From 2c663c945afd55bdf3993943ec357c7c69ff07f4 Mon Sep 17 00:00:00 2001 From: Kudlaty Date: Sun, 16 Aug 2009 15:49:51 +0200 Subject: Merge [SD2] r1302 Create folder structure for sorting instance by continent and move empty folders. - skip r1303 Start move source files to new folders, sorted by continent. --HG-- branch : trunk --- src/bindings/scripts/system/ScriptLoader.cpp | 634 ++++++++++++--------------- 1 file changed, 281 insertions(+), 353 deletions(-) (limited to 'src/bindings/scripts/system/ScriptLoader.cpp') diff --git a/src/bindings/scripts/system/ScriptLoader.cpp b/src/bindings/scripts/system/ScriptLoader.cpp index 8d2e4466a41..49d2aa8bb7e 100644 --- a/src/bindings/scripts/system/ScriptLoader.cpp +++ b/src/bindings/scripts/system/ScriptLoader.cpp @@ -26,7 +26,144 @@ extern void AddSC_npcs_special(); extern void AddSC_npc_taxi(); //eastern kingdoms -extern void AddSC_the_scarlet_enclave(); +extern void AddSC_blackrock_depths(); //Blackrock Depths +extern void AddSC_boss_ambassador_flamelash(); +extern void AddSC_boss_anubshiah(); +extern void AddSC_boss_draganthaurissan(); +extern void AddSC_boss_general_angerforge(); +extern void AddSC_boss_gorosh_the_dervish(); +extern void AddSC_boss_grizzle(); +extern void AddSC_boss_high_interrogator_gerstahn(); +extern void AddSC_boss_magmus(); +extern void AddSC_boss_moira_bronzebeard(); +extern void AddSC_boss_tomb_of_seven(); +extern void AddSC_instance_blackrock_depths(); +extern void AddSC_boss_drakkisath(); //Blackrock Spire +extern void AddSC_boss_halycon(); +extern void AddSC_boss_highlordomokk(); +extern void AddSC_boss_mothersmolderweb(); +extern void AddSC_boss_overlordwyrmthalak(); +extern void AddSC_boss_shadowvosh(); +extern void AddSC_boss_thebeast(); +extern void AddSC_boss_warmastervoone(); +extern void AddSC_boss_quatermasterzigris(); +extern void AddSC_boss_pyroguard_emberseer(); +extern void AddSC_boss_gyth(); +extern void AddSC_boss_rend_blackhand(); +extern void AddSC_boss_razorgore(); //Blackwing lair +extern void AddSC_boss_vael(); +extern void AddSC_boss_broodlord(); +extern void AddSC_boss_firemaw(); +extern void AddSC_boss_ebonroc(); +extern void AddSC_boss_flamegor(); +extern void AddSC_boss_chromaggus(); +extern void AddSC_boss_nefarian(); +extern void AddSC_boss_victor_nefarius(); +extern void AddSC_instance_deadmines(); //Deadmines +extern void AddSC_boss_attumen(); //Karazhan +extern void AddSC_boss_curator(); +extern void AddSC_boss_maiden_of_virtue(); +extern void AddSC_boss_shade_of_aran(); +extern void AddSC_boss_malchezaar(); +extern void AddSC_boss_terestian_illhoof(); +extern void AddSC_boss_moroes(); +extern void AddSC_bosses_opera(); +extern void AddSC_boss_netherspite(); +extern void AddSC_instance_karazhan(); +extern void AddSC_karazhan(); +extern void AddSC_boss_nightbane(); +extern void AddSC_boss_felblood_kaelthas(); // Magister's Terrace +extern void AddSC_boss_selin_fireheart(); +extern void AddSC_boss_vexallus(); +extern void AddSC_boss_priestess_delrissa(); +extern void AddSC_instance_magisters_terrace(); +extern void AddSC_magisters_terrace(); +extern void AddSC_boss_lucifron(); //Molten core +extern void AddSC_boss_magmadar(); +extern void AddSC_boss_gehennas(); +extern void AddSC_boss_garr(); +extern void AddSC_boss_baron_geddon(); +extern void AddSC_boss_shazzrah(); +extern void AddSC_boss_golemagg(); +extern void AddSC_boss_sulfuron(); +extern void AddSC_boss_majordomo(); +extern void AddSC_boss_ragnaros(); +extern void AddSC_instance_molten_core(); +extern void AddSC_molten_core(); +extern void AddSC_the_scarlet_enclave(); //Scarlet Enclave +extern void AddSC_boss_arcanist_doan(); //Scarlet Monastery +extern void AddSC_boss_azshir_the_sleepless(); +extern void AddSC_boss_bloodmage_thalnos(); +extern void AddSC_boss_headless_horseman(); +extern void AddSC_boss_herod(); +extern void AddSC_boss_high_inquisitor_fairbanks(); +extern void AddSC_boss_houndmaster_loksey(); +extern void AddSC_boss_interrogator_vishas(); +extern void AddSC_boss_scorn(); +extern void AddSC_instance_scarlet_monastery(); +extern void AddSC_boss_mograine_and_whitemane(); +extern void AddSC_boss_darkmaster_gandling(); //Scholomance +extern void AddSC_boss_death_knight_darkreaver(); +extern void AddSC_boss_theolenkrastinov(); +extern void AddSC_boss_illuciabarov(); +extern void AddSC_boss_instructormalicia(); +extern void AddSC_boss_jandicebarov(); +extern void AddSC_boss_kormok(); +extern void AddSC_boss_lordalexeibarov(); +extern void AddSC_boss_lorekeeperpolkelt(); +extern void AddSC_boss_rasfrost(); +extern void AddSC_boss_theravenian(); +extern void AddSC_boss_vectus(); +extern void AddSC_instance_scholomance(); +extern void AddSC_shadowfang_keep(); //Shadowfang keep +extern void AddSC_instance_shadowfang_keep(); +extern void AddSC_boss_magistrate_barthilas(); //Stratholme +extern void AddSC_boss_maleki_the_pallid(); +extern void AddSC_boss_nerubenkan(); +extern void AddSC_boss_cannon_master_willey(); +extern void AddSC_boss_baroness_anastari(); +extern void AddSC_boss_ramstein_the_gorger(); +extern void AddSC_boss_timmy_the_cruel(); +extern void AddSC_boss_postmaster_malown(); +extern void AddSC_boss_baron_rivendare(); +extern void AddSC_boss_dathrohan_balnazzar(); +extern void AddSC_boss_order_of_silver_hand(); +extern void AddSC_instance_stratholme(); +extern void AddSC_stratholme(); +extern void AddSC_instance_sunwell_plateau(); //Sunwell Plateau +extern void AddSC_boss_kalecgos(); +extern void AddSC_boss_brutallus(); +extern void AddSC_boss_felmyst(); +extern void AddSC_boss_eredar_twins(); +extern void AddSC_boss_muru(); +extern void AddSC_boss_kiljaeden(); +extern void AddSC_sunwell_plateau(); +extern void AddSC_boss_archaedas(); //Uldaman +extern void AddSC_boss_ironaya(); +extern void AddSC_uldaman(); +extern void AddSC_instance_uldaman(); +extern void AddSC_boss_akilzon(); //Zul'Aman +extern void AddSC_boss_halazzi(); +extern void AddSC_boss_hex_lord_malacrass(); +extern void AddSC_boss_janalai(); +extern void AddSC_boss_nalorakk(); +extern void AddSC_boss_zuljin(); +extern void AddSC_instance_zulaman(); +extern void AddSC_zulaman(); +extern void AddSC_boss_jeklik(); //Zul'Gurub +extern void AddSC_boss_venoxis(); +extern void AddSC_boss_marli(); +extern void AddSC_boss_mandokir(); +extern void AddSC_boss_gahzranka(); +extern void AddSC_boss_thekal(); +extern void AddSC_boss_arlokk(); +extern void AddSC_boss_jindo(); +extern void AddSC_boss_hakkar(); +extern void AddSC_boss_grilek(); +extern void AddSC_boss_hazzarah(); +extern void AddSC_boss_renataki(); +extern void AddSC_boss_wushoolay(); +extern void AddSC_instance_zulgurub(); //extern void AddSC_alterac_mountains(); extern void AddSC_arathi_highlands(); extern void AddSC_blasted_lands(); @@ -138,45 +275,6 @@ extern void AddSC_instance_black_temple(); //Blackfathom Depths extern void AddSC_instance_blackfathom_deeps(); -//Blackrock Depths -extern void AddSC_blackrock_depths(); -extern void AddSC_boss_ambassador_flamelash(); -extern void AddSC_boss_anubshiah(); -extern void AddSC_boss_draganthaurissan(); -extern void AddSC_boss_general_angerforge(); -extern void AddSC_boss_gorosh_the_dervish(); -extern void AddSC_boss_grizzle(); -extern void AddSC_boss_high_interrogator_gerstahn(); -extern void AddSC_boss_magmus(); -extern void AddSC_boss_moira_bronzebeard(); -extern void AddSC_boss_tomb_of_seven(); -extern void AddSC_instance_blackrock_depths(); - -//Blackrock Spire -extern void AddSC_boss_drakkisath(); -extern void AddSC_boss_halycon(); -extern void AddSC_boss_highlordomokk(); -extern void AddSC_boss_mothersmolderweb(); -extern void AddSC_boss_overlordwyrmthalak(); -extern void AddSC_boss_shadowvosh(); -extern void AddSC_boss_thebeast(); -extern void AddSC_boss_warmastervoone(); -extern void AddSC_boss_quatermasterzigris(); -extern void AddSC_boss_pyroguard_emberseer(); -extern void AddSC_boss_gyth(); -extern void AddSC_boss_rend_blackhand(); - -//Blackwing lair -extern void AddSC_boss_razorgore(); -extern void AddSC_boss_vael(); -extern void AddSC_boss_broodlord(); -extern void AddSC_boss_firemaw(); -extern void AddSC_boss_ebonroc(); -extern void AddSC_boss_flamegor(); -extern void AddSC_boss_chromaggus(); -extern void AddSC_boss_nefarian(); -extern void AddSC_boss_victor_nefarius(); - //Caverns of Time //--Battle for Mt. Hyjal extern void AddSC_hyjal(); @@ -224,9 +322,6 @@ extern void AddSC_instance_steam_vault(); extern void AddSC_boss_hungarfen(); extern void AddSC_boss_the_black_stalker(); -//Deadmines -extern void AddSC_instance_deadmines(); - //Gruul's Lair extern void AddSC_boss_gruul(); extern void AddSC_boss_high_king_maulgar(); @@ -255,50 +350,12 @@ extern void AddSC_boss_omor_the_unscarred(); extern void AddSC_boss_vazruden_the_herald(); extern void AddSC_instance_ramparts(); -//Karazhan -extern void AddSC_boss_attumen(); -extern void AddSC_boss_curator(); -extern void AddSC_boss_maiden_of_virtue(); -extern void AddSC_boss_shade_of_aran(); -extern void AddSC_boss_malchezaar(); -extern void AddSC_boss_terestian_illhoof(); -extern void AddSC_boss_moroes(); -extern void AddSC_bosses_opera(); -extern void AddSC_boss_netherspite(); -extern void AddSC_instance_karazhan(); -extern void AddSC_karazhan(); -extern void AddSC_boss_nightbane(); - -//Lower Blackrock Spire - -// Magister's Terrace -extern void AddSC_boss_felblood_kaelthas(); -extern void AddSC_boss_selin_fireheart(); -extern void AddSC_boss_vexallus(); -extern void AddSC_boss_priestess_delrissa(); -extern void AddSC_instance_magisters_terrace(); -extern void AddSC_magisters_terrace(); - //Maraudon extern void AddSC_boss_celebras_the_cursed(); extern void AddSC_boss_landslide(); extern void AddSC_boss_noxxion(); extern void AddSC_boss_ptheradras(); -//Molten core -extern void AddSC_boss_lucifron(); -extern void AddSC_boss_magmadar(); -extern void AddSC_boss_gehennas(); -extern void AddSC_boss_garr(); -extern void AddSC_boss_baron_geddon(); -extern void AddSC_boss_shazzrah(); -extern void AddSC_boss_golemagg(); -extern void AddSC_boss_sulfuron(); -extern void AddSC_boss_majordomo(); -extern void AddSC_boss_ragnaros(); -extern void AddSC_instance_molten_core(); -extern void AddSC_molten_core(); - //Naxxramas extern void AddSC_boss_anubrekhan(); extern void AddSC_boss_maexxna(); @@ -344,67 +401,6 @@ extern void AddSC_razorfen_downs(); //Razorfen Kraul extern void AddSC_razorfen_kraul(); -//Ruins of Ahn'Qiraj -//Scarlet Monastery -extern void AddSC_boss_arcanist_doan(); -extern void AddSC_boss_azshir_the_sleepless(); -extern void AddSC_boss_bloodmage_thalnos(); -extern void AddSC_boss_headless_horseman(); -extern void AddSC_boss_herod(); -extern void AddSC_boss_high_inquisitor_fairbanks(); -extern void AddSC_boss_houndmaster_loksey(); -extern void AddSC_boss_interrogator_vishas(); -extern void AddSC_boss_scorn(); -extern void AddSC_instance_scarlet_monastery(); -extern void AddSC_boss_mograine_and_whitemane(); - -//Scholomance -extern void AddSC_boss_darkmaster_gandling(); -extern void AddSC_boss_death_knight_darkreaver(); -extern void AddSC_boss_theolenkrastinov(); -extern void AddSC_boss_illuciabarov(); -extern void AddSC_boss_instructormalicia(); -extern void AddSC_boss_jandicebarov(); -extern void AddSC_boss_kormok(); -extern void AddSC_boss_lordalexeibarov(); -extern void AddSC_boss_lorekeeperpolkelt(); -extern void AddSC_boss_rasfrost(); -extern void AddSC_boss_theravenian(); -extern void AddSC_boss_vectus(); -extern void AddSC_instance_scholomance(); - -//Shadowfang keep -extern void AddSC_shadowfang_keep(); -extern void AddSC_instance_shadowfang_keep(); - -//Stratholme -extern void AddSC_boss_magistrate_barthilas(); -extern void AddSC_boss_maleki_the_pallid(); -extern void AddSC_boss_nerubenkan(); -extern void AddSC_boss_cannon_master_willey(); -extern void AddSC_boss_baroness_anastari(); -extern void AddSC_boss_ramstein_the_gorger(); -extern void AddSC_boss_timmy_the_cruel(); -extern void AddSC_boss_postmaster_malown(); -extern void AddSC_boss_baron_rivendare(); -extern void AddSC_boss_dathrohan_balnazzar(); -extern void AddSC_boss_order_of_silver_hand(); -extern void AddSC_instance_stratholme(); -extern void AddSC_stratholme(); - -//Sunken Temple -//Sunwell Plateau -extern void AddSC_instance_sunwell_plateau(); -extern void AddSC_boss_kalecgos(); -extern void AddSC_boss_brutallus(); -extern void AddSC_boss_felmyst(); -extern void AddSC_boss_eredar_twins(); -extern void AddSC_boss_muru(); -extern void AddSC_boss_kiljaeden(); -extern void AddSC_sunwell_plateau(); - -//Tanaris - //Tempest Keep //--Arcatraz extern void AddSC_arcatraz(); @@ -441,12 +437,6 @@ extern void AddSC_boss_twinemperors(); extern void AddSC_mob_anubisath_sentinel(); extern void AddSC_instance_temple_of_ahnqiraj(); -//Uldaman -extern void AddSC_boss_archaedas(); -extern void AddSC_boss_ironaya(); -extern void AddSC_uldaman(); -extern void AddSC_instance_uldaman(); - //Ulduar extern void AddSC_boss_auriaya(); extern void AddSC_boss_flame_leviathan(); @@ -474,36 +464,10 @@ extern void AddSC_instance_wailing_caverns(); //Zul'Farrak extern void AddSC_zulfarrak(); -//Zul'Gurub -extern void AddSC_boss_jeklik(); -extern void AddSC_boss_venoxis(); -extern void AddSC_boss_marli(); -extern void AddSC_boss_mandokir(); -extern void AddSC_boss_gahzranka(); -extern void AddSC_boss_thekal(); -extern void AddSC_boss_arlokk(); -extern void AddSC_boss_jindo(); -extern void AddSC_boss_hakkar(); -extern void AddSC_boss_grilek(); -extern void AddSC_boss_hazzarah(); -extern void AddSC_boss_renataki(); -extern void AddSC_boss_wushoolay(); -extern void AddSC_instance_zulgurub(); - -//Zul'Aman -extern void AddSC_boss_akilzon(); -extern void AddSC_boss_halazzi(); -extern void AddSC_boss_hex_lord_malacrass(); -extern void AddSC_boss_janalai(); -extern void AddSC_boss_nalorakk(); -extern void AddSC_boss_zuljin(); -extern void AddSC_instance_zulaman(); -extern void AddSC_zulaman(); - -//Vault of Archavon -extern void AddSC_boss_archavon(); -extern void AddSC_boss_emalon(); -extern void AddSC_instance_archavon(); +//Vault of Archavon +extern void AddSC_boss_archavon(); +extern void AddSC_boss_emalon(); +extern void AddSC_instance_archavon(); //Halls of Lightning extern void AddSC_boss_bjarngrim(); @@ -537,7 +501,144 @@ void AddScripts() AddSC_npc_taxi(); //eastern kingdoms - AddSC_the_scarlet_enclave(); + AddSC_blackrock_depths(); //Blackrock Depths + AddSC_boss_ambassador_flamelash(); + AddSC_boss_anubshiah(); + AddSC_boss_draganthaurissan(); + AddSC_boss_general_angerforge(); + AddSC_boss_gorosh_the_dervish(); + AddSC_boss_grizzle(); + AddSC_boss_high_interrogator_gerstahn(); + AddSC_boss_magmus(); + AddSC_boss_moira_bronzebeard(); + AddSC_boss_tomb_of_seven(); + AddSC_instance_blackrock_depths(); + AddSC_boss_drakkisath(); //Blackrock Spire + AddSC_boss_halycon(); + AddSC_boss_highlordomokk(); + AddSC_boss_mothersmolderweb(); + AddSC_boss_overlordwyrmthalak(); + AddSC_boss_shadowvosh(); + AddSC_boss_thebeast(); + AddSC_boss_warmastervoone(); + AddSC_boss_quatermasterzigris(); + AddSC_boss_pyroguard_emberseer(); + AddSC_boss_gyth(); + AddSC_boss_rend_blackhand(); + AddSC_boss_razorgore(); //Blackwing lair + AddSC_boss_vael(); + AddSC_boss_broodlord(); + AddSC_boss_firemaw(); + AddSC_boss_ebonroc(); + AddSC_boss_flamegor(); + AddSC_boss_chromaggus(); + AddSC_boss_nefarian(); + AddSC_boss_victor_nefarius(); + AddSC_instance_deadmines(); //Deadmines + AddSC_boss_attumen(); //Karazhan + AddSC_boss_curator(); + AddSC_boss_maiden_of_virtue(); + AddSC_boss_shade_of_aran(); + AddSC_boss_malchezaar(); + AddSC_boss_terestian_illhoof(); + AddSC_boss_moroes(); + AddSC_bosses_opera(); + AddSC_boss_netherspite(); + AddSC_instance_karazhan(); + AddSC_karazhan(); + AddSC_boss_nightbane(); + AddSC_boss_felblood_kaelthas(); // Magister's Terrace + AddSC_boss_selin_fireheart(); + AddSC_boss_vexallus(); + AddSC_boss_priestess_delrissa(); + AddSC_instance_magisters_terrace(); + AddSC_magisters_terrace(); + AddSC_boss_lucifron(); //Molten core + AddSC_boss_magmadar(); + AddSC_boss_gehennas(); + AddSC_boss_garr(); + AddSC_boss_baron_geddon(); + AddSC_boss_shazzrah(); + AddSC_boss_golemagg(); + AddSC_boss_sulfuron(); + AddSC_boss_majordomo(); + AddSC_boss_ragnaros(); + AddSC_instance_molten_core(); + AddSC_molten_core(); + AddSC_the_scarlet_enclave(); //Scarlet Enclave + AddSC_boss_arcanist_doan(); //Scarlet Monastery + AddSC_boss_azshir_the_sleepless(); + AddSC_boss_bloodmage_thalnos(); + AddSC_boss_headless_horseman(); + AddSC_boss_herod(); + AddSC_boss_high_inquisitor_fairbanks(); + AddSC_boss_houndmaster_loksey(); + AddSC_boss_interrogator_vishas(); + AddSC_boss_scorn(); + AddSC_instance_scarlet_monastery(); + AddSC_boss_mograine_and_whitemane(); + AddSC_boss_darkmaster_gandling(); //Scholomance + AddSC_boss_death_knight_darkreaver(); + AddSC_boss_theolenkrastinov(); + AddSC_boss_illuciabarov(); + AddSC_boss_instructormalicia(); + AddSC_boss_jandicebarov(); + AddSC_boss_kormok(); + AddSC_boss_lordalexeibarov(); + AddSC_boss_lorekeeperpolkelt(); + AddSC_boss_rasfrost(); + AddSC_boss_theravenian(); + AddSC_boss_vectus(); + AddSC_instance_scholomance(); + AddSC_shadowfang_keep(); //Shadowfang keep + AddSC_instance_shadowfang_keep(); + AddSC_boss_magistrate_barthilas(); //Stratholme + AddSC_boss_maleki_the_pallid(); + AddSC_boss_nerubenkan(); + AddSC_boss_cannon_master_willey(); + AddSC_boss_baroness_anastari(); + AddSC_boss_ramstein_the_gorger(); + AddSC_boss_timmy_the_cruel(); + AddSC_boss_postmaster_malown(); + AddSC_boss_baron_rivendare(); + AddSC_boss_dathrohan_balnazzar(); + AddSC_boss_order_of_silver_hand(); + AddSC_instance_stratholme(); + AddSC_stratholme(); + AddSC_instance_sunwell_plateau(); //Sunwell Plateau + AddSC_boss_kalecgos(); + AddSC_boss_brutallus(); + AddSC_boss_felmyst(); + AddSC_boss_eredar_twins(); + AddSC_boss_muru(); + AddSC_boss_kiljaeden(); + AddSC_sunwell_plateau(); + AddSC_boss_archaedas(); //Uldaman + AddSC_boss_ironaya(); + AddSC_uldaman(); + AddSC_instance_uldaman(); + AddSC_boss_akilzon(); //Zul'Aman + AddSC_boss_halazzi(); + AddSC_boss_hex_lord_malacrass(); + AddSC_boss_janalai(); + AddSC_boss_nalorakk(); + AddSC_boss_zuljin(); + AddSC_instance_zulaman(); + AddSC_zulaman(); + AddSC_boss_jeklik(); //Zul'Gurub + AddSC_boss_venoxis(); + AddSC_boss_marli(); + AddSC_boss_mandokir(); + AddSC_boss_gahzranka(); + AddSC_boss_thekal(); + AddSC_boss_arlokk(); + AddSC_boss_jindo(); + AddSC_boss_hakkar(); + AddSC_boss_grilek(); + AddSC_boss_hazzarah(); + AddSC_boss_renataki(); + AddSC_boss_wushoolay(); + AddSC_instance_zulgurub(); //AddSC_alterac_mountains(); AddSC_arathi_highlands(); AddSC_blasted_lands(); @@ -649,45 +750,6 @@ void AddScripts() //Blackfathom Depths AddSC_instance_blackfathom_deeps(); - //Blackrock Depths - AddSC_blackrock_depths(); - AddSC_boss_ambassador_flamelash(); - AddSC_boss_anubshiah(); - AddSC_boss_draganthaurissan(); - AddSC_boss_general_angerforge(); - AddSC_boss_gorosh_the_dervish(); - AddSC_boss_grizzle(); - AddSC_boss_high_interrogator_gerstahn(); - AddSC_boss_magmus(); - AddSC_boss_moira_bronzebeard(); - AddSC_boss_tomb_of_seven(); - AddSC_instance_blackrock_depths(); - - //Blackrock Spire - AddSC_boss_drakkisath(); - AddSC_boss_halycon(); - AddSC_boss_highlordomokk(); - AddSC_boss_mothersmolderweb(); - AddSC_boss_overlordwyrmthalak(); - AddSC_boss_shadowvosh(); - AddSC_boss_thebeast(); - AddSC_boss_warmastervoone(); - AddSC_boss_quatermasterzigris(); - AddSC_boss_pyroguard_emberseer(); - AddSC_boss_gyth(); - AddSC_boss_rend_blackhand(); - - //Blackwing lair - AddSC_boss_razorgore(); - AddSC_boss_vael(); - AddSC_boss_broodlord(); - AddSC_boss_firemaw(); - AddSC_boss_ebonroc(); - AddSC_boss_flamegor(); - AddSC_boss_chromaggus(); - AddSC_boss_nefarian(); - AddSC_boss_victor_nefarius(); - //Caverns of Time //--Battle for Mt. Hyjal AddSC_hyjal(); @@ -735,9 +797,6 @@ void AddScripts() AddSC_boss_hungarfen(); AddSC_boss_the_black_stalker(); - //Deadmines - AddSC_instance_deadmines(); - //Gruul's Lair AddSC_boss_gruul(); AddSC_boss_high_king_maulgar(); @@ -766,50 +825,12 @@ void AddScripts() AddSC_boss_vazruden_the_herald(); AddSC_instance_ramparts(); - //Karazhan - AddSC_boss_attumen(); - AddSC_boss_curator(); - AddSC_boss_maiden_of_virtue(); - AddSC_boss_shade_of_aran(); - AddSC_boss_malchezaar(); - AddSC_boss_terestian_illhoof(); - AddSC_boss_moroes(); - AddSC_bosses_opera(); - AddSC_boss_netherspite(); - AddSC_instance_karazhan(); - AddSC_karazhan(); - AddSC_boss_nightbane(); - - //Lower Blackrock Spire - - // Magister's Terrace - AddSC_boss_felblood_kaelthas(); - AddSC_boss_selin_fireheart(); - AddSC_boss_vexallus(); - AddSC_boss_priestess_delrissa(); - AddSC_instance_magisters_terrace(); - AddSC_magisters_terrace(); - //Maraudon AddSC_boss_celebras_the_cursed(); AddSC_boss_landslide(); AddSC_boss_noxxion(); AddSC_boss_ptheradras(); - //Molten core - AddSC_boss_lucifron(); - AddSC_boss_magmadar(); - AddSC_boss_gehennas(); - AddSC_boss_garr(); - AddSC_boss_baron_geddon(); - AddSC_boss_shazzrah(); - AddSC_boss_golemagg(); - AddSC_boss_sulfuron(); - AddSC_boss_majordomo(); - AddSC_boss_ragnaros(); - AddSC_instance_molten_core(); - AddSC_molten_core(); - //Naxxramas AddSC_boss_anubrekhan(); AddSC_boss_maexxna(); @@ -855,67 +876,6 @@ void AddScripts() //Razorfen Kraul AddSC_razorfen_kraul(); - //Ruins of Ahn'Qiraj - //Scarlet Monastery - AddSC_boss_arcanist_doan(); - AddSC_boss_azshir_the_sleepless(); - AddSC_boss_bloodmage_thalnos(); - AddSC_boss_headless_horseman(); - AddSC_boss_herod(); - AddSC_boss_high_inquisitor_fairbanks(); - AddSC_boss_houndmaster_loksey(); - AddSC_boss_interrogator_vishas(); - AddSC_boss_scorn(); - AddSC_instance_scarlet_monastery(); - AddSC_boss_mograine_and_whitemane(); - - //Scholomance - AddSC_boss_darkmaster_gandling(); - AddSC_boss_death_knight_darkreaver(); - AddSC_boss_theolenkrastinov(); - AddSC_boss_illuciabarov(); - AddSC_boss_instructormalicia(); - AddSC_boss_jandicebarov(); - AddSC_boss_kormok(); - AddSC_boss_lordalexeibarov(); - AddSC_boss_lorekeeperpolkelt(); - AddSC_boss_rasfrost(); - AddSC_boss_theravenian(); - AddSC_boss_vectus(); - AddSC_instance_scholomance(); - - //Shadowfang keep - AddSC_shadowfang_keep(); - AddSC_instance_shadowfang_keep(); - - //Stratholme - AddSC_boss_magistrate_barthilas(); - AddSC_boss_maleki_the_pallid(); - AddSC_boss_nerubenkan(); - AddSC_boss_cannon_master_willey(); - AddSC_boss_baroness_anastari(); - AddSC_boss_ramstein_the_gorger(); - AddSC_boss_timmy_the_cruel(); - AddSC_boss_postmaster_malown(); - AddSC_boss_baron_rivendare(); - AddSC_boss_dathrohan_balnazzar(); - AddSC_boss_order_of_silver_hand(); - AddSC_instance_stratholme(); - AddSC_stratholme(); - - //Sunken Temple - //Sunwell Plateau - AddSC_instance_sunwell_plateau(); - AddSC_boss_kalecgos(); - AddSC_boss_brutallus(); - AddSC_boss_felmyst(); - AddSC_boss_eredar_twins(); - AddSC_boss_muru(); - AddSC_boss_kiljaeden(); - AddSC_sunwell_plateau(); - - //Tanaris - //Tempest Keep //--Arcatraz AddSC_arcatraz(); @@ -952,19 +912,13 @@ void AddScripts() AddSC_mob_anubisath_sentinel(); AddSC_instance_temple_of_ahnqiraj(); - //Uldaman - AddSC_boss_archaedas(); - AddSC_boss_ironaya(); - AddSC_uldaman(); - AddSC_instance_uldaman(); - //Ulduar AddSC_boss_auriaya(); AddSC_boss_flame_leviathan(); AddSC_boss_ignis(); AddSC_boss_razorscale(); AddSC_boss_xt002(); - // AddSC_instance_ulduar(); + //AddSC_instance_ulduar(); //Un'Goro Crater AddSC_ungoro_crater(); @@ -985,32 +939,6 @@ void AddScripts() //Zul'Farrak AddSC_zulfarrak(); - //Zul'Gurub - AddSC_boss_jeklik(); - AddSC_boss_venoxis(); - AddSC_boss_marli(); - AddSC_boss_mandokir(); - AddSC_boss_gahzranka(); - AddSC_boss_thekal(); - AddSC_boss_arlokk(); - AddSC_boss_jindo(); - AddSC_boss_hakkar(); - AddSC_boss_grilek(); - AddSC_boss_hazzarah(); - AddSC_boss_renataki(); - AddSC_boss_wushoolay(); - AddSC_instance_zulgurub(); - - //Zul'Aman - AddSC_boss_akilzon(); - AddSC_boss_halazzi(); - AddSC_boss_hex_lord_malacrass(); - AddSC_boss_janalai(); - AddSC_boss_nalorakk(); - AddSC_boss_zuljin(); - AddSC_instance_zulaman(); - AddSC_zulaman(); - //Vault of Archavon AddSC_boss_archavon(); AddSC_boss_emalon(); -- cgit v1.2.3 From 6e9ee95bb7f6ef79b9e7a3d8e869c2e5217b3fa3 Mon Sep 17 00:00:00 2001 From: Kudlaty Date: Sun, 16 Aug 2009 16:29:41 +0200 Subject: Merge [SD2] r1304 Move source files to continent folder, part 2 --HG-- branch : trunk --- src/bindings/scripts/CMakeLists.txt | 132 +- src/bindings/scripts/VC80/80ScriptDev2.vcproj | 653 +++++---- src/bindings/scripts/VC90/90ScriptDev2.vcproj | 1358 +++++++++++++++++- .../blackfathom_depths/def_blackfathom_deeps.h | 23 + .../instance_blackfathom_deeps.cpp | 145 ++ .../culling_of_stratholme/boss_epoch.cpp | 86 ++ .../culling_of_stratholme/boss_mal_ganis.cpp | 123 ++ .../culling_of_stratholme/boss_meathook.cpp | 138 ++ .../culling_of_stratholme/boss_salramm.cpp | 155 +++ .../def_culling_of_stratholme.h | 4 + .../instance_culling_of_stratholme.cpp | 21 + .../caverns_of_time/dark_portal/boss_aeonus.cpp | 151 ++ .../dark_portal/boss_chrono_lord_deja.cpp | 160 +++ .../caverns_of_time/dark_portal/boss_temporus.cpp | 158 +++ .../caverns_of_time/dark_portal/dark_portal.cpp | 409 ++++++ .../caverns_of_time/dark_portal/def_dark_portal.h | 35 + .../dark_portal/instance_dark_portal.cpp | 351 +++++ .../caverns_of_time/hyjal/boss_anetheron.cpp | 312 +++++ .../caverns_of_time/hyjal/boss_archimonde.cpp | 640 +++++++++ .../caverns_of_time/hyjal/boss_azgalor.cpp | 288 ++++ .../caverns_of_time/hyjal/boss_kazrogal.cpp | 197 +++ .../hyjal/boss_rage_winterchill.cpp | 192 +++ .../kalimdor/caverns_of_time/hyjal/def_hyjal.h | 38 + .../kalimdor/caverns_of_time/hyjal/hyjal.cpp | 246 ++++ .../kalimdor/caverns_of_time/hyjal/hyjalAI.cpp | 1159 ++++++++++++++++ .../kalimdor/caverns_of_time/hyjal/hyjalAI.h | 248 ++++ .../kalimdor/caverns_of_time/hyjal/hyjal_trash.cpp | 1453 ++++++++++++++++++++ .../kalimdor/caverns_of_time/hyjal/hyjal_trash.h | 35 + .../caverns_of_time/hyjal/instance_hyjal.cpp | 322 +++++ .../old_hillsbrad/boss_captain_skarloc.cpp | 156 +++ .../old_hillsbrad/boss_epoch_hunter.cpp | 150 ++ .../old_hillsbrad/boss_leutenant_drake.cpp | 194 +++ .../old_hillsbrad/def_old_hillsbrad.h | 19 + .../old_hillsbrad/instance_old_hillsbrad.cpp | 238 ++++ .../old_hillsbrad/old_hillsbrad.cpp | 682 +++++++++ .../kalimdor/maraudon/boss_celebras_the_cursed.cpp | 98 ++ .../scripts/kalimdor/maraudon/boss_landslide.cpp | 95 ++ .../scripts/kalimdor/maraudon/boss_noxxion.cpp | 150 ++ .../kalimdor/maraudon/boss_princess_theradras.cpp | 109 ++ .../scripts/kalimdor/onyxias_lair/boss_onyxia.cpp | 307 +++++ .../boss_amnennar_the_coldbringer.cpp | 130 ++ .../kalimdor/razorfen_downs/razorfen_downs.cpp | 85 ++ .../kalimdor/razorfen_kraul/def_razorfen_kraul.h | 21 + .../razorfen_kraul/instance_razorfen_kraul.cpp | 105 ++ .../kalimdor/razorfen_kraul/razorfen_kraul.cpp | 252 ++++ .../kalimdor/ruins_of_ahnqiraj/boss_ayamiss.cpp | 108 ++ .../kalimdor/ruins_of_ahnqiraj/boss_buru.cpp | 27 + .../kalimdor/ruins_of_ahnqiraj/boss_kurinnaxx.cpp | 94 ++ .../kalimdor/ruins_of_ahnqiraj/boss_moam.cpp | 120 ++ .../kalimdor/ruins_of_ahnqiraj/boss_ossirian.cpp | 38 + .../kalimdor/ruins_of_ahnqiraj/boss_rajaxx.cpp | 45 + .../instance_ruins_of_ahnqiraj.cpp | 25 + .../kalimdor/temple_of_ahnqiraj/boss_bug_trio.cpp | 346 +++++ .../kalimdor/temple_of_ahnqiraj/boss_cthun.cpp | 1335 ++++++++++++++++++ .../kalimdor/temple_of_ahnqiraj/boss_fankriss.cpp | 206 +++ .../kalimdor/temple_of_ahnqiraj/boss_huhuran.cpp | 148 ++ .../kalimdor/temple_of_ahnqiraj/boss_ouro.cpp | 140 ++ .../kalimdor/temple_of_ahnqiraj/boss_sartura.cpp | 298 ++++ .../kalimdor/temple_of_ahnqiraj/boss_skeram.cpp | 316 +++++ .../temple_of_ahnqiraj/boss_twinemperors.cpp | 618 +++++++++ .../kalimdor/temple_of_ahnqiraj/boss_viscidus.cpp | 30 + .../temple_of_ahnqiraj/def_temple_of_ahnqiraj.h | 23 + .../instance_temple_of_ahnqiraj.cpp | 166 +++ .../temple_of_ahnqiraj/mob_anubisath_sentinel.cpp | 318 +++++ .../scripts/scripts/kalimdor/ungoro_crater.cpp | 210 +++ .../kalimdor/wailing_caverns/def_wailing_caverns.h | 24 + .../wailing_caverns/instance_wailing_caverns.cpp | 142 ++ .../kalimdor/wailing_caverns/wailing_caverns.cpp | 411 ++++++ .../scripts/kalimdor/zulfarrak/zulfarrak.cpp | 223 +++ .../blackfathom_depths/def_blackfathom_deeps.h | 23 - .../instance_blackfathom_deeps.cpp | 145 -- .../culling_of_stratholme/boss_epoch.cpp | 86 -- .../culling_of_stratholme/boss_mal_ganis.cpp | 123 -- .../culling_of_stratholme/boss_meathook.cpp | 138 -- .../culling_of_stratholme/boss_salramm.cpp | 155 --- .../def_culling_of_stratholme.h | 4 - .../instance_culling_of_stratholme.cpp | 21 - .../caverns_of_time/dark_portal/boss_aeonus.cpp | 151 -- .../dark_portal/boss_chrono_lord_deja.cpp | 160 --- .../caverns_of_time/dark_portal/boss_temporus.cpp | 158 --- .../caverns_of_time/dark_portal/dark_portal.cpp | 409 ------ .../caverns_of_time/dark_portal/def_dark_portal.h | 35 - .../dark_portal/instance_dark_portal.cpp | 351 ----- .../zone/caverns_of_time/hyjal/boss_anetheron.cpp | 312 ----- .../zone/caverns_of_time/hyjal/boss_archimonde.cpp | 640 --------- .../zone/caverns_of_time/hyjal/boss_azgalor.cpp | 288 ---- .../zone/caverns_of_time/hyjal/boss_kazrogal.cpp | 197 --- .../hyjal/boss_rage_winterchill.cpp | 192 --- .../scripts/zone/caverns_of_time/hyjal/def_hyjal.h | 38 - .../scripts/zone/caverns_of_time/hyjal/hyjal.cpp | 246 ---- .../scripts/zone/caverns_of_time/hyjal/hyjalAI.cpp | 1159 ---------------- .../scripts/zone/caverns_of_time/hyjal/hyjalAI.h | 248 ---- .../zone/caverns_of_time/hyjal/hyjal_trash.cpp | 1453 -------------------- .../zone/caverns_of_time/hyjal/hyjal_trash.h | 35 - .../zone/caverns_of_time/hyjal/instance_hyjal.cpp | 322 ----- .../old_hillsbrad/boss_captain_skarloc.cpp | 156 --- .../old_hillsbrad/boss_epoch_hunter.cpp | 150 -- .../old_hillsbrad/boss_leutenant_drake.cpp | 194 --- .../old_hillsbrad/def_old_hillsbrad.h | 19 - .../old_hillsbrad/instance_old_hillsbrad.cpp | 238 ---- .../old_hillsbrad/old_hillsbrad.cpp | 682 --------- .../zone/maraudon/boss_celebras_the_cursed.cpp | 98 -- .../scripts/zone/maraudon/boss_landslide.cpp | 95 -- .../scripts/scripts/zone/maraudon/boss_noxxion.cpp | 150 -- .../zone/maraudon/boss_princess_theradras.cpp | 109 -- .../scripts/zone/onyxias_lair/boss_onyxia.cpp | 307 ----- .../boss_amnennar_the_coldbringer.cpp | 130 -- .../scripts/zone/razorfen_downs/razorfen_downs.cpp | 85 -- .../zone/razorfen_kraul/def_razorfen_kraul.h | 21 - .../razorfen_kraul/instance_razorfen_kraul.cpp | 105 -- .../scripts/zone/razorfen_kraul/razorfen_kraul.cpp | 252 ---- .../zone/ruins_of_ahnqiraj/boss_ayamiss.cpp | 108 -- .../scripts/zone/ruins_of_ahnqiraj/boss_buru.cpp | 27 - .../zone/ruins_of_ahnqiraj/boss_kurinnaxx.cpp | 94 -- .../scripts/zone/ruins_of_ahnqiraj/boss_moam.cpp | 120 -- .../zone/ruins_of_ahnqiraj/boss_ossirian.cpp | 38 - .../scripts/zone/ruins_of_ahnqiraj/boss_rajaxx.cpp | 45 - .../instance_ruins_of_ahnqiraj.cpp | 25 - .../zone/temple_of_ahnqiraj/boss_bug_trio.cpp | 346 ----- .../scripts/zone/temple_of_ahnqiraj/boss_cthun.cpp | 1335 ------------------ .../zone/temple_of_ahnqiraj/boss_fankriss.cpp | 206 --- .../zone/temple_of_ahnqiraj/boss_huhuran.cpp | 148 -- .../scripts/zone/temple_of_ahnqiraj/boss_ouro.cpp | 140 -- .../zone/temple_of_ahnqiraj/boss_sartura.cpp | 298 ---- .../zone/temple_of_ahnqiraj/boss_skeram.cpp | 316 ----- .../zone/temple_of_ahnqiraj/boss_twinemperors.cpp | 618 --------- .../zone/temple_of_ahnqiraj/boss_viscidus.cpp | 30 - .../temple_of_ahnqiraj/def_temple_of_ahnqiraj.h | 23 - .../instance_temple_of_ahnqiraj.cpp | 166 --- .../temple_of_ahnqiraj/mob_anubisath_sentinel.cpp | 318 ----- .../scripts/zone/ungoro_crater/ungoro_crater.cpp | 210 --- .../zone/wailing_caverns/def_wailing_caverns.h | 24 - .../wailing_caverns/instance_wailing_caverns.cpp | 142 -- .../zone/wailing_caverns/wailing_caverns.cpp | 411 ------ .../scripts/scripts/zone/zulfarrak/zulfarrak.cpp | 223 --- src/bindings/scripts/system/ScriptLoader.cpp | 206 ++- 136 files changed, 17060 insertions(+), 15871 deletions(-) create mode 100644 src/bindings/scripts/scripts/kalimdor/blackfathom_depths/def_blackfathom_deeps.h create mode 100644 src/bindings/scripts/scripts/kalimdor/blackfathom_depths/instance_blackfathom_deeps.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_epoch.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_mal_ganis.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_meathook.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_salramm.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/caverns_of_time/culling_of_stratholme/def_culling_of_stratholme.h create mode 100644 src/bindings/scripts/scripts/kalimdor/caverns_of_time/culling_of_stratholme/instance_culling_of_stratholme.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/caverns_of_time/dark_portal/boss_aeonus.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/caverns_of_time/dark_portal/boss_chrono_lord_deja.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/caverns_of_time/dark_portal/boss_temporus.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/caverns_of_time/dark_portal/dark_portal.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/caverns_of_time/dark_portal/def_dark_portal.h create mode 100644 src/bindings/scripts/scripts/kalimdor/caverns_of_time/dark_portal/instance_dark_portal.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/boss_anetheron.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/boss_archimonde.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/boss_azgalor.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/boss_kazrogal.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/boss_rage_winterchill.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/def_hyjal.h create mode 100644 src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/hyjal.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/hyjalAI.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/hyjalAI.h create mode 100644 src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/hyjal_trash.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/hyjal_trash.h create mode 100644 src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/instance_hyjal.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/caverns_of_time/old_hillsbrad/boss_captain_skarloc.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/caverns_of_time/old_hillsbrad/boss_epoch_hunter.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/caverns_of_time/old_hillsbrad/boss_leutenant_drake.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/caverns_of_time/old_hillsbrad/def_old_hillsbrad.h create mode 100644 src/bindings/scripts/scripts/kalimdor/caverns_of_time/old_hillsbrad/instance_old_hillsbrad.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/caverns_of_time/old_hillsbrad/old_hillsbrad.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/maraudon/boss_celebras_the_cursed.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/maraudon/boss_landslide.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/maraudon/boss_noxxion.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/maraudon/boss_princess_theradras.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/onyxias_lair/boss_onyxia.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/razorfen_downs/boss_amnennar_the_coldbringer.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/razorfen_downs/razorfen_downs.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/razorfen_kraul/def_razorfen_kraul.h create mode 100644 src/bindings/scripts/scripts/kalimdor/razorfen_kraul/instance_razorfen_kraul.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/razorfen_kraul/razorfen_kraul.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/ruins_of_ahnqiraj/boss_ayamiss.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/ruins_of_ahnqiraj/boss_buru.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/ruins_of_ahnqiraj/boss_kurinnaxx.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/ruins_of_ahnqiraj/boss_moam.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/ruins_of_ahnqiraj/boss_ossirian.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/ruins_of_ahnqiraj/boss_rajaxx.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/ruins_of_ahnqiraj/instance_ruins_of_ahnqiraj.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_bug_trio.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_cthun.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_fankriss.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_huhuran.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_ouro.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_sartura.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_skeram.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_twinemperors.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_viscidus.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/def_temple_of_ahnqiraj.h create mode 100644 src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/instance_temple_of_ahnqiraj.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/mob_anubisath_sentinel.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/ungoro_crater.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/wailing_caverns/def_wailing_caverns.h create mode 100644 src/bindings/scripts/scripts/kalimdor/wailing_caverns/instance_wailing_caverns.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/wailing_caverns/wailing_caverns.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/zulfarrak/zulfarrak.cpp delete mode 100644 src/bindings/scripts/scripts/zone/blackfathom_depths/def_blackfathom_deeps.h delete mode 100644 src/bindings/scripts/scripts/zone/blackfathom_depths/instance_blackfathom_deeps.cpp delete mode 100644 src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/boss_epoch.cpp delete mode 100644 src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/boss_mal_ganis.cpp delete mode 100644 src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/boss_meathook.cpp delete mode 100644 src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/boss_salramm.cpp delete mode 100644 src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/def_culling_of_stratholme.h delete mode 100644 src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/instance_culling_of_stratholme.cpp delete mode 100644 src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_aeonus.cpp delete mode 100644 src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_chrono_lord_deja.cpp delete mode 100644 src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_temporus.cpp delete mode 100644 src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/dark_portal.cpp delete mode 100644 src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/def_dark_portal.h delete mode 100644 src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/instance_dark_portal.cpp delete mode 100644 src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_anetheron.cpp delete mode 100644 src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_archimonde.cpp delete mode 100644 src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_azgalor.cpp delete mode 100644 src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_kazrogal.cpp delete mode 100644 src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_rage_winterchill.cpp delete mode 100644 src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/def_hyjal.h delete mode 100644 src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal.cpp delete mode 100644 src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.cpp delete mode 100644 src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.h delete mode 100644 src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal_trash.cpp delete mode 100644 src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal_trash.h delete mode 100644 src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/instance_hyjal.cpp delete mode 100644 src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/boss_captain_skarloc.cpp delete mode 100644 src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/boss_epoch_hunter.cpp delete mode 100644 src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/boss_leutenant_drake.cpp delete mode 100644 src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/def_old_hillsbrad.h delete mode 100644 src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/instance_old_hillsbrad.cpp delete mode 100644 src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/old_hillsbrad.cpp delete mode 100644 src/bindings/scripts/scripts/zone/maraudon/boss_celebras_the_cursed.cpp delete mode 100644 src/bindings/scripts/scripts/zone/maraudon/boss_landslide.cpp delete mode 100644 src/bindings/scripts/scripts/zone/maraudon/boss_noxxion.cpp delete mode 100644 src/bindings/scripts/scripts/zone/maraudon/boss_princess_theradras.cpp delete mode 100644 src/bindings/scripts/scripts/zone/onyxias_lair/boss_onyxia.cpp delete mode 100644 src/bindings/scripts/scripts/zone/razorfen_downs/boss_amnennar_the_coldbringer.cpp delete mode 100644 src/bindings/scripts/scripts/zone/razorfen_downs/razorfen_downs.cpp delete mode 100644 src/bindings/scripts/scripts/zone/razorfen_kraul/def_razorfen_kraul.h delete mode 100644 src/bindings/scripts/scripts/zone/razorfen_kraul/instance_razorfen_kraul.cpp delete mode 100644 src/bindings/scripts/scripts/zone/razorfen_kraul/razorfen_kraul.cpp delete mode 100644 src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_ayamiss.cpp delete mode 100644 src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_buru.cpp delete mode 100644 src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_kurinnaxx.cpp delete mode 100644 src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_moam.cpp delete mode 100644 src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_ossirian.cpp delete mode 100644 src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_rajaxx.cpp delete mode 100644 src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/instance_ruins_of_ahnqiraj.cpp delete mode 100644 src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_bug_trio.cpp delete mode 100644 src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_cthun.cpp delete mode 100644 src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_fankriss.cpp delete mode 100644 src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_huhuran.cpp delete mode 100644 src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_ouro.cpp delete mode 100644 src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_sartura.cpp delete mode 100644 src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_skeram.cpp delete mode 100644 src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_twinemperors.cpp delete mode 100644 src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_viscidus.cpp delete mode 100644 src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/def_temple_of_ahnqiraj.h delete mode 100644 src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/instance_temple_of_ahnqiraj.cpp delete mode 100644 src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/mob_anubisath_sentinel.cpp delete mode 100644 src/bindings/scripts/scripts/zone/ungoro_crater/ungoro_crater.cpp delete mode 100644 src/bindings/scripts/scripts/zone/wailing_caverns/def_wailing_caverns.h delete mode 100644 src/bindings/scripts/scripts/zone/wailing_caverns/instance_wailing_caverns.cpp delete mode 100644 src/bindings/scripts/scripts/zone/wailing_caverns/wailing_caverns.cpp delete mode 100644 src/bindings/scripts/scripts/zone/zulfarrak/zulfarrak.cpp (limited to 'src/bindings/scripts/system/ScriptLoader.cpp') diff --git a/src/bindings/scripts/CMakeLists.txt b/src/bindings/scripts/CMakeLists.txt index 0d63ed10020..b83b2f09f58 100644 --- a/src/bindings/scripts/CMakeLists.txt +++ b/src/bindings/scripts/CMakeLists.txt @@ -194,6 +194,71 @@ SET(trinityscript_LIB_SRCS scripts/examples/example_escort.cpp scripts/examples/example_gossip_codebox.cpp scripts/examples/example_misc.cpp + scripts/kalimdor/blackfathom_depths/instance_blackfathom_deeps.cpp + scripts/kalimdor/blackfathom_depths/def_blackfathom_deeps.h + scripts/kalimdor/caverns_of_time/culling_of_stratholme/instance_culling_of_stratholme.cpp + scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_meathook.cpp + scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_epoch.cpp + scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_mal_ganis.cpp + scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_salramm.cpp + scripts/kalimdor/caverns_of_time/culling_of_stratholme/def_culling_of_stratholme.h + scripts/kalimdor/caverns_of_time/dark_portal/def_dark_portal.h + scripts/kalimdor/caverns_of_time/dark_portal/instance_dark_portal.cpp + scripts/kalimdor/caverns_of_time/dark_portal/dark_portal.cpp + scripts/kalimdor/caverns_of_time/dark_portal/boss_aeonus.cpp + scripts/kalimdor/caverns_of_time/dark_portal/boss_chrono_lord_deja.cpp + scripts/kalimdor/caverns_of_time/dark_portal/boss_temporus.cpp + scripts/kalimdor/caverns_of_time/hyjal/boss_anetheron.cpp + scripts/kalimdor/caverns_of_time/hyjal/boss_archimonde.cpp + scripts/kalimdor/caverns_of_time/hyjal/boss_azgalor.cpp + scripts/kalimdor/caverns_of_time/hyjal/boss_kazrogal.cpp + scripts/kalimdor/caverns_of_time/hyjal/boss_rage_winterchill.cpp + scripts/kalimdor/caverns_of_time/hyjal/def_hyjal.h + scripts/kalimdor/caverns_of_time/hyjal/hyjal.cpp + scripts/kalimdor/caverns_of_time/hyjal/hyjal_trash.cpp + scripts/kalimdor/caverns_of_time/hyjal/hyjal_trash.h + scripts/kalimdor/caverns_of_time/hyjal/hyjalAI.cpp + scripts/kalimdor/caverns_of_time/hyjal/hyjalAI.h + scripts/kalimdor/caverns_of_time/hyjal/instance_hyjal.cpp + scripts/kalimdor/caverns_of_time/old_hillsbrad/boss_captain_skarloc.cpp + scripts/kalimdor/caverns_of_time/old_hillsbrad/boss_epoch_hunter.cpp + scripts/kalimdor/caverns_of_time/old_hillsbrad/boss_leutenant_drake.cpp + scripts/kalimdor/caverns_of_time/old_hillsbrad/def_old_hillsbrad.h + scripts/kalimdor/caverns_of_time/old_hillsbrad/instance_old_hillsbrad.cpp + scripts/kalimdor/caverns_of_time/old_hillsbrad/old_hillsbrad.cpp + scripts/kalimdor/maraudon/boss_celebras_the_cursed.cpp + scripts/kalimdor/maraudon/boss_landslide.cpp + scripts/kalimdor/maraudon/boss_noxxion.cpp + scripts/kalimdor/maraudon/boss_princess_theradras.cpp + scripts/kalimdor/onyxias_lair/boss_onyxia.cpp + scripts/kalimdor/razorfen_downs/boss_amnennar_the_coldbringer.cpp + scripts/kalimdor/razorfen_downs/razorfen_downs.cpp + scripts/kalimdor/razorfen_kraul/def_razorfen_kraul.h + scripts/kalimdor/razorfen_kraul/instance_razorfen_kraul.cpp + scripts/kalimdor/razorfen_kraul/razorfen_kraul.cpp + scripts/kalimdor/ruins_of_ahnqiraj/boss_ayamiss.cpp + scripts/kalimdor/ruins_of_ahnqiraj/boss_buru.cpp + scripts/kalimdor/ruins_of_ahnqiraj/boss_kurinnaxx.cpp + scripts/kalimdor/ruins_of_ahnqiraj/boss_moam.cpp + scripts/kalimdor/ruins_of_ahnqiraj/boss_ossirian.cpp + scripts/kalimdor/ruins_of_ahnqiraj/boss_rajaxx.cpp + scripts/kalimdor/ruins_of_ahnqiraj/instance_ruins_of_ahnqiraj.cpp + scripts/kalimdor/temple_of_ahnqiraj/boss_bug_trio.cpp + scripts/kalimdor/temple_of_ahnqiraj/boss_cthun.cpp + scripts/kalimdor/temple_of_ahnqiraj/boss_fankriss.cpp + scripts/kalimdor/temple_of_ahnqiraj/boss_huhuran.cpp + scripts/kalimdor/temple_of_ahnqiraj/boss_ouro.cpp + scripts/kalimdor/temple_of_ahnqiraj/boss_sartura.cpp + scripts/kalimdor/temple_of_ahnqiraj/boss_skeram.cpp + scripts/kalimdor/temple_of_ahnqiraj/boss_twinemperors.cpp + scripts/kalimdor/temple_of_ahnqiraj/boss_viscidus.cpp + scripts/kalimdor/temple_of_ahnqiraj/def_temple_of_ahnqiraj.h + scripts/kalimdor/temple_of_ahnqiraj/instance_temple_of_ahnqiraj.cpp + scripts/kalimdor/temple_of_ahnqiraj/mob_anubisath_sentinel.cpp + scripts/kalimdor/wailing_caverns/def_wailing_caverns.h + scripts/kalimdor/wailing_caverns/instance_wailing_caverns.cpp + scripts/kalimdor/wailing_caverns/wailing_caverns.cpp + scripts/kalimdor/zulfarrak/zulfarrak.cpp scripts/kalimdor/ashenvale.cpp scripts/kalimdor/azshara.cpp scripts/kalimdor/azuremyst_isle.cpp @@ -214,6 +279,7 @@ SET(trinityscript_LIB_SRCS scripts/kalimdor/the_barrens.cpp scripts/kalimdor/thousand_needles.cpp scripts/kalimdor/thunder_bluff.cpp + scripts/kalimdor/ungoro_crater.cpp scripts/kalimdor/winterspring.cpp scripts/northrend/borean_tundra.cpp scripts/northrend/dragonblight.cpp @@ -257,32 +323,6 @@ SET(trinityscript_LIB_SRCS scripts/zone/black_temple/def_black_temple.h scripts/zone/black_temple/illidari_council.cpp scripts/zone/black_temple/instance_black_temple.cpp - scripts/zone/blackfathom_depths/instance_blackfathom_deeps.cpp - scripts/zone/blackfathom_depths/def_blackfathom_deeps.h - scripts/zone/caverns_of_time/dark_portal/def_dark_portal.h - scripts/zone/caverns_of_time/dark_portal/instance_dark_portal.cpp - scripts/zone/caverns_of_time/dark_portal/dark_portal.cpp - scripts/zone/caverns_of_time/dark_portal/boss_aeonus.cpp - scripts/zone/caverns_of_time/dark_portal/boss_chrono_lord_deja.cpp - scripts/zone/caverns_of_time/dark_portal/boss_temporus.cpp - scripts/zone/caverns_of_time/hyjal/boss_anetheron.cpp - scripts/zone/caverns_of_time/hyjal/boss_archimonde.cpp - scripts/zone/caverns_of_time/hyjal/boss_azgalor.cpp - scripts/zone/caverns_of_time/hyjal/boss_kazrogal.cpp - scripts/zone/caverns_of_time/hyjal/boss_rage_winterchill.cpp - scripts/zone/caverns_of_time/hyjal/def_hyjal.h - scripts/zone/caverns_of_time/hyjal/hyjal.cpp - scripts/zone/caverns_of_time/hyjal/hyjal_trash.cpp - scripts/zone/caverns_of_time/hyjal/hyjal_trash.h - scripts/zone/caverns_of_time/hyjal/hyjalAI.cpp - scripts/zone/caverns_of_time/hyjal/hyjalAI.h - scripts/zone/caverns_of_time/hyjal/instance_hyjal.cpp - scripts/zone/caverns_of_time/old_hillsbrad/boss_captain_skarloc.cpp - scripts/zone/caverns_of_time/old_hillsbrad/boss_epoch_hunter.cpp - scripts/zone/caverns_of_time/old_hillsbrad/boss_leutenant_drake.cpp - scripts/zone/caverns_of_time/old_hillsbrad/def_old_hillsbrad.h - scripts/zone/caverns_of_time/old_hillsbrad/instance_old_hillsbrad.cpp - scripts/zone/caverns_of_time/old_hillsbrad/old_hillsbrad.cpp scripts/zone/coilfang_resevoir/serpent_shrine/boss_fathomlord_karathress.cpp scripts/zone/coilfang_resevoir/serpent_shrine/boss_hydross_the_unstable.cpp scripts/zone/coilfang_resevoir/serpent_shrine/boss_lurker_below.cpp @@ -320,10 +360,6 @@ SET(trinityscript_LIB_SRCS scripts/zone/hellfire_citadel/shattered_halls/def_shattered_halls.h scripts/zone/hellfire_citadel/shattered_halls/instance_shattered_halls.cpp scripts/zone/hellfire_citadel/shattered_halls/boss_warchief_kargath_bladefist.cpp - scripts/zone/maraudon/boss_celebras_the_cursed.cpp - scripts/zone/maraudon/boss_landslide.cpp - scripts/zone/maraudon/boss_noxxion.cpp - scripts/zone/maraudon/boss_princess_theradras.cpp scripts/zone/naxxramas/boss_anubrekhan.cpp scripts/zone/naxxramas/boss_faerlina.cpp scripts/zone/naxxramas/boss_gluth.cpp @@ -341,19 +377,6 @@ SET(trinityscript_LIB_SRCS scripts/zone/naxxramas/boss_thaddius.cpp scripts/zone/naxxramas/def_naxxramas.h scripts/zone/naxxramas/instance_naxxramas.cpp - scripts/zone/onyxias_lair/boss_onyxia.cpp - scripts/zone/razorfen_downs/boss_amnennar_the_coldbringer.cpp - scripts/zone/razorfen_downs/razorfen_downs.cpp - scripts/zone/razorfen_kraul/def_razorfen_kraul.h - scripts/zone/razorfen_kraul/instance_razorfen_kraul.cpp - scripts/zone/razorfen_kraul/razorfen_kraul.cpp - scripts/zone/ruins_of_ahnqiraj/boss_ayamiss.cpp - scripts/zone/ruins_of_ahnqiraj/boss_buru.cpp - scripts/zone/ruins_of_ahnqiraj/boss_kurinnaxx.cpp - scripts/zone/ruins_of_ahnqiraj/boss_moam.cpp - scripts/zone/ruins_of_ahnqiraj/boss_ossirian.cpp - scripts/zone/ruins_of_ahnqiraj/boss_rajaxx.cpp - scripts/zone/ruins_of_ahnqiraj/instance_ruins_of_ahnqiraj.cpp scripts/zone/tempest_keep/arcatraz/arcatraz.cpp scripts/zone/tempest_keep/arcatraz/boss_harbinger_skyriss.cpp scripts/zone/tempest_keep/arcatraz/def_arcatraz.h @@ -374,23 +397,6 @@ SET(trinityscript_LIB_SRCS scripts/zone/tempest_keep/the_mechanar/boss_pathaleon_the_calculator.cpp scripts/zone/tempest_keep/the_mechanar/def_mechanar.h scripts/zone/tempest_keep/the_mechanar/instance_mechanar.cpp - scripts/zone/temple_of_ahnqiraj/boss_bug_trio.cpp - scripts/zone/temple_of_ahnqiraj/boss_cthun.cpp - scripts/zone/temple_of_ahnqiraj/boss_fankriss.cpp - scripts/zone/temple_of_ahnqiraj/boss_huhuran.cpp - scripts/zone/temple_of_ahnqiraj/boss_ouro.cpp - scripts/zone/temple_of_ahnqiraj/boss_sartura.cpp - scripts/zone/temple_of_ahnqiraj/boss_skeram.cpp - scripts/zone/temple_of_ahnqiraj/boss_twinemperors.cpp - scripts/zone/temple_of_ahnqiraj/boss_viscidus.cpp - scripts/zone/temple_of_ahnqiraj/def_temple_of_ahnqiraj.h - scripts/zone/temple_of_ahnqiraj/instance_temple_of_ahnqiraj.cpp - scripts/zone/temple_of_ahnqiraj/mob_anubisath_sentinel.cpp - scripts/zone/ungoro_crater/ungoro_crater.cpp - scripts/zone/wailing_caverns/def_wailing_caverns.h - scripts/zone/wailing_caverns/instance_wailing_caverns.cpp - scripts/zone/wailing_caverns/wailing_caverns.cpp - scripts/zone/zulfarrak/zulfarrak.cpp scripts/zone/utgarde_keep/utgarde_keep/instance_utgarde_keep.cpp scripts/zone/utgarde_keep/utgarde_keep/boss_keleseth.cpp scripts/zone/utgarde_keep/utgarde_keep/boss_skarvald_dalronn.cpp @@ -462,12 +468,6 @@ SET(trinityscript_LIB_SRCS scripts/zone/ulduar/halls_of_lightning/boss_volkhan.cpp scripts/zone/ulduar/halls_of_lightning/boss_loken.cpp scripts/zone/ulduar/halls_of_lightning/def_halls_of_lightning.h - scripts/zone/caverns_of_time/culling_of_stratholme/instance_culling_of_stratholme.cpp - scripts/zone/caverns_of_time/culling_of_stratholme/boss_meathook.cpp - scripts/zone/caverns_of_time/culling_of_stratholme/boss_epoch.cpp - scripts/zone/caverns_of_time/culling_of_stratholme/boss_mal_ganis.cpp - scripts/zone/caverns_of_time/culling_of_stratholme/boss_salramm.cpp - scripts/zone/caverns_of_time/culling_of_stratholme/def_culling_of_stratholme.h scripts/zone/nexus/eye_of_eternity/instance_eye_of_eternity.cpp scripts/zone/nexus/eye_of_eternity/boss_malygos.cpp scripts/zone/nexus/eye_of_eternity/def_eye_of_eternity.h diff --git a/src/bindings/scripts/VC80/80ScriptDev2.vcproj b/src/bindings/scripts/VC80/80ScriptDev2.vcproj index ece3e669445..00b918bd22e 100644 --- a/src/bindings/scripts/VC80/80ScriptDev2.vcproj +++ b/src/bindings/scripts/VC80/80ScriptDev2.vcproj @@ -1178,6 +1178,322 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1257,6 +1573,10 @@ RelativePath="..\scripts\kalimdor\thunder_bluff.cpp" > + + @@ -1337,339 +1657,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/bindings/scripts/VC90/90ScriptDev2.vcproj b/src/bindings/scripts/VC90/90ScriptDev2.vcproj index 87b5cb00ce4..d25138a9e0f 100644 --- a/src/bindings/scripts/VC90/90ScriptDev2.vcproj +++ b/src/bindings/scripts/VC90/90ScriptDev2.vcproj @@ -1254,6 +1254,10 @@ RelativePath="..\scripts\kalimdor\thunder_bluff.cpp" > + + @@ -1605,68 +1609,1308 @@ > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + R + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/bindings/scripts/scripts/kalimdor/blackfathom_depths/def_blackfathom_deeps.h b/src/bindings/scripts/scripts/kalimdor/blackfathom_depths/def_blackfathom_deeps.h new file mode 100644 index 00000000000..6a1b1974886 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/blackfathom_depths/def_blackfathom_deeps.h @@ -0,0 +1,23 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_BFD_H +#define DEF_BFD_H + +enum +{ + DATA_SHRINE1 = 1, + DATA_SHRINE2 = 2, + DATA_SHRINE3 = 3, + DATA_SHRINE4 = 4, + DATA_TWILIGHT_LORD_KELRIS = 5, + DATA_SHRINE_OF_GELIHAST = 6, + DATA_ALTAR_OF_THE_DEEPS = 7, + DATA_MAINDOOR = 8, + + TYPE_KELRIS = 10, + TYPE_SHRINE = 11 +}; + +#endif diff --git a/src/bindings/scripts/scripts/kalimdor/blackfathom_depths/instance_blackfathom_deeps.cpp b/src/bindings/scripts/scripts/kalimdor/blackfathom_depths/instance_blackfathom_deeps.cpp new file mode 100644 index 00000000000..19203ce2d73 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/blackfathom_depths/instance_blackfathom_deeps.cpp @@ -0,0 +1,145 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Blackfathom_Deeps +SD%Complete: 50 +SDComment: +SDCategory: Blackfathom Deeps +EndScriptData */ + +#include "precompiled.h" +#include "def_blackfathom_deeps.h" + +#define MAX_ENCOUNTER 2 + +/* Encounter 0 = Twilight Lord Kelris + Encounter 1 = Shrine event + Must kill twilight lord for shrine event to be possible + */ + +struct TRINITY_DLL_DECL instance_blackfathom_deeps : public ScriptedInstance +{ + instance_blackfathom_deeps(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint64 m_uiTwilightLordKelrisGUID; + uint64 m_uiShrine1GUID; + uint64 m_uiShrine2GUID; + uint64 m_uiShrine3GUID; + uint64 m_uiShrine4GUID; + uint64 m_uiShrineOfGelihastGUID; + uint64 m_uiAltarOfTheDeepsGUID; + uint64 m_uiMainDoorGUID; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + m_uiTwilightLordKelrisGUID = 0; + m_uiShrine1GUID = 0; + m_uiShrine2GUID = 0; + m_uiShrine3GUID = 0; + m_uiShrine4GUID = 0; + m_uiShrineOfGelihastGUID = 0; + m_uiAltarOfTheDeepsGUID = 0; + m_uiMainDoorGUID = 0; + } + + void OnCreatureCreate(Creature* pCreature, bool add) + { + if (pCreature->GetEntry() == 4832) + m_uiTwilightLordKelrisGUID = pCreature->GetGUID(); + } + + void OnGameObjectCreate(GameObject* pGo, bool add) + { + switch(pGo->GetEntry()) + { + case 21118: m_uiShrine1GUID = pGo->GetGUID(); break; + case 21119: m_uiShrine2GUID = pGo->GetGUID(); break; + case 21120: m_uiShrine3GUID = pGo->GetGUID(); break; + case 21121: m_uiShrine4GUID = pGo->GetGUID(); break; + case 103015: m_uiShrineOfGelihastGUID = pGo->GetGUID(); break; + case 103016: m_uiAltarOfTheDeepsGUID = pGo->GetGUID(); break; + case 21117: m_uiMainDoorGUID = pGo->GetGUID(); break; + } + } + + void SetData(uint32 uiType, uint32 uiData) + { + switch(uiType) + { + case TYPE_KELRIS: + m_auiEncounter[0] = uiData; + break; + case TYPE_SHRINE: + m_auiEncounter[1] = uiData; + break; + } + } + + uint32 GetData(uint32 uiType) + { + switch(uiType) + { + case TYPE_KELRIS: + return m_auiEncounter[0]; + case TYPE_SHRINE: + return m_auiEncounter[1]; + } + + return 0; + } + + uint64 GetData64(uint32 uiData) + { + switch(uiData) + { + case DATA_TWILIGHT_LORD_KELRIS: + return m_uiTwilightLordKelrisGUID; + case DATA_SHRINE1: + return m_uiShrine1GUID; + case DATA_SHRINE2: + return m_uiShrine2GUID; + case DATA_SHRINE3: + return m_uiShrine3GUID; + case DATA_SHRINE4: + return m_uiShrine4GUID; + case DATA_SHRINE_OF_GELIHAST: + return m_uiShrineOfGelihastGUID; + case DATA_MAINDOOR: + return m_uiMainDoorGUID; + } + + return 0; + } +}; + +InstanceData* GetInstanceData_instance_blackfathom_deeps(Map* pMap) +{ + return new instance_blackfathom_deeps(pMap); +} + +void AddSC_instance_blackfathom_deeps() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_blackfathom_deeps"; + newscript->GetInstanceData = &GetInstanceData_instance_blackfathom_deeps; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_epoch.cpp b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_epoch.cpp new file mode 100644 index 00000000000..2e9877e97e2 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_epoch.cpp @@ -0,0 +1,86 @@ +/* Script Data Start +SDName: Boss epoch +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = '' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_CURSE_OF_EXERTION 52772 +#define SPELL_TIME_WARP 52766 //Time slows down, reducing attack, casting and movement speed by 70% for 6 sec. +#define SPELL_TIME_STOP 58848 //Stops time in a 50 yard sphere for 2 sec. +#define SPELL_WOUNDING_STRIKE_N 52771 //Used only on the tank +#define SPELL_WOUNDING_STRIKE_H 58830 + +//Say +#define SAY_INTRO -1595000 //"Prince Arthas Menethil, on this day, a powerful darkness has taken hold of your soul. The death you are destined to visit upon others will this day be your own." +#define SAY_AGGRO -1595001 //"We'll see about that, young prince." +#define SAY_TIME_WARP_1 -1595002 //"Tick tock, tick tock..." +#define SAY_TIME_WARP_2 -1595003 //"Not quick enough!" +#define SAY_TIME_WARP_3 -1595004 //"Let's get this over with. " +#define SAY_SLAY_1 -1595005 //"There is no future for you." +#define SAY_SLAY_2 -1595006 //"This is the hour of our greatest triumph!" +#define SAY_SLAY_3 -1595007 //"You were destined to fail. " +#define SAY_DEATH -1595008 //"*gurgles*" + +struct TRINITY_DLL_DECL boss_epochAI : public ScriptedAI +{ + boss_epochAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + + switch(rand()%3) + { + case 0:DoScriptText(SAY_SLAY_1, m_creature);break; + case 1:DoScriptText(SAY_SLAY_2, m_creature);break; + case 2:DoScriptText(SAY_SLAY_3, m_creature);break; + } + } +}; + +CreatureAI* GetAI_boss_epoch(Creature* pCreature) +{ + return new boss_epochAI (pCreature); +} + +void AddSC_boss_epoch() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_epoch"; + newscript->GetAI = &GetAI_boss_epoch; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_mal_ganis.cpp b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_mal_ganis.cpp new file mode 100644 index 00000000000..bd68d94d994 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_mal_ganis.cpp @@ -0,0 +1,123 @@ +/* Script Data Start +SDName: Boss mal_ganis +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = 'boss_mal_ganis' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_CARRION_SWARM_N 52720 //A cresting wave of chaotic magic splashes over enemies in front of the caster, dealing 3230 to 3570 Shadow damage and 380 to 420 Shadow damage every 3 sec. for 15 sec. +#define SPELL_CARRION_SWARM_H 58852 +#define SPELL_MIND_BLAST_N 52722 //Inflicts 4163 to 4837 Shadow damage to an enemy. +#define SPELL_MIND_BLAST_H 58850 +#define SPELL_SLEEP 52721 //Puts an enemy to sleep for up to 10 sec. Any damage caused will awaken the target. +#define SPELL_VAMPIRIC_TOUCH 52723 //Heals the caster for half the damage dealt by a melee attack. + +//Yell Mal'ganis +#define SAY_INTRO_1 -1595009 +#define SAY_INTRO_2 -1595010 +#define SAY_OUTRO -1595011 +#define SAY_AGGRO -1595012 +#define SAY_KILL_1 -1595013 +#define SAY_KILL_2 -1595014 +#define SAY_KILL_3 -1595015 +#define SAY_SLAY_1 -1595016 +#define SAY_SLAY_2 -1595017 +#define SAY_SLAY_3 -1595018 +#define SAY_SLAY_4 -1595019 +#define SAY_SLEEP_1 -1595020 +#define SAY_SLEEP_2 -1595021 +#define SAY_30HEALTH -1595022 +#define SAY_15HEALTH -1595023 +#define SAY_ESCAPE_SPEECH_1 -1595024 +#define SAY_ESCAPE_SPEECH_2 -1595025 + +struct TRINITY_DLL_DECL boss_mal_ganisAI : public ScriptedAI +{ + boss_mal_ganisAI(Creature *c) : ScriptedAI(c) {} + + bool yelled, + yelled2, + yelled3; + + void Reset() + { + yelled = false; + yelled2 = false; + yelled3 = false; + } + + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + if (!yelled) + { + if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 30) + { + DoScriptText(SAY_30HEALTH, m_creature); + yelled = true; + } + } + + if (!yelled2) + { + if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 15) + { + DoScriptText(SAY_15HEALTH, m_creature); + yelled2 = true; + } + } + + if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 1) + { + //Handle Escape Event + } + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) {} + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + + switch(rand()%4) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature);break; + case 1: DoScriptText(SAY_SLAY_2, m_creature);break; + case 2: DoScriptText(SAY_SLAY_3, m_creature);break; + case 3: DoScriptText(SAY_SLAY_4, m_creature);break; + } + } +}; + +CreatureAI* GetAI_boss_mal_ganis(Creature* pCreature) +{ + return new boss_mal_ganisAI (pCreature); +} + +void AddSC_boss_mal_ganis() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_mal_ganis"; + newscript->GetAI = &GetAI_boss_mal_ganis; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_meathook.cpp b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_meathook.cpp new file mode 100644 index 00000000000..117a17585c6 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_meathook.cpp @@ -0,0 +1,138 @@ +/* Script Data Start +SDName: Boss meathook +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = 'boss_meathook' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spell +#define SPELL_CONSTRICTING_CHAINS_N 52696 //Encases the targets in chains, dealing 1800 Physical damage every 1 sec. and stunning the target for 5 sec. +#define SPELL_CONSTRICTING_CHAINS_H 58823 +#define SPELL_DISEASE_EXPULSION_N 52666 //Meathook belches out a cloud of disease, dealing 1710 to 1890 Nature damage and interrupting the spell casting of nearby enemy targets for 4 sec. +#define SPELL_DISEASE_EXPULSION_H 58824 +#define SPELL_FRENZY 58841 //Increases the caster's Physical damage by 10% for 30 sec. + +//Yell +#define SAY_AGGRO -1595026 +#define SAY_SLAY_1 -1595027 +#define SAY_SLAY_2 -1595028 +#define SAY_SLAY_3 -1595029 +#define SAY_SPAWN -1595030 +#define SAY_DEATH -1595031 + +struct TRINITY_DLL_DECL boss_meathookAI : public ScriptedAI +{ + boss_meathookAI(Creature *c) : ScriptedAI(c) {} + + uint32 Chain_Timer, + Disease_Timer, + Frenzy_Timer; + + void Reset() + { + Chain_Timer = 12000 + rand()%5000; //seen on video 13, 17, 15, 12, 16 + Disease_Timer = 2000 + rand()%1000; //approx 3s + Frenzy_Timer = 20000 + rand()%10000; //made it up + } + + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + + void AttackStart(Unit* who) {} + + std::list pList; + void MoveInLineOfSight(Unit* who, const uint32 diff) + { + /*if (m_creature->isHostileTo(who)) + { + pList.append(who); + }*/ + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + if (Disease_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_DISEASE_EXPULSION_N); + Disease_Timer = 1500 + rand()%2500; + }else Disease_Timer -= diff; + + if (Frenzy_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_FRENZY); + Frenzy_Timer = 20000 + rand()%10000; + }else Frenzy_Timer -= diff; + + if (Chain_Timer < diff) + { + + /* + std::list& m_threatlist = m_creature->getThreatManager().getThreatList(); + std::list::iterator itr; + + int st=0; + for(itr = m_threatlist.begin(); itr != m_threatlist.end(); ++itr) + { + //st++; + m_creature->getThreatManager(). + } + Unit* targets[st]; + int st2=0; + for(int i=1; i<=st; ++i){ + if (!IsWithinLOSInMap(targets[i]) + st2++; + } + Unit* targets_out_of_LOS[st2];*/ + + DoCast(SelectUnit(SELECT_TARGET_RANDOM, 1), SPELL_CONSTRICTING_CHAINS_N); //anyone but the tank + Chain_Timer = 2000 + rand()%1000; + }else Chain_Timer -= diff; + + DoMeleeAttackIfReady(); + } + + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature);break; + case 1: DoScriptText(SAY_SLAY_2, m_creature);break; + case 2: DoScriptText(SAY_SLAY_3, m_creature);break; + } + } +}; + +CreatureAI* GetAI_boss_meathook(Creature* pCreature) +{ + return new boss_meathookAI (pCreature); +} + +void AddSC_boss_meathook() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_meathook"; + newscript->GetAI = &GetAI_boss_meathook; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_salramm.cpp b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_salramm.cpp new file mode 100644 index 00000000000..418adb82ff4 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_salramm.cpp @@ -0,0 +1,155 @@ +/* Script Data Start +SDName: Boss salramm +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = 'boss_salramm' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_CURSE_OF_TWISTED_FLESH 58845 +#define SPELL_EXPLODE_GHOUL_N 52480 +#define SPELL_EXPLODE_GHOUL_H 58825 +#define SPELL_SHADOW_BOLT_N 57725 +#define SPELL_SHADOW_BOLT_H 58828 +#define SPELL_STEAL_FLESH 52708 +#define SPELL_SUMMON_GHOULS 52451 + +//Yell +#define SAY_AGGRO -1595032 +#define SAY_SPAWN -1595033 +#define SAY_SLAY_1 -1595034 +#define SAY_SLAY_2 -1595035 +#define SAY_SLAY_3 -1595036 +#define SAY_DEATH -1595037 +#define SAY_EXPLODE_GHOUL_1 -1595038 +#define SAY_EXPLODE_GHOUL_2 -1595039 +#define SAY_STEAL_FLESH_1 -1595040 +#define SAY_STEAL_FLESH_2 -1595041 +#define SAY_STEAL_FLESH_3 -1595042 +#define SAY_SUMMON_GHOULS_1 -1595043 +#define SAY_SUMMON_GHOULS_2 -1595044 + +struct TRINITY_DLL_DECL boss_salrammAI : public ScriptedAI +{ + boss_salrammAI(Creature *c) : ScriptedAI(c) {} + + uint32 Curse_flesh_Timer, + Explode_ghoul_Timer, + Shadow_bolt_Timer, + Steal_flesh_Timer, + Summon_ghouls_Timer; + + void Reset() + { + Curse_flesh_Timer = 30000; //30s DBM + Explode_ghoul_Timer = 25000 + rand()%3000; //approx 6 sec after summon ghouls + Shadow_bolt_Timer = 8000 + rand()%4000; // approx 10s + Steal_flesh_Timer = 12345; + Summon_ghouls_Timer = 19000 + rand()%5000; //on a video approx 24s after aggro + } + + void EnterCombat(Unit* who) + {DoScriptText(SAY_AGGRO, m_creature);} + + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + Unit* random_target = SelectUnit(SELECT_TARGET_RANDOM, 0); + + //Curse of twisted flesh timer + if (Curse_flesh_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_CURSE_OF_TWISTED_FLESH); + Curse_flesh_Timer = 37000; + }else Curse_flesh_Timer -= diff; + + //Shadow bolt timer + if (Shadow_bolt_Timer < diff) + { + if (random_target) + DoCast(random_target,SPELL_SHADOW_BOLT_N); + Shadow_bolt_Timer = 8000 + rand()%4000; + }else Shadow_bolt_Timer -= diff; + + //Steal Flesh timer + if (Steal_flesh_Timer < diff) + { + switch(rand()%3) + { + case 0: + DoScriptText(SAY_STEAL_FLESH_1, m_creature); + break; + case 1: + DoScriptText(SAY_STEAL_FLESH_2, m_creature); + break; + case 2: + DoScriptText(SAY_STEAL_FLESH_3, m_creature); + break; + } + if (random_target) + DoCast(random_target,SPELL_STEAL_FLESH); + Steal_flesh_Timer = 10000; + }else Steal_flesh_Timer -= diff; + + //Summon ghouls timer + if (Summon_ghouls_Timer < diff) + { + switch(rand()%2) + { + case 0: + DoScriptText(SAY_SUMMON_GHOULS_1, m_creature); + break; + case 1: + DoScriptText(SAY_SUMMON_GHOULS_2, m_creature); + break; + } + if (random_target) + DoCast(random_target,SPELL_SUMMON_GHOULS); + Summon_ghouls_Timer = 10000; + }else Summon_ghouls_Timer -= diff; + + DoMeleeAttackIfReady(); + } + + void JustDied(Unit* killer) + {DoScriptText(SAY_DEATH, m_creature);} + + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature);break; + case 1: DoScriptText(SAY_SLAY_2, m_creature);break; + case 2: DoScriptText(SAY_SLAY_3, m_creature);break; + } + } +}; + +CreatureAI* GetAI_boss_salramm(Creature* pCreature) +{ + return new boss_salrammAI (pCreature); +} + +void AddSC_boss_salramm() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_salramm"; + newscript->GetAI = &GetAI_boss_salramm; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/culling_of_stratholme/def_culling_of_stratholme.h b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/culling_of_stratholme/def_culling_of_stratholme.h new file mode 100644 index 00000000000..849549e8f99 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/culling_of_stratholme/def_culling_of_stratholme.h @@ -0,0 +1,4 @@ +#ifndef DEF_CULLING_OF_STRATHOLME_H +#define DEF_CULLING_OF_STRATHOLME_H + +#endif diff --git a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/culling_of_stratholme/instance_culling_of_stratholme.cpp b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/culling_of_stratholme/instance_culling_of_stratholme.cpp new file mode 100644 index 00000000000..35ee68ea991 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/culling_of_stratholme/instance_culling_of_stratholme.cpp @@ -0,0 +1,21 @@ +#include "precompiled.h" +#include "def_culling_of_stratholme.h" + +struct TRINITY_DLL_DECL instance_culling_of_stratholme : public ScriptedInstance +{ + instance_culling_of_stratholme(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; +}; + +InstanceData* GetInstanceData_instance_culling_of_stratholme(Map* pMap) +{ + return new instance_culling_of_stratholme(pMap); +} + +void AddSC_instance_culling_of_stratholme() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_culling_of_stratholme"; + newscript->GetInstanceData = &GetInstanceData_instance_culling_of_stratholme; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/dark_portal/boss_aeonus.cpp b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/dark_portal/boss_aeonus.cpp new file mode 100644 index 00000000000..5667f5ae0b1 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/dark_portal/boss_aeonus.cpp @@ -0,0 +1,151 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Aeonus +SD%Complete: 80 +SDComment: Some spells not implemented +SDCategory: Caverns of Time, The Dark Portal +EndScriptData */ + +#include "precompiled.h" +#include "def_dark_portal.h" + +enum +{ + SAY_ENTER = -1269012, + SAY_AGGRO = -1269013, + SAY_BANISH = -1269014, + SAY_SLAY1 = -1269015, + SAY_SLAY2 = -1269016, + SAY_DEATH = -1269017, + EMOTE_FRENZY = -1269018, + + SPELL_CLEAVE = 40504, + SPELL_TIME_STOP = 31422, + SPELL_ENRAGE = 37605, + SPELL_SAND_BREATH = 31473, + H_SPELL_SAND_BREATH = 39049 +}; + +struct TRINITY_DLL_DECL boss_aeonusAI : public ScriptedAI +{ + boss_aeonusAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + ScriptedInstance *pInstance; + bool HeroicMode; + + uint32 SandBreath_Timer; + uint32 TimeStop_Timer; + uint32 Frenzy_Timer; + + void Reset() + { + SandBreath_Timer = 15000+rand()%15000; + TimeStop_Timer = 10000+rand()%5000; + Frenzy_Timer = 30000+rand()%15000; + } + + void EnterCombat(Unit *who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + + void MoveInLineOfSight(Unit *who) + { + //Despawn Time Keeper + if (who->GetTypeId() == TYPEID_UNIT && who->GetEntry() == C_TIME_KEEPER) + { + if (m_creature->IsWithinDistInMap(who,20.0f)) + { + DoScriptText(SAY_BANISH, m_creature); + m_creature->DealDamage(who, who->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + } + } + + ScriptedAI::MoveInLineOfSight(who); + } + + void JustDied(Unit *victim) + { + DoScriptText(SAY_DEATH, m_creature); + + if (pInstance) + { + pInstance->SetData(TYPE_RIFT,DONE); + pInstance->SetData(TYPE_MEDIVH,DONE);//FIXME: later should be removed + } + } + + void KilledUnit(Unit *victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + } + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + //Sand Breath + if (SandBreath_Timer < diff) + { + DoCast(m_creature->getVictim(), HeroicMode ? H_SPELL_SAND_BREATH : SPELL_SAND_BREATH); + SandBreath_Timer = 15000+rand()%10000; + }else SandBreath_Timer -= diff; + + //Time Stop + if (TimeStop_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_TIME_STOP); + TimeStop_Timer = 20000+rand()%15000; + }else TimeStop_Timer -= diff; + + //Frenzy + if (Frenzy_Timer < diff) + { + DoScriptText(EMOTE_FRENZY, m_creature); + DoCast(m_creature, SPELL_ENRAGE); + Frenzy_Timer = 20000+rand()%15000; + }else Frenzy_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_aeonus(Creature* pCreature) +{ + return new boss_aeonusAI (pCreature); +} + +void AddSC_boss_aeonus() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_aeonus"; + newscript->GetAI = &GetAI_boss_aeonus; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/dark_portal/boss_chrono_lord_deja.cpp b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/dark_portal/boss_chrono_lord_deja.cpp new file mode 100644 index 00000000000..2a1d3c4fe03 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/dark_portal/boss_chrono_lord_deja.cpp @@ -0,0 +1,160 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Chrono_Lord_Deja +SD%Complete: 65 +SDComment: All abilities not implemented +SDCategory: Caverns of Time, The Dark Portal +EndScriptData */ + +#include "precompiled.h" +#include "def_dark_portal.h" + +enum +{ + SAY_ENTER = -1269006, + SAY_AGGRO = -1269007, + SAY_BANISH = -1269008, + SAY_SLAY1 = -1269009, + SAY_SLAY2 = -1269010, + SAY_DEATH = -1269011, + + SPELL_ARCANE_BLAST = 31457, + H_SPELL_ARCANE_BLAST = 38538, + SPELL_ARCANE_DISCHARGE = 31472, + H_SPELL_ARCANE_DISCHARGE = 38539, + SPELL_TIME_LAPSE = 31467, + SPELL_ATTRACTION = 38540 //Not Implemented (Heroic mode) +}; + +struct TRINITY_DLL_DECL boss_chrono_lord_dejaAI : public ScriptedAI +{ + boss_chrono_lord_dejaAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + ScriptedInstance *pInstance; + bool HeroicMode; + + uint32 ArcaneBlast_Timer; + uint32 TimeLapse_Timer; + uint32 Attraction_Timer; + uint32 ArcaneDischarge_Timer; + + void Reset() + { + ArcaneBlast_Timer = 18000+rand()%5000; + TimeLapse_Timer = 10000+rand()%5000; + ArcaneDischarge_Timer = 20000+rand()%10000; + Attraction_Timer = 25000+rand()%10000; + } + + void EnterCombat(Unit *who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + + void MoveInLineOfSight(Unit *who) + { + //Despawn Time Keeper + if (who->GetTypeId() == TYPEID_UNIT && who->GetEntry() == C_TIME_KEEPER) + { + if (m_creature->IsWithinDistInMap(who,20.0f)) + { + DoScriptText(SAY_BANISH, m_creature); + m_creature->DealDamage(who, who->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + } + } + + ScriptedAI::MoveInLineOfSight(who); + } + + void KilledUnit(Unit *victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + } + } + + void JustDied(Unit *victim) + { + DoScriptText(SAY_DEATH, m_creature); + + if (pInstance) + pInstance->SetData(TYPE_RIFT,SPECIAL); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + //Arcane Blast + if (ArcaneBlast_Timer < diff) + { + DoCast(m_creature->getVictim(), HeroicMode ? H_SPELL_ARCANE_BLAST : SPELL_ARCANE_BLAST); + ArcaneBlast_Timer = 15000+rand()%10000; + }else ArcaneBlast_Timer -= diff; + + //Arcane Discharge + if (ArcaneDischarge_Timer < diff) + { + Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0); + DoCast(target,HeroicMode ? H_SPELL_ARCANE_DISCHARGE : SPELL_ARCANE_DISCHARGE); + ArcaneDischarge_Timer = 20000+rand()%10000; + }else ArcaneDischarge_Timer -= diff; + + //Time Lapse + if (TimeLapse_Timer < diff) + { + DoScriptText(SAY_BANISH, m_creature); + DoCast(m_creature, SPELL_TIME_LAPSE); + TimeLapse_Timer = 15000+rand()%10000; + }else TimeLapse_Timer -= diff; + + if (HeroicMode) + { + if (Attraction_Timer < diff) + { + DoCast(m_creature,SPELL_ATTRACTION); + Attraction_Timer = 25000+rand()%10000; + }else Attraction_Timer -= diff; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_chrono_lord_deja(Creature* pCreature) +{ + return new boss_chrono_lord_dejaAI (pCreature); +} + +void AddSC_boss_chrono_lord_deja() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_chrono_lord_deja"; + newscript->GetAI = &GetAI_boss_chrono_lord_deja; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/dark_portal/boss_temporus.cpp b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/dark_portal/boss_temporus.cpp new file mode 100644 index 00000000000..0d1a6eec214 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/dark_portal/boss_temporus.cpp @@ -0,0 +1,158 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Temporus +SD%Complete: 75 +SDComment: More abilities need to be implemented +SDCategory: Caverns of Time, The Dark Portal +EndScriptData */ + +#include "precompiled.h" +#include "def_dark_portal.h" + +enum +{ + SAY_ENTER = -1269000, + SAY_AGGRO = -1269001, + SAY_BANISH = -1269002, + SAY_SLAY1 = -1269003, + SAY_SLAY2 = -1269004, + SAY_DEATH = -1269005, + + SPELL_HASTE = 31458, + SPELL_MORTAL_WOUND = 31464, + SPELL_WING_BUFFET = 31475, + H_SPELL_WING_BUFFET = 38593, + SPELL_REFLECT = 38592 //Not Implemented (Heroic mod) +}; + +struct TRINITY_DLL_DECL boss_temporusAI : public ScriptedAI +{ + boss_temporusAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + HeroicMode = c->GetMap()->IsHeroic(); + } + + ScriptedInstance *pInstance; + bool HeroicMode; + + uint32 Haste_Timer; + uint32 SpellReflection_Timer; + uint32 MortalWound_Timer; + uint32 WingBuffet_Timer; + + void Reset() + { + Haste_Timer = 15000+rand()%8000; + SpellReflection_Timer = 30000; + MortalWound_Timer = 8000; + WingBuffet_Timer = 25000+rand()%10000; + } + + void EnterCombat(Unit *who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + + void KilledUnit(Unit *victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + } + } + + void JustDied(Unit *victim) + { + DoScriptText(SAY_DEATH, m_creature); + + if (pInstance) + pInstance->SetData(TYPE_RIFT,SPECIAL); + } + + void MoveInLineOfSight(Unit *who) + { + //Despawn Time Keeper + if (who->GetTypeId() == TYPEID_UNIT && who->GetEntry() == C_TIME_KEEPER) + { + if (m_creature->IsWithinDistInMap(who,20.0f)) + { + DoScriptText(SAY_BANISH, m_creature); + + m_creature->DealDamage(who, who->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + } + } + + ScriptedAI::MoveInLineOfSight(who); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + //Attack Haste + if (Haste_Timer < diff) + { + DoCast(m_creature, SPELL_HASTE); + Haste_Timer = 20000+rand()%5000; + }else Haste_Timer -= diff; + + //MortalWound_Timer + if (MortalWound_Timer < diff) + { + DoCast(m_creature, SPELL_MORTAL_WOUND); + MortalWound_Timer = 10000+rand()%10000; + }else MortalWound_Timer -= diff; + + //Wing ruffet + if (WingBuffet_Timer < diff) + { + DoCast(m_creature,HeroicMode ? H_SPELL_WING_BUFFET : SPELL_WING_BUFFET); + WingBuffet_Timer = 20000+rand()%10000; + }else WingBuffet_Timer -= diff; + + if (HeroicMode) + { + if (SpellReflection_Timer < diff) + { + DoCast(m_creature,SPELL_REFLECT); + SpellReflection_Timer = 25000+rand()%10000; + }else SpellReflection_Timer -= diff; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_temporus(Creature* pCreature) +{ + return new boss_temporusAI (pCreature); +} + +void AddSC_boss_temporus() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_temporus"; + newscript->GetAI = &GetAI_boss_temporus; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/dark_portal/dark_portal.cpp b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/dark_portal/dark_portal.cpp new file mode 100644 index 00000000000..b57abc8c5d6 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/dark_portal/dark_portal.cpp @@ -0,0 +1,409 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +/* ScriptData +SDName: Dark_Portal +SD%Complete: 30 +SDComment: Misc NPC's and mobs for instance. Most here far from complete. +SDCategory: Caverns of Time, The Dark Portal +EndScriptData */ + +/* ContentData +npc_medivh_bm +npc_time_rift +npc_saat +EndContentData */ + +#include "precompiled.h" +#include "def_dark_portal.h" + +#define SAY_ENTER -1269020 //where does this belong? +#define SAY_INTRO -1269021 +#define SAY_WEAK75 -1269022 +#define SAY_WEAK50 -1269023 +#define SAY_WEAK25 -1269024 +#define SAY_DEATH -1269025 +#define SAY_WIN -1269026 +#define SAY_ORCS_ENTER -1269027 +#define SAY_ORCS_ANSWER -1269028 + +#define SPELL_CHANNEL 31556 +#define SPELL_PORTAL_RUNE 32570 //aura(portal on ground effect) + +#define SPELL_BLACK_CRYSTAL 32563 //aura +#define SPELL_PORTAL_CRYSTAL 32564 //summon + +#define SPELL_BANISH_PURPLE 32566 //aura +#define SPELL_BANISH_GREEN 32567 //aura + +#define SPELL_CORRUPT 31326 +#define SPELL_CORRUPT_AEONUS 37853 + +#define C_COUNCIL_ENFORCER 17023 + +struct TRINITY_DLL_DECL npc_medivh_bmAI : public ScriptedAI +{ + npc_medivh_bmAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance *pInstance; + + uint32 SpellCorrupt_Timer; + uint32 Check_Timer; + + bool Life75; + bool Life50; + bool Life25; + + void Reset() + { + SpellCorrupt_Timer = 0; + + if (!pInstance) + return; + + if (pInstance->GetData(TYPE_MEDIVH) == IN_PROGRESS) + m_creature->CastSpell(m_creature,SPELL_CHANNEL,true); + else if (m_creature->HasAura(SPELL_CHANNEL)) + m_creature->RemoveAura(SPELL_CHANNEL); + + m_creature->CastSpell(m_creature,SPELL_PORTAL_RUNE,true); + } + + void MoveInLineOfSight(Unit *who) + { + if (!pInstance) + return; + + if (who->GetTypeId() == TYPEID_PLAYER && m_creature->IsWithinDistInMap(who, 10.0f)) + { + if (pInstance->GetData(TYPE_MEDIVH) == IN_PROGRESS || pInstance->GetData(TYPE_MEDIVH) == DONE) + return; + + DoScriptText(SAY_INTRO, m_creature); + pInstance->SetData(TYPE_MEDIVH,IN_PROGRESS); + m_creature->CastSpell(m_creature,SPELL_CHANNEL,false); + Check_Timer = 5000; + } + else if (who->GetTypeId() == TYPEID_UNIT && m_creature->IsWithinDistInMap(who, 15.0f)) + { + if (pInstance->GetData(TYPE_MEDIVH) != IN_PROGRESS) + return; + + uint32 entry = who->GetEntry(); + if (entry == C_ASSAS || entry == C_WHELP || entry == C_CHRON || entry == C_EXECU || entry == C_VANQU) + { + who->StopMoving(); + who->CastSpell(m_creature,SPELL_CORRUPT,false); + } + else if (entry == C_AEONUS) + { + who->StopMoving(); + who->CastSpell(m_creature,SPELL_CORRUPT_AEONUS,false); + } + } + } + + void AttackStart(Unit *who) + { + //if (pInstance && pInstance->GetData(TYPE_MEDIVH) == IN_PROGRESS) + //return; + + //ScriptedAI::AttackStart(who); + } + + void EnterCombat(Unit *who) {} + + void SpellHit(Unit* caster, const SpellEntry* spell) + { + if (SpellCorrupt_Timer) + return; + + if (spell->Id == SPELL_CORRUPT_AEONUS) + SpellCorrupt_Timer = 1000; + + if (spell->Id == SPELL_CORRUPT) + SpellCorrupt_Timer = 3000; + } + + void JustDied(Unit* Killer) + { + if (Killer->GetEntry() == m_creature->GetEntry()) + return; + + DoScriptText(SAY_DEATH, m_creature); + } + + void UpdateAI(const uint32 diff) + { + if (!pInstance) + return; + + if (SpellCorrupt_Timer) + { + if (SpellCorrupt_Timer <= diff) + { + pInstance->SetData(TYPE_MEDIVH,SPECIAL); + + if (m_creature->HasAura(SPELL_CORRUPT_AEONUS)) + SpellCorrupt_Timer = 1000; + else if (m_creature->HasAura(SPELL_CORRUPT)) + SpellCorrupt_Timer = 3000; + else + SpellCorrupt_Timer = 0; + }else SpellCorrupt_Timer -= diff; + } + + if (Check_Timer) + { + if (Check_Timer <= diff) + { + uint32 pct = pInstance->GetData(DATA_SHIELD); + + Check_Timer = 5000; + + if (Life25 && pct <= 25) + { + DoScriptText(SAY_WEAK25, m_creature); + Life25 = false; + } + else if (Life50 && pct <= 50) + { + DoScriptText(SAY_WEAK50, m_creature); + Life50 = false; + } + else if (Life75 && pct <= 75) + { + DoScriptText(SAY_WEAK75, m_creature); + Life75 = false; + } + + //if we reach this it means event was running but at some point reset. + if (pInstance->GetData(TYPE_MEDIVH) == NOT_STARTED) + { + m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + m_creature->RemoveCorpse(); + m_creature->Respawn(); + return; + } + + if (pInstance->GetData(TYPE_RIFT) == DONE) + { + DoScriptText(SAY_WIN, m_creature); + Check_Timer = 0; + + if (m_creature->HasAura(SPELL_CHANNEL)) + m_creature->RemoveAura(SPELL_CHANNEL); + + //TODO: start the post-event here + pInstance->SetData(TYPE_MEDIVH,DONE); + } + }else Check_Timer -= diff; + } + + //if (!UpdateVictim()) + //return; + + //DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_npc_medivh_bm(Creature* pCreature) +{ + return new npc_medivh_bmAI (pCreature); +} + +struct Wave +{ + uint32 PortalMob[4]; //spawns for portal waves (in order) +}; + +static Wave PortalWaves[]= +{ + {C_ASSAS, C_WHELP, C_CHRON, 0}, + {C_EXECU, C_CHRON, C_WHELP, C_ASSAS}, + {C_EXECU, C_VANQU, C_CHRON, C_ASSAS} +}; + +struct TRINITY_DLL_DECL npc_time_riftAI : public ScriptedAI +{ + npc_time_riftAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance *pInstance; + + uint32 TimeRiftWave_Timer; + uint8 mRiftWaveCount; + uint8 mPortalCount; + uint8 mWaveId; + + void Reset() + { + + TimeRiftWave_Timer = 15000; + mRiftWaveCount = 0; + + if (!pInstance) + return; + + mPortalCount = pInstance->GetData(DATA_PORTAL_COUNT); + + if (mPortalCount < 6) + mWaveId = 0; + else if (mPortalCount > 12) + mWaveId = 2; + else mWaveId = 1; + + } + void EnterCombat(Unit *who) {} + + void DoSummonAtRift(uint32 creature_entry) + { + if (!creature_entry) + return; + + if (pInstance->GetData(TYPE_MEDIVH) != IN_PROGRESS) + { + m_creature->InterruptNonMeleeSpells(true); + m_creature->RemoveAllAuras(); + return; + } + + float x,y,z; + m_creature->GetRandomPoint(m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ(),10.0f,x,y,z); + + //normalize Z-level if we can, if rift is not at ground level. + z = std::max(m_creature->GetMap()->GetHeight(x, y, MAX_HEIGHT), m_creature->GetMap()->GetWaterLevel(x, y)); + + Unit *Summon = m_creature->SummonCreature(creature_entry,x,y,z,m_creature->GetOrientation(), + TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); + + if (Summon) + { + if (Unit *temp = Unit::GetUnit(*m_creature,pInstance->GetData64(DATA_MEDIVH))) + Summon->AddThreat(temp,0.0f); + } + } + + void DoSelectSummon() + { + uint32 entry = 0; + + if ((mRiftWaveCount > 2 && mWaveId < 1) || mRiftWaveCount > 3) + mRiftWaveCount = 0; + + entry = PortalWaves[mWaveId].PortalMob[mRiftWaveCount]; + debug_log("TSCR: npc_time_rift: summoning wave Creature (Wave %u, Entry %u).",mRiftWaveCount,entry); + + ++mRiftWaveCount; + + if (entry == C_WHELP) + { + for(uint8 i = 0; i < 3; ++i) + DoSummonAtRift(entry); + }else DoSummonAtRift(entry); + } + + void UpdateAI(const uint32 diff) + { + if (!pInstance) + return; + + if (TimeRiftWave_Timer < diff) + { + DoSelectSummon(); + TimeRiftWave_Timer = 15000; + }else TimeRiftWave_Timer -= diff; + + if (m_creature->IsNonMeleeSpellCasted(false)) + return; + + debug_log("TSCR: npc_time_rift: not casting anylonger, i need to die."); + m_creature->setDeathState(JUST_DIED); + + if (pInstance->GetData(TYPE_RIFT) == IN_PROGRESS) + pInstance->SetData(TYPE_RIFT,SPECIAL); + } +}; + +CreatureAI* GetAI_npc_time_rift(Creature* pCreature) +{ + return new npc_time_riftAI (pCreature); +} + +#define SAY_SAAT_WELCOME -1269019 + +#define GOSSIP_ITEM_OBTAIN "[PH] Obtain Chrono-Beacon" +#define SPELL_CHRONO_BEACON 34975 +#define ITEM_CHRONO_BEACON 24289 + +bool GossipHello_npc_saat(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->GetQuestStatus(QUEST_OPENING_PORTAL) == QUEST_STATUS_INCOMPLETE && !pPlayer->HasItemCount(ITEM_CHRONO_BEACON,1)) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT,GOSSIP_ITEM_OBTAIN,GOSSIP_SENDER_MAIN,GOSSIP_ACTION_INFO_DEF+1); + pPlayer->SEND_GOSSIP_MENU(10000, pCreature->GetGUID()); + return true; + } + else if (pPlayer->GetQuestRewardStatus(QUEST_OPENING_PORTAL) && !pPlayer->HasItemCount(ITEM_CHRONO_BEACON,1)) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT,GOSSIP_ITEM_OBTAIN,GOSSIP_SENDER_MAIN,GOSSIP_ACTION_INFO_DEF+1); + pPlayer->SEND_GOSSIP_MENU(10001, pCreature->GetGUID()); + return true; + } + + pPlayer->SEND_GOSSIP_MENU(10002, pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_saat(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + { + pPlayer->CLOSE_GOSSIP_MENU(); + pCreature->CastSpell(pPlayer,SPELL_CHRONO_BEACON,false); + } + return true; +} + +void AddSC_dark_portal() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "npc_medivh_bm"; + newscript->GetAI = &GetAI_npc_medivh_bm; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_time_rift"; + newscript->GetAI = &GetAI_npc_time_rift; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_saat"; + newscript->pGossipHello = &GossipHello_npc_saat; + newscript->pGossipSelect = &GossipSelect_npc_saat; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/dark_portal/def_dark_portal.h b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/dark_portal/def_dark_portal.h new file mode 100644 index 00000000000..7bfd8c917d7 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/dark_portal/def_dark_portal.h @@ -0,0 +1,35 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 +* This program is free software licensed under GPL version 2 +* Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_DARKPORTAL_H +#define DEF_DARKPORTAL_H + +#define TYPE_MEDIVH 1 +#define TYPE_RIFT 2 + +#define DATA_MEDIVH 10 +#define DATA_PORTAL_COUNT 11 +#define DATA_SHIELD 12 + +#define WORLD_STATE_BM 2541 +#define WORLD_STATE_BM_SHIELD 2540 +#define WORLD_STATE_BM_RIFT 2784 + +#define QUEST_OPENING_PORTAL 10297 +#define QUEST_MASTER_TOUCH 9836 + +#define C_TIME_KEEPER 17918 +#define C_RKEEP 21104 +#define C_RLORD 17839 +#define C_DEJA 17879 +#define C_TEMPO 17880 +#define C_AEONUS 17881 +#define C_ASSAS 17835 +#define C_WHELP 21818 +#define C_CHRON 17892 +#define C_EXECU 18994 +#define C_VANQU 18995 + +#endif + diff --git a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/dark_portal/instance_dark_portal.cpp b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/dark_portal/instance_dark_portal.cpp new file mode 100644 index 00000000000..f406bca7113 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/dark_portal/instance_dark_portal.cpp @@ -0,0 +1,351 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +/* ScriptData +SDName: Instance_Dark_Portal +SD%Complete: 50 +SDComment: Quest support: 9836, 10297. Currently in progress. +SDCategory: Caverns of Time, The Dark Portal +EndScriptData */ + +#include "precompiled.h" +#include "def_dark_portal.h" + +#define MAX_ENCOUNTER 2 + +#define C_MEDIVH 15608 +#define C_TIME_RIFT 17838 + +#define SPELL_RIFT_CHANNEL 31387 + +#define RIFT_BOSS 1 + +inline uint32 RandRiftBoss() { return ((rand()%2) ? C_RKEEP : C_RLORD); } + +float PortalLocation[4][4]= +{ + {-2041.06, 7042.08, 29.99, 1.30}, + {-1968.18, 7042.11, 21.93, 2.12}, + {-1885.82, 7107.36, 22.32, 3.07}, + {-1928.11, 7175.95, 22.11, 3.44} +}; + +struct Wave +{ + uint32 PortalBoss; //protector of current portal + uint32 NextPortalTime; //time to next portal, or 0 if portal boss need to be killed +}; + +static Wave RiftWaves[]= +{ + {RIFT_BOSS, 0}, + {C_DEJA, 0}, + {RIFT_BOSS, 120000}, + {C_TEMPO, 140000}, + {RIFT_BOSS, 120000}, + {C_AEONUS, 0} +}; + +struct TRINITY_DLL_DECL instance_dark_portal : public ScriptedInstance +{ + instance_dark_portal(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + + uint32 mRiftPortalCount; + uint32 mShieldPercent; + uint8 mRiftWaveCount; + uint8 mRiftWaveId; + + uint32 NextPortal_Timer; + + uint64 MedivhGUID; + uint8 CurrentRiftId; + + void Initialize() + { + MedivhGUID = 0; + Clear(); + } + + void Clear() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + mRiftPortalCount = 0; + mShieldPercent = 100; + mRiftWaveCount = 0; + mRiftWaveId = 0; + + CurrentRiftId = 0; + + NextPortal_Timer = 0; + } + + void InitWorldState(bool Enable = true) + { + DoUpdateWorldState(WORLD_STATE_BM,Enable ? 1 : 0); + DoUpdateWorldState(WORLD_STATE_BM_SHIELD, 100); + DoUpdateWorldState(WORLD_STATE_BM_RIFT, 0); + } + + bool IsEncounterInProgress() + { + if (GetData(TYPE_MEDIVH) == IN_PROGRESS) + return true; + + return false; + } + + void OnPlayerEnter(Player* pPlayer) + { + if (GetData(TYPE_MEDIVH) == IN_PROGRESS) + return; + + pPlayer->SendUpdateWorldState(WORLD_STATE_BM,0); + } + + void OnCreatureCreate(Creature* pCreature, bool add) + { + if (pCreature->GetEntry() == C_MEDIVH) + MedivhGUID = pCreature->GetGUID(); + } + + //what other conditions to check? + bool CanProgressEvent() + { + if (instance->GetPlayers().isEmpty()) + return false; + + return true; + } + + uint8 GetRiftWaveId() + { + switch(mRiftPortalCount) + { + case 6: + mRiftWaveId = 2; + return 1; + case 12: + mRiftWaveId = 4; + return 3; + case 18: + return 5; + default: + return mRiftWaveId; + } + } + + void SetData(uint32 type, uint32 data) + { + switch(type) + { + case TYPE_MEDIVH: + if (data == SPECIAL && m_auiEncounter[0] == IN_PROGRESS) + { + --mShieldPercent; + + DoUpdateWorldState(WORLD_STATE_BM_SHIELD, mShieldPercent); + + if (!mShieldPercent) + { + if (Creature* pMedivh = instance->GetCreature(MedivhGUID)) + { + if (pMedivh->isAlive()) + { + pMedivh->DealDamage(pMedivh, pMedivh->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + m_auiEncounter[0] = FAIL; + m_auiEncounter[1] = NOT_STARTED; + } + } + } + } + else + { + if (data == IN_PROGRESS) + { + debug_log("TSCR: Instance Dark Portal: Starting event."); + InitWorldState(); + m_auiEncounter[1] = IN_PROGRESS; + NextPortal_Timer = 15000; + } + + if (data == DONE) + { + //this may be completed further out in the post-event + debug_log("TSCR: Instance Dark Portal: Event completed."); + Map::PlayerList const& players = instance->GetPlayers(); + + if (!players.isEmpty()) + { + for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + { + if (Player* pPlayer = itr->getSource()) + { + if (pPlayer->GetQuestStatus(QUEST_OPENING_PORTAL) == QUEST_STATUS_INCOMPLETE) + pPlayer->AreaExploredOrEventHappens(QUEST_OPENING_PORTAL); + + if (pPlayer->GetQuestStatus(QUEST_MASTER_TOUCH) == QUEST_STATUS_INCOMPLETE) + pPlayer->AreaExploredOrEventHappens(QUEST_MASTER_TOUCH); + } + } + } + } + + m_auiEncounter[0] = data; + } + break; + case TYPE_RIFT: + if (data == SPECIAL) + { + if (mRiftPortalCount < 7) + NextPortal_Timer = 5000; + } + else + m_auiEncounter[1] = data; + break; + } + } + + uint32 GetData(uint32 type) + { + switch(type) + { + case TYPE_MEDIVH: + return m_auiEncounter[0]; + case TYPE_RIFT: + return m_auiEncounter[1]; + case DATA_PORTAL_COUNT: + return mRiftPortalCount; + case DATA_SHIELD: + return mShieldPercent; + } + return 0; + } + + uint64 GetData64(uint32 data) + { + if (data == DATA_MEDIVH) + return MedivhGUID; + + return 0; + } + + Creature* SummonedPortalBoss(Creature* pSource) + { + uint32 entry = RiftWaves[GetRiftWaveId()].PortalBoss; + + if (entry == RIFT_BOSS) + entry = RandRiftBoss(); + + float x,y,z; + pSource->GetRandomPoint(pSource->GetPositionX(),pSource->GetPositionY(),pSource->GetPositionZ(),10.0f,x,y,z); + //normalize Z-level if we can, if rift is not at ground level. + z = std::max(instance->GetHeight(x, y, MAX_HEIGHT), instance->GetWaterLevel(x, y)); + + debug_log("TSCR: Instance Dark Portal: Summoning rift boss entry %u.",entry); + + Creature* pSummoned = pSource->SummonCreature(entry,x,y,z,pSource->GetOrientation(), + TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); + + if (pSummoned) + return pSummoned; + + debug_log("TSCR: Instance Dark Portal: what just happened there? No boss, no loot, no fun..."); + return NULL; + } + + void DoSpawnPortal() + { + if (Creature* pMedivh = instance->GetCreature(MedivhGUID)) + { + int tmp = rand()%(4-1); + + if (tmp >= CurrentRiftId) + tmp++; + debug_log("TSCR: Instance Dark Portal: Creating Time Rift at locationId %i (old locationId was %u).",tmp,CurrentRiftId); + + CurrentRiftId = tmp; + + Creature* pTemp = pMedivh->SummonCreature(C_TIME_RIFT, + PortalLocation[tmp][0],PortalLocation[tmp][1],PortalLocation[tmp][2],PortalLocation[tmp][3], + TEMPSUMMON_CORPSE_DESPAWN,0); + if (pTemp) + { + + pTemp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + pTemp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + + + if (Creature* pBoss = SummonedPortalBoss(pTemp)) + { + if (pBoss->GetEntry() == C_AEONUS) + { + pBoss->AddThreat(pMedivh,0.0f); + } + else + { + pBoss->AddThreat(pTemp,0.0f); + pTemp->CastSpell(pBoss,SPELL_RIFT_CHANNEL,false); + } + } + } + } + } + + void Update(uint32 diff) + { + if (m_auiEncounter[1] != IN_PROGRESS) + return; + + //add delay timer? + if (!CanProgressEvent()) + { + Clear(); + return; + } + + if (NextPortal_Timer) + { + if (NextPortal_Timer <= diff) + { + ++mRiftPortalCount; + + DoUpdateWorldState(WORLD_STATE_BM_RIFT, mRiftPortalCount); + + DoSpawnPortal(); + NextPortal_Timer = RiftWaves[GetRiftWaveId()].NextPortalTime; + }else NextPortal_Timer -= diff; + } + } +}; + +InstanceData* GetInstanceData_instance_dark_portal(Map* pMap) +{ + return new instance_dark_portal(pMap); +} + +void AddSC_instance_dark_portal() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "instance_dark_portal"; + newscript->GetInstanceData = &GetInstanceData_instance_dark_portal; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/boss_anetheron.cpp b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/boss_anetheron.cpp new file mode 100644 index 00000000000..9f2971083e4 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/boss_anetheron.cpp @@ -0,0 +1,312 @@ + +#include "precompiled.h" +#include "def_hyjal.h" +#include "hyjal_trash.h" + +#define SPELL_CARRION_SWARM 31306 +#define SPELL_SLEEP 31298 +#define SPELL_VAMPIRIC_AURA 38196 +#define SPELL_INFERNO 31299 + +#define SAY_ONDEATH "The clock... is still... ticking." +#define SOUND_ONDEATH 10982 + +#define SAY_ONSLAY1 "Your hopes are lost!" +#define SAY_ONSLAY2 "Scream for me!" +#define SAY_ONSLAY3 "Pity, no time for a slow death!" +#define SOUND_ONSLAY1 10981 +#define SOUND_ONSLAY2 11038 +#define SOUND_ONSLAY3 11039 + +#define SAY_SWARM1 "The swarm is eager to feed!" +#define SAY_SWARM2 "Pestilence upon you!" +#define SOUND_SWARM1 10979 +#define SOUND_SWARM2 11037 + +#define SAY_SLEEP1 "You look tired..." +#define SAY_SLEEP2 "Sweet dreams..." +#define SOUND_SLEEP1 10978 +#define SOUND_SLEEP2 11545 + +#define SAY_INFERNO1 "Let fire rain from above!" +#define SAY_INFERNO2 "Earth and sky shall burn!" +#define SOUND_INFERNO1 10980 +#define SOUND_INFERNO2 11036 + +#define SAY_ONAGGRO "You are defenders of a doomed world! Flee here, and perhaps you will prolong your pathetic lives!" +#define SOUND_ONAGGRO 10977 + +struct TRINITY_DLL_DECL boss_anetheronAI : public hyjal_trashAI +{ + boss_anetheronAI(Creature *c) : hyjal_trashAI(c) + { + pInstance = c->GetInstanceData(); + pGo = false; + pos = 0; + SpellEntry *TempSpell = GET_SPELL(SPELL_SLEEP); + if (TempSpell && TempSpell->EffectImplicitTargetA[0] != 1) + { + TempSpell->EffectImplicitTargetA[0] = 1; + TempSpell->EffectImplicitTargetB[0] = 0; + } + } + + uint32 SwarmTimer; + uint32 SleepTimer; + uint32 AuraTimer; + uint32 InfernoTimer; + bool pGo; + uint32 pos; + + void Reset() + { + damageTaken = 0; + SwarmTimer = 45000; + SleepTimer = 60000; + AuraTimer = 5000; + InfernoTimer = 45000; + + if (pInstance && IsEvent) + pInstance->SetData(DATA_ANETHERONEVENT, NOT_STARTED); + } + + void EnterCombat(Unit *who) + { + if (pInstance && IsEvent) + pInstance->SetData(DATA_ANETHERONEVENT, IN_PROGRESS); + DoPlaySoundToSet(m_creature, SOUND_ONAGGRO); + m_creature->MonsterYell(SAY_ONAGGRO, LANG_UNIVERSAL, 0); + } + + void KilledUnit(Unit *victim) + { + switch(rand()%3) + { + case 0: + DoPlaySoundToSet(m_creature, SOUND_ONSLAY1); + m_creature->MonsterYell(SAY_ONSLAY1, LANG_UNIVERSAL, 0); + break; + case 1: + DoPlaySoundToSet(m_creature, SOUND_ONSLAY2); + m_creature->MonsterYell(SAY_ONSLAY2, LANG_UNIVERSAL, 0); + break; + case 2: + DoPlaySoundToSet(m_creature, SOUND_ONSLAY3); + m_creature->MonsterYell(SAY_ONSLAY3, LANG_UNIVERSAL, 0); + break; + } + } + + void WaypointReached(uint32 i) + { + pos = i; + if (i == 7 && pInstance) + { + Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_JAINAPROUDMOORE)); + if (target && target->isAlive()) + m_creature->AddThreat(target,0.0); + } + } + + void JustDied(Unit *victim) + { + hyjal_trashAI::JustDied(victim); + if (pInstance && IsEvent) + pInstance->SetData(DATA_ANETHERONEVENT, DONE); + DoPlaySoundToSet(m_creature, SOUND_ONDEATH); + m_creature->MonsterYell(SAY_ONDEATH, LANG_UNIVERSAL, 0); + } + + void UpdateAI(const uint32 diff) + { + if (IsEvent) + { + //Must update npc_escortAI + npc_escortAI::UpdateAI(diff); + if (!pGo) + { + pGo = true; + if (pInstance) + { + AddWaypoint(0, 4896.08, -1576.35, 1333.65); + AddWaypoint(1, 4898.68, -1615.02, 1329.48); + AddWaypoint(2, 4907.12, -1667.08, 1321.00); + AddWaypoint(3, 4963.18, -1699.35, 1340.51); + AddWaypoint(4, 4989.16, -1716.67, 1335.74); + AddWaypoint(5, 5026.27, -1736.89, 1323.02); + AddWaypoint(6, 5037.77, -1770.56, 1324.36); + AddWaypoint(7, 5067.23, -1789.95, 1321.17); + Start(false, true); + SetDespawnAtEnd(false); + } + } + } + + //Return since we have no target + if (!UpdateVictim()) + return; + + if (SwarmTimer < diff) + { + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM,0,100,true)) + DoCast(target,SPELL_CARRION_SWARM); + + SwarmTimer = 45000+rand()%15000; + switch(rand()%2) + { + case 0: + DoPlaySoundToSet(m_creature, SOUND_SWARM1); + m_creature->MonsterYell(SAY_SWARM1, LANG_UNIVERSAL, 0); + break; + case 1: + DoPlaySoundToSet(m_creature, SOUND_SWARM2); + m_creature->MonsterYell(SAY_SWARM2, LANG_UNIVERSAL, 0); + break; + } + }else SwarmTimer -= diff; + + if (SleepTimer < diff) + { + for(uint8 i=0;i<3; ++i) + { + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM,0,100,true)) + target->CastSpell(target,SPELL_SLEEP,true); + } + SleepTimer = 60000; + switch(rand()%2) + { + case 0: + DoPlaySoundToSet(m_creature, SOUND_SLEEP1); + m_creature->MonsterYell(SAY_SLEEP1, LANG_UNIVERSAL, 0); + break; + case 1: + DoPlaySoundToSet(m_creature, SOUND_SLEEP2); + m_creature->MonsterYell(SAY_SLEEP2, LANG_UNIVERSAL, 0); + break; + } + }else SleepTimer -= diff; + if (AuraTimer < diff) + { + DoCast(m_creature, SPELL_VAMPIRIC_AURA,true); + AuraTimer = 10000+rand()%10000; + }else AuraTimer -= diff; + if (InfernoTimer < diff) + { + DoCast(SelectTarget(SELECT_TARGET_RANDOM,0,100,true), SPELL_INFERNO); + InfernoTimer = 45000; + switch(rand()%2) + { + case 0: + DoPlaySoundToSet(m_creature, SOUND_INFERNO1); + m_creature->MonsterYell(SAY_INFERNO1, LANG_UNIVERSAL, 0); + break; + case 1: + DoPlaySoundToSet(m_creature, SOUND_INFERNO2); + m_creature->MonsterYell(SAY_INFERNO2, LANG_UNIVERSAL, 0); + break; + } + }else InfernoTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_anetheron(Creature* pCreature) +{ + return new boss_anetheronAI (pCreature); +} + +#define SPELL_IMMOLATION 31303 +#define SPELL_INFERNO_EFFECT 31302 + +struct TRINITY_DLL_DECL mob_towering_infernalAI : public ScriptedAI +{ + mob_towering_infernalAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + if (pInstance) + AnetheronGUID = pInstance->GetData64(DATA_ANETHERON); + } + + uint32 ImmolationTimer; + uint32 CheckTimer; + uint64 AnetheronGUID; + ScriptedInstance* pInstance; + + void Reset() + { + DoCast(m_creature, SPELL_INFERNO_EFFECT); + ImmolationTimer = 5000; + CheckTimer = 5000; + } + + void EnterCombat(Unit *who) + { + + } + + void KilledUnit(Unit *victim) + { + + } + + void JustDied(Unit *victim) + { + + } + + void MoveInLineOfSight(Unit *who) + { + if (m_creature->IsWithinDist(who, 50) && !m_creature->isInCombat() && m_creature->IsHostileTo(who)) + AttackStart(who); + } + + void UpdateAI(const uint32 diff) + { + if (CheckTimer < diff) + { + if (AnetheronGUID) + { + Creature* boss = Unit::GetCreature((*m_creature),AnetheronGUID); + if (!boss || (boss && boss->isDead())) + { + m_creature->setDeathState(JUST_DIED); + m_creature->RemoveCorpse(); + return; + } + } + CheckTimer = 5000; + }else CheckTimer -= diff; + + //Return since we have no target + if (!UpdateVictim()) + return; + + if (ImmolationTimer < diff) + { + DoCast(m_creature, SPELL_IMMOLATION); + ImmolationTimer = 5000; + }else ImmolationTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_towering_infernal(Creature* pCreature) +{ + return new mob_towering_infernalAI (pCreature); +} + +void AddSC_boss_anetheron() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_anetheron"; + newscript->GetAI = &GetAI_boss_anetheron; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_towering_infernal"; + newscript->GetAI = &GetAI_mob_towering_infernal; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/boss_archimonde.cpp b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/boss_archimonde.cpp new file mode 100644 index 00000000000..4819a74fc0c --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/boss_archimonde.cpp @@ -0,0 +1,640 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Archimonde +SD%Complete: 85 +SDComment: Doomfires not completely offlike due to core limitations for random moving. Tyrande and second phase not fully implemented. +SDCategory: Caverns of Time, Mount Hyjal +EndScriptData */ + +#include "precompiled.h" +#include "def_hyjal.h" +#include "SpellAuras.h" +#include "hyjal_trash.h" + +//text id -1534018 are the text used when previous events complete. Not part of this script. +#define SAY_AGGRO -1534019 +#define SAY_DOOMFIRE1 -1534020 +#define SAY_DOOMFIRE2 -1534021 +#define SAY_AIR_BURST1 -1534022 +#define SAY_AIR_BURST2 -1534023 +#define SAY_SLAY1 -1534024 +#define SAY_SLAY2 -1534025 +#define SAY_SLAY3 -1534026 +#define SAY_ENRAGE -1534027 +#define SAY_DEATH -1534028 +#define SAY_SOUL_CHARGE1 -1534029 +#define SAY_SOUL_CHARGE2 -1534030 + +#define SPELL_DENOUEMENT_WISP 32124 +#define SPELL_ANCIENT_SPARK 39349 +#define SPELL_PROTECTION_OF_ELUNE 38528 + +#define SPELL_DRAIN_WORLD_TREE 39140 +#define SPELL_DRAIN_WORLD_TREE_2 39141 + +#define SPELL_FINGER_OF_DEATH 31984 +#define SPELL_HAND_OF_DEATH 35354 +#define SPELL_AIR_BURST 32014 +#define SPELL_GRIP_OF_THE_LEGION 31972 +#define SPELL_DOOMFIRE_STRIKE 31903 //summons two creatures +#define SPELL_DOOMFIRE_SPAWN 32074 +#define SPELL_DOOMFIRE 31945 +#define SPELL_SOUL_CHARGE_YELLOW 32045 +#define SPELL_SOUL_CHARGE_GREEN 32051 +#define SPELL_SOUL_CHARGE_RED 32052 +#define SPELL_UNLEASH_SOUL_YELLOW 32054 +#define SPELL_UNLEASH_SOUL_GREEN 32057 +#define SPELL_UNLEASH_SOUL_RED 32053 +#define SPELL_FEAR 31970 + +#define CREATURE_ARCHIMONDE 17968 +#define CREATURE_DOOMFIRE 18095 +#define CREATURE_DOOMFIRE_SPIRIT 18104 +#define CREATURE_ANCIENT_WISP 17946 +#define CREATURE_CHANNEL_TARGET 22418 + +#define NORDRASSIL_X 5503.713 +#define NORDRASSIL_Y -3523.436 +#define NORDRASSIL_Z 1608.781 + +struct mob_ancient_wispAI : public ScriptedAI +{ + mob_ancient_wispAI(Creature* c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + ArchimondeGUID = 0; + } + + ScriptedInstance* pInstance; + uint64 ArchimondeGUID; + uint32 CheckTimer; + + void Reset() + { + CheckTimer = 1000; + + if (pInstance) + ArchimondeGUID = pInstance->GetData64(DATA_ARCHIMONDE); + + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + } + + void EnterCombat(Unit* who) {} + + void DamageTaken(Unit* done_by, uint32 &damage) { damage = 0; } + + void UpdateAI(const uint32 diff) + { + if (CheckTimer < diff) + { + if (Unit* Archimonde = Unit::GetUnit((*m_creature), ArchimondeGUID)) + { + if ((((Archimonde->GetHealth()*100) / Archimonde->GetMaxHealth()) < 2) || !Archimonde->isAlive()) + DoCast(m_creature, SPELL_DENOUEMENT_WISP); + else + DoCast(Archimonde, SPELL_ANCIENT_SPARK); + } + CheckTimer = 1000; + }else CheckTimer -= diff; + } +}; + +/* This script is merely a placeholder for the Doomfire that triggers Doomfire spell. It will + MoveChase the Doomfire Spirit always, until despawn (AttackStart is called upon it's spawn) */ +struct TRINITY_DLL_DECL mob_doomfireAI : public ScriptedAI +{ + mob_doomfireAI(Creature* c) : ScriptedAI(c) {} + + void Reset() { } + + void MoveInLineOfSight(Unit* who) { } + void EnterCombat(Unit* who) { } + void DamageTaken(Unit *done_by, uint32 &damage) { damage = 0; } +}; + +/* This is the script for the Doomfire Spirit Mob. This mob simply follow players or + travels in random directions if target cannot be found. */ +struct TRINITY_DLL_DECL mob_doomfire_targettingAI : public ScriptedAI +{ + mob_doomfire_targettingAI(Creature* c) : ScriptedAI(c) {} + + uint64 TargetGUID; + uint32 ChangeTargetTimer; + + void Reset() + { + TargetGUID = 0; + ChangeTargetTimer = 5000; + } + + void MoveInLineOfSight(Unit* who) + { + //will update once TargetGUID is 0. In case noone actually moves(not likely) and this is 0 + //when UpdateAI needs it, it will be forced to select randomPoint + if (!TargetGUID && who->GetTypeId() == TYPEID_PLAYER) + TargetGUID = who->GetGUID(); + } + + void EnterCombat(Unit* who) {} + + void DamageTaken(Unit *done_by, uint32 &damage) { damage = 0; } + + void UpdateAI(const uint32 diff) + { + if (ChangeTargetTimer < diff) + { + if (Unit *temp = Unit::GetUnit(*m_creature,TargetGUID)) + { + m_creature->GetMotionMaster()->MoveFollow(temp,0.0f,0.0f); + TargetGUID = 0; + } + else + { + float x,y,z = 0.0; + m_creature->GetRandomPoint(m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 40, x, y, z); + m_creature->GetMotionMaster()->MovePoint(0, x, y, z); + } + + ChangeTargetTimer = 5000; + }else ChangeTargetTimer -= diff; + } +}; + +/* Finally, Archimonde's script. His script isn't extremely complex, most are simply spells on timers. + The only complicated aspect of the battle is Finger of Death and Doomfire, with Doomfire being the + hardest bit to code. Finger of Death is simply a distance check - if no one is in melee range, then + select a random target and cast the spell on them. However, if someone IS in melee range, and this + is NOT the main tank (creature's victim), then we aggro that player and they become the new victim. + For Doomfire, we summon a mob (Doomfire Spirit) for the Doomfire mob to follow. It's spirit will + randomly select it's target to follow and then we create the random movement making it unpredictable. */ + +struct TRINITY_DLL_DECL boss_archimondeAI : public hyjal_trashAI +{ + boss_archimondeAI(Creature *c) : hyjal_trashAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + uint64 DoomfireSpiritGUID; + uint64 WorldTreeGUID; + + uint32 DrainNordrassilTimer; + uint32 FearTimer; + uint32 AirBurstTimer; + uint32 GripOfTheLegionTimer; + uint32 DoomfireTimer; + uint32 SoulChargeTimer; + uint32 SoulChargeCount; + uint32 MeleeRangeCheckTimer; + uint32 HandOfDeathTimer; + uint32 SummonWispTimer; + uint32 WispCount; + uint32 EnrageTimer; + uint32 CheckDistanceTimer; + + bool Enraged; + bool BelowTenPercent; + bool HasProtected; + bool IsChanneling; + + void Reset() + { + if (pInstance) + pInstance->SetData(DATA_ARCHIMONDEEVENT, NOT_STARTED); + + DoomfireSpiritGUID = 0; + damageTaken = 0; + WorldTreeGUID = 0; + + DrainNordrassilTimer = 0; + FearTimer = 42000; + AirBurstTimer = 30000; + GripOfTheLegionTimer = 5000 + rand()%20000; + DoomfireTimer = 20000; + SoulChargeTimer = 2000 + rand()%27000; + SoulChargeCount = 0; + MeleeRangeCheckTimer = 15000; + HandOfDeathTimer = 2000; + WispCount = 0; // When ~30 wisps are summoned, Archimonde dies + EnrageTimer = 600000; // 10 minutes + CheckDistanceTimer = 30000; // This checks if he's too close to the World Tree (75 yards from a point on the tree), if true then he will enrage + SummonWispTimer = 0; + + Enraged = false; + BelowTenPercent = false; + HasProtected = false; + IsChanneling = false; + } + + void EnterCombat(Unit *who) + { + m_creature->InterruptSpell(CURRENT_CHANNELED_SPELL); + DoScriptText(SAY_AGGRO, m_creature); + DoZoneInCombat(); + + if (pInstance) + pInstance->SetData(DATA_ARCHIMONDEEVENT, IN_PROGRESS); + } + + void KilledUnit(Unit *victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + case 2: DoScriptText(SAY_SLAY3, m_creature); break; + } + + if (victim && (victim->GetTypeId() == TYPEID_PLAYER)) + GainSoulCharge(CAST_PLR(victim)); + } + + void GainSoulCharge(Player* victim) + { + switch(victim->getClass()) + { + case CLASS_PRIEST: + case CLASS_PALADIN: + case CLASS_WARLOCK: + victim->CastSpell(m_creature, SPELL_SOUL_CHARGE_RED, true); + break; + case CLASS_MAGE: + case CLASS_ROGUE: + case CLASS_WARRIOR: + victim->CastSpell(m_creature, SPELL_SOUL_CHARGE_YELLOW, true); + break; + case CLASS_DRUID: + case CLASS_SHAMAN: + case CLASS_HUNTER: + victim->CastSpell(m_creature, SPELL_SOUL_CHARGE_GREEN, true); + break; + } + + SoulChargeTimer = 2000 + rand()%28000; + ++SoulChargeCount; + } + + void JustDied(Unit *victim) + { + hyjal_trashAI::JustDied(victim); + DoScriptText(SAY_DEATH, m_creature); + + if (pInstance) + pInstance->SetData(DATA_ARCHIMONDEEVENT, DONE); + } + + bool CanUseFingerOfDeath() + { + // First we check if our current victim is in melee range or not. + Unit* victim = m_creature->getVictim(); + if (victim && m_creature->IsWithinDistInMap(victim, m_creature->GetAttackDistance(victim))) + return false; + + std::list& m_threatlist = m_creature->getThreatManager().getThreatList(); + if (m_threatlist.empty()) + return false; + + std::list targets; + std::list::iterator itr = m_threatlist.begin(); + for(; itr != m_threatlist.end(); ++itr) + { + Unit* pUnit = Unit::GetUnit((*m_creature), (*itr)->getUnitGuid()); + if (pUnit && pUnit->isAlive()) + targets.push_back(pUnit); + } + + if (targets.empty()) + return false; + + targets.sort(ObjectDistanceOrder(m_creature)); + Unit* target = targets.front(); + if (target) + { + if (!m_creature->IsWithinDistInMap(target, m_creature->GetAttackDistance(target))) + return true; // Cast Finger of Death + else // This target is closest, he is our new tank + m_creature->AddThreat(target, m_creature->getThreatManager().getThreat(m_creature->getVictim())); + } + + return false; + } + + void JustSummoned(Creature *summoned) + { + if (summoned->GetEntry() == CREATURE_ANCIENT_WISP) + summoned->AI()->AttackStart(m_creature); + else + { + summoned->setFaction(m_creature->getFaction()); + summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + } + + if (summoned->GetEntry() == CREATURE_DOOMFIRE_SPIRIT) + { + DoomfireSpiritGUID = summoned->GetGUID(); + } + + if (summoned->GetEntry() == CREATURE_DOOMFIRE) + { + summoned->CastSpell(summoned,SPELL_DOOMFIRE_SPAWN,false); + summoned->CastSpell(summoned,SPELL_DOOMFIRE,true,0,0,m_creature->GetGUID()); + + if (Unit *DoomfireSpirit = Unit::GetUnit(*m_creature, DoomfireSpiritGUID)) + { + summoned->GetMotionMaster()->MoveFollow(DoomfireSpirit,0.0f,0.0f); + DoomfireSpiritGUID = 0; + } + } + } + + //this is code doing close to what the summoning spell would do (spell 31903) + void SummonDoomfire(Unit* target) + { + m_creature->SummonCreature(CREATURE_DOOMFIRE_SPIRIT, + target->GetPositionX()+15.0,target->GetPositionY()+15.0,target->GetPositionZ(),0, + TEMPSUMMON_TIMED_DESPAWN, 27000); + + m_creature->SummonCreature(CREATURE_DOOMFIRE, + target->GetPositionX()-15.0,target->GetPositionY()-15.0,target->GetPositionZ(),0, + TEMPSUMMON_TIMED_DESPAWN, 27000); + } + + void UnleashSoulCharge() + { + m_creature->InterruptNonMeleeSpells(false); + + bool HasCast = false; + uint32 chargeSpell = 0; + uint32 unleashSpell = 0; + + switch(rand()%3) + { + case 0: + chargeSpell = SPELL_SOUL_CHARGE_RED; + unleashSpell = SPELL_UNLEASH_SOUL_RED; + break; + case 1: + chargeSpell = SPELL_SOUL_CHARGE_YELLOW; + unleashSpell = SPELL_UNLEASH_SOUL_YELLOW; + break; + case 2: + chargeSpell = SPELL_SOUL_CHARGE_GREEN; + unleashSpell = SPELL_UNLEASH_SOUL_GREEN; + break; + } + + if (m_creature->HasAura(chargeSpell)) + { + m_creature->RemoveAuraFromStack(chargeSpell); + DoCast(m_creature->getVictim(), unleashSpell); + HasCast = true; + SoulChargeCount--; + } + + if (HasCast) + SoulChargeTimer = 2000 + rand()%28000; + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->isInCombat()) + { + if (pInstance) + { + // Do not let the raid skip straight to Archimonde. Visible and hostile ONLY if Azagalor is finished. + if ((pInstance->GetData(DATA_AZGALOREVENT) < DONE) && ((m_creature->GetVisibility() != VISIBILITY_OFF) || (m_creature->getFaction() != 35))) + { + m_creature->SetVisibility(VISIBILITY_OFF); + m_creature->setFaction(35); + } + else if ((pInstance->GetData(DATA_AZGALOREVENT) >= DONE) && ((m_creature->GetVisibility() != VISIBILITY_ON) || (m_creature->getFaction() == 35))) + { + m_creature->setFaction(1720); + m_creature->SetVisibility(VISIBILITY_ON); + } + } + + if (DrainNordrassilTimer < diff) + { + if (!IsChanneling) + { + Creature *temp = m_creature->SummonCreature(CREATURE_CHANNEL_TARGET, NORDRASSIL_X, NORDRASSIL_Y, NORDRASSIL_Z, 0, TEMPSUMMON_TIMED_DESPAWN, 1200000); + + if (temp) + WorldTreeGUID = temp->GetGUID(); + + if (Unit *Nordrassil = Unit::GetUnit(*m_creature, WorldTreeGUID)) + { + Nordrassil->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + Nordrassil->SetDisplayId(11686); + DoCast(Nordrassil, SPELL_DRAIN_WORLD_TREE); + IsChanneling = true; + } + } + + if (Unit *Nordrassil = Unit::GetUnit(*m_creature, WorldTreeGUID)) + { + Nordrassil->CastSpell(m_creature, SPELL_DRAIN_WORLD_TREE_2, true); + DrainNordrassilTimer = 1000; + } + }else DrainNordrassilTimer -= diff; + } + + if (!UpdateVictim()) + return; + + if (((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 10) && !BelowTenPercent && !Enraged) + BelowTenPercent = true; + + if (!Enraged) + { + if (EnrageTimer < diff) + { + if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) > 10) + { + m_creature->GetMotionMaster()->Clear(false); + m_creature->GetMotionMaster()->MoveIdle(); + Enraged = true; + DoScriptText(SAY_ENRAGE, m_creature); + } + }else EnrageTimer -= diff; + + if (CheckDistanceTimer < diff) + { + // To simplify the check, we simply summon a Creature in the location and then check how far we are from the creature + Creature* Check = m_creature->SummonCreature(CREATURE_CHANNEL_TARGET, NORDRASSIL_X, NORDRASSIL_Y, NORDRASSIL_Z, 0, TEMPSUMMON_TIMED_DESPAWN, 2000); + if (Check) + { + Check->SetVisibility(VISIBILITY_OFF); + + if (m_creature->IsWithinDistInMap(Check, 75)) + { + m_creature->GetMotionMaster()->Clear(false); + m_creature->GetMotionMaster()->MoveIdle(); + Enraged = true; + DoScriptText(SAY_ENRAGE, m_creature); + } + } + CheckDistanceTimer = 5000; + }else CheckDistanceTimer -= diff; + } + + if (BelowTenPercent) + { + if (!HasProtected) + { + m_creature->GetMotionMaster()->Clear(false); + m_creature->GetMotionMaster()->MoveIdle(); + + //all members of raid must get this buff + DoCast(m_creature->getVictim(), SPELL_PROTECTION_OF_ELUNE); + HasProtected = true; + Enraged = true; + } + + if (SummonWispTimer < diff) + { + DoSpawnCreature(CREATURE_ANCIENT_WISP, rand()%40, rand()%40, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + SummonWispTimer = 1500; + ++WispCount; + }else SummonWispTimer -= diff; + + if (WispCount >= 30) + m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + } + + if (Enraged) + { + if (HandOfDeathTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_HAND_OF_DEATH); + HandOfDeathTimer = 2000; + }else HandOfDeathTimer -= diff; + return; // Don't do anything after this point. + } + + if (SoulChargeCount) + { + if (SoulChargeTimer < diff) + UnleashSoulCharge(); + else SoulChargeTimer -= diff; + } + + if (GripOfTheLegionTimer < diff) + { + DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_GRIP_OF_THE_LEGION); + GripOfTheLegionTimer = 5000 + rand()%20000; + }else GripOfTheLegionTimer -= diff; + + if (AirBurstTimer < diff) + { + if (rand()%2 == 0) + DoScriptText(SAY_AIR_BURST1, m_creature); + else + DoScriptText(SAY_AIR_BURST2, m_creature); + + DoCast(SelectUnit(SELECT_TARGET_RANDOM, 1), SPELL_AIR_BURST);//not on tank + AirBurstTimer = 25000 + rand()%15000; + }else AirBurstTimer -= diff; + + if (FearTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_FEAR); + FearTimer = 42000; + }else FearTimer -= diff; + + if (DoomfireTimer < diff) + { + if (rand()%2 == 0) + DoScriptText(SAY_DOOMFIRE1, m_creature); + else + DoScriptText(SAY_DOOMFIRE2, m_creature); + + Unit *temp = SelectUnit(SELECT_TARGET_RANDOM, 1); + if (!temp) + temp = m_creature->getVictim(); + + //replace with spell cast 31903 once implicitTarget 73 implemented + SummonDoomfire(temp); + + //supposedly three doomfire can be up at the same time + DoomfireTimer = 20000; + }else DoomfireTimer -= diff; + + if (MeleeRangeCheckTimer < diff) + { + if (CanUseFingerOfDeath()) + { + DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_FINGER_OF_DEATH); + MeleeRangeCheckTimer = 1000; + } + + MeleeRangeCheckTimer = 5000; + }else MeleeRangeCheckTimer -= diff; + + DoMeleeAttackIfReady(); + } + void WaypointReached(uint32 i){} +}; + +CreatureAI* GetAI_boss_archimonde(Creature* pCreature) +{ + return new boss_archimondeAI (pCreature); +} + +CreatureAI* GetAI_mob_doomfire(Creature* pCreature) +{ + return new mob_doomfireAI(pCreature); +} + +CreatureAI* GetAI_mob_doomfire_targetting(Creature* pCreature) +{ + return new mob_doomfire_targettingAI(pCreature); +} + +CreatureAI* GetAI_mob_ancient_wisp(Creature* pCreature) +{ + return new mob_ancient_wispAI(pCreature); +} + +void AddSC_boss_archimonde() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_archimonde"; + newscript->GetAI = &GetAI_boss_archimonde; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_doomfire"; + newscript->GetAI = &GetAI_mob_doomfire; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_doomfire_targetting"; + newscript->GetAI = &GetAI_mob_doomfire_targetting; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_ancient_wisp"; + newscript->GetAI = &GetAI_mob_ancient_wisp; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/boss_azgalor.cpp b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/boss_azgalor.cpp new file mode 100644 index 00000000000..c4c928359c1 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/boss_azgalor.cpp @@ -0,0 +1,288 @@ + +#include "precompiled.h" +#include "def_hyjal.h" +#include "hyjal_trash.h" + +#define SPELL_RAIN_OF_FIRE 31340 +#define SPELL_DOOM 31347 +#define SPELL_HOWL_OF_AZGALOR 31344 +#define SPELL_CLEAVE 31345 +#define SPELL_BERSERK 26662 + +#define SAY_ONDEATH "Your time is almost... up" +#define SOUND_ONDEATH 11002 + +#define SAY_ONSLAY1 "Reesh, hokta!" +#define SAY_ONSLAY2 "Don't fight it" +#define SAY_ONSLAY3 "No one is going to save you" +#define SOUND_ONSLAY1 11001 +#define SOUND_ONSLAY2 11048 +#define SOUND_ONSLAY3 11047 + +#define SAY_DOOM1 "Just a taste... of what awaits you" +#define SAY_DOOM2 "Suffer you despicable insect!" +#define SOUND_DOOM1 11046 +#define SOUND_DOOM2 11000 + +#define SAY_ONAGGRO "Abandon all hope! The legion has returned to finish what was begun so many years ago. This time there will be no escape!" +#define SOUND_ONAGGRO 10999 + +struct TRINITY_DLL_DECL boss_azgalorAI : public hyjal_trashAI +{ + boss_azgalorAI(Creature *c) : hyjal_trashAI(c) + { + pInstance = c->GetInstanceData(); + pGo = false; + pos = 0; + SpellEntry *TempSpell = GET_SPELL(SPELL_HOWL_OF_AZGALOR); + if (TempSpell) + TempSpell->EffectRadiusIndex[0] = 12;//100yards instead of 50000?! + } + + uint32 RainTimer; + uint32 DoomTimer; + uint32 HowlTimer; + uint32 CleaveTimer; + uint32 EnrageTimer; + bool enraged; + + bool pGo; + uint32 pos; + + void Reset() + { + damageTaken = 0; + RainTimer = 20000; + DoomTimer = 50000; + HowlTimer = 30000; + CleaveTimer = 10000; + EnrageTimer = 600000; + enraged = false; + + if (pInstance && IsEvent) + pInstance->SetData(DATA_AZGALOREVENT, NOT_STARTED); + } + + void EnterCombat(Unit *who) + { + if (pInstance && IsEvent) + pInstance->SetData(DATA_AZGALOREVENT, IN_PROGRESS); + DoPlaySoundToSet(m_creature, SOUND_ONAGGRO); + m_creature->MonsterYell(SAY_ONAGGRO, LANG_UNIVERSAL, NULL); + } + + void KilledUnit(Unit *victim) + { + switch(rand()%3) + { + case 0: + DoPlaySoundToSet(m_creature, SOUND_ONSLAY1); + m_creature->MonsterYell(SAY_ONSLAY1, LANG_UNIVERSAL, NULL); + break; + case 1: + DoPlaySoundToSet(m_creature, SOUND_ONSLAY2); + m_creature->MonsterYell(SAY_ONSLAY2, LANG_UNIVERSAL, NULL); + break; + case 2: + DoPlaySoundToSet(m_creature, SOUND_ONSLAY3); + m_creature->MonsterYell(SAY_ONSLAY3, LANG_UNIVERSAL, NULL); + break; + } + } + + void WaypointReached(uint32 i) + { + pos = i; + if (i == 7 && pInstance) + { + Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THRALL)); + if (target && target->isAlive()) + m_creature->AddThreat(target,0.0); + } + } + + void JustDied(Unit *victim) + { + hyjal_trashAI::JustDied(victim); + if (pInstance && IsEvent) + pInstance->SetData(DATA_AZGALOREVENT, DONE); + DoPlaySoundToSet(m_creature, SOUND_ONDEATH); + } + + void UpdateAI(const uint32 diff) + { + if (IsEvent) + { + //Must update npc_escortAI + npc_escortAI::UpdateAI(diff); + if (!pGo) + { + pGo = true; + if (pInstance) + { + AddWaypoint(0, 5492.91, -2404.61, 1462.63); + AddWaypoint(1, 5531.76, -2460.87, 1469.55); + AddWaypoint(2, 5554.58, -2514.66, 1476.12); + AddWaypoint(3, 5554.16, -2567.23, 1479.90); + AddWaypoint(4, 5540.67, -2625.99, 1480.89); + AddWaypoint(5, 5508.16, -2659.2, 1480.15); + AddWaypoint(6, 5489.62, -2704.05, 1482.18); + AddWaypoint(7, 5457.04, -2726.26, 1485.10); + Start(false, true); + SetDespawnAtEnd(false); + } + } + } + + //Return since we have no target + if (!UpdateVictim()) + return; + + if (RainTimer < diff) + { + DoCast(SelectTarget(SELECT_TARGET_RANDOM,0,30,true), SPELL_RAIN_OF_FIRE); + RainTimer = 20000+rand()%15000; + }else RainTimer -= diff; + + if (DoomTimer < diff) + { + DoCast(SelectTarget(SELECT_TARGET_RANDOM,1,100,true), SPELL_DOOM);//never on tank + DoomTimer = 45000+rand()%5000; + }else DoomTimer -= diff; + + if (HowlTimer < diff) + { + DoCast(m_creature, SPELL_HOWL_OF_AZGALOR); + HowlTimer = 30000; + }else HowlTimer -= diff; + + if (CleaveTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_CLEAVE); + CleaveTimer = 10000+rand()%5000; + }else CleaveTimer -= diff; + + if (EnrageTimer < diff && !enraged) + { + m_creature->InterruptNonMeleeSpells(false); + DoCast(m_creature, SPELL_BERSERK, true); + enraged = true; + EnrageTimer = 600000; + }else EnrageTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_azgalor(Creature* pCreature) +{ + return new boss_azgalorAI (pCreature); +} + +#define SPELL_THRASH 12787 +#define SPELL_CRIPPLE 31406 +#define SPELL_WARSTOMP 31408 + +struct TRINITY_DLL_DECL mob_lesser_doomguardAI : public hyjal_trashAI +{ + mob_lesser_doomguardAI(Creature *c) : hyjal_trashAI(c) + { + pInstance = c->GetInstanceData(); + if (pInstance) + AzgalorGUID = pInstance->GetData64(DATA_AZGALOR); + } + + uint32 CrippleTimer; + uint32 WarstompTimer; + uint32 CheckTimer; + uint64 AzgalorGUID; + ScriptedInstance* pInstance; + + void Reset() + { + CrippleTimer = 50000; + WarstompTimer = 10000; + DoCast(m_creature, SPELL_THRASH); + CheckTimer = 5000; + } + + void EnterCombat(Unit *who) + { + } + + void KilledUnit(Unit *victim) + { + + } + + void WaypointReached(uint32 i) + { + + } + + void MoveInLineOfSight(Unit *who) + { + if (m_creature->IsWithinDist(who, 50) && !m_creature->isInCombat() && m_creature->IsHostileTo(who)) + AttackStart(who); + } + + void JustDied(Unit *victim) + { + + } + + void UpdateAI(const uint32 diff) + { + if (CheckTimer < diff) + { + if (AzgalorGUID) + { + Creature* boss = Unit::GetCreature((*m_creature),AzgalorGUID); + if (!boss || (boss && boss->isDead())) + { + m_creature->setDeathState(JUST_DIED); + m_creature->RemoveCorpse(); + return; + } + } + CheckTimer = 5000; + }else CheckTimer -= diff; + + //Return since we have no target + if (!UpdateVictim()) + return; + + if (WarstompTimer < diff) + { + DoCast(m_creature, SPELL_WARSTOMP); + WarstompTimer = 10000+rand()%5000; + }else WarstompTimer -= diff; + + if (CrippleTimer < diff) + { + DoCast(SelectTarget(SELECT_TARGET_RANDOM,0,100,true), SPELL_CRIPPLE); + CrippleTimer = 25000+rand()%5000; + }else CrippleTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_lesser_doomguard(Creature* pCreature) +{ + return new mob_lesser_doomguardAI (pCreature); +} + +void AddSC_boss_azgalor() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_azgalor"; + newscript->GetAI = &GetAI_boss_azgalor; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_lesser_doomguard"; + newscript->GetAI = &GetAI_mob_lesser_doomguard; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/boss_kazrogal.cpp b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/boss_kazrogal.cpp new file mode 100644 index 00000000000..59700ddac0a --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/boss_kazrogal.cpp @@ -0,0 +1,197 @@ + +#include "precompiled.h" +#include "def_hyjal.h" +#include "hyjal_trash.h" + +#define SPELL_CLEAVE 31436 +#define SPELL_WARSTOMP 31480 +#define SPELL_MARK 31447 + +#define SOUND_ONDEATH 11018 + +#define SAY_ONSLAY1 "Shaza-Kiel!" +#define SAY_ONSLAY2 "You... are nothing!" +#define SAY_ONSLAY3 "Miserable nuisance!" +#define SOUND_ONSLAY1 11017 +#define SOUND_ONSLAY2 11053 +#define SOUND_ONSLAY3 11054 + +#define SAY_MARK1 "Your death will be a painful one." +#define SAY_MARK2 "You... are marked." +#define SOUND_MARK1 11016 +#define SOUND_MARK2 11052 + +#define SAY_ONAGGRO "Cry for mercy! Your meaningless lives will soon be forfeit." +#define SOUND_ONAGGRO 11015 + +struct TRINITY_DLL_DECL boss_kazrogalAI : public hyjal_trashAI +{ + boss_kazrogalAI(Creature *c) : hyjal_trashAI(c) + { + pInstance = c->GetInstanceData(); + pGo = false; + pos = 0; + SpellEntry *TempSpell = GET_SPELL(SPELL_MARK); + if (TempSpell && TempSpell->EffectImplicitTargetA[0] != 1) + { + TempSpell->EffectImplicitTargetA[0] = 1; + TempSpell->EffectImplicitTargetB[0] = 0; + } + } + + uint32 CleaveTimer; + uint32 WarStompTimer; + uint32 MarkTimer; + uint32 MarkTimerBase; + bool pGo; + uint32 pos; + + void Reset() + { + damageTaken = 0; + CleaveTimer = 5000; + WarStompTimer = 15000; + MarkTimer = 45000; + MarkTimerBase = 45000; + + if (pInstance && IsEvent) + pInstance->SetData(DATA_KAZROGALEVENT, NOT_STARTED); + } + + void EnterCombat(Unit *who) + { + if (pInstance && IsEvent) + pInstance->SetData(DATA_KAZROGALEVENT, IN_PROGRESS); + DoPlaySoundToSet(m_creature, SOUND_ONAGGRO); + m_creature->MonsterYell(SAY_ONAGGRO, LANG_UNIVERSAL, NULL); + } + + void KilledUnit(Unit *victim) + { + switch(rand()%3) + { + case 0: + DoPlaySoundToSet(m_creature, SOUND_ONSLAY1); + m_creature->MonsterYell(SAY_ONSLAY1, LANG_UNIVERSAL, NULL); + break; + case 1: + DoPlaySoundToSet(m_creature, SOUND_ONSLAY2); + m_creature->MonsterYell(SAY_ONSLAY2, LANG_UNIVERSAL, NULL); + break; + case 2: + DoPlaySoundToSet(m_creature, SOUND_ONSLAY3); + m_creature->MonsterYell(SAY_ONSLAY3, LANG_UNIVERSAL, NULL); + break; + } + } + + void WaypointReached(uint32 i) + { + pos = i; + if (i == 7 && pInstance) + { + Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THRALL)); + if (target && target->isAlive()) + m_creature->AddThreat(target,0.0); + } + } + + void JustDied(Unit *victim) + { + hyjal_trashAI::JustDied(victim); + if (pInstance && IsEvent) + pInstance->SetData(DATA_KAZROGALEVENT, DONE); + DoPlaySoundToSet(m_creature, SOUND_ONDEATH); + } + + void UpdateAI(const uint32 diff) + { + if (IsEvent) + { + //Must update npc_escortAI + npc_escortAI::UpdateAI(diff); + if (!pGo) + { + pGo = true; + if (pInstance) + { + AddWaypoint(0, 5492.91, -2404.61, 1462.63); + AddWaypoint(1, 5531.76, -2460.87, 1469.55); + AddWaypoint(2, 5554.58, -2514.66, 1476.12); + AddWaypoint(3, 5554.16, -2567.23, 1479.90); + AddWaypoint(4, 5540.67, -2625.99, 1480.89); + AddWaypoint(5, 5508.16, -2659.2, 1480.15); + AddWaypoint(6, 5489.62, -2704.05, 1482.18); + AddWaypoint(7, 5457.04, -2726.26, 1485.10); + Start(false, true); + SetDespawnAtEnd(false); + } + } + } + + //Return since we have no target + if (!UpdateVictim()) + return; + + if (CleaveTimer < diff) + { + DoCast(m_creature, SPELL_CLEAVE); + CleaveTimer = 6000+rand()%15000; + }else CleaveTimer -= diff; + + if (WarStompTimer < diff) + { + DoCast(m_creature, SPELL_WARSTOMP); + WarStompTimer = 60000; + }else WarStompTimer -= diff; + + if (m_creature->HasAura(SPELL_MARK)) + m_creature->RemoveAurasDueToSpell(SPELL_MARK); + if (MarkTimer < diff) + { + //cast dummy, useful for bos addons + m_creature->CastCustomSpell(m_creature, SPELL_MARK, NULL, NULL, NULL, false, NULL, NULL, m_creature->GetGUID()); + + std::list t_list = m_creature->getThreatManager().getThreatList(); + for(std::list::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr) + { + Unit *target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()); + if (target && target->GetTypeId() == TYPEID_PLAYER && target->getPowerType() == POWER_MANA) + { + target->CastSpell(target, SPELL_MARK,true);//only cast on mana users + } + } + MarkTimerBase -= 5000; + if (MarkTimerBase < 5500) + MarkTimerBase = 5500; + MarkTimer = MarkTimerBase; + switch(rand()%3) + { + case 0: + DoPlaySoundToSet(m_creature, SOUND_MARK1); + m_creature->MonsterYell(SAY_MARK1, LANG_UNIVERSAL, NULL); + break; + case 1: + DoPlaySoundToSet(m_creature, SOUND_MARK2); + m_creature->MonsterYell(SAY_MARK2, LANG_UNIVERSAL, NULL); + break; + } + }else MarkTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_kazrogal(Creature* pCreature) +{ + return new boss_kazrogalAI (pCreature); +} + +void AddSC_boss_kazrogal() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_kazrogal"; + newscript->GetAI = &GetAI_boss_kazrogal; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/boss_rage_winterchill.cpp b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/boss_rage_winterchill.cpp new file mode 100644 index 00000000000..a7a9adf1676 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/boss_rage_winterchill.cpp @@ -0,0 +1,192 @@ + +#include "precompiled.h" +#include "def_hyjal.h" +#include "hyjal_trash.h" + +#define SPELL_FROST_ARMOR 31256 +#define SPELL_DEATH_AND_DECAY 31258 + +#define SPELL_FROST_NOVA 31250 +#define SPELL_ICEBOLT 31249 + +#define SAY_ONDEATH "You have won this battle, but not... the... war" +#define SOUND_ONDEATH 11026 + +#define SAY_ONSLAY1 "All life must perish!" +#define SAY_ONSLAY2 "Victory to the Legion!" +#define SOUND_ONSLAY1 11025 +#define SOUND_ONSLAY2 11057 + +#define SAY_DECAY1 "Crumble and rot!" +#define SAY_DECAY2 "Ashes to ashes, dust to dust" +#define SOUND_DECAY1 11023 +#define SOUND_DECAY2 11055 + +#define SAY_NOVA1 "Succumb to the icy chill... of death!" +#define SAY_NOVA2 "It will be much colder in your grave" +#define SOUND_NOVA1 11024 +#define SOUND_NOVA2 11058 + +#define SAY_ONAGGRO "The Legion's final conquest has begun! Once again the subjugation of this world is within our grasp. Let none survive!" +#define SOUND_ONAGGRO 11022 + +struct TRINITY_DLL_DECL boss_rage_winterchillAI : public hyjal_trashAI +{ + boss_rage_winterchillAI(Creature *c) : hyjal_trashAI(c) + { + pInstance = c->GetInstanceData(); + pGo = false; + pos = 0; + } + + uint32 FrostArmorTimer; + uint32 DecayTimer; + uint32 NovaTimer; + uint32 IceboltTimer; + bool pGo; + uint32 pos; + + void Reset() + { + damageTaken = 0; + FrostArmorTimer = 37000; + DecayTimer = 45000; + NovaTimer = 15000; + IceboltTimer = 10000; + + if (pInstance && IsEvent) + pInstance->SetData(DATA_RAGEWINTERCHILLEVENT, NOT_STARTED); + } + + void EnterCombat(Unit *who) + { + if (pInstance && IsEvent) + pInstance->SetData(DATA_RAGEWINTERCHILLEVENT, IN_PROGRESS); + DoPlaySoundToSet(m_creature, SOUND_ONAGGRO); + m_creature->MonsterYell(SAY_ONAGGRO, LANG_UNIVERSAL, 0); + } + + void KilledUnit(Unit *victim) + { + switch(rand()%2) + { + case 0: + DoPlaySoundToSet(m_creature, SOUND_ONSLAY1); + m_creature->MonsterYell(SAY_ONSLAY1, LANG_UNIVERSAL, NULL); + break; + case 1: + DoPlaySoundToSet(m_creature, SOUND_ONSLAY2); + m_creature->MonsterYell(SAY_ONSLAY2, LANG_UNIVERSAL, NULL); + break; + } + } + + void WaypointReached(uint32 i) + { + pos = i; + if (i == 7 && pInstance) + { + Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_JAINAPROUDMOORE)); + if (target && target->isAlive()) + m_creature->AddThreat(target,0.0); + } + } + + void JustDied(Unit *victim) + { + hyjal_trashAI::JustDied(victim); + if (pInstance && IsEvent) + pInstance->SetData(DATA_RAGEWINTERCHILLEVENT, DONE); + DoPlaySoundToSet(m_creature, SOUND_ONDEATH); + m_creature->MonsterYell(SAY_ONDEATH, LANG_UNIVERSAL, NULL); + } + + void UpdateAI(const uint32 diff) + { + if (IsEvent) + { + //Must update npc_escortAI + npc_escortAI::UpdateAI(diff); + if (!pGo) + { + pGo = true; + if (pInstance) + { + AddWaypoint(0, 4896.08, -1576.35, 1333.65); + AddWaypoint(1, 4898.68, -1615.02, 1329.48); + AddWaypoint(2, 4907.12, -1667.08, 1321.00); + AddWaypoint(3, 4963.18, -1699.35, 1340.51); + AddWaypoint(4, 4989.16, -1716.67, 1335.74); + AddWaypoint(5, 5026.27, -1736.89, 1323.02); + AddWaypoint(6, 5037.77, -1770.56, 1324.36); + AddWaypoint(7, 5067.23, -1789.95, 1321.17); + Start(false, true); + SetDespawnAtEnd(false); + } + } + } + + //Return since we have no target + if (!UpdateVictim()) + return; + + if (FrostArmorTimer < diff) + { + DoCast(m_creature, SPELL_FROST_ARMOR); + FrostArmorTimer = 40000+rand()%20000; + }else FrostArmorTimer -= diff; + if (DecayTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_DEATH_AND_DECAY); + DecayTimer = 60000+rand()%20000; + switch(rand()%2) + { + case 0: + DoPlaySoundToSet(m_creature, SOUND_DECAY1); + m_creature->MonsterYell(SAY_DECAY1, LANG_UNIVERSAL, NULL); + break; + case 1: + DoPlaySoundToSet(m_creature, SOUND_DECAY2); + m_creature->MonsterYell(SAY_DECAY2, LANG_UNIVERSAL, NULL); + break; + } + }else DecayTimer -= diff; + if (NovaTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_FROST_NOVA); + NovaTimer = 30000+rand()%15000; + switch(rand()%2) + { + case 0: + DoPlaySoundToSet(m_creature, SOUND_NOVA1); + m_creature->MonsterYell(SAY_NOVA1, LANG_UNIVERSAL, NULL); + break; + case 1: + DoPlaySoundToSet(m_creature, SOUND_NOVA2); + m_creature->MonsterYell(SAY_NOVA2, LANG_UNIVERSAL, NULL); + break; + } + }else NovaTimer -= diff; + if (IceboltTimer < diff) + { + DoCast(SelectTarget(SELECT_TARGET_RANDOM,0,40,true), SPELL_ICEBOLT); + IceboltTimer = 11000+rand()%20000; + }else IceboltTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_rage_winterchill(Creature* pCreature) +{ + return new boss_rage_winterchillAI (pCreature); +} + +void AddSC_boss_rage_winterchill() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_rage_winterchill"; + newscript->GetAI = &GetAI_boss_rage_winterchill; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/def_hyjal.h b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/def_hyjal.h new file mode 100644 index 00000000000..c08f28a4f3d --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/def_hyjal.h @@ -0,0 +1,38 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_HYJAL_H +#define DEF_HYJAL_H + +#define ERROR_INST_DATA "TSCR: Instance data not set properly for Mount Hyjal. Encounters will be buggy" + +enum +{ + WORLD_STATE_WAVES = 2842, + WORLD_STATE_ENEMY = 2453, + WORLD_STATE_ENEMYCOUNT = 2454, + + DATA_ANETHERON = 1, + DATA_ANETHERONEVENT = 2, + DATA_ARCHIMONDE = 3, + DATA_ARCHIMONDEEVENT = 4, + DATA_AZGALOR = 5, + DATA_AZGALOREVENT = 6, + DATA_JAINAPROUDMOORE = 7, + DATA_KAZROGAL = 8, + DATA_KAZROGALEVENT = 9, + DATA_RAGEWINTERCHILL = 10, + DATA_RAGEWINTERCHILLEVENT = 11, + DATA_THRALL = 12, + DATA_TYRANDEWHISPERWIND = 13, + DATA_TRASH = 14, + DATA_RESET_TRASH_COUNT = 15, + DATA_ALLIANCE_RETREAT = 16, + DATA_HORDE_RETREAT = 17, + DATA_RAIDDAMAGE = 18, + DATA_RESET_RAIDDAMAGE = 19, + TYPE_RETREAT = 20 +}; +#endif + diff --git a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/hyjal.cpp b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/hyjal.cpp new file mode 100644 index 00000000000..a7861e11ccc --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/hyjal.cpp @@ -0,0 +1,246 @@ + /* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Hyjal +SD%Complete: 80 +SDComment: gossip text id's unknown +SDCategory: Caverns of Time, Mount Hyjal +EndScriptData */ + +/* ContentData +npc_jaina_proudmoore +npc_thrall +npc_tyrande_whisperwind +EndContentData */ + +#include "precompiled.h" +#include "hyjalAI.h" + +#define GOSSIP_ITEM_BEGIN_ALLY "My companions and I are with you, Lady Proudmoore." +#define GOSSIP_ITEM_ANETHERON "We are ready for whatever Archimonde might send our way, Lady Proudmoore." + +#define GOSSIP_ITEM_BEGIN_HORDE "I am with you, Thrall." +#define GOSSIP_ITEM_AZGALOR "We have nothing to fear." + +#define GOSSIP_ITEM_RETREAT "We can't keep this up. Let's retreat!" + +#define GOSSIP_ITEM_TYRANDE "Aid us in defending Nordrassil" +#define ITEM_TEAR_OF_GODDESS 24494 + + +CreatureAI* GetAI_npc_jaina_proudmoore(Creature* pCreature) +{ + hyjalAI* ai = new hyjalAI(pCreature); + + ai->Reset(); + ai->EnterEvadeMode(); + + ai->Spell[0].SpellId = SPELL_BLIZZARD; + ai->Spell[0].Cooldown = 15000 + rand()%20000; + ai->Spell[0].TargetType = TARGETTYPE_RANDOM; + + ai->Spell[1].SpellId = SPELL_PYROBLAST; + ai->Spell[1].Cooldown = 5500 + rand()%4000; + ai->Spell[1].TargetType = TARGETTYPE_RANDOM; + + ai->Spell[2].SpellId = SPELL_SUMMON_ELEMENTALS; + ai->Spell[2].Cooldown = 15000 + rand()%30000; + ai->Spell[2].TargetType = TARGETTYPE_SELF; + + return ai; +} + +bool GossipHello_npc_jaina_proudmoore(Player* pPlayer, Creature* pCreature) +{ + hyjalAI* ai = CAST_AI(hyjalAI, pCreature->AI()); + if (ai->EventBegun) + return false; + + uint32 RageEncounter = ai->GetInstanceData(DATA_RAGEWINTERCHILLEVENT); + uint32 AnetheronEncounter = ai->GetInstanceData(DATA_ANETHERONEVENT); + if (RageEncounter == NOT_STARTED) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BEGIN_ALLY, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + else if (RageEncounter == DONE && AnetheronEncounter == NOT_STARTED) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ANETHERON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + else if (RageEncounter == DONE && AnetheronEncounter == DONE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_RETREAT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + + if (pPlayer->isGameMaster()) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_TRAINER, "[GM] Toggle Debug Timers", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + + pPlayer->SEND_GOSSIP_MENU(907, pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_jaina_proudmoore(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + hyjalAI* ai = CAST_AI(hyjalAI, pCreature->AI()); + switch(uiAction) + { + case GOSSIP_ACTION_INFO_DEF + 1: + ai->StartEvent(pPlayer); + break; + case GOSSIP_ACTION_INFO_DEF + 2: + ai->FirstBossDead = true; + ai->WaveCount = 9; + ai->StartEvent(pPlayer); + break; + case GOSSIP_ACTION_INFO_DEF + 3: + ai->Retreat(); + break; + case GOSSIP_ACTION_INFO_DEF: + ai->Debug = !ai->Debug; + debug_log("TSCR: HyjalAI - Debug mode has been toggled"); + break; + } + return true; +} + +CreatureAI* GetAI_npc_thrall(Creature* pCreature) +{ + hyjalAI* ai = new hyjalAI(pCreature); + + ai->Reset(); + ai->EnterEvadeMode(); + + ai->Spell[0].SpellId = SPELL_CHAIN_LIGHTNING; + ai->Spell[0].Cooldown = 3000 + rand()%5000; + ai->Spell[0].TargetType = TARGETTYPE_VICTIM; + + ai->Spell[1].SpellId = SPELL_SUMMON_DIRE_WOLF; + ai->Spell[1].Cooldown = 6000 + rand()%35000; + ai->Spell[1].TargetType = TARGETTYPE_RANDOM; + + return ai; +} + +bool GossipHello_npc_thrall(Player* pPlayer, Creature* pCreature) +{ + hyjalAI* ai = CAST_AI(hyjalAI, pCreature->AI()); + if (ai->EventBegun) + return false; + + uint32 AnetheronEvent = ai->GetInstanceData(DATA_ANETHERONEVENT); + // Only let them start the Horde phases if Anetheron is dead. + if (AnetheronEvent == DONE && ai->GetInstanceData(DATA_ALLIANCE_RETREAT)) + { + uint32 KazrogalEvent = ai->GetInstanceData(DATA_KAZROGALEVENT); + uint32 AzgalorEvent = ai->GetInstanceData(DATA_AZGALOREVENT); + if (KazrogalEvent == NOT_STARTED) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BEGIN_HORDE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + else if (KazrogalEvent == DONE && AzgalorEvent == NOT_STARTED) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_AZGALOR, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + else if (AzgalorEvent == DONE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_RETREAT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + } + + if (pPlayer->isGameMaster()) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_TRAINER, "[GM] Toggle Debug Timers", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + + pPlayer->SEND_GOSSIP_MENU(907, pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_thrall(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + hyjalAI* ai = CAST_AI(hyjalAI, pCreature->AI()); + ai->DeSpawnVeins();//despawn the alliance veins + switch(uiAction) + { + case GOSSIP_ACTION_INFO_DEF + 1: + ai->StartEvent(pPlayer); + break; + case GOSSIP_ACTION_INFO_DEF + 2: + ai->FirstBossDead = true; + ai->WaveCount = 9; + ai->StartEvent(pPlayer); + break; + case GOSSIP_ACTION_INFO_DEF + 3: + ai->Retreat(); + break; + case GOSSIP_ACTION_INFO_DEF: + ai->Debug = !ai->Debug; + debug_log("TSCR: HyjalAI - Debug mode has been toggled"); + break; + } + return true; +} + +CreatureAI* GetAI_npc_tyrande_whisperwind(Creature* pCreature) +{ + hyjalAI* ai = new hyjalAI(pCreature); + ai->Reset(); + ai->EnterEvadeMode(); + return ai; +} + +bool GossipHello_npc_tyrande_whisperwind(Player* pPlayer, Creature* pCreature) +{ + hyjalAI* ai = CAST_AI(hyjalAI, pCreature->AI()); + uint32 AzgalorEvent = ai->GetInstanceData(DATA_AZGALOREVENT); + + // Only let them get item if Azgalor is dead. + if (AzgalorEvent == DONE && !pPlayer->HasItemCount(ITEM_TEAR_OF_GODDESS,1)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_TYRANDE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + pPlayer->SEND_GOSSIP_MENU(907, pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_tyrande_whisperwind(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF) + { + ItemPosCountVec dest; + uint8 msg = pPlayer->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, ITEM_TEAR_OF_GODDESS, 1); + if (msg == EQUIP_ERR_OK) + { + Item* item = pPlayer->StoreNewItem(dest, ITEM_TEAR_OF_GODDESS, true); + if (item && pPlayer) + pPlayer->SendNewItem(item,1,true,false,true); + } + pPlayer->SEND_GOSSIP_MENU(907, pCreature->GetGUID()); + hyjalAI* ai = CAST_AI(hyjalAI, pCreature->AI()); + } + return true; +} + +void AddSC_hyjal() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "npc_jaina_proudmoore"; + newscript->GetAI = &GetAI_npc_jaina_proudmoore; + newscript->pGossipHello = &GossipHello_npc_jaina_proudmoore; + newscript->pGossipSelect = &GossipSelect_npc_jaina_proudmoore; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_thrall"; + newscript->GetAI = &GetAI_npc_thrall; + newscript->pGossipHello = &GossipHello_npc_thrall; + newscript->pGossipSelect = &GossipSelect_npc_thrall; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_tyrande_whisperwind"; + newscript->pGossipHello = &GossipHello_npc_tyrande_whisperwind; + newscript->pGossipSelect = &GossipSelect_npc_tyrande_whisperwind; + newscript->GetAI = &GetAI_npc_tyrande_whisperwind; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/hyjalAI.cpp b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/hyjalAI.cpp new file mode 100644 index 00000000000..726ce62b4c9 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/hyjalAI.cpp @@ -0,0 +1,1159 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: HyjalAI +SD%Complete: 90 +SDComment: +SDCategory: Caverns of Time, Mount Hyjal +EndScriptData */ + +#include "precompiled.h" +#include "hyjalAI.h" +#include "hyjal_trash.h" +#include "MapManager.h" +#include "Language.h" +#include "Chat.h" +#include "Object.h" + +#define SPAWN_GARG_GATE 0 +#define SPAWN_WYRM_GATE 1 +#define SPAWN_NEAR_TOWER 2 +// Locations for summoning gargoyls and frost wyrms in special cases +float SpawnPointSpecial[3][3]= +{ + {5497.08, -2493.23, 1535.72}, //spawn point for the gargoyles near the horde gate + {5624.53, -2548.12, 1551.54}, //spawn point for the frost wyrm near the horde gate + {5604.41, -2811.98, 1547.77} //spawn point for the gargoyles and wyrms near the horde tower +}; + +// Locations for summoning waves in Alliance base +float AllianceBase[4][3]= +{ + {4928.48, -1526.38, 1326.83}, + {4923.54, -1514.29, 1327.98}, + {4928.41, -1510.35, 1327.99}, + {4938.35, -1521.00, 1326.69} +}; + +float JainaDummySpawn[2][4]= +{ + {5497.01, -2719.03, 1483.08, 2.90426}, + {5484.98, -2721.69, 1483.39, 6.00656} +}; + + +// Locations for summoning waves in Horde base +float HordeBase[4][3]= +{ + {5458.01, -2340.27, 1459.60}, + {5466.01, -2334.69, 1460.06}, + {5468.45, -2355.13, 1459.99}, + {5479.06, -2344.16, 1461.74} +}; + +// Lady Jaina's waypoints when retreathing +float JainaWPs[2][3]= +{ + {5078.56, -1789.79, 1320.73},//next to the small stairs + {5037.38, -1778.39, 1322.61},//center of alliance base +}; + +float InfernalPos[8][3]=//spawn points for the infernals in the horde base +{ + {5453.59, -2764.52, 1493.50}, + {5478.4, -2781.77, 1497.52}, + {5506.09, -2780.53, 1496.32}, + {5532.1, -2763.42, 1492.37}, + {5544.16, -2733.99, 1487.14}, + {5536.19, -2708.18, 1480.01}, + {5510.16, -2691.75, 1479.66}, + {5482.39, -2689.19, 1481.09} +}; + +float InfernalSPWP[26][4]=//spawn points for the infernals in the horde base used in the cleaning wave +{ + {5490.96, -2718.72, 1482.96, 0.49773}, + {5449.51, -2723.32, 1485.69, 2.69685}, + {5520.83, -2624.68, 1483.82, 1.20459}, + {5558.28, -2629.26, 1485.76, 0.37992}, + {5567.97, -2758.69, 1494.10, 5.04125}, + {5384.90, -2793.47, 1503.90, 5.55412}, + {5495.33, -2814.06, 1501.56, 1.12055}, + {5472.63, -2929.39, 1538.31, 1.95777}, + {5334.72, -2952.29, 1534.34, 0.50869}, + {5398.36, -2872.46, 1512.38, 0.76787}, + {5514.39, -2768.63, 1492.30, 1.55721}, + {5598.91, -2703.75, 1495.64, 2.56644}, + {5467.80, -2655.93, 1482.27, 0.85819}, + {5399.83, -2985.24, 1545.04, 5.92559}, + {5232.13, -2967.05, 1553.09, 5.41351}, + {5272.02, -3082.52, 1567.09, 3.40681}, + {5343.26, -3120.71, 1582.92, 3.16727}, + {5371.26, -3175.24, 1587.41, 6.10466}, + {5434.67, -3177.91, 1579.25, 2.77850}, + {5237.39, -3149.25, 1593.59, 0.83855}, + {5202.15, -3016.64, 1566.28, 3.31256}, + {5302.54, -2914.37, 1528.53, 3.37146}, + {5439.04, -2834.81, 1508.80, 2.14231}, + {5421.33, -2771.04, 1494.28, 6.06223}, + {5549.76, -2692.93, 1482.68, 2.19414}, + {5459.78, -2755.71, 1490.68, 1.05139} +}; + +float VeinPos[14][8]=//spawn points of the ancient gem veins +{ + {5184.84, -1982.59, 1382.66, 2.58079, 0, 0, 0.960944, 0.276742}, //alliance + {5107.66, -2071.16, 1368.37, 2.65148, 0, 0, 0.970124, 0.242611}, //alliance + {5040.53, -2227.65, 1403.17, 3.35049, 0, 0, 0.99455, -0.104257}, //alliance + {5187.59, -2453.12, 1455.51, 5.87943, 0, 0, 0.20051, -0.979692}, //alliance + {5429.43, -2340.65, 1465.38, 4.7681, 0, 0, 0.687138, -0.726527}, //alliance + {5463.99, -2315.95, 1470.29, 1.52045, 0, 0, 0.689084, 0.724682}, //alliance + {5624.65, -2495.09, 1510.11, 0.0124869, 0, 0, 0.00624342, 0.999981}, //alliance + {5285.41, -3348.32, 1663.01, 1.57152, 0, 0, 0.707362, 0.706852}, //horde + {5417.69, -3372.52, 1656.31, 0.361993, 0, 0, 0.18001, 0.983665}, //horde + {5315.34, -3238.32, 1622.88, 3.03627, 0, 0, 0.998614, 0.0526347}, //horde + {5303.4, -3096.44, 1596.41, 1.72073, 0, 0, 0.758081, 0.65216}, //horde + {5265.13, -3177.27, 1616.22, 0.813604, 0, 0, 0.395674, 0.918391}, //horde + {5374.3, -3420.59, 1653.43, 1.45762, 0, 0, 0.665981, 0.745969}, //horde + {5441.54, -3321.59, 1651.55, 0.258306, 0, 0, 0.128794, 0.991671} //horde +}; + +float AllianceOverrunGargPos[5][4]=//gargoyle spawn points in the alliance overrun +{ + {5279.94, -2049.68, 1311.38, 0},//garg1 + {5289.15, -2219.06, 1291.12, 0},//garg2 + {5202.07, -2136.10, 1305.07, 2.8},//garg3 + {5071.52, -2425.63, 1454.48, 5.54},//garg4 + {5120.65, -2467.92, 1463.93, 2.54}//garg5 +}; + +float AllianceFirePos[92][8]=//spawn points for the fire visuals (GO) in the alliance base +{ + {5039.9, -1796.84, 1323.88, 2.59222, 0, 0, 0.962511, 0.271243}, + {5087.2, -1795.2, 1320.68, 1.03946, 0, 0, 0.496644, 0.867954}, + {5112.68, -1806.66, 1359.93, 1.37799, 0, 0, 0.63576, 0.771887}, + {5095.61, -1793.27, 1359.78, 0.580806, 0, 0, 0.286338, 0.958129}, + {5090.43, -1784.45, 1360.44, 0.796784, 0, 0, 0.387937, 0.921686}, + {5139.25, -1783.11, 1359.39, 3.30849, 0, 0, 0.99652, -0.0833509}, + {5112.16, -1763.72, 1361.35, 5.10312, 0, 0, 0.556388, -0.830922}, + {4981.18, -1793.98, 1335.7, 3.23072, 0, 0, 0.999007, -0.0445498}, + {4996.57, -1766.75, 1341.62, 3.5331, 0, 0, 0.980902, -0.194505}, + {4983.74, -1769.25, 1345.75, 3.79228, 0, 0, 0.947541, -0.319635}, + {4996.01, -1774.43, 1330.71, 3.07364, 0, 0, 0.999423, 0.0339693}, + {5094.2, -1726.13, 1330.55, 1.56175, 0, 0, 0.703901, 0.710298}, + {5079.82, -1721.24, 1336.26, 1.18868, 0, 0, 0.559964, 0.828517}, + {5077.68, -1717.15, 1327.78, 0.0145145, 0, 0, 0.00725717, 0.999974}, + {5122.27, -1738.22, 1341.67, 0.835256, 0, 0, 0.405593, 0.914054}, + {5131.88, -1741.15, 1335.25, 2.15472, 0, 0, 0.880712, 0.473653}, + {5196.93, -1772.99, 1345.2, 0.128397, 0, 0, 0.0641544, 0.99794}, + {5225.33, -1756.06, 1344.17, 3.04223, 0, 0, 0.998766, 0.0496599}, + {5224.84, -1767.05, 1360.06, 3.19538, 0, 0, 0.999638, -0.0268922}, + {5202.05, -1763.47, 1361.68, 2.59455, 0, 0, 0.962826, 0.270122}, + {5194.74, -1766.66, 1356.94, 0.0734191, 0, 0, 0.0367013, 0.999326}, + {5159.67, -1832.97, 1344.5, 5.17457, 0, 0, 0.526356, -0.850264}, + {5096.17, -1858.73, 1332.46, 5.30021, 0, 0, 0.471939, -0.881631}, + {5110.7, -1856.59, 1342.84, 5.97564, 0, 0, 0.153167, -0.9882}, + {5109.76, -1855.3, 1332.38, 4.89572, 0, 0, 0.639411, -0.768865}, + {5068.95, -1837.37, 1328.81, 2.61569, 0, 0, 0.965628, 0.25993}, + {5064.4, -1824.77, 1329.02, 2.16409, 0, 0, 0.88292, 0.469524}, + {5059.89, -1848.79, 1329.59, 0.0709955, 0, 0, 0.0354903, 0.99937}, + {5014.37, -1851.39, 1322.56, 4.66949, 0, 0, 0.722111, -0.691777}, + {5025.1, -1848.27, 1323.39, 4.44565, 0, 0, 0.794854, -0.606801}, + {4942.63, -1890.13, 1326.59, 3.28719, 0, 0, 0.997351, -0.0727343}, + {4937.95, -1888.71, 1352.41, 3.41678, 0, 0, 0.990549, -0.13716}, + {4922.48, -1881.92, 1352.41, 5.03077, 0, 0, 0.586075, -0.810257}, + {4915.35, -1894.32, 1351.24, 6.22457, 0, 0, 0.0293048, -0.999571}, + {4922.71, -1904.84, 1352.56, 1.37866, 0, 0, 0.63602, 0.771672}, + {4932.89, -1905.49, 1352.56, 1.89702, 0, 0, 0.812549, 0.582893}, + {5011.83, -1861.05, 1345.86, 4.43777, 0, 0, 0.797239, -0.603664}, + {5011.83, -1861.05, 1363.26, 4.748, 0, 0, 0.694406, -0.719583}, + {5021.46, -1858.35, 1342.17, 4.86188, 0, 0, 0.652329, -0.757936}, + {4995.02, -1698.3, 1370.38, 6.15779, 0, 0, 0.0626579, -0.998035}, + {5119.85, -1728.9, 1336.04, 5.87112, 0, 0, 0.204579, -0.97885}, + {5214.75, -1751.02, 1342.5, 5.08965, 0, 0, 0.561972, -0.827156}, + {5075.04, -1822.43, 1328.87, 3.99951, 0, 0, 0.9094, -0.415924}, + {5057.09, -1823.32, 1350.35, 3.88169, 0, 0, 0.93231, -0.361659}, + {4984.6, -1816.99, 1329.21, 3.05308, 0, 0, 0.999021, 0.0442417}, + {4983.35, -1811.55, 1356.82, 3.33975, 0, 0, 0.995096, -0.098917}, + {4984.11, -1825.73, 1350.76, 2.26375, 0, 0, 0.905211, 0.424962}, + {4968.47, -1786.46, 1354.09, 3.07663, 0, 0, 0.999473, 0.0324733}, + {5061.82, -1751.16, 1339.07, 5.94727, 0, 0, 0.167171, -0.985928}, + {5063.75, -1763, 1351.91, 0.759707, 0, 0, 0.370784, 0.928719}, + {5078.65, -1708.26, 1353.9, 1.27022, 0, 0, 0.593264, 0.805008}, + {4983.19, -1755.96, 1331.13, 4.28221, 0, 0, 0.841733, -0.539894}, + {4972.76, -1755.3, 1332.5, 4.21938, 0, 0, 0.858276, -0.513188}, + {4961.65, -1760.82, 1351.69, 3.56515, 0, 0, 0.977659, -0.210198}, + {5086.45, -1779.83, 1321.62, 6.23157, 0, 0, 0.0258051, -0.999667}, + {5063.15, -1756.74, 1328.56, 0.886926, 0, 0, 0.42907, 0.903271}, + {5042.45, -1800.61, 1323.88, 2.50093, 0, 0, 0.949131, 0.31488}, + {5084.74, -1725.35, 1327.89, 1.65034, 0, 0, 0.734663, 0.678432}, + {4993.25, -1758.1, 1331.07, 3.49995, 0, 0, 0.98399, -0.178223}, + {5078.53, -1867.85, 1348.91, 5.85612, 0, 0, 0.211913, -0.977288}, + {5080.74, -1869.73, 1333.18, 6.18206, 0, 0, 0.0505424, -0.998722}, + {5089.55, -1894.13, 1356.08, 1.52072, 0, 0, 0.689181, 0.724589}, + {5113.24, -1899.49, 1363.77, 1.50108, 0, 0, 0.682034, 0.731321}, + {4984.18, -1907.69, 1325.62, 3.82193, 0, 0, 0.942698, -0.333646}, + {5094.14, -2432.08, 1429.38, 4.70083, 0, 0, 0.711182, -0.703007}, + {5329.89, -2113.30, 1281.06, 5.60560, 0, 0, 0.332347, -0.943157}, + {5170.87, -2148.13, 1278.32, 1.63540, 0, 0, 0.729573, 0.683903 }, + {5132.94, -1960.25, 1367.8, 3.69787, 0, 0, 0.961568, -0.274566}, + {5280.82, -2351.55, 1431.57, 4.46913, 0, 0, 0.787677, -0.616088}, + {5176.78, -2121.43, 1295.27, 3.24153, 0, 0, 0.998752, -0.04995}, + {5332.75, -2101.41, 1296.37, 5.50350, 0, 0, 0.380043, -0.924969}, + {5265.70, -2050.27, 1287.57, 0.50051, 0, 0, 0.247655, 0.968848 }, + {5194.21, -2129.89, 1274.04, 3.08053, 0, 0, 0.999534, 0.0305272}, + {5225.81, -1985.50, 1364.15, 0.37247, 0, 0, 0.185163, 0.982708 }, + {5339.46, -2204.47, 1280.45, 0.99921, 0, 0, 0.479081, 0.877771 }, + {5269.63, -2020.57, 1299.62, 3.00201, 0, 0, 0.997566, 0.0697332}, + {5111.54, -2445.70, 1435.31, 2.70983, 0, 0, 0.976788, 0.214207 }, + {5111.24, -1901.14, 1355.33, 1.61028, 0, 0, 0.720929, 0.693009 }, + {5310.42, -2207.82, 1277.46, 0.50441, 0, 0, 0.249544, 0.968363 }, + {5150.81, -2042.13, 1394.3, 2.21031, 0, 0, 0.893534, 0.448995 }, + {5224.84, -2376.61, 1366.33, 5.0621, 0, 0, 0.573311, -0.819338}, + {5105.41, -2454.86, 1446.16, 4.64584, 0, 0, 0.730239, -0.683191}, + {5309.65, -2188.28, 1266.84, 5.56631, 0, 0, 0.350811, -0.936446}, + {5281.46, -2047.82, 1287.67, 2.44909, 0, 0, 0.940652, 0.339373 }, + {5325.45, -2189.41, 1309.6, 6.23783, 0, 0, 0.0226771, -0.999743}, + {5190.96, -2142.54, 1293.03, 6.25668, 0, 0, 0.0132544, -0.999912}, + {5089.99, -2467.49, 1441.8, 0.77381, 0, 0, 0.377326, 0.92608 }, + {5195.08, -2129.01, 1285.36, 3.55727, 0, 0, 0.978480, -0.206344}, + {5353.76, -2116.28, 1299.27, 6.17894, 0, 0, 0.0521006, -0.998642}, + {5271.14, -2037.38, 1299.24, 4.07879, 0, 0, 0.892201, -0.451638}, + {5332.5 , -2181.28, 1279.95, 4.6906, 0, 0, 0.714768, -0.699362}, + {5108.2 , -2429.84, 1427.73, 4.5194, 0, 0, 0.771943, -0.635691} +}; + +float HordeFirePos[65][8]=//spawn points for the fire visuals (GO) in the horde base +{ + {5524.11, -2612.73, 1483.38, 1.96198, 0, 0, 0.831047, 0.556202}, + {5514.42, -2617.19, 1505.77, 1.82453, 0, 0, 0.790892, 0.611956}, + {5510.21, -2624.77, 1485.34, 1.71065, 0, 0, 0.754783, 0.655974}, + {5570.72, -2619.04, 1487.62, 0.728898, 0, 0, 0.356435, 0.93432}, + {5570.29, -2639.37, 1487.31, 1.49308, 0, 0, 0.679104, 0.734042}, + {5583.56, -2637.2, 1503.78, 1.46559, 0, 0, 0.668951, 0.743307}, + {5571.53, -2626.81, 1510.99, 0.362107, 0, 0, 0.180066, 0.983654}, + {5545.97, -2659.62, 1489.64, 5.07055, 0, 0, 0.569845, -0.821752}, + {5557.44, -2675.91, 1482.58, 1.70118, 0, 0, 0.751671, 0.659539}, + {5594.98, -2742.31, 1495.51, 4.5993, 0, 0, 0.74594, -0.666013}, + {5599.65, -2755.6, 1505.05, 1.66896, 0, 0, 0.740947, 0.671564}, + {5565.95, -2774.75, 1499.48, 6.22425, 0, 0, 0.0294611, -0.999566}, + {5567.1, -2769.7, 1511.17, 5.99257, 0, 0, 0.144799, -0.989461}, + {5572.84, -2774.16, 1527.06, 0.836428, 0, 0, 0.406129, 0.913816}, + {5538.32, -2805.94, 1498.87, 4.30082, 0, 0, 0.836674, -0.547701}, + {5515.66, -2801.74, 1503.53, 5.57316, 0, 0, 0.347602, -0.937642}, + {5516.76, -2827.14, 1501.15, 0.35026, 0, 0, 0.174236, 0.984704}, + {5536.13, -2813.51, 1537.21, 4.51681, 0, 0, 0.772765, -0.634692}, + {5525.05, -2825.16, 1538.53, 0.489275, 0, 0, 0.242205, 0.970225}, + {5534.42, -2815.45, 1562.84, 4.62834, 0, 0, 0.736191, -0.676774}, + {5519.64, -2831.12, 1526.46, 0.611008, 0, 0, 0.300774, 0.953696}, + {5551.04, -2827.55, 1523.5, 3.35206, 0, 0, 0.994468, -0.10504}, + {5469.22, -2802.87, 1503.5, 4.99509, 0, 0, 0.600436, -0.799673}, + {5427.8, -2737.26, 1487.12, 1.78673, 0, 0, 0.779186, 0.626793}, + {5454.1, -2709.1, 1485.92, 3.03552, 0, 0, 0.998594, 0.0530137}, + {5436.3, -2718.2, 1506.02, 2.7567, 0, 0, 0.981539, 0.191261}, + {5412.6, -2740.55, 1510.79, 2.98446, 0, 0, 0.996915, 0.0784832}, + {5406.12, -2752.48, 1521.01, 2.05769, 0, 0, 0.856705, 0.515807}, + {5445.24, -2676.35, 1521.89, 2.91378, 0, 0, 0.99352, 0.113661}, + {5481.4, -2665.08, 1482.23, 4.30001, 0, 0, 0.836895, -0.547363}, + {5443.51, -2675.44, 1487.12, 2.90986, 0, 0, 0.993295, 0.115606}, + {5391.72, -2647.3, 1528.9, 3.76987, 0, 0, 0.951063, -0.308997}, + {5421.09, -2734.12, 1521.01, 2.70567, 0, 0, 0.97634, 0.216242}, + {5405.39, -2710.33, 1533.77, 2.51324, 0, 0, 0.951052, 0.309032}, + {5423.96, -2703.76, 1516.34, 2.79206, 0, 0, 0.984767, 0.173879}, + {5444.75, -2735.23, 1486.37, 2.22657, 0, 0, 0.897155, 0.441715}, + {5570.98, -2747.91, 1495.7, 5.14433, 0, 0, 0.53915, -0.84221}, + {5567.79, -2673.9, 1484.66, 2.72529, 0, 0, 0.978415, 0.20665}, + {5600.71, -2696.8, 1500.42, 0.443704, 0, 0, 0.220036, 0.975492}, + {5600.7, -2693.04, 1515.2, 5.16003, 0, 0, 0.532522, -0.846416}, + {5627.56, -2839.66, 1510.53, 5.41527, 0, 0, 0.420463, -0.907309}, + {5622.02, -2868.71, 1516.22, 2.25482, 0, 0, 0.903303, 0.429002}, + {5586.61, -2878.97, 1510.34, 4.55604, 0, 0, 0.76017, -0.649724}, + {5583.78, -2843.71, 1509.54, 5.35715, 0, 0, 0.44665, -0.894709}, + {5580.95, -2811.3, 1513.3, 3.57587, 0, 0, 0.976518, -0.215434}, + {5542.52, -2869.31, 1523.13, 5.23304, 0, 0, 0.501275, -0.865288}, + {5557.35, -2866.36, 1518.76, 4.48299, 0, 0, 0.783388, -0.621533}, + {5380.91, -2849.36, 1512.81, 3.90962, 0, 0, 0.927168, -0.374646}, + {5395.76, -2881.41, 1521.11, 4.28426, 0, 0, 0.84118, -0.540755}, + {5374.87, -2859.63, 1528.98, 3.30252, 0, 0, 0.996765, -0.0803745}, + {5356.07, -2854.66, 1520.34, 5.83933, 0, 0, 0.220108, -0.975475}, + {5363.01, -2975.72, 1539.02, 4.13738, 0, 0, 0.87859, -0.477576}, + {5336.85, -2980.74, 1561.24, 5.11126, 0, 0, 0.553001, -0.83318}, + {5335.23, -2974.62, 1540.05, 5.04451, 0, 0, 0.580496, -0.814263}, + {5422.37, -2998.87, 1549.98, 4.51831, 0, 0, 0.772288, -0.635272}, + {5405.54, -3014.6, 1562.16, 5.86761, 0, 0, 0.206298, -0.978489}, + {5427.96, -3019.4, 1561.58, 3.53498, 0, 0, 0.980718, -0.19543}, + {5348.12, -2977.84, 1582.47, 3.94025, 0, 0, 0.921323, -0.388799}, + {5331.12, -2993.71, 1576.14, 0.0642734, 0, 0, 0.0321311, 0.999484}, + {5321.63, -2986.55, 1552.2, 5.29503, 0, 0, 0.474219, -0.880407}, + {5292.1, -2914.36, 1529.52, 2.9742, 0, 0, 0.996499, 0.083601}, + {5281.77, -2926.5, 1530.62, 1.67829, 0, 0, 0.744071, 0.6681}, + {5287.19, -2909.94, 1543.49, 3.31192, 0, 0, 0.996376, -0.0850591}, + {5534.15, -2679.35, 1483.61, 0.428685, 0, 0, 0.212705, 0.977116}, + {5545.43, -2647.82, 1483.05, 5.38848, 0, 0, 0.432578, -0.901596} +}; + +hyjalAI::hyjalAI(Creature *c) : npc_escortAI(c), Summons(m_creature) +{ + pInstance = c->GetInstanceData(); + VeinsSpawned[0] = false; + VeinsSpawned[1] = false; + for(uint8 i=0;i<14; ++i) + VeinGUID[i] = 0; + InfernalCount = 0; + TeleportTimer = 1000; + Overrun = false; + Teleported = false; + WaitForTeleport = false; + OverrunCounter = 0; + OverrunCounter2 = 0; + InfernalPoint = 0; + RespawnTimer = 10000; + DoRespawn = false; + DoHide = false; + MassTeleportTimer = 0; + DoMassTeleport = false; +} + +void hyjalAI::JustSummoned(Creature *summoned) +{ + Summons.Summon(summoned); +} + +void hyjalAI::SummonedCreatureDespawn(Creature* summoned) +{ + Summons.Despawn(summoned); +} + +void hyjalAI::Reset() +{ + IsDummy = false; + m_creature->setActive(true); + // GUIDs + PlayerGUID = 0; + BossGUID[0] = 0; + BossGUID[1] = 0; + + // Timers + NextWaveTimer = 10000; + CheckTimer = 0; + RetreatTimer = 1000; + + // Misc + WaveCount = 0; + EnemyCount = 0; + + // Set faction properly based on Creature entry + switch(m_creature->GetEntry()) + { + case JAINA: + Faction = 0; + DoCast(m_creature, SPELL_BRILLIANCE_AURA, true); + break; + + case THRALL: + Faction = 1; + break; + + case TYRANDE: + Faction = 2; + break; + } + + //Bools + EventBegun = false; + FirstBossDead = false; + SecondBossDead = false; + Summon = false; + bRetreat = false; + Debug = false; + + + //Flags + m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + + //Initialize spells + memset(Spell, 0, sizeof(Spell)); + + + + //Reset Instance Data for trash count + if (pInstance) + { + if ((!pInstance->GetData(DATA_ALLIANCE_RETREAT) && m_creature->GetEntry() == JAINA) || (pInstance->GetData(DATA_ALLIANCE_RETREAT) && m_creature->GetEntry() == THRALL)) + { + //Reset World States + pInstance->DoUpdateWorldState(WORLD_STATE_WAVES, 0); + pInstance->DoUpdateWorldState(WORLD_STATE_ENEMY, 0); + pInstance->DoUpdateWorldState(WORLD_STATE_ENEMYCOUNT, 0); + pInstance->SetData(DATA_RESET_TRASH_COUNT, 0); + } + }else error_log(ERROR_INST_DATA); + + //Visibility + DoHide = true; +} + +void hyjalAI::EnterEvadeMode() +{ + if (m_creature->GetEntry() != JAINA) + m_creature->RemoveAllAuras(); + m_creature->DeleteThreatList(); + m_creature->CombatStop(true); + m_creature->LoadCreaturesAddon(); + + if (m_creature->isAlive()) + m_creature->GetMotionMaster()->MoveTargetedHome(); + + m_creature->SetLootRecipient(NULL); +} + +void hyjalAI::EnterCombat(Unit *who) +{ + if (IsDummy)return; + for(uint8 i = 0; i < 3; ++i) + if (Spell[i].Cooldown) + SpellTimer[i] = Spell[i].Cooldown; + + Talk(ATTACKED); +} + +void hyjalAI::MoveInLineOfSight(Unit *who) +{ + if (IsDummy) + return; + + npc_escortAI::MoveInLineOfSight(who); +} + +void hyjalAI::SummonCreature(uint32 entry, float Base[4][3]) +{ + uint32 random = rand()%4; + float SpawnLoc[3]; + + for(uint8 i = 0; i < 3; ++i) + { + SpawnLoc[i] = Base[random][i]; + } + Creature* pCreature = NULL; + switch(entry) + { + case 17906: //GARGOYLE + + if (!FirstBossDead && (WaveCount == 1 || WaveCount == 3)) + {//summon at tower + pCreature = m_creature->SummonCreature(entry, SpawnPointSpecial[SPAWN_NEAR_TOWER][0]+irand(-20,20), SpawnPointSpecial[SPAWN_NEAR_TOWER][1]+irand(-20,20), SpawnPointSpecial[SPAWN_NEAR_TOWER][2]+irand(-10,10), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000); + if (pCreature) + CAST_AI(hyjal_trashAI, pCreature->AI())->useFlyPath = true; + }else{//summon at gate + pCreature = m_creature->SummonCreature(entry, SpawnPointSpecial[SPAWN_GARG_GATE][0]+irand(-10,10), SpawnPointSpecial[SPAWN_GARG_GATE][1]+irand(-10,10), SpawnPointSpecial[SPAWN_GARG_GATE][2]+irand(-10,10), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000); + } + break; + case 17907: //FROST_WYRM , + if (FirstBossDead && WaveCount == 1) + {//summon at gate + pCreature = m_creature->SummonCreature(entry, SpawnPointSpecial[SPAWN_WYRM_GATE][0],SpawnPointSpecial[SPAWN_WYRM_GATE][1],SpawnPointSpecial[SPAWN_WYRM_GATE][2], 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000); + }else{ + pCreature = m_creature->SummonCreature(entry, SpawnPointSpecial[SPAWN_NEAR_TOWER][0], SpawnPointSpecial[SPAWN_NEAR_TOWER][1],SpawnPointSpecial[SPAWN_NEAR_TOWER][2], 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000); + if (pCreature) + CAST_AI(hyjal_trashAI, pCreature->AI())->useFlyPath = true; + } + break; + case 17908: //GIANT_INFERNAL + InfernalCount++; + if (InfernalCount > 7)InfernalCount = 0; + pCreature = m_creature->SummonCreature(entry, InfernalPos[InfernalCount][0], InfernalPos[InfernalCount][1], InfernalPos[InfernalCount][2], 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000); + break; + default: + pCreature = m_creature->SummonCreature(entry, SpawnLoc[0], SpawnLoc[1], SpawnLoc[2], 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000); + break; + + } + + if (pCreature) + { + // Increment Enemy Count to be used in World States and instance script + ++EnemyCount; + + pCreature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + pCreature->setActive(true); + switch(entry) + { + case NECROMANCER: + case ABOMINATION: + case GHOUL: + case BANSHEE: + case CRYPT_FIEND: + case GARGOYLE: + case FROST_WYRM: + case GIANT_INFERNAL: + case FEL_STALKER: + case RAGE_WINTERCHILL: + case ANETHERON: + case KAZROGAL: + case AZGALOR: + CAST_AI(hyjal_trashAI, pCreature->AI())->IsEvent = true; + break; + } + if (pInstance) + { + if (pInstance->GetData(DATA_RAIDDAMAGE) < MINRAIDDAMAGE) + pCreature->SetDisableReputationGain(true);//no repu for solo farming + } + // Check if Creature is a boss. + if (pCreature->isWorldBoss()) + { + if (!FirstBossDead) BossGUID[0] = pCreature->GetGUID(); + else BossGUID[1] = pCreature->GetGUID(); + CheckTimer = 5000; + } + } +} + +void hyjalAI::SummonNextWave(Wave wave[18], uint32 Count, float Base[4][3]) +{ + // 1 in 4 chance we give a rally yell. Not sure if the chance is offilike. + if (rand()%4 == 0) + Talk(RALLY); + + if (!pInstance) + { + error_log(ERROR_INST_DATA); + return; + } + InfernalCount = 0;//reset infernal count every new wave + + EnemyCount = pInstance->GetData(DATA_TRASH); + for(uint8 i = 0; i < 18; ++i) + { + if (wave[Count].Mob[i]) + SummonCreature(wave[Count].Mob[i], Base); + } + + if (!wave[Count].IsBoss) + { + uint32 stateValue = Count+1; + if (FirstBossDead) + stateValue -= 9; // Subtract 9 from it to give the proper wave number if we are greater than 8 + + // Set world state to our current wave number + pInstance->DoUpdateWorldState(WORLD_STATE_WAVES, stateValue); // Set world state to our current wave number + // Enable world state + pInstance->DoUpdateWorldState(WORLD_STATE_ENEMY, 1); // Enable world state + + pInstance->SetData(DATA_TRASH, EnemyCount); // Send data for instance script to update count + + if (!Debug) + NextWaveTimer = wave[Count].WaveTimer; + else + { + NextWaveTimer = 15000; + debug_log("TSCR: HyjalAI: debug mode is enabled. Next Wave in 15 seconds"); + } + } + else + { + // Set world state for waves to 0 to disable it. + pInstance->DoUpdateWorldState(WORLD_STATE_WAVES, 0); + pInstance->DoUpdateWorldState(WORLD_STATE_ENEMY, 1); + + // Set World State for enemies invading to 1. + pInstance->DoUpdateWorldState(WORLD_STATE_ENEMYCOUNT, 1); + + Summon = false; + } + CheckTimer = 5000; +} + +void hyjalAI::StartEvent(Player* pPlayer) +{ + if (!pPlayer || IsDummy || !pInstance) + return; + + Talk(BEGIN); + + EventBegun = true; + Summon = true; + + NextWaveTimer = 15000; + CheckTimer = 5000; + PlayerGUID = pPlayer->GetGUID(); + + m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + + pInstance->DoUpdateWorldState(WORLD_STATE_WAVES, 0); + pInstance->DoUpdateWorldState(WORLD_STATE_ENEMY, 0); + pInstance->DoUpdateWorldState(WORLD_STATE_ENEMYCOUNT, 0); + + DeSpawnVeins(); +} + +uint32 hyjalAI::GetInstanceData(uint32 Event) +{ + if (pInstance) + return pInstance->GetData(Event); + else error_log(ERROR_INST_DATA); + + return 0; +} + +void hyjalAI::Talk(uint32 id) +{ + std::list index; + for(uint8 i = 0; i < 9; ++i) + { + if (Faction == 0) // Alliance + { + if (JainaQuotes[i].id == id) + index.push_back(i); + } + else if (Faction == 1) // Horde + { + if (ThrallQuotes[i].id == id) + index.push_back(i); + } + } + + if (index.empty()) + return; // No quotes found, no use to continue + + uint8 ind = *(index.begin()) + rand()%index.size(); + + int32 YellId = 0; + if (Faction == 0) // Alliance + { + YellId = JainaQuotes[ind].textid; + } + else if (Faction == 1) // Horde + { + YellId = ThrallQuotes[ind].textid; + } + + if (YellId) + DoScriptText(YellId, m_creature); +} + +void hyjalAI::Retreat() +{ + if (pInstance) + { + pInstance->SetData(TYPE_RETREAT,SPECIAL); + + if (Faction == 0) + { + pInstance->SetData(DATA_ALLIANCE_RETREAT, 1); + AddWaypoint(0,JainaWPs[0][0],JainaWPs[0][1],JainaWPs[0][2]); + AddWaypoint(1,JainaWPs[1][0],JainaWPs[1][1],JainaWPs[1][2]); + Start(false, false); + SetDespawnAtEnd(false);//move to center of alliance base + } + if (Faction == 1) + { + pInstance->SetData(DATA_HORDE_RETREAT, 1); + Creature* JainaDummy = m_creature->SummonCreature(JAINA,JainaDummySpawn[0][0],JainaDummySpawn[0][1],JainaDummySpawn[0][2],JainaDummySpawn[0][3],TEMPSUMMON_TIMED_DESPAWN,60000); + if (JainaDummy) + { + JainaDummy->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + CAST_AI(hyjalAI, JainaDummy->AI())->IsDummy = true; + DummyGuid = JainaDummy->GetGUID(); + } + AddWaypoint(0,JainaDummySpawn[1][0],JainaDummySpawn[1][1],JainaDummySpawn[1][2]); + Start(false, false); + SetDespawnAtEnd(false);//move to center of alliance base + } + } + SpawnVeins(); + Overrun = true; + m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);//cant talk after overrun event started +} + +void hyjalAI::SpawnVeins() +{ + if (Faction == 0) + { + if (VeinsSpawned[0])//prevent any buggers + return; + for (uint8 i = 0; i<7; ++i) + { + GameObject* gem = m_creature->SummonGameObject(ANCIENT_VEIN,VeinPos[i][0],VeinPos[i][1],VeinPos[i][2],VeinPos[i][3],VeinPos[i][4],VeinPos[i][5],VeinPos[i][6],VeinPos[i][7],0); + if (gem) + VeinGUID[i]=gem->GetGUID(); + } + VeinsSpawned[0] = true; + }else{ + if (VeinsSpawned[1]) + return; + for (uint8 i = 7; i<14; ++i) + { + GameObject* gem = m_creature->SummonGameObject(ANCIENT_VEIN,VeinPos[i][0],VeinPos[i][1],VeinPos[i][2],VeinPos[i][3],VeinPos[i][4],VeinPos[i][5],VeinPos[i][6],VeinPos[i][7],0); + if (gem) + VeinGUID[i]=gem->GetGUID(); + } + VeinsSpawned[1] = true; + } +} + +void hyjalAI::DeSpawnVeins() +{ + if (!pInstance)return; + if (Faction == 1) + { + Creature* pUnit=Unit::GetCreature((*m_creature),pInstance->GetData64(DATA_JAINAPROUDMOORE)); + if (!pUnit)return; + hyjalAI* ai = CAST_AI(hyjalAI, pUnit->AI()); + if (!ai)return; + for (uint8 i = 0; i<7; ++i) + { + if (GameObject* gem = pInstance->instance->GetGameObject(pInstance->GetData64(ai->VeinGUID[i]))) + gem->Delete(); + } + }else if (Faction) + { + Creature* pUnit=Unit::GetCreature((*m_creature),pInstance->GetData64(DATA_THRALL)); + if (!pUnit)return; + hyjalAI* ai = CAST_AI(hyjalAI, pUnit->AI()); + if (!ai)return; + for (uint8 i = 7; i<14; ++i) + { + if (GameObject* gem = pInstance->instance->GetGameObject(pInstance->GetData64(ai->VeinGUID[i]))) + gem->Delete(); + } + } +} + +void hyjalAI::UpdateAI(const uint32 diff) +{ + if (IsDummy) + { + if (MassTeleportTimer < diff && DoMassTeleport) + { + m_creature->CastSpell(m_creature,SPELL_MASS_TELEPORT,false); + DoMassTeleport = false; + }else MassTeleportTimer -= diff; + return; + } + if (DoHide) + { + DoHide = false; + switch(m_creature->GetEntry()) + { + case JAINA: + if (pInstance->GetData(DATA_ALLIANCE_RETREAT)) + { + m_creature->SetVisibility(VISIBILITY_OFF); + HideNearPos(m_creature->GetPositionX(), m_creature->GetPositionY()); + HideNearPos(5037.76, -1889.71); + for(uint8 i = 0; i < 92; ++i)//summon fires + m_creature->SummonGameObject(FLAMEOBJECT,AllianceFirePos[i][0],AllianceFirePos[i][1],AllianceFirePos[i][2],AllianceFirePos[i][3],AllianceFirePos[i][4],AllianceFirePos[i][5],AllianceFirePos[i][6],AllianceFirePos[i][7],0); + + } + else m_creature->SetVisibility(VISIBILITY_ON); + break; + case THRALL: //thrall + if (pInstance->GetData(DATA_HORDE_RETREAT)) + { + m_creature->SetVisibility(VISIBILITY_OFF); + HideNearPos(m_creature->GetPositionX(), m_creature->GetPositionY()); + HideNearPos(5563, -2763.19); + HideNearPos(5542.2, -2629.36); + for(uint8 i = 0; i < 65; ++i)//summon fires + m_creature->SummonGameObject(FLAMEOBJECT,HordeFirePos[i][0],HordeFirePos[i][1],HordeFirePos[i][2],HordeFirePos[i][3],HordeFirePos[i][4],HordeFirePos[i][5],HordeFirePos[i][6],HordeFirePos[i][7],0); + + } + else m_creature->SetVisibility(VISIBILITY_ON); + break; + } + } + if (DoRespawn) + { + if (RespawnTimer < diff) + { + DoRespawn = false; + RespawnNearPos(m_creature->GetPositionX(), m_creature->GetPositionY()); + if (Faction == 0) + { + RespawnNearPos(5037.76, -1889.71); + }else if (Faction == 1) + { + RespawnNearPos(5563, -2763.19); + RespawnNearPos(5542.2, -2629.36); + } + m_creature->SetVisibility(VISIBILITY_ON); + }else{ + RespawnTimer -= diff; + m_creature->SetVisibility(VISIBILITY_OFF); + } + return; + } + if (Overrun) + DoOverrun(Faction, diff); + if (bRetreat) + { + if (RetreatTimer < diff) + { + IsDummy = true; + bRetreat = false; + HideNearPos(m_creature->GetPositionX(), m_creature->GetPositionY()); + switch(m_creature->GetEntry()) + { + case JAINA://jaina + HideNearPos(5037.76, -1889.71); + break; + case THRALL://thrall + HideNearPos(5563, -2763.19); + HideNearPos(5542.2, -2629.36); + HideNearPos(5603.75, -2853.12); + break; + } + m_creature->SetVisibility(VISIBILITY_OFF); + }else RetreatTimer -= diff; + } + + if (!EventBegun) + return; + + if (Summon) + { + if (pInstance && EnemyCount) + { + EnemyCount = pInstance->GetData(DATA_TRASH); + if (!EnemyCount) + NextWaveTimer = 5000; + } + + if (NextWaveTimer < diff) + { + if (Faction == 0) + SummonNextWave(AllianceWaves, WaveCount, AllianceBase); + else if (Faction == 1) + SummonNextWave(HordeWaves, WaveCount, HordeBase); + ++WaveCount; + }else NextWaveTimer -= diff; + } + + if (CheckTimer < diff) + { + for(uint8 i = 0; i < 2; ++i) + { + if (BossGUID[i]) + { + Unit* pUnit = Unit::GetUnit((*m_creature), BossGUID[i]); + if (pUnit && (!pUnit->isAlive())) + { + if (BossGUID[i] == BossGUID[0]) + { + Talk(INCOMING); + FirstBossDead = true; + } + else if (BossGUID[i] == BossGUID[1]) + { + Talk(SUCCESS); + SecondBossDead = true; + } + EventBegun = false; + CheckTimer = 0; + m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + BossGUID[i] = 0; + pInstance->DoUpdateWorldState(WORLD_STATE_ENEMY, 0); // Reset world state for enemies to disable it + } + } + } + CheckTimer = 5000; + }else CheckTimer -= diff; + + if (!UpdateVictim()) + return; + + for(uint8 i = 0; i < 3; ++i) + { + if (Spell[i].SpellId) + { + if (SpellTimer[i] < diff) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(false); + + Unit* target = NULL; + + switch(Spell[i].TargetType) + { + case TARGETTYPE_SELF: target = m_creature; break; + case TARGETTYPE_RANDOM: target = SelectUnit(SELECT_TARGET_RANDOM, 0); break; + case TARGETTYPE_VICTIM: target = m_creature->getVictim(); break; + } + + if (target && target->isAlive()) + { + DoCast(target, Spell[i].SpellId); + SpellTimer[i] = Spell[i].Cooldown; + } + }else SpellTimer[i] -= diff; + } + } + + DoMeleeAttackIfReady(); +} +void hyjalAI::JustDied(Unit* killer) +{ + if (IsDummy)return; + m_creature->Respawn(); + m_creature->SetVisibility(VISIBILITY_OFF); + DoRespawn = true; + RespawnTimer = 120000; + Talk(DEATH); + Summons.DespawnAll();//despawn all wave's summons + if (pInstance) + {//reset encounter if boss is despawned (ex: thrall is killed, boss despawns, event stucks at inprogress) + if (pInstance->GetData(DATA_RAGEWINTERCHILLEVENT) == IN_PROGRESS) + pInstance->SetData(DATA_RAGEWINTERCHILLEVENT, NOT_STARTED); + if (pInstance->GetData(DATA_ANETHERONEVENT) == IN_PROGRESS) + pInstance->SetData(DATA_ANETHERONEVENT, NOT_STARTED); + if (pInstance->GetData(DATA_KAZROGALEVENT) == IN_PROGRESS) + pInstance->SetData(DATA_KAZROGALEVENT, NOT_STARTED); + if (pInstance->GetData(DATA_AZGALOREVENT) == IN_PROGRESS) + pInstance->SetData(DATA_AZGALOREVENT, NOT_STARTED); + pInstance->SetData(DATA_RESET_RAIDDAMAGE, NULL);//reset damage on die + } +} +void hyjalAI::HideNearPos(float x, float y) +{ + CellPair pair(Trinity::ComputeCellPair(x, y)); + Cell cell(pair); + cell.data.Part.reserved = ALL_DISTRICT; + cell.SetNoCreate(); + + // First get all creatures. + std::list creatures; + Trinity::AllFriendlyCreaturesInGrid creature_check(m_creature); + Trinity::CreatureListSearcher creature_searcher(m_creature, creatures, creature_check); + TypeContainerVisitor + , + GridTypeMapContainer> creature_visitor(creature_searcher); + + CellLock cell_lock(cell, pair); + // Get Creatures + cell_lock->Visit(cell_lock, creature_visitor, *(m_creature->GetMap())); + + if (!creatures.empty()) + { + for(std::list::iterator itr = creatures.begin(); itr != creatures.end(); ++itr) + { + (*itr)->SetVisibility(VISIBILITY_OFF); + (*itr)->setFaction(35);//make them friendly so mobs won't attack them + } + } +} +void hyjalAI::RespawnNearPos(float x, float y) +{ + CellPair p(Trinity::ComputeCellPair(x, y)); + Cell cell(p); + cell.data.Part.reserved = ALL_DISTRICT; + cell.SetNoCreate(); + + Trinity::RespawnDo u_do; + Trinity::WorldObjectWorker worker(m_creature, u_do); + TypeContainerVisitor, GridTypeMapContainer > obj_worker(worker); + CellLock cell_lock(cell, p); + cell_lock->Visit(cell_lock, obj_worker, *m_creature->GetMap()); +} +void hyjalAI::WaypointReached(uint32 i) +{ + if (i == 1 || (i == 0 && m_creature->GetEntry() == THRALL)) + { + m_creature->MonsterYell("Hurry, we don't have much time",0,0); + WaitForTeleport = true; + TeleportTimer = 20000; + if (m_creature->GetEntry() == JAINA) + m_creature->CastSpell(m_creature,SPELL_MASS_TELEPORT,false); + if (m_creature->GetEntry() == THRALL && DummyGuid) + { + Unit* Dummy = Unit::GetUnit((*m_creature),DummyGuid); + if (Dummy) + { + CAST_AI(hyjalAI, CAST_CRE(Dummy)->AI())->DoMassTeleport = true; + CAST_AI(hyjalAI, CAST_CRE(Dummy)->AI())->MassTeleportTimer = 20000; + Dummy->CastSpell(m_creature,SPELL_MASS_TELEPORT,false); + } + } + //do some talking + //all alive guards walk near here + CellPair pair(Trinity::ComputeCellPair(m_creature->GetPositionX(), m_creature->GetPositionY())); + Cell cell(pair); + cell.data.Part.reserved = ALL_DISTRICT; + cell.SetNoCreate(); + + // First get all creatures. + std::list creatures; + Trinity::AllFriendlyCreaturesInGrid creature_check(m_creature); + Trinity::CreatureListSearcher creature_searcher(m_creature, creatures, creature_check); + TypeContainerVisitor + , + GridTypeMapContainer> creature_visitor(creature_searcher); + + CellLock cell_lock(cell, pair); + cell_lock->Visit(cell_lock, creature_visitor, *(m_creature->GetMap())); + + if (!creatures.empty()) + { + for(std::list::iterator itr = creatures.begin(); itr != creatures.end(); ++itr) + { + if ((*itr) && (*itr)->isAlive() && (*itr) != m_creature && (*itr)->GetEntry() != JAINA) + { + if (!(*itr)->IsWithinDist(m_creature, 60)) + (*itr)->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + float x, y, z; + (*itr)->SetDefaultMovementType(IDLE_MOTION_TYPE); + (*itr)->GetMotionMaster()->Initialize(); + float range = 10; + if (m_creature->GetEntry() == THRALL)range = 20; + m_creature->GetNearPoint(m_creature, x, y, z, range, 0, m_creature->GetAngle((*itr))); + (*itr)->GetMotionMaster()->MovePoint(0, x+irand(-5,5), y+irand(-5,5), m_creature->GetPositionZ()); + } + } + } + } +} +void hyjalAI::DoOverrun(uint32 faction, const uint32 diff) +{ + npc_escortAI::UpdateAI(diff); + if (WaitForTeleport) + { + if (TeleportTimer < diff) + { + CellPair pair(Trinity::ComputeCellPair(m_creature->GetPositionX(), m_creature->GetPositionY())); + Cell cell(pair); + cell.data.Part.reserved = ALL_DISTRICT; + cell.SetNoCreate(); + + std::list creatures; + Trinity::AllFriendlyCreaturesInGrid creature_check(m_creature); + Trinity::CreatureListSearcher creature_searcher(m_creature, creatures, creature_check); + TypeContainerVisitor + , + GridTypeMapContainer> creature_visitor(creature_searcher); + + CellLock cell_lock(cell, pair); + cell_lock->Visit(cell_lock, creature_visitor, *(m_creature->GetMap())); + + if (!creatures.empty()) + { + for(std::list::iterator itr = creatures.begin(); itr != creatures.end(); ++itr) + { + if ((*itr) && (*itr)->isAlive()) + { + (*itr)->CastSpell(*itr, SPELL_TELEPORT_VISUAL, true); + (*itr)->setFaction(35);//make them friendly so mobs won't attack them + (*itr)->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + } + } + DoCast(m_creature, SPELL_TELEPORT_VISUAL); + bRetreat = true; + RetreatTimer = 1000; + } + + WaitForTeleport = false; + Teleported = true; + }TeleportTimer -= diff; + } + if (!Teleported) + return; + Overrun = false;//execute once + switch(faction) + { + case 0://alliance + for(uint8 i = 0; i < 92; ++i)//summon fires + m_creature->SummonGameObject(FLAMEOBJECT,AllianceFirePos[i][0],AllianceFirePos[i][1],AllianceFirePos[i][2],AllianceFirePos[i][3],AllianceFirePos[i][4],AllianceFirePos[i][5],AllianceFirePos[i][6],AllianceFirePos[i][7],0); + + for(uint8 i = 0; i < 25; ++i)//summon 25 ghouls + { + uint8 r = rand()%4; + Creature* pUnit = m_creature->SummonCreature(GHOUL, AllianceBase[r][0]+irand(-15,15), AllianceBase[r][1]+irand(-15,15), AllianceBase[r][2], 0, TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000); + if (pUnit) + { + CAST_AI(hyjal_trashAI, pUnit->AI())->faction = Faction; + CAST_AI(hyjal_trashAI, pUnit->AI())->IsOverrun = true; + CAST_AI(hyjal_trashAI, pUnit->AI())->OverrunType = i; + pUnit->setActive(true); + } + } + for(uint8 i = 0; i < 3; ++i)//summon 3 abominations + { + uint8 r = rand()%4; + Creature* pUnit = m_creature->SummonCreature(ABOMINATION, AllianceBase[r][0]+irand(-15,15), AllianceBase[r][1]+irand(-15,15), AllianceBase[r][2], 0, TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000); + if (pUnit) + { + CAST_AI(hyjal_trashAI, pUnit->AI())->faction = Faction; + CAST_AI(hyjal_trashAI, pUnit->AI())->IsOverrun = true; + CAST_AI(hyjal_trashAI, pUnit->AI())->OverrunType = i; + pUnit->setActive(true); + } + } + for(uint8 i = 0; i < 5; ++i)//summon 5 gargoyles + { + Creature* pUnit = m_creature->SummonCreature(GARGOYLE, AllianceOverrunGargPos[i][0], AllianceOverrunGargPos[i][1], AllianceOverrunGargPos[i][2], AllianceOverrunGargPos[i][3], TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000); + if (pUnit) + { + pUnit->SetHomePosition(AllianceOverrunGargPos[i][0], AllianceOverrunGargPos[i][1], AllianceOverrunGargPos[i][2], AllianceOverrunGargPos[i][3]); + CAST_AI(hyjal_trashAI, pUnit->AI())->faction = Faction; + CAST_AI(hyjal_trashAI, pUnit->AI())->IsOverrun = true; + CAST_AI(hyjal_trashAI, pUnit->AI())->OverrunType = i; + pUnit->setActive(true); + } + } + break; + case 1://horde + for(uint8 i = 0; i < 65; ++i)//summon fires + m_creature->SummonGameObject(FLAMEOBJECT,HordeFirePos[i][0],HordeFirePos[i][1],HordeFirePos[i][2],HordeFirePos[i][3],HordeFirePos[i][4],HordeFirePos[i][5],HordeFirePos[i][6],HordeFirePos[i][7],0); + + for(uint8 i = 0; i < 26; ++i)//summon infernals + { + Creature* pUnit = m_creature->SummonCreature(GIANT_INFERNAL, InfernalSPWP[i][0], InfernalSPWP[i][1], InfernalSPWP[i][2], InfernalSPWP[i][3], TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000); + if (pUnit) + { + pUnit->SetHomePosition(InfernalSPWP[i][0], InfernalSPWP[i][1], InfernalSPWP[i][2], InfernalSPWP[i][3]); + CAST_AI(hyjal_trashAI, pUnit->AI())->faction = Faction; + CAST_AI(hyjal_trashAI, pUnit->AI())->IsOverrun = true; + CAST_AI(hyjal_trashAI, pUnit->AI())->OverrunType = i; + pUnit->setActive(true); + } + } + for(uint8 i = 0; i < 25; ++i)//summon 25 ghouls + { + uint8 r = rand()%4; + Creature* pUnit = m_creature->SummonCreature(GHOUL, HordeBase[r][0]+irand(-15,15), HordeBase[r][1]+irand(-15,15), HordeBase[r][2], 0, TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000); + if (pUnit) + { + CAST_AI(hyjal_trashAI, pUnit->AI())->faction = Faction; + CAST_AI(hyjal_trashAI, pUnit->AI())->IsOverrun = true; + CAST_AI(hyjal_trashAI, pUnit->AI())->OverrunType = i; + pUnit->setActive(true); + } + } + for(uint8 i = 0; i < 5; ++i)//summon 5 abominations + { + uint8 r = rand()%4; + Creature* pUnit = m_creature->SummonCreature(ABOMINATION, HordeBase[r][0]+irand(-15,15), HordeBase[r][1]+irand(-15,15), HordeBase[r][2], 0, TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000); + if (pUnit) + { + CAST_AI(hyjal_trashAI, pUnit->AI())->faction = Faction; + CAST_AI(hyjal_trashAI, pUnit->AI())->IsOverrun = true; + CAST_AI(hyjal_trashAI, pUnit->AI())->OverrunType = i; + pUnit->setActive(true); + } + } + break; + } +} \ No newline at end of file diff --git a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/hyjalAI.h b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/hyjalAI.h new file mode 100644 index 00000000000..3b0ff32a429 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/hyjalAI.h @@ -0,0 +1,248 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef SC_HYJALAI_H +#define SC_HYJALAI_H + +#include "def_hyjal.h" +#include "escortAI.h" + +// Trash Mobs summoned in waves +#define NECROMANCER 17899//done +#define ABOMINATION 17898//done +#define GHOUL 17895//done +#define BANSHEE 17905//done +#define CRYPT_FIEND 17897//done +#define GARGOYLE 17906//done +#define FROST_WYRM 17907//done +#define GIANT_INFERNAL 17908//done +#define FEL_STALKER 17916//done + +#define JAINA 17772 +#define THRALL 17852 +#define TYRANDE 17948 + +#define ANCIENT_VEIN 185557 +#define FLAMEOBJECT 182592 + +// Bosses summoned after every 8 waves +#define RAGE_WINTERCHILL 17767 +#define ANETHERON 17808 +#define KAZROGAL 17888 +#define AZGALOR 17842 +#define ARCHIMONDE 17968 + +#define SPELL_TELEPORT_VISUAL 41232 +#define SPELL_MASS_TELEPORT 16807 + +//Spells for Jaina +#define SPELL_BRILLIANCE_AURA 31260 // The database must handle this spell via creature_addon(it should, but is removed in evade..) +#define SPELL_BLIZZARD 31266 +#define SPELL_PYROBLAST 31263 +#define SPELL_SUMMON_ELEMENTALS 31264 + +//Thrall spells +#define SPELL_CHAIN_LIGHTNING 31330 +#define SPELL_SUMMON_DIRE_WOLF 31331 + +struct Wave +{ + uint32 Mob[18]; // Stores Creature Entries to be summoned in Waves + uint32 WaveTimer; // The timer before the next wave is summoned + bool IsBoss; // Simply used to inform the wave summoner that the next wave contains a boss to halt all waves after that +}; + +static Wave AllianceWaves[]= // Waves that will be summoned in the Alliance Base +{ // Rage Winterchill Wave 1-8 + {GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, 0, 0, 0, 0, 0, 0, 0, 0, 120000, false}, + {GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, 0, 0, 0, 0, 0, 0, 120000, false}, + {GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, 0, 0, 0, 0, 0, 0, 120000, false}, + {GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 0, 0, 120000, false}, + {GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 0, 0, 120000, false}, + {GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, 0, 0, 0, 0, 0, 0, 120000, false}, + {GHOUL, GHOUL, GHOUL, GHOUL, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, 0, 0, 0, 0, 0, 0, 120000, false}, + {GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, ABOMINATION, ABOMINATION, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 180000, false}, + // All 8 Waves are summoned, summon Rage Winterchill, next few waves are for Anetheron + {RAGE_WINTERCHILL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, true}, + // Anetheron Wave 1-8 + {GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, 0, 0, 0, 0, 0, 0, 0, 0, 120000, false}, + {GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, 0, 0, 0, 0, 0, 0, 120000, false}, + {GHOUL, GHOUL, GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 0, 0, 120000, false}, + {NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, BANSHEE, BANSHEE, 0, 0, 0, 0, 0, 0, 120000, false}, + {GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, NECROMANCER, NECROMANCER, BANSHEE, BANSHEE, BANSHEE, BANSHEE, 0, 0, 0, 0, 0, 0, 120000, false}, + {GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, ABOMINATION, ABOMINATION, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 0, 0, 120000, false}, + {CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, BANSHEE, BANSHEE, BANSHEE, BANSHEE, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, GHOUL, GHOUL, 0, 0, 0, 0, 120000, false}, + {GHOUL, GHOUL, GHOUL, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, BANSHEE, BANSHEE, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 180000, false}, + // All 8 Waves are summoned, summon Anatheron + {ANETHERON, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, true} +}; + +static Wave HordeWaves[]= // Waves that are summoned in the Horde base +{ // Kaz'Rogal Wave 1-8 + {GHOUL, GHOUL, GHOUL, GHOUL, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, BANSHEE, BANSHEE, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 0, 0, 180000, false}, + {GHOUL, GHOUL, GHOUL, GHOUL, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, 0, 0, 0, 0, 180000, false}, + {GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 180000, false}, + {CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 180000, false}, + {GHOUL, GHOUL, GHOUL, GHOUL, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 180000, false}, + {GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, FROST_WYRM, 0, 0, 0, 0, 0, 0, 0, 0, 0, 180000, false}, + {GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, FROST_WYRM, 0, 0, 0, 0, 0, 0, 0, 180000, false}, + {GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, BANSHEE, BANSHEE, NECROMANCER, NECROMANCER, 0, 0, 240000, false}, + // All 8 Waves are summoned, summon Kaz'Rogal, next few waves are for Azgalor + {KAZROGAL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, true}, + // Azgalor Wave 1-8 + {ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 0, 0, 180000, false}, + {GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, FROST_WYRM, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, 0, 0, 0, 0, 180000, false}, + {GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, 0, 0, 0, 0, 180000, false}, + {GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, FEL_STALKER, FEL_STALKER, FEL_STALKER, FEL_STALKER, FEL_STALKER, FEL_STALKER, 0, 0, 0, 0, 180000, false}, + {FEL_STALKER, FEL_STALKER, FEL_STALKER, FEL_STALKER, FEL_STALKER, FEL_STALKER, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 180000, false}, + {NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, BANSHEE, BANSHEE, BANSHEE, BANSHEE, BANSHEE, BANSHEE, 0, 0, 0, 0, 0, 0, 180000, false}, + {GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, FEL_STALKER, FEL_STALKER, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, 0, 0, 0, 0, 180000, false}, + {CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, FEL_STALKER, FEL_STALKER, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, BANSHEE, BANSHEE, BANSHEE, BANSHEE, NECROMANCER, NECROMANCER, 0, 0, 240000, false}, + // All 8 Waves are summoned, summon Azgalor + {AZGALOR, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, true} +}; + +enum TargetType // Used in the spell cast system for the AI +{ + TARGETTYPE_SELF = 0, + TARGETTYPE_RANDOM = 1, + TARGETTYPE_VICTIM = 2, +}; + +struct Yells +{ + uint32 id; // Used to determine the type of yell (attack, rally, etc) + int32 textid; // The text id to be yelled +}; + +enum YellId +{ + ATTACKED = 0, // Used when attacked and set in combat + BEGIN = 1, // Used when the event is begun + INCOMING = 2, // Used to warn the raid that another wave phase is coming + RALLY = 3, // Used to rally the raid and warn that the next wave has been summoned + FAILURE = 4, // Used when raid has failed (unsure where to place) + SUCCESS = 5, // Used when the raid has sucessfully defeated a wave phase + DEATH = 6, // Used on death +}; + +static Yells JainaQuotes[]= +{ + {ATTACKED, -1534000}, + {ATTACKED, -1534001}, + {INCOMING, -1534002}, + {BEGIN, -1534003}, + {RALLY, -1534004}, + {RALLY, -1534005}, + {FAILURE, -1534006}, + {SUCCESS, -1534007}, + {DEATH, -1534008}, +}; + +static Yells ThrallQuotes[]= +{ + {ATTACKED, -1534009}, + {ATTACKED, -1534010}, + {INCOMING, -1534011}, + {BEGIN, -1534012}, + {RALLY, -1534013}, + {RALLY, -1534014}, + {FAILURE, -1534015}, + {SUCCESS, -1534016}, + {DEATH, -1534017}, +}; + +struct TRINITY_DLL_DECL hyjalAI : public npc_escortAI +{ + hyjalAI(Creature *c); + + void Reset(); // Generically used to reset our variables. Do *not* call in EnterEvadeMode as this may make problems if the raid is still in combat + + void EnterEvadeMode(); // Send creature back to spawn location and evade. + + void EnterCombat(Unit *who); // Used to reset cooldowns for our spells and to inform the raid that we're under attack + + void UpdateAI(const uint32 diff); // Called to summon waves, check for boss deaths and to cast our spells. + + void JustDied(Unit* killer); // Called on death, informs the raid that they have failed. + + void SetFaction(uint32 _faction) // Set the faction to either Alliance or Horde in Hyjal + { + Faction = _faction; + } + + void Retreat(); // "Teleport" (teleport visual + set invisible) all friendly creatures away from the base. + + void SpawnVeins(); + void DeSpawnVeins(); + void JustSummoned(Creature *summoned); + void SummonedCreatureDespawn(Creature* summoned); + void HideNearPos(float x, float y); + void RespawnNearPos(float x, float y); + void WaypointReached(uint32 i); + void DoOverrun(uint32 faction, const uint32 diff); + void MoveInLineOfSight(Unit *who); + + void SummonCreature(uint32 entry, float Base[4][3]); // Summons a creature for that wave in that base + + // Summons the next wave, calls SummonCreature + void SummonNextWave(Wave wave[18], uint32 Count, float Base[4][3]); + + void StartEvent(Player* player); // Begins the event by gossip click + + uint32 GetInstanceData(uint32 Event); // Gets instance data for this instance, used to check if raid has gotten past a certain point and can access the next phase + + void Talk(uint32 id); // Searches for the appropriate yell and sound and uses it to inform the raid of various things + + public: + ScriptedInstance* pInstance; + + uint64 PlayerGUID; + uint64 BossGUID[2]; + uint64 VeinGUID[14]; + + uint32 NextWaveTimer; + uint32 WaveCount; + uint32 CheckTimer; + uint32 Faction; + uint32 EnemyCount; + uint32 RetreatTimer; + + bool EventBegun; + bool FirstBossDead; + bool SecondBossDead; + bool Summon; + bool bRetreat; + bool Debug; + bool VeinsSpawned[2]; + uint8 InfernalCount; + SummonList Summons; + bool Overrun; + bool Teleported; + bool WaitForTeleport; + uint32 TeleportTimer; + uint32 OverrunCounter; + uint32 OverrunCounter2; + uint32 InfernalPoint; + uint32 RespawnTimer; + bool DoRespawn; + bool DoHide; + bool IsDummy; + uint32 MassTeleportTimer; + bool DoMassTeleport; + uint64 DummyGuid; + + struct Spell + { + uint32 SpellId; + uint32 Cooldown; + uint32 TargetType; + }Spell[3]; + + private: + uint32 SpellTimer[3]; + //std::list CreatureList; +}; +#endif + diff --git a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/hyjal_trash.cpp b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/hyjal_trash.cpp new file mode 100644 index 00000000000..b0739530fdc --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/hyjal_trash.cpp @@ -0,0 +1,1453 @@ + +#include "precompiled.h" +#include "def_hyjal.h" +#include "hyjal_trash.h" +#include "hyjalAI.h" + +#define SPELL_METEOR 33814 //infernal visual +#define SPELL_IMMOLATION 37059 +#define SPELL_FLAME_BUFFET 31724 +#define NPC_TRIGGER 21987 //World Trigger (Tiny) +#define MODEL_INVIS 11686 //invisible model + +float HordeWPs[8][3]=//basic waypoints from spawn to leader +{ + {5492.91, -2404.61, 1462.63}, + {5531.76, -2460.87, 1469.55}, + {5554.58, -2514.66, 1476.12}, + {5554.16, -2567.23, 1479.90}, + {5540.67, -2625.99, 1480.89}, + {5508.16, -2659.20, 1480.15},//random rush starts from here + {5489.62, -2704.05, 1482.18}, + {5457.04, -2726.26, 1485.10} +}; +float AllianceWPs[8][3]=//basic waypoints from spawn to leader +{ + {4896.08, -1576.35, 1333.65}, + {4898.68, -1615.02, 1329.48}, + {4907.12, -1667.08, 1321.00}, + {4963.18, -1699.35, 1340.51}, + {4989.16, -1716.67, 1335.74},//first WP in the base, after the gate + {5026.27, -1736.89, 1323.02}, + {5037.77, -1770.56, 1324.36}, + {5067.23, -1789.95, 1321.17} +}; + +float FrostWyrmWPs[3][3]=//waypoints for the frost wyrms in horde base +{ + {5580.82, -2628.83, 1528.28}, + {5550.90, -2667.16, 1505.45}, + {5459.64, -2725.91, 1484.83} +}; + +float GargoyleWPs[3][3]=//waypoints for the gargoyles in horde base +{ + {5533.66, -2634.32, 1495.33}, + {5517.88, -2712.05, 1490.54}, + {5459.64, -2725.91, 1484.83} +}; + +float FlyPathWPs[3][3]=//waypoints for the gargoyls and frost wyrms in horde base in wave 1/3 +{ + {5531.96, -2772.83, 1516.68}, + {5498.32, -2734.84, 1497.01}, + {5456.67, -2725.48, 1493.08} +}; + +float AllianceOverrunWP[55][3]=//waypoints in the alliance base used in the end in the cleaning wave +{ + {4976.37,-1708.02,1339.43},//0spawn + {4994.83,-1725.52,1333.25},//1 start + {4982.92,-1753.7,1330.69},//2 end + {4996.75,-1721.47,1332.95},//3 start + {5015.74,-1755.05,1322.49},//4 + {4998.68,-1773.44,1329.59},//5 + {4994.83,-1725.52,1333.25},//6 start + {5022.8,-1735.46,1323.53},//7 + {5052.15,-1729.02,1320.88},//8 + {5082.43,-1726.29,1327.87},//9 + {4994.83,-1725.52,1333.25},//10 start + {5018.92,-1751.14,1322.19},//11 + {5040.09,-1792.09,1322.1},//12 + {4994.83,-1725.52,1333.25},//13 start + {5023.47,-1748.1,1322.51},//14 + {5013.43,-1842.39,1322.07},//15 + {4994.83,-1725.52,1333.25},//16 start + {5020.8,-1756.86,1322.2},//17 + {5019.53,-1824.6,1321.96},//18 + {5043.42,-1853.75,1324.52},//19 + {5053.02,-1864.13,1330.36},//20 + {5062.49,-1852.47,1330.49},//21 + {5015.27, -1738.77, 1324.83},//35//start 22 + {5027.97, -1775.25, 1321.87},//34 23 + {5015.94, -1821.24, 1321.86},//33 24 + {4983.25, -1857.4, 1320.48},//32 25 + {4981.51, -1883.7, 1322.34},//31 26 + {5002.33, -1893.98, 1325.88},//30 27 + {5049.32, -1886.54, 1331.69},//29 28 + {5089.68, -1846.88, 1328.99},//28 29 + {5127.90, -1825.14, 1335.58},//27 30 + {5163.27, -1789.08, 1337.04},//26 31 + {5138.97, -1755.88, 1334.57},//25 32 + {5096.63, -1742.22, 1329.61},//24 33 + {5065.81, -1729.43, 1325.66},//23 34 + {5049.32, -1726.31, 1320.64},//22 start + {5081.07, -1902.10, 1346.36},//36 abo start + {5107.65, -1912.03, 1356.49},//37 + {5132.83, -1927.07, 1362.42},//38 + {5147.78, -1954.41, 1365.98},//39 + {5164.96, -1966.48, 1367.04},//40 + {5189.04, -1961.06, 1367.90},//41 + {5212.27, -1975.30, 1365.58},//42 + {5221.82, -1994.18, 1364.97},//43 end1 + {5202.23, -1994.94, 1367.59},//44 end2 + {5279.94, -2049.68, 1311.38},//45 garg1 + {5289.15, -2219.06, 1291.12},//46 garg2 + {5202.07, -2136.10, 1305.07},//47 garg3 + {5071.52, -2425.63, 1454.48},//48 garg4 + {5120.65, -2467.92, 1463.93},//49 garg5 + {5283.04, -2043.26, 1300.11},//50 garg target1 + {5313.22, -2207.60, 1290.06},//51 garg target2 + {5180.41, -2121.87, 1292.62},//52 garg target3 + {5088.68, -2432.04, 1441.73},//53 garg target4 + {5111.26, -2454.73, 1449.63}//54 garg target5 + +}; + +float HordeOverrunWP[21][3]=//waypoints in the horde base used in the end in the cleaning wave +{ + {5490.72,-2702.94,1482.14},//0 start + {5469.77,-2741.34,1486.95}, + {5439.47,-2771.02,1494.59}, + {5408.85,-2811.92,1505.68}, + {5423.87,-2857.80,1515.55}, + {5428.19,-2898.15,1524.61}, + {5394.59,-2930.05,1528.23}, + {5351.11,-2935.80,1532.24}, + {5312.37,-2959.06,1536.21}, + {5264.93,-2989.80,1545.70}, + {5256.63,-3056.16,1559.24}, + {5267.32,-3119.55,1575.36}, + {5305.61,-3139.88,1586.38}, + {5330.56,-3135.37,1588.58}, + {5365.87,-3139.78,1583.96}, + {5389.39,-3163.57,1582.57},//15 end + {5500.86,-2669.89,1481.04},//16 start + {5472.08,-2715.14,1483.55}, + {5450.11,-2721.47,1485.61}, + {5433.25,-2712.93,1493.02},//19 end 1 + {5429.91,-2718.44,1493.42}//20 end 2 +}; + +hyjal_trashAI::hyjal_trashAI(Creature *c) : npc_escortAI(c) +{ + pInstance = c->GetInstanceData(); + IsEvent = false; + Delay = 0; + LastOverronPos = 0; + IsOverrun = false; + OverrunType = 0; + SetupOverrun = false; + faction = 0; + useFlyPath = false; + damageTaken = 0; + Reset(); +} + +void hyjal_trashAI::DamageTaken(Unit *done_by, uint32 &damage) +{ + if (done_by->GetTypeId() == TYPEID_PLAYER || (done_by->GetTypeId() == TYPEID_UNIT && CAST_CRE(done_by)->isPet())) + { + damageTaken += damage; + if (pInstance) + pInstance->SetData(DATA_RAIDDAMAGE,damage);//store raid's damage + } +} + +void hyjal_trashAI::UpdateAI(const uint32 diff) +{ + if (IsOverrun && !SetupOverrun) + { + SetupOverrun = true; + if (faction == 0) + { + if (m_creature->GetEntry() == GARGOYLE) + { + DummyTarget[0] = AllianceOverrunWP[50+OverrunType][0]; //+OverrunType 0 - 4 + DummyTarget[1] = AllianceOverrunWP[50+OverrunType][1]; + DummyTarget[2] = AllianceOverrunWP[50+OverrunType][2]; + } + if (m_creature->GetEntry() == ABOMINATION) + { + for(uint8 i = 0; i < 4; ++i) + AddWaypoint(i, AllianceWPs[i][0]+irand(-3,3), AllianceWPs[i][1]+irand(-3,3), AllianceWPs[i][2]); + switch(OverrunType) + { + case 0: + AddWaypoint(4, AllianceOverrunWP[22][0]+irand(-3,3), AllianceOverrunWP[22][1]+irand(-3,3), AllianceOverrunWP[22][2]); + AddWaypoint(5, AllianceOverrunWP[23][0]+irand(-3,3), AllianceOverrunWP[23][1]+irand(-3,3), AllianceOverrunWP[23][2]); + AddWaypoint(6, AllianceOverrunWP[24][0]+irand(-3,3), AllianceOverrunWP[24][1]+irand(-3,3), AllianceOverrunWP[24][2]); + AddWaypoint(7, AllianceOverrunWP[25][0]+irand(-3,3), AllianceOverrunWP[25][1]+irand(-3,3), AllianceOverrunWP[25][2]); + AddWaypoint(8, AllianceOverrunWP[26][0]+irand(-3,3), AllianceOverrunWP[26][1]+irand(-3,3), AllianceOverrunWP[26][2]); + AddWaypoint(9, AllianceOverrunWP[27][0]+irand(-3,3), AllianceOverrunWP[27][1]+irand(-3,3), AllianceOverrunWP[27][2]); + AddWaypoint(10, AllianceOverrunWP[28][0]+irand(-3,3), AllianceOverrunWP[28][1]+irand(-3,3), AllianceOverrunWP[28][2]); + + AddWaypoint(11, AllianceOverrunWP[36][0]+irand(-3,3), AllianceOverrunWP[36][1]+irand(-3,3), AllianceOverrunWP[36][2]); + AddWaypoint(12, AllianceOverrunWP[37][0]+irand(-3,3), AllianceOverrunWP[37][1]+irand(-3,3), AllianceOverrunWP[37][2]); + AddWaypoint(13, AllianceOverrunWP[38][0]+irand(-3,3), AllianceOverrunWP[38][1]+irand(-3,3), AllianceOverrunWP[38][2]); + AddWaypoint(14, AllianceOverrunWP[39][0]+irand(-3,3), AllianceOverrunWP[39][1]+irand(-3,3), AllianceOverrunWP[39][2]); + AddWaypoint(15, AllianceOverrunWP[40][0]+irand(-3,3), AllianceOverrunWP[40][1]+irand(-3,3), AllianceOverrunWP[40][2]); + AddWaypoint(16, AllianceOverrunWP[41][0]+irand(-3,3), AllianceOverrunWP[41][1]+irand(-3,3), AllianceOverrunWP[41][2]); + AddWaypoint(17, AllianceOverrunWP[42][0]+irand(-3,3), AllianceOverrunWP[42][1]+irand(-3,3), AllianceOverrunWP[42][2]); + AddWaypoint(18, AllianceOverrunWP[43][0]+irand(-3,3), AllianceOverrunWP[43][1]+irand(-3,3), AllianceOverrunWP[43][2]); + m_creature->SetHomePosition(AllianceOverrunWP[43][0]+irand(-3,3), AllianceOverrunWP[43][1]+irand(-3,3), AllianceOverrunWP[43][2],0); + SetDespawnAtEnd(false); + LastOverronPos = 18; + Start(true, true); + break; + case 1: + AddWaypoint(4, AllianceOverrunWP[22][0]+irand(-3,3), AllianceOverrunWP[22][1]+irand(-3,3), AllianceOverrunWP[22][2]); + AddWaypoint(5, AllianceOverrunWP[23][0]+irand(-3,3), AllianceOverrunWP[23][1]+irand(-3,3), AllianceOverrunWP[23][2]); + AddWaypoint(6, AllianceOverrunWP[24][0]+irand(-3,3), AllianceOverrunWP[24][1]+irand(-3,3), AllianceOverrunWP[24][2]); + AddWaypoint(7, AllianceOverrunWP[25][0]+irand(-3,3), AllianceOverrunWP[25][1]+irand(-3,3), AllianceOverrunWP[25][2]); + AddWaypoint(8, AllianceOverrunWP[26][0]+irand(-3,3), AllianceOverrunWP[26][1]+irand(-3,3), AllianceOverrunWP[26][2]); + AddWaypoint(9, AllianceOverrunWP[27][0]+irand(-3,3), AllianceOverrunWP[27][1]+irand(-3,3), AllianceOverrunWP[27][2]); + AddWaypoint(10, AllianceOverrunWP[28][0]+irand(-3,3), AllianceOverrunWP[28][1]+irand(-3,3), AllianceOverrunWP[28][2]); + + AddWaypoint(11, AllianceOverrunWP[36][0]+irand(-3,3), AllianceOverrunWP[36][1]+irand(-3,3), AllianceOverrunWP[36][2]); + AddWaypoint(12, AllianceOverrunWP[37][0]+irand(-3,3), AllianceOverrunWP[37][1]+irand(-3,3), AllianceOverrunWP[37][2]); + AddWaypoint(13, AllianceOverrunWP[38][0]+irand(-3,3), AllianceOverrunWP[38][1]+irand(-3,3), AllianceOverrunWP[38][2]); + AddWaypoint(14, AllianceOverrunWP[39][0]+irand(-3,3), AllianceOverrunWP[39][1]+irand(-3,3), AllianceOverrunWP[39][2]); + AddWaypoint(15, AllianceOverrunWP[40][0]+irand(-3,3), AllianceOverrunWP[40][1]+irand(-3,3), AllianceOverrunWP[40][2]); + AddWaypoint(16, AllianceOverrunWP[41][0]+irand(-3,3), AllianceOverrunWP[41][1]+irand(-3,3), AllianceOverrunWP[41][2]); + AddWaypoint(17, AllianceOverrunWP[42][0]+irand(-3,3), AllianceOverrunWP[42][1]+irand(-3,3), AllianceOverrunWP[42][2]); + AddWaypoint(18, AllianceOverrunWP[44][0]+irand(-3,3), AllianceOverrunWP[44][1]+irand(-3,3), AllianceOverrunWP[44][2]); + m_creature->SetHomePosition(AllianceOverrunWP[44][0]+irand(-3,3), AllianceOverrunWP[44][1]+irand(-3,3), AllianceOverrunWP[44][2],0); + SetDespawnAtEnd(false); + LastOverronPos = 18; + Start(true, true); + break; + default: + for(uint8 i = 22; i < 36; ++i) + AddWaypoint(i-18, AllianceOverrunWP[i][0]+irand(-3,3), AllianceOverrunWP[i][1]+irand(-3,3), AllianceOverrunWP[i][2]); + + SetDespawnAtEnd(true); + LastOverronPos = 17; + Start(true, true); + break; + } + } + if (m_creature->GetEntry() == GHOUL) + { + for(uint8 i = 0; i < 4; ++i) + AddWaypoint(i, AllianceWPs[i][0]+irand(-3,3), AllianceWPs[i][1]+irand(-3,3), AllianceWPs[i][2]); + switch(OverrunType) + { + case 0: + AddWaypoint(4, AllianceOverrunWP[1][0]+irand(-3,3), AllianceOverrunWP[1][1]+irand(-3,3), AllianceOverrunWP[1][2]); + AddWaypoint(5, AllianceOverrunWP[2][0]+irand(-3,3), AllianceOverrunWP[2][1]+irand(-3,3), AllianceOverrunWP[2][2]); + m_creature->SetHomePosition(AllianceOverrunWP[2][0]+irand(-3,3), AllianceOverrunWP[2][1]+irand(-3,3), AllianceOverrunWP[2][2],0); + SetDespawnAtEnd(false); + LastOverronPos = 5; + Start(true, true); + break; + case 1: + AddWaypoint(4, AllianceOverrunWP[3][0]+irand(-3,3), AllianceOverrunWP[3][1]+irand(-3,3), AllianceOverrunWP[3][2]); + AddWaypoint(5, AllianceOverrunWP[4][0]+irand(-3,3), AllianceOverrunWP[4][1]+irand(-3,3), AllianceOverrunWP[4][2]); + AddWaypoint(6, AllianceOverrunWP[5][0]+irand(-3,3), AllianceOverrunWP[5][1]+irand(-3,3), AllianceOverrunWP[5][2]); + m_creature->SetHomePosition(AllianceOverrunWP[5][0]+irand(-3,3), AllianceOverrunWP[5][1]+irand(-3,3), AllianceOverrunWP[5][2],0); + SetDespawnAtEnd(false); + LastOverronPos = 6; + Start(true, true); + break; + case 2: + AddWaypoint(4, AllianceOverrunWP[6][0]+irand(-3,3), AllianceOverrunWP[6][1]+irand(-3,3), AllianceOverrunWP[6][2]); + AddWaypoint(5, AllianceOverrunWP[7][0]+irand(-3,3), AllianceOverrunWP[7][1]+irand(-3,3), AllianceOverrunWP[7][2]); + AddWaypoint(6, AllianceOverrunWP[8][0]+irand(-3,3), AllianceOverrunWP[8][1]+irand(-3,3), AllianceOverrunWP[8][2]); + AddWaypoint(7, AllianceOverrunWP[9][0]+irand(-3,3), AllianceOverrunWP[9][1]+irand(-3,3), AllianceOverrunWP[9][2]); + m_creature->SetHomePosition(AllianceOverrunWP[9][0]+irand(-3,3), AllianceOverrunWP[9][1]+irand(-3,3), AllianceOverrunWP[9][2],0); + SetDespawnAtEnd(false); + LastOverronPos = 7; + Start(true, true); + break; + case 3: + AddWaypoint(4, AllianceOverrunWP[10][0]+irand(-3,3), AllianceOverrunWP[10][1]+irand(-3,3), AllianceOverrunWP[10][2]); + AddWaypoint(5, AllianceOverrunWP[11][0]+irand(-3,3), AllianceOverrunWP[11][1]+irand(-3,3), AllianceOverrunWP[11][2]); + AddWaypoint(6, AllianceOverrunWP[12][0]+irand(-3,3), AllianceOverrunWP[12][1]+irand(-3,3), AllianceOverrunWP[12][2]); + m_creature->SetHomePosition(AllianceOverrunWP[12][0]+irand(-3,3), AllianceOverrunWP[12][1]+irand(-3,3), AllianceOverrunWP[12][2],0); + SetDespawnAtEnd(false); + LastOverronPos = 6; + Start(true, true); + break; + case 4: + AddWaypoint(4, AllianceOverrunWP[13][0]+irand(-3,3), AllianceOverrunWP[13][1]+irand(-3,3), AllianceOverrunWP[13][2]); + AddWaypoint(5, AllianceOverrunWP[14][0]+irand(-3,3), AllianceOverrunWP[14][1]+irand(-3,3), AllianceOverrunWP[14][2]); + AddWaypoint(6, AllianceOverrunWP[15][0]+irand(-3,3), AllianceOverrunWP[15][1]+irand(-3,3), AllianceOverrunWP[15][2]); + m_creature->SetHomePosition(AllianceOverrunWP[15][0]+irand(-3,3), AllianceOverrunWP[15][1]+irand(-3,3), AllianceOverrunWP[15][2],0); + SetDespawnAtEnd(false); + LastOverronPos = 6; + Start(true, true); + break; + case 5: + AddWaypoint(4, AllianceOverrunWP[16][0]+irand(-3,3), AllianceOverrunWP[16][1]+irand(-3,3), AllianceOverrunWP[16][2]); + AddWaypoint(5, AllianceOverrunWP[17][0]+irand(-3,3), AllianceOverrunWP[17][1]+irand(-3,3), AllianceOverrunWP[17][2]); + AddWaypoint(6, AllianceOverrunWP[18][0]+irand(-3,3), AllianceOverrunWP[18][1]+irand(-3,3), AllianceOverrunWP[18][2]); + AddWaypoint(7, AllianceOverrunWP[19][0]+irand(-3,3), AllianceOverrunWP[19][1]+irand(-3,3), AllianceOverrunWP[19][2]); + AddWaypoint(8, AllianceOverrunWP[20][0]+irand(-3,3), AllianceOverrunWP[20][1]+irand(-3,3), AllianceOverrunWP[20][2]); + AddWaypoint(9, AllianceOverrunWP[21][0]+irand(-3,3), AllianceOverrunWP[21][1]+irand(-3,3), AllianceOverrunWP[21][2]); + m_creature->SetHomePosition(AllianceOverrunWP[21][0]+irand(-3,3), AllianceOverrunWP[21][1]+irand(-3,3), AllianceOverrunWP[21][2],0); + SetDespawnAtEnd(false); + LastOverronPos = 9; + Start(true, true); + break; + default: + for(uint8 i = 22; i < 36; ++i) + AddWaypoint(i-18, AllianceOverrunWP[i][0]+irand(-3,3), AllianceOverrunWP[i][1]+irand(-3,3), AllianceOverrunWP[i][2]); + SetDespawnAtEnd(true); + LastOverronPos = 17; + Start(true, true); + break; + } + } + } + if (faction == 1) + { + if (m_creature->GetEntry() == GHOUL) + { + for(uint8 i = 0; i < 6; ++i) + AddWaypoint(i, HordeWPs[i][0]+irand(-3,3), HordeWPs[i][1]+irand(-3,3), HordeWPs[i][2]); + switch(OverrunType) + { + case 0: + AddWaypoint(5, HordeOverrunWP[16][0]+irand(-10,10), HordeOverrunWP[16][1]+irand(-10,10), HordeOverrunWP[16][2]); + AddWaypoint(6, HordeOverrunWP[17][0]+irand(-10,10), HordeOverrunWP[17][1]+irand(-10,10), HordeOverrunWP[17][2]); + AddWaypoint(7, HordeOverrunWP[18][0], HordeOverrunWP[18][1], HordeOverrunWP[18][2]); + AddWaypoint(8, HordeOverrunWP[19][0], HordeOverrunWP[19][1], HordeOverrunWP[19][2]); + m_creature->SetHomePosition(HordeOverrunWP[19][0], HordeOverrunWP[19][1], HordeOverrunWP[19][2],0); + SetDespawnAtEnd(false); + LastOverronPos = 8; + Start(true, true); + break; + case 1: + AddWaypoint(5, HordeOverrunWP[16][0]+irand(-10,10), HordeOverrunWP[16][1]+irand(-10,10), HordeOverrunWP[16][2]); + AddWaypoint(6, HordeOverrunWP[17][0]+irand(-10,10), HordeOverrunWP[17][1]+irand(-10,10), HordeOverrunWP[17][2]); + AddWaypoint(7, HordeOverrunWP[18][0], HordeOverrunWP[18][1], HordeOverrunWP[18][2]); + AddWaypoint(8, HordeOverrunWP[20][0], HordeOverrunWP[20][1], HordeOverrunWP[20][2]); + m_creature->SetHomePosition(HordeOverrunWP[20][0], HordeOverrunWP[20][1], HordeOverrunWP[20][2],0); + SetDespawnAtEnd(false); + LastOverronPos = 8; + Start(true, true); + break; + default: + for(uint8 i = 0; i < 16; ++i) + AddWaypoint(i+6, HordeOverrunWP[i][0]+irand(-10,10), HordeOverrunWP[i][1]+irand(-10,10), HordeOverrunWP[i][2]); + SetDespawnAtEnd(true); + LastOverronPos = 21; + Start(true, true); + break; + } + } + if (m_creature->GetEntry() == ABOMINATION) + { + for(uint8 i = 0; i < 6; ++i) + AddWaypoint(i, HordeWPs[i][0]+irand(-10,10), HordeWPs[i][1]+irand(-10,10), HordeWPs[i][2]); + for(uint8 i = 0; i < 16; ++i) + AddWaypoint(i+6, HordeOverrunWP[i][0]+irand(-10,10), HordeOverrunWP[i][1]+irand(-10,10), HordeOverrunWP[i][2]); + SetDespawnAtEnd(true); + LastOverronPos = 21; + Start(true, true); + } + } + } +} + +void hyjal_trashAI::JustDied(Unit *victim) +{ + if (!pInstance)return; + if (IsEvent && !m_creature->isWorldBoss()) + pInstance->SetData(DATA_TRASH, 0);//signal trash is dead + + if ((pInstance->GetData(DATA_RAIDDAMAGE) < MINRAIDDAMAGE && !m_creature->isWorldBoss()) || (damageTaken < m_creature->GetMaxHealth()/4 && m_creature->isWorldBoss())) + m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);//no loot +} + +struct mob_giant_infernalAI : public hyjal_trashAI +{ + mob_giant_infernalAI(Creature* c) : hyjal_trashAI(c) + { + pInstance = c->GetInstanceData(); + meteor = false;//call once! + CanMove = false; + Delay = rand()%30000; + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetDisplayId(MODEL_INVIS); + pGo = false; + pos = 0; + Reset(); + } + + bool meteor; + bool CanMove; + bool WpEnabled; + bool pGo; + uint32 pos; + uint32 spawnTimer; + uint32 FlameBuffetTimer; + bool imol; + + void Reset() + { + spawnTimer = 2000; + FlameBuffetTimer= 2000; + imol = false; + } + + void EnterCombat(Unit* who) {} + + void WaypointReached(uint32 i) + { + pos = i; + if (i == 0 && pInstance && !IsOverrun) + { + if (pInstance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall + { + Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THRALL)); + if (target && target->isAlive()) + m_creature->AddThreat(target,0.0); + } + } + } + + void UpdateAI(const uint32 diff) + { + if (DelayGetPosition(x,y,z); + Creature* trigger = m_creature->SummonCreature(NPC_TRIGGER,x+8,y+8,z+25+rand()%10,m_creature->GetOrientation(),TEMPSUMMON_TIMED_DESPAWN,1000); + if (trigger) + { + trigger->SetVisibility(VISIBILITY_OFF); + trigger->setFaction(m_creature->getFaction()); + trigger->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + trigger->CastSpell(m_creature,SPELL_METEOR,true); + } + m_creature->GetMotionMaster()->Clear(); + meteor = true; + }else if (!CanMove){ + if (spawnTimerRemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetDisplayId(m_creature->GetUInt32Value(UNIT_FIELD_NATIVEDISPLAYID)); + CanMove = true; + if (pInstance) + { + if (pInstance->GetData(DATA_ALLIANCE_RETREAT) && !pInstance->GetData(DATA_HORDE_RETREAT)) + { + Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THRALL)); + if (target && target->isAlive()) + m_creature->AddThreat(target,0.0); + }else if (pInstance->GetData(DATA_ALLIANCE_RETREAT) && pInstance->GetData(DATA_HORDE_RETREAT)){ + //do overrun + } + } + }else spawnTimer -= diff; + } + if (!CanMove)return; + hyjal_trashAI::UpdateAI(diff); + if (IsEvent || IsOverrun) + npc_escortAI::UpdateAI(diff); + if (IsEvent) + { + if (!pGo) + { + pGo = true; + if (pInstance) + { + AddWaypoint(0, HordeWPs[7][0]+irand(-3,3), HordeWPs[7][1]+irand(-3,3), HordeWPs[7][2]);//HordeWPs[7] infront of thrall + Start(true, true); + SetDespawnAtEnd(false); + } + } + } + + if (!UpdateVictim()) + return; + if (!imol) + { + DoCast(m_creature,SPELL_IMMOLATION); + imol=true; + } + if (FlameBuffetTimergetVictim(),SPELL_FLAME_BUFFET,true); + FlameBuffetTimer = 7000; + }else FlameBuffetTimer -= diff; + DoMeleeAttackIfReady(); + } +}; + + +CreatureAI* GetAI_mob_giant_infernal(Creature* pCreature) +{ + return new mob_giant_infernalAI(pCreature); +} + +#define SPELL_DISEASE_CLOUD 31607 +#define SPELL_KNOCKDOWN 31610 + +struct mob_abominationAI : public hyjal_trashAI +{ + mob_abominationAI(Creature* c) : hyjal_trashAI(c) + { + pInstance = c->GetInstanceData(); + pGo = false; + pos = 0; + Reset(); + } + + bool pGo; + uint32 KnockDownTimer; + uint32 pos; + void Reset() + { + KnockDownTimer = 10000; + } + + void WaypointReached(uint32 i) + { + pos = i; + if (i == 7 && pInstance && !IsOverrun) + { + if (pInstance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall + { + Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THRALL)); + if (target && target->isAlive()) + m_creature->AddThreat(target,0.0); + }else{ + Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_JAINAPROUDMOORE)); + if (target && target->isAlive()) + m_creature->AddThreat(target,0.0); + } + } + if (i == LastOverronPos && IsOverrun) + { + if ((faction == 0 && LastOverronPos == 17) || (faction == 1 && LastOverronPos == 21)) + { + m_creature->setDeathState(DEAD); + m_creature->RemoveCorpse(); + } + } + } + + void EnterCombat(Unit* who) {} + + void UpdateAI(const uint32 diff) + { + hyjal_trashAI::UpdateAI(diff); + if (IsEvent || IsOverrun) + npc_escortAI::UpdateAI(diff); + if (IsEvent) + { + if (!pGo) + { + pGo = true; + if (pInstance) + { + if (pInstance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, use horde WPs + { + for (uint8 i = 0; i < 8; ++i) + AddWaypoint(i, HordeWPs[i][0]+irand(-3,3), HordeWPs[i][1]+irand(-3,3), HordeWPs[i][2]); + Start(false, true); + SetDespawnAtEnd(false); + }else//use alliance WPs + { + for (uint8 i = 0; i < 8; ++i) + AddWaypoint(i, AllianceWPs[i][0]+irand(-3,3), AllianceWPs[i][1]+irand(-3,3), AllianceWPs[i][2]); + Start(false, true); + SetDespawnAtEnd(false); + } + } + } + } + if (!m_creature->HasAura(SPELL_DISEASE_CLOUD)) + DoCast(m_creature,SPELL_DISEASE_CLOUD); + if (!UpdateVictim()) + return; + if (KnockDownTimergetVictim(),SPELL_KNOCKDOWN); + KnockDownTimer = 15000+rand()%10000; + }else KnockDownTimer -= diff; + DoMeleeAttackIfReady(); + } +}; + + +CreatureAI* GetAI_mob_abomination(Creature* pCreature) +{ + return new mob_abominationAI(pCreature); +} + +#define SPELL_FRENZY 31540 + +struct mob_ghoulAI : public hyjal_trashAI +{ + mob_ghoulAI(Creature* c) : hyjal_trashAI(c) + { + pInstance = c->GetInstanceData(); + pGo = false; + pos = 0; + Reset(); + } + + bool pGo; + uint32 FrenzyTimer; + uint32 pos; + uint32 MoveTimer; + bool RandomMove; + void Reset() + { + FrenzyTimer = 5000+rand()%5000; + MoveTimer = 2000; + RandomMove = false; + } + + void WaypointReached(uint32 i) + { + pos = i; + if (i == 7 && pInstance && !IsOverrun) + { + if (pInstance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall + { + Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THRALL)); + if (target && target->isAlive()) + m_creature->AddThreat(target,0.0); + }else{ + Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_JAINAPROUDMOORE)); + if (target && target->isAlive()) + m_creature->AddThreat(target,0.0); + } + } + if (i == LastOverronPos && IsOverrun) + { + m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_ATTACKUNARMED); + if ((faction == 0 && LastOverronPos == 17) || (faction == 1 && LastOverronPos == 21)) + { + m_creature->setDeathState(DEAD); + m_creature->RemoveCorpse(); + } + + } + } + + void EnterCombat(Unit* who) {} + + void UpdateAI(const uint32 diff) + { + hyjal_trashAI::UpdateAI(diff); + if (IsEvent || IsOverrun) + npc_escortAI::UpdateAI(diff); + if (IsEvent) + { + if (!pGo) + { + pGo = true; + if (pInstance) + { + if (pInstance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, use horde WPs + { + for (uint8 i = 0; i < 8; ++i) + AddWaypoint(i, HordeWPs[i][0]+irand(-3,3), HordeWPs[i][1]+irand(-3,3), HordeWPs[i][2]); + Start(false, true); + SetDespawnAtEnd(false); + }else//use alliance WPs + { + for (uint8 i = 0; i < 8; ++i) + AddWaypoint(i, AllianceWPs[i][0]+irand(-3,3), AllianceWPs[i][1]+irand(-3,3), AllianceWPs[i][2]); + Start(false, true); + SetDespawnAtEnd(false); + } + } + } + } + if (FrenzyTimerGetInstanceData(); + pGo = false; + pos = 0; + Reset(); + } + SummonList summons; + bool pGo; + uint32 ShadowBoltTimer; + uint32 pos; + void Reset() + { + ShadowBoltTimer = 1000+rand()%5000; + summons.DespawnAll(); + } + + void JustSummoned(Creature* summon) + { + Unit* target = SelectTarget(SELECT_TARGET_RANDOM,0,30,true); + if (target && summon) + summon->Attack(target,false); + summons.Summon(summon); + } + void SummonedCreatureDespawn(Creature *summon) {summons.Despawn(summon);} + void WaypointReached(uint32 i) + { + pos = i; + if (i == 7 && pInstance && !IsOverrun) + { + if (pInstance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall + { + Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THRALL)); + if (target && target->isAlive()) + m_creature->AddThreat(target,0.0); + }else{ + Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_JAINAPROUDMOORE)); + if (target && target->isAlive()) + m_creature->AddThreat(target,0.0); + } + } + } + + void KilledUnit(Unit* victim) + { + switch (rand()%3) + { + case 0: + DoSpawnCreature(17902,3,0,0,0,TEMPSUMMON_TIMED_DESPAWN, 60000); + DoSpawnCreature(17902,-3,0,0,0,TEMPSUMMON_TIMED_DESPAWN, 60000); + break; + case 1: + DoSpawnCreature(17903,3,0,0,0,TEMPSUMMON_TIMED_DESPAWN, 60000); + DoSpawnCreature(17903,-3,0,0,0,TEMPSUMMON_TIMED_DESPAWN, 60000); + break; + case 2: + if (rand()%2) + DoSpawnCreature(17902,3,0,0,0,TEMPSUMMON_TIMED_DESPAWN, 60000); + else + DoSpawnCreature(17903,3,0,0,0,TEMPSUMMON_TIMED_DESPAWN, 60000); + break; + } + } + + void EnterCombat(Unit* who) {} + + void UpdateAI(const uint32 diff) + { + hyjal_trashAI::UpdateAI(diff); + if (IsEvent || IsOverrun) + npc_escortAI::UpdateAI(diff); + if (IsEvent) + { + if (!pGo) + { + pGo = true; + if (pInstance) + { + if (pInstance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, use horde WPs + { + for (uint8 i = 0; i < 8; ++i) + AddWaypoint(i, HordeWPs[i][0]+irand(-3,3), HordeWPs[i][1]+irand(-3,3), HordeWPs[i][2]); + Start(true, true); + SetDespawnAtEnd(false); + }else//use alliance WPs + { + for (uint8 i = 0; i < 8; ++i) + AddWaypoint(i, AllianceWPs[i][0]+irand(-3,3), AllianceWPs[i][1]+irand(-3,3), AllianceWPs[i][2]); + Start(true, true); + SetDespawnAtEnd(false); + } + } + } + } + if (!UpdateVictim()) + return; + if (ShadowBoltTimergetVictim(),SPELL_SHADOW_BOLT); + ShadowBoltTimer = 20000+rand()%10000; + }else ShadowBoltTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + + +CreatureAI* GetAI_mob_necromancer(Creature* pCreature) +{ + return new mob_necromancerAI(pCreature); +} + +#define SPELL_BANSHEE_CURSE 31651 +#define SPELL_BANSHEE_WAIL 38183 +#define SPELL_ANTI_MAGIC_SHELL 31662 + +struct mob_bansheeAI : public hyjal_trashAI +{ + mob_bansheeAI(Creature* c) : hyjal_trashAI(c) + { + pInstance = c->GetInstanceData(); + pGo = false; + pos = 0; + Reset(); + } + + bool pGo; + uint32 CourseTimer; + uint32 WailTimer; + uint32 ShellTimer; + uint32 pos; + void Reset() + { + CourseTimer = 20000+rand()%5000; + WailTimer = 15000+rand()%5000; + ShellTimer = 50000+rand()%10000; + } + + void WaypointReached(uint32 i) + { + pos = i; + if (i == 7 && pInstance && !IsOverrun) + { + if (pInstance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall + { + Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THRALL)); + if (target && target->isAlive()) + m_creature->AddThreat(target,0.0); + }else{ + Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_JAINAPROUDMOORE)); + if (target && target->isAlive()) + m_creature->AddThreat(target,0.0); + } + } + } + + void EnterCombat(Unit* who) {} + + void UpdateAI(const uint32 diff) + { + hyjal_trashAI::UpdateAI(diff); + if (IsEvent || IsOverrun) + npc_escortAI::UpdateAI(diff); + if (IsEvent) + { + if (!pGo) + { + pGo = true; + if (pInstance) + { + if (pInstance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, use horde WPs + { + for (uint8 i = 0; i < 8; ++i) + AddWaypoint(i, HordeWPs[i][0]+irand(-3,3), HordeWPs[i][1]+irand(-3,3), HordeWPs[i][2]); + Start(false, true); + SetDespawnAtEnd(false); + }else//use alliance WPs + { + for (uint8 i = 0; i < 8; ++i) + AddWaypoint(i, AllianceWPs[i][0]+irand(-3,3), AllianceWPs[i][1]+irand(-3,3), AllianceWPs[i][2]); + Start(false, true); + SetDespawnAtEnd(false); + } + } + } + } + if (!UpdateVictim()) + return; + if (CourseTimergetVictim(),SPELL_BANSHEE_CURSE); + CourseTimer = 20000+rand()%5000; + }else CourseTimer -= diff; + if (WailTimergetVictim(),SPELL_BANSHEE_WAIL); + WailTimer = 15000+rand()%5000; + }else WailTimer -= diff; + if (ShellTimerGetInstanceData(); + pGo = false; + pos = 0; + Reset(); + } + + bool pGo; + uint32 WebTimer; + uint32 pos; + void Reset() + { + WebTimer = 20000+rand()%5000; + } + + void WaypointReached(uint32 i) + { + pos = i; + if (i == 7 && pInstance && !IsOverrun) + { + if (pInstance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall + { + Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THRALL)); + if (target && target->isAlive()) + m_creature->AddThreat(target,0.0); + }else{ + Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_JAINAPROUDMOORE)); + if (target && target->isAlive()) + m_creature->AddThreat(target,0.0); + } + } + } + + void EnterCombat(Unit* who) {} + + void UpdateAI(const uint32 diff) + { + hyjal_trashAI::UpdateAI(diff); + if (IsEvent || IsOverrun) + npc_escortAI::UpdateAI(diff); + if (IsEvent) + { + if (!pGo) + { + pGo = true; + if (pInstance) + { + if (pInstance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, use horde WPs + { + for (uint8 i = 0; i < 8; ++i) + AddWaypoint(i, HordeWPs[i][0]+irand(-3,3), HordeWPs[i][1]+irand(-3,3), HordeWPs[i][2]); + Start(false, true); + SetDespawnAtEnd(false); + }else//use alliance WPs + { + for (uint8 i = 0; i < 8; ++i) + AddWaypoint(i, AllianceWPs[i][0]+irand(-3,3), AllianceWPs[i][1]+irand(-3,3), AllianceWPs[i][2]); + Start(false, true); + SetDespawnAtEnd(false); + } + + } + } + } + if (!UpdateVictim()) + return; + if (WebTimergetVictim(),SPELL_WEB); + WebTimer = 20000+rand()%5000; + }else WebTimer -= diff; + DoMeleeAttackIfReady(); + } +}; + + +CreatureAI* GetAI_mob_crypt_fiend(Creature* pCreature) +{ + return new mob_crypt_fiendAI(pCreature); +} + +#define SPELL_MANA_BURN 31729 + +struct mob_fel_stalkerAI : public hyjal_trashAI +{ + mob_fel_stalkerAI(Creature* c) : hyjal_trashAI(c) + { + pInstance = c->GetInstanceData(); + pGo = false; + pos = 0; + Reset(); + } + + bool pGo; + uint32 ManaBurnTimer; + uint32 pos; + void Reset() + { + ManaBurnTimer = 9000+rand()%5000; + } + + void WaypointReached(uint32 i) + { + pos = i; + if (i == 7 && pInstance && !IsOverrun) + { + if (pInstance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall + { + Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THRALL)); + if (target && target->isAlive()) + m_creature->AddThreat(target,0.0); + }else{ + Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_JAINAPROUDMOORE)); + if (target && target->isAlive()) + m_creature->AddThreat(target,0.0); + } + } + } + + void EnterCombat(Unit* who) {} + + void UpdateAI(const uint32 diff) + { + hyjal_trashAI::UpdateAI(diff); + if (IsEvent || IsOverrun) + npc_escortAI::UpdateAI(diff); + if (IsEvent) + { + if (!pGo) + { + pGo = true; + if (pInstance) + { + if (pInstance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, use horde WPs + { + for (uint8 i = 0; i < 8; ++i) + AddWaypoint(i, HordeWPs[i][0]+irand(-3,3), HordeWPs[i][1]+irand(-3,3), HordeWPs[i][2]); + Start(false, true); + SetDespawnAtEnd(false); + }else//use alliance WPs + { + for (uint8 i = 0; i < 8; ++i) + AddWaypoint(i, AllianceWPs[i][0]+irand(-3,3), AllianceWPs[i][1]+irand(-3,3), AllianceWPs[i][2]); + Start(false, true); + SetDespawnAtEnd(false); + } + + } + } + } + if (!UpdateVictim()) + return; + if (ManaBurnTimergetVictim(),SPELL_MANA_BURN); + ManaBurnTimer = 9000+rand()%5000; + }else ManaBurnTimer -= diff; + DoMeleeAttackIfReady(); + } +}; + + +CreatureAI* GetAI_mob_fel_stalker(Creature* pCreature) +{ + return new mob_fel_stalkerAI(pCreature); +} + +#define SPELL_FROST_BREATH 31688 + +struct mob_frost_wyrmAI : public hyjal_trashAI +{ + mob_frost_wyrmAI(Creature* c) : hyjal_trashAI(c) + { + pInstance = c->GetInstanceData(); + pGo = false; + pos = 0; + Reset(); + } + + bool pGo; + uint32 FrostBreathTimer; + uint32 pos; + uint32 MoveTimer; + + void Reset() + { + FrostBreathTimer = 5000; + MoveTimer = 0; + m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + } + + void WaypointReached(uint32 i) + { + pos = i; + if (i == 2 && pInstance && !IsOverrun) + { + Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THRALL)); + if (target && target->isAlive()) + { + m_creature->AddThreat(target,0.0); + DoCast(target,SPELL_FROST_BREATH,true); + } + } + } + + void JustDied(Unit *victim) + { + if (pInstance && IsEvent) + pInstance->SetData(DATA_TRASH, 0);//signal trash is dead + + float x,y,z; + m_creature->GetPosition(x,y,z); + z = m_creature->GetMap()->GetVmapHeight(x, y, z, true); + m_creature->GetMotionMaster()->MovePoint(0,x,y,z); + m_creature->GetMap()->CreatureRelocation(m_creature, x,y,z,0); + } + + void EnterCombat(Unit* who) {} + + void UpdateAI(const uint32 diff) + { + hyjal_trashAI::UpdateAI(diff); + if (IsEvent || IsOverrun) + { + CAST_AI(hyjal_trashAI, m_creature->AI())->SetCanMelee(false); + npc_escortAI::UpdateAI(diff); + } + if (IsEvent) + { + if (!pGo) + { + pGo = true; + if (pInstance) + { + if (!useFlyPath) + { + for (uint8 i = 0; i < 3; ++i) + AddWaypoint(i, FrostWyrmWPs[i][0], FrostWyrmWPs[i][1], FrostWyrmWPs[i][2]); + Start(false, true); + SetDespawnAtEnd(false); + }else{//fly path FlyPathWPs + for (uint8 i = 0; i < 3; ++i) + AddWaypoint(i, FlyPathWPs[i][0]+irand(-10,10), FlyPathWPs[i][1]+irand(-10,10), FlyPathWPs[i][2]); + Start(false, true); + SetDespawnAtEnd(false); + } + } + } + } + if (!UpdateVictim()) + return; + if (!m_creature->IsWithinDist(m_creature->getVictim(), 25)){ + if (MoveTimerGetMotionMaster()->MoveChase(m_creature->getVictim()); + MoveTimer = 2000; + }else MoveTimer-=diff; + } + + if (FrostBreathTimerIsWithinDist(m_creature->getVictim(), 25)) + { + DoCast(m_creature->getVictim(),SPELL_FROST_BREATH); + m_creature->StopMoving(); + m_creature->GetMotionMaster()->Clear(); + FrostBreathTimer = 4000; + } + }else FrostBreathTimer -= diff; + } +}; + + +CreatureAI* GetAI_mob_frost_wyrm(Creature* pCreature) +{ + return new mob_frost_wyrmAI(pCreature); +} + +#define SPELL_GARGOYLE_STRIKE 31664 + +struct mob_gargoyleAI : public hyjal_trashAI +{ + mob_gargoyleAI(Creature* c) : hyjal_trashAI(c) + { + pInstance = c->GetInstanceData(); + pGo = false; + pos = 0; + DummyTarget[0] = 0;DummyTarget[1] = 0;DummyTarget[2] = 0; + Reset(); + } + + bool pGo; + uint32 StrikeTimer; + uint32 pos; + uint32 MoveTimer; + float Zpos; + bool forcemove; + + void Reset() + { + forcemove = true; + Zpos = 10.0; + StrikeTimer = 2000+rand()%5000; + MoveTimer = 0; + m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + } + + void WaypointReached(uint32 i) + { + pos = i; + if (i == 2 && pInstance && !IsOverrun) + { + Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THRALL)); + if (target && target->isAlive()) + { + m_creature->AddThreat(target,0.0); + DoCast(target,SPELL_GARGOYLE_STRIKE,true); + } + } + } + + void JustDied(Unit *victim) + { + float x,y,z; + m_creature->GetPosition(x,y,z); + z = m_creature->GetMap()->GetVmapHeight(x, y, z, true); + m_creature->GetMotionMaster()->MovePoint(0,x,y,z); + m_creature->GetMap()->CreatureRelocation(m_creature, x,y,z,0); + hyjal_trashAI::JustDied(victim); + } + + void UpdateAI(const uint32 diff) + { + hyjal_trashAI::UpdateAI(diff); + if (IsEvent || IsOverrun) + { + CAST_AI(hyjal_trashAI, m_creature->AI())->SetCanMelee(false); + npc_escortAI::UpdateAI(diff); + } + if (IsEvent) + { + if (!pGo) + { + pGo = true; + if (pInstance) + { + if (!useFlyPath) + { + for (uint8 i = 0; i < 3; ++i) + AddWaypoint(i, GargoyleWPs[i][0]+irand(-10,10), GargoyleWPs[i][1]+irand(-10,10), GargoyleWPs[i][2]); + Start(false, true); + SetDespawnAtEnd(false); + }else{//fly path FlyPathWPs + for (uint8 i = 0; i < 3; ++i) + AddWaypoint(i, FlyPathWPs[i][0]+irand(-10,10), FlyPathWPs[i][1]+irand(-10,10), FlyPathWPs[i][2]); + Start(false, true); + SetDespawnAtEnd(false); + } + } + } + } + if (IsOverrun && !UpdateVictim()) + { + if (faction == 0)//alliance + { + if (StrikeTimerCastSpell(DummyTarget[0],DummyTarget[1],DummyTarget[2],SPELL_GARGOYLE_STRIKE,false); + StrikeTimer = 2000+rand()%1000; + }else StrikeTimer -= diff; + } + } + if (!UpdateVictim()) + return; + if (!m_creature->IsWithinDist(m_creature->getVictim(), 20) || forcemove) + { + forcemove = false; + if (forcemove) + { + Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (target) + m_creature->Attack(target,false); + } + if (MoveTimergetVictim()->GetPosition(x,y,z); + m_creature->GetMotionMaster()->MovePoint(0,x,y,z+Zpos); + Zpos-=1.0; + if (Zpos<=0)Zpos=0; + MoveTimer = 2000; + }else MoveTimer-=diff; + } + if (StrikeTimerIsWithinDist(m_creature->getVictim(), 20)) + { + DoCast(m_creature->getVictim(),SPELL_GARGOYLE_STRIKE); + m_creature->StopMoving(); + m_creature->GetMotionMaster()->Clear(); + StrikeTimer = 2000+rand()%1000; + }else StrikeTimer=0; + }else StrikeTimer -= diff; + } +}; + + +CreatureAI* GetAI_mob_gargoyle(Creature* pCreature) +{ + return new mob_gargoyleAI(pCreature); +} + +#define SPELL_EXPLODING_SHOT 7896 + +struct TRINITY_DLL_DECL alliance_riflemanAI : public Scripted_NoMovementAI +{ + alliance_riflemanAI(Creature *c) : Scripted_NoMovementAI(c) + { + Reset(); + } + + uint32 ExplodeTimer; + + void JustDied(Unit* who) + { + } + + void Reset() + { + ExplodeTimer = 5000+rand()%5000; + } + + void MoveInLineOfSight(Unit *who) + { + if (!who || m_creature->getVictim()) + return; + + if (who->isTargetableForAttack() && m_creature->IsHostileTo(who)) + { + float attackRadius = m_creature->GetAttackDistance(who); + if (m_creature->IsWithinDistInMap(who, 30)) + { + AttackStart(who); + } + } + } + + void EnterCombat(Unit *who) + { + } + + void UpdateAI(const uint32 diff) + { + //Check if we have a target + if (!UpdateVictim()) + return; + if (ExplodeTimer < diff) + { + if (!m_creature->IsWithinDistInMap(m_creature->getVictim(), 30)) + { + EnterEvadeMode(); + return; + } + int dmg = 500+rand()%700; + m_creature->CastCustomSpell(m_creature->getVictim(), SPELL_EXPLODING_SHOT, &dmg, 0, 0, false); + ExplodeTimer = 5000+rand()%5000; + }else ExplodeTimer -= diff; + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_alliance_rifleman(Creature* pCreature) +{ + return new alliance_riflemanAI(pCreature); +} + +void AddSC_hyjal_trash() +{ + Script *newscript = new Script; + newscript->Name = "mob_giant_infernal"; + newscript->GetAI = &GetAI_mob_giant_infernal; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_abomination"; + newscript->GetAI = &GetAI_mob_abomination; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_ghoul"; + newscript->GetAI = &GetAI_mob_ghoul; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_necromancer"; + newscript->GetAI = &GetAI_mob_necromancer; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_banshee"; + newscript->GetAI = &GetAI_mob_banshee; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_crypt_fiend"; + newscript->GetAI = &GetAI_mob_crypt_fiend; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_fel_stalker"; + newscript->GetAI = &GetAI_mob_fel_stalker; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_frost_wyrm"; + newscript->GetAI = &GetAI_mob_frost_wyrm; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_gargoyle"; + newscript->GetAI = &GetAI_mob_gargoyle; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "alliance_rifleman"; + newscript->GetAI = &GetAI_alliance_rifleman; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/hyjal_trash.h b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/hyjal_trash.h new file mode 100644 index 00000000000..9eeff8a03f4 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/hyjal_trash.h @@ -0,0 +1,35 @@ + +#ifndef SC_HYJAL_TRASH_AI_H +#define SC_HYJAL_TRASH_AI_H + +#include "def_hyjal.h" +#include "escortAI.h" + +#define MINRAIDDAMAGE 700000//minimal damage before trash can drop loot and reputation, resets if faction leader dies + +struct TRINITY_DLL_DECL hyjal_trashAI : public npc_escortAI +{ + hyjal_trashAI(Creature *c); + + void UpdateAI(const uint32 diff); + + void JustDied(Unit* killer); + + void DamageTaken(Unit *done_by, uint32 &damage); + + public: + ScriptedInstance* pInstance; + bool IsEvent; + uint32 Delay; + uint32 LastOverronPos; + bool IsOverrun; + bool SetupOverrun; + uint32 OverrunType; + uint8 faction; + bool useFlyPath; + uint32 damageTaken; + float DummyTarget[3]; + + //private: +}; +#endif \ No newline at end of file diff --git a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/instance_hyjal.cpp b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/instance_hyjal.cpp new file mode 100644 index 00000000000..83fbbc67b73 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/instance_hyjal.cpp @@ -0,0 +1,322 @@ + /* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Mount_Hyjal +SD%Complete: 100 +SDComment: Instance Data Scripts and functions to acquire mobs and set encounter status for use in various Hyjal Scripts +SDCategory: Caverns of Time, Mount Hyjal +EndScriptData */ + +#include "precompiled.h" +#include "def_hyjal.h" +#include "hyjal_trash.h" + +enum +{ + MAX_ENCOUNTER = 5, + + GO_ANCIENT_GEM = 185557 +}; +/* Battle of Mount Hyjal encounters: +0 - Rage Winterchill event +1 - Anetheron event +2 - Kaz'rogal event +3 - Azgalor event +4 - Archimonde event +*/ + +struct TRINITY_DLL_DECL instance_mount_hyjal : public ScriptedInstance +{ + instance_mount_hyjal(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + std::string str_data; + + std::list m_uiAncientGemGUID; + + uint64 RageWinterchill; + uint64 Anetheron; + uint64 Kazrogal; + uint64 Azgalor; + uint64 Archimonde; + uint64 JainaProudmoore; + uint64 Thrall; + uint64 TyrandeWhisperwind; + uint64 HordeGate; + uint64 ElfGate; + + uint32 Trash; + + + uint32 hordeRetreat; + uint32 allianceRetreat; + bool ArchiYell; + + uint32 RaidDamage; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + m_uiAncientGemGUID.clear(); + + RageWinterchill = 0; + Anetheron = 0; + Kazrogal = 0; + Azgalor = 0; + Archimonde = 0; + JainaProudmoore = 0; + Thrall = 0; + TyrandeWhisperwind = 0; + HordeGate = 0; + ElfGate = 0; + ArchiYell = false; + RaidDamage = 0; + + Trash = 0; + + hordeRetreat = 0; + allianceRetreat = 0; + } + + bool IsEncounterInProgress() const + { + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) return true; + + return false; + } + + void OnGameObjectCreate(GameObject* pGo, bool add) + { + switch(pGo->GetEntry()) + { + case 182060: + HordeGate = pGo->GetGUID(); + if (allianceRetreat) + HandleGameObject(0, true, pGo); + else + HandleGameObject(0, false, pGo); + break; + case 182061: + ElfGate = pGo->GetGUID(); + if (hordeRetreat) + HandleGameObject(0, true, pGo); + else + HandleGameObject(0, false, pGo); + break; + case GO_ANCIENT_GEM: + m_uiAncientGemGUID.push_back(pGo->GetGUID()); + break; + } + } + + void OnCreatureCreate(Creature* pCreature, bool add) + { + switch(pCreature->GetEntry()) + { + case 17767: RageWinterchill = pCreature->GetGUID(); break; + case 17808: Anetheron = pCreature->GetGUID(); break; + case 17888: Kazrogal = pCreature->GetGUID(); break; + case 17842: Azgalor = pCreature->GetGUID(); break; + case 17968: Archimonde = pCreature->GetGUID(); break; + case 17772: JainaProudmoore = pCreature->GetGUID(); break; + case 17852: Thrall = pCreature->GetGUID(); break; + case 17948: TyrandeWhisperwind = pCreature->GetGUID(); break; + } + } + + uint64 GetData64(uint32 identifier) + { + switch(identifier) + { + case DATA_RAGEWINTERCHILL: return RageWinterchill; + case DATA_ANETHERON: return Anetheron; + case DATA_KAZROGAL: return Kazrogal; + case DATA_AZGALOR: return Azgalor; + case DATA_ARCHIMONDE: return Archimonde; + case DATA_JAINAPROUDMOORE: return JainaProudmoore; + case DATA_THRALL: return Thrall; + case DATA_TYRANDEWHISPERWIND: return TyrandeWhisperwind; + } + + return 0; + } + + void SetData(uint32 type, uint32 data) + { + switch(type) + { + case DATA_RAGEWINTERCHILLEVENT: m_auiEncounter[0] = data; break; + case DATA_ANETHERONEVENT: + m_auiEncounter[1] = data; + break; + case DATA_KAZROGALEVENT: m_auiEncounter[2] = data; break; + case DATA_AZGALOREVENT: + { + m_auiEncounter[3] = data; + if (data==DONE) + { + if (ArchiYell)break; + ArchiYell = true; + + Creature* pCreature = instance->GetCreature(Azgalor); + if (pCreature) + { + Creature* pUnit = pCreature->SummonCreature(21987,pCreature->GetPositionX(),pCreature->GetPositionY(),pCreature->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN,10000); + + Map* pMap = pCreature->GetMap(); + if (pMap->IsDungeon() && pUnit) + { + pUnit->SetVisibility(VISIBILITY_OFF); + Map::PlayerList const &PlayerList = pMap->GetPlayers(); + if (PlayerList.isEmpty()) + return; + + for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) + { + if (i->getSource()) + { + WorldPacket data(SMSG_MESSAGECHAT, 200); + pUnit->BuildMonsterChat(&data,CHAT_MSG_MONSTER_YELL,"All of your efforts have been in vain, for the draining of the World Tree has already begun. Soon the heart of your world will beat no more.",0,"Archimonde",i->getSource()->GetGUID()); + i->getSource()->GetSession()->SendPacket(&data); + + WorldPacket data2(SMSG_PLAY_SOUND, 4); + data2 << 10986; + i->getSource()->GetSession()->SendPacket(&data2); + } + } + } + } + } + } + break; + case DATA_ARCHIMONDEEVENT: m_auiEncounter[4] = data; break; + case DATA_RESET_TRASH_COUNT: Trash = 0; break; + + case DATA_TRASH: + if (data) Trash = data; + else Trash--; + DoUpdateWorldState(WORLD_STATE_ENEMYCOUNT, Trash); + break; + case TYPE_RETREAT: + if (data == SPECIAL) + { + if (!m_uiAncientGemGUID.empty()) + { + for(std::list::iterator itr = m_uiAncientGemGUID.begin(); itr != m_uiAncientGemGUID.end(); ++itr) + { + //don't know how long it expected + DoRespawnGameObject(*itr,DAY); + } + } + } + break; + case DATA_ALLIANCE_RETREAT: + allianceRetreat = data; + HandleGameObject(HordeGate, true); + SaveToDB(); + break; + case DATA_HORDE_RETREAT: + hordeRetreat = data; + HandleGameObject(ElfGate, true); + SaveToDB(); + break; + case DATA_RAIDDAMAGE: + RaidDamage += data; + if (RaidDamage >= MINRAIDDAMAGE) + RaidDamage = MINRAIDDAMAGE; + break; + case DATA_RESET_RAIDDAMAGE: + RaidDamage = 0; + break; + } + + debug_log("TSCR: Instance Hyjal: Instance data updated for event %u (Data=%u)",type,data); + + if (data == DONE) + { + OUT_SAVE_INST_DATA; + + std::ostringstream saveStream; + saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " " + << m_auiEncounter[3] << " " << m_auiEncounter[4] + << " " << allianceRetreat << " " << hordeRetreat + << " " << RaidDamage; + + str_data = saveStream.str(); + + SaveToDB(); + OUT_SAVE_INST_DATA_COMPLETE; + } + + } + + uint32 GetData(uint32 type) + { + switch(type) + { + case DATA_RAGEWINTERCHILLEVENT: return m_auiEncounter[0]; + case DATA_ANETHERONEVENT: return m_auiEncounter[1]; + case DATA_KAZROGALEVENT: return m_auiEncounter[2]; + case DATA_AZGALOREVENT: return m_auiEncounter[3]; + case DATA_ARCHIMONDEEVENT: return m_auiEncounter[4]; + case DATA_TRASH: return Trash; + case DATA_ALLIANCE_RETREAT: return allianceRetreat; + case DATA_HORDE_RETREAT: return hordeRetreat; + case DATA_RAIDDAMAGE: return RaidDamage; + } + return 0; + } + + std::string GetSaveData() + { + return str_data; + } + + void Load(const char* in) + { + if (!in) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(in); + std::istringstream loadStream(in); + loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3] >> m_auiEncounter[4] >> allianceRetreat >> hordeRetreat >> RaidDamage; + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) // Do not load an encounter as IN_PROGRESS - reset it instead. + m_auiEncounter[i] = NOT_STARTED; + OUT_LOAD_INST_DATA_COMPLETE; + } +}; + +InstanceData* GetInstanceData_instance_mount_hyjal(Map* pMap) +{ + return new instance_mount_hyjal(pMap); +} + +void AddSC_instance_mount_hyjal() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_hyjal"; + newscript->GetInstanceData = &GetInstanceData_instance_mount_hyjal; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/old_hillsbrad/boss_captain_skarloc.cpp b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/old_hillsbrad/boss_captain_skarloc.cpp new file mode 100644 index 00000000000..0c6c98d9758 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/old_hillsbrad/boss_captain_skarloc.cpp @@ -0,0 +1,156 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Captain_Skarloc +SD%Complete: 75 +SDComment: Missing adds, missing waypoints to move up to Thrall once spawned + speech before enter combat. +SDCategory: Caverns of Time, Old Hillsbrad Foothills +EndScriptData */ + +#include "precompiled.h" +#include "def_old_hillsbrad.h" + +#define SAY_ENTER -1560000 +#define SAY_TAUNT1 -1560001 +#define SAY_TAUNT2 -1560002 +#define SAY_SLAY1 -1560003 +#define SAY_SLAY2 -1560004 +#define SAY_DEATH -1560005 + +#define SPELL_HOLY_LIGHT 29427 +#define SPELL_CLEANSE 29380 +#define SPELL_HAMMER_OF_JUSTICE 13005 +#define SPELL_HOLY_SHIELD 31904 +#define SPELL_DEVOTION_AURA 8258 +#define SPELL_CONSECRATION 38385 + +struct TRINITY_DLL_DECL boss_captain_skarlocAI : public ScriptedAI +{ + boss_captain_skarlocAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance *pInstance; + + uint32 Holy_Light_Timer; + uint32 Cleanse_Timer; + uint32 HammerOfJustice_Timer; + uint32 HolyShield_Timer; + uint32 DevotionAura_Timer; + uint32 Consecration_Timer; + + void Reset() + { + Holy_Light_Timer = 20000 + rand()%10000; + Cleanse_Timer = 10000; + HammerOfJustice_Timer = 20000 + rand()%15000; + HolyShield_Timer = 240000; + DevotionAura_Timer = 3000; + Consecration_Timer = 8000; + } + + void EnterCombat(Unit *who) + { + //This is not correct. Should taunt Thrall before engage in combat + DoScriptText(SAY_TAUNT1, m_creature); + DoScriptText(SAY_TAUNT2, m_creature); + } + + void KilledUnit(Unit *victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + } + } + + void JustDied(Unit *victim) + { + DoScriptText(SAY_DEATH, m_creature); + + if (pInstance && pInstance->GetData(TYPE_THRALL_EVENT) == IN_PROGRESS) + pInstance->SetData(TYPE_THRALL_PART1, DONE); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + //Holy_Light + if (Holy_Light_Timer < diff) + { + DoCast(m_creature, SPELL_HOLY_LIGHT); + Holy_Light_Timer = 30000; + }else Holy_Light_Timer -= diff; + + //Cleanse + if (Cleanse_Timer < diff) + { + DoCast(m_creature, SPELL_CLEANSE); + Cleanse_Timer = 10000; + } else Cleanse_Timer -= diff; + + //Hammer of Justice + if (HammerOfJustice_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_HAMMER_OF_JUSTICE); + HammerOfJustice_Timer = 60000; + }else HammerOfJustice_Timer -= diff; + + //Holy Shield + if (HolyShield_Timer < diff) + { + DoCast(m_creature, SPELL_HOLY_SHIELD); + HolyShield_Timer = 240000; + }else HolyShield_Timer -= diff; + + //Devotion_Aura + if (DevotionAura_Timer < diff) + { + DoCast(m_creature, SPELL_DEVOTION_AURA); + DevotionAura_Timer = 45000 + rand()%10000; + }else DevotionAura_Timer -= diff; + + //Consecration + if (Consecration_Timer < diff) + { + //DoCast(m_creature->getVictim(), SPELL_CONSECRATION); + Consecration_Timer = 5000 + rand()%5000; + }else Consecration_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_captain_skarloc(Creature* pCreature) +{ + return new boss_captain_skarlocAI (pCreature); +} + +void AddSC_boss_captain_skarloc() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_captain_skarloc"; + newscript->GetAI = &GetAI_boss_captain_skarloc; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/old_hillsbrad/boss_epoch_hunter.cpp b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/old_hillsbrad/boss_epoch_hunter.cpp new file mode 100644 index 00000000000..138a59cce93 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/old_hillsbrad/boss_epoch_hunter.cpp @@ -0,0 +1,150 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Epoch_Hunter +SD%Complete: 60 +SDComment: Missing spawns pre-event, missing speech to be coordinated with rest of escort event. +SDCategory: Caverns of Time, Old Hillsbrad Foothills +EndScriptData */ + +#include "precompiled.h" +#include "def_old_hillsbrad.h" + +#define SAY_ENTER1 -1560013 +#define SAY_ENTER2 -1560014 +#define SAY_ENTER3 -1560015 +#define SAY_AGGRO1 -1560016 +#define SAY_AGGRO2 -1560017 +#define SAY_SLAY1 -1560018 +#define SAY_SLAY2 -1560019 +#define SAY_BREATH1 -1560020 +#define SAY_BREATH2 -1560021 +#define SAY_DEATH -1560022 + +#define SPELL_SAND_BREATH 31914 +#define SPELL_IMPENDING_DEATH 31916 +#define SPELL_MAGIC_DISRUPTION_AURA 33834 +#define SPELL_WING_BUFFET 31475 + +struct TRINITY_DLL_DECL boss_epoch_hunterAI : public ScriptedAI +{ + boss_epoch_hunterAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance *pInstance; + + uint32 SandBreath_Timer; + uint32 ImpendingDeath_Timer; + uint32 WingBuffet_Timer; + uint32 Mda_Timer; + + void Reset() + { + SandBreath_Timer = 8000 + rand()%8000; + ImpendingDeath_Timer = 25000 + rand()%5000; + WingBuffet_Timer = 35000; + Mda_Timer = 40000; + } + + void EnterCombat(Unit *who) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_AGGRO1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO2, m_creature); break; + } + } + + void KilledUnit(Unit *victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + } + } + + void JustDied(Unit *victim) + { + DoScriptText(SAY_DEATH, m_creature); + + if (pInstance && pInstance->GetData(TYPE_THRALL_EVENT) == IN_PROGRESS) + pInstance->SetData(TYPE_THRALL_PART4, DONE); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + //Sand Breath + if (SandBreath_Timer < diff) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(false); + + DoCast(m_creature->getVictim(),SPELL_SAND_BREATH); + + switch(rand()%2) + { + case 0: DoScriptText(SAY_BREATH1, m_creature); break; + case 1: DoScriptText(SAY_BREATH2, m_creature); break; + } + + SandBreath_Timer = 10000 + rand()%10000; + }else SandBreath_Timer -= diff; + + if (ImpendingDeath_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_IMPENDING_DEATH); + ImpendingDeath_Timer = 25000+rand()%5000; + }else ImpendingDeath_Timer -= diff; + + if (WingBuffet_Timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_WING_BUFFET); + WingBuffet_Timer = 25000+rand()%10000; + }else WingBuffet_Timer -= diff; + + if (Mda_Timer < diff) + { + DoCast(m_creature,SPELL_MAGIC_DISRUPTION_AURA); + Mda_Timer = 15000; + }else Mda_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_epoch_hunter(Creature* pCreature) +{ + return new boss_epoch_hunterAI (pCreature); +} + +void AddSC_boss_epoch_hunter() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_epoch_hunter"; + newscript->GetAI = &GetAI_boss_epoch_hunter; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/old_hillsbrad/boss_leutenant_drake.cpp b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/old_hillsbrad/boss_leutenant_drake.cpp new file mode 100644 index 00000000000..266f61354c0 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/old_hillsbrad/boss_leutenant_drake.cpp @@ -0,0 +1,194 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Luetenant_Drake +SD%Complete: 70 +SDComment: Missing proper code for patrolling area after being spawned. Script for GO (barrels) quest 10283 +SDCategory: Caverns of Time, Old Hillsbrad Foothills +EndScriptData */ + +#include "precompiled.h" +#include "def_old_hillsbrad.h" +#include "escortAI.h" + +/*###### +## go_barrel_old_hillsbrad +######*/ + +bool GOHello_go_barrel_old_hillsbrad(Player* pPlayer, GameObject* pGO) +{ + if (ScriptedInstance* pInstance = pGO->GetInstanceData()) + { + if (pInstance->GetData(TYPE_BARREL_DIVERSION) == DONE) + return false; + + pInstance->SetData(TYPE_BARREL_DIVERSION, IN_PROGRESS); + } + + return false; +} + +/*###### +## boss_lieutenant_drake +######*/ + +#define SAY_ENTER -1560006 +#define SAY_AGGRO -1560007 +#define SAY_SLAY1 -1560008 +#define SAY_SLAY2 -1560009 +#define SAY_MORTAL -1560010 +#define SAY_SHOUT -1560011 +#define SAY_DEATH -1560012 + +#define SPELL_WHIRLWIND 31909 +#define SPELL_HAMSTRING 9080 +#define SPELL_MORTAL_STRIKE 31911 +#define SPELL_FRIGHTENING_SHOUT 33789 + +struct Location +{ + uint32 wpId; + float x; + float y; + float z; +}; + +static Location DrakeWP[]= +{ + {0, 2125.84, 88.2535, 54.8830}, + {1, 2111.01, 93.8022, 52.6356}, + {2, 2106.70, 114.753, 53.1965}, + {3, 2107.76, 138.746, 52.5109}, + {4, 2114.83, 160.142, 52.4738}, + {5, 2125.24, 178.909, 52.7283}, + {6, 2151.02, 208.901, 53.1551}, + {7, 2177.00, 233.069, 52.4409}, + {8, 2190.71, 227.831, 53.2742}, + {9, 2178.14, 214.219, 53.0779}, + {10, 2154.99, 202.795, 52.6446}, + {11, 2132.00, 191.834, 52.5709}, + {12, 2117.59, 166.708, 52.7686}, + {13, 2093.61, 139.441, 52.7616}, + {14, 2086.29, 104.950, 52.9246}, + {15, 2094.23, 81.2788, 52.6946}, + {16, 2108.70, 85.3075, 53.3294}, + {17, 2125.50, 88.9481, 54.7953}, + {18, 2128.20, 70.9763, 64.4221} +}; + +struct TRINITY_DLL_DECL boss_lieutenant_drakeAI : public ScriptedAI +{ + boss_lieutenant_drakeAI(Creature *c) : ScriptedAI(c) {} + + bool CanPatrol; + uint32 wpId; + + uint32 Whirlwind_Timer; + uint32 Fear_Timer; + uint32 MortalStrike_Timer; + uint32 ExplodingShout_Timer; + + void Reset() + { + CanPatrol = true; + wpId = 0; + + Whirlwind_Timer = 20000; + Fear_Timer = 30000; + MortalStrike_Timer = 45000; + ExplodingShout_Timer = 25000; + } + + void EnterCombat(Unit *who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + + void KilledUnit(Unit *victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + } + } + + void JustDied(Unit *victim) + { + DoScriptText(SAY_DEATH, m_creature); + } + + void UpdateAI(const uint32 diff) + { + //TODO: make this work + if (CanPatrol && wpId == 0) + { + m_creature->GetMotionMaster()->MovePoint(DrakeWP[0].wpId, DrakeWP[0].x, DrakeWP[0].y, DrakeWP[0].z); + wpId++; + } + + //Return since we have no target + if (!UpdateVictim()) + return; + + //Whirlwind + if (Whirlwind_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_WHIRLWIND); + Whirlwind_Timer = 20000+rand()%5000; + }else Whirlwind_Timer -= diff; + + //Fear + if (Fear_Timer < diff) + { + DoScriptText(SAY_SHOUT, m_creature); + DoCast(m_creature->getVictim(), SPELL_FRIGHTENING_SHOUT); + Fear_Timer = 25000+rand()%10000; + }else Fear_Timer -= diff; + + //Mortal Strike + if (MortalStrike_Timer < diff) + { + DoScriptText(SAY_MORTAL, m_creature); + DoCast(m_creature->getVictim(), SPELL_MORTAL_STRIKE); + MortalStrike_Timer = 20000+rand()%10000; + }else MortalStrike_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_lieutenant_drake(Creature* pCreature) +{ + return new boss_lieutenant_drakeAI (pCreature); +} + +void AddSC_boss_lieutenant_drake() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="go_barrel_old_hillsbrad"; + newscript->pGOHello = &GOHello_go_barrel_old_hillsbrad; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="boss_lieutenant_drake"; + newscript->GetAI = &GetAI_boss_lieutenant_drake; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/old_hillsbrad/def_old_hillsbrad.h b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/old_hillsbrad/def_old_hillsbrad.h new file mode 100644 index 00000000000..3253a384217 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/old_hillsbrad/def_old_hillsbrad.h @@ -0,0 +1,19 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_OLD_HILLSBRAD_H +#define DEF_OLD_HILLSBRAD_H + +#define TYPE_BARREL_DIVERSION 1 +#define TYPE_THRALL_EVENT 2 +#define TYPE_THRALL_PART1 3 +#define TYPE_THRALL_PART2 4 +#define TYPE_THRALL_PART3 5 +#define TYPE_THRALL_PART4 6 +#define DATA_THRALL 7 +#define DATA_TARETHA 8 +#define DATA_EPOCH 9 +#define WORLD_STATE_OH 2436 +#endif + diff --git a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/old_hillsbrad/instance_old_hillsbrad.cpp b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/old_hillsbrad/instance_old_hillsbrad.cpp new file mode 100644 index 00000000000..b8ec8f2e111 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/old_hillsbrad/instance_old_hillsbrad.cpp @@ -0,0 +1,238 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Old_Hillsbrad +SD%Complete: 75 +SDComment: If thrall escort fail, all parts will reset. In future, save sub-parts and continue from last known. +SDCategory: Caverns of Time, Old Hillsbrad Foothills +EndScriptData */ + +#include "precompiled.h" +#include "def_old_hillsbrad.h" + +#define MAX_ENCOUNTER 6 + +#define THRALL_ENTRY 17876 +#define TARETHA_ENTRY 18887 +#define EPOCH_ENTRY 18096 + +#define DRAKE_ENTRY 17848 + +#define QUEST_ENTRY_DIVERSION 10283 +#define LODGE_QUEST_TRIGGER 20155 + +struct TRINITY_DLL_DECL instance_old_hillsbrad : public ScriptedInstance +{ + instance_old_hillsbrad(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + uint32 mBarrelCount; + uint32 mThrallEventCount; + + uint64 ThrallGUID; + uint64 TarethaGUID; + uint64 EpochGUID; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + mBarrelCount = 0; + mThrallEventCount = 0; + ThrallGUID = 0; + TarethaGUID = 0; + EpochGUID = 0; + } + + Player* GetPlayerInMap() + { + Map::PlayerList const& players = instance->GetPlayers(); + + if (!players.isEmpty()) + { + for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + { + if (Player* plr = itr->getSource()) + return plr; + } + } + + debug_log("TSCR: Instance Old Hillsbrad: GetPlayerInMap, but PlayerList is empty!"); + return NULL; + } + + void UpdateQuestCredit() + { + Map::PlayerList const& players = instance->GetPlayers(); + + if (!players.isEmpty()) + { + for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + { + if (Player* pPlayer = itr->getSource()) + pPlayer->KilledMonsterCredit(LODGE_QUEST_TRIGGER,0); + } + } + } + + void OnCreatureCreate(Creature* pCreature, bool add) + { + switch(pCreature->GetEntry()) + { + case THRALL_ENTRY: + ThrallGUID = pCreature->GetGUID(); + break; + case TARETHA_ENTRY: + TarethaGUID = pCreature->GetGUID(); + break; + case EPOCH_ENTRY: + EpochGUID = pCreature->GetGUID(); + break; + } + } + + void SetData(uint32 type, uint32 data) + { + Player* pPlayer = GetPlayerInMap(); + + if (!pPlayer) + { + debug_log("TSCR: Instance Old Hillsbrad: SetData (Type: %u Data %u) cannot find any player.", type, data); + return; + } + + switch(type) + { + case TYPE_BARREL_DIVERSION: + { + if (data == IN_PROGRESS) + { + if (mBarrelCount >= 5) + return; + + ++mBarrelCount; + DoUpdateWorldState(WORLD_STATE_OH, mBarrelCount); + + debug_log("TSCR: Instance Old Hillsbrad: go_barrel_old_hillsbrad count %u",mBarrelCount); + + m_auiEncounter[0] = IN_PROGRESS; + + if (mBarrelCount == 5) + { + UpdateQuestCredit(); + pPlayer->SummonCreature(DRAKE_ENTRY, 2128.43, 71.01, 64.42, 1.74, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 1800000); + m_auiEncounter[0] = DONE; + } + } + break; + } + case TYPE_THRALL_EVENT: + { + if (data == FAIL) + { + if (mThrallEventCount <= 20) + { + mThrallEventCount++; + m_auiEncounter[1] = NOT_STARTED; + debug_log("TSCR: Instance Old Hillsbrad: Thrall event failed %u times. Resetting all sub-events.",mThrallEventCount); + m_auiEncounter[2] = NOT_STARTED; + m_auiEncounter[3] = NOT_STARTED; + m_auiEncounter[4] = NOT_STARTED; + m_auiEncounter[5] = NOT_STARTED; + } + else if (mThrallEventCount > 20) + { + m_auiEncounter[1] = data; + m_auiEncounter[2] = data; + m_auiEncounter[3] = data; + m_auiEncounter[4] = data; + m_auiEncounter[5] = data; + debug_log("TSCR: Instance Old Hillsbrad: Thrall event failed %u times. Resetting all sub-events.",mThrallEventCount); + } + } + else + m_auiEncounter[1] = data; + debug_log("TSCR: Instance Old Hillsbrad: Thrall escort event adjusted to data %u.",data); + break; + } + case TYPE_THRALL_PART1: + m_auiEncounter[2] = data; + debug_log("TSCR: Instance Old Hillsbrad: Thrall event part I adjusted to data %u.",data); + break; + case TYPE_THRALL_PART2: + m_auiEncounter[3] = data; + debug_log("TSCR: Instance Old Hillsbrad: Thrall event part II adjusted to data %u.",data); + break; + case TYPE_THRALL_PART3: + m_auiEncounter[4] = data; + debug_log("TSCR: Instance Old Hillsbrad: Thrall event part III adjusted to data %u.",data); + break; + case TYPE_THRALL_PART4: + m_auiEncounter[5] = data; + debug_log("TSCR: Instance Old Hillsbrad: Thrall event part IV adjusted to data %u.",data); + break; + } + } + + uint32 GetData(uint32 data) + { + switch(data) + { + case TYPE_BARREL_DIVERSION: + return m_auiEncounter[0]; + case TYPE_THRALL_EVENT: + return m_auiEncounter[1]; + case TYPE_THRALL_PART1: + return m_auiEncounter[2]; + case TYPE_THRALL_PART2: + return m_auiEncounter[3]; + case TYPE_THRALL_PART3: + return m_auiEncounter[4]; + case TYPE_THRALL_PART4: + return m_auiEncounter[5]; + } + return 0; + } + + uint64 GetData64(uint32 data) + { + switch(data) + { + case DATA_THRALL: + return ThrallGUID; + case DATA_TARETHA: + return TarethaGUID; + case DATA_EPOCH: + return EpochGUID; + } + return 0; + } +}; +InstanceData* GetInstanceData_instance_old_hillsbrad(Map* pMap) +{ + return new instance_old_hillsbrad(pMap); +} + +void AddSC_instance_old_hillsbrad() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_old_hillsbrad"; + newscript->GetInstanceData = &GetInstanceData_instance_old_hillsbrad; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/old_hillsbrad/old_hillsbrad.cpp b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/old_hillsbrad/old_hillsbrad.cpp new file mode 100644 index 00000000000..5559989ef65 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/old_hillsbrad/old_hillsbrad.cpp @@ -0,0 +1,682 @@ + /* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Old_Hillsbrad +SD%Complete: 40 +SDComment: Quest support: 10283, 10284. All friendly NPC's. Thrall waypoints fairly complete, missing many details, but possible to complete escort. +SDCategory: Caverns of Time, Old Hillsbrad Foothills +EndScriptData */ + +/* ContentData +npc_erozion +npc_thrall_old_hillsbrad +npc_taretha +EndContentData */ + +#include "precompiled.h" +#include "escortAI.h" +#include "def_old_hillsbrad.h" + +#define QUEST_ENTRY_HILLSBRAD 10282 +#define QUEST_ENTRY_DIVERSION 10283 +#define QUEST_ENTRY_ESCAPE 10284 +#define QUEST_ENTRY_RETURN 10285 +#define ITEM_ENTRY_BOMBS 25853 + +/*###### +## npc_erozion +######*/ + +bool GossipHello_npc_erozion(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + ScriptedInstance* pInstance = (pCreature->GetInstanceData()); + if (pInstance && pInstance->GetData(TYPE_BARREL_DIVERSION) != DONE && !pPlayer->HasItemCount(ITEM_ENTRY_BOMBS,1)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "I need a pack of Incendiary Bombs.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + if (!pPlayer->GetQuestRewardStatus(QUEST_ENTRY_RETURN) && pPlayer->GetQuestStatus(QUEST_ENTRY_RETURN) == QUEST_STATUS_COMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "[PH] Teleport please, i'm tired.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + + pPlayer->SEND_GOSSIP_MENU(9778, pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_erozion(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + { + ItemPosCountVec dest; + uint8 msg = pPlayer->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, ITEM_ENTRY_BOMBS, 1); + if (msg == EQUIP_ERR_OK) + { + pPlayer->StoreNewItem(dest, ITEM_ENTRY_BOMBS, true); + } + pPlayer->SEND_GOSSIP_MENU(9515, pCreature->GetGUID()); + } + if (uiAction == GOSSIP_ACTION_INFO_DEF+2) + { + pPlayer->CLOSE_GOSSIP_MENU(); + } + return true; +} + +/*###### +## npc_thrall_old_hillsbrad +######*/ + +//Thrall texts +#define SAY_TH_START_EVENT_PART1 -1560023 +#define SAY_TH_ARMORY -1560024 +#define SAY_TH_SKARLOC_MEET -1560025 +#define SAY_TH_SKARLOC_TAUNT -1560026 +#define SAY_TH_START_EVENT_PART2 -1560027 +#define SAY_TH_MOUNTS_UP -1560028 +#define SAY_TH_CHURCH_END -1560029 +#define SAY_TH_MEET_TARETHA -1560030 +#define SAY_TH_EPOCH_WONDER -1560031 +#define SAY_TH_EPOCH_KILL_TARETHA -1560032 +#define SAY_TH_EVENT_COMPLETE -1560033 + +#define SAY_TH_RANDOM_LOW_HP1 -1560034 +#define SAY_TH_RANDOM_LOW_HP2 -1560035 + +#define SAY_TH_RANDOM_DIE1 -1560036 +#define SAY_TH_RANDOM_DIE2 -1560037 + +#define SAY_TH_RANDOM_AGGRO1 -1560038 +#define SAY_TH_RANDOM_AGGRO2 -1560039 +#define SAY_TH_RANDOM_AGGRO3 -1560040 +#define SAY_TH_RANDOM_AGGRO4 -1560041 + +#define SAY_TH_RANDOM_KILL1 -1560042 +#define SAY_TH_RANDOM_KILL2 -1560043 +#define SAY_TH_RANDOM_KILL3 -1560044 + +#define SAY_TH_LEAVE_COMBAT1 -1560045 +#define SAY_TH_LEAVE_COMBAT2 -1560046 +#define SAY_TH_LEAVE_COMBAT3 -1560047 + +//Taretha texts +#define SAY_TA_FREE -1560048 +#define SAY_TA_ESCAPED -1560049 + +//Misc for Thrall +#define SPELL_STRIKE 14516 +#define SPELL_SHIELD_BLOCK 12169 +#define SPELL_SUMMON_EROZION_IMAGE 33954 //if thrall dies during escort? + +#define SPEED_WALK (0.5f) +#define SPEED_RUN (1.0f) +#define SPEED_MOUNT (1.6f) + +#define THRALL_WEAPON_MODEL 22106 +#define THRALL_WEAPON_INFO 218169346 +#define THRALL_SHIELD_MODEL 18662 +#define THRALL_SHIELD_INFO 234948100 +#define THRALL_MODEL_UNEQUIPPED 17292 +#define THRALL_MODEL_EQUIPPED 18165 + +//Misc Creature entries +#define ENTRY_ARMORER 18764 +#define ENTRY_SCARLOC 17862 + +#define MOB_ENTRY_RIFLE 17820 +#define MOB_ENTRY_WARDEN 17833 +#define MOB_ENTRY_VETERAN 17860 +#define MOB_ENTRY_WATCHMAN 17814 +#define MOB_ENTRY_SENTRY 17815 + +#define MOB_ENTRY_BARN_GUARDSMAN 18092 +#define MOB_ENTRY_BARN_PROTECTOR 18093 +#define MOB_ENTRY_BARN_LOOKOUT 18094 + +#define MOB_ENTRY_CHURCH_GUARDSMAN 23175 +#define MOB_ENTRY_CHURCH_PROTECTOR 23179 +#define MOB_ENTRY_CHURCH_LOOKOUT 23177 + +#define MOB_ENTRY_INN_GUARDSMAN 23176 +#define MOB_ENTRY_INN_PROTECTOR 23180 +#define MOB_ENTRY_INN_LOOKOUT 23178 + +#define SKARLOC_MOUNT 18798 +#define SKARLOC_MOUNT_MODEL 18223 +#define EROZION_ENTRY 18723 +#define ENTRY_EPOCH 18096 + +//gossip items +#define GOSSIP_ID_START 9568 +#define GOSSIP_ID_SKARLOC1 9614 //I'm glad Taretha is alive. We now must find a way to free her... +#define GOSSIP_ITEM_SKARLOC1 "Taretha cannot see you, Thrall." +#define GOSSIP_ID_SKARLOC2 9579 //What do you mean by this? Is Taretha in danger? +#define GOSSIP_ITEM_SKARLOC2 "The situation is rather complicated, Thrall. It would be best for you to head into the mountains now, before more of Blackmoore's men show up. We'll make sure Taretha is safe." +#define GOSSIP_ID_SKARLOC3 9580 + +#define GOSSIP_ID_TARREN 9597 //tarren mill is beyond these trees +#define GOSSIP_ITEM_TARREN "We're ready, Thrall." + +#define GOSSIP_ID_COMPLETE 9578 //Thank you friends, I owe my freedom to you. Where is Taretha? I hoped to see her + +struct TRINITY_DLL_DECL npc_thrall_old_hillsbradAI : public npc_escortAI +{ + npc_thrall_old_hillsbradAI(Creature *c) : npc_escortAI(c) + { + pInstance = c->GetInstanceData(); + HadMount = false; + m_creature->setActive(true); + } + + ScriptedInstance *pInstance; + + uint64 TarethaGUID; + + bool LowHp; + bool HadMount; + + void WaypointReached(uint32 i) + { + if (!pInstance) + return; + + switch(i) + { + case 8: + SetRun(false); + m_creature->SummonCreature(18764,2181.87,112.46,89.45,0.26,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); + break; + case 9: + DoScriptText(SAY_TH_ARMORY, m_creature); + m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, THRALL_WEAPON_MODEL); + //m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO, THRALL_WEAPON_INFO); + //m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+1, 781); + m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, THRALL_SHIELD_MODEL); + //m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+2, THRALL_SHIELD_INFO); + //m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+3, 1038); + break; + case 10: + m_creature->SetDisplayId(THRALL_MODEL_EQUIPPED); + break; + case 11: + SetRun(); + break; + case 15: + m_creature->SummonCreature(MOB_ENTRY_RIFLE,2200.28,137.37,87.93,5.07,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); + m_creature->SummonCreature(MOB_ENTRY_WARDEN,2197.44,131.83,87.93,0.78,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); + m_creature->SummonCreature(MOB_ENTRY_VETERAN,2203.62,135.40,87.93,3.70,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); + m_creature->SummonCreature(MOB_ENTRY_VETERAN,2200.75,130.13,87.93,1.48,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); + break; + case 21: + m_creature->SummonCreature(MOB_ENTRY_RIFLE,2135.80,154.01,67.45,4.98,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); + m_creature->SummonCreature(MOB_ENTRY_WARDEN,2144.36,151.87,67.74,4.46,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); + m_creature->SummonCreature(MOB_ENTRY_VETERAN,2142.12,154.41,67.12,4.56,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); + m_creature->SummonCreature(MOB_ENTRY_VETERAN,2138.08,155.38,67.24,4.60,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); + break; + case 25: + m_creature->SummonCreature(MOB_ENTRY_RIFLE,2102.98,192.17,65.24,6.02,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); + m_creature->SummonCreature(MOB_ENTRY_WARDEN,2108.48,198.75,65.18,5.15,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); + m_creature->SummonCreature(MOB_ENTRY_VETERAN,2106.11,197.29,65.18,5.63,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); + m_creature->SummonCreature(MOB_ENTRY_VETERAN,2104.18,194.82,65.18,5.75,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); + break; + case 29: + DoScriptText(SAY_TH_SKARLOC_MEET, m_creature); + m_creature->SummonCreature(ENTRY_SCARLOC,2036.48,271.22,63.43,5.27,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); + //temporary,skarloc should rather be triggered to walk up to thrall + break; + case 30: + IsOnHold = true; + m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + SetRun(false); + break; + case 31: + DoScriptText(SAY_TH_MOUNTS_UP, m_creature); + DoMount(); + SetRun(); + break; + case 37: + //possibly regular patrollers? If so, remove this and let database handle them + m_creature->SummonCreature(MOB_ENTRY_WATCHMAN,2124.26,522.16,56.87,3.99,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); + m_creature->SummonCreature(MOB_ENTRY_WATCHMAN,2121.69,525.37,57.11,4.01,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); + m_creature->SummonCreature(MOB_ENTRY_SENTRY,2124.65,524.55,56.63,3.98,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); + break; + case 59: + m_creature->SummonCreature(SKARLOC_MOUNT,2488.64,625.77,58.26,4.71,TEMPSUMMON_TIMED_DESPAWN,10000); + DoUnmount(); + HadMount = false; + SetRun(false); + break; + case 60: + m_creature->HandleEmoteCommand(EMOTE_ONESHOT_EXCLAMATION); + //make horsie run off + IsOnHold = true; + m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + pInstance->SetData(TYPE_THRALL_PART2, DONE); + SetRun(); + break; + case 64: + SetRun(false); + break; + case 68: + m_creature->SummonCreature(MOB_ENTRY_BARN_PROTECTOR,2500.22,692.60,55.50,2.84,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); + m_creature->SummonCreature(MOB_ENTRY_BARN_LOOKOUT,2500.13,696.55,55.51,3.38,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); + m_creature->SummonCreature(MOB_ENTRY_BARN_GUARDSMAN,2500.55,693.64,55.50,3.14,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); + m_creature->SummonCreature(MOB_ENTRY_BARN_GUARDSMAN,2500.94,695.81,55.50,3.14,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); + break; + case 71: + SetRun(); + break; + case 81: + SetRun(false); + break; + case 83: + m_creature->SummonCreature(MOB_ENTRY_CHURCH_PROTECTOR,2627.33,646.82,56.03,4.28,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,5000); + m_creature->SummonCreature(MOB_ENTRY_CHURCH_LOOKOUT,2624.14,648.03,56.03,4.50,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,5000); + m_creature->SummonCreature(MOB_ENTRY_CHURCH_GUARDSMAN,2625.32,649.60,56.03,4.38,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,5000); + m_creature->SummonCreature(MOB_ENTRY_CHURCH_GUARDSMAN,2627.22,649.00,56.03,4.34,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,5000); + break; + case 84: + DoScriptText(SAY_TH_CHURCH_END, m_creature); + SetRun(); + break; + case 91: + m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + SetRun(false); + break; + case 93: + m_creature->SummonCreature(MOB_ENTRY_INN_PROTECTOR,2652.71,660.31,61.93,1.67,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); + m_creature->SummonCreature(MOB_ENTRY_INN_LOOKOUT,2648.96,662.59,61.93,0.79,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); + m_creature->SummonCreature(MOB_ENTRY_INN_GUARDSMAN,2657.36,662.34,61.93,2.68,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); + m_creature->SummonCreature(MOB_ENTRY_INN_GUARDSMAN,2656.39,659.77,61.93,2.61,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); + break; + case 94: + if (uint64 TarethaGUID = pInstance->GetData64(DATA_TARETHA)) + { + if (Unit* Taretha = Unit::GetUnit((*m_creature), TarethaGUID)) + DoScriptText(SAY_TA_ESCAPED, Taretha, m_creature); + } + break; + case 95: + DoScriptText(SAY_TH_MEET_TARETHA, m_creature); + pInstance->SetData(TYPE_THRALL_PART3,DONE); + IsOnHold = true; + break; + case 96: + DoScriptText(SAY_TH_EPOCH_WONDER, m_creature); + break; + case 97: + DoScriptText(SAY_TH_EPOCH_KILL_TARETHA, m_creature); + SetRun(); + break; + case 98: + //trigger epoch Yell("Thrall! Come outside and face your fate! ....") + //from here, thrall should not never be allowed to move to point 106 which he currently does. + break; + + case 106: + { + if (!PlayerGUID) + break; + + //trigger taretha to run down outside + if (uint64 TarethaGUID = pInstance->GetData64(DATA_TARETHA)) + { + if (Creature* Taretha = (Unit::GetCreature(*m_creature, TarethaGUID))) + CAST_AI(npc_escortAI, (Taretha->AI()))->Start(false, true, PlayerGUID); + } + + //kill credit Creature for quest + Map* pMap = m_creature->GetMap(); + Map::PlayerList const& players = pMap->GetPlayers(); + if (!players.isEmpty() && pMap->IsDungeon()) + { + for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + { + if (Player* pPlayer = itr->getSource()) + pPlayer->KilledMonsterCredit(20156,m_creature->GetGUID()); + } + } + + //alot will happen here, thrall and taretha talk, erozion appear at spot to explain + m_creature->SummonCreature(EROZION_ENTRY,2646.47,680.416,55.38,4.16,TEMPSUMMON_TIMED_DESPAWN,120000); + } + break; + case 108: + //last waypoint, just set Thrall invisible, respawn is turned off + m_creature->SetVisibility(VISIBILITY_OFF); + break; + } + } + + + void Reset() + { + LowHp = false; + + if (HadMount) + DoMount(); + + if (!IsBeingEscorted) + { + DoUnmount(); + HadMount = false; + m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, 0); + m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, 0); + m_creature->SetDisplayId(THRALL_MODEL_UNEQUIPPED); + } + if (IsBeingEscorted) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_TH_LEAVE_COMBAT1, m_creature); break; + case 1: DoScriptText(SAY_TH_LEAVE_COMBAT2, m_creature); break; + case 2: DoScriptText(SAY_TH_LEAVE_COMBAT3, m_creature); break; + } + } + } + void StartWP() + { + m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + IsOnHold = false; + } + void DoMount() + { + m_creature->Mount(SKARLOC_MOUNT_MODEL); + m_creature->SetSpeed(MOVE_RUN,SPEED_MOUNT); + } + void DoUnmount() + { + m_creature->Unmount(); + m_creature->SetSpeed(MOVE_RUN,SPEED_RUN); + } + void EnterCombat(Unit* who) + { + switch(rand()%4) + { + case 0: DoScriptText(SAY_TH_RANDOM_AGGRO1, m_creature); break; + case 1: DoScriptText(SAY_TH_RANDOM_AGGRO2, m_creature); break; + case 2: DoScriptText(SAY_TH_RANDOM_AGGRO3, m_creature); break; + case 3: DoScriptText(SAY_TH_RANDOM_AGGRO4, m_creature); break; + } + if (m_creature->IsMounted()) + { + DoUnmount(); + HadMount = true; + } + } + + void JustSummoned(Creature* summoned) + { + switch(summoned->GetEntry()) + { + //TODO: make Scarloc start into event instead, and not start attack directly + case MOB_ENTRY_BARN_GUARDSMAN: + case MOB_ENTRY_BARN_PROTECTOR: + case MOB_ENTRY_BARN_LOOKOUT: + case SKARLOC_MOUNT: + case EROZION_ENTRY: + break; + default: + summoned->AI()->AttackStart(m_creature); + break; + } + } + + void KilledUnit(Unit *victim) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_TH_RANDOM_KILL1, m_creature); break; + case 1: DoScriptText(SAY_TH_RANDOM_KILL2, m_creature); break; + case 2: DoScriptText(SAY_TH_RANDOM_KILL3, m_creature); break; + } + } + void JustDied(Unit *slayer) + { + if (pInstance) + pInstance->SetData(TYPE_THRALL_EVENT,FAIL); + + // Don't do a yell if he kills self (if player goes too far or at the end). + if (slayer == m_creature) + return; + + switch(rand()%2) + { + case 0: DoScriptText(SAY_TH_RANDOM_DIE1, m_creature); break; + case 1: DoScriptText(SAY_TH_RANDOM_DIE2, m_creature); break; + } + } + + void UpdateAI(const uint32 diff) + { + npc_escortAI::UpdateAI(diff); + + if (!UpdateVictim()) + return; + + //TODO: add his abilities'n-crap here + if (!LowHp && ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 20)) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_TH_RANDOM_LOW_HP1, m_creature); break; + case 1: DoScriptText(SAY_TH_RANDOM_LOW_HP2, m_creature); break; + } + LowHp = true; + } + } +}; + +CreatureAI* GetAI_npc_thrall_old_hillsbrad(Creature* pCreature) +{ + return new npc_thrall_old_hillsbradAI(pCreature); +} + +bool GossipHello_npc_thrall_old_hillsbrad(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + { + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + pPlayer->SendPreparedQuest(pCreature->GetGUID()); + } + + ScriptedInstance* pInstance = (pCreature->GetInstanceData()); + if (pInstance) + { + if (pInstance->GetData(TYPE_BARREL_DIVERSION) == DONE && !pInstance->GetData(TYPE_THRALL_EVENT)) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "[PH] Start walking.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_ID_START, pCreature->GetGUID()); + } + + if (pInstance->GetData(TYPE_THRALL_PART1) == DONE && !pInstance->GetData(TYPE_THRALL_PART2)) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_SKARLOC1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_ID_SKARLOC1, pCreature->GetGUID()); + } + + if (pInstance->GetData(TYPE_THRALL_PART2) == DONE && !pInstance->GetData(TYPE_THRALL_PART3)) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_TARREN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_ID_TARREN, pCreature->GetGUID()); + } + } + return true; +} + +bool GossipSelect_npc_thrall_old_hillsbrad(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + ScriptedInstance* pInstance = (pCreature->GetInstanceData()); + switch(uiAction) + { + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->CLOSE_GOSSIP_MENU(); + if (pInstance) + { + pInstance->SetData(TYPE_THRALL_EVENT,IN_PROGRESS); + pInstance->SetData(TYPE_THRALL_PART1,IN_PROGRESS); + } + + DoScriptText(SAY_TH_START_EVENT_PART1, pCreature); + + if (npc_escortAI* pEscortAI = CAST_AI(npc_thrall_old_hillsbradAI, pCreature->AI())) + pEscortAI->Start(true, true, pPlayer->GetGUID()); + + CAST_AI(npc_escortAI, (pCreature->AI()))->SetMaxPlayerDistance(100.0f);//not really needed, because it will not despawn if player is too far + CAST_AI(npc_escortAI, (pCreature->AI()))->SetDespawnAtEnd(false); + CAST_AI(npc_escortAI, (pCreature->AI()))->SetDespawnAtFar(false); + break; + + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_SKARLOC2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+20); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_ID_SKARLOC2, pCreature->GetGUID()); + break; + + case GOSSIP_ACTION_INFO_DEF+20: + pPlayer->SEND_GOSSIP_MENU(GOSSIP_ID_SKARLOC3, pCreature->GetGUID()); + pCreature->SummonCreature(SKARLOC_MOUNT,2038.81,270.26,63.20,5.41,TEMPSUMMON_TIMED_DESPAWN,12000); + if (pInstance) + pInstance->SetData(TYPE_THRALL_PART2,IN_PROGRESS); + + DoScriptText(SAY_TH_START_EVENT_PART2, pCreature); + + CAST_AI(npc_thrall_old_hillsbradAI, pCreature->AI())->StartWP(); + break; + + case GOSSIP_ACTION_INFO_DEF+3: + pPlayer->CLOSE_GOSSIP_MENU(); + if (pInstance) + pInstance->SetData(TYPE_THRALL_PART3,IN_PROGRESS); + CAST_AI(npc_thrall_old_hillsbradAI, pCreature->AI())->StartWP(); + break; + } + return true; +} + +/*###### +## npc_taretha +######*/ + +#define GOSSIP_ID_EPOCH1 9610 //Thank you for helping Thrall escape, friends. Now I only hope +#define GOSSIP_ITEM_EPOCH1 "Strange wizard?" +#define GOSSIP_ID_EPOCH2 9613 //Yes, friends. This man was no wizard of +#define GOSSIP_ITEM_EPOCH2 "We'll get you out. Taretha. Don't worry. I doubt the wizard would wander too far away." + +struct TRINITY_DLL_DECL npc_tarethaAI : public npc_escortAI +{ + npc_tarethaAI(Creature *c) : npc_escortAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance *pInstance; + + void WaypointReached(uint32 i) + { + switch(i) + { + case 6: + DoScriptText(SAY_TA_FREE, m_creature); + break; + case 7: + m_creature->HandleEmoteCommand(EMOTE_ONESHOT_CHEER); + break; + } + } + void Reset() {} + void EnterCombat(Unit* who) {} + + void UpdateAI(const uint32 diff) + { + npc_escortAI::UpdateAI(diff); + } +}; +CreatureAI* GetAI_npc_taretha(Creature* pCreature) +{ + return new npc_tarethaAI(pCreature); +} + +bool GossipHello_npc_taretha(Player* pPlayer, Creature* pCreature) +{ + ScriptedInstance* pInstance = (pCreature->GetInstanceData()); + if (pInstance && pInstance->GetData(TYPE_THRALL_PART3) == DONE && pInstance->GetData(TYPE_THRALL_PART4) == NOT_STARTED) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_EPOCH1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_ID_EPOCH1, pCreature->GetGUID()); + } + return true; +} + +bool GossipSelect_npc_taretha(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + ScriptedInstance* pInstance = (pCreature->GetInstanceData()); + if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_EPOCH2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_ID_EPOCH2, pCreature->GetGUID()); + } + if (uiAction == GOSSIP_ACTION_INFO_DEF+2) + { + pPlayer->CLOSE_GOSSIP_MENU(); + + if (pInstance->GetData(TYPE_THRALL_EVENT) == IN_PROGRESS) + { + if (pInstance) + pInstance->SetData(TYPE_THRALL_PART4,IN_PROGRESS); + if (pInstance->GetData64(DATA_EPOCH) == 0) + pCreature->SummonCreature(ENTRY_EPOCH,2639.13,698.55,65.43,4.59,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,120000); + + if (uint64 ThrallGUID = pInstance->GetData64(DATA_THRALL)) + { + Creature* Thrall = (Unit::GetCreature((*pCreature), ThrallGUID)); + if (Thrall) + CAST_AI(npc_thrall_old_hillsbradAI, Thrall->AI())->StartWP(); + } + } + } + return true; +} + +/*###### +## AddSC +######*/ + +void AddSC_old_hillsbrad() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="npc_erozion"; + newscript->pGossipHello = &GossipHello_npc_erozion; + newscript->pGossipSelect = &GossipSelect_npc_erozion; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_thrall_old_hillsbrad"; + newscript->pGossipHello = &GossipHello_npc_thrall_old_hillsbrad; + newscript->pGossipSelect = &GossipSelect_npc_thrall_old_hillsbrad; + newscript->GetAI = &GetAI_npc_thrall_old_hillsbrad; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_taretha"; + newscript->pGossipHello = &GossipHello_npc_taretha; + newscript->pGossipSelect = &GossipSelect_npc_taretha; + newscript->GetAI = &GetAI_npc_taretha; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/maraudon/boss_celebras_the_cursed.cpp b/src/bindings/scripts/scripts/kalimdor/maraudon/boss_celebras_the_cursed.cpp new file mode 100644 index 00000000000..f2ac8ff08e1 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/maraudon/boss_celebras_the_cursed.cpp @@ -0,0 +1,98 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Celebras_the_Cursed +SD%Complete: 100 +SDComment: +SDCategory: Maraudon +EndScriptData */ + +#include "precompiled.h" + +#define SPELL_WRATH 21807 +#define SPELL_ENTANGLINGROOTS 12747 +#define SPELL_CORRUPT_FORCES 21968 + +struct TRINITY_DLL_DECL celebras_the_cursedAI : public ScriptedAI +{ + celebras_the_cursedAI(Creature *c) : ScriptedAI(c) {} + + uint32 Wrath_Timer; + uint32 EntanglingRoots_Timer; + uint32 CorruptForces_Timer; + + void Reset() + { + Wrath_Timer = 8000; + EntanglingRoots_Timer = 2000; + CorruptForces_Timer = 30000; + } + + void EnterCombat(Unit *who) { } + + void JustDied(Unit* Killer) + { + m_creature->SummonCreature(13716, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 600000); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + //Wrath + if (Wrath_Timer < diff) + { + Unit* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM,0); + if (target) + DoCast(target,SPELL_WRATH); + Wrath_Timer = 8000; + }else Wrath_Timer -= diff; + + //EntanglingRoots + if (EntanglingRoots_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_ENTANGLINGROOTS); + EntanglingRoots_Timer = 20000; + }else EntanglingRoots_Timer -= diff; + + //CorruptForces + if (CorruptForces_Timer < diff) + { + m_creature->InterruptNonMeleeSpells(false); + DoCast(m_creature,SPELL_CORRUPT_FORCES); + CorruptForces_Timer = 20000; + }else CorruptForces_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_celebras_the_cursed(Creature* pCreature) +{ + return new celebras_the_cursedAI (pCreature); +} + +void AddSC_boss_celebras_the_cursed() +{ + Script *newscript; + newscript = new Script; + newscript->Name="celebras_the_cursed"; + newscript->GetAI = &GetAI_celebras_the_cursed; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/maraudon/boss_landslide.cpp b/src/bindings/scripts/scripts/kalimdor/maraudon/boss_landslide.cpp new file mode 100644 index 00000000000..353b9c1e3c0 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/maraudon/boss_landslide.cpp @@ -0,0 +1,95 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Landslide +SD%Complete: 100 +SDComment: +SDCategory: Maraudon +EndScriptData */ + +#include "precompiled.h" + +#define SPELL_KNOCKAWAY 18670 +#define SPELL_TRAMPLE 5568 +#define SPELL_LANDSLIDE 21808 + +struct TRINITY_DLL_DECL boss_landslideAI : public ScriptedAI +{ + boss_landslideAI(Creature *c) : ScriptedAI(c) {} + + uint32 KnockAway_Timer; + uint32 Trample_Timer; + uint32 Landslide_Timer; + + void Reset() + { + KnockAway_Timer = 8000; + Trample_Timer = 2000; + Landslide_Timer = 0; + } + + void EnterCombat(Unit *who) + { + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + //KnockAway_Timer + if (KnockAway_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_KNOCKAWAY); + KnockAway_Timer = 15000; + }else KnockAway_Timer -= diff; + + //Trample_Timer + if (Trample_Timer < diff) + { + DoCast(m_creature,SPELL_TRAMPLE); + Trample_Timer = 8000; + }else Trample_Timer -= diff; + + //Landslide + if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 50) + { + if (Landslide_Timer < diff) + { + m_creature->InterruptNonMeleeSpells(false); + DoCast(m_creature,SPELL_LANDSLIDE); + Landslide_Timer = 60000; + } else Landslide_Timer -= diff; + } + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_landslide(Creature* pCreature) +{ + return new boss_landslideAI (pCreature); +} + +void AddSC_boss_landslide() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_landslide"; + newscript->GetAI = &GetAI_boss_landslide; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/maraudon/boss_noxxion.cpp b/src/bindings/scripts/scripts/kalimdor/maraudon/boss_noxxion.cpp new file mode 100644 index 00000000000..62190d4192a --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/maraudon/boss_noxxion.cpp @@ -0,0 +1,150 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Noxxion +SD%Complete: 100 +SDComment: +SDCategory: Maraudon +EndScriptData */ + +#include "precompiled.h" + +#define SPELL_TOXICVOLLEY 21687 +#define SPELL_UPPERCUT 22916 + +struct TRINITY_DLL_DECL boss_noxxionAI : public ScriptedAI +{ + boss_noxxionAI(Creature *c) : ScriptedAI(c) {} + + uint32 ToxicVolley_Timer; + uint32 Uppercut_Timer; + uint32 Adds_Timer; + uint32 Invisible_Timer; + bool Invisible; + int Rand; + int RandX; + int RandY; + Creature* Summoned; + + void Reset() + { + ToxicVolley_Timer = 7000; + Uppercut_Timer = 16000; + Adds_Timer = 19000; + Invisible_Timer = 15000; //Too much too low? + Invisible = false; + } + + void EnterCombat(Unit *who) + { + } + + void SummonAdds(Unit* victim) + { + Rand = rand()%8; + switch (rand()%2) + { + case 0: RandX = 0 - Rand; break; + case 1: RandX = 0 + Rand; break; + } + Rand = 0; + Rand = rand()%8; + switch (rand()%2) + { + case 0: RandY = 0 - Rand; break; + case 1: RandY = 0 + Rand; break; + } + Rand = 0; + Summoned = DoSpawnCreature(13456, RandX, RandY, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 90000); + if (Summoned) + (Summoned->AI())->AttackStart(victim); + } + + void UpdateAI(const uint32 diff) + { + if (Invisible && Invisible_Timer < diff) + { + //Become visible again + m_creature->setFaction(14); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + //Noxxion model + m_creature->SetDisplayId(11172); + Invisible = false; + //m_creature->m_canMove = true; + } else if (Invisible) + { + Invisible_Timer -= diff; + //Do nothing while invisible + return; + } + + //Return since we have no target + if (!UpdateVictim()) + return; + + //ToxicVolley_Timer + if (ToxicVolley_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_TOXICVOLLEY); + ToxicVolley_Timer = 9000; + }else ToxicVolley_Timer -= diff; + + //Uppercut_Timer + if (Uppercut_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_UPPERCUT); + Uppercut_Timer = 12000; + }else Uppercut_Timer -= diff; + + //Adds_Timer + if (!Invisible && Adds_Timer < diff) + { + //Inturrupt any spell casting + //m_creature->m_canMove = true; + m_creature->InterruptNonMeleeSpells(false); + m_creature->setFaction(35); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + // Invisible Model + m_creature->SetDisplayId(11686); + SummonAdds(m_creature->getVictim()); + SummonAdds(m_creature->getVictim()); + SummonAdds(m_creature->getVictim()); + SummonAdds(m_creature->getVictim()); + SummonAdds(m_creature->getVictim()); + Invisible = true; + Invisible_Timer = 15000; + + Adds_Timer = 40000; + }else Adds_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_noxxion(Creature* pCreature) +{ + return new boss_noxxionAI (pCreature); +} + +void AddSC_boss_noxxion() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_noxxion"; + newscript->GetAI = &GetAI_boss_noxxion; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/maraudon/boss_princess_theradras.cpp b/src/bindings/scripts/scripts/kalimdor/maraudon/boss_princess_theradras.cpp new file mode 100644 index 00000000000..7199c18cf75 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/maraudon/boss_princess_theradras.cpp @@ -0,0 +1,109 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Princess_Theradras +SD%Complete: 100 +SDComment: +SDCategory: Maraudon +EndScriptData */ + +#include "precompiled.h" + +#define SPELL_DUSTFIELD 21909 +#define SPELL_BOULDER 21832 +#define SPELL_THRASH 3391 +#define SPELL_REPULSIVEGAZE 21869 + +struct TRINITY_DLL_DECL boss_ptheradrasAI : public ScriptedAI +{ + boss_ptheradrasAI(Creature *c) : ScriptedAI(c) {} + + uint32 Dustfield_Timer; + uint32 Boulder_Timer; + uint32 Thrash_Timer; + uint32 RepulsiveGaze_Timer; + + void Reset() + { + Dustfield_Timer = 8000; + Boulder_Timer = 2000; + Thrash_Timer = 5000; + RepulsiveGaze_Timer = 23000; + } + + void EnterCombat(Unit *who) + { + } + + void JustDied(Unit* Killer) + { + m_creature->SummonCreature(12238,28.067,61.875,-123.405,4.67,TEMPSUMMON_TIMED_DESPAWN,600000); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + //Dustfield_Timer + if (Dustfield_Timer < diff) + { + DoCast(m_creature,SPELL_DUSTFIELD); + Dustfield_Timer = 14000; + }else Dustfield_Timer -= diff; + + //Boulder_Timer + if (Boulder_Timer < diff) + { + Unit* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM,0); + if (target) + DoCast(target,SPELL_BOULDER); + Boulder_Timer = 10000; + }else Boulder_Timer -= diff; + + //RepulsiveGaze_Timer + if (RepulsiveGaze_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_REPULSIVEGAZE); + RepulsiveGaze_Timer = 20000; + }else RepulsiveGaze_Timer -= diff; + + //Thrash_Timer + if (Thrash_Timer < diff) + { + DoCast(m_creature,SPELL_THRASH); + Thrash_Timer = 18000; + }else Thrash_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_ptheradras(Creature* pCreature) +{ + return new boss_ptheradrasAI (pCreature); +} + +void AddSC_boss_ptheradras() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_princess_theradras"; + newscript->GetAI = &GetAI_boss_ptheradras; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/onyxias_lair/boss_onyxia.cpp b/src/bindings/scripts/scripts/kalimdor/onyxias_lair/boss_onyxia.cpp new file mode 100644 index 00000000000..35608557dad --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/onyxias_lair/boss_onyxia.cpp @@ -0,0 +1,307 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Onyxia +SD%Complete: 90 +SDComment: Spell Heated Ground is wrong, flying animation, visual for area effect +SDCategory: Onyxia's Lair +EndScriptData */ + +#include "precompiled.h" + +#define SAY_AGGRO -1249000 +#define SAY_KILL -1249001 +#define SAY_PHASE_2_TRANS -1249002 +#define SAY_PHASE_3_TRANS -1249003 +#define EMOTE_BREATH -1249004 + +#define SPELL_WINGBUFFET 18500 +#define SPELL_FLAMEBREATH 18435 +#define SPELL_CLEAVE 19983 +#define SPELL_TAILSWEEP 15847 +#define SPELL_KNOCK_AWAY 19633 + +#define SPELL_ENGULFINGFLAMES 20019 +#define SPELL_DEEPBREATH 23461 +#define SPELL_FIREBALL 18392 + +#define SPELL_BELLOWINGROAR 18431 +#define SPELL_HEATED_GROUND 22191 //Wrong Spell + +#define SPELL_SUMMONWHELP 17646 + +#define CREATURE_WHELP 11262 + +static float MovementLocations[4][3]= +{ + {-64.0523, -213.0619, -68.2985}, + {12.4636, -220.01490, -68.0548}, + {-38.8391, -182.3220, -68.9457}, + {-37.0390, -244.8760, -68.1278} +}; + +static float SpawnLocations[4][3]= +{ + {-30.127, -254.463, -89.440}, + {-30.817, -177.106, -89.258}, + {14.480, -241.560, -85.6300}, + {17.372, -190.840, -85.2810}, +}; + +struct TRINITY_DLL_DECL boss_onyxiaAI : public ScriptedAI +{ + boss_onyxiaAI(Creature* c) : ScriptedAI(c) {} + + uint32 Phase; + + uint32 FlameBreathTimer; + uint32 CleaveTimer; + uint32 TailSweepTimer; + uint32 MovementTimer; + uint32 EngulfingFlamesTimer; + uint32 SummonWhelpsTimer; + uint32 BellowingRoarTimer; + uint32 WingBuffetTimer; + uint32 KnockAwayTimer; + uint32 FireballTimer; + + bool InitialSpawn; + + void Reset() + { + Phase = 1; + + FlameBreathTimer = 20000; + TailSweepTimer = 2000; + CleaveTimer = 15000; + MovementTimer = 3000; + EngulfingFlamesTimer = 15000; + SummonWhelpsTimer = 45000; + BellowingRoarTimer = 30000; + WingBuffetTimer = 17000; + KnockAwayTimer = 15000; + FireballTimer = 18000; + + InitialSpawn = true; + } + + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + DoZoneInCombat(); + } + + void JustDied(Unit* Killer) + { + } + + void KilledUnit(Unit *victim) + { + DoScriptText(SAY_KILL, m_creature); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 60) && (Phase == 1)) + { + Phase = 2; + m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + m_creature->SetHover(true); + m_creature->GetMotionMaster()->Clear(false); + m_creature->GetMotionMaster()->MoveIdle(); + DoScriptText(SAY_PHASE_2_TRANS, m_creature); + } + + if (((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 40) && (Phase == 2)) + { + Phase = 3; + m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + m_creature->SetHover(false); + m_creature->GetMotionMaster()->MovePoint(0, -10.6155, -219.357, -87.7344); + DoStartMovement(m_creature->getVictim()); + m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + DoScriptText(SAY_PHASE_3_TRANS, m_creature); + m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); + } + + if (Phase == 1 || Phase == 3) + { + if (FlameBreathTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_FLAMEBREATH); + FlameBreathTimer = 15000; + }else FlameBreathTimer -= diff; + + if (TailSweepTimer < diff) + { + Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1); + if (target && !m_creature->HasInArc(M_PI, target)) + DoCast(target, SPELL_TAILSWEEP); + + TailSweepTimer = 10000; + }else TailSweepTimer -= diff; + + if (CleaveTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_CLEAVE); + CleaveTimer = 10000; + }else CleaveTimer -= diff; + + if (WingBuffetTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_WINGBUFFET); + WingBuffetTimer = 7000 + ((rand()%8)*1000); + }else WingBuffetTimer -= diff; + + if (KnockAwayTimer < diff) + { + if (rand() <= 30) + { + DoCast(m_creature->getVictim(), SPELL_KNOCK_AWAY); + } + KnockAwayTimer = 15000; + }else KnockAwayTimer -= diff; + + if (Phase == 3) + { + if (BellowingRoarTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_BELLOWINGROAR); + + BellowingRoarTimer = 30000; + }else BellowingRoarTimer -= diff; + + if (SummonWhelpsTimer < diff) + { + SummonWhelps(Phase); + + SummonWhelpsTimer = 45000; + }else SummonWhelpsTimer -= diff; + } + + DoMeleeAttackIfReady(); + } + + if (Phase == 2) + { + if (InitialSpawn) + { + InitialSpawn = false; + + for(uint32 i = 0; i < 10; ++i) + { + uint32 random = rand()%4; + Creature* Whelp = m_creature->SummonCreature(CREATURE_WHELP, SpawnLocations[random][0], SpawnLocations[random][1], SpawnLocations[random][2], 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000); + if (Whelp) + Whelp->AI()->AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 0)); + } + } + + if (EngulfingFlamesTimer < diff) + { + DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_ENGULFINGFLAMES); + m_creature->HandleEmoteCommand(ANIM_FLY); + + EngulfingFlamesTimer = 10000; + } + else EngulfingFlamesTimer -= diff; + + if (FireballTimer < diff) + { + DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_FIREBALL); + + FireballTimer = 18000; + } + else FireballTimer -= diff; + + if (MovementTimer < diff) + { + if (rand()%100 < 30) + { + DoScriptText(EMOTE_BREATH, m_creature); + DoCast(m_creature->getVictim(), SPELL_DEEPBREATH); + } + else ChangePosition(); + + MovementTimer = 25000; + }else MovementTimer -= diff; + + if (SummonWhelpsTimer < diff) + { + SummonWhelps(Phase); + + SummonWhelpsTimer = 45000; + } + else SummonWhelpsTimer -= diff; + } + } + + void ChangePosition() + { + uint32 random = rand() % 4; + if (random<4){ + m_creature->GetMotionMaster()->MovePoint(0, MovementLocations[random][0], MovementLocations[random][1], MovementLocations[random][2]);} + } + + void SummonWhelps(uint32 Phase) + { + if (Phase == 2) + { + uint32 max = rand()%10; + for(uint32 i = 0; i < max; ++i) + { + uint32 random = rand()%3; + Creature* Whelp = m_creature->SummonCreature(CREATURE_WHELP, SpawnLocations[random][0], SpawnLocations[random][1], SpawnLocations[random][2], 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000); + if (Whelp) + Whelp->AI()->AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 0)); + } + } + + if (Phase == 3) + { + uint32 max = rand() % 10 +1; + if (max < 5) + { + for(uint32 i = 0; i < max; ++i) + { + uint32 random = rand()%4; + Creature* Whelp = m_creature->SummonCreature(CREATURE_WHELP, SpawnLocations[random][0], SpawnLocations[random][1], SpawnLocations[random][2], 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000); + if (Whelp) + Whelp->AI()->AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 0)); + } + } + } + } +}; + +CreatureAI* GetAI_boss_onyxiaAI(Creature* pCreature) +{ + return new boss_onyxiaAI (pCreature); +} + +void AddSC_boss_onyxia() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_onyxia"; + newscript->GetAI = &GetAI_boss_onyxiaAI; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/razorfen_downs/boss_amnennar_the_coldbringer.cpp b/src/bindings/scripts/scripts/kalimdor/razorfen_downs/boss_amnennar_the_coldbringer.cpp new file mode 100644 index 00000000000..2ecccaf2980 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/razorfen_downs/boss_amnennar_the_coldbringer.cpp @@ -0,0 +1,130 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Amnennar_the_coldbringer +SD%Complete: 100 +SDComment: +SDCategory: Razorfen Downs +EndScriptData */ + +#include "precompiled.h" + +#define SAY_AGGRO -1129000 +#define SAY_SUMMON60 -1129001 +#define SAY_SUMMON30 -1129002 +#define SAY_HP -1129003 +#define SAY_KILL -1129004 + +#define SPELL_AMNENNARSWRATH 13009 +#define SPELL_FROSTBOLT 15530 +#define SPELL_FROST_NOVA 15531 +#define SPELL_FROST_SPECTRES 12642 + +struct TRINITY_DLL_DECL boss_amnennar_the_coldbringerAI : public ScriptedAI +{ + boss_amnennar_the_coldbringerAI(Creature *c) : ScriptedAI(c) {} + + uint32 AmnenarsWrath_Timer; + uint32 FrostBolt_Timer; + uint32 FrostNova_Timer; + bool Spectrals60; + bool Spectrals30; + bool Hp; + + void Reset() + { + AmnenarsWrath_Timer = 8000; + FrostBolt_Timer = 1000; + FrostNova_Timer = 10000 + rand()%5000; + Spectrals30 = false; + Spectrals60 = false; + Hp = false; + } + + void EnterCombat(Unit *who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + + void KilledUnit() + { + DoScriptText(SAY_KILL, m_creature); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + //AmnenarsWrath_Timer + if (AmnenarsWrath_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_AMNENNARSWRATH); + AmnenarsWrath_Timer = 12000; + } else AmnenarsWrath_Timer -= diff; + + //FrostBolt_Timer + if (FrostBolt_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_FROSTBOLT); + FrostBolt_Timer = 8000; + } else FrostBolt_Timer -= diff; + + if (FrostNova_Timer < diff) + { + DoCast(m_creature,SPELL_FROST_NOVA); + FrostNova_Timer = 15000; + } else FrostNova_Timer -= diff; + + if (!Spectrals60 && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 60) + { + DoScriptText(SAY_SUMMON60, m_creature); + DoCast(m_creature->getVictim(),SPELL_FROST_SPECTRES); + Spectrals60 = true; + } + + if (!Hp && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 50) + { + DoScriptText(SAY_HP, m_creature); + Hp = true; + } + + if (!Spectrals30 && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 30) + { + DoScriptText(SAY_SUMMON30, m_creature); + DoCast(m_creature->getVictim(),SPELL_FROST_SPECTRES); + Spectrals30 = true; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_amnennar_the_coldbringer(Creature* pCreature) +{ + return new boss_amnennar_the_coldbringerAI (pCreature); +} + +void AddSC_boss_amnennar_the_coldbringer() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_amnennar_the_coldbringer"; + newscript->GetAI = &GetAI_boss_amnennar_the_coldbringer; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/razorfen_downs/razorfen_downs.cpp b/src/bindings/scripts/scripts/kalimdor/razorfen_downs/razorfen_downs.cpp new file mode 100644 index 00000000000..7515c5a9195 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/razorfen_downs/razorfen_downs.cpp @@ -0,0 +1,85 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Razorfen_Downs +SD%Complete: 100 +SDComment: Support for Henry Stern(2 recipes) +SDCategory: Razorfen Downs +EndScriptData */ + +/* ContentData +npc_henry_stern +EndContentData */ + +#include "precompiled.h" + +/*### +# npc_henry_stern +####*/ + +enum +{ + SPELL_GOLDTHORN_TEA = 13028, + SPELL_TEACHING_GOLDTHORN_TEA = 13029, + SPELL_MIGHT_TROLLS_BLOOD_POTION = 3451, + SPELL_TEACHING_MIGHTY_TROLLS_BLOOD_POTION = 13030, + GOSSIP_TEXT_TEA_ANSWER = 2114, + GOSSIP_TEXT_POTION_ANSWER = 2115, +}; + +#define GOSSIP_ITEM_TEA "Teach me the cooking recipe" +#define GOSSIP_ITEM_POTION "Teach me the alchemy recipe" + +bool GossipHello_npc_henry_stern (Player* pPlayer, Creature* pCreature) +{ + if (pPlayer->GetBaseSkillValue(SKILL_COOKING) >= 175 && !pPlayer->HasSpell(SPELL_GOLDTHORN_TEA)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_TEA, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + + if (pPlayer->GetBaseSkillValue(SKILL_ALCHEMY) >= 180 && !pPlayer->HasSpell(SPELL_MIGHT_TROLLS_BLOOD_POTION)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_POTION, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + + pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_henry_stern (Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) + { + pCreature->CastSpell(pPlayer, SPELL_TEACHING_GOLDTHORN_TEA, true); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXT_TEA_ANSWER, pCreature->GetGUID()); + } + + if (uiAction == GOSSIP_ACTION_INFO_DEF + 2) + { + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXT_POTION_ANSWER, pCreature->GetGUID()); + pCreature->CastSpell(pPlayer, SPELL_TEACHING_MIGHTY_TROLLS_BLOOD_POTION, true); + } + + return true; +} + +void AddSC_razorfen_downs() +{ + Script* newscript; + + newscript = new Script; + newscript->Name = "npc_henry_stern"; + newscript->pGossipHello = &GossipHello_npc_henry_stern; + newscript->pGossipSelect = &GossipSelect_npc_henry_stern; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/kalimdor/razorfen_kraul/def_razorfen_kraul.h b/src/bindings/scripts/scripts/kalimdor/razorfen_kraul/def_razorfen_kraul.h new file mode 100644 index 00000000000..96917fcd4bf --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/razorfen_kraul/def_razorfen_kraul.h @@ -0,0 +1,21 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef DEF_RAZORFEN_KRAUL_H +#define DEF_RAZORFEN_KRAUL_H + +#define TYPE_WARD_KEEPERS 1 +#endif \ No newline at end of file diff --git a/src/bindings/scripts/scripts/kalimdor/razorfen_kraul/instance_razorfen_kraul.cpp b/src/bindings/scripts/scripts/kalimdor/razorfen_kraul/instance_razorfen_kraul.cpp new file mode 100644 index 00000000000..94b0943cf3d --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/razorfen_kraul/instance_razorfen_kraul.cpp @@ -0,0 +1,105 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Razorfen_Kraul +SD%Complete: +SDComment: +SDCategory: Razorfen Kraul +EndScriptData */ + +#include "precompiled.h" +#include "def_razorfen_kraul.h" + + +#define WARD_KEEPERS_NR 2 + +struct TRINITY_DLL_DECL instance_razorfen_kraul : public ScriptedInstance +{ + instance_razorfen_kraul(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint64 DoorWardGUID; + uint32 WardCheck_Timer; + int WardKeeperAlive; + + void Initialize() + { + WardKeeperAlive = 1; + WardCheck_Timer = 4000; + DoorWardGUID = 0; + } + + Player* GetPlayerInMap() + { + Map::PlayerList const& players = instance->GetPlayers(); + + if (!players.isEmpty()) + { + for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + { + if (Player* plr = itr->getSource()) + return plr; + } + } + debug_log("TSCR: Instance Razorfen Kraul: GetPlayerInMap, but PlayerList is empty!"); + return NULL; + } + + void OnGameObjectCreate(GameObject* pGo, bool apply) + { + switch(pGo->GetEntry()) + { + case 21099: DoorWardGUID = pGo->GetGUID(); break; + } + } + + void Update(uint32 diff) + { + if (WardCheck_Timer < diff) + { + HandleGameObject(DoorWardGUID, WardKeeperAlive); + WardKeeperAlive = 0; + WardCheck_Timer = 4000; + }else + WardCheck_Timer -= diff; + } + + void SetData(uint32 type, uint32 data) + { + switch(type) + { + case TYPE_WARD_KEEPERS: + if (data == NOT_STARTED) + WardKeeperAlive = 1; + break; + } + } + +}; + +InstanceData* GetInstanceData_instance_razorfen_kraul(Map* pMap) +{ + return new instance_razorfen_kraul(pMap); +} + +void AddSC_instance_razorfen_kraul() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_razorfen_kraul"; + newscript->GetInstanceData = &GetInstanceData_instance_razorfen_kraul; + newscript->RegisterSelf(); +} \ No newline at end of file diff --git a/src/bindings/scripts/scripts/kalimdor/razorfen_kraul/razorfen_kraul.cpp b/src/bindings/scripts/scripts/kalimdor/razorfen_kraul/razorfen_kraul.cpp new file mode 100644 index 00000000000..a6bd845b13e --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/razorfen_kraul/razorfen_kraul.cpp @@ -0,0 +1,252 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Razorfen Kraul +SD%Complete: 100 +SDComment: Quest support: 1144 +SDCategory: Razorfen Kraul +EndScriptData */ + +/* ContentData +npc_willix +EndContentData */ + +#include "precompiled.h" +#include "escortAI.h" +#include "def_razorfen_kraul.h" + +#define SAY_READY -1047000 +#define SAY_POINT -10470001 +#define SAY_AGGRO1 -1047002 +#define SAY_BLUELEAF -1047003 +#define SAY_DANGER -1047004 +#define SAY_BAD -1047005 +#define SAY_THINK -1047006 +#define SAY_SOON -1047007 +#define SAY_FINALY -1047008 +#define SAY_WIN -1047009 +#define SAY_END -1047010 + +#define QUEST_WILLIX_THE_IMPORTER 1144 +#define ENTRY_BOAR 4514 +#define SPELL_QUILLBOAR_CHANNELING 7083 + +struct TRINITY_DLL_DECL npc_willixAI : public npc_escortAI +{ + npc_willixAI(Creature *c) : npc_escortAI(c) {} + + void WaypointReached(uint32 i) + { + Player* pPlayer = Unit::GetPlayer(PlayerGUID); + + if (!pPlayer) + return; + + switch (i) + { + case 3: + m_creature->HandleEmoteCommand(EMOTE_STATE_POINT); + DoScriptText(SAY_POINT, m_creature, pPlayer); + break; + case 4: + m_creature->SummonCreature(ENTRY_BOAR, 2137.66, 1843.98, 48.08, 1.54, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + break; + case 8: + DoScriptText(SAY_BLUELEAF, m_creature, pPlayer); + break; + case 9: + DoScriptText(SAY_DANGER, m_creature, pPlayer); + break; + case 13: + DoScriptText(SAY_BAD, m_creature, pPlayer); + break; + case 14: + m_creature->SummonCreature(ENTRY_BOAR, 2078.91, 1704.54, 56.77, 1.54, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + break; + case 25: + DoScriptText(SAY_THINK, m_creature, pPlayer); + break; + case 31: + DoScriptText(SAY_SOON, m_creature, pPlayer); + break; + case 42: + DoScriptText(SAY_FINALY, m_creature, pPlayer); + break; + case 43: + m_creature->SummonCreature(ENTRY_BOAR, 1956.43, 1596.97, 81.75, 1.54,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + break; + case 45: + DoScriptText(SAY_WIN, m_creature, pPlayer); + if (pPlayer && pPlayer->GetTypeId() == TYPEID_PLAYER) + CAST_PLR(pPlayer)->GroupEventHappens(QUEST_WILLIX_THE_IMPORTER,m_creature); + break; + case 46: + DoScriptText(SAY_END, m_creature, pPlayer); + break; + } + } + + void Reset() {} + + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO1, m_creature, NULL); + } + + void JustSummoned(Creature* summoned) + { + summoned->AI()->AttackStart(m_creature); + } + + void JustDied(Unit* killer) + { + if (PlayerGUID) + { + if (Player* pPlayer = Unit::GetPlayer(PlayerGUID)) + CAST_PLR(pPlayer)->FailQuest(QUEST_WILLIX_THE_IMPORTER); + } + } + + void UpdateAI(const uint32 diff) + { + npc_escortAI::UpdateAI(diff); + } +}; + +bool QuestAccept_npc_willix(Player* pPlayer, Creature* pCreature, Quest const* quest) +{ + if (quest->GetQuestId() == QUEST_WILLIX_THE_IMPORTER) + { + CAST_AI(npc_escortAI, (pCreature->AI()))->Start(true, false, pPlayer->GetGUID()); + DoScriptText(SAY_READY, pCreature, pPlayer); + pCreature->setFaction(113); + } + + return true; +} + +struct TRINITY_DLL_DECL npc_deaths_head_ward_keeperAI : public ScriptedAI +{ + npc_deaths_head_ward_keeperAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + Reset(); + } + + ScriptedInstance *pInstance; + uint32 QuillboarChanneling_Timer; + + void Reset() + { + QuillboarChanneling_Timer = 1500; + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->isAlive()) + return; + + if (pInstance) + pInstance->SetData(TYPE_WARD_KEEPERS, NOT_STARTED); + + if (QuillboarChanneling_Timer < diff) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(true); + DoCast(m_creature, SPELL_QUILLBOAR_CHANNELING); + QuillboarChanneling_Timer = 1100; + }else QuillboarChanneling_Timer -= diff; + + } +}; + +CreatureAI* GetAI_npc_deaths_head_ward_keeper(Creature* pCreature) +{ + return new npc_deaths_head_ward_keeperAI(pCreature); +} + +CreatureAI* GetAI_npc_willix(Creature* pCreature) +{ + npc_willixAI* thisAI = new npc_willixAI(pCreature); + + thisAI->AddWaypoint(0, 2194.38, 1791.65, 65.48, 5000); + thisAI->AddWaypoint(1, 2188.56, 1805.87, 64.45); + thisAI->AddWaypoint(2, 2187, 1843.49, 59.33); + thisAI->AddWaypoint(3, 2163.27, 1851.67, 56.73, 5000); + thisAI->AddWaypoint(4, 2137.66, 1843.98, 48.08, 5000); + thisAI->AddWaypoint(5, 2140.22, 1845.02, 48.32); + thisAI->AddWaypoint(6, 2131.5, 1804.29, 46.85); + thisAI->AddWaypoint(7, 2096.18, 1789.03, 51.13); + thisAI->AddWaypoint(8, 2074.46, 1780.09, 55.64, 3000); + thisAI->AddWaypoint(9, 2055.12, 1768.67, 58.46, 5000); + thisAI->AddWaypoint(10, 2037.83, 1748.62, 60.27); + thisAI->AddWaypoint(11, 2037.51, 1728.94, 60.85); + thisAI->AddWaypoint(12, 2044.7, 1711.71, 59.71); + thisAI->AddWaypoint(13, 2067.66, 1701.84, 57.77, 3000); + thisAI->AddWaypoint(14, 2078.91, 1704.54, 56.77, 3000); + thisAI->AddWaypoint(15, 2097.65, 1715.24, 54.74); + thisAI->AddWaypoint(16, 2106.44, 1720.98, 54.41); + thisAI->AddWaypoint(17, 2123.96, 1732.56, 52.27); + thisAI->AddWaypoint(18, 2153.82, 1728.73, 51.92); + thisAI->AddWaypoint(19, 2163.49, 1706.33, 54.42); + thisAI->AddWaypoint(20, 2158.75, 1695.98, 55.70); + thisAI->AddWaypoint(21, 2142.6, 1680.72, 58.24); + thisAI->AddWaypoint(22, 2118.31, 1671.54, 59.21); + thisAI->AddWaypoint(23, 2086.02, 1672.04, 61.24); + thisAI->AddWaypoint(24, 2068.81, 1658.93, 61.24); + thisAI->AddWaypoint(25, 2062.82, 1633.31, 64.35, 3000); + thisAI->AddWaypoint(26, 2063.05, 1589.16, 63.26); + thisAI->AddWaypoint(27, 2063.67, 1577.22, 65.89); + thisAI->AddWaypoint(28, 2057.94, 1560.68, 68.40); + thisAI->AddWaypoint(29, 2052.56, 1548.05, 73.35); + thisAI->AddWaypoint(30, 2045.22, 1543.4, 76.65); + thisAI->AddWaypoint(31, 2034.35, 1543.01, 79.70); + thisAI->AddWaypoint(32, 2029.95, 1542.94, 80.79); + thisAI->AddWaypoint(33, 2021.34, 1538.67, 80.8); + thisAI->AddWaypoint(34, 2012.45, 1549.48, 79.93); + thisAI->AddWaypoint(35, 2008.05, 1554.92, 80.44); + thisAI->AddWaypoint(36, 2006.54, 1562.72, 81.11); + thisAI->AddWaypoint(37, 2003.8, 1576.43, 81.57); + thisAI->AddWaypoint(38, 2000.57, 1590.06, 80.62); + thisAI->AddWaypoint(39, 1998.96, 1596.87, 80.22); + thisAI->AddWaypoint(40, 1991.19, 1600.82, 79.39); + thisAI->AddWaypoint(41, 1980.71, 1601.44, 79.77, 3000); + thisAI->AddWaypoint(42, 1967.22, 1600.18, 80.62, 3000); + thisAI->AddWaypoint(43, 1956.43, 1596.97, 81.75, 3000); + thisAI->AddWaypoint(44, 1954.87, 1592.02, 82.18); + thisAI->AddWaypoint(45, 1948.35, 1571.35, 80.96, 30000); + thisAI->AddWaypoint(46, 1947.02, 1566.42, 81.80, 30000); + + return thisAI; +} + +void AddSC_razorfen_kraul() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "npc_willix"; + newscript->GetAI = &GetAI_npc_willix; + newscript->pQuestAccept = &QuestAccept_npc_willix; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_deaths_head_ward_keeper"; + newscript->GetAI = &GetAI_npc_deaths_head_ward_keeper; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/ruins_of_ahnqiraj/boss_ayamiss.cpp b/src/bindings/scripts/scripts/kalimdor/ruins_of_ahnqiraj/boss_ayamiss.cpp new file mode 100644 index 00000000000..eefedb2c0d5 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/ruins_of_ahnqiraj/boss_ayamiss.cpp @@ -0,0 +1,108 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Ayamiss +SD%Complete: 50 +SDComment: VERIFY SCRIPT +SDCategory: Ruins of Ahn'Qiraj +EndScriptData */ + +#include "precompiled.h" + +/* +To do: +make him fly from 70-100% +*/ + +#define SPELL_STINGERSPRAY 25749 +#define SPELL_POISONSTINGER 25748 //only used in phase1 +#define SPELL_SUMMONSWARMER 25844 //might be 25708 +// #define SPELL_PARALYZE 23414 doesnt work correct (core) + +struct TRINITY_DLL_DECL boss_ayamissAI : public ScriptedAI +{ + boss_ayamissAI(Creature *c) : ScriptedAI(c) {} + + Unit *pTarget; + uint32 STINGERSPRAY_Timer; + uint32 POISONSTINGER_Timer; + uint32 SUMMONSWARMER_Timer; + uint32 phase; + + void Reset() + { + pTarget = NULL; + STINGERSPRAY_Timer = 30000; + POISONSTINGER_Timer = 30000; + SUMMONSWARMER_Timer = 60000; + phase=1; + } + + void EnterCombat(Unit *who) + { + pTarget = who; + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + //If he is 70% start phase 2 + if (phase==1 && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 70 && !m_creature->IsNonMeleeSpellCasted(false)) + { + phase=2; + } + + //STINGERSPRAY_Timer (only in phase2) + if (phase==2 && STINGERSPRAY_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_STINGERSPRAY); + STINGERSPRAY_Timer = 30000; + }else STINGERSPRAY_Timer -= diff; + + //POISONSTINGER_Timer (only in phase1) + if (phase==1 && POISONSTINGER_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_POISONSTINGER); + POISONSTINGER_Timer = 30000; + }else POISONSTINGER_Timer -= diff; + + //SUMMONSWARMER_Timer (only in phase1) + if (SUMMONSWARMER_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_SUMMONSWARMER); + SUMMONSWARMER_Timer = 60000; + }else SUMMONSWARMER_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_ayamiss(Creature* pCreature) +{ + return new boss_ayamissAI (pCreature); +} + +void AddSC_boss_ayamiss() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_ayamiss"; + newscript->GetAI = &GetAI_boss_ayamiss; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/ruins_of_ahnqiraj/boss_buru.cpp b/src/bindings/scripts/scripts/kalimdor/ruins_of_ahnqiraj/boss_buru.cpp new file mode 100644 index 00000000000..58c48540362 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/ruins_of_ahnqiraj/boss_buru.cpp @@ -0,0 +1,27 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Buru +SD%Complete: 0 +SDComment: Place Holder +SDCategory: Ruins of Ahn'Qiraj +EndScriptData */ + +#include "precompiled.h" + + #define EMOTE_TARGET -1509002 + diff --git a/src/bindings/scripts/scripts/kalimdor/ruins_of_ahnqiraj/boss_kurinnaxx.cpp b/src/bindings/scripts/scripts/kalimdor/ruins_of_ahnqiraj/boss_kurinnaxx.cpp new file mode 100644 index 00000000000..e781c749d0d --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/ruins_of_ahnqiraj/boss_kurinnaxx.cpp @@ -0,0 +1,94 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Kurinnaxx +SD%Complete: 100 +SDComment: VERIFY SCRIPT AND SQL +SDCategory: Ruins of Ahn'Qiraj +EndScriptData */ + +#include "precompiled.h" + +#define SPELL_MORTALWOUND 25646 +#define SPELL_SANDTRAP 25656 +#define SPELL_ENRAGE 28798 + +struct TRINITY_DLL_DECL boss_kurinnaxxAI : public ScriptedAI +{ + boss_kurinnaxxAI(Creature *c) : ScriptedAI(c) {} + + Unit *pTarget; + uint32 MORTALWOUND_Timer; + uint32 SANDTRAP_Timer; + uint32 i; + + void Reset() + { + i=0; + pTarget = NULL; + MORTALWOUND_Timer = 30000; + SANDTRAP_Timer = 30000; + } + + void EnterCombat(Unit *who) + { + pTarget = who; + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + //If we are <30% cast enrage + if (i==0 && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 30 && !m_creature->IsNonMeleeSpellCasted(false)) + { + i=1; + DoCast(m_creature->getVictim(),SPELL_ENRAGE); + } + + //MORTALWOUND_Timer + if (MORTALWOUND_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_MORTALWOUND); + MORTALWOUND_Timer = 30000; + }else MORTALWOUND_Timer -= diff; + + //SANDTRAP_Timer + if (SANDTRAP_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_SANDTRAP); + SANDTRAP_Timer = 30000; + }else SANDTRAP_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_kurinnaxx(Creature* pCreature) +{ + return new boss_kurinnaxxAI (pCreature); +} + +void AddSC_boss_kurinnaxx() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_kurinnaxx"; + newscript->GetAI = &GetAI_boss_kurinnaxx; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/ruins_of_ahnqiraj/boss_moam.cpp b/src/bindings/scripts/scripts/kalimdor/ruins_of_ahnqiraj/boss_moam.cpp new file mode 100644 index 00000000000..4d62a923e16 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/ruins_of_ahnqiraj/boss_moam.cpp @@ -0,0 +1,120 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Moam +SD%Complete: 100 +SDComment: VERIFY SCRIPT AND SQL +SDCategory: Ruins of Ahn'Qiraj +EndScriptData */ + +#include "precompiled.h" + +#define EMOTE_AGGRO -1509000 +#define EMOTE_MANA_FULL -1509001 + +#define SPELL_TRAMPLE 15550 +#define SPELL_DRAINMANA 27256 +#define SPELL_ARCANEERUPTION 25672 +#define SPELL_SUMMONMANA 25681 +#define SPELL_GRDRSLEEP 24360 //Greater Dreamless Sleep + +struct TRINITY_DLL_DECL boss_moamAI : public ScriptedAI +{ + boss_moamAI(Creature *c) : ScriptedAI(c) {} + + Unit *pTarget; + uint32 TRAMPLE_Timer; + uint32 DRAINMANA_Timer; + uint32 SUMMONMANA_Timer; + uint32 i; + uint32 j; + + void Reset() + { + i=0; + j=0; + pTarget = NULL; + TRAMPLE_Timer = 30000; + DRAINMANA_Timer = 30000; + } + + void EnterCombat(Unit *who) + { + DoScriptText(EMOTE_AGGRO, m_creature); + pTarget = who; + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + //If we are 100%MANA cast Arcane Erruption + //if (j==1 && m_creature->GetMana()*100 / m_creature->GetMaxMana() == 100 && !m_creature->IsNonMeleeSpellCasted(false)) + { + DoCast(m_creature->getVictim(),SPELL_ARCANEERUPTION); + DoScriptText(EMOTE_MANA_FULL, m_creature); + } + + //If we are <50%HP cast MANA FIEND (Summon Mana) and Sleep + //if (i==0 && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 50 && !m_creature->IsNonMeleeSpellCasted(false)) + { + i=1; + DoCast(m_creature->getVictim(),SPELL_SUMMONMANA); + DoCast(m_creature->getVictim(),SPELL_GRDRSLEEP); + } + + //SUMMONMANA_Timer + if (i==1 && SUMMONMANA_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_SUMMONMANA); + SUMMONMANA_Timer = 90000; + }else SUMMONMANA_Timer -= diff; + + //TRAMPLE_Timer + if (TRAMPLE_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_TRAMPLE); + j=1; + + TRAMPLE_Timer = 30000; + }else TRAMPLE_Timer -= diff; + + //DRAINMANA_Timer + if (DRAINMANA_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_DRAINMANA); + DRAINMANA_Timer = 30000; + }else DRAINMANA_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_moam(Creature* pCreature) +{ + return new boss_moamAI (pCreature); +} + +void AddSC_boss_moam() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_moam"; + newscript->GetAI = &GetAI_boss_moam; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/ruins_of_ahnqiraj/boss_ossirian.cpp b/src/bindings/scripts/scripts/kalimdor/ruins_of_ahnqiraj/boss_ossirian.cpp new file mode 100644 index 00000000000..5652b706917 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/ruins_of_ahnqiraj/boss_ossirian.cpp @@ -0,0 +1,38 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Ossirian +SD%Complete: 0 +SDComment: Place holder +SDCategory: Ruins of Ahn'Qiraj +EndScriptData */ + +#include "precompiled.h" + +#define SAY_SURPREME2 -1509019 +#define SAY_SURPREME3 -1509020 + +#define SAY_RAND_INTRO1 -1509021 +#define SAY_RAND_INTRO2 -1509022 +#define SAY_RAND_INTRO3 -1509023 +#define SAY_RAND_INTRO4 -1509024 //possibly old? + +#define SAY_AGGRO -1509025 + +#define SAY_SLAY -1509026 +#define SAY_DEATH -1509027 + diff --git a/src/bindings/scripts/scripts/kalimdor/ruins_of_ahnqiraj/boss_rajaxx.cpp b/src/bindings/scripts/scripts/kalimdor/ruins_of_ahnqiraj/boss_rajaxx.cpp new file mode 100644 index 00000000000..fb2c92ff59f --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/ruins_of_ahnqiraj/boss_rajaxx.cpp @@ -0,0 +1,45 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Rajaxx +SD%Complete: 0 +SDComment: Place Holder +SDCategory: Ruins of Ahn'Qiraj +EndScriptData */ + +#include "precompiled.h" + +#define SAY_ANDOROV_INTRO -1509003 +#define SAY_ANDOROV_ATTACK -1509004 + +#define SAY_WAVE3 -1509005 +#define SAY_WAVE4 -1509006 +#define SAY_WAVE5 -1509007 +#define SAY_WAVE6 -1509008 +#define SAY_WAVE7 -1509009 +#define SAY_INTRO -1509010 + +#define SAY_UNK1 -1509011 +#define SAY_UNK2 -1509012 +#define SAY_UNK3 -1509013 +#define SAY_UNK4 -1509014 + +#define SAY_DEAGGRO -1509015 +#define SAY_KILLS_ANDOROV -1509016 + +#define SAY_COMPLETE_QUEST -1509017 //Yell when realm complete quest 8743 for world event + diff --git a/src/bindings/scripts/scripts/kalimdor/ruins_of_ahnqiraj/instance_ruins_of_ahnqiraj.cpp b/src/bindings/scripts/scripts/kalimdor/ruins_of_ahnqiraj/instance_ruins_of_ahnqiraj.cpp new file mode 100644 index 00000000000..b94e6f16a80 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/ruins_of_ahnqiraj/instance_ruins_of_ahnqiraj.cpp @@ -0,0 +1,25 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Ruins_of_Ahnqiraj +SD%Complete: 0 +SDComment: Place holder +SDCategory: Ruins of Ahn'Qiraj +EndScriptData */ + +#include "precompiled.h" + diff --git a/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_bug_trio.cpp b/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_bug_trio.cpp new file mode 100644 index 00000000000..042dd5d53f5 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_bug_trio.cpp @@ -0,0 +1,346 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: boss_kri, boss_yauj, boss_vem : The Bug Trio +SD%Complete: 100 +SDComment: +SDCategory: Temple of Ahn'Qiraj +EndScriptData */ + +#include "precompiled.h" +#include "def_temple_of_ahnqiraj.h" + +#define SPELL_CLEAVE 26350 +#define SPELL_TOXIC_VOLLEY 25812 +#define SPELL_POISON_CLOUD 38718 //Only Spell with right dmg. +#define SPELL_ENRAGE 34624 //Changed cause 25790 is casted on gamers too. Same prob with old explosion of twin emperors. + +#define SPELL_CHARGE 26561 +#define SPELL_KNOCKBACK 26027 + +#define SPELL_HEAL 25807 +#define SPELL_FEAR 19408 + +struct TRINITY_DLL_DECL boss_kriAI : public ScriptedAI +{ + boss_kriAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance *pInstance; + + uint32 Cleave_Timer; + uint32 ToxicVolley_Timer; + uint32 Check_Timer; + + bool VemDead; + bool Death; + + void Reset() + { + Cleave_Timer = 4000 + rand()%4000; + ToxicVolley_Timer = 6000 + rand()%6000; + Check_Timer = 2000; + + VemDead = false; + Death = false; + } + + void EnterCombat(Unit *who) + { + } + + void JustDied(Unit* killer) + { + if (pInstance) + { + if (pInstance->GetData(DATA_BUG_TRIO_DEATH) < 2) + // Unlootable if death + m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); + + pInstance->SetData(DATA_BUG_TRIO_DEATH, 1); + } + } + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + //Cleave_Timer + if (Cleave_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_CLEAVE); + Cleave_Timer = 5000 + rand()%7000; + }else Cleave_Timer -= diff; + + //ToxicVolley_Timer + if (ToxicVolley_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_TOXIC_VOLLEY); + ToxicVolley_Timer = 10000 + rand()%5000; + }else ToxicVolley_Timer -= diff; + + if (m_creature->GetHealth() <= m_creature->GetMaxHealth() * 0.05 && !Death) + { + DoCast(m_creature->getVictim(),SPELL_POISON_CLOUD); + Death = true; + } + + if (!VemDead) + { + //Checking if Vem is dead. If yes we will enrage. + if (Check_Timer < diff) + { + if (pInstance && pInstance->GetData(DATA_VEMISDEAD)) + { + DoCast(m_creature, SPELL_ENRAGE); + VemDead = true; + } + Check_Timer = 2000; + }else Check_Timer -=diff; + } + + DoMeleeAttackIfReady(); + } +}; + +struct TRINITY_DLL_DECL boss_vemAI : public ScriptedAI +{ + boss_vemAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance *pInstance; + + uint32 Charge_Timer; + uint32 KnockBack_Timer; + uint32 Enrage_Timer; + + bool Enraged; + + void Reset() + { + Charge_Timer = 15000 + rand()%12000; + KnockBack_Timer = 8000 + rand()%12000; + Enrage_Timer = 120000; + + Enraged = false; + } + + void JustDied(Unit* Killer) + { + if (pInstance) + { + pInstance->SetData(DATA_VEM_DEATH, 0); + if (pInstance->GetData(DATA_BUG_TRIO_DEATH) < 2) + // Unlootable if death + m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); + pInstance->SetData(DATA_BUG_TRIO_DEATH, 1); + } + } + + void EnterCombat(Unit *who) + { + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + //Charge_Timer + if (Charge_Timer < diff) + { + Unit* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM,0); + if (target) + { + DoCast(target, SPELL_CHARGE); + //m_creature->SendMonsterMove(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, true,1); + AttackStart(target); + } + + Charge_Timer = 8000 + rand()%8000; + }else Charge_Timer -= diff; + + //KnockBack_Timer + if (KnockBack_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_KNOCKBACK); + if (DoGetThreat(m_creature->getVictim())) + DoModifyThreatPercent(m_creature->getVictim(),-80); + KnockBack_Timer = 15000 + rand()%10000; + }else KnockBack_Timer -= diff; + + //Enrage_Timer + if (!Enraged && Enrage_Timer < diff) + { + DoCast(m_creature,SPELL_ENRAGE); + Enraged = true; + }else Charge_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +struct TRINITY_DLL_DECL boss_yaujAI : public ScriptedAI +{ + boss_yaujAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance *pInstance; + + uint32 Heal_Timer; + uint32 Fear_Timer; + uint32 Check_Timer; + + bool VemDead; + + void Reset() + { + Heal_Timer = 25000 + rand()%15000; + Fear_Timer = 12000 + rand()%12000; + Check_Timer = 2000; + + VemDead = false; + } + + void JustDied(Unit* Killer) + { + if (pInstance) + { + if (pInstance->GetData(DATA_BUG_TRIO_DEATH) < 2) + // Unlootable if death + m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); + pInstance->SetData(DATA_BUG_TRIO_DEATH, 1); + } + + for(uint8 i = 0; i < 10; ++i) + { + Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0); + Creature* Summoned = m_creature->SummonCreature(15621,m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(),0,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,90000); + if (Summoned && target) + (Summoned->AI())->AttackStart(target); + } + } + + void EnterCombat(Unit *who) + { + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + //Fear_Timer + if (Fear_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_FEAR); + DoResetThreat(); + Fear_Timer = 20000; + }else Fear_Timer -= diff; + + //Casting Heal to other twins or herself. + if (Heal_Timer < diff) + { + if (pInstance) + { + Unit *pKri = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_KRI)); + Unit *pVem = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_VEM)); + + switch(rand()%3) + { + case 0: + if (pKri) + DoCast(pKri, SPELL_HEAL); + break; + case 1: + if (pVem) + DoCast(pVem, SPELL_HEAL); + break; + case 2: + DoCast(m_creature, SPELL_HEAL); + break; + } + } + + Heal_Timer = 15000+rand()%15000; + }else Heal_Timer -= diff; + + //Checking if Vem is dead. If yes we will enrage. + if (Check_Timer < diff) + { + if (!VemDead) + { + if (pInstance) + { + if (pInstance->GetData(DATA_VEMISDEAD)) + { + DoCast(m_creature, SPELL_ENRAGE); + VemDead = true; + } + } + } + Check_Timer = 2000; + }else Check_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_yauj(Creature* pCreature) +{ + return new boss_yaujAI (pCreature); +} + +CreatureAI* GetAI_boss_vem(Creature* pCreature) +{ + return new boss_vemAI (pCreature); +} + +CreatureAI* GetAI_boss_kri(Creature* pCreature) +{ + return new boss_kriAI (pCreature); +} + +void AddSC_bug_trio() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_kri"; + newscript->GetAI = &GetAI_boss_kri; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="boss_vem"; + newscript->GetAI = &GetAI_boss_vem; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="boss_yauj"; + newscript->GetAI = &GetAI_boss_yauj; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_cthun.cpp b/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_cthun.cpp new file mode 100644 index 00000000000..905f46070f7 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_cthun.cpp @@ -0,0 +1,1335 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Cthun +SD%Complete: 95 +SDComment: Darkglare tracking issue +SDCategory: Temple of Ahn'Qiraj +EndScriptData */ + +#include "precompiled.h" +#include "def_temple_of_ahnqiraj.h" + +//Text emote +#define EMOTE_WEAKENED -1531011 + +#define PI 3.14 + +//****** Out of Combat ****** +//Random Wispers - No txt only sound +#define RANDOM_SOUND_WHISPER 8663 + +//***** Phase 1 ******** + +//Mobs +#define BOSS_EYE_OF_CTHUN 15589 +#define MOB_CLAW_TENTACLE 15725 +#define MOB_EYE_TENTACLE 15726 +#define MOB_SMALL_PORTAL 15904 + +//Eye Spells +#define SPELL_GREEN_BEAM 26134 +#define SPELL_DARK_GLARE 26029 +#define SPELL_RED_COLORATION 22518 //Probably not the right spell but looks similar + +//Eye Tentacles Spells +#define SPELL_MIND_FLAY 26143 + +//Claw Tentacles Spells +#define SPELL_GROUND_RUPTURE 26139 +#define SPELL_HAMSTRING 26141 + +#define MOB_ + +//*****Phase 2****** +//Body spells +//#define SPELL_CARAPACE_CTHUN 26156 //Was removed from client dbcs +#define SPELL_TRANSFORM 26232 + +//Eye Tentacles Spells +//SAME AS PHASE1 + +//Giant Claw Tentacles +#define SPELL_MASSIVE_GROUND_RUPTURE 26100 + +//Also casts Hamstring +#define SPELL_THRASH 3391 + +//Giant Eye Tentacles +//CHAIN CASTS "SPELL_GREEN_BEAM" + +//Stomach Spells +#define SPELL_MOUTH_TENTACLE 26332 +#define SPELL_EXIT_STOMACH_KNOCKBACK 25383 +#define SPELL_DIGESTIVE_ACID 26476 + +//Mobs +#define MOB_BODY_OF_CTHUN 15809 +#define MOB_GIANT_CLAW_TENTACLE 15728 +#define MOB_GIANT_EYE_TENTACLE 15334 +#define MOB_FLESH_TENTACLE 15802 +#define MOB_GIANT_PORTAL 15910 + +//Stomach Teleport positions +#define STOMACH_X -8562.0f +#define STOMACH_Y 2037.0f +#define STOMACH_Z -70.0f +#define STOMACH_O 5.05f + +//Flesh tentacle positions +#define TENTACLE_POS1_X -8571.0f +#define TENTACLE_POS1_Y 1990.0f +#define TENTACLE_POS1_Z -98.0f +#define TENTACLE_POS1_O 1.22f + +#define TENTACLE_POS2_X -8525.0f +#define TENTACLE_POS2_Y 1994.0f +#define TENTACLE_POS2_Z -98.0f +#define TENTACLE_POS2_O 2.12f + +//Kick out position +#define KICK_X -8545.0f +#define KICK_Y 1984.0f +#define KICK_Z -96.0f + +struct TRINITY_DLL_DECL flesh_tentacleAI : public ScriptedAI +{ + flesh_tentacleAI(Creature *c) : ScriptedAI(c), Parent(0) + { + SetCombatMovement(false); + } + + uint64 Parent; + uint32 CheckTimer; + + void SpawnedByCthun(uint64 p) + { + Parent = p; + } + + void Reset() + { + CheckTimer = 1000; + } + + void EnterCombat(Unit *who) + { + } + + void UpdateAI(const uint32 diff); + + void JustDied(Unit* killer); +}; + +struct TRINITY_DLL_DECL eye_of_cthunAI : public Scripted_NoMovementAI +{ + eye_of_cthunAI(Creature *c) : Scripted_NoMovementAI(c) + { + pInst = c->GetInstanceData(); + if (!pInst) + error_log("TSCR: No Instance eye_of_cthunAI"); + } + + ScriptedInstance* pInst; + + //Global variables + uint32 PhaseTimer; + + //Eye beam phase + uint32 BeamTimer; + uint32 EyeTentacleTimer; + uint32 ClawTentacleTimer; + + //Dark Glare phase + uint32 DarkGlareTick; + uint32 DarkGlareTickTimer; + float DarkGlareAngle; + bool ClockWise; + + void Reset() + { + //Phase information + PhaseTimer = 50000; //First dark glare in 50 seconds + + //Eye beam phase 50 seconds + BeamTimer = 3000; + EyeTentacleTimer = 45000; //Always spawns 5 seconds before Dark Beam + ClawTentacleTimer = 12500; //4 per Eye beam phase (unsure if they spawn durring Dark beam) + + //Dark Beam phase 35 seconds (each tick = 1 second, 35 ticks) + DarkGlareTick = 0; + DarkGlareTickTimer = 1000; + DarkGlareAngle = 0; + ClockWise = false; + + //Reset flags + m_creature->RemoveAurasDueToSpell(SPELL_RED_COLORATION); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE); + + //Reset Phase + if (pInst) + pInst->SetData(DATA_CTHUN_PHASE, 0); + } + + void EnterCombat(Unit *who) + { + DoZoneInCombat(); + } + + void SpawnEyeTentacle(float x, float y) + { + Creature* Spawned; + Spawned = me->SummonCreature(MOB_EYE_TENTACLE,m_creature->GetPositionX()+x,m_creature->GetPositionY()+y,m_creature->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,500); + if (Spawned) + { + Unit* target; + target = SelectUnit(SELECT_TARGET_RANDOM,0); + + if (target) + Spawned->AI()->AttackStart(target); + } + } + + void UpdateAI(const uint32 diff) + { + //Check if we have a target + if (!UpdateVictim()) + return; + + //No instance + if (!pInst) + return; + + switch (pInst->GetData(DATA_CTHUN_PHASE)) + { + case 0: + { + //BeamTimer + if (BeamTimer < diff) + { + //SPELL_GREEN_BEAM + Unit* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM,0); + if (target) + { + m_creature->InterruptNonMeleeSpells(false); + DoCast(target,SPELL_GREEN_BEAM); + + //Correctly update our target + m_creature->SetUInt64Value(UNIT_FIELD_TARGET, target->GetGUID()); + } + + //Beam every 3 seconds + BeamTimer = 3000; + }else BeamTimer -= diff; + + //ClawTentacleTimer + if (ClawTentacleTimer < diff) + { + Unit* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM,0); + if (target) + { + Creature* Spawned = NULL; + + //Spawn claw tentacle on the random target + Spawned = me->SummonCreature(MOB_CLAW_TENTACLE,target->GetPositionX(),target->GetPositionY(),target->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,500); + + if (Spawned) + Spawned->AI()->AttackStart(target); + } + + //One claw tentacle every 12.5 seconds + ClawTentacleTimer = 12500; + }else ClawTentacleTimer -= diff; + + //EyeTentacleTimer + if (EyeTentacleTimer < diff) + { + //Spawn the 8 Eye Tentacles in the corret spots + SpawnEyeTentacle(0, 20); //south + SpawnEyeTentacle(10, 10); //south west + SpawnEyeTentacle(20, 0); //west + SpawnEyeTentacle(10, -10); //north west + + SpawnEyeTentacle(0, -20); //north + SpawnEyeTentacle(-10, -10); //north east + SpawnEyeTentacle(-20, 0); // east + SpawnEyeTentacle(-10, 10); // south east + + //No point actually putting a timer here since + //These shouldn't trigger agian until after phase shifts + EyeTentacleTimer = 45000; + }else EyeTentacleTimer -= diff; + + //PhaseTimer + if (PhaseTimer < diff) + { + //Switch to Dark Beam + pInst->SetData(DATA_CTHUN_PHASE, 1); + + m_creature->InterruptNonMeleeSpells(false); + + //Select random target for dark beam to start on + Unit* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM,0); + + if (target) + { + //Correctly update our target + m_creature->SetUInt64Value(UNIT_FIELD_TARGET, target->GetGUID()); + + //Face our target + DarkGlareAngle = m_creature->GetAngle(target); + DarkGlareTickTimer = 1000; + DarkGlareTick = 0; + ClockWise = rand()%2; + } + + //Add red coloration to C'thun + DoCast(m_creature,SPELL_RED_COLORATION); + + //Freeze animation + + //Darkbeam for 35 seconds + PhaseTimer = 35000; + }else PhaseTimer -= diff; + + } + break; + case 1: + { + //EyeTentacleTimer + if (DarkGlareTick < 35) + if (DarkGlareTickTimer < diff) + { + //Remove any target + m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0); + + //Set angle and cast + if (ClockWise) + m_creature->SetOrientation(DarkGlareAngle + ((float)DarkGlareTick*PI/35)); + else m_creature->SetOrientation(DarkGlareAngle - ((float)DarkGlareTick*PI/35)); + + m_creature->StopMoving(); + + //Actual dark glare cast, maybe something missing here? + m_creature->CastSpell(m_creature, SPELL_DARK_GLARE, false); + + //Increase tick + DarkGlareTick++; + + //1 second per tick + DarkGlareTickTimer = 1000; + }else DarkGlareTickTimer -= diff; + + //PhaseTimer + if (PhaseTimer < diff) + { + //Switch to Eye Beam + pInst->SetData(DATA_CTHUN_PHASE, 0); + + BeamTimer = 3000; + EyeTentacleTimer = 45000; //Always spawns 5 seconds before Dark Beam + ClawTentacleTimer = 12500; //4 per Eye beam phase (unsure if they spawn durring Dark beam) + + m_creature->InterruptNonMeleeSpells(false); + + //Remove Red coloration from c'thun + m_creature->RemoveAurasDueToSpell(SPELL_RED_COLORATION); + + //Freeze animation + m_creature->SetUInt32Value(UNIT_FIELD_FLAGS, 0); + + //Eye Beam for 50 seconds + PhaseTimer = 50000; + }else PhaseTimer -= diff; + }break; + + //Transition phase + case 2: + { + //Remove any target + m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0); + m_creature->SetHealth(0); + } + + //Dead phase + case 5: + { + m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false); + } + } + } + + void DamageTaken(Unit *done_by, uint32 &damage) + { + //No instance + if (!pInst) + return; + + switch (pInst->GetData(DATA_CTHUN_PHASE)) + { + case 0: + case 1: + { + //Only if it will kill + if (damage < m_creature->GetHealth()) + return; + + //Fake death in phase 0 or 1 (green beam or dark glare phase) + m_creature->InterruptNonMeleeSpells(false); + + //Remove Red coloration from c'thun + m_creature->RemoveAurasDueToSpell(SPELL_RED_COLORATION); + + //Reset to normal emote state and prevent select and attack + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE); + + //Remove Target field + m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0); + + //Death animation/respawning; + pInst->SetData(DATA_CTHUN_PHASE, 2); + + m_creature->SetHealth(0); + damage = 0; + + m_creature->InterruptNonMeleeSpells(true); + m_creature->RemoveAllAuras(); + } + break; + + case 5: + { + //Allow death here + return; + } + + default: + { + //Prevent death in this phase + damage = 0; + return; + } + break; + } + } +}; + +struct TRINITY_DLL_DECL cthunAI : public ScriptedAI +{ + cthunAI(Creature *c) : ScriptedAI(c) + { + SetCombatMovement(false); + + pInst = c->GetInstanceData(); + if (!pInst) + error_log("TSCR: No Instance eye_of_cthunAI"); + } + + ScriptedInstance* pInst; + + //Out of combat whisper timer + uint32 WisperTimer; + + //Global variables + uint32 PhaseTimer; + + //------------------- + + //Phase transition + uint64 HoldPlayer; + + //Body Phase + uint32 EyeTentacleTimer; + uint8 FleshTentaclesKilled; + uint32 GiantClawTentacleTimer; + uint32 GiantEyeTentacleTimer; + uint32 StomachAcidTimer; + uint32 StomachEnterTimer; + uint32 StomachEnterVisTimer; + uint64 StomachEnterTarget; + + //Stomach map, bool = true then in stomach + UNORDERED_MAP Stomach_Map; + + void Reset() + { + //One random wisper every 90 - 300 seconds + WisperTimer = 90000; + + //Phase information + PhaseTimer = 10000; //Emerge in 10 seconds + + //No hold player for transition + HoldPlayer = 0; + + //Body Phase + EyeTentacleTimer = 30000; + FleshTentaclesKilled = 0; + GiantClawTentacleTimer = 15000; //15 seconds into body phase (1 min repeat) + GiantEyeTentacleTimer = 45000; //15 seconds into body phase (1 min repeat) + StomachAcidTimer = 4000; //Every 4 seconds + StomachEnterTimer = 10000; //Every 10 seconds + StomachEnterVisTimer = 0; //Always 3.5 seconds after Stomach Enter Timer + StomachEnterTarget = 0; //Target to be teleported to stomach + + //Clear players in stomach and outside + Stomach_Map.clear(); + + //Reset flags + m_creature->RemoveAurasDueToSpell(SPELL_TRANSFORM); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE); + + if (pInst) + pInst->SetData(DATA_CTHUN_PHASE, 0); + } + + void EnterCombat(Unit *who) + { + DoZoneInCombat(); + } + + void SpawnEyeTentacle(float x, float y) + { + Creature* Spawned; + Spawned = me->SummonCreature(MOB_EYE_TENTACLE,m_creature->GetPositionX()+x,m_creature->GetPositionY()+y,m_creature->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,500); + if (Spawned) + { + Unit* target; + + target = SelectRandomNotStomach(); + + if (target) + Spawned->AI()->AttackStart(target); + } + } + + Unit* SelectRandomNotStomach() + { + if (Stomach_Map.empty()) + return NULL; + + UNORDERED_MAP::iterator i = Stomach_Map.begin(); + + std::list temp; + std::list::iterator j; + + //Get all players in map + while (i != Stomach_Map.end()) + { + //Check for valid player + Unit* pUnit = Unit::GetUnit(*m_creature, i->first); + + //Only units out of stomach + if (pUnit && i->second == false) + { + temp.push_back(pUnit); + } + ++i; + } + + if (temp.empty()) + return NULL; + + j = temp.begin(); + + //Get random but only if we have more than one unit on threat list + if (temp.size() > 1) + advance (i , rand() % (temp.size() - 1)); + + return (*j); + } + + void UpdateAI(const uint32 diff) + { + //Check if we have a target + if (!UpdateVictim()) + { + //No target so we'll use this section to do our random wispers instance wide + //WisperTimer + if (WisperTimer < diff) + { + Map* pMap = m_creature->GetMap(); + if (!pMap->IsDungeon()) return; + + //Play random sound to the zone + Map::PlayerList const &PlayerList = pMap->GetPlayers(); + + if (!PlayerList.isEmpty()) + { + for(Map::PlayerList::const_iterator itr = PlayerList.begin(); itr != PlayerList.end(); ++itr) + { + if (Player* pPlr = itr->getSource()) + pPlr->PlayDirectSound(RANDOM_SOUND_WHISPER,pPlr); + } + } + + //One random wisper every 90 - 300 seconds + WisperTimer = 90000 + (rand()% 210000); + }else WisperTimer -= diff; + + return; + } + + m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0); + + //No instance + if (!pInst) + return; + + switch (pInst->GetData(DATA_CTHUN_PHASE)) + { + //Transition phase + case 2: + { + //PhaseTimer + if (PhaseTimer < diff) + { + //Switch + pInst->SetData(DATA_CTHUN_PHASE, 3); + + //Switch to c'thun model + m_creature->InterruptNonMeleeSpells(false); + DoCast(m_creature, SPELL_TRANSFORM, false); + m_creature->SetHealth(m_creature->GetMaxHealth()); + + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE); + + //Emerging phase + //AttackStart(Unit::GetUnit(*m_creature, HoldpPlayer)); + DoZoneInCombat(); + + //Place all units in threat list on outside of stomach + Stomach_Map.clear(); + + std::list::iterator i = m_creature->getThreatManager().getThreatList().begin(); + for (; i != m_creature->getThreatManager().getThreatList().end(); ++i) + { + //Outside stomach + Stomach_Map[(*i)->getUnitGuid()] = false; + } + + //Spawn 2 flesh tentacles + FleshTentaclesKilled = 0; + + Creature* Spawned; + + //Spawn flesh tentacle + Spawned = me->SummonCreature(MOB_FLESH_TENTACLE, TENTACLE_POS1_X, TENTACLE_POS1_Y, TENTACLE_POS1_Z, TENTACLE_POS1_O, TEMPSUMMON_CORPSE_DESPAWN, 0); + + if (!Spawned) + FleshTentaclesKilled++; + else + CAST_AI(flesh_tentacleAI, (Spawned->AI()))->SpawnedByCthun(m_creature->GetGUID()); + + //Spawn flesh tentacle + Spawned = me->SummonCreature(MOB_FLESH_TENTACLE, TENTACLE_POS2_X, TENTACLE_POS2_Y, TENTACLE_POS2_Z, TENTACLE_POS2_O, TEMPSUMMON_CORPSE_DESPAWN, 0); + + if (!Spawned) + FleshTentaclesKilled++; + else + CAST_AI(flesh_tentacleAI, (Spawned->AI()))->SpawnedByCthun(m_creature->GetGUID()); + + PhaseTimer = 0; + }else PhaseTimer -= diff; + + }break; + + //Body Phase + case 3: + { + //Remove Target field + m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0); + + //Weaken + if (FleshTentaclesKilled > 1) + { + pInst->SetData(DATA_CTHUN_PHASE, 4); + + DoScriptText(EMOTE_WEAKENED, m_creature); + PhaseTimer = 45000; + + DoCast(m_creature, SPELL_RED_COLORATION, true); + + UNORDERED_MAP::iterator i = Stomach_Map.begin(); + + //Kick all players out of stomach + while (i != Stomach_Map.end()) + { + //Check for valid player + Unit* pUnit = Unit::GetUnit(*m_creature, i->first); + + //Only move units in stomach + if (pUnit && i->second == true) + { + //Teleport each player out + DoTeleportPlayer(pUnit, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ()+10, rand()%6); + + //Cast knockback on them + DoCast(pUnit, SPELL_EXIT_STOMACH_KNOCKBACK, true); + + //Remove the acid debuff + pUnit->RemoveAurasDueToSpell(SPELL_DIGESTIVE_ACID); + + i->second = false; + } + ++i; + } + + return; + } + + //Stomach acid + if (StomachAcidTimer < diff) + { + //Apply aura to all players in stomach + UNORDERED_MAP::iterator i = Stomach_Map.begin(); + + while (i != Stomach_Map.end()) + { + //Check for valid player + Unit* pUnit = Unit::GetUnit(*m_creature, i->first); + + //Only apply to units in stomach + if (pUnit && i->second == true) + { + //Cast digestive acid on them + DoCast(pUnit, SPELL_DIGESTIVE_ACID, true); + + //Check if player should be kicked from stomach + if (pUnit->IsWithinDist3d(KICK_X, KICK_Y, KICK_Z, 15.0f)) + { + //Teleport each player out + DoTeleportPlayer(pUnit, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ()+10, rand()%6); + + //Cast knockback on them + DoCast(pUnit, SPELL_EXIT_STOMACH_KNOCKBACK, true); + + //Remove the acid debuff + pUnit->RemoveAurasDueToSpell(SPELL_DIGESTIVE_ACID); + + i->second = false; + } + } + ++i; + } + + StomachAcidTimer = 4000; + }else StomachAcidTimer -= diff; + + //Stomach Enter Timer + if (StomachEnterTimer < diff) + { + Unit* target = NULL; + target = SelectRandomNotStomach(); + + if (target) + { + //Set target in stomach + Stomach_Map[target->GetGUID()] = true; + target->InterruptNonMeleeSpells(false); + target->CastSpell(target, SPELL_MOUTH_TENTACLE, true, NULL, NULL, m_creature->GetGUID()); + StomachEnterTarget = target->GetGUID(); + StomachEnterVisTimer = 3800; + } + + StomachEnterTimer = 13800; + }else StomachEnterTimer -= diff; + + if (StomachEnterVisTimer && StomachEnterTarget) + if (StomachEnterVisTimer <= diff) + { + //Check for valid player + Unit* pUnit = Unit::GetUnit(*m_creature, StomachEnterTarget); + + if (pUnit) + { + DoTeleportPlayer(pUnit, STOMACH_X, STOMACH_Y, STOMACH_Z, STOMACH_O); + } + + StomachEnterTarget = 0; + StomachEnterVisTimer = 0; + }else StomachEnterVisTimer -= diff; + + //GientClawTentacleTimer + if (GiantClawTentacleTimer < diff) + { + Unit* target = NULL; + target = SelectRandomNotStomach(); + if (target) + { + Creature* Spawned = NULL; + + //Spawn claw tentacle on the random target + Spawned = me->SummonCreature(MOB_GIANT_CLAW_TENTACLE,target->GetPositionX(),target->GetPositionY(),target->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,500); + + if (Spawned) + Spawned->AI()->AttackStart(target); + } + + //One giant claw tentacle every minute + GiantClawTentacleTimer = 60000; + }else GiantClawTentacleTimer -= diff; + + //GiantEyeTentacleTimer + if (GiantEyeTentacleTimer < diff) + { + Unit* target = NULL; + target = SelectRandomNotStomach(); + if (target) + { + + Creature* Spawned = NULL; + + //Spawn claw tentacle on the random target + Spawned = me->SummonCreature(MOB_GIANT_EYE_TENTACLE,target->GetPositionX(),target->GetPositionY(),target->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,500); + + if (Spawned) + Spawned->AI()->AttackStart(target); + } + + //One giant eye tentacle every minute + GiantEyeTentacleTimer = 60000; + }else GiantEyeTentacleTimer -= diff; + + //EyeTentacleTimer + if (EyeTentacleTimer < diff) + { + //Spawn the 8 Eye Tentacles in the corret spots + SpawnEyeTentacle(0, 25); //south + SpawnEyeTentacle(12, 12); //south west + SpawnEyeTentacle(25, 0); //west + SpawnEyeTentacle(12, -12); //north west + + SpawnEyeTentacle(0, -25); //north + SpawnEyeTentacle(-12, -12); //north east + SpawnEyeTentacle(-25, 0); // east + SpawnEyeTentacle(-12, 12); // south east + + //These spawn at every 30 seconds + EyeTentacleTimer = 30000; + }else EyeTentacleTimer -= diff; + + }break; + + //Weakened state + case 4: + { + //PhaseTimer + if (PhaseTimer < diff) + { + //Switch + pInst->SetData(DATA_CTHUN_PHASE, 3); + + //Remove red coloration + m_creature->RemoveAurasDueToSpell(SPELL_RED_COLORATION); + + //Spawn 2 flesh tentacles + FleshTentaclesKilled = 0; + + Creature* Spawned; + + //Spawn flesh tentacle + Spawned = me->SummonCreature(MOB_FLESH_TENTACLE, TENTACLE_POS1_X, TENTACLE_POS1_Y, TENTACLE_POS1_Z, TENTACLE_POS1_O, TEMPSUMMON_CORPSE_DESPAWN, 0); + + if (!Spawned) + FleshTentaclesKilled++; + else + CAST_AI(flesh_tentacleAI, (Spawned->AI()))->SpawnedByCthun(m_creature->GetGUID()); + + //Spawn flesh tentacle + Spawned = me->SummonCreature(MOB_FLESH_TENTACLE, TENTACLE_POS2_X, TENTACLE_POS2_Y, TENTACLE_POS2_Z, TENTACLE_POS2_O, TEMPSUMMON_CORPSE_DESPAWN, 0); + + if (!Spawned) + FleshTentaclesKilled++; + else + CAST_AI(flesh_tentacleAI, (Spawned->AI()))->SpawnedByCthun(m_creature->GetGUID()); + + PhaseTimer = 0; + }else PhaseTimer -= diff; + } + } + } + + void JustDied(Unit* pKiller) + { + //Switch + if (pInst) + pInst->SetData(DATA_CTHUN_PHASE, 5); + } + + void DamageTaken(Unit *done_by, uint32 &damage) + { + //No instance + if (!pInst) + return; + + switch (pInst->GetData(DATA_CTHUN_PHASE)) + { + case 3: + { + //Not weakened so reduce damage by 99% + if (damage / 99 > 0) damage/= 99; + else damage = 1; + + //Prevent death in non-weakened state + if (damage >= m_creature->GetHealth()) + damage = 0; + + return; + } + break; + + case 4: + { + //Weakened - takes normal damage + return; + } + + default: + damage = 0; + break; + } + } + + void FleshTentcleKilled() + { + FleshTentaclesKilled++; + } +}; + +struct TRINITY_DLL_DECL eye_tentacleAI : public ScriptedAI +{ + eye_tentacleAI(Creature *c) : ScriptedAI(c) + { + SetCombatMovement(false); + + if (Unit* pPortal = m_creature->SummonCreature(MOB_SMALL_PORTAL, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 0)) + Portal = pPortal->GetGUID(); + } + + uint32 MindflayTimer; + uint32 KillSelfTimer; + uint64 Portal; + + void JustDied(Unit* who) + { + if (Unit* p = Unit::GetUnit(*m_creature, Portal)) + p->DealDamage(p, p->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false); + } + + void Reset() + { + //Mind flay half a second after we spawn + MindflayTimer = 500; + + //This prevents eyes from overlapping + KillSelfTimer = 35000; + } + + void EnterCombat(Unit *who) + { + DoZoneInCombat(); + } + + void UpdateAI(const uint32 diff) + { + //Check if we have a target + if (!UpdateVictim()) + return; + + //KillSelfTimer + if (KillSelfTimer < diff) + { + m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false); + + return; + }else KillSelfTimer -= diff; + + //MindflayTimer + if (MindflayTimer < diff) + { + Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0); + if (target && !target->HasAura(SPELL_DIGESTIVE_ACID)) + DoCast(target,SPELL_MIND_FLAY); + + //Mindflay every 10 seconds + MindflayTimer = 10100; + }else MindflayTimer -= diff; + } +}; + +struct TRINITY_DLL_DECL claw_tentacleAI : public ScriptedAI +{ + claw_tentacleAI(Creature *c) : ScriptedAI(c) + { + SetCombatMovement(false); + + if (Unit* pPortal = m_creature->SummonCreature(MOB_SMALL_PORTAL, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 0)) + Portal = pPortal->GetGUID(); + } + + uint32 GroundRuptureTimer; + uint32 HamstringTimer; + uint32 EvadeTimer; + uint64 Portal; + + void JustDied(Unit* who) + { + if (Unit* p = Unit::GetUnit(*m_creature, Portal)) + p->DealDamage(p, p->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false); + } + + void Reset() + { + //First rupture should happen half a second after we spawn + GroundRuptureTimer = 500; + HamstringTimer = 2000; + EvadeTimer = 5000; + } + + void EnterCombat(Unit *who) + { + DoZoneInCombat(); + } + + void UpdateAI(const uint32 diff) + { + //Check if we have a target + if (!UpdateVictim()) + return; + + //EvadeTimer + if (!m_creature->IsWithinMeleeRange(m_creature->getVictim())) + if (EvadeTimer < diff) + { + if (Unit* p = Unit::GetUnit(*m_creature, Portal)) + p->DealDamage(p, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false); + + //Dissapear and reappear at new position + m_creature->SetVisibility(VISIBILITY_OFF); + + Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0); + if (!target) + { + m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false); + return; + } + + if (!target->HasAura(SPELL_DIGESTIVE_ACID)) + { + m_creature->GetMap()->CreatureRelocation(m_creature, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0); + if (Unit* pPortal = m_creature->SummonCreature(MOB_SMALL_PORTAL, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 0)) + Portal = pPortal->GetGUID(); + + GroundRuptureTimer = 500; + HamstringTimer = 2000; + EvadeTimer = 5000; + AttackStart(target); + } + + m_creature->SetVisibility(VISIBILITY_ON); + + }else EvadeTimer -= diff; + + //GroundRuptureTimer + if (GroundRuptureTimer < diff) + { + DoCast(m_creature->getVictim(),SPELL_GROUND_RUPTURE); + GroundRuptureTimer = 30000; + }else GroundRuptureTimer -= diff; + + //HamstringTimer + if (HamstringTimer < diff) + { + DoCast(m_creature->getVictim(),SPELL_HAMSTRING); + HamstringTimer = 5000; + }else HamstringTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +struct TRINITY_DLL_DECL giant_claw_tentacleAI : public ScriptedAI +{ + giant_claw_tentacleAI(Creature *c) : ScriptedAI(c) + { + SetCombatMovement(false); + + if (Unit* pPortal = m_creature->SummonCreature(MOB_GIANT_PORTAL, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 0)) + Portal = pPortal->GetGUID(); + } + + uint32 GroundRuptureTimer; + uint32 ThrashTimer; + uint32 HamstringTimer; + uint32 EvadeTimer; + uint64 Portal; + + void JustDied(Unit* who) + { + if (Unit* p = Unit::GetUnit(*m_creature, Portal)) + p->DealDamage(p, p->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false); + } + + void Reset() + { + //First rupture should happen half a second after we spawn + GroundRuptureTimer = 500; + HamstringTimer = 2000; + ThrashTimer = 5000; + EvadeTimer = 5000; + } + + void EnterCombat(Unit *who) + { + DoZoneInCombat(); + } + + void UpdateAI(const uint32 diff) + { + //Check if we have a target + if (!UpdateVictim()) + return; + + //EvadeTimer + if (!m_creature->IsWithinMeleeRange(m_creature->getVictim())) + if (EvadeTimer < diff) + { + if (Unit* p = Unit::GetUnit(*m_creature, Portal)) + p->DealDamage(p, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false); + + //Dissapear and reappear at new position + m_creature->SetVisibility(VISIBILITY_OFF); + + Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (!target) + { + m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false); + return; + } + + if (!target->HasAura(SPELL_DIGESTIVE_ACID)) + { + m_creature->GetMap()->CreatureRelocation(m_creature, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0); + if (Unit* pPortal = m_creature->SummonCreature(MOB_GIANT_PORTAL, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 0)) + Portal = pPortal->GetGUID(); + + GroundRuptureTimer = 500; + HamstringTimer = 2000; + ThrashTimer = 5000; + EvadeTimer = 5000; + AttackStart(target); + } + + m_creature->SetVisibility(VISIBILITY_ON); + + }else EvadeTimer -= diff; + + //GroundRuptureTimer + if (GroundRuptureTimer < diff) + { + DoCast(m_creature->getVictim(),SPELL_GROUND_RUPTURE); + GroundRuptureTimer = 30000; + }else GroundRuptureTimer -= diff; + + //ThrashTimer + if (ThrashTimer < diff) + { + DoCast(m_creature->getVictim(),SPELL_THRASH); + ThrashTimer = 10000; + }else ThrashTimer -= diff; + + //HamstringTimer + if (HamstringTimer < diff) + { + DoCast(m_creature->getVictim(),SPELL_HAMSTRING); + HamstringTimer = 10000; + }else HamstringTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +struct TRINITY_DLL_DECL giant_eye_tentacleAI : public ScriptedAI +{ + giant_eye_tentacleAI(Creature *c) : ScriptedAI(c) + { + SetCombatMovement(false); + + if (Unit* pPortal = m_creature->SummonCreature(MOB_GIANT_PORTAL, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 0)) + Portal = pPortal->GetGUID(); + } + + uint32 BeamTimer; + uint64 Portal; + + void JustDied(Unit* who) + { + if (Unit* p = Unit::GetUnit(*m_creature, Portal)) + p->DealDamage(p, p->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false); + } + + void Reset() + { + //Green Beam half a second after we spawn + BeamTimer = 500; + } + + void EnterCombat(Unit *who) + { + DoZoneInCombat(); + } + + void UpdateAI(const uint32 diff) + { + //Check if we have a target + if (!UpdateVictim()) + return; + + //BeamTimer + if (BeamTimer < diff) + { + Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0); + if (target && !target->HasAura(SPELL_DIGESTIVE_ACID)) + DoCast(target,SPELL_GREEN_BEAM); + + //Beam every 2 seconds + BeamTimer = 2100; + }else BeamTimer -= diff; + } +}; + +//Flesh tentacle functions +void flesh_tentacleAI::UpdateAI(const uint32 diff) +{ + //Check if we have a target + if (!UpdateVictim()) + return; + + if (Parent) + if (CheckTimer < diff) + { + Unit* pUnit = Unit::GetUnit(*m_creature, Parent); + + if (!pUnit || !pUnit->isAlive() || !pUnit->isInCombat()) + { + Parent = 0; + m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false); + return; + } + + CheckTimer = 1000; + }else CheckTimer -= diff; + + DoMeleeAttackIfReady(); +} + +void flesh_tentacleAI::JustDied(Unit* killer) +{ + if (!Parent) + { + error_log("TSCR: flesh_tentacle: No Parent variable"); + return; + } + + Creature* Cthun = Unit::GetCreature(*m_creature, Parent); + + if (Cthun) + CAST_AI(cthunAI, (Cthun->AI()))->FleshTentcleKilled(); + else error_log("TSCR: flesh_tentacle: No Cthun"); +} + +//GetAIs +CreatureAI* GetAI_eye_of_cthun(Creature* pCreature) +{ + return new eye_of_cthunAI (pCreature); +} + +CreatureAI* GetAI_cthun(Creature* pCreature) +{ + return new cthunAI (pCreature); +} + +CreatureAI* GetAI_eye_tentacle(Creature* pCreature) +{ + return new eye_tentacleAI (pCreature); +} + +CreatureAI* GetAI_claw_tentacle(Creature* pCreature) +{ + return new claw_tentacleAI (pCreature); +} + +CreatureAI* GetAI_giant_claw_tentacle(Creature* pCreature) +{ + return new giant_claw_tentacleAI (pCreature); +} + +CreatureAI* GetAI_giant_eye_tentacle(Creature* pCreature) +{ + return new giant_eye_tentacleAI (pCreature); +} + +CreatureAI* GetAI_flesh_tentacle(Creature* pCreature) +{ + return new flesh_tentacleAI (pCreature); +} + +void AddSC_boss_cthun() +{ + Script *newscript; + + //Eye + newscript = new Script; + newscript->Name="boss_eye_of_cthun"; + newscript->GetAI = &GetAI_eye_of_cthun; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="boss_cthun"; + newscript->GetAI = &GetAI_cthun; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_eye_tentacle"; + newscript->GetAI = &GetAI_eye_tentacle; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_claw_tentacle"; + newscript->GetAI = &GetAI_claw_tentacle; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_giant_claw_tentacle"; + newscript->GetAI = &GetAI_giant_claw_tentacle; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_giant_eye_tentacle"; + newscript->GetAI = &GetAI_giant_eye_tentacle; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_giant_flesh_tentacle"; + newscript->GetAI = &GetAI_flesh_tentacle; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_fankriss.cpp b/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_fankriss.cpp new file mode 100644 index 00000000000..6e5992556e3 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_fankriss.cpp @@ -0,0 +1,206 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Fankriss +SD%Complete: 100 +SDComment: sound not implemented +SDCategory: Temple of Ahn'Qiraj +EndScriptData */ + +#include "precompiled.h" + +#define SOUND_SENTENCE_YOU 8588 +#define SOUND_SERVE_TO 8589 +#define SOUND_LAWS 8590 +#define SOUND_TRESPASS 8591 +#define SOUND_WILL_BE 8592 + +#define SPELL_MORTAL_WOUND 28467 +#define SPELL_ROOT 28858 + +// Enrage for his spawns +#define SPELL_ENRAGE 28798 + +struct TRINITY_DLL_DECL boss_fankrissAI : public ScriptedAI +{ + boss_fankrissAI(Creature *c) : ScriptedAI(c) {} + + uint32 MortalWound_Timer; + uint32 SpawnHatchlings_Timer; + uint32 SpawnSpawns_Timer; + int Rand; + int RandX; + int RandY; + + Creature* Hatchling; + Creature* Spawn; + + void Reset() + { + MortalWound_Timer = 10000 + rand()%5000; + SpawnHatchlings_Timer = 6000 + rand()%6000; + SpawnSpawns_Timer = 15000 + rand()%30000; + } + + void SummonSpawn(Unit* victim) + { + if (!victim) + return; + + Rand = 10 + (rand()%10); + switch (rand()%2) + { + case 0: RandX = 0 - Rand; break; + case 1: RandX = 0 + Rand; break; + } + Rand = 0; + Rand = 10 + (rand()%10); + switch (rand()%2) + { + case 0: RandY = 0 - Rand; break; + case 1: RandY = 0 + Rand; break; + } + Rand = 0; + Spawn = DoSpawnCreature(15630, RandX, RandY, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + if (Spawn) + (Spawn->AI())->AttackStart(victim); + } + + void EnterCombat(Unit *who) + { + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + //MortalWound_Timer + if (MortalWound_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_MORTAL_WOUND); + MortalWound_Timer = 10000 + rand()%10000; + }else MortalWound_Timer -= diff; + + //Summon 1-3 Spawns of Fankriss at random time. + if (SpawnSpawns_Timer < diff) + { + switch(rand()%3) + { + case 0: + SummonSpawn(SelectUnit(SELECT_TARGET_RANDOM,0)); + break; + case 1: + SummonSpawn(SelectUnit(SELECT_TARGET_RANDOM,0)); + SummonSpawn(SelectUnit(SELECT_TARGET_RANDOM,0)); + break; + case 2: + SummonSpawn(SelectUnit(SELECT_TARGET_RANDOM,0)); + SummonSpawn(SelectUnit(SELECT_TARGET_RANDOM,0)); + SummonSpawn(SelectUnit(SELECT_TARGET_RANDOM,0)); + break; + } + SpawnSpawns_Timer = 30000 + rand()%30000; + }else SpawnSpawns_Timer -= diff; + + // Teleporting Random Target to one of the three tunnels and spawn 4 hatchlings near the gamer. + //We will only telport if fankriss has more than 3% of hp so teleported gamers can always loot. + if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() > 3) + { + if (SpawnHatchlings_Timer< diff) + { + Unit* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM,0); + if (target && target->GetTypeId() == TYPEID_PLAYER) + { + DoCast(target, SPELL_ROOT); + + if (DoGetThreat(target)) + DoModifyThreatPercent(target, -100); + + switch(rand()%3) + { + case 0: + DoTeleportPlayer(target, -8106.0142,1289.2900,-74.419533,5.112); + Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()-3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Hatchling) + (Hatchling->AI())->AttackStart(target); + Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()+3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Hatchling) + (Hatchling->AI())->AttackStart(target); + Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()-5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Hatchling) + (Hatchling->AI())->AttackStart(target); + Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()+5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Hatchling) + (Hatchling->AI())->AttackStart(target); + break; + case 1: + DoTeleportPlayer(target, -7990.135354,1155.1907,-78.849319,2.608); + Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()-3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Hatchling) + (Hatchling->AI())->AttackStart(target); + Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()+3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Hatchling) + (Hatchling->AI())->AttackStart(target); + Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()-5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Hatchling) + (Hatchling->AI())->AttackStart(target); + Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()+5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Hatchling) + (Hatchling->AI())->AttackStart(target); + break; + case 2: + DoTeleportPlayer(target,-8159.7753,1127.9064,-76.868660,0.675); + Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()-3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Hatchling) + (Hatchling->AI())->AttackStart(target); + Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()+3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Hatchling) + (Hatchling->AI())->AttackStart(target); + Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()-5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Hatchling) + (Hatchling->AI())->AttackStart(target); + Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()+5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Hatchling) + (Hatchling->AI())->AttackStart(target); + break; + } + } + SpawnHatchlings_Timer = 45000 + rand()%15000; + }else SpawnHatchlings_Timer -= diff; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_fankriss(Creature* pCreature) +{ + return new boss_fankrissAI (pCreature); +} + +void AddSC_boss_fankriss() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_fankriss"; + newscript->GetAI = &GetAI_boss_fankriss; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_huhuran.cpp b/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_huhuran.cpp new file mode 100644 index 00000000000..705e2275d33 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_huhuran.cpp @@ -0,0 +1,148 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Huhuran +SD%Complete: 100 +SDComment: +SDCategory: Temple of Ahn'Qiraj +EndScriptData */ + +#include "precompiled.h" + +#define EMOTE_GENERIC_FRENZY_KILL -1000001 +#define EMOTE_GENERIC_BERSERK -1000004 + +#define SPELL_FRENZY 26051 +#define SPELL_BERSERK 26068 +#define SPELL_POISONBOLT 26052 +#define SPELL_NOXIOUSPOISON 26053 +#define SPELL_WYVERNSTING 26180 +#define SPELL_ACIDSPIT 26050 + +struct TRINITY_DLL_DECL boss_huhuranAI : public ScriptedAI +{ + boss_huhuranAI(Creature *c) : ScriptedAI(c) {} + + uint32 Frenzy_Timer; + uint32 Wyvern_Timer; + uint32 Spit_Timer; + uint32 PoisonBolt_Timer; + uint32 NoxiousPoison_Timer; + uint32 FrenzyBack_Timer; + + bool Frenzy; + bool Berserk; + + void Reset() + { + Frenzy_Timer = 25000 + rand()%10000; + Wyvern_Timer = 18000 + rand()%10000; + Spit_Timer = 8000; + PoisonBolt_Timer = 4000; + NoxiousPoison_Timer = 10000 + rand()%10000; + FrenzyBack_Timer = 15000; + + Frenzy = false; + Berserk = false; + } + + void EnterCombat(Unit *who) + { + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + //Frenzy_Timer + if (!Frenzy && Frenzy_Timer < diff) + { + DoCast(m_creature, SPELL_FRENZY); + DoScriptText(EMOTE_GENERIC_FRENZY_KILL, m_creature); + Frenzy = true; + PoisonBolt_Timer = 3000; + Frenzy_Timer = 25000 + rand()%10000; + }else Frenzy_Timer -= diff; + + // Wyvern Timer + if (Wyvern_Timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_WYVERNSTING); + Wyvern_Timer = 15000 + rand()%17000; + }else Wyvern_Timer -= diff; + + //Spit Timer + if (Spit_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_ACIDSPIT); + Spit_Timer = 5000 + rand()%5000; + }else Spit_Timer -= diff; + + //NoxiousPoison_Timer + if (NoxiousPoison_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_NOXIOUSPOISON); + NoxiousPoison_Timer = 12000 + rand()%12000; + }else NoxiousPoison_Timer -= diff; + + //PoisonBolt only if frenzy or berserk + if (Frenzy || Berserk) + { + if (PoisonBolt_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_POISONBOLT); + PoisonBolt_Timer = 3000; + }else PoisonBolt_Timer -= diff; + } + + //FrenzyBack_Timer + if (Frenzy && FrenzyBack_Timer < diff) + { + m_creature->InterruptNonMeleeSpells(false); + Frenzy = false; + FrenzyBack_Timer = 15000; + }else FrenzyBack_Timer -= diff; + + if (!Berserk && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 31) + { + m_creature->InterruptNonMeleeSpells(false); + DoScriptText(EMOTE_GENERIC_BERSERK, m_creature); + DoCast(m_creature, SPELL_BERSERK); + Berserk = true; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_huhuran(Creature* pCreature) +{ + return new boss_huhuranAI (pCreature); +} + +void AddSC_boss_huhuran() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_huhuran"; + newscript->GetAI = &GetAI_boss_huhuran; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_ouro.cpp b/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_ouro.cpp new file mode 100644 index 00000000000..d7f6a186316 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_ouro.cpp @@ -0,0 +1,140 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Ouro +SD%Complete: 85 +SDComment: No model for submerging. Currently just invisible. +SDCategory: Temple of Ahn'Qiraj +EndScriptData */ + +#include "precompiled.h" +#include "def_temple_of_ahnqiraj.h" + +#define SPELL_SWEEP 26103 +#define SPELL_SANDBLAST 26102 +#define SPELL_GROUND_RUPTURE 26100 +#define SPELL_BIRTH 26262 //The Birth Animation + +#define SPELL_DIRTMOUND_PASSIVE 26092 + +struct TRINITY_DLL_DECL boss_ouroAI : public ScriptedAI +{ + boss_ouroAI(Creature *c) : ScriptedAI(c) {} + + uint32 Sweep_Timer; + uint32 SandBlast_Timer; + uint32 Submerge_Timer; + uint32 Back_Timer; + uint32 ChangeTarget_Timer; + uint32 Spawn_Timer; + + bool Enrage; + bool Submerged; + + void Reset() + { + Sweep_Timer = 5000 + rand()%5000; + SandBlast_Timer = 20000 + rand()%15000; + Submerge_Timer = 90000 + rand()%60000; + Back_Timer = 30000 + rand()%15000; + ChangeTarget_Timer = 5000 + rand()%3000; + Spawn_Timer = 10000 + rand()%10000; + + Enrage = false; + Submerged = false; + } + + void EnterCombat(Unit *who) + { + DoCast(m_creature->getVictim(), SPELL_BIRTH); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + //Sweep_Timer + if (!Submerged && Sweep_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_SWEEP); + Sweep_Timer = 15000 + rand()%15000; + }else Sweep_Timer -= diff; + + //SandBlast_Timer + if (!Submerged && SandBlast_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_SANDBLAST); + SandBlast_Timer = 20000 + rand()%15000; + }else SandBlast_Timer -= diff; + + //Submerge_Timer + if (!Submerged && Submerge_Timer < diff) + { + //Cast + m_creature->HandleEmoteCommand(EMOTE_ONESHOT_SUBMERGE); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->setFaction(35); + DoCast(m_creature, SPELL_DIRTMOUND_PASSIVE); + + Submerged = true; + Back_Timer = 30000 + rand()%15000; + }else Submerge_Timer -= diff; + + //ChangeTarget_Timer + if (Submerged && ChangeTarget_Timer < diff) + { + Unit* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM,0); + + if (target) + DoTeleportTo(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ()); + + ChangeTarget_Timer = 10000 + rand()%10000; + }else ChangeTarget_Timer -= diff; + + //Back_Timer + if (Submerged && Back_Timer < diff) + { + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->setFaction(14); + + DoCast(m_creature->getVictim(), SPELL_GROUND_RUPTURE); + + Submerged = false; + Submerge_Timer = 60000 + rand()%60000; + }else Back_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_ouro(Creature* pCreature) +{ + return new boss_ouroAI (pCreature); +} + +void AddSC_boss_ouro() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_ouro"; + newscript->GetAI = &GetAI_boss_ouro; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_sartura.cpp b/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_sartura.cpp new file mode 100644 index 00000000000..dd5aa9bae87 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_sartura.cpp @@ -0,0 +1,298 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Sartura +SD%Complete: 95 +SDComment: +SDCategory: Temple of Ahn'Qiraj +EndScriptData */ + +#include "precompiled.h" + +#define SAY_AGGRO -1531008 +#define SAY_SLAY -1531009 +#define SAY_DEATH -1531010 + +#define SPELL_WHIRLWIND 26083 +#define SPELL_ENRAGE 28747 //Not sure if right ID. +#define SPELL_ENRAGEHARD 28798 + +//Guard Spell +#define SPELL_WHIRLWINDADD 26038 +#define SPELL_KNOCKBACK 26027 + + +struct TRINITY_DLL_DECL boss_sarturaAI : public ScriptedAI +{ + boss_sarturaAI(Creature *c) : ScriptedAI(c) {} + + uint32 WhirlWind_Timer; + uint32 WhirlWindRandom_Timer; + uint32 WhirlWindEnd_Timer; + uint32 AggroReset_Timer; + uint32 AggroResetEnd_Timer; + uint32 EnrageHard_Timer; + + bool Enraged; + bool EnragedHard; + bool WhirlWind; + bool AggroReset; + + void Reset() + { + WhirlWind_Timer = 30000; + WhirlWindRandom_Timer = 3000 + rand()%4000; + WhirlWindEnd_Timer = 15000; + AggroReset_Timer = 45000 + rand()%10000; + AggroResetEnd_Timer = 5000; + EnrageHard_Timer = 10*60000; + + WhirlWind = false; + AggroReset = false; + Enraged = false; + EnragedHard = false; + + } + + void EnterCombat(Unit *who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + + void KilledUnit(Unit* victim) + { + DoScriptText(SAY_SLAY, m_creature); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + if (WhirlWind) + { + if (WhirlWindRandom_Timer < diff) + { + //Attack random Gamers + Unit* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM,1); + if (target) + m_creature->AddThreat(target, 1.0f); + m_creature->TauntApply(target); + AttackStart(target); + + WhirlWindRandom_Timer = 3000 + rand()%4000; + }else WhirlWindRandom_Timer -= diff; + + if (WhirlWindEnd_Timer < diff) + { + WhirlWind = false; + WhirlWind_Timer = 25000 + rand()%15000; + }else WhirlWindEnd_Timer -= diff; + } + + if (!WhirlWind) + { + if (WhirlWind_Timer < diff) + { + DoCast(m_creature, SPELL_WHIRLWIND); + WhirlWind = true; + WhirlWindEnd_Timer = 15000; + }else WhirlWind_Timer -= diff; + + if (AggroReset_Timer < diff) + { + //Attack random Gamers + Unit* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM,1); + if (target) + m_creature->AddThreat(target, 1.0f); + m_creature->TauntApply(target); + AttackStart(target); + + AggroReset = true; + AggroReset_Timer = 2000 + rand()%3000; + }else AggroReset_Timer -= diff; + + if (AggroReset) + { + if (AggroResetEnd_Timer GetHealth()*100 / m_creature->GetMaxHealth() <= 20 && !m_creature->IsNonMeleeSpellCasted(false)) + { + DoCast(m_creature, SPELL_ENRAGE); + Enraged = true; + } + } + + //After 10 minutes hard enrage + if (!EnragedHard) + { + if (EnrageHard_Timer < diff) + { + DoCast(m_creature, SPELL_ENRAGEHARD); + EnragedHard = true; + } else EnrageHard_Timer -= diff; + } + + DoMeleeAttackIfReady(); + } + } +}; + +struct TRINITY_DLL_DECL mob_sartura_royal_guardAI : public ScriptedAI +{ + mob_sartura_royal_guardAI(Creature *c) : ScriptedAI(c) {} + + uint32 WhirlWind_Timer; + uint32 WhirlWindRandom_Timer; + uint32 WhirlWindEnd_Timer; + uint32 AggroReset_Timer; + uint32 AggroResetEnd_Timer; + uint32 KnockBack_Timer; + + bool WhirlWind; + bool AggroReset; + + void Reset() + { + WhirlWind_Timer = 30000; + WhirlWindRandom_Timer = 3000 + rand()%4000; + WhirlWindEnd_Timer = 15000; + AggroReset_Timer = 45000 + rand()%10000; + AggroResetEnd_Timer = 5000; + KnockBack_Timer = 10000; + + WhirlWind = false; + AggroReset = false; + } + + void EnterCombat(Unit *who) + { + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + if (!WhirlWind && WhirlWind_Timer < diff) + { + DoCast(m_creature, SPELL_WHIRLWINDADD); + WhirlWind = true; + WhirlWind_Timer = 25000 + rand()%15000; + WhirlWindEnd_Timer = 15000; + }else WhirlWind_Timer -= diff; + + if (WhirlWind) + { + if (WhirlWindRandom_Timer < diff) + { + //Attack random Gamers + Unit* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM,1); + if (target) + m_creature->AddThreat(target, 1.0f); + m_creature->TauntApply(target); + AttackStart(target); + + WhirlWindRandom_Timer = 3000 + rand()%4000; + }else WhirlWindRandom_Timer -= diff; + + if (WhirlWindEnd_Timer < diff) + { + WhirlWind = false; + }else WhirlWindEnd_Timer -= diff; + } + + if (!WhirlWind) + { + if (AggroReset_Timer < diff) + { + //Attack random Gamers + Unit* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM,1); + if (target) + m_creature->AddThreat(target, 1.0f); + m_creature->TauntApply(target); + AttackStart(target); + + AggroReset = true; + AggroReset_Timer = 2000 + rand()%3000; + }else AggroReset_Timer -= diff; + + if (KnockBack_Timer < diff) + { + DoCast(m_creature, SPELL_WHIRLWINDADD); + KnockBack_Timer = 10000 + rand()%10000; + }else KnockBack_Timer -= diff; + } + + if (AggroReset) + { + if (AggroResetEnd_Timer Name="boss_sartura"; + newscript->GetAI = &GetAI_boss_sartura; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_sartura_royal_guard"; + newscript->GetAI = &GetAI_mob_sartura_royal_guard; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_skeram.cpp b/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_skeram.cpp new file mode 100644 index 00000000000..780a0c28f22 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_skeram.cpp @@ -0,0 +1,316 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Skeram +SD%Complete: 75 +SDComment: Mind Control buggy. +SDCategory: Temple of Ahn'Qiraj +EndScriptData */ + +#include "precompiled.h" +#include "def_temple_of_ahnqiraj.h" +#include "Group.h" + +#define SAY_AGGRO1 -1531000 +#define SAY_AGGRO2 -1531001 +#define SAY_AGGRO3 -1531002 +#define SAY_SLAY1 -1531003 +#define SAY_SLAY2 -1531004 +#define SAY_SLAY3 -1531005 +#define SAY_SPLIT -1531006 +#define SAY_DEATH -1531007 + +#define SPELL_ARCANE_EXPLOSION 25679 +#define SPELL_EARTH_SHOCK 26194 +#define SPELL_TRUE_FULFILLMENT4 26526 +#define SPELL_BLINK 28391 + +class ov_mycoordinates +{ + public: + float x,y,z,r; + ov_mycoordinates(float cx, float cy, float cz, float cr) + { + x = cx; y = cy; z = cz; r = cr; + } +}; + +struct TRINITY_DLL_DECL boss_skeramAI : public ScriptedAI +{ + boss_skeramAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + IsImage = false; + } + + ScriptedInstance *pInstance; + + uint32 ArcaneExplosion_Timer; + uint32 EarthShock_Timer; + uint32 FullFillment_Timer; + uint32 Blink_Timer; + uint32 Invisible_Timer; + + Creature *Image1, *Image2; + + bool Images75; + bool Images50; + bool Images25; + bool IsImage; + bool Invisible; + + void Reset() + { + ArcaneExplosion_Timer = 6000 + rand()%6000; + EarthShock_Timer = 2000; + FullFillment_Timer = 15000; + Blink_Timer = 8000 + rand()%12000; + Invisible_Timer = 500; + + Images75 = false; + Images50 = false; + Images25 = false; + Invisible = false; + + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetVisibility(VISIBILITY_ON); + + if (IsImage) + m_creature->setDeathState(JUST_DIED); + } + + void KilledUnit(Unit* victim) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + case 2: DoScriptText(SAY_SLAY3, m_creature); break; + } + } + + void JustDied(Unit* Killer) + { + if (!IsImage) + DoScriptText(SAY_DEATH, m_creature); + } + + void EnterCombat(Unit *who) + { + if (IsImage || Images75) + return; + switch(rand()%3) + { + case 0: DoScriptText(SAY_AGGRO1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO3, m_creature); break; + } + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + //ArcaneExplosion_Timer + if (ArcaneExplosion_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_ARCANE_EXPLOSION); + ArcaneExplosion_Timer = 8000 + rand()%10000; + }else ArcaneExplosion_Timer -= diff; + + //If we are within range melee the target + if (m_creature->IsWithinMeleeRange(m_creature->getVictim())) + { + //Make sure our attack is ready and we arn't currently casting + if (m_creature->isAttackReady() && !m_creature->IsNonMeleeSpellCasted(false)) + { + m_creature->AttackerStateUpdate(m_creature->getVictim()); + m_creature->resetAttackTimer(); + } + }else + { + //EarthShock_Timer + if (EarthShock_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_EARTH_SHOCK); + EarthShock_Timer = 1000; + }else EarthShock_Timer -= diff; + } + + //Blink_Timer + if (Blink_Timer < diff) + { + //DoCast(m_creature, SPELL_BLINK); + switch(rand()%3) + { + case 0: + m_creature->GetMap()->CreatureRelocation(m_creature, -8340.782227,2083.814453,125.648788,0.0f); + DoResetThreat(); + break; + case 1: + m_creature->GetMap()->CreatureRelocation(m_creature, -8341.546875,2118.504639,133.058151,0.0f); + DoResetThreat(); + break; + case 2: + m_creature->GetMap()->CreatureRelocation(m_creature, -8318.822266,2058.231201,133.058151,0.0f); + DoResetThreat(); + break; + } + DoStopAttack(); + + Blink_Timer= 20000 + rand()%20000; + }else Blink_Timer -= diff; + + int procent = (int) (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() +0.5); + + //Summoning 2 Images and teleporting to a random position on 75% health + if ((!Images75 && !IsImage) && (procent <= 75 && procent > 70)) + DoSplit(75); + + //Summoning 2 Images and teleporting to a random position on 50% health + if ((!Images50 && !IsImage) && + (procent <= 50 && procent > 45)) + DoSplit(50); + + //Summoning 2 Images and teleporting to a random position on 25% health + if ((!Images25 && !IsImage) && (procent <= 25 && procent > 20)) + DoSplit(25); + + //Invisible_Timer + if (Invisible) + { + if (Invisible_Timer < diff) + { + //Making Skeram visible after telporting + m_creature->SetVisibility(VISIBILITY_ON); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + + Invisible_Timer = 2500; + Invisible = false; + }else Invisible_Timer -= diff; + } + + DoMeleeAttackIfReady(); + } + + void DoSplit(int atPercent /* 75 50 25 */) + { + DoScriptText(SAY_SPLIT, m_creature); + + ov_mycoordinates *place1 = new ov_mycoordinates(-8340.782227,2083.814453,125.648788,0); + ov_mycoordinates *place2 = new ov_mycoordinates(-8341.546875,2118.504639,133.058151,0); + ov_mycoordinates *place3 = new ov_mycoordinates(-8318.822266,2058.231201,133.058151,0); + + ov_mycoordinates *bossc=place1, *i1=place2, *i2=place3; + + switch(rand()%3) + { + case 0: + bossc=place1; + i1=place2; + i2=place3; + break; + case 1: + bossc=place2; + i1=place1; + i2=place3; + break; + case 2: + bossc=place3; + i1=place1; + i2=place2; + break; + } + + for (int tryi = 0; tryi < 41; tryi ++) + { + Unit *targetpl = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (targetpl->GetTypeId() == TYPEID_PLAYER) + { + Group *grp = CAST_PLR(targetpl)->GetGroup(); + if (grp) + { + for (int ici = 0; ici < TARGETICONCOUNT; ++ici) + { + //if (grp ->m_targetIcons[ici] == m_creature->GetGUID()) -- private member:( + grp->SetTargetIcon(ici, 0); + } + } + break; + } + } + + m_creature->RemoveAllAuras(); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetVisibility(VISIBILITY_OFF); + m_creature->GetMap()->CreatureRelocation(m_creature, bossc->x, bossc->y, bossc->z, bossc->r); + Invisible = true; + delete place1; + delete place2; + delete place3; + DoResetThreat(); + DoStopAttack(); + + switch (atPercent) + { + case 75: Images75 = true; break; + case 50: Images50 = true; break; + case 25: Images25 = true; break; + } + + Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0); + + Image1 = m_creature->SummonCreature(15263, i1->x, i1->y, i1->z, i1->r, TEMPSUMMON_CORPSE_DESPAWN, 30000); + if (Image1) + { + Image1->SetMaxHealth(m_creature->GetMaxHealth() / 5); + Image1->SetHealth(m_creature->GetHealth() / 5); + if (target) + Image1->AI()->AttackStart(target); + CAST_AI(boss_skeramAI, Image1->AI())->IsImage = true; + } + + Image2 = m_creature->SummonCreature(15263,i2->x, i2->y, i2->z, i2->r, TEMPSUMMON_CORPSE_DESPAWN, 30000); + if (Image2) + { + Image2->SetMaxHealth(m_creature->GetMaxHealth() / 5); + Image2->SetHealth(m_creature->GetHealth() / 5); + if (target) + Image2->AI()->AttackStart(target); + CAST_AI(boss_skeramAI, Image2->AI())->IsImage = true; + } + Invisible = true; + } + +}; + +CreatureAI* GetAI_boss_skeram(Creature* pCreature) +{ + return new boss_skeramAI (pCreature); +} + +void AddSC_boss_skeram() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_skeram"; + newscript->GetAI = &GetAI_boss_skeram; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_twinemperors.cpp b/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_twinemperors.cpp new file mode 100644 index 00000000000..fdc1b6ae408 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_twinemperors.cpp @@ -0,0 +1,618 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Twinemperors +SD%Complete: 95 +SDComment: +SDCategory: Temple of Ahn'Qiraj +EndScriptData */ + +#include "precompiled.h" +#include "def_temple_of_ahnqiraj.h" +#include "WorldPacket.h" + +#include "Item.h" +#include "Spell.h" + +#define SPELL_HEAL_BROTHER 7393 +#define SPELL_TWIN_TELEPORT 800 // CTRA watches for this spell to start its teleport timer +#define SPELL_TWIN_TELEPORT_VISUAL 26638 // visual + +#define SPELL_EXPLODEBUG 804 +#define SPELL_MUTATE_BUG 802 + +#define SOUND_VN_DEATH 8660 //8660 - Death - Feel +#define SOUND_VN_AGGRO 8661 //8661 - Aggro - Let none +#define SOUND_VN_KILL 8662 //8661 - Kill - your fate + +#define SOUND_VL_AGGRO 8657 //8657 - Aggro - To Late +#define SOUND_VL_KILL 8658 //8658 - Kill - You will not +#define SOUND_VL_DEATH 8659 //8659 - Death + +#define PULL_RANGE 50 +#define ABUSE_BUG_RANGE 20 +#define SPELL_BERSERK 26662 +#define TELEPORTTIME 30000 + +#define SPELL_UPPERCUT 26007 +#define SPELL_UNBALANCING_STRIKE 26613 + +#define VEKLOR_DIST 20 // VL will not come to melee when attacking + +#define SPELL_SHADOWBOLT 26006 +#define SPELL_BLIZZARD 26607 +#define SPELL_ARCANEBURST 568 + +struct TRINITY_DLL_DECL boss_twinemperorsAI : public ScriptedAI +{ + ScriptedInstance *pInstance; + uint32 Heal_Timer; + uint32 Teleport_Timer; + bool AfterTeleport; + uint32 AfterTeleportTimer; + bool DontYellWhenDead; + uint32 Abuse_Bug_Timer, BugsTimer; + bool tspellcasted; + uint32 EnrageTimer; + + virtual bool IAmVeklor() = 0; + virtual void Reset() = 0; + virtual void CastSpellOnBug(Creature *target) = 0; + + boss_twinemperorsAI(Creature *c): ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + void TwinReset() + { + Heal_Timer = 0; // first heal immediately when they get close together + Teleport_Timer = TELEPORTTIME; + AfterTeleport = false; + tspellcasted = false; + AfterTeleportTimer = 0; + Abuse_Bug_Timer = 10000 + rand()%7000; + BugsTimer = 2000; + m_creature->clearUnitState(UNIT_STAT_STUNNED); + DontYellWhenDead = false; + EnrageTimer = 15*60000; + } + + Creature *GetOtherBoss() + { + if (pInstance) + { + return Unit::GetCreature(*m_creature, pInstance->GetData64(IAmVeklor() ? DATA_VEKNILASH : DATA_VEKLOR)); + } + else + { + return NULL; + } + } + + void DamageTaken(Unit *done_by, uint32 &damage) + { + Unit *pOtherBoss = GetOtherBoss(); + if (pOtherBoss) + { + float dPercent = ((float)damage) / ((float)m_creature->GetMaxHealth()); + int odmg = (int)(dPercent * ((float)pOtherBoss->GetMaxHealth())); + int ohealth = pOtherBoss->GetHealth()-odmg; + pOtherBoss->SetHealth(ohealth > 0 ? ohealth : 0); + if (ohealth <= 0) + { + pOtherBoss->setDeathState(JUST_DIED); + pOtherBoss->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); + } + } + } + + void JustDied(Unit* Killer) + { + Creature *pOtherBoss = GetOtherBoss(); + if (pOtherBoss) + { + pOtherBoss->SetHealth(0); + pOtherBoss->setDeathState(JUST_DIED); + pOtherBoss->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); + CAST_AI(boss_twinemperorsAI, pOtherBoss->AI())->DontYellWhenDead = true; + } + if (!DontYellWhenDead) // I hope AI is not threaded + DoPlaySoundToSet(m_creature, IAmVeklor() ? SOUND_VL_DEATH : SOUND_VN_DEATH); + } + + void KilledUnit(Unit* victim) + { + DoPlaySoundToSet(m_creature, IAmVeklor() ? SOUND_VL_KILL : SOUND_VN_KILL); + } + + void EnterCombat(Unit *who) + { + DoZoneInCombat(); + Creature *pOtherBoss = GetOtherBoss(); + if (pOtherBoss) + { + // TODO: we should activate the other boss location so he can start attackning even if nobody + // is near I dont know how to do that + ScriptedAI *otherAI = CAST_AI(ScriptedAI, pOtherBoss->AI()); + if (!pOtherBoss->isInCombat()) + { + DoPlaySoundToSet(m_creature, IAmVeklor() ? SOUND_VL_AGGRO : SOUND_VN_AGGRO); + otherAI->AttackStart(who); + otherAI->DoZoneInCombat(); + } + } + } + + void SpellHit(Unit *caster, const SpellEntry *entry) + { + if (caster == m_creature) + return; + + Creature *pOtherBoss = GetOtherBoss(); + if (entry->Id != SPELL_HEAL_BROTHER || !pOtherBoss) + return; + + // add health so we keep same percentage for both brothers + uint32 mytotal = m_creature->GetMaxHealth(), histotal = pOtherBoss->GetMaxHealth(); + float mult = ((float)mytotal) / ((float)histotal); + if (mult < 1) + mult = 1.0f/mult; + #define HEAL_BROTHER_AMOUNT 30000.0f + uint32 largerAmount = (uint32)((HEAL_BROTHER_AMOUNT * mult) - HEAL_BROTHER_AMOUNT); + + uint32 myh = m_creature->GetHealth(); + uint32 hish = pOtherBoss->GetHealth(); + if (mytotal > histotal) + { + uint32 h = m_creature->GetHealth()+largerAmount; + m_creature->SetHealth(std::min(mytotal, h)); + } + else + { + uint32 h = pOtherBoss->GetHealth()+largerAmount; + pOtherBoss->SetHealth(std::min(histotal, h)); + } + } + + void TryHealBrother(uint32 diff) + { + if (IAmVeklor()) // this spell heals caster and the other brother so let VN cast it + return; + + if (Heal_Timer < diff) + { + Unit *pOtherBoss = GetOtherBoss(); + if (pOtherBoss && pOtherBoss->IsWithinDist(m_creature,60)) + { + DoCast(pOtherBoss, SPELL_HEAL_BROTHER); + Heal_Timer = 1000; + } + } else Heal_Timer -= diff; + } + + void TeleportToMyBrother() + { + if (!pInstance) + return; + + Teleport_Timer = TELEPORTTIME; + + if (IAmVeklor()) + return; // mechanics handled by veknilash so they teleport exactly at the same time and to correct coordinates + + Creature *pOtherBoss = GetOtherBoss(); + if (pOtherBoss) + { + //m_creature->MonsterYell("Teleporting ...", LANG_UNIVERSAL, 0); + float other_x = pOtherBoss->GetPositionX(); + float other_y = pOtherBoss->GetPositionY(); + float other_z = pOtherBoss->GetPositionZ(); + float other_o = pOtherBoss->GetOrientation(); + + Map *thismap = m_creature->GetMap(); + thismap->CreatureRelocation(pOtherBoss, m_creature->GetPositionX(), + m_creature->GetPositionY(), m_creature->GetPositionZ(), m_creature->GetOrientation()); + thismap->CreatureRelocation(m_creature, other_x, other_y, other_z, other_o); + + SetAfterTeleport(); + CAST_AI(boss_twinemperorsAI, pOtherBoss->AI())->SetAfterTeleport(); + } + } + + void SetAfterTeleport() + { + m_creature->InterruptNonMeleeSpells(false); + DoStopAttack(); + DoResetThreat(); + DoCast(m_creature, SPELL_TWIN_TELEPORT_VISUAL); + m_creature->addUnitState(UNIT_STAT_STUNNED); + AfterTeleport = true; + AfterTeleportTimer = 2000; + tspellcasted = false; + } + + bool TryActivateAfterTTelep(uint32 diff) + { + if (AfterTeleport) + { + if (!tspellcasted) + { + m_creature->clearUnitState(UNIT_STAT_STUNNED); + DoCast(m_creature, SPELL_TWIN_TELEPORT); + m_creature->addUnitState(UNIT_STAT_STUNNED); + } + + tspellcasted = true; + + if (AfterTeleportTimer < diff) + { + AfterTeleport = false; + m_creature->clearUnitState(UNIT_STAT_STUNNED); + Unit *nearu = m_creature->SelectNearestTarget(100); + //DoYell(nearu->GetName(), LANG_UNIVERSAL, 0); + if (nearu) + { + AttackStart(nearu); + m_creature->getThreatManager().addThreat(nearu, 10000); + } + return true; + } + else + { + AfterTeleportTimer -= diff; + // update important timers which would otherwise get skipped + if (EnrageTimer > diff) + EnrageTimer -= diff; + else + EnrageTimer = 0; + if (Teleport_Timer > diff) + Teleport_Timer -= diff; + else + Teleport_Timer = 0; + return false; + } + } + else + { + return true; + } + } + + void MoveInLineOfSight(Unit *who) + { + if (!who || m_creature->getVictim()) + return; + + if (who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who)) + { + float attackRadius = m_creature->GetAttackDistance(who); + if (attackRadius < PULL_RANGE) + attackRadius = PULL_RANGE; + if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->GetDistanceZ(who) <= /*CREATURE_Z_ATTACK_RANGE*/7 /*there are stairs*/) + { + //if (who->HasStealthAura()) + // who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); + AttackStart(who); + } + } + } + + Creature *RespawnNearbyBugsAndGetOne() + { + std::list lUnitList; + m_creature->GetCreatureListWithEntryInGrid(lUnitList,15316,150.0f); + m_creature->GetCreatureListWithEntryInGrid(lUnitList,15317,150.0f); + + if (lUnitList.empty()) + return NULL; + + Creature *nearb = NULL; + + for(std::list::iterator iter = lUnitList.begin(); iter != lUnitList.end(); ++iter) + { + Creature *c = *iter; + if (c) + { + if (c->isDead()) + { + c->Respawn(); + c->setFaction(7); + c->RemoveAllAuras(); + } + if (c->IsWithinDistInMap(m_creature, ABUSE_BUG_RANGE)) + { + if (!nearb || (rand()%4) == 0) + nearb = c; + } + } + } + return nearb; + } + + void HandleBugs(uint32 diff) + { + if (BugsTimer < diff || Abuse_Bug_Timer < diff) + { + Creature *c = RespawnNearbyBugsAndGetOne(); + if (Abuse_Bug_Timer < diff) + { + if (c) + { + CastSpellOnBug(c); + Abuse_Bug_Timer = 10000 + rand()%7000; + } + else + { + Abuse_Bug_Timer = 1000; + } + } + else + { + Abuse_Bug_Timer -= diff; + } + BugsTimer = 2000; + } + else + { + BugsTimer -= diff; + Abuse_Bug_Timer -= diff; + } + } + + void CheckEnrage(uint32 diff) + { + if (EnrageTimer < diff) + { + if (!m_creature->IsNonMeleeSpellCasted(true)) + { + DoCast(m_creature, SPELL_BERSERK); + EnrageTimer = 60*60000; + } else EnrageTimer = 0; + } else EnrageTimer-=diff; + } +}; + +struct TRINITY_DLL_DECL boss_veknilashAI : public boss_twinemperorsAI +{ + bool IAmVeklor() {return false;} + boss_veknilashAI(Creature *c) : boss_twinemperorsAI(c) {} + + uint32 UpperCut_Timer; + uint32 UnbalancingStrike_Timer; + uint32 Scarabs_Timer; + int Rand; + int RandX; + int RandY; + + Creature* Summoned; + + void Reset() + { + TwinReset(); + UpperCut_Timer = 14000 + rand()%15000; + UnbalancingStrike_Timer = 8000 + rand()%10000; + Scarabs_Timer = 7000 + rand()%7000; + + //Added. Can be removed if its included in DB. + m_creature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_MAGIC, true); + } + + void CastSpellOnBug(Creature *target) + { + target->setFaction(14); + (target->AI())->AttackStart(m_creature->getThreatManager().getHostilTarget()); + SpellEntry *spell = GET_SPELL(SPELL_MUTATE_BUG); + uint8 eff_mask=0; + for (int i=0; i<3; ++i) + { + if (!spell->Effect[i]) + continue; + eff_mask|=1<AddAura(new Aura(spell, eff_mask, NULL, target, target)); + target->SetHealth(target->GetMaxHealth()); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + if (!TryActivateAfterTTelep(diff)) + return; + + //UnbalancingStrike_Timer + if (UnbalancingStrike_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_UNBALANCING_STRIKE); + UnbalancingStrike_Timer = 8000+rand()%12000; + }else UnbalancingStrike_Timer -= diff; + + if (UpperCut_Timer < diff) + { + Unit* randomMelee = SelectTarget(SELECT_TARGET_RANDOM, 0, NOMINAL_MELEE_RANGE, true); + if (randomMelee) + DoCast(randomMelee,SPELL_UPPERCUT); + UpperCut_Timer = 15000+rand()%15000; + }else UpperCut_Timer -= diff; + + HandleBugs(diff); + + //Heal brother when 60yrds close + TryHealBrother(diff); + + //Teleporting to brother + if (Teleport_Timer < diff) + { + TeleportToMyBrother(); + }else Teleport_Timer -= diff; + + CheckEnrage(diff); + + DoMeleeAttackIfReady(); + } +}; + +struct TRINITY_DLL_DECL boss_veklorAI : public boss_twinemperorsAI +{ + bool IAmVeklor() {return true;} + boss_veklorAI(Creature *c) : boss_twinemperorsAI(c) {} + + uint32 ShadowBolt_Timer; + uint32 Blizzard_Timer; + uint32 ArcaneBurst_Timer; + uint32 Scorpions_Timer; + int Rand; + int RandX; + int RandY; + + Creature* Summoned; + + void Reset() + { + TwinReset(); + ShadowBolt_Timer = 0; + Blizzard_Timer = 15000 + rand()%5000;; + ArcaneBurst_Timer = 1000; + Scorpions_Timer = 7000 + rand()%7000; + + //Added. Can be removed if its included in DB. + m_creature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, true); + m_creature->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, 0); + m_creature->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, 0); + } + + void CastSpellOnBug(Creature *target) + { + target->setFaction(14); + SpellEntry *spell = GET_SPELL(SPELL_EXPLODEBUG); + uint8 eff_mask=0; + for (int i=0; i<3; ++i) + { + if (!spell->Effect[i]) + continue; + eff_mask|=1<AddAura(new Aura(spell, eff_mask, NULL, target, target)); + target->SetHealth(target->GetMaxHealth()); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + // reset arcane burst after teleport - we need to do this because + // when VL jumps to VN's location there will be a warrior who will get only 2s to run away + // which is almost impossible + if (AfterTeleport) + ArcaneBurst_Timer = 5000; + if (!TryActivateAfterTTelep(diff)) + return; + + //ShadowBolt_Timer + if (ShadowBolt_Timer < diff) + { + if (!m_creature->IsWithinDist(m_creature->getVictim(), 45.0f)) + m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim(), VEKLOR_DIST, 0); + else + DoCast(m_creature->getVictim(),SPELL_SHADOWBOLT); + ShadowBolt_Timer = 2000; + }else ShadowBolt_Timer -= diff; + + //Blizzard_Timer + if (Blizzard_Timer < diff) + { + Unit* target = NULL; + target = SelectTarget(SELECT_TARGET_RANDOM, 0, 45, true); + if (target) + DoCast(target,SPELL_BLIZZARD); + Blizzard_Timer = 15000+rand()%15000; + }else Blizzard_Timer -= diff; + + if (ArcaneBurst_Timer < diff) + { + Unit *mvic; + if ((mvic=SelectTarget(SELECT_TARGET_NEAREST, 0, NOMINAL_MELEE_RANGE, true))!=NULL) + { + DoCast(mvic,SPELL_ARCANEBURST); + ArcaneBurst_Timer = 5000; + } + }else ArcaneBurst_Timer -= diff; + + HandleBugs(diff); + + //Heal brother when 60yrds close + TryHealBrother(diff); + + //Teleporting to brother + if (Teleport_Timer < diff) + { + TeleportToMyBrother(); + }else Teleport_Timer -= diff; + + CheckEnrage(diff); + + //VL doesn't melee + //DoMeleeAttackIfReady(); + } + + void AttackStart(Unit* who) + { + if (!who) + return; + + if (who->isTargetableForAttack()) + { + // VL doesn't melee + if (m_creature->Attack(who, false)) + { + m_creature->GetMotionMaster()->MoveChase(who, VEKLOR_DIST, 0); + m_creature->AddThreat(who, 0.0f); + } + } + } +}; + +CreatureAI* GetAI_boss_veknilash(Creature* pCreature) +{ + return new boss_veknilashAI (pCreature); +} + +CreatureAI* GetAI_boss_veklor(Creature* pCreature) +{ + return new boss_veklorAI (pCreature); +} + +void AddSC_boss_twinemperors() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_veknilash"; + newscript->GetAI = &GetAI_boss_veknilash; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="boss_veklor"; + newscript->GetAI = &GetAI_boss_veklor; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_viscidus.cpp b/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_viscidus.cpp new file mode 100644 index 00000000000..2bb9f1bfb0b --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_viscidus.cpp @@ -0,0 +1,30 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Viscidus +SD%Complete: 0 +SDComment: place holder +SDCategory: Temple of Ahn'Qiraj +EndScriptData */ + +#include "precompiled.h" + +#define SPELL_POISON_SHOCK 25993 +#define SPELL_POISONBOLT_VOLLEY 25991 + +#define SPELL_TOXIN_CLOUD 25989 + diff --git a/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/def_temple_of_ahnqiraj.h b/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/def_temple_of_ahnqiraj.h new file mode 100644 index 00000000000..5d545ed7c74 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/def_temple_of_ahnqiraj.h @@ -0,0 +1,23 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_TEMPLE_OF_AHNQIRAJ_H +#define DEF_TEMPLE_OF_AHNQIRAJ_H + +#define DATA_SKERAM 1 +#define DATA_KRI 2 +#define DATA_VEM 3 +#define DATA_VEMISDEAD 4 +#define DATA_VEM_DEATH 5 +#define DATA_VEKLOR 6 +#define DATA_VEKLORISDEAD 7 +#define DATA_VEKLOR_DEATH 8 +#define DATA_VEKNILASH 9 +#define DATA_VEKNILASHISDEAD 10 +#define DATA_VEKNILASH_DEATH 11 +#define DATA_BUG_TRIO_DEATH 14 + +#define DATA_CTHUN_PHASE 20 +#endif + diff --git a/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/instance_temple_of_ahnqiraj.cpp b/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/instance_temple_of_ahnqiraj.cpp new file mode 100644 index 00000000000..489a415cf81 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/instance_temple_of_ahnqiraj.cpp @@ -0,0 +1,166 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Temple_of_Ahnqiraj +SD%Complete: 80 +SDComment: +SDCategory: Temple of Ahn'Qiraj +EndScriptData */ + +#include "precompiled.h" +#include "def_temple_of_ahnqiraj.h" + +struct TRINITY_DLL_DECL instance_temple_of_ahnqiraj : public ScriptedInstance +{ + instance_temple_of_ahnqiraj(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + //If Vem is dead... + bool IsBossDied[3]; + + //Storing Skeram, Vem and Kri. + uint64 SkeramGUID; + uint64 VemGUID; + uint64 KriGUID; + uint64 VeklorGUID; + uint64 VeknilashGUID; + + uint32 BugTrioDeathCount; + + uint32 CthunPhase; + + void Initialize() + { + IsBossDied[0] = false; + IsBossDied[1] = false; + IsBossDied[2] = false; + + SkeramGUID = 0; + VemGUID = 0; + KriGUID = 0; + VeklorGUID = 0; + VeknilashGUID = 0; + + BugTrioDeathCount = 0; + + CthunPhase = 0; + } + + void OnCreatureCreate(Creature* pCreature, bool add) + { + switch (pCreature->GetEntry()) + { + case 15263: SkeramGUID = pCreature->GetGUID(); break; + case 15544: VemGUID = pCreature->GetGUID(); break; + case 15511: KriGUID = pCreature->GetGUID(); break; + case 15276: VeklorGUID = pCreature->GetGUID(); break; + case 15275: VeknilashGUID = pCreature->GetGUID(); break; + } + } + + bool IsEncounterInProgress() const + { + //not active in AQ40 + return false; + } + + uint32 GetData(uint32 type) + { + switch(type) + { + case DATA_VEMISDEAD: + if (IsBossDied[0]) + return 1; + break; + + case DATA_VEKLORISDEAD: + if (IsBossDied[1]) + return 1; + break; + + case DATA_VEKNILASHISDEAD: + if (IsBossDied[2]) + return 1; + break; + + case DATA_BUG_TRIO_DEATH: + return BugTrioDeathCount; + + case DATA_CTHUN_PHASE: + return CthunPhase; + } + return 0; + } + + uint64 GetData64 (uint32 identifier) + { + switch(identifier) + { + case DATA_SKERAM: + return SkeramGUID; + case DATA_VEM: + return VemGUID; + case DATA_KRI: + return KriGUID; + case DATA_VEKLOR: + return VeklorGUID; + case DATA_VEKNILASH: + return VeknilashGUID; + } + return 0; + } // end GetData64 + + void SetData(uint32 type, uint32 data) + { + switch(type) + { + case DATA_VEM_DEATH: + IsBossDied[0] = true; + break; + + case DATA_BUG_TRIO_DEATH: + BugTrioDeathCount++; + break; + + case DATA_VEKLOR_DEATH: + IsBossDied[1] = true; + break; + + case DATA_VEKNILASH_DEATH: + IsBossDied[2] = true; + break; + + case DATA_CTHUN_PHASE: + CthunPhase = data; + break; + } + } +}; + +InstanceData* GetInstanceData_instance_temple_of_ahnqiraj(Map* pMap) +{ + return new instance_temple_of_ahnqiraj(pMap); +} + +void AddSC_instance_temple_of_ahnqiraj() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_temple_of_ahnqiraj"; + newscript->GetInstanceData = &GetInstanceData_instance_temple_of_ahnqiraj; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/mob_anubisath_sentinel.cpp b/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/mob_anubisath_sentinel.cpp new file mode 100644 index 00000000000..35882b86ac7 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/mob_anubisath_sentinel.cpp @@ -0,0 +1,318 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: mob_anubisath_sentinel +SD%Complete: 95 +SDComment: Shadow storm is not properly implemented in core it should only target ppl outside of melee range. +SDCategory: Temple of Ahn'Qiraj +EndScriptData */ + +#include "precompiled.h" +#include "WorldPacket.h" + +#include "Item.h" +#include "Player.h" +#include "Spell.h" + +#include "Cell.h" +#include "CellImpl.h" +#include "GridNotifiers.h" +#include "GridNotifiersImpl.h" + +#define SPELL_MENDING_BUFF 2147 + +#define SPELL_KNOCK_BUFF 21737 +#define SPELL_KNOCK 25778 +#define SPELL_MANAB_BUFF 812 +#define SPELL_MANAB 25779 + +#define SPELL_REFLECTAF_BUFF 13022 +#define SPELL_REFLECTSFr_BUFF 19595 +#define SPELL_THORNS_BUFF 25777 + +#define SPELL_THUNDER_BUFF 2834 +#define SPELL_THUNDER 8732 + +#define SPELL_MSTRIKE_BUFF 9347 +#define SPELL_MSTRIKE 24573 + +#define SPELL_STORM_BUFF 2148 +#define SPELL_STORM 26546 + +struct TRINITY_DLL_DECL aqsentinelAI; +class TRINITY_DLL_DECL SentinelAbilityAura : public Aura +{ + public: + ~SentinelAbilityAura(); + Unit* GetTriggerTarget() const; + SentinelAbilityAura(aqsentinelAI *abilityOwner, SpellEntry *spell, uint32 ability, uint32 eff); + protected: + aqsentinelAI *aOwner; + int32 currentBasePoints; + uint32 abilityId; +}; + +struct TRINITY_DLL_DECL aqsentinelAI : public ScriptedAI +{ + uint32 ability; + int abselected; + + void selectAbility(int asel) + { + switch (asel) + { + case 0: ability = SPELL_MENDING_BUFF;break; + case 1: ability = SPELL_KNOCK_BUFF;break; + case 2: ability = SPELL_MANAB_BUFF;break; + case 3: ability = SPELL_REFLECTAF_BUFF;break; + case 4: ability = SPELL_REFLECTSFr_BUFF;break; + case 5: ability = SPELL_THORNS_BUFF;break; + case 6: ability = SPELL_THUNDER_BUFF;break; + case 7: ability = SPELL_MSTRIKE_BUFF;break; + case 8: ability = SPELL_STORM_BUFF;break; + } + } + + aqsentinelAI(Creature *c) : ScriptedAI(c) + { + ClearBudyList(); + abselected = 0; // just initialization of variable + } + + Creature *nearby[3]; + + void ClearBudyList() + { + nearby[0] = nearby[1] = nearby[2] = NULL; + } + + void AddBuddyToList(Creature *c) + { + if (c==m_creature) + return; + for (int i=0; i<3; ++i) + { + if (nearby[i] == c) + return; + if (!nearby[i]) + { + nearby[i] = c; + return; + } + } + } + + void GiveBuddyMyList(Creature *c) + { + aqsentinelAI *cai = CAST_AI(aqsentinelAI, (c)->AI()); + for (int i=0; i<3; ++i) + if (nearby[i] && nearby[i]!=c) + cai->AddBuddyToList(nearby[i]); + cai->AddBuddyToList(m_creature); + } + + void SendMyListToBuddies() + { + for (int i=0; i<3; ++i) + if (nearby[i]) + GiveBuddyMyList(nearby[i]); + } + + void CallBuddiesToAttack(Unit *who) + { + for (int i=0; i<3; ++i) + { + Creature *c = nearby[i]; + if (c) + { + if (!c->isInCombat()) + { + c->SetNoCallAssistance(true); + if (c->AI()) + c->AI()->AttackStart(who); + } + } + } + } + + void AddSentinelsNear(Unit *nears) + { + std::list assistList; + m_creature->GetCreatureListWithEntryInGrid(assistList,15264,70.0f); + + if (assistList.empty()) + return; + + for(std::list::iterator iter = assistList.begin(); iter != assistList.end(); ++iter) + AddBuddyToList((*iter)); + } + + int pickAbilityRandom(bool *chosenAbilities) + { + for (int t = 0; t < 2; ++t) + { + for (int i = !t ? (rand()%9) : 0; i < 9; ++i) + { + if (!chosenAbilities[i]) + { + chosenAbilities[i] = true; + return i; + } + } + } + return 0; // should never happen + } + + void GetOtherSentinels(Unit *who) + { + bool *chosenAbilities = new bool[9]; + memset(chosenAbilities, 0, 9*sizeof(bool)); + selectAbility(pickAbilityRandom(chosenAbilities)); + + ClearBudyList(); + AddSentinelsNear(m_creature); + int bli; + for (bli = 0; bli < 3; ++bli) + { + if (!nearby[bli]) + break; + AddSentinelsNear(nearby[bli]); + CAST_AI(aqsentinelAI, nearby[bli]->AI())->gatherOthersWhenAggro = false; + CAST_AI(aqsentinelAI, nearby[bli]->AI())->selectAbility(pickAbilityRandom(chosenAbilities)); + } + /*if (bli < 3) + DoYell("I dont have enough buddies.", LANG_NEUTRAL, 0);*/ + SendMyListToBuddies(); + CallBuddiesToAttack(who); + + delete[] chosenAbilities; + } + + bool gatherOthersWhenAggro; + + void Reset() + { + if (!m_creature->isDead()) + { + for (int i=0; i<3; ++i) + { + if (!nearby[i]) + continue; + if (nearby[i]->isDead()) + nearby[i]->Respawn(); + } + } + ClearBudyList(); + gatherOthersWhenAggro = true; + } + + void GainSentinelAbility(uint32 id) + { + const SpellEntry *spell = GetSpellStore()->LookupEntry(id); + uint8 eff_mask=0; + for (int i=0; i<3; ++i) + { + if (!spell->Effect[i]) + continue; + eff_mask=1<AddAura(a); + } + + void EnterCombat(Unit *who) + { + if (gatherOthersWhenAggro) + GetOtherSentinels(who); + + GainSentinelAbility(ability); + DoZoneInCombat(); + } + + void JustDied(Unit* who) + { + for (int ni=0; ni<3; ++ni) + { + Creature *sent = nearby[ni]; + if (!sent) + continue; + if (sent->isDead()) + continue; + int h = sent->GetHealth() + (sent->GetMaxHealth() / 2); + if (h > sent->GetMaxHealth()) + h = sent->GetMaxHealth(); + sent->SetHealth(h); + CAST_AI(aqsentinelAI, sent->AI())->GainSentinelAbility(ability); + } + } + + Unit *GetHatedManaUser() + { + std::list::iterator i; + for (i = m_creature->getThreatManager().getThreatList().begin();i != m_creature->getThreatManager().getThreatList().end(); ++i) + { + Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid()); + if (pUnit->getPowerType()==POWER_MANA) + return pUnit; + } + return NULL; + } +}; +CreatureAI* GetAI_mob_anubisath_sentinelAI(Creature* pCreature) +{ + return new aqsentinelAI (pCreature); +} + +void AddSC_mob_anubisath_sentinel() +{ + Script *newscript; + newscript = new Script; + newscript->Name="mob_anubisath_sentinel"; + newscript->GetAI = &GetAI_mob_anubisath_sentinelAI; + newscript->RegisterSelf(); +} + +SentinelAbilityAura::~SentinelAbilityAura() {} +Unit* SentinelAbilityAura::GetTriggerTarget() const +{ + switch (abilityId) + { + case SPELL_KNOCK_BUFF: + case SPELL_THUNDER_BUFF: + case SPELL_MSTRIKE_BUFF: + case SPELL_STORM_BUFF: + return aOwner->m_creature->getVictim(); + + case SPELL_MANAB_BUFF: + return aOwner->GetHatedManaUser(); + + case SPELL_MENDING_BUFF: + case SPELL_REFLECTAF_BUFF: + case SPELL_REFLECTSFr_BUFF: + case SPELL_THORNS_BUFF: + default: + return aOwner->m_creature; + } +} + +SentinelAbilityAura::SentinelAbilityAura(aqsentinelAI *abilityOwner, SpellEntry *spell, uint32 ability, uint32 eff) +: Aura(spell, eff, NULL, abilityOwner->m_creature, abilityOwner->m_creature, NULL) +{ + aOwner = abilityOwner; + abilityId = ability; +} + diff --git a/src/bindings/scripts/scripts/kalimdor/ungoro_crater.cpp b/src/bindings/scripts/scripts/kalimdor/ungoro_crater.cpp new file mode 100644 index 00000000000..426b7fa2217 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/ungoro_crater.cpp @@ -0,0 +1,210 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +/* ScriptData +SDName: Ungoro Crater +SD%Complete: 100 +SDComment: Support for Quest: 4245 +SDCategory: Ungoro Crater +EndScriptData */ + +/* ContentData +npc_a-me +EndContentData */ + +#include "precompiled.h" +#include "escortAI.h" + +#define SAY_READY -1000200 +#define SAY_AGGRO1 -1000201 +#define SAY_SEARCH -1000202 +#define SAY_AGGRO2 -1000203 +#define SAY_AGGRO3 -1000204 +#define SAY_FINISH -1000205 + +#define SPELL_DEMORALIZINGSHOUT 13730 + +#define QUEST_CHASING_AME 4245 +#define ENTRY_TARLORD 6519 +#define ENTRY_TARLORD1 6519 +#define ENTRY_STOMPER 6513 + + +struct TRINITY_DLL_DECL npc_ameAI : public npc_escortAI +{ + npc_ameAI(Creature *c) : npc_escortAI(c) {} + + uint32 DEMORALIZINGSHOUT_Timer; + + void WaypointReached(uint32 i) + { + Player* pPlayer = Unit::GetPlayer(PlayerGUID); + + if (!pPlayer) + return; + + switch (i) + { + + case 19: + m_creature->SummonCreature(ENTRY_STOMPER, -6391.69, -1730.49, -272.83, 4.96, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + DoScriptText(SAY_AGGRO1, m_creature, pPlayer); + break; + case 28: + DoScriptText(SAY_SEARCH, m_creature, pPlayer); + break; + case 38: + m_creature->SummonCreature(ENTRY_TARLORD, -6370.75, -1382.84, -270.51, 6.06, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + DoScriptText(SAY_AGGRO2, m_creature, pPlayer); + break; + case 49: + m_creature->SummonCreature(ENTRY_TARLORD1, -6324.44, -1181.05, -270.17, 4.34, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + DoScriptText(SAY_AGGRO3, m_creature, pPlayer); + break; + case 55: + DoScriptText(SAY_FINISH, m_creature, pPlayer); + if (pPlayer && pPlayer->GetTypeId() == TYPEID_PLAYER) + CAST_PLR(pPlayer)->GroupEventHappens(QUEST_CHASING_AME,m_creature); + break; + + } + } + + void Reset() + { + DEMORALIZINGSHOUT_Timer = 5000; + } + + void EnterCombat(Unit* who) + {} + + void JustSummoned(Creature* summoned) + { + summoned->AI()->AttackStart(m_creature); + } + + void JustDied(Unit* killer) + { + if (PlayerGUID) + { + if (Player* pPlayer = Unit::GetPlayer(PlayerGUID)) + CAST_PLR(pPlayer)->FailQuest(QUEST_CHASING_AME); + } + } + + void UpdateAI(const uint32 diff) + { + npc_escortAI::UpdateAI(diff); + if (!UpdateVictim()) + return; + + if (DEMORALIZINGSHOUT_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_DEMORALIZINGSHOUT); + DEMORALIZINGSHOUT_Timer = 70000; + }else DEMORALIZINGSHOUT_Timer -= diff; + + } +}; + +bool QuestAccept_npc_ame(Player* pPlayer, Creature* pCreature, Quest const* quest) +{ + if (quest->GetQuestId() == QUEST_CHASING_AME) + { + CAST_AI(npc_escortAI, (pCreature->AI()))->Start(false, false, pPlayer->GetGUID()); + DoScriptText(SAY_READY, pCreature, pPlayer); + pCreature->SetUInt32Value(UNIT_FIELD_BYTES_1,0); + // Change faction so mobs attack + pCreature->setFaction(113); + } + return true; +} + +CreatureAI* GetAI_npc_ame(Creature* pCreature) +{ + npc_ameAI* thisAI = new npc_ameAI(pCreature); + + thisAI->AddWaypoint(1, -6380.38, -1965.14, -258.292, 5000); + thisAI->AddWaypoint(2, -6383.06, -1962.9, -258.936); + thisAI->AddWaypoint(3, -6391.09, -1956.13, -260.291); + thisAI->AddWaypoint(4, -6395.29, -1933.58, -262.949); + thisAI->AddWaypoint(5, -6396.58, -1919.93, -263.838); + thisAI->AddWaypoint(6, -6389.01, -1912.64, -260.689); + thisAI->AddWaypoint(7, -6369.19, -1892.87, -255.924); + thisAI->AddWaypoint(8, -6373.77, -1879.36, -259.268); + thisAI->AddWaypoint(9, -6377.55, -1869.56, -260.503); + thisAI->AddWaypoint(10, -6376.58, -1860.79, -260.026); + thisAI->AddWaypoint(11, -6373.13, -1847.22, -259.249); + thisAI->AddWaypoint(12, -6370.54, -1837.04, -260.007); + thisAI->AddWaypoint(13, -6372.52, -1829.16, -260.071); + thisAI->AddWaypoint(14, -6377.13, -1815.94, -262.632); + thisAI->AddWaypoint(15, -6380.27, -1806.95, -265.53); + thisAI->AddWaypoint(16, -6386.04, -1790.43, -268.546); + thisAI->AddWaypoint(17, -6386.72, -1776.29, -269.851); + thisAI->AddWaypoint(18, -6385.92, -1762.31, -271.494); + thisAI->AddWaypoint(19, -6384.69, -1744.86, -272.196); + thisAI->AddWaypoint(20, -6383.8, -1732.66, -272.222); + thisAI->AddWaypoint(21, -6382.66, -1716.96, -272.235); + thisAI->AddWaypoint(22, -6381.5, -1703.01, -272.964); + thisAI->AddWaypoint(23, -6379.96, -1685.58, -272.842); + thisAI->AddWaypoint(24, -6379.34, -1678.61, -272.34); + thisAI->AddWaypoint(25, -6364.45, -1636.27, -271.065); + thisAI->AddWaypoint(26, -6371.85, -1626.36, -272.188); + thisAI->AddWaypoint(27, -6383.5, -1629.01, -272.206); + thisAI->AddWaypoint(28, -6388.09, -1635.37, -272.105, 5000); + thisAI->AddWaypoint(29, -6375.42, -1637.33, -272.193); + thisAI->AddWaypoint(30, -6365.46, -1617.25, -272.141); + thisAI->AddWaypoint(31, -6353.79, -1603.48, -271.932); + thisAI->AddWaypoint(32, -6340.24, -1592.41, -269.435); + thisAI->AddWaypoint(33, -6329.45, -1566.89, -269.895); + thisAI->AddWaypoint(34, -6312.2, -1499.06, -269.507); + thisAI->AddWaypoint(35, -6304.55, -1468.5, -269.431); + thisAI->AddWaypoint(36, -6310.36, -1440.94, -268.427); + thisAI->AddWaypoint(37, -6321, -1418.91, -266.525); + thisAI->AddWaypoint(38, -6358.76, -1389.97, -267.522); + thisAI->AddWaypoint(39, -6378.65, -1375.67, -271.749); + thisAI->AddWaypoint(40, -6387.22, -1360.95, -272.109); + thisAI->AddWaypoint(41, -6406.95, -1323.87, -271.586); + thisAI->AddWaypoint(42, -6405, -1311.92, -271.906); + thisAI->AddWaypoint(43, -6395.56, -1303.62, -271.902); + thisAI->AddWaypoint(44, -6375.97, -1296.08, -271.865); + thisAI->AddWaypoint(45, -6364.39, -1281.23, -269.012); + thisAI->AddWaypoint(46, -6353.71, -1263.19, -267.95); + thisAI->AddWaypoint(47, -6340.09, -1248.65, -267.441); + thisAI->AddWaypoint(48, -6338.21, -1237.11, -267.844); + thisAI->AddWaypoint(49, -6336.6, -1219.69, -269.196); + thisAI->AddWaypoint(50, -6334.44, -1202.33, -271.527); + thisAI->AddWaypoint(51, -6329.56, -1189.82, -270.947); + thisAI->AddWaypoint(52, -6324.66, -1179.46, -270.103); + thisAI->AddWaypoint(53, -6315.08, -1176.74, -269.735); + thisAI->AddWaypoint(54, -6308.49, -1179.12, -269.57); + thisAI->AddWaypoint(55, -6302.43, -1181.32, -269.328, 5000); + thisAI->AddWaypoint(56, -6298.87, -1185.79, -269.278); + + return thisAI; +} + +void AddSC_ungoro_crater() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "npc_ame"; + newscript->GetAI = &GetAI_npc_ame; + newscript->pQuestAccept = &QuestAccept_npc_ame; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/wailing_caverns/def_wailing_caverns.h b/src/bindings/scripts/scripts/kalimdor/wailing_caverns/def_wailing_caverns.h new file mode 100644 index 00000000000..ee03ade365e --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/wailing_caverns/def_wailing_caverns.h @@ -0,0 +1,24 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_WAILING_CAVERNS_H +#define DEF_WAILING_CAVERNS_H + +enum +{ + TYPE_LORD_COBRAHN = 1, + TYPE_LORD_PYTHAS = 2, + TYPE_LADY_ANACONDRA = 3, + TYPE_LORD_SERPENTIS = 4, + TYPE_NARALEX_EVENT = 5, + TYPE_NARALEX_PART1 = 6, + TYPE_NARALEX_PART2 = 7, + TYPE_NARALEX_PART3 = 8, + TYPE_MUTANUS_THE_DEVOURER = 9, + TYPE_NARALEX_YELLED = 10, + + DATA_NARALEX = 3679, +}; + +#endif \ No newline at end of file diff --git a/src/bindings/scripts/scripts/kalimdor/wailing_caverns/instance_wailing_caverns.cpp b/src/bindings/scripts/scripts/kalimdor/wailing_caverns/instance_wailing_caverns.cpp new file mode 100644 index 00000000000..e535a20a2c1 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/wailing_caverns/instance_wailing_caverns.cpp @@ -0,0 +1,142 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Wailing_Caverns +SD%Complete: 99 +SDComment: Everything seems to work, still need some checking +SDCategory: Wailing Caverns +EndScriptData */ + +#include "precompiled.h" +#include "def_wailing_caverns.h" + +#define MAX_ENCOUNTER 9 + +struct TRINITY_DLL_DECL instance_wailing_caverns : public ScriptedInstance +{ + instance_wailing_caverns(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + + bool yelled; + uint64 NaralexGUID; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + yelled = false; + NaralexGUID = 0; + } + + void OnCreatureCreate(Creature* pCreature, bool add) + { + if (pCreature->GetEntry() == DATA_NARALEX) + NaralexGUID = pCreature->GetGUID(); + } + + void SetData(uint32 type, uint32 data) + { + switch (type) + { + case TYPE_LORD_COBRAHN: m_auiEncounter[0] = data;break; + case TYPE_LORD_PYTHAS: m_auiEncounter[1] = data;break; + case TYPE_LADY_ANACONDRA: m_auiEncounter[2] = data;break; + case TYPE_LORD_SERPENTIS: m_auiEncounter[3] = data;break; + case TYPE_NARALEX_EVENT: m_auiEncounter[4] = data;break; + case TYPE_NARALEX_PART1: m_auiEncounter[5] = data;break; + case TYPE_NARALEX_PART2: m_auiEncounter[6] = data;break; + case TYPE_NARALEX_PART3: m_auiEncounter[7] = data;break; + case TYPE_MUTANUS_THE_DEVOURER: m_auiEncounter[8] = data;break; + case TYPE_NARALEX_YELLED: yelled = true; break; + } + if (data == DONE)SaveToDB(); + } + + uint32 GetData(uint32 type) + { + switch (type) + { + case TYPE_LORD_COBRAHN: return m_auiEncounter[0]; + case TYPE_LORD_PYTHAS: return m_auiEncounter[1]; + case TYPE_LADY_ANACONDRA: return m_auiEncounter[2]; + case TYPE_LORD_SERPENTIS: return m_auiEncounter[3]; + case TYPE_NARALEX_EVENT: return m_auiEncounter[4]; + case TYPE_NARALEX_PART1: return m_auiEncounter[5]; + case TYPE_NARALEX_PART2: return m_auiEncounter[6]; + case TYPE_NARALEX_PART3: return m_auiEncounter[7]; + case TYPE_MUTANUS_THE_DEVOURER: return m_auiEncounter[8]; + case TYPE_NARALEX_YELLED: return yelled; + } + return 0; + } + + uint64 GetData64(uint32 data) + { + if (data == DATA_NARALEX)return NaralexGUID; + return 0; + } + + std::string GetSaveData() + { + OUT_SAVE_INST_DATA; + + std::ostringstream saveStream; + saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " " + << m_auiEncounter[3] << " " << m_auiEncounter[4] << " " << m_auiEncounter[5] << " " + << m_auiEncounter[6] << " " << m_auiEncounter[7] << " " << m_auiEncounter[8]; + + OUT_SAVE_INST_DATA_COMPLETE; + return saveStream.str(); + } + + void Load(const char* in) + { + if (!in) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(in); + + std::istringstream loadStream(in); + loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3] + >> m_auiEncounter[4] >> m_auiEncounter[5] >> m_auiEncounter[6] >> m_auiEncounter[7] >> m_auiEncounter[8]; + + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] != DONE) + m_auiEncounter[i] = NOT_STARTED; + + OUT_LOAD_INST_DATA_COMPLETE; + } + +}; + +InstanceData* GetInstanceData_instance_wailing_caverns(Map* pMap) +{ + return new instance_wailing_caverns(pMap); +} + +void AddSC_instance_wailing_caverns() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_wailing_caverns"; + newscript->GetInstanceData = &GetInstanceData_instance_wailing_caverns; + newscript->RegisterSelf(); +} \ No newline at end of file diff --git a/src/bindings/scripts/scripts/kalimdor/wailing_caverns/wailing_caverns.cpp b/src/bindings/scripts/scripts/kalimdor/wailing_caverns/wailing_caverns.cpp new file mode 100644 index 00000000000..622800127db --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/wailing_caverns/wailing_caverns.cpp @@ -0,0 +1,411 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +/* ScriptData +SDName: Wailing Caverns +SD%Complete: 95 +SDComment: Need to add skill usage for Disciple of Naralex +SDCategory: Wailing Caverns +EndScriptData */ + +/* ContentData +EndContentData */ + +#include "precompiled.h" +#include "escortAI.h" +#include "def_wailing_caverns.h" + +/*###### +## npc_disciple_of_naralex +######*/ + +enum +{ + //say + SAY_MAKE_PREPARATIONS = -1043001, + SAY_TEMPLE_OF_PROMISE = -1043002, + SAY_MUST_CONTINUE = -1043003, + SAY_BANISH_THE_SPIRITS = -1043004, + SAY_CAVERNS_PURIFIED = -1043005, + SAY_BEYOND_THIS_CORRIDOR = -1043006, + SAY_EMERALD_DREAM = -1043007, + SAY_MUTANUS_THE_DEVOURER = -1043012, + SAY_NARALEX_AWAKES = -1043014, + SAY_THANK_YOU = -1043015, + SAY_FAREWELL = -1043016, + SAY_ATTACKED = -1043017, + //yell + SAY_AT_LAST = -1043000, + SAY_I_AM_AWAKE = -1043013, + //emote + EMOTE_AWAKENING_RITUAL = -1043008, + EMOTE_TROUBLED_SLEEP = -1043009, + EMOTE_WRITHE_IN_AGONY = -1043010, + EMOTE_HORRENDOUS_VISION = -1043011, + //spell + SPELL_MARK_OF_THE_WILD_RANK_2 = 5232, + SPELL_SERPENTINE_CLEANSING = 6270, + SPELL_NARALEXS_AWAKENING = 6271, + SPELL_FLIGHT_FORM = 33943, + //npc entry + NPC_DEVIATE_RAVAGER = 3636, + NPC_DEVIATE_VIPER = 5755, + NPC_DEVIATE_MOCCASIN = 5762, + NPC_NIGHTMARE_ECTOPLASM = 5763, + NPC_MUTANUS_THE_DEVOURER = 3654, +}; + +#define GOSSIP_ID_START_1 698 //Naralex sleeps again! +#define GOSSIP_ID_START_2 699 //The fanglords are dead! +#define GOSSIP_ITEM_NARALEX "Let the event begin!" +#define ACHIEVEMENT_WAILING_CAVERNS 630 + +struct TRINITY_DLL_DECL npc_disciple_of_naralexAI : public npc_escortAI +{ + npc_disciple_of_naralexAI(Creature *c) : npc_escortAI(c) + { + pInstance = c->GetInstanceData(); + eventTimer = 0; + currentEvent = 0; + eventProgress = 0; + m_creature->setActive(true); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); + } + + uint32 eventTimer; + uint32 currentEvent; + uint32 eventProgress; + ScriptedInstance *pInstance; + + void WaypointReached(uint32 i) + { + if (!pInstance) + return; + + switch (i) + { + case 4: + eventProgress = 1; + currentEvent = TYPE_NARALEX_PART1; + pInstance->SetData(TYPE_NARALEX_PART1, IN_PROGRESS); + break; + case 5: + DoScriptText(SAY_MUST_CONTINUE, m_creature); + pInstance->SetData(TYPE_NARALEX_PART1, DONE); + break; + case 11: + eventProgress = 1; + currentEvent = TYPE_NARALEX_PART2; + pInstance->SetData(TYPE_NARALEX_PART2, IN_PROGRESS); + break; + case 19: + DoScriptText(SAY_BEYOND_THIS_CORRIDOR, m_creature); + break; + case 24: + eventProgress = 1; + currentEvent = TYPE_NARALEX_PART3; + pInstance->SetData(TYPE_NARALEX_PART3, IN_PROGRESS); + break; + } + } + + void Reset() + { + + } + + void EnterCombat(Unit* who) + { + DoScriptText(SAY_ATTACKED, m_creature, who); + } + + void JustDied(Unit *slayer) + { + if (pInstance) + { + pInstance->SetData(TYPE_NARALEX_EVENT, FAIL); + pInstance->SetData(TYPE_NARALEX_PART1, FAIL); + pInstance->SetData(TYPE_NARALEX_PART2, FAIL); + pInstance->SetData(TYPE_NARALEX_PART3, FAIL); + } + } + + void JustSummoned(Creature* summoned) + { + summoned->AI()->AttackStart(m_creature); + } + + void EnterEvadeMode() + { + m_creature->RemoveAllAuras(); + m_creature->DeleteThreatList(); + m_creature->CombatStop(false);//do not interrupt channeling + m_creature->SetLootRecipient(NULL); + if (GetIsBeingEscorted()) + { + SetReturning(true); + ReturnToLastPoint(); + debug_log("TSCR: EscortAI (EnterEvadeMode() Override) has left combat and is now returning to last point"); + } + else + m_creature->GetMotionMaster()->MoveTargetedHome(); + } + + void UpdateAI(const uint32 diff) + { + if (currentEvent != TYPE_NARALEX_PART3) + npc_escortAI::UpdateAI(diff); + + if (!pInstance) + return; + if (eventTimer <= diff) + { + eventTimer = 0; + if (pInstance->GetData(currentEvent) == IN_PROGRESS) + { + switch (currentEvent) + { + case TYPE_NARALEX_PART1: + if (eventProgress == 1) + { + eventProgress++; + DoScriptText(SAY_TEMPLE_OF_PROMISE, m_creature); + m_creature->SummonCreature(NPC_DEVIATE_RAVAGER, -82.1763, 227.874, -93.3233, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000); + m_creature->SummonCreature(NPC_DEVIATE_RAVAGER, -72.9506, 216.645, -93.6756, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000); + } + break; + case TYPE_NARALEX_PART2: + if (eventProgress == 1) + { + eventProgress++; + DoScriptText(SAY_BANISH_THE_SPIRITS, m_creature); + DoCast(m_creature, SPELL_SERPENTINE_CLEANSING); + //CAST_AI(npc_escortAI, m_creature->AI())->SetCanDefend(false); + eventTimer = 30000; + m_creature->SummonCreature(NPC_DEVIATE_VIPER, -61.5261, 273.676, -92.8442, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000); + m_creature->SummonCreature(NPC_DEVIATE_VIPER, -58.4658, 280.799, -92.8393, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000); + m_creature->SummonCreature(NPC_DEVIATE_VIPER, -50.002, 278.578, -92.8442, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000); + } + else + if (eventProgress == 2) + { + //CAST_AI(npc_escortAI, m_creature->AI())->SetCanDefend(true); + DoScriptText(SAY_CAVERNS_PURIFIED, m_creature); + pInstance->SetData(TYPE_NARALEX_PART2, DONE); + if (m_creature->HasAura(SPELL_SERPENTINE_CLEANSING)) + m_creature->RemoveAura(SPELL_SERPENTINE_CLEANSING); + } + break; + case TYPE_NARALEX_PART3: + if (eventProgress == 1) + { + eventProgress++; + eventTimer = 4000; + m_creature->SetStandState(UNIT_STAND_STATE_KNEEL); + DoScriptText(SAY_EMERALD_DREAM, m_creature); + } + else + if (eventProgress == 2) + { + eventProgress++; + eventTimer = 15000; + //CAST_AI(npc_escortAI, m_creature->AI())->SetCanDefend(false); + if (Creature* naralex = pInstance->instance->GetCreature(pInstance->GetData64(DATA_NARALEX))) + DoCast(naralex, SPELL_NARALEXS_AWAKENING, true); + DoScriptText(EMOTE_AWAKENING_RITUAL, m_creature); + } + else + if (eventProgress == 3) + { + eventProgress++; + eventTimer = 15000; + if (Creature* naralex = pInstance->instance->GetCreature(pInstance->GetData64(DATA_NARALEX))) + DoScriptText(EMOTE_TROUBLED_SLEEP, naralex); + m_creature->SummonCreature(NPC_DEVIATE_MOCCASIN, 135.943, 199.701, -103.529, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000); + m_creature->SummonCreature(NPC_DEVIATE_MOCCASIN, 151.08, 221.13, -103.609, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000); + m_creature->SummonCreature(NPC_DEVIATE_MOCCASIN, 128.007, 227.428, -97.421, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000); + } + else + if (eventProgress == 4) + { + eventProgress++; + eventTimer = 30000; + if (Creature* naralex = pInstance->instance->GetCreature(pInstance->GetData64(DATA_NARALEX))) + DoScriptText(EMOTE_WRITHE_IN_AGONY, naralex); + m_creature->SummonCreature(NPC_NIGHTMARE_ECTOPLASM, 133.413, 207.188, -102.469, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000); + m_creature->SummonCreature(NPC_NIGHTMARE_ECTOPLASM, 142.857, 218.645, -102.905, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000); + m_creature->SummonCreature(NPC_NIGHTMARE_ECTOPLASM, 105.102, 227.211, -102.752, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000); + m_creature->SummonCreature(NPC_NIGHTMARE_ECTOPLASM, 153.372, 235.149, -102.826, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000); + m_creature->SummonCreature(NPC_NIGHTMARE_ECTOPLASM, 149.524, 251.113, -102.558, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000); + m_creature->SummonCreature(NPC_NIGHTMARE_ECTOPLASM, 136.208, 266.466, -102.977, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000); + m_creature->SummonCreature(NPC_NIGHTMARE_ECTOPLASM, 126.167, 274.759, -102.962, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000); + } + else + if (eventProgress == 5) + { + eventProgress++; + if (Creature* naralex = pInstance->instance->GetCreature(pInstance->GetData64(DATA_NARALEX))) + DoScriptText(EMOTE_HORRENDOUS_VISION, naralex); + m_creature->SummonCreature(NPC_MUTANUS_THE_DEVOURER, 150.872, 262.905, -103.503, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000); + DoScriptText(SAY_MUTANUS_THE_DEVOURER, m_creature); + pInstance->SetData(TYPE_MUTANUS_THE_DEVOURER, IN_PROGRESS); + } + else + if (eventProgress == 6 && pInstance->GetData(TYPE_MUTANUS_THE_DEVOURER) == DONE) + { + eventProgress++; + eventTimer = 3000; + if (Creature* naralex = pInstance->instance->GetCreature(pInstance->GetData64(DATA_NARALEX))) + { + AchievementEntry const *AchievWC = GetAchievementStore()->LookupEntry(ACHIEVEMENT_WAILING_CAVERNS); + if (AchievWC) + { + Map* pMap = m_creature->GetMap(); + if (pMap && pMap->IsDungeon()) + { + Map::PlayerList const &players = pMap->GetPlayers(); + for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + itr->getSource()->CompletedAchievement(AchievWC); + } + } + if (m_creature->HasAura(SPELL_NARALEXS_AWAKENING)) + m_creature->RemoveAura(SPELL_NARALEXS_AWAKENING); + naralex->SetStandState(UNIT_STAND_STATE_STAND); + DoScriptText(SAY_I_AM_AWAKE, naralex); + } + DoScriptText(SAY_NARALEX_AWAKES, m_creature); + } + else + if (eventProgress == 7) + { + eventProgress++; + eventTimer = 6000; + if (Creature* naralex = pInstance->instance->GetCreature(pInstance->GetData64(DATA_NARALEX))) + DoScriptText(SAY_THANK_YOU, naralex); + } + else + if (eventProgress == 8) + { + eventProgress++; + eventTimer = 8000; + if (Creature* naralex = pInstance->instance->GetCreature(pInstance->GetData64(DATA_NARALEX))) + { + DoScriptText(SAY_FAREWELL, naralex); + naralex->AddAura(SPELL_FLIGHT_FORM, naralex); + } + SetRun(); + m_creature->SetStandState(UNIT_STAND_STATE_STAND); + m_creature->AddAura(SPELL_FLIGHT_FORM, m_creature); + } + else + if (eventProgress == 9) + { + eventProgress++; + eventTimer = 1500; + if (Creature* naralex = pInstance->instance->GetCreature(pInstance->GetData64(DATA_NARALEX))) + naralex->GetMotionMaster()->MovePoint(25, naralex->GetPositionX(), naralex->GetPositionY(), naralex->GetPositionZ()); + } + else + if (eventProgress == 10) + { + eventProgress++; + eventTimer = 2500; + if (Creature* naralex = pInstance->instance->GetCreature(pInstance->GetData64(DATA_NARALEX))) + { + naralex->GetMotionMaster()->MovePoint(0, 117.095512, 247.107971, -96.167870); + naralex->GetMotionMaster()->MovePoint(1, 90.388809, 276.135406, -83.389801); + } + m_creature->GetMotionMaster()->MovePoint(26, 117.095512, 247.107971, -96.167870); + m_creature->GetMotionMaster()->MovePoint(27, 144.375443, 281.045837, -82.477135); + } + else + if (eventProgress == 11) + { + if (Creature* naralex = pInstance->instance->GetCreature(pInstance->GetData64(DATA_NARALEX))) + naralex->SetVisibility(VISIBILITY_OFF); + m_creature->SetVisibility(VISIBILITY_OFF); + pInstance->SetData(TYPE_NARALEX_PART3, DONE); + } + break; + } + } + }else eventTimer -= diff; + } +}; + +CreatureAI* GetAI_npc_disciple_of_naralex(Creature* pCreature) +{ + return new npc_disciple_of_naralexAI(pCreature); +} + +bool GossipHello_npc_disciple_of_naralex(Player* pPlayer, Creature* pCreature) +{ + ScriptedInstance *pInstance = (pCreature->GetInstanceData()); + + if (pInstance) + { + pCreature->CastSpell(pPlayer, SPELL_MARK_OF_THE_WILD_RANK_2, true); + if ((pInstance->GetData(TYPE_LORD_COBRAHN) == DONE) && (pInstance->GetData(TYPE_LORD_PYTHAS) == DONE) && + (pInstance->GetData(TYPE_LADY_ANACONDRA) == DONE) && (pInstance->GetData(TYPE_LORD_SERPENTIS) == DONE)) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_NARALEX, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_ID_START_2, pCreature->GetGUID()); + + if (!pInstance->GetData(TYPE_NARALEX_YELLED)) + { + DoScriptText(SAY_AT_LAST, pCreature); + pInstance->SetData(TYPE_NARALEX_YELLED, 1); + } + } + else + { + pPlayer->SEND_GOSSIP_MENU(GOSSIP_ID_START_1, pCreature->GetGUID()); + } + } + return true; +} + +bool GossipSelect_npc_disciple_of_naralex(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + ScriptedInstance *pInstance = (pCreature->GetInstanceData()); + if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) + { + pPlayer->CLOSE_GOSSIP_MENU(); + if (pInstance)pInstance->SetData(TYPE_NARALEX_EVENT, IN_PROGRESS); + + DoScriptText(SAY_MAKE_PREPARATIONS, pCreature); + + pCreature->setFaction(250); + pCreature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); + + CAST_AI(npc_escortAI, (pCreature->AI()))->Start(false, false, pPlayer->GetGUID()); + CAST_AI(npc_escortAI, (pCreature->AI()))->SetDespawnAtFar(false); + CAST_AI(npc_escortAI, (pCreature->AI()))->SetDespawnAtEnd(false); + } + return true; +} + +void AddSC_wailing_caverns() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "npc_disciple_of_naralex"; + newscript->pGossipHello = &GossipHello_npc_disciple_of_naralex; + newscript->pGossipSelect = &GossipSelect_npc_disciple_of_naralex; + newscript->GetAI = &GetAI_npc_disciple_of_naralex; + newscript->RegisterSelf(); +} \ No newline at end of file diff --git a/src/bindings/scripts/scripts/kalimdor/zulfarrak/zulfarrak.cpp b/src/bindings/scripts/scripts/kalimdor/zulfarrak/zulfarrak.cpp new file mode 100644 index 00000000000..4e630368db1 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/zulfarrak/zulfarrak.cpp @@ -0,0 +1,223 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Zulfarrak +SD%Complete: 50 +SDComment: Consider it temporary, no instance script made for this instance yet. +SDCategory: Zul'Farrak +EndScriptData */ + +/* ContentData +npc_sergeant_bly +npc_weegli_blastfuse +EndContentData */ + +#include "precompiled.h" + +/*###### +## npc_sergeant_bly +######*/ + +#define FACTION_HOSTILE 14 +#define FACTION_FRIENDLY 35 + +#define SPELL_SHIELD_BASH 11972 +#define SPELL_REVENGE 12170 + +#define GOSSIP_BLY "[PH] In that case, i will take my reward!" + +struct TRINITY_DLL_DECL npc_sergeant_blyAI : public ScriptedAI +{ + npc_sergeant_blyAI(Creature *c) : ScriptedAI(c) + { + //pInstance = c->GetInstanceData(); + } + + //ScriptedInstance* pInstance; + + uint32 ShieldBash_Timer; + uint32 Revenge_Timer; //this is wrong, spell should never be used unless m_creature->getVictim() dodge, parry or block attack. Trinity support required. + + void Reset() + { + ShieldBash_Timer = 5000; + Revenge_Timer = 8000; + + m_creature->setFaction(FACTION_FRIENDLY); + + /*if (pInstance) + pInstance->SetData(0, NOT_STARTED);*/ + } + + void EnterCombat(Unit *who) + { + /*if (pInstance) + pInstance->SetData(0, IN_PROGRESS);*/ + } + + void JustDied(Unit *victim) + { + /*if (pInstance) + pInstance->SetData(0, DONE);*/ + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (ShieldBash_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_SHIELD_BASH); + ShieldBash_Timer = 15000; + }else ShieldBash_Timer -= diff; + + if (Revenge_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_REVENGE); + Revenge_Timer = 10000; + }else Revenge_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_npc_sergeant_bly(Creature* pCreature) +{ + return new npc_sergeant_blyAI (pCreature); +} + +bool GossipHello_npc_sergeant_bly(Player* pPlayer, Creature* pCreature) +{ + /*if (pInstance->GetData(0) == DONE) + {*/ + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BLY, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + pPlayer->SEND_GOSSIP_MENU(1517, pCreature->GetGUID()); + /*} + else if (pInstance->GetData(0) == IN_PROGRESS) + pPlayer->SEND_GOSSIP_MENU(1516, pCreature->GetGUID()); + else + pPlayer->SEND_GOSSIP_MENU(1515, pCreature->GetGUID());*/ + + return true; +} + +bool GossipSelect_npc_sergeant_bly(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + { + pPlayer->CLOSE_GOSSIP_MENU(); + pCreature->setFaction(FACTION_HOSTILE); + CAST_AI(npc_sergeant_blyAI, pCreature->AI())->AttackStart(pPlayer); + } + return true; +} + +/*###### +## npc_weegli_blastfuse +######*/ + +#define SPELL_BOMB 8858 +#define SPELL_GOBLIN_LAND_MINE 21688 +#define SPELL_SHOOT 6660 +#define SPELL_WEEGLIS_BARREL 10772 + +#define GOSSIP_WEEGLI "[PH] Please blow up the door." + +struct TRINITY_DLL_DECL npc_weegli_blastfuseAI : public ScriptedAI +{ + npc_weegli_blastfuseAI(Creature *c) : ScriptedAI(c) + { + //pInstance = c->GetInstanceData(); + } + + //ScriptedInstance* pInstance; + + void Reset() + { + /*if (pInstance) + pInstance->SetData(0, NOT_STARTED);*/ + } + + void EnterCombat(Unit *who) + { + /*if (pInstance) + pInstance->SetData(0, IN_PROGRESS);*/ + } + + void JustDied(Unit *victim) + { + /*if (pInstance) + pInstance->SetData(0, DONE);*/ + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_npc_weegli_blastfuse(Creature* pCreature) +{ + return new npc_weegli_blastfuseAI (pCreature); +} + +bool GossipHello_npc_weegli_blastfuse(Player* pPlayer, Creature* pCreature) +{ + //event not implemented yet, this is only placeholder for future developement + /*if (pInstance->GetData(0) == DONE) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_WEEGLI, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + pPlayer->SEND_GOSSIP_MENU(1514, pCreature->GetGUID());//if event can proceed to end + } + else if (pInstance->GetData(0) == IN_PROGRESS) + pPlayer->SEND_GOSSIP_MENU(1513, pCreature->GetGUID());//if event are in progress + else*/ + pPlayer->SEND_GOSSIP_MENU(1511, pCreature->GetGUID()); //if event not started + return true; +} + +bool GossipSelect_npc_weegli_blastfuse(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + { + pPlayer->CLOSE_GOSSIP_MENU(); + //here we make him run to door, set the charge and run away off to nowhere + } + return true; +} + +void AddSC_zulfarrak() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="npc_sergeant_bly"; + newscript->GetAI = &GetAI_npc_sergeant_bly; + newscript->pGossipHello = &GossipHello_npc_sergeant_bly; + newscript->pGossipSelect = &GossipSelect_npc_sergeant_bly; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_weegli_blastfuse"; + newscript->GetAI = &GetAI_npc_weegli_blastfuse; + newscript->pGossipHello = &GossipHello_npc_weegli_blastfuse; + newscript->pGossipSelect = &GossipSelect_npc_weegli_blastfuse; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/zone/blackfathom_depths/def_blackfathom_deeps.h b/src/bindings/scripts/scripts/zone/blackfathom_depths/def_blackfathom_deeps.h deleted file mode 100644 index 6a1b1974886..00000000000 --- a/src/bindings/scripts/scripts/zone/blackfathom_depths/def_blackfathom_deeps.h +++ /dev/null @@ -1,23 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ - -#ifndef DEF_BFD_H -#define DEF_BFD_H - -enum -{ - DATA_SHRINE1 = 1, - DATA_SHRINE2 = 2, - DATA_SHRINE3 = 3, - DATA_SHRINE4 = 4, - DATA_TWILIGHT_LORD_KELRIS = 5, - DATA_SHRINE_OF_GELIHAST = 6, - DATA_ALTAR_OF_THE_DEEPS = 7, - DATA_MAINDOOR = 8, - - TYPE_KELRIS = 10, - TYPE_SHRINE = 11 -}; - -#endif diff --git a/src/bindings/scripts/scripts/zone/blackfathom_depths/instance_blackfathom_deeps.cpp b/src/bindings/scripts/scripts/zone/blackfathom_depths/instance_blackfathom_deeps.cpp deleted file mode 100644 index 19203ce2d73..00000000000 --- a/src/bindings/scripts/scripts/zone/blackfathom_depths/instance_blackfathom_deeps.cpp +++ /dev/null @@ -1,145 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Instance_Blackfathom_Deeps -SD%Complete: 50 -SDComment: -SDCategory: Blackfathom Deeps -EndScriptData */ - -#include "precompiled.h" -#include "def_blackfathom_deeps.h" - -#define MAX_ENCOUNTER 2 - -/* Encounter 0 = Twilight Lord Kelris - Encounter 1 = Shrine event - Must kill twilight lord for shrine event to be possible - */ - -struct TRINITY_DLL_DECL instance_blackfathom_deeps : public ScriptedInstance -{ - instance_blackfathom_deeps(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; - - uint64 m_uiTwilightLordKelrisGUID; - uint64 m_uiShrine1GUID; - uint64 m_uiShrine2GUID; - uint64 m_uiShrine3GUID; - uint64 m_uiShrine4GUID; - uint64 m_uiShrineOfGelihastGUID; - uint64 m_uiAltarOfTheDeepsGUID; - uint64 m_uiMainDoorGUID; - - uint32 m_auiEncounter[MAX_ENCOUNTER]; - - void Initialize() - { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - - m_uiTwilightLordKelrisGUID = 0; - m_uiShrine1GUID = 0; - m_uiShrine2GUID = 0; - m_uiShrine3GUID = 0; - m_uiShrine4GUID = 0; - m_uiShrineOfGelihastGUID = 0; - m_uiAltarOfTheDeepsGUID = 0; - m_uiMainDoorGUID = 0; - } - - void OnCreatureCreate(Creature* pCreature, bool add) - { - if (pCreature->GetEntry() == 4832) - m_uiTwilightLordKelrisGUID = pCreature->GetGUID(); - } - - void OnGameObjectCreate(GameObject* pGo, bool add) - { - switch(pGo->GetEntry()) - { - case 21118: m_uiShrine1GUID = pGo->GetGUID(); break; - case 21119: m_uiShrine2GUID = pGo->GetGUID(); break; - case 21120: m_uiShrine3GUID = pGo->GetGUID(); break; - case 21121: m_uiShrine4GUID = pGo->GetGUID(); break; - case 103015: m_uiShrineOfGelihastGUID = pGo->GetGUID(); break; - case 103016: m_uiAltarOfTheDeepsGUID = pGo->GetGUID(); break; - case 21117: m_uiMainDoorGUID = pGo->GetGUID(); break; - } - } - - void SetData(uint32 uiType, uint32 uiData) - { - switch(uiType) - { - case TYPE_KELRIS: - m_auiEncounter[0] = uiData; - break; - case TYPE_SHRINE: - m_auiEncounter[1] = uiData; - break; - } - } - - uint32 GetData(uint32 uiType) - { - switch(uiType) - { - case TYPE_KELRIS: - return m_auiEncounter[0]; - case TYPE_SHRINE: - return m_auiEncounter[1]; - } - - return 0; - } - - uint64 GetData64(uint32 uiData) - { - switch(uiData) - { - case DATA_TWILIGHT_LORD_KELRIS: - return m_uiTwilightLordKelrisGUID; - case DATA_SHRINE1: - return m_uiShrine1GUID; - case DATA_SHRINE2: - return m_uiShrine2GUID; - case DATA_SHRINE3: - return m_uiShrine3GUID; - case DATA_SHRINE4: - return m_uiShrine4GUID; - case DATA_SHRINE_OF_GELIHAST: - return m_uiShrineOfGelihastGUID; - case DATA_MAINDOOR: - return m_uiMainDoorGUID; - } - - return 0; - } -}; - -InstanceData* GetInstanceData_instance_blackfathom_deeps(Map* pMap) -{ - return new instance_blackfathom_deeps(pMap); -} - -void AddSC_instance_blackfathom_deeps() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_blackfathom_deeps"; - newscript->GetInstanceData = &GetInstanceData_instance_blackfathom_deeps; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/boss_epoch.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/boss_epoch.cpp deleted file mode 100644 index 2e9877e97e2..00000000000 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/boss_epoch.cpp +++ /dev/null @@ -1,86 +0,0 @@ -/* Script Data Start -SDName: Boss epoch -SDAuthor: LordVanMartin -SD%Complete: -SDComment: -SDCategory: -Script Data End */ - -/*** SQL START *** -update creature_template set scriptname = '' where entry = ''; -*** SQL END ***/ -#include "precompiled.h" - -//Spells -#define SPELL_CURSE_OF_EXERTION 52772 -#define SPELL_TIME_WARP 52766 //Time slows down, reducing attack, casting and movement speed by 70% for 6 sec. -#define SPELL_TIME_STOP 58848 //Stops time in a 50 yard sphere for 2 sec. -#define SPELL_WOUNDING_STRIKE_N 52771 //Used only on the tank -#define SPELL_WOUNDING_STRIKE_H 58830 - -//Say -#define SAY_INTRO -1595000 //"Prince Arthas Menethil, on this day, a powerful darkness has taken hold of your soul. The death you are destined to visit upon others will this day be your own." -#define SAY_AGGRO -1595001 //"We'll see about that, young prince." -#define SAY_TIME_WARP_1 -1595002 //"Tick tock, tick tock..." -#define SAY_TIME_WARP_2 -1595003 //"Not quick enough!" -#define SAY_TIME_WARP_3 -1595004 //"Let's get this over with. " -#define SAY_SLAY_1 -1595005 //"There is no future for you." -#define SAY_SLAY_2 -1595006 //"This is the hour of our greatest triumph!" -#define SAY_SLAY_3 -1595007 //"You were destined to fail. " -#define SAY_DEATH -1595008 //"*gurgles*" - -struct TRINITY_DLL_DECL boss_epochAI : public ScriptedAI -{ - boss_epochAI(Creature *c) : ScriptedAI(c) {} - - void Reset() {} - - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - - void JustDied(Unit* killer) - { - DoScriptText(SAY_DEATH, m_creature); - } - - void KilledUnit(Unit *victim) - { - if (victim == m_creature) - return; - - switch(rand()%3) - { - case 0:DoScriptText(SAY_SLAY_1, m_creature);break; - case 1:DoScriptText(SAY_SLAY_2, m_creature);break; - case 2:DoScriptText(SAY_SLAY_3, m_creature);break; - } - } -}; - -CreatureAI* GetAI_boss_epoch(Creature* pCreature) -{ - return new boss_epochAI (pCreature); -} - -void AddSC_boss_epoch() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_epoch"; - newscript->GetAI = &GetAI_boss_epoch; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/boss_mal_ganis.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/boss_mal_ganis.cpp deleted file mode 100644 index bd68d94d994..00000000000 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/boss_mal_ganis.cpp +++ /dev/null @@ -1,123 +0,0 @@ -/* Script Data Start -SDName: Boss mal_ganis -SDAuthor: LordVanMartin -SD%Complete: -SDComment: -SDCategory: -Script Data End */ - -/*** SQL START *** -update creature_template set scriptname = 'boss_mal_ganis' where entry = ''; -*** SQL END ***/ -#include "precompiled.h" - -//Spells -#define SPELL_CARRION_SWARM_N 52720 //A cresting wave of chaotic magic splashes over enemies in front of the caster, dealing 3230 to 3570 Shadow damage and 380 to 420 Shadow damage every 3 sec. for 15 sec. -#define SPELL_CARRION_SWARM_H 58852 -#define SPELL_MIND_BLAST_N 52722 //Inflicts 4163 to 4837 Shadow damage to an enemy. -#define SPELL_MIND_BLAST_H 58850 -#define SPELL_SLEEP 52721 //Puts an enemy to sleep for up to 10 sec. Any damage caused will awaken the target. -#define SPELL_VAMPIRIC_TOUCH 52723 //Heals the caster for half the damage dealt by a melee attack. - -//Yell Mal'ganis -#define SAY_INTRO_1 -1595009 -#define SAY_INTRO_2 -1595010 -#define SAY_OUTRO -1595011 -#define SAY_AGGRO -1595012 -#define SAY_KILL_1 -1595013 -#define SAY_KILL_2 -1595014 -#define SAY_KILL_3 -1595015 -#define SAY_SLAY_1 -1595016 -#define SAY_SLAY_2 -1595017 -#define SAY_SLAY_3 -1595018 -#define SAY_SLAY_4 -1595019 -#define SAY_SLEEP_1 -1595020 -#define SAY_SLEEP_2 -1595021 -#define SAY_30HEALTH -1595022 -#define SAY_15HEALTH -1595023 -#define SAY_ESCAPE_SPEECH_1 -1595024 -#define SAY_ESCAPE_SPEECH_2 -1595025 - -struct TRINITY_DLL_DECL boss_mal_ganisAI : public ScriptedAI -{ - boss_mal_ganisAI(Creature *c) : ScriptedAI(c) {} - - bool yelled, - yelled2, - yelled3; - - void Reset() - { - yelled = false; - yelled2 = false; - yelled3 = false; - } - - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - if (!yelled) - { - if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 30) - { - DoScriptText(SAY_30HEALTH, m_creature); - yelled = true; - } - } - - if (!yelled2) - { - if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 15) - { - DoScriptText(SAY_15HEALTH, m_creature); - yelled2 = true; - } - } - - if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 1) - { - //Handle Escape Event - } - - DoMeleeAttackIfReady(); - } - void JustDied(Unit* killer) {} - void KilledUnit(Unit *victim) - { - if (victim == m_creature) - return; - - switch(rand()%4) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature);break; - case 1: DoScriptText(SAY_SLAY_2, m_creature);break; - case 2: DoScriptText(SAY_SLAY_3, m_creature);break; - case 3: DoScriptText(SAY_SLAY_4, m_creature);break; - } - } -}; - -CreatureAI* GetAI_boss_mal_ganis(Creature* pCreature) -{ - return new boss_mal_ganisAI (pCreature); -} - -void AddSC_boss_mal_ganis() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_mal_ganis"; - newscript->GetAI = &GetAI_boss_mal_ganis; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/boss_meathook.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/boss_meathook.cpp deleted file mode 100644 index 117a17585c6..00000000000 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/boss_meathook.cpp +++ /dev/null @@ -1,138 +0,0 @@ -/* Script Data Start -SDName: Boss meathook -SDAuthor: LordVanMartin -SD%Complete: -SDComment: -SDCategory: -Script Data End */ - -/*** SQL START *** -update creature_template set scriptname = 'boss_meathook' where entry = ''; -*** SQL END ***/ -#include "precompiled.h" - -//Spell -#define SPELL_CONSTRICTING_CHAINS_N 52696 //Encases the targets in chains, dealing 1800 Physical damage every 1 sec. and stunning the target for 5 sec. -#define SPELL_CONSTRICTING_CHAINS_H 58823 -#define SPELL_DISEASE_EXPULSION_N 52666 //Meathook belches out a cloud of disease, dealing 1710 to 1890 Nature damage and interrupting the spell casting of nearby enemy targets for 4 sec. -#define SPELL_DISEASE_EXPULSION_H 58824 -#define SPELL_FRENZY 58841 //Increases the caster's Physical damage by 10% for 30 sec. - -//Yell -#define SAY_AGGRO -1595026 -#define SAY_SLAY_1 -1595027 -#define SAY_SLAY_2 -1595028 -#define SAY_SLAY_3 -1595029 -#define SAY_SPAWN -1595030 -#define SAY_DEATH -1595031 - -struct TRINITY_DLL_DECL boss_meathookAI : public ScriptedAI -{ - boss_meathookAI(Creature *c) : ScriptedAI(c) {} - - uint32 Chain_Timer, - Disease_Timer, - Frenzy_Timer; - - void Reset() - { - Chain_Timer = 12000 + rand()%5000; //seen on video 13, 17, 15, 12, 16 - Disease_Timer = 2000 + rand()%1000; //approx 3s - Frenzy_Timer = 20000 + rand()%10000; //made it up - } - - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - - void AttackStart(Unit* who) {} - - std::list pList; - void MoveInLineOfSight(Unit* who, const uint32 diff) - { - /*if (m_creature->isHostileTo(who)) - { - pList.append(who); - }*/ - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - if (Disease_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_DISEASE_EXPULSION_N); - Disease_Timer = 1500 + rand()%2500; - }else Disease_Timer -= diff; - - if (Frenzy_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_FRENZY); - Frenzy_Timer = 20000 + rand()%10000; - }else Frenzy_Timer -= diff; - - if (Chain_Timer < diff) - { - - /* - std::list& m_threatlist = m_creature->getThreatManager().getThreatList(); - std::list::iterator itr; - - int st=0; - for(itr = m_threatlist.begin(); itr != m_threatlist.end(); ++itr) - { - //st++; - m_creature->getThreatManager(). - } - Unit* targets[st]; - int st2=0; - for(int i=1; i<=st; ++i){ - if (!IsWithinLOSInMap(targets[i]) - st2++; - } - Unit* targets_out_of_LOS[st2];*/ - - DoCast(SelectUnit(SELECT_TARGET_RANDOM, 1), SPELL_CONSTRICTING_CHAINS_N); //anyone but the tank - Chain_Timer = 2000 + rand()%1000; - }else Chain_Timer -= diff; - - DoMeleeAttackIfReady(); - } - - void JustDied(Unit* killer) - { - DoScriptText(SAY_DEATH, m_creature); - } - - void KilledUnit(Unit *victim) - { - if (victim == m_creature) - return; - - switch(rand()%3) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature);break; - case 1: DoScriptText(SAY_SLAY_2, m_creature);break; - case 2: DoScriptText(SAY_SLAY_3, m_creature);break; - } - } -}; - -CreatureAI* GetAI_boss_meathook(Creature* pCreature) -{ - return new boss_meathookAI (pCreature); -} - -void AddSC_boss_meathook() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_meathook"; - newscript->GetAI = &GetAI_boss_meathook; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/boss_salramm.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/boss_salramm.cpp deleted file mode 100644 index 418adb82ff4..00000000000 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/boss_salramm.cpp +++ /dev/null @@ -1,155 +0,0 @@ -/* Script Data Start -SDName: Boss salramm -SDAuthor: LordVanMartin -SD%Complete: -SDComment: -SDCategory: -Script Data End */ - -/*** SQL START *** -update creature_template set scriptname = 'boss_salramm' where entry = ''; -*** SQL END ***/ -#include "precompiled.h" - -//Spells -#define SPELL_CURSE_OF_TWISTED_FLESH 58845 -#define SPELL_EXPLODE_GHOUL_N 52480 -#define SPELL_EXPLODE_GHOUL_H 58825 -#define SPELL_SHADOW_BOLT_N 57725 -#define SPELL_SHADOW_BOLT_H 58828 -#define SPELL_STEAL_FLESH 52708 -#define SPELL_SUMMON_GHOULS 52451 - -//Yell -#define SAY_AGGRO -1595032 -#define SAY_SPAWN -1595033 -#define SAY_SLAY_1 -1595034 -#define SAY_SLAY_2 -1595035 -#define SAY_SLAY_3 -1595036 -#define SAY_DEATH -1595037 -#define SAY_EXPLODE_GHOUL_1 -1595038 -#define SAY_EXPLODE_GHOUL_2 -1595039 -#define SAY_STEAL_FLESH_1 -1595040 -#define SAY_STEAL_FLESH_2 -1595041 -#define SAY_STEAL_FLESH_3 -1595042 -#define SAY_SUMMON_GHOULS_1 -1595043 -#define SAY_SUMMON_GHOULS_2 -1595044 - -struct TRINITY_DLL_DECL boss_salrammAI : public ScriptedAI -{ - boss_salrammAI(Creature *c) : ScriptedAI(c) {} - - uint32 Curse_flesh_Timer, - Explode_ghoul_Timer, - Shadow_bolt_Timer, - Steal_flesh_Timer, - Summon_ghouls_Timer; - - void Reset() - { - Curse_flesh_Timer = 30000; //30s DBM - Explode_ghoul_Timer = 25000 + rand()%3000; //approx 6 sec after summon ghouls - Shadow_bolt_Timer = 8000 + rand()%4000; // approx 10s - Steal_flesh_Timer = 12345; - Summon_ghouls_Timer = 19000 + rand()%5000; //on a video approx 24s after aggro - } - - void EnterCombat(Unit* who) - {DoScriptText(SAY_AGGRO, m_creature);} - - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - Unit* random_target = SelectUnit(SELECT_TARGET_RANDOM, 0); - - //Curse of twisted flesh timer - if (Curse_flesh_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_CURSE_OF_TWISTED_FLESH); - Curse_flesh_Timer = 37000; - }else Curse_flesh_Timer -= diff; - - //Shadow bolt timer - if (Shadow_bolt_Timer < diff) - { - if (random_target) - DoCast(random_target,SPELL_SHADOW_BOLT_N); - Shadow_bolt_Timer = 8000 + rand()%4000; - }else Shadow_bolt_Timer -= diff; - - //Steal Flesh timer - if (Steal_flesh_Timer < diff) - { - switch(rand()%3) - { - case 0: - DoScriptText(SAY_STEAL_FLESH_1, m_creature); - break; - case 1: - DoScriptText(SAY_STEAL_FLESH_2, m_creature); - break; - case 2: - DoScriptText(SAY_STEAL_FLESH_3, m_creature); - break; - } - if (random_target) - DoCast(random_target,SPELL_STEAL_FLESH); - Steal_flesh_Timer = 10000; - }else Steal_flesh_Timer -= diff; - - //Summon ghouls timer - if (Summon_ghouls_Timer < diff) - { - switch(rand()%2) - { - case 0: - DoScriptText(SAY_SUMMON_GHOULS_1, m_creature); - break; - case 1: - DoScriptText(SAY_SUMMON_GHOULS_2, m_creature); - break; - } - if (random_target) - DoCast(random_target,SPELL_SUMMON_GHOULS); - Summon_ghouls_Timer = 10000; - }else Summon_ghouls_Timer -= diff; - - DoMeleeAttackIfReady(); - } - - void JustDied(Unit* killer) - {DoScriptText(SAY_DEATH, m_creature);} - - void KilledUnit(Unit *victim) - { - if (victim == m_creature) - return; - - switch(rand()%3) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature);break; - case 1: DoScriptText(SAY_SLAY_2, m_creature);break; - case 2: DoScriptText(SAY_SLAY_3, m_creature);break; - } - } -}; - -CreatureAI* GetAI_boss_salramm(Creature* pCreature) -{ - return new boss_salrammAI (pCreature); -} - -void AddSC_boss_salramm() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_salramm"; - newscript->GetAI = &GetAI_boss_salramm; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/def_culling_of_stratholme.h b/src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/def_culling_of_stratholme.h deleted file mode 100644 index 849549e8f99..00000000000 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/def_culling_of_stratholme.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef DEF_CULLING_OF_STRATHOLME_H -#define DEF_CULLING_OF_STRATHOLME_H - -#endif diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/instance_culling_of_stratholme.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/instance_culling_of_stratholme.cpp deleted file mode 100644 index 35ee68ea991..00000000000 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/instance_culling_of_stratholme.cpp +++ /dev/null @@ -1,21 +0,0 @@ -#include "precompiled.h" -#include "def_culling_of_stratholme.h" - -struct TRINITY_DLL_DECL instance_culling_of_stratholme : public ScriptedInstance -{ - instance_culling_of_stratholme(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; -}; - -InstanceData* GetInstanceData_instance_culling_of_stratholme(Map* pMap) -{ - return new instance_culling_of_stratholme(pMap); -} - -void AddSC_instance_culling_of_stratholme() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_culling_of_stratholme"; - newscript->GetInstanceData = &GetInstanceData_instance_culling_of_stratholme; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_aeonus.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_aeonus.cpp deleted file mode 100644 index 5667f5ae0b1..00000000000 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_aeonus.cpp +++ /dev/null @@ -1,151 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Aeonus -SD%Complete: 80 -SDComment: Some spells not implemented -SDCategory: Caverns of Time, The Dark Portal -EndScriptData */ - -#include "precompiled.h" -#include "def_dark_portal.h" - -enum -{ - SAY_ENTER = -1269012, - SAY_AGGRO = -1269013, - SAY_BANISH = -1269014, - SAY_SLAY1 = -1269015, - SAY_SLAY2 = -1269016, - SAY_DEATH = -1269017, - EMOTE_FRENZY = -1269018, - - SPELL_CLEAVE = 40504, - SPELL_TIME_STOP = 31422, - SPELL_ENRAGE = 37605, - SPELL_SAND_BREATH = 31473, - H_SPELL_SAND_BREATH = 39049 -}; - -struct TRINITY_DLL_DECL boss_aeonusAI : public ScriptedAI -{ - boss_aeonusAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - ScriptedInstance *pInstance; - bool HeroicMode; - - uint32 SandBreath_Timer; - uint32 TimeStop_Timer; - uint32 Frenzy_Timer; - - void Reset() - { - SandBreath_Timer = 15000+rand()%15000; - TimeStop_Timer = 10000+rand()%5000; - Frenzy_Timer = 30000+rand()%15000; - } - - void EnterCombat(Unit *who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - - void MoveInLineOfSight(Unit *who) - { - //Despawn Time Keeper - if (who->GetTypeId() == TYPEID_UNIT && who->GetEntry() == C_TIME_KEEPER) - { - if (m_creature->IsWithinDistInMap(who,20.0f)) - { - DoScriptText(SAY_BANISH, m_creature); - m_creature->DealDamage(who, who->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - } - } - - ScriptedAI::MoveInLineOfSight(who); - } - - void JustDied(Unit *victim) - { - DoScriptText(SAY_DEATH, m_creature); - - if (pInstance) - { - pInstance->SetData(TYPE_RIFT,DONE); - pInstance->SetData(TYPE_MEDIVH,DONE);//FIXME: later should be removed - } - } - - void KilledUnit(Unit *victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; - } - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //Sand Breath - if (SandBreath_Timer < diff) - { - DoCast(m_creature->getVictim(), HeroicMode ? H_SPELL_SAND_BREATH : SPELL_SAND_BREATH); - SandBreath_Timer = 15000+rand()%10000; - }else SandBreath_Timer -= diff; - - //Time Stop - if (TimeStop_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_TIME_STOP); - TimeStop_Timer = 20000+rand()%15000; - }else TimeStop_Timer -= diff; - - //Frenzy - if (Frenzy_Timer < diff) - { - DoScriptText(EMOTE_FRENZY, m_creature); - DoCast(m_creature, SPELL_ENRAGE); - Frenzy_Timer = 20000+rand()%15000; - }else Frenzy_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_aeonus(Creature* pCreature) -{ - return new boss_aeonusAI (pCreature); -} - -void AddSC_boss_aeonus() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_aeonus"; - newscript->GetAI = &GetAI_boss_aeonus; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_chrono_lord_deja.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_chrono_lord_deja.cpp deleted file mode 100644 index 2a1d3c4fe03..00000000000 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_chrono_lord_deja.cpp +++ /dev/null @@ -1,160 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Chrono_Lord_Deja -SD%Complete: 65 -SDComment: All abilities not implemented -SDCategory: Caverns of Time, The Dark Portal -EndScriptData */ - -#include "precompiled.h" -#include "def_dark_portal.h" - -enum -{ - SAY_ENTER = -1269006, - SAY_AGGRO = -1269007, - SAY_BANISH = -1269008, - SAY_SLAY1 = -1269009, - SAY_SLAY2 = -1269010, - SAY_DEATH = -1269011, - - SPELL_ARCANE_BLAST = 31457, - H_SPELL_ARCANE_BLAST = 38538, - SPELL_ARCANE_DISCHARGE = 31472, - H_SPELL_ARCANE_DISCHARGE = 38539, - SPELL_TIME_LAPSE = 31467, - SPELL_ATTRACTION = 38540 //Not Implemented (Heroic mode) -}; - -struct TRINITY_DLL_DECL boss_chrono_lord_dejaAI : public ScriptedAI -{ - boss_chrono_lord_dejaAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - ScriptedInstance *pInstance; - bool HeroicMode; - - uint32 ArcaneBlast_Timer; - uint32 TimeLapse_Timer; - uint32 Attraction_Timer; - uint32 ArcaneDischarge_Timer; - - void Reset() - { - ArcaneBlast_Timer = 18000+rand()%5000; - TimeLapse_Timer = 10000+rand()%5000; - ArcaneDischarge_Timer = 20000+rand()%10000; - Attraction_Timer = 25000+rand()%10000; - } - - void EnterCombat(Unit *who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - - void MoveInLineOfSight(Unit *who) - { - //Despawn Time Keeper - if (who->GetTypeId() == TYPEID_UNIT && who->GetEntry() == C_TIME_KEEPER) - { - if (m_creature->IsWithinDistInMap(who,20.0f)) - { - DoScriptText(SAY_BANISH, m_creature); - m_creature->DealDamage(who, who->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - } - } - - ScriptedAI::MoveInLineOfSight(who); - } - - void KilledUnit(Unit *victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; - } - } - - void JustDied(Unit *victim) - { - DoScriptText(SAY_DEATH, m_creature); - - if (pInstance) - pInstance->SetData(TYPE_RIFT,SPECIAL); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //Arcane Blast - if (ArcaneBlast_Timer < diff) - { - DoCast(m_creature->getVictim(), HeroicMode ? H_SPELL_ARCANE_BLAST : SPELL_ARCANE_BLAST); - ArcaneBlast_Timer = 15000+rand()%10000; - }else ArcaneBlast_Timer -= diff; - - //Arcane Discharge - if (ArcaneDischarge_Timer < diff) - { - Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0); - DoCast(target,HeroicMode ? H_SPELL_ARCANE_DISCHARGE : SPELL_ARCANE_DISCHARGE); - ArcaneDischarge_Timer = 20000+rand()%10000; - }else ArcaneDischarge_Timer -= diff; - - //Time Lapse - if (TimeLapse_Timer < diff) - { - DoScriptText(SAY_BANISH, m_creature); - DoCast(m_creature, SPELL_TIME_LAPSE); - TimeLapse_Timer = 15000+rand()%10000; - }else TimeLapse_Timer -= diff; - - if (HeroicMode) - { - if (Attraction_Timer < diff) - { - DoCast(m_creature,SPELL_ATTRACTION); - Attraction_Timer = 25000+rand()%10000; - }else Attraction_Timer -= diff; - } - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_chrono_lord_deja(Creature* pCreature) -{ - return new boss_chrono_lord_dejaAI (pCreature); -} - -void AddSC_boss_chrono_lord_deja() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_chrono_lord_deja"; - newscript->GetAI = &GetAI_boss_chrono_lord_deja; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_temporus.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_temporus.cpp deleted file mode 100644 index 0d1a6eec214..00000000000 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_temporus.cpp +++ /dev/null @@ -1,158 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Temporus -SD%Complete: 75 -SDComment: More abilities need to be implemented -SDCategory: Caverns of Time, The Dark Portal -EndScriptData */ - -#include "precompiled.h" -#include "def_dark_portal.h" - -enum -{ - SAY_ENTER = -1269000, - SAY_AGGRO = -1269001, - SAY_BANISH = -1269002, - SAY_SLAY1 = -1269003, - SAY_SLAY2 = -1269004, - SAY_DEATH = -1269005, - - SPELL_HASTE = 31458, - SPELL_MORTAL_WOUND = 31464, - SPELL_WING_BUFFET = 31475, - H_SPELL_WING_BUFFET = 38593, - SPELL_REFLECT = 38592 //Not Implemented (Heroic mod) -}; - -struct TRINITY_DLL_DECL boss_temporusAI : public ScriptedAI -{ - boss_temporusAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - HeroicMode = c->GetMap()->IsHeroic(); - } - - ScriptedInstance *pInstance; - bool HeroicMode; - - uint32 Haste_Timer; - uint32 SpellReflection_Timer; - uint32 MortalWound_Timer; - uint32 WingBuffet_Timer; - - void Reset() - { - Haste_Timer = 15000+rand()%8000; - SpellReflection_Timer = 30000; - MortalWound_Timer = 8000; - WingBuffet_Timer = 25000+rand()%10000; - } - - void EnterCombat(Unit *who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - - void KilledUnit(Unit *victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; - } - } - - void JustDied(Unit *victim) - { - DoScriptText(SAY_DEATH, m_creature); - - if (pInstance) - pInstance->SetData(TYPE_RIFT,SPECIAL); - } - - void MoveInLineOfSight(Unit *who) - { - //Despawn Time Keeper - if (who->GetTypeId() == TYPEID_UNIT && who->GetEntry() == C_TIME_KEEPER) - { - if (m_creature->IsWithinDistInMap(who,20.0f)) - { - DoScriptText(SAY_BANISH, m_creature); - - m_creature->DealDamage(who, who->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - } - } - - ScriptedAI::MoveInLineOfSight(who); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //Attack Haste - if (Haste_Timer < diff) - { - DoCast(m_creature, SPELL_HASTE); - Haste_Timer = 20000+rand()%5000; - }else Haste_Timer -= diff; - - //MortalWound_Timer - if (MortalWound_Timer < diff) - { - DoCast(m_creature, SPELL_MORTAL_WOUND); - MortalWound_Timer = 10000+rand()%10000; - }else MortalWound_Timer -= diff; - - //Wing ruffet - if (WingBuffet_Timer < diff) - { - DoCast(m_creature,HeroicMode ? H_SPELL_WING_BUFFET : SPELL_WING_BUFFET); - WingBuffet_Timer = 20000+rand()%10000; - }else WingBuffet_Timer -= diff; - - if (HeroicMode) - { - if (SpellReflection_Timer < diff) - { - DoCast(m_creature,SPELL_REFLECT); - SpellReflection_Timer = 25000+rand()%10000; - }else SpellReflection_Timer -= diff; - } - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_temporus(Creature* pCreature) -{ - return new boss_temporusAI (pCreature); -} - -void AddSC_boss_temporus() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_temporus"; - newscript->GetAI = &GetAI_boss_temporus; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/dark_portal.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/dark_portal.cpp deleted file mode 100644 index b57abc8c5d6..00000000000 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/dark_portal.cpp +++ /dev/null @@ -1,409 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -/* ScriptData -SDName: Dark_Portal -SD%Complete: 30 -SDComment: Misc NPC's and mobs for instance. Most here far from complete. -SDCategory: Caverns of Time, The Dark Portal -EndScriptData */ - -/* ContentData -npc_medivh_bm -npc_time_rift -npc_saat -EndContentData */ - -#include "precompiled.h" -#include "def_dark_portal.h" - -#define SAY_ENTER -1269020 //where does this belong? -#define SAY_INTRO -1269021 -#define SAY_WEAK75 -1269022 -#define SAY_WEAK50 -1269023 -#define SAY_WEAK25 -1269024 -#define SAY_DEATH -1269025 -#define SAY_WIN -1269026 -#define SAY_ORCS_ENTER -1269027 -#define SAY_ORCS_ANSWER -1269028 - -#define SPELL_CHANNEL 31556 -#define SPELL_PORTAL_RUNE 32570 //aura(portal on ground effect) - -#define SPELL_BLACK_CRYSTAL 32563 //aura -#define SPELL_PORTAL_CRYSTAL 32564 //summon - -#define SPELL_BANISH_PURPLE 32566 //aura -#define SPELL_BANISH_GREEN 32567 //aura - -#define SPELL_CORRUPT 31326 -#define SPELL_CORRUPT_AEONUS 37853 - -#define C_COUNCIL_ENFORCER 17023 - -struct TRINITY_DLL_DECL npc_medivh_bmAI : public ScriptedAI -{ - npc_medivh_bmAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance *pInstance; - - uint32 SpellCorrupt_Timer; - uint32 Check_Timer; - - bool Life75; - bool Life50; - bool Life25; - - void Reset() - { - SpellCorrupt_Timer = 0; - - if (!pInstance) - return; - - if (pInstance->GetData(TYPE_MEDIVH) == IN_PROGRESS) - m_creature->CastSpell(m_creature,SPELL_CHANNEL,true); - else if (m_creature->HasAura(SPELL_CHANNEL)) - m_creature->RemoveAura(SPELL_CHANNEL); - - m_creature->CastSpell(m_creature,SPELL_PORTAL_RUNE,true); - } - - void MoveInLineOfSight(Unit *who) - { - if (!pInstance) - return; - - if (who->GetTypeId() == TYPEID_PLAYER && m_creature->IsWithinDistInMap(who, 10.0f)) - { - if (pInstance->GetData(TYPE_MEDIVH) == IN_PROGRESS || pInstance->GetData(TYPE_MEDIVH) == DONE) - return; - - DoScriptText(SAY_INTRO, m_creature); - pInstance->SetData(TYPE_MEDIVH,IN_PROGRESS); - m_creature->CastSpell(m_creature,SPELL_CHANNEL,false); - Check_Timer = 5000; - } - else if (who->GetTypeId() == TYPEID_UNIT && m_creature->IsWithinDistInMap(who, 15.0f)) - { - if (pInstance->GetData(TYPE_MEDIVH) != IN_PROGRESS) - return; - - uint32 entry = who->GetEntry(); - if (entry == C_ASSAS || entry == C_WHELP || entry == C_CHRON || entry == C_EXECU || entry == C_VANQU) - { - who->StopMoving(); - who->CastSpell(m_creature,SPELL_CORRUPT,false); - } - else if (entry == C_AEONUS) - { - who->StopMoving(); - who->CastSpell(m_creature,SPELL_CORRUPT_AEONUS,false); - } - } - } - - void AttackStart(Unit *who) - { - //if (pInstance && pInstance->GetData(TYPE_MEDIVH) == IN_PROGRESS) - //return; - - //ScriptedAI::AttackStart(who); - } - - void EnterCombat(Unit *who) {} - - void SpellHit(Unit* caster, const SpellEntry* spell) - { - if (SpellCorrupt_Timer) - return; - - if (spell->Id == SPELL_CORRUPT_AEONUS) - SpellCorrupt_Timer = 1000; - - if (spell->Id == SPELL_CORRUPT) - SpellCorrupt_Timer = 3000; - } - - void JustDied(Unit* Killer) - { - if (Killer->GetEntry() == m_creature->GetEntry()) - return; - - DoScriptText(SAY_DEATH, m_creature); - } - - void UpdateAI(const uint32 diff) - { - if (!pInstance) - return; - - if (SpellCorrupt_Timer) - { - if (SpellCorrupt_Timer <= diff) - { - pInstance->SetData(TYPE_MEDIVH,SPECIAL); - - if (m_creature->HasAura(SPELL_CORRUPT_AEONUS)) - SpellCorrupt_Timer = 1000; - else if (m_creature->HasAura(SPELL_CORRUPT)) - SpellCorrupt_Timer = 3000; - else - SpellCorrupt_Timer = 0; - }else SpellCorrupt_Timer -= diff; - } - - if (Check_Timer) - { - if (Check_Timer <= diff) - { - uint32 pct = pInstance->GetData(DATA_SHIELD); - - Check_Timer = 5000; - - if (Life25 && pct <= 25) - { - DoScriptText(SAY_WEAK25, m_creature); - Life25 = false; - } - else if (Life50 && pct <= 50) - { - DoScriptText(SAY_WEAK50, m_creature); - Life50 = false; - } - else if (Life75 && pct <= 75) - { - DoScriptText(SAY_WEAK75, m_creature); - Life75 = false; - } - - //if we reach this it means event was running but at some point reset. - if (pInstance->GetData(TYPE_MEDIVH) == NOT_STARTED) - { - m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - m_creature->RemoveCorpse(); - m_creature->Respawn(); - return; - } - - if (pInstance->GetData(TYPE_RIFT) == DONE) - { - DoScriptText(SAY_WIN, m_creature); - Check_Timer = 0; - - if (m_creature->HasAura(SPELL_CHANNEL)) - m_creature->RemoveAura(SPELL_CHANNEL); - - //TODO: start the post-event here - pInstance->SetData(TYPE_MEDIVH,DONE); - } - }else Check_Timer -= diff; - } - - //if (!UpdateVictim()) - //return; - - //DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_npc_medivh_bm(Creature* pCreature) -{ - return new npc_medivh_bmAI (pCreature); -} - -struct Wave -{ - uint32 PortalMob[4]; //spawns for portal waves (in order) -}; - -static Wave PortalWaves[]= -{ - {C_ASSAS, C_WHELP, C_CHRON, 0}, - {C_EXECU, C_CHRON, C_WHELP, C_ASSAS}, - {C_EXECU, C_VANQU, C_CHRON, C_ASSAS} -}; - -struct TRINITY_DLL_DECL npc_time_riftAI : public ScriptedAI -{ - npc_time_riftAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance *pInstance; - - uint32 TimeRiftWave_Timer; - uint8 mRiftWaveCount; - uint8 mPortalCount; - uint8 mWaveId; - - void Reset() - { - - TimeRiftWave_Timer = 15000; - mRiftWaveCount = 0; - - if (!pInstance) - return; - - mPortalCount = pInstance->GetData(DATA_PORTAL_COUNT); - - if (mPortalCount < 6) - mWaveId = 0; - else if (mPortalCount > 12) - mWaveId = 2; - else mWaveId = 1; - - } - void EnterCombat(Unit *who) {} - - void DoSummonAtRift(uint32 creature_entry) - { - if (!creature_entry) - return; - - if (pInstance->GetData(TYPE_MEDIVH) != IN_PROGRESS) - { - m_creature->InterruptNonMeleeSpells(true); - m_creature->RemoveAllAuras(); - return; - } - - float x,y,z; - m_creature->GetRandomPoint(m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ(),10.0f,x,y,z); - - //normalize Z-level if we can, if rift is not at ground level. - z = std::max(m_creature->GetMap()->GetHeight(x, y, MAX_HEIGHT), m_creature->GetMap()->GetWaterLevel(x, y)); - - Unit *Summon = m_creature->SummonCreature(creature_entry,x,y,z,m_creature->GetOrientation(), - TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); - - if (Summon) - { - if (Unit *temp = Unit::GetUnit(*m_creature,pInstance->GetData64(DATA_MEDIVH))) - Summon->AddThreat(temp,0.0f); - } - } - - void DoSelectSummon() - { - uint32 entry = 0; - - if ((mRiftWaveCount > 2 && mWaveId < 1) || mRiftWaveCount > 3) - mRiftWaveCount = 0; - - entry = PortalWaves[mWaveId].PortalMob[mRiftWaveCount]; - debug_log("TSCR: npc_time_rift: summoning wave Creature (Wave %u, Entry %u).",mRiftWaveCount,entry); - - ++mRiftWaveCount; - - if (entry == C_WHELP) - { - for(uint8 i = 0; i < 3; ++i) - DoSummonAtRift(entry); - }else DoSummonAtRift(entry); - } - - void UpdateAI(const uint32 diff) - { - if (!pInstance) - return; - - if (TimeRiftWave_Timer < diff) - { - DoSelectSummon(); - TimeRiftWave_Timer = 15000; - }else TimeRiftWave_Timer -= diff; - - if (m_creature->IsNonMeleeSpellCasted(false)) - return; - - debug_log("TSCR: npc_time_rift: not casting anylonger, i need to die."); - m_creature->setDeathState(JUST_DIED); - - if (pInstance->GetData(TYPE_RIFT) == IN_PROGRESS) - pInstance->SetData(TYPE_RIFT,SPECIAL); - } -}; - -CreatureAI* GetAI_npc_time_rift(Creature* pCreature) -{ - return new npc_time_riftAI (pCreature); -} - -#define SAY_SAAT_WELCOME -1269019 - -#define GOSSIP_ITEM_OBTAIN "[PH] Obtain Chrono-Beacon" -#define SPELL_CHRONO_BEACON 34975 -#define ITEM_CHRONO_BEACON 24289 - -bool GossipHello_npc_saat(Player* pPlayer, Creature* pCreature) -{ - if (pCreature->isQuestGiver()) - pPlayer->PrepareQuestMenu(pCreature->GetGUID()); - - if (pPlayer->GetQuestStatus(QUEST_OPENING_PORTAL) == QUEST_STATUS_INCOMPLETE && !pPlayer->HasItemCount(ITEM_CHRONO_BEACON,1)) - { - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT,GOSSIP_ITEM_OBTAIN,GOSSIP_SENDER_MAIN,GOSSIP_ACTION_INFO_DEF+1); - pPlayer->SEND_GOSSIP_MENU(10000, pCreature->GetGUID()); - return true; - } - else if (pPlayer->GetQuestRewardStatus(QUEST_OPENING_PORTAL) && !pPlayer->HasItemCount(ITEM_CHRONO_BEACON,1)) - { - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT,GOSSIP_ITEM_OBTAIN,GOSSIP_SENDER_MAIN,GOSSIP_ACTION_INFO_DEF+1); - pPlayer->SEND_GOSSIP_MENU(10001, pCreature->GetGUID()); - return true; - } - - pPlayer->SEND_GOSSIP_MENU(10002, pCreature->GetGUID()); - return true; -} - -bool GossipSelect_npc_saat(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) - { - pPlayer->CLOSE_GOSSIP_MENU(); - pCreature->CastSpell(pPlayer,SPELL_CHRONO_BEACON,false); - } - return true; -} - -void AddSC_dark_portal() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "npc_medivh_bm"; - newscript->GetAI = &GetAI_npc_medivh_bm; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "npc_time_rift"; - newscript->GetAI = &GetAI_npc_time_rift; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "npc_saat"; - newscript->pGossipHello = &GossipHello_npc_saat; - newscript->pGossipSelect = &GossipSelect_npc_saat; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/def_dark_portal.h b/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/def_dark_portal.h deleted file mode 100644 index 7bfd8c917d7..00000000000 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/def_dark_portal.h +++ /dev/null @@ -1,35 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 -* This program is free software licensed under GPL version 2 -* Please see the included DOCS/LICENSE.TXT for more information */ - -#ifndef DEF_DARKPORTAL_H -#define DEF_DARKPORTAL_H - -#define TYPE_MEDIVH 1 -#define TYPE_RIFT 2 - -#define DATA_MEDIVH 10 -#define DATA_PORTAL_COUNT 11 -#define DATA_SHIELD 12 - -#define WORLD_STATE_BM 2541 -#define WORLD_STATE_BM_SHIELD 2540 -#define WORLD_STATE_BM_RIFT 2784 - -#define QUEST_OPENING_PORTAL 10297 -#define QUEST_MASTER_TOUCH 9836 - -#define C_TIME_KEEPER 17918 -#define C_RKEEP 21104 -#define C_RLORD 17839 -#define C_DEJA 17879 -#define C_TEMPO 17880 -#define C_AEONUS 17881 -#define C_ASSAS 17835 -#define C_WHELP 21818 -#define C_CHRON 17892 -#define C_EXECU 18994 -#define C_VANQU 18995 - -#endif - diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/instance_dark_portal.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/instance_dark_portal.cpp deleted file mode 100644 index f406bca7113..00000000000 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/instance_dark_portal.cpp +++ /dev/null @@ -1,351 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -/* ScriptData -SDName: Instance_Dark_Portal -SD%Complete: 50 -SDComment: Quest support: 9836, 10297. Currently in progress. -SDCategory: Caverns of Time, The Dark Portal -EndScriptData */ - -#include "precompiled.h" -#include "def_dark_portal.h" - -#define MAX_ENCOUNTER 2 - -#define C_MEDIVH 15608 -#define C_TIME_RIFT 17838 - -#define SPELL_RIFT_CHANNEL 31387 - -#define RIFT_BOSS 1 - -inline uint32 RandRiftBoss() { return ((rand()%2) ? C_RKEEP : C_RLORD); } - -float PortalLocation[4][4]= -{ - {-2041.06, 7042.08, 29.99, 1.30}, - {-1968.18, 7042.11, 21.93, 2.12}, - {-1885.82, 7107.36, 22.32, 3.07}, - {-1928.11, 7175.95, 22.11, 3.44} -}; - -struct Wave -{ - uint32 PortalBoss; //protector of current portal - uint32 NextPortalTime; //time to next portal, or 0 if portal boss need to be killed -}; - -static Wave RiftWaves[]= -{ - {RIFT_BOSS, 0}, - {C_DEJA, 0}, - {RIFT_BOSS, 120000}, - {C_TEMPO, 140000}, - {RIFT_BOSS, 120000}, - {C_AEONUS, 0} -}; - -struct TRINITY_DLL_DECL instance_dark_portal : public ScriptedInstance -{ - instance_dark_portal(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; - - uint32 m_auiEncounter[MAX_ENCOUNTER]; - - uint32 mRiftPortalCount; - uint32 mShieldPercent; - uint8 mRiftWaveCount; - uint8 mRiftWaveId; - - uint32 NextPortal_Timer; - - uint64 MedivhGUID; - uint8 CurrentRiftId; - - void Initialize() - { - MedivhGUID = 0; - Clear(); - } - - void Clear() - { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - - mRiftPortalCount = 0; - mShieldPercent = 100; - mRiftWaveCount = 0; - mRiftWaveId = 0; - - CurrentRiftId = 0; - - NextPortal_Timer = 0; - } - - void InitWorldState(bool Enable = true) - { - DoUpdateWorldState(WORLD_STATE_BM,Enable ? 1 : 0); - DoUpdateWorldState(WORLD_STATE_BM_SHIELD, 100); - DoUpdateWorldState(WORLD_STATE_BM_RIFT, 0); - } - - bool IsEncounterInProgress() - { - if (GetData(TYPE_MEDIVH) == IN_PROGRESS) - return true; - - return false; - } - - void OnPlayerEnter(Player* pPlayer) - { - if (GetData(TYPE_MEDIVH) == IN_PROGRESS) - return; - - pPlayer->SendUpdateWorldState(WORLD_STATE_BM,0); - } - - void OnCreatureCreate(Creature* pCreature, bool add) - { - if (pCreature->GetEntry() == C_MEDIVH) - MedivhGUID = pCreature->GetGUID(); - } - - //what other conditions to check? - bool CanProgressEvent() - { - if (instance->GetPlayers().isEmpty()) - return false; - - return true; - } - - uint8 GetRiftWaveId() - { - switch(mRiftPortalCount) - { - case 6: - mRiftWaveId = 2; - return 1; - case 12: - mRiftWaveId = 4; - return 3; - case 18: - return 5; - default: - return mRiftWaveId; - } - } - - void SetData(uint32 type, uint32 data) - { - switch(type) - { - case TYPE_MEDIVH: - if (data == SPECIAL && m_auiEncounter[0] == IN_PROGRESS) - { - --mShieldPercent; - - DoUpdateWorldState(WORLD_STATE_BM_SHIELD, mShieldPercent); - - if (!mShieldPercent) - { - if (Creature* pMedivh = instance->GetCreature(MedivhGUID)) - { - if (pMedivh->isAlive()) - { - pMedivh->DealDamage(pMedivh, pMedivh->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - m_auiEncounter[0] = FAIL; - m_auiEncounter[1] = NOT_STARTED; - } - } - } - } - else - { - if (data == IN_PROGRESS) - { - debug_log("TSCR: Instance Dark Portal: Starting event."); - InitWorldState(); - m_auiEncounter[1] = IN_PROGRESS; - NextPortal_Timer = 15000; - } - - if (data == DONE) - { - //this may be completed further out in the post-event - debug_log("TSCR: Instance Dark Portal: Event completed."); - Map::PlayerList const& players = instance->GetPlayers(); - - if (!players.isEmpty()) - { - for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) - { - if (Player* pPlayer = itr->getSource()) - { - if (pPlayer->GetQuestStatus(QUEST_OPENING_PORTAL) == QUEST_STATUS_INCOMPLETE) - pPlayer->AreaExploredOrEventHappens(QUEST_OPENING_PORTAL); - - if (pPlayer->GetQuestStatus(QUEST_MASTER_TOUCH) == QUEST_STATUS_INCOMPLETE) - pPlayer->AreaExploredOrEventHappens(QUEST_MASTER_TOUCH); - } - } - } - } - - m_auiEncounter[0] = data; - } - break; - case TYPE_RIFT: - if (data == SPECIAL) - { - if (mRiftPortalCount < 7) - NextPortal_Timer = 5000; - } - else - m_auiEncounter[1] = data; - break; - } - } - - uint32 GetData(uint32 type) - { - switch(type) - { - case TYPE_MEDIVH: - return m_auiEncounter[0]; - case TYPE_RIFT: - return m_auiEncounter[1]; - case DATA_PORTAL_COUNT: - return mRiftPortalCount; - case DATA_SHIELD: - return mShieldPercent; - } - return 0; - } - - uint64 GetData64(uint32 data) - { - if (data == DATA_MEDIVH) - return MedivhGUID; - - return 0; - } - - Creature* SummonedPortalBoss(Creature* pSource) - { - uint32 entry = RiftWaves[GetRiftWaveId()].PortalBoss; - - if (entry == RIFT_BOSS) - entry = RandRiftBoss(); - - float x,y,z; - pSource->GetRandomPoint(pSource->GetPositionX(),pSource->GetPositionY(),pSource->GetPositionZ(),10.0f,x,y,z); - //normalize Z-level if we can, if rift is not at ground level. - z = std::max(instance->GetHeight(x, y, MAX_HEIGHT), instance->GetWaterLevel(x, y)); - - debug_log("TSCR: Instance Dark Portal: Summoning rift boss entry %u.",entry); - - Creature* pSummoned = pSource->SummonCreature(entry,x,y,z,pSource->GetOrientation(), - TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); - - if (pSummoned) - return pSummoned; - - debug_log("TSCR: Instance Dark Portal: what just happened there? No boss, no loot, no fun..."); - return NULL; - } - - void DoSpawnPortal() - { - if (Creature* pMedivh = instance->GetCreature(MedivhGUID)) - { - int tmp = rand()%(4-1); - - if (tmp >= CurrentRiftId) - tmp++; - debug_log("TSCR: Instance Dark Portal: Creating Time Rift at locationId %i (old locationId was %u).",tmp,CurrentRiftId); - - CurrentRiftId = tmp; - - Creature* pTemp = pMedivh->SummonCreature(C_TIME_RIFT, - PortalLocation[tmp][0],PortalLocation[tmp][1],PortalLocation[tmp][2],PortalLocation[tmp][3], - TEMPSUMMON_CORPSE_DESPAWN,0); - if (pTemp) - { - - pTemp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - pTemp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - - - if (Creature* pBoss = SummonedPortalBoss(pTemp)) - { - if (pBoss->GetEntry() == C_AEONUS) - { - pBoss->AddThreat(pMedivh,0.0f); - } - else - { - pBoss->AddThreat(pTemp,0.0f); - pTemp->CastSpell(pBoss,SPELL_RIFT_CHANNEL,false); - } - } - } - } - } - - void Update(uint32 diff) - { - if (m_auiEncounter[1] != IN_PROGRESS) - return; - - //add delay timer? - if (!CanProgressEvent()) - { - Clear(); - return; - } - - if (NextPortal_Timer) - { - if (NextPortal_Timer <= diff) - { - ++mRiftPortalCount; - - DoUpdateWorldState(WORLD_STATE_BM_RIFT, mRiftPortalCount); - - DoSpawnPortal(); - NextPortal_Timer = RiftWaves[GetRiftWaveId()].NextPortalTime; - }else NextPortal_Timer -= diff; - } - } -}; - -InstanceData* GetInstanceData_instance_dark_portal(Map* pMap) -{ - return new instance_dark_portal(pMap); -} - -void AddSC_instance_dark_portal() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "instance_dark_portal"; - newscript->GetInstanceData = &GetInstanceData_instance_dark_portal; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_anetheron.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_anetheron.cpp deleted file mode 100644 index 9f2971083e4..00000000000 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_anetheron.cpp +++ /dev/null @@ -1,312 +0,0 @@ - -#include "precompiled.h" -#include "def_hyjal.h" -#include "hyjal_trash.h" - -#define SPELL_CARRION_SWARM 31306 -#define SPELL_SLEEP 31298 -#define SPELL_VAMPIRIC_AURA 38196 -#define SPELL_INFERNO 31299 - -#define SAY_ONDEATH "The clock... is still... ticking." -#define SOUND_ONDEATH 10982 - -#define SAY_ONSLAY1 "Your hopes are lost!" -#define SAY_ONSLAY2 "Scream for me!" -#define SAY_ONSLAY3 "Pity, no time for a slow death!" -#define SOUND_ONSLAY1 10981 -#define SOUND_ONSLAY2 11038 -#define SOUND_ONSLAY3 11039 - -#define SAY_SWARM1 "The swarm is eager to feed!" -#define SAY_SWARM2 "Pestilence upon you!" -#define SOUND_SWARM1 10979 -#define SOUND_SWARM2 11037 - -#define SAY_SLEEP1 "You look tired..." -#define SAY_SLEEP2 "Sweet dreams..." -#define SOUND_SLEEP1 10978 -#define SOUND_SLEEP2 11545 - -#define SAY_INFERNO1 "Let fire rain from above!" -#define SAY_INFERNO2 "Earth and sky shall burn!" -#define SOUND_INFERNO1 10980 -#define SOUND_INFERNO2 11036 - -#define SAY_ONAGGRO "You are defenders of a doomed world! Flee here, and perhaps you will prolong your pathetic lives!" -#define SOUND_ONAGGRO 10977 - -struct TRINITY_DLL_DECL boss_anetheronAI : public hyjal_trashAI -{ - boss_anetheronAI(Creature *c) : hyjal_trashAI(c) - { - pInstance = c->GetInstanceData(); - pGo = false; - pos = 0; - SpellEntry *TempSpell = GET_SPELL(SPELL_SLEEP); - if (TempSpell && TempSpell->EffectImplicitTargetA[0] != 1) - { - TempSpell->EffectImplicitTargetA[0] = 1; - TempSpell->EffectImplicitTargetB[0] = 0; - } - } - - uint32 SwarmTimer; - uint32 SleepTimer; - uint32 AuraTimer; - uint32 InfernoTimer; - bool pGo; - uint32 pos; - - void Reset() - { - damageTaken = 0; - SwarmTimer = 45000; - SleepTimer = 60000; - AuraTimer = 5000; - InfernoTimer = 45000; - - if (pInstance && IsEvent) - pInstance->SetData(DATA_ANETHERONEVENT, NOT_STARTED); - } - - void EnterCombat(Unit *who) - { - if (pInstance && IsEvent) - pInstance->SetData(DATA_ANETHERONEVENT, IN_PROGRESS); - DoPlaySoundToSet(m_creature, SOUND_ONAGGRO); - m_creature->MonsterYell(SAY_ONAGGRO, LANG_UNIVERSAL, 0); - } - - void KilledUnit(Unit *victim) - { - switch(rand()%3) - { - case 0: - DoPlaySoundToSet(m_creature, SOUND_ONSLAY1); - m_creature->MonsterYell(SAY_ONSLAY1, LANG_UNIVERSAL, 0); - break; - case 1: - DoPlaySoundToSet(m_creature, SOUND_ONSLAY2); - m_creature->MonsterYell(SAY_ONSLAY2, LANG_UNIVERSAL, 0); - break; - case 2: - DoPlaySoundToSet(m_creature, SOUND_ONSLAY3); - m_creature->MonsterYell(SAY_ONSLAY3, LANG_UNIVERSAL, 0); - break; - } - } - - void WaypointReached(uint32 i) - { - pos = i; - if (i == 7 && pInstance) - { - Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_JAINAPROUDMOORE)); - if (target && target->isAlive()) - m_creature->AddThreat(target,0.0); - } - } - - void JustDied(Unit *victim) - { - hyjal_trashAI::JustDied(victim); - if (pInstance && IsEvent) - pInstance->SetData(DATA_ANETHERONEVENT, DONE); - DoPlaySoundToSet(m_creature, SOUND_ONDEATH); - m_creature->MonsterYell(SAY_ONDEATH, LANG_UNIVERSAL, 0); - } - - void UpdateAI(const uint32 diff) - { - if (IsEvent) - { - //Must update npc_escortAI - npc_escortAI::UpdateAI(diff); - if (!pGo) - { - pGo = true; - if (pInstance) - { - AddWaypoint(0, 4896.08, -1576.35, 1333.65); - AddWaypoint(1, 4898.68, -1615.02, 1329.48); - AddWaypoint(2, 4907.12, -1667.08, 1321.00); - AddWaypoint(3, 4963.18, -1699.35, 1340.51); - AddWaypoint(4, 4989.16, -1716.67, 1335.74); - AddWaypoint(5, 5026.27, -1736.89, 1323.02); - AddWaypoint(6, 5037.77, -1770.56, 1324.36); - AddWaypoint(7, 5067.23, -1789.95, 1321.17); - Start(false, true); - SetDespawnAtEnd(false); - } - } - } - - //Return since we have no target - if (!UpdateVictim()) - return; - - if (SwarmTimer < diff) - { - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM,0,100,true)) - DoCast(target,SPELL_CARRION_SWARM); - - SwarmTimer = 45000+rand()%15000; - switch(rand()%2) - { - case 0: - DoPlaySoundToSet(m_creature, SOUND_SWARM1); - m_creature->MonsterYell(SAY_SWARM1, LANG_UNIVERSAL, 0); - break; - case 1: - DoPlaySoundToSet(m_creature, SOUND_SWARM2); - m_creature->MonsterYell(SAY_SWARM2, LANG_UNIVERSAL, 0); - break; - } - }else SwarmTimer -= diff; - - if (SleepTimer < diff) - { - for(uint8 i=0;i<3; ++i) - { - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM,0,100,true)) - target->CastSpell(target,SPELL_SLEEP,true); - } - SleepTimer = 60000; - switch(rand()%2) - { - case 0: - DoPlaySoundToSet(m_creature, SOUND_SLEEP1); - m_creature->MonsterYell(SAY_SLEEP1, LANG_UNIVERSAL, 0); - break; - case 1: - DoPlaySoundToSet(m_creature, SOUND_SLEEP2); - m_creature->MonsterYell(SAY_SLEEP2, LANG_UNIVERSAL, 0); - break; - } - }else SleepTimer -= diff; - if (AuraTimer < diff) - { - DoCast(m_creature, SPELL_VAMPIRIC_AURA,true); - AuraTimer = 10000+rand()%10000; - }else AuraTimer -= diff; - if (InfernoTimer < diff) - { - DoCast(SelectTarget(SELECT_TARGET_RANDOM,0,100,true), SPELL_INFERNO); - InfernoTimer = 45000; - switch(rand()%2) - { - case 0: - DoPlaySoundToSet(m_creature, SOUND_INFERNO1); - m_creature->MonsterYell(SAY_INFERNO1, LANG_UNIVERSAL, 0); - break; - case 1: - DoPlaySoundToSet(m_creature, SOUND_INFERNO2); - m_creature->MonsterYell(SAY_INFERNO2, LANG_UNIVERSAL, 0); - break; - } - }else InfernoTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_anetheron(Creature* pCreature) -{ - return new boss_anetheronAI (pCreature); -} - -#define SPELL_IMMOLATION 31303 -#define SPELL_INFERNO_EFFECT 31302 - -struct TRINITY_DLL_DECL mob_towering_infernalAI : public ScriptedAI -{ - mob_towering_infernalAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - if (pInstance) - AnetheronGUID = pInstance->GetData64(DATA_ANETHERON); - } - - uint32 ImmolationTimer; - uint32 CheckTimer; - uint64 AnetheronGUID; - ScriptedInstance* pInstance; - - void Reset() - { - DoCast(m_creature, SPELL_INFERNO_EFFECT); - ImmolationTimer = 5000; - CheckTimer = 5000; - } - - void EnterCombat(Unit *who) - { - - } - - void KilledUnit(Unit *victim) - { - - } - - void JustDied(Unit *victim) - { - - } - - void MoveInLineOfSight(Unit *who) - { - if (m_creature->IsWithinDist(who, 50) && !m_creature->isInCombat() && m_creature->IsHostileTo(who)) - AttackStart(who); - } - - void UpdateAI(const uint32 diff) - { - if (CheckTimer < diff) - { - if (AnetheronGUID) - { - Creature* boss = Unit::GetCreature((*m_creature),AnetheronGUID); - if (!boss || (boss && boss->isDead())) - { - m_creature->setDeathState(JUST_DIED); - m_creature->RemoveCorpse(); - return; - } - } - CheckTimer = 5000; - }else CheckTimer -= diff; - - //Return since we have no target - if (!UpdateVictim()) - return; - - if (ImmolationTimer < diff) - { - DoCast(m_creature, SPELL_IMMOLATION); - ImmolationTimer = 5000; - }else ImmolationTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_towering_infernal(Creature* pCreature) -{ - return new mob_towering_infernalAI (pCreature); -} - -void AddSC_boss_anetheron() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_anetheron"; - newscript->GetAI = &GetAI_boss_anetheron; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_towering_infernal"; - newscript->GetAI = &GetAI_mob_towering_infernal; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_archimonde.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_archimonde.cpp deleted file mode 100644 index 4819a74fc0c..00000000000 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_archimonde.cpp +++ /dev/null @@ -1,640 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Archimonde -SD%Complete: 85 -SDComment: Doomfires not completely offlike due to core limitations for random moving. Tyrande and second phase not fully implemented. -SDCategory: Caverns of Time, Mount Hyjal -EndScriptData */ - -#include "precompiled.h" -#include "def_hyjal.h" -#include "SpellAuras.h" -#include "hyjal_trash.h" - -//text id -1534018 are the text used when previous events complete. Not part of this script. -#define SAY_AGGRO -1534019 -#define SAY_DOOMFIRE1 -1534020 -#define SAY_DOOMFIRE2 -1534021 -#define SAY_AIR_BURST1 -1534022 -#define SAY_AIR_BURST2 -1534023 -#define SAY_SLAY1 -1534024 -#define SAY_SLAY2 -1534025 -#define SAY_SLAY3 -1534026 -#define SAY_ENRAGE -1534027 -#define SAY_DEATH -1534028 -#define SAY_SOUL_CHARGE1 -1534029 -#define SAY_SOUL_CHARGE2 -1534030 - -#define SPELL_DENOUEMENT_WISP 32124 -#define SPELL_ANCIENT_SPARK 39349 -#define SPELL_PROTECTION_OF_ELUNE 38528 - -#define SPELL_DRAIN_WORLD_TREE 39140 -#define SPELL_DRAIN_WORLD_TREE_2 39141 - -#define SPELL_FINGER_OF_DEATH 31984 -#define SPELL_HAND_OF_DEATH 35354 -#define SPELL_AIR_BURST 32014 -#define SPELL_GRIP_OF_THE_LEGION 31972 -#define SPELL_DOOMFIRE_STRIKE 31903 //summons two creatures -#define SPELL_DOOMFIRE_SPAWN 32074 -#define SPELL_DOOMFIRE 31945 -#define SPELL_SOUL_CHARGE_YELLOW 32045 -#define SPELL_SOUL_CHARGE_GREEN 32051 -#define SPELL_SOUL_CHARGE_RED 32052 -#define SPELL_UNLEASH_SOUL_YELLOW 32054 -#define SPELL_UNLEASH_SOUL_GREEN 32057 -#define SPELL_UNLEASH_SOUL_RED 32053 -#define SPELL_FEAR 31970 - -#define CREATURE_ARCHIMONDE 17968 -#define CREATURE_DOOMFIRE 18095 -#define CREATURE_DOOMFIRE_SPIRIT 18104 -#define CREATURE_ANCIENT_WISP 17946 -#define CREATURE_CHANNEL_TARGET 22418 - -#define NORDRASSIL_X 5503.713 -#define NORDRASSIL_Y -3523.436 -#define NORDRASSIL_Z 1608.781 - -struct mob_ancient_wispAI : public ScriptedAI -{ - mob_ancient_wispAI(Creature* c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - ArchimondeGUID = 0; - } - - ScriptedInstance* pInstance; - uint64 ArchimondeGUID; - uint32 CheckTimer; - - void Reset() - { - CheckTimer = 1000; - - if (pInstance) - ArchimondeGUID = pInstance->GetData64(DATA_ARCHIMONDE); - - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - } - - void EnterCombat(Unit* who) {} - - void DamageTaken(Unit* done_by, uint32 &damage) { damage = 0; } - - void UpdateAI(const uint32 diff) - { - if (CheckTimer < diff) - { - if (Unit* Archimonde = Unit::GetUnit((*m_creature), ArchimondeGUID)) - { - if ((((Archimonde->GetHealth()*100) / Archimonde->GetMaxHealth()) < 2) || !Archimonde->isAlive()) - DoCast(m_creature, SPELL_DENOUEMENT_WISP); - else - DoCast(Archimonde, SPELL_ANCIENT_SPARK); - } - CheckTimer = 1000; - }else CheckTimer -= diff; - } -}; - -/* This script is merely a placeholder for the Doomfire that triggers Doomfire spell. It will - MoveChase the Doomfire Spirit always, until despawn (AttackStart is called upon it's spawn) */ -struct TRINITY_DLL_DECL mob_doomfireAI : public ScriptedAI -{ - mob_doomfireAI(Creature* c) : ScriptedAI(c) {} - - void Reset() { } - - void MoveInLineOfSight(Unit* who) { } - void EnterCombat(Unit* who) { } - void DamageTaken(Unit *done_by, uint32 &damage) { damage = 0; } -}; - -/* This is the script for the Doomfire Spirit Mob. This mob simply follow players or - travels in random directions if target cannot be found. */ -struct TRINITY_DLL_DECL mob_doomfire_targettingAI : public ScriptedAI -{ - mob_doomfire_targettingAI(Creature* c) : ScriptedAI(c) {} - - uint64 TargetGUID; - uint32 ChangeTargetTimer; - - void Reset() - { - TargetGUID = 0; - ChangeTargetTimer = 5000; - } - - void MoveInLineOfSight(Unit* who) - { - //will update once TargetGUID is 0. In case noone actually moves(not likely) and this is 0 - //when UpdateAI needs it, it will be forced to select randomPoint - if (!TargetGUID && who->GetTypeId() == TYPEID_PLAYER) - TargetGUID = who->GetGUID(); - } - - void EnterCombat(Unit* who) {} - - void DamageTaken(Unit *done_by, uint32 &damage) { damage = 0; } - - void UpdateAI(const uint32 diff) - { - if (ChangeTargetTimer < diff) - { - if (Unit *temp = Unit::GetUnit(*m_creature,TargetGUID)) - { - m_creature->GetMotionMaster()->MoveFollow(temp,0.0f,0.0f); - TargetGUID = 0; - } - else - { - float x,y,z = 0.0; - m_creature->GetRandomPoint(m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 40, x, y, z); - m_creature->GetMotionMaster()->MovePoint(0, x, y, z); - } - - ChangeTargetTimer = 5000; - }else ChangeTargetTimer -= diff; - } -}; - -/* Finally, Archimonde's script. His script isn't extremely complex, most are simply spells on timers. - The only complicated aspect of the battle is Finger of Death and Doomfire, with Doomfire being the - hardest bit to code. Finger of Death is simply a distance check - if no one is in melee range, then - select a random target and cast the spell on them. However, if someone IS in melee range, and this - is NOT the main tank (creature's victim), then we aggro that player and they become the new victim. - For Doomfire, we summon a mob (Doomfire Spirit) for the Doomfire mob to follow. It's spirit will - randomly select it's target to follow and then we create the random movement making it unpredictable. */ - -struct TRINITY_DLL_DECL boss_archimondeAI : public hyjal_trashAI -{ - boss_archimondeAI(Creature *c) : hyjal_trashAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - uint64 DoomfireSpiritGUID; - uint64 WorldTreeGUID; - - uint32 DrainNordrassilTimer; - uint32 FearTimer; - uint32 AirBurstTimer; - uint32 GripOfTheLegionTimer; - uint32 DoomfireTimer; - uint32 SoulChargeTimer; - uint32 SoulChargeCount; - uint32 MeleeRangeCheckTimer; - uint32 HandOfDeathTimer; - uint32 SummonWispTimer; - uint32 WispCount; - uint32 EnrageTimer; - uint32 CheckDistanceTimer; - - bool Enraged; - bool BelowTenPercent; - bool HasProtected; - bool IsChanneling; - - void Reset() - { - if (pInstance) - pInstance->SetData(DATA_ARCHIMONDEEVENT, NOT_STARTED); - - DoomfireSpiritGUID = 0; - damageTaken = 0; - WorldTreeGUID = 0; - - DrainNordrassilTimer = 0; - FearTimer = 42000; - AirBurstTimer = 30000; - GripOfTheLegionTimer = 5000 + rand()%20000; - DoomfireTimer = 20000; - SoulChargeTimer = 2000 + rand()%27000; - SoulChargeCount = 0; - MeleeRangeCheckTimer = 15000; - HandOfDeathTimer = 2000; - WispCount = 0; // When ~30 wisps are summoned, Archimonde dies - EnrageTimer = 600000; // 10 minutes - CheckDistanceTimer = 30000; // This checks if he's too close to the World Tree (75 yards from a point on the tree), if true then he will enrage - SummonWispTimer = 0; - - Enraged = false; - BelowTenPercent = false; - HasProtected = false; - IsChanneling = false; - } - - void EnterCombat(Unit *who) - { - m_creature->InterruptSpell(CURRENT_CHANNELED_SPELL); - DoScriptText(SAY_AGGRO, m_creature); - DoZoneInCombat(); - - if (pInstance) - pInstance->SetData(DATA_ARCHIMONDEEVENT, IN_PROGRESS); - } - - void KilledUnit(Unit *victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; - case 2: DoScriptText(SAY_SLAY3, m_creature); break; - } - - if (victim && (victim->GetTypeId() == TYPEID_PLAYER)) - GainSoulCharge(CAST_PLR(victim)); - } - - void GainSoulCharge(Player* victim) - { - switch(victim->getClass()) - { - case CLASS_PRIEST: - case CLASS_PALADIN: - case CLASS_WARLOCK: - victim->CastSpell(m_creature, SPELL_SOUL_CHARGE_RED, true); - break; - case CLASS_MAGE: - case CLASS_ROGUE: - case CLASS_WARRIOR: - victim->CastSpell(m_creature, SPELL_SOUL_CHARGE_YELLOW, true); - break; - case CLASS_DRUID: - case CLASS_SHAMAN: - case CLASS_HUNTER: - victim->CastSpell(m_creature, SPELL_SOUL_CHARGE_GREEN, true); - break; - } - - SoulChargeTimer = 2000 + rand()%28000; - ++SoulChargeCount; - } - - void JustDied(Unit *victim) - { - hyjal_trashAI::JustDied(victim); - DoScriptText(SAY_DEATH, m_creature); - - if (pInstance) - pInstance->SetData(DATA_ARCHIMONDEEVENT, DONE); - } - - bool CanUseFingerOfDeath() - { - // First we check if our current victim is in melee range or not. - Unit* victim = m_creature->getVictim(); - if (victim && m_creature->IsWithinDistInMap(victim, m_creature->GetAttackDistance(victim))) - return false; - - std::list& m_threatlist = m_creature->getThreatManager().getThreatList(); - if (m_threatlist.empty()) - return false; - - std::list targets; - std::list::iterator itr = m_threatlist.begin(); - for(; itr != m_threatlist.end(); ++itr) - { - Unit* pUnit = Unit::GetUnit((*m_creature), (*itr)->getUnitGuid()); - if (pUnit && pUnit->isAlive()) - targets.push_back(pUnit); - } - - if (targets.empty()) - return false; - - targets.sort(ObjectDistanceOrder(m_creature)); - Unit* target = targets.front(); - if (target) - { - if (!m_creature->IsWithinDistInMap(target, m_creature->GetAttackDistance(target))) - return true; // Cast Finger of Death - else // This target is closest, he is our new tank - m_creature->AddThreat(target, m_creature->getThreatManager().getThreat(m_creature->getVictim())); - } - - return false; - } - - void JustSummoned(Creature *summoned) - { - if (summoned->GetEntry() == CREATURE_ANCIENT_WISP) - summoned->AI()->AttackStart(m_creature); - else - { - summoned->setFaction(m_creature->getFaction()); - summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - } - - if (summoned->GetEntry() == CREATURE_DOOMFIRE_SPIRIT) - { - DoomfireSpiritGUID = summoned->GetGUID(); - } - - if (summoned->GetEntry() == CREATURE_DOOMFIRE) - { - summoned->CastSpell(summoned,SPELL_DOOMFIRE_SPAWN,false); - summoned->CastSpell(summoned,SPELL_DOOMFIRE,true,0,0,m_creature->GetGUID()); - - if (Unit *DoomfireSpirit = Unit::GetUnit(*m_creature, DoomfireSpiritGUID)) - { - summoned->GetMotionMaster()->MoveFollow(DoomfireSpirit,0.0f,0.0f); - DoomfireSpiritGUID = 0; - } - } - } - - //this is code doing close to what the summoning spell would do (spell 31903) - void SummonDoomfire(Unit* target) - { - m_creature->SummonCreature(CREATURE_DOOMFIRE_SPIRIT, - target->GetPositionX()+15.0,target->GetPositionY()+15.0,target->GetPositionZ(),0, - TEMPSUMMON_TIMED_DESPAWN, 27000); - - m_creature->SummonCreature(CREATURE_DOOMFIRE, - target->GetPositionX()-15.0,target->GetPositionY()-15.0,target->GetPositionZ(),0, - TEMPSUMMON_TIMED_DESPAWN, 27000); - } - - void UnleashSoulCharge() - { - m_creature->InterruptNonMeleeSpells(false); - - bool HasCast = false; - uint32 chargeSpell = 0; - uint32 unleashSpell = 0; - - switch(rand()%3) - { - case 0: - chargeSpell = SPELL_SOUL_CHARGE_RED; - unleashSpell = SPELL_UNLEASH_SOUL_RED; - break; - case 1: - chargeSpell = SPELL_SOUL_CHARGE_YELLOW; - unleashSpell = SPELL_UNLEASH_SOUL_YELLOW; - break; - case 2: - chargeSpell = SPELL_SOUL_CHARGE_GREEN; - unleashSpell = SPELL_UNLEASH_SOUL_GREEN; - break; - } - - if (m_creature->HasAura(chargeSpell)) - { - m_creature->RemoveAuraFromStack(chargeSpell); - DoCast(m_creature->getVictim(), unleashSpell); - HasCast = true; - SoulChargeCount--; - } - - if (HasCast) - SoulChargeTimer = 2000 + rand()%28000; - } - - void UpdateAI(const uint32 diff) - { - if (!m_creature->isInCombat()) - { - if (pInstance) - { - // Do not let the raid skip straight to Archimonde. Visible and hostile ONLY if Azagalor is finished. - if ((pInstance->GetData(DATA_AZGALOREVENT) < DONE) && ((m_creature->GetVisibility() != VISIBILITY_OFF) || (m_creature->getFaction() != 35))) - { - m_creature->SetVisibility(VISIBILITY_OFF); - m_creature->setFaction(35); - } - else if ((pInstance->GetData(DATA_AZGALOREVENT) >= DONE) && ((m_creature->GetVisibility() != VISIBILITY_ON) || (m_creature->getFaction() == 35))) - { - m_creature->setFaction(1720); - m_creature->SetVisibility(VISIBILITY_ON); - } - } - - if (DrainNordrassilTimer < diff) - { - if (!IsChanneling) - { - Creature *temp = m_creature->SummonCreature(CREATURE_CHANNEL_TARGET, NORDRASSIL_X, NORDRASSIL_Y, NORDRASSIL_Z, 0, TEMPSUMMON_TIMED_DESPAWN, 1200000); - - if (temp) - WorldTreeGUID = temp->GetGUID(); - - if (Unit *Nordrassil = Unit::GetUnit(*m_creature, WorldTreeGUID)) - { - Nordrassil->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - Nordrassil->SetDisplayId(11686); - DoCast(Nordrassil, SPELL_DRAIN_WORLD_TREE); - IsChanneling = true; - } - } - - if (Unit *Nordrassil = Unit::GetUnit(*m_creature, WorldTreeGUID)) - { - Nordrassil->CastSpell(m_creature, SPELL_DRAIN_WORLD_TREE_2, true); - DrainNordrassilTimer = 1000; - } - }else DrainNordrassilTimer -= diff; - } - - if (!UpdateVictim()) - return; - - if (((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 10) && !BelowTenPercent && !Enraged) - BelowTenPercent = true; - - if (!Enraged) - { - if (EnrageTimer < diff) - { - if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) > 10) - { - m_creature->GetMotionMaster()->Clear(false); - m_creature->GetMotionMaster()->MoveIdle(); - Enraged = true; - DoScriptText(SAY_ENRAGE, m_creature); - } - }else EnrageTimer -= diff; - - if (CheckDistanceTimer < diff) - { - // To simplify the check, we simply summon a Creature in the location and then check how far we are from the creature - Creature* Check = m_creature->SummonCreature(CREATURE_CHANNEL_TARGET, NORDRASSIL_X, NORDRASSIL_Y, NORDRASSIL_Z, 0, TEMPSUMMON_TIMED_DESPAWN, 2000); - if (Check) - { - Check->SetVisibility(VISIBILITY_OFF); - - if (m_creature->IsWithinDistInMap(Check, 75)) - { - m_creature->GetMotionMaster()->Clear(false); - m_creature->GetMotionMaster()->MoveIdle(); - Enraged = true; - DoScriptText(SAY_ENRAGE, m_creature); - } - } - CheckDistanceTimer = 5000; - }else CheckDistanceTimer -= diff; - } - - if (BelowTenPercent) - { - if (!HasProtected) - { - m_creature->GetMotionMaster()->Clear(false); - m_creature->GetMotionMaster()->MoveIdle(); - - //all members of raid must get this buff - DoCast(m_creature->getVictim(), SPELL_PROTECTION_OF_ELUNE); - HasProtected = true; - Enraged = true; - } - - if (SummonWispTimer < diff) - { - DoSpawnCreature(CREATURE_ANCIENT_WISP, rand()%40, rand()%40, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - SummonWispTimer = 1500; - ++WispCount; - }else SummonWispTimer -= diff; - - if (WispCount >= 30) - m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - } - - if (Enraged) - { - if (HandOfDeathTimer < diff) - { - DoCast(m_creature->getVictim(), SPELL_HAND_OF_DEATH); - HandOfDeathTimer = 2000; - }else HandOfDeathTimer -= diff; - return; // Don't do anything after this point. - } - - if (SoulChargeCount) - { - if (SoulChargeTimer < diff) - UnleashSoulCharge(); - else SoulChargeTimer -= diff; - } - - if (GripOfTheLegionTimer < diff) - { - DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_GRIP_OF_THE_LEGION); - GripOfTheLegionTimer = 5000 + rand()%20000; - }else GripOfTheLegionTimer -= diff; - - if (AirBurstTimer < diff) - { - if (rand()%2 == 0) - DoScriptText(SAY_AIR_BURST1, m_creature); - else - DoScriptText(SAY_AIR_BURST2, m_creature); - - DoCast(SelectUnit(SELECT_TARGET_RANDOM, 1), SPELL_AIR_BURST);//not on tank - AirBurstTimer = 25000 + rand()%15000; - }else AirBurstTimer -= diff; - - if (FearTimer < diff) - { - DoCast(m_creature->getVictim(), SPELL_FEAR); - FearTimer = 42000; - }else FearTimer -= diff; - - if (DoomfireTimer < diff) - { - if (rand()%2 == 0) - DoScriptText(SAY_DOOMFIRE1, m_creature); - else - DoScriptText(SAY_DOOMFIRE2, m_creature); - - Unit *temp = SelectUnit(SELECT_TARGET_RANDOM, 1); - if (!temp) - temp = m_creature->getVictim(); - - //replace with spell cast 31903 once implicitTarget 73 implemented - SummonDoomfire(temp); - - //supposedly three doomfire can be up at the same time - DoomfireTimer = 20000; - }else DoomfireTimer -= diff; - - if (MeleeRangeCheckTimer < diff) - { - if (CanUseFingerOfDeath()) - { - DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_FINGER_OF_DEATH); - MeleeRangeCheckTimer = 1000; - } - - MeleeRangeCheckTimer = 5000; - }else MeleeRangeCheckTimer -= diff; - - DoMeleeAttackIfReady(); - } - void WaypointReached(uint32 i){} -}; - -CreatureAI* GetAI_boss_archimonde(Creature* pCreature) -{ - return new boss_archimondeAI (pCreature); -} - -CreatureAI* GetAI_mob_doomfire(Creature* pCreature) -{ - return new mob_doomfireAI(pCreature); -} - -CreatureAI* GetAI_mob_doomfire_targetting(Creature* pCreature) -{ - return new mob_doomfire_targettingAI(pCreature); -} - -CreatureAI* GetAI_mob_ancient_wisp(Creature* pCreature) -{ - return new mob_ancient_wispAI(pCreature); -} - -void AddSC_boss_archimonde() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_archimonde"; - newscript->GetAI = &GetAI_boss_archimonde; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_doomfire"; - newscript->GetAI = &GetAI_mob_doomfire; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_doomfire_targetting"; - newscript->GetAI = &GetAI_mob_doomfire_targetting; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_ancient_wisp"; - newscript->GetAI = &GetAI_mob_ancient_wisp; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_azgalor.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_azgalor.cpp deleted file mode 100644 index c4c928359c1..00000000000 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_azgalor.cpp +++ /dev/null @@ -1,288 +0,0 @@ - -#include "precompiled.h" -#include "def_hyjal.h" -#include "hyjal_trash.h" - -#define SPELL_RAIN_OF_FIRE 31340 -#define SPELL_DOOM 31347 -#define SPELL_HOWL_OF_AZGALOR 31344 -#define SPELL_CLEAVE 31345 -#define SPELL_BERSERK 26662 - -#define SAY_ONDEATH "Your time is almost... up" -#define SOUND_ONDEATH 11002 - -#define SAY_ONSLAY1 "Reesh, hokta!" -#define SAY_ONSLAY2 "Don't fight it" -#define SAY_ONSLAY3 "No one is going to save you" -#define SOUND_ONSLAY1 11001 -#define SOUND_ONSLAY2 11048 -#define SOUND_ONSLAY3 11047 - -#define SAY_DOOM1 "Just a taste... of what awaits you" -#define SAY_DOOM2 "Suffer you despicable insect!" -#define SOUND_DOOM1 11046 -#define SOUND_DOOM2 11000 - -#define SAY_ONAGGRO "Abandon all hope! The legion has returned to finish what was begun so many years ago. This time there will be no escape!" -#define SOUND_ONAGGRO 10999 - -struct TRINITY_DLL_DECL boss_azgalorAI : public hyjal_trashAI -{ - boss_azgalorAI(Creature *c) : hyjal_trashAI(c) - { - pInstance = c->GetInstanceData(); - pGo = false; - pos = 0; - SpellEntry *TempSpell = GET_SPELL(SPELL_HOWL_OF_AZGALOR); - if (TempSpell) - TempSpell->EffectRadiusIndex[0] = 12;//100yards instead of 50000?! - } - - uint32 RainTimer; - uint32 DoomTimer; - uint32 HowlTimer; - uint32 CleaveTimer; - uint32 EnrageTimer; - bool enraged; - - bool pGo; - uint32 pos; - - void Reset() - { - damageTaken = 0; - RainTimer = 20000; - DoomTimer = 50000; - HowlTimer = 30000; - CleaveTimer = 10000; - EnrageTimer = 600000; - enraged = false; - - if (pInstance && IsEvent) - pInstance->SetData(DATA_AZGALOREVENT, NOT_STARTED); - } - - void EnterCombat(Unit *who) - { - if (pInstance && IsEvent) - pInstance->SetData(DATA_AZGALOREVENT, IN_PROGRESS); - DoPlaySoundToSet(m_creature, SOUND_ONAGGRO); - m_creature->MonsterYell(SAY_ONAGGRO, LANG_UNIVERSAL, NULL); - } - - void KilledUnit(Unit *victim) - { - switch(rand()%3) - { - case 0: - DoPlaySoundToSet(m_creature, SOUND_ONSLAY1); - m_creature->MonsterYell(SAY_ONSLAY1, LANG_UNIVERSAL, NULL); - break; - case 1: - DoPlaySoundToSet(m_creature, SOUND_ONSLAY2); - m_creature->MonsterYell(SAY_ONSLAY2, LANG_UNIVERSAL, NULL); - break; - case 2: - DoPlaySoundToSet(m_creature, SOUND_ONSLAY3); - m_creature->MonsterYell(SAY_ONSLAY3, LANG_UNIVERSAL, NULL); - break; - } - } - - void WaypointReached(uint32 i) - { - pos = i; - if (i == 7 && pInstance) - { - Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THRALL)); - if (target && target->isAlive()) - m_creature->AddThreat(target,0.0); - } - } - - void JustDied(Unit *victim) - { - hyjal_trashAI::JustDied(victim); - if (pInstance && IsEvent) - pInstance->SetData(DATA_AZGALOREVENT, DONE); - DoPlaySoundToSet(m_creature, SOUND_ONDEATH); - } - - void UpdateAI(const uint32 diff) - { - if (IsEvent) - { - //Must update npc_escortAI - npc_escortAI::UpdateAI(diff); - if (!pGo) - { - pGo = true; - if (pInstance) - { - AddWaypoint(0, 5492.91, -2404.61, 1462.63); - AddWaypoint(1, 5531.76, -2460.87, 1469.55); - AddWaypoint(2, 5554.58, -2514.66, 1476.12); - AddWaypoint(3, 5554.16, -2567.23, 1479.90); - AddWaypoint(4, 5540.67, -2625.99, 1480.89); - AddWaypoint(5, 5508.16, -2659.2, 1480.15); - AddWaypoint(6, 5489.62, -2704.05, 1482.18); - AddWaypoint(7, 5457.04, -2726.26, 1485.10); - Start(false, true); - SetDespawnAtEnd(false); - } - } - } - - //Return since we have no target - if (!UpdateVictim()) - return; - - if (RainTimer < diff) - { - DoCast(SelectTarget(SELECT_TARGET_RANDOM,0,30,true), SPELL_RAIN_OF_FIRE); - RainTimer = 20000+rand()%15000; - }else RainTimer -= diff; - - if (DoomTimer < diff) - { - DoCast(SelectTarget(SELECT_TARGET_RANDOM,1,100,true), SPELL_DOOM);//never on tank - DoomTimer = 45000+rand()%5000; - }else DoomTimer -= diff; - - if (HowlTimer < diff) - { - DoCast(m_creature, SPELL_HOWL_OF_AZGALOR); - HowlTimer = 30000; - }else HowlTimer -= diff; - - if (CleaveTimer < diff) - { - DoCast(m_creature->getVictim(), SPELL_CLEAVE); - CleaveTimer = 10000+rand()%5000; - }else CleaveTimer -= diff; - - if (EnrageTimer < diff && !enraged) - { - m_creature->InterruptNonMeleeSpells(false); - DoCast(m_creature, SPELL_BERSERK, true); - enraged = true; - EnrageTimer = 600000; - }else EnrageTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_azgalor(Creature* pCreature) -{ - return new boss_azgalorAI (pCreature); -} - -#define SPELL_THRASH 12787 -#define SPELL_CRIPPLE 31406 -#define SPELL_WARSTOMP 31408 - -struct TRINITY_DLL_DECL mob_lesser_doomguardAI : public hyjal_trashAI -{ - mob_lesser_doomguardAI(Creature *c) : hyjal_trashAI(c) - { - pInstance = c->GetInstanceData(); - if (pInstance) - AzgalorGUID = pInstance->GetData64(DATA_AZGALOR); - } - - uint32 CrippleTimer; - uint32 WarstompTimer; - uint32 CheckTimer; - uint64 AzgalorGUID; - ScriptedInstance* pInstance; - - void Reset() - { - CrippleTimer = 50000; - WarstompTimer = 10000; - DoCast(m_creature, SPELL_THRASH); - CheckTimer = 5000; - } - - void EnterCombat(Unit *who) - { - } - - void KilledUnit(Unit *victim) - { - - } - - void WaypointReached(uint32 i) - { - - } - - void MoveInLineOfSight(Unit *who) - { - if (m_creature->IsWithinDist(who, 50) && !m_creature->isInCombat() && m_creature->IsHostileTo(who)) - AttackStart(who); - } - - void JustDied(Unit *victim) - { - - } - - void UpdateAI(const uint32 diff) - { - if (CheckTimer < diff) - { - if (AzgalorGUID) - { - Creature* boss = Unit::GetCreature((*m_creature),AzgalorGUID); - if (!boss || (boss && boss->isDead())) - { - m_creature->setDeathState(JUST_DIED); - m_creature->RemoveCorpse(); - return; - } - } - CheckTimer = 5000; - }else CheckTimer -= diff; - - //Return since we have no target - if (!UpdateVictim()) - return; - - if (WarstompTimer < diff) - { - DoCast(m_creature, SPELL_WARSTOMP); - WarstompTimer = 10000+rand()%5000; - }else WarstompTimer -= diff; - - if (CrippleTimer < diff) - { - DoCast(SelectTarget(SELECT_TARGET_RANDOM,0,100,true), SPELL_CRIPPLE); - CrippleTimer = 25000+rand()%5000; - }else CrippleTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_lesser_doomguard(Creature* pCreature) -{ - return new mob_lesser_doomguardAI (pCreature); -} - -void AddSC_boss_azgalor() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_azgalor"; - newscript->GetAI = &GetAI_boss_azgalor; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_lesser_doomguard"; - newscript->GetAI = &GetAI_mob_lesser_doomguard; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_kazrogal.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_kazrogal.cpp deleted file mode 100644 index 59700ddac0a..00000000000 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_kazrogal.cpp +++ /dev/null @@ -1,197 +0,0 @@ - -#include "precompiled.h" -#include "def_hyjal.h" -#include "hyjal_trash.h" - -#define SPELL_CLEAVE 31436 -#define SPELL_WARSTOMP 31480 -#define SPELL_MARK 31447 - -#define SOUND_ONDEATH 11018 - -#define SAY_ONSLAY1 "Shaza-Kiel!" -#define SAY_ONSLAY2 "You... are nothing!" -#define SAY_ONSLAY3 "Miserable nuisance!" -#define SOUND_ONSLAY1 11017 -#define SOUND_ONSLAY2 11053 -#define SOUND_ONSLAY3 11054 - -#define SAY_MARK1 "Your death will be a painful one." -#define SAY_MARK2 "You... are marked." -#define SOUND_MARK1 11016 -#define SOUND_MARK2 11052 - -#define SAY_ONAGGRO "Cry for mercy! Your meaningless lives will soon be forfeit." -#define SOUND_ONAGGRO 11015 - -struct TRINITY_DLL_DECL boss_kazrogalAI : public hyjal_trashAI -{ - boss_kazrogalAI(Creature *c) : hyjal_trashAI(c) - { - pInstance = c->GetInstanceData(); - pGo = false; - pos = 0; - SpellEntry *TempSpell = GET_SPELL(SPELL_MARK); - if (TempSpell && TempSpell->EffectImplicitTargetA[0] != 1) - { - TempSpell->EffectImplicitTargetA[0] = 1; - TempSpell->EffectImplicitTargetB[0] = 0; - } - } - - uint32 CleaveTimer; - uint32 WarStompTimer; - uint32 MarkTimer; - uint32 MarkTimerBase; - bool pGo; - uint32 pos; - - void Reset() - { - damageTaken = 0; - CleaveTimer = 5000; - WarStompTimer = 15000; - MarkTimer = 45000; - MarkTimerBase = 45000; - - if (pInstance && IsEvent) - pInstance->SetData(DATA_KAZROGALEVENT, NOT_STARTED); - } - - void EnterCombat(Unit *who) - { - if (pInstance && IsEvent) - pInstance->SetData(DATA_KAZROGALEVENT, IN_PROGRESS); - DoPlaySoundToSet(m_creature, SOUND_ONAGGRO); - m_creature->MonsterYell(SAY_ONAGGRO, LANG_UNIVERSAL, NULL); - } - - void KilledUnit(Unit *victim) - { - switch(rand()%3) - { - case 0: - DoPlaySoundToSet(m_creature, SOUND_ONSLAY1); - m_creature->MonsterYell(SAY_ONSLAY1, LANG_UNIVERSAL, NULL); - break; - case 1: - DoPlaySoundToSet(m_creature, SOUND_ONSLAY2); - m_creature->MonsterYell(SAY_ONSLAY2, LANG_UNIVERSAL, NULL); - break; - case 2: - DoPlaySoundToSet(m_creature, SOUND_ONSLAY3); - m_creature->MonsterYell(SAY_ONSLAY3, LANG_UNIVERSAL, NULL); - break; - } - } - - void WaypointReached(uint32 i) - { - pos = i; - if (i == 7 && pInstance) - { - Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THRALL)); - if (target && target->isAlive()) - m_creature->AddThreat(target,0.0); - } - } - - void JustDied(Unit *victim) - { - hyjal_trashAI::JustDied(victim); - if (pInstance && IsEvent) - pInstance->SetData(DATA_KAZROGALEVENT, DONE); - DoPlaySoundToSet(m_creature, SOUND_ONDEATH); - } - - void UpdateAI(const uint32 diff) - { - if (IsEvent) - { - //Must update npc_escortAI - npc_escortAI::UpdateAI(diff); - if (!pGo) - { - pGo = true; - if (pInstance) - { - AddWaypoint(0, 5492.91, -2404.61, 1462.63); - AddWaypoint(1, 5531.76, -2460.87, 1469.55); - AddWaypoint(2, 5554.58, -2514.66, 1476.12); - AddWaypoint(3, 5554.16, -2567.23, 1479.90); - AddWaypoint(4, 5540.67, -2625.99, 1480.89); - AddWaypoint(5, 5508.16, -2659.2, 1480.15); - AddWaypoint(6, 5489.62, -2704.05, 1482.18); - AddWaypoint(7, 5457.04, -2726.26, 1485.10); - Start(false, true); - SetDespawnAtEnd(false); - } - } - } - - //Return since we have no target - if (!UpdateVictim()) - return; - - if (CleaveTimer < diff) - { - DoCast(m_creature, SPELL_CLEAVE); - CleaveTimer = 6000+rand()%15000; - }else CleaveTimer -= diff; - - if (WarStompTimer < diff) - { - DoCast(m_creature, SPELL_WARSTOMP); - WarStompTimer = 60000; - }else WarStompTimer -= diff; - - if (m_creature->HasAura(SPELL_MARK)) - m_creature->RemoveAurasDueToSpell(SPELL_MARK); - if (MarkTimer < diff) - { - //cast dummy, useful for bos addons - m_creature->CastCustomSpell(m_creature, SPELL_MARK, NULL, NULL, NULL, false, NULL, NULL, m_creature->GetGUID()); - - std::list t_list = m_creature->getThreatManager().getThreatList(); - for(std::list::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr) - { - Unit *target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()); - if (target && target->GetTypeId() == TYPEID_PLAYER && target->getPowerType() == POWER_MANA) - { - target->CastSpell(target, SPELL_MARK,true);//only cast on mana users - } - } - MarkTimerBase -= 5000; - if (MarkTimerBase < 5500) - MarkTimerBase = 5500; - MarkTimer = MarkTimerBase; - switch(rand()%3) - { - case 0: - DoPlaySoundToSet(m_creature, SOUND_MARK1); - m_creature->MonsterYell(SAY_MARK1, LANG_UNIVERSAL, NULL); - break; - case 1: - DoPlaySoundToSet(m_creature, SOUND_MARK2); - m_creature->MonsterYell(SAY_MARK2, LANG_UNIVERSAL, NULL); - break; - } - }else MarkTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_kazrogal(Creature* pCreature) -{ - return new boss_kazrogalAI (pCreature); -} - -void AddSC_boss_kazrogal() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_kazrogal"; - newscript->GetAI = &GetAI_boss_kazrogal; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_rage_winterchill.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_rage_winterchill.cpp deleted file mode 100644 index a7a9adf1676..00000000000 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_rage_winterchill.cpp +++ /dev/null @@ -1,192 +0,0 @@ - -#include "precompiled.h" -#include "def_hyjal.h" -#include "hyjal_trash.h" - -#define SPELL_FROST_ARMOR 31256 -#define SPELL_DEATH_AND_DECAY 31258 - -#define SPELL_FROST_NOVA 31250 -#define SPELL_ICEBOLT 31249 - -#define SAY_ONDEATH "You have won this battle, but not... the... war" -#define SOUND_ONDEATH 11026 - -#define SAY_ONSLAY1 "All life must perish!" -#define SAY_ONSLAY2 "Victory to the Legion!" -#define SOUND_ONSLAY1 11025 -#define SOUND_ONSLAY2 11057 - -#define SAY_DECAY1 "Crumble and rot!" -#define SAY_DECAY2 "Ashes to ashes, dust to dust" -#define SOUND_DECAY1 11023 -#define SOUND_DECAY2 11055 - -#define SAY_NOVA1 "Succumb to the icy chill... of death!" -#define SAY_NOVA2 "It will be much colder in your grave" -#define SOUND_NOVA1 11024 -#define SOUND_NOVA2 11058 - -#define SAY_ONAGGRO "The Legion's final conquest has begun! Once again the subjugation of this world is within our grasp. Let none survive!" -#define SOUND_ONAGGRO 11022 - -struct TRINITY_DLL_DECL boss_rage_winterchillAI : public hyjal_trashAI -{ - boss_rage_winterchillAI(Creature *c) : hyjal_trashAI(c) - { - pInstance = c->GetInstanceData(); - pGo = false; - pos = 0; - } - - uint32 FrostArmorTimer; - uint32 DecayTimer; - uint32 NovaTimer; - uint32 IceboltTimer; - bool pGo; - uint32 pos; - - void Reset() - { - damageTaken = 0; - FrostArmorTimer = 37000; - DecayTimer = 45000; - NovaTimer = 15000; - IceboltTimer = 10000; - - if (pInstance && IsEvent) - pInstance->SetData(DATA_RAGEWINTERCHILLEVENT, NOT_STARTED); - } - - void EnterCombat(Unit *who) - { - if (pInstance && IsEvent) - pInstance->SetData(DATA_RAGEWINTERCHILLEVENT, IN_PROGRESS); - DoPlaySoundToSet(m_creature, SOUND_ONAGGRO); - m_creature->MonsterYell(SAY_ONAGGRO, LANG_UNIVERSAL, 0); - } - - void KilledUnit(Unit *victim) - { - switch(rand()%2) - { - case 0: - DoPlaySoundToSet(m_creature, SOUND_ONSLAY1); - m_creature->MonsterYell(SAY_ONSLAY1, LANG_UNIVERSAL, NULL); - break; - case 1: - DoPlaySoundToSet(m_creature, SOUND_ONSLAY2); - m_creature->MonsterYell(SAY_ONSLAY2, LANG_UNIVERSAL, NULL); - break; - } - } - - void WaypointReached(uint32 i) - { - pos = i; - if (i == 7 && pInstance) - { - Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_JAINAPROUDMOORE)); - if (target && target->isAlive()) - m_creature->AddThreat(target,0.0); - } - } - - void JustDied(Unit *victim) - { - hyjal_trashAI::JustDied(victim); - if (pInstance && IsEvent) - pInstance->SetData(DATA_RAGEWINTERCHILLEVENT, DONE); - DoPlaySoundToSet(m_creature, SOUND_ONDEATH); - m_creature->MonsterYell(SAY_ONDEATH, LANG_UNIVERSAL, NULL); - } - - void UpdateAI(const uint32 diff) - { - if (IsEvent) - { - //Must update npc_escortAI - npc_escortAI::UpdateAI(diff); - if (!pGo) - { - pGo = true; - if (pInstance) - { - AddWaypoint(0, 4896.08, -1576.35, 1333.65); - AddWaypoint(1, 4898.68, -1615.02, 1329.48); - AddWaypoint(2, 4907.12, -1667.08, 1321.00); - AddWaypoint(3, 4963.18, -1699.35, 1340.51); - AddWaypoint(4, 4989.16, -1716.67, 1335.74); - AddWaypoint(5, 5026.27, -1736.89, 1323.02); - AddWaypoint(6, 5037.77, -1770.56, 1324.36); - AddWaypoint(7, 5067.23, -1789.95, 1321.17); - Start(false, true); - SetDespawnAtEnd(false); - } - } - } - - //Return since we have no target - if (!UpdateVictim()) - return; - - if (FrostArmorTimer < diff) - { - DoCast(m_creature, SPELL_FROST_ARMOR); - FrostArmorTimer = 40000+rand()%20000; - }else FrostArmorTimer -= diff; - if (DecayTimer < diff) - { - DoCast(m_creature->getVictim(), SPELL_DEATH_AND_DECAY); - DecayTimer = 60000+rand()%20000; - switch(rand()%2) - { - case 0: - DoPlaySoundToSet(m_creature, SOUND_DECAY1); - m_creature->MonsterYell(SAY_DECAY1, LANG_UNIVERSAL, NULL); - break; - case 1: - DoPlaySoundToSet(m_creature, SOUND_DECAY2); - m_creature->MonsterYell(SAY_DECAY2, LANG_UNIVERSAL, NULL); - break; - } - }else DecayTimer -= diff; - if (NovaTimer < diff) - { - DoCast(m_creature->getVictim(), SPELL_FROST_NOVA); - NovaTimer = 30000+rand()%15000; - switch(rand()%2) - { - case 0: - DoPlaySoundToSet(m_creature, SOUND_NOVA1); - m_creature->MonsterYell(SAY_NOVA1, LANG_UNIVERSAL, NULL); - break; - case 1: - DoPlaySoundToSet(m_creature, SOUND_NOVA2); - m_creature->MonsterYell(SAY_NOVA2, LANG_UNIVERSAL, NULL); - break; - } - }else NovaTimer -= diff; - if (IceboltTimer < diff) - { - DoCast(SelectTarget(SELECT_TARGET_RANDOM,0,40,true), SPELL_ICEBOLT); - IceboltTimer = 11000+rand()%20000; - }else IceboltTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_rage_winterchill(Creature* pCreature) -{ - return new boss_rage_winterchillAI (pCreature); -} - -void AddSC_boss_rage_winterchill() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_rage_winterchill"; - newscript->GetAI = &GetAI_boss_rage_winterchill; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/def_hyjal.h b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/def_hyjal.h deleted file mode 100644 index c08f28a4f3d..00000000000 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/def_hyjal.h +++ /dev/null @@ -1,38 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ - -#ifndef DEF_HYJAL_H -#define DEF_HYJAL_H - -#define ERROR_INST_DATA "TSCR: Instance data not set properly for Mount Hyjal. Encounters will be buggy" - -enum -{ - WORLD_STATE_WAVES = 2842, - WORLD_STATE_ENEMY = 2453, - WORLD_STATE_ENEMYCOUNT = 2454, - - DATA_ANETHERON = 1, - DATA_ANETHERONEVENT = 2, - DATA_ARCHIMONDE = 3, - DATA_ARCHIMONDEEVENT = 4, - DATA_AZGALOR = 5, - DATA_AZGALOREVENT = 6, - DATA_JAINAPROUDMOORE = 7, - DATA_KAZROGAL = 8, - DATA_KAZROGALEVENT = 9, - DATA_RAGEWINTERCHILL = 10, - DATA_RAGEWINTERCHILLEVENT = 11, - DATA_THRALL = 12, - DATA_TYRANDEWHISPERWIND = 13, - DATA_TRASH = 14, - DATA_RESET_TRASH_COUNT = 15, - DATA_ALLIANCE_RETREAT = 16, - DATA_HORDE_RETREAT = 17, - DATA_RAIDDAMAGE = 18, - DATA_RESET_RAIDDAMAGE = 19, - TYPE_RETREAT = 20 -}; -#endif - diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal.cpp deleted file mode 100644 index a7861e11ccc..00000000000 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal.cpp +++ /dev/null @@ -1,246 +0,0 @@ - /* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Hyjal -SD%Complete: 80 -SDComment: gossip text id's unknown -SDCategory: Caverns of Time, Mount Hyjal -EndScriptData */ - -/* ContentData -npc_jaina_proudmoore -npc_thrall -npc_tyrande_whisperwind -EndContentData */ - -#include "precompiled.h" -#include "hyjalAI.h" - -#define GOSSIP_ITEM_BEGIN_ALLY "My companions and I are with you, Lady Proudmoore." -#define GOSSIP_ITEM_ANETHERON "We are ready for whatever Archimonde might send our way, Lady Proudmoore." - -#define GOSSIP_ITEM_BEGIN_HORDE "I am with you, Thrall." -#define GOSSIP_ITEM_AZGALOR "We have nothing to fear." - -#define GOSSIP_ITEM_RETREAT "We can't keep this up. Let's retreat!" - -#define GOSSIP_ITEM_TYRANDE "Aid us in defending Nordrassil" -#define ITEM_TEAR_OF_GODDESS 24494 - - -CreatureAI* GetAI_npc_jaina_proudmoore(Creature* pCreature) -{ - hyjalAI* ai = new hyjalAI(pCreature); - - ai->Reset(); - ai->EnterEvadeMode(); - - ai->Spell[0].SpellId = SPELL_BLIZZARD; - ai->Spell[0].Cooldown = 15000 + rand()%20000; - ai->Spell[0].TargetType = TARGETTYPE_RANDOM; - - ai->Spell[1].SpellId = SPELL_PYROBLAST; - ai->Spell[1].Cooldown = 5500 + rand()%4000; - ai->Spell[1].TargetType = TARGETTYPE_RANDOM; - - ai->Spell[2].SpellId = SPELL_SUMMON_ELEMENTALS; - ai->Spell[2].Cooldown = 15000 + rand()%30000; - ai->Spell[2].TargetType = TARGETTYPE_SELF; - - return ai; -} - -bool GossipHello_npc_jaina_proudmoore(Player* pPlayer, Creature* pCreature) -{ - hyjalAI* ai = CAST_AI(hyjalAI, pCreature->AI()); - if (ai->EventBegun) - return false; - - uint32 RageEncounter = ai->GetInstanceData(DATA_RAGEWINTERCHILLEVENT); - uint32 AnetheronEncounter = ai->GetInstanceData(DATA_ANETHERONEVENT); - if (RageEncounter == NOT_STARTED) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BEGIN_ALLY, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - else if (RageEncounter == DONE && AnetheronEncounter == NOT_STARTED) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ANETHERON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - else if (RageEncounter == DONE && AnetheronEncounter == DONE) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_RETREAT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); - - if (pPlayer->isGameMaster()) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_TRAINER, "[GM] Toggle Debug Timers", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - - pPlayer->SEND_GOSSIP_MENU(907, pCreature->GetGUID()); - return true; -} - -bool GossipSelect_npc_jaina_proudmoore(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - hyjalAI* ai = CAST_AI(hyjalAI, pCreature->AI()); - switch(uiAction) - { - case GOSSIP_ACTION_INFO_DEF + 1: - ai->StartEvent(pPlayer); - break; - case GOSSIP_ACTION_INFO_DEF + 2: - ai->FirstBossDead = true; - ai->WaveCount = 9; - ai->StartEvent(pPlayer); - break; - case GOSSIP_ACTION_INFO_DEF + 3: - ai->Retreat(); - break; - case GOSSIP_ACTION_INFO_DEF: - ai->Debug = !ai->Debug; - debug_log("TSCR: HyjalAI - Debug mode has been toggled"); - break; - } - return true; -} - -CreatureAI* GetAI_npc_thrall(Creature* pCreature) -{ - hyjalAI* ai = new hyjalAI(pCreature); - - ai->Reset(); - ai->EnterEvadeMode(); - - ai->Spell[0].SpellId = SPELL_CHAIN_LIGHTNING; - ai->Spell[0].Cooldown = 3000 + rand()%5000; - ai->Spell[0].TargetType = TARGETTYPE_VICTIM; - - ai->Spell[1].SpellId = SPELL_SUMMON_DIRE_WOLF; - ai->Spell[1].Cooldown = 6000 + rand()%35000; - ai->Spell[1].TargetType = TARGETTYPE_RANDOM; - - return ai; -} - -bool GossipHello_npc_thrall(Player* pPlayer, Creature* pCreature) -{ - hyjalAI* ai = CAST_AI(hyjalAI, pCreature->AI()); - if (ai->EventBegun) - return false; - - uint32 AnetheronEvent = ai->GetInstanceData(DATA_ANETHERONEVENT); - // Only let them start the Horde phases if Anetheron is dead. - if (AnetheronEvent == DONE && ai->GetInstanceData(DATA_ALLIANCE_RETREAT)) - { - uint32 KazrogalEvent = ai->GetInstanceData(DATA_KAZROGALEVENT); - uint32 AzgalorEvent = ai->GetInstanceData(DATA_AZGALOREVENT); - if (KazrogalEvent == NOT_STARTED) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BEGIN_HORDE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - else if (KazrogalEvent == DONE && AzgalorEvent == NOT_STARTED) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_AZGALOR, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - else if (AzgalorEvent == DONE) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_RETREAT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); - } - - if (pPlayer->isGameMaster()) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_TRAINER, "[GM] Toggle Debug Timers", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - - pPlayer->SEND_GOSSIP_MENU(907, pCreature->GetGUID()); - return true; -} - -bool GossipSelect_npc_thrall(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - hyjalAI* ai = CAST_AI(hyjalAI, pCreature->AI()); - ai->DeSpawnVeins();//despawn the alliance veins - switch(uiAction) - { - case GOSSIP_ACTION_INFO_DEF + 1: - ai->StartEvent(pPlayer); - break; - case GOSSIP_ACTION_INFO_DEF + 2: - ai->FirstBossDead = true; - ai->WaveCount = 9; - ai->StartEvent(pPlayer); - break; - case GOSSIP_ACTION_INFO_DEF + 3: - ai->Retreat(); - break; - case GOSSIP_ACTION_INFO_DEF: - ai->Debug = !ai->Debug; - debug_log("TSCR: HyjalAI - Debug mode has been toggled"); - break; - } - return true; -} - -CreatureAI* GetAI_npc_tyrande_whisperwind(Creature* pCreature) -{ - hyjalAI* ai = new hyjalAI(pCreature); - ai->Reset(); - ai->EnterEvadeMode(); - return ai; -} - -bool GossipHello_npc_tyrande_whisperwind(Player* pPlayer, Creature* pCreature) -{ - hyjalAI* ai = CAST_AI(hyjalAI, pCreature->AI()); - uint32 AzgalorEvent = ai->GetInstanceData(DATA_AZGALOREVENT); - - // Only let them get item if Azgalor is dead. - if (AzgalorEvent == DONE && !pPlayer->HasItemCount(ITEM_TEAR_OF_GODDESS,1)) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_TYRANDE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - pPlayer->SEND_GOSSIP_MENU(907, pCreature->GetGUID()); - return true; -} - -bool GossipSelect_npc_tyrande_whisperwind(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - if (uiAction == GOSSIP_ACTION_INFO_DEF) - { - ItemPosCountVec dest; - uint8 msg = pPlayer->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, ITEM_TEAR_OF_GODDESS, 1); - if (msg == EQUIP_ERR_OK) - { - Item* item = pPlayer->StoreNewItem(dest, ITEM_TEAR_OF_GODDESS, true); - if (item && pPlayer) - pPlayer->SendNewItem(item,1,true,false,true); - } - pPlayer->SEND_GOSSIP_MENU(907, pCreature->GetGUID()); - hyjalAI* ai = CAST_AI(hyjalAI, pCreature->AI()); - } - return true; -} - -void AddSC_hyjal() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "npc_jaina_proudmoore"; - newscript->GetAI = &GetAI_npc_jaina_proudmoore; - newscript->pGossipHello = &GossipHello_npc_jaina_proudmoore; - newscript->pGossipSelect = &GossipSelect_npc_jaina_proudmoore; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "npc_thrall"; - newscript->GetAI = &GetAI_npc_thrall; - newscript->pGossipHello = &GossipHello_npc_thrall; - newscript->pGossipSelect = &GossipSelect_npc_thrall; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "npc_tyrande_whisperwind"; - newscript->pGossipHello = &GossipHello_npc_tyrande_whisperwind; - newscript->pGossipSelect = &GossipSelect_npc_tyrande_whisperwind; - newscript->GetAI = &GetAI_npc_tyrande_whisperwind; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.cpp deleted file mode 100644 index 726ce62b4c9..00000000000 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.cpp +++ /dev/null @@ -1,1159 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: HyjalAI -SD%Complete: 90 -SDComment: -SDCategory: Caverns of Time, Mount Hyjal -EndScriptData */ - -#include "precompiled.h" -#include "hyjalAI.h" -#include "hyjal_trash.h" -#include "MapManager.h" -#include "Language.h" -#include "Chat.h" -#include "Object.h" - -#define SPAWN_GARG_GATE 0 -#define SPAWN_WYRM_GATE 1 -#define SPAWN_NEAR_TOWER 2 -// Locations for summoning gargoyls and frost wyrms in special cases -float SpawnPointSpecial[3][3]= -{ - {5497.08, -2493.23, 1535.72}, //spawn point for the gargoyles near the horde gate - {5624.53, -2548.12, 1551.54}, //spawn point for the frost wyrm near the horde gate - {5604.41, -2811.98, 1547.77} //spawn point for the gargoyles and wyrms near the horde tower -}; - -// Locations for summoning waves in Alliance base -float AllianceBase[4][3]= -{ - {4928.48, -1526.38, 1326.83}, - {4923.54, -1514.29, 1327.98}, - {4928.41, -1510.35, 1327.99}, - {4938.35, -1521.00, 1326.69} -}; - -float JainaDummySpawn[2][4]= -{ - {5497.01, -2719.03, 1483.08, 2.90426}, - {5484.98, -2721.69, 1483.39, 6.00656} -}; - - -// Locations for summoning waves in Horde base -float HordeBase[4][3]= -{ - {5458.01, -2340.27, 1459.60}, - {5466.01, -2334.69, 1460.06}, - {5468.45, -2355.13, 1459.99}, - {5479.06, -2344.16, 1461.74} -}; - -// Lady Jaina's waypoints when retreathing -float JainaWPs[2][3]= -{ - {5078.56, -1789.79, 1320.73},//next to the small stairs - {5037.38, -1778.39, 1322.61},//center of alliance base -}; - -float InfernalPos[8][3]=//spawn points for the infernals in the horde base -{ - {5453.59, -2764.52, 1493.50}, - {5478.4, -2781.77, 1497.52}, - {5506.09, -2780.53, 1496.32}, - {5532.1, -2763.42, 1492.37}, - {5544.16, -2733.99, 1487.14}, - {5536.19, -2708.18, 1480.01}, - {5510.16, -2691.75, 1479.66}, - {5482.39, -2689.19, 1481.09} -}; - -float InfernalSPWP[26][4]=//spawn points for the infernals in the horde base used in the cleaning wave -{ - {5490.96, -2718.72, 1482.96, 0.49773}, - {5449.51, -2723.32, 1485.69, 2.69685}, - {5520.83, -2624.68, 1483.82, 1.20459}, - {5558.28, -2629.26, 1485.76, 0.37992}, - {5567.97, -2758.69, 1494.10, 5.04125}, - {5384.90, -2793.47, 1503.90, 5.55412}, - {5495.33, -2814.06, 1501.56, 1.12055}, - {5472.63, -2929.39, 1538.31, 1.95777}, - {5334.72, -2952.29, 1534.34, 0.50869}, - {5398.36, -2872.46, 1512.38, 0.76787}, - {5514.39, -2768.63, 1492.30, 1.55721}, - {5598.91, -2703.75, 1495.64, 2.56644}, - {5467.80, -2655.93, 1482.27, 0.85819}, - {5399.83, -2985.24, 1545.04, 5.92559}, - {5232.13, -2967.05, 1553.09, 5.41351}, - {5272.02, -3082.52, 1567.09, 3.40681}, - {5343.26, -3120.71, 1582.92, 3.16727}, - {5371.26, -3175.24, 1587.41, 6.10466}, - {5434.67, -3177.91, 1579.25, 2.77850}, - {5237.39, -3149.25, 1593.59, 0.83855}, - {5202.15, -3016.64, 1566.28, 3.31256}, - {5302.54, -2914.37, 1528.53, 3.37146}, - {5439.04, -2834.81, 1508.80, 2.14231}, - {5421.33, -2771.04, 1494.28, 6.06223}, - {5549.76, -2692.93, 1482.68, 2.19414}, - {5459.78, -2755.71, 1490.68, 1.05139} -}; - -float VeinPos[14][8]=//spawn points of the ancient gem veins -{ - {5184.84, -1982.59, 1382.66, 2.58079, 0, 0, 0.960944, 0.276742}, //alliance - {5107.66, -2071.16, 1368.37, 2.65148, 0, 0, 0.970124, 0.242611}, //alliance - {5040.53, -2227.65, 1403.17, 3.35049, 0, 0, 0.99455, -0.104257}, //alliance - {5187.59, -2453.12, 1455.51, 5.87943, 0, 0, 0.20051, -0.979692}, //alliance - {5429.43, -2340.65, 1465.38, 4.7681, 0, 0, 0.687138, -0.726527}, //alliance - {5463.99, -2315.95, 1470.29, 1.52045, 0, 0, 0.689084, 0.724682}, //alliance - {5624.65, -2495.09, 1510.11, 0.0124869, 0, 0, 0.00624342, 0.999981}, //alliance - {5285.41, -3348.32, 1663.01, 1.57152, 0, 0, 0.707362, 0.706852}, //horde - {5417.69, -3372.52, 1656.31, 0.361993, 0, 0, 0.18001, 0.983665}, //horde - {5315.34, -3238.32, 1622.88, 3.03627, 0, 0, 0.998614, 0.0526347}, //horde - {5303.4, -3096.44, 1596.41, 1.72073, 0, 0, 0.758081, 0.65216}, //horde - {5265.13, -3177.27, 1616.22, 0.813604, 0, 0, 0.395674, 0.918391}, //horde - {5374.3, -3420.59, 1653.43, 1.45762, 0, 0, 0.665981, 0.745969}, //horde - {5441.54, -3321.59, 1651.55, 0.258306, 0, 0, 0.128794, 0.991671} //horde -}; - -float AllianceOverrunGargPos[5][4]=//gargoyle spawn points in the alliance overrun -{ - {5279.94, -2049.68, 1311.38, 0},//garg1 - {5289.15, -2219.06, 1291.12, 0},//garg2 - {5202.07, -2136.10, 1305.07, 2.8},//garg3 - {5071.52, -2425.63, 1454.48, 5.54},//garg4 - {5120.65, -2467.92, 1463.93, 2.54}//garg5 -}; - -float AllianceFirePos[92][8]=//spawn points for the fire visuals (GO) in the alliance base -{ - {5039.9, -1796.84, 1323.88, 2.59222, 0, 0, 0.962511, 0.271243}, - {5087.2, -1795.2, 1320.68, 1.03946, 0, 0, 0.496644, 0.867954}, - {5112.68, -1806.66, 1359.93, 1.37799, 0, 0, 0.63576, 0.771887}, - {5095.61, -1793.27, 1359.78, 0.580806, 0, 0, 0.286338, 0.958129}, - {5090.43, -1784.45, 1360.44, 0.796784, 0, 0, 0.387937, 0.921686}, - {5139.25, -1783.11, 1359.39, 3.30849, 0, 0, 0.99652, -0.0833509}, - {5112.16, -1763.72, 1361.35, 5.10312, 0, 0, 0.556388, -0.830922}, - {4981.18, -1793.98, 1335.7, 3.23072, 0, 0, 0.999007, -0.0445498}, - {4996.57, -1766.75, 1341.62, 3.5331, 0, 0, 0.980902, -0.194505}, - {4983.74, -1769.25, 1345.75, 3.79228, 0, 0, 0.947541, -0.319635}, - {4996.01, -1774.43, 1330.71, 3.07364, 0, 0, 0.999423, 0.0339693}, - {5094.2, -1726.13, 1330.55, 1.56175, 0, 0, 0.703901, 0.710298}, - {5079.82, -1721.24, 1336.26, 1.18868, 0, 0, 0.559964, 0.828517}, - {5077.68, -1717.15, 1327.78, 0.0145145, 0, 0, 0.00725717, 0.999974}, - {5122.27, -1738.22, 1341.67, 0.835256, 0, 0, 0.405593, 0.914054}, - {5131.88, -1741.15, 1335.25, 2.15472, 0, 0, 0.880712, 0.473653}, - {5196.93, -1772.99, 1345.2, 0.128397, 0, 0, 0.0641544, 0.99794}, - {5225.33, -1756.06, 1344.17, 3.04223, 0, 0, 0.998766, 0.0496599}, - {5224.84, -1767.05, 1360.06, 3.19538, 0, 0, 0.999638, -0.0268922}, - {5202.05, -1763.47, 1361.68, 2.59455, 0, 0, 0.962826, 0.270122}, - {5194.74, -1766.66, 1356.94, 0.0734191, 0, 0, 0.0367013, 0.999326}, - {5159.67, -1832.97, 1344.5, 5.17457, 0, 0, 0.526356, -0.850264}, - {5096.17, -1858.73, 1332.46, 5.30021, 0, 0, 0.471939, -0.881631}, - {5110.7, -1856.59, 1342.84, 5.97564, 0, 0, 0.153167, -0.9882}, - {5109.76, -1855.3, 1332.38, 4.89572, 0, 0, 0.639411, -0.768865}, - {5068.95, -1837.37, 1328.81, 2.61569, 0, 0, 0.965628, 0.25993}, - {5064.4, -1824.77, 1329.02, 2.16409, 0, 0, 0.88292, 0.469524}, - {5059.89, -1848.79, 1329.59, 0.0709955, 0, 0, 0.0354903, 0.99937}, - {5014.37, -1851.39, 1322.56, 4.66949, 0, 0, 0.722111, -0.691777}, - {5025.1, -1848.27, 1323.39, 4.44565, 0, 0, 0.794854, -0.606801}, - {4942.63, -1890.13, 1326.59, 3.28719, 0, 0, 0.997351, -0.0727343}, - {4937.95, -1888.71, 1352.41, 3.41678, 0, 0, 0.990549, -0.13716}, - {4922.48, -1881.92, 1352.41, 5.03077, 0, 0, 0.586075, -0.810257}, - {4915.35, -1894.32, 1351.24, 6.22457, 0, 0, 0.0293048, -0.999571}, - {4922.71, -1904.84, 1352.56, 1.37866, 0, 0, 0.63602, 0.771672}, - {4932.89, -1905.49, 1352.56, 1.89702, 0, 0, 0.812549, 0.582893}, - {5011.83, -1861.05, 1345.86, 4.43777, 0, 0, 0.797239, -0.603664}, - {5011.83, -1861.05, 1363.26, 4.748, 0, 0, 0.694406, -0.719583}, - {5021.46, -1858.35, 1342.17, 4.86188, 0, 0, 0.652329, -0.757936}, - {4995.02, -1698.3, 1370.38, 6.15779, 0, 0, 0.0626579, -0.998035}, - {5119.85, -1728.9, 1336.04, 5.87112, 0, 0, 0.204579, -0.97885}, - {5214.75, -1751.02, 1342.5, 5.08965, 0, 0, 0.561972, -0.827156}, - {5075.04, -1822.43, 1328.87, 3.99951, 0, 0, 0.9094, -0.415924}, - {5057.09, -1823.32, 1350.35, 3.88169, 0, 0, 0.93231, -0.361659}, - {4984.6, -1816.99, 1329.21, 3.05308, 0, 0, 0.999021, 0.0442417}, - {4983.35, -1811.55, 1356.82, 3.33975, 0, 0, 0.995096, -0.098917}, - {4984.11, -1825.73, 1350.76, 2.26375, 0, 0, 0.905211, 0.424962}, - {4968.47, -1786.46, 1354.09, 3.07663, 0, 0, 0.999473, 0.0324733}, - {5061.82, -1751.16, 1339.07, 5.94727, 0, 0, 0.167171, -0.985928}, - {5063.75, -1763, 1351.91, 0.759707, 0, 0, 0.370784, 0.928719}, - {5078.65, -1708.26, 1353.9, 1.27022, 0, 0, 0.593264, 0.805008}, - {4983.19, -1755.96, 1331.13, 4.28221, 0, 0, 0.841733, -0.539894}, - {4972.76, -1755.3, 1332.5, 4.21938, 0, 0, 0.858276, -0.513188}, - {4961.65, -1760.82, 1351.69, 3.56515, 0, 0, 0.977659, -0.210198}, - {5086.45, -1779.83, 1321.62, 6.23157, 0, 0, 0.0258051, -0.999667}, - {5063.15, -1756.74, 1328.56, 0.886926, 0, 0, 0.42907, 0.903271}, - {5042.45, -1800.61, 1323.88, 2.50093, 0, 0, 0.949131, 0.31488}, - {5084.74, -1725.35, 1327.89, 1.65034, 0, 0, 0.734663, 0.678432}, - {4993.25, -1758.1, 1331.07, 3.49995, 0, 0, 0.98399, -0.178223}, - {5078.53, -1867.85, 1348.91, 5.85612, 0, 0, 0.211913, -0.977288}, - {5080.74, -1869.73, 1333.18, 6.18206, 0, 0, 0.0505424, -0.998722}, - {5089.55, -1894.13, 1356.08, 1.52072, 0, 0, 0.689181, 0.724589}, - {5113.24, -1899.49, 1363.77, 1.50108, 0, 0, 0.682034, 0.731321}, - {4984.18, -1907.69, 1325.62, 3.82193, 0, 0, 0.942698, -0.333646}, - {5094.14, -2432.08, 1429.38, 4.70083, 0, 0, 0.711182, -0.703007}, - {5329.89, -2113.30, 1281.06, 5.60560, 0, 0, 0.332347, -0.943157}, - {5170.87, -2148.13, 1278.32, 1.63540, 0, 0, 0.729573, 0.683903 }, - {5132.94, -1960.25, 1367.8, 3.69787, 0, 0, 0.961568, -0.274566}, - {5280.82, -2351.55, 1431.57, 4.46913, 0, 0, 0.787677, -0.616088}, - {5176.78, -2121.43, 1295.27, 3.24153, 0, 0, 0.998752, -0.04995}, - {5332.75, -2101.41, 1296.37, 5.50350, 0, 0, 0.380043, -0.924969}, - {5265.70, -2050.27, 1287.57, 0.50051, 0, 0, 0.247655, 0.968848 }, - {5194.21, -2129.89, 1274.04, 3.08053, 0, 0, 0.999534, 0.0305272}, - {5225.81, -1985.50, 1364.15, 0.37247, 0, 0, 0.185163, 0.982708 }, - {5339.46, -2204.47, 1280.45, 0.99921, 0, 0, 0.479081, 0.877771 }, - {5269.63, -2020.57, 1299.62, 3.00201, 0, 0, 0.997566, 0.0697332}, - {5111.54, -2445.70, 1435.31, 2.70983, 0, 0, 0.976788, 0.214207 }, - {5111.24, -1901.14, 1355.33, 1.61028, 0, 0, 0.720929, 0.693009 }, - {5310.42, -2207.82, 1277.46, 0.50441, 0, 0, 0.249544, 0.968363 }, - {5150.81, -2042.13, 1394.3, 2.21031, 0, 0, 0.893534, 0.448995 }, - {5224.84, -2376.61, 1366.33, 5.0621, 0, 0, 0.573311, -0.819338}, - {5105.41, -2454.86, 1446.16, 4.64584, 0, 0, 0.730239, -0.683191}, - {5309.65, -2188.28, 1266.84, 5.56631, 0, 0, 0.350811, -0.936446}, - {5281.46, -2047.82, 1287.67, 2.44909, 0, 0, 0.940652, 0.339373 }, - {5325.45, -2189.41, 1309.6, 6.23783, 0, 0, 0.0226771, -0.999743}, - {5190.96, -2142.54, 1293.03, 6.25668, 0, 0, 0.0132544, -0.999912}, - {5089.99, -2467.49, 1441.8, 0.77381, 0, 0, 0.377326, 0.92608 }, - {5195.08, -2129.01, 1285.36, 3.55727, 0, 0, 0.978480, -0.206344}, - {5353.76, -2116.28, 1299.27, 6.17894, 0, 0, 0.0521006, -0.998642}, - {5271.14, -2037.38, 1299.24, 4.07879, 0, 0, 0.892201, -0.451638}, - {5332.5 , -2181.28, 1279.95, 4.6906, 0, 0, 0.714768, -0.699362}, - {5108.2 , -2429.84, 1427.73, 4.5194, 0, 0, 0.771943, -0.635691} -}; - -float HordeFirePos[65][8]=//spawn points for the fire visuals (GO) in the horde base -{ - {5524.11, -2612.73, 1483.38, 1.96198, 0, 0, 0.831047, 0.556202}, - {5514.42, -2617.19, 1505.77, 1.82453, 0, 0, 0.790892, 0.611956}, - {5510.21, -2624.77, 1485.34, 1.71065, 0, 0, 0.754783, 0.655974}, - {5570.72, -2619.04, 1487.62, 0.728898, 0, 0, 0.356435, 0.93432}, - {5570.29, -2639.37, 1487.31, 1.49308, 0, 0, 0.679104, 0.734042}, - {5583.56, -2637.2, 1503.78, 1.46559, 0, 0, 0.668951, 0.743307}, - {5571.53, -2626.81, 1510.99, 0.362107, 0, 0, 0.180066, 0.983654}, - {5545.97, -2659.62, 1489.64, 5.07055, 0, 0, 0.569845, -0.821752}, - {5557.44, -2675.91, 1482.58, 1.70118, 0, 0, 0.751671, 0.659539}, - {5594.98, -2742.31, 1495.51, 4.5993, 0, 0, 0.74594, -0.666013}, - {5599.65, -2755.6, 1505.05, 1.66896, 0, 0, 0.740947, 0.671564}, - {5565.95, -2774.75, 1499.48, 6.22425, 0, 0, 0.0294611, -0.999566}, - {5567.1, -2769.7, 1511.17, 5.99257, 0, 0, 0.144799, -0.989461}, - {5572.84, -2774.16, 1527.06, 0.836428, 0, 0, 0.406129, 0.913816}, - {5538.32, -2805.94, 1498.87, 4.30082, 0, 0, 0.836674, -0.547701}, - {5515.66, -2801.74, 1503.53, 5.57316, 0, 0, 0.347602, -0.937642}, - {5516.76, -2827.14, 1501.15, 0.35026, 0, 0, 0.174236, 0.984704}, - {5536.13, -2813.51, 1537.21, 4.51681, 0, 0, 0.772765, -0.634692}, - {5525.05, -2825.16, 1538.53, 0.489275, 0, 0, 0.242205, 0.970225}, - {5534.42, -2815.45, 1562.84, 4.62834, 0, 0, 0.736191, -0.676774}, - {5519.64, -2831.12, 1526.46, 0.611008, 0, 0, 0.300774, 0.953696}, - {5551.04, -2827.55, 1523.5, 3.35206, 0, 0, 0.994468, -0.10504}, - {5469.22, -2802.87, 1503.5, 4.99509, 0, 0, 0.600436, -0.799673}, - {5427.8, -2737.26, 1487.12, 1.78673, 0, 0, 0.779186, 0.626793}, - {5454.1, -2709.1, 1485.92, 3.03552, 0, 0, 0.998594, 0.0530137}, - {5436.3, -2718.2, 1506.02, 2.7567, 0, 0, 0.981539, 0.191261}, - {5412.6, -2740.55, 1510.79, 2.98446, 0, 0, 0.996915, 0.0784832}, - {5406.12, -2752.48, 1521.01, 2.05769, 0, 0, 0.856705, 0.515807}, - {5445.24, -2676.35, 1521.89, 2.91378, 0, 0, 0.99352, 0.113661}, - {5481.4, -2665.08, 1482.23, 4.30001, 0, 0, 0.836895, -0.547363}, - {5443.51, -2675.44, 1487.12, 2.90986, 0, 0, 0.993295, 0.115606}, - {5391.72, -2647.3, 1528.9, 3.76987, 0, 0, 0.951063, -0.308997}, - {5421.09, -2734.12, 1521.01, 2.70567, 0, 0, 0.97634, 0.216242}, - {5405.39, -2710.33, 1533.77, 2.51324, 0, 0, 0.951052, 0.309032}, - {5423.96, -2703.76, 1516.34, 2.79206, 0, 0, 0.984767, 0.173879}, - {5444.75, -2735.23, 1486.37, 2.22657, 0, 0, 0.897155, 0.441715}, - {5570.98, -2747.91, 1495.7, 5.14433, 0, 0, 0.53915, -0.84221}, - {5567.79, -2673.9, 1484.66, 2.72529, 0, 0, 0.978415, 0.20665}, - {5600.71, -2696.8, 1500.42, 0.443704, 0, 0, 0.220036, 0.975492}, - {5600.7, -2693.04, 1515.2, 5.16003, 0, 0, 0.532522, -0.846416}, - {5627.56, -2839.66, 1510.53, 5.41527, 0, 0, 0.420463, -0.907309}, - {5622.02, -2868.71, 1516.22, 2.25482, 0, 0, 0.903303, 0.429002}, - {5586.61, -2878.97, 1510.34, 4.55604, 0, 0, 0.76017, -0.649724}, - {5583.78, -2843.71, 1509.54, 5.35715, 0, 0, 0.44665, -0.894709}, - {5580.95, -2811.3, 1513.3, 3.57587, 0, 0, 0.976518, -0.215434}, - {5542.52, -2869.31, 1523.13, 5.23304, 0, 0, 0.501275, -0.865288}, - {5557.35, -2866.36, 1518.76, 4.48299, 0, 0, 0.783388, -0.621533}, - {5380.91, -2849.36, 1512.81, 3.90962, 0, 0, 0.927168, -0.374646}, - {5395.76, -2881.41, 1521.11, 4.28426, 0, 0, 0.84118, -0.540755}, - {5374.87, -2859.63, 1528.98, 3.30252, 0, 0, 0.996765, -0.0803745}, - {5356.07, -2854.66, 1520.34, 5.83933, 0, 0, 0.220108, -0.975475}, - {5363.01, -2975.72, 1539.02, 4.13738, 0, 0, 0.87859, -0.477576}, - {5336.85, -2980.74, 1561.24, 5.11126, 0, 0, 0.553001, -0.83318}, - {5335.23, -2974.62, 1540.05, 5.04451, 0, 0, 0.580496, -0.814263}, - {5422.37, -2998.87, 1549.98, 4.51831, 0, 0, 0.772288, -0.635272}, - {5405.54, -3014.6, 1562.16, 5.86761, 0, 0, 0.206298, -0.978489}, - {5427.96, -3019.4, 1561.58, 3.53498, 0, 0, 0.980718, -0.19543}, - {5348.12, -2977.84, 1582.47, 3.94025, 0, 0, 0.921323, -0.388799}, - {5331.12, -2993.71, 1576.14, 0.0642734, 0, 0, 0.0321311, 0.999484}, - {5321.63, -2986.55, 1552.2, 5.29503, 0, 0, 0.474219, -0.880407}, - {5292.1, -2914.36, 1529.52, 2.9742, 0, 0, 0.996499, 0.083601}, - {5281.77, -2926.5, 1530.62, 1.67829, 0, 0, 0.744071, 0.6681}, - {5287.19, -2909.94, 1543.49, 3.31192, 0, 0, 0.996376, -0.0850591}, - {5534.15, -2679.35, 1483.61, 0.428685, 0, 0, 0.212705, 0.977116}, - {5545.43, -2647.82, 1483.05, 5.38848, 0, 0, 0.432578, -0.901596} -}; - -hyjalAI::hyjalAI(Creature *c) : npc_escortAI(c), Summons(m_creature) -{ - pInstance = c->GetInstanceData(); - VeinsSpawned[0] = false; - VeinsSpawned[1] = false; - for(uint8 i=0;i<14; ++i) - VeinGUID[i] = 0; - InfernalCount = 0; - TeleportTimer = 1000; - Overrun = false; - Teleported = false; - WaitForTeleport = false; - OverrunCounter = 0; - OverrunCounter2 = 0; - InfernalPoint = 0; - RespawnTimer = 10000; - DoRespawn = false; - DoHide = false; - MassTeleportTimer = 0; - DoMassTeleport = false; -} - -void hyjalAI::JustSummoned(Creature *summoned) -{ - Summons.Summon(summoned); -} - -void hyjalAI::SummonedCreatureDespawn(Creature* summoned) -{ - Summons.Despawn(summoned); -} - -void hyjalAI::Reset() -{ - IsDummy = false; - m_creature->setActive(true); - // GUIDs - PlayerGUID = 0; - BossGUID[0] = 0; - BossGUID[1] = 0; - - // Timers - NextWaveTimer = 10000; - CheckTimer = 0; - RetreatTimer = 1000; - - // Misc - WaveCount = 0; - EnemyCount = 0; - - // Set faction properly based on Creature entry - switch(m_creature->GetEntry()) - { - case JAINA: - Faction = 0; - DoCast(m_creature, SPELL_BRILLIANCE_AURA, true); - break; - - case THRALL: - Faction = 1; - break; - - case TYRANDE: - Faction = 2; - break; - } - - //Bools - EventBegun = false; - FirstBossDead = false; - SecondBossDead = false; - Summon = false; - bRetreat = false; - Debug = false; - - - //Flags - m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - - //Initialize spells - memset(Spell, 0, sizeof(Spell)); - - - - //Reset Instance Data for trash count - if (pInstance) - { - if ((!pInstance->GetData(DATA_ALLIANCE_RETREAT) && m_creature->GetEntry() == JAINA) || (pInstance->GetData(DATA_ALLIANCE_RETREAT) && m_creature->GetEntry() == THRALL)) - { - //Reset World States - pInstance->DoUpdateWorldState(WORLD_STATE_WAVES, 0); - pInstance->DoUpdateWorldState(WORLD_STATE_ENEMY, 0); - pInstance->DoUpdateWorldState(WORLD_STATE_ENEMYCOUNT, 0); - pInstance->SetData(DATA_RESET_TRASH_COUNT, 0); - } - }else error_log(ERROR_INST_DATA); - - //Visibility - DoHide = true; -} - -void hyjalAI::EnterEvadeMode() -{ - if (m_creature->GetEntry() != JAINA) - m_creature->RemoveAllAuras(); - m_creature->DeleteThreatList(); - m_creature->CombatStop(true); - m_creature->LoadCreaturesAddon(); - - if (m_creature->isAlive()) - m_creature->GetMotionMaster()->MoveTargetedHome(); - - m_creature->SetLootRecipient(NULL); -} - -void hyjalAI::EnterCombat(Unit *who) -{ - if (IsDummy)return; - for(uint8 i = 0; i < 3; ++i) - if (Spell[i].Cooldown) - SpellTimer[i] = Spell[i].Cooldown; - - Talk(ATTACKED); -} - -void hyjalAI::MoveInLineOfSight(Unit *who) -{ - if (IsDummy) - return; - - npc_escortAI::MoveInLineOfSight(who); -} - -void hyjalAI::SummonCreature(uint32 entry, float Base[4][3]) -{ - uint32 random = rand()%4; - float SpawnLoc[3]; - - for(uint8 i = 0; i < 3; ++i) - { - SpawnLoc[i] = Base[random][i]; - } - Creature* pCreature = NULL; - switch(entry) - { - case 17906: //GARGOYLE - - if (!FirstBossDead && (WaveCount == 1 || WaveCount == 3)) - {//summon at tower - pCreature = m_creature->SummonCreature(entry, SpawnPointSpecial[SPAWN_NEAR_TOWER][0]+irand(-20,20), SpawnPointSpecial[SPAWN_NEAR_TOWER][1]+irand(-20,20), SpawnPointSpecial[SPAWN_NEAR_TOWER][2]+irand(-10,10), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000); - if (pCreature) - CAST_AI(hyjal_trashAI, pCreature->AI())->useFlyPath = true; - }else{//summon at gate - pCreature = m_creature->SummonCreature(entry, SpawnPointSpecial[SPAWN_GARG_GATE][0]+irand(-10,10), SpawnPointSpecial[SPAWN_GARG_GATE][1]+irand(-10,10), SpawnPointSpecial[SPAWN_GARG_GATE][2]+irand(-10,10), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000); - } - break; - case 17907: //FROST_WYRM , - if (FirstBossDead && WaveCount == 1) - {//summon at gate - pCreature = m_creature->SummonCreature(entry, SpawnPointSpecial[SPAWN_WYRM_GATE][0],SpawnPointSpecial[SPAWN_WYRM_GATE][1],SpawnPointSpecial[SPAWN_WYRM_GATE][2], 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000); - }else{ - pCreature = m_creature->SummonCreature(entry, SpawnPointSpecial[SPAWN_NEAR_TOWER][0], SpawnPointSpecial[SPAWN_NEAR_TOWER][1],SpawnPointSpecial[SPAWN_NEAR_TOWER][2], 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000); - if (pCreature) - CAST_AI(hyjal_trashAI, pCreature->AI())->useFlyPath = true; - } - break; - case 17908: //GIANT_INFERNAL - InfernalCount++; - if (InfernalCount > 7)InfernalCount = 0; - pCreature = m_creature->SummonCreature(entry, InfernalPos[InfernalCount][0], InfernalPos[InfernalCount][1], InfernalPos[InfernalCount][2], 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000); - break; - default: - pCreature = m_creature->SummonCreature(entry, SpawnLoc[0], SpawnLoc[1], SpawnLoc[2], 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000); - break; - - } - - if (pCreature) - { - // Increment Enemy Count to be used in World States and instance script - ++EnemyCount; - - pCreature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - pCreature->setActive(true); - switch(entry) - { - case NECROMANCER: - case ABOMINATION: - case GHOUL: - case BANSHEE: - case CRYPT_FIEND: - case GARGOYLE: - case FROST_WYRM: - case GIANT_INFERNAL: - case FEL_STALKER: - case RAGE_WINTERCHILL: - case ANETHERON: - case KAZROGAL: - case AZGALOR: - CAST_AI(hyjal_trashAI, pCreature->AI())->IsEvent = true; - break; - } - if (pInstance) - { - if (pInstance->GetData(DATA_RAIDDAMAGE) < MINRAIDDAMAGE) - pCreature->SetDisableReputationGain(true);//no repu for solo farming - } - // Check if Creature is a boss. - if (pCreature->isWorldBoss()) - { - if (!FirstBossDead) BossGUID[0] = pCreature->GetGUID(); - else BossGUID[1] = pCreature->GetGUID(); - CheckTimer = 5000; - } - } -} - -void hyjalAI::SummonNextWave(Wave wave[18], uint32 Count, float Base[4][3]) -{ - // 1 in 4 chance we give a rally yell. Not sure if the chance is offilike. - if (rand()%4 == 0) - Talk(RALLY); - - if (!pInstance) - { - error_log(ERROR_INST_DATA); - return; - } - InfernalCount = 0;//reset infernal count every new wave - - EnemyCount = pInstance->GetData(DATA_TRASH); - for(uint8 i = 0; i < 18; ++i) - { - if (wave[Count].Mob[i]) - SummonCreature(wave[Count].Mob[i], Base); - } - - if (!wave[Count].IsBoss) - { - uint32 stateValue = Count+1; - if (FirstBossDead) - stateValue -= 9; // Subtract 9 from it to give the proper wave number if we are greater than 8 - - // Set world state to our current wave number - pInstance->DoUpdateWorldState(WORLD_STATE_WAVES, stateValue); // Set world state to our current wave number - // Enable world state - pInstance->DoUpdateWorldState(WORLD_STATE_ENEMY, 1); // Enable world state - - pInstance->SetData(DATA_TRASH, EnemyCount); // Send data for instance script to update count - - if (!Debug) - NextWaveTimer = wave[Count].WaveTimer; - else - { - NextWaveTimer = 15000; - debug_log("TSCR: HyjalAI: debug mode is enabled. Next Wave in 15 seconds"); - } - } - else - { - // Set world state for waves to 0 to disable it. - pInstance->DoUpdateWorldState(WORLD_STATE_WAVES, 0); - pInstance->DoUpdateWorldState(WORLD_STATE_ENEMY, 1); - - // Set World State for enemies invading to 1. - pInstance->DoUpdateWorldState(WORLD_STATE_ENEMYCOUNT, 1); - - Summon = false; - } - CheckTimer = 5000; -} - -void hyjalAI::StartEvent(Player* pPlayer) -{ - if (!pPlayer || IsDummy || !pInstance) - return; - - Talk(BEGIN); - - EventBegun = true; - Summon = true; - - NextWaveTimer = 15000; - CheckTimer = 5000; - PlayerGUID = pPlayer->GetGUID(); - - m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - - pInstance->DoUpdateWorldState(WORLD_STATE_WAVES, 0); - pInstance->DoUpdateWorldState(WORLD_STATE_ENEMY, 0); - pInstance->DoUpdateWorldState(WORLD_STATE_ENEMYCOUNT, 0); - - DeSpawnVeins(); -} - -uint32 hyjalAI::GetInstanceData(uint32 Event) -{ - if (pInstance) - return pInstance->GetData(Event); - else error_log(ERROR_INST_DATA); - - return 0; -} - -void hyjalAI::Talk(uint32 id) -{ - std::list index; - for(uint8 i = 0; i < 9; ++i) - { - if (Faction == 0) // Alliance - { - if (JainaQuotes[i].id == id) - index.push_back(i); - } - else if (Faction == 1) // Horde - { - if (ThrallQuotes[i].id == id) - index.push_back(i); - } - } - - if (index.empty()) - return; // No quotes found, no use to continue - - uint8 ind = *(index.begin()) + rand()%index.size(); - - int32 YellId = 0; - if (Faction == 0) // Alliance - { - YellId = JainaQuotes[ind].textid; - } - else if (Faction == 1) // Horde - { - YellId = ThrallQuotes[ind].textid; - } - - if (YellId) - DoScriptText(YellId, m_creature); -} - -void hyjalAI::Retreat() -{ - if (pInstance) - { - pInstance->SetData(TYPE_RETREAT,SPECIAL); - - if (Faction == 0) - { - pInstance->SetData(DATA_ALLIANCE_RETREAT, 1); - AddWaypoint(0,JainaWPs[0][0],JainaWPs[0][1],JainaWPs[0][2]); - AddWaypoint(1,JainaWPs[1][0],JainaWPs[1][1],JainaWPs[1][2]); - Start(false, false); - SetDespawnAtEnd(false);//move to center of alliance base - } - if (Faction == 1) - { - pInstance->SetData(DATA_HORDE_RETREAT, 1); - Creature* JainaDummy = m_creature->SummonCreature(JAINA,JainaDummySpawn[0][0],JainaDummySpawn[0][1],JainaDummySpawn[0][2],JainaDummySpawn[0][3],TEMPSUMMON_TIMED_DESPAWN,60000); - if (JainaDummy) - { - JainaDummy->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - CAST_AI(hyjalAI, JainaDummy->AI())->IsDummy = true; - DummyGuid = JainaDummy->GetGUID(); - } - AddWaypoint(0,JainaDummySpawn[1][0],JainaDummySpawn[1][1],JainaDummySpawn[1][2]); - Start(false, false); - SetDespawnAtEnd(false);//move to center of alliance base - } - } - SpawnVeins(); - Overrun = true; - m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);//cant talk after overrun event started -} - -void hyjalAI::SpawnVeins() -{ - if (Faction == 0) - { - if (VeinsSpawned[0])//prevent any buggers - return; - for (uint8 i = 0; i<7; ++i) - { - GameObject* gem = m_creature->SummonGameObject(ANCIENT_VEIN,VeinPos[i][0],VeinPos[i][1],VeinPos[i][2],VeinPos[i][3],VeinPos[i][4],VeinPos[i][5],VeinPos[i][6],VeinPos[i][7],0); - if (gem) - VeinGUID[i]=gem->GetGUID(); - } - VeinsSpawned[0] = true; - }else{ - if (VeinsSpawned[1]) - return; - for (uint8 i = 7; i<14; ++i) - { - GameObject* gem = m_creature->SummonGameObject(ANCIENT_VEIN,VeinPos[i][0],VeinPos[i][1],VeinPos[i][2],VeinPos[i][3],VeinPos[i][4],VeinPos[i][5],VeinPos[i][6],VeinPos[i][7],0); - if (gem) - VeinGUID[i]=gem->GetGUID(); - } - VeinsSpawned[1] = true; - } -} - -void hyjalAI::DeSpawnVeins() -{ - if (!pInstance)return; - if (Faction == 1) - { - Creature* pUnit=Unit::GetCreature((*m_creature),pInstance->GetData64(DATA_JAINAPROUDMOORE)); - if (!pUnit)return; - hyjalAI* ai = CAST_AI(hyjalAI, pUnit->AI()); - if (!ai)return; - for (uint8 i = 0; i<7; ++i) - { - if (GameObject* gem = pInstance->instance->GetGameObject(pInstance->GetData64(ai->VeinGUID[i]))) - gem->Delete(); - } - }else if (Faction) - { - Creature* pUnit=Unit::GetCreature((*m_creature),pInstance->GetData64(DATA_THRALL)); - if (!pUnit)return; - hyjalAI* ai = CAST_AI(hyjalAI, pUnit->AI()); - if (!ai)return; - for (uint8 i = 7; i<14; ++i) - { - if (GameObject* gem = pInstance->instance->GetGameObject(pInstance->GetData64(ai->VeinGUID[i]))) - gem->Delete(); - } - } -} - -void hyjalAI::UpdateAI(const uint32 diff) -{ - if (IsDummy) - { - if (MassTeleportTimer < diff && DoMassTeleport) - { - m_creature->CastSpell(m_creature,SPELL_MASS_TELEPORT,false); - DoMassTeleport = false; - }else MassTeleportTimer -= diff; - return; - } - if (DoHide) - { - DoHide = false; - switch(m_creature->GetEntry()) - { - case JAINA: - if (pInstance->GetData(DATA_ALLIANCE_RETREAT)) - { - m_creature->SetVisibility(VISIBILITY_OFF); - HideNearPos(m_creature->GetPositionX(), m_creature->GetPositionY()); - HideNearPos(5037.76, -1889.71); - for(uint8 i = 0; i < 92; ++i)//summon fires - m_creature->SummonGameObject(FLAMEOBJECT,AllianceFirePos[i][0],AllianceFirePos[i][1],AllianceFirePos[i][2],AllianceFirePos[i][3],AllianceFirePos[i][4],AllianceFirePos[i][5],AllianceFirePos[i][6],AllianceFirePos[i][7],0); - - } - else m_creature->SetVisibility(VISIBILITY_ON); - break; - case THRALL: //thrall - if (pInstance->GetData(DATA_HORDE_RETREAT)) - { - m_creature->SetVisibility(VISIBILITY_OFF); - HideNearPos(m_creature->GetPositionX(), m_creature->GetPositionY()); - HideNearPos(5563, -2763.19); - HideNearPos(5542.2, -2629.36); - for(uint8 i = 0; i < 65; ++i)//summon fires - m_creature->SummonGameObject(FLAMEOBJECT,HordeFirePos[i][0],HordeFirePos[i][1],HordeFirePos[i][2],HordeFirePos[i][3],HordeFirePos[i][4],HordeFirePos[i][5],HordeFirePos[i][6],HordeFirePos[i][7],0); - - } - else m_creature->SetVisibility(VISIBILITY_ON); - break; - } - } - if (DoRespawn) - { - if (RespawnTimer < diff) - { - DoRespawn = false; - RespawnNearPos(m_creature->GetPositionX(), m_creature->GetPositionY()); - if (Faction == 0) - { - RespawnNearPos(5037.76, -1889.71); - }else if (Faction == 1) - { - RespawnNearPos(5563, -2763.19); - RespawnNearPos(5542.2, -2629.36); - } - m_creature->SetVisibility(VISIBILITY_ON); - }else{ - RespawnTimer -= diff; - m_creature->SetVisibility(VISIBILITY_OFF); - } - return; - } - if (Overrun) - DoOverrun(Faction, diff); - if (bRetreat) - { - if (RetreatTimer < diff) - { - IsDummy = true; - bRetreat = false; - HideNearPos(m_creature->GetPositionX(), m_creature->GetPositionY()); - switch(m_creature->GetEntry()) - { - case JAINA://jaina - HideNearPos(5037.76, -1889.71); - break; - case THRALL://thrall - HideNearPos(5563, -2763.19); - HideNearPos(5542.2, -2629.36); - HideNearPos(5603.75, -2853.12); - break; - } - m_creature->SetVisibility(VISIBILITY_OFF); - }else RetreatTimer -= diff; - } - - if (!EventBegun) - return; - - if (Summon) - { - if (pInstance && EnemyCount) - { - EnemyCount = pInstance->GetData(DATA_TRASH); - if (!EnemyCount) - NextWaveTimer = 5000; - } - - if (NextWaveTimer < diff) - { - if (Faction == 0) - SummonNextWave(AllianceWaves, WaveCount, AllianceBase); - else if (Faction == 1) - SummonNextWave(HordeWaves, WaveCount, HordeBase); - ++WaveCount; - }else NextWaveTimer -= diff; - } - - if (CheckTimer < diff) - { - for(uint8 i = 0; i < 2; ++i) - { - if (BossGUID[i]) - { - Unit* pUnit = Unit::GetUnit((*m_creature), BossGUID[i]); - if (pUnit && (!pUnit->isAlive())) - { - if (BossGUID[i] == BossGUID[0]) - { - Talk(INCOMING); - FirstBossDead = true; - } - else if (BossGUID[i] == BossGUID[1]) - { - Talk(SUCCESS); - SecondBossDead = true; - } - EventBegun = false; - CheckTimer = 0; - m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - BossGUID[i] = 0; - pInstance->DoUpdateWorldState(WORLD_STATE_ENEMY, 0); // Reset world state for enemies to disable it - } - } - } - CheckTimer = 5000; - }else CheckTimer -= diff; - - if (!UpdateVictim()) - return; - - for(uint8 i = 0; i < 3; ++i) - { - if (Spell[i].SpellId) - { - if (SpellTimer[i] < diff) - { - if (m_creature->IsNonMeleeSpellCasted(false)) - m_creature->InterruptNonMeleeSpells(false); - - Unit* target = NULL; - - switch(Spell[i].TargetType) - { - case TARGETTYPE_SELF: target = m_creature; break; - case TARGETTYPE_RANDOM: target = SelectUnit(SELECT_TARGET_RANDOM, 0); break; - case TARGETTYPE_VICTIM: target = m_creature->getVictim(); break; - } - - if (target && target->isAlive()) - { - DoCast(target, Spell[i].SpellId); - SpellTimer[i] = Spell[i].Cooldown; - } - }else SpellTimer[i] -= diff; - } - } - - DoMeleeAttackIfReady(); -} -void hyjalAI::JustDied(Unit* killer) -{ - if (IsDummy)return; - m_creature->Respawn(); - m_creature->SetVisibility(VISIBILITY_OFF); - DoRespawn = true; - RespawnTimer = 120000; - Talk(DEATH); - Summons.DespawnAll();//despawn all wave's summons - if (pInstance) - {//reset encounter if boss is despawned (ex: thrall is killed, boss despawns, event stucks at inprogress) - if (pInstance->GetData(DATA_RAGEWINTERCHILLEVENT) == IN_PROGRESS) - pInstance->SetData(DATA_RAGEWINTERCHILLEVENT, NOT_STARTED); - if (pInstance->GetData(DATA_ANETHERONEVENT) == IN_PROGRESS) - pInstance->SetData(DATA_ANETHERONEVENT, NOT_STARTED); - if (pInstance->GetData(DATA_KAZROGALEVENT) == IN_PROGRESS) - pInstance->SetData(DATA_KAZROGALEVENT, NOT_STARTED); - if (pInstance->GetData(DATA_AZGALOREVENT) == IN_PROGRESS) - pInstance->SetData(DATA_AZGALOREVENT, NOT_STARTED); - pInstance->SetData(DATA_RESET_RAIDDAMAGE, NULL);//reset damage on die - } -} -void hyjalAI::HideNearPos(float x, float y) -{ - CellPair pair(Trinity::ComputeCellPair(x, y)); - Cell cell(pair); - cell.data.Part.reserved = ALL_DISTRICT; - cell.SetNoCreate(); - - // First get all creatures. - std::list creatures; - Trinity::AllFriendlyCreaturesInGrid creature_check(m_creature); - Trinity::CreatureListSearcher creature_searcher(m_creature, creatures, creature_check); - TypeContainerVisitor - , - GridTypeMapContainer> creature_visitor(creature_searcher); - - CellLock cell_lock(cell, pair); - // Get Creatures - cell_lock->Visit(cell_lock, creature_visitor, *(m_creature->GetMap())); - - if (!creatures.empty()) - { - for(std::list::iterator itr = creatures.begin(); itr != creatures.end(); ++itr) - { - (*itr)->SetVisibility(VISIBILITY_OFF); - (*itr)->setFaction(35);//make them friendly so mobs won't attack them - } - } -} -void hyjalAI::RespawnNearPos(float x, float y) -{ - CellPair p(Trinity::ComputeCellPair(x, y)); - Cell cell(p); - cell.data.Part.reserved = ALL_DISTRICT; - cell.SetNoCreate(); - - Trinity::RespawnDo u_do; - Trinity::WorldObjectWorker worker(m_creature, u_do); - TypeContainerVisitor, GridTypeMapContainer > obj_worker(worker); - CellLock cell_lock(cell, p); - cell_lock->Visit(cell_lock, obj_worker, *m_creature->GetMap()); -} -void hyjalAI::WaypointReached(uint32 i) -{ - if (i == 1 || (i == 0 && m_creature->GetEntry() == THRALL)) - { - m_creature->MonsterYell("Hurry, we don't have much time",0,0); - WaitForTeleport = true; - TeleportTimer = 20000; - if (m_creature->GetEntry() == JAINA) - m_creature->CastSpell(m_creature,SPELL_MASS_TELEPORT,false); - if (m_creature->GetEntry() == THRALL && DummyGuid) - { - Unit* Dummy = Unit::GetUnit((*m_creature),DummyGuid); - if (Dummy) - { - CAST_AI(hyjalAI, CAST_CRE(Dummy)->AI())->DoMassTeleport = true; - CAST_AI(hyjalAI, CAST_CRE(Dummy)->AI())->MassTeleportTimer = 20000; - Dummy->CastSpell(m_creature,SPELL_MASS_TELEPORT,false); - } - } - //do some talking - //all alive guards walk near here - CellPair pair(Trinity::ComputeCellPair(m_creature->GetPositionX(), m_creature->GetPositionY())); - Cell cell(pair); - cell.data.Part.reserved = ALL_DISTRICT; - cell.SetNoCreate(); - - // First get all creatures. - std::list creatures; - Trinity::AllFriendlyCreaturesInGrid creature_check(m_creature); - Trinity::CreatureListSearcher creature_searcher(m_creature, creatures, creature_check); - TypeContainerVisitor - , - GridTypeMapContainer> creature_visitor(creature_searcher); - - CellLock cell_lock(cell, pair); - cell_lock->Visit(cell_lock, creature_visitor, *(m_creature->GetMap())); - - if (!creatures.empty()) - { - for(std::list::iterator itr = creatures.begin(); itr != creatures.end(); ++itr) - { - if ((*itr) && (*itr)->isAlive() && (*itr) != m_creature && (*itr)->GetEntry() != JAINA) - { - if (!(*itr)->IsWithinDist(m_creature, 60)) - (*itr)->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - float x, y, z; - (*itr)->SetDefaultMovementType(IDLE_MOTION_TYPE); - (*itr)->GetMotionMaster()->Initialize(); - float range = 10; - if (m_creature->GetEntry() == THRALL)range = 20; - m_creature->GetNearPoint(m_creature, x, y, z, range, 0, m_creature->GetAngle((*itr))); - (*itr)->GetMotionMaster()->MovePoint(0, x+irand(-5,5), y+irand(-5,5), m_creature->GetPositionZ()); - } - } - } - } -} -void hyjalAI::DoOverrun(uint32 faction, const uint32 diff) -{ - npc_escortAI::UpdateAI(diff); - if (WaitForTeleport) - { - if (TeleportTimer < diff) - { - CellPair pair(Trinity::ComputeCellPair(m_creature->GetPositionX(), m_creature->GetPositionY())); - Cell cell(pair); - cell.data.Part.reserved = ALL_DISTRICT; - cell.SetNoCreate(); - - std::list creatures; - Trinity::AllFriendlyCreaturesInGrid creature_check(m_creature); - Trinity::CreatureListSearcher creature_searcher(m_creature, creatures, creature_check); - TypeContainerVisitor - , - GridTypeMapContainer> creature_visitor(creature_searcher); - - CellLock cell_lock(cell, pair); - cell_lock->Visit(cell_lock, creature_visitor, *(m_creature->GetMap())); - - if (!creatures.empty()) - { - for(std::list::iterator itr = creatures.begin(); itr != creatures.end(); ++itr) - { - if ((*itr) && (*itr)->isAlive()) - { - (*itr)->CastSpell(*itr, SPELL_TELEPORT_VISUAL, true); - (*itr)->setFaction(35);//make them friendly so mobs won't attack them - (*itr)->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - } - } - DoCast(m_creature, SPELL_TELEPORT_VISUAL); - bRetreat = true; - RetreatTimer = 1000; - } - - WaitForTeleport = false; - Teleported = true; - }TeleportTimer -= diff; - } - if (!Teleported) - return; - Overrun = false;//execute once - switch(faction) - { - case 0://alliance - for(uint8 i = 0; i < 92; ++i)//summon fires - m_creature->SummonGameObject(FLAMEOBJECT,AllianceFirePos[i][0],AllianceFirePos[i][1],AllianceFirePos[i][2],AllianceFirePos[i][3],AllianceFirePos[i][4],AllianceFirePos[i][5],AllianceFirePos[i][6],AllianceFirePos[i][7],0); - - for(uint8 i = 0; i < 25; ++i)//summon 25 ghouls - { - uint8 r = rand()%4; - Creature* pUnit = m_creature->SummonCreature(GHOUL, AllianceBase[r][0]+irand(-15,15), AllianceBase[r][1]+irand(-15,15), AllianceBase[r][2], 0, TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000); - if (pUnit) - { - CAST_AI(hyjal_trashAI, pUnit->AI())->faction = Faction; - CAST_AI(hyjal_trashAI, pUnit->AI())->IsOverrun = true; - CAST_AI(hyjal_trashAI, pUnit->AI())->OverrunType = i; - pUnit->setActive(true); - } - } - for(uint8 i = 0; i < 3; ++i)//summon 3 abominations - { - uint8 r = rand()%4; - Creature* pUnit = m_creature->SummonCreature(ABOMINATION, AllianceBase[r][0]+irand(-15,15), AllianceBase[r][1]+irand(-15,15), AllianceBase[r][2], 0, TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000); - if (pUnit) - { - CAST_AI(hyjal_trashAI, pUnit->AI())->faction = Faction; - CAST_AI(hyjal_trashAI, pUnit->AI())->IsOverrun = true; - CAST_AI(hyjal_trashAI, pUnit->AI())->OverrunType = i; - pUnit->setActive(true); - } - } - for(uint8 i = 0; i < 5; ++i)//summon 5 gargoyles - { - Creature* pUnit = m_creature->SummonCreature(GARGOYLE, AllianceOverrunGargPos[i][0], AllianceOverrunGargPos[i][1], AllianceOverrunGargPos[i][2], AllianceOverrunGargPos[i][3], TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000); - if (pUnit) - { - pUnit->SetHomePosition(AllianceOverrunGargPos[i][0], AllianceOverrunGargPos[i][1], AllianceOverrunGargPos[i][2], AllianceOverrunGargPos[i][3]); - CAST_AI(hyjal_trashAI, pUnit->AI())->faction = Faction; - CAST_AI(hyjal_trashAI, pUnit->AI())->IsOverrun = true; - CAST_AI(hyjal_trashAI, pUnit->AI())->OverrunType = i; - pUnit->setActive(true); - } - } - break; - case 1://horde - for(uint8 i = 0; i < 65; ++i)//summon fires - m_creature->SummonGameObject(FLAMEOBJECT,HordeFirePos[i][0],HordeFirePos[i][1],HordeFirePos[i][2],HordeFirePos[i][3],HordeFirePos[i][4],HordeFirePos[i][5],HordeFirePos[i][6],HordeFirePos[i][7],0); - - for(uint8 i = 0; i < 26; ++i)//summon infernals - { - Creature* pUnit = m_creature->SummonCreature(GIANT_INFERNAL, InfernalSPWP[i][0], InfernalSPWP[i][1], InfernalSPWP[i][2], InfernalSPWP[i][3], TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000); - if (pUnit) - { - pUnit->SetHomePosition(InfernalSPWP[i][0], InfernalSPWP[i][1], InfernalSPWP[i][2], InfernalSPWP[i][3]); - CAST_AI(hyjal_trashAI, pUnit->AI())->faction = Faction; - CAST_AI(hyjal_trashAI, pUnit->AI())->IsOverrun = true; - CAST_AI(hyjal_trashAI, pUnit->AI())->OverrunType = i; - pUnit->setActive(true); - } - } - for(uint8 i = 0; i < 25; ++i)//summon 25 ghouls - { - uint8 r = rand()%4; - Creature* pUnit = m_creature->SummonCreature(GHOUL, HordeBase[r][0]+irand(-15,15), HordeBase[r][1]+irand(-15,15), HordeBase[r][2], 0, TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000); - if (pUnit) - { - CAST_AI(hyjal_trashAI, pUnit->AI())->faction = Faction; - CAST_AI(hyjal_trashAI, pUnit->AI())->IsOverrun = true; - CAST_AI(hyjal_trashAI, pUnit->AI())->OverrunType = i; - pUnit->setActive(true); - } - } - for(uint8 i = 0; i < 5; ++i)//summon 5 abominations - { - uint8 r = rand()%4; - Creature* pUnit = m_creature->SummonCreature(ABOMINATION, HordeBase[r][0]+irand(-15,15), HordeBase[r][1]+irand(-15,15), HordeBase[r][2], 0, TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000); - if (pUnit) - { - CAST_AI(hyjal_trashAI, pUnit->AI())->faction = Faction; - CAST_AI(hyjal_trashAI, pUnit->AI())->IsOverrun = true; - CAST_AI(hyjal_trashAI, pUnit->AI())->OverrunType = i; - pUnit->setActive(true); - } - } - break; - } -} \ No newline at end of file diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.h b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.h deleted file mode 100644 index 3b0ff32a429..00000000000 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.h +++ /dev/null @@ -1,248 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ - -#ifndef SC_HYJALAI_H -#define SC_HYJALAI_H - -#include "def_hyjal.h" -#include "escortAI.h" - -// Trash Mobs summoned in waves -#define NECROMANCER 17899//done -#define ABOMINATION 17898//done -#define GHOUL 17895//done -#define BANSHEE 17905//done -#define CRYPT_FIEND 17897//done -#define GARGOYLE 17906//done -#define FROST_WYRM 17907//done -#define GIANT_INFERNAL 17908//done -#define FEL_STALKER 17916//done - -#define JAINA 17772 -#define THRALL 17852 -#define TYRANDE 17948 - -#define ANCIENT_VEIN 185557 -#define FLAMEOBJECT 182592 - -// Bosses summoned after every 8 waves -#define RAGE_WINTERCHILL 17767 -#define ANETHERON 17808 -#define KAZROGAL 17888 -#define AZGALOR 17842 -#define ARCHIMONDE 17968 - -#define SPELL_TELEPORT_VISUAL 41232 -#define SPELL_MASS_TELEPORT 16807 - -//Spells for Jaina -#define SPELL_BRILLIANCE_AURA 31260 // The database must handle this spell via creature_addon(it should, but is removed in evade..) -#define SPELL_BLIZZARD 31266 -#define SPELL_PYROBLAST 31263 -#define SPELL_SUMMON_ELEMENTALS 31264 - -//Thrall spells -#define SPELL_CHAIN_LIGHTNING 31330 -#define SPELL_SUMMON_DIRE_WOLF 31331 - -struct Wave -{ - uint32 Mob[18]; // Stores Creature Entries to be summoned in Waves - uint32 WaveTimer; // The timer before the next wave is summoned - bool IsBoss; // Simply used to inform the wave summoner that the next wave contains a boss to halt all waves after that -}; - -static Wave AllianceWaves[]= // Waves that will be summoned in the Alliance Base -{ // Rage Winterchill Wave 1-8 - {GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, 0, 0, 0, 0, 0, 0, 0, 0, 120000, false}, - {GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, 0, 0, 0, 0, 0, 0, 120000, false}, - {GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, 0, 0, 0, 0, 0, 0, 120000, false}, - {GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 0, 0, 120000, false}, - {GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 0, 0, 120000, false}, - {GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, 0, 0, 0, 0, 0, 0, 120000, false}, - {GHOUL, GHOUL, GHOUL, GHOUL, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, 0, 0, 0, 0, 0, 0, 120000, false}, - {GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, ABOMINATION, ABOMINATION, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 180000, false}, - // All 8 Waves are summoned, summon Rage Winterchill, next few waves are for Anetheron - {RAGE_WINTERCHILL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, true}, - // Anetheron Wave 1-8 - {GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, 0, 0, 0, 0, 0, 0, 0, 0, 120000, false}, - {GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, 0, 0, 0, 0, 0, 0, 120000, false}, - {GHOUL, GHOUL, GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 0, 0, 120000, false}, - {NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, BANSHEE, BANSHEE, 0, 0, 0, 0, 0, 0, 120000, false}, - {GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, NECROMANCER, NECROMANCER, BANSHEE, BANSHEE, BANSHEE, BANSHEE, 0, 0, 0, 0, 0, 0, 120000, false}, - {GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, ABOMINATION, ABOMINATION, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 0, 0, 120000, false}, - {CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, BANSHEE, BANSHEE, BANSHEE, BANSHEE, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, GHOUL, GHOUL, 0, 0, 0, 0, 120000, false}, - {GHOUL, GHOUL, GHOUL, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, BANSHEE, BANSHEE, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 180000, false}, - // All 8 Waves are summoned, summon Anatheron - {ANETHERON, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, true} -}; - -static Wave HordeWaves[]= // Waves that are summoned in the Horde base -{ // Kaz'Rogal Wave 1-8 - {GHOUL, GHOUL, GHOUL, GHOUL, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, BANSHEE, BANSHEE, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 0, 0, 180000, false}, - {GHOUL, GHOUL, GHOUL, GHOUL, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, 0, 0, 0, 0, 180000, false}, - {GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 180000, false}, - {CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 180000, false}, - {GHOUL, GHOUL, GHOUL, GHOUL, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 180000, false}, - {GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, FROST_WYRM, 0, 0, 0, 0, 0, 0, 0, 0, 0, 180000, false}, - {GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, FROST_WYRM, 0, 0, 0, 0, 0, 0, 0, 180000, false}, - {GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, BANSHEE, BANSHEE, NECROMANCER, NECROMANCER, 0, 0, 240000, false}, - // All 8 Waves are summoned, summon Kaz'Rogal, next few waves are for Azgalor - {KAZROGAL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, true}, - // Azgalor Wave 1-8 - {ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 0, 0, 180000, false}, - {GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, FROST_WYRM, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, 0, 0, 0, 0, 180000, false}, - {GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, 0, 0, 0, 0, 180000, false}, - {GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, FEL_STALKER, FEL_STALKER, FEL_STALKER, FEL_STALKER, FEL_STALKER, FEL_STALKER, 0, 0, 0, 0, 180000, false}, - {FEL_STALKER, FEL_STALKER, FEL_STALKER, FEL_STALKER, FEL_STALKER, FEL_STALKER, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 180000, false}, - {NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, BANSHEE, BANSHEE, BANSHEE, BANSHEE, BANSHEE, BANSHEE, 0, 0, 0, 0, 0, 0, 180000, false}, - {GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, FEL_STALKER, FEL_STALKER, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, 0, 0, 0, 0, 180000, false}, - {CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, FEL_STALKER, FEL_STALKER, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, BANSHEE, BANSHEE, BANSHEE, BANSHEE, NECROMANCER, NECROMANCER, 0, 0, 240000, false}, - // All 8 Waves are summoned, summon Azgalor - {AZGALOR, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, true} -}; - -enum TargetType // Used in the spell cast system for the AI -{ - TARGETTYPE_SELF = 0, - TARGETTYPE_RANDOM = 1, - TARGETTYPE_VICTIM = 2, -}; - -struct Yells -{ - uint32 id; // Used to determine the type of yell (attack, rally, etc) - int32 textid; // The text id to be yelled -}; - -enum YellId -{ - ATTACKED = 0, // Used when attacked and set in combat - BEGIN = 1, // Used when the event is begun - INCOMING = 2, // Used to warn the raid that another wave phase is coming - RALLY = 3, // Used to rally the raid and warn that the next wave has been summoned - FAILURE = 4, // Used when raid has failed (unsure where to place) - SUCCESS = 5, // Used when the raid has sucessfully defeated a wave phase - DEATH = 6, // Used on death -}; - -static Yells JainaQuotes[]= -{ - {ATTACKED, -1534000}, - {ATTACKED, -1534001}, - {INCOMING, -1534002}, - {BEGIN, -1534003}, - {RALLY, -1534004}, - {RALLY, -1534005}, - {FAILURE, -1534006}, - {SUCCESS, -1534007}, - {DEATH, -1534008}, -}; - -static Yells ThrallQuotes[]= -{ - {ATTACKED, -1534009}, - {ATTACKED, -1534010}, - {INCOMING, -1534011}, - {BEGIN, -1534012}, - {RALLY, -1534013}, - {RALLY, -1534014}, - {FAILURE, -1534015}, - {SUCCESS, -1534016}, - {DEATH, -1534017}, -}; - -struct TRINITY_DLL_DECL hyjalAI : public npc_escortAI -{ - hyjalAI(Creature *c); - - void Reset(); // Generically used to reset our variables. Do *not* call in EnterEvadeMode as this may make problems if the raid is still in combat - - void EnterEvadeMode(); // Send creature back to spawn location and evade. - - void EnterCombat(Unit *who); // Used to reset cooldowns for our spells and to inform the raid that we're under attack - - void UpdateAI(const uint32 diff); // Called to summon waves, check for boss deaths and to cast our spells. - - void JustDied(Unit* killer); // Called on death, informs the raid that they have failed. - - void SetFaction(uint32 _faction) // Set the faction to either Alliance or Horde in Hyjal - { - Faction = _faction; - } - - void Retreat(); // "Teleport" (teleport visual + set invisible) all friendly creatures away from the base. - - void SpawnVeins(); - void DeSpawnVeins(); - void JustSummoned(Creature *summoned); - void SummonedCreatureDespawn(Creature* summoned); - void HideNearPos(float x, float y); - void RespawnNearPos(float x, float y); - void WaypointReached(uint32 i); - void DoOverrun(uint32 faction, const uint32 diff); - void MoveInLineOfSight(Unit *who); - - void SummonCreature(uint32 entry, float Base[4][3]); // Summons a creature for that wave in that base - - // Summons the next wave, calls SummonCreature - void SummonNextWave(Wave wave[18], uint32 Count, float Base[4][3]); - - void StartEvent(Player* player); // Begins the event by gossip click - - uint32 GetInstanceData(uint32 Event); // Gets instance data for this instance, used to check if raid has gotten past a certain point and can access the next phase - - void Talk(uint32 id); // Searches for the appropriate yell and sound and uses it to inform the raid of various things - - public: - ScriptedInstance* pInstance; - - uint64 PlayerGUID; - uint64 BossGUID[2]; - uint64 VeinGUID[14]; - - uint32 NextWaveTimer; - uint32 WaveCount; - uint32 CheckTimer; - uint32 Faction; - uint32 EnemyCount; - uint32 RetreatTimer; - - bool EventBegun; - bool FirstBossDead; - bool SecondBossDead; - bool Summon; - bool bRetreat; - bool Debug; - bool VeinsSpawned[2]; - uint8 InfernalCount; - SummonList Summons; - bool Overrun; - bool Teleported; - bool WaitForTeleport; - uint32 TeleportTimer; - uint32 OverrunCounter; - uint32 OverrunCounter2; - uint32 InfernalPoint; - uint32 RespawnTimer; - bool DoRespawn; - bool DoHide; - bool IsDummy; - uint32 MassTeleportTimer; - bool DoMassTeleport; - uint64 DummyGuid; - - struct Spell - { - uint32 SpellId; - uint32 Cooldown; - uint32 TargetType; - }Spell[3]; - - private: - uint32 SpellTimer[3]; - //std::list CreatureList; -}; -#endif - diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal_trash.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal_trash.cpp deleted file mode 100644 index b0739530fdc..00000000000 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal_trash.cpp +++ /dev/null @@ -1,1453 +0,0 @@ - -#include "precompiled.h" -#include "def_hyjal.h" -#include "hyjal_trash.h" -#include "hyjalAI.h" - -#define SPELL_METEOR 33814 //infernal visual -#define SPELL_IMMOLATION 37059 -#define SPELL_FLAME_BUFFET 31724 -#define NPC_TRIGGER 21987 //World Trigger (Tiny) -#define MODEL_INVIS 11686 //invisible model - -float HordeWPs[8][3]=//basic waypoints from spawn to leader -{ - {5492.91, -2404.61, 1462.63}, - {5531.76, -2460.87, 1469.55}, - {5554.58, -2514.66, 1476.12}, - {5554.16, -2567.23, 1479.90}, - {5540.67, -2625.99, 1480.89}, - {5508.16, -2659.20, 1480.15},//random rush starts from here - {5489.62, -2704.05, 1482.18}, - {5457.04, -2726.26, 1485.10} -}; -float AllianceWPs[8][3]=//basic waypoints from spawn to leader -{ - {4896.08, -1576.35, 1333.65}, - {4898.68, -1615.02, 1329.48}, - {4907.12, -1667.08, 1321.00}, - {4963.18, -1699.35, 1340.51}, - {4989.16, -1716.67, 1335.74},//first WP in the base, after the gate - {5026.27, -1736.89, 1323.02}, - {5037.77, -1770.56, 1324.36}, - {5067.23, -1789.95, 1321.17} -}; - -float FrostWyrmWPs[3][3]=//waypoints for the frost wyrms in horde base -{ - {5580.82, -2628.83, 1528.28}, - {5550.90, -2667.16, 1505.45}, - {5459.64, -2725.91, 1484.83} -}; - -float GargoyleWPs[3][3]=//waypoints for the gargoyles in horde base -{ - {5533.66, -2634.32, 1495.33}, - {5517.88, -2712.05, 1490.54}, - {5459.64, -2725.91, 1484.83} -}; - -float FlyPathWPs[3][3]=//waypoints for the gargoyls and frost wyrms in horde base in wave 1/3 -{ - {5531.96, -2772.83, 1516.68}, - {5498.32, -2734.84, 1497.01}, - {5456.67, -2725.48, 1493.08} -}; - -float AllianceOverrunWP[55][3]=//waypoints in the alliance base used in the end in the cleaning wave -{ - {4976.37,-1708.02,1339.43},//0spawn - {4994.83,-1725.52,1333.25},//1 start - {4982.92,-1753.7,1330.69},//2 end - {4996.75,-1721.47,1332.95},//3 start - {5015.74,-1755.05,1322.49},//4 - {4998.68,-1773.44,1329.59},//5 - {4994.83,-1725.52,1333.25},//6 start - {5022.8,-1735.46,1323.53},//7 - {5052.15,-1729.02,1320.88},//8 - {5082.43,-1726.29,1327.87},//9 - {4994.83,-1725.52,1333.25},//10 start - {5018.92,-1751.14,1322.19},//11 - {5040.09,-1792.09,1322.1},//12 - {4994.83,-1725.52,1333.25},//13 start - {5023.47,-1748.1,1322.51},//14 - {5013.43,-1842.39,1322.07},//15 - {4994.83,-1725.52,1333.25},//16 start - {5020.8,-1756.86,1322.2},//17 - {5019.53,-1824.6,1321.96},//18 - {5043.42,-1853.75,1324.52},//19 - {5053.02,-1864.13,1330.36},//20 - {5062.49,-1852.47,1330.49},//21 - {5015.27, -1738.77, 1324.83},//35//start 22 - {5027.97, -1775.25, 1321.87},//34 23 - {5015.94, -1821.24, 1321.86},//33 24 - {4983.25, -1857.4, 1320.48},//32 25 - {4981.51, -1883.7, 1322.34},//31 26 - {5002.33, -1893.98, 1325.88},//30 27 - {5049.32, -1886.54, 1331.69},//29 28 - {5089.68, -1846.88, 1328.99},//28 29 - {5127.90, -1825.14, 1335.58},//27 30 - {5163.27, -1789.08, 1337.04},//26 31 - {5138.97, -1755.88, 1334.57},//25 32 - {5096.63, -1742.22, 1329.61},//24 33 - {5065.81, -1729.43, 1325.66},//23 34 - {5049.32, -1726.31, 1320.64},//22 start - {5081.07, -1902.10, 1346.36},//36 abo start - {5107.65, -1912.03, 1356.49},//37 - {5132.83, -1927.07, 1362.42},//38 - {5147.78, -1954.41, 1365.98},//39 - {5164.96, -1966.48, 1367.04},//40 - {5189.04, -1961.06, 1367.90},//41 - {5212.27, -1975.30, 1365.58},//42 - {5221.82, -1994.18, 1364.97},//43 end1 - {5202.23, -1994.94, 1367.59},//44 end2 - {5279.94, -2049.68, 1311.38},//45 garg1 - {5289.15, -2219.06, 1291.12},//46 garg2 - {5202.07, -2136.10, 1305.07},//47 garg3 - {5071.52, -2425.63, 1454.48},//48 garg4 - {5120.65, -2467.92, 1463.93},//49 garg5 - {5283.04, -2043.26, 1300.11},//50 garg target1 - {5313.22, -2207.60, 1290.06},//51 garg target2 - {5180.41, -2121.87, 1292.62},//52 garg target3 - {5088.68, -2432.04, 1441.73},//53 garg target4 - {5111.26, -2454.73, 1449.63}//54 garg target5 - -}; - -float HordeOverrunWP[21][3]=//waypoints in the horde base used in the end in the cleaning wave -{ - {5490.72,-2702.94,1482.14},//0 start - {5469.77,-2741.34,1486.95}, - {5439.47,-2771.02,1494.59}, - {5408.85,-2811.92,1505.68}, - {5423.87,-2857.80,1515.55}, - {5428.19,-2898.15,1524.61}, - {5394.59,-2930.05,1528.23}, - {5351.11,-2935.80,1532.24}, - {5312.37,-2959.06,1536.21}, - {5264.93,-2989.80,1545.70}, - {5256.63,-3056.16,1559.24}, - {5267.32,-3119.55,1575.36}, - {5305.61,-3139.88,1586.38}, - {5330.56,-3135.37,1588.58}, - {5365.87,-3139.78,1583.96}, - {5389.39,-3163.57,1582.57},//15 end - {5500.86,-2669.89,1481.04},//16 start - {5472.08,-2715.14,1483.55}, - {5450.11,-2721.47,1485.61}, - {5433.25,-2712.93,1493.02},//19 end 1 - {5429.91,-2718.44,1493.42}//20 end 2 -}; - -hyjal_trashAI::hyjal_trashAI(Creature *c) : npc_escortAI(c) -{ - pInstance = c->GetInstanceData(); - IsEvent = false; - Delay = 0; - LastOverronPos = 0; - IsOverrun = false; - OverrunType = 0; - SetupOverrun = false; - faction = 0; - useFlyPath = false; - damageTaken = 0; - Reset(); -} - -void hyjal_trashAI::DamageTaken(Unit *done_by, uint32 &damage) -{ - if (done_by->GetTypeId() == TYPEID_PLAYER || (done_by->GetTypeId() == TYPEID_UNIT && CAST_CRE(done_by)->isPet())) - { - damageTaken += damage; - if (pInstance) - pInstance->SetData(DATA_RAIDDAMAGE,damage);//store raid's damage - } -} - -void hyjal_trashAI::UpdateAI(const uint32 diff) -{ - if (IsOverrun && !SetupOverrun) - { - SetupOverrun = true; - if (faction == 0) - { - if (m_creature->GetEntry() == GARGOYLE) - { - DummyTarget[0] = AllianceOverrunWP[50+OverrunType][0]; //+OverrunType 0 - 4 - DummyTarget[1] = AllianceOverrunWP[50+OverrunType][1]; - DummyTarget[2] = AllianceOverrunWP[50+OverrunType][2]; - } - if (m_creature->GetEntry() == ABOMINATION) - { - for(uint8 i = 0; i < 4; ++i) - AddWaypoint(i, AllianceWPs[i][0]+irand(-3,3), AllianceWPs[i][1]+irand(-3,3), AllianceWPs[i][2]); - switch(OverrunType) - { - case 0: - AddWaypoint(4, AllianceOverrunWP[22][0]+irand(-3,3), AllianceOverrunWP[22][1]+irand(-3,3), AllianceOverrunWP[22][2]); - AddWaypoint(5, AllianceOverrunWP[23][0]+irand(-3,3), AllianceOverrunWP[23][1]+irand(-3,3), AllianceOverrunWP[23][2]); - AddWaypoint(6, AllianceOverrunWP[24][0]+irand(-3,3), AllianceOverrunWP[24][1]+irand(-3,3), AllianceOverrunWP[24][2]); - AddWaypoint(7, AllianceOverrunWP[25][0]+irand(-3,3), AllianceOverrunWP[25][1]+irand(-3,3), AllianceOverrunWP[25][2]); - AddWaypoint(8, AllianceOverrunWP[26][0]+irand(-3,3), AllianceOverrunWP[26][1]+irand(-3,3), AllianceOverrunWP[26][2]); - AddWaypoint(9, AllianceOverrunWP[27][0]+irand(-3,3), AllianceOverrunWP[27][1]+irand(-3,3), AllianceOverrunWP[27][2]); - AddWaypoint(10, AllianceOverrunWP[28][0]+irand(-3,3), AllianceOverrunWP[28][1]+irand(-3,3), AllianceOverrunWP[28][2]); - - AddWaypoint(11, AllianceOverrunWP[36][0]+irand(-3,3), AllianceOverrunWP[36][1]+irand(-3,3), AllianceOverrunWP[36][2]); - AddWaypoint(12, AllianceOverrunWP[37][0]+irand(-3,3), AllianceOverrunWP[37][1]+irand(-3,3), AllianceOverrunWP[37][2]); - AddWaypoint(13, AllianceOverrunWP[38][0]+irand(-3,3), AllianceOverrunWP[38][1]+irand(-3,3), AllianceOverrunWP[38][2]); - AddWaypoint(14, AllianceOverrunWP[39][0]+irand(-3,3), AllianceOverrunWP[39][1]+irand(-3,3), AllianceOverrunWP[39][2]); - AddWaypoint(15, AllianceOverrunWP[40][0]+irand(-3,3), AllianceOverrunWP[40][1]+irand(-3,3), AllianceOverrunWP[40][2]); - AddWaypoint(16, AllianceOverrunWP[41][0]+irand(-3,3), AllianceOverrunWP[41][1]+irand(-3,3), AllianceOverrunWP[41][2]); - AddWaypoint(17, AllianceOverrunWP[42][0]+irand(-3,3), AllianceOverrunWP[42][1]+irand(-3,3), AllianceOverrunWP[42][2]); - AddWaypoint(18, AllianceOverrunWP[43][0]+irand(-3,3), AllianceOverrunWP[43][1]+irand(-3,3), AllianceOverrunWP[43][2]); - m_creature->SetHomePosition(AllianceOverrunWP[43][0]+irand(-3,3), AllianceOverrunWP[43][1]+irand(-3,3), AllianceOverrunWP[43][2],0); - SetDespawnAtEnd(false); - LastOverronPos = 18; - Start(true, true); - break; - case 1: - AddWaypoint(4, AllianceOverrunWP[22][0]+irand(-3,3), AllianceOverrunWP[22][1]+irand(-3,3), AllianceOverrunWP[22][2]); - AddWaypoint(5, AllianceOverrunWP[23][0]+irand(-3,3), AllianceOverrunWP[23][1]+irand(-3,3), AllianceOverrunWP[23][2]); - AddWaypoint(6, AllianceOverrunWP[24][0]+irand(-3,3), AllianceOverrunWP[24][1]+irand(-3,3), AllianceOverrunWP[24][2]); - AddWaypoint(7, AllianceOverrunWP[25][0]+irand(-3,3), AllianceOverrunWP[25][1]+irand(-3,3), AllianceOverrunWP[25][2]); - AddWaypoint(8, AllianceOverrunWP[26][0]+irand(-3,3), AllianceOverrunWP[26][1]+irand(-3,3), AllianceOverrunWP[26][2]); - AddWaypoint(9, AllianceOverrunWP[27][0]+irand(-3,3), AllianceOverrunWP[27][1]+irand(-3,3), AllianceOverrunWP[27][2]); - AddWaypoint(10, AllianceOverrunWP[28][0]+irand(-3,3), AllianceOverrunWP[28][1]+irand(-3,3), AllianceOverrunWP[28][2]); - - AddWaypoint(11, AllianceOverrunWP[36][0]+irand(-3,3), AllianceOverrunWP[36][1]+irand(-3,3), AllianceOverrunWP[36][2]); - AddWaypoint(12, AllianceOverrunWP[37][0]+irand(-3,3), AllianceOverrunWP[37][1]+irand(-3,3), AllianceOverrunWP[37][2]); - AddWaypoint(13, AllianceOverrunWP[38][0]+irand(-3,3), AllianceOverrunWP[38][1]+irand(-3,3), AllianceOverrunWP[38][2]); - AddWaypoint(14, AllianceOverrunWP[39][0]+irand(-3,3), AllianceOverrunWP[39][1]+irand(-3,3), AllianceOverrunWP[39][2]); - AddWaypoint(15, AllianceOverrunWP[40][0]+irand(-3,3), AllianceOverrunWP[40][1]+irand(-3,3), AllianceOverrunWP[40][2]); - AddWaypoint(16, AllianceOverrunWP[41][0]+irand(-3,3), AllianceOverrunWP[41][1]+irand(-3,3), AllianceOverrunWP[41][2]); - AddWaypoint(17, AllianceOverrunWP[42][0]+irand(-3,3), AllianceOverrunWP[42][1]+irand(-3,3), AllianceOverrunWP[42][2]); - AddWaypoint(18, AllianceOverrunWP[44][0]+irand(-3,3), AllianceOverrunWP[44][1]+irand(-3,3), AllianceOverrunWP[44][2]); - m_creature->SetHomePosition(AllianceOverrunWP[44][0]+irand(-3,3), AllianceOverrunWP[44][1]+irand(-3,3), AllianceOverrunWP[44][2],0); - SetDespawnAtEnd(false); - LastOverronPos = 18; - Start(true, true); - break; - default: - for(uint8 i = 22; i < 36; ++i) - AddWaypoint(i-18, AllianceOverrunWP[i][0]+irand(-3,3), AllianceOverrunWP[i][1]+irand(-3,3), AllianceOverrunWP[i][2]); - - SetDespawnAtEnd(true); - LastOverronPos = 17; - Start(true, true); - break; - } - } - if (m_creature->GetEntry() == GHOUL) - { - for(uint8 i = 0; i < 4; ++i) - AddWaypoint(i, AllianceWPs[i][0]+irand(-3,3), AllianceWPs[i][1]+irand(-3,3), AllianceWPs[i][2]); - switch(OverrunType) - { - case 0: - AddWaypoint(4, AllianceOverrunWP[1][0]+irand(-3,3), AllianceOverrunWP[1][1]+irand(-3,3), AllianceOverrunWP[1][2]); - AddWaypoint(5, AllianceOverrunWP[2][0]+irand(-3,3), AllianceOverrunWP[2][1]+irand(-3,3), AllianceOverrunWP[2][2]); - m_creature->SetHomePosition(AllianceOverrunWP[2][0]+irand(-3,3), AllianceOverrunWP[2][1]+irand(-3,3), AllianceOverrunWP[2][2],0); - SetDespawnAtEnd(false); - LastOverronPos = 5; - Start(true, true); - break; - case 1: - AddWaypoint(4, AllianceOverrunWP[3][0]+irand(-3,3), AllianceOverrunWP[3][1]+irand(-3,3), AllianceOverrunWP[3][2]); - AddWaypoint(5, AllianceOverrunWP[4][0]+irand(-3,3), AllianceOverrunWP[4][1]+irand(-3,3), AllianceOverrunWP[4][2]); - AddWaypoint(6, AllianceOverrunWP[5][0]+irand(-3,3), AllianceOverrunWP[5][1]+irand(-3,3), AllianceOverrunWP[5][2]); - m_creature->SetHomePosition(AllianceOverrunWP[5][0]+irand(-3,3), AllianceOverrunWP[5][1]+irand(-3,3), AllianceOverrunWP[5][2],0); - SetDespawnAtEnd(false); - LastOverronPos = 6; - Start(true, true); - break; - case 2: - AddWaypoint(4, AllianceOverrunWP[6][0]+irand(-3,3), AllianceOverrunWP[6][1]+irand(-3,3), AllianceOverrunWP[6][2]); - AddWaypoint(5, AllianceOverrunWP[7][0]+irand(-3,3), AllianceOverrunWP[7][1]+irand(-3,3), AllianceOverrunWP[7][2]); - AddWaypoint(6, AllianceOverrunWP[8][0]+irand(-3,3), AllianceOverrunWP[8][1]+irand(-3,3), AllianceOverrunWP[8][2]); - AddWaypoint(7, AllianceOverrunWP[9][0]+irand(-3,3), AllianceOverrunWP[9][1]+irand(-3,3), AllianceOverrunWP[9][2]); - m_creature->SetHomePosition(AllianceOverrunWP[9][0]+irand(-3,3), AllianceOverrunWP[9][1]+irand(-3,3), AllianceOverrunWP[9][2],0); - SetDespawnAtEnd(false); - LastOverronPos = 7; - Start(true, true); - break; - case 3: - AddWaypoint(4, AllianceOverrunWP[10][0]+irand(-3,3), AllianceOverrunWP[10][1]+irand(-3,3), AllianceOverrunWP[10][2]); - AddWaypoint(5, AllianceOverrunWP[11][0]+irand(-3,3), AllianceOverrunWP[11][1]+irand(-3,3), AllianceOverrunWP[11][2]); - AddWaypoint(6, AllianceOverrunWP[12][0]+irand(-3,3), AllianceOverrunWP[12][1]+irand(-3,3), AllianceOverrunWP[12][2]); - m_creature->SetHomePosition(AllianceOverrunWP[12][0]+irand(-3,3), AllianceOverrunWP[12][1]+irand(-3,3), AllianceOverrunWP[12][2],0); - SetDespawnAtEnd(false); - LastOverronPos = 6; - Start(true, true); - break; - case 4: - AddWaypoint(4, AllianceOverrunWP[13][0]+irand(-3,3), AllianceOverrunWP[13][1]+irand(-3,3), AllianceOverrunWP[13][2]); - AddWaypoint(5, AllianceOverrunWP[14][0]+irand(-3,3), AllianceOverrunWP[14][1]+irand(-3,3), AllianceOverrunWP[14][2]); - AddWaypoint(6, AllianceOverrunWP[15][0]+irand(-3,3), AllianceOverrunWP[15][1]+irand(-3,3), AllianceOverrunWP[15][2]); - m_creature->SetHomePosition(AllianceOverrunWP[15][0]+irand(-3,3), AllianceOverrunWP[15][1]+irand(-3,3), AllianceOverrunWP[15][2],0); - SetDespawnAtEnd(false); - LastOverronPos = 6; - Start(true, true); - break; - case 5: - AddWaypoint(4, AllianceOverrunWP[16][0]+irand(-3,3), AllianceOverrunWP[16][1]+irand(-3,3), AllianceOverrunWP[16][2]); - AddWaypoint(5, AllianceOverrunWP[17][0]+irand(-3,3), AllianceOverrunWP[17][1]+irand(-3,3), AllianceOverrunWP[17][2]); - AddWaypoint(6, AllianceOverrunWP[18][0]+irand(-3,3), AllianceOverrunWP[18][1]+irand(-3,3), AllianceOverrunWP[18][2]); - AddWaypoint(7, AllianceOverrunWP[19][0]+irand(-3,3), AllianceOverrunWP[19][1]+irand(-3,3), AllianceOverrunWP[19][2]); - AddWaypoint(8, AllianceOverrunWP[20][0]+irand(-3,3), AllianceOverrunWP[20][1]+irand(-3,3), AllianceOverrunWP[20][2]); - AddWaypoint(9, AllianceOverrunWP[21][0]+irand(-3,3), AllianceOverrunWP[21][1]+irand(-3,3), AllianceOverrunWP[21][2]); - m_creature->SetHomePosition(AllianceOverrunWP[21][0]+irand(-3,3), AllianceOverrunWP[21][1]+irand(-3,3), AllianceOverrunWP[21][2],0); - SetDespawnAtEnd(false); - LastOverronPos = 9; - Start(true, true); - break; - default: - for(uint8 i = 22; i < 36; ++i) - AddWaypoint(i-18, AllianceOverrunWP[i][0]+irand(-3,3), AllianceOverrunWP[i][1]+irand(-3,3), AllianceOverrunWP[i][2]); - SetDespawnAtEnd(true); - LastOverronPos = 17; - Start(true, true); - break; - } - } - } - if (faction == 1) - { - if (m_creature->GetEntry() == GHOUL) - { - for(uint8 i = 0; i < 6; ++i) - AddWaypoint(i, HordeWPs[i][0]+irand(-3,3), HordeWPs[i][1]+irand(-3,3), HordeWPs[i][2]); - switch(OverrunType) - { - case 0: - AddWaypoint(5, HordeOverrunWP[16][0]+irand(-10,10), HordeOverrunWP[16][1]+irand(-10,10), HordeOverrunWP[16][2]); - AddWaypoint(6, HordeOverrunWP[17][0]+irand(-10,10), HordeOverrunWP[17][1]+irand(-10,10), HordeOverrunWP[17][2]); - AddWaypoint(7, HordeOverrunWP[18][0], HordeOverrunWP[18][1], HordeOverrunWP[18][2]); - AddWaypoint(8, HordeOverrunWP[19][0], HordeOverrunWP[19][1], HordeOverrunWP[19][2]); - m_creature->SetHomePosition(HordeOverrunWP[19][0], HordeOverrunWP[19][1], HordeOverrunWP[19][2],0); - SetDespawnAtEnd(false); - LastOverronPos = 8; - Start(true, true); - break; - case 1: - AddWaypoint(5, HordeOverrunWP[16][0]+irand(-10,10), HordeOverrunWP[16][1]+irand(-10,10), HordeOverrunWP[16][2]); - AddWaypoint(6, HordeOverrunWP[17][0]+irand(-10,10), HordeOverrunWP[17][1]+irand(-10,10), HordeOverrunWP[17][2]); - AddWaypoint(7, HordeOverrunWP[18][0], HordeOverrunWP[18][1], HordeOverrunWP[18][2]); - AddWaypoint(8, HordeOverrunWP[20][0], HordeOverrunWP[20][1], HordeOverrunWP[20][2]); - m_creature->SetHomePosition(HordeOverrunWP[20][0], HordeOverrunWP[20][1], HordeOverrunWP[20][2],0); - SetDespawnAtEnd(false); - LastOverronPos = 8; - Start(true, true); - break; - default: - for(uint8 i = 0; i < 16; ++i) - AddWaypoint(i+6, HordeOverrunWP[i][0]+irand(-10,10), HordeOverrunWP[i][1]+irand(-10,10), HordeOverrunWP[i][2]); - SetDespawnAtEnd(true); - LastOverronPos = 21; - Start(true, true); - break; - } - } - if (m_creature->GetEntry() == ABOMINATION) - { - for(uint8 i = 0; i < 6; ++i) - AddWaypoint(i, HordeWPs[i][0]+irand(-10,10), HordeWPs[i][1]+irand(-10,10), HordeWPs[i][2]); - for(uint8 i = 0; i < 16; ++i) - AddWaypoint(i+6, HordeOverrunWP[i][0]+irand(-10,10), HordeOverrunWP[i][1]+irand(-10,10), HordeOverrunWP[i][2]); - SetDespawnAtEnd(true); - LastOverronPos = 21; - Start(true, true); - } - } - } -} - -void hyjal_trashAI::JustDied(Unit *victim) -{ - if (!pInstance)return; - if (IsEvent && !m_creature->isWorldBoss()) - pInstance->SetData(DATA_TRASH, 0);//signal trash is dead - - if ((pInstance->GetData(DATA_RAIDDAMAGE) < MINRAIDDAMAGE && !m_creature->isWorldBoss()) || (damageTaken < m_creature->GetMaxHealth()/4 && m_creature->isWorldBoss())) - m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);//no loot -} - -struct mob_giant_infernalAI : public hyjal_trashAI -{ - mob_giant_infernalAI(Creature* c) : hyjal_trashAI(c) - { - pInstance = c->GetInstanceData(); - meteor = false;//call once! - CanMove = false; - Delay = rand()%30000; - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetDisplayId(MODEL_INVIS); - pGo = false; - pos = 0; - Reset(); - } - - bool meteor; - bool CanMove; - bool WpEnabled; - bool pGo; - uint32 pos; - uint32 spawnTimer; - uint32 FlameBuffetTimer; - bool imol; - - void Reset() - { - spawnTimer = 2000; - FlameBuffetTimer= 2000; - imol = false; - } - - void EnterCombat(Unit* who) {} - - void WaypointReached(uint32 i) - { - pos = i; - if (i == 0 && pInstance && !IsOverrun) - { - if (pInstance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall - { - Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THRALL)); - if (target && target->isAlive()) - m_creature->AddThreat(target,0.0); - } - } - } - - void UpdateAI(const uint32 diff) - { - if (DelayGetPosition(x,y,z); - Creature* trigger = m_creature->SummonCreature(NPC_TRIGGER,x+8,y+8,z+25+rand()%10,m_creature->GetOrientation(),TEMPSUMMON_TIMED_DESPAWN,1000); - if (trigger) - { - trigger->SetVisibility(VISIBILITY_OFF); - trigger->setFaction(m_creature->getFaction()); - trigger->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - trigger->CastSpell(m_creature,SPELL_METEOR,true); - } - m_creature->GetMotionMaster()->Clear(); - meteor = true; - }else if (!CanMove){ - if (spawnTimerRemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetDisplayId(m_creature->GetUInt32Value(UNIT_FIELD_NATIVEDISPLAYID)); - CanMove = true; - if (pInstance) - { - if (pInstance->GetData(DATA_ALLIANCE_RETREAT) && !pInstance->GetData(DATA_HORDE_RETREAT)) - { - Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THRALL)); - if (target && target->isAlive()) - m_creature->AddThreat(target,0.0); - }else if (pInstance->GetData(DATA_ALLIANCE_RETREAT) && pInstance->GetData(DATA_HORDE_RETREAT)){ - //do overrun - } - } - }else spawnTimer -= diff; - } - if (!CanMove)return; - hyjal_trashAI::UpdateAI(diff); - if (IsEvent || IsOverrun) - npc_escortAI::UpdateAI(diff); - if (IsEvent) - { - if (!pGo) - { - pGo = true; - if (pInstance) - { - AddWaypoint(0, HordeWPs[7][0]+irand(-3,3), HordeWPs[7][1]+irand(-3,3), HordeWPs[7][2]);//HordeWPs[7] infront of thrall - Start(true, true); - SetDespawnAtEnd(false); - } - } - } - - if (!UpdateVictim()) - return; - if (!imol) - { - DoCast(m_creature,SPELL_IMMOLATION); - imol=true; - } - if (FlameBuffetTimergetVictim(),SPELL_FLAME_BUFFET,true); - FlameBuffetTimer = 7000; - }else FlameBuffetTimer -= diff; - DoMeleeAttackIfReady(); - } -}; - - -CreatureAI* GetAI_mob_giant_infernal(Creature* pCreature) -{ - return new mob_giant_infernalAI(pCreature); -} - -#define SPELL_DISEASE_CLOUD 31607 -#define SPELL_KNOCKDOWN 31610 - -struct mob_abominationAI : public hyjal_trashAI -{ - mob_abominationAI(Creature* c) : hyjal_trashAI(c) - { - pInstance = c->GetInstanceData(); - pGo = false; - pos = 0; - Reset(); - } - - bool pGo; - uint32 KnockDownTimer; - uint32 pos; - void Reset() - { - KnockDownTimer = 10000; - } - - void WaypointReached(uint32 i) - { - pos = i; - if (i == 7 && pInstance && !IsOverrun) - { - if (pInstance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall - { - Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THRALL)); - if (target && target->isAlive()) - m_creature->AddThreat(target,0.0); - }else{ - Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_JAINAPROUDMOORE)); - if (target && target->isAlive()) - m_creature->AddThreat(target,0.0); - } - } - if (i == LastOverronPos && IsOverrun) - { - if ((faction == 0 && LastOverronPos == 17) || (faction == 1 && LastOverronPos == 21)) - { - m_creature->setDeathState(DEAD); - m_creature->RemoveCorpse(); - } - } - } - - void EnterCombat(Unit* who) {} - - void UpdateAI(const uint32 diff) - { - hyjal_trashAI::UpdateAI(diff); - if (IsEvent || IsOverrun) - npc_escortAI::UpdateAI(diff); - if (IsEvent) - { - if (!pGo) - { - pGo = true; - if (pInstance) - { - if (pInstance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, use horde WPs - { - for (uint8 i = 0; i < 8; ++i) - AddWaypoint(i, HordeWPs[i][0]+irand(-3,3), HordeWPs[i][1]+irand(-3,3), HordeWPs[i][2]); - Start(false, true); - SetDespawnAtEnd(false); - }else//use alliance WPs - { - for (uint8 i = 0; i < 8; ++i) - AddWaypoint(i, AllianceWPs[i][0]+irand(-3,3), AllianceWPs[i][1]+irand(-3,3), AllianceWPs[i][2]); - Start(false, true); - SetDespawnAtEnd(false); - } - } - } - } - if (!m_creature->HasAura(SPELL_DISEASE_CLOUD)) - DoCast(m_creature,SPELL_DISEASE_CLOUD); - if (!UpdateVictim()) - return; - if (KnockDownTimergetVictim(),SPELL_KNOCKDOWN); - KnockDownTimer = 15000+rand()%10000; - }else KnockDownTimer -= diff; - DoMeleeAttackIfReady(); - } -}; - - -CreatureAI* GetAI_mob_abomination(Creature* pCreature) -{ - return new mob_abominationAI(pCreature); -} - -#define SPELL_FRENZY 31540 - -struct mob_ghoulAI : public hyjal_trashAI -{ - mob_ghoulAI(Creature* c) : hyjal_trashAI(c) - { - pInstance = c->GetInstanceData(); - pGo = false; - pos = 0; - Reset(); - } - - bool pGo; - uint32 FrenzyTimer; - uint32 pos; - uint32 MoveTimer; - bool RandomMove; - void Reset() - { - FrenzyTimer = 5000+rand()%5000; - MoveTimer = 2000; - RandomMove = false; - } - - void WaypointReached(uint32 i) - { - pos = i; - if (i == 7 && pInstance && !IsOverrun) - { - if (pInstance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall - { - Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THRALL)); - if (target && target->isAlive()) - m_creature->AddThreat(target,0.0); - }else{ - Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_JAINAPROUDMOORE)); - if (target && target->isAlive()) - m_creature->AddThreat(target,0.0); - } - } - if (i == LastOverronPos && IsOverrun) - { - m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_ATTACKUNARMED); - if ((faction == 0 && LastOverronPos == 17) || (faction == 1 && LastOverronPos == 21)) - { - m_creature->setDeathState(DEAD); - m_creature->RemoveCorpse(); - } - - } - } - - void EnterCombat(Unit* who) {} - - void UpdateAI(const uint32 diff) - { - hyjal_trashAI::UpdateAI(diff); - if (IsEvent || IsOverrun) - npc_escortAI::UpdateAI(diff); - if (IsEvent) - { - if (!pGo) - { - pGo = true; - if (pInstance) - { - if (pInstance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, use horde WPs - { - for (uint8 i = 0; i < 8; ++i) - AddWaypoint(i, HordeWPs[i][0]+irand(-3,3), HordeWPs[i][1]+irand(-3,3), HordeWPs[i][2]); - Start(false, true); - SetDespawnAtEnd(false); - }else//use alliance WPs - { - for (uint8 i = 0; i < 8; ++i) - AddWaypoint(i, AllianceWPs[i][0]+irand(-3,3), AllianceWPs[i][1]+irand(-3,3), AllianceWPs[i][2]); - Start(false, true); - SetDespawnAtEnd(false); - } - } - } - } - if (FrenzyTimerGetInstanceData(); - pGo = false; - pos = 0; - Reset(); - } - SummonList summons; - bool pGo; - uint32 ShadowBoltTimer; - uint32 pos; - void Reset() - { - ShadowBoltTimer = 1000+rand()%5000; - summons.DespawnAll(); - } - - void JustSummoned(Creature* summon) - { - Unit* target = SelectTarget(SELECT_TARGET_RANDOM,0,30,true); - if (target && summon) - summon->Attack(target,false); - summons.Summon(summon); - } - void SummonedCreatureDespawn(Creature *summon) {summons.Despawn(summon);} - void WaypointReached(uint32 i) - { - pos = i; - if (i == 7 && pInstance && !IsOverrun) - { - if (pInstance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall - { - Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THRALL)); - if (target && target->isAlive()) - m_creature->AddThreat(target,0.0); - }else{ - Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_JAINAPROUDMOORE)); - if (target && target->isAlive()) - m_creature->AddThreat(target,0.0); - } - } - } - - void KilledUnit(Unit* victim) - { - switch (rand()%3) - { - case 0: - DoSpawnCreature(17902,3,0,0,0,TEMPSUMMON_TIMED_DESPAWN, 60000); - DoSpawnCreature(17902,-3,0,0,0,TEMPSUMMON_TIMED_DESPAWN, 60000); - break; - case 1: - DoSpawnCreature(17903,3,0,0,0,TEMPSUMMON_TIMED_DESPAWN, 60000); - DoSpawnCreature(17903,-3,0,0,0,TEMPSUMMON_TIMED_DESPAWN, 60000); - break; - case 2: - if (rand()%2) - DoSpawnCreature(17902,3,0,0,0,TEMPSUMMON_TIMED_DESPAWN, 60000); - else - DoSpawnCreature(17903,3,0,0,0,TEMPSUMMON_TIMED_DESPAWN, 60000); - break; - } - } - - void EnterCombat(Unit* who) {} - - void UpdateAI(const uint32 diff) - { - hyjal_trashAI::UpdateAI(diff); - if (IsEvent || IsOverrun) - npc_escortAI::UpdateAI(diff); - if (IsEvent) - { - if (!pGo) - { - pGo = true; - if (pInstance) - { - if (pInstance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, use horde WPs - { - for (uint8 i = 0; i < 8; ++i) - AddWaypoint(i, HordeWPs[i][0]+irand(-3,3), HordeWPs[i][1]+irand(-3,3), HordeWPs[i][2]); - Start(true, true); - SetDespawnAtEnd(false); - }else//use alliance WPs - { - for (uint8 i = 0; i < 8; ++i) - AddWaypoint(i, AllianceWPs[i][0]+irand(-3,3), AllianceWPs[i][1]+irand(-3,3), AllianceWPs[i][2]); - Start(true, true); - SetDespawnAtEnd(false); - } - } - } - } - if (!UpdateVictim()) - return; - if (ShadowBoltTimergetVictim(),SPELL_SHADOW_BOLT); - ShadowBoltTimer = 20000+rand()%10000; - }else ShadowBoltTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - - -CreatureAI* GetAI_mob_necromancer(Creature* pCreature) -{ - return new mob_necromancerAI(pCreature); -} - -#define SPELL_BANSHEE_CURSE 31651 -#define SPELL_BANSHEE_WAIL 38183 -#define SPELL_ANTI_MAGIC_SHELL 31662 - -struct mob_bansheeAI : public hyjal_trashAI -{ - mob_bansheeAI(Creature* c) : hyjal_trashAI(c) - { - pInstance = c->GetInstanceData(); - pGo = false; - pos = 0; - Reset(); - } - - bool pGo; - uint32 CourseTimer; - uint32 WailTimer; - uint32 ShellTimer; - uint32 pos; - void Reset() - { - CourseTimer = 20000+rand()%5000; - WailTimer = 15000+rand()%5000; - ShellTimer = 50000+rand()%10000; - } - - void WaypointReached(uint32 i) - { - pos = i; - if (i == 7 && pInstance && !IsOverrun) - { - if (pInstance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall - { - Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THRALL)); - if (target && target->isAlive()) - m_creature->AddThreat(target,0.0); - }else{ - Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_JAINAPROUDMOORE)); - if (target && target->isAlive()) - m_creature->AddThreat(target,0.0); - } - } - } - - void EnterCombat(Unit* who) {} - - void UpdateAI(const uint32 diff) - { - hyjal_trashAI::UpdateAI(diff); - if (IsEvent || IsOverrun) - npc_escortAI::UpdateAI(diff); - if (IsEvent) - { - if (!pGo) - { - pGo = true; - if (pInstance) - { - if (pInstance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, use horde WPs - { - for (uint8 i = 0; i < 8; ++i) - AddWaypoint(i, HordeWPs[i][0]+irand(-3,3), HordeWPs[i][1]+irand(-3,3), HordeWPs[i][2]); - Start(false, true); - SetDespawnAtEnd(false); - }else//use alliance WPs - { - for (uint8 i = 0; i < 8; ++i) - AddWaypoint(i, AllianceWPs[i][0]+irand(-3,3), AllianceWPs[i][1]+irand(-3,3), AllianceWPs[i][2]); - Start(false, true); - SetDespawnAtEnd(false); - } - } - } - } - if (!UpdateVictim()) - return; - if (CourseTimergetVictim(),SPELL_BANSHEE_CURSE); - CourseTimer = 20000+rand()%5000; - }else CourseTimer -= diff; - if (WailTimergetVictim(),SPELL_BANSHEE_WAIL); - WailTimer = 15000+rand()%5000; - }else WailTimer -= diff; - if (ShellTimerGetInstanceData(); - pGo = false; - pos = 0; - Reset(); - } - - bool pGo; - uint32 WebTimer; - uint32 pos; - void Reset() - { - WebTimer = 20000+rand()%5000; - } - - void WaypointReached(uint32 i) - { - pos = i; - if (i == 7 && pInstance && !IsOverrun) - { - if (pInstance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall - { - Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THRALL)); - if (target && target->isAlive()) - m_creature->AddThreat(target,0.0); - }else{ - Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_JAINAPROUDMOORE)); - if (target && target->isAlive()) - m_creature->AddThreat(target,0.0); - } - } - } - - void EnterCombat(Unit* who) {} - - void UpdateAI(const uint32 diff) - { - hyjal_trashAI::UpdateAI(diff); - if (IsEvent || IsOverrun) - npc_escortAI::UpdateAI(diff); - if (IsEvent) - { - if (!pGo) - { - pGo = true; - if (pInstance) - { - if (pInstance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, use horde WPs - { - for (uint8 i = 0; i < 8; ++i) - AddWaypoint(i, HordeWPs[i][0]+irand(-3,3), HordeWPs[i][1]+irand(-3,3), HordeWPs[i][2]); - Start(false, true); - SetDespawnAtEnd(false); - }else//use alliance WPs - { - for (uint8 i = 0; i < 8; ++i) - AddWaypoint(i, AllianceWPs[i][0]+irand(-3,3), AllianceWPs[i][1]+irand(-3,3), AllianceWPs[i][2]); - Start(false, true); - SetDespawnAtEnd(false); - } - - } - } - } - if (!UpdateVictim()) - return; - if (WebTimergetVictim(),SPELL_WEB); - WebTimer = 20000+rand()%5000; - }else WebTimer -= diff; - DoMeleeAttackIfReady(); - } -}; - - -CreatureAI* GetAI_mob_crypt_fiend(Creature* pCreature) -{ - return new mob_crypt_fiendAI(pCreature); -} - -#define SPELL_MANA_BURN 31729 - -struct mob_fel_stalkerAI : public hyjal_trashAI -{ - mob_fel_stalkerAI(Creature* c) : hyjal_trashAI(c) - { - pInstance = c->GetInstanceData(); - pGo = false; - pos = 0; - Reset(); - } - - bool pGo; - uint32 ManaBurnTimer; - uint32 pos; - void Reset() - { - ManaBurnTimer = 9000+rand()%5000; - } - - void WaypointReached(uint32 i) - { - pos = i; - if (i == 7 && pInstance && !IsOverrun) - { - if (pInstance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall - { - Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THRALL)); - if (target && target->isAlive()) - m_creature->AddThreat(target,0.0); - }else{ - Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_JAINAPROUDMOORE)); - if (target && target->isAlive()) - m_creature->AddThreat(target,0.0); - } - } - } - - void EnterCombat(Unit* who) {} - - void UpdateAI(const uint32 diff) - { - hyjal_trashAI::UpdateAI(diff); - if (IsEvent || IsOverrun) - npc_escortAI::UpdateAI(diff); - if (IsEvent) - { - if (!pGo) - { - pGo = true; - if (pInstance) - { - if (pInstance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, use horde WPs - { - for (uint8 i = 0; i < 8; ++i) - AddWaypoint(i, HordeWPs[i][0]+irand(-3,3), HordeWPs[i][1]+irand(-3,3), HordeWPs[i][2]); - Start(false, true); - SetDespawnAtEnd(false); - }else//use alliance WPs - { - for (uint8 i = 0; i < 8; ++i) - AddWaypoint(i, AllianceWPs[i][0]+irand(-3,3), AllianceWPs[i][1]+irand(-3,3), AllianceWPs[i][2]); - Start(false, true); - SetDespawnAtEnd(false); - } - - } - } - } - if (!UpdateVictim()) - return; - if (ManaBurnTimergetVictim(),SPELL_MANA_BURN); - ManaBurnTimer = 9000+rand()%5000; - }else ManaBurnTimer -= diff; - DoMeleeAttackIfReady(); - } -}; - - -CreatureAI* GetAI_mob_fel_stalker(Creature* pCreature) -{ - return new mob_fel_stalkerAI(pCreature); -} - -#define SPELL_FROST_BREATH 31688 - -struct mob_frost_wyrmAI : public hyjal_trashAI -{ - mob_frost_wyrmAI(Creature* c) : hyjal_trashAI(c) - { - pInstance = c->GetInstanceData(); - pGo = false; - pos = 0; - Reset(); - } - - bool pGo; - uint32 FrostBreathTimer; - uint32 pos; - uint32 MoveTimer; - - void Reset() - { - FrostBreathTimer = 5000; - MoveTimer = 0; - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - } - - void WaypointReached(uint32 i) - { - pos = i; - if (i == 2 && pInstance && !IsOverrun) - { - Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THRALL)); - if (target && target->isAlive()) - { - m_creature->AddThreat(target,0.0); - DoCast(target,SPELL_FROST_BREATH,true); - } - } - } - - void JustDied(Unit *victim) - { - if (pInstance && IsEvent) - pInstance->SetData(DATA_TRASH, 0);//signal trash is dead - - float x,y,z; - m_creature->GetPosition(x,y,z); - z = m_creature->GetMap()->GetVmapHeight(x, y, z, true); - m_creature->GetMotionMaster()->MovePoint(0,x,y,z); - m_creature->GetMap()->CreatureRelocation(m_creature, x,y,z,0); - } - - void EnterCombat(Unit* who) {} - - void UpdateAI(const uint32 diff) - { - hyjal_trashAI::UpdateAI(diff); - if (IsEvent || IsOverrun) - { - CAST_AI(hyjal_trashAI, m_creature->AI())->SetCanMelee(false); - npc_escortAI::UpdateAI(diff); - } - if (IsEvent) - { - if (!pGo) - { - pGo = true; - if (pInstance) - { - if (!useFlyPath) - { - for (uint8 i = 0; i < 3; ++i) - AddWaypoint(i, FrostWyrmWPs[i][0], FrostWyrmWPs[i][1], FrostWyrmWPs[i][2]); - Start(false, true); - SetDespawnAtEnd(false); - }else{//fly path FlyPathWPs - for (uint8 i = 0; i < 3; ++i) - AddWaypoint(i, FlyPathWPs[i][0]+irand(-10,10), FlyPathWPs[i][1]+irand(-10,10), FlyPathWPs[i][2]); - Start(false, true); - SetDespawnAtEnd(false); - } - } - } - } - if (!UpdateVictim()) - return; - if (!m_creature->IsWithinDist(m_creature->getVictim(), 25)){ - if (MoveTimerGetMotionMaster()->MoveChase(m_creature->getVictim()); - MoveTimer = 2000; - }else MoveTimer-=diff; - } - - if (FrostBreathTimerIsWithinDist(m_creature->getVictim(), 25)) - { - DoCast(m_creature->getVictim(),SPELL_FROST_BREATH); - m_creature->StopMoving(); - m_creature->GetMotionMaster()->Clear(); - FrostBreathTimer = 4000; - } - }else FrostBreathTimer -= diff; - } -}; - - -CreatureAI* GetAI_mob_frost_wyrm(Creature* pCreature) -{ - return new mob_frost_wyrmAI(pCreature); -} - -#define SPELL_GARGOYLE_STRIKE 31664 - -struct mob_gargoyleAI : public hyjal_trashAI -{ - mob_gargoyleAI(Creature* c) : hyjal_trashAI(c) - { - pInstance = c->GetInstanceData(); - pGo = false; - pos = 0; - DummyTarget[0] = 0;DummyTarget[1] = 0;DummyTarget[2] = 0; - Reset(); - } - - bool pGo; - uint32 StrikeTimer; - uint32 pos; - uint32 MoveTimer; - float Zpos; - bool forcemove; - - void Reset() - { - forcemove = true; - Zpos = 10.0; - StrikeTimer = 2000+rand()%5000; - MoveTimer = 0; - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - } - - void WaypointReached(uint32 i) - { - pos = i; - if (i == 2 && pInstance && !IsOverrun) - { - Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THRALL)); - if (target && target->isAlive()) - { - m_creature->AddThreat(target,0.0); - DoCast(target,SPELL_GARGOYLE_STRIKE,true); - } - } - } - - void JustDied(Unit *victim) - { - float x,y,z; - m_creature->GetPosition(x,y,z); - z = m_creature->GetMap()->GetVmapHeight(x, y, z, true); - m_creature->GetMotionMaster()->MovePoint(0,x,y,z); - m_creature->GetMap()->CreatureRelocation(m_creature, x,y,z,0); - hyjal_trashAI::JustDied(victim); - } - - void UpdateAI(const uint32 diff) - { - hyjal_trashAI::UpdateAI(diff); - if (IsEvent || IsOverrun) - { - CAST_AI(hyjal_trashAI, m_creature->AI())->SetCanMelee(false); - npc_escortAI::UpdateAI(diff); - } - if (IsEvent) - { - if (!pGo) - { - pGo = true; - if (pInstance) - { - if (!useFlyPath) - { - for (uint8 i = 0; i < 3; ++i) - AddWaypoint(i, GargoyleWPs[i][0]+irand(-10,10), GargoyleWPs[i][1]+irand(-10,10), GargoyleWPs[i][2]); - Start(false, true); - SetDespawnAtEnd(false); - }else{//fly path FlyPathWPs - for (uint8 i = 0; i < 3; ++i) - AddWaypoint(i, FlyPathWPs[i][0]+irand(-10,10), FlyPathWPs[i][1]+irand(-10,10), FlyPathWPs[i][2]); - Start(false, true); - SetDespawnAtEnd(false); - } - } - } - } - if (IsOverrun && !UpdateVictim()) - { - if (faction == 0)//alliance - { - if (StrikeTimerCastSpell(DummyTarget[0],DummyTarget[1],DummyTarget[2],SPELL_GARGOYLE_STRIKE,false); - StrikeTimer = 2000+rand()%1000; - }else StrikeTimer -= diff; - } - } - if (!UpdateVictim()) - return; - if (!m_creature->IsWithinDist(m_creature->getVictim(), 20) || forcemove) - { - forcemove = false; - if (forcemove) - { - Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (target) - m_creature->Attack(target,false); - } - if (MoveTimergetVictim()->GetPosition(x,y,z); - m_creature->GetMotionMaster()->MovePoint(0,x,y,z+Zpos); - Zpos-=1.0; - if (Zpos<=0)Zpos=0; - MoveTimer = 2000; - }else MoveTimer-=diff; - } - if (StrikeTimerIsWithinDist(m_creature->getVictim(), 20)) - { - DoCast(m_creature->getVictim(),SPELL_GARGOYLE_STRIKE); - m_creature->StopMoving(); - m_creature->GetMotionMaster()->Clear(); - StrikeTimer = 2000+rand()%1000; - }else StrikeTimer=0; - }else StrikeTimer -= diff; - } -}; - - -CreatureAI* GetAI_mob_gargoyle(Creature* pCreature) -{ - return new mob_gargoyleAI(pCreature); -} - -#define SPELL_EXPLODING_SHOT 7896 - -struct TRINITY_DLL_DECL alliance_riflemanAI : public Scripted_NoMovementAI -{ - alliance_riflemanAI(Creature *c) : Scripted_NoMovementAI(c) - { - Reset(); - } - - uint32 ExplodeTimer; - - void JustDied(Unit* who) - { - } - - void Reset() - { - ExplodeTimer = 5000+rand()%5000; - } - - void MoveInLineOfSight(Unit *who) - { - if (!who || m_creature->getVictim()) - return; - - if (who->isTargetableForAttack() && m_creature->IsHostileTo(who)) - { - float attackRadius = m_creature->GetAttackDistance(who); - if (m_creature->IsWithinDistInMap(who, 30)) - { - AttackStart(who); - } - } - } - - void EnterCombat(Unit *who) - { - } - - void UpdateAI(const uint32 diff) - { - //Check if we have a target - if (!UpdateVictim()) - return; - if (ExplodeTimer < diff) - { - if (!m_creature->IsWithinDistInMap(m_creature->getVictim(), 30)) - { - EnterEvadeMode(); - return; - } - int dmg = 500+rand()%700; - m_creature->CastCustomSpell(m_creature->getVictim(), SPELL_EXPLODING_SHOT, &dmg, 0, 0, false); - ExplodeTimer = 5000+rand()%5000; - }else ExplodeTimer -= diff; - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_alliance_rifleman(Creature* pCreature) -{ - return new alliance_riflemanAI(pCreature); -} - -void AddSC_hyjal_trash() -{ - Script *newscript = new Script; - newscript->Name = "mob_giant_infernal"; - newscript->GetAI = &GetAI_mob_giant_infernal; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_abomination"; - newscript->GetAI = &GetAI_mob_abomination; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_ghoul"; - newscript->GetAI = &GetAI_mob_ghoul; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_necromancer"; - newscript->GetAI = &GetAI_mob_necromancer; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_banshee"; - newscript->GetAI = &GetAI_mob_banshee; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_crypt_fiend"; - newscript->GetAI = &GetAI_mob_crypt_fiend; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_fel_stalker"; - newscript->GetAI = &GetAI_mob_fel_stalker; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_frost_wyrm"; - newscript->GetAI = &GetAI_mob_frost_wyrm; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_gargoyle"; - newscript->GetAI = &GetAI_mob_gargoyle; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "alliance_rifleman"; - newscript->GetAI = &GetAI_alliance_rifleman; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal_trash.h b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal_trash.h deleted file mode 100644 index 9eeff8a03f4..00000000000 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal_trash.h +++ /dev/null @@ -1,35 +0,0 @@ - -#ifndef SC_HYJAL_TRASH_AI_H -#define SC_HYJAL_TRASH_AI_H - -#include "def_hyjal.h" -#include "escortAI.h" - -#define MINRAIDDAMAGE 700000//minimal damage before trash can drop loot and reputation, resets if faction leader dies - -struct TRINITY_DLL_DECL hyjal_trashAI : public npc_escortAI -{ - hyjal_trashAI(Creature *c); - - void UpdateAI(const uint32 diff); - - void JustDied(Unit* killer); - - void DamageTaken(Unit *done_by, uint32 &damage); - - public: - ScriptedInstance* pInstance; - bool IsEvent; - uint32 Delay; - uint32 LastOverronPos; - bool IsOverrun; - bool SetupOverrun; - uint32 OverrunType; - uint8 faction; - bool useFlyPath; - uint32 damageTaken; - float DummyTarget[3]; - - //private: -}; -#endif \ No newline at end of file diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/instance_hyjal.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/instance_hyjal.cpp deleted file mode 100644 index 83fbbc67b73..00000000000 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/instance_hyjal.cpp +++ /dev/null @@ -1,322 +0,0 @@ - /* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Instance_Mount_Hyjal -SD%Complete: 100 -SDComment: Instance Data Scripts and functions to acquire mobs and set encounter status for use in various Hyjal Scripts -SDCategory: Caverns of Time, Mount Hyjal -EndScriptData */ - -#include "precompiled.h" -#include "def_hyjal.h" -#include "hyjal_trash.h" - -enum -{ - MAX_ENCOUNTER = 5, - - GO_ANCIENT_GEM = 185557 -}; -/* Battle of Mount Hyjal encounters: -0 - Rage Winterchill event -1 - Anetheron event -2 - Kaz'rogal event -3 - Azgalor event -4 - Archimonde event -*/ - -struct TRINITY_DLL_DECL instance_mount_hyjal : public ScriptedInstance -{ - instance_mount_hyjal(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; - - uint32 m_auiEncounter[MAX_ENCOUNTER]; - std::string str_data; - - std::list m_uiAncientGemGUID; - - uint64 RageWinterchill; - uint64 Anetheron; - uint64 Kazrogal; - uint64 Azgalor; - uint64 Archimonde; - uint64 JainaProudmoore; - uint64 Thrall; - uint64 TyrandeWhisperwind; - uint64 HordeGate; - uint64 ElfGate; - - uint32 Trash; - - - uint32 hordeRetreat; - uint32 allianceRetreat; - bool ArchiYell; - - uint32 RaidDamage; - - void Initialize() - { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - - m_uiAncientGemGUID.clear(); - - RageWinterchill = 0; - Anetheron = 0; - Kazrogal = 0; - Azgalor = 0; - Archimonde = 0; - JainaProudmoore = 0; - Thrall = 0; - TyrandeWhisperwind = 0; - HordeGate = 0; - ElfGate = 0; - ArchiYell = false; - RaidDamage = 0; - - Trash = 0; - - hordeRetreat = 0; - allianceRetreat = 0; - } - - bool IsEncounterInProgress() const - { - for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) return true; - - return false; - } - - void OnGameObjectCreate(GameObject* pGo, bool add) - { - switch(pGo->GetEntry()) - { - case 182060: - HordeGate = pGo->GetGUID(); - if (allianceRetreat) - HandleGameObject(0, true, pGo); - else - HandleGameObject(0, false, pGo); - break; - case 182061: - ElfGate = pGo->GetGUID(); - if (hordeRetreat) - HandleGameObject(0, true, pGo); - else - HandleGameObject(0, false, pGo); - break; - case GO_ANCIENT_GEM: - m_uiAncientGemGUID.push_back(pGo->GetGUID()); - break; - } - } - - void OnCreatureCreate(Creature* pCreature, bool add) - { - switch(pCreature->GetEntry()) - { - case 17767: RageWinterchill = pCreature->GetGUID(); break; - case 17808: Anetheron = pCreature->GetGUID(); break; - case 17888: Kazrogal = pCreature->GetGUID(); break; - case 17842: Azgalor = pCreature->GetGUID(); break; - case 17968: Archimonde = pCreature->GetGUID(); break; - case 17772: JainaProudmoore = pCreature->GetGUID(); break; - case 17852: Thrall = pCreature->GetGUID(); break; - case 17948: TyrandeWhisperwind = pCreature->GetGUID(); break; - } - } - - uint64 GetData64(uint32 identifier) - { - switch(identifier) - { - case DATA_RAGEWINTERCHILL: return RageWinterchill; - case DATA_ANETHERON: return Anetheron; - case DATA_KAZROGAL: return Kazrogal; - case DATA_AZGALOR: return Azgalor; - case DATA_ARCHIMONDE: return Archimonde; - case DATA_JAINAPROUDMOORE: return JainaProudmoore; - case DATA_THRALL: return Thrall; - case DATA_TYRANDEWHISPERWIND: return TyrandeWhisperwind; - } - - return 0; - } - - void SetData(uint32 type, uint32 data) - { - switch(type) - { - case DATA_RAGEWINTERCHILLEVENT: m_auiEncounter[0] = data; break; - case DATA_ANETHERONEVENT: - m_auiEncounter[1] = data; - break; - case DATA_KAZROGALEVENT: m_auiEncounter[2] = data; break; - case DATA_AZGALOREVENT: - { - m_auiEncounter[3] = data; - if (data==DONE) - { - if (ArchiYell)break; - ArchiYell = true; - - Creature* pCreature = instance->GetCreature(Azgalor); - if (pCreature) - { - Creature* pUnit = pCreature->SummonCreature(21987,pCreature->GetPositionX(),pCreature->GetPositionY(),pCreature->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN,10000); - - Map* pMap = pCreature->GetMap(); - if (pMap->IsDungeon() && pUnit) - { - pUnit->SetVisibility(VISIBILITY_OFF); - Map::PlayerList const &PlayerList = pMap->GetPlayers(); - if (PlayerList.isEmpty()) - return; - - for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) - { - if (i->getSource()) - { - WorldPacket data(SMSG_MESSAGECHAT, 200); - pUnit->BuildMonsterChat(&data,CHAT_MSG_MONSTER_YELL,"All of your efforts have been in vain, for the draining of the World Tree has already begun. Soon the heart of your world will beat no more.",0,"Archimonde",i->getSource()->GetGUID()); - i->getSource()->GetSession()->SendPacket(&data); - - WorldPacket data2(SMSG_PLAY_SOUND, 4); - data2 << 10986; - i->getSource()->GetSession()->SendPacket(&data2); - } - } - } - } - } - } - break; - case DATA_ARCHIMONDEEVENT: m_auiEncounter[4] = data; break; - case DATA_RESET_TRASH_COUNT: Trash = 0; break; - - case DATA_TRASH: - if (data) Trash = data; - else Trash--; - DoUpdateWorldState(WORLD_STATE_ENEMYCOUNT, Trash); - break; - case TYPE_RETREAT: - if (data == SPECIAL) - { - if (!m_uiAncientGemGUID.empty()) - { - for(std::list::iterator itr = m_uiAncientGemGUID.begin(); itr != m_uiAncientGemGUID.end(); ++itr) - { - //don't know how long it expected - DoRespawnGameObject(*itr,DAY); - } - } - } - break; - case DATA_ALLIANCE_RETREAT: - allianceRetreat = data; - HandleGameObject(HordeGate, true); - SaveToDB(); - break; - case DATA_HORDE_RETREAT: - hordeRetreat = data; - HandleGameObject(ElfGate, true); - SaveToDB(); - break; - case DATA_RAIDDAMAGE: - RaidDamage += data; - if (RaidDamage >= MINRAIDDAMAGE) - RaidDamage = MINRAIDDAMAGE; - break; - case DATA_RESET_RAIDDAMAGE: - RaidDamage = 0; - break; - } - - debug_log("TSCR: Instance Hyjal: Instance data updated for event %u (Data=%u)",type,data); - - if (data == DONE) - { - OUT_SAVE_INST_DATA; - - std::ostringstream saveStream; - saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " " - << m_auiEncounter[3] << " " << m_auiEncounter[4] - << " " << allianceRetreat << " " << hordeRetreat - << " " << RaidDamage; - - str_data = saveStream.str(); - - SaveToDB(); - OUT_SAVE_INST_DATA_COMPLETE; - } - - } - - uint32 GetData(uint32 type) - { - switch(type) - { - case DATA_RAGEWINTERCHILLEVENT: return m_auiEncounter[0]; - case DATA_ANETHERONEVENT: return m_auiEncounter[1]; - case DATA_KAZROGALEVENT: return m_auiEncounter[2]; - case DATA_AZGALOREVENT: return m_auiEncounter[3]; - case DATA_ARCHIMONDEEVENT: return m_auiEncounter[4]; - case DATA_TRASH: return Trash; - case DATA_ALLIANCE_RETREAT: return allianceRetreat; - case DATA_HORDE_RETREAT: return hordeRetreat; - case DATA_RAIDDAMAGE: return RaidDamage; - } - return 0; - } - - std::string GetSaveData() - { - return str_data; - } - - void Load(const char* in) - { - if (!in) - { - OUT_LOAD_INST_DATA_FAIL; - return; - } - - OUT_LOAD_INST_DATA(in); - std::istringstream loadStream(in); - loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3] >> m_auiEncounter[4] >> allianceRetreat >> hordeRetreat >> RaidDamage; - for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) // Do not load an encounter as IN_PROGRESS - reset it instead. - m_auiEncounter[i] = NOT_STARTED; - OUT_LOAD_INST_DATA_COMPLETE; - } -}; - -InstanceData* GetInstanceData_instance_mount_hyjal(Map* pMap) -{ - return new instance_mount_hyjal(pMap); -} - -void AddSC_instance_mount_hyjal() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_hyjal"; - newscript->GetInstanceData = &GetInstanceData_instance_mount_hyjal; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/boss_captain_skarloc.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/boss_captain_skarloc.cpp deleted file mode 100644 index 0c6c98d9758..00000000000 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/boss_captain_skarloc.cpp +++ /dev/null @@ -1,156 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Captain_Skarloc -SD%Complete: 75 -SDComment: Missing adds, missing waypoints to move up to Thrall once spawned + speech before enter combat. -SDCategory: Caverns of Time, Old Hillsbrad Foothills -EndScriptData */ - -#include "precompiled.h" -#include "def_old_hillsbrad.h" - -#define SAY_ENTER -1560000 -#define SAY_TAUNT1 -1560001 -#define SAY_TAUNT2 -1560002 -#define SAY_SLAY1 -1560003 -#define SAY_SLAY2 -1560004 -#define SAY_DEATH -1560005 - -#define SPELL_HOLY_LIGHT 29427 -#define SPELL_CLEANSE 29380 -#define SPELL_HAMMER_OF_JUSTICE 13005 -#define SPELL_HOLY_SHIELD 31904 -#define SPELL_DEVOTION_AURA 8258 -#define SPELL_CONSECRATION 38385 - -struct TRINITY_DLL_DECL boss_captain_skarlocAI : public ScriptedAI -{ - boss_captain_skarlocAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance *pInstance; - - uint32 Holy_Light_Timer; - uint32 Cleanse_Timer; - uint32 HammerOfJustice_Timer; - uint32 HolyShield_Timer; - uint32 DevotionAura_Timer; - uint32 Consecration_Timer; - - void Reset() - { - Holy_Light_Timer = 20000 + rand()%10000; - Cleanse_Timer = 10000; - HammerOfJustice_Timer = 20000 + rand()%15000; - HolyShield_Timer = 240000; - DevotionAura_Timer = 3000; - Consecration_Timer = 8000; - } - - void EnterCombat(Unit *who) - { - //This is not correct. Should taunt Thrall before engage in combat - DoScriptText(SAY_TAUNT1, m_creature); - DoScriptText(SAY_TAUNT2, m_creature); - } - - void KilledUnit(Unit *victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; - } - } - - void JustDied(Unit *victim) - { - DoScriptText(SAY_DEATH, m_creature); - - if (pInstance && pInstance->GetData(TYPE_THRALL_EVENT) == IN_PROGRESS) - pInstance->SetData(TYPE_THRALL_PART1, DONE); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //Holy_Light - if (Holy_Light_Timer < diff) - { - DoCast(m_creature, SPELL_HOLY_LIGHT); - Holy_Light_Timer = 30000; - }else Holy_Light_Timer -= diff; - - //Cleanse - if (Cleanse_Timer < diff) - { - DoCast(m_creature, SPELL_CLEANSE); - Cleanse_Timer = 10000; - } else Cleanse_Timer -= diff; - - //Hammer of Justice - if (HammerOfJustice_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_HAMMER_OF_JUSTICE); - HammerOfJustice_Timer = 60000; - }else HammerOfJustice_Timer -= diff; - - //Holy Shield - if (HolyShield_Timer < diff) - { - DoCast(m_creature, SPELL_HOLY_SHIELD); - HolyShield_Timer = 240000; - }else HolyShield_Timer -= diff; - - //Devotion_Aura - if (DevotionAura_Timer < diff) - { - DoCast(m_creature, SPELL_DEVOTION_AURA); - DevotionAura_Timer = 45000 + rand()%10000; - }else DevotionAura_Timer -= diff; - - //Consecration - if (Consecration_Timer < diff) - { - //DoCast(m_creature->getVictim(), SPELL_CONSECRATION); - Consecration_Timer = 5000 + rand()%5000; - }else Consecration_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_captain_skarloc(Creature* pCreature) -{ - return new boss_captain_skarlocAI (pCreature); -} - -void AddSC_boss_captain_skarloc() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_captain_skarloc"; - newscript->GetAI = &GetAI_boss_captain_skarloc; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/boss_epoch_hunter.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/boss_epoch_hunter.cpp deleted file mode 100644 index 138a59cce93..00000000000 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/boss_epoch_hunter.cpp +++ /dev/null @@ -1,150 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Epoch_Hunter -SD%Complete: 60 -SDComment: Missing spawns pre-event, missing speech to be coordinated with rest of escort event. -SDCategory: Caverns of Time, Old Hillsbrad Foothills -EndScriptData */ - -#include "precompiled.h" -#include "def_old_hillsbrad.h" - -#define SAY_ENTER1 -1560013 -#define SAY_ENTER2 -1560014 -#define SAY_ENTER3 -1560015 -#define SAY_AGGRO1 -1560016 -#define SAY_AGGRO2 -1560017 -#define SAY_SLAY1 -1560018 -#define SAY_SLAY2 -1560019 -#define SAY_BREATH1 -1560020 -#define SAY_BREATH2 -1560021 -#define SAY_DEATH -1560022 - -#define SPELL_SAND_BREATH 31914 -#define SPELL_IMPENDING_DEATH 31916 -#define SPELL_MAGIC_DISRUPTION_AURA 33834 -#define SPELL_WING_BUFFET 31475 - -struct TRINITY_DLL_DECL boss_epoch_hunterAI : public ScriptedAI -{ - boss_epoch_hunterAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance *pInstance; - - uint32 SandBreath_Timer; - uint32 ImpendingDeath_Timer; - uint32 WingBuffet_Timer; - uint32 Mda_Timer; - - void Reset() - { - SandBreath_Timer = 8000 + rand()%8000; - ImpendingDeath_Timer = 25000 + rand()%5000; - WingBuffet_Timer = 35000; - Mda_Timer = 40000; - } - - void EnterCombat(Unit *who) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_AGGRO1, m_creature); break; - case 1: DoScriptText(SAY_AGGRO2, m_creature); break; - } - } - - void KilledUnit(Unit *victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; - } - } - - void JustDied(Unit *victim) - { - DoScriptText(SAY_DEATH, m_creature); - - if (pInstance && pInstance->GetData(TYPE_THRALL_EVENT) == IN_PROGRESS) - pInstance->SetData(TYPE_THRALL_PART4, DONE); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //Sand Breath - if (SandBreath_Timer < diff) - { - if (m_creature->IsNonMeleeSpellCasted(false)) - m_creature->InterruptNonMeleeSpells(false); - - DoCast(m_creature->getVictim(),SPELL_SAND_BREATH); - - switch(rand()%2) - { - case 0: DoScriptText(SAY_BREATH1, m_creature); break; - case 1: DoScriptText(SAY_BREATH2, m_creature); break; - } - - SandBreath_Timer = 10000 + rand()%10000; - }else SandBreath_Timer -= diff; - - if (ImpendingDeath_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_IMPENDING_DEATH); - ImpendingDeath_Timer = 25000+rand()%5000; - }else ImpendingDeath_Timer -= diff; - - if (WingBuffet_Timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_WING_BUFFET); - WingBuffet_Timer = 25000+rand()%10000; - }else WingBuffet_Timer -= diff; - - if (Mda_Timer < diff) - { - DoCast(m_creature,SPELL_MAGIC_DISRUPTION_AURA); - Mda_Timer = 15000; - }else Mda_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_epoch_hunter(Creature* pCreature) -{ - return new boss_epoch_hunterAI (pCreature); -} - -void AddSC_boss_epoch_hunter() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_epoch_hunter"; - newscript->GetAI = &GetAI_boss_epoch_hunter; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/boss_leutenant_drake.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/boss_leutenant_drake.cpp deleted file mode 100644 index 266f61354c0..00000000000 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/boss_leutenant_drake.cpp +++ /dev/null @@ -1,194 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Luetenant_Drake -SD%Complete: 70 -SDComment: Missing proper code for patrolling area after being spawned. Script for GO (barrels) quest 10283 -SDCategory: Caverns of Time, Old Hillsbrad Foothills -EndScriptData */ - -#include "precompiled.h" -#include "def_old_hillsbrad.h" -#include "escortAI.h" - -/*###### -## go_barrel_old_hillsbrad -######*/ - -bool GOHello_go_barrel_old_hillsbrad(Player* pPlayer, GameObject* pGO) -{ - if (ScriptedInstance* pInstance = pGO->GetInstanceData()) - { - if (pInstance->GetData(TYPE_BARREL_DIVERSION) == DONE) - return false; - - pInstance->SetData(TYPE_BARREL_DIVERSION, IN_PROGRESS); - } - - return false; -} - -/*###### -## boss_lieutenant_drake -######*/ - -#define SAY_ENTER -1560006 -#define SAY_AGGRO -1560007 -#define SAY_SLAY1 -1560008 -#define SAY_SLAY2 -1560009 -#define SAY_MORTAL -1560010 -#define SAY_SHOUT -1560011 -#define SAY_DEATH -1560012 - -#define SPELL_WHIRLWIND 31909 -#define SPELL_HAMSTRING 9080 -#define SPELL_MORTAL_STRIKE 31911 -#define SPELL_FRIGHTENING_SHOUT 33789 - -struct Location -{ - uint32 wpId; - float x; - float y; - float z; -}; - -static Location DrakeWP[]= -{ - {0, 2125.84, 88.2535, 54.8830}, - {1, 2111.01, 93.8022, 52.6356}, - {2, 2106.70, 114.753, 53.1965}, - {3, 2107.76, 138.746, 52.5109}, - {4, 2114.83, 160.142, 52.4738}, - {5, 2125.24, 178.909, 52.7283}, - {6, 2151.02, 208.901, 53.1551}, - {7, 2177.00, 233.069, 52.4409}, - {8, 2190.71, 227.831, 53.2742}, - {9, 2178.14, 214.219, 53.0779}, - {10, 2154.99, 202.795, 52.6446}, - {11, 2132.00, 191.834, 52.5709}, - {12, 2117.59, 166.708, 52.7686}, - {13, 2093.61, 139.441, 52.7616}, - {14, 2086.29, 104.950, 52.9246}, - {15, 2094.23, 81.2788, 52.6946}, - {16, 2108.70, 85.3075, 53.3294}, - {17, 2125.50, 88.9481, 54.7953}, - {18, 2128.20, 70.9763, 64.4221} -}; - -struct TRINITY_DLL_DECL boss_lieutenant_drakeAI : public ScriptedAI -{ - boss_lieutenant_drakeAI(Creature *c) : ScriptedAI(c) {} - - bool CanPatrol; - uint32 wpId; - - uint32 Whirlwind_Timer; - uint32 Fear_Timer; - uint32 MortalStrike_Timer; - uint32 ExplodingShout_Timer; - - void Reset() - { - CanPatrol = true; - wpId = 0; - - Whirlwind_Timer = 20000; - Fear_Timer = 30000; - MortalStrike_Timer = 45000; - ExplodingShout_Timer = 25000; - } - - void EnterCombat(Unit *who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - - void KilledUnit(Unit *victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; - } - } - - void JustDied(Unit *victim) - { - DoScriptText(SAY_DEATH, m_creature); - } - - void UpdateAI(const uint32 diff) - { - //TODO: make this work - if (CanPatrol && wpId == 0) - { - m_creature->GetMotionMaster()->MovePoint(DrakeWP[0].wpId, DrakeWP[0].x, DrakeWP[0].y, DrakeWP[0].z); - wpId++; - } - - //Return since we have no target - if (!UpdateVictim()) - return; - - //Whirlwind - if (Whirlwind_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_WHIRLWIND); - Whirlwind_Timer = 20000+rand()%5000; - }else Whirlwind_Timer -= diff; - - //Fear - if (Fear_Timer < diff) - { - DoScriptText(SAY_SHOUT, m_creature); - DoCast(m_creature->getVictim(), SPELL_FRIGHTENING_SHOUT); - Fear_Timer = 25000+rand()%10000; - }else Fear_Timer -= diff; - - //Mortal Strike - if (MortalStrike_Timer < diff) - { - DoScriptText(SAY_MORTAL, m_creature); - DoCast(m_creature->getVictim(), SPELL_MORTAL_STRIKE); - MortalStrike_Timer = 20000+rand()%10000; - }else MortalStrike_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_lieutenant_drake(Creature* pCreature) -{ - return new boss_lieutenant_drakeAI (pCreature); -} - -void AddSC_boss_lieutenant_drake() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="go_barrel_old_hillsbrad"; - newscript->pGOHello = &GOHello_go_barrel_old_hillsbrad; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="boss_lieutenant_drake"; - newscript->GetAI = &GetAI_boss_lieutenant_drake; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/def_old_hillsbrad.h b/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/def_old_hillsbrad.h deleted file mode 100644 index 3253a384217..00000000000 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/def_old_hillsbrad.h +++ /dev/null @@ -1,19 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ - -#ifndef DEF_OLD_HILLSBRAD_H -#define DEF_OLD_HILLSBRAD_H - -#define TYPE_BARREL_DIVERSION 1 -#define TYPE_THRALL_EVENT 2 -#define TYPE_THRALL_PART1 3 -#define TYPE_THRALL_PART2 4 -#define TYPE_THRALL_PART3 5 -#define TYPE_THRALL_PART4 6 -#define DATA_THRALL 7 -#define DATA_TARETHA 8 -#define DATA_EPOCH 9 -#define WORLD_STATE_OH 2436 -#endif - diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/instance_old_hillsbrad.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/instance_old_hillsbrad.cpp deleted file mode 100644 index b8ec8f2e111..00000000000 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/instance_old_hillsbrad.cpp +++ /dev/null @@ -1,238 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Instance_Old_Hillsbrad -SD%Complete: 75 -SDComment: If thrall escort fail, all parts will reset. In future, save sub-parts and continue from last known. -SDCategory: Caverns of Time, Old Hillsbrad Foothills -EndScriptData */ - -#include "precompiled.h" -#include "def_old_hillsbrad.h" - -#define MAX_ENCOUNTER 6 - -#define THRALL_ENTRY 17876 -#define TARETHA_ENTRY 18887 -#define EPOCH_ENTRY 18096 - -#define DRAKE_ENTRY 17848 - -#define QUEST_ENTRY_DIVERSION 10283 -#define LODGE_QUEST_TRIGGER 20155 - -struct TRINITY_DLL_DECL instance_old_hillsbrad : public ScriptedInstance -{ - instance_old_hillsbrad(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; - - uint32 m_auiEncounter[MAX_ENCOUNTER]; - uint32 mBarrelCount; - uint32 mThrallEventCount; - - uint64 ThrallGUID; - uint64 TarethaGUID; - uint64 EpochGUID; - - void Initialize() - { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - - mBarrelCount = 0; - mThrallEventCount = 0; - ThrallGUID = 0; - TarethaGUID = 0; - EpochGUID = 0; - } - - Player* GetPlayerInMap() - { - Map::PlayerList const& players = instance->GetPlayers(); - - if (!players.isEmpty()) - { - for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) - { - if (Player* plr = itr->getSource()) - return plr; - } - } - - debug_log("TSCR: Instance Old Hillsbrad: GetPlayerInMap, but PlayerList is empty!"); - return NULL; - } - - void UpdateQuestCredit() - { - Map::PlayerList const& players = instance->GetPlayers(); - - if (!players.isEmpty()) - { - for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) - { - if (Player* pPlayer = itr->getSource()) - pPlayer->KilledMonsterCredit(LODGE_QUEST_TRIGGER,0); - } - } - } - - void OnCreatureCreate(Creature* pCreature, bool add) - { - switch(pCreature->GetEntry()) - { - case THRALL_ENTRY: - ThrallGUID = pCreature->GetGUID(); - break; - case TARETHA_ENTRY: - TarethaGUID = pCreature->GetGUID(); - break; - case EPOCH_ENTRY: - EpochGUID = pCreature->GetGUID(); - break; - } - } - - void SetData(uint32 type, uint32 data) - { - Player* pPlayer = GetPlayerInMap(); - - if (!pPlayer) - { - debug_log("TSCR: Instance Old Hillsbrad: SetData (Type: %u Data %u) cannot find any player.", type, data); - return; - } - - switch(type) - { - case TYPE_BARREL_DIVERSION: - { - if (data == IN_PROGRESS) - { - if (mBarrelCount >= 5) - return; - - ++mBarrelCount; - DoUpdateWorldState(WORLD_STATE_OH, mBarrelCount); - - debug_log("TSCR: Instance Old Hillsbrad: go_barrel_old_hillsbrad count %u",mBarrelCount); - - m_auiEncounter[0] = IN_PROGRESS; - - if (mBarrelCount == 5) - { - UpdateQuestCredit(); - pPlayer->SummonCreature(DRAKE_ENTRY, 2128.43, 71.01, 64.42, 1.74, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 1800000); - m_auiEncounter[0] = DONE; - } - } - break; - } - case TYPE_THRALL_EVENT: - { - if (data == FAIL) - { - if (mThrallEventCount <= 20) - { - mThrallEventCount++; - m_auiEncounter[1] = NOT_STARTED; - debug_log("TSCR: Instance Old Hillsbrad: Thrall event failed %u times. Resetting all sub-events.",mThrallEventCount); - m_auiEncounter[2] = NOT_STARTED; - m_auiEncounter[3] = NOT_STARTED; - m_auiEncounter[4] = NOT_STARTED; - m_auiEncounter[5] = NOT_STARTED; - } - else if (mThrallEventCount > 20) - { - m_auiEncounter[1] = data; - m_auiEncounter[2] = data; - m_auiEncounter[3] = data; - m_auiEncounter[4] = data; - m_auiEncounter[5] = data; - debug_log("TSCR: Instance Old Hillsbrad: Thrall event failed %u times. Resetting all sub-events.",mThrallEventCount); - } - } - else - m_auiEncounter[1] = data; - debug_log("TSCR: Instance Old Hillsbrad: Thrall escort event adjusted to data %u.",data); - break; - } - case TYPE_THRALL_PART1: - m_auiEncounter[2] = data; - debug_log("TSCR: Instance Old Hillsbrad: Thrall event part I adjusted to data %u.",data); - break; - case TYPE_THRALL_PART2: - m_auiEncounter[3] = data; - debug_log("TSCR: Instance Old Hillsbrad: Thrall event part II adjusted to data %u.",data); - break; - case TYPE_THRALL_PART3: - m_auiEncounter[4] = data; - debug_log("TSCR: Instance Old Hillsbrad: Thrall event part III adjusted to data %u.",data); - break; - case TYPE_THRALL_PART4: - m_auiEncounter[5] = data; - debug_log("TSCR: Instance Old Hillsbrad: Thrall event part IV adjusted to data %u.",data); - break; - } - } - - uint32 GetData(uint32 data) - { - switch(data) - { - case TYPE_BARREL_DIVERSION: - return m_auiEncounter[0]; - case TYPE_THRALL_EVENT: - return m_auiEncounter[1]; - case TYPE_THRALL_PART1: - return m_auiEncounter[2]; - case TYPE_THRALL_PART2: - return m_auiEncounter[3]; - case TYPE_THRALL_PART3: - return m_auiEncounter[4]; - case TYPE_THRALL_PART4: - return m_auiEncounter[5]; - } - return 0; - } - - uint64 GetData64(uint32 data) - { - switch(data) - { - case DATA_THRALL: - return ThrallGUID; - case DATA_TARETHA: - return TarethaGUID; - case DATA_EPOCH: - return EpochGUID; - } - return 0; - } -}; -InstanceData* GetInstanceData_instance_old_hillsbrad(Map* pMap) -{ - return new instance_old_hillsbrad(pMap); -} - -void AddSC_instance_old_hillsbrad() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_old_hillsbrad"; - newscript->GetInstanceData = &GetInstanceData_instance_old_hillsbrad; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/old_hillsbrad.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/old_hillsbrad.cpp deleted file mode 100644 index 5559989ef65..00000000000 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/old_hillsbrad.cpp +++ /dev/null @@ -1,682 +0,0 @@ - /* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Old_Hillsbrad -SD%Complete: 40 -SDComment: Quest support: 10283, 10284. All friendly NPC's. Thrall waypoints fairly complete, missing many details, but possible to complete escort. -SDCategory: Caverns of Time, Old Hillsbrad Foothills -EndScriptData */ - -/* ContentData -npc_erozion -npc_thrall_old_hillsbrad -npc_taretha -EndContentData */ - -#include "precompiled.h" -#include "escortAI.h" -#include "def_old_hillsbrad.h" - -#define QUEST_ENTRY_HILLSBRAD 10282 -#define QUEST_ENTRY_DIVERSION 10283 -#define QUEST_ENTRY_ESCAPE 10284 -#define QUEST_ENTRY_RETURN 10285 -#define ITEM_ENTRY_BOMBS 25853 - -/*###### -## npc_erozion -######*/ - -bool GossipHello_npc_erozion(Player* pPlayer, Creature* pCreature) -{ - if (pCreature->isQuestGiver()) - pPlayer->PrepareQuestMenu(pCreature->GetGUID()); - - ScriptedInstance* pInstance = (pCreature->GetInstanceData()); - if (pInstance && pInstance->GetData(TYPE_BARREL_DIVERSION) != DONE && !pPlayer->HasItemCount(ITEM_ENTRY_BOMBS,1)) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "I need a pack of Incendiary Bombs.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - - if (!pPlayer->GetQuestRewardStatus(QUEST_ENTRY_RETURN) && pPlayer->GetQuestStatus(QUEST_ENTRY_RETURN) == QUEST_STATUS_COMPLETE) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "[PH] Teleport please, i'm tired.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); - - pPlayer->SEND_GOSSIP_MENU(9778, pCreature->GetGUID()); - - return true; -} - -bool GossipSelect_npc_erozion(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) - { - ItemPosCountVec dest; - uint8 msg = pPlayer->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, ITEM_ENTRY_BOMBS, 1); - if (msg == EQUIP_ERR_OK) - { - pPlayer->StoreNewItem(dest, ITEM_ENTRY_BOMBS, true); - } - pPlayer->SEND_GOSSIP_MENU(9515, pCreature->GetGUID()); - } - if (uiAction == GOSSIP_ACTION_INFO_DEF+2) - { - pPlayer->CLOSE_GOSSIP_MENU(); - } - return true; -} - -/*###### -## npc_thrall_old_hillsbrad -######*/ - -//Thrall texts -#define SAY_TH_START_EVENT_PART1 -1560023 -#define SAY_TH_ARMORY -1560024 -#define SAY_TH_SKARLOC_MEET -1560025 -#define SAY_TH_SKARLOC_TAUNT -1560026 -#define SAY_TH_START_EVENT_PART2 -1560027 -#define SAY_TH_MOUNTS_UP -1560028 -#define SAY_TH_CHURCH_END -1560029 -#define SAY_TH_MEET_TARETHA -1560030 -#define SAY_TH_EPOCH_WONDER -1560031 -#define SAY_TH_EPOCH_KILL_TARETHA -1560032 -#define SAY_TH_EVENT_COMPLETE -1560033 - -#define SAY_TH_RANDOM_LOW_HP1 -1560034 -#define SAY_TH_RANDOM_LOW_HP2 -1560035 - -#define SAY_TH_RANDOM_DIE1 -1560036 -#define SAY_TH_RANDOM_DIE2 -1560037 - -#define SAY_TH_RANDOM_AGGRO1 -1560038 -#define SAY_TH_RANDOM_AGGRO2 -1560039 -#define SAY_TH_RANDOM_AGGRO3 -1560040 -#define SAY_TH_RANDOM_AGGRO4 -1560041 - -#define SAY_TH_RANDOM_KILL1 -1560042 -#define SAY_TH_RANDOM_KILL2 -1560043 -#define SAY_TH_RANDOM_KILL3 -1560044 - -#define SAY_TH_LEAVE_COMBAT1 -1560045 -#define SAY_TH_LEAVE_COMBAT2 -1560046 -#define SAY_TH_LEAVE_COMBAT3 -1560047 - -//Taretha texts -#define SAY_TA_FREE -1560048 -#define SAY_TA_ESCAPED -1560049 - -//Misc for Thrall -#define SPELL_STRIKE 14516 -#define SPELL_SHIELD_BLOCK 12169 -#define SPELL_SUMMON_EROZION_IMAGE 33954 //if thrall dies during escort? - -#define SPEED_WALK (0.5f) -#define SPEED_RUN (1.0f) -#define SPEED_MOUNT (1.6f) - -#define THRALL_WEAPON_MODEL 22106 -#define THRALL_WEAPON_INFO 218169346 -#define THRALL_SHIELD_MODEL 18662 -#define THRALL_SHIELD_INFO 234948100 -#define THRALL_MODEL_UNEQUIPPED 17292 -#define THRALL_MODEL_EQUIPPED 18165 - -//Misc Creature entries -#define ENTRY_ARMORER 18764 -#define ENTRY_SCARLOC 17862 - -#define MOB_ENTRY_RIFLE 17820 -#define MOB_ENTRY_WARDEN 17833 -#define MOB_ENTRY_VETERAN 17860 -#define MOB_ENTRY_WATCHMAN 17814 -#define MOB_ENTRY_SENTRY 17815 - -#define MOB_ENTRY_BARN_GUARDSMAN 18092 -#define MOB_ENTRY_BARN_PROTECTOR 18093 -#define MOB_ENTRY_BARN_LOOKOUT 18094 - -#define MOB_ENTRY_CHURCH_GUARDSMAN 23175 -#define MOB_ENTRY_CHURCH_PROTECTOR 23179 -#define MOB_ENTRY_CHURCH_LOOKOUT 23177 - -#define MOB_ENTRY_INN_GUARDSMAN 23176 -#define MOB_ENTRY_INN_PROTECTOR 23180 -#define MOB_ENTRY_INN_LOOKOUT 23178 - -#define SKARLOC_MOUNT 18798 -#define SKARLOC_MOUNT_MODEL 18223 -#define EROZION_ENTRY 18723 -#define ENTRY_EPOCH 18096 - -//gossip items -#define GOSSIP_ID_START 9568 -#define GOSSIP_ID_SKARLOC1 9614 //I'm glad Taretha is alive. We now must find a way to free her... -#define GOSSIP_ITEM_SKARLOC1 "Taretha cannot see you, Thrall." -#define GOSSIP_ID_SKARLOC2 9579 //What do you mean by this? Is Taretha in danger? -#define GOSSIP_ITEM_SKARLOC2 "The situation is rather complicated, Thrall. It would be best for you to head into the mountains now, before more of Blackmoore's men show up. We'll make sure Taretha is safe." -#define GOSSIP_ID_SKARLOC3 9580 - -#define GOSSIP_ID_TARREN 9597 //tarren mill is beyond these trees -#define GOSSIP_ITEM_TARREN "We're ready, Thrall." - -#define GOSSIP_ID_COMPLETE 9578 //Thank you friends, I owe my freedom to you. Where is Taretha? I hoped to see her - -struct TRINITY_DLL_DECL npc_thrall_old_hillsbradAI : public npc_escortAI -{ - npc_thrall_old_hillsbradAI(Creature *c) : npc_escortAI(c) - { - pInstance = c->GetInstanceData(); - HadMount = false; - m_creature->setActive(true); - } - - ScriptedInstance *pInstance; - - uint64 TarethaGUID; - - bool LowHp; - bool HadMount; - - void WaypointReached(uint32 i) - { - if (!pInstance) - return; - - switch(i) - { - case 8: - SetRun(false); - m_creature->SummonCreature(18764,2181.87,112.46,89.45,0.26,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); - break; - case 9: - DoScriptText(SAY_TH_ARMORY, m_creature); - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, THRALL_WEAPON_MODEL); - //m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO, THRALL_WEAPON_INFO); - //m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+1, 781); - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, THRALL_SHIELD_MODEL); - //m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+2, THRALL_SHIELD_INFO); - //m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+3, 1038); - break; - case 10: - m_creature->SetDisplayId(THRALL_MODEL_EQUIPPED); - break; - case 11: - SetRun(); - break; - case 15: - m_creature->SummonCreature(MOB_ENTRY_RIFLE,2200.28,137.37,87.93,5.07,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); - m_creature->SummonCreature(MOB_ENTRY_WARDEN,2197.44,131.83,87.93,0.78,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); - m_creature->SummonCreature(MOB_ENTRY_VETERAN,2203.62,135.40,87.93,3.70,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); - m_creature->SummonCreature(MOB_ENTRY_VETERAN,2200.75,130.13,87.93,1.48,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); - break; - case 21: - m_creature->SummonCreature(MOB_ENTRY_RIFLE,2135.80,154.01,67.45,4.98,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); - m_creature->SummonCreature(MOB_ENTRY_WARDEN,2144.36,151.87,67.74,4.46,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); - m_creature->SummonCreature(MOB_ENTRY_VETERAN,2142.12,154.41,67.12,4.56,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); - m_creature->SummonCreature(MOB_ENTRY_VETERAN,2138.08,155.38,67.24,4.60,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); - break; - case 25: - m_creature->SummonCreature(MOB_ENTRY_RIFLE,2102.98,192.17,65.24,6.02,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); - m_creature->SummonCreature(MOB_ENTRY_WARDEN,2108.48,198.75,65.18,5.15,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); - m_creature->SummonCreature(MOB_ENTRY_VETERAN,2106.11,197.29,65.18,5.63,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); - m_creature->SummonCreature(MOB_ENTRY_VETERAN,2104.18,194.82,65.18,5.75,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); - break; - case 29: - DoScriptText(SAY_TH_SKARLOC_MEET, m_creature); - m_creature->SummonCreature(ENTRY_SCARLOC,2036.48,271.22,63.43,5.27,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); - //temporary,skarloc should rather be triggered to walk up to thrall - break; - case 30: - IsOnHold = true; - m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - SetRun(false); - break; - case 31: - DoScriptText(SAY_TH_MOUNTS_UP, m_creature); - DoMount(); - SetRun(); - break; - case 37: - //possibly regular patrollers? If so, remove this and let database handle them - m_creature->SummonCreature(MOB_ENTRY_WATCHMAN,2124.26,522.16,56.87,3.99,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); - m_creature->SummonCreature(MOB_ENTRY_WATCHMAN,2121.69,525.37,57.11,4.01,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); - m_creature->SummonCreature(MOB_ENTRY_SENTRY,2124.65,524.55,56.63,3.98,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); - break; - case 59: - m_creature->SummonCreature(SKARLOC_MOUNT,2488.64,625.77,58.26,4.71,TEMPSUMMON_TIMED_DESPAWN,10000); - DoUnmount(); - HadMount = false; - SetRun(false); - break; - case 60: - m_creature->HandleEmoteCommand(EMOTE_ONESHOT_EXCLAMATION); - //make horsie run off - IsOnHold = true; - m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - pInstance->SetData(TYPE_THRALL_PART2, DONE); - SetRun(); - break; - case 64: - SetRun(false); - break; - case 68: - m_creature->SummonCreature(MOB_ENTRY_BARN_PROTECTOR,2500.22,692.60,55.50,2.84,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); - m_creature->SummonCreature(MOB_ENTRY_BARN_LOOKOUT,2500.13,696.55,55.51,3.38,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); - m_creature->SummonCreature(MOB_ENTRY_BARN_GUARDSMAN,2500.55,693.64,55.50,3.14,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); - m_creature->SummonCreature(MOB_ENTRY_BARN_GUARDSMAN,2500.94,695.81,55.50,3.14,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); - break; - case 71: - SetRun(); - break; - case 81: - SetRun(false); - break; - case 83: - m_creature->SummonCreature(MOB_ENTRY_CHURCH_PROTECTOR,2627.33,646.82,56.03,4.28,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,5000); - m_creature->SummonCreature(MOB_ENTRY_CHURCH_LOOKOUT,2624.14,648.03,56.03,4.50,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,5000); - m_creature->SummonCreature(MOB_ENTRY_CHURCH_GUARDSMAN,2625.32,649.60,56.03,4.38,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,5000); - m_creature->SummonCreature(MOB_ENTRY_CHURCH_GUARDSMAN,2627.22,649.00,56.03,4.34,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,5000); - break; - case 84: - DoScriptText(SAY_TH_CHURCH_END, m_creature); - SetRun(); - break; - case 91: - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - SetRun(false); - break; - case 93: - m_creature->SummonCreature(MOB_ENTRY_INN_PROTECTOR,2652.71,660.31,61.93,1.67,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); - m_creature->SummonCreature(MOB_ENTRY_INN_LOOKOUT,2648.96,662.59,61.93,0.79,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); - m_creature->SummonCreature(MOB_ENTRY_INN_GUARDSMAN,2657.36,662.34,61.93,2.68,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); - m_creature->SummonCreature(MOB_ENTRY_INN_GUARDSMAN,2656.39,659.77,61.93,2.61,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); - break; - case 94: - if (uint64 TarethaGUID = pInstance->GetData64(DATA_TARETHA)) - { - if (Unit* Taretha = Unit::GetUnit((*m_creature), TarethaGUID)) - DoScriptText(SAY_TA_ESCAPED, Taretha, m_creature); - } - break; - case 95: - DoScriptText(SAY_TH_MEET_TARETHA, m_creature); - pInstance->SetData(TYPE_THRALL_PART3,DONE); - IsOnHold = true; - break; - case 96: - DoScriptText(SAY_TH_EPOCH_WONDER, m_creature); - break; - case 97: - DoScriptText(SAY_TH_EPOCH_KILL_TARETHA, m_creature); - SetRun(); - break; - case 98: - //trigger epoch Yell("Thrall! Come outside and face your fate! ....") - //from here, thrall should not never be allowed to move to point 106 which he currently does. - break; - - case 106: - { - if (!PlayerGUID) - break; - - //trigger taretha to run down outside - if (uint64 TarethaGUID = pInstance->GetData64(DATA_TARETHA)) - { - if (Creature* Taretha = (Unit::GetCreature(*m_creature, TarethaGUID))) - CAST_AI(npc_escortAI, (Taretha->AI()))->Start(false, true, PlayerGUID); - } - - //kill credit Creature for quest - Map* pMap = m_creature->GetMap(); - Map::PlayerList const& players = pMap->GetPlayers(); - if (!players.isEmpty() && pMap->IsDungeon()) - { - for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) - { - if (Player* pPlayer = itr->getSource()) - pPlayer->KilledMonsterCredit(20156,m_creature->GetGUID()); - } - } - - //alot will happen here, thrall and taretha talk, erozion appear at spot to explain - m_creature->SummonCreature(EROZION_ENTRY,2646.47,680.416,55.38,4.16,TEMPSUMMON_TIMED_DESPAWN,120000); - } - break; - case 108: - //last waypoint, just set Thrall invisible, respawn is turned off - m_creature->SetVisibility(VISIBILITY_OFF); - break; - } - } - - - void Reset() - { - LowHp = false; - - if (HadMount) - DoMount(); - - if (!IsBeingEscorted) - { - DoUnmount(); - HadMount = false; - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, 0); - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, 0); - m_creature->SetDisplayId(THRALL_MODEL_UNEQUIPPED); - } - if (IsBeingEscorted) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_TH_LEAVE_COMBAT1, m_creature); break; - case 1: DoScriptText(SAY_TH_LEAVE_COMBAT2, m_creature); break; - case 2: DoScriptText(SAY_TH_LEAVE_COMBAT3, m_creature); break; - } - } - } - void StartWP() - { - m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - IsOnHold = false; - } - void DoMount() - { - m_creature->Mount(SKARLOC_MOUNT_MODEL); - m_creature->SetSpeed(MOVE_RUN,SPEED_MOUNT); - } - void DoUnmount() - { - m_creature->Unmount(); - m_creature->SetSpeed(MOVE_RUN,SPEED_RUN); - } - void EnterCombat(Unit* who) - { - switch(rand()%4) - { - case 0: DoScriptText(SAY_TH_RANDOM_AGGRO1, m_creature); break; - case 1: DoScriptText(SAY_TH_RANDOM_AGGRO2, m_creature); break; - case 2: DoScriptText(SAY_TH_RANDOM_AGGRO3, m_creature); break; - case 3: DoScriptText(SAY_TH_RANDOM_AGGRO4, m_creature); break; - } - if (m_creature->IsMounted()) - { - DoUnmount(); - HadMount = true; - } - } - - void JustSummoned(Creature* summoned) - { - switch(summoned->GetEntry()) - { - //TODO: make Scarloc start into event instead, and not start attack directly - case MOB_ENTRY_BARN_GUARDSMAN: - case MOB_ENTRY_BARN_PROTECTOR: - case MOB_ENTRY_BARN_LOOKOUT: - case SKARLOC_MOUNT: - case EROZION_ENTRY: - break; - default: - summoned->AI()->AttackStart(m_creature); - break; - } - } - - void KilledUnit(Unit *victim) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_TH_RANDOM_KILL1, m_creature); break; - case 1: DoScriptText(SAY_TH_RANDOM_KILL2, m_creature); break; - case 2: DoScriptText(SAY_TH_RANDOM_KILL3, m_creature); break; - } - } - void JustDied(Unit *slayer) - { - if (pInstance) - pInstance->SetData(TYPE_THRALL_EVENT,FAIL); - - // Don't do a yell if he kills self (if player goes too far or at the end). - if (slayer == m_creature) - return; - - switch(rand()%2) - { - case 0: DoScriptText(SAY_TH_RANDOM_DIE1, m_creature); break; - case 1: DoScriptText(SAY_TH_RANDOM_DIE2, m_creature); break; - } - } - - void UpdateAI(const uint32 diff) - { - npc_escortAI::UpdateAI(diff); - - if (!UpdateVictim()) - return; - - //TODO: add his abilities'n-crap here - if (!LowHp && ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 20)) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_TH_RANDOM_LOW_HP1, m_creature); break; - case 1: DoScriptText(SAY_TH_RANDOM_LOW_HP2, m_creature); break; - } - LowHp = true; - } - } -}; - -CreatureAI* GetAI_npc_thrall_old_hillsbrad(Creature* pCreature) -{ - return new npc_thrall_old_hillsbradAI(pCreature); -} - -bool GossipHello_npc_thrall_old_hillsbrad(Player* pPlayer, Creature* pCreature) -{ - if (pCreature->isQuestGiver()) - { - pPlayer->PrepareQuestMenu(pCreature->GetGUID()); - pPlayer->SendPreparedQuest(pCreature->GetGUID()); - } - - ScriptedInstance* pInstance = (pCreature->GetInstanceData()); - if (pInstance) - { - if (pInstance->GetData(TYPE_BARREL_DIVERSION) == DONE && !pInstance->GetData(TYPE_THRALL_EVENT)) - { - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "[PH] Start walking.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - pPlayer->SEND_GOSSIP_MENU(GOSSIP_ID_START, pCreature->GetGUID()); - } - - if (pInstance->GetData(TYPE_THRALL_PART1) == DONE && !pInstance->GetData(TYPE_THRALL_PART2)) - { - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_SKARLOC1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); - pPlayer->SEND_GOSSIP_MENU(GOSSIP_ID_SKARLOC1, pCreature->GetGUID()); - } - - if (pInstance->GetData(TYPE_THRALL_PART2) == DONE && !pInstance->GetData(TYPE_THRALL_PART3)) - { - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_TARREN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); - pPlayer->SEND_GOSSIP_MENU(GOSSIP_ID_TARREN, pCreature->GetGUID()); - } - } - return true; -} - -bool GossipSelect_npc_thrall_old_hillsbrad(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - ScriptedInstance* pInstance = (pCreature->GetInstanceData()); - switch(uiAction) - { - case GOSSIP_ACTION_INFO_DEF+1: - pPlayer->CLOSE_GOSSIP_MENU(); - if (pInstance) - { - pInstance->SetData(TYPE_THRALL_EVENT,IN_PROGRESS); - pInstance->SetData(TYPE_THRALL_PART1,IN_PROGRESS); - } - - DoScriptText(SAY_TH_START_EVENT_PART1, pCreature); - - if (npc_escortAI* pEscortAI = CAST_AI(npc_thrall_old_hillsbradAI, pCreature->AI())) - pEscortAI->Start(true, true, pPlayer->GetGUID()); - - CAST_AI(npc_escortAI, (pCreature->AI()))->SetMaxPlayerDistance(100.0f);//not really needed, because it will not despawn if player is too far - CAST_AI(npc_escortAI, (pCreature->AI()))->SetDespawnAtEnd(false); - CAST_AI(npc_escortAI, (pCreature->AI()))->SetDespawnAtFar(false); - break; - - case GOSSIP_ACTION_INFO_DEF+2: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_SKARLOC2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+20); - pPlayer->SEND_GOSSIP_MENU(GOSSIP_ID_SKARLOC2, pCreature->GetGUID()); - break; - - case GOSSIP_ACTION_INFO_DEF+20: - pPlayer->SEND_GOSSIP_MENU(GOSSIP_ID_SKARLOC3, pCreature->GetGUID()); - pCreature->SummonCreature(SKARLOC_MOUNT,2038.81,270.26,63.20,5.41,TEMPSUMMON_TIMED_DESPAWN,12000); - if (pInstance) - pInstance->SetData(TYPE_THRALL_PART2,IN_PROGRESS); - - DoScriptText(SAY_TH_START_EVENT_PART2, pCreature); - - CAST_AI(npc_thrall_old_hillsbradAI, pCreature->AI())->StartWP(); - break; - - case GOSSIP_ACTION_INFO_DEF+3: - pPlayer->CLOSE_GOSSIP_MENU(); - if (pInstance) - pInstance->SetData(TYPE_THRALL_PART3,IN_PROGRESS); - CAST_AI(npc_thrall_old_hillsbradAI, pCreature->AI())->StartWP(); - break; - } - return true; -} - -/*###### -## npc_taretha -######*/ - -#define GOSSIP_ID_EPOCH1 9610 //Thank you for helping Thrall escape, friends. Now I only hope -#define GOSSIP_ITEM_EPOCH1 "Strange wizard?" -#define GOSSIP_ID_EPOCH2 9613 //Yes, friends. This man was no wizard of -#define GOSSIP_ITEM_EPOCH2 "We'll get you out. Taretha. Don't worry. I doubt the wizard would wander too far away." - -struct TRINITY_DLL_DECL npc_tarethaAI : public npc_escortAI -{ - npc_tarethaAI(Creature *c) : npc_escortAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance *pInstance; - - void WaypointReached(uint32 i) - { - switch(i) - { - case 6: - DoScriptText(SAY_TA_FREE, m_creature); - break; - case 7: - m_creature->HandleEmoteCommand(EMOTE_ONESHOT_CHEER); - break; - } - } - void Reset() {} - void EnterCombat(Unit* who) {} - - void UpdateAI(const uint32 diff) - { - npc_escortAI::UpdateAI(diff); - } -}; -CreatureAI* GetAI_npc_taretha(Creature* pCreature) -{ - return new npc_tarethaAI(pCreature); -} - -bool GossipHello_npc_taretha(Player* pPlayer, Creature* pCreature) -{ - ScriptedInstance* pInstance = (pCreature->GetInstanceData()); - if (pInstance && pInstance->GetData(TYPE_THRALL_PART3) == DONE && pInstance->GetData(TYPE_THRALL_PART4) == NOT_STARTED) - { - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_EPOCH1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - pPlayer->SEND_GOSSIP_MENU(GOSSIP_ID_EPOCH1, pCreature->GetGUID()); - } - return true; -} - -bool GossipSelect_npc_taretha(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - ScriptedInstance* pInstance = (pCreature->GetInstanceData()); - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) - { - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_EPOCH2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); - pPlayer->SEND_GOSSIP_MENU(GOSSIP_ID_EPOCH2, pCreature->GetGUID()); - } - if (uiAction == GOSSIP_ACTION_INFO_DEF+2) - { - pPlayer->CLOSE_GOSSIP_MENU(); - - if (pInstance->GetData(TYPE_THRALL_EVENT) == IN_PROGRESS) - { - if (pInstance) - pInstance->SetData(TYPE_THRALL_PART4,IN_PROGRESS); - if (pInstance->GetData64(DATA_EPOCH) == 0) - pCreature->SummonCreature(ENTRY_EPOCH,2639.13,698.55,65.43,4.59,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,120000); - - if (uint64 ThrallGUID = pInstance->GetData64(DATA_THRALL)) - { - Creature* Thrall = (Unit::GetCreature((*pCreature), ThrallGUID)); - if (Thrall) - CAST_AI(npc_thrall_old_hillsbradAI, Thrall->AI())->StartWP(); - } - } - } - return true; -} - -/*###### -## AddSC -######*/ - -void AddSC_old_hillsbrad() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="npc_erozion"; - newscript->pGossipHello = &GossipHello_npc_erozion; - newscript->pGossipSelect = &GossipSelect_npc_erozion; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_thrall_old_hillsbrad"; - newscript->pGossipHello = &GossipHello_npc_thrall_old_hillsbrad; - newscript->pGossipSelect = &GossipSelect_npc_thrall_old_hillsbrad; - newscript->GetAI = &GetAI_npc_thrall_old_hillsbrad; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_taretha"; - newscript->pGossipHello = &GossipHello_npc_taretha; - newscript->pGossipSelect = &GossipSelect_npc_taretha; - newscript->GetAI = &GetAI_npc_taretha; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/maraudon/boss_celebras_the_cursed.cpp b/src/bindings/scripts/scripts/zone/maraudon/boss_celebras_the_cursed.cpp deleted file mode 100644 index f2ac8ff08e1..00000000000 --- a/src/bindings/scripts/scripts/zone/maraudon/boss_celebras_the_cursed.cpp +++ /dev/null @@ -1,98 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Celebras_the_Cursed -SD%Complete: 100 -SDComment: -SDCategory: Maraudon -EndScriptData */ - -#include "precompiled.h" - -#define SPELL_WRATH 21807 -#define SPELL_ENTANGLINGROOTS 12747 -#define SPELL_CORRUPT_FORCES 21968 - -struct TRINITY_DLL_DECL celebras_the_cursedAI : public ScriptedAI -{ - celebras_the_cursedAI(Creature *c) : ScriptedAI(c) {} - - uint32 Wrath_Timer; - uint32 EntanglingRoots_Timer; - uint32 CorruptForces_Timer; - - void Reset() - { - Wrath_Timer = 8000; - EntanglingRoots_Timer = 2000; - CorruptForces_Timer = 30000; - } - - void EnterCombat(Unit *who) { } - - void JustDied(Unit* Killer) - { - m_creature->SummonCreature(13716, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 600000); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //Wrath - if (Wrath_Timer < diff) - { - Unit* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM,0); - if (target) - DoCast(target,SPELL_WRATH); - Wrath_Timer = 8000; - }else Wrath_Timer -= diff; - - //EntanglingRoots - if (EntanglingRoots_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_ENTANGLINGROOTS); - EntanglingRoots_Timer = 20000; - }else EntanglingRoots_Timer -= diff; - - //CorruptForces - if (CorruptForces_Timer < diff) - { - m_creature->InterruptNonMeleeSpells(false); - DoCast(m_creature,SPELL_CORRUPT_FORCES); - CorruptForces_Timer = 20000; - }else CorruptForces_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_celebras_the_cursed(Creature* pCreature) -{ - return new celebras_the_cursedAI (pCreature); -} - -void AddSC_boss_celebras_the_cursed() -{ - Script *newscript; - newscript = new Script; - newscript->Name="celebras_the_cursed"; - newscript->GetAI = &GetAI_celebras_the_cursed; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/maraudon/boss_landslide.cpp b/src/bindings/scripts/scripts/zone/maraudon/boss_landslide.cpp deleted file mode 100644 index 353b9c1e3c0..00000000000 --- a/src/bindings/scripts/scripts/zone/maraudon/boss_landslide.cpp +++ /dev/null @@ -1,95 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Landslide -SD%Complete: 100 -SDComment: -SDCategory: Maraudon -EndScriptData */ - -#include "precompiled.h" - -#define SPELL_KNOCKAWAY 18670 -#define SPELL_TRAMPLE 5568 -#define SPELL_LANDSLIDE 21808 - -struct TRINITY_DLL_DECL boss_landslideAI : public ScriptedAI -{ - boss_landslideAI(Creature *c) : ScriptedAI(c) {} - - uint32 KnockAway_Timer; - uint32 Trample_Timer; - uint32 Landslide_Timer; - - void Reset() - { - KnockAway_Timer = 8000; - Trample_Timer = 2000; - Landslide_Timer = 0; - } - - void EnterCombat(Unit *who) - { - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //KnockAway_Timer - if (KnockAway_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_KNOCKAWAY); - KnockAway_Timer = 15000; - }else KnockAway_Timer -= diff; - - //Trample_Timer - if (Trample_Timer < diff) - { - DoCast(m_creature,SPELL_TRAMPLE); - Trample_Timer = 8000; - }else Trample_Timer -= diff; - - //Landslide - if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 50) - { - if (Landslide_Timer < diff) - { - m_creature->InterruptNonMeleeSpells(false); - DoCast(m_creature,SPELL_LANDSLIDE); - Landslide_Timer = 60000; - } else Landslide_Timer -= diff; - } - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_landslide(Creature* pCreature) -{ - return new boss_landslideAI (pCreature); -} - -void AddSC_boss_landslide() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_landslide"; - newscript->GetAI = &GetAI_boss_landslide; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/maraudon/boss_noxxion.cpp b/src/bindings/scripts/scripts/zone/maraudon/boss_noxxion.cpp deleted file mode 100644 index 62190d4192a..00000000000 --- a/src/bindings/scripts/scripts/zone/maraudon/boss_noxxion.cpp +++ /dev/null @@ -1,150 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Noxxion -SD%Complete: 100 -SDComment: -SDCategory: Maraudon -EndScriptData */ - -#include "precompiled.h" - -#define SPELL_TOXICVOLLEY 21687 -#define SPELL_UPPERCUT 22916 - -struct TRINITY_DLL_DECL boss_noxxionAI : public ScriptedAI -{ - boss_noxxionAI(Creature *c) : ScriptedAI(c) {} - - uint32 ToxicVolley_Timer; - uint32 Uppercut_Timer; - uint32 Adds_Timer; - uint32 Invisible_Timer; - bool Invisible; - int Rand; - int RandX; - int RandY; - Creature* Summoned; - - void Reset() - { - ToxicVolley_Timer = 7000; - Uppercut_Timer = 16000; - Adds_Timer = 19000; - Invisible_Timer = 15000; //Too much too low? - Invisible = false; - } - - void EnterCombat(Unit *who) - { - } - - void SummonAdds(Unit* victim) - { - Rand = rand()%8; - switch (rand()%2) - { - case 0: RandX = 0 - Rand; break; - case 1: RandX = 0 + Rand; break; - } - Rand = 0; - Rand = rand()%8; - switch (rand()%2) - { - case 0: RandY = 0 - Rand; break; - case 1: RandY = 0 + Rand; break; - } - Rand = 0; - Summoned = DoSpawnCreature(13456, RandX, RandY, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 90000); - if (Summoned) - (Summoned->AI())->AttackStart(victim); - } - - void UpdateAI(const uint32 diff) - { - if (Invisible && Invisible_Timer < diff) - { - //Become visible again - m_creature->setFaction(14); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - //Noxxion model - m_creature->SetDisplayId(11172); - Invisible = false; - //m_creature->m_canMove = true; - } else if (Invisible) - { - Invisible_Timer -= diff; - //Do nothing while invisible - return; - } - - //Return since we have no target - if (!UpdateVictim()) - return; - - //ToxicVolley_Timer - if (ToxicVolley_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_TOXICVOLLEY); - ToxicVolley_Timer = 9000; - }else ToxicVolley_Timer -= diff; - - //Uppercut_Timer - if (Uppercut_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_UPPERCUT); - Uppercut_Timer = 12000; - }else Uppercut_Timer -= diff; - - //Adds_Timer - if (!Invisible && Adds_Timer < diff) - { - //Inturrupt any spell casting - //m_creature->m_canMove = true; - m_creature->InterruptNonMeleeSpells(false); - m_creature->setFaction(35); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - // Invisible Model - m_creature->SetDisplayId(11686); - SummonAdds(m_creature->getVictim()); - SummonAdds(m_creature->getVictim()); - SummonAdds(m_creature->getVictim()); - SummonAdds(m_creature->getVictim()); - SummonAdds(m_creature->getVictim()); - Invisible = true; - Invisible_Timer = 15000; - - Adds_Timer = 40000; - }else Adds_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_noxxion(Creature* pCreature) -{ - return new boss_noxxionAI (pCreature); -} - -void AddSC_boss_noxxion() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_noxxion"; - newscript->GetAI = &GetAI_boss_noxxion; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/maraudon/boss_princess_theradras.cpp b/src/bindings/scripts/scripts/zone/maraudon/boss_princess_theradras.cpp deleted file mode 100644 index 7199c18cf75..00000000000 --- a/src/bindings/scripts/scripts/zone/maraudon/boss_princess_theradras.cpp +++ /dev/null @@ -1,109 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Princess_Theradras -SD%Complete: 100 -SDComment: -SDCategory: Maraudon -EndScriptData */ - -#include "precompiled.h" - -#define SPELL_DUSTFIELD 21909 -#define SPELL_BOULDER 21832 -#define SPELL_THRASH 3391 -#define SPELL_REPULSIVEGAZE 21869 - -struct TRINITY_DLL_DECL boss_ptheradrasAI : public ScriptedAI -{ - boss_ptheradrasAI(Creature *c) : ScriptedAI(c) {} - - uint32 Dustfield_Timer; - uint32 Boulder_Timer; - uint32 Thrash_Timer; - uint32 RepulsiveGaze_Timer; - - void Reset() - { - Dustfield_Timer = 8000; - Boulder_Timer = 2000; - Thrash_Timer = 5000; - RepulsiveGaze_Timer = 23000; - } - - void EnterCombat(Unit *who) - { - } - - void JustDied(Unit* Killer) - { - m_creature->SummonCreature(12238,28.067,61.875,-123.405,4.67,TEMPSUMMON_TIMED_DESPAWN,600000); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //Dustfield_Timer - if (Dustfield_Timer < diff) - { - DoCast(m_creature,SPELL_DUSTFIELD); - Dustfield_Timer = 14000; - }else Dustfield_Timer -= diff; - - //Boulder_Timer - if (Boulder_Timer < diff) - { - Unit* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM,0); - if (target) - DoCast(target,SPELL_BOULDER); - Boulder_Timer = 10000; - }else Boulder_Timer -= diff; - - //RepulsiveGaze_Timer - if (RepulsiveGaze_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_REPULSIVEGAZE); - RepulsiveGaze_Timer = 20000; - }else RepulsiveGaze_Timer -= diff; - - //Thrash_Timer - if (Thrash_Timer < diff) - { - DoCast(m_creature,SPELL_THRASH); - Thrash_Timer = 18000; - }else Thrash_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_ptheradras(Creature* pCreature) -{ - return new boss_ptheradrasAI (pCreature); -} - -void AddSC_boss_ptheradras() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_princess_theradras"; - newscript->GetAI = &GetAI_boss_ptheradras; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/onyxias_lair/boss_onyxia.cpp b/src/bindings/scripts/scripts/zone/onyxias_lair/boss_onyxia.cpp deleted file mode 100644 index 35608557dad..00000000000 --- a/src/bindings/scripts/scripts/zone/onyxias_lair/boss_onyxia.cpp +++ /dev/null @@ -1,307 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Onyxia -SD%Complete: 90 -SDComment: Spell Heated Ground is wrong, flying animation, visual for area effect -SDCategory: Onyxia's Lair -EndScriptData */ - -#include "precompiled.h" - -#define SAY_AGGRO -1249000 -#define SAY_KILL -1249001 -#define SAY_PHASE_2_TRANS -1249002 -#define SAY_PHASE_3_TRANS -1249003 -#define EMOTE_BREATH -1249004 - -#define SPELL_WINGBUFFET 18500 -#define SPELL_FLAMEBREATH 18435 -#define SPELL_CLEAVE 19983 -#define SPELL_TAILSWEEP 15847 -#define SPELL_KNOCK_AWAY 19633 - -#define SPELL_ENGULFINGFLAMES 20019 -#define SPELL_DEEPBREATH 23461 -#define SPELL_FIREBALL 18392 - -#define SPELL_BELLOWINGROAR 18431 -#define SPELL_HEATED_GROUND 22191 //Wrong Spell - -#define SPELL_SUMMONWHELP 17646 - -#define CREATURE_WHELP 11262 - -static float MovementLocations[4][3]= -{ - {-64.0523, -213.0619, -68.2985}, - {12.4636, -220.01490, -68.0548}, - {-38.8391, -182.3220, -68.9457}, - {-37.0390, -244.8760, -68.1278} -}; - -static float SpawnLocations[4][3]= -{ - {-30.127, -254.463, -89.440}, - {-30.817, -177.106, -89.258}, - {14.480, -241.560, -85.6300}, - {17.372, -190.840, -85.2810}, -}; - -struct TRINITY_DLL_DECL boss_onyxiaAI : public ScriptedAI -{ - boss_onyxiaAI(Creature* c) : ScriptedAI(c) {} - - uint32 Phase; - - uint32 FlameBreathTimer; - uint32 CleaveTimer; - uint32 TailSweepTimer; - uint32 MovementTimer; - uint32 EngulfingFlamesTimer; - uint32 SummonWhelpsTimer; - uint32 BellowingRoarTimer; - uint32 WingBuffetTimer; - uint32 KnockAwayTimer; - uint32 FireballTimer; - - bool InitialSpawn; - - void Reset() - { - Phase = 1; - - FlameBreathTimer = 20000; - TailSweepTimer = 2000; - CleaveTimer = 15000; - MovementTimer = 3000; - EngulfingFlamesTimer = 15000; - SummonWhelpsTimer = 45000; - BellowingRoarTimer = 30000; - WingBuffetTimer = 17000; - KnockAwayTimer = 15000; - FireballTimer = 18000; - - InitialSpawn = true; - } - - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO, m_creature); - DoZoneInCombat(); - } - - void JustDied(Unit* Killer) - { - } - - void KilledUnit(Unit *victim) - { - DoScriptText(SAY_KILL, m_creature); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 60) && (Phase == 1)) - { - Phase = 2; - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - m_creature->SetHover(true); - m_creature->GetMotionMaster()->Clear(false); - m_creature->GetMotionMaster()->MoveIdle(); - DoScriptText(SAY_PHASE_2_TRANS, m_creature); - } - - if (((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 40) && (Phase == 2)) - { - Phase = 3; - m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - m_creature->SetHover(false); - m_creature->GetMotionMaster()->MovePoint(0, -10.6155, -219.357, -87.7344); - DoStartMovement(m_creature->getVictim()); - m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - DoScriptText(SAY_PHASE_3_TRANS, m_creature); - m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); - } - - if (Phase == 1 || Phase == 3) - { - if (FlameBreathTimer < diff) - { - DoCast(m_creature->getVictim(), SPELL_FLAMEBREATH); - FlameBreathTimer = 15000; - }else FlameBreathTimer -= diff; - - if (TailSweepTimer < diff) - { - Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1); - if (target && !m_creature->HasInArc(M_PI, target)) - DoCast(target, SPELL_TAILSWEEP); - - TailSweepTimer = 10000; - }else TailSweepTimer -= diff; - - if (CleaveTimer < diff) - { - DoCast(m_creature->getVictim(), SPELL_CLEAVE); - CleaveTimer = 10000; - }else CleaveTimer -= diff; - - if (WingBuffetTimer < diff) - { - DoCast(m_creature->getVictim(), SPELL_WINGBUFFET); - WingBuffetTimer = 7000 + ((rand()%8)*1000); - }else WingBuffetTimer -= diff; - - if (KnockAwayTimer < diff) - { - if (rand() <= 30) - { - DoCast(m_creature->getVictim(), SPELL_KNOCK_AWAY); - } - KnockAwayTimer = 15000; - }else KnockAwayTimer -= diff; - - if (Phase == 3) - { - if (BellowingRoarTimer < diff) - { - DoCast(m_creature->getVictim(), SPELL_BELLOWINGROAR); - - BellowingRoarTimer = 30000; - }else BellowingRoarTimer -= diff; - - if (SummonWhelpsTimer < diff) - { - SummonWhelps(Phase); - - SummonWhelpsTimer = 45000; - }else SummonWhelpsTimer -= diff; - } - - DoMeleeAttackIfReady(); - } - - if (Phase == 2) - { - if (InitialSpawn) - { - InitialSpawn = false; - - for(uint32 i = 0; i < 10; ++i) - { - uint32 random = rand()%4; - Creature* Whelp = m_creature->SummonCreature(CREATURE_WHELP, SpawnLocations[random][0], SpawnLocations[random][1], SpawnLocations[random][2], 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000); - if (Whelp) - Whelp->AI()->AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 0)); - } - } - - if (EngulfingFlamesTimer < diff) - { - DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_ENGULFINGFLAMES); - m_creature->HandleEmoteCommand(ANIM_FLY); - - EngulfingFlamesTimer = 10000; - } - else EngulfingFlamesTimer -= diff; - - if (FireballTimer < diff) - { - DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_FIREBALL); - - FireballTimer = 18000; - } - else FireballTimer -= diff; - - if (MovementTimer < diff) - { - if (rand()%100 < 30) - { - DoScriptText(EMOTE_BREATH, m_creature); - DoCast(m_creature->getVictim(), SPELL_DEEPBREATH); - } - else ChangePosition(); - - MovementTimer = 25000; - }else MovementTimer -= diff; - - if (SummonWhelpsTimer < diff) - { - SummonWhelps(Phase); - - SummonWhelpsTimer = 45000; - } - else SummonWhelpsTimer -= diff; - } - } - - void ChangePosition() - { - uint32 random = rand() % 4; - if (random<4){ - m_creature->GetMotionMaster()->MovePoint(0, MovementLocations[random][0], MovementLocations[random][1], MovementLocations[random][2]);} - } - - void SummonWhelps(uint32 Phase) - { - if (Phase == 2) - { - uint32 max = rand()%10; - for(uint32 i = 0; i < max; ++i) - { - uint32 random = rand()%3; - Creature* Whelp = m_creature->SummonCreature(CREATURE_WHELP, SpawnLocations[random][0], SpawnLocations[random][1], SpawnLocations[random][2], 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000); - if (Whelp) - Whelp->AI()->AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 0)); - } - } - - if (Phase == 3) - { - uint32 max = rand() % 10 +1; - if (max < 5) - { - for(uint32 i = 0; i < max; ++i) - { - uint32 random = rand()%4; - Creature* Whelp = m_creature->SummonCreature(CREATURE_WHELP, SpawnLocations[random][0], SpawnLocations[random][1], SpawnLocations[random][2], 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000); - if (Whelp) - Whelp->AI()->AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 0)); - } - } - } - } -}; - -CreatureAI* GetAI_boss_onyxiaAI(Creature* pCreature) -{ - return new boss_onyxiaAI (pCreature); -} - -void AddSC_boss_onyxia() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_onyxia"; - newscript->GetAI = &GetAI_boss_onyxiaAI; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/razorfen_downs/boss_amnennar_the_coldbringer.cpp b/src/bindings/scripts/scripts/zone/razorfen_downs/boss_amnennar_the_coldbringer.cpp deleted file mode 100644 index 2ecccaf2980..00000000000 --- a/src/bindings/scripts/scripts/zone/razorfen_downs/boss_amnennar_the_coldbringer.cpp +++ /dev/null @@ -1,130 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Amnennar_the_coldbringer -SD%Complete: 100 -SDComment: -SDCategory: Razorfen Downs -EndScriptData */ - -#include "precompiled.h" - -#define SAY_AGGRO -1129000 -#define SAY_SUMMON60 -1129001 -#define SAY_SUMMON30 -1129002 -#define SAY_HP -1129003 -#define SAY_KILL -1129004 - -#define SPELL_AMNENNARSWRATH 13009 -#define SPELL_FROSTBOLT 15530 -#define SPELL_FROST_NOVA 15531 -#define SPELL_FROST_SPECTRES 12642 - -struct TRINITY_DLL_DECL boss_amnennar_the_coldbringerAI : public ScriptedAI -{ - boss_amnennar_the_coldbringerAI(Creature *c) : ScriptedAI(c) {} - - uint32 AmnenarsWrath_Timer; - uint32 FrostBolt_Timer; - uint32 FrostNova_Timer; - bool Spectrals60; - bool Spectrals30; - bool Hp; - - void Reset() - { - AmnenarsWrath_Timer = 8000; - FrostBolt_Timer = 1000; - FrostNova_Timer = 10000 + rand()%5000; - Spectrals30 = false; - Spectrals60 = false; - Hp = false; - } - - void EnterCombat(Unit *who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - - void KilledUnit() - { - DoScriptText(SAY_KILL, m_creature); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //AmnenarsWrath_Timer - if (AmnenarsWrath_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_AMNENNARSWRATH); - AmnenarsWrath_Timer = 12000; - } else AmnenarsWrath_Timer -= diff; - - //FrostBolt_Timer - if (FrostBolt_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_FROSTBOLT); - FrostBolt_Timer = 8000; - } else FrostBolt_Timer -= diff; - - if (FrostNova_Timer < diff) - { - DoCast(m_creature,SPELL_FROST_NOVA); - FrostNova_Timer = 15000; - } else FrostNova_Timer -= diff; - - if (!Spectrals60 && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 60) - { - DoScriptText(SAY_SUMMON60, m_creature); - DoCast(m_creature->getVictim(),SPELL_FROST_SPECTRES); - Spectrals60 = true; - } - - if (!Hp && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 50) - { - DoScriptText(SAY_HP, m_creature); - Hp = true; - } - - if (!Spectrals30 && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 30) - { - DoScriptText(SAY_SUMMON30, m_creature); - DoCast(m_creature->getVictim(),SPELL_FROST_SPECTRES); - Spectrals30 = true; - } - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_amnennar_the_coldbringer(Creature* pCreature) -{ - return new boss_amnennar_the_coldbringerAI (pCreature); -} - -void AddSC_boss_amnennar_the_coldbringer() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_amnennar_the_coldbringer"; - newscript->GetAI = &GetAI_boss_amnennar_the_coldbringer; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/razorfen_downs/razorfen_downs.cpp b/src/bindings/scripts/scripts/zone/razorfen_downs/razorfen_downs.cpp deleted file mode 100644 index 7515c5a9195..00000000000 --- a/src/bindings/scripts/scripts/zone/razorfen_downs/razorfen_downs.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Razorfen_Downs -SD%Complete: 100 -SDComment: Support for Henry Stern(2 recipes) -SDCategory: Razorfen Downs -EndScriptData */ - -/* ContentData -npc_henry_stern -EndContentData */ - -#include "precompiled.h" - -/*### -# npc_henry_stern -####*/ - -enum -{ - SPELL_GOLDTHORN_TEA = 13028, - SPELL_TEACHING_GOLDTHORN_TEA = 13029, - SPELL_MIGHT_TROLLS_BLOOD_POTION = 3451, - SPELL_TEACHING_MIGHTY_TROLLS_BLOOD_POTION = 13030, - GOSSIP_TEXT_TEA_ANSWER = 2114, - GOSSIP_TEXT_POTION_ANSWER = 2115, -}; - -#define GOSSIP_ITEM_TEA "Teach me the cooking recipe" -#define GOSSIP_ITEM_POTION "Teach me the alchemy recipe" - -bool GossipHello_npc_henry_stern (Player* pPlayer, Creature* pCreature) -{ - if (pPlayer->GetBaseSkillValue(SKILL_COOKING) >= 175 && !pPlayer->HasSpell(SPELL_GOLDTHORN_TEA)) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_TEA, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - - if (pPlayer->GetBaseSkillValue(SKILL_ALCHEMY) >= 180 && !pPlayer->HasSpell(SPELL_MIGHT_TROLLS_BLOOD_POTION)) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_POTION, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - - pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); - return true; -} - -bool GossipSelect_npc_henry_stern (Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) - { - pCreature->CastSpell(pPlayer, SPELL_TEACHING_GOLDTHORN_TEA, true); - pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXT_TEA_ANSWER, pCreature->GetGUID()); - } - - if (uiAction == GOSSIP_ACTION_INFO_DEF + 2) - { - pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXT_POTION_ANSWER, pCreature->GetGUID()); - pCreature->CastSpell(pPlayer, SPELL_TEACHING_MIGHTY_TROLLS_BLOOD_POTION, true); - } - - return true; -} - -void AddSC_razorfen_downs() -{ - Script* newscript; - - newscript = new Script; - newscript->Name = "npc_henry_stern"; - newscript->pGossipHello = &GossipHello_npc_henry_stern; - newscript->pGossipSelect = &GossipSelect_npc_henry_stern; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/razorfen_kraul/def_razorfen_kraul.h b/src/bindings/scripts/scripts/zone/razorfen_kraul/def_razorfen_kraul.h deleted file mode 100644 index 96917fcd4bf..00000000000 --- a/src/bindings/scripts/scripts/zone/razorfen_kraul/def_razorfen_kraul.h +++ /dev/null @@ -1,21 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef DEF_RAZORFEN_KRAUL_H -#define DEF_RAZORFEN_KRAUL_H - -#define TYPE_WARD_KEEPERS 1 -#endif \ No newline at end of file diff --git a/src/bindings/scripts/scripts/zone/razorfen_kraul/instance_razorfen_kraul.cpp b/src/bindings/scripts/scripts/zone/razorfen_kraul/instance_razorfen_kraul.cpp deleted file mode 100644 index 94b0943cf3d..00000000000 --- a/src/bindings/scripts/scripts/zone/razorfen_kraul/instance_razorfen_kraul.cpp +++ /dev/null @@ -1,105 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Instance_Razorfen_Kraul -SD%Complete: -SDComment: -SDCategory: Razorfen Kraul -EndScriptData */ - -#include "precompiled.h" -#include "def_razorfen_kraul.h" - - -#define WARD_KEEPERS_NR 2 - -struct TRINITY_DLL_DECL instance_razorfen_kraul : public ScriptedInstance -{ - instance_razorfen_kraul(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; - - uint64 DoorWardGUID; - uint32 WardCheck_Timer; - int WardKeeperAlive; - - void Initialize() - { - WardKeeperAlive = 1; - WardCheck_Timer = 4000; - DoorWardGUID = 0; - } - - Player* GetPlayerInMap() - { - Map::PlayerList const& players = instance->GetPlayers(); - - if (!players.isEmpty()) - { - for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) - { - if (Player* plr = itr->getSource()) - return plr; - } - } - debug_log("TSCR: Instance Razorfen Kraul: GetPlayerInMap, but PlayerList is empty!"); - return NULL; - } - - void OnGameObjectCreate(GameObject* pGo, bool apply) - { - switch(pGo->GetEntry()) - { - case 21099: DoorWardGUID = pGo->GetGUID(); break; - } - } - - void Update(uint32 diff) - { - if (WardCheck_Timer < diff) - { - HandleGameObject(DoorWardGUID, WardKeeperAlive); - WardKeeperAlive = 0; - WardCheck_Timer = 4000; - }else - WardCheck_Timer -= diff; - } - - void SetData(uint32 type, uint32 data) - { - switch(type) - { - case TYPE_WARD_KEEPERS: - if (data == NOT_STARTED) - WardKeeperAlive = 1; - break; - } - } - -}; - -InstanceData* GetInstanceData_instance_razorfen_kraul(Map* pMap) -{ - return new instance_razorfen_kraul(pMap); -} - -void AddSC_instance_razorfen_kraul() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_razorfen_kraul"; - newscript->GetInstanceData = &GetInstanceData_instance_razorfen_kraul; - newscript->RegisterSelf(); -} \ No newline at end of file diff --git a/src/bindings/scripts/scripts/zone/razorfen_kraul/razorfen_kraul.cpp b/src/bindings/scripts/scripts/zone/razorfen_kraul/razorfen_kraul.cpp deleted file mode 100644 index a6bd845b13e..00000000000 --- a/src/bindings/scripts/scripts/zone/razorfen_kraul/razorfen_kraul.cpp +++ /dev/null @@ -1,252 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Razorfen Kraul -SD%Complete: 100 -SDComment: Quest support: 1144 -SDCategory: Razorfen Kraul -EndScriptData */ - -/* ContentData -npc_willix -EndContentData */ - -#include "precompiled.h" -#include "escortAI.h" -#include "def_razorfen_kraul.h" - -#define SAY_READY -1047000 -#define SAY_POINT -10470001 -#define SAY_AGGRO1 -1047002 -#define SAY_BLUELEAF -1047003 -#define SAY_DANGER -1047004 -#define SAY_BAD -1047005 -#define SAY_THINK -1047006 -#define SAY_SOON -1047007 -#define SAY_FINALY -1047008 -#define SAY_WIN -1047009 -#define SAY_END -1047010 - -#define QUEST_WILLIX_THE_IMPORTER 1144 -#define ENTRY_BOAR 4514 -#define SPELL_QUILLBOAR_CHANNELING 7083 - -struct TRINITY_DLL_DECL npc_willixAI : public npc_escortAI -{ - npc_willixAI(Creature *c) : npc_escortAI(c) {} - - void WaypointReached(uint32 i) - { - Player* pPlayer = Unit::GetPlayer(PlayerGUID); - - if (!pPlayer) - return; - - switch (i) - { - case 3: - m_creature->HandleEmoteCommand(EMOTE_STATE_POINT); - DoScriptText(SAY_POINT, m_creature, pPlayer); - break; - case 4: - m_creature->SummonCreature(ENTRY_BOAR, 2137.66, 1843.98, 48.08, 1.54, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - break; - case 8: - DoScriptText(SAY_BLUELEAF, m_creature, pPlayer); - break; - case 9: - DoScriptText(SAY_DANGER, m_creature, pPlayer); - break; - case 13: - DoScriptText(SAY_BAD, m_creature, pPlayer); - break; - case 14: - m_creature->SummonCreature(ENTRY_BOAR, 2078.91, 1704.54, 56.77, 1.54, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - break; - case 25: - DoScriptText(SAY_THINK, m_creature, pPlayer); - break; - case 31: - DoScriptText(SAY_SOON, m_creature, pPlayer); - break; - case 42: - DoScriptText(SAY_FINALY, m_creature, pPlayer); - break; - case 43: - m_creature->SummonCreature(ENTRY_BOAR, 1956.43, 1596.97, 81.75, 1.54,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - break; - case 45: - DoScriptText(SAY_WIN, m_creature, pPlayer); - if (pPlayer && pPlayer->GetTypeId() == TYPEID_PLAYER) - CAST_PLR(pPlayer)->GroupEventHappens(QUEST_WILLIX_THE_IMPORTER,m_creature); - break; - case 46: - DoScriptText(SAY_END, m_creature, pPlayer); - break; - } - } - - void Reset() {} - - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO1, m_creature, NULL); - } - - void JustSummoned(Creature* summoned) - { - summoned->AI()->AttackStart(m_creature); - } - - void JustDied(Unit* killer) - { - if (PlayerGUID) - { - if (Player* pPlayer = Unit::GetPlayer(PlayerGUID)) - CAST_PLR(pPlayer)->FailQuest(QUEST_WILLIX_THE_IMPORTER); - } - } - - void UpdateAI(const uint32 diff) - { - npc_escortAI::UpdateAI(diff); - } -}; - -bool QuestAccept_npc_willix(Player* pPlayer, Creature* pCreature, Quest const* quest) -{ - if (quest->GetQuestId() == QUEST_WILLIX_THE_IMPORTER) - { - CAST_AI(npc_escortAI, (pCreature->AI()))->Start(true, false, pPlayer->GetGUID()); - DoScriptText(SAY_READY, pCreature, pPlayer); - pCreature->setFaction(113); - } - - return true; -} - -struct TRINITY_DLL_DECL npc_deaths_head_ward_keeperAI : public ScriptedAI -{ - npc_deaths_head_ward_keeperAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - Reset(); - } - - ScriptedInstance *pInstance; - uint32 QuillboarChanneling_Timer; - - void Reset() - { - QuillboarChanneling_Timer = 1500; - } - - void UpdateAI(const uint32 diff) - { - if (!m_creature->isAlive()) - return; - - if (pInstance) - pInstance->SetData(TYPE_WARD_KEEPERS, NOT_STARTED); - - if (QuillboarChanneling_Timer < diff) - { - if (m_creature->IsNonMeleeSpellCasted(false)) - m_creature->InterruptNonMeleeSpells(true); - DoCast(m_creature, SPELL_QUILLBOAR_CHANNELING); - QuillboarChanneling_Timer = 1100; - }else QuillboarChanneling_Timer -= diff; - - } -}; - -CreatureAI* GetAI_npc_deaths_head_ward_keeper(Creature* pCreature) -{ - return new npc_deaths_head_ward_keeperAI(pCreature); -} - -CreatureAI* GetAI_npc_willix(Creature* pCreature) -{ - npc_willixAI* thisAI = new npc_willixAI(pCreature); - - thisAI->AddWaypoint(0, 2194.38, 1791.65, 65.48, 5000); - thisAI->AddWaypoint(1, 2188.56, 1805.87, 64.45); - thisAI->AddWaypoint(2, 2187, 1843.49, 59.33); - thisAI->AddWaypoint(3, 2163.27, 1851.67, 56.73, 5000); - thisAI->AddWaypoint(4, 2137.66, 1843.98, 48.08, 5000); - thisAI->AddWaypoint(5, 2140.22, 1845.02, 48.32); - thisAI->AddWaypoint(6, 2131.5, 1804.29, 46.85); - thisAI->AddWaypoint(7, 2096.18, 1789.03, 51.13); - thisAI->AddWaypoint(8, 2074.46, 1780.09, 55.64, 3000); - thisAI->AddWaypoint(9, 2055.12, 1768.67, 58.46, 5000); - thisAI->AddWaypoint(10, 2037.83, 1748.62, 60.27); - thisAI->AddWaypoint(11, 2037.51, 1728.94, 60.85); - thisAI->AddWaypoint(12, 2044.7, 1711.71, 59.71); - thisAI->AddWaypoint(13, 2067.66, 1701.84, 57.77, 3000); - thisAI->AddWaypoint(14, 2078.91, 1704.54, 56.77, 3000); - thisAI->AddWaypoint(15, 2097.65, 1715.24, 54.74); - thisAI->AddWaypoint(16, 2106.44, 1720.98, 54.41); - thisAI->AddWaypoint(17, 2123.96, 1732.56, 52.27); - thisAI->AddWaypoint(18, 2153.82, 1728.73, 51.92); - thisAI->AddWaypoint(19, 2163.49, 1706.33, 54.42); - thisAI->AddWaypoint(20, 2158.75, 1695.98, 55.70); - thisAI->AddWaypoint(21, 2142.6, 1680.72, 58.24); - thisAI->AddWaypoint(22, 2118.31, 1671.54, 59.21); - thisAI->AddWaypoint(23, 2086.02, 1672.04, 61.24); - thisAI->AddWaypoint(24, 2068.81, 1658.93, 61.24); - thisAI->AddWaypoint(25, 2062.82, 1633.31, 64.35, 3000); - thisAI->AddWaypoint(26, 2063.05, 1589.16, 63.26); - thisAI->AddWaypoint(27, 2063.67, 1577.22, 65.89); - thisAI->AddWaypoint(28, 2057.94, 1560.68, 68.40); - thisAI->AddWaypoint(29, 2052.56, 1548.05, 73.35); - thisAI->AddWaypoint(30, 2045.22, 1543.4, 76.65); - thisAI->AddWaypoint(31, 2034.35, 1543.01, 79.70); - thisAI->AddWaypoint(32, 2029.95, 1542.94, 80.79); - thisAI->AddWaypoint(33, 2021.34, 1538.67, 80.8); - thisAI->AddWaypoint(34, 2012.45, 1549.48, 79.93); - thisAI->AddWaypoint(35, 2008.05, 1554.92, 80.44); - thisAI->AddWaypoint(36, 2006.54, 1562.72, 81.11); - thisAI->AddWaypoint(37, 2003.8, 1576.43, 81.57); - thisAI->AddWaypoint(38, 2000.57, 1590.06, 80.62); - thisAI->AddWaypoint(39, 1998.96, 1596.87, 80.22); - thisAI->AddWaypoint(40, 1991.19, 1600.82, 79.39); - thisAI->AddWaypoint(41, 1980.71, 1601.44, 79.77, 3000); - thisAI->AddWaypoint(42, 1967.22, 1600.18, 80.62, 3000); - thisAI->AddWaypoint(43, 1956.43, 1596.97, 81.75, 3000); - thisAI->AddWaypoint(44, 1954.87, 1592.02, 82.18); - thisAI->AddWaypoint(45, 1948.35, 1571.35, 80.96, 30000); - thisAI->AddWaypoint(46, 1947.02, 1566.42, 81.80, 30000); - - return thisAI; -} - -void AddSC_razorfen_kraul() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "npc_willix"; - newscript->GetAI = &GetAI_npc_willix; - newscript->pQuestAccept = &QuestAccept_npc_willix; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "npc_deaths_head_ward_keeper"; - newscript->GetAI = &GetAI_npc_deaths_head_ward_keeper; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_ayamiss.cpp b/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_ayamiss.cpp deleted file mode 100644 index eefedb2c0d5..00000000000 --- a/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_ayamiss.cpp +++ /dev/null @@ -1,108 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Ayamiss -SD%Complete: 50 -SDComment: VERIFY SCRIPT -SDCategory: Ruins of Ahn'Qiraj -EndScriptData */ - -#include "precompiled.h" - -/* -To do: -make him fly from 70-100% -*/ - -#define SPELL_STINGERSPRAY 25749 -#define SPELL_POISONSTINGER 25748 //only used in phase1 -#define SPELL_SUMMONSWARMER 25844 //might be 25708 -// #define SPELL_PARALYZE 23414 doesnt work correct (core) - -struct TRINITY_DLL_DECL boss_ayamissAI : public ScriptedAI -{ - boss_ayamissAI(Creature *c) : ScriptedAI(c) {} - - Unit *pTarget; - uint32 STINGERSPRAY_Timer; - uint32 POISONSTINGER_Timer; - uint32 SUMMONSWARMER_Timer; - uint32 phase; - - void Reset() - { - pTarget = NULL; - STINGERSPRAY_Timer = 30000; - POISONSTINGER_Timer = 30000; - SUMMONSWARMER_Timer = 60000; - phase=1; - } - - void EnterCombat(Unit *who) - { - pTarget = who; - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //If he is 70% start phase 2 - if (phase==1 && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 70 && !m_creature->IsNonMeleeSpellCasted(false)) - { - phase=2; - } - - //STINGERSPRAY_Timer (only in phase2) - if (phase==2 && STINGERSPRAY_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_STINGERSPRAY); - STINGERSPRAY_Timer = 30000; - }else STINGERSPRAY_Timer -= diff; - - //POISONSTINGER_Timer (only in phase1) - if (phase==1 && POISONSTINGER_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_POISONSTINGER); - POISONSTINGER_Timer = 30000; - }else POISONSTINGER_Timer -= diff; - - //SUMMONSWARMER_Timer (only in phase1) - if (SUMMONSWARMER_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_SUMMONSWARMER); - SUMMONSWARMER_Timer = 60000; - }else SUMMONSWARMER_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_ayamiss(Creature* pCreature) -{ - return new boss_ayamissAI (pCreature); -} - -void AddSC_boss_ayamiss() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_ayamiss"; - newscript->GetAI = &GetAI_boss_ayamiss; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_buru.cpp b/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_buru.cpp deleted file mode 100644 index 58c48540362..00000000000 --- a/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_buru.cpp +++ /dev/null @@ -1,27 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Buru -SD%Complete: 0 -SDComment: Place Holder -SDCategory: Ruins of Ahn'Qiraj -EndScriptData */ - -#include "precompiled.h" - - #define EMOTE_TARGET -1509002 - diff --git a/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_kurinnaxx.cpp b/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_kurinnaxx.cpp deleted file mode 100644 index e781c749d0d..00000000000 --- a/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_kurinnaxx.cpp +++ /dev/null @@ -1,94 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Kurinnaxx -SD%Complete: 100 -SDComment: VERIFY SCRIPT AND SQL -SDCategory: Ruins of Ahn'Qiraj -EndScriptData */ - -#include "precompiled.h" - -#define SPELL_MORTALWOUND 25646 -#define SPELL_SANDTRAP 25656 -#define SPELL_ENRAGE 28798 - -struct TRINITY_DLL_DECL boss_kurinnaxxAI : public ScriptedAI -{ - boss_kurinnaxxAI(Creature *c) : ScriptedAI(c) {} - - Unit *pTarget; - uint32 MORTALWOUND_Timer; - uint32 SANDTRAP_Timer; - uint32 i; - - void Reset() - { - i=0; - pTarget = NULL; - MORTALWOUND_Timer = 30000; - SANDTRAP_Timer = 30000; - } - - void EnterCombat(Unit *who) - { - pTarget = who; - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //If we are <30% cast enrage - if (i==0 && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 30 && !m_creature->IsNonMeleeSpellCasted(false)) - { - i=1; - DoCast(m_creature->getVictim(),SPELL_ENRAGE); - } - - //MORTALWOUND_Timer - if (MORTALWOUND_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_MORTALWOUND); - MORTALWOUND_Timer = 30000; - }else MORTALWOUND_Timer -= diff; - - //SANDTRAP_Timer - if (SANDTRAP_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_SANDTRAP); - SANDTRAP_Timer = 30000; - }else SANDTRAP_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_kurinnaxx(Creature* pCreature) -{ - return new boss_kurinnaxxAI (pCreature); -} - -void AddSC_boss_kurinnaxx() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_kurinnaxx"; - newscript->GetAI = &GetAI_boss_kurinnaxx; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_moam.cpp b/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_moam.cpp deleted file mode 100644 index 4d62a923e16..00000000000 --- a/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_moam.cpp +++ /dev/null @@ -1,120 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Moam -SD%Complete: 100 -SDComment: VERIFY SCRIPT AND SQL -SDCategory: Ruins of Ahn'Qiraj -EndScriptData */ - -#include "precompiled.h" - -#define EMOTE_AGGRO -1509000 -#define EMOTE_MANA_FULL -1509001 - -#define SPELL_TRAMPLE 15550 -#define SPELL_DRAINMANA 27256 -#define SPELL_ARCANEERUPTION 25672 -#define SPELL_SUMMONMANA 25681 -#define SPELL_GRDRSLEEP 24360 //Greater Dreamless Sleep - -struct TRINITY_DLL_DECL boss_moamAI : public ScriptedAI -{ - boss_moamAI(Creature *c) : ScriptedAI(c) {} - - Unit *pTarget; - uint32 TRAMPLE_Timer; - uint32 DRAINMANA_Timer; - uint32 SUMMONMANA_Timer; - uint32 i; - uint32 j; - - void Reset() - { - i=0; - j=0; - pTarget = NULL; - TRAMPLE_Timer = 30000; - DRAINMANA_Timer = 30000; - } - - void EnterCombat(Unit *who) - { - DoScriptText(EMOTE_AGGRO, m_creature); - pTarget = who; - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //If we are 100%MANA cast Arcane Erruption - //if (j==1 && m_creature->GetMana()*100 / m_creature->GetMaxMana() == 100 && !m_creature->IsNonMeleeSpellCasted(false)) - { - DoCast(m_creature->getVictim(),SPELL_ARCANEERUPTION); - DoScriptText(EMOTE_MANA_FULL, m_creature); - } - - //If we are <50%HP cast MANA FIEND (Summon Mana) and Sleep - //if (i==0 && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 50 && !m_creature->IsNonMeleeSpellCasted(false)) - { - i=1; - DoCast(m_creature->getVictim(),SPELL_SUMMONMANA); - DoCast(m_creature->getVictim(),SPELL_GRDRSLEEP); - } - - //SUMMONMANA_Timer - if (i==1 && SUMMONMANA_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_SUMMONMANA); - SUMMONMANA_Timer = 90000; - }else SUMMONMANA_Timer -= diff; - - //TRAMPLE_Timer - if (TRAMPLE_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_TRAMPLE); - j=1; - - TRAMPLE_Timer = 30000; - }else TRAMPLE_Timer -= diff; - - //DRAINMANA_Timer - if (DRAINMANA_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_DRAINMANA); - DRAINMANA_Timer = 30000; - }else DRAINMANA_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_moam(Creature* pCreature) -{ - return new boss_moamAI (pCreature); -} - -void AddSC_boss_moam() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_moam"; - newscript->GetAI = &GetAI_boss_moam; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_ossirian.cpp b/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_ossirian.cpp deleted file mode 100644 index 5652b706917..00000000000 --- a/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_ossirian.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Ossirian -SD%Complete: 0 -SDComment: Place holder -SDCategory: Ruins of Ahn'Qiraj -EndScriptData */ - -#include "precompiled.h" - -#define SAY_SURPREME2 -1509019 -#define SAY_SURPREME3 -1509020 - -#define SAY_RAND_INTRO1 -1509021 -#define SAY_RAND_INTRO2 -1509022 -#define SAY_RAND_INTRO3 -1509023 -#define SAY_RAND_INTRO4 -1509024 //possibly old? - -#define SAY_AGGRO -1509025 - -#define SAY_SLAY -1509026 -#define SAY_DEATH -1509027 - diff --git a/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_rajaxx.cpp b/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_rajaxx.cpp deleted file mode 100644 index fb2c92ff59f..00000000000 --- a/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_rajaxx.cpp +++ /dev/null @@ -1,45 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Rajaxx -SD%Complete: 0 -SDComment: Place Holder -SDCategory: Ruins of Ahn'Qiraj -EndScriptData */ - -#include "precompiled.h" - -#define SAY_ANDOROV_INTRO -1509003 -#define SAY_ANDOROV_ATTACK -1509004 - -#define SAY_WAVE3 -1509005 -#define SAY_WAVE4 -1509006 -#define SAY_WAVE5 -1509007 -#define SAY_WAVE6 -1509008 -#define SAY_WAVE7 -1509009 -#define SAY_INTRO -1509010 - -#define SAY_UNK1 -1509011 -#define SAY_UNK2 -1509012 -#define SAY_UNK3 -1509013 -#define SAY_UNK4 -1509014 - -#define SAY_DEAGGRO -1509015 -#define SAY_KILLS_ANDOROV -1509016 - -#define SAY_COMPLETE_QUEST -1509017 //Yell when realm complete quest 8743 for world event - diff --git a/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/instance_ruins_of_ahnqiraj.cpp b/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/instance_ruins_of_ahnqiraj.cpp deleted file mode 100644 index b94e6f16a80..00000000000 --- a/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/instance_ruins_of_ahnqiraj.cpp +++ /dev/null @@ -1,25 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Instance_Ruins_of_Ahnqiraj -SD%Complete: 0 -SDComment: Place holder -SDCategory: Ruins of Ahn'Qiraj -EndScriptData */ - -#include "precompiled.h" - diff --git a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_bug_trio.cpp b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_bug_trio.cpp deleted file mode 100644 index 042dd5d53f5..00000000000 --- a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_bug_trio.cpp +++ /dev/null @@ -1,346 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: boss_kri, boss_yauj, boss_vem : The Bug Trio -SD%Complete: 100 -SDComment: -SDCategory: Temple of Ahn'Qiraj -EndScriptData */ - -#include "precompiled.h" -#include "def_temple_of_ahnqiraj.h" - -#define SPELL_CLEAVE 26350 -#define SPELL_TOXIC_VOLLEY 25812 -#define SPELL_POISON_CLOUD 38718 //Only Spell with right dmg. -#define SPELL_ENRAGE 34624 //Changed cause 25790 is casted on gamers too. Same prob with old explosion of twin emperors. - -#define SPELL_CHARGE 26561 -#define SPELL_KNOCKBACK 26027 - -#define SPELL_HEAL 25807 -#define SPELL_FEAR 19408 - -struct TRINITY_DLL_DECL boss_kriAI : public ScriptedAI -{ - boss_kriAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance *pInstance; - - uint32 Cleave_Timer; - uint32 ToxicVolley_Timer; - uint32 Check_Timer; - - bool VemDead; - bool Death; - - void Reset() - { - Cleave_Timer = 4000 + rand()%4000; - ToxicVolley_Timer = 6000 + rand()%6000; - Check_Timer = 2000; - - VemDead = false; - Death = false; - } - - void EnterCombat(Unit *who) - { - } - - void JustDied(Unit* killer) - { - if (pInstance) - { - if (pInstance->GetData(DATA_BUG_TRIO_DEATH) < 2) - // Unlootable if death - m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); - - pInstance->SetData(DATA_BUG_TRIO_DEATH, 1); - } - } - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //Cleave_Timer - if (Cleave_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_CLEAVE); - Cleave_Timer = 5000 + rand()%7000; - }else Cleave_Timer -= diff; - - //ToxicVolley_Timer - if (ToxicVolley_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_TOXIC_VOLLEY); - ToxicVolley_Timer = 10000 + rand()%5000; - }else ToxicVolley_Timer -= diff; - - if (m_creature->GetHealth() <= m_creature->GetMaxHealth() * 0.05 && !Death) - { - DoCast(m_creature->getVictim(),SPELL_POISON_CLOUD); - Death = true; - } - - if (!VemDead) - { - //Checking if Vem is dead. If yes we will enrage. - if (Check_Timer < diff) - { - if (pInstance && pInstance->GetData(DATA_VEMISDEAD)) - { - DoCast(m_creature, SPELL_ENRAGE); - VemDead = true; - } - Check_Timer = 2000; - }else Check_Timer -=diff; - } - - DoMeleeAttackIfReady(); - } -}; - -struct TRINITY_DLL_DECL boss_vemAI : public ScriptedAI -{ - boss_vemAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance *pInstance; - - uint32 Charge_Timer; - uint32 KnockBack_Timer; - uint32 Enrage_Timer; - - bool Enraged; - - void Reset() - { - Charge_Timer = 15000 + rand()%12000; - KnockBack_Timer = 8000 + rand()%12000; - Enrage_Timer = 120000; - - Enraged = false; - } - - void JustDied(Unit* Killer) - { - if (pInstance) - { - pInstance->SetData(DATA_VEM_DEATH, 0); - if (pInstance->GetData(DATA_BUG_TRIO_DEATH) < 2) - // Unlootable if death - m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); - pInstance->SetData(DATA_BUG_TRIO_DEATH, 1); - } - } - - void EnterCombat(Unit *who) - { - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //Charge_Timer - if (Charge_Timer < diff) - { - Unit* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM,0); - if (target) - { - DoCast(target, SPELL_CHARGE); - //m_creature->SendMonsterMove(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, true,1); - AttackStart(target); - } - - Charge_Timer = 8000 + rand()%8000; - }else Charge_Timer -= diff; - - //KnockBack_Timer - if (KnockBack_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_KNOCKBACK); - if (DoGetThreat(m_creature->getVictim())) - DoModifyThreatPercent(m_creature->getVictim(),-80); - KnockBack_Timer = 15000 + rand()%10000; - }else KnockBack_Timer -= diff; - - //Enrage_Timer - if (!Enraged && Enrage_Timer < diff) - { - DoCast(m_creature,SPELL_ENRAGE); - Enraged = true; - }else Charge_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -struct TRINITY_DLL_DECL boss_yaujAI : public ScriptedAI -{ - boss_yaujAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance *pInstance; - - uint32 Heal_Timer; - uint32 Fear_Timer; - uint32 Check_Timer; - - bool VemDead; - - void Reset() - { - Heal_Timer = 25000 + rand()%15000; - Fear_Timer = 12000 + rand()%12000; - Check_Timer = 2000; - - VemDead = false; - } - - void JustDied(Unit* Killer) - { - if (pInstance) - { - if (pInstance->GetData(DATA_BUG_TRIO_DEATH) < 2) - // Unlootable if death - m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); - pInstance->SetData(DATA_BUG_TRIO_DEATH, 1); - } - - for(uint8 i = 0; i < 10; ++i) - { - Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0); - Creature* Summoned = m_creature->SummonCreature(15621,m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(),0,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,90000); - if (Summoned && target) - (Summoned->AI())->AttackStart(target); - } - } - - void EnterCombat(Unit *who) - { - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //Fear_Timer - if (Fear_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_FEAR); - DoResetThreat(); - Fear_Timer = 20000; - }else Fear_Timer -= diff; - - //Casting Heal to other twins or herself. - if (Heal_Timer < diff) - { - if (pInstance) - { - Unit *pKri = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_KRI)); - Unit *pVem = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_VEM)); - - switch(rand()%3) - { - case 0: - if (pKri) - DoCast(pKri, SPELL_HEAL); - break; - case 1: - if (pVem) - DoCast(pVem, SPELL_HEAL); - break; - case 2: - DoCast(m_creature, SPELL_HEAL); - break; - } - } - - Heal_Timer = 15000+rand()%15000; - }else Heal_Timer -= diff; - - //Checking if Vem is dead. If yes we will enrage. - if (Check_Timer < diff) - { - if (!VemDead) - { - if (pInstance) - { - if (pInstance->GetData(DATA_VEMISDEAD)) - { - DoCast(m_creature, SPELL_ENRAGE); - VemDead = true; - } - } - } - Check_Timer = 2000; - }else Check_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_yauj(Creature* pCreature) -{ - return new boss_yaujAI (pCreature); -} - -CreatureAI* GetAI_boss_vem(Creature* pCreature) -{ - return new boss_vemAI (pCreature); -} - -CreatureAI* GetAI_boss_kri(Creature* pCreature) -{ - return new boss_kriAI (pCreature); -} - -void AddSC_bug_trio() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_kri"; - newscript->GetAI = &GetAI_boss_kri; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="boss_vem"; - newscript->GetAI = &GetAI_boss_vem; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="boss_yauj"; - newscript->GetAI = &GetAI_boss_yauj; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_cthun.cpp b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_cthun.cpp deleted file mode 100644 index 905f46070f7..00000000000 --- a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_cthun.cpp +++ /dev/null @@ -1,1335 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Cthun -SD%Complete: 95 -SDComment: Darkglare tracking issue -SDCategory: Temple of Ahn'Qiraj -EndScriptData */ - -#include "precompiled.h" -#include "def_temple_of_ahnqiraj.h" - -//Text emote -#define EMOTE_WEAKENED -1531011 - -#define PI 3.14 - -//****** Out of Combat ****** -//Random Wispers - No txt only sound -#define RANDOM_SOUND_WHISPER 8663 - -//***** Phase 1 ******** - -//Mobs -#define BOSS_EYE_OF_CTHUN 15589 -#define MOB_CLAW_TENTACLE 15725 -#define MOB_EYE_TENTACLE 15726 -#define MOB_SMALL_PORTAL 15904 - -//Eye Spells -#define SPELL_GREEN_BEAM 26134 -#define SPELL_DARK_GLARE 26029 -#define SPELL_RED_COLORATION 22518 //Probably not the right spell but looks similar - -//Eye Tentacles Spells -#define SPELL_MIND_FLAY 26143 - -//Claw Tentacles Spells -#define SPELL_GROUND_RUPTURE 26139 -#define SPELL_HAMSTRING 26141 - -#define MOB_ - -//*****Phase 2****** -//Body spells -//#define SPELL_CARAPACE_CTHUN 26156 //Was removed from client dbcs -#define SPELL_TRANSFORM 26232 - -//Eye Tentacles Spells -//SAME AS PHASE1 - -//Giant Claw Tentacles -#define SPELL_MASSIVE_GROUND_RUPTURE 26100 - -//Also casts Hamstring -#define SPELL_THRASH 3391 - -//Giant Eye Tentacles -//CHAIN CASTS "SPELL_GREEN_BEAM" - -//Stomach Spells -#define SPELL_MOUTH_TENTACLE 26332 -#define SPELL_EXIT_STOMACH_KNOCKBACK 25383 -#define SPELL_DIGESTIVE_ACID 26476 - -//Mobs -#define MOB_BODY_OF_CTHUN 15809 -#define MOB_GIANT_CLAW_TENTACLE 15728 -#define MOB_GIANT_EYE_TENTACLE 15334 -#define MOB_FLESH_TENTACLE 15802 -#define MOB_GIANT_PORTAL 15910 - -//Stomach Teleport positions -#define STOMACH_X -8562.0f -#define STOMACH_Y 2037.0f -#define STOMACH_Z -70.0f -#define STOMACH_O 5.05f - -//Flesh tentacle positions -#define TENTACLE_POS1_X -8571.0f -#define TENTACLE_POS1_Y 1990.0f -#define TENTACLE_POS1_Z -98.0f -#define TENTACLE_POS1_O 1.22f - -#define TENTACLE_POS2_X -8525.0f -#define TENTACLE_POS2_Y 1994.0f -#define TENTACLE_POS2_Z -98.0f -#define TENTACLE_POS2_O 2.12f - -//Kick out position -#define KICK_X -8545.0f -#define KICK_Y 1984.0f -#define KICK_Z -96.0f - -struct TRINITY_DLL_DECL flesh_tentacleAI : public ScriptedAI -{ - flesh_tentacleAI(Creature *c) : ScriptedAI(c), Parent(0) - { - SetCombatMovement(false); - } - - uint64 Parent; - uint32 CheckTimer; - - void SpawnedByCthun(uint64 p) - { - Parent = p; - } - - void Reset() - { - CheckTimer = 1000; - } - - void EnterCombat(Unit *who) - { - } - - void UpdateAI(const uint32 diff); - - void JustDied(Unit* killer); -}; - -struct TRINITY_DLL_DECL eye_of_cthunAI : public Scripted_NoMovementAI -{ - eye_of_cthunAI(Creature *c) : Scripted_NoMovementAI(c) - { - pInst = c->GetInstanceData(); - if (!pInst) - error_log("TSCR: No Instance eye_of_cthunAI"); - } - - ScriptedInstance* pInst; - - //Global variables - uint32 PhaseTimer; - - //Eye beam phase - uint32 BeamTimer; - uint32 EyeTentacleTimer; - uint32 ClawTentacleTimer; - - //Dark Glare phase - uint32 DarkGlareTick; - uint32 DarkGlareTickTimer; - float DarkGlareAngle; - bool ClockWise; - - void Reset() - { - //Phase information - PhaseTimer = 50000; //First dark glare in 50 seconds - - //Eye beam phase 50 seconds - BeamTimer = 3000; - EyeTentacleTimer = 45000; //Always spawns 5 seconds before Dark Beam - ClawTentacleTimer = 12500; //4 per Eye beam phase (unsure if they spawn durring Dark beam) - - //Dark Beam phase 35 seconds (each tick = 1 second, 35 ticks) - DarkGlareTick = 0; - DarkGlareTickTimer = 1000; - DarkGlareAngle = 0; - ClockWise = false; - - //Reset flags - m_creature->RemoveAurasDueToSpell(SPELL_RED_COLORATION); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE); - - //Reset Phase - if (pInst) - pInst->SetData(DATA_CTHUN_PHASE, 0); - } - - void EnterCombat(Unit *who) - { - DoZoneInCombat(); - } - - void SpawnEyeTentacle(float x, float y) - { - Creature* Spawned; - Spawned = me->SummonCreature(MOB_EYE_TENTACLE,m_creature->GetPositionX()+x,m_creature->GetPositionY()+y,m_creature->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,500); - if (Spawned) - { - Unit* target; - target = SelectUnit(SELECT_TARGET_RANDOM,0); - - if (target) - Spawned->AI()->AttackStart(target); - } - } - - void UpdateAI(const uint32 diff) - { - //Check if we have a target - if (!UpdateVictim()) - return; - - //No instance - if (!pInst) - return; - - switch (pInst->GetData(DATA_CTHUN_PHASE)) - { - case 0: - { - //BeamTimer - if (BeamTimer < diff) - { - //SPELL_GREEN_BEAM - Unit* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM,0); - if (target) - { - m_creature->InterruptNonMeleeSpells(false); - DoCast(target,SPELL_GREEN_BEAM); - - //Correctly update our target - m_creature->SetUInt64Value(UNIT_FIELD_TARGET, target->GetGUID()); - } - - //Beam every 3 seconds - BeamTimer = 3000; - }else BeamTimer -= diff; - - //ClawTentacleTimer - if (ClawTentacleTimer < diff) - { - Unit* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM,0); - if (target) - { - Creature* Spawned = NULL; - - //Spawn claw tentacle on the random target - Spawned = me->SummonCreature(MOB_CLAW_TENTACLE,target->GetPositionX(),target->GetPositionY(),target->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,500); - - if (Spawned) - Spawned->AI()->AttackStart(target); - } - - //One claw tentacle every 12.5 seconds - ClawTentacleTimer = 12500; - }else ClawTentacleTimer -= diff; - - //EyeTentacleTimer - if (EyeTentacleTimer < diff) - { - //Spawn the 8 Eye Tentacles in the corret spots - SpawnEyeTentacle(0, 20); //south - SpawnEyeTentacle(10, 10); //south west - SpawnEyeTentacle(20, 0); //west - SpawnEyeTentacle(10, -10); //north west - - SpawnEyeTentacle(0, -20); //north - SpawnEyeTentacle(-10, -10); //north east - SpawnEyeTentacle(-20, 0); // east - SpawnEyeTentacle(-10, 10); // south east - - //No point actually putting a timer here since - //These shouldn't trigger agian until after phase shifts - EyeTentacleTimer = 45000; - }else EyeTentacleTimer -= diff; - - //PhaseTimer - if (PhaseTimer < diff) - { - //Switch to Dark Beam - pInst->SetData(DATA_CTHUN_PHASE, 1); - - m_creature->InterruptNonMeleeSpells(false); - - //Select random target for dark beam to start on - Unit* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM,0); - - if (target) - { - //Correctly update our target - m_creature->SetUInt64Value(UNIT_FIELD_TARGET, target->GetGUID()); - - //Face our target - DarkGlareAngle = m_creature->GetAngle(target); - DarkGlareTickTimer = 1000; - DarkGlareTick = 0; - ClockWise = rand()%2; - } - - //Add red coloration to C'thun - DoCast(m_creature,SPELL_RED_COLORATION); - - //Freeze animation - - //Darkbeam for 35 seconds - PhaseTimer = 35000; - }else PhaseTimer -= diff; - - } - break; - case 1: - { - //EyeTentacleTimer - if (DarkGlareTick < 35) - if (DarkGlareTickTimer < diff) - { - //Remove any target - m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0); - - //Set angle and cast - if (ClockWise) - m_creature->SetOrientation(DarkGlareAngle + ((float)DarkGlareTick*PI/35)); - else m_creature->SetOrientation(DarkGlareAngle - ((float)DarkGlareTick*PI/35)); - - m_creature->StopMoving(); - - //Actual dark glare cast, maybe something missing here? - m_creature->CastSpell(m_creature, SPELL_DARK_GLARE, false); - - //Increase tick - DarkGlareTick++; - - //1 second per tick - DarkGlareTickTimer = 1000; - }else DarkGlareTickTimer -= diff; - - //PhaseTimer - if (PhaseTimer < diff) - { - //Switch to Eye Beam - pInst->SetData(DATA_CTHUN_PHASE, 0); - - BeamTimer = 3000; - EyeTentacleTimer = 45000; //Always spawns 5 seconds before Dark Beam - ClawTentacleTimer = 12500; //4 per Eye beam phase (unsure if they spawn durring Dark beam) - - m_creature->InterruptNonMeleeSpells(false); - - //Remove Red coloration from c'thun - m_creature->RemoveAurasDueToSpell(SPELL_RED_COLORATION); - - //Freeze animation - m_creature->SetUInt32Value(UNIT_FIELD_FLAGS, 0); - - //Eye Beam for 50 seconds - PhaseTimer = 50000; - }else PhaseTimer -= diff; - }break; - - //Transition phase - case 2: - { - //Remove any target - m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0); - m_creature->SetHealth(0); - } - - //Dead phase - case 5: - { - m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false); - } - } - } - - void DamageTaken(Unit *done_by, uint32 &damage) - { - //No instance - if (!pInst) - return; - - switch (pInst->GetData(DATA_CTHUN_PHASE)) - { - case 0: - case 1: - { - //Only if it will kill - if (damage < m_creature->GetHealth()) - return; - - //Fake death in phase 0 or 1 (green beam or dark glare phase) - m_creature->InterruptNonMeleeSpells(false); - - //Remove Red coloration from c'thun - m_creature->RemoveAurasDueToSpell(SPELL_RED_COLORATION); - - //Reset to normal emote state and prevent select and attack - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE); - - //Remove Target field - m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0); - - //Death animation/respawning; - pInst->SetData(DATA_CTHUN_PHASE, 2); - - m_creature->SetHealth(0); - damage = 0; - - m_creature->InterruptNonMeleeSpells(true); - m_creature->RemoveAllAuras(); - } - break; - - case 5: - { - //Allow death here - return; - } - - default: - { - //Prevent death in this phase - damage = 0; - return; - } - break; - } - } -}; - -struct TRINITY_DLL_DECL cthunAI : public ScriptedAI -{ - cthunAI(Creature *c) : ScriptedAI(c) - { - SetCombatMovement(false); - - pInst = c->GetInstanceData(); - if (!pInst) - error_log("TSCR: No Instance eye_of_cthunAI"); - } - - ScriptedInstance* pInst; - - //Out of combat whisper timer - uint32 WisperTimer; - - //Global variables - uint32 PhaseTimer; - - //------------------- - - //Phase transition - uint64 HoldPlayer; - - //Body Phase - uint32 EyeTentacleTimer; - uint8 FleshTentaclesKilled; - uint32 GiantClawTentacleTimer; - uint32 GiantEyeTentacleTimer; - uint32 StomachAcidTimer; - uint32 StomachEnterTimer; - uint32 StomachEnterVisTimer; - uint64 StomachEnterTarget; - - //Stomach map, bool = true then in stomach - UNORDERED_MAP Stomach_Map; - - void Reset() - { - //One random wisper every 90 - 300 seconds - WisperTimer = 90000; - - //Phase information - PhaseTimer = 10000; //Emerge in 10 seconds - - //No hold player for transition - HoldPlayer = 0; - - //Body Phase - EyeTentacleTimer = 30000; - FleshTentaclesKilled = 0; - GiantClawTentacleTimer = 15000; //15 seconds into body phase (1 min repeat) - GiantEyeTentacleTimer = 45000; //15 seconds into body phase (1 min repeat) - StomachAcidTimer = 4000; //Every 4 seconds - StomachEnterTimer = 10000; //Every 10 seconds - StomachEnterVisTimer = 0; //Always 3.5 seconds after Stomach Enter Timer - StomachEnterTarget = 0; //Target to be teleported to stomach - - //Clear players in stomach and outside - Stomach_Map.clear(); - - //Reset flags - m_creature->RemoveAurasDueToSpell(SPELL_TRANSFORM); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE); - - if (pInst) - pInst->SetData(DATA_CTHUN_PHASE, 0); - } - - void EnterCombat(Unit *who) - { - DoZoneInCombat(); - } - - void SpawnEyeTentacle(float x, float y) - { - Creature* Spawned; - Spawned = me->SummonCreature(MOB_EYE_TENTACLE,m_creature->GetPositionX()+x,m_creature->GetPositionY()+y,m_creature->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,500); - if (Spawned) - { - Unit* target; - - target = SelectRandomNotStomach(); - - if (target) - Spawned->AI()->AttackStart(target); - } - } - - Unit* SelectRandomNotStomach() - { - if (Stomach_Map.empty()) - return NULL; - - UNORDERED_MAP::iterator i = Stomach_Map.begin(); - - std::list temp; - std::list::iterator j; - - //Get all players in map - while (i != Stomach_Map.end()) - { - //Check for valid player - Unit* pUnit = Unit::GetUnit(*m_creature, i->first); - - //Only units out of stomach - if (pUnit && i->second == false) - { - temp.push_back(pUnit); - } - ++i; - } - - if (temp.empty()) - return NULL; - - j = temp.begin(); - - //Get random but only if we have more than one unit on threat list - if (temp.size() > 1) - advance (i , rand() % (temp.size() - 1)); - - return (*j); - } - - void UpdateAI(const uint32 diff) - { - //Check if we have a target - if (!UpdateVictim()) - { - //No target so we'll use this section to do our random wispers instance wide - //WisperTimer - if (WisperTimer < diff) - { - Map* pMap = m_creature->GetMap(); - if (!pMap->IsDungeon()) return; - - //Play random sound to the zone - Map::PlayerList const &PlayerList = pMap->GetPlayers(); - - if (!PlayerList.isEmpty()) - { - for(Map::PlayerList::const_iterator itr = PlayerList.begin(); itr != PlayerList.end(); ++itr) - { - if (Player* pPlr = itr->getSource()) - pPlr->PlayDirectSound(RANDOM_SOUND_WHISPER,pPlr); - } - } - - //One random wisper every 90 - 300 seconds - WisperTimer = 90000 + (rand()% 210000); - }else WisperTimer -= diff; - - return; - } - - m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0); - - //No instance - if (!pInst) - return; - - switch (pInst->GetData(DATA_CTHUN_PHASE)) - { - //Transition phase - case 2: - { - //PhaseTimer - if (PhaseTimer < diff) - { - //Switch - pInst->SetData(DATA_CTHUN_PHASE, 3); - - //Switch to c'thun model - m_creature->InterruptNonMeleeSpells(false); - DoCast(m_creature, SPELL_TRANSFORM, false); - m_creature->SetHealth(m_creature->GetMaxHealth()); - - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE); - - //Emerging phase - //AttackStart(Unit::GetUnit(*m_creature, HoldpPlayer)); - DoZoneInCombat(); - - //Place all units in threat list on outside of stomach - Stomach_Map.clear(); - - std::list::iterator i = m_creature->getThreatManager().getThreatList().begin(); - for (; i != m_creature->getThreatManager().getThreatList().end(); ++i) - { - //Outside stomach - Stomach_Map[(*i)->getUnitGuid()] = false; - } - - //Spawn 2 flesh tentacles - FleshTentaclesKilled = 0; - - Creature* Spawned; - - //Spawn flesh tentacle - Spawned = me->SummonCreature(MOB_FLESH_TENTACLE, TENTACLE_POS1_X, TENTACLE_POS1_Y, TENTACLE_POS1_Z, TENTACLE_POS1_O, TEMPSUMMON_CORPSE_DESPAWN, 0); - - if (!Spawned) - FleshTentaclesKilled++; - else - CAST_AI(flesh_tentacleAI, (Spawned->AI()))->SpawnedByCthun(m_creature->GetGUID()); - - //Spawn flesh tentacle - Spawned = me->SummonCreature(MOB_FLESH_TENTACLE, TENTACLE_POS2_X, TENTACLE_POS2_Y, TENTACLE_POS2_Z, TENTACLE_POS2_O, TEMPSUMMON_CORPSE_DESPAWN, 0); - - if (!Spawned) - FleshTentaclesKilled++; - else - CAST_AI(flesh_tentacleAI, (Spawned->AI()))->SpawnedByCthun(m_creature->GetGUID()); - - PhaseTimer = 0; - }else PhaseTimer -= diff; - - }break; - - //Body Phase - case 3: - { - //Remove Target field - m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0); - - //Weaken - if (FleshTentaclesKilled > 1) - { - pInst->SetData(DATA_CTHUN_PHASE, 4); - - DoScriptText(EMOTE_WEAKENED, m_creature); - PhaseTimer = 45000; - - DoCast(m_creature, SPELL_RED_COLORATION, true); - - UNORDERED_MAP::iterator i = Stomach_Map.begin(); - - //Kick all players out of stomach - while (i != Stomach_Map.end()) - { - //Check for valid player - Unit* pUnit = Unit::GetUnit(*m_creature, i->first); - - //Only move units in stomach - if (pUnit && i->second == true) - { - //Teleport each player out - DoTeleportPlayer(pUnit, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ()+10, rand()%6); - - //Cast knockback on them - DoCast(pUnit, SPELL_EXIT_STOMACH_KNOCKBACK, true); - - //Remove the acid debuff - pUnit->RemoveAurasDueToSpell(SPELL_DIGESTIVE_ACID); - - i->second = false; - } - ++i; - } - - return; - } - - //Stomach acid - if (StomachAcidTimer < diff) - { - //Apply aura to all players in stomach - UNORDERED_MAP::iterator i = Stomach_Map.begin(); - - while (i != Stomach_Map.end()) - { - //Check for valid player - Unit* pUnit = Unit::GetUnit(*m_creature, i->first); - - //Only apply to units in stomach - if (pUnit && i->second == true) - { - //Cast digestive acid on them - DoCast(pUnit, SPELL_DIGESTIVE_ACID, true); - - //Check if player should be kicked from stomach - if (pUnit->IsWithinDist3d(KICK_X, KICK_Y, KICK_Z, 15.0f)) - { - //Teleport each player out - DoTeleportPlayer(pUnit, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ()+10, rand()%6); - - //Cast knockback on them - DoCast(pUnit, SPELL_EXIT_STOMACH_KNOCKBACK, true); - - //Remove the acid debuff - pUnit->RemoveAurasDueToSpell(SPELL_DIGESTIVE_ACID); - - i->second = false; - } - } - ++i; - } - - StomachAcidTimer = 4000; - }else StomachAcidTimer -= diff; - - //Stomach Enter Timer - if (StomachEnterTimer < diff) - { - Unit* target = NULL; - target = SelectRandomNotStomach(); - - if (target) - { - //Set target in stomach - Stomach_Map[target->GetGUID()] = true; - target->InterruptNonMeleeSpells(false); - target->CastSpell(target, SPELL_MOUTH_TENTACLE, true, NULL, NULL, m_creature->GetGUID()); - StomachEnterTarget = target->GetGUID(); - StomachEnterVisTimer = 3800; - } - - StomachEnterTimer = 13800; - }else StomachEnterTimer -= diff; - - if (StomachEnterVisTimer && StomachEnterTarget) - if (StomachEnterVisTimer <= diff) - { - //Check for valid player - Unit* pUnit = Unit::GetUnit(*m_creature, StomachEnterTarget); - - if (pUnit) - { - DoTeleportPlayer(pUnit, STOMACH_X, STOMACH_Y, STOMACH_Z, STOMACH_O); - } - - StomachEnterTarget = 0; - StomachEnterVisTimer = 0; - }else StomachEnterVisTimer -= diff; - - //GientClawTentacleTimer - if (GiantClawTentacleTimer < diff) - { - Unit* target = NULL; - target = SelectRandomNotStomach(); - if (target) - { - Creature* Spawned = NULL; - - //Spawn claw tentacle on the random target - Spawned = me->SummonCreature(MOB_GIANT_CLAW_TENTACLE,target->GetPositionX(),target->GetPositionY(),target->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,500); - - if (Spawned) - Spawned->AI()->AttackStart(target); - } - - //One giant claw tentacle every minute - GiantClawTentacleTimer = 60000; - }else GiantClawTentacleTimer -= diff; - - //GiantEyeTentacleTimer - if (GiantEyeTentacleTimer < diff) - { - Unit* target = NULL; - target = SelectRandomNotStomach(); - if (target) - { - - Creature* Spawned = NULL; - - //Spawn claw tentacle on the random target - Spawned = me->SummonCreature(MOB_GIANT_EYE_TENTACLE,target->GetPositionX(),target->GetPositionY(),target->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,500); - - if (Spawned) - Spawned->AI()->AttackStart(target); - } - - //One giant eye tentacle every minute - GiantEyeTentacleTimer = 60000; - }else GiantEyeTentacleTimer -= diff; - - //EyeTentacleTimer - if (EyeTentacleTimer < diff) - { - //Spawn the 8 Eye Tentacles in the corret spots - SpawnEyeTentacle(0, 25); //south - SpawnEyeTentacle(12, 12); //south west - SpawnEyeTentacle(25, 0); //west - SpawnEyeTentacle(12, -12); //north west - - SpawnEyeTentacle(0, -25); //north - SpawnEyeTentacle(-12, -12); //north east - SpawnEyeTentacle(-25, 0); // east - SpawnEyeTentacle(-12, 12); // south east - - //These spawn at every 30 seconds - EyeTentacleTimer = 30000; - }else EyeTentacleTimer -= diff; - - }break; - - //Weakened state - case 4: - { - //PhaseTimer - if (PhaseTimer < diff) - { - //Switch - pInst->SetData(DATA_CTHUN_PHASE, 3); - - //Remove red coloration - m_creature->RemoveAurasDueToSpell(SPELL_RED_COLORATION); - - //Spawn 2 flesh tentacles - FleshTentaclesKilled = 0; - - Creature* Spawned; - - //Spawn flesh tentacle - Spawned = me->SummonCreature(MOB_FLESH_TENTACLE, TENTACLE_POS1_X, TENTACLE_POS1_Y, TENTACLE_POS1_Z, TENTACLE_POS1_O, TEMPSUMMON_CORPSE_DESPAWN, 0); - - if (!Spawned) - FleshTentaclesKilled++; - else - CAST_AI(flesh_tentacleAI, (Spawned->AI()))->SpawnedByCthun(m_creature->GetGUID()); - - //Spawn flesh tentacle - Spawned = me->SummonCreature(MOB_FLESH_TENTACLE, TENTACLE_POS2_X, TENTACLE_POS2_Y, TENTACLE_POS2_Z, TENTACLE_POS2_O, TEMPSUMMON_CORPSE_DESPAWN, 0); - - if (!Spawned) - FleshTentaclesKilled++; - else - CAST_AI(flesh_tentacleAI, (Spawned->AI()))->SpawnedByCthun(m_creature->GetGUID()); - - PhaseTimer = 0; - }else PhaseTimer -= diff; - } - } - } - - void JustDied(Unit* pKiller) - { - //Switch - if (pInst) - pInst->SetData(DATA_CTHUN_PHASE, 5); - } - - void DamageTaken(Unit *done_by, uint32 &damage) - { - //No instance - if (!pInst) - return; - - switch (pInst->GetData(DATA_CTHUN_PHASE)) - { - case 3: - { - //Not weakened so reduce damage by 99% - if (damage / 99 > 0) damage/= 99; - else damage = 1; - - //Prevent death in non-weakened state - if (damage >= m_creature->GetHealth()) - damage = 0; - - return; - } - break; - - case 4: - { - //Weakened - takes normal damage - return; - } - - default: - damage = 0; - break; - } - } - - void FleshTentcleKilled() - { - FleshTentaclesKilled++; - } -}; - -struct TRINITY_DLL_DECL eye_tentacleAI : public ScriptedAI -{ - eye_tentacleAI(Creature *c) : ScriptedAI(c) - { - SetCombatMovement(false); - - if (Unit* pPortal = m_creature->SummonCreature(MOB_SMALL_PORTAL, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 0)) - Portal = pPortal->GetGUID(); - } - - uint32 MindflayTimer; - uint32 KillSelfTimer; - uint64 Portal; - - void JustDied(Unit* who) - { - if (Unit* p = Unit::GetUnit(*m_creature, Portal)) - p->DealDamage(p, p->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false); - } - - void Reset() - { - //Mind flay half a second after we spawn - MindflayTimer = 500; - - //This prevents eyes from overlapping - KillSelfTimer = 35000; - } - - void EnterCombat(Unit *who) - { - DoZoneInCombat(); - } - - void UpdateAI(const uint32 diff) - { - //Check if we have a target - if (!UpdateVictim()) - return; - - //KillSelfTimer - if (KillSelfTimer < diff) - { - m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false); - - return; - }else KillSelfTimer -= diff; - - //MindflayTimer - if (MindflayTimer < diff) - { - Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0); - if (target && !target->HasAura(SPELL_DIGESTIVE_ACID)) - DoCast(target,SPELL_MIND_FLAY); - - //Mindflay every 10 seconds - MindflayTimer = 10100; - }else MindflayTimer -= diff; - } -}; - -struct TRINITY_DLL_DECL claw_tentacleAI : public ScriptedAI -{ - claw_tentacleAI(Creature *c) : ScriptedAI(c) - { - SetCombatMovement(false); - - if (Unit* pPortal = m_creature->SummonCreature(MOB_SMALL_PORTAL, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 0)) - Portal = pPortal->GetGUID(); - } - - uint32 GroundRuptureTimer; - uint32 HamstringTimer; - uint32 EvadeTimer; - uint64 Portal; - - void JustDied(Unit* who) - { - if (Unit* p = Unit::GetUnit(*m_creature, Portal)) - p->DealDamage(p, p->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false); - } - - void Reset() - { - //First rupture should happen half a second after we spawn - GroundRuptureTimer = 500; - HamstringTimer = 2000; - EvadeTimer = 5000; - } - - void EnterCombat(Unit *who) - { - DoZoneInCombat(); - } - - void UpdateAI(const uint32 diff) - { - //Check if we have a target - if (!UpdateVictim()) - return; - - //EvadeTimer - if (!m_creature->IsWithinMeleeRange(m_creature->getVictim())) - if (EvadeTimer < diff) - { - if (Unit* p = Unit::GetUnit(*m_creature, Portal)) - p->DealDamage(p, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false); - - //Dissapear and reappear at new position - m_creature->SetVisibility(VISIBILITY_OFF); - - Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0); - if (!target) - { - m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false); - return; - } - - if (!target->HasAura(SPELL_DIGESTIVE_ACID)) - { - m_creature->GetMap()->CreatureRelocation(m_creature, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0); - if (Unit* pPortal = m_creature->SummonCreature(MOB_SMALL_PORTAL, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 0)) - Portal = pPortal->GetGUID(); - - GroundRuptureTimer = 500; - HamstringTimer = 2000; - EvadeTimer = 5000; - AttackStart(target); - } - - m_creature->SetVisibility(VISIBILITY_ON); - - }else EvadeTimer -= diff; - - //GroundRuptureTimer - if (GroundRuptureTimer < diff) - { - DoCast(m_creature->getVictim(),SPELL_GROUND_RUPTURE); - GroundRuptureTimer = 30000; - }else GroundRuptureTimer -= diff; - - //HamstringTimer - if (HamstringTimer < diff) - { - DoCast(m_creature->getVictim(),SPELL_HAMSTRING); - HamstringTimer = 5000; - }else HamstringTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -struct TRINITY_DLL_DECL giant_claw_tentacleAI : public ScriptedAI -{ - giant_claw_tentacleAI(Creature *c) : ScriptedAI(c) - { - SetCombatMovement(false); - - if (Unit* pPortal = m_creature->SummonCreature(MOB_GIANT_PORTAL, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 0)) - Portal = pPortal->GetGUID(); - } - - uint32 GroundRuptureTimer; - uint32 ThrashTimer; - uint32 HamstringTimer; - uint32 EvadeTimer; - uint64 Portal; - - void JustDied(Unit* who) - { - if (Unit* p = Unit::GetUnit(*m_creature, Portal)) - p->DealDamage(p, p->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false); - } - - void Reset() - { - //First rupture should happen half a second after we spawn - GroundRuptureTimer = 500; - HamstringTimer = 2000; - ThrashTimer = 5000; - EvadeTimer = 5000; - } - - void EnterCombat(Unit *who) - { - DoZoneInCombat(); - } - - void UpdateAI(const uint32 diff) - { - //Check if we have a target - if (!UpdateVictim()) - return; - - //EvadeTimer - if (!m_creature->IsWithinMeleeRange(m_creature->getVictim())) - if (EvadeTimer < diff) - { - if (Unit* p = Unit::GetUnit(*m_creature, Portal)) - p->DealDamage(p, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false); - - //Dissapear and reappear at new position - m_creature->SetVisibility(VISIBILITY_OFF); - - Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (!target) - { - m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false); - return; - } - - if (!target->HasAura(SPELL_DIGESTIVE_ACID)) - { - m_creature->GetMap()->CreatureRelocation(m_creature, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0); - if (Unit* pPortal = m_creature->SummonCreature(MOB_GIANT_PORTAL, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 0)) - Portal = pPortal->GetGUID(); - - GroundRuptureTimer = 500; - HamstringTimer = 2000; - ThrashTimer = 5000; - EvadeTimer = 5000; - AttackStart(target); - } - - m_creature->SetVisibility(VISIBILITY_ON); - - }else EvadeTimer -= diff; - - //GroundRuptureTimer - if (GroundRuptureTimer < diff) - { - DoCast(m_creature->getVictim(),SPELL_GROUND_RUPTURE); - GroundRuptureTimer = 30000; - }else GroundRuptureTimer -= diff; - - //ThrashTimer - if (ThrashTimer < diff) - { - DoCast(m_creature->getVictim(),SPELL_THRASH); - ThrashTimer = 10000; - }else ThrashTimer -= diff; - - //HamstringTimer - if (HamstringTimer < diff) - { - DoCast(m_creature->getVictim(),SPELL_HAMSTRING); - HamstringTimer = 10000; - }else HamstringTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -struct TRINITY_DLL_DECL giant_eye_tentacleAI : public ScriptedAI -{ - giant_eye_tentacleAI(Creature *c) : ScriptedAI(c) - { - SetCombatMovement(false); - - if (Unit* pPortal = m_creature->SummonCreature(MOB_GIANT_PORTAL, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 0)) - Portal = pPortal->GetGUID(); - } - - uint32 BeamTimer; - uint64 Portal; - - void JustDied(Unit* who) - { - if (Unit* p = Unit::GetUnit(*m_creature, Portal)) - p->DealDamage(p, p->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false); - } - - void Reset() - { - //Green Beam half a second after we spawn - BeamTimer = 500; - } - - void EnterCombat(Unit *who) - { - DoZoneInCombat(); - } - - void UpdateAI(const uint32 diff) - { - //Check if we have a target - if (!UpdateVictim()) - return; - - //BeamTimer - if (BeamTimer < diff) - { - Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0); - if (target && !target->HasAura(SPELL_DIGESTIVE_ACID)) - DoCast(target,SPELL_GREEN_BEAM); - - //Beam every 2 seconds - BeamTimer = 2100; - }else BeamTimer -= diff; - } -}; - -//Flesh tentacle functions -void flesh_tentacleAI::UpdateAI(const uint32 diff) -{ - //Check if we have a target - if (!UpdateVictim()) - return; - - if (Parent) - if (CheckTimer < diff) - { - Unit* pUnit = Unit::GetUnit(*m_creature, Parent); - - if (!pUnit || !pUnit->isAlive() || !pUnit->isInCombat()) - { - Parent = 0; - m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false); - return; - } - - CheckTimer = 1000; - }else CheckTimer -= diff; - - DoMeleeAttackIfReady(); -} - -void flesh_tentacleAI::JustDied(Unit* killer) -{ - if (!Parent) - { - error_log("TSCR: flesh_tentacle: No Parent variable"); - return; - } - - Creature* Cthun = Unit::GetCreature(*m_creature, Parent); - - if (Cthun) - CAST_AI(cthunAI, (Cthun->AI()))->FleshTentcleKilled(); - else error_log("TSCR: flesh_tentacle: No Cthun"); -} - -//GetAIs -CreatureAI* GetAI_eye_of_cthun(Creature* pCreature) -{ - return new eye_of_cthunAI (pCreature); -} - -CreatureAI* GetAI_cthun(Creature* pCreature) -{ - return new cthunAI (pCreature); -} - -CreatureAI* GetAI_eye_tentacle(Creature* pCreature) -{ - return new eye_tentacleAI (pCreature); -} - -CreatureAI* GetAI_claw_tentacle(Creature* pCreature) -{ - return new claw_tentacleAI (pCreature); -} - -CreatureAI* GetAI_giant_claw_tentacle(Creature* pCreature) -{ - return new giant_claw_tentacleAI (pCreature); -} - -CreatureAI* GetAI_giant_eye_tentacle(Creature* pCreature) -{ - return new giant_eye_tentacleAI (pCreature); -} - -CreatureAI* GetAI_flesh_tentacle(Creature* pCreature) -{ - return new flesh_tentacleAI (pCreature); -} - -void AddSC_boss_cthun() -{ - Script *newscript; - - //Eye - newscript = new Script; - newscript->Name="boss_eye_of_cthun"; - newscript->GetAI = &GetAI_eye_of_cthun; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="boss_cthun"; - newscript->GetAI = &GetAI_cthun; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_eye_tentacle"; - newscript->GetAI = &GetAI_eye_tentacle; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_claw_tentacle"; - newscript->GetAI = &GetAI_claw_tentacle; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_giant_claw_tentacle"; - newscript->GetAI = &GetAI_giant_claw_tentacle; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_giant_eye_tentacle"; - newscript->GetAI = &GetAI_giant_eye_tentacle; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_giant_flesh_tentacle"; - newscript->GetAI = &GetAI_flesh_tentacle; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_fankriss.cpp b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_fankriss.cpp deleted file mode 100644 index 6e5992556e3..00000000000 --- a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_fankriss.cpp +++ /dev/null @@ -1,206 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Fankriss -SD%Complete: 100 -SDComment: sound not implemented -SDCategory: Temple of Ahn'Qiraj -EndScriptData */ - -#include "precompiled.h" - -#define SOUND_SENTENCE_YOU 8588 -#define SOUND_SERVE_TO 8589 -#define SOUND_LAWS 8590 -#define SOUND_TRESPASS 8591 -#define SOUND_WILL_BE 8592 - -#define SPELL_MORTAL_WOUND 28467 -#define SPELL_ROOT 28858 - -// Enrage for his spawns -#define SPELL_ENRAGE 28798 - -struct TRINITY_DLL_DECL boss_fankrissAI : public ScriptedAI -{ - boss_fankrissAI(Creature *c) : ScriptedAI(c) {} - - uint32 MortalWound_Timer; - uint32 SpawnHatchlings_Timer; - uint32 SpawnSpawns_Timer; - int Rand; - int RandX; - int RandY; - - Creature* Hatchling; - Creature* Spawn; - - void Reset() - { - MortalWound_Timer = 10000 + rand()%5000; - SpawnHatchlings_Timer = 6000 + rand()%6000; - SpawnSpawns_Timer = 15000 + rand()%30000; - } - - void SummonSpawn(Unit* victim) - { - if (!victim) - return; - - Rand = 10 + (rand()%10); - switch (rand()%2) - { - case 0: RandX = 0 - Rand; break; - case 1: RandX = 0 + Rand; break; - } - Rand = 0; - Rand = 10 + (rand()%10); - switch (rand()%2) - { - case 0: RandY = 0 - Rand; break; - case 1: RandY = 0 + Rand; break; - } - Rand = 0; - Spawn = DoSpawnCreature(15630, RandX, RandY, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - if (Spawn) - (Spawn->AI())->AttackStart(victim); - } - - void EnterCombat(Unit *who) - { - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //MortalWound_Timer - if (MortalWound_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_MORTAL_WOUND); - MortalWound_Timer = 10000 + rand()%10000; - }else MortalWound_Timer -= diff; - - //Summon 1-3 Spawns of Fankriss at random time. - if (SpawnSpawns_Timer < diff) - { - switch(rand()%3) - { - case 0: - SummonSpawn(SelectUnit(SELECT_TARGET_RANDOM,0)); - break; - case 1: - SummonSpawn(SelectUnit(SELECT_TARGET_RANDOM,0)); - SummonSpawn(SelectUnit(SELECT_TARGET_RANDOM,0)); - break; - case 2: - SummonSpawn(SelectUnit(SELECT_TARGET_RANDOM,0)); - SummonSpawn(SelectUnit(SELECT_TARGET_RANDOM,0)); - SummonSpawn(SelectUnit(SELECT_TARGET_RANDOM,0)); - break; - } - SpawnSpawns_Timer = 30000 + rand()%30000; - }else SpawnSpawns_Timer -= diff; - - // Teleporting Random Target to one of the three tunnels and spawn 4 hatchlings near the gamer. - //We will only telport if fankriss has more than 3% of hp so teleported gamers can always loot. - if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() > 3) - { - if (SpawnHatchlings_Timer< diff) - { - Unit* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM,0); - if (target && target->GetTypeId() == TYPEID_PLAYER) - { - DoCast(target, SPELL_ROOT); - - if (DoGetThreat(target)) - DoModifyThreatPercent(target, -100); - - switch(rand()%3) - { - case 0: - DoTeleportPlayer(target, -8106.0142,1289.2900,-74.419533,5.112); - Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()-3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Hatchling) - (Hatchling->AI())->AttackStart(target); - Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()+3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Hatchling) - (Hatchling->AI())->AttackStart(target); - Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()-5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Hatchling) - (Hatchling->AI())->AttackStart(target); - Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()+5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Hatchling) - (Hatchling->AI())->AttackStart(target); - break; - case 1: - DoTeleportPlayer(target, -7990.135354,1155.1907,-78.849319,2.608); - Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()-3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Hatchling) - (Hatchling->AI())->AttackStart(target); - Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()+3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Hatchling) - (Hatchling->AI())->AttackStart(target); - Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()-5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Hatchling) - (Hatchling->AI())->AttackStart(target); - Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()+5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Hatchling) - (Hatchling->AI())->AttackStart(target); - break; - case 2: - DoTeleportPlayer(target,-8159.7753,1127.9064,-76.868660,0.675); - Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()-3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Hatchling) - (Hatchling->AI())->AttackStart(target); - Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()+3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Hatchling) - (Hatchling->AI())->AttackStart(target); - Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()-5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Hatchling) - (Hatchling->AI())->AttackStart(target); - Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()+5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Hatchling) - (Hatchling->AI())->AttackStart(target); - break; - } - } - SpawnHatchlings_Timer = 45000 + rand()%15000; - }else SpawnHatchlings_Timer -= diff; - } - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_fankriss(Creature* pCreature) -{ - return new boss_fankrissAI (pCreature); -} - -void AddSC_boss_fankriss() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_fankriss"; - newscript->GetAI = &GetAI_boss_fankriss; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_huhuran.cpp b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_huhuran.cpp deleted file mode 100644 index 705e2275d33..00000000000 --- a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_huhuran.cpp +++ /dev/null @@ -1,148 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Huhuran -SD%Complete: 100 -SDComment: -SDCategory: Temple of Ahn'Qiraj -EndScriptData */ - -#include "precompiled.h" - -#define EMOTE_GENERIC_FRENZY_KILL -1000001 -#define EMOTE_GENERIC_BERSERK -1000004 - -#define SPELL_FRENZY 26051 -#define SPELL_BERSERK 26068 -#define SPELL_POISONBOLT 26052 -#define SPELL_NOXIOUSPOISON 26053 -#define SPELL_WYVERNSTING 26180 -#define SPELL_ACIDSPIT 26050 - -struct TRINITY_DLL_DECL boss_huhuranAI : public ScriptedAI -{ - boss_huhuranAI(Creature *c) : ScriptedAI(c) {} - - uint32 Frenzy_Timer; - uint32 Wyvern_Timer; - uint32 Spit_Timer; - uint32 PoisonBolt_Timer; - uint32 NoxiousPoison_Timer; - uint32 FrenzyBack_Timer; - - bool Frenzy; - bool Berserk; - - void Reset() - { - Frenzy_Timer = 25000 + rand()%10000; - Wyvern_Timer = 18000 + rand()%10000; - Spit_Timer = 8000; - PoisonBolt_Timer = 4000; - NoxiousPoison_Timer = 10000 + rand()%10000; - FrenzyBack_Timer = 15000; - - Frenzy = false; - Berserk = false; - } - - void EnterCombat(Unit *who) - { - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //Frenzy_Timer - if (!Frenzy && Frenzy_Timer < diff) - { - DoCast(m_creature, SPELL_FRENZY); - DoScriptText(EMOTE_GENERIC_FRENZY_KILL, m_creature); - Frenzy = true; - PoisonBolt_Timer = 3000; - Frenzy_Timer = 25000 + rand()%10000; - }else Frenzy_Timer -= diff; - - // Wyvern Timer - if (Wyvern_Timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_WYVERNSTING); - Wyvern_Timer = 15000 + rand()%17000; - }else Wyvern_Timer -= diff; - - //Spit Timer - if (Spit_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_ACIDSPIT); - Spit_Timer = 5000 + rand()%5000; - }else Spit_Timer -= diff; - - //NoxiousPoison_Timer - if (NoxiousPoison_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_NOXIOUSPOISON); - NoxiousPoison_Timer = 12000 + rand()%12000; - }else NoxiousPoison_Timer -= diff; - - //PoisonBolt only if frenzy or berserk - if (Frenzy || Berserk) - { - if (PoisonBolt_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_POISONBOLT); - PoisonBolt_Timer = 3000; - }else PoisonBolt_Timer -= diff; - } - - //FrenzyBack_Timer - if (Frenzy && FrenzyBack_Timer < diff) - { - m_creature->InterruptNonMeleeSpells(false); - Frenzy = false; - FrenzyBack_Timer = 15000; - }else FrenzyBack_Timer -= diff; - - if (!Berserk && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 31) - { - m_creature->InterruptNonMeleeSpells(false); - DoScriptText(EMOTE_GENERIC_BERSERK, m_creature); - DoCast(m_creature, SPELL_BERSERK); - Berserk = true; - } - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_huhuran(Creature* pCreature) -{ - return new boss_huhuranAI (pCreature); -} - -void AddSC_boss_huhuran() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_huhuran"; - newscript->GetAI = &GetAI_boss_huhuran; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_ouro.cpp b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_ouro.cpp deleted file mode 100644 index d7f6a186316..00000000000 --- a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_ouro.cpp +++ /dev/null @@ -1,140 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Ouro -SD%Complete: 85 -SDComment: No model for submerging. Currently just invisible. -SDCategory: Temple of Ahn'Qiraj -EndScriptData */ - -#include "precompiled.h" -#include "def_temple_of_ahnqiraj.h" - -#define SPELL_SWEEP 26103 -#define SPELL_SANDBLAST 26102 -#define SPELL_GROUND_RUPTURE 26100 -#define SPELL_BIRTH 26262 //The Birth Animation - -#define SPELL_DIRTMOUND_PASSIVE 26092 - -struct TRINITY_DLL_DECL boss_ouroAI : public ScriptedAI -{ - boss_ouroAI(Creature *c) : ScriptedAI(c) {} - - uint32 Sweep_Timer; - uint32 SandBlast_Timer; - uint32 Submerge_Timer; - uint32 Back_Timer; - uint32 ChangeTarget_Timer; - uint32 Spawn_Timer; - - bool Enrage; - bool Submerged; - - void Reset() - { - Sweep_Timer = 5000 + rand()%5000; - SandBlast_Timer = 20000 + rand()%15000; - Submerge_Timer = 90000 + rand()%60000; - Back_Timer = 30000 + rand()%15000; - ChangeTarget_Timer = 5000 + rand()%3000; - Spawn_Timer = 10000 + rand()%10000; - - Enrage = false; - Submerged = false; - } - - void EnterCombat(Unit *who) - { - DoCast(m_creature->getVictim(), SPELL_BIRTH); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //Sweep_Timer - if (!Submerged && Sweep_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_SWEEP); - Sweep_Timer = 15000 + rand()%15000; - }else Sweep_Timer -= diff; - - //SandBlast_Timer - if (!Submerged && SandBlast_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_SANDBLAST); - SandBlast_Timer = 20000 + rand()%15000; - }else SandBlast_Timer -= diff; - - //Submerge_Timer - if (!Submerged && Submerge_Timer < diff) - { - //Cast - m_creature->HandleEmoteCommand(EMOTE_ONESHOT_SUBMERGE); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->setFaction(35); - DoCast(m_creature, SPELL_DIRTMOUND_PASSIVE); - - Submerged = true; - Back_Timer = 30000 + rand()%15000; - }else Submerge_Timer -= diff; - - //ChangeTarget_Timer - if (Submerged && ChangeTarget_Timer < diff) - { - Unit* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM,0); - - if (target) - DoTeleportTo(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ()); - - ChangeTarget_Timer = 10000 + rand()%10000; - }else ChangeTarget_Timer -= diff; - - //Back_Timer - if (Submerged && Back_Timer < diff) - { - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->setFaction(14); - - DoCast(m_creature->getVictim(), SPELL_GROUND_RUPTURE); - - Submerged = false; - Submerge_Timer = 60000 + rand()%60000; - }else Back_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_ouro(Creature* pCreature) -{ - return new boss_ouroAI (pCreature); -} - -void AddSC_boss_ouro() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_ouro"; - newscript->GetAI = &GetAI_boss_ouro; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_sartura.cpp b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_sartura.cpp deleted file mode 100644 index dd5aa9bae87..00000000000 --- a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_sartura.cpp +++ /dev/null @@ -1,298 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Sartura -SD%Complete: 95 -SDComment: -SDCategory: Temple of Ahn'Qiraj -EndScriptData */ - -#include "precompiled.h" - -#define SAY_AGGRO -1531008 -#define SAY_SLAY -1531009 -#define SAY_DEATH -1531010 - -#define SPELL_WHIRLWIND 26083 -#define SPELL_ENRAGE 28747 //Not sure if right ID. -#define SPELL_ENRAGEHARD 28798 - -//Guard Spell -#define SPELL_WHIRLWINDADD 26038 -#define SPELL_KNOCKBACK 26027 - - -struct TRINITY_DLL_DECL boss_sarturaAI : public ScriptedAI -{ - boss_sarturaAI(Creature *c) : ScriptedAI(c) {} - - uint32 WhirlWind_Timer; - uint32 WhirlWindRandom_Timer; - uint32 WhirlWindEnd_Timer; - uint32 AggroReset_Timer; - uint32 AggroResetEnd_Timer; - uint32 EnrageHard_Timer; - - bool Enraged; - bool EnragedHard; - bool WhirlWind; - bool AggroReset; - - void Reset() - { - WhirlWind_Timer = 30000; - WhirlWindRandom_Timer = 3000 + rand()%4000; - WhirlWindEnd_Timer = 15000; - AggroReset_Timer = 45000 + rand()%10000; - AggroResetEnd_Timer = 5000; - EnrageHard_Timer = 10*60000; - - WhirlWind = false; - AggroReset = false; - Enraged = false; - EnragedHard = false; - - } - - void EnterCombat(Unit *who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - - void JustDied(Unit* Killer) - { - DoScriptText(SAY_DEATH, m_creature); - } - - void KilledUnit(Unit* victim) - { - DoScriptText(SAY_SLAY, m_creature); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - if (WhirlWind) - { - if (WhirlWindRandom_Timer < diff) - { - //Attack random Gamers - Unit* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM,1); - if (target) - m_creature->AddThreat(target, 1.0f); - m_creature->TauntApply(target); - AttackStart(target); - - WhirlWindRandom_Timer = 3000 + rand()%4000; - }else WhirlWindRandom_Timer -= diff; - - if (WhirlWindEnd_Timer < diff) - { - WhirlWind = false; - WhirlWind_Timer = 25000 + rand()%15000; - }else WhirlWindEnd_Timer -= diff; - } - - if (!WhirlWind) - { - if (WhirlWind_Timer < diff) - { - DoCast(m_creature, SPELL_WHIRLWIND); - WhirlWind = true; - WhirlWindEnd_Timer = 15000; - }else WhirlWind_Timer -= diff; - - if (AggroReset_Timer < diff) - { - //Attack random Gamers - Unit* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM,1); - if (target) - m_creature->AddThreat(target, 1.0f); - m_creature->TauntApply(target); - AttackStart(target); - - AggroReset = true; - AggroReset_Timer = 2000 + rand()%3000; - }else AggroReset_Timer -= diff; - - if (AggroReset) - { - if (AggroResetEnd_Timer GetHealth()*100 / m_creature->GetMaxHealth() <= 20 && !m_creature->IsNonMeleeSpellCasted(false)) - { - DoCast(m_creature, SPELL_ENRAGE); - Enraged = true; - } - } - - //After 10 minutes hard enrage - if (!EnragedHard) - { - if (EnrageHard_Timer < diff) - { - DoCast(m_creature, SPELL_ENRAGEHARD); - EnragedHard = true; - } else EnrageHard_Timer -= diff; - } - - DoMeleeAttackIfReady(); - } - } -}; - -struct TRINITY_DLL_DECL mob_sartura_royal_guardAI : public ScriptedAI -{ - mob_sartura_royal_guardAI(Creature *c) : ScriptedAI(c) {} - - uint32 WhirlWind_Timer; - uint32 WhirlWindRandom_Timer; - uint32 WhirlWindEnd_Timer; - uint32 AggroReset_Timer; - uint32 AggroResetEnd_Timer; - uint32 KnockBack_Timer; - - bool WhirlWind; - bool AggroReset; - - void Reset() - { - WhirlWind_Timer = 30000; - WhirlWindRandom_Timer = 3000 + rand()%4000; - WhirlWindEnd_Timer = 15000; - AggroReset_Timer = 45000 + rand()%10000; - AggroResetEnd_Timer = 5000; - KnockBack_Timer = 10000; - - WhirlWind = false; - AggroReset = false; - } - - void EnterCombat(Unit *who) - { - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - if (!WhirlWind && WhirlWind_Timer < diff) - { - DoCast(m_creature, SPELL_WHIRLWINDADD); - WhirlWind = true; - WhirlWind_Timer = 25000 + rand()%15000; - WhirlWindEnd_Timer = 15000; - }else WhirlWind_Timer -= diff; - - if (WhirlWind) - { - if (WhirlWindRandom_Timer < diff) - { - //Attack random Gamers - Unit* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM,1); - if (target) - m_creature->AddThreat(target, 1.0f); - m_creature->TauntApply(target); - AttackStart(target); - - WhirlWindRandom_Timer = 3000 + rand()%4000; - }else WhirlWindRandom_Timer -= diff; - - if (WhirlWindEnd_Timer < diff) - { - WhirlWind = false; - }else WhirlWindEnd_Timer -= diff; - } - - if (!WhirlWind) - { - if (AggroReset_Timer < diff) - { - //Attack random Gamers - Unit* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM,1); - if (target) - m_creature->AddThreat(target, 1.0f); - m_creature->TauntApply(target); - AttackStart(target); - - AggroReset = true; - AggroReset_Timer = 2000 + rand()%3000; - }else AggroReset_Timer -= diff; - - if (KnockBack_Timer < diff) - { - DoCast(m_creature, SPELL_WHIRLWINDADD); - KnockBack_Timer = 10000 + rand()%10000; - }else KnockBack_Timer -= diff; - } - - if (AggroReset) - { - if (AggroResetEnd_Timer Name="boss_sartura"; - newscript->GetAI = &GetAI_boss_sartura; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_sartura_royal_guard"; - newscript->GetAI = &GetAI_mob_sartura_royal_guard; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_skeram.cpp b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_skeram.cpp deleted file mode 100644 index 780a0c28f22..00000000000 --- a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_skeram.cpp +++ /dev/null @@ -1,316 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Skeram -SD%Complete: 75 -SDComment: Mind Control buggy. -SDCategory: Temple of Ahn'Qiraj -EndScriptData */ - -#include "precompiled.h" -#include "def_temple_of_ahnqiraj.h" -#include "Group.h" - -#define SAY_AGGRO1 -1531000 -#define SAY_AGGRO2 -1531001 -#define SAY_AGGRO3 -1531002 -#define SAY_SLAY1 -1531003 -#define SAY_SLAY2 -1531004 -#define SAY_SLAY3 -1531005 -#define SAY_SPLIT -1531006 -#define SAY_DEATH -1531007 - -#define SPELL_ARCANE_EXPLOSION 25679 -#define SPELL_EARTH_SHOCK 26194 -#define SPELL_TRUE_FULFILLMENT4 26526 -#define SPELL_BLINK 28391 - -class ov_mycoordinates -{ - public: - float x,y,z,r; - ov_mycoordinates(float cx, float cy, float cz, float cr) - { - x = cx; y = cy; z = cz; r = cr; - } -}; - -struct TRINITY_DLL_DECL boss_skeramAI : public ScriptedAI -{ - boss_skeramAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - IsImage = false; - } - - ScriptedInstance *pInstance; - - uint32 ArcaneExplosion_Timer; - uint32 EarthShock_Timer; - uint32 FullFillment_Timer; - uint32 Blink_Timer; - uint32 Invisible_Timer; - - Creature *Image1, *Image2; - - bool Images75; - bool Images50; - bool Images25; - bool IsImage; - bool Invisible; - - void Reset() - { - ArcaneExplosion_Timer = 6000 + rand()%6000; - EarthShock_Timer = 2000; - FullFillment_Timer = 15000; - Blink_Timer = 8000 + rand()%12000; - Invisible_Timer = 500; - - Images75 = false; - Images50 = false; - Images25 = false; - Invisible = false; - - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetVisibility(VISIBILITY_ON); - - if (IsImage) - m_creature->setDeathState(JUST_DIED); - } - - void KilledUnit(Unit* victim) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; - case 2: DoScriptText(SAY_SLAY3, m_creature); break; - } - } - - void JustDied(Unit* Killer) - { - if (!IsImage) - DoScriptText(SAY_DEATH, m_creature); - } - - void EnterCombat(Unit *who) - { - if (IsImage || Images75) - return; - switch(rand()%3) - { - case 0: DoScriptText(SAY_AGGRO1, m_creature); break; - case 1: DoScriptText(SAY_AGGRO2, m_creature); break; - case 2: DoScriptText(SAY_AGGRO3, m_creature); break; - } - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //ArcaneExplosion_Timer - if (ArcaneExplosion_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_ARCANE_EXPLOSION); - ArcaneExplosion_Timer = 8000 + rand()%10000; - }else ArcaneExplosion_Timer -= diff; - - //If we are within range melee the target - if (m_creature->IsWithinMeleeRange(m_creature->getVictim())) - { - //Make sure our attack is ready and we arn't currently casting - if (m_creature->isAttackReady() && !m_creature->IsNonMeleeSpellCasted(false)) - { - m_creature->AttackerStateUpdate(m_creature->getVictim()); - m_creature->resetAttackTimer(); - } - }else - { - //EarthShock_Timer - if (EarthShock_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_EARTH_SHOCK); - EarthShock_Timer = 1000; - }else EarthShock_Timer -= diff; - } - - //Blink_Timer - if (Blink_Timer < diff) - { - //DoCast(m_creature, SPELL_BLINK); - switch(rand()%3) - { - case 0: - m_creature->GetMap()->CreatureRelocation(m_creature, -8340.782227,2083.814453,125.648788,0.0f); - DoResetThreat(); - break; - case 1: - m_creature->GetMap()->CreatureRelocation(m_creature, -8341.546875,2118.504639,133.058151,0.0f); - DoResetThreat(); - break; - case 2: - m_creature->GetMap()->CreatureRelocation(m_creature, -8318.822266,2058.231201,133.058151,0.0f); - DoResetThreat(); - break; - } - DoStopAttack(); - - Blink_Timer= 20000 + rand()%20000; - }else Blink_Timer -= diff; - - int procent = (int) (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() +0.5); - - //Summoning 2 Images and teleporting to a random position on 75% health - if ((!Images75 && !IsImage) && (procent <= 75 && procent > 70)) - DoSplit(75); - - //Summoning 2 Images and teleporting to a random position on 50% health - if ((!Images50 && !IsImage) && - (procent <= 50 && procent > 45)) - DoSplit(50); - - //Summoning 2 Images and teleporting to a random position on 25% health - if ((!Images25 && !IsImage) && (procent <= 25 && procent > 20)) - DoSplit(25); - - //Invisible_Timer - if (Invisible) - { - if (Invisible_Timer < diff) - { - //Making Skeram visible after telporting - m_creature->SetVisibility(VISIBILITY_ON); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - - Invisible_Timer = 2500; - Invisible = false; - }else Invisible_Timer -= diff; - } - - DoMeleeAttackIfReady(); - } - - void DoSplit(int atPercent /* 75 50 25 */) - { - DoScriptText(SAY_SPLIT, m_creature); - - ov_mycoordinates *place1 = new ov_mycoordinates(-8340.782227,2083.814453,125.648788,0); - ov_mycoordinates *place2 = new ov_mycoordinates(-8341.546875,2118.504639,133.058151,0); - ov_mycoordinates *place3 = new ov_mycoordinates(-8318.822266,2058.231201,133.058151,0); - - ov_mycoordinates *bossc=place1, *i1=place2, *i2=place3; - - switch(rand()%3) - { - case 0: - bossc=place1; - i1=place2; - i2=place3; - break; - case 1: - bossc=place2; - i1=place1; - i2=place3; - break; - case 2: - bossc=place3; - i1=place1; - i2=place2; - break; - } - - for (int tryi = 0; tryi < 41; tryi ++) - { - Unit *targetpl = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (targetpl->GetTypeId() == TYPEID_PLAYER) - { - Group *grp = CAST_PLR(targetpl)->GetGroup(); - if (grp) - { - for (int ici = 0; ici < TARGETICONCOUNT; ++ici) - { - //if (grp ->m_targetIcons[ici] == m_creature->GetGUID()) -- private member:( - grp->SetTargetIcon(ici, 0); - } - } - break; - } - } - - m_creature->RemoveAllAuras(); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetVisibility(VISIBILITY_OFF); - m_creature->GetMap()->CreatureRelocation(m_creature, bossc->x, bossc->y, bossc->z, bossc->r); - Invisible = true; - delete place1; - delete place2; - delete place3; - DoResetThreat(); - DoStopAttack(); - - switch (atPercent) - { - case 75: Images75 = true; break; - case 50: Images50 = true; break; - case 25: Images25 = true; break; - } - - Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0); - - Image1 = m_creature->SummonCreature(15263, i1->x, i1->y, i1->z, i1->r, TEMPSUMMON_CORPSE_DESPAWN, 30000); - if (Image1) - { - Image1->SetMaxHealth(m_creature->GetMaxHealth() / 5); - Image1->SetHealth(m_creature->GetHealth() / 5); - if (target) - Image1->AI()->AttackStart(target); - CAST_AI(boss_skeramAI, Image1->AI())->IsImage = true; - } - - Image2 = m_creature->SummonCreature(15263,i2->x, i2->y, i2->z, i2->r, TEMPSUMMON_CORPSE_DESPAWN, 30000); - if (Image2) - { - Image2->SetMaxHealth(m_creature->GetMaxHealth() / 5); - Image2->SetHealth(m_creature->GetHealth() / 5); - if (target) - Image2->AI()->AttackStart(target); - CAST_AI(boss_skeramAI, Image2->AI())->IsImage = true; - } - Invisible = true; - } - -}; - -CreatureAI* GetAI_boss_skeram(Creature* pCreature) -{ - return new boss_skeramAI (pCreature); -} - -void AddSC_boss_skeram() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_skeram"; - newscript->GetAI = &GetAI_boss_skeram; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_twinemperors.cpp b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_twinemperors.cpp deleted file mode 100644 index fdc1b6ae408..00000000000 --- a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_twinemperors.cpp +++ /dev/null @@ -1,618 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Twinemperors -SD%Complete: 95 -SDComment: -SDCategory: Temple of Ahn'Qiraj -EndScriptData */ - -#include "precompiled.h" -#include "def_temple_of_ahnqiraj.h" -#include "WorldPacket.h" - -#include "Item.h" -#include "Spell.h" - -#define SPELL_HEAL_BROTHER 7393 -#define SPELL_TWIN_TELEPORT 800 // CTRA watches for this spell to start its teleport timer -#define SPELL_TWIN_TELEPORT_VISUAL 26638 // visual - -#define SPELL_EXPLODEBUG 804 -#define SPELL_MUTATE_BUG 802 - -#define SOUND_VN_DEATH 8660 //8660 - Death - Feel -#define SOUND_VN_AGGRO 8661 //8661 - Aggro - Let none -#define SOUND_VN_KILL 8662 //8661 - Kill - your fate - -#define SOUND_VL_AGGRO 8657 //8657 - Aggro - To Late -#define SOUND_VL_KILL 8658 //8658 - Kill - You will not -#define SOUND_VL_DEATH 8659 //8659 - Death - -#define PULL_RANGE 50 -#define ABUSE_BUG_RANGE 20 -#define SPELL_BERSERK 26662 -#define TELEPORTTIME 30000 - -#define SPELL_UPPERCUT 26007 -#define SPELL_UNBALANCING_STRIKE 26613 - -#define VEKLOR_DIST 20 // VL will not come to melee when attacking - -#define SPELL_SHADOWBOLT 26006 -#define SPELL_BLIZZARD 26607 -#define SPELL_ARCANEBURST 568 - -struct TRINITY_DLL_DECL boss_twinemperorsAI : public ScriptedAI -{ - ScriptedInstance *pInstance; - uint32 Heal_Timer; - uint32 Teleport_Timer; - bool AfterTeleport; - uint32 AfterTeleportTimer; - bool DontYellWhenDead; - uint32 Abuse_Bug_Timer, BugsTimer; - bool tspellcasted; - uint32 EnrageTimer; - - virtual bool IAmVeklor() = 0; - virtual void Reset() = 0; - virtual void CastSpellOnBug(Creature *target) = 0; - - boss_twinemperorsAI(Creature *c): ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - void TwinReset() - { - Heal_Timer = 0; // first heal immediately when they get close together - Teleport_Timer = TELEPORTTIME; - AfterTeleport = false; - tspellcasted = false; - AfterTeleportTimer = 0; - Abuse_Bug_Timer = 10000 + rand()%7000; - BugsTimer = 2000; - m_creature->clearUnitState(UNIT_STAT_STUNNED); - DontYellWhenDead = false; - EnrageTimer = 15*60000; - } - - Creature *GetOtherBoss() - { - if (pInstance) - { - return Unit::GetCreature(*m_creature, pInstance->GetData64(IAmVeklor() ? DATA_VEKNILASH : DATA_VEKLOR)); - } - else - { - return NULL; - } - } - - void DamageTaken(Unit *done_by, uint32 &damage) - { - Unit *pOtherBoss = GetOtherBoss(); - if (pOtherBoss) - { - float dPercent = ((float)damage) / ((float)m_creature->GetMaxHealth()); - int odmg = (int)(dPercent * ((float)pOtherBoss->GetMaxHealth())); - int ohealth = pOtherBoss->GetHealth()-odmg; - pOtherBoss->SetHealth(ohealth > 0 ? ohealth : 0); - if (ohealth <= 0) - { - pOtherBoss->setDeathState(JUST_DIED); - pOtherBoss->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); - } - } - } - - void JustDied(Unit* Killer) - { - Creature *pOtherBoss = GetOtherBoss(); - if (pOtherBoss) - { - pOtherBoss->SetHealth(0); - pOtherBoss->setDeathState(JUST_DIED); - pOtherBoss->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); - CAST_AI(boss_twinemperorsAI, pOtherBoss->AI())->DontYellWhenDead = true; - } - if (!DontYellWhenDead) // I hope AI is not threaded - DoPlaySoundToSet(m_creature, IAmVeklor() ? SOUND_VL_DEATH : SOUND_VN_DEATH); - } - - void KilledUnit(Unit* victim) - { - DoPlaySoundToSet(m_creature, IAmVeklor() ? SOUND_VL_KILL : SOUND_VN_KILL); - } - - void EnterCombat(Unit *who) - { - DoZoneInCombat(); - Creature *pOtherBoss = GetOtherBoss(); - if (pOtherBoss) - { - // TODO: we should activate the other boss location so he can start attackning even if nobody - // is near I dont know how to do that - ScriptedAI *otherAI = CAST_AI(ScriptedAI, pOtherBoss->AI()); - if (!pOtherBoss->isInCombat()) - { - DoPlaySoundToSet(m_creature, IAmVeklor() ? SOUND_VL_AGGRO : SOUND_VN_AGGRO); - otherAI->AttackStart(who); - otherAI->DoZoneInCombat(); - } - } - } - - void SpellHit(Unit *caster, const SpellEntry *entry) - { - if (caster == m_creature) - return; - - Creature *pOtherBoss = GetOtherBoss(); - if (entry->Id != SPELL_HEAL_BROTHER || !pOtherBoss) - return; - - // add health so we keep same percentage for both brothers - uint32 mytotal = m_creature->GetMaxHealth(), histotal = pOtherBoss->GetMaxHealth(); - float mult = ((float)mytotal) / ((float)histotal); - if (mult < 1) - mult = 1.0f/mult; - #define HEAL_BROTHER_AMOUNT 30000.0f - uint32 largerAmount = (uint32)((HEAL_BROTHER_AMOUNT * mult) - HEAL_BROTHER_AMOUNT); - - uint32 myh = m_creature->GetHealth(); - uint32 hish = pOtherBoss->GetHealth(); - if (mytotal > histotal) - { - uint32 h = m_creature->GetHealth()+largerAmount; - m_creature->SetHealth(std::min(mytotal, h)); - } - else - { - uint32 h = pOtherBoss->GetHealth()+largerAmount; - pOtherBoss->SetHealth(std::min(histotal, h)); - } - } - - void TryHealBrother(uint32 diff) - { - if (IAmVeklor()) // this spell heals caster and the other brother so let VN cast it - return; - - if (Heal_Timer < diff) - { - Unit *pOtherBoss = GetOtherBoss(); - if (pOtherBoss && pOtherBoss->IsWithinDist(m_creature,60)) - { - DoCast(pOtherBoss, SPELL_HEAL_BROTHER); - Heal_Timer = 1000; - } - } else Heal_Timer -= diff; - } - - void TeleportToMyBrother() - { - if (!pInstance) - return; - - Teleport_Timer = TELEPORTTIME; - - if (IAmVeklor()) - return; // mechanics handled by veknilash so they teleport exactly at the same time and to correct coordinates - - Creature *pOtherBoss = GetOtherBoss(); - if (pOtherBoss) - { - //m_creature->MonsterYell("Teleporting ...", LANG_UNIVERSAL, 0); - float other_x = pOtherBoss->GetPositionX(); - float other_y = pOtherBoss->GetPositionY(); - float other_z = pOtherBoss->GetPositionZ(); - float other_o = pOtherBoss->GetOrientation(); - - Map *thismap = m_creature->GetMap(); - thismap->CreatureRelocation(pOtherBoss, m_creature->GetPositionX(), - m_creature->GetPositionY(), m_creature->GetPositionZ(), m_creature->GetOrientation()); - thismap->CreatureRelocation(m_creature, other_x, other_y, other_z, other_o); - - SetAfterTeleport(); - CAST_AI(boss_twinemperorsAI, pOtherBoss->AI())->SetAfterTeleport(); - } - } - - void SetAfterTeleport() - { - m_creature->InterruptNonMeleeSpells(false); - DoStopAttack(); - DoResetThreat(); - DoCast(m_creature, SPELL_TWIN_TELEPORT_VISUAL); - m_creature->addUnitState(UNIT_STAT_STUNNED); - AfterTeleport = true; - AfterTeleportTimer = 2000; - tspellcasted = false; - } - - bool TryActivateAfterTTelep(uint32 diff) - { - if (AfterTeleport) - { - if (!tspellcasted) - { - m_creature->clearUnitState(UNIT_STAT_STUNNED); - DoCast(m_creature, SPELL_TWIN_TELEPORT); - m_creature->addUnitState(UNIT_STAT_STUNNED); - } - - tspellcasted = true; - - if (AfterTeleportTimer < diff) - { - AfterTeleport = false; - m_creature->clearUnitState(UNIT_STAT_STUNNED); - Unit *nearu = m_creature->SelectNearestTarget(100); - //DoYell(nearu->GetName(), LANG_UNIVERSAL, 0); - if (nearu) - { - AttackStart(nearu); - m_creature->getThreatManager().addThreat(nearu, 10000); - } - return true; - } - else - { - AfterTeleportTimer -= diff; - // update important timers which would otherwise get skipped - if (EnrageTimer > diff) - EnrageTimer -= diff; - else - EnrageTimer = 0; - if (Teleport_Timer > diff) - Teleport_Timer -= diff; - else - Teleport_Timer = 0; - return false; - } - } - else - { - return true; - } - } - - void MoveInLineOfSight(Unit *who) - { - if (!who || m_creature->getVictim()) - return; - - if (who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who)) - { - float attackRadius = m_creature->GetAttackDistance(who); - if (attackRadius < PULL_RANGE) - attackRadius = PULL_RANGE; - if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->GetDistanceZ(who) <= /*CREATURE_Z_ATTACK_RANGE*/7 /*there are stairs*/) - { - //if (who->HasStealthAura()) - // who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); - AttackStart(who); - } - } - } - - Creature *RespawnNearbyBugsAndGetOne() - { - std::list lUnitList; - m_creature->GetCreatureListWithEntryInGrid(lUnitList,15316,150.0f); - m_creature->GetCreatureListWithEntryInGrid(lUnitList,15317,150.0f); - - if (lUnitList.empty()) - return NULL; - - Creature *nearb = NULL; - - for(std::list::iterator iter = lUnitList.begin(); iter != lUnitList.end(); ++iter) - { - Creature *c = *iter; - if (c) - { - if (c->isDead()) - { - c->Respawn(); - c->setFaction(7); - c->RemoveAllAuras(); - } - if (c->IsWithinDistInMap(m_creature, ABUSE_BUG_RANGE)) - { - if (!nearb || (rand()%4) == 0) - nearb = c; - } - } - } - return nearb; - } - - void HandleBugs(uint32 diff) - { - if (BugsTimer < diff || Abuse_Bug_Timer < diff) - { - Creature *c = RespawnNearbyBugsAndGetOne(); - if (Abuse_Bug_Timer < diff) - { - if (c) - { - CastSpellOnBug(c); - Abuse_Bug_Timer = 10000 + rand()%7000; - } - else - { - Abuse_Bug_Timer = 1000; - } - } - else - { - Abuse_Bug_Timer -= diff; - } - BugsTimer = 2000; - } - else - { - BugsTimer -= diff; - Abuse_Bug_Timer -= diff; - } - } - - void CheckEnrage(uint32 diff) - { - if (EnrageTimer < diff) - { - if (!m_creature->IsNonMeleeSpellCasted(true)) - { - DoCast(m_creature, SPELL_BERSERK); - EnrageTimer = 60*60000; - } else EnrageTimer = 0; - } else EnrageTimer-=diff; - } -}; - -struct TRINITY_DLL_DECL boss_veknilashAI : public boss_twinemperorsAI -{ - bool IAmVeklor() {return false;} - boss_veknilashAI(Creature *c) : boss_twinemperorsAI(c) {} - - uint32 UpperCut_Timer; - uint32 UnbalancingStrike_Timer; - uint32 Scarabs_Timer; - int Rand; - int RandX; - int RandY; - - Creature* Summoned; - - void Reset() - { - TwinReset(); - UpperCut_Timer = 14000 + rand()%15000; - UnbalancingStrike_Timer = 8000 + rand()%10000; - Scarabs_Timer = 7000 + rand()%7000; - - //Added. Can be removed if its included in DB. - m_creature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_MAGIC, true); - } - - void CastSpellOnBug(Creature *target) - { - target->setFaction(14); - (target->AI())->AttackStart(m_creature->getThreatManager().getHostilTarget()); - SpellEntry *spell = GET_SPELL(SPELL_MUTATE_BUG); - uint8 eff_mask=0; - for (int i=0; i<3; ++i) - { - if (!spell->Effect[i]) - continue; - eff_mask|=1<AddAura(new Aura(spell, eff_mask, NULL, target, target)); - target->SetHealth(target->GetMaxHealth()); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - if (!TryActivateAfterTTelep(diff)) - return; - - //UnbalancingStrike_Timer - if (UnbalancingStrike_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_UNBALANCING_STRIKE); - UnbalancingStrike_Timer = 8000+rand()%12000; - }else UnbalancingStrike_Timer -= diff; - - if (UpperCut_Timer < diff) - { - Unit* randomMelee = SelectTarget(SELECT_TARGET_RANDOM, 0, NOMINAL_MELEE_RANGE, true); - if (randomMelee) - DoCast(randomMelee,SPELL_UPPERCUT); - UpperCut_Timer = 15000+rand()%15000; - }else UpperCut_Timer -= diff; - - HandleBugs(diff); - - //Heal brother when 60yrds close - TryHealBrother(diff); - - //Teleporting to brother - if (Teleport_Timer < diff) - { - TeleportToMyBrother(); - }else Teleport_Timer -= diff; - - CheckEnrage(diff); - - DoMeleeAttackIfReady(); - } -}; - -struct TRINITY_DLL_DECL boss_veklorAI : public boss_twinemperorsAI -{ - bool IAmVeklor() {return true;} - boss_veklorAI(Creature *c) : boss_twinemperorsAI(c) {} - - uint32 ShadowBolt_Timer; - uint32 Blizzard_Timer; - uint32 ArcaneBurst_Timer; - uint32 Scorpions_Timer; - int Rand; - int RandX; - int RandY; - - Creature* Summoned; - - void Reset() - { - TwinReset(); - ShadowBolt_Timer = 0; - Blizzard_Timer = 15000 + rand()%5000;; - ArcaneBurst_Timer = 1000; - Scorpions_Timer = 7000 + rand()%7000; - - //Added. Can be removed if its included in DB. - m_creature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, true); - m_creature->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, 0); - m_creature->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, 0); - } - - void CastSpellOnBug(Creature *target) - { - target->setFaction(14); - SpellEntry *spell = GET_SPELL(SPELL_EXPLODEBUG); - uint8 eff_mask=0; - for (int i=0; i<3; ++i) - { - if (!spell->Effect[i]) - continue; - eff_mask|=1<AddAura(new Aura(spell, eff_mask, NULL, target, target)); - target->SetHealth(target->GetMaxHealth()); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - // reset arcane burst after teleport - we need to do this because - // when VL jumps to VN's location there will be a warrior who will get only 2s to run away - // which is almost impossible - if (AfterTeleport) - ArcaneBurst_Timer = 5000; - if (!TryActivateAfterTTelep(diff)) - return; - - //ShadowBolt_Timer - if (ShadowBolt_Timer < diff) - { - if (!m_creature->IsWithinDist(m_creature->getVictim(), 45.0f)) - m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim(), VEKLOR_DIST, 0); - else - DoCast(m_creature->getVictim(),SPELL_SHADOWBOLT); - ShadowBolt_Timer = 2000; - }else ShadowBolt_Timer -= diff; - - //Blizzard_Timer - if (Blizzard_Timer < diff) - { - Unit* target = NULL; - target = SelectTarget(SELECT_TARGET_RANDOM, 0, 45, true); - if (target) - DoCast(target,SPELL_BLIZZARD); - Blizzard_Timer = 15000+rand()%15000; - }else Blizzard_Timer -= diff; - - if (ArcaneBurst_Timer < diff) - { - Unit *mvic; - if ((mvic=SelectTarget(SELECT_TARGET_NEAREST, 0, NOMINAL_MELEE_RANGE, true))!=NULL) - { - DoCast(mvic,SPELL_ARCANEBURST); - ArcaneBurst_Timer = 5000; - } - }else ArcaneBurst_Timer -= diff; - - HandleBugs(diff); - - //Heal brother when 60yrds close - TryHealBrother(diff); - - //Teleporting to brother - if (Teleport_Timer < diff) - { - TeleportToMyBrother(); - }else Teleport_Timer -= diff; - - CheckEnrage(diff); - - //VL doesn't melee - //DoMeleeAttackIfReady(); - } - - void AttackStart(Unit* who) - { - if (!who) - return; - - if (who->isTargetableForAttack()) - { - // VL doesn't melee - if (m_creature->Attack(who, false)) - { - m_creature->GetMotionMaster()->MoveChase(who, VEKLOR_DIST, 0); - m_creature->AddThreat(who, 0.0f); - } - } - } -}; - -CreatureAI* GetAI_boss_veknilash(Creature* pCreature) -{ - return new boss_veknilashAI (pCreature); -} - -CreatureAI* GetAI_boss_veklor(Creature* pCreature) -{ - return new boss_veklorAI (pCreature); -} - -void AddSC_boss_twinemperors() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_veknilash"; - newscript->GetAI = &GetAI_boss_veknilash; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="boss_veklor"; - newscript->GetAI = &GetAI_boss_veklor; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_viscidus.cpp b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_viscidus.cpp deleted file mode 100644 index 2bb9f1bfb0b..00000000000 --- a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_viscidus.cpp +++ /dev/null @@ -1,30 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Viscidus -SD%Complete: 0 -SDComment: place holder -SDCategory: Temple of Ahn'Qiraj -EndScriptData */ - -#include "precompiled.h" - -#define SPELL_POISON_SHOCK 25993 -#define SPELL_POISONBOLT_VOLLEY 25991 - -#define SPELL_TOXIN_CLOUD 25989 - diff --git a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/def_temple_of_ahnqiraj.h b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/def_temple_of_ahnqiraj.h deleted file mode 100644 index 5d545ed7c74..00000000000 --- a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/def_temple_of_ahnqiraj.h +++ /dev/null @@ -1,23 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ - -#ifndef DEF_TEMPLE_OF_AHNQIRAJ_H -#define DEF_TEMPLE_OF_AHNQIRAJ_H - -#define DATA_SKERAM 1 -#define DATA_KRI 2 -#define DATA_VEM 3 -#define DATA_VEMISDEAD 4 -#define DATA_VEM_DEATH 5 -#define DATA_VEKLOR 6 -#define DATA_VEKLORISDEAD 7 -#define DATA_VEKLOR_DEATH 8 -#define DATA_VEKNILASH 9 -#define DATA_VEKNILASHISDEAD 10 -#define DATA_VEKNILASH_DEATH 11 -#define DATA_BUG_TRIO_DEATH 14 - -#define DATA_CTHUN_PHASE 20 -#endif - diff --git a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/instance_temple_of_ahnqiraj.cpp b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/instance_temple_of_ahnqiraj.cpp deleted file mode 100644 index 489a415cf81..00000000000 --- a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/instance_temple_of_ahnqiraj.cpp +++ /dev/null @@ -1,166 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Instance_Temple_of_Ahnqiraj -SD%Complete: 80 -SDComment: -SDCategory: Temple of Ahn'Qiraj -EndScriptData */ - -#include "precompiled.h" -#include "def_temple_of_ahnqiraj.h" - -struct TRINITY_DLL_DECL instance_temple_of_ahnqiraj : public ScriptedInstance -{ - instance_temple_of_ahnqiraj(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; - - //If Vem is dead... - bool IsBossDied[3]; - - //Storing Skeram, Vem and Kri. - uint64 SkeramGUID; - uint64 VemGUID; - uint64 KriGUID; - uint64 VeklorGUID; - uint64 VeknilashGUID; - - uint32 BugTrioDeathCount; - - uint32 CthunPhase; - - void Initialize() - { - IsBossDied[0] = false; - IsBossDied[1] = false; - IsBossDied[2] = false; - - SkeramGUID = 0; - VemGUID = 0; - KriGUID = 0; - VeklorGUID = 0; - VeknilashGUID = 0; - - BugTrioDeathCount = 0; - - CthunPhase = 0; - } - - void OnCreatureCreate(Creature* pCreature, bool add) - { - switch (pCreature->GetEntry()) - { - case 15263: SkeramGUID = pCreature->GetGUID(); break; - case 15544: VemGUID = pCreature->GetGUID(); break; - case 15511: KriGUID = pCreature->GetGUID(); break; - case 15276: VeklorGUID = pCreature->GetGUID(); break; - case 15275: VeknilashGUID = pCreature->GetGUID(); break; - } - } - - bool IsEncounterInProgress() const - { - //not active in AQ40 - return false; - } - - uint32 GetData(uint32 type) - { - switch(type) - { - case DATA_VEMISDEAD: - if (IsBossDied[0]) - return 1; - break; - - case DATA_VEKLORISDEAD: - if (IsBossDied[1]) - return 1; - break; - - case DATA_VEKNILASHISDEAD: - if (IsBossDied[2]) - return 1; - break; - - case DATA_BUG_TRIO_DEATH: - return BugTrioDeathCount; - - case DATA_CTHUN_PHASE: - return CthunPhase; - } - return 0; - } - - uint64 GetData64 (uint32 identifier) - { - switch(identifier) - { - case DATA_SKERAM: - return SkeramGUID; - case DATA_VEM: - return VemGUID; - case DATA_KRI: - return KriGUID; - case DATA_VEKLOR: - return VeklorGUID; - case DATA_VEKNILASH: - return VeknilashGUID; - } - return 0; - } // end GetData64 - - void SetData(uint32 type, uint32 data) - { - switch(type) - { - case DATA_VEM_DEATH: - IsBossDied[0] = true; - break; - - case DATA_BUG_TRIO_DEATH: - BugTrioDeathCount++; - break; - - case DATA_VEKLOR_DEATH: - IsBossDied[1] = true; - break; - - case DATA_VEKNILASH_DEATH: - IsBossDied[2] = true; - break; - - case DATA_CTHUN_PHASE: - CthunPhase = data; - break; - } - } -}; - -InstanceData* GetInstanceData_instance_temple_of_ahnqiraj(Map* pMap) -{ - return new instance_temple_of_ahnqiraj(pMap); -} - -void AddSC_instance_temple_of_ahnqiraj() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_temple_of_ahnqiraj"; - newscript->GetInstanceData = &GetInstanceData_instance_temple_of_ahnqiraj; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/mob_anubisath_sentinel.cpp b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/mob_anubisath_sentinel.cpp deleted file mode 100644 index 35882b86ac7..00000000000 --- a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/mob_anubisath_sentinel.cpp +++ /dev/null @@ -1,318 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: mob_anubisath_sentinel -SD%Complete: 95 -SDComment: Shadow storm is not properly implemented in core it should only target ppl outside of melee range. -SDCategory: Temple of Ahn'Qiraj -EndScriptData */ - -#include "precompiled.h" -#include "WorldPacket.h" - -#include "Item.h" -#include "Player.h" -#include "Spell.h" - -#include "Cell.h" -#include "CellImpl.h" -#include "GridNotifiers.h" -#include "GridNotifiersImpl.h" - -#define SPELL_MENDING_BUFF 2147 - -#define SPELL_KNOCK_BUFF 21737 -#define SPELL_KNOCK 25778 -#define SPELL_MANAB_BUFF 812 -#define SPELL_MANAB 25779 - -#define SPELL_REFLECTAF_BUFF 13022 -#define SPELL_REFLECTSFr_BUFF 19595 -#define SPELL_THORNS_BUFF 25777 - -#define SPELL_THUNDER_BUFF 2834 -#define SPELL_THUNDER 8732 - -#define SPELL_MSTRIKE_BUFF 9347 -#define SPELL_MSTRIKE 24573 - -#define SPELL_STORM_BUFF 2148 -#define SPELL_STORM 26546 - -struct TRINITY_DLL_DECL aqsentinelAI; -class TRINITY_DLL_DECL SentinelAbilityAura : public Aura -{ - public: - ~SentinelAbilityAura(); - Unit* GetTriggerTarget() const; - SentinelAbilityAura(aqsentinelAI *abilityOwner, SpellEntry *spell, uint32 ability, uint32 eff); - protected: - aqsentinelAI *aOwner; - int32 currentBasePoints; - uint32 abilityId; -}; - -struct TRINITY_DLL_DECL aqsentinelAI : public ScriptedAI -{ - uint32 ability; - int abselected; - - void selectAbility(int asel) - { - switch (asel) - { - case 0: ability = SPELL_MENDING_BUFF;break; - case 1: ability = SPELL_KNOCK_BUFF;break; - case 2: ability = SPELL_MANAB_BUFF;break; - case 3: ability = SPELL_REFLECTAF_BUFF;break; - case 4: ability = SPELL_REFLECTSFr_BUFF;break; - case 5: ability = SPELL_THORNS_BUFF;break; - case 6: ability = SPELL_THUNDER_BUFF;break; - case 7: ability = SPELL_MSTRIKE_BUFF;break; - case 8: ability = SPELL_STORM_BUFF;break; - } - } - - aqsentinelAI(Creature *c) : ScriptedAI(c) - { - ClearBudyList(); - abselected = 0; // just initialization of variable - } - - Creature *nearby[3]; - - void ClearBudyList() - { - nearby[0] = nearby[1] = nearby[2] = NULL; - } - - void AddBuddyToList(Creature *c) - { - if (c==m_creature) - return; - for (int i=0; i<3; ++i) - { - if (nearby[i] == c) - return; - if (!nearby[i]) - { - nearby[i] = c; - return; - } - } - } - - void GiveBuddyMyList(Creature *c) - { - aqsentinelAI *cai = CAST_AI(aqsentinelAI, (c)->AI()); - for (int i=0; i<3; ++i) - if (nearby[i] && nearby[i]!=c) - cai->AddBuddyToList(nearby[i]); - cai->AddBuddyToList(m_creature); - } - - void SendMyListToBuddies() - { - for (int i=0; i<3; ++i) - if (nearby[i]) - GiveBuddyMyList(nearby[i]); - } - - void CallBuddiesToAttack(Unit *who) - { - for (int i=0; i<3; ++i) - { - Creature *c = nearby[i]; - if (c) - { - if (!c->isInCombat()) - { - c->SetNoCallAssistance(true); - if (c->AI()) - c->AI()->AttackStart(who); - } - } - } - } - - void AddSentinelsNear(Unit *nears) - { - std::list assistList; - m_creature->GetCreatureListWithEntryInGrid(assistList,15264,70.0f); - - if (assistList.empty()) - return; - - for(std::list::iterator iter = assistList.begin(); iter != assistList.end(); ++iter) - AddBuddyToList((*iter)); - } - - int pickAbilityRandom(bool *chosenAbilities) - { - for (int t = 0; t < 2; ++t) - { - for (int i = !t ? (rand()%9) : 0; i < 9; ++i) - { - if (!chosenAbilities[i]) - { - chosenAbilities[i] = true; - return i; - } - } - } - return 0; // should never happen - } - - void GetOtherSentinels(Unit *who) - { - bool *chosenAbilities = new bool[9]; - memset(chosenAbilities, 0, 9*sizeof(bool)); - selectAbility(pickAbilityRandom(chosenAbilities)); - - ClearBudyList(); - AddSentinelsNear(m_creature); - int bli; - for (bli = 0; bli < 3; ++bli) - { - if (!nearby[bli]) - break; - AddSentinelsNear(nearby[bli]); - CAST_AI(aqsentinelAI, nearby[bli]->AI())->gatherOthersWhenAggro = false; - CAST_AI(aqsentinelAI, nearby[bli]->AI())->selectAbility(pickAbilityRandom(chosenAbilities)); - } - /*if (bli < 3) - DoYell("I dont have enough buddies.", LANG_NEUTRAL, 0);*/ - SendMyListToBuddies(); - CallBuddiesToAttack(who); - - delete[] chosenAbilities; - } - - bool gatherOthersWhenAggro; - - void Reset() - { - if (!m_creature->isDead()) - { - for (int i=0; i<3; ++i) - { - if (!nearby[i]) - continue; - if (nearby[i]->isDead()) - nearby[i]->Respawn(); - } - } - ClearBudyList(); - gatherOthersWhenAggro = true; - } - - void GainSentinelAbility(uint32 id) - { - const SpellEntry *spell = GetSpellStore()->LookupEntry(id); - uint8 eff_mask=0; - for (int i=0; i<3; ++i) - { - if (!spell->Effect[i]) - continue; - eff_mask=1<AddAura(a); - } - - void EnterCombat(Unit *who) - { - if (gatherOthersWhenAggro) - GetOtherSentinels(who); - - GainSentinelAbility(ability); - DoZoneInCombat(); - } - - void JustDied(Unit* who) - { - for (int ni=0; ni<3; ++ni) - { - Creature *sent = nearby[ni]; - if (!sent) - continue; - if (sent->isDead()) - continue; - int h = sent->GetHealth() + (sent->GetMaxHealth() / 2); - if (h > sent->GetMaxHealth()) - h = sent->GetMaxHealth(); - sent->SetHealth(h); - CAST_AI(aqsentinelAI, sent->AI())->GainSentinelAbility(ability); - } - } - - Unit *GetHatedManaUser() - { - std::list::iterator i; - for (i = m_creature->getThreatManager().getThreatList().begin();i != m_creature->getThreatManager().getThreatList().end(); ++i) - { - Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid()); - if (pUnit->getPowerType()==POWER_MANA) - return pUnit; - } - return NULL; - } -}; -CreatureAI* GetAI_mob_anubisath_sentinelAI(Creature* pCreature) -{ - return new aqsentinelAI (pCreature); -} - -void AddSC_mob_anubisath_sentinel() -{ - Script *newscript; - newscript = new Script; - newscript->Name="mob_anubisath_sentinel"; - newscript->GetAI = &GetAI_mob_anubisath_sentinelAI; - newscript->RegisterSelf(); -} - -SentinelAbilityAura::~SentinelAbilityAura() {} -Unit* SentinelAbilityAura::GetTriggerTarget() const -{ - switch (abilityId) - { - case SPELL_KNOCK_BUFF: - case SPELL_THUNDER_BUFF: - case SPELL_MSTRIKE_BUFF: - case SPELL_STORM_BUFF: - return aOwner->m_creature->getVictim(); - - case SPELL_MANAB_BUFF: - return aOwner->GetHatedManaUser(); - - case SPELL_MENDING_BUFF: - case SPELL_REFLECTAF_BUFF: - case SPELL_REFLECTSFr_BUFF: - case SPELL_THORNS_BUFF: - default: - return aOwner->m_creature; - } -} - -SentinelAbilityAura::SentinelAbilityAura(aqsentinelAI *abilityOwner, SpellEntry *spell, uint32 ability, uint32 eff) -: Aura(spell, eff, NULL, abilityOwner->m_creature, abilityOwner->m_creature, NULL) -{ - aOwner = abilityOwner; - abilityId = ability; -} - diff --git a/src/bindings/scripts/scripts/zone/ungoro_crater/ungoro_crater.cpp b/src/bindings/scripts/scripts/zone/ungoro_crater/ungoro_crater.cpp deleted file mode 100644 index 426b7fa2217..00000000000 --- a/src/bindings/scripts/scripts/zone/ungoro_crater/ungoro_crater.cpp +++ /dev/null @@ -1,210 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -/* ScriptData -SDName: Ungoro Crater -SD%Complete: 100 -SDComment: Support for Quest: 4245 -SDCategory: Ungoro Crater -EndScriptData */ - -/* ContentData -npc_a-me -EndContentData */ - -#include "precompiled.h" -#include "escortAI.h" - -#define SAY_READY -1000200 -#define SAY_AGGRO1 -1000201 -#define SAY_SEARCH -1000202 -#define SAY_AGGRO2 -1000203 -#define SAY_AGGRO3 -1000204 -#define SAY_FINISH -1000205 - -#define SPELL_DEMORALIZINGSHOUT 13730 - -#define QUEST_CHASING_AME 4245 -#define ENTRY_TARLORD 6519 -#define ENTRY_TARLORD1 6519 -#define ENTRY_STOMPER 6513 - - -struct TRINITY_DLL_DECL npc_ameAI : public npc_escortAI -{ - npc_ameAI(Creature *c) : npc_escortAI(c) {} - - uint32 DEMORALIZINGSHOUT_Timer; - - void WaypointReached(uint32 i) - { - Player* pPlayer = Unit::GetPlayer(PlayerGUID); - - if (!pPlayer) - return; - - switch (i) - { - - case 19: - m_creature->SummonCreature(ENTRY_STOMPER, -6391.69, -1730.49, -272.83, 4.96, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - DoScriptText(SAY_AGGRO1, m_creature, pPlayer); - break; - case 28: - DoScriptText(SAY_SEARCH, m_creature, pPlayer); - break; - case 38: - m_creature->SummonCreature(ENTRY_TARLORD, -6370.75, -1382.84, -270.51, 6.06, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - DoScriptText(SAY_AGGRO2, m_creature, pPlayer); - break; - case 49: - m_creature->SummonCreature(ENTRY_TARLORD1, -6324.44, -1181.05, -270.17, 4.34, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - DoScriptText(SAY_AGGRO3, m_creature, pPlayer); - break; - case 55: - DoScriptText(SAY_FINISH, m_creature, pPlayer); - if (pPlayer && pPlayer->GetTypeId() == TYPEID_PLAYER) - CAST_PLR(pPlayer)->GroupEventHappens(QUEST_CHASING_AME,m_creature); - break; - - } - } - - void Reset() - { - DEMORALIZINGSHOUT_Timer = 5000; - } - - void EnterCombat(Unit* who) - {} - - void JustSummoned(Creature* summoned) - { - summoned->AI()->AttackStart(m_creature); - } - - void JustDied(Unit* killer) - { - if (PlayerGUID) - { - if (Player* pPlayer = Unit::GetPlayer(PlayerGUID)) - CAST_PLR(pPlayer)->FailQuest(QUEST_CHASING_AME); - } - } - - void UpdateAI(const uint32 diff) - { - npc_escortAI::UpdateAI(diff); - if (!UpdateVictim()) - return; - - if (DEMORALIZINGSHOUT_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_DEMORALIZINGSHOUT); - DEMORALIZINGSHOUT_Timer = 70000; - }else DEMORALIZINGSHOUT_Timer -= diff; - - } -}; - -bool QuestAccept_npc_ame(Player* pPlayer, Creature* pCreature, Quest const* quest) -{ - if (quest->GetQuestId() == QUEST_CHASING_AME) - { - CAST_AI(npc_escortAI, (pCreature->AI()))->Start(false, false, pPlayer->GetGUID()); - DoScriptText(SAY_READY, pCreature, pPlayer); - pCreature->SetUInt32Value(UNIT_FIELD_BYTES_1,0); - // Change faction so mobs attack - pCreature->setFaction(113); - } - return true; -} - -CreatureAI* GetAI_npc_ame(Creature* pCreature) -{ - npc_ameAI* thisAI = new npc_ameAI(pCreature); - - thisAI->AddWaypoint(1, -6380.38, -1965.14, -258.292, 5000); - thisAI->AddWaypoint(2, -6383.06, -1962.9, -258.936); - thisAI->AddWaypoint(3, -6391.09, -1956.13, -260.291); - thisAI->AddWaypoint(4, -6395.29, -1933.58, -262.949); - thisAI->AddWaypoint(5, -6396.58, -1919.93, -263.838); - thisAI->AddWaypoint(6, -6389.01, -1912.64, -260.689); - thisAI->AddWaypoint(7, -6369.19, -1892.87, -255.924); - thisAI->AddWaypoint(8, -6373.77, -1879.36, -259.268); - thisAI->AddWaypoint(9, -6377.55, -1869.56, -260.503); - thisAI->AddWaypoint(10, -6376.58, -1860.79, -260.026); - thisAI->AddWaypoint(11, -6373.13, -1847.22, -259.249); - thisAI->AddWaypoint(12, -6370.54, -1837.04, -260.007); - thisAI->AddWaypoint(13, -6372.52, -1829.16, -260.071); - thisAI->AddWaypoint(14, -6377.13, -1815.94, -262.632); - thisAI->AddWaypoint(15, -6380.27, -1806.95, -265.53); - thisAI->AddWaypoint(16, -6386.04, -1790.43, -268.546); - thisAI->AddWaypoint(17, -6386.72, -1776.29, -269.851); - thisAI->AddWaypoint(18, -6385.92, -1762.31, -271.494); - thisAI->AddWaypoint(19, -6384.69, -1744.86, -272.196); - thisAI->AddWaypoint(20, -6383.8, -1732.66, -272.222); - thisAI->AddWaypoint(21, -6382.66, -1716.96, -272.235); - thisAI->AddWaypoint(22, -6381.5, -1703.01, -272.964); - thisAI->AddWaypoint(23, -6379.96, -1685.58, -272.842); - thisAI->AddWaypoint(24, -6379.34, -1678.61, -272.34); - thisAI->AddWaypoint(25, -6364.45, -1636.27, -271.065); - thisAI->AddWaypoint(26, -6371.85, -1626.36, -272.188); - thisAI->AddWaypoint(27, -6383.5, -1629.01, -272.206); - thisAI->AddWaypoint(28, -6388.09, -1635.37, -272.105, 5000); - thisAI->AddWaypoint(29, -6375.42, -1637.33, -272.193); - thisAI->AddWaypoint(30, -6365.46, -1617.25, -272.141); - thisAI->AddWaypoint(31, -6353.79, -1603.48, -271.932); - thisAI->AddWaypoint(32, -6340.24, -1592.41, -269.435); - thisAI->AddWaypoint(33, -6329.45, -1566.89, -269.895); - thisAI->AddWaypoint(34, -6312.2, -1499.06, -269.507); - thisAI->AddWaypoint(35, -6304.55, -1468.5, -269.431); - thisAI->AddWaypoint(36, -6310.36, -1440.94, -268.427); - thisAI->AddWaypoint(37, -6321, -1418.91, -266.525); - thisAI->AddWaypoint(38, -6358.76, -1389.97, -267.522); - thisAI->AddWaypoint(39, -6378.65, -1375.67, -271.749); - thisAI->AddWaypoint(40, -6387.22, -1360.95, -272.109); - thisAI->AddWaypoint(41, -6406.95, -1323.87, -271.586); - thisAI->AddWaypoint(42, -6405, -1311.92, -271.906); - thisAI->AddWaypoint(43, -6395.56, -1303.62, -271.902); - thisAI->AddWaypoint(44, -6375.97, -1296.08, -271.865); - thisAI->AddWaypoint(45, -6364.39, -1281.23, -269.012); - thisAI->AddWaypoint(46, -6353.71, -1263.19, -267.95); - thisAI->AddWaypoint(47, -6340.09, -1248.65, -267.441); - thisAI->AddWaypoint(48, -6338.21, -1237.11, -267.844); - thisAI->AddWaypoint(49, -6336.6, -1219.69, -269.196); - thisAI->AddWaypoint(50, -6334.44, -1202.33, -271.527); - thisAI->AddWaypoint(51, -6329.56, -1189.82, -270.947); - thisAI->AddWaypoint(52, -6324.66, -1179.46, -270.103); - thisAI->AddWaypoint(53, -6315.08, -1176.74, -269.735); - thisAI->AddWaypoint(54, -6308.49, -1179.12, -269.57); - thisAI->AddWaypoint(55, -6302.43, -1181.32, -269.328, 5000); - thisAI->AddWaypoint(56, -6298.87, -1185.79, -269.278); - - return thisAI; -} - -void AddSC_ungoro_crater() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "npc_ame"; - newscript->GetAI = &GetAI_npc_ame; - newscript->pQuestAccept = &QuestAccept_npc_ame; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/wailing_caverns/def_wailing_caverns.h b/src/bindings/scripts/scripts/zone/wailing_caverns/def_wailing_caverns.h deleted file mode 100644 index ee03ade365e..00000000000 --- a/src/bindings/scripts/scripts/zone/wailing_caverns/def_wailing_caverns.h +++ /dev/null @@ -1,24 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ - -#ifndef DEF_WAILING_CAVERNS_H -#define DEF_WAILING_CAVERNS_H - -enum -{ - TYPE_LORD_COBRAHN = 1, - TYPE_LORD_PYTHAS = 2, - TYPE_LADY_ANACONDRA = 3, - TYPE_LORD_SERPENTIS = 4, - TYPE_NARALEX_EVENT = 5, - TYPE_NARALEX_PART1 = 6, - TYPE_NARALEX_PART2 = 7, - TYPE_NARALEX_PART3 = 8, - TYPE_MUTANUS_THE_DEVOURER = 9, - TYPE_NARALEX_YELLED = 10, - - DATA_NARALEX = 3679, -}; - -#endif \ No newline at end of file diff --git a/src/bindings/scripts/scripts/zone/wailing_caverns/instance_wailing_caverns.cpp b/src/bindings/scripts/scripts/zone/wailing_caverns/instance_wailing_caverns.cpp deleted file mode 100644 index e535a20a2c1..00000000000 --- a/src/bindings/scripts/scripts/zone/wailing_caverns/instance_wailing_caverns.cpp +++ /dev/null @@ -1,142 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Instance_Wailing_Caverns -SD%Complete: 99 -SDComment: Everything seems to work, still need some checking -SDCategory: Wailing Caverns -EndScriptData */ - -#include "precompiled.h" -#include "def_wailing_caverns.h" - -#define MAX_ENCOUNTER 9 - -struct TRINITY_DLL_DECL instance_wailing_caverns : public ScriptedInstance -{ - instance_wailing_caverns(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; - - uint32 m_auiEncounter[MAX_ENCOUNTER]; - - bool yelled; - uint64 NaralexGUID; - - void Initialize() - { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - - yelled = false; - NaralexGUID = 0; - } - - void OnCreatureCreate(Creature* pCreature, bool add) - { - if (pCreature->GetEntry() == DATA_NARALEX) - NaralexGUID = pCreature->GetGUID(); - } - - void SetData(uint32 type, uint32 data) - { - switch (type) - { - case TYPE_LORD_COBRAHN: m_auiEncounter[0] = data;break; - case TYPE_LORD_PYTHAS: m_auiEncounter[1] = data;break; - case TYPE_LADY_ANACONDRA: m_auiEncounter[2] = data;break; - case TYPE_LORD_SERPENTIS: m_auiEncounter[3] = data;break; - case TYPE_NARALEX_EVENT: m_auiEncounter[4] = data;break; - case TYPE_NARALEX_PART1: m_auiEncounter[5] = data;break; - case TYPE_NARALEX_PART2: m_auiEncounter[6] = data;break; - case TYPE_NARALEX_PART3: m_auiEncounter[7] = data;break; - case TYPE_MUTANUS_THE_DEVOURER: m_auiEncounter[8] = data;break; - case TYPE_NARALEX_YELLED: yelled = true; break; - } - if (data == DONE)SaveToDB(); - } - - uint32 GetData(uint32 type) - { - switch (type) - { - case TYPE_LORD_COBRAHN: return m_auiEncounter[0]; - case TYPE_LORD_PYTHAS: return m_auiEncounter[1]; - case TYPE_LADY_ANACONDRA: return m_auiEncounter[2]; - case TYPE_LORD_SERPENTIS: return m_auiEncounter[3]; - case TYPE_NARALEX_EVENT: return m_auiEncounter[4]; - case TYPE_NARALEX_PART1: return m_auiEncounter[5]; - case TYPE_NARALEX_PART2: return m_auiEncounter[6]; - case TYPE_NARALEX_PART3: return m_auiEncounter[7]; - case TYPE_MUTANUS_THE_DEVOURER: return m_auiEncounter[8]; - case TYPE_NARALEX_YELLED: return yelled; - } - return 0; - } - - uint64 GetData64(uint32 data) - { - if (data == DATA_NARALEX)return NaralexGUID; - return 0; - } - - std::string GetSaveData() - { - OUT_SAVE_INST_DATA; - - std::ostringstream saveStream; - saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " " - << m_auiEncounter[3] << " " << m_auiEncounter[4] << " " << m_auiEncounter[5] << " " - << m_auiEncounter[6] << " " << m_auiEncounter[7] << " " << m_auiEncounter[8]; - - OUT_SAVE_INST_DATA_COMPLETE; - return saveStream.str(); - } - - void Load(const char* in) - { - if (!in) - { - OUT_LOAD_INST_DATA_FAIL; - return; - } - - OUT_LOAD_INST_DATA(in); - - std::istringstream loadStream(in); - loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3] - >> m_auiEncounter[4] >> m_auiEncounter[5] >> m_auiEncounter[6] >> m_auiEncounter[7] >> m_auiEncounter[8]; - - for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] != DONE) - m_auiEncounter[i] = NOT_STARTED; - - OUT_LOAD_INST_DATA_COMPLETE; - } - -}; - -InstanceData* GetInstanceData_instance_wailing_caverns(Map* pMap) -{ - return new instance_wailing_caverns(pMap); -} - -void AddSC_instance_wailing_caverns() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_wailing_caverns"; - newscript->GetInstanceData = &GetInstanceData_instance_wailing_caverns; - newscript->RegisterSelf(); -} \ No newline at end of file diff --git a/src/bindings/scripts/scripts/zone/wailing_caverns/wailing_caverns.cpp b/src/bindings/scripts/scripts/zone/wailing_caverns/wailing_caverns.cpp deleted file mode 100644 index 622800127db..00000000000 --- a/src/bindings/scripts/scripts/zone/wailing_caverns/wailing_caverns.cpp +++ /dev/null @@ -1,411 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -/* ScriptData -SDName: Wailing Caverns -SD%Complete: 95 -SDComment: Need to add skill usage for Disciple of Naralex -SDCategory: Wailing Caverns -EndScriptData */ - -/* ContentData -EndContentData */ - -#include "precompiled.h" -#include "escortAI.h" -#include "def_wailing_caverns.h" - -/*###### -## npc_disciple_of_naralex -######*/ - -enum -{ - //say - SAY_MAKE_PREPARATIONS = -1043001, - SAY_TEMPLE_OF_PROMISE = -1043002, - SAY_MUST_CONTINUE = -1043003, - SAY_BANISH_THE_SPIRITS = -1043004, - SAY_CAVERNS_PURIFIED = -1043005, - SAY_BEYOND_THIS_CORRIDOR = -1043006, - SAY_EMERALD_DREAM = -1043007, - SAY_MUTANUS_THE_DEVOURER = -1043012, - SAY_NARALEX_AWAKES = -1043014, - SAY_THANK_YOU = -1043015, - SAY_FAREWELL = -1043016, - SAY_ATTACKED = -1043017, - //yell - SAY_AT_LAST = -1043000, - SAY_I_AM_AWAKE = -1043013, - //emote - EMOTE_AWAKENING_RITUAL = -1043008, - EMOTE_TROUBLED_SLEEP = -1043009, - EMOTE_WRITHE_IN_AGONY = -1043010, - EMOTE_HORRENDOUS_VISION = -1043011, - //spell - SPELL_MARK_OF_THE_WILD_RANK_2 = 5232, - SPELL_SERPENTINE_CLEANSING = 6270, - SPELL_NARALEXS_AWAKENING = 6271, - SPELL_FLIGHT_FORM = 33943, - //npc entry - NPC_DEVIATE_RAVAGER = 3636, - NPC_DEVIATE_VIPER = 5755, - NPC_DEVIATE_MOCCASIN = 5762, - NPC_NIGHTMARE_ECTOPLASM = 5763, - NPC_MUTANUS_THE_DEVOURER = 3654, -}; - -#define GOSSIP_ID_START_1 698 //Naralex sleeps again! -#define GOSSIP_ID_START_2 699 //The fanglords are dead! -#define GOSSIP_ITEM_NARALEX "Let the event begin!" -#define ACHIEVEMENT_WAILING_CAVERNS 630 - -struct TRINITY_DLL_DECL npc_disciple_of_naralexAI : public npc_escortAI -{ - npc_disciple_of_naralexAI(Creature *c) : npc_escortAI(c) - { - pInstance = c->GetInstanceData(); - eventTimer = 0; - currentEvent = 0; - eventProgress = 0; - m_creature->setActive(true); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); - } - - uint32 eventTimer; - uint32 currentEvent; - uint32 eventProgress; - ScriptedInstance *pInstance; - - void WaypointReached(uint32 i) - { - if (!pInstance) - return; - - switch (i) - { - case 4: - eventProgress = 1; - currentEvent = TYPE_NARALEX_PART1; - pInstance->SetData(TYPE_NARALEX_PART1, IN_PROGRESS); - break; - case 5: - DoScriptText(SAY_MUST_CONTINUE, m_creature); - pInstance->SetData(TYPE_NARALEX_PART1, DONE); - break; - case 11: - eventProgress = 1; - currentEvent = TYPE_NARALEX_PART2; - pInstance->SetData(TYPE_NARALEX_PART2, IN_PROGRESS); - break; - case 19: - DoScriptText(SAY_BEYOND_THIS_CORRIDOR, m_creature); - break; - case 24: - eventProgress = 1; - currentEvent = TYPE_NARALEX_PART3; - pInstance->SetData(TYPE_NARALEX_PART3, IN_PROGRESS); - break; - } - } - - void Reset() - { - - } - - void EnterCombat(Unit* who) - { - DoScriptText(SAY_ATTACKED, m_creature, who); - } - - void JustDied(Unit *slayer) - { - if (pInstance) - { - pInstance->SetData(TYPE_NARALEX_EVENT, FAIL); - pInstance->SetData(TYPE_NARALEX_PART1, FAIL); - pInstance->SetData(TYPE_NARALEX_PART2, FAIL); - pInstance->SetData(TYPE_NARALEX_PART3, FAIL); - } - } - - void JustSummoned(Creature* summoned) - { - summoned->AI()->AttackStart(m_creature); - } - - void EnterEvadeMode() - { - m_creature->RemoveAllAuras(); - m_creature->DeleteThreatList(); - m_creature->CombatStop(false);//do not interrupt channeling - m_creature->SetLootRecipient(NULL); - if (GetIsBeingEscorted()) - { - SetReturning(true); - ReturnToLastPoint(); - debug_log("TSCR: EscortAI (EnterEvadeMode() Override) has left combat and is now returning to last point"); - } - else - m_creature->GetMotionMaster()->MoveTargetedHome(); - } - - void UpdateAI(const uint32 diff) - { - if (currentEvent != TYPE_NARALEX_PART3) - npc_escortAI::UpdateAI(diff); - - if (!pInstance) - return; - if (eventTimer <= diff) - { - eventTimer = 0; - if (pInstance->GetData(currentEvent) == IN_PROGRESS) - { - switch (currentEvent) - { - case TYPE_NARALEX_PART1: - if (eventProgress == 1) - { - eventProgress++; - DoScriptText(SAY_TEMPLE_OF_PROMISE, m_creature); - m_creature->SummonCreature(NPC_DEVIATE_RAVAGER, -82.1763, 227.874, -93.3233, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000); - m_creature->SummonCreature(NPC_DEVIATE_RAVAGER, -72.9506, 216.645, -93.6756, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000); - } - break; - case TYPE_NARALEX_PART2: - if (eventProgress == 1) - { - eventProgress++; - DoScriptText(SAY_BANISH_THE_SPIRITS, m_creature); - DoCast(m_creature, SPELL_SERPENTINE_CLEANSING); - //CAST_AI(npc_escortAI, m_creature->AI())->SetCanDefend(false); - eventTimer = 30000; - m_creature->SummonCreature(NPC_DEVIATE_VIPER, -61.5261, 273.676, -92.8442, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000); - m_creature->SummonCreature(NPC_DEVIATE_VIPER, -58.4658, 280.799, -92.8393, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000); - m_creature->SummonCreature(NPC_DEVIATE_VIPER, -50.002, 278.578, -92.8442, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000); - } - else - if (eventProgress == 2) - { - //CAST_AI(npc_escortAI, m_creature->AI())->SetCanDefend(true); - DoScriptText(SAY_CAVERNS_PURIFIED, m_creature); - pInstance->SetData(TYPE_NARALEX_PART2, DONE); - if (m_creature->HasAura(SPELL_SERPENTINE_CLEANSING)) - m_creature->RemoveAura(SPELL_SERPENTINE_CLEANSING); - } - break; - case TYPE_NARALEX_PART3: - if (eventProgress == 1) - { - eventProgress++; - eventTimer = 4000; - m_creature->SetStandState(UNIT_STAND_STATE_KNEEL); - DoScriptText(SAY_EMERALD_DREAM, m_creature); - } - else - if (eventProgress == 2) - { - eventProgress++; - eventTimer = 15000; - //CAST_AI(npc_escortAI, m_creature->AI())->SetCanDefend(false); - if (Creature* naralex = pInstance->instance->GetCreature(pInstance->GetData64(DATA_NARALEX))) - DoCast(naralex, SPELL_NARALEXS_AWAKENING, true); - DoScriptText(EMOTE_AWAKENING_RITUAL, m_creature); - } - else - if (eventProgress == 3) - { - eventProgress++; - eventTimer = 15000; - if (Creature* naralex = pInstance->instance->GetCreature(pInstance->GetData64(DATA_NARALEX))) - DoScriptText(EMOTE_TROUBLED_SLEEP, naralex); - m_creature->SummonCreature(NPC_DEVIATE_MOCCASIN, 135.943, 199.701, -103.529, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000); - m_creature->SummonCreature(NPC_DEVIATE_MOCCASIN, 151.08, 221.13, -103.609, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000); - m_creature->SummonCreature(NPC_DEVIATE_MOCCASIN, 128.007, 227.428, -97.421, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000); - } - else - if (eventProgress == 4) - { - eventProgress++; - eventTimer = 30000; - if (Creature* naralex = pInstance->instance->GetCreature(pInstance->GetData64(DATA_NARALEX))) - DoScriptText(EMOTE_WRITHE_IN_AGONY, naralex); - m_creature->SummonCreature(NPC_NIGHTMARE_ECTOPLASM, 133.413, 207.188, -102.469, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000); - m_creature->SummonCreature(NPC_NIGHTMARE_ECTOPLASM, 142.857, 218.645, -102.905, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000); - m_creature->SummonCreature(NPC_NIGHTMARE_ECTOPLASM, 105.102, 227.211, -102.752, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000); - m_creature->SummonCreature(NPC_NIGHTMARE_ECTOPLASM, 153.372, 235.149, -102.826, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000); - m_creature->SummonCreature(NPC_NIGHTMARE_ECTOPLASM, 149.524, 251.113, -102.558, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000); - m_creature->SummonCreature(NPC_NIGHTMARE_ECTOPLASM, 136.208, 266.466, -102.977, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000); - m_creature->SummonCreature(NPC_NIGHTMARE_ECTOPLASM, 126.167, 274.759, -102.962, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000); - } - else - if (eventProgress == 5) - { - eventProgress++; - if (Creature* naralex = pInstance->instance->GetCreature(pInstance->GetData64(DATA_NARALEX))) - DoScriptText(EMOTE_HORRENDOUS_VISION, naralex); - m_creature->SummonCreature(NPC_MUTANUS_THE_DEVOURER, 150.872, 262.905, -103.503, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000); - DoScriptText(SAY_MUTANUS_THE_DEVOURER, m_creature); - pInstance->SetData(TYPE_MUTANUS_THE_DEVOURER, IN_PROGRESS); - } - else - if (eventProgress == 6 && pInstance->GetData(TYPE_MUTANUS_THE_DEVOURER) == DONE) - { - eventProgress++; - eventTimer = 3000; - if (Creature* naralex = pInstance->instance->GetCreature(pInstance->GetData64(DATA_NARALEX))) - { - AchievementEntry const *AchievWC = GetAchievementStore()->LookupEntry(ACHIEVEMENT_WAILING_CAVERNS); - if (AchievWC) - { - Map* pMap = m_creature->GetMap(); - if (pMap && pMap->IsDungeon()) - { - Map::PlayerList const &players = pMap->GetPlayers(); - for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) - itr->getSource()->CompletedAchievement(AchievWC); - } - } - if (m_creature->HasAura(SPELL_NARALEXS_AWAKENING)) - m_creature->RemoveAura(SPELL_NARALEXS_AWAKENING); - naralex->SetStandState(UNIT_STAND_STATE_STAND); - DoScriptText(SAY_I_AM_AWAKE, naralex); - } - DoScriptText(SAY_NARALEX_AWAKES, m_creature); - } - else - if (eventProgress == 7) - { - eventProgress++; - eventTimer = 6000; - if (Creature* naralex = pInstance->instance->GetCreature(pInstance->GetData64(DATA_NARALEX))) - DoScriptText(SAY_THANK_YOU, naralex); - } - else - if (eventProgress == 8) - { - eventProgress++; - eventTimer = 8000; - if (Creature* naralex = pInstance->instance->GetCreature(pInstance->GetData64(DATA_NARALEX))) - { - DoScriptText(SAY_FAREWELL, naralex); - naralex->AddAura(SPELL_FLIGHT_FORM, naralex); - } - SetRun(); - m_creature->SetStandState(UNIT_STAND_STATE_STAND); - m_creature->AddAura(SPELL_FLIGHT_FORM, m_creature); - } - else - if (eventProgress == 9) - { - eventProgress++; - eventTimer = 1500; - if (Creature* naralex = pInstance->instance->GetCreature(pInstance->GetData64(DATA_NARALEX))) - naralex->GetMotionMaster()->MovePoint(25, naralex->GetPositionX(), naralex->GetPositionY(), naralex->GetPositionZ()); - } - else - if (eventProgress == 10) - { - eventProgress++; - eventTimer = 2500; - if (Creature* naralex = pInstance->instance->GetCreature(pInstance->GetData64(DATA_NARALEX))) - { - naralex->GetMotionMaster()->MovePoint(0, 117.095512, 247.107971, -96.167870); - naralex->GetMotionMaster()->MovePoint(1, 90.388809, 276.135406, -83.389801); - } - m_creature->GetMotionMaster()->MovePoint(26, 117.095512, 247.107971, -96.167870); - m_creature->GetMotionMaster()->MovePoint(27, 144.375443, 281.045837, -82.477135); - } - else - if (eventProgress == 11) - { - if (Creature* naralex = pInstance->instance->GetCreature(pInstance->GetData64(DATA_NARALEX))) - naralex->SetVisibility(VISIBILITY_OFF); - m_creature->SetVisibility(VISIBILITY_OFF); - pInstance->SetData(TYPE_NARALEX_PART3, DONE); - } - break; - } - } - }else eventTimer -= diff; - } -}; - -CreatureAI* GetAI_npc_disciple_of_naralex(Creature* pCreature) -{ - return new npc_disciple_of_naralexAI(pCreature); -} - -bool GossipHello_npc_disciple_of_naralex(Player* pPlayer, Creature* pCreature) -{ - ScriptedInstance *pInstance = (pCreature->GetInstanceData()); - - if (pInstance) - { - pCreature->CastSpell(pPlayer, SPELL_MARK_OF_THE_WILD_RANK_2, true); - if ((pInstance->GetData(TYPE_LORD_COBRAHN) == DONE) && (pInstance->GetData(TYPE_LORD_PYTHAS) == DONE) && - (pInstance->GetData(TYPE_LADY_ANACONDRA) == DONE) && (pInstance->GetData(TYPE_LORD_SERPENTIS) == DONE)) - { - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_NARALEX, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - pPlayer->SEND_GOSSIP_MENU(GOSSIP_ID_START_2, pCreature->GetGUID()); - - if (!pInstance->GetData(TYPE_NARALEX_YELLED)) - { - DoScriptText(SAY_AT_LAST, pCreature); - pInstance->SetData(TYPE_NARALEX_YELLED, 1); - } - } - else - { - pPlayer->SEND_GOSSIP_MENU(GOSSIP_ID_START_1, pCreature->GetGUID()); - } - } - return true; -} - -bool GossipSelect_npc_disciple_of_naralex(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - ScriptedInstance *pInstance = (pCreature->GetInstanceData()); - if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) - { - pPlayer->CLOSE_GOSSIP_MENU(); - if (pInstance)pInstance->SetData(TYPE_NARALEX_EVENT, IN_PROGRESS); - - DoScriptText(SAY_MAKE_PREPARATIONS, pCreature); - - pCreature->setFaction(250); - pCreature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); - - CAST_AI(npc_escortAI, (pCreature->AI()))->Start(false, false, pPlayer->GetGUID()); - CAST_AI(npc_escortAI, (pCreature->AI()))->SetDespawnAtFar(false); - CAST_AI(npc_escortAI, (pCreature->AI()))->SetDespawnAtEnd(false); - } - return true; -} - -void AddSC_wailing_caverns() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "npc_disciple_of_naralex"; - newscript->pGossipHello = &GossipHello_npc_disciple_of_naralex; - newscript->pGossipSelect = &GossipSelect_npc_disciple_of_naralex; - newscript->GetAI = &GetAI_npc_disciple_of_naralex; - newscript->RegisterSelf(); -} \ No newline at end of file diff --git a/src/bindings/scripts/scripts/zone/zulfarrak/zulfarrak.cpp b/src/bindings/scripts/scripts/zone/zulfarrak/zulfarrak.cpp deleted file mode 100644 index 4e630368db1..00000000000 --- a/src/bindings/scripts/scripts/zone/zulfarrak/zulfarrak.cpp +++ /dev/null @@ -1,223 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Zulfarrak -SD%Complete: 50 -SDComment: Consider it temporary, no instance script made for this instance yet. -SDCategory: Zul'Farrak -EndScriptData */ - -/* ContentData -npc_sergeant_bly -npc_weegli_blastfuse -EndContentData */ - -#include "precompiled.h" - -/*###### -## npc_sergeant_bly -######*/ - -#define FACTION_HOSTILE 14 -#define FACTION_FRIENDLY 35 - -#define SPELL_SHIELD_BASH 11972 -#define SPELL_REVENGE 12170 - -#define GOSSIP_BLY "[PH] In that case, i will take my reward!" - -struct TRINITY_DLL_DECL npc_sergeant_blyAI : public ScriptedAI -{ - npc_sergeant_blyAI(Creature *c) : ScriptedAI(c) - { - //pInstance = c->GetInstanceData(); - } - - //ScriptedInstance* pInstance; - - uint32 ShieldBash_Timer; - uint32 Revenge_Timer; //this is wrong, spell should never be used unless m_creature->getVictim() dodge, parry or block attack. Trinity support required. - - void Reset() - { - ShieldBash_Timer = 5000; - Revenge_Timer = 8000; - - m_creature->setFaction(FACTION_FRIENDLY); - - /*if (pInstance) - pInstance->SetData(0, NOT_STARTED);*/ - } - - void EnterCombat(Unit *who) - { - /*if (pInstance) - pInstance->SetData(0, IN_PROGRESS);*/ - } - - void JustDied(Unit *victim) - { - /*if (pInstance) - pInstance->SetData(0, DONE);*/ - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (ShieldBash_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_SHIELD_BASH); - ShieldBash_Timer = 15000; - }else ShieldBash_Timer -= diff; - - if (Revenge_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_REVENGE); - Revenge_Timer = 10000; - }else Revenge_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_npc_sergeant_bly(Creature* pCreature) -{ - return new npc_sergeant_blyAI (pCreature); -} - -bool GossipHello_npc_sergeant_bly(Player* pPlayer, Creature* pCreature) -{ - /*if (pInstance->GetData(0) == DONE) - {*/ - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BLY, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - pPlayer->SEND_GOSSIP_MENU(1517, pCreature->GetGUID()); - /*} - else if (pInstance->GetData(0) == IN_PROGRESS) - pPlayer->SEND_GOSSIP_MENU(1516, pCreature->GetGUID()); - else - pPlayer->SEND_GOSSIP_MENU(1515, pCreature->GetGUID());*/ - - return true; -} - -bool GossipSelect_npc_sergeant_bly(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) - { - pPlayer->CLOSE_GOSSIP_MENU(); - pCreature->setFaction(FACTION_HOSTILE); - CAST_AI(npc_sergeant_blyAI, pCreature->AI())->AttackStart(pPlayer); - } - return true; -} - -/*###### -## npc_weegli_blastfuse -######*/ - -#define SPELL_BOMB 8858 -#define SPELL_GOBLIN_LAND_MINE 21688 -#define SPELL_SHOOT 6660 -#define SPELL_WEEGLIS_BARREL 10772 - -#define GOSSIP_WEEGLI "[PH] Please blow up the door." - -struct TRINITY_DLL_DECL npc_weegli_blastfuseAI : public ScriptedAI -{ - npc_weegli_blastfuseAI(Creature *c) : ScriptedAI(c) - { - //pInstance = c->GetInstanceData(); - } - - //ScriptedInstance* pInstance; - - void Reset() - { - /*if (pInstance) - pInstance->SetData(0, NOT_STARTED);*/ - } - - void EnterCombat(Unit *who) - { - /*if (pInstance) - pInstance->SetData(0, IN_PROGRESS);*/ - } - - void JustDied(Unit *victim) - { - /*if (pInstance) - pInstance->SetData(0, DONE);*/ - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_npc_weegli_blastfuse(Creature* pCreature) -{ - return new npc_weegli_blastfuseAI (pCreature); -} - -bool GossipHello_npc_weegli_blastfuse(Player* pPlayer, Creature* pCreature) -{ - //event not implemented yet, this is only placeholder for future developement - /*if (pInstance->GetData(0) == DONE) - { - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_WEEGLI, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - pPlayer->SEND_GOSSIP_MENU(1514, pCreature->GetGUID());//if event can proceed to end - } - else if (pInstance->GetData(0) == IN_PROGRESS) - pPlayer->SEND_GOSSIP_MENU(1513, pCreature->GetGUID());//if event are in progress - else*/ - pPlayer->SEND_GOSSIP_MENU(1511, pCreature->GetGUID()); //if event not started - return true; -} - -bool GossipSelect_npc_weegli_blastfuse(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) - { - pPlayer->CLOSE_GOSSIP_MENU(); - //here we make him run to door, set the charge and run away off to nowhere - } - return true; -} - -void AddSC_zulfarrak() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="npc_sergeant_bly"; - newscript->GetAI = &GetAI_npc_sergeant_bly; - newscript->pGossipHello = &GossipHello_npc_sergeant_bly; - newscript->pGossipSelect = &GossipSelect_npc_sergeant_bly; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_weegli_blastfuse"; - newscript->GetAI = &GetAI_npc_weegli_blastfuse; - newscript->pGossipHello = &GossipHello_npc_weegli_blastfuse; - newscript->pGossipSelect = &GossipSelect_npc_weegli_blastfuse; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/system/ScriptLoader.cpp b/src/bindings/scripts/system/ScriptLoader.cpp index 49d2aa8bb7e..6f49b54a515 100644 --- a/src/bindings/scripts/system/ScriptLoader.cpp +++ b/src/bindings/scripts/system/ScriptLoader.cpp @@ -164,6 +164,7 @@ extern void AddSC_boss_hazzarah(); extern void AddSC_boss_renataki(); extern void AddSC_boss_wushoolay(); extern void AddSC_instance_zulgurub(); + //extern void AddSC_alterac_mountains(); extern void AddSC_arathi_highlands(); extern void AddSC_blasted_lands(); @@ -189,6 +190,46 @@ extern void AddSC_western_plaguelands(); extern void AddSC_westfall(); //kalimdor +extern void AddSC_instance_blackfathom_deeps(); //Blackfathom Depths +extern void AddSC_hyjal(); //CoT Battle for Mt. Hyjal +extern void AddSC_boss_archimonde(); +extern void AddSC_instance_mount_hyjal(); +extern void AddSC_hyjal_trash(); +extern void AddSC_boss_rage_winterchill(); +extern void AddSC_boss_anetheron(); +extern void AddSC_boss_kazrogal(); +extern void AddSC_boss_azgalor(); +extern void AddSC_boss_captain_skarloc(); //CoT Old Hillsbrad +extern void AddSC_boss_epoch_hunter(); +extern void AddSC_boss_lieutenant_drake(); +extern void AddSC_instance_old_hillsbrad(); +extern void AddSC_old_hillsbrad(); +extern void AddSC_boss_aeonus(); //CoT The Dark Portal +extern void AddSC_boss_chrono_lord_deja(); +extern void AddSC_boss_temporus(); +extern void AddSC_dark_portal(); +extern void AddSC_instance_dark_portal(); +extern void AddSC_boss_celebras_the_cursed(); //Maraudon +extern void AddSC_boss_landslide(); +extern void AddSC_boss_noxxion(); +extern void AddSC_boss_ptheradras(); +extern void AddSC_boss_onyxia(); //Onyxia's Lair +extern void AddSC_boss_amnennar_the_coldbringer(); //Razorfen Downs +extern void AddSC_razorfen_downs(); +extern void AddSC_razorfen_kraul(); //Razorfen Kraul +extern void AddSC_boss_cthun(); //Temple of ahn'qiraj +extern void AddSC_boss_fankriss(); +extern void AddSC_boss_huhuran(); +extern void AddSC_bug_trio(); +extern void AddSC_boss_sartura(); +extern void AddSC_boss_skeram(); +extern void AddSC_boss_twinemperors(); +extern void AddSC_mob_anubisath_sentinel(); +extern void AddSC_instance_temple_of_ahnqiraj(); +extern void AddSC_wailing_caverns(); //Wailing caverns +extern void AddSC_instance_wailing_caverns(); +extern void AddSC_zulfarrak(); //Zul'Farrak + extern void AddSC_ashenvale(); extern void AddSC_azshara(); extern void AddSC_azuremyst_isle(); @@ -272,34 +313,6 @@ extern void AddSC_boss_najentus(); extern void AddSC_boss_illidari_council(); extern void AddSC_instance_black_temple(); -//Blackfathom Depths -extern void AddSC_instance_blackfathom_deeps(); - -//Caverns of Time -//--Battle for Mt. Hyjal -extern void AddSC_hyjal(); -extern void AddSC_boss_archimonde(); -extern void AddSC_instance_mount_hyjal(); -extern void AddSC_hyjal_trash(); -extern void AddSC_boss_rage_winterchill(); -extern void AddSC_boss_anetheron(); -extern void AddSC_boss_kazrogal(); -extern void AddSC_boss_azgalor(); - -//--Old Hillsbrad -extern void AddSC_boss_captain_skarloc(); -extern void AddSC_boss_epoch_hunter(); -extern void AddSC_boss_lieutenant_drake(); -extern void AddSC_instance_old_hillsbrad(); -extern void AddSC_old_hillsbrad(); - -//--The Dark Portal -extern void AddSC_boss_aeonus(); -extern void AddSC_boss_chrono_lord_deja(); -extern void AddSC_boss_temporus(); -extern void AddSC_dark_portal(); -extern void AddSC_instance_dark_portal(); - //Coilfang Resevoir //--Serpent Shrine Cavern extern void AddSC_boss_fathomlord_karathress(); @@ -350,12 +363,6 @@ extern void AddSC_boss_omor_the_unscarred(); extern void AddSC_boss_vazruden_the_herald(); extern void AddSC_instance_ramparts(); -//Maraudon -extern void AddSC_boss_celebras_the_cursed(); -extern void AddSC_boss_landslide(); -extern void AddSC_boss_noxxion(); -extern void AddSC_boss_ptheradras(); - //Naxxramas extern void AddSC_boss_anubrekhan(); extern void AddSC_boss_maexxna(); @@ -390,17 +397,6 @@ extern void AddSC_instance_nexus(); extern void AddSC_boss_sartharion(); extern void AddSC_instance_obsidian_sanctum(); -//Onyxia's Lair -extern void AddSC_boss_onyxia(); - -//Ragefire Chasm -//Razorfen Downs -extern void AddSC_boss_amnennar_the_coldbringer(); -extern void AddSC_razorfen_downs(); - -//Razorfen Kraul -extern void AddSC_razorfen_kraul(); - //Tempest Keep //--Arcatraz extern void AddSC_arcatraz(); @@ -426,16 +422,6 @@ extern void AddSC_boss_nethermancer_sepethrea(); extern void AddSC_boss_pathaleon_the_calculator(); extern void AddSC_instance_mechanar(); -//Temple of ahn'qiraj -extern void AddSC_boss_cthun(); -extern void AddSC_boss_fankriss(); -extern void AddSC_boss_huhuran(); -extern void AddSC_bug_trio(); -extern void AddSC_boss_sartura(); -extern void AddSC_boss_skeram(); -extern void AddSC_boss_twinemperors(); -extern void AddSC_mob_anubisath_sentinel(); -extern void AddSC_instance_temple_of_ahnqiraj(); //Ulduar extern void AddSC_boss_auriaya(); @@ -457,13 +443,6 @@ extern void AddSC_boss_ingvar_the_plunderer(); extern void AddSC_instance_utgarde_keep(); extern void AddSC_utgarde_keep(); -//Wailing caverns -extern void AddSC_wailing_caverns(); -extern void AddSC_instance_wailing_caverns(); - -//Zul'Farrak -extern void AddSC_zulfarrak(); - //Vault of Archavon extern void AddSC_boss_archavon(); extern void AddSC_boss_emalon(); @@ -639,6 +618,7 @@ void AddScripts() AddSC_boss_renataki(); AddSC_boss_wushoolay(); AddSC_instance_zulgurub(); + //AddSC_alterac_mountains(); AddSC_arathi_highlands(); AddSC_blasted_lands(); @@ -664,6 +644,46 @@ void AddScripts() AddSC_westfall(); //kalimdor + AddSC_instance_blackfathom_deeps(); //Blackfathom Depths + AddSC_hyjal(); //CoT Battle for Mt. Hyjal + AddSC_boss_archimonde(); + AddSC_instance_mount_hyjal(); + AddSC_hyjal_trash(); + AddSC_boss_rage_winterchill(); + AddSC_boss_anetheron(); + AddSC_boss_kazrogal(); + AddSC_boss_azgalor(); + AddSC_boss_captain_skarloc(); //CoT Old Hillsbrad + AddSC_boss_epoch_hunter(); + AddSC_boss_lieutenant_drake(); + AddSC_instance_old_hillsbrad(); + AddSC_old_hillsbrad(); + AddSC_boss_aeonus(); //CoT The Dark Portal + AddSC_boss_chrono_lord_deja(); + AddSC_boss_temporus(); + AddSC_dark_portal(); + AddSC_instance_dark_portal(); + AddSC_boss_celebras_the_cursed(); //Maraudon + AddSC_boss_landslide(); + AddSC_boss_noxxion(); + AddSC_boss_ptheradras(); + AddSC_boss_onyxia(); //Onyxia's Lair + AddSC_boss_amnennar_the_coldbringer(); //Razorfen Downs + AddSC_razorfen_downs(); + AddSC_razorfen_kraul(); //Razorfen Kraul + AddSC_boss_cthun(); //Temple of ahn'qiraj + AddSC_boss_fankriss(); + AddSC_boss_huhuran(); + AddSC_bug_trio(); + AddSC_boss_sartura(); + AddSC_boss_skeram(); + AddSC_boss_twinemperors(); + AddSC_mob_anubisath_sentinel(); + AddSC_instance_temple_of_ahnqiraj(); + AddSC_wailing_caverns(); //Wailing caverns + AddSC_instance_wailing_caverns(); + AddSC_zulfarrak(); //Zul'Farrak + AddSC_ashenvale(); AddSC_azshara(); AddSC_azuremyst_isle(); @@ -747,34 +767,6 @@ void AddScripts() AddSC_boss_illidari_council(); AddSC_instance_black_temple(); - //Blackfathom Depths - AddSC_instance_blackfathom_deeps(); - - //Caverns of Time - //--Battle for Mt. Hyjal - AddSC_hyjal(); - AddSC_boss_archimonde(); - AddSC_instance_mount_hyjal(); - AddSC_hyjal_trash(); - AddSC_boss_rage_winterchill(); - AddSC_boss_anetheron(); - AddSC_boss_kazrogal(); - AddSC_boss_azgalor(); - - //--Old Hillsbrad - AddSC_boss_captain_skarloc(); - AddSC_boss_epoch_hunter(); - AddSC_boss_lieutenant_drake(); - AddSC_instance_old_hillsbrad(); - AddSC_old_hillsbrad(); - - //--The Dark Portal - AddSC_boss_aeonus(); - AddSC_boss_chrono_lord_deja(); - AddSC_boss_temporus(); - AddSC_dark_portal(); - AddSC_instance_dark_portal(); - //Coilfang Resevoir //--Serpent Shrine Cavern AddSC_boss_fathomlord_karathress(); @@ -825,12 +817,6 @@ void AddScripts() AddSC_boss_vazruden_the_herald(); AddSC_instance_ramparts(); - //Maraudon - AddSC_boss_celebras_the_cursed(); - AddSC_boss_landslide(); - AddSC_boss_noxxion(); - AddSC_boss_ptheradras(); - //Naxxramas AddSC_boss_anubrekhan(); AddSC_boss_maexxna(); @@ -865,17 +851,6 @@ void AddScripts() AddSC_boss_sartharion(); AddSC_instance_obsidian_sanctum(); - //Onyxia's Lair - AddSC_boss_onyxia(); - - //Ragefire Chasm - //Razorfen Downs - AddSC_boss_amnennar_the_coldbringer(); - AddSC_razorfen_downs(); - - //Razorfen Kraul - AddSC_razorfen_kraul(); - //Tempest Keep //--Arcatraz AddSC_arcatraz(); @@ -901,16 +876,6 @@ void AddScripts() AddSC_boss_pathaleon_the_calculator(); AddSC_instance_mechanar(); - //Temple of ahn'qiraj - AddSC_boss_cthun(); - AddSC_boss_fankriss(); - AddSC_boss_huhuran(); - AddSC_bug_trio(); - AddSC_boss_sartura(); - AddSC_boss_skeram(); - AddSC_boss_twinemperors(); - AddSC_mob_anubisath_sentinel(); - AddSC_instance_temple_of_ahnqiraj(); //Ulduar AddSC_boss_auriaya(); @@ -932,13 +897,6 @@ void AddScripts() AddSC_instance_utgarde_keep(); AddSC_utgarde_keep(); - //Wailing caverns - AddSC_wailing_caverns(); - AddSC_instance_wailing_caverns(); - - //Zul'Farrak - AddSC_zulfarrak(); - //Vault of Archavon AddSC_boss_archavon(); AddSC_boss_emalon(); -- cgit v1.2.3 From 982dcc9eaa3fbddde8b02e0c242387dea1e6f912 Mon Sep 17 00:00:00 2001 From: Kudlaty Date: Sun, 16 Aug 2009 17:22:17 +0200 Subject: Merge [SD2] r1305 Move source files to continent folder, part 3 --HG-- branch : trunk --- src/bindings/scripts/CMakeLists.txt | 396 +-- src/bindings/scripts/VC80/80ScriptDev2.vcproj | 1878 ++++++------ src/bindings/scripts/VC90/90ScriptDev2.vcproj | 3047 ++++++-------------- .../azjol_nerub/ahnkahet/boss_amanitar.cpp | 79 + .../azjol_nerub/ahnkahet/boss_elder_nadox.cpp | 274 ++ .../azjol_nerub/ahnkahet/boss_herald_volazj.cpp | 111 + .../ahnkahet/boss_jedoga_shadowseeker.cpp | 109 + .../azjol_nerub/ahnkahet/boss_prince_taldaram.cpp | 109 + .../northrend/azjol_nerub/ahnkahet/def_ahnkahet.h | 33 + .../azjol_nerub/ahnkahet/instance_ahnkahet.cpp | 194 ++ .../azjol_nerub/azjol_nerub/boss_anubarak.cpp | 112 + .../azjol_nerub/azjol_nerub/boss_hadronox.cpp | 114 + .../azjol_nerub/boss_krikthir_the_gatewatcher.cpp | 116 + .../azjol_nerub/azjol_nerub/def_azjol_nerub.h | 29 + .../azjol_nerub/instance_azjol_nerub.cpp | 178 ++ .../northrend/draktharon_keep/boss_dred.cpp | 56 + .../northrend/draktharon_keep/boss_novos.cpp | 75 + .../northrend/draktharon_keep/boss_tharon_ja.cpp | 88 + .../northrend/draktharon_keep/boss_trollgore.cpp | 75 + .../draktharon_keep/def_drak_tharon_keep.h | 4 + .../draktharon_keep/instance_drak_tharon_keep.cpp | 21 + .../northrend/gundrak/boss_drakkari_colossus.cpp | 55 + .../scripts/scripts/northrend/gundrak/boss_eck.cpp | 65 + .../scripts/northrend/gundrak/boss_gal_darah.cpp | 85 + .../scripts/northrend/gundrak/boss_moorabi.cpp | 88 + .../scripts/northrend/gundrak/boss_slad_ran.cpp | 95 + .../scripts/northrend/gundrak/def_gundrak.h | 4 + .../scripts/northrend/gundrak/instance_gundrak.cpp | 21 + .../northrend/naxxramas/boss_anubrekhan.cpp | 123 + .../scripts/northrend/naxxramas/boss_faerlina.cpp | 122 + .../northrend/naxxramas/boss_four_horsemen.cpp | 167 ++ .../scripts/northrend/naxxramas/boss_gluth.cpp | 160 + .../scripts/northrend/naxxramas/boss_gothik.cpp | 347 +++ .../scripts/northrend/naxxramas/boss_grobbulus.cpp | 103 + .../scripts/northrend/naxxramas/boss_heigan.cpp | 150 + .../northrend/naxxramas/boss_highlord_mograine.cpp | 179 ++ .../scripts/northrend/naxxramas/boss_kelthuzad.cpp | 294 ++ .../scripts/northrend/naxxramas/boss_loatheb.cpp | 93 + .../scripts/northrend/naxxramas/boss_maexxna.cpp | 140 + .../scripts/northrend/naxxramas/boss_noth.cpp | 210 ++ .../scripts/northrend/naxxramas/boss_patchwerk.cpp | 133 + .../scripts/northrend/naxxramas/boss_razuvious.cpp | 128 + .../scripts/northrend/naxxramas/boss_sapphiron.cpp | 350 +++ .../scripts/northrend/naxxramas/boss_thaddius.cpp | 143 + .../scripts/northrend/naxxramas/def_naxxramas.h | 52 + .../northrend/naxxramas/instance_naxxramas.cpp | 217 ++ .../nexus/eye_of_eternity/boss_malygos.cpp | 170 ++ .../nexus/eye_of_eternity/def_eye_of_eternity.h | 4 + .../eye_of_eternity/instance_eye_of_eternity.cpp | 21 + .../northrend/nexus/nexus/boss_anomalus.cpp | 302 ++ .../northrend/nexus/nexus/boss_keristrasza.cpp | 258 ++ .../northrend/nexus/nexus/boss_magus_telestra.cpp | 317 ++ .../scripts/northrend/nexus/nexus/boss_ormorok.cpp | 311 ++ .../northrend/nexus/nexus/commander_kolurg.cpp | 57 + .../northrend/nexus/nexus/commander_stoutbeard.cpp | 63 + .../scripts/northrend/nexus/nexus/def_nexus.h | 19 + .../northrend/nexus/nexus/instance_nexus.cpp | 258 ++ .../scripts/northrend/nexus/oculus/boss_drakos.cpp | 82 + .../scripts/northrend/nexus/oculus/boss_eregos.cpp | 104 + .../scripts/northrend/nexus/oculus/boss_urom.cpp | 87 + .../scripts/northrend/nexus/oculus/boss_varos.cpp | 85 + .../scripts/northrend/nexus/oculus/def_oculus.h | 4 + .../northrend/nexus/oculus/instance_oculus.cpp | 21 + .../northrend/obsidian_sanctum/boss_sartharion.cpp | 1153 ++++++++ .../obsidian_sanctum/def_obsidian_sanctum.h | 20 + .../obsidian_sanctum/instance_obsidian_sanctum.cpp | 97 + .../ulduar/halls_of_lightning/boss_bjarngrim.cpp | 440 +++ .../ulduar/halls_of_lightning/boss_ionar.cpp | 399 +++ .../ulduar/halls_of_lightning/boss_loken.cpp | 253 ++ .../ulduar/halls_of_lightning/boss_volkhan.cpp | 494 ++++ .../halls_of_lightning/def_halls_of_lightning.h | 34 + .../instance_halls_of_lightning.cpp | 194 ++ .../ulduar/halls_of_stone/boss_krystallus.cpp | 73 + .../ulduar/halls_of_stone/boss_maiden_of_grief.cpp | 81 + .../ulduar/halls_of_stone/boss_sjonnir.cpp | 83 + .../ulduar/halls_of_stone/def_halls_of_stone.h | 4 + .../halls_of_stone/instance_halls_of_stone.cpp | 21 + .../northrend/ulduar/ulduar/boss_algalon.cpp | 20 + .../ulduar/ulduar/boss_assembly_of_iron.cpp | 20 + .../northrend/ulduar/ulduar/boss_auriaya.cpp | 91 + .../ulduar/ulduar/boss_flame_leviathan.cpp | 306 ++ .../scripts/northrend/ulduar/ulduar/boss_freya.cpp | 20 + .../northrend/ulduar/ulduar/boss_general_vezax.cpp | 20 + .../scripts/northrend/ulduar/ulduar/boss_hodir.cpp | 20 + .../scripts/northrend/ulduar/ulduar/boss_ignis.cpp | 102 + .../northrend/ulduar/ulduar/boss_kologarn.cpp | 20 + .../northrend/ulduar/ulduar/boss_mimiron.cpp | 20 + .../northrend/ulduar/ulduar/boss_razorscale.cpp | 300 ++ .../northrend/ulduar/ulduar/boss_thorim.cpp | 20 + .../scripts/northrend/ulduar/ulduar/boss_xt002.cpp | 90 + .../northrend/ulduar/ulduar/boss_yoggsaron.cpp | 20 + .../scripts/northrend/ulduar/ulduar/def_ulduar.h | 41 + .../northrend/ulduar/ulduar/instance_ulduar.cpp | 20 + .../utgarde_keep/boss_ingvar_the_plunderer.cpp | 459 +++ .../utgarde_keep/utgarde_keep/boss_keleseth.cpp | 365 +++ .../utgarde_keep/boss_skarvald_dalronn.cpp | 397 +++ .../utgarde_keep/utgarde_keep/def_utgarde_keep.h | 35 + .../utgarde_keep/instance_utgarde_keep.cpp | 291 ++ .../utgarde_keep/utgarde_keep/utgarde_keep.cpp | 160 + .../utgarde_pinnacle/boss_palehoof.cpp | 78 + .../utgarde_keep/utgarde_pinnacle/boss_skadi.cpp | 89 + .../utgarde_keep/utgarde_pinnacle/boss_svala.cpp | 83 + .../utgarde_keep/utgarde_pinnacle/boss_ymiron.cpp | 85 + .../utgarde_keep/utgarde_pinnacle/def_pinnacle.h | 4 + .../utgarde_pinnacle/instance_pinnacle.cpp | 21 + .../northrend/vault_of_archavon/boss_archavon.cpp | 199 ++ .../northrend/vault_of_archavon/boss_emalon.cpp | 275 ++ .../vault_of_archavon/def_vault_of_archavon.h | 8 + .../instance_vault_of_archavon.cpp | 124 + .../northrend/violet_hold/boss_cyanigosa.cpp | 82 + .../scripts/northrend/violet_hold/boss_erekem.cpp | 82 + .../scripts/northrend/violet_hold/boss_ichoron.cpp | 81 + .../northrend/violet_hold/boss_lavanthor.cpp | 52 + .../scripts/northrend/violet_hold/boss_moragg.cpp | 50 + .../scripts/northrend/violet_hold/boss_xevozz.cpp | 82 + .../scripts/northrend/violet_hold/boss_zuramat.cpp | 82 + .../northrend/violet_hold/def_violet_hold.h | 4 + .../northrend/violet_hold/instance_violet_hold.cpp | 21 + .../scripts/scripts/northrend/wintergrasp.cpp | 60 + .../auchenai_crypts/boss_exarch_maladaar.cpp | 358 +++ .../boss_shirrak_the_dead_watcher.cpp | 212 ++ .../mana_tombs/boss_nexusprince_shaffar.cpp | 369 +++ .../aunchindoun/mana_tombs/boss_pandemonius.cpp | 138 + .../sethekk_halls/boss_darkweaver_syth.cpp | 438 +++ .../sethekk_halls/boss_tailonking_ikiss.cpp | 221 ++ .../aunchindoun/sethekk_halls/def_sethekk_halls.h | 14 + .../sethekk_halls/instance_sethekk_halls.cpp | 91 + .../shadow_labyrinth/boss_ambassador_hellmaw.cpp | 217 ++ .../boss_blackheart_the_inciter.cpp | 177 ++ .../shadow_labyrinth/boss_grandmaster_vorpil.cpp | 321 +++ .../aunchindoun/shadow_labyrinth/boss_murmur.cpp | 207 ++ .../shadow_labyrinth/def_shadow_labyrinth.h | 15 + .../shadow_labyrinth/instance_shadow_labyrinth.cpp | 227 ++ .../scripts/outland/black_temple/black_temple.cpp | 69 + .../outland/black_temple/boss_bloodboil.cpp | 344 +++ .../scripts/outland/black_temple/boss_illidan.cpp | 2208 ++++++++++++++ .../outland/black_temple/boss_mother_shahraz.cpp | 315 ++ .../black_temple/boss_reliquary_of_souls.cpp | 710 +++++ .../outland/black_temple/boss_shade_of_akama.cpp | 870 ++++++ .../scripts/outland/black_temple/boss_supremus.cpp | 296 ++ .../outland/black_temple/boss_teron_gorefiend.cpp | 520 ++++ .../outland/black_temple/boss_warlord_najentus.cpp | 226 ++ .../outland/black_temple/def_black_temple.h | 39 + .../outland/black_temple/illidari_council.cpp | 872 ++++++ .../outland/black_temple/instance_black_temple.cpp | 346 +++ .../serpent_shrine/boss_fathomlord_karathress.cpp | 759 +++++ .../serpent_shrine/boss_hydross_the_unstable.cpp | 386 +++ .../serpent_shrine/boss_lady_vashj.cpp | 1066 +++++++ .../serpent_shrine/boss_leotheras_the_blind.cpp | 808 ++++++ .../serpent_shrine/boss_lurker_below.cpp | 489 ++++ .../serpent_shrine/boss_morogrim_tidewalker.cpp | 372 +++ .../serpent_shrine/def_serpent_shrine.h | 32 + .../serpent_shrine/instance_serpent_shrine.cpp | 285 ++ .../steam_vault/boss_hydromancer_thespia.cpp | 197 ++ .../steam_vault/boss_mekgineer_steamrigger.cpp | 279 ++ .../steam_vault/boss_warlord_kalithresh.cpp | 213 ++ .../steam_vault/def_steam_vault.h | 17 + .../steam_vault/instance_steam_vault.cpp | 231 ++ .../coilfang_resevoir/underbog/boss_hungarfen.cpp | 156 + .../underbog/boss_the_black_stalker.cpp | 191 ++ .../scripts/outland/gruuls_lair/boss_gruul.cpp | 260 ++ .../outland/gruuls_lair/boss_high_king_maulgar.cpp | 793 +++++ .../scripts/outland/gruuls_lair/def_gruuls_lair.h | 21 + .../outland/gruuls_lair/instance_gruuls_lair.cpp | 193 ++ .../blood_furnace/boss_broggok.cpp | 131 + .../blood_furnace/boss_kelidan_the_breaker.cpp | 378 +++ .../blood_furnace/boss_the_maker.cpp | 162 ++ .../blood_furnace/def_blood_furnace.h | 29 + .../blood_furnace/instance_blood_furnace.cpp | 234 ++ .../hellfire_ramparts/boss_omor_the_unscarred.cpp | 214 ++ .../hellfire_ramparts/boss_vazruden_the_herald.cpp | 490 ++++ .../boss_watchkeeper_gargolmar.cpp | 168 ++ .../hellfire_ramparts/def_hellfire_ramparts.h | 16 + .../instance_hellfire_ramparts.cpp | 84 + .../magtheridons_lair/boss_magtheridon.cpp | 562 ++++ .../magtheridons_lair/def_magtheridons_lair.h | 14 + .../instance_magtheridons_lair.cpp | 249 ++ .../shattered_halls/boss_nethekurse.cpp | 412 +++ .../shattered_halls/boss_warbringer_omrogg.cpp | 408 +++ .../boss_warchief_kargath_bladefist.cpp | 303 ++ .../shattered_halls/def_shattered_halls.h | 14 + .../shattered_halls/instance_shattered_halls.cpp | 114 + .../outland/tempest_keep/arcatraz/arcatraz.cpp | 521 ++++ .../arcatraz/boss_harbinger_skyriss.cpp | 312 ++ .../outland/tempest_keep/arcatraz/def_arcatraz.h | 21 + .../tempest_keep/arcatraz/instance_arcatraz.cpp | 238 ++ .../botanica/boss_high_botanist_freywinn.cpp | 199 ++ .../outland/tempest_keep/botanica/boss_laj.cpp | 205 ++ .../tempest_keep/botanica/boss_warp_splinter.cpp | 226 ++ .../outland/tempest_keep/the_eye/boss_alar.cpp | 525 ++++ .../tempest_keep/the_eye/boss_astromancer.cpp | 474 +++ .../outland/tempest_keep/the_eye/boss_kaelthas.cpp | 1515 ++++++++++ .../tempest_keep/the_eye/boss_void_reaver.cpp | 185 ++ .../outland/tempest_keep/the_eye/def_the_eye.h | 20 + .../tempest_keep/the_eye/instance_the_eye.cpp | 176 ++ .../outland/tempest_keep/the_eye/the_eye.cpp | 99 + .../the_mechanar/boss_gatewatcher_gyrokill.cpp | 38 + .../the_mechanar/boss_gatewatcher_ironhand.cpp | 148 + .../the_mechanar/boss_nethermancer_sepethrea.cpp | 258 ++ .../the_mechanar/boss_pathaleon_the_calculator.cpp | 257 ++ .../tempest_keep/the_mechanar/def_mechanar.h | 6 + .../the_mechanar/instance_mechanar.cpp | 87 + .../auchenai_crypts/boss_exarch_maladaar.cpp | 358 --- .../boss_shirrak_the_dead_watcher.cpp | 212 -- .../mana_tombs/boss_nexusprince_shaffar.cpp | 369 --- .../aunchindoun/mana_tombs/boss_pandemonius.cpp | 138 - .../sethekk_halls/boss_darkweaver_syth.cpp | 438 --- .../sethekk_halls/boss_tailonking_ikiss.cpp | 221 -- .../aunchindoun/sethekk_halls/def_sethekk_halls.h | 14 - .../sethekk_halls/instance_sethekk_halls.cpp | 91 - .../shadow_labyrinth/boss_ambassador_hellmaw.cpp | 217 -- .../boss_blackheart_the_inciter.cpp | 177 -- .../shadow_labyrinth/boss_grandmaster_vorpil.cpp | 321 --- .../aunchindoun/shadow_labyrinth/boss_murmur.cpp | 207 -- .../shadow_labyrinth/def_shadow_labyrinth.h | 15 - .../shadow_labyrinth/instance_shadow_labyrinth.cpp | 227 -- .../zone/azjol_nerub/ahnkahet/boss_amanitar.cpp | 79 - .../zone/azjol_nerub/ahnkahet/boss_elder_nadox.cpp | 274 -- .../azjol_nerub/ahnkahet/boss_herald_volazj.cpp | 111 - .../ahnkahet/boss_jedoga_shadowseeker.cpp | 109 - .../azjol_nerub/ahnkahet/boss_prince_taldaram.cpp | 109 - .../zone/azjol_nerub/ahnkahet/def_ahnkahet.h | 33 - .../azjol_nerub/ahnkahet/instance_ahnkahet.cpp | 194 -- .../zone/azjol_nerub/azjol_nerub/boss_anubarak.cpp | 112 - .../zone/azjol_nerub/azjol_nerub/boss_hadronox.cpp | 114 - .../azjol_nerub/boss_krikthir_the_gatewatcher.cpp | 116 - .../zone/azjol_nerub/azjol_nerub/def_azjol_nerub.h | 29 - .../azjol_nerub/instance_azjol_nerub.cpp | 178 -- .../black_temple/.instance_black_temple.cpp-s8inyu | 347 --- .../scripts/zone/black_temple/black_temple.cpp | 69 - .../scripts/zone/black_temple/boss_bloodboil.cpp | 344 --- .../scripts/zone/black_temple/boss_illidan.cpp | 2208 -------------- .../zone/black_temple/boss_mother_shahraz.cpp | 315 -- .../zone/black_temple/boss_reliquary_of_souls.cpp | 710 ----- .../zone/black_temple/boss_shade_of_akama.cpp | 870 ------ .../scripts/zone/black_temple/boss_supremus.cpp | 296 -- .../zone/black_temple/boss_teron_gorefiend.cpp | 520 ---- .../zone/black_temple/boss_warlord_najentus.cpp | 226 -- .../scripts/zone/black_temple/def_black_temple.h | 39 - .../scripts/zone/black_temple/illidari_council.cpp | 872 ------ .../zone/black_temple/instance_black_temple.cpp | 346 --- .../serpent_shrine/boss_fathomlord_karathress.cpp | 759 ----- .../serpent_shrine/boss_hydross_the_unstable.cpp | 386 --- .../serpent_shrine/boss_lady_vashj.cpp | 1066 ------- .../serpent_shrine/boss_leotheras_the_blind.cpp | 808 ------ .../serpent_shrine/boss_lurker_below.cpp | 489 ---- .../serpent_shrine/boss_morogrim_tidewalker.cpp | 372 --- .../serpent_shrine/def_serpent_shrine.h | 32 - .../serpent_shrine/instance_serpent_shrine.cpp | 285 -- .../steam_vault/boss_hydromancer_thespia.cpp | 197 -- .../steam_vault/boss_mekgineer_steamrigger.cpp | 279 -- .../steam_vault/boss_warlord_kalithresh.cpp | 213 -- .../steam_vault/def_steam_vault.h | 17 - .../steam_vault/instance_steam_vault.cpp | 231 -- .../coilfang_resevoir/underbog/boss_hungarfen.cpp | 156 - .../underbog/boss_the_black_stalker.cpp | 191 -- .../scripts/zone/draktharon_keep/boss_dred.cpp | 56 - .../scripts/zone/draktharon_keep/boss_novos.cpp | 75 - .../zone/draktharon_keep/boss_tharon_ja.cpp | 88 - .../zone/draktharon_keep/boss_trollgore.cpp | 75 - .../zone/draktharon_keep/def_drak_tharon_keep.h | 4 - .../draktharon_keep/instance_drak_tharon_keep.cpp | 21 - .../scripts/zone/gruuls_lair/boss_gruul.cpp | 260 -- .../zone/gruuls_lair/boss_high_king_maulgar.cpp | 793 ----- .../scripts/zone/gruuls_lair/def_gruuls_lair.h | 21 - .../zone/gruuls_lair/instance_gruuls_lair.cpp | 193 -- .../zone/gundrak/boss_drakkari_colossus.cpp | 55 - .../scripts/scripts/zone/gundrak/boss_eck.cpp | 65 - .../scripts/zone/gundrak/boss_gal_darah.cpp | 85 - .../scripts/scripts/zone/gundrak/boss_moorabi.cpp | 88 - .../scripts/scripts/zone/gundrak/boss_slad_ran.cpp | 95 - .../scripts/scripts/zone/gundrak/def_gundrak.h | 4 - .../scripts/zone/gundrak/instance_gundrak.cpp | 21 - .../blood_furnace/boss_broggok.cpp | 131 - .../blood_furnace/boss_kelidan_the_breaker.cpp | 378 --- .../blood_furnace/boss_the_maker.cpp | 162 -- .../blood_furnace/def_blood_furnace.h | 29 - .../blood_furnace/instance_blood_furnace.cpp | 234 -- .../hellfire_ramparts/boss_omor_the_unscarred.cpp | 214 -- .../hellfire_ramparts/boss_vazruden_the_herald.cpp | 490 ---- .../boss_watchkeeper_gargolmar.cpp | 168 -- .../hellfire_ramparts/def_hellfire_ramparts.h | 16 - .../instance_hellfire_ramparts.cpp | 84 - .../magtheridons_lair/boss_magtheridon.cpp | 562 ---- .../magtheridons_lair/def_magtheridons_lair.h | 14 - .../instance_magtheridons_lair.cpp | 249 -- .../shattered_halls/boss_nethekurse.cpp | 412 --- .../shattered_halls/boss_warbringer_omrogg.cpp | 408 --- .../boss_warchief_kargath_bladefist.cpp | 303 -- .../shattered_halls/def_shattered_halls.h | 14 - .../shattered_halls/instance_shattered_halls.cpp | 114 - .../scripts/zone/naxxramas/boss_anubrekhan.cpp | 123 - .../scripts/zone/naxxramas/boss_faerlina.cpp | 122 - .../scripts/zone/naxxramas/boss_four_horsemen.cpp | 167 -- .../scripts/scripts/zone/naxxramas/boss_gluth.cpp | 160 - .../scripts/scripts/zone/naxxramas/boss_gothik.cpp | 347 --- .../scripts/zone/naxxramas/boss_grobbulus.cpp | 103 - .../scripts/scripts/zone/naxxramas/boss_heigan.cpp | 150 - .../zone/naxxramas/boss_highlord_mograine.cpp | 179 -- .../scripts/zone/naxxramas/boss_kelthuzad.cpp | 294 -- .../scripts/zone/naxxramas/boss_loatheb.cpp | 93 - .../scripts/zone/naxxramas/boss_maexxna.cpp | 140 - .../scripts/scripts/zone/naxxramas/boss_noth.cpp | 210 -- .../scripts/zone/naxxramas/boss_patchwerk.cpp | 133 - .../scripts/zone/naxxramas/boss_razuvious.cpp | 128 - .../scripts/zone/naxxramas/boss_sapphiron.cpp | 350 --- .../scripts/zone/naxxramas/boss_thaddius.cpp | 143 - .../scripts/scripts/zone/naxxramas/def_naxxramas.h | 52 - .../scripts/zone/naxxramas/instance_naxxramas.cpp | 217 -- .../zone/nexus/eye_of_eternity/boss_malygos.cpp | 170 -- .../nexus/eye_of_eternity/def_eye_of_eternity.h | 4 - .../eye_of_eternity/instance_eye_of_eternity.cpp | 21 - .../scripts/zone/nexus/nexus/boss_anomalus.cpp | 302 -- .../scripts/zone/nexus/nexus/boss_keristrasza.cpp | 258 -- .../zone/nexus/nexus/boss_magus_telestra.cpp | 317 -- .../scripts/zone/nexus/nexus/boss_ormorok.cpp | 311 -- .../scripts/zone/nexus/nexus/commander_kolurg.cpp | 57 - .../zone/nexus/nexus/commander_stoutbeard.cpp | 63 - .../scripts/scripts/zone/nexus/nexus/def_nexus.h | 19 - .../scripts/zone/nexus/nexus/instance_nexus.cpp | 258 -- .../scripts/zone/nexus/oculus/boss_drakos.cpp | 82 - .../scripts/zone/nexus/oculus/boss_eregos.cpp | 104 - .../scripts/zone/nexus/oculus/boss_urom.cpp | 87 - .../scripts/zone/nexus/oculus/boss_varos.cpp | 85 - .../scripts/scripts/zone/nexus/oculus/def_oculus.h | 4 - .../scripts/zone/nexus/oculus/instance_oculus.cpp | 21 - .../zone/obsidian_sanctum/boss_sartharion.cpp | 1153 -------- .../zone/obsidian_sanctum/def_obsidian_sanctum.h | 20 - .../obsidian_sanctum/instance_obsidian_sanctum.cpp | 97 - .../zone/tempest_keep/arcatraz/arcatraz.cpp | 521 ---- .../arcatraz/boss_harbinger_skyriss.cpp | 312 -- .../zone/tempest_keep/arcatraz/def_arcatraz.h | 21 - .../tempest_keep/arcatraz/instance_arcatraz.cpp | 238 -- .../botanica/boss_high_botanist_freywinn.cpp | 199 -- .../zone/tempest_keep/botanica/boss_laj.cpp | 205 -- .../tempest_keep/botanica/boss_warp_splinter.cpp | 226 -- .../zone/tempest_keep/the_eye/boss_alar.cpp | 525 ---- .../zone/tempest_keep/the_eye/boss_astromancer.cpp | 474 --- .../zone/tempest_keep/the_eye/boss_kaelthas.cpp | 1515 ---------- .../zone/tempest_keep/the_eye/boss_void_reaver.cpp | 185 -- .../zone/tempest_keep/the_eye/def_the_eye.h | 20 - .../zone/tempest_keep/the_eye/instance_the_eye.cpp | 176 -- .../scripts/zone/tempest_keep/the_eye/the_eye.cpp | 99 - .../the_mechanar/boss_gatewatcher_gyrokill.cpp | 38 - .../the_mechanar/boss_gatewatcher_ironhand.cpp | 148 - .../the_mechanar/boss_nethermancer_sepethrea.cpp | 258 -- .../the_mechanar/boss_pathaleon_the_calculator.cpp | 257 -- .../zone/tempest_keep/the_mechanar/def_mechanar.h | 6 - .../the_mechanar/instance_mechanar.cpp | 87 - .../ulduar/halls_of_lightning/boss_bjarngrim.cpp | 440 --- .../zone/ulduar/halls_of_lightning/boss_ionar.cpp | 399 --- .../zone/ulduar/halls_of_lightning/boss_loken.cpp | 253 -- .../ulduar/halls_of_lightning/boss_volkhan.cpp | 494 ---- .../halls_of_lightning/def_halls_of_lightning.h | 34 - .../instance_halls_of_lightning.cpp | 194 -- .../zone/ulduar/halls_of_stone/boss_krystallus.cpp | 73 - .../ulduar/halls_of_stone/boss_maiden_of_grief.cpp | 81 - .../zone/ulduar/halls_of_stone/boss_sjonnir.cpp | 83 - .../ulduar/halls_of_stone/def_halls_of_stone.h | 4 - .../halls_of_stone/instance_halls_of_stone.cpp | 21 - .../scripts/zone/ulduar/ulduar/boss_algalon.cpp | 20 - .../zone/ulduar/ulduar/boss_assembly_of_iron.cpp | 20 - .../scripts/zone/ulduar/ulduar/boss_auriaya.cpp | 91 - .../zone/ulduar/ulduar/boss_flame_leviathan.cpp | 306 -- .../scripts/zone/ulduar/ulduar/boss_freya.cpp | 20 - .../zone/ulduar/ulduar/boss_general_vezax.cpp | 20 - .../scripts/zone/ulduar/ulduar/boss_hodir.cpp | 20 - .../scripts/zone/ulduar/ulduar/boss_ignis.cpp | 102 - .../scripts/zone/ulduar/ulduar/boss_kologarn.cpp | 20 - .../scripts/zone/ulduar/ulduar/boss_mimiron.cpp | 20 - .../scripts/zone/ulduar/ulduar/boss_razorscale.cpp | 300 -- .../scripts/zone/ulduar/ulduar/boss_thorim.cpp | 20 - .../scripts/zone/ulduar/ulduar/boss_xt002.cpp | 90 - .../scripts/zone/ulduar/ulduar/boss_yoggsaron.cpp | 20 - .../scripts/zone/ulduar/ulduar/def_ulduar.h | 41 - .../scripts/zone/ulduar/ulduar/instance_ulduar.cpp | 20 - .../utgarde_keep/boss_ingvar_the_plunderer.cpp | 459 --- .../utgarde_keep/utgarde_keep/boss_keleseth.cpp | 365 --- .../utgarde_keep/boss_skarvald_dalronn.cpp | 397 --- .../utgarde_keep/utgarde_keep/def_utgarde_keep.h | 35 - .../utgarde_keep/instance_utgarde_keep.cpp | 291 -- .../utgarde_keep/utgarde_keep/utgarde_keep.cpp | 160 - .../utgarde_pinnacle/boss_palehoof.cpp | 78 - .../utgarde_keep/utgarde_pinnacle/boss_skadi.cpp | 89 - .../utgarde_keep/utgarde_pinnacle/boss_svala.cpp | 83 - .../utgarde_keep/utgarde_pinnacle/boss_ymiron.cpp | 85 - .../utgarde_keep/utgarde_pinnacle/def_pinnacle.h | 4 - .../utgarde_pinnacle/instance_pinnacle.cpp | 21 - .../zone/vault_of_archavon/boss_archavon.cpp | 199 -- .../scripts/zone/vault_of_archavon/boss_emalon.cpp | 275 -- .../zone/vault_of_archavon/def_vault_of_archavon.h | 8 - .../instance_vault_of_archavon.cpp | 124 - .../scripts/zone/violet_hold/boss_cyanigosa.cpp | 82 - .../scripts/zone/violet_hold/boss_erekem.cpp | 82 - .../scripts/zone/violet_hold/boss_ichoron.cpp | 81 - .../scripts/zone/violet_hold/boss_lavanthor.cpp | 52 - .../scripts/zone/violet_hold/boss_moragg.cpp | 50 - .../scripts/zone/violet_hold/boss_xevozz.cpp | 82 - .../scripts/zone/violet_hold/boss_zuramat.cpp | 82 - .../scripts/zone/violet_hold/def_violet_hold.h | 4 - .../zone/violet_hold/instance_violet_hold.cpp | 21 - .../scripts/zone/wintergrasp/wintergrasp.cpp | 60 - src/bindings/scripts/system/ScriptLoader.cpp | 426 +-- 403 files changed, 43405 insertions(+), 45227 deletions(-) create mode 100644 src/bindings/scripts/scripts/northrend/azjol_nerub/ahnkahet/boss_amanitar.cpp create mode 100644 src/bindings/scripts/scripts/northrend/azjol_nerub/ahnkahet/boss_elder_nadox.cpp create mode 100644 src/bindings/scripts/scripts/northrend/azjol_nerub/ahnkahet/boss_herald_volazj.cpp create mode 100644 src/bindings/scripts/scripts/northrend/azjol_nerub/ahnkahet/boss_jedoga_shadowseeker.cpp create mode 100644 src/bindings/scripts/scripts/northrend/azjol_nerub/ahnkahet/boss_prince_taldaram.cpp create mode 100644 src/bindings/scripts/scripts/northrend/azjol_nerub/ahnkahet/def_ahnkahet.h create mode 100644 src/bindings/scripts/scripts/northrend/azjol_nerub/ahnkahet/instance_ahnkahet.cpp create mode 100644 src/bindings/scripts/scripts/northrend/azjol_nerub/azjol_nerub/boss_anubarak.cpp create mode 100644 src/bindings/scripts/scripts/northrend/azjol_nerub/azjol_nerub/boss_hadronox.cpp create mode 100644 src/bindings/scripts/scripts/northrend/azjol_nerub/azjol_nerub/boss_krikthir_the_gatewatcher.cpp create mode 100644 src/bindings/scripts/scripts/northrend/azjol_nerub/azjol_nerub/def_azjol_nerub.h create mode 100644 src/bindings/scripts/scripts/northrend/azjol_nerub/azjol_nerub/instance_azjol_nerub.cpp create mode 100644 src/bindings/scripts/scripts/northrend/draktharon_keep/boss_dred.cpp create mode 100644 src/bindings/scripts/scripts/northrend/draktharon_keep/boss_novos.cpp create mode 100644 src/bindings/scripts/scripts/northrend/draktharon_keep/boss_tharon_ja.cpp create mode 100644 src/bindings/scripts/scripts/northrend/draktharon_keep/boss_trollgore.cpp create mode 100644 src/bindings/scripts/scripts/northrend/draktharon_keep/def_drak_tharon_keep.h create mode 100644 src/bindings/scripts/scripts/northrend/draktharon_keep/instance_drak_tharon_keep.cpp create mode 100644 src/bindings/scripts/scripts/northrend/gundrak/boss_drakkari_colossus.cpp create mode 100644 src/bindings/scripts/scripts/northrend/gundrak/boss_eck.cpp create mode 100644 src/bindings/scripts/scripts/northrend/gundrak/boss_gal_darah.cpp create mode 100644 src/bindings/scripts/scripts/northrend/gundrak/boss_moorabi.cpp create mode 100644 src/bindings/scripts/scripts/northrend/gundrak/boss_slad_ran.cpp create mode 100644 src/bindings/scripts/scripts/northrend/gundrak/def_gundrak.h create mode 100644 src/bindings/scripts/scripts/northrend/gundrak/instance_gundrak.cpp create mode 100644 src/bindings/scripts/scripts/northrend/naxxramas/boss_anubrekhan.cpp create mode 100644 src/bindings/scripts/scripts/northrend/naxxramas/boss_faerlina.cpp create mode 100644 src/bindings/scripts/scripts/northrend/naxxramas/boss_four_horsemen.cpp create mode 100644 src/bindings/scripts/scripts/northrend/naxxramas/boss_gluth.cpp create mode 100644 src/bindings/scripts/scripts/northrend/naxxramas/boss_gothik.cpp create mode 100644 src/bindings/scripts/scripts/northrend/naxxramas/boss_grobbulus.cpp create mode 100644 src/bindings/scripts/scripts/northrend/naxxramas/boss_heigan.cpp create mode 100644 src/bindings/scripts/scripts/northrend/naxxramas/boss_highlord_mograine.cpp create mode 100644 src/bindings/scripts/scripts/northrend/naxxramas/boss_kelthuzad.cpp create mode 100644 src/bindings/scripts/scripts/northrend/naxxramas/boss_loatheb.cpp create mode 100644 src/bindings/scripts/scripts/northrend/naxxramas/boss_maexxna.cpp create mode 100644 src/bindings/scripts/scripts/northrend/naxxramas/boss_noth.cpp create mode 100644 src/bindings/scripts/scripts/northrend/naxxramas/boss_patchwerk.cpp create mode 100644 src/bindings/scripts/scripts/northrend/naxxramas/boss_razuvious.cpp create mode 100644 src/bindings/scripts/scripts/northrend/naxxramas/boss_sapphiron.cpp create mode 100644 src/bindings/scripts/scripts/northrend/naxxramas/boss_thaddius.cpp create mode 100644 src/bindings/scripts/scripts/northrend/naxxramas/def_naxxramas.h create mode 100644 src/bindings/scripts/scripts/northrend/naxxramas/instance_naxxramas.cpp create mode 100644 src/bindings/scripts/scripts/northrend/nexus/eye_of_eternity/boss_malygos.cpp create mode 100644 src/bindings/scripts/scripts/northrend/nexus/eye_of_eternity/def_eye_of_eternity.h create mode 100644 src/bindings/scripts/scripts/northrend/nexus/eye_of_eternity/instance_eye_of_eternity.cpp create mode 100644 src/bindings/scripts/scripts/northrend/nexus/nexus/boss_anomalus.cpp create mode 100644 src/bindings/scripts/scripts/northrend/nexus/nexus/boss_keristrasza.cpp create mode 100644 src/bindings/scripts/scripts/northrend/nexus/nexus/boss_magus_telestra.cpp create mode 100644 src/bindings/scripts/scripts/northrend/nexus/nexus/boss_ormorok.cpp create mode 100644 src/bindings/scripts/scripts/northrend/nexus/nexus/commander_kolurg.cpp create mode 100644 src/bindings/scripts/scripts/northrend/nexus/nexus/commander_stoutbeard.cpp create mode 100644 src/bindings/scripts/scripts/northrend/nexus/nexus/def_nexus.h create mode 100644 src/bindings/scripts/scripts/northrend/nexus/nexus/instance_nexus.cpp create mode 100644 src/bindings/scripts/scripts/northrend/nexus/oculus/boss_drakos.cpp create mode 100644 src/bindings/scripts/scripts/northrend/nexus/oculus/boss_eregos.cpp create mode 100644 src/bindings/scripts/scripts/northrend/nexus/oculus/boss_urom.cpp create mode 100644 src/bindings/scripts/scripts/northrend/nexus/oculus/boss_varos.cpp create mode 100644 src/bindings/scripts/scripts/northrend/nexus/oculus/def_oculus.h create mode 100644 src/bindings/scripts/scripts/northrend/nexus/oculus/instance_oculus.cpp create mode 100644 src/bindings/scripts/scripts/northrend/obsidian_sanctum/boss_sartharion.cpp create mode 100644 src/bindings/scripts/scripts/northrend/obsidian_sanctum/def_obsidian_sanctum.h create mode 100644 src/bindings/scripts/scripts/northrend/obsidian_sanctum/instance_obsidian_sanctum.cpp create mode 100644 src/bindings/scripts/scripts/northrend/ulduar/halls_of_lightning/boss_bjarngrim.cpp create mode 100644 src/bindings/scripts/scripts/northrend/ulduar/halls_of_lightning/boss_ionar.cpp create mode 100644 src/bindings/scripts/scripts/northrend/ulduar/halls_of_lightning/boss_loken.cpp create mode 100644 src/bindings/scripts/scripts/northrend/ulduar/halls_of_lightning/boss_volkhan.cpp create mode 100644 src/bindings/scripts/scripts/northrend/ulduar/halls_of_lightning/def_halls_of_lightning.h create mode 100644 src/bindings/scripts/scripts/northrend/ulduar/halls_of_lightning/instance_halls_of_lightning.cpp create mode 100644 src/bindings/scripts/scripts/northrend/ulduar/halls_of_stone/boss_krystallus.cpp create mode 100644 src/bindings/scripts/scripts/northrend/ulduar/halls_of_stone/boss_maiden_of_grief.cpp create mode 100644 src/bindings/scripts/scripts/northrend/ulduar/halls_of_stone/boss_sjonnir.cpp create mode 100644 src/bindings/scripts/scripts/northrend/ulduar/halls_of_stone/def_halls_of_stone.h create mode 100644 src/bindings/scripts/scripts/northrend/ulduar/halls_of_stone/instance_halls_of_stone.cpp create mode 100644 src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_algalon.cpp create mode 100644 src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_assembly_of_iron.cpp create mode 100644 src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_auriaya.cpp create mode 100644 src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_flame_leviathan.cpp create mode 100644 src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_freya.cpp create mode 100644 src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_general_vezax.cpp create mode 100644 src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_hodir.cpp create mode 100644 src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_ignis.cpp create mode 100644 src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_kologarn.cpp create mode 100644 src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_mimiron.cpp create mode 100644 src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_razorscale.cpp create mode 100644 src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_thorim.cpp create mode 100644 src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_xt002.cpp create mode 100644 src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_yoggsaron.cpp create mode 100644 src/bindings/scripts/scripts/northrend/ulduar/ulduar/def_ulduar.h create mode 100644 src/bindings/scripts/scripts/northrend/ulduar/ulduar/instance_ulduar.cpp create mode 100644 src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_keep/boss_ingvar_the_plunderer.cpp create mode 100644 src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_keep/boss_keleseth.cpp create mode 100644 src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_keep/boss_skarvald_dalronn.cpp create mode 100644 src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_keep/def_utgarde_keep.h create mode 100644 src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_keep/instance_utgarde_keep.cpp create mode 100644 src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_keep/utgarde_keep.cpp create mode 100644 src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_palehoof.cpp create mode 100644 src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_skadi.cpp create mode 100644 src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_svala.cpp create mode 100644 src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_ymiron.cpp create mode 100644 src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_pinnacle/def_pinnacle.h create mode 100644 src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_pinnacle/instance_pinnacle.cpp create mode 100644 src/bindings/scripts/scripts/northrend/vault_of_archavon/boss_archavon.cpp create mode 100644 src/bindings/scripts/scripts/northrend/vault_of_archavon/boss_emalon.cpp create mode 100644 src/bindings/scripts/scripts/northrend/vault_of_archavon/def_vault_of_archavon.h create mode 100644 src/bindings/scripts/scripts/northrend/vault_of_archavon/instance_vault_of_archavon.cpp create mode 100644 src/bindings/scripts/scripts/northrend/violet_hold/boss_cyanigosa.cpp create mode 100644 src/bindings/scripts/scripts/northrend/violet_hold/boss_erekem.cpp create mode 100644 src/bindings/scripts/scripts/northrend/violet_hold/boss_ichoron.cpp create mode 100644 src/bindings/scripts/scripts/northrend/violet_hold/boss_lavanthor.cpp create mode 100644 src/bindings/scripts/scripts/northrend/violet_hold/boss_moragg.cpp create mode 100644 src/bindings/scripts/scripts/northrend/violet_hold/boss_xevozz.cpp create mode 100644 src/bindings/scripts/scripts/northrend/violet_hold/boss_zuramat.cpp create mode 100644 src/bindings/scripts/scripts/northrend/violet_hold/def_violet_hold.h create mode 100644 src/bindings/scripts/scripts/northrend/violet_hold/instance_violet_hold.cpp create mode 100644 src/bindings/scripts/scripts/northrend/wintergrasp.cpp create mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/auchenai_crypts/boss_exarch_maladaar.cpp create mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp create mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp create mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/mana_tombs/boss_pandemonius.cpp create mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/boss_darkweaver_syth.cpp create mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/boss_tailonking_ikiss.cpp create mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/def_sethekk_halls.h create mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/instance_sethekk_halls.cpp create mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp create mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp create mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp create mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_murmur.cpp create mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/def_shadow_labyrinth.h create mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp create mode 100644 src/bindings/scripts/scripts/outland/black_temple/black_temple.cpp create mode 100644 src/bindings/scripts/scripts/outland/black_temple/boss_bloodboil.cpp create mode 100644 src/bindings/scripts/scripts/outland/black_temple/boss_illidan.cpp create mode 100644 src/bindings/scripts/scripts/outland/black_temple/boss_mother_shahraz.cpp create mode 100644 src/bindings/scripts/scripts/outland/black_temple/boss_reliquary_of_souls.cpp create mode 100644 src/bindings/scripts/scripts/outland/black_temple/boss_shade_of_akama.cpp create mode 100644 src/bindings/scripts/scripts/outland/black_temple/boss_supremus.cpp create mode 100644 src/bindings/scripts/scripts/outland/black_temple/boss_teron_gorefiend.cpp create mode 100644 src/bindings/scripts/scripts/outland/black_temple/boss_warlord_najentus.cpp create mode 100644 src/bindings/scripts/scripts/outland/black_temple/def_black_temple.h create mode 100644 src/bindings/scripts/scripts/outland/black_temple/illidari_council.cpp create mode 100644 src/bindings/scripts/scripts/outland/black_temple/instance_black_temple.cpp create mode 100644 src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/boss_fathomlord_karathress.cpp create mode 100644 src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/boss_hydross_the_unstable.cpp create mode 100644 src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/boss_lady_vashj.cpp create mode 100644 src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/boss_leotheras_the_blind.cpp create mode 100644 src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/boss_lurker_below.cpp create mode 100644 src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/boss_morogrim_tidewalker.cpp create mode 100644 src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/def_serpent_shrine.h create mode 100644 src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/instance_serpent_shrine.cpp create mode 100644 src/bindings/scripts/scripts/outland/coilfang_resevoir/steam_vault/boss_hydromancer_thespia.cpp create mode 100644 src/bindings/scripts/scripts/outland/coilfang_resevoir/steam_vault/boss_mekgineer_steamrigger.cpp create mode 100644 src/bindings/scripts/scripts/outland/coilfang_resevoir/steam_vault/boss_warlord_kalithresh.cpp create mode 100644 src/bindings/scripts/scripts/outland/coilfang_resevoir/steam_vault/def_steam_vault.h create mode 100644 src/bindings/scripts/scripts/outland/coilfang_resevoir/steam_vault/instance_steam_vault.cpp create mode 100644 src/bindings/scripts/scripts/outland/coilfang_resevoir/underbog/boss_hungarfen.cpp create mode 100644 src/bindings/scripts/scripts/outland/coilfang_resevoir/underbog/boss_the_black_stalker.cpp create mode 100644 src/bindings/scripts/scripts/outland/gruuls_lair/boss_gruul.cpp create mode 100644 src/bindings/scripts/scripts/outland/gruuls_lair/boss_high_king_maulgar.cpp create mode 100644 src/bindings/scripts/scripts/outland/gruuls_lair/def_gruuls_lair.h create mode 100644 src/bindings/scripts/scripts/outland/gruuls_lair/instance_gruuls_lair.cpp create mode 100644 src/bindings/scripts/scripts/outland/hellfire_citadel/blood_furnace/boss_broggok.cpp create mode 100644 src/bindings/scripts/scripts/outland/hellfire_citadel/blood_furnace/boss_kelidan_the_breaker.cpp create mode 100644 src/bindings/scripts/scripts/outland/hellfire_citadel/blood_furnace/boss_the_maker.cpp create mode 100644 src/bindings/scripts/scripts/outland/hellfire_citadel/blood_furnace/def_blood_furnace.h create mode 100644 src/bindings/scripts/scripts/outland/hellfire_citadel/blood_furnace/instance_blood_furnace.cpp create mode 100644 src/bindings/scripts/scripts/outland/hellfire_citadel/hellfire_ramparts/boss_omor_the_unscarred.cpp create mode 100644 src/bindings/scripts/scripts/outland/hellfire_citadel/hellfire_ramparts/boss_vazruden_the_herald.cpp create mode 100644 src/bindings/scripts/scripts/outland/hellfire_citadel/hellfire_ramparts/boss_watchkeeper_gargolmar.cpp create mode 100644 src/bindings/scripts/scripts/outland/hellfire_citadel/hellfire_ramparts/def_hellfire_ramparts.h create mode 100644 src/bindings/scripts/scripts/outland/hellfire_citadel/hellfire_ramparts/instance_hellfire_ramparts.cpp create mode 100644 src/bindings/scripts/scripts/outland/hellfire_citadel/magtheridons_lair/boss_magtheridon.cpp create mode 100644 src/bindings/scripts/scripts/outland/hellfire_citadel/magtheridons_lair/def_magtheridons_lair.h create mode 100644 src/bindings/scripts/scripts/outland/hellfire_citadel/magtheridons_lair/instance_magtheridons_lair.cpp create mode 100644 src/bindings/scripts/scripts/outland/hellfire_citadel/shattered_halls/boss_nethekurse.cpp create mode 100644 src/bindings/scripts/scripts/outland/hellfire_citadel/shattered_halls/boss_warbringer_omrogg.cpp create mode 100644 src/bindings/scripts/scripts/outland/hellfire_citadel/shattered_halls/boss_warchief_kargath_bladefist.cpp create mode 100644 src/bindings/scripts/scripts/outland/hellfire_citadel/shattered_halls/def_shattered_halls.h create mode 100644 src/bindings/scripts/scripts/outland/hellfire_citadel/shattered_halls/instance_shattered_halls.cpp create mode 100644 src/bindings/scripts/scripts/outland/tempest_keep/arcatraz/arcatraz.cpp create mode 100644 src/bindings/scripts/scripts/outland/tempest_keep/arcatraz/boss_harbinger_skyriss.cpp create mode 100644 src/bindings/scripts/scripts/outland/tempest_keep/arcatraz/def_arcatraz.h create mode 100644 src/bindings/scripts/scripts/outland/tempest_keep/arcatraz/instance_arcatraz.cpp create mode 100644 src/bindings/scripts/scripts/outland/tempest_keep/botanica/boss_high_botanist_freywinn.cpp create mode 100644 src/bindings/scripts/scripts/outland/tempest_keep/botanica/boss_laj.cpp create mode 100644 src/bindings/scripts/scripts/outland/tempest_keep/botanica/boss_warp_splinter.cpp create mode 100644 src/bindings/scripts/scripts/outland/tempest_keep/the_eye/boss_alar.cpp create mode 100644 src/bindings/scripts/scripts/outland/tempest_keep/the_eye/boss_astromancer.cpp create mode 100644 src/bindings/scripts/scripts/outland/tempest_keep/the_eye/boss_kaelthas.cpp create mode 100644 src/bindings/scripts/scripts/outland/tempest_keep/the_eye/boss_void_reaver.cpp create mode 100644 src/bindings/scripts/scripts/outland/tempest_keep/the_eye/def_the_eye.h create mode 100644 src/bindings/scripts/scripts/outland/tempest_keep/the_eye/instance_the_eye.cpp create mode 100644 src/bindings/scripts/scripts/outland/tempest_keep/the_eye/the_eye.cpp create mode 100644 src/bindings/scripts/scripts/outland/tempest_keep/the_mechanar/boss_gatewatcher_gyrokill.cpp create mode 100644 src/bindings/scripts/scripts/outland/tempest_keep/the_mechanar/boss_gatewatcher_ironhand.cpp create mode 100644 src/bindings/scripts/scripts/outland/tempest_keep/the_mechanar/boss_nethermancer_sepethrea.cpp create mode 100644 src/bindings/scripts/scripts/outland/tempest_keep/the_mechanar/boss_pathaleon_the_calculator.cpp create mode 100644 src/bindings/scripts/scripts/outland/tempest_keep/the_mechanar/def_mechanar.h create mode 100644 src/bindings/scripts/scripts/outland/tempest_keep/the_mechanar/instance_mechanar.cpp delete mode 100644 src/bindings/scripts/scripts/zone/aunchindoun/auchenai_crypts/boss_exarch_maladaar.cpp delete mode 100644 src/bindings/scripts/scripts/zone/aunchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp delete mode 100644 src/bindings/scripts/scripts/zone/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp delete mode 100644 src/bindings/scripts/scripts/zone/aunchindoun/mana_tombs/boss_pandemonius.cpp delete mode 100644 src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/boss_darkweaver_syth.cpp delete mode 100644 src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/boss_tailonking_ikiss.cpp delete mode 100644 src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/def_sethekk_halls.h delete mode 100644 src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/instance_sethekk_halls.cpp delete mode 100644 src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp delete mode 100644 src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp delete mode 100644 src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp delete mode 100644 src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_murmur.cpp delete mode 100644 src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/def_shadow_labyrinth.h delete mode 100644 src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp delete mode 100644 src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/boss_amanitar.cpp delete mode 100644 src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/boss_elder_nadox.cpp delete mode 100644 src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/boss_herald_volazj.cpp delete mode 100644 src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/boss_jedoga_shadowseeker.cpp delete mode 100644 src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/boss_prince_taldaram.cpp delete mode 100644 src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/def_ahnkahet.h delete mode 100644 src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/instance_ahnkahet.cpp delete mode 100644 src/bindings/scripts/scripts/zone/azjol_nerub/azjol_nerub/boss_anubarak.cpp delete mode 100644 src/bindings/scripts/scripts/zone/azjol_nerub/azjol_nerub/boss_hadronox.cpp delete mode 100644 src/bindings/scripts/scripts/zone/azjol_nerub/azjol_nerub/boss_krikthir_the_gatewatcher.cpp delete mode 100644 src/bindings/scripts/scripts/zone/azjol_nerub/azjol_nerub/def_azjol_nerub.h delete mode 100644 src/bindings/scripts/scripts/zone/azjol_nerub/azjol_nerub/instance_azjol_nerub.cpp delete mode 100644 src/bindings/scripts/scripts/zone/black_temple/.instance_black_temple.cpp-s8inyu delete mode 100644 src/bindings/scripts/scripts/zone/black_temple/black_temple.cpp delete mode 100644 src/bindings/scripts/scripts/zone/black_temple/boss_bloodboil.cpp delete mode 100644 src/bindings/scripts/scripts/zone/black_temple/boss_illidan.cpp delete mode 100644 src/bindings/scripts/scripts/zone/black_temple/boss_mother_shahraz.cpp delete mode 100644 src/bindings/scripts/scripts/zone/black_temple/boss_reliquary_of_souls.cpp delete mode 100644 src/bindings/scripts/scripts/zone/black_temple/boss_shade_of_akama.cpp delete mode 100644 src/bindings/scripts/scripts/zone/black_temple/boss_supremus.cpp delete mode 100644 src/bindings/scripts/scripts/zone/black_temple/boss_teron_gorefiend.cpp delete mode 100644 src/bindings/scripts/scripts/zone/black_temple/boss_warlord_najentus.cpp delete mode 100644 src/bindings/scripts/scripts/zone/black_temple/def_black_temple.h delete mode 100644 src/bindings/scripts/scripts/zone/black_temple/illidari_council.cpp delete mode 100644 src/bindings/scripts/scripts/zone/black_temple/instance_black_temple.cpp delete mode 100644 src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_fathomlord_karathress.cpp delete mode 100644 src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_hydross_the_unstable.cpp delete mode 100644 src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_lady_vashj.cpp delete mode 100644 src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_leotheras_the_blind.cpp delete mode 100644 src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_lurker_below.cpp delete mode 100644 src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_morogrim_tidewalker.cpp delete mode 100644 src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/def_serpent_shrine.h delete mode 100644 src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/instance_serpent_shrine.cpp delete mode 100644 src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/boss_hydromancer_thespia.cpp delete mode 100644 src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/boss_mekgineer_steamrigger.cpp delete mode 100644 src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/boss_warlord_kalithresh.cpp delete mode 100644 src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/def_steam_vault.h delete mode 100644 src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/instance_steam_vault.cpp delete mode 100644 src/bindings/scripts/scripts/zone/coilfang_resevoir/underbog/boss_hungarfen.cpp delete mode 100644 src/bindings/scripts/scripts/zone/coilfang_resevoir/underbog/boss_the_black_stalker.cpp delete mode 100644 src/bindings/scripts/scripts/zone/draktharon_keep/boss_dred.cpp delete mode 100644 src/bindings/scripts/scripts/zone/draktharon_keep/boss_novos.cpp delete mode 100644 src/bindings/scripts/scripts/zone/draktharon_keep/boss_tharon_ja.cpp delete mode 100644 src/bindings/scripts/scripts/zone/draktharon_keep/boss_trollgore.cpp delete mode 100644 src/bindings/scripts/scripts/zone/draktharon_keep/def_drak_tharon_keep.h delete mode 100644 src/bindings/scripts/scripts/zone/draktharon_keep/instance_drak_tharon_keep.cpp delete mode 100644 src/bindings/scripts/scripts/zone/gruuls_lair/boss_gruul.cpp delete mode 100644 src/bindings/scripts/scripts/zone/gruuls_lair/boss_high_king_maulgar.cpp delete mode 100644 src/bindings/scripts/scripts/zone/gruuls_lair/def_gruuls_lair.h delete mode 100644 src/bindings/scripts/scripts/zone/gruuls_lair/instance_gruuls_lair.cpp delete mode 100644 src/bindings/scripts/scripts/zone/gundrak/boss_drakkari_colossus.cpp delete mode 100644 src/bindings/scripts/scripts/zone/gundrak/boss_eck.cpp delete mode 100644 src/bindings/scripts/scripts/zone/gundrak/boss_gal_darah.cpp delete mode 100644 src/bindings/scripts/scripts/zone/gundrak/boss_moorabi.cpp delete mode 100644 src/bindings/scripts/scripts/zone/gundrak/boss_slad_ran.cpp delete mode 100644 src/bindings/scripts/scripts/zone/gundrak/def_gundrak.h delete mode 100644 src/bindings/scripts/scripts/zone/gundrak/instance_gundrak.cpp delete mode 100644 src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_broggok.cpp delete mode 100644 src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_kelidan_the_breaker.cpp delete mode 100644 src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_the_maker.cpp delete mode 100644 src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/def_blood_furnace.h delete mode 100644 src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/instance_blood_furnace.cpp delete mode 100644 src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/boss_omor_the_unscarred.cpp delete mode 100644 src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/boss_vazruden_the_herald.cpp delete mode 100644 src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/boss_watchkeeper_gargolmar.cpp delete mode 100644 src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/def_hellfire_ramparts.h delete mode 100644 src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/instance_hellfire_ramparts.cpp delete mode 100644 src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/boss_magtheridon.cpp delete mode 100644 src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/def_magtheridons_lair.h delete mode 100644 src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/instance_magtheridons_lair.cpp delete mode 100644 src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/boss_nethekurse.cpp delete mode 100644 src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/boss_warbringer_omrogg.cpp delete mode 100644 src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/boss_warchief_kargath_bladefist.cpp delete mode 100644 src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/def_shattered_halls.h delete mode 100644 src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/instance_shattered_halls.cpp delete mode 100644 src/bindings/scripts/scripts/zone/naxxramas/boss_anubrekhan.cpp delete mode 100644 src/bindings/scripts/scripts/zone/naxxramas/boss_faerlina.cpp delete mode 100644 src/bindings/scripts/scripts/zone/naxxramas/boss_four_horsemen.cpp delete mode 100644 src/bindings/scripts/scripts/zone/naxxramas/boss_gluth.cpp delete mode 100644 src/bindings/scripts/scripts/zone/naxxramas/boss_gothik.cpp delete mode 100644 src/bindings/scripts/scripts/zone/naxxramas/boss_grobbulus.cpp delete mode 100644 src/bindings/scripts/scripts/zone/naxxramas/boss_heigan.cpp delete mode 100644 src/bindings/scripts/scripts/zone/naxxramas/boss_highlord_mograine.cpp delete mode 100644 src/bindings/scripts/scripts/zone/naxxramas/boss_kelthuzad.cpp delete mode 100644 src/bindings/scripts/scripts/zone/naxxramas/boss_loatheb.cpp delete mode 100644 src/bindings/scripts/scripts/zone/naxxramas/boss_maexxna.cpp delete mode 100644 src/bindings/scripts/scripts/zone/naxxramas/boss_noth.cpp delete mode 100644 src/bindings/scripts/scripts/zone/naxxramas/boss_patchwerk.cpp delete mode 100644 src/bindings/scripts/scripts/zone/naxxramas/boss_razuvious.cpp delete mode 100644 src/bindings/scripts/scripts/zone/naxxramas/boss_sapphiron.cpp delete mode 100644 src/bindings/scripts/scripts/zone/naxxramas/boss_thaddius.cpp delete mode 100644 src/bindings/scripts/scripts/zone/naxxramas/def_naxxramas.h delete mode 100644 src/bindings/scripts/scripts/zone/naxxramas/instance_naxxramas.cpp delete mode 100644 src/bindings/scripts/scripts/zone/nexus/eye_of_eternity/boss_malygos.cpp delete mode 100644 src/bindings/scripts/scripts/zone/nexus/eye_of_eternity/def_eye_of_eternity.h delete mode 100644 src/bindings/scripts/scripts/zone/nexus/eye_of_eternity/instance_eye_of_eternity.cpp delete mode 100644 src/bindings/scripts/scripts/zone/nexus/nexus/boss_anomalus.cpp delete mode 100644 src/bindings/scripts/scripts/zone/nexus/nexus/boss_keristrasza.cpp delete mode 100644 src/bindings/scripts/scripts/zone/nexus/nexus/boss_magus_telestra.cpp delete mode 100644 src/bindings/scripts/scripts/zone/nexus/nexus/boss_ormorok.cpp delete mode 100644 src/bindings/scripts/scripts/zone/nexus/nexus/commander_kolurg.cpp delete mode 100644 src/bindings/scripts/scripts/zone/nexus/nexus/commander_stoutbeard.cpp delete mode 100644 src/bindings/scripts/scripts/zone/nexus/nexus/def_nexus.h delete mode 100644 src/bindings/scripts/scripts/zone/nexus/nexus/instance_nexus.cpp delete mode 100644 src/bindings/scripts/scripts/zone/nexus/oculus/boss_drakos.cpp delete mode 100644 src/bindings/scripts/scripts/zone/nexus/oculus/boss_eregos.cpp delete mode 100644 src/bindings/scripts/scripts/zone/nexus/oculus/boss_urom.cpp delete mode 100644 src/bindings/scripts/scripts/zone/nexus/oculus/boss_varos.cpp delete mode 100644 src/bindings/scripts/scripts/zone/nexus/oculus/def_oculus.h delete mode 100644 src/bindings/scripts/scripts/zone/nexus/oculus/instance_oculus.cpp delete mode 100644 src/bindings/scripts/scripts/zone/obsidian_sanctum/boss_sartharion.cpp delete mode 100644 src/bindings/scripts/scripts/zone/obsidian_sanctum/def_obsidian_sanctum.h delete mode 100644 src/bindings/scripts/scripts/zone/obsidian_sanctum/instance_obsidian_sanctum.cpp delete mode 100644 src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/arcatraz.cpp delete mode 100644 src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/boss_harbinger_skyriss.cpp delete mode 100644 src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/def_arcatraz.h delete mode 100644 src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/instance_arcatraz.cpp delete mode 100644 src/bindings/scripts/scripts/zone/tempest_keep/botanica/boss_high_botanist_freywinn.cpp delete mode 100644 src/bindings/scripts/scripts/zone/tempest_keep/botanica/boss_laj.cpp delete mode 100644 src/bindings/scripts/scripts/zone/tempest_keep/botanica/boss_warp_splinter.cpp delete mode 100644 src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_alar.cpp delete mode 100644 src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_astromancer.cpp delete mode 100644 src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_kaelthas.cpp delete mode 100644 src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_void_reaver.cpp delete mode 100644 src/bindings/scripts/scripts/zone/tempest_keep/the_eye/def_the_eye.h delete mode 100644 src/bindings/scripts/scripts/zone/tempest_keep/the_eye/instance_the_eye.cpp delete mode 100644 src/bindings/scripts/scripts/zone/tempest_keep/the_eye/the_eye.cpp delete mode 100644 src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_gatewatcher_gyrokill.cpp delete mode 100644 src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_gatewatcher_ironhand.cpp delete mode 100644 src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_nethermancer_sepethrea.cpp delete mode 100644 src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_pathaleon_the_calculator.cpp delete mode 100644 src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/def_mechanar.h delete mode 100644 src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/instance_mechanar.cpp delete mode 100644 src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/boss_bjarngrim.cpp delete mode 100644 src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/boss_ionar.cpp delete mode 100644 src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/boss_loken.cpp delete mode 100644 src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/boss_volkhan.cpp delete mode 100644 src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/def_halls_of_lightning.h delete mode 100644 src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/instance_halls_of_lightning.cpp delete mode 100644 src/bindings/scripts/scripts/zone/ulduar/halls_of_stone/boss_krystallus.cpp delete mode 100644 src/bindings/scripts/scripts/zone/ulduar/halls_of_stone/boss_maiden_of_grief.cpp delete mode 100644 src/bindings/scripts/scripts/zone/ulduar/halls_of_stone/boss_sjonnir.cpp delete mode 100644 src/bindings/scripts/scripts/zone/ulduar/halls_of_stone/def_halls_of_stone.h delete mode 100644 src/bindings/scripts/scripts/zone/ulduar/halls_of_stone/instance_halls_of_stone.cpp delete mode 100644 src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_algalon.cpp delete mode 100644 src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_assembly_of_iron.cpp delete mode 100644 src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_auriaya.cpp delete mode 100644 src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_flame_leviathan.cpp delete mode 100644 src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_freya.cpp delete mode 100644 src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_general_vezax.cpp delete mode 100644 src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_hodir.cpp delete mode 100644 src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_ignis.cpp delete mode 100644 src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_kologarn.cpp delete mode 100644 src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_mimiron.cpp delete mode 100644 src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_razorscale.cpp delete mode 100644 src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_thorim.cpp delete mode 100644 src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_xt002.cpp delete mode 100644 src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_yoggsaron.cpp delete mode 100644 src/bindings/scripts/scripts/zone/ulduar/ulduar/def_ulduar.h delete mode 100644 src/bindings/scripts/scripts/zone/ulduar/ulduar/instance_ulduar.cpp delete mode 100644 src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/boss_ingvar_the_plunderer.cpp delete mode 100644 src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/boss_keleseth.cpp delete mode 100644 src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/boss_skarvald_dalronn.cpp delete mode 100644 src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/def_utgarde_keep.h delete mode 100644 src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/instance_utgarde_keep.cpp delete mode 100644 src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/utgarde_keep.cpp delete mode 100644 src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/boss_palehoof.cpp delete mode 100644 src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/boss_skadi.cpp delete mode 100644 src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/boss_svala.cpp delete mode 100644 src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/boss_ymiron.cpp delete mode 100644 src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/def_pinnacle.h delete mode 100644 src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/instance_pinnacle.cpp delete mode 100644 src/bindings/scripts/scripts/zone/vault_of_archavon/boss_archavon.cpp delete mode 100644 src/bindings/scripts/scripts/zone/vault_of_archavon/boss_emalon.cpp delete mode 100644 src/bindings/scripts/scripts/zone/vault_of_archavon/def_vault_of_archavon.h delete mode 100644 src/bindings/scripts/scripts/zone/vault_of_archavon/instance_vault_of_archavon.cpp delete mode 100644 src/bindings/scripts/scripts/zone/violet_hold/boss_cyanigosa.cpp delete mode 100644 src/bindings/scripts/scripts/zone/violet_hold/boss_erekem.cpp delete mode 100644 src/bindings/scripts/scripts/zone/violet_hold/boss_ichoron.cpp delete mode 100644 src/bindings/scripts/scripts/zone/violet_hold/boss_lavanthor.cpp delete mode 100644 src/bindings/scripts/scripts/zone/violet_hold/boss_moragg.cpp delete mode 100644 src/bindings/scripts/scripts/zone/violet_hold/boss_xevozz.cpp delete mode 100644 src/bindings/scripts/scripts/zone/violet_hold/boss_zuramat.cpp delete mode 100644 src/bindings/scripts/scripts/zone/violet_hold/def_violet_hold.h delete mode 100644 src/bindings/scripts/scripts/zone/violet_hold/instance_violet_hold.cpp delete mode 100644 src/bindings/scripts/scripts/zone/wintergrasp/wintergrasp.cpp (limited to 'src/bindings/scripts/system/ScriptLoader.cpp') diff --git a/src/bindings/scripts/CMakeLists.txt b/src/bindings/scripts/CMakeLists.txt index b83b2f09f58..0ea35a6b201 100644 --- a/src/bindings/scripts/CMakeLists.txt +++ b/src/bindings/scripts/CMakeLists.txt @@ -281,12 +281,210 @@ SET(trinityscript_LIB_SRCS scripts/kalimdor/thunder_bluff.cpp scripts/kalimdor/ungoro_crater.cpp scripts/kalimdor/winterspring.cpp + scripts/northrend/azjol_nerub/azjol_nerub/instance_azjol_nerub.cpp + scripts/northrend/azjol_nerub/azjol_nerub/boss_krikthir_the_gatewatcher.cpp + scripts/northrend/azjol_nerub/azjol_nerub/boss_hadronox.cpp + scripts/northrend/azjol_nerub/azjol_nerub/boss_anubarak.cpp + scripts/northrend/azjol_nerub/azjol_nerub/def_azjol_nerub.h + scripts/northrend/azjol_nerub/ahnkahet/instance_ahnkahet.cpp + scripts/northrend/azjol_nerub/ahnkahet/boss_prince_taldaram.cpp + scripts/northrend/azjol_nerub/ahnkahet/boss_elder_nadox.cpp + scripts/northrend/azjol_nerub/ahnkahet/boss_jedoga_shadowseeker.cpp + scripts/northrend/azjol_nerub/ahnkahet/boss_herald_volazj.cpp + scripts/northrend/azjol_nerub/ahnkahet/boss_amanitar.cpp + scripts/northrend/azjol_nerub/ahnkahet/def_ahnkahet.h + scripts/northrend/draktharon_keep/instance_drak_tharon_keep.cpp + scripts/northrend/draktharon_keep/boss_trollgore.cpp + scripts/northrend/draktharon_keep/boss_novos.cpp + scripts/northrend/draktharon_keep/boss_dred.cpp + scripts/northrend/draktharon_keep/boss_tharon_ja.cpp + scripts/northrend/draktharon_keep/def_drak_tharon_keep.h + scripts/northrend/gundrak/instance_gundrak.cpp + scripts/northrend/gundrak/boss_slad_ran.cpp + scripts/northrend/gundrak/boss_moorabi.cpp + scripts/northrend/gundrak/boss_drakkari_colossus.cpp + scripts/northrend/gundrak/boss_gal_darah.cpp + scripts/northrend/gundrak/boss_eck.cpp + scripts/northrend/gundrak/def_gundrak.h + scripts/northrend/naxxramas/boss_anubrekhan.cpp + scripts/northrend/naxxramas/boss_faerlina.cpp + scripts/northrend/naxxramas/boss_gluth.cpp + scripts/northrend/naxxramas/boss_gothik.cpp + scripts/northrend/naxxramas/boss_grobbulus.cpp + scripts/northrend/naxxramas/boss_heigan.cpp + scripts/northrend/naxxramas/boss_kelthuzad.cpp + scripts/northrend/naxxramas/boss_four_horsemen.cpp + scripts/northrend/naxxramas/boss_loatheb.cpp + scripts/northrend/naxxramas/boss_maexxna.cpp + scripts/northrend/naxxramas/boss_noth.cpp + scripts/northrend/naxxramas/boss_patchwerk.cpp + scripts/northrend/naxxramas/boss_razuvious.cpp + scripts/northrend/naxxramas/boss_sapphiron.cpp + scripts/northrend/naxxramas/boss_thaddius.cpp + scripts/northrend/naxxramas/def_naxxramas.h + scripts/northrend/naxxramas/instance_naxxramas.cpp + scripts/northrend/nexus/eye_of_eternity/instance_eye_of_eternity.cpp + scripts/northrend/nexus/eye_of_eternity/boss_malygos.cpp + scripts/northrend/nexus/eye_of_eternity/def_eye_of_eternity.h + scripts/northrend/nexus/nexus/instance_nexus.cpp + scripts/northrend/nexus/nexus/boss_magus_telestra.cpp + scripts/northrend/nexus/nexus/boss_anomalus.cpp + scripts/northrend/nexus/nexus/boss_ormorok.cpp + scripts/northrend/nexus/nexus/boss_keristrasza.cpp + scripts/northrend/nexus/nexus/commander_stoutbeard.cpp + scripts/northrend/nexus/nexus/commander_kolurg.cpp + scripts/northrend/nexus/nexus/def_nexus.h + scripts/northrend/nexus/oculus/instance_oculus.cpp + scripts/northrend/nexus/oculus/boss_drakos.cpp + scripts/northrend/nexus/oculus/boss_urom.cpp + scripts/northrend/nexus/oculus/boss_varos.cpp + scripts/northrend/nexus/oculus/boss_eregos.cpp + scripts/northrend/nexus/oculus/def_oculus.h + scripts/northrend/obsidian_sanctum/instance_obsidian_sanctum.cpp + scripts/northrend/obsidian_sanctum/boss_sartharion.cpp + scripts/northrend/obsidian_sanctum/def_obsidian_sanctum.h + scripts/northrend/ulduar/halls_of_stone/instance_halls_of_stone.cpp + scripts/northrend/ulduar/halls_of_stone/boss_maiden_of_grief.cpp + scripts/northrend/ulduar/halls_of_stone/boss_krystallus.cpp + scripts/northrend/ulduar/halls_of_stone/boss_sjonnir.cpp + scripts/northrend/ulduar/halls_of_stone/def_halls_of_stone.h + scripts/northrend/ulduar/halls_of_lightning/instance_halls_of_lightning.cpp + scripts/northrend/ulduar/halls_of_lightning/boss_bjarngrim.cpp + scripts/northrend/ulduar/halls_of_lightning/boss_ionar.cpp + scripts/northrend/ulduar/halls_of_lightning/boss_volkhan.cpp + scripts/northrend/ulduar/halls_of_lightning/boss_loken.cpp + scripts/northrend/ulduar/halls_of_lightning/def_halls_of_lightning.h + scripts/northrend/ulduar/ulduar/boss_algalon.cpp + scripts/northrend/ulduar/ulduar/boss_assembly_of_iron.cpp + scripts/northrend/ulduar/ulduar/boss_auriaya.cpp + scripts/northrend/ulduar/ulduar/boss_flame_leviathan.cpp + scripts/northrend/ulduar/ulduar/boss_freya.cpp + scripts/northrend/ulduar/ulduar/boss_general_vezax.cpp + scripts/northrend/ulduar/ulduar/boss_hodir.cpp + scripts/northrend/ulduar/ulduar/boss_ignis.cpp + scripts/northrend/ulduar/ulduar/boss_kologarn.cpp + scripts/northrend/ulduar/ulduar/boss_mimiron.cpp + scripts/northrend/ulduar/ulduar/boss_razorscale.cpp + scripts/northrend/ulduar/ulduar/boss_thorim.cpp + scripts/northrend/ulduar/ulduar/boss_xt002.cpp + scripts/northrend/ulduar/ulduar/boss_yoggsaron.cpp + scripts/northrend/ulduar/ulduar/def_ulduar.h + scripts/northrend/ulduar/ulduar/instance_ulduar.cpp + scripts/northrend/utgarde_keep/utgarde_keep/instance_utgarde_keep.cpp + scripts/northrend/utgarde_keep/utgarde_keep/boss_keleseth.cpp + scripts/northrend/utgarde_keep/utgarde_keep/boss_skarvald_dalronn.cpp + scripts/northrend/utgarde_keep/utgarde_keep/boss_ingvar_the_plunderer.cpp + scripts/northrend/utgarde_keep/utgarde_keep/def_utgarde_keep.h + scripts/northrend/utgarde_keep/utgarde_keep/utgarde_keep.cpp + scripts/northrend/utgarde_keep/utgarde_pinnacle/instance_pinnacle.cpp + scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_skadi.cpp + scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_ymiron.cpp + scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_palehoof.cpp + scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_svala.cpp + scripts/northrend/utgarde_keep/utgarde_pinnacle/def_pinnacle.h + scripts/northrend/vault_of_archavon/instance_vault_of_archavon.cpp + scripts/northrend/vault_of_archavon/boss_archavon.cpp + scripts/northrend/vault_of_archavon/boss_emalon.cpp + scripts/northrend/vault_of_archavon/def_vault_of_archavon.h + scripts/northrend/violet_hold/instance_violet_hold.cpp + scripts/northrend/violet_hold/boss_cyanigosa.cpp + scripts/northrend/violet_hold/boss_erekem.cpp + scripts/northrend/violet_hold/boss_ichoron.cpp + scripts/northrend/violet_hold/boss_lavanthor.cpp + scripts/northrend/violet_hold/boss_moragg.cpp + scripts/northrend/violet_hold/boss_xevozz.cpp + scripts/northrend/violet_hold/boss_zuramat.cpp + scripts/northrend/violet_hold/def_violet_hold.h scripts/northrend/borean_tundra.cpp scripts/northrend/dragonblight.cpp scripts/northrend/grizzly_hills.cpp scripts/northrend/icecrown.cpp scripts/northrend/sholazar_basin.cpp + scripts/northrend/wintergrasp.cpp scripts/northrend/zuldrak.cpp + scripts/outland/aunchindoun/auchenai_crypts/boss_exarch_maladaar.cpp + scripts/outland/aunchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp + scripts/outland/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp + scripts/outland/aunchindoun/mana_tombs/boss_pandemonius.cpp + scripts/outland/aunchindoun/sethekk_halls/boss_darkweaver_syth.cpp + scripts/outland/aunchindoun/sethekk_halls/boss_tailonking_ikiss.cpp + scripts/outland/aunchindoun/sethekk_halls/def_sethekk_halls.h + scripts/outland/aunchindoun/sethekk_halls/instance_sethekk_halls.cpp + scripts/outland/aunchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp + scripts/outland/aunchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp + scripts/outland/aunchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp + scripts/outland/aunchindoun/shadow_labyrinth/boss_murmur.cpp + scripts/outland/aunchindoun/shadow_labyrinth/def_shadow_labyrinth.h + scripts/outland/aunchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp + scripts/outland/black_temple/black_temple.cpp + scripts/outland/black_temple/boss_bloodboil.cpp + scripts/outland/black_temple/boss_illidan.cpp + scripts/outland/black_temple/boss_mother_shahraz.cpp + scripts/outland/black_temple/boss_reliquary_of_souls.cpp + scripts/outland/black_temple/boss_shade_of_akama.cpp + scripts/outland/black_temple/boss_supremus.cpp + scripts/outland/black_temple/boss_teron_gorefiend.cpp + scripts/outland/black_temple/boss_warlord_najentus.cpp + scripts/outland/black_temple/def_black_temple.h + scripts/outland/black_temple/illidari_council.cpp + scripts/outland/black_temple/instance_black_temple.cpp + scripts/outland/coilfang_resevoir/serpent_shrine/boss_fathomlord_karathress.cpp + scripts/outland/coilfang_resevoir/serpent_shrine/boss_hydross_the_unstable.cpp + scripts/outland/coilfang_resevoir/serpent_shrine/boss_lurker_below.cpp + scripts/outland/coilfang_resevoir/serpent_shrine/boss_lady_vashj.cpp + scripts/outland/coilfang_resevoir/serpent_shrine/boss_leotheras_the_blind.cpp + scripts/outland/coilfang_resevoir/serpent_shrine/boss_morogrim_tidewalker.cpp + scripts/outland/coilfang_resevoir/serpent_shrine/def_serpent_shrine.h + scripts/outland/coilfang_resevoir/serpent_shrine/instance_serpent_shrine.cpp + scripts/outland/coilfang_resevoir/steam_vault/boss_hydromancer_thespia.cpp + scripts/outland/coilfang_resevoir/steam_vault/boss_mekgineer_steamrigger.cpp + scripts/outland/coilfang_resevoir/steam_vault/boss_warlord_kalithresh.cpp + scripts/outland/coilfang_resevoir/steam_vault/def_steam_vault.h + scripts/outland/coilfang_resevoir/steam_vault/instance_steam_vault.cpp + scripts/outland/coilfang_resevoir/underbog/boss_hungarfen.cpp + scripts/outland/coilfang_resevoir/underbog/boss_the_black_stalker.cpp + scripts/outland/gruuls_lair/boss_gruul.cpp + scripts/outland/gruuls_lair/boss_high_king_maulgar.cpp + scripts/outland/gruuls_lair/def_gruuls_lair.h + scripts/outland/gruuls_lair/instance_gruuls_lair.cpp + scripts/outland/hellfire_citadel/blood_furnace/boss_broggok.cpp + scripts/outland/hellfire_citadel/blood_furnace/boss_kelidan_the_breaker.cpp + scripts/outland/hellfire_citadel/blood_furnace/boss_the_maker.cpp + scripts/outland/hellfire_citadel/blood_furnace/instance_blood_furnace.cpp + scripts/outland/hellfire_citadel/blood_furnace/def_blood_furnace.h + scripts/outland/hellfire_citadel/hellfire_ramparts/boss_omor_the_unscarred.cpp + scripts/outland/hellfire_citadel/hellfire_ramparts/boss_watchkeeper_gargolmar.cpp + scripts/outland/hellfire_citadel/hellfire_ramparts/boss_vazruden_the_herald.cpp + scripts/outland/hellfire_citadel/hellfire_ramparts/def_hellfire_ramparts.h + scripts/outland/hellfire_citadel/hellfire_ramparts/instance_hellfire_ramparts.cpp + scripts/outland/hellfire_citadel/magtheridons_lair/boss_magtheridon.cpp + scripts/outland/hellfire_citadel/magtheridons_lair/def_magtheridons_lair.h + scripts/outland/hellfire_citadel/magtheridons_lair/instance_magtheridons_lair.cpp + scripts/outland/hellfire_citadel/shattered_halls/boss_nethekurse.cpp + scripts/outland/hellfire_citadel/shattered_halls/boss_warbringer_omrogg.cpp + scripts/outland/hellfire_citadel/shattered_halls/def_shattered_halls.h + scripts/outland/hellfire_citadel/shattered_halls/instance_shattered_halls.cpp + scripts/outland/hellfire_citadel/shattered_halls/boss_warchief_kargath_bladefist.cpp + scripts/outland/tempest_keep/arcatraz/arcatraz.cpp + scripts/outland/tempest_keep/arcatraz/boss_harbinger_skyriss.cpp + scripts/outland/tempest_keep/arcatraz/def_arcatraz.h + scripts/outland/tempest_keep/arcatraz/instance_arcatraz.cpp + scripts/outland/tempest_keep/botanica/boss_high_botanist_freywinn.cpp + scripts/outland/tempest_keep/botanica/boss_laj.cpp + scripts/outland/tempest_keep/botanica/boss_warp_splinter.cpp + scripts/outland/tempest_keep/the_eye/boss_alar.cpp + scripts/outland/tempest_keep/the_eye/boss_astromancer.cpp + scripts/outland/tempest_keep/the_eye/boss_kaelthas.cpp + scripts/outland/tempest_keep/the_eye/boss_void_reaver.cpp + scripts/outland/tempest_keep/the_eye/def_the_eye.h + scripts/outland/tempest_keep/the_eye/instance_the_eye.cpp + scripts/outland/tempest_keep/the_eye/the_eye.cpp + scripts/outland/tempest_keep/the_mechanar/boss_gatewatcher_gyrokill.cpp + scripts/outland/tempest_keep/the_mechanar/boss_gatewatcher_ironhand.cpp + scripts/outland/tempest_keep/the_mechanar/boss_nethermancer_sepethrea.cpp + scripts/outland/tempest_keep/the_mechanar/boss_pathaleon_the_calculator.cpp + scripts/outland/tempest_keep/the_mechanar/def_mechanar.h + scripts/outland/tempest_keep/the_mechanar/instance_mechanar.cpp scripts/outland/blades_edge_mountains.cpp scripts/outland/boss_doomlord_kazzak.cpp scripts/outland/boss_doomwalker.cpp @@ -297,204 +495,6 @@ SET(trinityscript_LIB_SRCS scripts/outland/shattrath_city.cpp scripts/outland/terokkar_forest.cpp scripts/outland/zangarmarsh.cpp - scripts/zone/aunchindoun/auchenai_crypts/boss_exarch_maladaar.cpp - scripts/zone/aunchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp - scripts/zone/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp - scripts/zone/aunchindoun/mana_tombs/boss_pandemonius.cpp - scripts/zone/aunchindoun/sethekk_halls/boss_darkweaver_syth.cpp - scripts/zone/aunchindoun/sethekk_halls/boss_tailonking_ikiss.cpp - scripts/zone/aunchindoun/sethekk_halls/def_sethekk_halls.h - scripts/zone/aunchindoun/sethekk_halls/instance_sethekk_halls.cpp - scripts/zone/aunchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp - scripts/zone/aunchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp - scripts/zone/aunchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp - scripts/zone/aunchindoun/shadow_labyrinth/boss_murmur.cpp - scripts/zone/aunchindoun/shadow_labyrinth/def_shadow_labyrinth.h - scripts/zone/aunchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp - scripts/zone/black_temple/black_temple.cpp - scripts/zone/black_temple/boss_bloodboil.cpp - scripts/zone/black_temple/boss_illidan.cpp - scripts/zone/black_temple/boss_mother_shahraz.cpp - scripts/zone/black_temple/boss_reliquary_of_souls.cpp - scripts/zone/black_temple/boss_shade_of_akama.cpp - scripts/zone/black_temple/boss_supremus.cpp - scripts/zone/black_temple/boss_teron_gorefiend.cpp - scripts/zone/black_temple/boss_warlord_najentus.cpp - scripts/zone/black_temple/def_black_temple.h - scripts/zone/black_temple/illidari_council.cpp - scripts/zone/black_temple/instance_black_temple.cpp - scripts/zone/coilfang_resevoir/serpent_shrine/boss_fathomlord_karathress.cpp - scripts/zone/coilfang_resevoir/serpent_shrine/boss_hydross_the_unstable.cpp - scripts/zone/coilfang_resevoir/serpent_shrine/boss_lurker_below.cpp - scripts/zone/coilfang_resevoir/serpent_shrine/boss_lady_vashj.cpp - scripts/zone/coilfang_resevoir/serpent_shrine/boss_leotheras_the_blind.cpp - scripts/zone/coilfang_resevoir/serpent_shrine/boss_morogrim_tidewalker.cpp - scripts/zone/coilfang_resevoir/serpent_shrine/def_serpent_shrine.h - scripts/zone/coilfang_resevoir/serpent_shrine/instance_serpent_shrine.cpp - scripts/zone/coilfang_resevoir/steam_vault/boss_hydromancer_thespia.cpp - scripts/zone/coilfang_resevoir/steam_vault/boss_mekgineer_steamrigger.cpp - scripts/zone/coilfang_resevoir/steam_vault/boss_warlord_kalithresh.cpp - scripts/zone/coilfang_resevoir/steam_vault/def_steam_vault.h - scripts/zone/coilfang_resevoir/steam_vault/instance_steam_vault.cpp - scripts/zone/coilfang_resevoir/underbog/boss_hungarfen.cpp - scripts/zone/coilfang_resevoir/underbog/boss_the_black_stalker.cpp - scripts/zone/gruuls_lair/boss_gruul.cpp - scripts/zone/gruuls_lair/boss_high_king_maulgar.cpp - scripts/zone/gruuls_lair/def_gruuls_lair.h - scripts/zone/gruuls_lair/instance_gruuls_lair.cpp - scripts/zone/hellfire_citadel/blood_furnace/boss_broggok.cpp - scripts/zone/hellfire_citadel/blood_furnace/boss_kelidan_the_breaker.cpp - scripts/zone/hellfire_citadel/blood_furnace/boss_the_maker.cpp - scripts/zone/hellfire_citadel/blood_furnace/instance_blood_furnace.cpp - scripts/zone/hellfire_citadel/blood_furnace/def_blood_furnace.h - scripts/zone/hellfire_citadel/hellfire_ramparts/boss_omor_the_unscarred.cpp - scripts/zone/hellfire_citadel/hellfire_ramparts/boss_watchkeeper_gargolmar.cpp - scripts/zone/hellfire_citadel/hellfire_ramparts/boss_vazruden_the_herald.cpp - scripts/zone/hellfire_citadel/hellfire_ramparts/def_hellfire_ramparts.h - scripts/zone/hellfire_citadel/hellfire_ramparts/instance_hellfire_ramparts.cpp - scripts/zone/hellfire_citadel/magtheridons_lair/boss_magtheridon.cpp - scripts/zone/hellfire_citadel/magtheridons_lair/def_magtheridons_lair.h - scripts/zone/hellfire_citadel/magtheridons_lair/instance_magtheridons_lair.cpp - scripts/zone/hellfire_citadel/shattered_halls/boss_nethekurse.cpp - scripts/zone/hellfire_citadel/shattered_halls/boss_warbringer_omrogg.cpp - scripts/zone/hellfire_citadel/shattered_halls/def_shattered_halls.h - scripts/zone/hellfire_citadel/shattered_halls/instance_shattered_halls.cpp - scripts/zone/hellfire_citadel/shattered_halls/boss_warchief_kargath_bladefist.cpp - scripts/zone/naxxramas/boss_anubrekhan.cpp - scripts/zone/naxxramas/boss_faerlina.cpp - scripts/zone/naxxramas/boss_gluth.cpp - scripts/zone/naxxramas/boss_gothik.cpp - scripts/zone/naxxramas/boss_grobbulus.cpp - scripts/zone/naxxramas/boss_heigan.cpp - scripts/zone/naxxramas/boss_kelthuzad.cpp - scripts/zone/naxxramas/boss_four_horsemen.cpp - scripts/zone/naxxramas/boss_loatheb.cpp - scripts/zone/naxxramas/boss_maexxna.cpp - scripts/zone/naxxramas/boss_noth.cpp - scripts/zone/naxxramas/boss_patchwerk.cpp - scripts/zone/naxxramas/boss_razuvious.cpp - scripts/zone/naxxramas/boss_sapphiron.cpp - scripts/zone/naxxramas/boss_thaddius.cpp - scripts/zone/naxxramas/def_naxxramas.h - scripts/zone/naxxramas/instance_naxxramas.cpp - scripts/zone/tempest_keep/arcatraz/arcatraz.cpp - scripts/zone/tempest_keep/arcatraz/boss_harbinger_skyriss.cpp - scripts/zone/tempest_keep/arcatraz/def_arcatraz.h - scripts/zone/tempest_keep/arcatraz/instance_arcatraz.cpp - scripts/zone/tempest_keep/botanica/boss_high_botanist_freywinn.cpp - scripts/zone/tempest_keep/botanica/boss_laj.cpp - scripts/zone/tempest_keep/botanica/boss_warp_splinter.cpp - scripts/zone/tempest_keep/the_eye/boss_alar.cpp - scripts/zone/tempest_keep/the_eye/boss_astromancer.cpp - scripts/zone/tempest_keep/the_eye/boss_kaelthas.cpp - scripts/zone/tempest_keep/the_eye/boss_void_reaver.cpp - scripts/zone/tempest_keep/the_eye/def_the_eye.h - scripts/zone/tempest_keep/the_eye/instance_the_eye.cpp - scripts/zone/tempest_keep/the_eye/the_eye.cpp - scripts/zone/tempest_keep/the_mechanar/boss_gatewatcher_gyrokill.cpp - scripts/zone/tempest_keep/the_mechanar/boss_gatewatcher_ironhand.cpp - scripts/zone/tempest_keep/the_mechanar/boss_nethermancer_sepethrea.cpp - scripts/zone/tempest_keep/the_mechanar/boss_pathaleon_the_calculator.cpp - scripts/zone/tempest_keep/the_mechanar/def_mechanar.h - scripts/zone/tempest_keep/the_mechanar/instance_mechanar.cpp - scripts/zone/utgarde_keep/utgarde_keep/instance_utgarde_keep.cpp - scripts/zone/utgarde_keep/utgarde_keep/boss_keleseth.cpp - scripts/zone/utgarde_keep/utgarde_keep/boss_skarvald_dalronn.cpp - scripts/zone/utgarde_keep/utgarde_keep/boss_ingvar_the_plunderer.cpp - scripts/zone/utgarde_keep/utgarde_keep/def_utgarde_keep.h - scripts/zone/utgarde_keep/utgarde_keep/utgarde_keep.cpp - scripts/zone/utgarde_keep/utgarde_pinnacle/instance_pinnacle.cpp - scripts/zone/utgarde_keep/utgarde_pinnacle/boss_skadi.cpp - scripts/zone/utgarde_keep/utgarde_pinnacle/boss_ymiron.cpp - scripts/zone/utgarde_keep/utgarde_pinnacle/boss_palehoof.cpp - scripts/zone/utgarde_keep/utgarde_pinnacle/boss_svala.cpp - scripts/zone/utgarde_keep/utgarde_pinnacle/def_pinnacle.h - scripts/zone/nexus/nexus/instance_nexus.cpp - scripts/zone/nexus/nexus/boss_magus_telestra.cpp - scripts/zone/nexus/nexus/boss_anomalus.cpp - scripts/zone/nexus/nexus/boss_ormorok.cpp - scripts/zone/nexus/nexus/boss_keristrasza.cpp - scripts/zone/nexus/nexus/commander_stoutbeard.cpp - scripts/zone/nexus/nexus/commander_kolurg.cpp - scripts/zone/nexus/nexus/def_nexus.h - scripts/zone/nexus/oculus/instance_oculus.cpp - scripts/zone/nexus/oculus/boss_drakos.cpp - scripts/zone/nexus/oculus/boss_urom.cpp - scripts/zone/nexus/oculus/boss_varos.cpp - scripts/zone/nexus/oculus/boss_eregos.cpp - scripts/zone/nexus/oculus/def_oculus.h - scripts/zone/azjol_nerub/azjol_nerub/instance_azjol_nerub.cpp - scripts/zone/azjol_nerub/azjol_nerub/boss_krikthir_the_gatewatcher.cpp - scripts/zone/azjol_nerub/azjol_nerub/boss_hadronox.cpp - scripts/zone/azjol_nerub/azjol_nerub/boss_anubarak.cpp - scripts/zone/azjol_nerub/azjol_nerub/def_azjol_nerub.h - scripts/zone/azjol_nerub/ahnkahet/instance_ahnkahet.cpp - scripts/zone/azjol_nerub/ahnkahet/boss_prince_taldaram.cpp - scripts/zone/azjol_nerub/ahnkahet/boss_elder_nadox.cpp - scripts/zone/azjol_nerub/ahnkahet/boss_jedoga_shadowseeker.cpp - scripts/zone/azjol_nerub/ahnkahet/boss_herald_volazj.cpp - scripts/zone/azjol_nerub/ahnkahet/boss_amanitar.cpp - scripts/zone/azjol_nerub/ahnkahet/def_ahnkahet.h - scripts/zone/draktharon_keep/instance_drak_tharon_keep.cpp - scripts/zone/draktharon_keep/boss_trollgore.cpp - scripts/zone/draktharon_keep/boss_novos.cpp - scripts/zone/draktharon_keep/boss_dred.cpp - scripts/zone/draktharon_keep/boss_tharon_ja.cpp - scripts/zone/draktharon_keep/def_drak_tharon_keep.h - scripts/zone/violet_hold/instance_violet_hold.cpp - scripts/zone/violet_hold/boss_cyanigosa.cpp - scripts/zone/violet_hold/boss_erekem.cpp - scripts/zone/violet_hold/boss_ichoron.cpp - scripts/zone/violet_hold/boss_lavanthor.cpp - scripts/zone/violet_hold/boss_moragg.cpp - scripts/zone/violet_hold/boss_xevozz.cpp - scripts/zone/violet_hold/boss_zuramat.cpp - scripts/zone/violet_hold/def_violet_hold.h - scripts/zone/gundrak/instance_gundrak.cpp - scripts/zone/gundrak/boss_slad_ran.cpp - scripts/zone/gundrak/boss_moorabi.cpp - scripts/zone/gundrak/boss_drakkari_colossus.cpp - scripts/zone/gundrak/boss_gal_darah.cpp - scripts/zone/gundrak/boss_eck.cpp - scripts/zone/gundrak/def_gundrak.h - scripts/zone/ulduar/halls_of_stone/instance_halls_of_stone.cpp - scripts/zone/ulduar/halls_of_stone/boss_maiden_of_grief.cpp - scripts/zone/ulduar/halls_of_stone/boss_krystallus.cpp - scripts/zone/ulduar/halls_of_stone/boss_sjonnir.cpp - scripts/zone/ulduar/halls_of_stone/def_halls_of_stone.h - scripts/zone/ulduar/halls_of_lightning/instance_halls_of_lightning.cpp - scripts/zone/ulduar/halls_of_lightning/boss_bjarngrim.cpp - scripts/zone/ulduar/halls_of_lightning/boss_ionar.cpp - scripts/zone/ulduar/halls_of_lightning/boss_volkhan.cpp - scripts/zone/ulduar/halls_of_lightning/boss_loken.cpp - scripts/zone/ulduar/halls_of_lightning/def_halls_of_lightning.h - scripts/zone/nexus/eye_of_eternity/instance_eye_of_eternity.cpp - scripts/zone/nexus/eye_of_eternity/boss_malygos.cpp - scripts/zone/nexus/eye_of_eternity/def_eye_of_eternity.h - scripts/zone/obsidian_sanctum/instance_obsidian_sanctum.cpp - scripts/zone/obsidian_sanctum/boss_sartharion.cpp - scripts/zone/obsidian_sanctum/def_obsidian_sanctum.h - scripts/zone/vault_of_archavon/instance_vault_of_archavon.cpp - scripts/zone/vault_of_archavon/boss_archavon.cpp - scripts/zone/vault_of_archavon/boss_emalon.cpp - scripts/zone/vault_of_archavon/def_vault_of_archavon.h - scripts/zone/wintergrasp/wintergrasp.cpp - scripts/zone/ulduar/ulduar/boss_algalon.cpp - scripts/zone/ulduar/ulduar/boss_assembly_of_iron.cpp - scripts/zone/ulduar/ulduar/boss_auriaya.cpp - scripts/zone/ulduar/ulduar/boss_flame_leviathan.cpp - scripts/zone/ulduar/ulduar/boss_freya.cpp - scripts/zone/ulduar/ulduar/boss_general_vezax.cpp - scripts/zone/ulduar/ulduar/boss_hodir.cpp - scripts/zone/ulduar/ulduar/boss_ignis.cpp - scripts/zone/ulduar/ulduar/boss_kologarn.cpp - scripts/zone/ulduar/ulduar/boss_mimiron.cpp - scripts/zone/ulduar/ulduar/boss_razorscale.cpp - scripts/zone/ulduar/ulduar/boss_thorim.cpp - scripts/zone/ulduar/ulduar/boss_xt002.cpp - scripts/zone/ulduar/ulduar/boss_yoggsaron.cpp - scripts/zone/ulduar/ulduar/def_ulduar.h - scripts/zone/ulduar/ulduar/instance_ulduar.cpp scripts/world/areatrigger_scripts.cpp scripts/world/boss_emeriss.cpp scripts/world/boss_lethon.cpp diff --git a/src/bindings/scripts/VC80/80ScriptDev2.vcproj b/src/bindings/scripts/VC80/80ScriptDev2.vcproj index 00b918bd22e..3136b5d6adc 100644 --- a/src/bindings/scripts/VC80/80ScriptDev2.vcproj +++ b/src/bindings/scripts/VC80/80ScriptDev2.vcproj @@ -1585,1070 +1585,1030 @@ - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + Name="Steam Vault" + > + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + Name="Underbog" + > + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + Name="Blood Furnace" + > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + - - + + + + + - - + - - + - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + Name="The Mechanar" + > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + - - + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + - + + + + + + + + + + + - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + - + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -2859,6 +2138,10 @@ RelativePath="..\scripts\northrend\sholazar_basin.cpp" > + + @@ -2867,1042 +2150,462 @@ - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + Name="Steam Vault" + > + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + Name="Underbog" + > + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + Name="Blood Furnace" + > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + - - + + + + + - - + - - + - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + Name="The Mechanar" + > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* Script Data Start +SDName: boss_amanitar +SDAuthor: LordVanMartin +SD%Complete: 0 +SDComment: Only appears in heroic mode +SDCategory: Ahn'kahet +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = 'boss_amanitar' where entry = ''; +*** SQL END ***/ + +#include "precompiled.h" +#include "def_ahnkahet.h" + +#define SPELL_BASH 57094 +#define SPELL_ENTANGLING_ROOTS 57095 +#define SPELL_MINI 57055 +#define SPELL_VENOM_BOLT_VOLLEY 57088 + +struct TRINITY_DLL_DECL boss_amanitarAI : public ScriptedAI +{ + boss_amanitarAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + + void EnterCombat(Unit* who) {} + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + + void JustDied(Unit* killer) {} + + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + } +}; + +CreatureAI* GetAI_boss_amanitar(Creature* pCreature) +{ + return new boss_amanitarAI (pCreature); +} + +void AddSC_boss_amanitar() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_amanitar"; + newscript->GetAI = &GetAI_boss_amanitar; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/azjol_nerub/ahnkahet/boss_elder_nadox.cpp b/src/bindings/scripts/scripts/northrend/azjol_nerub/ahnkahet/boss_elder_nadox.cpp new file mode 100644 index 00000000000..129f7b34db6 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/azjol_nerub/ahnkahet/boss_elder_nadox.cpp @@ -0,0 +1,274 @@ +/* + * Copyright (C) 2009 Trinity + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: boss_elder_nadox +SD%Complete: 100 +SDComment: +SDCategory: Ahn'kahet +EndScriptData */ + +#include "precompiled.h" +#include "def_ahnkahet.h" + +bool DeadAhnkaharGuardian; // needed for achievement: Respect Your Elders(2038) + +#define ACHIEVEMENT_RESPECT_YOUR_ELDERS 2038 + +#define SAY_AGGRO -1619014 +#define SAY_SLAY_1 -1619015 +#define SAY_SLAY_2 -1619016 +#define SAY_SLAY_3 -1619017 +#define SAY_DEATH -1619018 +#define SAY_EGG_SAC_1 -1619019 +#define SAY_EGG_SAC_2 -1619020 + +#define SPELL_BROOD_PLAGUE 56130 +#define H_SPELL_BROOD_PLAGUE 59467 +#define H_SPELL_BROOD_RAGE 59465 +#define SPELL_ENRAGE 26662// Enraged if too far away from home + +#define MOB_AHNKAHAR_SWARMER 30178 +#define SPELL_SUMMON_SWARMERS 56119//2x 30178 -- 2x every 10secs + +#define MOB_AHNKAHAR_GUARDIAN_ENTRY 30176 +#define SPELL_SUMMON_SWARM_GUARD 56120//1x 30176 -- every 25secs +#define SPELL_GUARDIAN_AURA 56151 + +struct TRINITY_DLL_DECL boss_elder_nadoxAI : public ScriptedAI +{ + boss_elder_nadoxAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + HeroicMode = c->GetMap()->IsHeroic(); + } + + bool HeroicMode; + uint32 plague_Timer; + uint32 rage_Timer; + + uint32 swarmer_spawn_Timer; + uint32 guard_spawn_Timer; + uint32 enrage_Timer; + + + ScriptedInstance *pInstance; + + void Reset() + { + plague_Timer = 13000; + rage_Timer = 20000; + + swarmer_spawn_Timer = 10000; + guard_spawn_Timer = 25000; + + enrage_Timer = 5000; + + DeadAhnkaharGuardian = false; + + if (pInstance) + pInstance->SetData(DATA_ELDER_NADOX_EVENT, NOT_STARTED); + } + + void EnterCombat(Unit *who) + { + DoScriptText(SAY_DEATH,m_creature); + + if (pInstance) + pInstance->SetData(DATA_ELDER_NADOX_EVENT, IN_PROGRESS); + } + + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY_1,m_creature); break; + case 1: DoScriptText(SAY_SLAY_2,m_creature); break; + case 2: DoScriptText(SAY_SLAY_3,m_creature); break; + } + } + + void JustDied(Unit* killer) + { + DoScriptText(SAY_SLAY_3,m_creature); + + if (HeroicMode && !DeadAhnkaharGuardian) + { + AchievementEntry const *AchievRespectYourElders = GetAchievementStore()->LookupEntry(ACHIEVEMENT_RESPECT_YOUR_ELDERS); + if (AchievRespectYourElders) + { + Map* pMap = m_creature->GetMap(); + if (pMap && pMap->IsDungeon()) + { + Map::PlayerList const &players = pMap->GetPlayers(); + for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + itr->getSource()->CompletedAchievement(AchievRespectYourElders); + } + } + } + + if (pInstance) + pInstance->SetData(DATA_ELDER_NADOX_EVENT, DONE); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (plague_Timer < diff) + { + DoCast(m_creature->getVictim(),HeroicMode ? H_SPELL_BROOD_PLAGUE : SPELL_BROOD_PLAGUE); + plague_Timer = 15000; + }else plague_Timer -= diff; + + if (HeroicMode) + if (rage_Timer < diff) + { + Unit* Swarmer = m_creature->FindNearestCreature(MOB_AHNKAHAR_SWARMER, 35); + + if (Swarmer) + { + DoCast(Swarmer,H_SPELL_BROOD_RAGE,true); + rage_Timer = 15000; + } + }else rage_Timer -= diff; + + if (swarmer_spawn_Timer < diff) + { + DoCast(m_creature,SPELL_SUMMON_SWARMERS,true); + DoCast(m_creature,SPELL_SUMMON_SWARMERS); + if (rand()%3 == 0) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_EGG_SAC_1,m_creature); break; + case 1: DoScriptText(SAY_EGG_SAC_2,m_creature); break; + } + } + swarmer_spawn_Timer = 10000; + }else swarmer_spawn_Timer -= diff; + + if (guard_spawn_Timer < diff) + { + m_creature->MonsterTextEmote("An Ahn'kahar Guardian hatches!",m_creature->GetGUID(),true); + DoCast(m_creature,SPELL_SUMMON_SWARM_GUARD); + guard_spawn_Timer = 25000; + }else guard_spawn_Timer -= diff; + + if (enrage_Timer < diff) + { + if (m_creature->HasAura(SPELL_ENRAGE,0)) + return; + + float x, y, z, o; + m_creature->GetHomePosition(x, y, z, o); + if (z < 24) + { + if (!m_creature->IsNonMeleeSpellCasted(false)) + { + DoCast(m_creature,SPELL_ENRAGE,true); + } + } + enrage_Timer = 5000; + }else enrage_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_elder_nadox(Creature* pCreature) +{ + return new boss_elder_nadoxAI(pCreature); +} + +#define SPELL_SPRINT 56354 + +struct TRINITY_DLL_DECL mob_ahnkahar_nerubianAI : public ScriptedAI +{ + mob_ahnkahar_nerubianAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance *pInstance; + uint32 sprint_Timer; + + void Reset() + { + if (m_creature->GetEntry() == 30176) + DoCast(m_creature,SPELL_GUARDIAN_AURA,true); + sprint_Timer = 10000; + } + + void JustDied(Unit *killer) + { + if (m_creature->GetEntry() == MOB_AHNKAHAR_GUARDIAN_ENTRY) + DeadAhnkaharGuardian = true; + } + + void EnterCombat(Unit *who){} + + void UpdateAI(const uint32 diff) + { + if (m_creature->GetEntry() == 30176) + m_creature->RemoveAurasDueToSpell(SPELL_GUARDIAN_AURA); + + if (pInstance) + { + if (pInstance->GetData(DATA_ELDER_NADOX_EVENT) != IN_PROGRESS) + { + m_creature->DealDamage(m_creature,m_creature->GetHealth()); + m_creature->RemoveCorpse(); + } + } + + if (!UpdateVictim()) + return; + + if (sprint_Timer < diff) + { + DoCast(m_creature,SPELL_SPRINT); + sprint_Timer = 25000; + }else sprint_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_ahnkahar_nerubian(Creature* pCreature) +{ + return new mob_ahnkahar_nerubianAI(pCreature); +} + +void AddSC_boss_elder_nadox() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_elder_nadox"; + newscript->GetAI = &GetAI_boss_elder_nadox; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_ahnkahar_nerubian"; + newscript->GetAI = &GetAI_mob_ahnkahar_nerubian; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/azjol_nerub/ahnkahet/boss_herald_volazj.cpp b/src/bindings/scripts/scripts/northrend/azjol_nerub/ahnkahet/boss_herald_volazj.cpp new file mode 100644 index 00000000000..820c260801e --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/azjol_nerub/ahnkahet/boss_herald_volazj.cpp @@ -0,0 +1,111 @@ +/* + * Copyright (C) 2009 Trinity + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: boss_herald_volazj +SDAuthor: LordVanMartin +SD%Complete: 0 +SDComment: +SDCategory: Ahn'kahet +EndScriptData */ + +/*** SQL START *** +update creature_template set scriptname = 'boss_volazj' where entry = ''; +*** SQL END ***/ + +#include "precompiled.h" +#include "def_ahnkahet.h" + +//Spells +#define SPELL_INSANITY 57496 //Dummy +#define INSANITY_VISUAL 57561 +#define SPELL_MIND_FLAY_N 57941 +#define SPELL_MIND_FLAY_H 59974 +#define SPELL_SHADOW_BOLT_VOLLEY_1 57942 +#define SPELL_SHADOW_BOLT_VOLLEY_2 59975 +#define SPELL_SHIVER_N 57949 +#define SPELL_SHIVER_H 59978 + +//Yell +#define SAY_AGGRO -1619030 +#define SAY_SLAY_1 -1619031 +#define SAY_SLAY_2 -1619032 +#define SAY_SLAY_3 -1619033 +#define SAY_DEATH_1 -1619034 +#define SAY_DEATH_2 -1619035 +#define SAY_PHASE -1619036 + +struct TRINITY_DLL_DECL boss_volazjAI : public ScriptedAI +{ + boss_volazjAI(Creature *c) : ScriptedAI(c) {} + + uint32 phase; + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + phase =1; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + if (phase == 1) + DoScriptText(SAY_DEATH_1, m_creature); + else + DoScriptText(SAY_DEATH_2, m_creature); + } + + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature);break; + case 1: DoScriptText(SAY_SLAY_2, m_creature);break; + case 2: DoScriptText(SAY_SLAY_3, m_creature);break; + } + } +}; + +CreatureAI* GetAI_boss_volazj(Creature* pCreature) +{ + return new boss_volazjAI (pCreature); +} + +void AddSC_boss_volazj() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_volazj"; + newscript->GetAI = &GetAI_boss_volazj; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/azjol_nerub/ahnkahet/boss_jedoga_shadowseeker.cpp b/src/bindings/scripts/scripts/northrend/azjol_nerub/ahnkahet/boss_jedoga_shadowseeker.cpp new file mode 100644 index 00000000000..47a7d79e87b --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/azjol_nerub/ahnkahet/boss_jedoga_shadowseeker.cpp @@ -0,0 +1,109 @@ +/* + * Copyright (C) 2009 Trinity + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: boss_jedoga_shadowseeker +SDAuthor: LordVanMartin +SD%Complete: 0 +SDComment: +SDCategory: Ahn'kahet +EndScriptData */ + +/*** SQL START *** +update creature_template set scriptname = 'boss_jedoga' where entry = ''; +*** SQL END ***/ + +#include "precompiled.h" +#include "def_ahnkahet.h" + +#define SPELL_CYCLONE_STRIKE 56855 +#define H_SPELL_CYCLONE_STRIKE 60030//kein unterschied zu 56855 außer das 60030 1,5sec cast ist +#define SPELL_LIGHTNING_BOLT 56891 +#define H_SPELL_LIGHTNING_BOLT 60032 +#define SPELL_THUNDERSHOCK 56926//AOE works +#define H_SPELL_THUNDERSHOCK 60029//AOE works +#define SPELL_GIFT_OF_THE_HERALD 56219//triggert if sucessfull sacreficed + +#define SAY_AGGRO -1619000 +#define SAY_C_SACRIFICE_1 -1619001 +#define SAY_C_SACRIFICE_2 -1619002 +#define SAY_SACRIFICE_1 -1619003 +#define SAY_SACRIFICE_2 -1619004 +#define SAY_SLAY_1 -1619005 +#define SAY_SLAY_2 -1619006 +#define SAY_SLAY_3 -1619007 +#define SAY_DEATH -1619008 +#define SAY_PREACHING_1 -1619009 +#define SAY_PREACHING_2 -1619010 +#define SAY_PREACHING_3 -1619011 +#define SAY_PREACHING_4 -1619012 +#define SAY_PREACHING_5 -1619013 + +struct TRINITY_DLL_DECL boss_jedogaAI : public ScriptedAI +{ + boss_jedogaAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature);break; + case 1: DoScriptText(SAY_SLAY_2, m_creature);break; + case 2: DoScriptText(SAY_SLAY_3, m_creature);break; + } + } +}; + +CreatureAI* GetAI_boss_jedoga(Creature* pCreature) +{ + return new boss_jedogaAI (pCreature); +} + +void AddSC_boss_jedoga() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_jedoga"; + newscript->GetAI = &GetAI_boss_jedoga; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/azjol_nerub/ahnkahet/boss_prince_taldaram.cpp b/src/bindings/scripts/scripts/northrend/azjol_nerub/ahnkahet/boss_prince_taldaram.cpp new file mode 100644 index 00000000000..cb34d8919d7 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/azjol_nerub/ahnkahet/boss_prince_taldaram.cpp @@ -0,0 +1,109 @@ +/* + * Copyright (C) 2009 Trinity + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: boss_prince_taldaram +SDAuthor: LordVanMartin +SD%Complete: 0 +SDComment: +SDCategory: Ahn'kahet +EndScriptData */ + +#include "precompiled.h" +#include "def_ahnkahet.h" + +#define SPELL_BLOODTHIRST 55968 //Trigger Spell + add aura +#define SPELL_CONJURE_FLAME_SPHERE 55931 + +#define SPELL_FLAME_SPHERE_SUMMON_1 55895// 1x 30106 +#define H_SPELL_FLAME_SPHERE_SUMMON_1 59511// 1x 31686 +#define H_SPELL_FLAME_SPHERE_SUMMON_2 59512// 1x 31687 +#define SPELL_FLAME_SPHERE_SPAWN_EFFEKT 55891 +#define SPELL_FLAME_SPHERE_VISUAL 55928 +#define SPELL_FLAME_SPHERE_PERIODIC 55926 +#define H_SPELL_FLAME_SPHERE_PERIODIC 59508 +#define SPELL_FLAME_SPHERE_DEATH_EFFEKT 55947 + +#define SPELL_EMBRACE_OF_THE_VAMPYR 55959 +#define H_SPELL_EMBRACE_OF_THE_VAMPYR 59513 + +#define SPELL_VANISH 55964 + +//Yell +#define SAY_AGGRO -1619021 +#define SAY_SLAY_1 -1619022 +#define SAY_SLAY_2 -1619023 +#define SAY_SLAY_3 -1619024 +#define SAY_DEATH -1619025 +#define SAY_FEED_1 -1619026 +#define SAY_FEED_2 -1619027 +#define SAY_VANISH_1 -1619028 +#define SAY_VANISH_2 -1619029 + +struct TRINITY_DLL_DECL boss_taldaramAI : public ScriptedAI +{ + boss_taldaramAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature);break; + case 1: DoScriptText(SAY_SLAY_2, m_creature);break; + case 2: DoScriptText(SAY_SLAY_3, m_creature);break; + } + } +}; + +CreatureAI* GetAI_boss_taldaram(Creature* pCreature) +{ + return new boss_taldaramAI (pCreature); +} + +void AddSC_boss_taldaram() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_taldaram"; + newscript->GetAI = &GetAI_boss_taldaram; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/azjol_nerub/ahnkahet/def_ahnkahet.h b/src/bindings/scripts/scripts/northrend/azjol_nerub/ahnkahet/def_ahnkahet.h new file mode 100644 index 00000000000..97c0db55d72 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/azjol_nerub/ahnkahet/def_ahnkahet.h @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2009 Trinity + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef DEF_AHNKAHET_H +#define DEF_AHNKAHET_H + +#define DATA_ELDER_NADOX 1 +#define DATA_PRINCE_TALDARAM 2 +#define DATA_JEDOGA_SHADOWSEEKER 3 +#define DATA_HERALD_VOLAZJ 4 +#define DATA_AMANITAR 5 + +#define DATA_ELDER_NADOX_EVENT 6 +#define DATA_PRINCE_TALDARAM_EVENT 7 +#define DATA_JEDOGA_SHADOWSEEKER_EVENT 8 +#define DATA_HERALD_VOLAZJ_EVENT 9 +#define DATA_AMANITAR_EVENT 10 +#endif diff --git a/src/bindings/scripts/scripts/northrend/azjol_nerub/ahnkahet/instance_ahnkahet.cpp b/src/bindings/scripts/scripts/northrend/azjol_nerub/ahnkahet/instance_ahnkahet.cpp new file mode 100644 index 00000000000..db9befd65cf --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/azjol_nerub/ahnkahet/instance_ahnkahet.cpp @@ -0,0 +1,194 @@ +/* + * Copyright (C) 2009 Trinity + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Azjol_Nerub +SD%Complete: 0 +SDComment: +SDCategory: Azjol Nerub +EndScriptData */ + +#include "precompiled.h" +#include "def_ahnkahet.h" + +#define MAX_ENCOUNTER 5 + +/* Ahn'kahet encounters: +0 - Elder Nadox +1 - Prince Taldaram +2 - Jedoga Shadowseeker +3 - Herald Volazj +4 - Amanitar (Heroic only) +*/ + +struct TRINITY_DLL_DECL instance_ahnkahet : public ScriptedInstance +{ + instance_ahnkahet(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint64 Elder_Nadox; + uint64 Prince_Taldaram; + uint64 Jedoga_Shadowseeker; + uint64 Herald_Volazj; + uint64 Amanitar; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + + void Initialize() + { + Elder_Nadox =0; + Prince_Taldaram =0; + Jedoga_Shadowseeker =0; + Herald_Volazj =0; + Amanitar =0; + + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + m_auiEncounter[i] = NOT_STARTED; + } + + bool IsEncounterInProgress() const + { + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) return true; + + return false; + } + + + void OnCreatureCreate(Creature* pCreature, bool add) + { + switch(pCreature->GetEntry()) + { + case 29309: Elder_Nadox = pCreature->GetGUID(); break; + case 29308: Prince_Taldaram = pCreature->GetGUID(); break; + case 29310: Jedoga_Shadowseeker = pCreature->GetGUID(); break; + case 29311: Herald_Volazj = pCreature->GetGUID(); break; + case 30258: Amanitar = pCreature->GetGUID(); break; + } + } + + uint64 GetData64(uint32 identifier) + { + switch(identifier) + { + case DATA_ELDER_NADOX: return Elder_Nadox; + case DATA_PRINCE_TALDARAM: return Prince_Taldaram; + case DATA_JEDOGA_SHADOWSEEKER: return Jedoga_Shadowseeker; + case DATA_HERALD_VOLAZJ: return Herald_Volazj; + case DATA_AMANITAR: return Amanitar; + } + return 0; + } + + void SetData(uint32 type, uint32 data) + { + switch(type) + { + case DATA_ELDER_NADOX_EVENT: + m_auiEncounter[0] = data;break; + case DATA_PRINCE_TALDARAM_EVENT: + m_auiEncounter[1] = data; break; + case DATA_JEDOGA_SHADOWSEEKER_EVENT: + m_auiEncounter[2] = data; break; + case DATA_HERALD_VOLAZJ: + m_auiEncounter[3] = data; break; + case DATA_AMANITAR: + m_auiEncounter[4] = data; break; + } + + if (data == DONE) + { + SaveToDB(); + } + } + + uint32 GetData(uint32 type) + { + switch(type) + { + case DATA_ELDER_NADOX_EVENT: return m_auiEncounter[0]; + case DATA_PRINCE_TALDARAM_EVENT: return m_auiEncounter[1]; + case DATA_JEDOGA_SHADOWSEEKER_EVENT: return m_auiEncounter[2]; + case DATA_HERALD_VOLAZJ: return m_auiEncounter[3]; + case DATA_AMANITAR: return m_auiEncounter[4]; + } + return 0; + } + + std::string GetSaveData() + { + OUT_SAVE_INST_DATA; + + std::string str_data; + + std::ostringstream saveStream; + saveStream << "A K " << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " + << m_auiEncounter[2] << m_auiEncounter[3] << m_auiEncounter[4]; + + str_data = saveStream.str(); + + OUT_SAVE_INST_DATA_COMPLETE; + return str_data; + } + + void Load(const char* in) + { + if (!in) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(in); + + char dataHead1, dataHead2; + uint16 data0,data1,data2,data3,data4; + + std::istringstream loadStream(in); + loadStream >> dataHead1 >> dataHead2 >> data0 >> data1 >> data2 >> data3 >> data4; + + if (dataHead1 == 'A' && dataHead2 == 'K') + { + m_auiEncounter[0] = data0; + m_auiEncounter[1] = data1; + m_auiEncounter[2] = data2; + m_auiEncounter[3] = data3; + m_auiEncounter[4] = data4; + + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) + m_auiEncounter[i] = NOT_STARTED; + + }else OUT_LOAD_INST_DATA_FAIL; + + OUT_LOAD_INST_DATA_COMPLETE; + } +}; + +InstanceData* GetInstanceData_instance_ahnkahet(Map* pMap) +{ + return new instance_ahnkahet(pMap); +} + +void AddSC_instance_ahnkahet() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_ahnkahet"; + newscript->GetInstanceData = &GetInstanceData_instance_ahnkahet; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/azjol_nerub/azjol_nerub/boss_anubarak.cpp b/src/bindings/scripts/scripts/northrend/azjol_nerub/azjol_nerub/boss_anubarak.cpp new file mode 100644 index 00000000000..b4717824443 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/azjol_nerub/azjol_nerub/boss_anubarak.cpp @@ -0,0 +1,112 @@ +/* + * Copyright (C) 2009 Trinity + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: boss_anubarak +SDAuthor: LordVanMartin +SD%Complete: 0 +SDComment: +SDCategory: Azjol Nerub +EndScriptData */ + +/*** SQL START *** +update creature_template set scriptname = 'boss_anub_arak' where entry = ''; +*** SQL END ***/ + +#include "precompiled.h" +#include "def_azjol_nerub.h" + +//Spells +#define SPELL_CARRION_BEETLES 53520 +#define SPELL_LOCUST_SWARM 53467 +#define SPELL_IMPALE 53454 +#define SPELL_POUND 53472 + +//Yell +#define SAY_INTRO -1601010 +#define SAY_AGGRO -1601000 +#define SAY_SLAY_1 -1601001 +#define SAY_SLAY_2 -1601002 +#define SAY_SLAY_3 -1601003 +#define SAY_LOCUST_1 -1601005 +#define SAY_LOCUST_2 -1601006 +#define SAY_LOCUST_3 -1601007 +#define SAY_SUBMERGE_1 -1601008 +#define SAY_SUBMERGE_2 -1601009 +#define SAY_DEATH -1601004 + +struct TRINITY_DLL_DECL boss_anub_arakAI : public ScriptedAI +{ + boss_anub_arakAI(Creature *c) : ScriptedAI(c) {} + + uint32 phase; + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + phase =1; + + if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) <= 33) + phase = 2; + if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) == 15) + phase = 3; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature);break; + case 1: DoScriptText(SAY_SLAY_2, m_creature);break; + case 2: DoScriptText(SAY_SLAY_3, m_creature);break; + } + } +}; + +CreatureAI* GetAI_boss_anub_arak(Creature* pCreature) +{ + return new boss_anub_arakAI (pCreature); +} + +void AddSC_boss_anub_arak() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_anub_arak"; + newscript->GetAI = &GetAI_boss_anub_arak; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/azjol_nerub/azjol_nerub/boss_hadronox.cpp b/src/bindings/scripts/scripts/northrend/azjol_nerub/azjol_nerub/boss_hadronox.cpp new file mode 100644 index 00000000000..fa85563a2e7 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/azjol_nerub/azjol_nerub/boss_hadronox.cpp @@ -0,0 +1,114 @@ +/* + * Copyright (C) 2009 Trinity + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: boss_hadronox +SD%Complete: 0 +SDComment: Placeholder +SDCategory: Azjol Nerub +EndScriptData */ + +#include "precompiled.h" +#include "def_azjol_nerub.h" + +#define SPELL_WEB_FRONT_DOORS 53177//dummy + +#define SPELL_ACID_CLOUD 53400 +#define H_SPELL_ACID_CLOUD 59419 +#define SPELL_LEECH_POISON 53030 +#define H_SPELL_LEECH_POISON 59417 +#define SPELL_LEECH_POISON_DEADTRIGGER 53800//heal 10% heroic und normal +#define SPELL_PIECE_ARMOR 53418 +#define SPELL_WEB_GRAB 53406 +#define H_SPELL_WEB_GRAB 59420 + +/* Script Data Start +SDName: Boss hadronox +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = 'boss_hadronox' where entry = ''; +*** SQL END ***/ + +//Spells +#define SPELL_LEECH_POISON 53030 +#define SPELL_ACID_CLOUD 53400 +#define SPELL_PIERCE_ARMOR 53418 //Source SUN++ +#define SPELL_WEB_GRAB 53406 + +//Phase 0 => Gauntlet Event described below +//Phase 1 => Boss Encounter + +/*When your group enters the main room (the one after the bridge), you will notice a group of 3 Nerubians. +When you engage them, 2 more groups like this one spawn behind the first one - it is important to pull the first group back, +so you don't aggro all 3. Hadronox will be under you, fighting Nerubians. + +This is the timed gauntlet - waves of non-elite spiders + will spawn from the 3 doors located a little above the main room, and will then head down to fight Hadronox. After clearing the + main room, it is recommended to just stay in it, kill the occasional non-elites that will attack you instead of the boss, and wait for + Hadronox to make his way to you. When Hadronox enters the main room, she will web the doors, and no more non-elites will spawn.*/ + +struct TRINITY_DLL_DECL boss_hadronoxAI : public ScriptedAI +{ + boss_hadronoxAI(Creature *c) : ScriptedAI(c) {} + + uint32 phase; + + void Reset() {} + void EnterCombat(Unit* who) {} + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + phase =1; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) {} + + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + + //when Hadronox kills any enemy (that includes a party member) she will regain 10% of her HP if the target had Leech Poison on + } +}; + +CreatureAI* GetAI_boss_hadronox(Creature* pCreature) +{ + return new boss_hadronoxAI (pCreature); +} + +void AddSC_boss_hadronox() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_hadronox"; + newscript->GetAI = &GetAI_boss_hadronox; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/azjol_nerub/azjol_nerub/boss_krikthir_the_gatewatcher.cpp b/src/bindings/scripts/scripts/northrend/azjol_nerub/azjol_nerub/boss_krikthir_the_gatewatcher.cpp new file mode 100644 index 00000000000..3e0d3e97a51 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/azjol_nerub/azjol_nerub/boss_krikthir_the_gatewatcher.cpp @@ -0,0 +1,116 @@ +/* + * Copyright (C) 2009 Trinity + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: boss_krikthir_the_gatewatcher +SDAuthor: LordVanMartin +SD%Complete: 0 +SDComment: Placeholder +SDCategory: Azjol Nerub +EndScriptData */ + +/*** SQL START *** +update creature_template set scriptname = 'boss_krik_thir' where entry = ''; +*** SQL END ***/ + +#include "precompiled.h" +#include "def_azjol_nerub.h" + +#define SPELL_MIND_FLAY 52586 +#define H_SPELL_MIND_FLAY 59367 +#define SPELL_CURSE_OF_FATIGUE 52592 +#define H_SPELL_CURSE_OF_FATIGUE 59368 +#define SPELL_FRENZY 28747 // maybe 53361 + +#define MOB_SKITTERING_SWARMER 28735 +#define MOB_SKITTERING_SWARMER_CONTROLLER 32593 + +#define SPELL_SUMMON_SKITTERING_SWARMER 52438//AOE Effekt 140, maybe 52439 +#define SPELL_SUMMON_SKITTERING_SWARMER 52439//Summon 3x 28735 + +//Yell +#define SAY_AGGRO -1601011 +#define SAY_SLAY_1 -1601012 +#define SAY_SLAY_2 -1601013 +#define SAY_SLAY_3 -1601014 +#define SAY_DEATH -1601015 +#define SAY_SEND_GROUP_1 -1601018 +#define SAY_SEND_GROUP_2 -1601019 +#define SAY_SEND_GROUP_3 -1601020 +#define SAY_SWARM_1 -1601016 +#define SAY_SWARM_2 -1601017 +#define SAY_PREFIGHT_1 -1601021 +#define SAY_PREFIGHT_2 -1601022 +#define SAY_PREFIGHT_3 -1601023 + +struct TRINITY_DLL_DECL boss_krik_thirAI : public ScriptedAI +{ + boss_krik_thirAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) >= 10) + { + //Frenzy + } + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature);break; + case 1: DoScriptText(SAY_SLAY_2, m_creature);break; + case 2: DoScriptText(SAY_SLAY_3, m_creature);break; + } + } +}; + +CreatureAI* GetAI_boss_krik_thir(Creature* pCreature) +{ + return new boss_krik_thirAI (pCreature); +} + +void AddSC_boss_krik_thir() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_krik_thir"; + newscript->GetAI = &GetAI_boss_krik_thir; + newscript->RegisterSelf(); + +} diff --git a/src/bindings/scripts/scripts/northrend/azjol_nerub/azjol_nerub/def_azjol_nerub.h b/src/bindings/scripts/scripts/northrend/azjol_nerub/azjol_nerub/def_azjol_nerub.h new file mode 100644 index 00000000000..9e319e8fde0 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/azjol_nerub/azjol_nerub/def_azjol_nerub.h @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2009 Trinity + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef DEF_AZJOL_NERUB_H +#define DEF_AZJOL_NERUB_H + +#define DATA_KRIKTHIR_THE_GATEWATCHER 1 +#define DATA_HADRONOX 2 +#define DATA_ANUBARAK 3 + +#define DATA_KRIKTHIR_THE_GATEWATCHER_EVENT 4 +#define DATA_HADRONOX_EVENT 5 +#define DATA_ANUBARAK_EVENT 6 +#endif diff --git a/src/bindings/scripts/scripts/northrend/azjol_nerub/azjol_nerub/instance_azjol_nerub.cpp b/src/bindings/scripts/scripts/northrend/azjol_nerub/azjol_nerub/instance_azjol_nerub.cpp new file mode 100644 index 00000000000..bac772acc6f --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/azjol_nerub/azjol_nerub/instance_azjol_nerub.cpp @@ -0,0 +1,178 @@ +/* + * Copyright (C) 2009 Trinity + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Azjol_Nerub +SD%Complete: 0 +SDComment: Placeholder +SDCategory: Azjol Nerub +EndScriptData */ + +#include "precompiled.h" +#include "def_azjol_nerub.h" + +#define MAX_ENCOUNTER 3 + +/* Azjol Nerub encounters: +0 - Krik'thir the Gatewatcher +1 - Hadronox +2 - Anub'arak +*/ + +struct TRINITY_DLL_DECL instance_azjol_nerub : public ScriptedInstance +{ + instance_azjol_nerub(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint64 m_uiKrikthir; + uint64 m_uiHadronox; + uint64 m_uiAnubarak; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + m_uiKrikthir = 0; + m_uiHadronox = 0; + m_uiAnubarak =0; + } + + bool IsEncounterInProgress() const + { + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) return true; + + return false; + } + + + void OnCreatureCreate(Creature* pCreature, bool add) + { + switch(pCreature->GetEntry()) + { + case 28684: m_uiKrikthir = pCreature->GetGUID(); break; + case 28921: m_uiHadronox = pCreature->GetGUID(); break; + case 29120: m_uiAnubarak = pCreature->GetGUID(); break; + + } + } + + uint64 GetData64(uint32 identifier) + { + switch(identifier) + { + case DATA_KRIKTHIR_THE_GATEWATCHER: return m_uiKrikthir; + case DATA_HADRONOX: return m_uiHadronox; + case DATA_ANUBARAK: return m_uiAnubarak; + } + + return 0; + } + + void SetData(uint32 type, uint32 data) + { + switch(type) + { + case DATA_KRIKTHIR_THE_GATEWATCHER_EVENT: + m_auiEncounter[0] = data;break; + case DATA_HADRONOX_EVENT: + m_auiEncounter[1] = data; break; + case DATA_ANUBARAK_EVENT: + m_auiEncounter[2] = data; break; + } + + if (data == DONE) + { + SaveToDB(); + } + } + + uint32 GetData(uint32 type) + { + switch(type) + { + case DATA_KRIKTHIR_THE_GATEWATCHER_EVENT: return m_auiEncounter[0]; + case DATA_HADRONOX_EVENT: return m_auiEncounter[1]; + case DATA_ANUBARAK_EVENT: return m_auiEncounter[2]; + } + + return 0; + } + + std::string GetSaveData() + { + OUT_SAVE_INST_DATA; + + std::string str_data; + + std::ostringstream saveStream; + saveStream << "A N " << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " + << m_auiEncounter[2]; + + str_data = saveStream.str(); + + OUT_SAVE_INST_DATA_COMPLETE; + return str_data; + } + + void Load(const char* in) + { + if (!in) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(in); + + char dataHead1, dataHead2; + uint16 data0,data1,data2; + + std::istringstream loadStream(in); + loadStream >> dataHead1 >> dataHead2 >> data0 >> data1 >> data2; + + if (dataHead1 == 'A' && dataHead2 == 'N') + { + m_auiEncounter[0] = data0; + m_auiEncounter[1] = data1; + m_auiEncounter[2] = data2; + + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) + m_auiEncounter[i] = NOT_STARTED; + + }else OUT_LOAD_INST_DATA_FAIL; + + OUT_LOAD_INST_DATA_COMPLETE; + } +}; + +InstanceData* GetInstanceData_instance_azjol_nerub(Map* pMap) +{ + return new instance_azjol_nerub(pMap); +} + +void AddSC_instance_azjol_nerub() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_azjol_nerub"; + newscript->GetInstanceData = &GetInstanceData_instance_azjol_nerub; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/draktharon_keep/boss_dred.cpp b/src/bindings/scripts/scripts/northrend/draktharon_keep/boss_dred.cpp new file mode 100644 index 00000000000..98425a29e1a --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/draktharon_keep/boss_dred.cpp @@ -0,0 +1,56 @@ +/* Script Data Start +SDName: Boss dred +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = '' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_BELLOWING_ROAR 44863 // fears the group, can be resisted/dispelled +#define SPELL_GRIEVOUS_BITE 48920 +#define SPELL_MANGLING_SLASH 48873 //casted on the current tank, adds debuf +#define SPELL_FEARSOME_ROAR_N 48849 +#define SPELL_FEARSOME_ROAR_H 48849 //Not stacking, debuff +#define SPELL_PIERCING_SLASH 48878 //debuff -->Armor reduced by 75% +#define SPELL_RAPTOR_CALL 59416 //dummy + + +struct TRINITY_DLL_DECL boss_dredAI : public ScriptedAI +{ + boss_dredAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) {} + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) {} +}; + +CreatureAI* GetAI_boss_dred(Creature* pCreature) +{ + return new boss_dredAI (pCreature); +} + +void AddSC_boss_dred() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_dred"; + newscript->GetAI = &GetAI_boss_dred; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/draktharon_keep/boss_novos.cpp b/src/bindings/scripts/scripts/northrend/draktharon_keep/boss_novos.cpp new file mode 100644 index 00000000000..2f1cc7d22fc --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/draktharon_keep/boss_novos.cpp @@ -0,0 +1,75 @@ +/* Script Data Start +SDName: Boss novos +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = 'boss_novos' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_ARCANE_BLAST_N 49198 +#define SPELL_ARCANE_BLAST_H 59909 +#define SPELL_ARCANE_FIELD 47346 +#define SPELL_BLIZZARD_N 49034 +#define SPELL_BLIZZARD_H 59854 +#define SPELL_FROSTBOLT_N 49037 +#define SPELL_FROSTBOLT_H 59855 +#define SPELL_WRATH_OF_MISERY_N 50089 +#define SPELL_WRATH_OF_MISERY_H 59856 +#define SPELL_SUMMON_MINIONS 59910 //Summons an army of Fetid Troll Corpses to assist the caster. + +//Yell +#define SAY_AGGRO -1600000 +#define SAY_KILL -1600001 +#define SAY_DEATH -1600002 +#define SAY_NECRO_ADD -1600003 +#define SAY_REUBBLE_1 -1600004 +#define SAY_REUBBLE_2 -1600005 + +struct TRINITY_DLL_DECL boss_novosAI : public ScriptedAI +{ + boss_novosAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) {} + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + DoScriptText(SAY_KILL, m_creature); + } +}; + +CreatureAI* GetAI_boss_novos(Creature* pCreature) +{ + return new boss_novosAI (pCreature); +} + +void AddSC_boss_novos() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_novos"; + newscript->GetAI = &GetAI_boss_novos; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/draktharon_keep/boss_tharon_ja.cpp b/src/bindings/scripts/scripts/northrend/draktharon_keep/boss_tharon_ja.cpp new file mode 100644 index 00000000000..62d724f4de4 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/draktharon_keep/boss_tharon_ja.cpp @@ -0,0 +1,88 @@ +/* Script Data Start +SDName: Boss tharon_ja +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = 'boss_tharon_ja' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_COURSE_OF_LIFE 49527 +#define SPELL_DECAY_FLESH 49356 //casted at end of pahase 1, starts phase 2 +#define SPELL_EYE_BEAM_N 49544 +#define SPELL_LIGHTNING_BREATH_N 49537 +#define SPELL_POISON_CLOUD_N 49548 +#define SPELL_RAIN_OF_FIRE_N 49518 +#define SPELL_RETURN_FLESH 53463 //Channeled spell ending phase two and returning to phase 1. This ability will stun the party for 6 seconds. +#define SPELL_SHADOW_VOLLEY_N 49528 + +//Spells Heroic +#define SPELL_COURSE_OF_LIFE_H 59972 +#define SPELL_EYE_BEAM_H 59965 +#define SPELL_LIGHTNING_BREATH_H 59963 +#define SPELL_POISON_CLOUD_H 59969 +#define SPELL_RAIN_OF_FIRE_H 59971 +#define SPELL_SHADOW_VOLLEY_H 59973 + +//Players skills durring Phase2 +#define PLAYER_PHASE2_SLAYING_STRIKE 50799 +#define PLAYER_PHASE2_TAUNT 49613 +#define PLAYER_PHASE2_BONE_ARMOR 49609 +#define PLAYER_PHASE2_TOUCH_OF_LIFE 49617 +//Phase 1 all abilities except Eye beam +//Phase 2 turns players to skeletons with new abilities, boss grows skin + +//Yell +#define SAY_AGGRO 1600011 +#define SAY_KILL_1 1600012 +#define SAY_KILL_2 1600013 +#define SAY_FLESH_1 1600014 +#define SAY_FLESH_2 1600015 +#define SAY_SKELETON_1 1600016 +#define SAY_SKELETON_2 1600017 +#define SAY_DEATH 1600018 + +struct TRINITY_DLL_DECL boss_tharon_jaAI : public ScriptedAI +{ + boss_tharon_jaAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH,m_creature); + } +}; + +CreatureAI* GetAI_boss_tharon_ja(Creature* pCreature) +{ + return new boss_tharon_jaAI (pCreature); +} + +void AddSC_boss_tharon_ja() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_tharon_ja"; + newscript->GetAI = &GetAI_boss_tharon_ja; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/draktharon_keep/boss_trollgore.cpp b/src/bindings/scripts/scripts/northrend/draktharon_keep/boss_trollgore.cpp new file mode 100644 index 00000000000..59f68c37205 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/draktharon_keep/boss_trollgore.cpp @@ -0,0 +1,75 @@ +/* Script Data Start +SDName: Boss trollgore +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = 'boss_trollgore' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spell +#define SPELL_INFECTED_WOUND 49637 +#define SPELL_CRUSH 49639 +#define SPELL_CORPSE_EXPLODE_N 49555 +#define SPELL_CONSUME_N 49380 + +//Spell Heroic +#define SPELL_CORPSE_EXPLODE_H 59807 +#define SPELL_CONSUME_H 59803 + +//Yell +#define SAY_AGGRO -1600006 +#define SAY_KILL -1600007 +#define SAY_CONSUME -1600008 +#define SAY_EXPLODE -1600009 +#define SAY_DEATH -1600010 + +struct TRINITY_DLL_DECL boss_trollgoreAI : public ScriptedAI +{ + boss_trollgoreAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + DoScriptText(SAY_KILL, m_creature); + } +}; + +CreatureAI* GetAI_boss_trollgore(Creature* pCreature) +{ + return new boss_trollgoreAI (pCreature); +} + +void AddSC_boss_trollgore() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_trollgore"; + newscript->GetAI = &GetAI_boss_trollgore; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/draktharon_keep/def_drak_tharon_keep.h b/src/bindings/scripts/scripts/northrend/draktharon_keep/def_drak_tharon_keep.h new file mode 100644 index 00000000000..321d77a9c27 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/draktharon_keep/def_drak_tharon_keep.h @@ -0,0 +1,4 @@ +#ifndef DEF_DRAK_THARON_H +#define DEF_DRAK_THARON_H + +#endif diff --git a/src/bindings/scripts/scripts/northrend/draktharon_keep/instance_drak_tharon_keep.cpp b/src/bindings/scripts/scripts/northrend/draktharon_keep/instance_drak_tharon_keep.cpp new file mode 100644 index 00000000000..795f36eca18 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/draktharon_keep/instance_drak_tharon_keep.cpp @@ -0,0 +1,21 @@ +#include "precompiled.h" +#include "def_drak_tharon_keep.h" + +struct TRINITY_DLL_DECL instance_drak_tharon : public ScriptedInstance +{ + instance_drak_tharon(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; +}; + +InstanceData* GetInstanceData_instance_drak_tharon(Map* pMap) +{ + return new instance_drak_tharon(pMap); +} + +void AddSC_instance_drak_tharon() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_drak_tharon"; + newscript->GetInstanceData = &GetInstanceData_instance_drak_tharon; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/gundrak/boss_drakkari_colossus.cpp b/src/bindings/scripts/scripts/northrend/gundrak/boss_drakkari_colossus.cpp new file mode 100644 index 00000000000..4d18ad6ba7c --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/gundrak/boss_drakkari_colossus.cpp @@ -0,0 +1,55 @@ +/* Script Data Start +SDName: Boss Drakkari Colossus +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = '' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_EMERGE 54850 //to phase2, Colossus unatackable, Elemental emerges +#define SPELL_EMERGE_2 54851 +#define SPELL_MIGHTY_BLOW 54719 + +struct TRINITY_DLL_DECL boss_drakkari_colossusAI : public ScriptedAI +{ + boss_drakkari_colossusAI(Creature *c) : ScriptedAI(c) {} + + uint32 phase; + + void Reset() {} + void EnterCombat(Unit* who) {} + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + phase =1; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) {} +}; + +CreatureAI* GetAI_boss_drakkari_colossus(Creature* pCreature) +{ + return new boss_drakkari_colossusAI (pCreature); +} + +void AddSC_boss_drakkari_colossus() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_drakkari_colossus"; + newscript->GetAI = &GetAI_boss_drakkari_colossus; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/gundrak/boss_eck.cpp b/src/bindings/scripts/scripts/northrend/gundrak/boss_eck.cpp new file mode 100644 index 00000000000..8c72de6c9ad --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/gundrak/boss_eck.cpp @@ -0,0 +1,65 @@ +/* Script Data Start +SDName: Boss Eck the Ferocious +SDAuthor: LordVanMartin +SD%Complete: +SDComment: Only appears in Heroic mode +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = '' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +#define SPELL_ECK_BERSERK 55816 //Eck goes berserk, increasing his attack speed by 150% and all damage he deals by 500%. +#define SPELL_ECK_BITE 55813 //Eck bites down hard, inflicting 150% of his normal damage to an enemy. +#define SPELL_ECK_SPIT 55814 //Eck spits toxic bile at enemies in a cone in front of him, inflicting 2970 Nature damage and draining 220 mana every 1 sec for 3 sec. +#define SPELL_ECK_SPRING_1 55815 //Eck leaps at a distant target. --> Drops aggro and charges a random player. Tank can simply taunt him back. +#define SPELL_ECK_SPRING_2 55837 //Eck leaps at a distant target. + +struct TRINITY_DLL_DECL boss_eckAI : public ScriptedAI +{ + boss_eckAI(Creature *c) : ScriptedAI(c) {} + + uint32 berserk; + + void Reset() + { + //Source Deadly Boss Mod + berserk = 120000; //2min + } + + void EnterCombat(Unit* who) {} + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + if (berserk < diff) + { + DoCast(m_creature,SPELL_ECK_BERSERK); + berserk = 120000; + }else berserk -= diff; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) {} +}; + +CreatureAI* GetAI_boss_eck(Creature* pCreature) +{ + return new boss_eckAI (pCreature); +} + +void AddSC_boss_eck() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_eck"; + newscript->GetAI = &GetAI_boss_eck; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/gundrak/boss_gal_darah.cpp b/src/bindings/scripts/scripts/northrend/gundrak/boss_gal_darah.cpp new file mode 100644 index 00000000000..65edd1b312e --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/gundrak/boss_gal_darah.cpp @@ -0,0 +1,85 @@ +/* Script Data Start +SDName: Boss gal_darah +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = '' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_ENRAGE 55285 +#define SPELL_IMPALING_CHARGE 54956 +#define SPELL_STOMP 55292 + +#define SPELL_PUNCTURE 55276 +#define SPELL_STAMPEDE 55218 +#define SPELL_WHIRLING_SLASH 55285 + +//Yells +#define SAY_AGGRO -1604000 +#define SAY_SLAY_1 -1604001 +#define SAY_SLAY_2 -1604002 +#define SAY_SLAY_3 -1604003 +#define SAY_DEATH -1604004 +#define SAY_SUMMON_RHINO_1 -1604005 +#define SAY_SUMMON_RHINO_2 -1604006 +#define SAY_SUMMON_RHINO_3 -1604007 +#define SAY_TRANSFORM_1 -1604008 //Phase change +#define SAY_TRANSFORM_2 -1604009 + +struct TRINITY_DLL_DECL boss_gal_darahAI : public ScriptedAI +{ + boss_gal_darahAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature);break; + case 1: DoScriptText(SAY_SLAY_2, m_creature);break; + case 2: DoScriptText(SAY_SLAY_3, m_creature);break; + } + } +}; + +CreatureAI* GetAI_boss_gal_darah(Creature* pCreature) +{ + return new boss_gal_darahAI (pCreature); +} + +void AddSC_boss_gal_darah() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_gal_darah"; + newscript->GetAI = &GetAI_boss_gal_darah; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/gundrak/boss_moorabi.cpp b/src/bindings/scripts/scripts/northrend/gundrak/boss_moorabi.cpp new file mode 100644 index 00000000000..7bdbe0eebc9 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/gundrak/boss_moorabi.cpp @@ -0,0 +1,88 @@ +/* Script Data Start +SDName: Boss moorabi +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = 'boss_moorabi' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_DETERMINED_GORE 55102 +#define SPELL_DETERMINED_STAB_2 59444 +#define SPELL_DETERMINED_STAB_3 55104 + +#define SPELL_GROUND_TREMOR 55142 +#define SPELL_MOJO_FRENZY 55163 +#define SPELL_NUMBING_ROAR_1 55100 +#define SPELL_NUMBING_ROAR_2 55106 +#define SPELL_TRANSFORMATION 55098 //Periodic, The caster transforms into a powerful mammoth, increasing Physical damage done by 25% and granting immunity to Stun effects. +#define SPELL_QUAKE 55101 + +//Yell +#define SAY_AGGRO -1604010 +#define SAY_SLAY_1 -1604011 +#define SAY_SLAY_2 -1604012 +#define SAY_SLAY_3 -1604013 +#define SAY_DEATH -1604014 +#define SAY_TRANSFORM -1604015 +#define SAY_QUAKE -1604016 + +struct TRINITY_DLL_DECL boss_moorabiAI : public ScriptedAI +{ + boss_moorabiAI(Creature *c) : ScriptedAI(c) {} + + uint32 phase; + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + phase =1; + //Return since we have no target + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature);break; + case 1: DoScriptText(SAY_SLAY_2, m_creature);break; + case 2: DoScriptText(SAY_SLAY_3, m_creature);break; + } + } +}; + +CreatureAI* GetAI_boss_moorabi(Creature* pCreature) +{ + return new boss_moorabiAI (pCreature); +} + +void AddSC_boss_moorabi() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_moorabi"; + newscript->GetAI = &GetAI_boss_moorabi; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/gundrak/boss_slad_ran.cpp b/src/bindings/scripts/scripts/northrend/gundrak/boss_slad_ran.cpp new file mode 100644 index 00000000000..559a0090e3b --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/gundrak/boss_slad_ran.cpp @@ -0,0 +1,95 @@ +/* Script Data Start +SDName: Boss slad_ran +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = 'boss_slad_ran' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_POISON_NOVA 55081 +#define SPELL_POISON_NOVA_2 59842 +//-- +#define SPELL_POWERFUL_BITE 48287 +#define SPELL_POWERFUL_BITE_2 59840 +//-- +#define SPELL_VENOM_BOLT 54970 +#define SPELL_VENOM_BOLT_2 59839 +//At 30% HPStart summoning small serpents + +//Yell +#define SAY_AGGRO -1604017 +#define SAY_SLAY_1 -1604018 +#define SAY_SLAY_2 -1604019 +#define SAY_SLAY_3 -1604020 +#define SAY_DEATH -1604021 +#define SAY_SUMMON_SNAKES -1604022 //npc 29680 +#define SAY_SUMMON_CONSTRICTORS -1604023 //npc 29713, can cast Grip of Slad'ran (spell 55093) + +struct TRINITY_DLL_DECL boss_slad_ranAI : public ScriptedAI +{ + boss_slad_ranAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 30) + { + //Summon 3 snakes --> npc 29680 + DoScriptText(SAY_SUMMON_SNAKES,m_creature); + } + if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 25) + { + //Summon 3 constrictors --> npc 29713 + DoScriptText(SAY_SUMMON_CONSTRICTORS,m_creature); + } + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + + switch(rand()%3) + { + case 0:DoScriptText(SAY_SLAY_1, m_creature);break; + case 1:DoScriptText(SAY_SLAY_2, m_creature);break; + case 2:DoScriptText(SAY_SLAY_3, m_creature);break; + } + } +}; + +CreatureAI* GetAI_boss_slad_ran(Creature* pCreature) +{ + return new boss_slad_ranAI (pCreature); +} + +void AddSC_boss_slad_ran() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_slad_ran"; + newscript->GetAI = &GetAI_boss_slad_ran; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/gundrak/def_gundrak.h b/src/bindings/scripts/scripts/northrend/gundrak/def_gundrak.h new file mode 100644 index 00000000000..5f015610312 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/gundrak/def_gundrak.h @@ -0,0 +1,4 @@ +#ifndef DEF_GUNDRAK_H +#define DEF_GUNDRAK_H + +#endif diff --git a/src/bindings/scripts/scripts/northrend/gundrak/instance_gundrak.cpp b/src/bindings/scripts/scripts/northrend/gundrak/instance_gundrak.cpp new file mode 100644 index 00000000000..0ed874d905f --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/gundrak/instance_gundrak.cpp @@ -0,0 +1,21 @@ +#include "precompiled.h" +#include "def_gundrak.h" + +struct TRINITY_DLL_DECL instance_gundrak : public ScriptedInstance +{ + instance_gundrak(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; +}; + +InstanceData* GetInstanceData_instance_gundrak(Map* pMap) +{ + return new instance_gundrak(pMap); +} + +void AddSC_instance_gundrak() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_gundrak"; + newscript->GetInstanceData = &GetInstanceData_instance_gundrak; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/naxxramas/boss_anubrekhan.cpp b/src/bindings/scripts/scripts/northrend/naxxramas/boss_anubrekhan.cpp new file mode 100644 index 00000000000..835a5bfa2da --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/naxxramas/boss_anubrekhan.cpp @@ -0,0 +1,123 @@ +/* Copyright (C) 2008 - 2009 Trinity + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "precompiled.h" +#include "def_naxxramas.h" + +#define SAY_GREET RAND(-1533000,-1533004,-1533005,-1533006,-1533007) +#define SAY_AGGRO RAND(-1533001,-1533002,-1533003) +#define SAY_SLAY -1533008 + +#define SPELL_IMPALE HEROIC(28783,56090) +#define SPELL_LOCUSTSWARM HEROIC(28785,54021) + +#define SPELL_SELF_SPAWN_5 29105 //This spawns 5 corpse scarabs ontop of us (most likely the player casts this on death) + +#define EVENT_IMPALE 1 +#define EVENT_LOCUST 2 + +#define MOB_CRYPT_GUARD 16573 + +struct TRINITY_DLL_DECL boss_anubrekhanAI : public BossAI +{ + boss_anubrekhanAI(Creature *c) : BossAI(c, BOSS_ANUBREKHAN) { HasTaunted = false; } + + bool HasTaunted; + + void Prepare() + { + HasTaunted = false; + DoSpawnCreature(MOB_CRYPT_GUARD, 0, 10, 0, me->GetOrientation(), TEMPSUMMON_CORPSE_TIMED_DESPAWN, 60000); + if (HeroicMode) + DoSpawnCreature(MOB_CRYPT_GUARD, 0, -10, 0, me->GetOrientation(), TEMPSUMMON_CORPSE_TIMED_DESPAWN, 60000); + } + + void InitializeAI() { Prepare(); } + void JustReachedHome() { Prepare(); _JustReachedHome(); } + + void KilledUnit(Unit* victim) + { + //Force the player to spawn corpse scarabs via spell + victim->CastSpell(victim, SPELL_SELF_SPAWN_5, true, NULL, NULL, me->GetGUID()); + + if (!(rand()%5)) + DoScriptText(SAY_SLAY, me); + } + + void EnterCombat(Unit *who) + { + _EnterCombat(); + DoScriptText(SAY_AGGRO, me); + events.ScheduleEvent(EVENT_IMPALE, 15000, 1); + events.ScheduleEvent(EVENT_LOCUST, 80000 + rand()%40000, 1); + } + + void MoveInLineOfSight(Unit *who) + { + if (!HasTaunted && me->IsWithinDistInMap(who, 60.0f)) + { + DoScriptText(SAY_GREET, me); + HasTaunted = true; + } + ScriptedAI::MoveInLineOfSight(who); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim() || !CheckInRoom()) + return; + + events.Update(diff); + + while(uint32 eventId = events.ExecuteEvent()) + { + switch(eventId) + { + case EVENT_IMPALE: + //Cast Impale on a random target + //Do NOT cast it when we are afflicted by locust swarm + if (!me->HasAura(SPELL_LOCUSTSWARM)) + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + DoCast(target, SPELL_IMPALE); + events.ScheduleEvent(EVENT_IMPALE, 15000, 1); + events.DelayEvents(1500, 1); + return; + case EVENT_LOCUST: + DoCast(m_creature, SPELL_LOCUSTSWARM); + DoSpawnCreature(MOB_CRYPT_GUARD, 5, 5, 0, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 60000); + events.ScheduleEvent(EVENT_LOCUST, 90000, 1); + return; + } + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_anubrekhan(Creature* pCreature) +{ + return new boss_anubrekhanAI (pCreature); +} + +void AddSC_boss_anubrekhan() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_anubrekhan"; + newscript->GetAI = &GetAI_boss_anubrekhan; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/northrend/naxxramas/boss_faerlina.cpp b/src/bindings/scripts/scripts/northrend/naxxramas/boss_faerlina.cpp new file mode 100644 index 00000000000..4be8f839e3d --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/naxxramas/boss_faerlina.cpp @@ -0,0 +1,122 @@ +/* + * Copyright (C) 2008 - 2009 Trinity + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "precompiled.h" +#include "def_naxxramas.h" + +#define SAY_GREET -1533009 +#define SAY_AGGRO RAND(-1533010,-1533011,-1533012,-1533013) +#define SAY_SLAY RAND(-1533014,-1533015) +#define SAY_DEATH -1533016 + +//#define SOUND_RANDOM_AGGRO 8955 //soundId containing the 4 aggro sounds, we not using this + +#define SPELL_POSION_BOLT_VOLLEY HEROIC(28796,54098) +#define SPELL_RAIN_OF_FIRE HEROIC(28794,54099) +#define SPELL_FRENZY HEROIC(28798,54100) +#define SPELL_WIDOWS_EMBRACE HEROIC(28732,54097) + +enum Events +{ + EVENT_POSION = 1, + EVENT_FIRE, + EVENT_FRENZY, +}; + +struct TRINITY_DLL_DECL boss_faerlinaAI : public BossAI +{ + boss_faerlinaAI(Creature *c) : BossAI(c, BOSS_FAERLINA), greet(false) {} + + bool greet; + + void EnterCombat(Unit *who) + { + _EnterCombat(); + DoScriptText(SAY_AGGRO, me); + events.ScheduleEvent(EVENT_POSION, 10000 + rand()%15000); + events.ScheduleEvent(EVENT_FIRE, 5000 + rand()%15000); + events.ScheduleEvent(EVENT_FRENZY, 60000 + rand()%20000); + } + + void MoveInLineOfSight(Unit *who) + { + if (!greet) + { + DoScriptText(SAY_GREET, me); + greet = true; + } + BossAI::MoveInLineOfSight(who); + } + + void KilledUnit(Unit* victim) + { + if (!(rand()%3)) + DoScriptText(SAY_SLAY, me); + } + + void JustDied(Unit* Killer) + { + _JustDied(); + DoScriptText(SAY_DEATH, me); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + events.Update(diff); + + while(uint32 eventId = events.ExecuteEvent()) + { + switch(eventId) + { + case EVENT_POSION: + if (!me->HasAura(SPELL_WIDOWS_EMBRACE)) + DoCastAOE(SPELL_POSION_BOLT_VOLLEY); + events.ScheduleEvent(EVENT_POSION, 10000 + rand()%15000); + return; + case EVENT_FIRE: + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + DoCast(target, SPELL_RAIN_OF_FIRE); + events.ScheduleEvent(EVENT_FIRE, 5000 + rand()%15000); + return; + case EVENT_FRENZY: + DoCast(me,SPELL_FRENZY); + events.ScheduleEvent(EVENT_FRENZY, 60000 + rand()%20000); + return; + } + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_faerlina(Creature* pCreature) +{ + return new boss_faerlinaAI (pCreature); +} + +void AddSC_boss_faerlina() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_faerlina"; + newscript->GetAI = &GetAI_boss_faerlina; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/naxxramas/boss_four_horsemen.cpp b/src/bindings/scripts/scripts/northrend/naxxramas/boss_four_horsemen.cpp new file mode 100644 index 00000000000..467f5ef62e9 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/naxxramas/boss_four_horsemen.cpp @@ -0,0 +1,167 @@ +/* Copyright (C) 2008 - 2009 Trinity + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "precompiled.h" +#include "def_naxxramas.h" + +enum Horsemen +{ + HORSEMEN_THANE, + HORSEMEN_LADY, + HORSEMEN_BARON, + HORSEMEN_SIR, +}; + +enum Events +{ + EVENT_MARK = 1, + EVENT_CAST, + EVENT_BERSERK, +}; + +const uint32 MOB_HORSEMEN[] = {16064, 16065, 30549, 16063}; +const uint32 SPELL_MARK[] = {28832, 28833, 28834, 28835}; +#define SPELL_PRIMARY(i) HEROIC(SPELL_PRIMARY_N[i],SPELL_PRIMARY_H[i]) +const uint32 SPELL_PRIMARY_N[] = {28884, 28863, 28882, 28883}; +const uint32 SPELL_PRIMARY_H[] = {57467, 57463, 57369, 57466}; +#define SPELL_SECONDARY(i) HEROIC(SPELL_SECONDARY_N[i],SPELL_SECONDARY_H[i]) +const uint32 SPELL_SECONDARY_N[]= {0, 57374, 0, 57376}; +const uint32 SPELL_SECONDARY_H[]= {0, 57464, 0, 57465}; +const uint32 SPELL_PUNISH[] = {0, 57381, 0, 57377}; +#define SPELL_BERSERK 26662 + +const int32 SAY_AGGRO[] = {-1533051, -1533044, -1533065, -1533058}; +const int32 SAY_TAUNT[3][4] ={ {-1533052, -1533045, -1533071, -1533059}, + {-1533053, -1533046, -1533072, -1533060}, + {-1533054, -1533047, -1533073, -1533061},}; +const int32 SAY_SPECIAL[] = {-1533055, -1533048, -1533070, -1533062}; +const int32 SAY_SLAY[] = {-1533056, -1533049, -1533068, -1533063}; +const int32 SAY_DEATH[] = {-1533057, -1533050, -1533074, -1533064}; + +#define SAY_BARON_AGGRO RAND(-1533065,-1533066,-1533067) +#define SAY_BARON_SLAY RAND(-1533068,-1533069) + +struct TRINITY_DLL_DECL boss_four_horsemenAI : public BossAI +{ + boss_four_horsemenAI(Creature *c) : BossAI(c, BOSS_HORSEMEN) + { + id = Horsemen(0); + for(uint8 i = 1; i < 4; ++i) + if (me->GetEntry() == MOB_HORSEMEN[i]) + id = Horsemen(i); + caster = (id == HORSEMEN_LADY || id == HORSEMEN_SIR); + } + + Horsemen id; + bool caster; + + void MoveInLineOfSight(Unit *who) + { + BossAI::MoveInLineOfSight(who); + if (caster) + SelectNearestTarget(who); + } + + void AttackStart(Unit *who) + { + if (caster) + AttackStartCaster(who, 20); + else + BossAI::AttackStart(who); + } + + void KilledUnit(Unit* victim) + { + if (!(rand()%5)) + { + if (id == HORSEMEN_BARON) + DoScriptText(SAY_BARON_SLAY, me); + else + DoScriptText(SAY_SLAY[id], me); + } + } + + void JustDied(Unit* killer) + { + _JustDied(); + DoScriptText(SAY_DEATH[id], me); + } + + void EnterCombat(Unit *who) + { + _EnterCombat(); + if (id == HORSEMEN_BARON) + DoScriptText(SAY_BARON_AGGRO, me); + else + DoScriptText(SAY_AGGRO[id], me); + events.ScheduleEvent(EVENT_MARK, 15000); + events.ScheduleEvent(EVENT_CAST, 20000+rand()%5000); + events.ScheduleEvent(EVENT_BERSERK, 15*100*1000); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim() || !CheckInRoom()) + return; + + events.Update(diff); + + if (me->hasUnitState(UNIT_STAT_CASTING)) + return; + + while(uint32 eventId = events.ExecuteEvent()) + { + switch(eventId) + { + case EVENT_MARK: + if (!(rand()%5)) + DoScriptText(SAY_SPECIAL[id], me); + DoCastAOE(SPELL_MARK[id]); + events.ScheduleEvent(EVENT_MARK, 15000); + return; + case EVENT_CAST: + if (!(rand()%5)) + DoScriptText(SAY_TAUNT[rand()%3][id], me); + DoCast(SPELL_PRIMARY(id)); + events.ScheduleEvent(EVENT_CAST, 15000); + return; + case EVENT_BERSERK: + DoScriptText(SAY_SPECIAL[id], me); + DoCast(me, EVENT_BERSERK); + return; + } + } + + if (!caster) + DoMeleeAttackIfReady(); + else if (!DoSpellAttackIfReady(SPELL_SECONDARY(id))) + DoCastAOE(SPELL_PUNISH[id]); + } +}; + +CreatureAI* GetAI_four_horsemen(Creature* pCreature) +{ + return new boss_four_horsemenAI (pCreature); +} + +void AddSC_boss_four_horsemen() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_four_horsemen"; + newscript->GetAI = &GetAI_four_horsemen; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/naxxramas/boss_gluth.cpp b/src/bindings/scripts/scripts/northrend/naxxramas/boss_gluth.cpp new file mode 100644 index 00000000000..a92c34a019c --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/naxxramas/boss_gluth.cpp @@ -0,0 +1,160 @@ +/* Copyright (C) 2008 - 2009 Trinity + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "precompiled.h" +#include "def_naxxramas.h" + +#define SPELL_MORTAL_WOUND 25646 +#define SPELL_ENRAGE HEROIC(28371,54427) +#define SPELL_DECIMATE HEROIC(28374,54426) +#define SPELL_BERSERK 26662 +#define SPELL_INFECTED_WOUND 29306 + +#define MOB_ZOMBIE 16360 + +const float PosSummon[3][4] = +{ + {3267.9, -3172.1, 297.42, 0.94}, + {3253.2, -3132.3, 297.42, 0}, + {3308.3, -3185.8, 297.42, 1.58}, +}; + +enum Events +{ + EVENT_WOUND = 1, + EVENT_ENRAGE, + EVENT_DECIMATE, + EVENT_BERSERK, + EVENT_SUMMON, +}; + +struct TRINITY_DLL_DECL boss_gluthAI : public BossAI +{ + boss_gluthAI(Creature *c) : BossAI(c, BOSS_GLUTH) + { + // Do not let Gluth be affected by zombies' debuff + me->ApplySpellImmune(0, IMMUNITY_ID, SPELL_INFECTED_WOUND, true); + } + + std::vector triggers; + + void Reset() + { + triggers.clear(); + _Reset(); + } + + void MoveInLineOfSight(Unit *who) + { + if (who->GetEntry() == MOB_ZOMBIE && me->IsWithinDistInMap(who, 20)) + { + SetGazeOn(who); + me->MonsterTextEmote(" spots a nearby zombie to devour!", 0, true); + } + else + BossAI::MoveInLineOfSight(who); + } + + void EnterCombat(Unit *who) + { + for(uint32 i = 0; i < 3; ++i) + if (Creature *trigger = DoSummon(WORLD_TRIGGER, PosSummon[i])) + triggers.push_back(trigger); + if (triggers.size() < 3) + { + error_log("Script Gluth: cannot summon triggers!"); + EnterEvadeMode(); + return; + } + + _EnterCombat(); + events.ScheduleEvent(EVENT_WOUND, 10000); + events.ScheduleEvent(EVENT_ENRAGE, 30000); + events.ScheduleEvent(EVENT_DECIMATE, 105000); + events.ScheduleEvent(EVENT_BERSERK, 8*60000); + events.ScheduleEvent(EVENT_SUMMON, 10000); + } + + void JustSummoned(Creature *summon) + { + if (summon->GetEntry() == WORLD_TRIGGER) + summon->setActive(true); + else if (summon->GetEntry() == MOB_ZOMBIE) + summon->AI()->AttackStart(me); + summons.Summon(summon); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictimWithGaze() || !CheckInRoom()) + return; + + events.Update(diff); + + while(uint32 eventId = events.ExecuteEvent()) + { + switch(eventId) + { + case EVENT_WOUND: + DoCast(me->getVictim(), SPELL_MORTAL_WOUND); + events.ScheduleEvent(EVENT_WOUND, 10000); + return; + case EVENT_ENRAGE: + DoCast(me, SPELL_ENRAGE); + events.ScheduleEvent(EVENT_ENRAGE, 30000); + return; + case EVENT_DECIMATE: + DoCastAOE(SPELL_DECIMATE); + events.ScheduleEvent(EVENT_DECIMATE, 105000); + return; + case EVENT_BERSERK: + DoCast(me, SPELL_BERSERK); + return; + case EVENT_SUMMON: + for(uint32 i = 0; i < HEROIC(1,2); ++i) + DoSummon(MOB_ZOMBIE, triggers[rand()%3]); + events.ScheduleEvent(EVENT_SUMMON, 10000); + return; + } + } + + if (me->getVictim()->GetEntry() == MOB_ZOMBIE) + { + if (me->IsWithinMeleeRange(me->getVictim())) + { + me->Kill(me->getVictim()); + me->ModifyHealth(me->GetMaxHealth() * 0.05f); + } + } + else + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_gluth(Creature* pCreature) +{ + return new boss_gluthAI (pCreature); +} + +void AddSC_boss_gluth() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_gluth"; + newscript->GetAI = &GetAI_boss_gluth; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/northrend/naxxramas/boss_gothik.cpp b/src/bindings/scripts/scripts/northrend/naxxramas/boss_gothik.cpp new file mode 100644 index 00000000000..f98e7667e6e --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/naxxramas/boss_gothik.cpp @@ -0,0 +1,347 @@ +/* Copyright (C) 2008 - 2009 Trinity + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "precompiled.h" +#include "def_naxxramas.h" + +#define SAY_SPEECH -1533040 +#define SAY_KILL -1533041 +#define SAY_DEATH -1533042 +#define SAY_TELEPORT -1533043 + +//Gothik +#define SPELL_HARVEST_SOUL 28679 +#define SPELL_SHADOW_BOLT HEROIC(29317,56405) + +#define SPELL_INFORM_LIVE_TRAINEE 27892 +#define SPELL_INFORM_LIVE_KNIGHT 27928 +#define SPELL_INFORM_LIVE_RIDER 27935 +#define SPELL_INFORM_DEAD_TRAINEE 27915 +#define SPELL_INFORM_DEAD_KNIGHT 27931 +#define SPELL_INFORM_DEAD_RIDER 27937 + +#define MOB_LIVE_TRAINEE 16124 +#define MOB_LIVE_KNIGHT 16125 +#define MOB_LIVE_RIDER 16126 +#define MOB_DEAD_TRAINEE 16127 +#define MOB_DEAD_KNIGHT 16148 +#define MOB_DEAD_RIDER 16150 +#define MOB_DEAD_HORSE 16149 + +const struct Waves { uint32 entry, number, time; } +waves[] = +{ + {MOB_LIVE_TRAINEE, 2, 20000}, + {MOB_LIVE_TRAINEE, 2, 20000}, + {MOB_LIVE_TRAINEE, 2, 10000}, + {MOB_LIVE_KNIGHT, 1, 10000}, + {MOB_LIVE_TRAINEE, 2, 15000}, + {MOB_LIVE_KNIGHT, 1, 10000}, + {MOB_LIVE_TRAINEE, 2, 15000}, + {MOB_LIVE_TRAINEE, 2, 0}, + {MOB_LIVE_KNIGHT, 1, 10000}, + {MOB_LIVE_RIDER, 1, 10000}, + {MOB_LIVE_TRAINEE, 2, 5000}, + {MOB_LIVE_KNIGHT, 1, 15000}, + {MOB_LIVE_TRAINEE, 2, 0}, + {MOB_LIVE_RIDER, 1, 10000}, + {MOB_LIVE_KNIGHT, 2, 10000}, + {MOB_LIVE_TRAINEE, 2, 10000}, + {MOB_LIVE_RIDER, 1, 5000}, + {MOB_LIVE_KNIGHT, 1, 5000}, + {MOB_LIVE_TRAINEE, 2, 20000}, + {MOB_LIVE_TRAINEE, 2, 0}, + {MOB_LIVE_KNIGHT, 1, 0}, + {MOB_LIVE_RIDER, 1, 15000}, + {MOB_LIVE_TRAINEE, 2, 29000}, + {0, 0, 0}, +}; + +#define POS_Y_GATE -3360.78f + +enum Events +{ + EVENT_SUMMON = 1, + EVENT_HARVEST, + EVENT_BOLT, +}; + +#define POS_LIVE 3 +#define POS_DEAD 5 + +const float PosSummonLive[POS_LIVE][4] = +{ + {2669.7, -3430.9, 268.56, 1.6}, + {2692.0, -3430.9, 268.56, 1.6}, + {2714.1, -3430.9, 268.56, 1.6}, +}; + +const float PosSummonDead[POS_DEAD][4] = +{ + {2725.1, -3310.0, 268.85, 3.4}, + {2699.3, -3322.8, 268.60, 3.3}, + {2733.1, -3348.5, 268.84, 3.1}, + {2682.8, -3304.2, 268.85, 3.9}, + {2664.8, -3340.7, 268.23, 3.7}, +}; + +const float PosGround[4] = {2691.2, -3362.7, 267.68, 1.7}; +const float PosPlatform[4] = {2640.5, -3360.6, 285.26, 0}; + +struct TRINITY_DLL_DECL boss_gothikAI : public BossAI +{ + boss_gothikAI(Creature *c) : BossAI(c, BOSS_GOTHIK) {} + + uint32 waveCount; + std::vector liveTrigger; + std::vector deadTrigger; + + void Reset() + { + liveTrigger.clear(); + deadTrigger.clear(); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); + me->SetReactState(REACT_PASSIVE); + _Reset(); + } + + void EnterCombat(Unit *who) + { + for(uint32 i = 0; i < POS_LIVE; ++i) + if (Creature *trigger = DoSummon(WORLD_TRIGGER, PosSummonLive[i])) + liveTrigger.push_back(trigger); + for(uint32 i = 0; i < POS_DEAD; ++i) + if (Creature *trigger = DoSummon(WORLD_TRIGGER, PosSummonDead[i])) + deadTrigger.push_back(trigger); + + if (liveTrigger.size() < POS_LIVE || deadTrigger.size() < POS_DEAD) + { + error_log("Script Gothik: cannot summon triggers!"); + EnterEvadeMode(); + return; + } + + _EnterCombat(); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); + waveCount = 0; + events.ScheduleEvent(EVENT_SUMMON, 30000); + DoTeleportTo(PosPlatform); + DoScriptText(SAY_SPEECH, me); + if (instance) + instance->SetData(DATA_GOTHIK_GATE, 1); + } + + void JustSummoned(Creature *summon) + { + if (summon->GetEntry() == WORLD_TRIGGER) + summon->setActive(true); + else + { + summon->AI()->DoAction(me->HasReactState(REACT_PASSIVE) ? 1 : 0); + summon->AI()->EnterEvadeMode(); + } + summons.Summon(summon); + } + + void KilledUnit(Unit* victim) + { + if (!(rand()%5)) + DoScriptText(SAY_KILL, me); + } + + void JustDied(Unit* Killer) + { + _JustDied(); + DoScriptText(SAY_DEATH, me); + } + + void SpellHit(Unit *caster, const SpellEntry *spell) + { + uint32 spellId = 0; + switch(spell->Id) + { + case SPELL_INFORM_LIVE_TRAINEE: spellId = SPELL_INFORM_DEAD_TRAINEE; break; + case SPELL_INFORM_LIVE_KNIGHT: spellId = SPELL_INFORM_DEAD_KNIGHT; break; + case SPELL_INFORM_LIVE_RIDER: spellId = SPELL_INFORM_DEAD_RIDER; break; + } + if (spellId && me->isInCombat()) + { + me->HandleEmoteCommand(EMOTE_ONESHOT_SPELLCAST); + me->CastSpell(deadTrigger[rand()%POS_DEAD], spellId, true); + } + } + + void SpellHitTarget(Unit *target, const SpellEntry *spell) + { + if (!me->isInCombat()) + return; + + switch(spell->Id) + { + case SPELL_INFORM_DEAD_TRAINEE: DoSummon(MOB_DEAD_TRAINEE, target, 0); break; + case SPELL_INFORM_DEAD_KNIGHT: DoSummon(MOB_DEAD_KNIGHT, target, 0); break; + case SPELL_INFORM_DEAD_RIDER: DoSummon(MOB_DEAD_RIDER, target, 1.0f); + DoSummon(MOB_DEAD_HORSE, target, 1.0f); break; + } + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateCombatState() || !CheckInRoom()) + return; + + events.Update(diff); + + if (me->hasUnitState(UNIT_STAT_CASTING)) + return; + + while(uint32 eventId = events.ExecuteEvent()) + { + switch(eventId) + { + case EVENT_SUMMON: + if (waves[waveCount].entry) + { + for(uint32 i = 0; i < waves[waveCount].number; ++i) + DoSummon(waves[waveCount].entry, liveTrigger[rand()%POS_LIVE], 1.0f); + events.ScheduleEvent(EVENT_SUMMON, waves[waveCount].time); + ++waveCount; + } + else + { + DoScriptText(SAY_TELEPORT, me); + DoTeleportTo(PosGround); + me->SetReactState(REACT_AGGRESSIVE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); + if (instance) + instance->SetData(DATA_GOTHIK_GATE, 0); + summons.DoAction(0, 0); + summons.DoZoneInCombat(); + events.ScheduleEvent(EVENT_BOLT, 1000); + events.ScheduleEvent(EVENT_HARVEST, 15000); + } + break; + case EVENT_BOLT: + DoCast(me->getVictim(), SPELL_SHADOW_BOLT); + events.ScheduleEvent(EVENT_BOLT, 1000); + return; + case EVENT_HARVEST: + DoCast(me->getVictim(), SPELL_HARVEST_SOUL); + events.ScheduleEvent(EVENT_HARVEST, 15000); + return; + } + } + + DoMeleeAttackIfReady(); + } +}; + +struct TRINITY_DLL_DECL mob_gothik_minionAI : public SpellAI +{ + mob_gothik_minionAI(Creature *c) : SpellAI(c) + { + liveSide = me->GetPositionY() < POS_Y_GATE; + } + + bool liveSide; + bool gateClose; + +#define SIDE_CHECK(who) (liveSide == (who->GetPositionY() < POS_Y_GATE)) + + void DoAction(const int32 param) + { + gateClose = param; + } + + void DamageTaken(Unit *attacker, uint32 &damage) + { + if (gateClose && !SIDE_CHECK(attacker)) + damage = 0; + } + + void JustDied(Unit *killer) + { + if (me->isSummon()) + { + if (Unit *owner = CAST_SUM(me)->GetSummoner()) + SpellAI::JustDied(owner); + } + } + + void EnterEvadeMode() + { + if (!gateClose) + { + SpellAI::EnterEvadeMode(); + return; + } + + if (!_EnterEvadeMode()) + return; + + Map* pMap = me->GetMap(); + if (pMap->IsDungeon()) + { + Map::PlayerList const &PlayerList = pMap->GetPlayers(); + for(Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) + { + if (i->getSource()->isAlive() && SIDE_CHECK(i->getSource())) + { + AttackStart(i->getSource()); + return; + } + } + } + + me->GetMotionMaster()->MoveIdle(); + Reset(); + } + + void UpdateAI(const uint32 diff) + { + if (gateClose && (!SIDE_CHECK(me) || me->getVictim() && !SIDE_CHECK(me->getVictim()))) + { + EnterEvadeMode(); + return; + } + + SpellAI::UpdateAI(diff); + } +}; + +CreatureAI* GetAI_boss_gothik(Creature* pCreature) +{ + return new boss_gothikAI (pCreature); +} + +CreatureAI* GetAI_mob_gothik_minion(Creature* pCreature) +{ + return new mob_gothik_minionAI (pCreature); +} + +void AddSC_boss_gothik() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_gothik"; + newscript->GetAI = &GetAI_boss_gothik; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_gothik_minion"; + newscript->GetAI = &GetAI_mob_gothik_minion; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/naxxramas/boss_grobbulus.cpp b/src/bindings/scripts/scripts/northrend/naxxramas/boss_grobbulus.cpp new file mode 100644 index 00000000000..9195e0e7828 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/naxxramas/boss_grobbulus.cpp @@ -0,0 +1,103 @@ +/* Copyright (C) 2008 - 2009 Trinity + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "precompiled.h" +#include "def_naxxramas.h" + +#define SPELL_BOMBARD_SLIME 28280 + +#define SPELL_POISON_CLOUD 28240 +#define SPELL_MUTATING_INJECTION 28169 +#define SPELL_SLIME_SPRAY HEROIC(28157,54364) +#define SPELL_BERSERK 26662 + +#define EVENT_BERSERK 1 +#define EVENT_CLOUD 2 +#define EVENT_INJECT 3 +#define EVENT_SPRAY 4 + +#define MOB_FALLOUT_SLIME 16290 + +struct TRINITY_DLL_DECL boss_grobbulusAI : public BossAI +{ + boss_grobbulusAI(Creature *c) : BossAI(c, BOSS_GROBBULUS) {} + + void EnterCombat(Unit *who) + { + _EnterCombat(); + events.ScheduleEvent(EVENT_CLOUD, 15000); + events.ScheduleEvent(EVENT_INJECT, 20000); + events.ScheduleEvent(EVENT_SPRAY, 15000+rand()%15000); //not sure + events.ScheduleEvent(EVENT_BERSERK, 12*60000); + } + + void SpellHitTarget(Unit *target, const SpellEntry *spell) + { + if (spell->Id == SPELL_SLIME_SPRAY) + { + if (TempSummon *slime = me->SummonCreature(MOB_FALLOUT_SLIME, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 0)) + DoZoneInCombat(slime); + } + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + events.Update(diff); + + while(uint32 eventId = events.ExecuteEvent()) + { + switch(eventId) + { + case EVENT_CLOUD: + DoCastAOE(SPELL_POISON_CLOUD); + events.ScheduleEvent(EVENT_CLOUD, 15000); + return; + case EVENT_BERSERK: + DoCastAOE(SPELL_BERSERK); + return; + case EVENT_SPRAY: + DoCastAOE(SPELL_SLIME_SPRAY); + events.ScheduleEvent(EVENT_SPRAY, 15000+rand()%15000); + return; + case EVENT_INJECT: + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (!target->HasAura(SPELL_MUTATING_INJECTION)) + DoCast(target, SPELL_MUTATING_INJECTION); + events.ScheduleEvent(EVENT_INJECT, 8000 + 12000 * ((float)me->GetHealth() / me->GetMaxHealth())); + return; + } + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_grobbulus(Creature* pCreature) +{ + return new boss_grobbulusAI (pCreature); +} + +void AddSC_boss_grobbulus() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_grobbulus"; + newscript->GetAI = &GetAI_boss_grobbulus; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/naxxramas/boss_heigan.cpp b/src/bindings/scripts/scripts/northrend/naxxramas/boss_heigan.cpp new file mode 100644 index 00000000000..8491ab95703 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/naxxramas/boss_heigan.cpp @@ -0,0 +1,150 @@ +/* Copyright (C) 2008 - 2009 Trinity + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "precompiled.h" +#include "def_naxxramas.h" + +#define SAY_AGGRO RAND(-1533109,-1533110,-1533111) +#define SAY_SLAY -1533112 +#define SAY_TAUNT RAND(-1533113,-1533114,-1533115,-1533116,-1533117) +#define SAY_DEATH -1533118 + +#define SPELL_SPELL_DISRUPTION 29310 +#define SPELL_DECREPIT_FEVER HEROIC(29998,55011) +#define SPELL_PLAGUE_CLOUD 29350 + +enum Events +{ + EVENT_DISRUPT = 1, + EVENT_FEVER, + EVENT_ERUPT, + EVENT_PHASE, +}; + +enum Phases +{ + PHASE_FIGHT = 1, + PHASE_DANCE, +}; + +//Spell by eye stalks +#define SPELL_MIND_FLAY 26143 + +struct TRINITY_DLL_DECL boss_heiganAI : public BossAI +{ + boss_heiganAI(Creature *c) : BossAI(c, BOSS_HEIGAN) {} + + uint32 eruptSection; + bool eruptDirection; + Phases phase; + + void KilledUnit(Unit* Victim) + { + if (!(rand()%5)) + DoScriptText(SAY_SLAY, me); + } + + void JustDied(Unit* Killer) + { + _JustDied(); + DoScriptText(SAY_DEATH, me); + } + + void EnterCombat(Unit *who) + { + _EnterCombat(); + DoScriptText(SAY_AGGRO, me); + EnterPhase(PHASE_FIGHT); + } + + void EnterPhase(Phases newPhase) + { + phase = newPhase; + events.Reset(); + eruptSection = 3; + if (phase == PHASE_FIGHT) + { + events.ScheduleEvent(EVENT_DISRUPT, 0); + events.ScheduleEvent(EVENT_FEVER, 20000); + events.ScheduleEvent(EVENT_PHASE, 85000); + events.ScheduleEvent(EVENT_ERUPT, 10000); + } + else + { + float x, y, z, o; + me->GetHomePosition(x, y, z, o); + me->NearTeleportTo(x, y, z, o); + DoCastAOE(SPELL_PLAGUE_CLOUD); + events.ScheduleEvent(EVENT_PHASE, 45000); + events.ScheduleEvent(EVENT_ERUPT, 5000); + } + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim() || !CheckInRoom()) + return; + + events.Update(diff); + + while(uint32 eventId = events.ExecuteEvent()) + { + switch(eventId) + { + case EVENT_DISRUPT: + DoCastAOE(SPELL_SPELL_DISRUPTION); + events.ScheduleEvent(EVENT_DISRUPT, 5000); + return; + case EVENT_FEVER: + DoCastAOE(SPELL_DECREPIT_FEVER); + events.ScheduleEvent(EVENT_FEVER, 20000); + return; + case EVENT_PHASE: + EnterPhase(phase == PHASE_FIGHT ? PHASE_DANCE : PHASE_FIGHT); + return; + case EVENT_ERUPT: + instance->SetData(DATA_HEIGAN_ERUPT, eruptSection); + TeleportCheaters(); + + if (eruptSection == 0) + eruptDirection = true; + else if (eruptSection == 3) + eruptDirection = false; + + eruptDirection ? ++eruptSection : --eruptSection; + + events.ScheduleEvent(EVENT_ERUPT, phase == PHASE_FIGHT ? 10000 : 3000); + break; + } + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_heigan(Creature* pCreature) +{ + return new boss_heiganAI (pCreature); +} + +void AddSC_boss_heigan() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_heigan"; + newscript->GetAI = &GetAI_boss_heigan; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/naxxramas/boss_highlord_mograine.cpp b/src/bindings/scripts/scripts/northrend/naxxramas/boss_highlord_mograine.cpp new file mode 100644 index 00000000000..9bef8ebd3f9 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/naxxramas/boss_highlord_mograine.cpp @@ -0,0 +1,179 @@ +/* Copyright (C) 2006 - 2008 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Highlord_Mograine +SD%Complete: 100 +SDComment: SCRIPT OBSOLETE +SDCategory: Naxxramas +EndScriptData */ + +#include "precompiled.h" + +//All horsemen +#define SPELL_SHIELDWALL 29061 +#define SPELL_BESERK 26662 + +// highlord mograine +#define SPELL_MARK_OF_MOGRAINE 28834 +#define SPELL_RIGHTEOUS_FIRE 28882 // Applied as a 25% chance on melee hit to proc. m_creature->GetVictim() + +#define SAY_TAUNT1 "Enough prattling. Let them come! We shall grind their bones to dust." +#define SAY_TAUNT2 "Conserve your anger! Harness your rage! You will all have outlets for your frustration soon enough." +#define SAY_TAUNT3 "Life is meaningless. It is in death that we are truly tested." +#define SAY_AGGRO1 "You seek death?" +#define SAY_AGGRO2 "None shall pass!" +#define SAY_AGGRO3 "Be still!" +#define SAY_SLAY1 "You will find no peace in death." +#define SAY_SLAY2 "The master's will is done." +#define SAY_SPECIAL "Bow to the might of the Highlord!" +#define SAY_DEATH "I... am... released! Perhaps it's not too late to - noo! I need... more time..." + +#define SOUND_TAUNT1 8842 +#define SOUND_TAUNT2 8843 +#define SOUND_TAUNT3 8844 +#define SOUND_AGGRO1 8835 +#define SOUND_AGGRO2 8836 +#define SOUND_AGGRO3 8837 +#define SOUND_SLAY1 8839 +#define SOUND_SLAY2 8840 +#define SOUND_SPECIAL 8841 +#define SOUND_DEATH 8838 + +#define SPIRIT_OF_MOGRAINE 16775 + +struct TRINITY_DLL_DECL boss_highlord_mograineAI : public ScriptedAI +{ + boss_highlord_mograineAI(Creature *c) : ScriptedAI(c) {} + + uint32 Mark_Timer; + uint32 RighteousFire_Timer; + bool ShieldWall1; + bool ShieldWall2; + + void Reset() + { + Mark_Timer = 20000; // First Horsemen Mark is applied at 20 sec. + RighteousFire_Timer = 2000; // applied approx 1 out of 4 attacks + ShieldWall1 = true; + ShieldWall2 = true; + } + + void InitialYell() + { + if (!m_creature->isInCombat()) + { + switch(rand()%3) + { + case 0: + DoYell(SAY_AGGRO1,LANG_UNIVERSAL,NULL); + DoPlaySoundToSet(m_creature,SOUND_AGGRO1); + break; + case 1: + DoYell(SAY_AGGRO2,LANG_UNIVERSAL,NULL); + DoPlaySoundToSet(m_creature,SOUND_AGGRO2); + break; + case 2: + DoYell(SAY_AGGRO3,LANG_UNIVERSAL,NULL); + DoPlaySoundToSet(m_creature,SOUND_AGGRO3); + break; + } + } + } + + void KilledUnit() + { + switch(rand()%2) + { + case 0: + DoYell(SAY_SLAY1,LANG_UNIVERSAL,NULL); + DoPlaySoundToSet(m_creature,SOUND_SLAY1); + break; + case 1: + DoYell(SAY_SLAY2,LANG_UNIVERSAL,NULL); + DoPlaySoundToSet(m_creature,SOUND_SLAY2); + break; + } + } + + void JustDied(Unit* Killer) + { + DoYell(SAY_DEATH,LANG_UNIVERSAL,NULL); + DoPlaySoundToSet(m_creature, SOUND_DEATH); + } + + void Aggro(Unit *who) + { + InitialYell(); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + // Mark of Mograine + if (Mark_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_MARK_OF_MOGRAINE); + Mark_Timer = 12000; + }else Mark_Timer -= diff; + + // Shield Wall - All 4 horsemen will shield wall at 50% hp and 20% hp for 20 seconds + if (ShieldWall1 && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 50) + { + if (ShieldWall1) + { + DoCast(m_creature,SPELL_SHIELDWALL); + ShieldWall1 = false; + } + } + if (ShieldWall2 && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 20) + { + if (ShieldWall2) + { + DoCast(m_creature,SPELL_SHIELDWALL); + ShieldWall2 = false; + } + } + + // Righteous Fire + if (RighteousFire_Timer < diff) + { + if (rand()%4 == 1) // 1/4 + { + DoCast(m_creature->getVictim(),SPELL_RIGHTEOUS_FIRE); + } + RighteousFire_Timer = 2000; + }else RighteousFire_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_highlord_mograine(Creature* pCreature) +{ + return new boss_highlord_mograineAI (pCreature); +} + +void AddSC_boss_highlord_mograine() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_highlord_mograine"; + newscript->GetAI = &GetAI_boss_highlord_mograine; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/northrend/naxxramas/boss_kelthuzad.cpp b/src/bindings/scripts/scripts/northrend/naxxramas/boss_kelthuzad.cpp new file mode 100644 index 00000000000..a93ff572ab0 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/naxxramas/boss_kelthuzad.cpp @@ -0,0 +1,294 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_KelThuzud +SD%Complete: 0 +SDComment: VERIFY SCRIPT +SDCategory: Naxxramas +EndScriptData */ + +#include "precompiled.h" +#include "def_naxxramas.h" + +//when shappiron dies. dialog between kel and lich king (in this order) +#define SAY_SAPP_DIALOG1 -1533084 +#define SAY_SAPP_DIALOG2_LICH -1533085 +#define SAY_SAPP_DIALOG3 -1533086 +#define SAY_SAPP_DIALOG4_LICH -1533087 +#define SAY_SAPP_DIALOG5 -1533088 + +//when cat dies +#define SAY_CAT_DIED -1533089 + +//when each of the 4 wing bosses dies +#define SAY_TAUNT1 -1533090 +#define SAY_TAUNT2 -1533091 +#define SAY_TAUNT3 -1533092 +#define SAY_TAUNT4 -1533093 + +#define SAY_SUMMON_MINIONS -1533105 //start of phase 1 + +#define SAY_AGGRO RAND(-1533094,-1533095,-1533096) //start of phase 2 +#define SAY_SLAY RAND(-1533097,-1533098) +#define SAY_DEATH -1533099 +#define SAY_CHAIN RAND(-1533100,-1533101) +#define SAY_FROST_BLAST -1533102 +#define SAY_SPECIAL RAND(-1533106,-1533107,-1533108) + +#define SAY_REQUEST_AID -1533103 //start of phase 3 +#define SAY_ANSWER_REQUEST -1533104 //lich king answer + +enum Event +{ + EVENT_BOLT = 1, + EVENT_NOVA, + EVENT_CHAIN, + EVENT_DETONATE, + EVENT_FISSURE, + EVENT_BLAST, + + EVENT_WASTE, + EVENT_ABOMIN, + EVENT_WEAVER, + EVENT_ICECROWN, + + EVENT_PHASE, +}; + +#define SPELL_FROST_BOLT HEROIC(28478,55802) +#define SPELL_FROST_BOLT_AOE HEROIC(28479,55807) +#define SPELL_SHADOW_FISURE 27810 +#define SPELL_VOID_BLAST 27812 +#define SPELL_MANA_DETONATION 27819 +#define SPELL_FROST_BLAST 27808 +#define SPELL_CHAINS_OF_KELTHUZAD 28410 //28408 script effect +#define SPELL_BERSERK 28498 + +#define MOB_WASTE 16427 // Soldiers of the Frozen Wastes +#define MOB_ABOMINATION 16428 // Unstoppable Abominations +#define MOB_WEAVER 16429 // Soul Weavers +#define MOB_ICECROWN 16441 // Guardians of Icecrown + +float Pos[12][4] = +{ + {3783.272705, -5062.697266, 143.711203,3.617599},//LEFT_FAR + {3730.291260, -5027.239258,143.956909,4.461900},//LEFT_MIDDLE + {3683.868652,-5057.281250,143.183884,5.237086},//LEFT_NEAR + {3759.355225,-5174.128418,143.802383,2.170104},//RIGHT_FAR + {3700.724365,-5185.123047,143.928024,1.309310},//RIGHT_MIDDLE + {3665.121094,-5138.679199,143.183212,0.604023},//RIGHT_NEAR + {3754.431396,-5080.727734,142.036316,3.736189},//LEFT_FAR + {3724.396484, -5061.330566,142.032700, 4.564785},//LEFT_MIDDLE + {3687.158424,-5076.834473,142.017319,5.237086},//LEFT_NEAR + {3687.571777,-5126.831055,142.017807,0.604023},//RIGHT_FAR + {3707.990733,-5151.450195,142.032562,1.376855},//RIGHT_MIDDLE + {3739.500000,-5141.883989,142.0141130, 2.121412}//RIGHT_NEAR +}; + +struct TRINITY_DLL_DECL boss_kelthuzadAI : public BossAI +{ + boss_kelthuzadAI(Creature* c) : BossAI(c, BOSS_KELTHUZAD) {} + + uint32 GuardiansOfIcecrown_Count; + + uint32 Phase; + uint32 GuardiansOfIcecrown_Timer; + + void Reset() + { + _Reset(); + me->SetReactState(REACT_AGGRESSIVE); + GuardiansOfIcecrown_Count = 0; + + GuardiansOfIcecrown_Timer = 5000; //5 seconds for summoning each Guardian of Icecrown in phase 3 + + Phase=0; + } + + void KilledUnit() + { + DoScriptText(SAY_SLAY, m_creature); + } + + void JustDied(Unit* Killer) + { + _JustDied(); + DoScriptText(SAY_DEATH, m_creature); + } + + void EnterCombat(Unit* who) + { + _EnterCombat(); + DoScriptText(SAY_AGGRO, me); + Phase=1; + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + me->SetReactState(REACT_PASSIVE); + events.ScheduleEvent(EVENT_WASTE, 3000); + events.ScheduleEvent(EVENT_ABOMIN, 25000); + events.ScheduleEvent(EVENT_WEAVER, 20000); + events.ScheduleEvent(EVENT_PHASE, 228000); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateCombatState()) + return; + + events.Update(diff); + + if (Phase == 1) + { + while(uint32 eventId = events.GetEvent()) + { + switch(eventId) + { + case EVENT_WASTE: + DoSummon(MOB_WASTE, Pos[RAND(0,3,6,9)]); + events.RepeatEvent(3000); + break; + case EVENT_ABOMIN: + DoSummon(MOB_ABOMINATION, Pos[RAND(1,4,7,10)]); + events.RepeatEvent(25000); + break; + case EVENT_WEAVER: + DoSummon(MOB_WEAVER, Pos[RAND(0,3,6,9)]); + events.RepeatEvent(20000); + break; + case EVENT_PHASE: + events.Reset(); + events.ScheduleEvent(EVENT_BOLT, 2000); + events.ScheduleEvent(EVENT_NOVA, 15000); + events.ScheduleEvent(EVENT_DETONATE, 20000); + events.ScheduleEvent(EVENT_FISSURE, 25000); + events.ScheduleEvent(EVENT_BLAST, (rand()%30+30)*1000); + if (HeroicMode) + events.ScheduleEvent(EVENT_CHAIN, (rand()%30+30)*1000); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + me->SetReactState(REACT_AGGRESSIVE); + Phase = 2; + return; + default: + events.PopEvent(); + break; + } + } + } + else + { + //start phase 3 when we are 40% health + if (Phase != 3) + { + if (HealthBelowPct(40)) + { + Phase = 3 ; + DoScriptText(SAY_REQUEST_AID, m_creature); + //here Lich King should respond to KelThuzad but I don't know which Creature to make talk + //so for now just make Kelthuzad says it. + DoScriptText(SAY_ANSWER_REQUEST, m_creature); + } + } + else if (GuardiansOfIcecrown_Count < HEROIC(2,5)) + { + if (GuardiansOfIcecrown_Timer < diff) + { + DoSummon(MOB_ICECROWN, Pos[RAND(2,5,8)]); + ++GuardiansOfIcecrown_Count; + GuardiansOfIcecrown_Timer = 5000; + } + else GuardiansOfIcecrown_Timer -= diff; + } + + if (me->hasUnitState(UNIT_STAT_CASTING)) + return; + + if (uint32 eventId = events.GetEvent()) + { + switch(eventId) + { + case EVENT_BOLT: + DoCast(m_creature->getVictim(),SPELL_FROST_BOLT); + events.RepeatEvent(2000); + return; + case EVENT_NOVA: + DoCastAOE(SPELL_FROST_BOLT_AOE); + events.RepeatEvent(15000); + return; + case EVENT_CHAIN: + if (Unit *target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0, true)) + DoCast(target, SPELL_CHAINS_OF_KELTHUZAD); + DoScriptText(SAY_CHAIN, me); + events.RepeatEvent((rand()%30+30)*1000); + return; + case EVENT_DETONATE: + { + std::vector unitList; + std::list *threatList = &me->getThreatManager().getThreatList(); + for(std::list::const_iterator itr = threatList->begin(); itr != threatList->end(); ++itr) + { + if ((*itr)->getTarget()->GetTypeId() == TYPEID_PLAYER + && (*itr)->getTarget()->getPowerType() == POWER_MANA + && (*itr)->getTarget()->GetPower(POWER_MANA)) + unitList.push_back((*itr)->getTarget()); + } + + if (!unitList.empty()) + { + std::vector::iterator itr = unitList.begin(); + advance(itr, rand()%unitList.size()); + DoCast(*itr, SPELL_MANA_DETONATION); + DoScriptText(SAY_SPECIAL, me); + } + + events.RepeatEvent(20000); + return; + } + case EVENT_FISSURE: + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target, SPELL_SHADOW_FISURE); + events.RepeatEvent(25000); + return; + case EVENT_BLAST: + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0, true)) + DoCast(target, SPELL_FROST_BLAST); + if (rand()%2) + DoScriptText(SAY_FROST_BLAST, m_creature); + events.RepeatEvent((rand()%30+30)*1000); + return; + default: + events.PopEvent(); + return; + } + } + + DoMeleeAttackIfReady(); + } + } +}; + +CreatureAI* GetAI_boss_kelthuzadAI(Creature* pCreature) +{ + return new boss_kelthuzadAI (pCreature); +} + +void AddSC_boss_kelthuzad() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_kelthuzad"; + newscript->GetAI = &GetAI_boss_kelthuzadAI; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/naxxramas/boss_loatheb.cpp b/src/bindings/scripts/scripts/northrend/naxxramas/boss_loatheb.cpp new file mode 100644 index 00000000000..eb53583752f --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/naxxramas/boss_loatheb.cpp @@ -0,0 +1,93 @@ +/* + * Copyright (C) 2008 - 2009 Trinity + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "precompiled.h" +#include "def_naxxramas.h" + +#define SPELL_NECROTIC_AURA 55593 +#define SPELL_SUMMON_SPORE 29234 +#define SPELL_DEATHBLOOM HEROIC(29865,55053) +#define SPELL_INEVITABLE_DOOM HEROIC(29204,55052) + +enum Events +{ + EVENT_AURA = 1, + EVENT_BLOOM, + EVENT_DOOM, +}; + +struct TRINITY_DLL_DECL boss_loathebAI : public BossAI +{ + boss_loathebAI(Creature *c) : BossAI(c, BOSS_LOATHEB) {} + + void EnterCombat(Unit *who) + { + _EnterCombat(); + events.ScheduleEvent(EVENT_AURA, 0); + events.ScheduleEvent(EVENT_BLOOM, 30000); + events.ScheduleEvent(EVENT_DOOM, 120000); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + events.Update(diff); + + while(uint32 eventId = events.ExecuteEvent()) + { + switch(eventId) + { + case EVENT_AURA: + DoCastAOE(SPELL_NECROTIC_AURA); + events.ScheduleEvent(EVENT_AURA, 20000); + return; + case EVENT_BLOOM: + DoCastAOE(SPELL_SUMMON_SPORE, true); + DoCastAOE(SPELL_DEATHBLOOM); + events.ScheduleEvent(EVENT_BLOOM, 30000); + return; + case EVENT_DOOM: + DoCastAOE(SPELL_INEVITABLE_DOOM); + events.ScheduleEvent(EVENT_DOOM, events.GetTimer() < 5*60000 ? 30000 : 15000); + return; + } + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_loatheb(Creature* pCreature) +{ + return new boss_loathebAI (pCreature); +} + +void AddSC_boss_loatheb() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_loatheb"; + newscript->GetAI = &GetAI_boss_loatheb; + newscript->RegisterSelf(); + + // Fungal Creep + GetAISpellInfo(29232)->condition = AICOND_DIE; +} + diff --git a/src/bindings/scripts/scripts/northrend/naxxramas/boss_maexxna.cpp b/src/bindings/scripts/scripts/northrend/naxxramas/boss_maexxna.cpp new file mode 100644 index 00000000000..63ffb995cd5 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/naxxramas/boss_maexxna.cpp @@ -0,0 +1,140 @@ +/* + * Copyright (C) 2008 - 2009 Trinity + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "precompiled.h" +#include "def_naxxramas.h" + +#define SPELL_WEB_WRAP 28622 +#define SPELL_WEB_SPRAY HEROIC(29484,54125) +#define SPELL_POISON_SHOCK HEROIC(28741,54122) +#define SPELL_NECROTIC_POISON HEROIC(54121,28776) +#define SPELL_FRENZY HEROIC(54123,54124) + +#define MOB_WEB_WRAP 16486 +#define MOB_SPIDERLING 17055 + +#define MAX_POS_WRAP 3 +const float PosWrap[MAX_POS_WRAP][3] = +{ + {3546.796, -3869.082, 296.450+20}, + {3531.271, -3847.424, 299.450+20}, + {3497.067, -3843.384, 302.384+20}, +}; + +enum Events +{ + EVENT_SPRAY = 1, + EVENT_SHOCK, + EVENT_POISON, + EVENT_WRAP, + EVENT_SUMMON, +}; + +struct TRINITY_DLL_DECL boss_maexxnaAI : public BossAI +{ + boss_maexxnaAI(Creature *c) : BossAI(c, BOSS_MAEXXNA) {} + + bool enraged; + + void EnterCombat(Unit *who) + { + _EnterCombat(); + enraged = false; + events.ScheduleEvent(EVENT_WRAP, 20000); + events.ScheduleEvent(EVENT_SPRAY, 40000); + events.ScheduleEvent(EVENT_SHOCK, 10000); + events.ScheduleEvent(EVENT_POISON, 5000); + events.ScheduleEvent(EVENT_SUMMON, 40000); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim() || !CheckInRoom()) + return; + + events.Update(diff); + + while(uint32 eventId = events.ExecuteEvent()) + { + switch(eventId) + { + case EVENT_WRAP: + for(uint32 i = 0; i < HEROIC(1,2); ++i) + { + if (Unit *target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0, true, -SPELL_WEB_WRAP)) + { + target->RemoveAura(SPELL_WEB_SPRAY); + uint32 pos = rand()%MAX_POS_WRAP; + target->GetMotionMaster()->MoveJump(PosWrap[pos][0], PosWrap[pos][1], PosWrap[pos][2], 20, 20); + if (Creature *wrap = DoSummon(MOB_WEB_WRAP, target, 0, 60000)) + { + wrap->AI()->SetGUID(target->GetGUID()); + wrap->GetMotionMaster()->MoveJump(PosWrap[pos][0], PosWrap[pos][1], PosWrap[pos][2], 20, 20); + } + } + } + events.ScheduleEvent(EVENT_WRAP, 40000); + return; + case EVENT_SPRAY: + DoCastAOE(SPELL_WEB_SPRAY); + events.ScheduleEvent(EVENT_SPRAY, 40000); + return; + case EVENT_SHOCK: + DoCastAOE(SPELL_POISON_SHOCK); + events.ScheduleEvent(EVENT_SHOCK, 10000); + return; + case EVENT_POISON: + DoCast(me->getVictim(), SPELL_NECROTIC_POISON); + events.ScheduleEvent(EVENT_POISON, 30000); + return; + case EVENT_SUMMON: + { + uint32 amount = 8+rand()%2; + for(uint32 i = 0; i < amount; ++i) + DoSummon(MOB_SPIDERLING, me); + events.ScheduleEvent(EVENT_SUMMON, 40000); + break; + } + } + } + + if (!enraged && HealthBelowPct(30)) + { + DoCast(me, SPELL_FRENZY); + enraged = true; + } + else + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_maexxna(Creature* pCreature) +{ + return new boss_maexxnaAI (pCreature); +} + +void AddSC_boss_maexxna() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_maexxna"; + newscript->GetAI = &GetAI_boss_maexxna; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/northrend/naxxramas/boss_noth.cpp b/src/bindings/scripts/scripts/northrend/naxxramas/boss_noth.cpp new file mode 100644 index 00000000000..87f9a96ad61 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/naxxramas/boss_noth.cpp @@ -0,0 +1,210 @@ +/* Copyright (C) 2008 - 2009 Trinity + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "precompiled.h" +#include "def_naxxramas.h" + +#define SAY_AGGRO RAND(-1533075,-1533076,-1533077) +#define SAY_SUMMON -1533078 +#define SAY_SLAY RAND(-1533079,-1533080) +#define SAY_DEATH -1533081 + +#define SOUND_DEATH 8848 + +#define SPELL_CURSE_PLAGUEBRINGER HEROIC(29213,54835) +#define SPELL_BLINK RAND(29208,29209,29210,29211) +#define SPELL_CRIPPLE HEROIC(29212,54814) +#define SPELL_TELEPORT 29216 + +#define MOB_WARRIOR 16984 +#define MOB_CHAMPION 16983 +#define MOB_GUARDIAN 16981 + +// Teleport position of Noth on his balcony +#define TELE_X 2631.370 +#define TELE_Y -3529.680 +#define TELE_Z 274.040 +#define TELE_O 6.277 + +#define MAX_SUMMON_POS 5 + +const float SummonPos[MAX_SUMMON_POS][4] = +{ + {2728.12, -3544.43, 261.91, 6.04}, + {2729.05, -3544.47, 261.91, 5.58}, + {2728.24, -3465.08, 264.20, 3.56}, + {2704.11, -3456.81, 265.53, 4.51}, + {2663.56, -3464.43, 262.66, 5.20}, +}; + +enum Events +{ + EVENT_BERSERK = 1, + EVENT_CURSE, + EVENT_BLINK, + EVENT_WARRIOR, + EVENT_BALCONY, + EVENT_WAVE, + EVENT_GROUND, +}; + +struct TRINITY_DLL_DECL boss_nothAI : public BossAI +{ + boss_nothAI(Creature *c) : BossAI(c, BOSS_NOTH) {} + + uint32 waveCount, balconyCount; + + void Reset() + { + me->SetReactState(REACT_AGGRESSIVE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + _Reset(); + } + + void EnterCombat(Unit *who) + { + _EnterCombat(); + DoScriptText(SAY_AGGRO, me); + balconyCount = 0; + EnterPhaseGround(); + } + + void EnterPhaseGround() + { + me->SetReactState(REACT_AGGRESSIVE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + DoZoneInCombat(); + if (me->getThreatManager().isThreatListEmpty()) + EnterEvadeMode(); + else + { + events.ScheduleEvent(EVENT_BALCONY, 110000); + events.ScheduleEvent(EVENT_CURSE, 20000+rand()%10000); + events.ScheduleEvent(EVENT_WARRIOR, 30000); + if (HeroicMode) + events.ScheduleEvent(EVENT_BLINK, 20000+rand()%10000); + } + } + + void KilledUnit(Unit* victim) + { + if (!(rand()%5)) + DoScriptText(SAY_SLAY, me); + } + + void JustSummoned(Creature *summon) + { + summons.Summon(summon); + summon->setActive(true); + summon->AI()->DoZoneInCombat(); + } + + void JustDied(Unit* Killer) + { + _JustDied(); + DoScriptText(SAY_DEATH, me); + } + + void SummonUndead(uint32 entry, uint32 num) + { + for(uint32 i = 0; i < num; ++i) + { + uint32 pos = rand()%MAX_SUMMON_POS; + me->SummonCreature(entry, SummonPos[pos][0], SummonPos[pos][1], SummonPos[pos][2], + SummonPos[pos][3], TEMPSUMMON_CORPSE_DESPAWN, 60000); + } + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateCombatState() || !CheckInRoom()) + return; + + events.Update(diff); + + while(uint32 eventId = events.ExecuteEvent()) + { + switch(eventId) + { + case EVENT_CURSE: + DoCastAOE(SPELL_CURSE_PLAGUEBRINGER); + events.ScheduleEvent(EVENT_CURSE, 20000+rand()%10000); + return; + case EVENT_WARRIOR: + DoScriptText(SAY_SUMMON, me); + SummonUndead(MOB_WARRIOR, HEROIC(2,3)); + events.ScheduleEvent(EVENT_WARRIOR, 30000); + return; + case EVENT_BLINK: + DoCastAOE(SPELL_CRIPPLE, true); + DoCastAOE(SPELL_BLINK); + DoResetThreat(); + events.ScheduleEvent(EVENT_BLINK, 20000+rand()%10000); + return; + case EVENT_BALCONY: + me->SetReactState(REACT_PASSIVE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->AttackStop(); + me->RemoveAllAuras(); + me->NearTeleportTo(TELE_X, TELE_Y, TELE_Z, TELE_O); + events.Reset(); + events.ScheduleEvent(EVENT_WAVE, 2000); + waveCount = 0; + return; + case EVENT_WAVE: + DoScriptText(SAY_SUMMON, me); + switch(balconyCount) + { + case 0: SummonUndead(MOB_CHAMPION, HEROIC(2,4)); break; + case 1: SummonUndead(MOB_CHAMPION, HEROIC(1,2)); + SummonUndead(MOB_GUARDIAN, HEROIC(1,2)); break; + case 2: SummonUndead(MOB_GUARDIAN, HEROIC(2,4)); break; + default:SummonUndead(MOB_CHAMPION, HEROIC(5,10)); + SummonUndead(MOB_GUARDIAN, HEROIC(5,10));break; + } + ++waveCount; + events.ScheduleEvent(waveCount < 2 ? EVENT_WAVE : EVENT_GROUND, 34000); + return; + case EVENT_GROUND: + { + ++balconyCount; + float x, y, z, o; + me->GetHomePosition(x, y, z, o); + me->NearTeleportTo(x, y, z, o); + EnterPhaseGround(); + return; + } + } + } + + if (me->HasReactState(REACT_AGGRESSIVE)) + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_noth(Creature* pCreature) +{ + return new boss_nothAI (pCreature); +} + +void AddSC_boss_noth() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_noth"; + newscript->GetAI = &GetAI_boss_noth; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/naxxramas/boss_patchwerk.cpp b/src/bindings/scripts/scripts/northrend/naxxramas/boss_patchwerk.cpp new file mode 100644 index 00000000000..d50c72d8fa6 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/naxxramas/boss_patchwerk.cpp @@ -0,0 +1,133 @@ +/* Copyright (C) 2008 - 2009 Trinity + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "precompiled.h" +#include "def_naxxramas.h" + +#define SAY_AGGRO RAND(-1533017,-1533018) +#define SAY_SLAY -1533019 +#define SAY_DEATH -1533020 + +#define EMOTE_BERSERK -1533021 +#define EMOTE_ENRAGE -1533022 + +#define SPELL_HATEFULSTRIKE HEROIC(41926,59192) +#define SPELL_FRENZY 28131 +#define SPELL_BERSERK 26662 +#define SPELL_SLIMEBOLT 32309 + +#define EVENT_BERSERK 1 +#define EVENT_HATEFUL 2 +#define EVENT_SLIME 3 + +struct TRINITY_DLL_DECL boss_patchwerkAI : public BossAI +{ + boss_patchwerkAI(Creature *c) : BossAI(c, BOSS_PATCHWERK) {} + + bool Enraged; + + void KilledUnit(Unit* Victim) + { + if (!(rand()%5)) + DoScriptText(SAY_SLAY, me); + } + + void JustDied(Unit* Killer) + { + _JustDied(); + DoScriptText(SAY_DEATH, me); + } + + void EnterCombat(Unit *who) + { + _EnterCombat(); + Enraged = false; + DoScriptText(SAY_AGGRO, me); + events.ScheduleEvent(EVENT_HATEFUL, 1200); + events.ScheduleEvent(EVENT_BERSERK, 360000); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + events.Update(diff); + + while(uint32 eventId = events.ExecuteEvent()) + { + switch(eventId) + { + case EVENT_HATEFUL: + { + //Cast Hateful strike on the player with the highest + //amount of HP within melee distance + uint32 MostHP = 0; + Unit* pMostHPTarget = NULL; + std::list::iterator i = me->getThreatManager().getThreatList().begin(); + for(; i != me->getThreatManager().getThreatList().end(); ++i) + { + Unit* target = (*i)->getTarget(); + if (target->isAlive() && target->GetHealth() > MostHP && me->IsWithinMeleeRange(target)) + { + MostHP = target->GetHealth(); + pMostHPTarget = target; + } + } + + if (pMostHPTarget) + DoCast(pMostHPTarget, SPELL_HATEFULSTRIKE, true); + + events.ScheduleEvent(EVENT_HATEFUL, 1200); + return; + } + case EVENT_BERSERK: + DoCast(m_creature, SPELL_BERSERK); + DoScriptText(EMOTE_BERSERK, m_creature); + events.ScheduleEvent(EVENT_SLIME, 2000); + return; + case EVENT_SLIME: + DoCast(m_creature->getVictim(), SPELL_SLIMEBOLT); + events.ScheduleEvent(EVENT_SLIME, 2000); + return; + } + } + + if (!Enraged && HealthBelowPct(5)) + { + DoCast(m_creature, SPELL_FRENZY); + DoScriptText(EMOTE_ENRAGE, NULL); + Enraged = true; + return; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_patchwerk(Creature* pCreature) +{ + return new boss_patchwerkAI (pCreature); +} + +void AddSC_boss_patchwerk() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_patchwerk"; + newscript->GetAI = &GetAI_boss_patchwerk; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/naxxramas/boss_razuvious.cpp b/src/bindings/scripts/scripts/northrend/naxxramas/boss_razuvious.cpp new file mode 100644 index 00000000000..2ade34b6e6d --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/naxxramas/boss_razuvious.cpp @@ -0,0 +1,128 @@ +/* + * Copyright (C) 2008 - 2009 Trinity + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "precompiled.h" +#include "def_naxxramas.h" + +//Razuvious - NO TEXT sound only +//8852 aggro01 - Hah hah, I'm just getting warmed up! +//8853 aggro02 Stand and fight! +//8854 aggro03 Show me what you've got! +//8861 slay1 - You should've stayed home! +//8863 slay2- +//8858 cmmnd3 - You disappoint me, students! +//8855 cmmnd1 - Do as I taught you! +//8856 cmmnd2 - Show them no mercy! +//8859 cmmnd4 - The time for practice is over! Show me what you've learned! +//8861 Sweep the leg! Do you have a problem with that? +//8860 death - An honorable... death... +//8947 - Aggro Mixed? - ? + +#define SOUND_AGGRO RAND(8852,8853,8854) +#define SOUND_SLAY RAND(8861,8863) +#define SOUND_COMMND RAND(8855,8856,8858,8859,8861) +#define SOUND_DEATH 8860 +#define SOUND_AGGROMIX 8847 + +#define SPELL_UNBALANCING_STRIKE 26613 +#define SPELL_DISRUPTING_SHOUT HEROIC(29107,55543) +#define SPELL_JAGGED_KNIFE 55550 +#define SPELL_HOPELESS 29125 + +enum Events +{ + EVENT_STRIKE, + EVENT_SHOUT, + EVENT_KNIFE, + EVENT_COMMAND, +}; + +struct TRINITY_DLL_DECL boss_razuviousAI : public BossAI +{ + boss_razuviousAI(Creature *c) : BossAI(c, BOSS_RAZUVIOUS) {} + + void KilledUnit(Unit* victim) + { + if (!(rand()%3)) + DoPlaySoundToSet(me, SOUND_SLAY); + } + + void JustDied(Unit* killer) + { + _JustDied(); + DoPlaySoundToSet(me, SOUND_DEATH); + me->CastSpell(me, SPELL_HOPELESS, true); // TODO: this may affect other creatures + } + + void EnterCombat(Unit *who) + { + _EnterCombat(); + DoPlaySoundToSet(m_creature, SOUND_AGGRO); + events.ScheduleEvent(EVENT_STRIKE, 30000); + events.ScheduleEvent(EVENT_SHOUT, 25000); + events.ScheduleEvent(EVENT_COMMAND, 40000); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + events.Update(diff); + + while(uint32 eventId = events.ExecuteEvent()) + { + switch(eventId) + { + case EVENT_STRIKE: + DoCast(me->getVictim(), SPELL_UNBALANCING_STRIKE); + events.ScheduleEvent(EVENT_STRIKE, 30000); + return; + case EVENT_SHOUT: + DoCastAOE(SPELL_DISRUPTING_SHOUT); + events.ScheduleEvent(EVENT_SHOUT, 25000); + return; + case EVENT_KNIFE: + if (Unit *target = SelectTarget(SELECT_TARGET_RANDOM, 0, 45)) + DoCast(target, SPELL_JAGGED_KNIFE); + events.ScheduleEvent(EVENT_KNIFE, 25000); + return; + case EVENT_COMMAND: + DoPlaySoundToSet(me, SOUND_COMMND); + events.ScheduleEvent(EVENT_COMMAND, 40000); + return; + } + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_razuvious(Creature* pCreature) +{ + return new boss_razuviousAI (pCreature); +} + +void AddSC_boss_razuvious() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_razuvious"; + newscript->GetAI = &GetAI_boss_razuvious; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/naxxramas/boss_sapphiron.cpp b/src/bindings/scripts/scripts/northrend/naxxramas/boss_sapphiron.cpp new file mode 100644 index 00000000000..f0dd9e735cb --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/naxxramas/boss_sapphiron.cpp @@ -0,0 +1,350 @@ +/* + * Copyright (C) 2008 - 2009 Trinity + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "precompiled.h" +#include "def_naxxramas.h" + +#define EMOTE_BREATH -1533082 +#define EMOTE_ENRAGE -1533083 + +#define SPELL_FROST_AURA HEROIC(28531,55799) +#define SPELL_CLEAVE 19983 +#define SPELL_TAIL_SWEEP HEROIC(55697,55696) +#define SPELL_SUMMON_BLIZZARD 28560 +#define SPELL_LIFE_DRAIN HEROIC(28542,55665) +#define SPELL_ICEBOLT 28522 +#define SPELL_FROST_BREATH 29318 +#define SPELL_FROST_EXPLOSION 28524 +#define SPELL_FROST_MISSILE 30101 +#define SPELL_BERSERK 26662 +#define SPELL_DIES 29357 + +#define SPELL_CHILL HEROIC(28547,55699) + +#define MOB_BLIZZARD 16474 +#define GO_ICEBLOCK 181247 + +enum Phases +{ + PHASE_NULL = 0, + PHASE_BIRTH, + PHASE_GROUND, + PHASE_FLIGHT, +}; + +enum Events +{ + EVENT_BERSERK = 1, + EVENT_CLEAVE, + EVENT_TAIL, + EVENT_DRAIN, + EVENT_BLIZZARD, + EVENT_FLIGHT, + EVENT_LIFTOFF, + EVENT_ICEBOLT, + EVENT_BREATH, + EVENT_EXPLOSION, + EVENT_LAND, + EVENT_GROUND, + EVENT_BIRTH, +}; + +typedef std::map IceBlockMap; + +struct TRINITY_DLL_DECL boss_sapphironAI : public BossAI +{ + boss_sapphironAI(Creature* c) : BossAI(c, BOSS_SAPPHIRON) + , phase(PHASE_NULL) + {} + + Phases phase; + uint32 iceboltCount; + IceBlockMap iceblocks; + + void InitializeAI() + { + float x, y, z; + me->GetPosition(x, y, z); + me->SummonGameObject(GO_BIRTH, x, y, z, 0, 0, 0, 0, 0, 0); + me->SetVisibility(VISIBILITY_OFF); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + me->SetReactState(REACT_PASSIVE); + + Reset(); + } + + void Reset() + { + _Reset(); + + if (phase = PHASE_FLIGHT) + ClearIceBlock(); + + phase = PHASE_NULL; + } + + void EnterCombat(Unit *who) + { + _EnterCombat(); + + me->CastSpell(me, SPELL_FROST_AURA, true); + + events.ScheduleEvent(EVENT_BERSERK, 15*60000); + EnterPhaseGround(); + } + + void SpellHitTarget(Unit *target, const SpellEntry *spell) + { + if (spell->Id == SPELL_ICEBOLT) + { + IceBlockMap::iterator itr = iceblocks.find(target->GetGUID()); + if (itr != iceblocks.end() && !itr->second) + { + if (GameObject *iceblock = me->SummonGameObject(GO_ICEBLOCK, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, 0, 0, 0, 0, 25000)) + itr->second = iceblock->GetGUID(); + } + } + } + + void JustDied(Unit* who) + { + _JustDied(); + me->CastSpell(me, SPELL_DIES, true); + } + + void MovementInform(uint32, uint32 id) + { + if (id == 1) + events.ScheduleEvent(EVENT_LIFTOFF, 0); + } + + void DoAction(const int32 param) + { + if (param == DATA_SAPPHIRON_BIRTH) + { + phase = PHASE_BIRTH; + events.ScheduleEvent(EVENT_BIRTH, 23000); + } + } + + void EnterPhaseGround() + { + phase = PHASE_GROUND; + me->SetReactState(REACT_AGGRESSIVE); + events.SetPhase(PHASE_GROUND); + events.ScheduleEvent(EVENT_CLEAVE, 5000+rand()%10000, 0, PHASE_GROUND); + events.ScheduleEvent(EVENT_TAIL, 5000+rand()%10000, 0, PHASE_GROUND); + events.ScheduleEvent(EVENT_DRAIN, 24000, 0, PHASE_GROUND); + events.ScheduleEvent(EVENT_BLIZZARD, 5000+rand()%5000, 0, PHASE_GROUND); + events.ScheduleEvent(EVENT_FLIGHT, 45000); + } + + void ClearIceBlock() + { + for(IceBlockMap::iterator itr = iceblocks.begin(); itr != iceblocks.end(); ++itr) + { + if (Player* pPlayer = Unit::GetPlayer(itr->first)) + pPlayer->RemoveAura(SPELL_ICEBOLT); + if (GameObject* pGo = GameObject::GetGameObject(*me, itr->second)) + pGo->DeleteObjectWithOwner(); + } + iceblocks.clear(); + } + + void UpdateAI(const uint32 diff) + { + if (!phase) + return; + + events.Update(diff); + + if (phase != PHASE_BIRTH && !UpdateCombatState() || !CheckInRoom()) + return; + + if (phase == PHASE_GROUND) + { + while(uint32 eventId = events.ExecuteEvent()) + { + switch(eventId) + { + case EVENT_BERSERK: + DoScriptText(EMOTE_ENRAGE, m_creature); + DoCast(me, SPELL_BERSERK); + return; + case EVENT_CLEAVE: + DoCast(me->getVictim(), SPELL_CLEAVE); + events.ScheduleEvent(EVENT_CLEAVE, 5000+rand()%10000, 0, PHASE_GROUND); + return; + case EVENT_TAIL: + DoCastAOE(SPELL_TAIL_SWEEP); + events.ScheduleEvent(EVENT_TAIL, 5000+rand()%10000, 0, PHASE_GROUND); + return; + case EVENT_DRAIN: + DoCastAOE(SPELL_LIFE_DRAIN); + events.ScheduleEvent(EVENT_DRAIN, 24000, 0, PHASE_GROUND); + return; + case EVENT_BLIZZARD: + { + //DoCastAOE(SPELL_SUMMON_BLIZZARD); + float x, y, z; + me->GetGroundPointAroundUnit(x, y, z, rand_norm()*20, rand_norm()*2*M_PI); + if (Creature *summon = me->SummonCreature(MOB_BLIZZARD, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN, 25000+rand()%5000)) + summon->GetMotionMaster()->MoveRandom(40); + events.ScheduleEvent(EVENT_BLIZZARD, HEROIC(20000,7000), 0, PHASE_GROUND); + break; + } + case EVENT_FLIGHT: + phase = PHASE_FLIGHT; + events.SetPhase(PHASE_FLIGHT); + me->SetReactState(REACT_PASSIVE); + me->AttackStop(); + float x, y, z, o; + me->GetHomePosition(x, y, z, o); + me->GetMotionMaster()->MovePoint(1, x, y, z); + return; + } + } + + DoMeleeAttackIfReady(); + } + else + { + if (uint32 eventId = events.ExecuteEvent()) + { + switch(eventId) + { + case EVENT_LIFTOFF: + me->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF); + me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SendMovementFlagUpdate(); + events.ScheduleEvent(EVENT_ICEBOLT, 1500); + iceboltCount = HEROIC(2,3); + return; + case EVENT_ICEBOLT: + { + std::vector targets; + std::list::iterator i = me->getThreatManager().getThreatList().begin(); + for(; i != me->getThreatManager().getThreatList().end(); ++i) + if ((*i)->getTarget()->GetTypeId() == TYPEID_PLAYER && !(*i)->getTarget()->HasAura(SPELL_ICEBOLT)) + targets.push_back((*i)->getTarget()); + + if (targets.empty()) + iceboltCount = 0; + else + { + std::vector::iterator itr = targets.begin(); + advance(itr, rand()%targets.size()); + iceblocks.insert(std::make_pair((*itr)->GetGUID(), 0)); + DoCast(*itr, SPELL_ICEBOLT); + --iceboltCount; + } + + if (iceboltCount) + events.ScheduleEvent(EVENT_ICEBOLT, 1000); + else + events.ScheduleEvent(EVENT_BREATH, 1000); + return; + } + case EVENT_BREATH: + { + DoScriptText(EMOTE_BREATH, me); + DoCastAOE(SPELL_FROST_MISSILE); + events.ScheduleEvent(EVENT_EXPLOSION, 8000); + return; + } + case EVENT_EXPLOSION: + CastExplosion(); + ClearIceBlock(); + events.ScheduleEvent(EVENT_LAND, 3000); + return; + case EVENT_LAND: + me->HandleEmoteCommand(EMOTE_ONESHOT_LAND); + me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SendMovementFlagUpdate(); + events.ScheduleEvent(EVENT_GROUND, 1500); + return; + case EVENT_GROUND: + EnterPhaseGround(); + return; + case EVENT_BIRTH: + me->SetVisibility(VISIBILITY_ON); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + me->SetReactState(REACT_AGGRESSIVE); + return; + } + }//if (uint32 eventId = events.ExecuteEvent()) + }//if (phase == PHASE_GROUND) + } + + void CastExplosion() + { + DoZoneInCombat(); // make sure everyone is in threatlist + std::vector targets; + std::list::iterator i = me->getThreatManager().getThreatList().begin(); + for(; i != me->getThreatManager().getThreatList().end(); ++i) + { + Unit *target = (*i)->getTarget(); + if (target->GetTypeId() != TYPEID_PLAYER) + continue; + + if (target->HasAura(SPELL_ICEBOLT)) + { + target->ApplySpellImmune(0, IMMUNITY_ID, SPELL_FROST_EXPLOSION, true); + targets.push_back(target); + continue; + } + + for(IceBlockMap::iterator itr = iceblocks.begin(); itr != iceblocks.end(); ++itr) + { + if (GameObject* pGo = GameObject::GetGameObject(*me, itr->second)) + { + if (pGo->IsInBetween(me, target, 2.0f) + && me->GetExactDistance2d(target->GetPositionX(), target->GetPositionY()) - me->GetExactDistance2d(pGo->GetPositionX(), pGo->GetPositionY()) < 5.0f) + { + target->ApplySpellImmune(0, IMMUNITY_ID, SPELL_FROST_EXPLOSION, true); + targets.push_back(target); + break; + } + } + } + } + + me->CastSpell(me, SPELL_FROST_EXPLOSION, true); + + for(std::vector::iterator itr = targets.begin(); itr != targets.end(); ++itr) + (*itr)->ApplySpellImmune(0, IMMUNITY_ID, SPELL_FROST_EXPLOSION, false); + } +}; + +CreatureAI* GetAI_boss_sapphiron(Creature* pCreature) +{ + return new boss_sapphironAI (pCreature); +} + +void AddSC_boss_sapphiron() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_sapphiron"; + newscript->GetAI = &GetAI_boss_sapphiron; + newscript->RegisterSelf(); + + // Chill + GetAISpellInfo(28547)->cooldown = 1000; + GetAISpellInfo(55699)->cooldown = 1000; +} diff --git a/src/bindings/scripts/scripts/northrend/naxxramas/boss_thaddius.cpp b/src/bindings/scripts/scripts/northrend/naxxramas/boss_thaddius.cpp new file mode 100644 index 00000000000..b40b5aca876 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/naxxramas/boss_thaddius.cpp @@ -0,0 +1,143 @@ +/* + * Copyright (C) 2008 - 2009 Trinity + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "precompiled.h" +#include "def_naxxramas.h" + +//Stalagg +#define SAY_STAL_AGGRO -1533023 +#define SAY_STAL_SLAY -1533024 +#define SAY_STAL_DEATH -1533025 + +#define SPELL_POWERSURGE 28134 + +//Feugen +#define SAY_FEUG_AGGRO -1533026 +#define SAY_FEUG_SLAY -1533027 +#define SAY_FEUG_DEATH -1533028 + +#define SPELL_MANABURN 28135 + +//both +#define SPELL_WARSTOMP 28125 + + + //generic +#define C_TESLA_COIL 16218 //the coils (emotes "Tesla Coil overloads!") + + +//Thaddus +#define SAY_GREET -1533029 +#define SAY_AGGRO RAND(-1533030,-1533031,-1533032) +#define SAY_SLAY -1533033 +#define SAY_ELECT -1533034 +#define SAY_DEATH -1533035 +#define SAY_SCREAM1 -1533036 +#define SAY_SCREAM2 -1533037 +#define SAY_SCREAM3 -1533038 +#define SAY_SCREAM4 -1533039 + +#define SPELL_POLARITY_SHIFT 28089 +#define SPELL_BALL_LIGHTNING 28299 +#define SPELL_CHAIN_LIGHTNING HEROIC(28167,54531) +#define SPELL_BERSERK 27680 + +enum Events +{ + EVENT_SHIFT = 1, + EVENT_CHAIN, + EVENT_BERSERK, +}; + +struct TRINITY_DLL_DECL boss_thaddiusAI : public BossAI +{ + boss_thaddiusAI(Creature *c) : BossAI(c, BOSS_THADDIUS) + { + // temp + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2 | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_STUNNED); + } + + void KilledUnit(Unit* victim) + { + if (!(rand()%5)) + DoScriptText(SAY_SLAY, me); + } + + void JustDied(Unit* Killer) + { + _JustDied(); + DoScriptText(SAY_DEATH, me); + } + + void EnterCombat(Unit *who) + { + _EnterCombat(); + DoScriptText(SAY_AGGRO, me); + events.ScheduleEvent(EVENT_SHIFT, 30000); + events.ScheduleEvent(EVENT_CHAIN, 10000+rand()%10000); + events.ScheduleEvent(EVENT_BERSERK, 6*60000); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + events.Update(diff); + + if (me->hasUnitState(UNIT_STAT_CASTING)) + return; + + while(uint32 eventId = events.ExecuteEvent()) + { + switch(eventId) + { + case EVENT_SHIFT: + DoCastAOE(SPELL_POLARITY_SHIFT); + events.ScheduleEvent(EVENT_SHIFT, 30000); + return; + case EVENT_CHAIN: + DoCast(me->getVictim(), SPELL_CHAIN_LIGHTNING); + events.ScheduleEvent(EVENT_CHAIN, 10000+rand()%10000); + return; + case EVENT_BERSERK: + DoCast(me, SPELL_BERSERK); + return; + } + } + + if (events.GetTimer() > 15000 && !me->IsWithinMeleeRange(me->getVictim())) + DoCast(me->getVictim(), SPELL_BALL_LIGHTNING); + else + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_thaddius(Creature* pCreature) +{ + return new boss_thaddiusAI (pCreature); +} + +void AddSC_boss_thaddius() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_thaddius"; + newscript->GetAI = &GetAI_boss_thaddius; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/naxxramas/def_naxxramas.h b/src/bindings/scripts/scripts/northrend/naxxramas/def_naxxramas.h new file mode 100644 index 00000000000..383200d4600 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/naxxramas/def_naxxramas.h @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2008 - 2009 Trinity + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef DEF_NAXXRAMAS_H +#define DEF_NAXXRAMAS_H + +enum Encounter +{ + BOSS_ANUBREKHAN, + BOSS_FAERLINA, + BOSS_MAEXXNA, + BOSS_NOTH, + BOSS_HEIGAN, + BOSS_LOATHEB, + BOSS_PATCHWERK, + BOSS_GROBBULUS, + BOSS_GLUTH, + BOSS_THADDIUS, + BOSS_RAZUVIOUS, + BOSS_GOTHIK, + BOSS_HORSEMEN, + BOSS_SAPPHIRON, + BOSS_KELTHUZAD, + MAX_BOSS_NUMBER +}; + +enum Data +{ + DATA_HEIGAN_ERUPT, + DATA_GOTHIK_GATE, + DATA_SAPPHIRON_BIRTH, +}; + +#define GO_BIRTH 181356 + +#endif + diff --git a/src/bindings/scripts/scripts/northrend/naxxramas/instance_naxxramas.cpp b/src/bindings/scripts/scripts/northrend/naxxramas/instance_naxxramas.cpp new file mode 100644 index 00000000000..f6121c18ef5 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/naxxramas/instance_naxxramas.cpp @@ -0,0 +1,217 @@ +/* Copyright (C) 2008 - 2009 Trinity + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "precompiled.h" +#include "def_naxxramas.h" + +const DoorData doorData[] = +{ + {181126, BOSS_ANUBREKHAN,DOOR_TYPE_ROOM, BOUNDARY_S}, + {181195, BOSS_ANUBREKHAN,DOOR_TYPE_PASSAGE, 0}, + {194022, BOSS_FAERLINA, DOOR_TYPE_PASSAGE, 0}, + {181209, BOSS_FAERLINA, DOOR_TYPE_PASSAGE, 0}, + {181209, BOSS_MAEXXNA, DOOR_TYPE_ROOM, BOUNDARY_SW}, + {181200, BOSS_NOTH, DOOR_TYPE_ROOM, BOUNDARY_N}, + {181201, BOSS_NOTH, DOOR_TYPE_PASSAGE, BOUNDARY_E}, + {181202, BOSS_NOTH, DOOR_TYPE_PASSAGE, 0}, + {181202, BOSS_HEIGAN, DOOR_TYPE_ROOM, BOUNDARY_N}, + {181203, BOSS_HEIGAN, DOOR_TYPE_PASSAGE, BOUNDARY_E}, + {181241, BOSS_HEIGAN, DOOR_TYPE_PASSAGE, 0}, + {181241, BOSS_LOATHEB, DOOR_TYPE_ROOM, BOUNDARY_W}, + {181123, BOSS_PATCHWERK, DOOR_TYPE_PASSAGE, 0}, + {181123, BOSS_GROBBULUS, DOOR_TYPE_ROOM, 0}, + {181120, BOSS_GLUTH, DOOR_TYPE_PASSAGE, BOUNDARY_NW}, + {181121, BOSS_GLUTH, DOOR_TYPE_PASSAGE, 0}, + {181121, BOSS_THADDIUS, DOOR_TYPE_ROOM, 0}, + {181124, BOSS_RAZUVIOUS, DOOR_TYPE_PASSAGE, 0}, + {181124, BOSS_GOTHIK, DOOR_TYPE_ROOM, BOUNDARY_N}, + {181125, BOSS_GOTHIK, DOOR_TYPE_PASSAGE, BOUNDARY_S}, + {181119, BOSS_GOTHIK, DOOR_TYPE_PASSAGE, 0}, + {181119, BOSS_HORSEMEN, DOOR_TYPE_ROOM, BOUNDARY_NE}, + {181225, BOSS_SAPPHIRON, DOOR_TYPE_PASSAGE, BOUNDARY_W}, + {0, 0, DOOR_TYPE_ROOM, 0}, // EOF +}; + +const MinionData minionData[] = +{ + //{16573, BOSS_ANUBREKHAN}, there is no spawn point in db, so we do not add them here + {16506, BOSS_FAERLINA}, + {16803, BOSS_RAZUVIOUS}, + {16063, BOSS_HORSEMEN}, + {16064, BOSS_HORSEMEN}, + {16065, BOSS_HORSEMEN}, + {30549, BOSS_HORSEMEN}, + {0, 0,} +}; + +enum +{ + GO_HORSEMEN_CHEST_HERO = 193426, + GO_HORSEMEN_CHEST = 181366, //four horsemen event, DoRespawnGameObject() when event == DONE + GO_GOTHIK_GATE = 181170, + + SPELL_ERUPTION = 29371 +}; + +const float HeiganPos[2] = {2796, -3707}; +const float HeiganEruptionSlope[3] = +{ + (-3685 - HeiganPos[1]) /(2724 - HeiganPos[0]), + (-3647 - HeiganPos[1]) /(2749 - HeiganPos[0]), + (-3637 - HeiganPos[1]) /(2771 - HeiganPos[0]), +}; + +// 0 H x +// 1 ^ +// 2 | +// 3 y<--o +inline uint32 GetEruptionSection(float x, float y) +{ + y -= HeiganPos[1]; + if (y < 1.0f) + return 0; + + x -= HeiganPos[0]; + if (x > -1.0f) + return 3; + + float slope = y/x; + for(uint32 i = 0; i < 3; ++i) + if (slope > HeiganEruptionSlope[i]) + return i; + return 3; +} + +struct TRINITY_DLL_DECL instance_naxxramas : public InstanceData +{ + instance_naxxramas(Map* pMap) : InstanceData(pMap) + , Sapphiron(NULL), pGothikGate(NULL), HorsemenChest(NULL), HorsemenNum(0) + { + SetBossNumber(MAX_BOSS_NUMBER); + LoadDoorData(doorData); + LoadMinionData(minionData); + } + + std::set HeiganEruption[4]; + GameObject* pGothikGate, *HorsemenChest; + Creature* Sapphiron; + uint32 HorsemenNum; + + void OnCreatureCreate(Creature* pCreature, bool add) + { + switch(pCreature->GetEntry()) + { + case 15989: Sapphiron = add ? pCreature : NULL; return; + } + + AddMinion(pCreature, add); + } + + void OnGameObjectCreate(GameObject* pGo, bool add) + { + if (pGo->GetGOInfo()->displayId == 6785 || pGo->GetGOInfo()->displayId == 1287) + { + uint32 section = GetEruptionSection(pGo->GetPositionX(), pGo->GetPositionY()); + if (add) + HeiganEruption[section].insert(pGo); + else + HeiganEruption[section].erase(pGo); + return; + } + + switch(pGo->GetEntry()) + { + case GO_BIRTH: if (!add && Sapphiron) Sapphiron->AI()->DoAction(DATA_SAPPHIRON_BIRTH); return; + case GO_GOTHIK_GATE: pGothikGate = add ? pGo : NULL; break; + case GO_HORSEMEN_CHEST: HorsemenChest = add ? pGo : NULL; break; + } + + AddDoor(pGo, add); + } + + void SetData(uint32 id, uint32 value) + { + switch(id) + { + case DATA_HEIGAN_ERUPT: + HeiganErupt(value); + break; + case DATA_GOTHIK_GATE: + if (pGothikGate) + pGothikGate->SetGoState(GOState(value)); + break; + } + } + + bool SetBossState(uint32 id, EncounterState state) + { + if (!InstanceData::SetBossState(id, state)) + return false; + + if (id == BOSS_HORSEMEN && state == DONE && HorsemenChest) + HorsemenChest->SetRespawnTime(HorsemenChest->GetRespawnDelay()); + + return true; + } + + void HeiganErupt(uint32 section) + { + for(uint32 i = 0; i < 4; ++i) + { + if (i == section) + continue; + + for(std::set::iterator itr = HeiganEruption[i].begin(); itr != HeiganEruption[i].end(); ++itr) + { + (*itr)->SendCustomAnim(); + (*itr)->CastSpell(NULL, SPELL_ERUPTION); + } + } + } +}; + +bool AreaTrigger_at_naxxramas_frostwyrm_wing(Player* pPlayer, AreaTriggerEntry *at) +{ + if (pPlayer->isGameMaster()) + return false; + + InstanceData *data = pPlayer->GetInstanceData(); + if (data) + for(uint32 i = BOSS_ANUBREKHAN; i < BOSS_SAPPHIRON; ++i) + if (data->GetBossState(i) != DONE) + return true; + + return false; +} + +InstanceData* GetInstanceData_instance_naxxramas(Map* pMap) +{ + return new instance_naxxramas(pMap); +} + +void AddSC_instance_naxxramas() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_naxxramas"; + newscript->GetInstanceData = &GetInstanceData_instance_naxxramas; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "at_naxxramas_frostwyrm_wing"; + newscript->pAreaTrigger = &AreaTrigger_at_naxxramas_frostwyrm_wing; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/nexus/eye_of_eternity/boss_malygos.cpp b/src/bindings/scripts/scripts/northrend/nexus/eye_of_eternity/boss_malygos.cpp new file mode 100644 index 00000000000..b187fa10656 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/nexus/eye_of_eternity/boss_malygos.cpp @@ -0,0 +1,170 @@ +/* Script Data Start +SDName: Boss malygos +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = '' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_ARCANE_BREATH_N 56272 +#define SPELL_ARCANE_BREATH_H 60072 +#define SPELL_ARCANE_PULSE 57432 +#define SPELL_ARCANE_STORM_1 57459 +#define SPELL_ARCANE_STORM_2 61693 +#define SPELL_ARCANE_STORM_3 61694 +#define SPELL_STATIC_FIELD 57430 +#define SPELL_SURGE_OF_POWER_1 56505 +#define SPELL_SURGE_OF_POWER_2 57407 +#define SPELL_SURGE_OF_POWER_3 60936 +#define SPELL_VORTEX 56105 + +//Dragon "mounts" spells in Phase3 +//they use Rugelike energy +#define SPELL_DMOUNT_FLAME_SPIKE 56091 //maybe not accurate +#define SPELL_DMOUNT_ENGULF_IN_FLAMES 61621 +#define SPELL_DMOUNT_REVIVIFY 57090 +#define SPELL_DMOUNT_LIFE_BURST 57143 +#define SPELL_DMOUNT_FLAME_SHIELD 57108 +//#define SPELL_DMOUNT_UNKNOWN XYZ //Increases your drake's flight speed by 500%. + + +//Yell +//-->Other +#define SAY_ANTI_MAGIC_SHELL -1616000 +#define SAY_BREATH_ATTACK -1616001 +#define SAY_HIGH_DAMAGE_MODE -1616002 +#define SAY_MAGIC_BLAST -1616003 +//--> Generic Spells +#define SAY_GENERIC_SPELL_1 -1616004 +#define SAY_GENERIC_SPELL_2 -1616005 +#define SAY_GENERIC_SPELL_3 -1616006 +#define SAY_DEATH -1616007 +//--> Prefight +#define SAY_PREFIGHT_1 -1616008 +#define SAY_PREFIGHT_2 -1616009 +#define SAY_PREFIGHT_3 -1616010 +#define SAY_PREFIGHT_4 -1616011 +#define SAY_PREFIGHT_5 -1616012 +//--> Phase1 +#define SAY_PHASE1_AGGRO -1616013 +#define SAY_PHASE1_END -1616014 +#define SAY_PHASE1_SLAY_1 -1616015 +#define SAY_PHASE1_SLAY_2 -1616016 +#define SAY_PHASE1_SLAY_3 -1616017 + +//--> Phase2 at 50% HP, + +/*Malygos himself is not targetable during this phase, it will end when the adds he spawns are all killed. However, he does continue to play a part in the encounter. +During this phase he drops anti-magic zones onto the ground the raid MUST stand inside of, it reduces magical damage taken by 50%. They shrink over time, so it's important that your raid moves to each new one he drops. +Throughout the phase, he will deep breath doing ~4k damage per second, unless you are standing inside of the anti-magic zone. +The way the fight works during this phase is there are NPCs riding around on disks in the room. There are two types of mobs, Lords and Scions. +The Lords will move down onto the group, and need to be tanked (They will one-shot a non-tank). After they die, they drop a disk that a raid member can mount onto, which allows them to fly, to attack the Scions that do not come down to the ground. +It is recommended to let melee take the first disks, then ranged. As those mobs die, they also drop disks, which allows the rest of your dps to get onto them. +The Scions will continually cast Arcane Blast on random targets on the floor, which is mitigated by the anti-magic zones. While mounted on a disk, you will not take damage. +After all of the NPCs riding on the disks die, the players on the disks need to dismount as Phase 3 is about to begin.*/ + +#define SAY_PHASE2_AGGRO -1616018 +#define SAY_PHASE2_END -1616019 +#define SAY_PHASE2_SLAY_1 -1616020 +#define SAY_PHASE2_SLAY_2 -1616021 +#define SAY_PHASE2_SLAY_3 -1616022 +//--> Phase3 Malygos destroys the floor, encounter continues on dragon "mounts" +#define SAY_PHASE3_INTRO -1616023 +#define SAY_PHASE3_AGGRO -1616024 +#define SAY_PHASE3_SLAY_1 -1616025 +#define SAY_PHASE3_SLAY_2 -1616026 +#define SAY_PHASE3_SLAY_3 -1616027 +#define SAY_PHASE3_BIG_ATTACK -1616028 + +struct TRINITY_DLL_DECL boss_malygosAI : public ScriptedAI +{ + boss_malygosAI(Creature *c) : ScriptedAI(c) {} + + uint32 phase, + enrage; + + void Reset() + { + //Source Deadly Boss Mod + enrage = 615000; //10 min + } + void EnterCombat(Unit* who) + { + if (phase == 1) + DoScriptText(SAY_PHASE1_AGGRO, m_creature); + if (phase == 2) + DoScriptText(SAY_PHASE1_AGGRO, m_creature); + if (phase == 3) + DoScriptText(SAY_PHASE1_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + phase =1; + //Return since we have no target + if (!UpdateVictim()) + return; + + if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) <= 50){ + phase = 2; + //spawn adds + //set malygos unatackable untill all adds spawned dead + //start phase3 + } + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + + if (phase ==1) + switch(rand()%3) + { + case 0: DoScriptText(SAY_PHASE1_SLAY_1, m_creature); break; + case 1: DoScriptText(SAY_PHASE1_SLAY_2, m_creature);break; + case 2: DoScriptText(SAY_PHASE1_SLAY_3, m_creature);break; + } + if (phase ==2) + switch(rand()%3) + { + case 0: DoScriptText(SAY_PHASE2_SLAY_1, m_creature);break; + case 1: DoScriptText(SAY_PHASE2_SLAY_2, m_creature);break; + case 2: DoScriptText(SAY_PHASE2_SLAY_3, m_creature);break; + } + if (phase ==3) + switch(rand()%3) + { + case 0: DoScriptText(SAY_PHASE3_SLAY_1, m_creature);break; + case 1: DoScriptText(SAY_PHASE3_SLAY_2, m_creature);break; + case 2: DoScriptText(SAY_PHASE3_SLAY_3, m_creature);break; + } + } +}; + +CreatureAI* GetAI_boss_malygos(Creature* pCreature) +{ + return new boss_malygosAI (pCreature); +} + +void AddSC_boss_malygos() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_malygos"; + newscript->GetAI = &GetAI_boss_malygos; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/nexus/eye_of_eternity/def_eye_of_eternity.h b/src/bindings/scripts/scripts/northrend/nexus/eye_of_eternity/def_eye_of_eternity.h new file mode 100644 index 00000000000..caa82a92e95 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/nexus/eye_of_eternity/def_eye_of_eternity.h @@ -0,0 +1,4 @@ +#ifndef DEF_EYE_OF_ETERNITY_H +#define DEF_EYE_OF_ETERNITY_H + +#endif diff --git a/src/bindings/scripts/scripts/northrend/nexus/eye_of_eternity/instance_eye_of_eternity.cpp b/src/bindings/scripts/scripts/northrend/nexus/eye_of_eternity/instance_eye_of_eternity.cpp new file mode 100644 index 00000000000..7c89a117d92 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/nexus/eye_of_eternity/instance_eye_of_eternity.cpp @@ -0,0 +1,21 @@ +#include "precompiled.h" +#include "def_eye_of_eternity.h" + +struct TRINITY_DLL_DECL instance_eye_of_eternity : public ScriptedInstance +{ + instance_eye_of_eternity(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; +}; + +InstanceData* GetInstanceData_instance_eye_of_eternity(Map* pMap) +{ + return new instance_eye_of_eternity(pMap); +} + +void AddSC_instance_eye_of_eternity() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_eye_of_eternity"; + newscript->GetInstanceData = &GetInstanceData_instance_eye_of_eternity; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/nexus/nexus/boss_anomalus.cpp b/src/bindings/scripts/scripts/northrend/nexus/nexus/boss_anomalus.cpp new file mode 100644 index 00000000000..832dc9274e2 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/nexus/nexus/boss_anomalus.cpp @@ -0,0 +1,302 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Anomalus +SD%Complete: +SDComment: +SDCategory: The Nexus, The Nexus +EndScriptData */ + +#include "precompiled.h" +#include "def_nexus.h" + +bool DeadChaoticRift; // needed for achievement: Chaos Theory(2037) + +enum +{ + ACHIEVEMENT_CHAOS_THEORY = 2037, + + //Spells + SPELL_SPARK_N = 47751, + SPELL_SPARK_H = 57062, + SPELL_RIFT_SHIELD = 47748, + SPELL_CHARGE_RIFT = 47747, //Works wrong (affect players, not rifts) + SPELL_CREATE_RIFT = 47743, //Don't work, using WA + SPELL_ARCANE_ATTRACTION = 57063, //No idea, when it's used + + MOB_CRAZED_MANA_WRAITH = 26746, + MOB_CHAOTIC_RIFT = 26918, + SPELL_CHAOTIC_ENERGY_BURST = 47688, + SPELL_CHARGED_CHAOTIC_ENERGY_BURST = 47737, + SPELL_ARCANEFORM = 48019, //Chaotic Rift visual + + //Yell + SAY_AGGRO = -1576010, + SAY_DEATH = -1576011, + SAY_RIFT = -1576012, + SAY_SHIELD = -1576013 +}; + +float RiftLocation[6][3]= +{ + {652.64, -273.70, -8.75}, + {634.45, -265.94, -8.44}, + {620.73, -281.17, -9.02}, + {626.10, -304.67, -9.44}, + {639.87, -314.11, -9.49}, + {651.72, -297.44, -9.37} +}; + +struct TRINITY_DLL_DECL boss_anomalusAI : public ScriptedAI +{ + boss_anomalusAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + HeroicMode = c->GetMap()->IsHeroic(); + } + + ScriptedInstance* pInstance; + bool HeroicMode; + + uint8 Phase; + uint32 SPELL_SPARK_Timer; + uint32 SPELL_CREATE_RIFT_Timer; + uint64 ChaoticRiftGUID; + + void Reset() + { + Phase = 0; + SPELL_SPARK_Timer = 5000; + SPELL_CREATE_RIFT_Timer = 25000; + ChaoticRiftGUID = 0; + + DeadChaoticRift = false; + + if (pInstance) + pInstance->SetData(DATA_ANOMALUS_EVENT, NOT_STARTED); + } + + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + + if (pInstance) + pInstance->SetData(DATA_ANOMALUS_EVENT, IN_PROGRESS); + } + + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + + if (HeroicMode && !DeadChaoticRift) + { + AchievementEntry const *AchievChaosTheory = GetAchievementStore()->LookupEntry(ACHIEVEMENT_CHAOS_THEORY); + if (AchievChaosTheory) + { + Map* pMap = m_creature->GetMap(); + if (pMap && pMap->IsDungeon()) + { + Map::PlayerList const &players = pMap->GetPlayers(); + for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + itr->getSource()->CompletedAchievement(AchievChaosTheory); + } + } + } + + if (pInstance) + pInstance->SetData(DATA_ANOMALUS_EVENT, DONE); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (m_creature->HasAura(SPELL_RIFT_SHIELD)) + { + if (ChaoticRiftGUID) + { + Unit* Rift = Unit::GetUnit((*m_creature), ChaoticRiftGUID); + if (Rift && Rift->isDead()) + { + m_creature->RemoveAurasDueToSpell(SPELL_RIFT_SHIELD); + ChaoticRiftGUID = 0; + } + return; + } + } else + ChaoticRiftGUID = 0; + + if ((Phase == 0) && (m_creature->GetHealth() < m_creature->GetMaxHealth() * 0.75)) + { + Phase = 1; + DoScriptText(SAY_SHIELD, m_creature); + DoCast(m_creature, SPELL_RIFT_SHIELD); + + int tmp = rand()%(2); + Creature* Rift = m_creature->SummonCreature(MOB_CHAOTIC_RIFT, RiftLocation[tmp][0], RiftLocation[tmp][1], RiftLocation[tmp][2], 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000); + if (Rift) + { + //DoCast(Rift, SPELL_CHARGE_RIFT); + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + Rift->AI()->AttackStart(target); + ChaoticRiftGUID = Rift->GetGUID(); + DoScriptText(SAY_RIFT , m_creature); + } + } + + if ((Phase == 1) && (m_creature->GetHealth() < m_creature->GetMaxHealth() * 0.50)) + { + Phase = 2; + DoScriptText(SAY_SHIELD , m_creature); + DoCast(m_creature,SPELL_RIFT_SHIELD); + + int tmp = rand()%(2); + Creature* Rift = m_creature->SummonCreature(MOB_CHAOTIC_RIFT, RiftLocation[tmp][0], RiftLocation[tmp][1], RiftLocation[tmp][2], 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000); + if (Rift) + { + //DoCast(Rift, SPELL_CHARGE_RIFT); + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + Rift->AI()->AttackStart(target); + ChaoticRiftGUID = Rift->GetGUID(); + DoScriptText(SAY_RIFT , m_creature); + } + } + + if ((Phase == 2) && (m_creature->GetHealth() < m_creature->GetMaxHealth() * 0.25)) + { + Phase = 3; + DoScriptText(SAY_SHIELD , m_creature); + DoCast(m_creature,SPELL_RIFT_SHIELD); + + int tmp = rand()%(2); + Creature* Rift = m_creature->SummonCreature(MOB_CHAOTIC_RIFT, RiftLocation[tmp][0], RiftLocation[tmp][1], RiftLocation[tmp][2], 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000); + if (Rift) + { + //DoCast(Rift, SPELL_CHARGE_RIFT); + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + Rift->AI()->AttackStart(target); + ChaoticRiftGUID = Rift->GetGUID(); + DoScriptText(SAY_RIFT , m_creature); + } + } + + if (SPELL_SPARK_Timer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + DoCast(target, HeroicMode ? SPELL_SPARK_H : SPELL_SPARK_N); + SPELL_SPARK_Timer = 5000; + }else SPELL_SPARK_Timer -=diff; + + if (SPELL_CREATE_RIFT_Timer < diff) + { + DoScriptText(SAY_RIFT , m_creature); + + int tmp = rand()%(2); + Creature* Rift = m_creature->SummonCreature(MOB_CHAOTIC_RIFT, RiftLocation[tmp][0], RiftLocation[tmp][1], RiftLocation[tmp][2], 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000); + if (Rift) + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + Rift->AI()->AttackStart(target); + SPELL_CREATE_RIFT_Timer = 25000; + }else SPELL_CREATE_RIFT_Timer -=diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_anomalus(Creature* pCreature) +{ + return new boss_anomalusAI (pCreature); +} + +struct TRINITY_DLL_DECL mob_chaotic_riftAI : public Scripted_NoMovementAI +{ + mob_chaotic_riftAI(Creature *c) : Scripted_NoMovementAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + uint32 SPELL_CHAOTIC_ENERGY_BURST_Timer; + uint32 SUMMON_CRAZED_MANA_WRAITH_Timer; + + void Reset() + { + SPELL_CHAOTIC_ENERGY_BURST_Timer = 1000; + SUMMON_CRAZED_MANA_WRAITH_Timer = 5000; + m_creature->SetDisplayId(25206); //For some reason in DB models for ally and horde are different. + //Model for ally (1126) does not show auras. Horde model works perfect. + //Set model to horde number + DoCast(m_creature, SPELL_ARCANEFORM, false); + } + + void JustDied(Unit *killer) + { + DeadChaoticRift = true; + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (SPELL_CHAOTIC_ENERGY_BURST_Timer < diff) + { + Unit* Anomalus = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_ANOMALUS)); + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Anomalus && Anomalus->HasAura(SPELL_RIFT_SHIELD)) + DoCast(target, SPELL_CHARGED_CHAOTIC_ENERGY_BURST); + else + DoCast(target, SPELL_CHAOTIC_ENERGY_BURST); + SPELL_CHAOTIC_ENERGY_BURST_Timer = 1000; + }else SPELL_CHAOTIC_ENERGY_BURST_Timer -=diff; + + if (SUMMON_CRAZED_MANA_WRAITH_Timer < diff) + { + Creature* Wraith = m_creature->SummonCreature(MOB_CRAZED_MANA_WRAITH, m_creature->GetPositionX()+1, m_creature->GetPositionY()+1, m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000); + if (Wraith) + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + Wraith->AI()->AttackStart(target); + Unit* Anomalus = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_ANOMALUS)); + if (Anomalus && Anomalus->HasAura(SPELL_RIFT_SHIELD)) + SUMMON_CRAZED_MANA_WRAITH_Timer = 5000; + else + SUMMON_CRAZED_MANA_WRAITH_Timer = 10000; + }else SUMMON_CRAZED_MANA_WRAITH_Timer -=diff; + } +}; + +CreatureAI* GetAI_mob_chaotic_rift(Creature* pCreature) +{ + return new mob_chaotic_riftAI (pCreature); +} + +void AddSC_boss_anomalus() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_anomalus"; + newscript->GetAI = &GetAI_boss_anomalus; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_chaotic_rift"; + newscript->GetAI = &GetAI_mob_chaotic_rift; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/nexus/nexus/boss_keristrasza.cpp b/src/bindings/scripts/scripts/northrend/nexus/nexus/boss_keristrasza.cpp new file mode 100644 index 00000000000..072e6db1a1f --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/nexus/nexus/boss_keristrasza.cpp @@ -0,0 +1,258 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Keristrasza +SD%Complete: +SDComment: +SDCategory: The Nexus, The Nexus +EndScriptData */ + +#include "precompiled.h" +#include "def_nexus.h" + +enum +{ + CONTAINMENT_SPHERES = 3, + + ACHIEVEMENT_INTENSE_COLD = 2036, + + //Spells + SPELL_FROZEN_PRISON = 47854, + SPELL_TAIL_SWEEP = 50155, + SPELL_CRYSTAL_CHAINS = 50997, + SPELL_ENRAGE = 8599, + SPELL_CRYSTALFIRE_BREATH_N = 48096, + SPELL_CRYSTALFIRE_BREATH_H = 57091, + SPELL_CRYSTALIZE = 48179, + SPELL_INTENSE_COLD = 48094, + SPELL_INTENSE_COLD_TRIGGERED = 48095, + + //Yell + SAY_AGGRO = -1576040, + SAY_SLAY = -1576041, + SAY_ENRAGE = -1576042, + SAY_DEATH = -1576043, + SAY_CRYSTAL_NOVA = -1576044 +}; + +struct TRINITY_DLL_DECL boss_keristraszaAI : public ScriptedAI +{ + boss_keristraszaAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + HeroicMode = c->GetMap()->IsHeroic(); + } + + ScriptedInstance* pInstance; + bool HeroicMode; + + uint32 CRYSTALFIRE_BREATH_Timer; + uint32 CRYSTAL_CHAINS_CRYSTALIZE_Timer; + uint32 TAIL_SWEEP_Timer; + bool Enrage; + + uint64 ContainmentSphereGUIDs[CONTAINMENT_SPHERES]; + + uint32 CheckIntenseColdTimer; + bool MoreThanTwoIntenseCold; // needed for achievement: Intense Cold(2036) + + void Reset() + { + CRYSTALFIRE_BREATH_Timer = 14000; + CRYSTAL_CHAINS_CRYSTALIZE_Timer = HeroicMode ? 30000 : 11000; + TAIL_SWEEP_Timer = 5000; + Enrage = false; + + CheckIntenseColdTimer = 2000; + MoreThanTwoIntenseCold = false; + + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED); + + RemovePrison(CheckContainmentSpheres()); + + if (pInstance) + pInstance->SetData(DATA_KERISTRASZA_EVENT, NOT_STARTED); + } + + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + DoCastAOE(SPELL_INTENSE_COLD); + + if (pInstance) + pInstance->SetData(DATA_KERISTRASZA_EVENT, IN_PROGRESS); + } + + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + + if (HeroicMode && !MoreThanTwoIntenseCold) + { + AchievementEntry const *AchievIntenseCold = GetAchievementStore()->LookupEntry(ACHIEVEMENT_INTENSE_COLD); + if (AchievIntenseCold) + { + Map* pMap = m_creature->GetMap(); + if (pMap && pMap->IsDungeon()) + { + Map::PlayerList const &players = pMap->GetPlayers(); + for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + itr->getSource()->CompletedAchievement(AchievIntenseCold); + } + } + } + + if (pInstance) + pInstance->SetData(DATA_KERISTRASZA_EVENT, DONE); + } + + void KilledUnit(Unit *victim) + { + DoScriptText(SAY_SLAY, m_creature); + } + + bool CheckContainmentSpheres(bool remove_prison = false) + { + ContainmentSphereGUIDs[0] = pInstance->GetData64(ANOMALUS_CONTAINMET_SPHERE); + ContainmentSphereGUIDs[1] = pInstance->GetData64(ORMOROKS_CONTAINMET_SPHERE); + ContainmentSphereGUIDs[2] = pInstance->GetData64(TELESTRAS_CONTAINMET_SPHERE); + + GameObject *ContainmentSpheres[CONTAINMENT_SPHERES]; + + for(uint8 i = 0; i < CONTAINMENT_SPHERES; ++i) + { + ContainmentSpheres[i] = pInstance->instance->GetGameObject(ContainmentSphereGUIDs[i]); + if (!ContainmentSpheres[i]) + return false; + if (ContainmentSpheres[i]->GetGoState() != GO_STATE_ACTIVE) + return false; + } + if (remove_prison) + RemovePrison(true); + return true; + } + + void RemovePrison(bool remove) + { + if (remove) + { + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + if (m_creature->HasAura(SPELL_FROZEN_PRISON)) + m_creature->RemoveAurasDueToSpell(SPELL_FROZEN_PRISON); + } + else + { + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->CastSpell(m_creature, SPELL_FROZEN_PRISON, false); + } + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (CheckIntenseColdTimer < diff && !MoreThanTwoIntenseCold) + { + std::list ThreatList = m_creature->getThreatManager().getThreatList(); + for(std::list::const_iterator itr = ThreatList.begin(); itr != ThreatList.end(); itr++) + { + Unit *target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()); + if (!target || target->GetTypeId() != TYPEID_PLAYER) + continue; + + Aura *AuraIntenseCold = target->GetAura(SPELL_INTENSE_COLD_TRIGGERED); + if (AuraIntenseCold && AuraIntenseCold->GetStackAmount() > 2) + { + MoreThanTwoIntenseCold = true; + break; + } + } + CheckIntenseColdTimer = 2000; + }else CheckIntenseColdTimer -= diff; + + if (!Enrage && (m_creature->GetHealth() < m_creature->GetMaxHealth() * 0.25)) + { + DoScriptText(SAY_ENRAGE , m_creature); + DoCast(m_creature, SPELL_ENRAGE); + Enrage = true; + } + + if (CRYSTALFIRE_BREATH_Timer < diff) + { + DoCast(m_creature->getVictim(), HeroicMode ? SPELL_CRYSTALFIRE_BREATH_H : SPELL_CRYSTALFIRE_BREATH_N); + CRYSTALFIRE_BREATH_Timer = 14000; + }else CRYSTALFIRE_BREATH_Timer -=diff; + + if (TAIL_SWEEP_Timer < diff) + { + DoCast(m_creature, SPELL_TAIL_SWEEP); + TAIL_SWEEP_Timer = 5000; + }else TAIL_SWEEP_Timer -=diff; + + if (CRYSTAL_CHAINS_CRYSTALIZE_Timer < diff) + { + DoScriptText(SAY_CRYSTAL_NOVA , m_creature); + if (HeroicMode) + DoCast(m_creature, SPELL_CRYSTALIZE); + else + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + DoCast(target, SPELL_CRYSTAL_CHAINS); + CRYSTAL_CHAINS_CRYSTALIZE_Timer = HeroicMode ? 30000 : 11000; + }else CRYSTAL_CHAINS_CRYSTALIZE_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_keristrasza(Creature* pCreature) +{ + return new boss_keristraszaAI (pCreature); +} + +bool GOHello_containment_sphere(Player *pPlayer, GameObject *pGO) +{ + ScriptedInstance *pInstance = pGO->GetInstanceData(); + + Creature *Keristrasza = Unit::GetCreature(*pGO, pInstance->GetData64(DATA_KERISTRASZA)); + if (Keristrasza && Keristrasza->isAlive()) + { + // maybe these are hacks :( + pGO->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1); + pGO->SetGoState(GO_STATE_ACTIVE); + + CAST_AI(boss_keristraszaAI, Keristrasza->AI())->CheckContainmentSpheres(true); + } + return true; +} + +void AddSC_boss_keristrasza() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_keristrasza"; + newscript->GetAI = &GetAI_boss_keristrasza; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "containment_sphere"; + newscript->pGOHello = &GOHello_containment_sphere; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/nexus/nexus/boss_magus_telestra.cpp b/src/bindings/scripts/scripts/northrend/nexus/nexus/boss_magus_telestra.cpp new file mode 100644 index 00000000000..2fe856cea05 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/nexus/nexus/boss_magus_telestra.cpp @@ -0,0 +1,317 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Magus_Telestra +SD%Complete: +SDComment: +SDCategory: The Nexus, The Nexus +EndScriptData */ + +#include "precompiled.h" +#include "def_nexus.h" + +enum +{ +//Spells + SPELL_ICE_NOVA_N = 47772, + SPELL_ICE_NOVA_H = 56935, + SPELL_FIREBOMB_N = 47773, + SPELL_FIREBOMB_H = 56934, + SPELL_GRAVITY_WELL = 47756, + SPELL_TELESTRA_BACK = 47714, + +//At 50% HP - 3 clones, Frost, Fire, Arcane (and in 10% HP in Heroic) + MOB_FIRE_MAGUS = 26928, + MOB_FROST_MAGUS = 26930, + MOB_ARCANE_MAGUS = 26929, + + SPELL_FIRE_MAGUS_VISUAL = 47705, + SPELL_FROST_MAGUS_VISUAL = 47706, + SPELL_ARCANE_MAGUS_VISUAL = 47704, + +//Yell + SAY_AGGRO = -1576000, + SAY_KILL = -1576001, + SAY_DEATH = -1576002, + SAY_MERGE = -1576003, + SAY_SPLIT_1 = -1576004, + SAY_SPLIT_2 = -1576005 +}; + +float CenterOfRoom[1][4] = +{ + {504.80, 89.07, -16.12, 6.27} +}; + +struct TRINITY_DLL_DECL boss_magus_telestraAI : public ScriptedAI +{ + boss_magus_telestraAI(Creature* c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + HeroicMode = c->GetMap()->IsHeroic(); + } + + ScriptedInstance* pInstance; + bool HeroicMode; + + uint64 FireMagusGUID; + uint64 FrostMagusGUID; + uint64 ArcaneMagusGUID; + bool FireMagusDead; + bool FrostMagusDead; + bool ArcaneMagusDead; + + uint32 AppearDelay_Timer; + bool AppearDelay; + + uint8 Phase; + + uint32 SPELL_ICE_NOVA_Timer; + uint32 SPELL_FIREBOMB_Timer; + uint32 SPELL_GRAVITY_WELL_Timer; + uint32 Cooldown; + + void Reset() + { + Phase = 0; + //These times are probably wrong + SPELL_ICE_NOVA_Timer = 7000; + SPELL_FIREBOMB_Timer = 0; + SPELL_GRAVITY_WELL_Timer = 15000; + Cooldown = 0; + + FireMagusGUID = 0; + FrostMagusGUID = 0; + ArcaneMagusGUID = 0; + + AppearDelay = false; + + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetVisibility(VISIBILITY_ON); + + if (pInstance) + pInstance->SetData(DATA_MAGUS_TELESTRA_EVENT, NOT_STARTED); + } + + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + + if (pInstance) + pInstance->SetData(DATA_MAGUS_TELESTRA_EVENT, IN_PROGRESS); + } + + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + + if (pInstance) + pInstance->SetData(DATA_MAGUS_TELESTRA_EVENT, DONE); + } + + void KilledUnit(Unit *victim) + { + DoScriptText(SAY_KILL, m_creature); + } + + uint64 SplitPersonality(uint32 entry) + { + Creature* Summoned = m_creature->SummonCreature(entry, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), m_creature->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000); + if (Summoned) + { + switch (entry) + { + case MOB_FIRE_MAGUS: + { + Summoned->CastSpell(Summoned, SPELL_FIRE_MAGUS_VISUAL, false); + break; + } + case MOB_FROST_MAGUS: + { + Summoned->CastSpell(Summoned, SPELL_FROST_MAGUS_VISUAL, false); + break; + } + case MOB_ARCANE_MAGUS: + { + Summoned->CastSpell(Summoned, SPELL_ARCANE_MAGUS_VISUAL, false); + break; + } + } + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + Summoned->AI()->AttackStart(target); + return Summoned->GetGUID(); + } + return 0; + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + { + return; + } + + if (AppearDelay) + { + m_creature->StopMoving(); + m_creature->AttackStop(); + if (AppearDelay_Timer < diff) + { + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + AppearDelay = false; + }else AppearDelay_Timer -= diff; + return; + } + + + if ((Phase == 1)||(Phase == 3)) + { + Unit* FireMagus; + Unit* FrostMagus; + Unit* ArcaneMagus; + if (FireMagusGUID) + FireMagus = Unit::GetUnit((*m_creature), FireMagusGUID); + if (FrostMagusGUID) + FrostMagus = Unit::GetUnit((*m_creature), FrostMagusGUID); + if (ArcaneMagusGUID) + ArcaneMagus = Unit::GetUnit((*m_creature), ArcaneMagusGUID); + if (FireMagus && FireMagus->isDead()) + FireMagusDead = true; + if (FrostMagus && FrostMagus->isDead()) + FrostMagusDead = true; + if (ArcaneMagus && ArcaneMagus->isDead()) + ArcaneMagusDead = true; + if (FireMagusDead && FrostMagusDead && ArcaneMagusDead) + { + m_creature->GetMotionMaster()->Clear(); + m_creature->GetMap()->CreatureRelocation(m_creature, CenterOfRoom[0][0], CenterOfRoom[0][1], CenterOfRoom[0][2], CenterOfRoom[0][3]); + DoCast(m_creature, SPELL_TELESTRA_BACK); + m_creature->SetVisibility(VISIBILITY_ON); + if (Phase == 1) + Phase = 2; + if (Phase == 3) + Phase = 4; + FireMagusGUID = 0; + FrostMagusGUID = 0; + ArcaneMagusGUID = 0; + AppearDelay = true; + AppearDelay_Timer = 4000; + DoScriptText(SAY_MERGE, m_creature); + }else + return; + } + + if ((Phase == 0) && (m_creature->GetHealth() <= (m_creature->GetMaxHealth() * 0.5))) + { + Phase = 1; + m_creature->CastStop(); + m_creature->SetVisibility(VISIBILITY_OFF); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + FireMagusGUID = SplitPersonality(MOB_FIRE_MAGUS); + FrostMagusGUID = SplitPersonality(MOB_FROST_MAGUS); + ArcaneMagusGUID = SplitPersonality(MOB_ARCANE_MAGUS); + FireMagusDead = false; + FrostMagusDead = false; + ArcaneMagusDead = false; + switch(rand()%2) + { + case 0: DoScriptText(SAY_SPLIT_1, m_creature); break; + case 1: DoScriptText(SAY_SPLIT_2, m_creature); break; + } + return; + } + + if (HeroicMode && (Phase == 2) && (m_creature->GetHealth() <= (m_creature->GetMaxHealth() * 0.1))) + { + Phase = 3; + m_creature->CastStop(); + m_creature->SetVisibility(VISIBILITY_OFF); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + FireMagusGUID = SplitPersonality(MOB_FIRE_MAGUS); + FrostMagusGUID = SplitPersonality(MOB_FROST_MAGUS); + ArcaneMagusGUID = SplitPersonality(MOB_ARCANE_MAGUS); + FireMagusDead = false; + FrostMagusDead = false; + ArcaneMagusDead = false; + switch(rand()%2) + { + case 0: DoScriptText(SAY_SPLIT_1, m_creature); break; + case 1: DoScriptText(SAY_SPLIT_2, m_creature); break; + } + return; + } + + if (Cooldown) + { + if (Cooldown < diff) + Cooldown = 0; + else + { + Cooldown -= diff; + return; + } + } + + if (SPELL_ICE_NOVA_Timer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + { + DoCast(target, HeroicMode ? SPELL_ICE_NOVA_H : SPELL_ICE_NOVA_N); + Cooldown = 1500; + } + SPELL_ICE_NOVA_Timer = 15000; + }else SPELL_ICE_NOVA_Timer -=diff; + + if (SPELL_GRAVITY_WELL_Timer < diff) + { + if (Unit* target = m_creature->getVictim()) + { + DoCast(target, SPELL_GRAVITY_WELL); + Cooldown = 6000; + } + SPELL_GRAVITY_WELL_Timer = 15000; + }else SPELL_GRAVITY_WELL_Timer -=diff; + + if (SPELL_FIREBOMB_Timer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + { + DoCast(target, HeroicMode ? SPELL_FIREBOMB_H : SPELL_FIREBOMB_N); + Cooldown = 2000; + } + SPELL_FIREBOMB_Timer = 2000; + }else SPELL_FIREBOMB_Timer -=diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_magus_telestra(Creature* pCreature) +{ + return new boss_magus_telestraAI (pCreature); +} + +void AddSC_boss_magus_telestra() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_magus_telestra"; + newscript->GetAI = &GetAI_boss_magus_telestra; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/nexus/nexus/boss_ormorok.cpp b/src/bindings/scripts/scripts/northrend/nexus/nexus/boss_ormorok.cpp new file mode 100644 index 00000000000..d55e8514cc6 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/nexus/nexus/boss_ormorok.cpp @@ -0,0 +1,311 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Ormorok +SD%Complete: +SDComment: +SDCategory: The Nexus, The Nexus +EndScriptData */ + +#include "precompiled.h" +#include "def_nexus.h" + +enum +{ +//Spells + SPELL_CRYSTAL_SPIKES_N = 47958, //Don't work, using walkaround + SPELL_CRYSTAL_SPIKES_H = 57082, //Don't work, using walkaround +//Walkaround for spells Crystal Spikes ----------------- + SPELL_CRYSTALL_SPIKE_DAMAGE_N = 47944, + SPELL_CRYSTALL_SPIKE_DAMAGE_H = 57067, + SPELL_CRYSTAL_SPIKE_PREVISUAL = 50442, + MOB_CRYSTAL_SPIKE = 27099, +//------------------------------------------------------ + SPELL_SPELL_REFLECTION = 47981, + SPELL_TRAMPLE_N = 48016, + SPELL_TRAMPLE_H = 57066, + SPELL_FRENZY = 48017, + SPELL_SUMMON_CRYSTALLINE_TANGLER = 61564, //summons npc 32665 + MOB_CRYSTALLINE_TANGLER = 32665, + SPELL_ROOTS = 28858, //proper spell id is unknown + +//Yell + SAY_AGGRO = -1576020, + SAY_DEATH = -1576021, + SAY_REFLECT = -1576022, + SAY_CRYSTAL_SPIKES = -1576023, + SAY_KILL = -1576024 +}; + +#define SPIKE_DISTANCE 5.0f + +struct TRINITY_DLL_DECL boss_ormorokAI : public ScriptedAI +{ + boss_ormorokAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + HeroicMode = c->GetMap()->IsHeroic(); + } + + ScriptedInstance* pInstance; + bool HeroicMode; + bool Frenzy; + bool CrystalSpikes; + uint8 CrystalSpikes_Count; + float BaseX; + float BaseY; + float BaseZ; + float BaseO; + float SpikeXY[4][2]; + + uint32 SPELL_CRYSTAL_SPIKES_Timer; + uint32 CRYSTAL_SPIKES_Timer; + uint32 SPELL_TRAMPLE_Timer; + uint32 SPELL_FRENZY_Timer; + uint32 SPELL_SPELL_REFLECTION_Timer; + uint32 SPELL_SUMMON_CRYSTALLINE_TANGLER_Timer; + + void Reset() + { + SPELL_CRYSTAL_SPIKES_Timer = 12000; + SPELL_TRAMPLE_Timer = 10000; + SPELL_SPELL_REFLECTION_Timer = 30000; + SPELL_SUMMON_CRYSTALLINE_TANGLER_Timer = 17000; + Frenzy = false; + CrystalSpikes = false; + + if (pInstance) + pInstance->SetData(DATA_ORMOROK_EVENT, NOT_STARTED); + } + + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + + if (pInstance) + pInstance->SetData(DATA_ORMOROK_EVENT, IN_PROGRESS); + } + + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + + if (pInstance) + pInstance->SetData(DATA_ORMOROK_EVENT, DONE); + } + + void KilledUnit(Unit *victim) + { + DoScriptText(SAY_KILL, m_creature); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + { + return; + } + if (CrystalSpikes) + if (CRYSTAL_SPIKES_Timer < diff) + { + SpikeXY[0][0] = BaseX+(SPIKE_DISTANCE*CrystalSpikes_Count*cos(BaseO)); + SpikeXY[0][1] = BaseY+(SPIKE_DISTANCE*CrystalSpikes_Count*sin(BaseO)); + SpikeXY[1][0] = BaseX-(SPIKE_DISTANCE*CrystalSpikes_Count*cos(BaseO)); + SpikeXY[1][1] = BaseY-(SPIKE_DISTANCE*CrystalSpikes_Count*sin(BaseO)); + SpikeXY[2][0] = BaseX+(SPIKE_DISTANCE*CrystalSpikes_Count*cos(BaseO-(M_PI/2))); + SpikeXY[2][1] = BaseY+(SPIKE_DISTANCE*CrystalSpikes_Count*sin(BaseO-(M_PI/2))); + SpikeXY[3][0] = BaseX-(SPIKE_DISTANCE*CrystalSpikes_Count*cos(BaseO-(M_PI/2))); + SpikeXY[3][1] = BaseY-(SPIKE_DISTANCE*CrystalSpikes_Count*sin(BaseO-(M_PI/2))); + for (uint8 i = 0; i < 4; ++i) + Creature* Spike = m_creature->SummonCreature(MOB_CRYSTAL_SPIKE, SpikeXY[i][0], SpikeXY[i][1], BaseZ, 0, TEMPSUMMON_TIMED_DESPAWN, 7000); + if (++CrystalSpikes_Count >= 13) + CrystalSpikes = false; + CRYSTAL_SPIKES_Timer = 200; + }else CRYSTAL_SPIKES_Timer -= diff; + + if (!Frenzy && (m_creature->GetHealth() < m_creature->GetMaxHealth() * 0.25)) + { + DoCast(m_creature, SPELL_FRENZY); + Frenzy = true; + } + + if (SPELL_TRAMPLE_Timer < diff) + { + DoCast(m_creature, HeroicMode ? SPELL_TRAMPLE_H : SPELL_TRAMPLE_N); + SPELL_TRAMPLE_Timer = 10000; + }else SPELL_TRAMPLE_Timer -= diff; + + if (SPELL_SPELL_REFLECTION_Timer < diff) + { + DoScriptText(SAY_REFLECT, m_creature); + DoCast(m_creature, SPELL_SPELL_REFLECTION); + SPELL_SPELL_REFLECTION_Timer = 30000; + }else SPELL_SPELL_REFLECTION_Timer -= diff; + + if (SPELL_CRYSTAL_SPIKES_Timer < diff) + { + DoScriptText(SAY_CRYSTAL_SPIKES, m_creature); + CrystalSpikes = true; + CrystalSpikes_Count = 1; + CRYSTAL_SPIKES_Timer = 0; + BaseX = m_creature->GetPositionX(); + BaseY = m_creature->GetPositionY(); + BaseZ = m_creature->GetPositionZ(); + BaseO = m_creature->GetOrientation(); + SPELL_CRYSTAL_SPIKES_Timer = 20000; + }else SPELL_CRYSTAL_SPIKES_Timer -=diff; + + if (HeroicMode && (SPELL_SUMMON_CRYSTALLINE_TANGLER_Timer < diff)) + { + Creature* Crystalline_Tangler = m_creature->SummonCreature(MOB_CRYSTALLINE_TANGLER, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), m_creature->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000); + if (Crystalline_Tangler) + { + Unit* target = NULL; + uint8 Healer = 0; + for (uint8 j = 1; j<=4; j++) + { + switch (j) + { + case 1: Healer = CLASS_PRIEST; break; + case 2: Healer = CLASS_PALADIN; break; + case 3: Healer = CLASS_DRUID; break; + case 4: Healer = CLASS_SHAMAN; break; + } + std::list::iterator i = m_creature->getThreatManager().getThreatList().begin(); + for (; i != m_creature->getThreatManager().getThreatList().end(); ++i) + { + Unit* pTemp = Unit::GetUnit((*m_creature),(*i)->getUnitGuid()); + if (pTemp && pTemp->GetTypeId() == TYPEID_PLAYER && pTemp->getClass() == Healer) + { + target = pTemp; + break; + } + } + if (target) + break; + } + if (!target) + target = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (target) + { + Crystalline_Tangler->AI()->AttackStart(target); + Crystalline_Tangler->getThreatManager().addThreat(target, 1000000000.0f); + } + } + SPELL_SUMMON_CRYSTALLINE_TANGLER_Timer = 17000; + }else SPELL_SUMMON_CRYSTALLINE_TANGLER_Timer -=diff; + + DoMeleeAttackIfReady(); + } +}; + +struct TRINITY_DLL_DECL mob_crystal_spikeAI : public Scripted_NoMovementAI +{ + mob_crystal_spikeAI(Creature *c) : Scripted_NoMovementAI(c) + { + HeroicMode = c->GetMap()->IsHeroic(); + } + + bool HeroicMode; + + uint32 SPELL_CRYSTALL_SPIKE_DAMAGE_Timer; + uint32 SPELL_CRYSTAL_SPIKE_PREVISUAL_Timer; + + void Reset() + { + SPELL_CRYSTALL_SPIKE_DAMAGE_Timer = 3700; + SPELL_CRYSTAL_SPIKE_PREVISUAL_Timer = 1000; + m_creature->SetLevel(80); // + m_creature->setFaction(16); //Walkaround to be independent from data in DB + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); // + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); // + } + + void UpdateAI(const uint32 diff) + { + if (SPELL_CRYSTAL_SPIKE_PREVISUAL_Timer < diff) + { + DoCast(m_creature, SPELL_CRYSTAL_SPIKE_PREVISUAL); + SPELL_CRYSTAL_SPIKE_PREVISUAL_Timer = 10000; + }else SPELL_CRYSTAL_SPIKE_PREVISUAL_Timer -=diff; + + if (SPELL_CRYSTALL_SPIKE_DAMAGE_Timer < diff) + { + DoCast(m_creature, HeroicMode ? SPELL_CRYSTALL_SPIKE_DAMAGE_H : SPELL_CRYSTALL_SPIKE_DAMAGE_N); + SPELL_CRYSTALL_SPIKE_DAMAGE_Timer = 10000; + }else SPELL_CRYSTALL_SPIKE_DAMAGE_Timer -=diff; + } +}; + +struct TRINITY_DLL_DECL mob_crystalline_tanglerAI : public ScriptedAI +{ + mob_crystalline_tanglerAI(Creature *c) : ScriptedAI(c) {} + + uint32 SPELL_ROOTS_Timer; + + void Reset() + { + SPELL_ROOTS_Timer = 1000; + } + + void UpdateAI(const uint32 diff) + { + if (SPELL_ROOTS_Timer < diff) + { + if (m_creature->IsWithinDist(m_creature->getVictim(), 5.0f, false)) + { + DoCast(m_creature->getVictim(), SPELL_ROOTS); + SPELL_ROOTS_Timer = 15000; + } + }else SPELL_ROOTS_Timer -=diff; + } +}; + +CreatureAI* GetAI_mob_crystal_spike(Creature* pCreature) +{ + return new mob_crystal_spikeAI (pCreature); +} + +CreatureAI* GetAI_mob_crystalline_tangler(Creature* pCreature) +{ + return new mob_crystalline_tanglerAI (pCreature); +} + +CreatureAI* GetAI_boss_ormorok(Creature* pCreature) +{ + return new boss_ormorokAI (pCreature); +} + +void AddSC_boss_ormorok() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_ormorok"; + newscript->GetAI = &GetAI_boss_ormorok; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_crystal_spike"; + newscript->GetAI = &GetAI_mob_crystal_spike; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_crystalline_tangler"; + newscript->GetAI = &GetAI_mob_crystalline_tangler; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/nexus/nexus/commander_kolurg.cpp b/src/bindings/scripts/scripts/northrend/nexus/nexus/commander_kolurg.cpp new file mode 100644 index 00000000000..a28deb89264 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/nexus/nexus/commander_kolurg.cpp @@ -0,0 +1,57 @@ +/* Script Data Start +SDName: Boss Commander Kolurg +SDAuthor: LordVanMartin +SD%Complete: +SDComment: Only Alliance Heroic +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = 'boss_commander_kolurg' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +#define SPELL_BATTLE_SHOUT 31403 +#define SPELL_CHARGE 60067 +#define SPELL_FRIGHTENING_SHOUT 19134 +#define SPELL_WHIRLWIND_1 38619 +#define SPELL_WHIRLWIND_2 38618 + +//Yell +#define SAY_AGGRO 1576024 +#define SAY_KILL 1576025 +#define SAY_DEATH 1576026 + +struct TRINITY_DLL_DECL boss_commander_kolurgAI : public ScriptedAI +{ + boss_commander_kolurgAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) {} + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) {} +}; + +CreatureAI* GetAI_boss_commander_kolurg(Creature* pCreature) +{ + return new boss_commander_kolurgAI (pCreature); +} + +void AddSC_boss_commander_kolurg() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_commander_kolurg"; + newscript->GetAI = &GetAI_boss_commander_kolurg; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/nexus/nexus/commander_stoutbeard.cpp b/src/bindings/scripts/scripts/northrend/nexus/nexus/commander_stoutbeard.cpp new file mode 100644 index 00000000000..1bacd679e25 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/nexus/nexus/commander_stoutbeard.cpp @@ -0,0 +1,63 @@ +/* Script Data Start +SDName: Boss Commander Stoutbeard +SDAuthor: LordVanMartin +SD%Complete: +SDComment: Only Horde Heroic +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = 'boss_commander_stoutbeard' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +#define SPELL_BATTLE_SHOUT 31403 +#define SPELL_CHARGE 60067 +#define SPELL_FRIGHTENING_SHOUT 19134 +#define SPELL_WHIRLWIND_1 38619 +#define SPELL_WHIRLWIND_2 38618 + +//Yell +#define SAY_AGGRO 1576021 +#define SAY_KILL 1576022 +#define SAY_DEATH 1576023 + +struct TRINITY_DLL_DECL boss_commander_stoutbeardAI : public ScriptedAI +{ + boss_commander_stoutbeardAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } +}; + +CreatureAI* GetAI_boss_commander_stoutbeard(Creature* pCreature) +{ + return new boss_commander_stoutbeardAI (pCreature); +} + +void AddSC_boss_commander_stoutbeard() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_commander_stoutbeard"; + newscript->GetAI = &GetAI_boss_commander_stoutbeard; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/nexus/nexus/def_nexus.h b/src/bindings/scripts/scripts/northrend/nexus/nexus/def_nexus.h new file mode 100644 index 00000000000..678e44e5bbe --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/nexus/nexus/def_nexus.h @@ -0,0 +1,19 @@ +#ifndef DEF_NEXUS_H +#define DEF_NEXUS_H + +enum +{ + DATA_MAGUS_TELESTRA_EVENT, + DATA_ANOMALUS_EVENT, + DATA_ORMOROK_EVENT, + DATA_KERISTRASZA_EVENT, + + DATA_ANOMALUS, + DATA_KERISTRASZA, + + ANOMALUS_CONTAINMET_SPHERE, + ORMOROKS_CONTAINMET_SPHERE, + TELESTRAS_CONTAINMET_SPHERE +}; + +#endif diff --git a/src/bindings/scripts/scripts/northrend/nexus/nexus/instance_nexus.cpp b/src/bindings/scripts/scripts/northrend/nexus/nexus/instance_nexus.cpp new file mode 100644 index 00000000000..169eda90d2a --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/nexus/nexus/instance_nexus.cpp @@ -0,0 +1,258 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Nexus +SD%Complete: +SDComment: +SDCategory: The Nexus, The Nexus +EndScriptData */ + +#include "precompiled.h" +#include "def_nexus.h" + +#define NUMBER_OF_ENCOUNTERS 4 + +struct TRINITY_DLL_DECL instance_nexus : public ScriptedInstance +{ + instance_nexus(Map* pMap) : ScriptedInstance(pMap) { Initialize(); } + + uint32 m_auiEncounter[NUMBER_OF_ENCOUNTERS]; + + uint64 Anomalus; + uint64 Keristrasza; + + uint64 AnomalusContainmentSphere; + uint64 OrmoroksContainmentSphere; + uint64 TelestrasContainmentSphere; + + std::string strInstData; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + Anomalus = 0; + } + + void OnCreatureCreate(Creature* pCreature, bool add) + { + Map::PlayerList const& players = instance->GetPlayers(); + uint32 TeamInInstance = 0; + + if (!players.isEmpty()) + { + if (Player* pPlayer = players.begin()->getSource()) + { + TeamInInstance = pPlayer->GetTeam(); + } + } + switch(pCreature->GetEntry()) + { + case 26763: Anomalus = pCreature->GetGUID(); break; + case 26723: Keristrasza = pCreature->GetGUID(); break; + case 26800: + { + //26799 + pCreature->setFaction(16); + if (TeamInInstance == ALLIANCE) + pCreature->SetDisplayId(24358); + break; + } + case 26802: + { + //26801 + pCreature->setFaction(16); + if (TeamInInstance == ALLIANCE) + pCreature->SetDisplayId(24354); + break; + } + case 26805: + { + //26803 + pCreature->setFaction(16); + if (TeamInInstance == ALLIANCE) + pCreature->SetDisplayId(24357); + break; + } + case 27949: + { + //27947 + pCreature->setFaction(16); + if (TeamInInstance == ALLIANCE) + pCreature->SetDisplayId(24352); + break; + } + case 26796: + { + //26798 + pCreature->setFaction(16); + if (TeamInInstance == ALLIANCE) + pCreature->SetDisplayId(24352); + break; + } + } + } + + void OnGameObjectCreate(GameObject* pGo, bool add) + { + switch(pGo->GetEntry()) + { + case 188527: + { + AnomalusContainmentSphere = pGo->GetGUID(); + if (m_auiEncounter[1] == DONE) + pGo->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1); + break; + } + case 188528: + { + OrmoroksContainmentSphere = pGo->GetGUID(); + if (m_auiEncounter[2] == DONE) + pGo->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1); + break; + } + case 188526: + { + TelestrasContainmentSphere = pGo->GetGUID(); + if (m_auiEncounter[0] == DONE) + pGo->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1); + break; + } + } + } + + uint32 GetData(uint32 identifier) + { + switch(identifier) + { + case DATA_MAGUS_TELESTRA_EVENT: return m_auiEncounter[0]; + case DATA_ANOMALUS_EVENT: return m_auiEncounter[1]; + case DATA_ORMOROK_EVENT: return m_auiEncounter[2]; + case DATA_KERISTRASZA_EVENT: return m_auiEncounter[3]; + } + return 0; + } + + void SetData(uint32 identifier, uint32 data) + { + switch(identifier) + { + case DATA_MAGUS_TELESTRA_EVENT: + { + if (data == DONE) + { + GameObject *Sphere = instance->GetGameObject(TelestrasContainmentSphere); + if (Sphere) + Sphere->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1); + } + m_auiEncounter[0] = data; + break; + } + case DATA_ANOMALUS_EVENT: + { + if (data == DONE) + { + GameObject *Sphere = instance->GetGameObject(AnomalusContainmentSphere); + if (Sphere) + Sphere->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1); + } + m_auiEncounter[1] = data; + break; + } + case DATA_ORMOROK_EVENT: + { + if (data == DONE) + { + GameObject *Sphere = instance->GetGameObject(OrmoroksContainmentSphere); + if (Sphere) + Sphere->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1); + } + m_auiEncounter[2] = data; + break; + } + case DATA_KERISTRASZA_EVENT: m_auiEncounter[3] = data; break; + } + + if (data == DONE) + { + OUT_SAVE_INST_DATA; + + std::ostringstream saveStream; + saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " " + << m_auiEncounter[3]; + + strInstData = saveStream.str(); + + SaveToDB(); + OUT_SAVE_INST_DATA_COMPLETE; + } + } + + uint64 GetData64(uint32 uiIdentifier) + { + switch(uiIdentifier) + { + case DATA_ANOMALUS: return Anomalus; + case DATA_KERISTRASZA: return Keristrasza; + case ANOMALUS_CONTAINMET_SPHERE: return AnomalusContainmentSphere; + case ORMOROKS_CONTAINMET_SPHERE: return OrmoroksContainmentSphere; + case TELESTRAS_CONTAINMET_SPHERE: return TelestrasContainmentSphere; + } + return 0; + } + + std::string GetSaveData() + { + return strInstData; + } + + void Load(const char* chrIn) + { + if (!chrIn) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(chrIn); + + std::istringstream loadStream(chrIn); + loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3]; + + for(uint8 i = 1; i < NUMBER_OF_ENCOUNTERS; ++i) + { + if (m_auiEncounter[i] == IN_PROGRESS) + m_auiEncounter[i] = NOT_STARTED; + } + + OUT_LOAD_INST_DATA_COMPLETE; + } +}; + +InstanceData* GetInstanceData_instance_nexus(Map* pMap) +{ + return new instance_nexus(pMap); +} + +void AddSC_instance_nexus() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_nexus"; + newscript->GetInstanceData = &GetInstanceData_instance_nexus; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/nexus/oculus/boss_drakos.cpp b/src/bindings/scripts/scripts/northrend/nexus/oculus/boss_drakos.cpp new file mode 100644 index 00000000000..bde90bf021e --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/nexus/oculus/boss_drakos.cpp @@ -0,0 +1,82 @@ +/* Script Data Start +SDName: Boss drakos +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = '' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_MAGIC_PULL 51336 +#define SPELL_THUNDERING_STOMP 50774 +#define SPELL_THUNDERING_STOMP_2 59370 + +//Yell +#define SAY_AGGRO -1578000 +#define SAY_KILL_1 -1578001 +#define SAY_KILL_2 -1578002 +#define SAY_KILL_3 -1578003 +#define SAY_DEATH -1578004 +#define SAY_PULL_1 -1578005 +#define SAY_PULL_2 -1578006 +#define SAY_PULL_3 -1578007 +#define SAY_PULL_4 -1578008 +#define SAY_STOMP_1 -1578009 +#define SAY_STOMP_2 -1578010 +#define SAY_STOMP_3 -1578011 + +struct TRINITY_DLL_DECL boss_drakosAI : public ScriptedAI +{ + boss_drakosAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + switch(rand()%3) + { + case 0: DoScriptText(SAY_KILL_1, m_creature);break; + case 1: DoScriptText(SAY_KILL_2, m_creature);break; + case 2: DoScriptText(SAY_KILL_3, m_creature);break; + } + } +}; + +CreatureAI* GetAI_boss_drakos(Creature* pCreature) +{ + return new boss_drakosAI (pCreature); +} + +void AddSC_boss_drakos() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_drakos"; + newscript->GetAI = &GetAI_boss_drakos; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/nexus/oculus/boss_eregos.cpp b/src/bindings/scripts/scripts/northrend/nexus/oculus/boss_eregos.cpp new file mode 100644 index 00000000000..cc3fa3b3043 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/nexus/oculus/boss_eregos.cpp @@ -0,0 +1,104 @@ +/* Script Data Start +SDName: Boss eregos +SDAuthor: LordVanMartin +SD%Complete: +SDComment: Encounter is done entirely on drake vehicles +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = '' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Types of drake mounts: Ruby(Tank), Amber(DPS), Emerald(Healer) +//Two Repeating phases + +//Spells +#define SPELL_ARCANE_BARRAGE 50804 +#define SPELL_ARCANE_VOLLEY 51153 +#define SPELL_ENRAGED_ASSAULT 51170 +#define SPELL_PLANAR_ANOMALIES 57959 +#define SPELL_PLANAR_SHIFT 51162 + +//Heroic +#define SPELL_ARCANE_BARRAGE_H 59381 +#define SPELL_ARCANE_VOLLEY_H 59382 + +/*Ruby Drake , +(npc 27756) (item 37860) +(summoned by spell Ruby Essence = 37860 ---> Call Amber Drake == 49462 ---> Summon 27756) +*/ +#define NPC_RUBY_DRAKE_VEHICLE 27756 +#define SPELL_RIDE_RUBY_DRAKE_QUE 49463 //Apply Aura: Periodic Trigger, Interval: 3 seconds ---> 49464 +#define SPELL_RUBY_DRAKE_SADDLE 49464 //Allows you to ride on the back of an Amber Drake. ---> Dummy + +#define SPELL_RUBY_SEARING_WRATH 50232 //(60 yds) - Instant - Breathes a stream of fire at an enemy dragon, dealing 6800 to 9200 Fire damage and then jumping to additional dragons within 30 yards. Each jump increases the damage by 50%. Affects up to 5 total targets +#define SPELL_RUBY_EVASIVE_AURA 50248 //Instant - Allows the Ruby Drake to generate Evasive Charges when hit by hostile attacks and spells. +#define SPELL_RUBY_EVASIVE_MANEUVERS 50240 //Instant - 5 sec. cooldown - Allows your drake to dodge all incoming attacks and spells. Requires Evasive Charges to use. Each attack or spell dodged while this ability is active burns one Evasive Charge. Lasts 30 sec. or until all charges are exhausted. +//you do not have acces to until you kill Mage-Lord Urom +#define SPELL_RUBY_MARTYR 50253 //Instant - 10 sec. cooldown - Redirect all harmful spells cast at friendly drakes to yourself for 10 sec. + +/*Amber Drake, +(npc 27755) (item 37859) +(summoned by spell Amber Essence = 37859 ---> Call Amber Drake == 49461 ---> Summon 27755) +*/ +#define NPC_AMBER_DRAKE_VEHICLE 27755 +#define SPELL_RIDE_AMBER_DRAKE_QUE 49459 //Apply Aura: Periodic Trigger, Interval: 3 seconds ---> 49460 +#define SPELL_AMBER_DRAKE_SADDLE 49460 //Allows you to ride on the back of an Amber Drake. ---> Dummy + +#define SPELL_AMBER_SHOCK_LANCE 49840 //(60 yds) - Instant - Deals 4822 to 5602 Arcane damage and detonates all Shock Charges on an enemy dragon. Damage is increased by 6525 for each detonated. +#define SPELL_AMBER_STOP_TIME //Instant - 1 min cooldown - Halts the passage of time, freezing all enemy dragons in place for 10 sec. This attack applies 5 Shock Charges to each affected target. +//you do not have access to until you kill the Mage-Lord Urom. +#define SPELL_AMBER_TEMPORAL_RIFT 49592 //(60 yds) - Channeled - Channels a temporal rift on an enemy dragon for 10 sec. While trapped in the rift, all damage done to the target is increased by 100%. In addition, for every 15,000 damage done to a target affected by Temporal Rift, 1 Shock Charge is generated. + +/*Emerald Drake, +(npc 27692) (item 37815), + (summoned by spell Emerald Essence = 37815 ---> Call Emerald Drake == 49345 ---> Summon 27692) +*/ +#define NPC_EMERALD_DRAKE_VEHICLE 27692 +#define SPELL_RIDE_EMERALD_DRAKE_QUE 49427 //Apply Aura: Periodic Trigger, Interval: 3 seconds ---> 49346 +#define SPELL_EMERALD_DRAKE_SADDLE 49346 //Allows you to ride on the back of an Amber Drake. ---> Dummy + +#define SPELL_EMERALD_LEECHING_POISON 50328 //(60 yds) - Instant - Poisons the enemy dragon, leeching 1300 to the caster every 2 sec. for 12 sec. Stacks up to 3 times. +#define SPELL_EMERALD_TOUCH_THE_NIGHTMARE 50341 //(60 yds) - Instant - Consumes 30% of the caster's max health to inflict 25,000 nature damage to an enemy dragon and reduce the damage it deals by 25% for 30 sec. +// you do not have access to until you kill the Mage-Lord Urom +#define SPELL_EMERALD_DREAM_FUNNEL 50344 //(60 yds) - Channeled - Transfers 5% of the caster's max health to a friendly drake every second for 10 seconds as long as the caster channels. + +struct TRINITY_DLL_DECL boss_eregosAI : public ScriptedAI +{ + boss_eregosAI(Creature *c) : ScriptedAI(c) {} + + uint32 phase; + + void Reset() {} + void EnterCombat(Unit* who) {} + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + phase =1; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) {} +}; + +CreatureAI* GetAI_boss_eregos(Creature* pCreature) +{ + return new boss_eregosAI (pCreature); +} + +void AddSC_boss_eregos() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_eregos"; + newscript->GetAI = &GetAI_boss_eregos; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/nexus/oculus/boss_urom.cpp b/src/bindings/scripts/scripts/northrend/nexus/oculus/boss_urom.cpp new file mode 100644 index 00000000000..1f34ecefbbd --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/nexus/oculus/boss_urom.cpp @@ -0,0 +1,87 @@ +/* Script Data Start +SDName: Boss urom +SDAuthor: LordVanMartin +SD%Complete: 1% +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = '' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_ARCANE_SHIELD 53813 //Dummy --> Channeled, shields the caster from damage. +#define SPELL_EMPOWERED_ARCANE_EXPLOSION 51110 +#define SPELL_EMPOWERED_ARCANE_EXPLOSION_2 59377 +#define SPELL_FROSTBOMB 51103 //Urom throws a bomb, hitting its target with the highest aggro which inflict directly 650 frost damage and drops a frost zone on the ground. This zone deals 650 frost damage per second and reduce the movement speed by 35%. Lasts 1 minute. +#define SPELL_SUMMON_MENAGERIE 50476 //Summons an assortment of creatures and teleports the caster to safety. +#define SPELL_SUMMON_MENAGERIE_2 50495 +#define SPELL_SUMMON_MENAGERIE_3 50496 +#define SPELL_TELEPORT 51112 //Teleports to the center of Oculus +#define SPELL_TIME_BOMB 51121 //Deals arcane damage to a random player, and after 6 seconds, deals zone damage to nearby equal to the health missing of the target afflicted by the debuff. +#define SPELL_TIME_BOMB_2 59376 + +//Yell +#define SAY_AGGRO -1578012 +#define SAY_KILL_1 -1578013 +#define SAY_KILL_2 -1578014 +#define SAY_KILL_3 -1578015 +#define SAY_DEATH -1578016 +#define SAY_EXPLOSION_1 -1578017 +#define SAY_EXPLOSION_2 -1578018 +#define SAY_SUMMON_1 -1578019 +#define SAY_SUMMON_2 -1578020 +#define SAY_SUMMON_3 -1578021 + +struct TRINITY_DLL_DECL boss_uromAI : public ScriptedAI +{ + boss_uromAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + switch(rand()%3) + { + case 0: DoScriptText(SAY_KILL_1, m_creature);break; + case 1: DoScriptText(SAY_KILL_2, m_creature);break; + case 2: DoScriptText(SAY_KILL_3, m_creature);break; + } + } +}; + +CreatureAI* GetAI_boss_urom(Creature* pCreature) +{ + return new boss_uromAI (pCreature); +} + +void AddSC_boss_urom() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_urom"; + newscript->GetAI = &GetAI_boss_urom; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/nexus/oculus/boss_varos.cpp b/src/bindings/scripts/scripts/northrend/nexus/oculus/boss_varos.cpp new file mode 100644 index 00000000000..299c54dd8dc --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/nexus/oculus/boss_varos.cpp @@ -0,0 +1,85 @@ +/* Script Data Start +SDName: Boss varos +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = '' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_ENERGIZE_CORES 50785 //Damage 5938 to 6562, effec2 Triggers 54069, effect3 Triggers 56251 +#define SPELL_ENERGIZE_CORES_TRIGGER_1 54069 +#define SPELL_ENERGIZE_CORES_TRIGGER_2 56251 +#define SPELL_ENERGIZE_CORES_2 59372 //Damage 9025 to 9975, effect2 Triggers 54069, effect 56251 +#define SPELL_CALL_AZURE_RING_CAPTAIN 51002 //Effect Send Event (12229) +#define SPELL_CALL_AZURE_RING_CAPTAIN_2 51006 //Effect Send Event (10665) +#define SPELL_CALL_AZURE_RING_CAPTAIN_3 51007 //Effect Send Event (18454) +#define SPELL_CALL_AZURE_RING_CAPTAIN_4 51008 //Effect Send Event (18455) +#define SPELL_CALL_AMPLIFY_MAGIC 51054 +#define SPELL_CALL_AMPLIFY_MAGIC_2 59371 + +//Yell +#define SAY_AGGRO -1578022 +#define SAY_KILL_1 -1578023 +#define SAY_KILL_2 -1578024 +#define SAY_DEATH -1578025 +#define SAY_STRIKE_1 -1578026 +#define SAY_STRIKE_2 -1578027 +#define SAY_STRIKE_3 -1578028 +#define SAY_SPAWN -1578029 + + +struct TRINITY_DLL_DECL boss_varosAI : public ScriptedAI +{ + boss_varosAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + switch(rand()%2) + { + case 0: DoScriptText(SAY_KILL_1, m_creature);break; + case 1: DoScriptText(SAY_KILL_2, m_creature);break; + } + } +}; + +CreatureAI* GetAI_boss_varos(Creature* pCreature) +{ + return new boss_varosAI (pCreature); +} + +void AddSC_boss_varos() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_varos"; + newscript->GetAI = &GetAI_boss_varos; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/nexus/oculus/def_oculus.h b/src/bindings/scripts/scripts/northrend/nexus/oculus/def_oculus.h new file mode 100644 index 00000000000..0b63a52d866 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/nexus/oculus/def_oculus.h @@ -0,0 +1,4 @@ +#ifndef DEF_OCULUS_H +#define DEF_OCULUS_H + +#endif diff --git a/src/bindings/scripts/scripts/northrend/nexus/oculus/instance_oculus.cpp b/src/bindings/scripts/scripts/northrend/nexus/oculus/instance_oculus.cpp new file mode 100644 index 00000000000..b5ceee9e5ed --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/nexus/oculus/instance_oculus.cpp @@ -0,0 +1,21 @@ +#include "precompiled.h" +#include "def_oculus.h" + +struct TRINITY_DLL_DECL instance_oculus : public ScriptedInstance +{ + instance_oculus(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; +}; + +InstanceData* GetInstanceData_instance_oculus(Map* pMap) +{ + return new instance_oculus(pMap); +} + +void AddSC_instance_oculus() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_oculus"; + newscript->GetInstanceData = &GetInstanceData_instance_oculus; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/obsidian_sanctum/boss_sartharion.cpp b/src/bindings/scripts/scripts/northrend/obsidian_sanctum/boss_sartharion.cpp new file mode 100644 index 00000000000..01ba351ff99 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/obsidian_sanctum/boss_sartharion.cpp @@ -0,0 +1,1153 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss Sartharion +SD%Complete: 70% +SDComment: Flame wave, achievement and portal events need to be implemented +SDCategory: Obsidian Sanctum +EndScriptData */ + +#include "precompiled.h" +#include "def_obsidian_sanctum.h" + +enum +{ + //Sartharion Yell + SAY_SARTHARION_AGGRO = -1615018, + SAY_SARTHARION_BERSERK = -1615019, + SAY_SARTHARION_BREATH = -1615020, + SAY_SARTHARION_CALL_SHADRON = -1615021, + SAY_SARTHARION_CALL_TENEBRON = -1615022, + SAY_SARTHARION_CALL_VESPERON = -1615023, + SAY_SARTHARION_DEATH = -1615024, + SAY_SARTHARION_SPECIAL_1 = -1615025, + SAY_SARTHARION_SPECIAL_2 = -1615026, + SAY_SARTHARION_SPECIAL_3 = -1615027, + SAY_SARTHARION_SPECIAL_4 = -1615028, + SAY_SARTHARION_SLAY_1 = -1615029, + SAY_SARTHARION_SLAY_2 = -1615030, + SAY_SARTHARION_SLAY_3 = -1615031, + + WHISPER_LAVA_CHURN = -1615032, + + WHISPER_SHADRON_DICIPLE = -1615008, + WHISPER_VESPERON_DICIPLE = -1615041, + WHISPER_HATCH_EGGS = -1615017, + WHISPER_OPEN_PORTAL = -1615042, // whisper, shared by two dragons + + //Sartharion Spells + SPELL_BERSERK = 61632, // Increases the caster's attack speed by 150% and all damage it deals by 500% for 5 min. + SPELL_CLEAVE = 56909, // Inflicts 35% weapon damage to an enemy and its nearest allies, affecting up to 10 targets. + SPELL_FLAME_BREATH = 56908, // Inflicts 8750 to 11250 Fire damage to enemies in a cone in front of the caster. + SPELL_FLAME_BREATH_H = 58956, // Inflicts 10938 to 14062 Fire damage to enemies in a cone in front of the caster. + SPELL_TAIL_LASH = 56910, // A sweeping tail strike hits all enemies behind the caster, inflicting 3063 to 3937 damage and stunning them for 2 sec. + SPELL_TAIL_LASH_H = 58957, // A sweeping tail strike hits all enemies behind the caster, inflicting 4375 to 5625 damage and stunning them for 2 sec. + SPELL_WILL_OF_SARTHARION = 61254, // Sartharion's presence bolsters the resolve of the Twilight Drakes, increasing their total health by 25%. This effect also increases Sartharion's health by 25%. + SPELL_LAVA_STRIKE = 57571, // (Real spell casted should be 57578) 57571 then trigger visual missile, then summon Lava Blaze on impact(spell 57572) + SPELL_TWILIGHT_REVENGE = 60639, + + SPELL_PYROBUFFET = 56916, // currently used for hard enrage after 15 minutes + SPELL_PYROBUFFET_RANGE = 58907, // possibly used when player get too far away from dummy creatures (2x Creature entry 30494) + + SPELL_TWILIGHT_SHIFT_ENTER = 57620, // enter phase. Player get this when click GO + SPELL_TWILIGHT_SHIFT_REMOVAL = 61187, // leave phase + SPELL_TWILIGHT_SHIFT_REMOVAL_ALL = 61190, // leave phase (probably version to make all leave) + + //Mini bosses common spells + SPELL_TWILIGHT_RESIDUE = 61885, // makes immune to shadow damage, applied when leave phase + + //Miniboses (Vesperon, Shadron, Tenebron) + SPELL_SHADOW_BREATH_H = 59126, // Inflicts 8788 to 10212 Fire damage to enemies in a cone in front of the caster. + SPELL_SHADOW_BREATH = 57570, // Inflicts 6938 to 8062 Fire damage to enemies in a cone in front of the caster. + + SPELL_SHADOW_FISSURE_H = 59127, // Deals 9488 to 13512 Shadow damage to any enemy within the Shadow fissure after 5 sec. + SPELL_SHADOW_FISSURE = 57579, // Deals 6188 to 8812 Shadow damage to any enemy within the Shadow fissure after 5 sec. + + //Vesperon + //In portal is a disciple, when disciple killed remove Power_of_vesperon, portal open multiple times + NPC_ACOLYTE_OF_VESPERON = 31219, // Acolyte of Vesperon + SPELL_POWER_OF_VESPERON = 61251, // Vesperon's presence decreases the maximum health of all enemies by 25%. + SPELL_TWILIGHT_TORMENT_VESP = 57948, // (Shadow only) trigger 57935 then 57988 + SPELL_TWILIGHT_TORMENT_VESP_ACO = 58853, // (Fire and Shadow) trigger 58835 then 57988 + + //Shadron + //In portal is a disciple, when disciple killed remove Power_of_vesperon, portal open multiple times + NPC_ACOLYTE_OF_SHADRON = 31218, // Acolyte of Shadron + SPELL_POWER_OF_SHADRON = 58105, // Shadron's presence increases Fire damage taken by all enemies by 100%. + SPELL_GIFT_OF_TWILIGTH_SHA = 57835, // TARGET_SCRIPT shadron + SPELL_GIFT_OF_TWILIGTH_SAR = 58766, // TARGET_SCRIPT sartharion + + //Tenebron + //in the portal spawns 6 eggs, if not killed in time (approx. 20s) they will hatch, whelps can cast 60708 + SPELL_POWER_OF_TENEBRON = 61248, // Tenebron's presence increases Shadow damage taken by all enemies by 100%. + //Tenebron, dummy spell + SPELL_SUMMON_TWILIGHT_WHELP = 58035, // doesn't work, will spawn NPC_TWILIGHT_WHELP + SPELL_SUMMON_SARTHARION_TWILIGHT_WHELP = 58826, // doesn't work, will spawn NPC_SHARTHARION_TWILIGHT_WHELP + + SPELL_HATCH_EGGS_H = 59189, + SPELL_HATCH_EGGS = 58542, + SPELL_HATCH_EGGS_EFFECT_H = 59190, + SPELL_HATCH_EGGS_EFFECT = 58685, + + //Whelps + NPC_TWILIGHT_WHELP = 30890, + NPC_SHARTHARION_TWILIGHT_WHELP = 31214, + SPELL_FADE_ARMOR = 60708, // Reduces the armor of an enemy by 1500 for 15s + + //flame tsunami + SPELL_FLAME_TSUNAMI = 57494, // the visual dummy + SPELL_FLAME_TSUNAMI_LEAP = 60241, // SPELL_EFFECT_138 some leap effect, causing caster to move in direction + SPELL_FLAME_TSUNAMI_DMG_AURA = 57492, // periodic damage, npc has this aura + + NPC_FLAME_TSUNAMI = 30616, // for the flame waves + NPC_LAVA_BLAZE = 30643, // adds spawning from flame strike + + //using these custom points for dragons start and end + POINT_ID_INIT = 100, + POINT_ID_LAND = 200 +}; + +struct Waypoint +{ + float m_fX, m_fY, m_fZ; +}; + +//each dragons special points. First where fly to before connect to connon, second where land point is. +Waypoint m_aTene[]= +{ + {3212.854, 575.597, 109.856}, //init + {3246.425, 565.367, 61.249} //end +}; + +Waypoint m_aShad[]= +{ + {3293.238, 472.223, 106.968}, + {3271.669, 526.907, 61.931} +}; + +Waypoint m_aVesp[]= +{ + {3193.310, 472.861, 102.697}, + {3227.268, 533.238, 59.995} +}; + +//points around raid "isle", counter clockwise. should probably be adjusted to be more alike +Waypoint m_aDragonCommon[]= +{ + {3214.012, 468.932, 98.652}, + {3244.950, 468.427, 98.652}, + {3283.520, 496.869, 98.652}, + {3287.316, 555.875, 98.652}, + {3250.479, 585.827, 98.652}, + {3209.969, 566.523, 98.652} +}; + +/*###### +## Boss Sartharion +######*/ + +struct TRINITY_DLL_DECL boss_sartharionAI : public ScriptedAI +{ + boss_sartharionAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = pCreature->GetInstanceData(); + m_bIsHeroic = pCreature->GetMap()->IsHeroic(); + } + + ScriptedInstance* m_pInstance; + bool m_bIsHeroic; + + bool m_bIsBerserk; + bool m_bIsSoftEnraged; + + uint32 m_uiEnrageTimer; + bool m_bIsHardEnraged; + + uint32 m_uiTenebronTimer; + uint32 m_uiShadronTimer; + uint32 m_uiVesperonTimer; + + uint32 m_uiFlameTsunamiTimer; + uint32 m_uiFlameBreathTimer; + uint32 m_uiTailSweepTimer; + uint32 m_uiCleaveTimer; + uint32 m_uiLavaStrikeTimer; + + bool m_bHasCalledTenebron; + bool m_bHasCalledShadron; + bool m_bHasCalledVesperon; + + void Reset() + { + m_bIsBerserk = false; + m_bIsSoftEnraged = false; + + m_uiEnrageTimer = MINUTE*15*IN_MILISECONDS; + m_bIsHardEnraged = false; + + m_uiTenebronTimer = 30000; + m_uiShadronTimer = 75000; + m_uiVesperonTimer = 120000; + + m_uiFlameTsunamiTimer = 30000; + m_uiFlameBreathTimer = 20000; + m_uiTailSweepTimer = 20000; + m_uiCleaveTimer = 7000; + m_uiLavaStrikeTimer = 5000; + + m_bHasCalledTenebron = false; + m_bHasCalledShadron = false; + m_bHasCalledVesperon = false; + + if (m_creature->HasAura(SPELL_TWILIGHT_REVENGE)) + m_creature->RemoveAurasDueToSpell(SPELL_TWILIGHT_REVENGE); + } + + void JustReachedHome() + { + if (m_pInstance) + m_pInstance->SetData(TYPE_SARTHARION_EVENT, NOT_STARTED); + } + + void Aggro(Unit* pWho) + { + DoScriptText(SAY_SARTHARION_AGGRO,m_creature); + DoZoneInCombat(); + + if (m_pInstance) + { + m_pInstance->SetData(TYPE_SARTHARION_EVENT, IN_PROGRESS); + FetchDragons(); + } + } + + void JustDied(Unit* pKiller) + { + DoScriptText(SAY_SARTHARION_DEATH,m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_SARTHARION_EVENT, DONE); + } + + void KilledUnit(Unit* pVictim) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_SARTHARION_SLAY_1, m_creature); break; + case 1: DoScriptText(SAY_SARTHARION_SLAY_2, m_creature); break; + case 2: DoScriptText(SAY_SARTHARION_SLAY_3, m_creature); break; + } + } + + void FetchDragons() + { + Unit* pTene = Unit::GetUnit(*m_creature,m_pInstance->GetData64(DATA_TENEBRON)); + Unit* pShad = Unit::GetUnit(*m_creature,m_pInstance->GetData64(DATA_SHADRON)); + Unit* pVesp = Unit::GetUnit(*m_creature,m_pInstance->GetData64(DATA_VESPERON)); + + //if at least one of the dragons are alive and are being called + bool bCanUseWill = false; + + if (pTene && pTene->isAlive() && !pTene->getVictim()) + { + bCanUseWill = true; + pTene->GetMotionMaster()->MovePoint(POINT_ID_INIT, m_aTene[0].m_fX, m_aTene[0].m_fY, m_aTene[0].m_fZ); + + if (!pTene->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + pTene->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + } + + if (pShad && pShad->isAlive() && !pShad->getVictim()) + { + bCanUseWill = true; + pShad->GetMotionMaster()->MovePoint(POINT_ID_INIT, m_aShad[0].m_fX, m_aShad[0].m_fY, m_aShad[0].m_fZ); + + if (!pShad->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + pShad->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + } + + if (pVesp && pVesp->isAlive() && !pVesp->getVictim()) + { + bCanUseWill = true; + pVesp->GetMotionMaster()->MovePoint(POINT_ID_INIT, m_aVesp[0].m_fX, m_aVesp[0].m_fY, m_aVesp[0].m_fZ); + + if (!pVesp->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + pVesp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + } + + if (bCanUseWill) + DoCast(m_creature, SPELL_WILL_OF_SARTHARION); + } + + void CallDragon(uint32 uiDataId) + { + if (m_pInstance) + { + Creature* pTemp = Unit::GetCreature((*m_creature),m_pInstance->GetData64(uiDataId)); + + if (pTemp && pTemp->isAlive() && !pTemp->getVictim()) + { + if (pTemp->HasUnitMovementFlag(MOVEMENTFLAG_WALK_MODE)) + pTemp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + + if (pTemp->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + pTemp->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + int32 iTextId = 0; + + switch(pTemp->GetEntry()) + { + case NPC_TENEBRON: + iTextId = SAY_SARTHARION_CALL_TENEBRON; + pTemp->GetMotionMaster()->MovePoint(POINT_ID_LAND, m_aTene[1].m_fX, m_aTene[1].m_fY, m_aTene[1].m_fZ); + break; + case NPC_SHADRON: + iTextId = SAY_SARTHARION_CALL_SHADRON; + pTemp->GetMotionMaster()->MovePoint(POINT_ID_LAND, m_aShad[1].m_fX, m_aShad[1].m_fY, m_aShad[1].m_fZ); + break; + case NPC_VESPERON: + iTextId = SAY_SARTHARION_CALL_VESPERON; + pTemp->GetMotionMaster()->MovePoint(POINT_ID_LAND, m_aVesp[1].m_fX, m_aVesp[1].m_fY, m_aVesp[1].m_fZ); + break; + } + + DoScriptText(iTextId, m_creature); + } + } + } + + void SendFlameTsunami() + { + Map* pMap = m_creature->GetMap(); + + if (pMap && pMap->IsDungeon()) + { + Map::PlayerList const &PlayerList = pMap->GetPlayers(); + + if (!PlayerList.isEmpty()) + { + for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) + { + if (i->getSource()->isAlive()) + DoScriptText(WHISPER_LAVA_CHURN,m_creature,i->getSource()); + } + } + } + } + + void UpdateAI(const uint32 uiDiff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + //spell will target dragons, if they are still alive at 35% + if (!m_bIsBerserk && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) <= 35) + { + DoScriptText(SAY_SARTHARION_BERSERK,m_creature); + DoCast(m_creature,SPELL_BERSERK); + m_bIsBerserk = true; + } + + //soft enrage + if (!m_bIsSoftEnraged && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) <= 10) + { + // TODO + m_bIsSoftEnraged = true; + } + + // hard enrage + if (!m_bIsHardEnraged) + { + if (m_uiEnrageTimer < uiDiff) + { + DoCast(m_creature, SPELL_PYROBUFFET, true); + m_bIsHardEnraged = true; + } + else + m_uiEnrageTimer -= uiDiff; + } + + // flame tsunami + if (m_uiFlameTsunamiTimer < uiDiff) + { + SendFlameTsunami(); + m_uiFlameTsunamiTimer = 30000; + } + else + m_uiFlameTsunamiTimer -= uiDiff; + + // flame breath + if (m_uiFlameBreathTimer < uiDiff) + { + DoScriptText(SAY_SARTHARION_BREATH, m_creature); + DoCast(m_creature->getVictim(), m_bIsHeroic ? SPELL_FLAME_BREATH_H : SPELL_FLAME_BREATH); + m_uiFlameBreathTimer = 25000 + rand()%10000; + } + else + m_uiFlameBreathTimer -= uiDiff; + + // Tail Sweep + if (m_uiTailSweepTimer < uiDiff) + { + DoCast(m_creature->getVictim(), m_bIsHeroic ? SPELL_TAIL_LASH_H : SPELL_TAIL_LASH); + m_uiTailSweepTimer = 15000 + rand()%5000; + } + else + m_uiTailSweepTimer -= uiDiff; + + // Cleave + if (m_uiCleaveTimer < uiDiff) + { + DoCast(m_creature->getVictim(), SPELL_CLEAVE); + m_uiCleaveTimer = 7000 + rand()%3000; + } + else + m_uiCleaveTimer -= uiDiff; + + // Lavas Strike + if (m_uiLavaStrikeTimer < uiDiff) + { + if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + { + DoCast(pTarget, SPELL_LAVA_STRIKE); + + switch(rand()%15) + { + case 0: DoScriptText(SAY_SARTHARION_SPECIAL_1, m_creature); break; + case 1: DoScriptText(SAY_SARTHARION_SPECIAL_2, m_creature); break; + case 2: DoScriptText(SAY_SARTHARION_SPECIAL_3, m_creature); break; + } + } + m_uiLavaStrikeTimer = 5000 + rand()%15000; + } + else + m_uiLavaStrikeTimer -= uiDiff; + + // call tenebron + if (!m_bHasCalledTenebron && m_uiTenebronTimer < uiDiff) + { + CallDragon(DATA_TENEBRON); + m_bHasCalledTenebron = true; + } + else + m_uiTenebronTimer -= uiDiff; + + // call shadron + if (!m_bHasCalledShadron && m_uiShadronTimer < uiDiff) + { + CallDragon(DATA_SHADRON); + m_bHasCalledShadron = true; + } + else + m_uiShadronTimer -= uiDiff; + + // call vesperon + if (!m_bHasCalledVesperon && m_uiVesperonTimer < uiDiff) + { + CallDragon(DATA_VESPERON); + m_bHasCalledVesperon = true; + } + else + m_uiVesperonTimer -= uiDiff; + + DoMeleeAttackIfReady(); + + EnterEvadeIfOutOfCombatArea(uiDiff); + } +}; + +CreatureAI* GetAI_boss_sartharion(Creature* pCreature) +{ + return new boss_sartharionAI(pCreature); +} + +enum TeneText +{ + SAY_TENEBRON_AGGRO = -1615009, + SAY_TENEBRON_SLAY_1 = -1615010, + SAY_TENEBRON_SLAY_2 = -1615011, + SAY_TENEBRON_DEATH = -1615012, + SAY_TENEBRON_BREATH = -1615013, + SAY_TENEBRON_RESPOND = -1615014, + SAY_TENEBRON_SPECIAL_1 = -1615015, + SAY_TENEBRON_SPECIAL_2 = -1615016 +}; + +enum ShadText +{ + SAY_SHADRON_AGGRO = -1615000, + SAY_SHADRON_SLAY_1 = -1615001, + SAY_SHADRON_SLAY_2 = -1615002, + SAY_SHADRON_DEATH = -1615003, + SAY_SHADRON_BREATH = -1615004, + SAY_SHADRON_RESPOND = -1615005, + SAY_SHADRON_SPECIAL_1 = -1615006, + SAY_SHADRON_SPECIAL_2 = -1615007 +}; + +enum VespText +{ + SAY_VESPERON_AGGRO = -1615033, + SAY_VESPERON_SLAY_1 = -1615034, + SAY_VESPERON_SLAY_2 = -1615035, + SAY_VESPERON_DEATH = -1615036, + SAY_VESPERON_BREATH = -1615037, + SAY_VESPERON_RESPOND = -1615038, + SAY_VESPERON_SPECIAL_1 = -1615039, + SAY_VESPERON_SPECIAL_2 = -1615040 +}; + +//to control each dragons common abilities +struct TRINITY_DLL_DECL dummy_dragonAI : public ScriptedAI +{ + dummy_dragonAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = pCreature->GetInstanceData(); + m_bIsHeroic = pCreature->GetMap()->IsHeroic(); + } + + ScriptedInstance* m_pInstance; + bool m_bIsHeroic; + + uint32 m_uiWaypointId; + uint32 m_uiMoveNextTimer; + int32 m_iPortalRespawnTime; + bool m_bCanMoveFree; + + void Reset() + { + if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + m_uiWaypointId = 0; + m_uiMoveNextTimer = 500; + m_iPortalRespawnTime = 30000; + m_bCanMoveFree = false; + } + + void MovementInform(uint32 uiType, uint32 uiPointId) + { + if (!m_pInstance || uiType != POINT_MOTION_TYPE) + return; + + debug_log("dummy_dragonAI: %s reached point %u", m_creature->GetName(), uiPointId); + + //if healers messed up the raid and we was already initialized + if (m_pInstance->GetData(TYPE_SARTHARION_EVENT) != IN_PROGRESS) + { + EnterEvadeMode(); + return; + } + + //this is end, if we reach this, don't do much + if (uiPointId == POINT_ID_LAND) + { + m_creature->GetMotionMaster()->Clear(); + m_bCanMoveFree = false; + return; + } + + //get amount of common points + uint32 uiCommonWPCount = sizeof(m_aDragonCommon)/sizeof(Waypoint); + + //increase + m_uiWaypointId = uiPointId+1; + + //if we have reached a point bigger or equal to count, it mean we must reset to point 0 + if (m_uiWaypointId >= uiCommonWPCount) + { + if (!m_bCanMoveFree) + m_bCanMoveFree = true; + + m_uiWaypointId = 0; + } + + m_uiMoveNextTimer = 500; + } + + //used when open portal and spawn mobs in phase + void DoRaidWhisper(int32 iTextId) + { + Map* pMap = m_creature->GetMap(); + + if (pMap && pMap->IsDungeon()) + { + Map::PlayerList const &PlayerList = pMap->GetPlayers(); + + if (!PlayerList.isEmpty()) + { + for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) + DoScriptText(iTextId, m_creature, i->getSource()); + } + } + } + + //"opens" the portal and does the "opening" whisper + void OpenPortal() + { + int32 iTextId = 0; + + //there are 4 portal spawn locations, each are expected to be spawned with negative spawntimesecs in database + + //using a grid search here seem to be more efficient than caching all four guids + //in instance script and calculate range to each. + GameObject* pPortal = m_creature->FindNearestGameObject(GO_TWILIGHT_PORTAL,50.0f); + + switch(m_creature->GetEntry()) + { + case NPC_TENEBRON: + iTextId = WHISPER_HATCH_EGGS; + break; + case NPC_SHADRON: + case NPC_VESPERON: + iTextId = WHISPER_OPEN_PORTAL; + break; + } + + DoRaidWhisper(iTextId); + + //By using SetRespawnTime() we will actually "spawn" the object with our defined time. + //Once time is up, portal will disappear again. + if (pPortal && !pPortal->isSpawned()) + pPortal->SetRespawnTime(m_iPortalRespawnTime); + + //Unclear what are expected to happen if one drake has a portal open already + //Refresh respawnTime so time again are set to 30secs? + } + + //Removes each drakes unique debuff from players + void RemoveDebuff(uint32 uiSpellId) + { + Map* pMap = m_creature->GetMap(); + + if (pMap && pMap->IsDungeon()) + { + Map::PlayerList const &PlayerList = pMap->GetPlayers(); + + if (PlayerList.isEmpty()) + return; + + for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) + { + if (i->getSource()->isAlive() && i->getSource()->HasAura(uiSpellId)) + i->getSource()->RemoveAurasDueToSpell(uiSpellId); + } + } + } + + void JustDied(Unit* pKiller) + { + int32 iTextId = 0; + uint32 uiSpellId = 0; + + switch(m_creature->GetEntry()) + { + case NPC_TENEBRON: + iTextId = SAY_TENEBRON_DEATH; + uiSpellId = SPELL_POWER_OF_TENEBRON; + break; + case NPC_SHADRON: + iTextId = SAY_SHADRON_DEATH; + uiSpellId = SPELL_POWER_OF_SHADRON; + break; + case NPC_VESPERON: + iTextId = SAY_VESPERON_DEATH; + uiSpellId = SPELL_POWER_OF_VESPERON; + break; + } + + DoScriptText(iTextId, m_creature); + + RemoveDebuff(uiSpellId); + + if (m_pInstance) + { + // not if solo mini-boss fight + if (m_pInstance->GetData(TYPE_SARTHARION_EVENT) != IN_PROGRESS) + return; + + // Twilight Revenge to main boss + if (Unit* pSartharion = Unit::GetUnit((*m_creature), m_pInstance->GetData64(DATA_SARTHARION))) + { + if (pSartharion->isAlive()) + m_creature->CastSpell(pSartharion,SPELL_TWILIGHT_REVENGE,true); + } + } + } + + void UpdateAI(const uint32 uiDiff) + { + if (m_bCanMoveFree && m_uiMoveNextTimer) + { + if (m_uiMoveNextTimer < uiDiff) + { + m_creature->GetMotionMaster()->MovePoint(m_uiWaypointId, + m_aDragonCommon[m_uiWaypointId].m_fX, m_aDragonCommon[m_uiWaypointId].m_fY, m_aDragonCommon[m_uiWaypointId].m_fZ); + + debug_log("dummy_dragonAI: %s moving to point %u", m_creature->GetName(), m_uiWaypointId); + m_uiMoveNextTimer = 0; + } + else + m_uiMoveNextTimer -= uiDiff; + } + } +}; + +/*###### +## Mob Tenebron +######*/ + +struct TRINITY_DLL_DECL mob_tenebronAI : public dummy_dragonAI +{ + mob_tenebronAI(Creature* pCreature) : dummy_dragonAI(pCreature) { } + + uint32 m_uiShadowBreathTimer; + uint32 m_uiShadowFissureTimer; + uint32 m_uiHatchEggTimer; + + void Reset() + { + m_uiShadowBreathTimer = 20000; + m_uiShadowFissureTimer = 5000; + m_uiHatchEggTimer = 30000; + } + + void Aggro(Unit* pWho) + { + DoScriptText(SAY_TENEBRON_AGGRO, m_creature); + DoZoneInCombat(); + DoCast(m_creature, SPELL_POWER_OF_TENEBRON); + } + + void KilledUnit(Unit* pVictim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_TENEBRON_SLAY_1, m_creature); break; + case 1: DoScriptText(SAY_TENEBRON_SLAY_2, m_creature); break; + } + } + + void UpdateAI(const uint32 uiDiff) + { + //if no target, update dummy and return + if (!UpdateVictim()) + { + dummy_dragonAI::UpdateAI(uiDiff); + return; + } + + // shadow fissure + if (m_uiShadowFissureTimer < uiDiff) + { + if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + DoCast(pTarget, m_bIsHeroic ? SPELL_SHADOW_FISSURE_H : SPELL_SHADOW_FISSURE); + + m_uiShadowFissureTimer = 15000 + rand()%5000; + } + else + m_uiShadowFissureTimer -= uiDiff; + + // shadow breath + if (m_uiShadowBreathTimer < uiDiff) + { + DoScriptText(SAY_TENEBRON_BREATH, m_creature); + DoCast(m_creature->getVictim(), m_bIsHeroic ? SPELL_SHADOW_BREATH_H : SPELL_SHADOW_BREATH); + m_uiShadowBreathTimer = 20000 + rand()%5000; + } + else + m_uiShadowBreathTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_tenebron(Creature* pCreature) +{ + return new mob_tenebronAI(pCreature); +} + +/*###### +## Mob Shadron +######*/ + +struct TRINITY_DLL_DECL mob_shadronAI : public dummy_dragonAI +{ + mob_shadronAI(Creature* pCreature) : dummy_dragonAI(pCreature) { } + + uint32 m_uiShadowBreathTimer; + uint32 m_uiShadowFissureTimer; + uint32 m_uiAcolyteShadronTimer; + + void Reset() + { + m_uiShadowBreathTimer = 20000; + m_uiShadowFissureTimer = 5000; + m_uiAcolyteShadronTimer = 60000; + + if (m_creature->HasAura(SPELL_TWILIGHT_TORMENT_VESP)) + m_creature->RemoveAurasDueToSpell(SPELL_TWILIGHT_TORMENT_VESP); + + if (m_creature->HasAura(SPELL_GIFT_OF_TWILIGTH_SHA)) + m_creature->RemoveAurasDueToSpell(SPELL_GIFT_OF_TWILIGTH_SHA); + } + + void Aggro(Unit* pWho) + { + DoScriptText(SAY_SHADRON_AGGRO,m_creature); + DoZoneInCombat(); + DoCast(m_creature, SPELL_POWER_OF_SHADRON); + } + + void KilledUnit(Unit* pVictim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_SHADRON_SLAY_1, m_creature); break; + case 1: DoScriptText(SAY_SHADRON_SLAY_2, m_creature); break; + } + } + + void UpdateAI(const uint32 uiDiff) + { + //if no target, update dummy and return + if (!UpdateVictim()) + { + dummy_dragonAI::UpdateAI(uiDiff); + return; + } + + // shadow fissure + if (m_uiShadowFissureTimer < uiDiff) + { + if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + DoCast(pTarget, m_bIsHeroic ? SPELL_SHADOW_FISSURE_H : SPELL_SHADOW_FISSURE); + + m_uiShadowFissureTimer = 15000 + rand()%5000; + } + else + m_uiShadowFissureTimer -= uiDiff; + + // shadow breath + if (m_uiShadowBreathTimer < uiDiff) + { + DoScriptText(SAY_SHADRON_BREATH, m_creature); + DoCast(m_creature->getVictim(), m_bIsHeroic ? SPELL_SHADOW_BREATH_H : SPELL_SHADOW_BREATH); + m_uiShadowBreathTimer = 20000 + rand()%5000; + } + else + m_uiShadowBreathTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_shadron(Creature* pCreature) +{ + return new mob_shadronAI(pCreature); +} + +/*###### +## Mob Vesperon +######*/ + +struct TRINITY_DLL_DECL mob_vesperonAI : public dummy_dragonAI +{ + mob_vesperonAI(Creature* pCreature) : dummy_dragonAI(pCreature) { } + + uint32 m_uiShadowBreathTimer; + uint32 m_uiShadowFissureTimer; + uint32 m_uiAcolyteVesperonTimer; + + void Reset() + { + m_uiShadowBreathTimer = 20000; + m_uiShadowFissureTimer = 5000; + m_uiAcolyteVesperonTimer = 60000; + } + + void Aggro(Unit* pWho) + { + DoScriptText(SAY_VESPERON_AGGRO,m_creature); + DoZoneInCombat(); + DoCast(m_creature, SPELL_POWER_OF_VESPERON); + } + + void KilledUnit(Unit* pVictim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_VESPERON_SLAY_1, m_creature); break; + case 1: DoScriptText(SAY_VESPERON_SLAY_2, m_creature); break; + } + } + + void UpdateAI(const uint32 uiDiff) + { + //if no target, update dummy and return + if (!UpdateVictim()) + { + dummy_dragonAI::UpdateAI(uiDiff); + return; + } + + // shadow fissure + if (m_uiShadowFissureTimer < uiDiff) + { + if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + DoCast(pTarget, m_bIsHeroic ? SPELL_SHADOW_FISSURE_H : SPELL_SHADOW_FISSURE); + + m_uiShadowFissureTimer = 15000 + rand()%5000; + } + else + m_uiShadowFissureTimer -= uiDiff; + + // shadow breath + if (m_uiShadowBreathTimer < uiDiff) + { + DoScriptText(SAY_VESPERON_BREATH, m_creature); + DoCast(m_creature->getVictim(), m_bIsHeroic ? SPELL_SHADOW_BREATH_H : SPELL_SHADOW_BREATH); + m_uiShadowBreathTimer = 20000 + rand()%5000; + } + else + m_uiShadowBreathTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_vesperon(Creature* pCreature) +{ + return new mob_vesperonAI(pCreature); +} + +/*###### +## Mob Acolyte of Shadron +######*/ + +struct TRINITY_DLL_DECL mob_acolyte_of_shadronAI : public ScriptedAI +{ + mob_acolyte_of_shadronAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = pCreature->GetInstanceData(); + } + + ScriptedInstance* m_pInstance; + + void Reset() + { + if (m_pInstance) + { + //if not solo figth, buff main boss, else place debuff on mini-boss. both spells TARGET_SCRIPT + if (m_pInstance->GetData(TYPE_SARTHARION_EVENT) == IN_PROGRESS) + DoCast(m_creature, SPELL_GIFT_OF_TWILIGTH_SAR); + else + DoCast(m_creature, SPELL_GIFT_OF_TWILIGTH_SHA); + } + } + + void JustDied(Unit* killer) + { + if (m_pInstance) + { + Creature* pDebuffTarget = NULL; + + if (m_pInstance->GetData(TYPE_SARTHARION_EVENT) == IN_PROGRESS) + { + //not solo fight, so main boss has deduff + pDebuffTarget = m_pInstance->instance->GetCreature(m_pInstance->GetData64(DATA_SARTHARION)); + + if (pDebuffTarget && pDebuffTarget->isAlive() && pDebuffTarget->HasAura(SPELL_GIFT_OF_TWILIGTH_SAR)) + pDebuffTarget->RemoveAurasDueToSpell(SPELL_GIFT_OF_TWILIGTH_SAR); + } + else + { + //event not in progress, then solo fight and must remove debuff mini-boss + pDebuffTarget = m_pInstance->instance->GetCreature(m_pInstance->GetData64(DATA_SHADRON)); + + if (pDebuffTarget && pDebuffTarget->isAlive() && pDebuffTarget->HasAura(SPELL_GIFT_OF_TWILIGTH_SHA)) + pDebuffTarget->RemoveAurasDueToSpell(SPELL_GIFT_OF_TWILIGTH_SHA); + } + } + } + + void UpdateAI(const uint32 uiDiff) + { + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_acolyte_of_shadron(Creature* pCreature) +{ + return new mob_acolyte_of_shadronAI(pCreature); +} + +/*###### +## Mob Acolyte of Vesperon +######*/ + +struct TRINITY_DLL_DECL mob_acolyte_of_vesperonAI : public ScriptedAI +{ + mob_acolyte_of_vesperonAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = pCreature->GetInstanceData(); + } + + ScriptedInstance* m_pInstance; + + void Reset() + { + DoCast(m_creature, SPELL_TWILIGHT_TORMENT_VESP_ACO); + } + + void JustDied(Unit* pKiller) + { + // remove twilight torment on Vesperon + if (m_pInstance) + { + Creature* pVesperon = m_pInstance->instance->GetCreature(m_pInstance->GetData64(DATA_VESPERON)); + + if (pVesperon && pVesperon->isAlive() && pVesperon->HasAura(SPELL_TWILIGHT_TORMENT_VESP)) + pVesperon->RemoveAurasDueToSpell(SPELL_TWILIGHT_TORMENT_VESP); + } + } + + void UpdateAI(const uint32 uiDiff) + { + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_acolyte_of_vesperon(Creature* pCreature) +{ + return new mob_acolyte_of_vesperonAI(pCreature); +} + +/*###### +## Mob Twilight Eggs +######*/ + +struct TRINITY_DLL_DECL mob_twilight_eggsAI : public ScriptedAI +{ + mob_twilight_eggsAI(Creature* pCreature) : ScriptedAI(pCreature) { } + + uint32 m_uiFadeArmorTimer; + + void Reset() + { + m_uiFadeArmorTimer = 1000; + } + + void AttackStart(Unit* pWho) { } + void MoveInLineOfSight(Unit* pWho) { } +}; + +CreatureAI* GetAI_mob_twilight_eggs(Creature* pCreature) +{ + return new mob_twilight_eggsAI(pCreature); +} + +/*###### +## Mob Twilight Whelps +######*/ + +struct TRINITY_DLL_DECL mob_twilight_whelpAI : public ScriptedAI +{ + mob_twilight_whelpAI(Creature* pCreature) : ScriptedAI(pCreature) { } + + uint32 m_uiFadeArmorTimer; + + void Reset() + { + m_uiFadeArmorTimer = 1000; + } + + void UpdateAI(const uint32 uiDiff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + // twilight torment + if (m_uiFadeArmorTimer < uiDiff) + { + DoCast(m_creature->getVictim(), SPELL_FADE_ARMOR); + m_uiFadeArmorTimer = 5000 + rand()%5000; + } + else + m_uiFadeArmorTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_twilight_whelp(Creature* pCreature) +{ + return new mob_twilight_whelpAI(pCreature); +} + +void AddSC_boss_sartharion() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_sartharion"; + newscript->GetAI = &GetAI_boss_sartharion; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_vesperon"; + newscript->GetAI = &GetAI_mob_vesperon; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_shadron"; + newscript->GetAI = &GetAI_mob_shadron; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_tenebron"; + newscript->GetAI = &GetAI_mob_tenebron; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_acolyte_of_shadron"; + newscript->GetAI = &GetAI_mob_acolyte_of_shadron; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_acolyte_of_vesperon"; + newscript->GetAI = &GetAI_mob_acolyte_of_vesperon; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_twilight_eggs"; + newscript->GetAI = &GetAI_mob_twilight_eggs; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_twilight_whelp"; + newscript->GetAI = &GetAI_mob_twilight_whelp; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/obsidian_sanctum/def_obsidian_sanctum.h b/src/bindings/scripts/scripts/northrend/obsidian_sanctum/def_obsidian_sanctum.h new file mode 100644 index 00000000000..461834a2386 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/obsidian_sanctum/def_obsidian_sanctum.h @@ -0,0 +1,20 @@ +#ifndef DEF_OBSIDIAN_SANCTUM_H +#define DEF_OBSIDIAN_SANCTUM_H + +enum +{ + TYPE_SARTHARION_EVENT = 1, + + DATA_SARTHARION = 10, + DATA_TENEBRON = 11, + DATA_SHADRON = 12, + DATA_VESPERON = 13, + + NPC_SARTHARION = 28860, + NPC_TENEBRON = 30452, + NPC_SHADRON = 30451, + NPC_VESPERON = 30449, + GO_TWILIGHT_PORTAL = 193988 +}; + +#endif diff --git a/src/bindings/scripts/scripts/northrend/obsidian_sanctum/instance_obsidian_sanctum.cpp b/src/bindings/scripts/scripts/northrend/obsidian_sanctum/instance_obsidian_sanctum.cpp new file mode 100644 index 00000000000..5dd3e06e585 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/obsidian_sanctum/instance_obsidian_sanctum.cpp @@ -0,0 +1,97 @@ +#include "precompiled.h" +#include "def_obsidian_sanctum.h" + +#define MAX_ENCOUNTER 1 + +/* Obsidian Sanctum encounters: +0 - Sartharion +*/ + +struct TRINITY_DLL_DECL instance_obsidian_sanctum : public ScriptedInstance +{ + instance_obsidian_sanctum(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + uint64 m_uiSartharionGUID; + uint64 m_uiTenebronGUID; + uint64 m_uiShadronGUID; + uint64 m_uiVesperonGUID; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + m_uiSartharionGUID = 0; + m_uiTenebronGUID = 0; + m_uiShadronGUID = 0; + m_uiVesperonGUID = 0; + } + + void OnCreatureCreate(Creature* pCreature, bool add) + { + switch(pCreature->GetEntry()) + { + case NPC_SARTHARION: + m_uiSartharionGUID = pCreature->GetGUID(); + break; + //three dragons below set to active state once created. + //we must expect bigger raid to encounter main boss, and then three dragons must be active due to grid differences + case NPC_TENEBRON: + m_uiTenebronGUID = pCreature->GetGUID(); + pCreature->setActive(true); + break; + case NPC_SHADRON: + m_uiShadronGUID = pCreature->GetGUID(); + pCreature->setActive(true); + break; + case NPC_VESPERON: + m_uiVesperonGUID = pCreature->GetGUID(); + pCreature->setActive(true); + break; + } + } + + void SetData(uint32 uiType, uint32 uiData) + { + if (uiType == TYPE_SARTHARION_EVENT) + m_auiEncounter[0] = uiData; + } + + uint32 GetData(uint32 uiType) + { + if (uiType == TYPE_SARTHARION_EVENT) + return m_auiEncounter[0]; + + return 0; + } + + uint64 GetData64(uint32 uiData) + { + switch(uiData) + { + case DATA_SARTHARION: + return m_uiSartharionGUID; + case DATA_TENEBRON: + return m_uiTenebronGUID; + case DATA_SHADRON: + return m_uiShadronGUID; + case DATA_VESPERON: + return m_uiVesperonGUID; + } + return 0; + } +}; + +InstanceData* GetInstanceData_instance_obsidian_sanctum(Map* pMap) +{ + return new instance_obsidian_sanctum(pMap); +} + +void AddSC_instance_obsidian_sanctum() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_obsidian_sanctum"; + newscript->GetInstanceData = &GetInstanceData_instance_obsidian_sanctum; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/ulduar/halls_of_lightning/boss_bjarngrim.cpp b/src/bindings/scripts/scripts/northrend/ulduar/halls_of_lightning/boss_bjarngrim.cpp new file mode 100644 index 00000000000..5b6301019a5 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/ulduar/halls_of_lightning/boss_bjarngrim.cpp @@ -0,0 +1,440 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss General Bjarngrim +SD%Complete: 70% +SDComment: Waypoint needed, we expect boss to always have 2x Stormforged Lieutenant following +SDCategory: Halls of Lightning +EndScriptData */ + +#include "precompiled.h" +#include "def_halls_of_lightning.h" + +enum +{ + //Yell + SAY_AGGRO = -1602000, + SAY_SLAY_1 = -1602001, + SAY_SLAY_2 = -1602002, + SAY_SLAY_3 = -1602003, + SAY_DEATH = -1602004, + SAY_BATTLE_STANCE = -1602005, + EMOTE_BATTLE_STANCE = -1602006, + SAY_BERSEKER_STANCE = -1602007, + EMOTE_BERSEKER_STANCE = -1602008, + SAY_DEFENSIVE_STANCE = -1602009, + EMOTE_DEFENSIVE_STANCE = -1602010, + + SPELL_DEFENSIVE_STANCE = 53790, + //SPELL_DEFENSIVE_AURA = 41105, + SPELL_SPELL_REFLECTION = 36096, + SPELL_PUMMEL = 12555, + SPELL_KNOCK_AWAY = 52029, + SPELL_IRONFORM = 52022, + + SPELL_BERSEKER_STANCE = 53791, + //SPELL_BERSEKER_AURA = 41107, + SPELL_INTERCEPT = 58769, + SPELL_WHIRLWIND = 52027, + SPELL_CLEAVE = 15284, + + SPELL_BATTLE_STANCE = 53792, + //SPELL_BATTLE_AURA = 41106, + SPELL_MORTAL_STRIKE = 16856, + SPELL_SLAM = 52026, + + //OTHER SPELLS + //SPELL_CHARGE_UP = 52098, // only used when starting walk from one platform to the other + //SPELL_TEMPORARY_ELECTRICAL_CHARGE = 52092, // triggered part of above + + NPC_STORMFORGED_LIEUTENANT = 29240, + SPELL_ARC_WELD = 59085, + SPELL_RENEW_STEEL_N = 52774, + SPELL_RENEW_STEEL_H = 59160, + + EQUIP_SWORD = 37871, + EQUIP_SHIELD = 35642, + EQUIP_MACE = 43623, + + STANCE_DEFENSIVE = 0, + STANCE_BERSERKER = 1, + STANCE_BATTLE = 2 +}; + +/*###### +## boss_bjarngrim +######*/ + +struct TRINITY_DLL_DECL boss_bjarngrimAI : public ScriptedAI +{ + boss_bjarngrimAI(Creature *pCreature) : ScriptedAI(pCreature) + { + m_pInstance = pCreature->GetInstanceData(); + m_bIsHeroic = pCreature->GetMap()->IsHeroic(); + m_uiStance = STANCE_DEFENSIVE; + } + + ScriptedInstance* m_pInstance; + + bool m_bIsHeroic; + bool m_bIsChangingStance; + + uint8 m_uiChargingStatus; + uint8 m_uiStance; + + uint32 m_uiCharge_Timer; + uint32 m_uiChangeStance_Timer; + + uint32 m_uiReflection_Timer; + uint32 m_uiKnockAway_Timer; + uint32 m_uiPummel_Timer; + uint32 m_uiIronform_Timer; + + uint32 m_uiIntercept_Timer; + uint32 m_uiWhirlwind_Timer; + uint32 m_uiCleave_Timer; + + uint32 m_uiMortalStrike_Timer; + uint32 m_uiSlam_Timer; + + uint64 m_uiStormforgedLieutenantGUID[2]; + + void Reset() + { + m_bIsChangingStance = false; + + m_uiChargingStatus = 0; + m_uiCharge_Timer = 1000; + + m_uiChangeStance_Timer = 20000 + rand()%5000; + + m_uiReflection_Timer = 8000; + m_uiKnockAway_Timer = 20000; + m_uiPummel_Timer = 10000; + m_uiIronform_Timer = 25000; + + m_uiIntercept_Timer = 5000; + m_uiWhirlwind_Timer = 10000; + m_uiCleave_Timer = 8000; + + m_uiMortalStrike_Timer = 8000; + m_uiSlam_Timer = 10000; + + for(uint8 i = 0; i < 2; ++i) + { + if (Creature* pStormforgedLieutenant = (Unit::GetCreature((*m_creature), m_uiStormforgedLieutenantGUID[i]))) + { + if (!pStormforgedLieutenant->isAlive()) + pStormforgedLieutenant->Respawn(); + } + } + + if (m_uiStance != STANCE_DEFENSIVE) + { + DoRemoveStanceAura(m_uiStance); + DoCast(m_creature, SPELL_DEFENSIVE_STANCE); + m_uiStance = STANCE_DEFENSIVE; + } + + SetEquipmentSlots(false, EQUIP_SWORD, EQUIP_SHIELD, EQUIP_NO_CHANGE); + + if (m_pInstance) + m_pInstance->SetData(TYPE_BJARNGRIM, NOT_STARTED); + } + + void EnterCombat(Unit* pWho) + { + DoScriptText(SAY_AGGRO, m_creature); + + //must get both lieutenants here and make sure they are with him + m_creature->CallForHelp(30.0f); + + if (m_pInstance) + m_pInstance->SetData(TYPE_BJARNGRIM, IN_PROGRESS); + } + + void KilledUnit(Unit* pVictim) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature); break; + case 1: DoScriptText(SAY_SLAY_2, m_creature); break; + case 2: DoScriptText(SAY_SLAY_3, m_creature); break; + } + } + + void JustDied(Unit* pKiller) + { + DoScriptText(SAY_DEATH, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_BJARNGRIM, DONE); + } + + //TODO: remove when removal is done by mangos + void DoRemoveStanceAura(uint8 uiStance) + { + switch(uiStance) + { + case STANCE_DEFENSIVE: + m_creature->RemoveAurasDueToSpell(SPELL_DEFENSIVE_STANCE); + break; + case STANCE_BERSERKER: + m_creature->RemoveAurasDueToSpell(SPELL_BERSEKER_STANCE); + break; + case STANCE_BATTLE: + m_creature->RemoveAurasDueToSpell(SPELL_BATTLE_STANCE); + break; + } + } + + void UpdateAI(const uint32 uiDiff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + // Change stance + if (m_uiChangeStance_Timer < uiDiff) + { + //wait for current spell to finish before change stance + if (m_creature->IsNonMeleeSpellCasted(false)) + return; + + DoRemoveStanceAura(m_uiStance); + + int uiTempStance = rand()%(3-1); + + if (uiTempStance >= m_uiStance) + ++uiTempStance; + + m_uiStance = uiTempStance; + + switch(m_uiStance) + { + case STANCE_DEFENSIVE: + DoScriptText(SAY_DEFENSIVE_STANCE, m_creature); + DoScriptText(EMOTE_DEFENSIVE_STANCE, m_creature); + DoCast(m_creature, SPELL_DEFENSIVE_STANCE); + SetEquipmentSlots(false, EQUIP_SWORD, EQUIP_SHIELD, EQUIP_NO_CHANGE); + break; + case STANCE_BERSERKER: + DoScriptText(SAY_BERSEKER_STANCE, m_creature); + DoScriptText(EMOTE_BERSEKER_STANCE, m_creature); + DoCast(m_creature, SPELL_BERSEKER_STANCE); + SetEquipmentSlots(false, EQUIP_SWORD, EQUIP_SWORD, EQUIP_NO_CHANGE); + break; + case STANCE_BATTLE: + DoScriptText(SAY_BATTLE_STANCE, m_creature); + DoScriptText(EMOTE_BATTLE_STANCE, m_creature); + DoCast(m_creature, SPELL_BATTLE_STANCE); + SetEquipmentSlots(false, EQUIP_MACE, EQUIP_UNEQUIP, EQUIP_NO_CHANGE); + break; + } + + m_uiChangeStance_Timer = 20000 + rand()%5000; + return; + } + else + m_uiChangeStance_Timer -= uiDiff; + + switch(m_uiStance) + { + case STANCE_DEFENSIVE: + { + if (m_uiReflection_Timer < uiDiff) + { + DoCast(m_creature, SPELL_SPELL_REFLECTION); + m_uiReflection_Timer = 8000 + rand()%1000; + } + else + m_uiReflection_Timer -= uiDiff; + + if (m_uiKnockAway_Timer < uiDiff) + { + DoCast(m_creature, SPELL_KNOCK_AWAY); + m_uiKnockAway_Timer = 20000 + rand()%1000; + } + else + m_uiKnockAway_Timer -= uiDiff; + + if (m_uiPummel_Timer < uiDiff) + { + DoCast(m_creature->getVictim(), SPELL_PUMMEL); + m_uiPummel_Timer = 10000 + rand()%1000; + } + else + m_uiPummel_Timer -= uiDiff; + + if (m_uiIronform_Timer < uiDiff) + { + DoCast(m_creature, SPELL_IRONFORM); + m_uiIronform_Timer = 25000 + rand()%1000; + } + else + m_uiIronform_Timer -= uiDiff; + + break; + } + case STANCE_BERSERKER: + { + if (m_uiIntercept_Timer < uiDiff) + { + //not much point is this, better random target and more often? + DoCast(m_creature->getVictim(), SPELL_INTERCEPT); + m_uiIntercept_Timer = 45000 + rand()%1000; + } + else + m_uiIntercept_Timer -= uiDiff; + + if (m_uiWhirlwind_Timer < uiDiff) + { + DoCast(m_creature, SPELL_WHIRLWIND); + m_uiWhirlwind_Timer = 10000 + rand()%1000; + } + else + m_uiWhirlwind_Timer -= uiDiff; + + if (m_uiCleave_Timer < uiDiff) + { + DoCast(m_creature->getVictim(), SPELL_CLEAVE); + m_uiCleave_Timer = 8000 + rand()%1000; + } + else + m_uiCleave_Timer -= uiDiff; + + break; + } + case STANCE_BATTLE: + { + if (m_uiMortalStrike_Timer < uiDiff) + { + DoCast(m_creature->getVictim(), SPELL_MORTAL_STRIKE); + m_uiMortalStrike_Timer = 20000 + rand()%1000; + } + else + m_uiMortalStrike_Timer -= uiDiff; + + if (m_uiSlam_Timer < uiDiff) + { + DoCast(m_creature->getVictim(), SPELL_SLAM); + m_uiSlam_Timer = 15000 + rand()%1000; + } + else + m_uiSlam_Timer -= uiDiff; + + break; + } + } + + DoMeleeAttackIfReady(); + } +}; + +/*###### +## mob_stormforged_lieutenant +######*/ + +struct TRINITY_DLL_DECL mob_stormforged_lieutenantAI : public ScriptedAI +{ + mob_stormforged_lieutenantAI(Creature *pCreature) : ScriptedAI(pCreature) + { + m_pInstance = pCreature->GetInstanceData(); + m_bIsHeroic = pCreature->GetMap()->IsHeroic(); + } + + ScriptedInstance* m_pInstance; + bool m_bIsHeroic; + + uint32 m_uiArcWeld_Timer; + uint32 m_uiRenewSteel_Timer; + + void Reset() + { + m_uiArcWeld_Timer = 20000 + rand()%1000; + m_uiRenewSteel_Timer = 10000 + rand()%1000; + } + + void EnterCombat(Unit* pWho) + { + if (m_pInstance) + { + if (Creature* pBjarngrim = m_pInstance->instance->GetCreature(m_pInstance->GetData64(DATA_BJARNGRIM))) + { + if (pBjarngrim->isAlive() && !pBjarngrim->getVictim()) + pBjarngrim->AI()->AttackStart(pWho); + } + } + } + + void UpdateAI(const uint32 uiDiff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + if (m_uiArcWeld_Timer < uiDiff) + { + DoCast(m_creature->getVictim(), SPELL_ARC_WELD); + m_uiArcWeld_Timer = 20000 + rand()%1000; + } + else + m_uiArcWeld_Timer -= uiDiff; + + if (m_uiRenewSteel_Timer < uiDiff) + { + if (m_pInstance) + { + if (Creature* pBjarngrim = m_pInstance->instance->GetCreature(m_pInstance->GetData64(DATA_BJARNGRIM))) + { + if (pBjarngrim->isAlive()) + DoCast(pBjarngrim, m_bIsHeroic ? SPELL_RENEW_STEEL_H : SPELL_RENEW_STEEL_N); + } + } + m_uiRenewSteel_Timer = 10000 + rand()%4000; + } + else + m_uiRenewSteel_Timer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_bjarngrim(Creature* pCreature) +{ + return new boss_bjarngrimAI(pCreature); +} + +CreatureAI* GetAI_mob_stormforged_lieutenant(Creature* pCreature) +{ + return new mob_stormforged_lieutenantAI(pCreature); +} + +void AddSC_boss_bjarngrim() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_bjarngrim"; + newscript->GetAI = &GetAI_boss_bjarngrim; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_stormforged_lieutenant"; + newscript->GetAI = &GetAI_mob_stormforged_lieutenant; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/ulduar/halls_of_lightning/boss_ionar.cpp b/src/bindings/scripts/scripts/northrend/ulduar/halls_of_lightning/boss_ionar.cpp new file mode 100644 index 00000000000..227d23b154a --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/ulduar/halls_of_lightning/boss_ionar.cpp @@ -0,0 +1,399 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss Ionar +SD%Complete: 80% +SDComment: Timer check +SDCategory: Halls of Lightning +EndScriptData */ + +#include "precompiled.h" +#include "def_halls_of_lightning.h" + +enum +{ + SAY_AGGRO = -1602011, + SAY_SLAY_1 = -1602012, + SAY_SLAY_2 = -1602013, + SAY_SLAY_3 = -1602014, + SAY_DEATH = -1602015, + SAY_SPLIT_1 = -1602016, + SAY_SPLIT_2 = -1602017, + + SPELL_BALL_LIGHTNING_N = 52780, + SPELL_BALL_LIGHTNING_H = 59800, + SPELL_STATIC_OVERLOAD_N = 52658, + SPELL_STATIC_OVERLOAD_H = 59795, + + SPELL_DISPERSE = 52770, + SPELL_SUMMON_SPARK = 52746, + SPELL_SPARK_DESPAWN = 52776, + + //Spark of Ionar + SPELL_SPARK_VISUAL_TRIGGER_N = 52667, + SPELL_SPARK_VISUAL_TRIGGER_H = 59833, + + NPC_SPARK_OF_IONAR = 28926, + + MAX_SPARKS = 5, + POINT_CALLBACK = 0 +}; + +/*###### +## Boss Ionar +######*/ + +struct TRINITY_DLL_DECL boss_ionarAI : public ScriptedAI +{ + boss_ionarAI(Creature *pCreature) : ScriptedAI(pCreature) + { + m_pInstance = pCreature->GetInstanceData(); + m_bIsHeroic = pCreature->GetMap()->IsHeroic(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + std::list m_lSparkGUIDList; + + bool m_bIsHeroic; + + bool m_bIsSplitPhase; + uint32 m_uiSplit_Timer; + uint32 m_uiSparkAtHomeCount; + + uint32 m_uiStaticOverload_Timer; + uint32 m_uiBallLightning_Timer; + + uint32 m_uiHealthAmountModifier; + + void Reset() + { + m_lSparkGUIDList.clear(); + + m_bIsSplitPhase = true; + m_uiSplit_Timer = 25000; + m_uiSparkAtHomeCount = 0; + + m_uiStaticOverload_Timer = 5000 + rand()%1000; + m_uiBallLightning_Timer = 10000 + rand()%1000; + + m_uiHealthAmountModifier = 1; + + if (m_creature->GetVisibility() == VISIBILITY_OFF) + m_creature->SetVisibility(VISIBILITY_ON); + } + + void AttackedBy(Unit* pAttacker) + { + if (m_creature->getVictim()) + return; + + if (m_creature->GetVisibility() == VISIBILITY_OFF) + return; + + AttackStart(pAttacker); + } + + void Aggro(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_IONAR, IN_PROGRESS); + } + + void JustReachedHome() + { + if (m_pInstance) + m_pInstance->SetData(TYPE_IONAR, NOT_STARTED); + } + + void AttackStart(Unit* pWho) + { + if (m_creature->Attack(pWho, true)) + { + m_creature->AddThreat(pWho, 0.0f); + m_creature->SetInCombatWith(pWho); + pWho->SetInCombatWith(m_creature); + + if (m_creature->GetVisibility() != VISIBILITY_OFF) + m_creature->GetMotionMaster()->MoveChase(pWho); + } + } + + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + DespawnSpark(); + + if (m_pInstance) + m_pInstance->SetData(TYPE_IONAR, DONE); + } + + void KilledUnit(Unit *victim) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature); break; + case 1: DoScriptText(SAY_SLAY_2, m_creature); break; + case 2: DoScriptText(SAY_SLAY_3, m_creature); break; + } + } + + void DespawnSpark() + { + if (m_lSparkGUIDList.empty()) + return; + + for(std::list::iterator itr = m_lSparkGUIDList.begin(); itr != m_lSparkGUIDList.end(); ++itr) + { + if (Creature* pTemp = Unit::GetCreature(*m_creature, *itr)) + { + if (pTemp->isAlive()) + pTemp->ForcedDespawn(); + } + } + + m_lSparkGUIDList.clear(); + } + + //make sparks come back + void CallBackSparks() + { + //should never be empty here, but check + if (m_lSparkGUIDList.empty()) + return; + + for(std::list::iterator itr = m_lSparkGUIDList.begin(); itr != m_lSparkGUIDList.end(); ++itr) + { + if (Creature* pSpark = Unit::GetCreature(*m_creature, *itr)) + { + if (pSpark->isAlive()) + { + if (pSpark->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE) + pSpark->GetMotionMaster()->MovementExpired(); + + pSpark->SetSpeed(MOVE_RUN, pSpark->GetCreatureInfo()->speed * 2); + pSpark->GetMotionMaster()->MovePoint(POINT_CALLBACK, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ()); + } + } + } + } + + void RegisterSparkAtHome() + { + ++m_uiSparkAtHomeCount; + } + + void JustSummoned(Creature* pSummoned) + { + if (pSummoned->GetEntry() == NPC_SPARK_OF_IONAR) + { + pSummoned->CastSpell(pSummoned, m_bIsHeroic ? SPELL_SPARK_VISUAL_TRIGGER_H : SPELL_SPARK_VISUAL_TRIGGER_N, true); + + Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + + if (m_creature->getVictim()) + pSummoned->AI()->AttackStart(pTarget ? pTarget : m_creature->getVictim()); + + m_lSparkGUIDList.push_back(pSummoned->GetGUID()); + } + } + + void UpdateAI(const uint32 uiDiff) + { + // Splitted + if (m_creature->GetVisibility() == VISIBILITY_OFF) + { + if (!m_creature->getVictim()) + { + Reset(); + return; + } + + if (m_uiSplit_Timer < uiDiff) + { + m_uiSplit_Timer = 2500; + + // Return sparks to where Ionar splitted + if (m_bIsSplitPhase) + { + CallBackSparks(); + m_bIsSplitPhase = false; + } + // Lightning effect and restore Ionar + else if (m_uiSparkAtHomeCount == MAX_SPARKS) + { + m_creature->SetVisibility(VISIBILITY_ON); + m_creature->CastSpell(m_creature, SPELL_SPARK_DESPAWN, false); + + DespawnSpark(); + + m_uiSparkAtHomeCount = 0; + m_uiSplit_Timer = 25000; + m_bIsSplitPhase = true; + + if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() != TARGETED_MOTION_TYPE) + { + if (m_creature->getVictim()) + m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); + } + } + } + else + m_uiSplit_Timer -= uiDiff; + + return; + } + + //Return since we have no target + if (!UpdateVictim()) + return; + + if (m_uiStaticOverload_Timer < uiDiff) + { + if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + DoCast(pTarget, m_bIsHeroic ? SPELL_STATIC_OVERLOAD_H : SPELL_STATIC_OVERLOAD_N); + + m_uiStaticOverload_Timer = 5000 + rand()%1000; + } + else + m_uiStaticOverload_Timer -= uiDiff; + + if (m_uiBallLightning_Timer < uiDiff) + { + DoCast(m_creature->getVictim(), m_bIsHeroic ? SPELL_BALL_LIGHTNING_H : SPELL_BALL_LIGHTNING_N); + m_uiBallLightning_Timer = 10000 + rand()%1000; + } + else + m_uiBallLightning_Timer -= uiDiff; + + // Health check + if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < (100-(20*m_uiHealthAmountModifier))) + { + ++m_uiHealthAmountModifier; + + switch(rand()%2) + { + case 0: DoScriptText(SAY_SPLIT_1, m_creature); break; + case 1: DoScriptText(SAY_SPLIT_2, m_creature); break; + } + + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(false); + + DoCast(m_creature, SPELL_DISPERSE); + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_ionar(Creature* pCreature) +{ + return new boss_ionarAI(pCreature); +} + +bool EffectDummyCreature_boss_ionar(Unit* pCaster, uint32 uiSpellId, uint32 uiEffIndex, Creature* pCreatureTarget) +{ + //always check spellid and effectindex + if (uiSpellId == SPELL_DISPERSE && uiEffIndex == 0) + { + if (pCreatureTarget->GetEntry() != NPC_IONAR) + return true; + + for(uint8 i = 0; i < MAX_SPARKS; ++i) + { + pCreatureTarget->CastSpell(pCreatureTarget, SPELL_SUMMON_SPARK, true); + + //TODO: remove this line of hack when summon implemented + pCreatureTarget->SummonCreature(NPC_SPARK_OF_IONAR, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + } + + pCreatureTarget->AttackStop(); + pCreatureTarget->SetVisibility(VISIBILITY_OFF); + + if (pCreatureTarget->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE) + pCreatureTarget->GetMotionMaster()->MovementExpired(); + + //always return true when we are handling this spell and effect + return true; + } + return false; +} + +/*###### +## mob_spark_of_ionar +######*/ + +struct TRINITY_DLL_DECL mob_spark_of_ionarAI : public ScriptedAI +{ + mob_spark_of_ionarAI(Creature *pCreature) : ScriptedAI(pCreature) + { + m_pInstance = pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + void Reset() { } + + void MovementInform(uint32 uiType, uint32 uiPointId) + { + if (uiType != POINT_MOTION_TYPE || !m_pInstance) + return; + + if (uiPointId == POINT_CALLBACK) + { + if (Creature* pIonar = m_pInstance->instance->GetCreature(m_pInstance->GetData64(DATA_IONAR))) + { + if (!pIonar->isAlive()) + { + m_creature->ForcedDespawn(); + return; + } + + if (boss_ionarAI* pIonarAI = dynamic_cast(pIonar->AI())) + pIonarAI->RegisterSparkAtHome(); + } + else + m_creature->ForcedDespawn(); + } + } +}; + +CreatureAI* GetAI_mob_spark_of_ionar(Creature* pCreature) +{ + return new mob_spark_of_ionarAI(pCreature); +} + +void AddSC_boss_ionar() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_ionar"; + newscript->GetAI = &GetAI_boss_ionar; + newscript->pEffectDummyCreature = &EffectDummyCreature_boss_ionar; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_spark_of_ionar"; + newscript->GetAI = &GetAI_mob_spark_of_ionar; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/ulduar/halls_of_lightning/boss_loken.cpp b/src/bindings/scripts/scripts/northrend/ulduar/halls_of_lightning/boss_loken.cpp new file mode 100644 index 00000000000..164b393b6d9 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/ulduar/halls_of_lightning/boss_loken.cpp @@ -0,0 +1,253 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss Loken +SD%Complete: 60% +SDComment: Missing intro. Remove hack of Pulsing Shockwave when core supports. Aura is not working (59414) +SDCategory: Halls of Lightning +EndScriptData */ + +#include "precompiled.h" +#include "def_halls_of_lightning.h" + +enum +{ + ACHIEVEMENT_TIMELY_DEATH = 1867, + + SAY_AGGRO = -1602018, + SAY_INTRO_1 = -1602019, + SAY_INTRO_2 = -1602020, + SAY_SLAY_1 = -1602021, + SAY_SLAY_2 = -1602022, + SAY_SLAY_3 = -1602023, + SAY_DEATH = -1602024, + SAY_NOVA_1 = -1602025, + SAY_NOVA_2 = -1602026, + SAY_NOVA_3 = -1602027, + SAY_75HEALTH = -1602028, + SAY_50HEALTH = -1602029, + SAY_25HEALTH = -1602030, + EMOTE_NOVA = -1602031, + + SPELL_ARC_LIGHTNING = 52921, + SPELL_LIGHTNING_NOVA_N = 52960, + SPELL_LIGHTNING_NOVA_H = 59835, + + SPELL_PULSING_SHOCKWAVE_N = 52961, + SPELL_PULSING_SHOCKWAVE_H = 59836, + SPELL_PULSING_SHOCKWAVE_AURA = 59414 +}; + +/*###### +## Boss Loken +######*/ + +struct TRINITY_DLL_DECL boss_lokenAI : public ScriptedAI +{ + boss_lokenAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = pCreature->GetInstanceData(); + m_bIsHeroic = pCreature->GetMap()->IsHeroic(); + } + + ScriptedInstance* m_pInstance; + + bool m_bIsHeroic; + bool m_bIsAura; + + uint32 m_uiArcLightning_Timer; + uint32 m_uiLightningNova_Timer; + uint32 m_uiPulsingShockwave_Timer; + uint32 m_uiResumePulsingShockwave_Timer; + + uint32 m_uiHealthAmountModifier; + + uint32 EncounterTimer; + + void Reset() + { + m_bIsAura = false; + + m_uiArcLightning_Timer = 15000; + m_uiLightningNova_Timer = 20000; + m_uiPulsingShockwave_Timer = 2000; + m_uiResumePulsingShockwave_Timer = 15000; + + m_uiHealthAmountModifier = 1; + + EncounterTimer = 0; + + if (m_pInstance) + m_pInstance->SetData(TYPE_LOKEN, NOT_STARTED); + } + + void EnterCombat(Unit* pWho) + { + DoScriptText(SAY_AGGRO, m_creature); + + EncounterTimer = 1; + + if (m_pInstance) + m_pInstance->SetData(TYPE_LOKEN, IN_PROGRESS); + } + + void JustDied(Unit* pKiller) + { + DoScriptText(SAY_DEATH, m_creature); + + if (m_bIsHeroic && EncounterTimer <= 120000) + { + AchievementEntry const *AchievTimelyDeath = GetAchievementStore()->LookupEntry(ACHIEVEMENT_TIMELY_DEATH); + if (AchievTimelyDeath) + { + Map* pMap = m_creature->GetMap(); + if (pMap && pMap->IsDungeon()) + { + Map::PlayerList const &players = pMap->GetPlayers(); + for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + itr->getSource()->CompletedAchievement(AchievTimelyDeath); + } + } + } + + if (m_pInstance) + m_pInstance->SetData(TYPE_LOKEN, DONE); + } + + void KilledUnit(Unit* pVictim) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature);break; + case 1: DoScriptText(SAY_SLAY_2, m_creature);break; + case 2: DoScriptText(SAY_SLAY_3, m_creature);break; + } + } + + void UpdateAI(const uint32 uiDiff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + if (EncounterTimer) + EncounterTimer += uiDiff; + + if (m_bIsAura) + { + // workaround for PULSING_SHOCKWAVE + if (m_uiPulsingShockwave_Timer < uiDiff) + { + Map* pMap = m_creature->GetMap(); + if (pMap->IsDungeon()) + { + Map::PlayerList const &PlayerList = pMap->GetPlayers(); + + if (PlayerList.isEmpty()) + return; + + for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) + if (i->getSource()->isAlive() && i->getSource()->isTargetableForAttack()) + { + int32 dmg; + float m_fDist = m_creature->GetDistance(i->getSource()); + + if (m_fDist <= 1.0f) // Less than 1 yard + dmg = (m_bIsHeroic ? 850 : 800); // need to correct damage + else // Further from 1 yard + dmg = ((m_bIsHeroic ? 250 : 200) * m_fDist) + (m_bIsHeroic ? 850 : 800); // need to correct damage + + m_creature->CastCustomSpell(i->getSource(), (m_bIsHeroic ? 59837 : 52942), &dmg, 0, 0, false); + } + } + m_uiPulsingShockwave_Timer = 2000; + }else m_uiPulsingShockwave_Timer -= uiDiff; + } + else + { + if (m_uiResumePulsingShockwave_Timer < uiDiff) + { + //breaks at movement, can we assume when it's time, this spell is casted and also must stop movement? + m_creature->CastSpell(m_creature, SPELL_PULSING_SHOCKWAVE_AURA, true); + + DoCast(m_creature, m_bIsHeroic ? SPELL_PULSING_SHOCKWAVE_H : SPELL_PULSING_SHOCKWAVE_N); // need core support + m_bIsAura = true; + m_uiResumePulsingShockwave_Timer = 0; + } + else + m_uiResumePulsingShockwave_Timer -= uiDiff; + } + + if (m_uiArcLightning_Timer < uiDiff) + { + if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + DoCast(pTarget, SPELL_ARC_LIGHTNING); + + m_uiArcLightning_Timer = 15000 + rand()%1000; + } + else + m_uiArcLightning_Timer -= uiDiff; + + if (m_uiLightningNova_Timer < uiDiff) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_NOVA_1, m_creature);break; + case 1: DoScriptText(SAY_NOVA_2, m_creature);break; + case 2: DoScriptText(SAY_NOVA_3, m_creature);break; + } + + DoCast(m_creature, m_bIsHeroic ? SPELL_LIGHTNING_NOVA_H : SPELL_LIGHTNING_NOVA_N); + + m_bIsAura = false; + m_uiResumePulsingShockwave_Timer = (m_bIsHeroic ? 4000 : 5000); // Pause Pulsing Shockwave aura + m_uiLightningNova_Timer = 20000 + rand()%1000; + } + else + m_uiLightningNova_Timer -= uiDiff; + + // Health check + if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < (100-(25*m_uiHealthAmountModifier))) + { + switch(m_uiHealthAmountModifier) + { + case 1: DoScriptText(SAY_75HEALTH, m_creature); break; + case 2: DoScriptText(SAY_50HEALTH, m_creature); break; + case 3: DoScriptText(SAY_25HEALTH, m_creature); break; + } + + ++m_uiHealthAmountModifier; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_loken(Creature* pCreature) +{ + return new boss_lokenAI(pCreature); +} + +void AddSC_boss_loken() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_loken"; + newscript->GetAI = &GetAI_boss_loken; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/ulduar/halls_of_lightning/boss_volkhan.cpp b/src/bindings/scripts/scripts/northrend/ulduar/halls_of_lightning/boss_volkhan.cpp new file mode 100644 index 00000000000..35eadb9783e --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/ulduar/halls_of_lightning/boss_volkhan.cpp @@ -0,0 +1,494 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss Volkhan +SD%Complete: 60% +SDComment: Not considered complete. Some events may fail and need further development +SDCategory: Halls of Lightning +EndScriptData */ + +#include "precompiled.h" +#include "def_halls_of_lightning.h" + +enum +{ + SAY_AGGRO = -1602032, + SAY_SLAY_1 = -1602033, + SAY_SLAY_2 = -1602034, + SAY_SLAY_3 = -1602035, + SAY_DEATH = -1602036, + SAY_STOMP_1 = -1602037, + SAY_STOMP_2 = -1602038, + SAY_FORGE_1 = -1602039, + SAY_FORGE_2 = -1602040, + EMOTE_TO_ANVIL = -1602041, + EMOTE_SHATTER = -1602042, + + SPELL_HEAT_N = 52387, + SPELL_HEAT_H = 59528, + SPELL_SHATTERING_STOMP_N = 52237, + SPELL_SHATTERING_STOMP_H = 59529, + + //unclear how "directions" of spells must be. Last, summoning GO, what is it for? Script depend on: + SPELL_TEMPER = 52238, //TARGET_SCRIPT boss->anvil + SPELL_TEMPER_DUMMY = 52654, //TARGET_SCRIPT anvil->boss + + //SPELL_TEMPER_VISUAL = 52661, //summons GO + + SPELL_SUMMON_MOLTEN_GOLEM = 52405, + + //Molten Golem + SPELL_BLAST_WAVE = 23113, + SPELL_IMMOLATION_STRIKE_N = 52433, + SPELL_IMMOLATION_STRIKE_H = 59530, + SPELL_SHATTER_N = 52429, + SPELL_SHATTER_H = 59527, + + NPC_VOLKHAN_ANVIL = 28823, + NPC_MOLTEN_GOLEM = 28695, + NPC_BRITTLE_GOLEM = 28681, + + POINT_ID_ANVIL = 0, + MAX_GOLEM = 2 +}; + +/*###### +## Boss Volkhan +######*/ + +struct TRINITY_DLL_DECL boss_volkhanAI : public ScriptedAI +{ + boss_volkhanAI(Creature *pCreature) : ScriptedAI(pCreature) + { + m_pInstance = pCreature->GetInstanceData(); + m_bIsHeroic = pCreature->GetMap()->IsHeroic(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + std::list m_lGolemGUIDList; + + bool m_bIsHeroic; + bool m_bHasTemper; + bool m_bIsStriking; + bool m_bCanShatterGolem; + + uint32 m_uiPause_Timer; + uint32 m_uiShatteringStomp_Timer; + uint32 m_uiShatter_Timer; + + uint32 m_uiHealthAmountModifier; + + void Reset() + { + m_bIsStriking = false; + m_bHasTemper = false; + m_bCanShatterGolem = false; + + m_uiPause_Timer = 3500; + m_uiShatteringStomp_Timer = 0; + m_uiShatter_Timer = 5000; + + m_uiHealthAmountModifier = 1; + + DespawnGolem(); + m_lGolemGUIDList.clear(); + + if (m_pInstance) + m_pInstance->SetData(TYPE_VOLKHAN, NOT_STARTED); + } + + void Aggro(Unit* pWho) + { + DoScriptText(SAY_AGGRO, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_VOLKHAN, IN_PROGRESS); + } + + void AttackStart(Unit* pWho) + { + if (m_creature->Attack(pWho, true)) + { + m_creature->AddThreat(pWho, 0.0f); + m_creature->SetInCombatWith(pWho); + pWho->SetInCombatWith(m_creature); + + if (!m_bHasTemper) + m_creature->GetMotionMaster()->MoveChase(pWho); + } + } + + void JustDied(Unit* pKiller) + { + DoScriptText(SAY_DEATH, m_creature); + DespawnGolem(); + + if (m_pInstance) + m_pInstance->SetData(TYPE_VOLKHAN, DONE); + } + + void KilledUnit(Unit* pVictim) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature); break; + case 1: DoScriptText(SAY_SLAY_2, m_creature); break; + case 2: DoScriptText(SAY_SLAY_3, m_creature); break; + } + } + + void DespawnGolem() + { + if (m_lGolemGUIDList.empty()) + return; + + for(std::list::iterator itr = m_lGolemGUIDList.begin(); itr != m_lGolemGUIDList.end(); ++itr) + { + if (Creature* pTemp = Unit::GetCreature(*m_creature, *itr)) + { + if (pTemp->isAlive()) + pTemp->ForcedDespawn(); + } + } + + m_lGolemGUIDList.clear(); + } + + void ShatterGolem() + { + if (m_lGolemGUIDList.empty()) + return; + + for(std::list::iterator itr = m_lGolemGUIDList.begin(); itr != m_lGolemGUIDList.end(); ++itr) + { + if (Creature* pTemp = Unit::GetCreature(*m_creature, *itr)) + { + // only shatter brittle golems + if (pTemp->isAlive() && pTemp->GetEntry() == NPC_BRITTLE_GOLEM) + pTemp->CastSpell(pTemp, m_bIsHeroic ? SPELL_SHATTER_H : SPELL_SHATTER_N, false); + } + } + } + + void SpellHit(Unit* pCaster, const SpellEntry* pSpell) + { + if (pSpell->Id == SPELL_TEMPER_DUMMY) + m_bIsStriking = true; + } + + void JustSummoned(Creature* pSummoned) + { + if (pSummoned->GetEntry() == NPC_MOLTEN_GOLEM) + { + m_lGolemGUIDList.push_back(pSummoned->GetGUID()); + + if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + pSummoned->AI()->AttackStart(pTarget); + + //why healing when just summoned? + pSummoned->CastSpell(pSummoned, m_bIsHeroic ? SPELL_HEAT_H : SPELL_HEAT_N, false, NULL, NULL, m_creature->GetGUID()); + } + } + + void UpdateAI(const uint32 uiDiff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + if (m_bIsStriking) + { + if (m_uiPause_Timer < uiDiff) + { + if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() != TARGETED_MOTION_TYPE) + { + if (m_creature->getVictim()) + m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); + } + + m_bHasTemper = false; + m_bIsStriking = false; + m_uiPause_Timer = 3500; + } + else + m_uiPause_Timer -= uiDiff; + + return; + } + + // When to start shatter? After 60, 40 or 20% hp? + if (!m_bHasTemper && m_uiHealthAmountModifier >= 3) + { + if (m_uiShatteringStomp_Timer < uiDiff) + { + //should he stomp even if he has no brittle golem to shatter? + + switch(rand()%2) + { + case 0: DoScriptText(SAY_STOMP_1, m_creature); break; + case 1: DoScriptText(SAY_STOMP_2, m_creature); break; + } + + DoCast(m_creature, m_bIsHeroic ? SPELL_SHATTERING_STOMP_H : SPELL_SHATTERING_STOMP_N); + + DoScriptText(EMOTE_SHATTER, m_creature); + + m_uiShatteringStomp_Timer = 30000; + m_bCanShatterGolem = true; + } + else + m_uiShatteringStomp_Timer -= uiDiff; + } + + // Shatter Golems 3 seconds after Shattering Stomp + if (m_bCanShatterGolem) + { + if (m_uiShatter_Timer < uiDiff) + { + ShatterGolem(); + m_uiShatter_Timer = 3000; + m_bCanShatterGolem = false; + } + else + m_uiShatter_Timer -= uiDiff; + } + + // Health check + if (!m_bCanShatterGolem && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < (100-(20*m_uiHealthAmountModifier))) + { + ++m_uiHealthAmountModifier; + + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(false); + + switch(rand()%2) + { + case 0: DoScriptText(SAY_FORGE_1, m_creature); break; + case 1: DoScriptText(SAY_FORGE_2, m_creature); break; + } + + m_bHasTemper = true; + + m_creature->CastSpell(m_creature, SPELL_TEMPER, false); + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_volkhan(Creature* pCreature) +{ + return new boss_volkhanAI(pCreature); +} + +bool EffectDummyCreature_boss_volkhan(Unit* pCaster, uint32 uiSpellId, uint32 uiEffIndex, Creature* pCreatureTarget) +{ + //always check spellid and effectindex + if (uiSpellId == SPELL_TEMPER_DUMMY && uiEffIndex == 0) + { + if (pCaster->GetEntry() != NPC_VOLKHAN_ANVIL || pCreatureTarget->GetEntry() != NPC_VOLKHAN) + return true; + + for(uint8 i = 0; i < MAX_GOLEM; ++i) + { + pCreatureTarget->CastSpell(pCaster, SPELL_SUMMON_MOLTEN_GOLEM, true); + + //TODO: remove this line of hack when summon effect implemented + pCreatureTarget->SummonCreature(NPC_MOLTEN_GOLEM, + pCaster->GetPositionX(), pCaster->GetPositionY(), pCaster->GetPositionZ(), 0.0f, + TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000); + } + + //always return true when we are handling this spell and effect + return true; + } + + return false; +} + +/*###### +## npc_volkhan_anvil +######*/ + +bool EffectDummyCreature_npc_volkhan_anvil(Unit* pCaster, uint32 uiSpellId, uint32 uiEffIndex, Creature* pCreatureTarget) +{ + //always check spellid and effectindex + if (uiSpellId == SPELL_TEMPER && uiEffIndex == 0) + { + if (pCaster->GetEntry() != NPC_VOLKHAN || pCreatureTarget->GetEntry() != NPC_VOLKHAN_ANVIL) + return true; + + Creature *cre = CAST_CRE(pCaster); + + DoScriptText(EMOTE_TO_ANVIL, pCaster); + + float fX, fY, fZ; + pCreatureTarget->GetContactPoint(pCaster, fX, fY, fZ, INTERACTION_DISTANCE); + + pCaster->AttackStop(); + + if (pCaster->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE) + pCaster->GetMotionMaster()->MovementExpired(); + + cre->GetMap()->CreatureRelocation(cre, fX, fY, fZ, pCreatureTarget->GetOrientation()); + cre->SendMonsterMove(fX, fY, fZ, 0, cre->GetUnitMovementFlags(), 1); + + pCreatureTarget->CastSpell(pCaster, SPELL_TEMPER_DUMMY, false); + + //always return true when we are handling this spell and effect + return true; + } + + return false; +} + +/*###### +## mob_molten_golem +######*/ + +struct TRINITY_DLL_DECL mob_molten_golemAI : public ScriptedAI +{ + mob_molten_golemAI(Creature *pCreature) : ScriptedAI(pCreature) + { + m_pInstance = pCreature->GetInstanceData(); + m_bIsHeroic = pCreature->GetMap()->IsHeroic(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + bool m_bIsHeroic; + bool m_bIsFrozen; + + uint32 m_uiBlast_Timer; + uint32 m_uiDeathDelay_Timer; + uint32 m_uiImmolation_Timer; + + void Reset() + { + m_bIsFrozen = false; + + m_uiBlast_Timer = 20000; + m_uiDeathDelay_Timer = 0; + m_uiImmolation_Timer = 5000; + } + + void AttackStart(Unit* pWho) + { + if (m_creature->Attack(pWho, true)) + { + m_creature->AddThreat(pWho, 0.0f); + m_creature->SetInCombatWith(pWho); + pWho->SetInCombatWith(m_creature); + + if (!m_bIsFrozen) + m_creature->GetMotionMaster()->MoveChase(pWho); + } + } + + void DamageTaken(Unit* pDoneBy, uint32 &uiDamage) + { + if (m_bIsFrozen) + { + //workaround for now, brittled should be immune to any kind of attacks + uiDamage = 0; + return; + } + + if (uiDamage > m_creature->GetHealth()) + { + m_bIsFrozen = true; + + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(false); + + m_creature->RemoveAllAuras(); + m_creature->AttackStop(); + + if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE) + m_creature->GetMotionMaster()->MovementExpired(); + + uiDamage = m_creature->GetHealth()-1; + + m_creature->UpdateEntry(NPC_BRITTLE_GOLEM); + m_creature->SetHealth(1); + } + } + + void SpellHit(Unit* pCaster, const SpellEntry* pSpell) + { + //this is the dummy effect of the spells + if (pSpell->Id == SPELL_SHATTER_N || pSpell->Id == SPELL_SHATTER_H) + { + if (m_creature->GetEntry() == NPC_BRITTLE_GOLEM) + m_creature->ForcedDespawn(); + } + } + + void UpdateAI(const uint32 uiDiff) + { + //Return since we have no target or if we are frozen + if (!UpdateVictim() || m_bIsFrozen) + return; + + if (m_uiBlast_Timer < uiDiff) + { + DoCast(m_creature, SPELL_BLAST_WAVE); + m_uiBlast_Timer = 20000; + } + else + m_uiBlast_Timer -= uiDiff; + + if (m_uiImmolation_Timer < uiDiff) + { + DoCast(m_creature->getVictim(), m_bIsHeroic ? SPELL_IMMOLATION_STRIKE_H : SPELL_IMMOLATION_STRIKE_N); + m_uiImmolation_Timer = 5000; + } + else + m_uiImmolation_Timer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_molten_golem(Creature* pCreature) +{ + return new mob_molten_golemAI(pCreature); +} + +void AddSC_boss_volkhan() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_volkhan"; + newscript->GetAI = &GetAI_boss_volkhan; + newscript->pEffectDummyCreature = &EffectDummyCreature_boss_volkhan; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_volkhan_anvil"; + newscript->pEffectDummyCreature = &EffectDummyCreature_npc_volkhan_anvil; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_molten_golem"; + newscript->GetAI = &GetAI_mob_molten_golem; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/ulduar/halls_of_lightning/def_halls_of_lightning.h b/src/bindings/scripts/scripts/northrend/ulduar/halls_of_lightning/def_halls_of_lightning.h new file mode 100644 index 00000000000..8790274e599 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/ulduar/halls_of_lightning/def_halls_of_lightning.h @@ -0,0 +1,34 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_HALLS_OF_LIGHTNING_H +#define DEF_HALLS_OF_LIGHTNING_H + +enum +{ + MAX_ENCOUNTER = 4, + + DATA_BJARNGRIM = 1, + DATA_IONAR = 2, + DATA_LOKEN = 3, + DATA_VOLKHAN = 4, + + TYPE_BJARNGRIM = 10, + TYPE_IONAR = 11, + TYPE_LOKEN = 12, + TYPE_VOLKHAN = 13, + + NPC_BJARNGRIM = 28586, + NPC_VOLKHAN = 28587, + NPC_IONAR = 28546, + NPC_LOKEN = 28923, + + GO_BJARNGRIM_DOOR = 191416, //_doors10 + GO_VOLKHAN_DOOR = 191325, //_doors07 + GO_IONAR_DOOR = 191326, //_doors05 + GO_LOKEN_DOOR = 191324, //_doors02 + GO_LOKEN_THRONE = 192654 +}; + +#endif diff --git a/src/bindings/scripts/scripts/northrend/ulduar/halls_of_lightning/instance_halls_of_lightning.cpp b/src/bindings/scripts/scripts/northrend/ulduar/halls_of_lightning/instance_halls_of_lightning.cpp new file mode 100644 index 00000000000..e9d75fb8b6f --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/ulduar/halls_of_lightning/instance_halls_of_lightning.cpp @@ -0,0 +1,194 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Halls_of_Lightning +SD%Complete: 90% +SDComment: All ready. +SDCategory: Halls of Lightning +EndScriptData */ + +#include "precompiled.h" +#include "def_halls_of_lightning.h" + +/* Halls of Lightning encounters: +0 - General Bjarngrim +1 - Volkhan +2 - Ionar +3 - Loken +*/ + +struct TRINITY_DLL_DECL instance_halls_of_lightning : public ScriptedInstance +{ + instance_halls_of_lightning(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + + uint64 m_uiGeneralBjarngrimGUID; + uint64 m_uiIonarGUID; + uint64 m_uiLokenGUID; + uint64 m_uiVolkhanGUID; + + uint64 m_uiBjarngrimDoorGUID; + uint64 m_uiVolkhanDoorGUID; + uint64 m_uiIonarDoorGUID; + uint64 m_uiLokenDoorGUID; + uint64 m_uiLokenGlobeGUID; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + m_uiGeneralBjarngrimGUID = 0; + m_uiVolkhanGUID = 0; + m_uiIonarGUID = 0; + m_uiLokenGUID = 0; + + m_uiBjarngrimDoorGUID = 0; + m_uiVolkhanDoorGUID = 0; + m_uiIonarDoorGUID = 0; + m_uiLokenDoorGUID = 0; + m_uiLokenGlobeGUID = 0; + } + + void OnCreatureCreate(Creature* pCreature, bool add) + { + switch(pCreature->GetEntry()) + { + case NPC_BJARNGRIM: + m_uiGeneralBjarngrimGUID = pCreature->GetGUID(); + break; + case NPC_VOLKHAN: + m_uiVolkhanGUID = pCreature->GetGUID(); + break; + case NPC_IONAR: + m_uiIonarGUID = pCreature->GetGUID(); + break; + case NPC_LOKEN: + m_uiLokenGUID = pCreature->GetGUID(); + break; + } + } + + void OnGameObjectCreate(GameObject* pGo, bool add) + { + switch(pGo->GetEntry()) + { + case GO_BJARNGRIM_DOOR: + m_uiBjarngrimDoorGUID = pGo->GetGUID(); + if (m_auiEncounter[0] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + case GO_VOLKHAN_DOOR: + m_uiVolkhanDoorGUID = pGo->GetGUID(); + if (m_auiEncounter[1] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + case GO_IONAR_DOOR: + m_uiIonarDoorGUID = pGo->GetGUID(); + if (m_auiEncounter[2] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + case GO_LOKEN_DOOR: + m_uiLokenDoorGUID = pGo->GetGUID(); + if (m_auiEncounter[3] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + case GO_LOKEN_THRONE: + m_uiLokenGlobeGUID = pGo->GetGUID(); + break; + } + } + + void SetData(uint32 uiType, uint32 uiData) + { + switch(uiType) + { + case TYPE_BJARNGRIM: + if (uiData == DONE) + DoUseDoorOrButton(m_uiBjarngrimDoorGUID); + m_auiEncounter[0] = uiData; + break; + case TYPE_VOLKHAN: + if (uiData == DONE) + DoUseDoorOrButton(m_uiVolkhanDoorGUID); + m_auiEncounter[1] = uiData; + break; + case TYPE_IONAR: + if (uiData == DONE) + DoUseDoorOrButton(m_uiIonarDoorGUID); + m_auiEncounter[2] = uiData; + break; + case TYPE_LOKEN: + if (uiData == DONE) + { + DoUseDoorOrButton(m_uiLokenDoorGUID); + + //Appears to be type 5 GO with animation. Need to figure out how this work, code below only placeholder + if (GameObject* pGlobe = instance->GetGameObject(m_uiLokenGlobeGUID)) + pGlobe->SetGoState(GO_STATE_ACTIVE); + } + m_auiEncounter[3] = uiData; + break; + } + } + + uint32 GetData(uint32 uiType) + { + switch(uiType) + { + case TYPE_BJARNGRIM: + return m_auiEncounter[0]; + case TYPE_VOLKHAN: + return m_auiEncounter[1]; + case TYPE_IONAR: + return m_auiEncounter[2]; + case TYPE_LOKEN: + return m_auiEncounter[3]; + } + return 0; + } + + uint64 GetData64(uint32 uiData) + { + switch(uiData) + { + case DATA_BJARNGRIM: + return m_uiGeneralBjarngrimGUID; + case DATA_VOLKHAN: + return m_uiVolkhanGUID; + case DATA_IONAR: + return m_uiIonarGUID; + case DATA_LOKEN: + return m_uiLokenGUID; + } + return 0; + } +}; + +InstanceData* GetInstanceData_instance_halls_of_lightning(Map* pMap) +{ + return new instance_halls_of_lightning(pMap); +} + +void AddSC_instance_halls_of_lightning() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_halls_of_lightning"; + newscript->GetInstanceData = &GetInstanceData_instance_halls_of_lightning; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/ulduar/halls_of_stone/boss_krystallus.cpp b/src/bindings/scripts/scripts/northrend/ulduar/halls_of_stone/boss_krystallus.cpp new file mode 100644 index 00000000000..e7ec03124de --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/ulduar/halls_of_stone/boss_krystallus.cpp @@ -0,0 +1,73 @@ +/* Script Data Start +SDName: Boss krystallus +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = 'boss_krystallus' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_BOULDER_TOSS 50843 +#define SPELL_BOULDER_TOSS_2 59742 +#define SPELL_GROUND_SPIKE 59750 +#define SPELL_SHATTER 50810 +#define SPELL_SHATTER_2 61546 +#define SPELL_STOMP 48131 +#define SPELL_STOMP_2 59744 + +//Yell +#define SAY_AGGRO -1599000 +#define SAY_KILL -1599001 +#define SAY_DEATH -1599002 +#define SAY_SHATTER -1599003 + +struct TRINITY_DLL_DECL boss_krystallusAI : public ScriptedAI +{ + boss_krystallusAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + DoScriptText(SAY_KILL, m_creature); + } +}; + +CreatureAI* GetAI_boss_krystallus(Creature* pCreature) +{ + return new boss_krystallusAI (pCreature); +} + +void AddSC_boss_krystallus() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_krystallus"; + newscript->GetAI = &GetAI_boss_krystallus; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/ulduar/halls_of_stone/boss_maiden_of_grief.cpp b/src/bindings/scripts/scripts/northrend/ulduar/halls_of_stone/boss_maiden_of_grief.cpp new file mode 100644 index 00000000000..51e8f26f6a9 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/ulduar/halls_of_stone/boss_maiden_of_grief.cpp @@ -0,0 +1,81 @@ +/* Script Data Start +SDName: Boss maiden_of_grief +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = 'boss_maiden_of_grief' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spell +#define SPELL_PARTING_SORROW 59723 +#define SPELL_STORM_OF_GRIEF 50752 +#define SPELL_STORM_OF_GRIEF_2 59772 +#define SPELL_SHOCK_OF_SORROW 50760 +#define SPELL_SHOCK_OF_SORROW_2 59726 +#define SPELL_PILLAR_OF_WOE 50761 +#define SPELL_PILLAR_OF_WOE_2 59727 + +//Yell +#define SAY_AGGRO -1599004 +#define SAY_SLAY_1 -1599005 +#define SAY_SLAY_2 -1599006 +#define SAY_SLAY_3 -1599007 +#define SAY_SLAY_4 -1599008 +#define SAY_DEATH -1599009 +#define SAY_STUN -1599010 + +struct TRINITY_DLL_DECL boss_maiden_of_griefAI : public ScriptedAI +{ + boss_maiden_of_griefAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature);break; + case 1: DoScriptText(SAY_SLAY_2, m_creature);break; + case 2: DoScriptText(SAY_SLAY_3, m_creature);break; + } + } +}; + +CreatureAI* GetAI_boss_maiden_of_grief(Creature* pCreature) +{ + return new boss_maiden_of_griefAI (pCreature); +} + +void AddSC_boss_maiden_of_grief() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_maiden_of_grief"; + newscript->GetAI = &GetAI_boss_maiden_of_grief; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/ulduar/halls_of_stone/boss_sjonnir.cpp b/src/bindings/scripts/scripts/northrend/ulduar/halls_of_stone/boss_sjonnir.cpp new file mode 100644 index 00000000000..d0b0889ea63 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/ulduar/halls_of_stone/boss_sjonnir.cpp @@ -0,0 +1,83 @@ +/* Script Data Start +SDName: Boss sjonnir +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = 'boss_sjonnir' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_LIGHTING_RING_1 50840 //Periodic Trigger (interval 2s) spell = 50841 +#define SPELL_LIGHTING_RING_2 51849 //Periodic Trigger (interval 2s) spell = 50841 +#define SPELL_LIGHTING_RING_2 59848 //Periodic Trigger (interval 2s) spell = 59849 +#define SPELL_LIGHTING_RING_3 59861 //Periodic Trigger (interval 2s) spell = 59849 +#define SPELL_STATIC_CHARGE_1 50834 //Periodic Trigger 2s interval, spell =50835 +#define SPELL_STATIC_CHARGE_2 59846 //Periodic Trigger 2s interval, spell =50847 +#define SPELL_CHAIN_LIGHTING_1 50830 +#define SPELL_CHAIN_LIGHTING_2 59844 +#define SPELL_LIGHTING_SHIELD_1 50831 +#define SPELL_LIGHTING_SHIELD_2 59845 +#define SPELL_FRENZY 28747 + +//Yell +#define SAY_AGGRO -1599011 +#define SAY_SLAY_1 -1599012 +#define SAY_SLAY_2 -1599013 +#define SAY_SLAY_3 -1599014 +#define SAY_DEATH -1599015 + +struct TRINITY_DLL_DECL boss_sjonnirAI : public ScriptedAI +{ + boss_sjonnirAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature);break; + case 1: DoScriptText(SAY_SLAY_2, m_creature);break; + case 2: DoScriptText(SAY_SLAY_3, m_creature);break; + } + } +}; + +CreatureAI* GetAI_boss_sjonnir(Creature* pCreature) +{ + return new boss_sjonnirAI (pCreature); +} + +void AddSC_boss_sjonnir() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_sjonnir"; + newscript->GetAI = &GetAI_boss_sjonnir; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/ulduar/halls_of_stone/def_halls_of_stone.h b/src/bindings/scripts/scripts/northrend/ulduar/halls_of_stone/def_halls_of_stone.h new file mode 100644 index 00000000000..ade934ad921 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/ulduar/halls_of_stone/def_halls_of_stone.h @@ -0,0 +1,4 @@ +#ifndef DEF_HALLS_OF_STONE_H +#define DEF_HALLS_OF_STONE_H + +#endif diff --git a/src/bindings/scripts/scripts/northrend/ulduar/halls_of_stone/instance_halls_of_stone.cpp b/src/bindings/scripts/scripts/northrend/ulduar/halls_of_stone/instance_halls_of_stone.cpp new file mode 100644 index 00000000000..fa2dd83637f --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/ulduar/halls_of_stone/instance_halls_of_stone.cpp @@ -0,0 +1,21 @@ +#include "precompiled.h" +#include "def_halls_of_stone.h" + +struct TRINITY_DLL_DECL instance_halls_of_stone : public ScriptedInstance +{ + instance_halls_of_stone(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; +}; + +InstanceData* GetInstanceData_instance_halls_of_stone(Map* pMap) +{ + return new instance_halls_of_stone(pMap); +} + +void AddSC_instance_halls_of_stone() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_halls_of_stone"; + newscript->GetInstanceData = &GetInstanceData_instance_halls_of_stone; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_algalon.cpp b/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_algalon.cpp new file mode 100644 index 00000000000..a736b2db12a --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_algalon.cpp @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2008 - 2009 Trinity + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "precompiled.h" +#include "def_ulduar.h" diff --git a/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_assembly_of_iron.cpp b/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_assembly_of_iron.cpp new file mode 100644 index 00000000000..a736b2db12a --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_assembly_of_iron.cpp @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2008 - 2009 Trinity + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "precompiled.h" +#include "def_ulduar.h" diff --git a/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_auriaya.cpp b/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_auriaya.cpp new file mode 100644 index 00000000000..685e2b506c0 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_auriaya.cpp @@ -0,0 +1,91 @@ +/* + * Copyright (C) 2008 - 2009 Trinity + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "precompiled.h" +#include "def_ulduar.h" + +//boss_auriaya +#define SPELL_TERRIFYING_SCREECH 64386 +#define SPELL_SONIC_BOOM 38897 +#define SAY_AGGRO -2615016 +#define SAY_SLAY_1 -2615017 + +struct TRINITY_DLL_DECL boss_auriaya_AI : public ScriptedAI +{ + boss_auriaya_AI(Creature *c) : ScriptedAI(c) {} + + uint32 TERRIFYING_SCREECH_Timer; + uint32 SONIC_BOOM_Timer; + + void Reset() + { + TERRIFYING_SCREECH_Timer = 0; + SONIC_BOOM_Timer = 2000; + } + + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO,m_creature); + } + void KilledUnit(Unit* victim) + { + DoScriptText(SAY_SLAY_1, m_creature); + } + + void JustDied(Unit *victim) + { + DoScriptText(SAY_SLAY_1, m_creature); + } + + void MoveInLineOfSight(Unit* who) {} + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (TERRIFYING_SCREECH_Timer < diff) + { + DoCast(m_creature,SPELL_TERRIFYING_SCREECH); + DoScriptText(SAY_SLAY_1, m_creature); + TERRIFYING_SCREECH_Timer = 360000; + } else TERRIFYING_SCREECH_Timer -= diff; + + if (SONIC_BOOM_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_SONIC_BOOM); + SONIC_BOOM_Timer = 20000; + } else SONIC_BOOM_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_auriaya(Creature* pCreature) +{ + return new boss_auriaya_AI (pCreature); +} +void AddSC_boss_auriaya() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_auriaya"; + newscript->GetAI = &GetAI_boss_auriaya; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_flame_leviathan.cpp b/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_flame_leviathan.cpp new file mode 100644 index 00000000000..20ad85351a9 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_flame_leviathan.cpp @@ -0,0 +1,306 @@ +/* + * Copyright (C) 2008 - 2009 Trinity + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "precompiled.h" +#include "def_ulduar.h" +#include "Vehicle.h" + +#define SPELL_PURSUED 62374 +#define SPELL_GATHERING_SPEED 62375 +#define SPELL_BATTERING_RAM 62376 +#define SPELL_FLAME_VENTS 62396 +#define SPELL_MISSILE_BARRAGE 62400 +#define SPELL_SYSTEMS_SHUTDOWN 62475 + +#define SPELL_CANNON 62397 + +#define SPELL_OVERLOAD_CIRCUIT 62399 + +#define SPELL_SEARING_FLAME 62402 + +enum Events +{ + EVENT_PURSUE = 1, + EVENT_MISSILE, + EVENT_VENT, +}; + +struct TRINITY_DLL_DECL boss_flame_leviathanAI : public BossAI +{ + boss_flame_leviathanAI(Creature *c) : BossAI(c, BOSS_LEVIATHAN) + { + assert(c->isVehicle()); + } + + void MoveInLineOfSight(Unit* who) {} + + void EnterCombat(Unit *who) + { + _EnterCombat(); + events.ScheduleEvent(EVENT_PURSUE, 0); + events.ScheduleEvent(EVENT_MISSILE, 1500); + events.ScheduleEvent(EVENT_VENT, 20000); + if (Creature *turret = CAST_CRE(CAST_VEH(me)->GetPassenger(7))) + turret->AI()->DoZoneInCombat(); + } + + // TODO: effect 0 and effect 1 may be on different target + void SpellHitTarget(Unit *target, const SpellEntry *spell) + { + if (spell->Id == SPELL_PURSUED) + AttackStart(target); + } + + void UpdateAI(const uint32 diff) + { + if (!me->isInCombat()) + return; + + if (me->getThreatManager().isThreatListEmpty()) + { + EnterEvadeMode(); + return; + } + + events.Update(diff); + + if (me->hasUnitState(UNIT_STAT_CASTING)) + return; + + uint32 eventId = events.GetEvent(); + if (!me->getVictim()) + eventId = EVENT_PURSUE; + + switch(eventId) + { + case 0: + return; + case EVENT_PURSUE: + DoCastAOE(SPELL_PURSUED); + events.RepeatEvent(35000); + return; + case EVENT_MISSILE: + //TODO: without unittarget no visual effect + //DoCastAOE(SPELL_MISSILE_BARRAGE); + DoCast(me->getVictim(), SPELL_MISSILE_BARRAGE); + events.RepeatEvent(1500); + return; + case EVENT_VENT: + DoCastAOE(SPELL_FLAME_VENTS); + events.RepeatEvent(20000); + return; + default: + events.PopEvent(); + break; + } + + DoSpellAttackIfReady(SPELL_BATTERING_RAM); + } +}; + + +struct TRINITY_DLL_DECL boss_flame_leviathan_turretAI : public ScriptedAI +{ + boss_flame_leviathan_turretAI(Creature *c) : ScriptedAI(c) + { + me->SetReactState(REACT_PASSIVE); + } + + void Reset() + { + events.Reset(); + } + + EventMap events; + + void EnterCombat(Unit *who) + { + events.ScheduleEvent(1, 5000); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateCombatState()) + return; + + events.Update(diff); + + if (me->hasUnitState(UNIT_STAT_CASTING)) + return; + + if (uint32 eventId = events.GetEvent()) + { + switch(eventId) + { + case 1: + DoCast(SelectTarget(SELECT_TARGET_RANDOM), SPELL_CANNON); + events.RepeatEvent(10000); + return; + default: + events.PopEvent(); + break; + } + } + } +}; + + +struct TRINITY_DLL_DECL boss_flame_leviathan_seatAI : public ScriptedAI +{ + boss_flame_leviathan_seatAI(Creature *c) : ScriptedAI(c) + { + assert(c->isVehicle()); + if (const CreatureInfo *cInfo = me->GetCreatureInfo()) + me->SetDisplayId(cInfo->DisplayID_A[0]); // 0 invisible, 1 visible + } + + void Reset() + { + me->SetReactState(REACT_AGGRESSIVE); + } + + void MoveInLineOfSight(Unit *who) // for test + { + if (who->GetTypeId() == TYPEID_PLAYER && !who->m_Vehicle + && !CAST_VEH(me)->GetPassenger(0) && CAST_VEH(me)->GetPassenger(2)) + who->EnterVehicle(CAST_VEH(me), 0); + } + + void UpdateAI(const uint32 diff) + { + if (!CAST_VEH(me)->GetPassenger(2)) + if (Unit *who = CAST_VEH(me)->GetPassenger(0)) + who->ExitVehicle(); + } +}; + +struct TRINITY_DLL_DECL boss_flame_leviathan_defense_turretAI : public ScriptedAI +{ + boss_flame_leviathan_defense_turretAI(Creature *c) : ScriptedAI(c) + { + } + + void Reset() + { + } + + void DamageTaken(Unit *who, uint32 &damage) + { + if (!who->m_Vehicle || who->m_Vehicle->GetEntry() != 33114) + damage = 0; + } + + void MoveInLineOfSight(Unit *who) + { + if (me->getVictim()) + return; + + if (who->GetTypeId() != TYPEID_PLAYER || !who->m_Vehicle || who->m_Vehicle->GetEntry() != 33114) + return; + + AttackStart(who); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (me->hasUnitState(UNIT_STAT_CASTING)) + return; + + DoCast(me->getVictim(), SPELL_SEARING_FLAME); + } +}; + +struct TRINITY_DLL_DECL boss_flame_leviathan_overload_deviceAI : public ScriptedAI +{ + boss_flame_leviathan_overload_deviceAI(Creature *c) : ScriptedAI(c) + { + if (const CreatureInfo *cInfo = me->GetCreatureInfo()) + me->SetDisplayId(cInfo->DisplayID_H[0]); // A0 gm, H0 device + } + + void Reset() + { + } + + void DamageTaken(Unit *who, uint32 &damage) + { + if (damage >= me->GetHealth()) + { + damage = 0; + if (!me->hasUnitState(UNIT_STAT_CASTING)) + DoCastAOE(SPELL_OVERLOAD_CIRCUIT); + } + } +}; + +CreatureAI* GetAI_boss_flame_leviathan(Creature* pCreature) +{ + return new boss_flame_leviathanAI (pCreature); +} + +CreatureAI* GetAI_boss_flame_leviathan_turret(Creature* pCreature) +{ + return new boss_flame_leviathan_turretAI (pCreature); +} + +CreatureAI* GetAI_boss_flame_leviathan_seat(Creature* pCreature) +{ + return new boss_flame_leviathan_seatAI (pCreature); +} + +CreatureAI* GetAI_boss_flame_leviathan_defense_turret(Creature* pCreature) +{ + return new boss_flame_leviathan_defense_turretAI (pCreature); +} + +CreatureAI* GetAI_boss_flame_leviathan_overload_device(Creature* pCreature) +{ + return new boss_flame_leviathan_overload_deviceAI (pCreature); +} + +void AddSC_boss_flame_leviathan() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_flame_leviathan"; + newscript->GetAI = &GetAI_boss_flame_leviathan; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="boss_flame_leviathan_turret"; + newscript->GetAI = &GetAI_boss_flame_leviathan_turret; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="boss_flame_leviathan_seat"; + newscript->GetAI = &GetAI_boss_flame_leviathan_seat; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="boss_flame_leviathan_defense_turret"; + newscript->GetAI = &GetAI_boss_flame_leviathan_defense_turret; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="boss_flame_leviathan_overload_device"; + newscript->GetAI = &GetAI_boss_flame_leviathan_overload_device; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_freya.cpp b/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_freya.cpp new file mode 100644 index 00000000000..a736b2db12a --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_freya.cpp @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2008 - 2009 Trinity + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "precompiled.h" +#include "def_ulduar.h" diff --git a/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_general_vezax.cpp b/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_general_vezax.cpp new file mode 100644 index 00000000000..a736b2db12a --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_general_vezax.cpp @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2008 - 2009 Trinity + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "precompiled.h" +#include "def_ulduar.h" diff --git a/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_hodir.cpp b/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_hodir.cpp new file mode 100644 index 00000000000..a736b2db12a --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_hodir.cpp @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2008 - 2009 Trinity + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "precompiled.h" +#include "def_ulduar.h" diff --git a/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_ignis.cpp b/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_ignis.cpp new file mode 100644 index 00000000000..56405eb13e1 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_ignis.cpp @@ -0,0 +1,102 @@ +/* + * Copyright (C) 2008 - 2009 Trinity + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "precompiled.h" +#include "def_ulduar.h" + +#define SPELL_FLAME_JETS 62680 +#define SPELL_SCORCH 62546 +#define SPELL_SLAG_POT 62717 + +#define SAY_AGGRO -10000002 +#define SAY_SLAY -1000003 + +struct TRINITY_DLL_DECL boss_ignis_AI : public ScriptedAI +{ + boss_ignis_AI(Creature *c) : ScriptedAI(c) {} + + uint32 FLAME_JETS_Timer; + uint32 SCORCH_Timer; + uint32 SLAG_POT_Timer; + + void Reset() + { + FLAME_JETS_Timer = 32000; + SCORCH_Timer = 100; + SLAG_POT_Timer = 100; + } + + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO,m_creature); + } + void KilledUnit(Unit* victim) + { + DoScriptText(SAY_SLAY, m_creature); + } + + void JustDied(Unit *victim) + { + DoScriptText(SAY_SLAY, m_creature); + } + + void MoveInLineOfSight(Unit* who) {} + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (FLAME_JETS_Timer < diff) + { + DoCast(m_creature,SPELL_FLAME_JETS); + DoScriptText(SAY_SLAY, m_creature); + FLAME_JETS_Timer = 25000; + } else FLAME_JETS_Timer -= diff; + + if (SCORCH_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_SCORCH); + SCORCH_Timer = 20000; + } else SCORCH_Timer -= diff; + + if (SLAG_POT_Timer < diff) + { + DoCast(m_creature,SPELL_SLAG_POT); + DoScriptText(SAY_SLAY, m_creature); + SLAG_POT_Timer = 30000; + } else SLAG_POT_Timer -= diff; + + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_ignis(Creature* pCreature) +{ + return new boss_ignis_AI (pCreature); +} +void AddSC_boss_ignis() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_ignis"; + newscript->GetAI = &GetAI_boss_ignis; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_kologarn.cpp b/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_kologarn.cpp new file mode 100644 index 00000000000..a736b2db12a --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_kologarn.cpp @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2008 - 2009 Trinity + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "precompiled.h" +#include "def_ulduar.h" diff --git a/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_mimiron.cpp b/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_mimiron.cpp new file mode 100644 index 00000000000..a736b2db12a --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_mimiron.cpp @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2008 - 2009 Trinity + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "precompiled.h" +#include "def_ulduar.h" diff --git a/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_razorscale.cpp b/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_razorscale.cpp new file mode 100644 index 00000000000..59a7b8e6a9a --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_razorscale.cpp @@ -0,0 +1,300 @@ +/* + * Copyright (C) 2008 - 2009 Trinity + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +Name: razorscale +%Complete: 90 +Comment: Made by Epsik from WoW Arthas wow.dsl.net.pk +Category: +EndScriptData */ + +#include "precompiled.h" +#include "def_ulduar.h" + +#define SAY_AGGRO -2000000 +#define SAY_KILL -2000001 +#define SAY_PHASE_2_TRANS -2000002 +#define SAY_PHASE_3_TRANS -2000003 +#define EMOTE_BREATH -2000004 + +#define SPELL_FLAMEBUFFET 64016 +#define SPELL_FIREBALL 62796 + +#define SPELL_WINGBUFFET 62666 +#define SPELL_FLAMEBREATH 63317 +#define SPELL_FUSEARMOR 64771 +#define SPELL_DEVOURINGFLAME 63014 +#define SPELL_KNOCK_AWAY 19633 + +#define SPELL_BELLOWINGROAR 18431 +#define SPELL_HEATED_GROUND 22191 + +#define SPELL_SUMMONADDS 17646 + +#define CREATURE_ADDS 33846 + +static float MovementLocations[4][3]= +{ + {607.7, -281.9, 408.6}, + {602.0, -245.5, 424.7}, + {612.3, -230.8, 409.1}, + {624.1, -251.8, 426.1} +}; + +static float SpawnLocations[4][3]= +{ + {602.0, -248.1, 391.2}, + {624.4, -232-4, 391.1}, + {643.3, -256.4, 391.4}, + {626.6, -271.5, 391.4}, +}; + +struct TRINITY_DLL_DECL boss_razorscaleAI : public ScriptedAI +{ + boss_razorscaleAI(Creature* c) : ScriptedAI(c) {} + + uint32 Phase; + + uint32 FlameBreathTimer; + uint32 FUSEARMORTimer; + uint32 DEVOURINGFLAMETimer; + uint32 MovementTimer; + uint32 SummonAddsTimer; + uint32 BellowingRoarTimer; + uint32 WingBuffetTimer; + uint32 KnockAwayTimer; + uint32 FireballTimer; + + bool InitialSpawn; + + void Reset() + { + Phase = 1; + + FlameBreathTimer = 20000; + DEVOURINGFLAMETimer = 2000; + FUSEARMORTimer = 15000; + MovementTimer = 3000; + SummonAddsTimer = 45000; + BellowingRoarTimer = 30000; + WingBuffetTimer = 17000; + KnockAwayTimer = 15000; + FireballTimer = 18000; + + InitialSpawn = true; + + m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true); + m_creature->ApplySpellImmune(1, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true); + } + + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + DoZoneInCombat(); + } + + void JustDied(Unit* Killer) + { + } + + void KilledUnit(Unit *victim) + { + DoScriptText(SAY_KILL, m_creature); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 99) && (Phase == 1)) + { + Phase = 2; + m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + m_creature->SetHover(true); + m_creature->GetMotionMaster()->Clear(false); + m_creature->GetMotionMaster()->MoveIdle(); + DoScriptText(SAY_PHASE_2_TRANS, m_creature); + } + + if (((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 50) && (Phase == 2)) + { + Phase = 3; + m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + m_creature->SetHover(false); + m_creature->GetMotionMaster()->MovePoint(0, 619.6, -261.1, 391.471832); + DoStartMovement(m_creature->getVictim()); + m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + DoScriptText(SAY_PHASE_3_TRANS, m_creature); + m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); + } + + if (Phase == 1 || Phase == 3) + { + if (FlameBreathTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_FLAMEBREATH); + FlameBreathTimer = 15000; + } else FlameBreathTimer -= diff; + + if (DEVOURINGFLAMETimer < diff) + { + Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1); + if (target && !m_creature->HasInArc(M_PI, target)) + DoCast(target, SPELL_DEVOURINGFLAME); + + DEVOURINGFLAMETimer = 10000; + } else DEVOURINGFLAMETimer -= diff; + + if (FUSEARMORTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_FUSEARMOR); + FUSEARMORTimer = 10000; + } else FUSEARMORTimer -= diff; + + if (WingBuffetTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_WINGBUFFET); + WingBuffetTimer = 7000 + ((rand()%8)*1000); + } else WingBuffetTimer -= diff; + + if (KnockAwayTimer < diff) + { + if (rand()%100 <= 30) + { + DoCast(m_creature->getVictim(), SPELL_KNOCK_AWAY); + } + KnockAwayTimer = 15000; + } else KnockAwayTimer -= diff; + + if (Phase == 3) + { + if (BellowingRoarTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_BELLOWINGROAR); + + BellowingRoarTimer = 30000; + } else BellowingRoarTimer -= diff; + + if (SummonAddsTimer < diff) + { + SummonAdds(Phase); + + SummonAddsTimer = 45000; + } else SummonAddsTimer -= diff; + } + + DoMeleeAttackIfReady(); + } + + if (Phase == 2) + { + if (InitialSpawn) + { + InitialSpawn = false; + + for(uint32 i = 0; i < 4; ++i) + { + uint32 random = rand()%4; + Creature* Add = m_creature->SummonCreature(CREATURE_ADDS, SpawnLocations[random][0], SpawnLocations[random][1], SpawnLocations[random][2], 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000); + if (Add) + Add->AI()->AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 0)); + } + } + + + if (FireballTimer < diff) + { + DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_FIREBALL); + + FireballTimer = 18000; + } else FireballTimer -= diff; + + if (MovementTimer < diff) + { + if (rand()%100 <= 30) + { + DoScriptText(EMOTE_BREATH, m_creature); + DoCast(m_creature->getVictim(), SPELL_FLAMEBUFFET); + } + else ChangePosition(); + + MovementTimer = 25000; + } else MovementTimer -= diff; + + if (SummonAddsTimer < diff) + { + SummonAdds(Phase); + + SummonAddsTimer = 45000; + } else SummonAddsTimer -= diff; + } + } + + void ChangePosition() + { + /* Malfunctioning, Razorscale is flying around randomly, attacking players from hundreds of yards away. + uint32 random = rand() % 4; + if (random<4){ + m_creature->GetMotionMaster()->MovePoint(0, MovementLocations[random][0], MovementLocations[random][1], MovementLocations[random][2]);} */ + } + + void SummonAdds(uint32 Phase) + { + if (Phase == 2) + { + uint32 max = rand()%10; + for(uint32 i = 0; i < 4; ++i) + { + uint32 random = rand()%3; + Creature* Add = m_creature->SummonCreature(CREATURE_ADDS, SpawnLocations[random][0], SpawnLocations[random][1], SpawnLocations[random][2], 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000); + if (Add) + Add->AI()->AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 0)); + } + } + + if (Phase == 3) + { + uint32 max = rand() % 10 +1; + if (max < 1) + { + for(uint32 i = 0; i < max; ++i) + { + uint32 random = rand()%4; + Creature* Add = m_creature->SummonCreature(CREATURE_ADDS, SpawnLocations[random][0], SpawnLocations[random][1], SpawnLocations[random][2], 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000); + if (Add) + Add->AI()->AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 0)); + } + } + } + } +}; + +CreatureAI* GetAI_boss_razorscale(Creature* pCreature) +{ + return new boss_razorscaleAI (pCreature); +} + +void AddSC_boss_razorscale() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_razorscale"; + newscript->GetAI = &GetAI_boss_razorscale; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_thorim.cpp b/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_thorim.cpp new file mode 100644 index 00000000000..a736b2db12a --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_thorim.cpp @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2008 - 2009 Trinity + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "precompiled.h" +#include "def_ulduar.h" diff --git a/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_xt002.cpp b/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_xt002.cpp new file mode 100644 index 00000000000..a0d265f6224 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_xt002.cpp @@ -0,0 +1,90 @@ +/* + * Copyright (C) 2008 - 2009 Trinity + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "precompiled.h" +#include "def_ulduar.h" + +#define SPELL_SEARING_LIGHT 63018 +#define SPELL_SONIC_BOOM 38897 + +#define SAY_AGGRO -1000000 +#define SAY_SLAY -1000001 +struct TRINITY_DLL_DECL boss_xt002_AI : public ScriptedAI +{ + boss_xt002_AI(Creature *c) : ScriptedAI(c) {} + + uint32 SEARING_LIGHT_Timer; + uint32 SONIC_BOOM_Timer; + + void Reset() + { + SEARING_LIGHT_Timer = 100; + SONIC_BOOM_Timer = 20; + } + + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO,m_creature); + } + void KilledUnit(Unit* victim) + { + DoScriptText(SAY_SLAY, m_creature); + } + + void JustDied(Unit *victim) + { + DoScriptText(SAY_SLAY, m_creature); + } + + void MoveInLineOfSight(Unit* who) {} + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (SEARING_LIGHT_Timer < diff) + { + DoCast(m_creature,SPELL_SEARING_LIGHT); + DoScriptText(SAY_SLAY, m_creature); + SEARING_LIGHT_Timer = 50000; + } else SEARING_LIGHT_Timer -= diff; + + if (SONIC_BOOM_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_SONIC_BOOM); + SONIC_BOOM_Timer = 20000; + } else SONIC_BOOM_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_xt002(Creature* pCreature) +{ + return new boss_xt002_AI (pCreature); +} +void AddSC_boss_xt002() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_xt002"; + newscript->GetAI = &GetAI_boss_xt002; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_yoggsaron.cpp b/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_yoggsaron.cpp new file mode 100644 index 00000000000..a736b2db12a --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_yoggsaron.cpp @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2008 - 2009 Trinity + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "precompiled.h" +#include "def_ulduar.h" diff --git a/src/bindings/scripts/scripts/northrend/ulduar/ulduar/def_ulduar.h b/src/bindings/scripts/scripts/northrend/ulduar/ulduar/def_ulduar.h new file mode 100644 index 00000000000..d73e6324fc8 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/ulduar/ulduar/def_ulduar.h @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2008 - 2009 Trinity + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef DEF_ULDUAR_H +#define DEF_ULDUAR_H + +enum Encounter +{ + BOSS_LEVIATHAN, + BOSS_IGNIS, + BOSS_RAZORSCALE, + BOSS_XT002, + BOSS_ASSEMBLY, + BOSS_KOLOGARN, + BOSS_AURIAYA, + BOSS_MIMIRON, + BOSS_HODIR, + BOSS_THORIM, + BOSS_FREYA, + BOSS_VEZAX, + BOSS_YOGGSARON, + BOSS_ALGALON, + MAX_BOSS_NUMBER +}; + +#endif diff --git a/src/bindings/scripts/scripts/northrend/ulduar/ulduar/instance_ulduar.cpp b/src/bindings/scripts/scripts/northrend/ulduar/ulduar/instance_ulduar.cpp new file mode 100644 index 00000000000..a736b2db12a --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/ulduar/ulduar/instance_ulduar.cpp @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2008 - 2009 Trinity + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "precompiled.h" +#include "def_ulduar.h" diff --git a/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_keep/boss_ingvar_the_plunderer.cpp b/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_keep/boss_ingvar_the_plunderer.cpp new file mode 100644 index 00000000000..a2445a97229 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_keep/boss_ingvar_the_plunderer.cpp @@ -0,0 +1,459 @@ +/* + * Copyright (C) 2009 Trinity + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Ingvar_The_Plunderer +SD%Complete: 95 +SDComment: Some Problems with Annhylde Movement, Blizzlike Timers +SDCategory: Udgarde Keep +EndScriptData */ + +#include "precompiled.h" +#include "def_utgarde_keep.h" + +enum +{ + //Yells Ingvar + YELL_AGGRO_1 = -1574005, + YELL_AGGRO_2 = -1574006, + + YELL_DEAD_1 = -1574007, + YELL_DEAD_2 = -1574008, + + YELL_KILL_1 = -1574009, + YELL_KILL_2 = -1574010, + +//Ingvar Spells human form + MOB_INGVAR_HUMAN = 23954, + SPELL_CLEAVE = 42724, + SPELL_SMASH = 42669, + H_SPELL_SMASH = 59706, + SPELL_STAGGERING_ROAR = 42708, + H_SPELL_STAGGERING_ROAR = 59708, + SPELL_ENRAGE = 42705, + H_SPELL_ENRAGE = 59707, + + MOB_ANNHYLDE_THE_CALLER = 24068, + SPELL_INGVAR_FEIGN_DEATH = 42795, + SPELL_SUMMON_BANSHEE = 42912, + SPELL_SCOURG_RESURRECTION_EFFEKTSPAWN = 42863, //Spawn resurrecteffekt around Ingvar + + MODEL_INGVAR_UNDEAD = 26351, + MODEL_INGVAR_HUMAN = 21953, + +//Ingvar Spells undead form + MOB_INGVAR_UNDEAD = 23980, + SPELL_DARK_SMASH = 42723, + SPELL_DREADFUL_ROAR = 42729, + H_SPELL_DREADFUL_ROAR = 59734, + SPELL_WOE_STRIKE = 42730, + H_SPELL_WOE_STRIKE = 59735, + + ENTRY_THROW_TARGET = 23996, + SPELL_SHADOW_AXE_SUMMON = 42749 +}; + +struct TRINITY_DLL_DECL boss_ingvar_the_plundererAI : public ScriptedAI +{ + boss_ingvar_the_plundererAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + HeroicMode = c->GetMap()->IsHeroic(); + } + + ScriptedInstance* pInstance; + + bool HeroicMode; + bool undead; + bool event_inProgress; + + uint32 Cleave_Timer; + uint32 Smash_Timer; + uint32 Enrage_Timer; + uint32 Roar_Timer; + uint32 SpawnResTimer; + uint32 wait_Timer; + + void Reset() + { + if (undead) // Visual Hack + m_creature->SetDisplayId(MODEL_INGVAR_HUMAN); + + undead = false; + event_inProgress = false; + + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); + m_creature->SetStandState(UNIT_STAND_STATE_STAND); + + Cleave_Timer = 2000; + Smash_Timer = 5000; + Enrage_Timer = 10000; + Roar_Timer = 15000; + + SpawnResTimer = 3000; + + wait_Timer = 0; + + if (pInstance) + pInstance->SetData(DATA_INGVAR_EVENT, NOT_STARTED); + } + + void DamageTaken(Unit *done_by, uint32 &damage) + { + if (damage >= m_creature->GetHealth() && !undead) + { + //DoCast(m_creature,SPELL_INGVAR_FEIGN_DEATH,true); // Dont work ??? + // visuel hack + m_creature->SetHealth(0); + m_creature->InterruptNonMeleeSpells(true); + m_creature->RemoveAllAuras(); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); + m_creature->GetMotionMaster()->MovementExpired(false); + m_creature->GetMotionMaster()->MoveIdle(); + m_creature->SetStandState(UNIT_STAND_STATE_DEAD); + // visuel hack end + + event_inProgress = true; + undead = true; + + DoScriptText(YELL_DEAD_1,m_creature); + } + + if (event_inProgress) + { + damage = 0; + } + } + + void StartZombiePhase() + { + undead = true; + event_inProgress = false; + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); + m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); + m_creature->AI()->AttackStart(m_creature->getVictim()); + + DoScriptText(YELL_AGGRO_2,m_creature); + } + + void EnterCombat(Unit *who) + { + DoScriptText(YELL_AGGRO_1,m_creature); + + if (pInstance) + pInstance->SetData(DATA_INGVAR_EVENT, IN_PROGRESS); + } + + void JustDied(Unit* killer) + { + DoScriptText(YELL_DEAD_2,m_creature); + + if (pInstance) + pInstance->SetData(DATA_INGVAR_EVENT, DONE); + } + + void KilledUnit(Unit *victim) + { + if (undead) { DoScriptText(YELL_KILL_1,m_creature); } + else { DoScriptText(YELL_KILL_2,m_creature); } + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (event_inProgress) + { + if (SpawnResTimer) + if (SpawnResTimer< diff) + { + DoCast(m_creature,SPELL_SUMMON_BANSHEE); // Summons direktly on caster position + //DoCast(m_creature,SPELL_SCOURG_RESURRECTION_EFFEKTSPAWN); // Dont needet ? + SpawnResTimer = 0; + }else SpawnResTimer -= diff; + + return; + } + + // This is used for a spell queue ... the spells should not castet if one spell is already casting + if (wait_Timer) + if (wait_Timer < diff) + { + wait_Timer = 0; + }else wait_Timer -= diff; + + if (Cleave_Timer < diff) + { + if (!wait_Timer) + { + if (undead) + DoCast(m_creature->getVictim(),HeroicMode ? H_SPELL_WOE_STRIKE : SPELL_WOE_STRIKE); + else + DoCast(m_creature->getVictim(),SPELL_CLEAVE); + Cleave_Timer = rand()%5000 + 2000; + + wait_Timer = 1000; + } + }else Cleave_Timer -= diff; + + if (Smash_Timer < diff) + { + if (!wait_Timer) + { + if (undead) + DoCast(m_creature->getVictim(), SPELL_DARK_SMASH); + else + DoCast(m_creature->getVictim(),HeroicMode ? H_SPELL_SMASH : SPELL_SMASH); + Smash_Timer = 10000; + + wait_Timer = 5000; + } + }else Smash_Timer -= diff; + + if (!undead) + { + if (Enrage_Timer < diff) + { + DoCast(m_creature,HeroicMode ? H_SPELL_ENRAGE : SPELL_ENRAGE); + Enrage_Timer = 10000; + }else Enrage_Timer -= diff; + }else // In Undead form used to summon weapon + { + if (Enrage_Timer < diff) + { + if (!wait_Timer) + { + // Spawn target for Axe + Unit* target = SelectUnit(SELECT_TARGET_TOPAGGRO, 1); + if (target) + { + Creature* temp = m_creature->SummonCreature(ENTRY_THROW_TARGET,target->GetPositionX(),target->GetPositionY(),target->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN,2000); + + DoCast(m_creature,SPELL_SHADOW_AXE_SUMMON); + } + Enrage_Timer = 30000; + } + }else Enrage_Timer -= diff; + } + + + if (Roar_Timer < diff) + { + if (!wait_Timer) + { + if (undead) + DoCast(m_creature,HeroicMode ? H_SPELL_DREADFUL_ROAR : SPELL_DREADFUL_ROAR); + else + DoCast(m_creature,HeroicMode ? H_SPELL_STAGGERING_ROAR : SPELL_STAGGERING_ROAR); + Roar_Timer = 10000; + + wait_Timer = 5000; + } + }else Roar_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_ingvar_the_plunderer(Creature* pCreature) +{ + return new boss_ingvar_the_plundererAI (pCreature); +} + +enum +{ +//we don't have that text in db so comment it until we get this text +// YELL_RESSURECT = -1574025, + +//Spells for Annhylde + SPELL_SCOURG_RESURRECTION_HEAL = 42704, //Heal Max + DummyAura + SPELL_SCOURG_RESURRECTION_BEAM = 42857, //Channeling Beam of Annhylde + SPELL_SCOURG_RESURRECTION_DUMMY = 42862, //Some Emote Dummy? + SPELL_INGVAR_TRANSFORM = 42796 +}; + +struct TRINITY_DLL_DECL mob_annhylde_the_callerAI : public ScriptedAI +{ + mob_annhylde_the_callerAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + float x,y,z; + ScriptedInstance* pInstance; + uint32 Resurect_Timer; + uint32 Resurect_Phase; + + void Reset() + { + m_creature->AddUnitMovementFlag(MOVEMENTFLAG_FLYING + MOVEMENTFLAG_HOVER); + m_creature->SetSpeed(MOVE_SWIM , 1.0f); + m_creature->SetSpeed(MOVE_RUN , 1.0f); + m_creature->SetSpeed(MOVE_WALK , 1.0f); + //m_creature->SetSpeed(MOVE_FLIGHT , 1.0f); + + m_creature->GetPosition(x,y,z); + DoTeleportTo(x+1,y,z+30); + + Unit* ingvar = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_INGVAR)); + if (ingvar) + { + m_creature->GetMotionMaster()->MovePoint(1,x,y,z+15); + +// DoScriptText(YELL_RESSURECT,m_creature); + } + } + + void MovementInform(uint32 type, uint32 id) + { + if (type != POINT_MOTION_TYPE) + return; + Unit* ingvar = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_INGVAR)); + if (ingvar) + { + switch (id) + { + case 1: + ingvar->RemoveAura(SPELL_SUMMON_BANSHEE); + ingvar->CastSpell(ingvar,SPELL_SCOURG_RESURRECTION_DUMMY,true); + DoCast(ingvar,SPELL_SCOURG_RESURRECTION_BEAM); + Resurect_Timer = 8000; + Resurect_Phase = 1; + break; + case 2: + m_creature->DealDamage(m_creature,m_creature->GetHealth()); + m_creature->RemoveCorpse(); + break; + } + } + } + + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void EnterCombat(Unit *who) {} + void UpdateAI(const uint32 diff) + { + if (Resurect_Timer) + if (Resurect_Timer < diff) + { + if (Resurect_Phase == 1) + { + Unit* ingvar = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_INGVAR)); + if (ingvar) + { + ingvar->SetStandState(UNIT_STAND_STATE_STAND); + ingvar->CastSpell(ingvar,SPELL_SCOURG_RESURRECTION_HEAL,false); + } + Resurect_Timer = 3000; + Resurect_Phase = 2; + }else if (Resurect_Phase == 2) + { + Creature* ingvar = Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_INGVAR)); + if (ingvar) + { + ingvar->RemoveAurasDueToSpell(SPELL_SCOURG_RESURRECTION_DUMMY); + //ingvar->CastSpell(ingvar,SPELL_INGVAR_TRANSFORM,false); + ingvar->SetDisplayId(MODEL_INGVAR_UNDEAD); // Visual Hack - when he dies he becomes human model -> wrong + Creature* c_ingvar = ingvar; + + CAST_AI(boss_ingvar_the_plundererAI, (c_ingvar->AI()))->StartZombiePhase(); + + m_creature->GetMotionMaster()->MovePoint(2,x+1,y,z+30); + Resurect_Phase++; + } + } + + }else Resurect_Timer -= diff; + } +}; + +CreatureAI* GetAI_mob_annhylde_the_caller(Creature* pCreature) +{ + return new mob_annhylde_the_callerAI (pCreature); +} + +enum +{ + SPELL_SHADOW_AXE_DAMAGE = 42750, + H_SPELL_SHADOW_AXE_DAMAGE = 59719 +}; + +struct TRINITY_DLL_DECL mob_ingvar_throw_dummyAI : public ScriptedAI +{ + mob_ingvar_throw_dummyAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + HeroicMode = c->GetMap()->IsHeroic(); + } + + bool HeroicMode; + uint32 Despawn_Timer; + + ScriptedInstance* pInstance; + + void Reset() + { + Unit* target = m_creature->FindNearestCreature(ENTRY_THROW_TARGET,50); + if (target) + { + DoCast(m_creature, HeroicMode ? H_SPELL_SHADOW_AXE_DAMAGE : SPELL_SHADOW_AXE_DAMAGE); + float x,y,z; + target->GetPosition(x,y,z); + m_creature->GetMotionMaster()->MovePoint(0,x,y,z); + } + Despawn_Timer = 7000; + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void EnterCombat(Unit *who) {} + void UpdateAI(const uint32 diff) + { + if (Despawn_Timer < diff) + { + m_creature->DealDamage(m_creature,m_creature->GetHealth()); + m_creature->RemoveCorpse(); + Despawn_Timer = 0; + }else Despawn_Timer -= diff; + } +}; + +CreatureAI* GetAI_mob_ingvar_throw_dummy(Creature* pCreature) +{ + return new mob_ingvar_throw_dummyAI (pCreature); +} + +void AddSC_boss_ingvar_the_plunderer() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_ingvar_the_plunderer"; + newscript->GetAI = &GetAI_boss_ingvar_the_plunderer; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_annhylde_the_caller"; + newscript->GetAI = &GetAI_mob_annhylde_the_caller; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_ingvar_throw_dummy"; + newscript->GetAI = &GetAI_mob_ingvar_throw_dummy; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_keep/boss_keleseth.cpp b/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_keep/boss_keleseth.cpp new file mode 100644 index 00000000000..b7701a52472 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_keep/boss_keleseth.cpp @@ -0,0 +1,365 @@ +/* + * Copyright (C) 2009 Trinity + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Prince_Keleseth +SD%Complete: 90 +SDComment: Needs Prince Movements, Needs adjustments to blizzlike timers, Needs Shadowbolt castbar, Needs right Ressurect Visual, Needs Some Heroic Spells +SDCategory: Utgarde Keep +EndScriptData */ + +#include "precompiled.h" +#include "def_utgarde_keep.h" + +enum +{ + ACHIEVEMENT_ON_THE_ROCKS = 1919, + + SPELL_SHADOWBOLT = 43667, + SPELL_SHADOWBOLT_HEROIC = 59389, + SPELL_FROST_TOMB = 48400, + SPELL_FROST_TOMB_SUMMON = 42714, + SPELL_DECREPIFY = 42702, + SPELL_SCOURGE_RESSURRECTION = 42704, + CREATURE_FROSTTOMB = 23965, + CREATURE_SKELETON = 23970, + + SAY_AGGRO = -1574000, + SAY_FROST_TOMB = -1574001, + SAY_SKELETONS = -1574002, + SAY_KILL = -1574003, + SAY_DEATH = -1574004 +}; + +#define SKELETONSPAWN_Z 42.8668 + +float SkeletonSpawnPoint[5][5]= +{ + {156.2559, 259.2093}, + {156.2559, 259.2093}, + {156.2559, 259.2093}, + {156.2559, 259.2093}, + {156.2559, 259.2093}, +}; + +float AttackLoc[3]={197.636, 194.046, 40.8164}; + +bool ShatterFrostTomb; // needed for achievement: On The Rocks(1919) + +struct TRINITY_DLL_DECL mob_frost_tombAI : public ScriptedAI +{ + mob_frost_tombAI(Creature *c) : ScriptedAI(c) + { + FrostTombGUID = 0; + } + + uint64 FrostTombGUID; + + void SetPrisoner(Unit* uPrisoner) + { + FrostTombGUID = uPrisoner->GetGUID(); + } + + void Reset(){ FrostTombGUID = 0; } + void EnterCombat(Unit* who) {} + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + + void JustDied(Unit *killer) + { + if (killer->GetGUID() != m_creature->GetGUID()) + ShatterFrostTomb = true; + + if (FrostTombGUID) + { + Unit* FrostTomb = Unit::GetUnit((*m_creature),FrostTombGUID); + if (FrostTomb) + FrostTomb->RemoveAurasDueToSpell(SPELL_FROST_TOMB); + } + } + + void UpdateAI(const uint32 diff) + { + Unit* temp = Unit::GetUnit((*m_creature),FrostTombGUID); + if ((temp && temp->isAlive() && !temp->HasAura(SPELL_FROST_TOMB)) || !temp) + m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + } +}; + +struct TRINITY_DLL_DECL boss_kelesethAI : public ScriptedAI +{ + boss_kelesethAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + Heroic = c->GetMap()->IsHeroic(); + } + + ScriptedInstance* pInstance; + + uint32 FrostTombTimer; + uint32 SummonSkeletonsTimer; + uint32 RespawnSkeletonsTimer; + uint32 ShadowboltTimer; + uint64 SkeletonGUID[5]; + bool Skeletons; + bool Heroic; + bool RespawnSkeletons; + + void Reset() + { + ShadowboltTimer = 0; + Skeletons = false; + + ShatterFrostTomb = false; + + ResetTimer(); + + if (pInstance) + pInstance->SetData(DATA_PRINCEKELESETH_EVENT, NOT_STARTED); + } + + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + + DoScriptText(SAY_KILL, m_creature); + } + + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + + if (Heroic && !ShatterFrostTomb) + { + AchievementEntry const *AchievOnTheRocks = GetAchievementStore()->LookupEntry(ACHIEVEMENT_ON_THE_ROCKS); + if (AchievOnTheRocks) + { + Map* pMap = m_creature->GetMap(); + if (pMap && pMap->IsDungeon()) + { + Map::PlayerList const &players = pMap->GetPlayers(); + for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + itr->getSource()->CompletedAchievement(AchievOnTheRocks); + } + } + } + + if (pInstance) + pInstance->SetData(DATA_PRINCEKELESETH_EVENT, DONE); + } + + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + DoZoneInCombat(); + + if (pInstance) + pInstance->SetData(DATA_PRINCEKELESETH_EVENT, IN_PROGRESS); + } + + void ResetTimer(uint32 inc = 0) + { + SummonSkeletonsTimer = 5000 + inc; + FrostTombTimer = 28000 + inc; + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (ShadowboltTimer < diff) + { + Unit* target = SelectUnit(SELECT_TARGET_TOPAGGRO, 0); + if (target && target->isAlive() && target->GetTypeId() == TYPEID_PLAYER) + m_creature->CastSpell(target, Heroic ? SPELL_SHADOWBOLT_HEROIC : SPELL_SHADOWBOLT, true); + ShadowboltTimer = 10000; + }else ShadowboltTimer -= diff; + + if (!Skeletons) + if ((SummonSkeletonsTimer < diff)) + { + Creature* Skeleton; + DoScriptText(SAY_SKELETONS, m_creature); + for(uint8 i = 0; i < 5; ++i) + { + Skeleton = m_creature->SummonCreature(CREATURE_SKELETON, SkeletonSpawnPoint[i][0], SkeletonSpawnPoint[i][1] , SKELETONSPAWN_Z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN,20000); + if (Skeleton) + { + Skeleton->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + Skeleton->GetMotionMaster()->MovePoint(0, m_creature->GetPositionX(), m_creature->GetPositionY() , m_creature->GetPositionZ()); + Skeleton->AddThreat(m_creature->getVictim(), 0.0f); + DoZoneInCombat(Skeleton); + } + } + Skeletons = true; + }else SummonSkeletonsTimer -= diff; + + if (FrostTombTimer < diff) + { + Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1); + if (target && target->isAlive() && target->GetTypeId() == TYPEID_PLAYER) + { + //DoCast(target, SPELL_FROST_TOMB_SUMMON, true); + Creature* Chains = m_creature->SummonCreature(CREATURE_FROSTTOMB, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 20000); + if (Chains) + { + CAST_AI(mob_frost_tombAI, Chains->AI())->SetPrisoner(target); + Chains->CastSpell(target, SPELL_FROST_TOMB, true); + + DoScriptText(SAY_FROST_TOMB, m_creature); + } + } + FrostTombTimer = 15000; + }else FrostTombTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +struct TRINITY_DLL_DECL mob_vrykul_skeletonAI : public ScriptedAI +{ + mob_vrykul_skeletonAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance *pInstance; + uint32 Respawn_Time; + uint64 Target_Guid; + uint32 Decrepify_Timer; + + bool isDead; + + void Reset() + { + Respawn_Time = 12000; + Decrepify_Timer = 10000 + rand()%20000; + isDead = false; + } + + void EnterCombat(Unit *who){} + void DamageTaken(Unit *done_by, uint32 &damage) + { + if (done_by->GetGUID() == m_creature->GetGUID()) + return; + + if (damage >= m_creature->GetHealth()) + { + PretendToDie(); + damage = 0; + } + } + + + void PretendToDie() + { + isDead = true; + m_creature->InterruptNonMeleeSpells(true); + m_creature->RemoveAllAuras(); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->GetMotionMaster()->MovementExpired(false); + m_creature->GetMotionMaster()->MoveIdle(); + m_creature->SetStandState(UNIT_STAND_STATE_DEAD); + }; + + void Resurrect() + { + isDead = false; + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->SetStandState(UNIT_STAND_STATE_STAND); + m_creature->CastSpell(m_creature,SPELL_SCOURGE_RESSURRECTION,true); + + if (m_creature->getVictim()) + { + m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); + m_creature->AI()->AttackStart(m_creature->getVictim()); + } + else + m_creature->GetMotionMaster()->Initialize(); + }; + + void UpdateAI(const uint32 diff) + { + if (pInstance->GetData(DATA_PRINCEKELESETH_EVENT) == IN_PROGRESS) + { + if (isDead) + { + if (Respawn_Time < diff) + { + Resurrect(); + Respawn_Time = 12000; + }else Respawn_Time -= diff; + } + else + { + if (!UpdateVictim()) + return; + + if (Decrepify_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_DECREPIFY); + Decrepify_Timer = 30000; + }else Decrepify_Timer -= diff; + + DoMeleeAttackIfReady(); + } + }else + { + if (m_creature->isAlive()) + m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + } + + } +}; + +CreatureAI* GetAI_mob_frost_tomb(Creature* pCreature) +{ + return new mob_frost_tombAI(pCreature); +} + +CreatureAI* GetAI_boss_keleseth(Creature* pCreature) +{ + return new boss_kelesethAI (pCreature); +} + +CreatureAI* GetAI_mob_vrykul_skeleton(Creature* pCreature) +{ + return new mob_vrykul_skeletonAI (pCreature); +} + +void AddSC_boss_keleseth() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_keleseth"; + newscript->GetAI = &GetAI_boss_keleseth; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_frost_tomb"; + newscript->GetAI = &GetAI_mob_frost_tomb; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_vrykul_skeleton"; + newscript->GetAI = &GetAI_mob_vrykul_skeleton; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_keep/boss_skarvald_dalronn.cpp b/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_keep/boss_skarvald_dalronn.cpp new file mode 100644 index 00000000000..49811125594 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_keep/boss_skarvald_dalronn.cpp @@ -0,0 +1,397 @@ +/* + * Copyright (C) 2009 Trinity + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Skarvald_Dalronn +SD%Complete: 95 +SDComment: Needs adjustments to blizzlike timers, Yell Text + Sound to DB +SDCategory: Utgarde Keep +EndScriptData */ + +#include "precompiled.h" +#include "def_utgarde_keep.h" + +enum +{ + YELL_SKARVALD_AGGRO = -1574011, + YELL_SKARVALD_DAL_DIED = -1574012, + YELL_SKARVALD_SKA_DIEDFIRST = -1574013, + YELL_SKARVALD_KILL = -1574014, + YELL_SKARVALD_DAL_DIEDFIRST = -1574015, + + YELL_DALRONN_AGGRO = -1574016, + YELL_DALRONN_SKA_DIED = -1574017, + YELL_DALRONN_DAL_DIEDFIRST = -1574018, + YELL_DALRONN_KILL = -1574019, + YELL_DALRONN_SKA_DIEDFIRST = -1574020, + +//Spells of Skarvald and his Ghost + MOB_SKARVALD_THE_CONSTRUCTOR = 24200, + SPELL_CHARGE = 43651, + SPELL_STONE_STRIKE = 48583, + SPELL_SUMMON_SKARVALD_GHOST = 48613, + MOB_SKARVALD_GHOST = 27390, +//Spells of Dalronn and his Ghost + MOB_DALRONN_THE_CONTROLLER = 24201, + SPELL_SHADOW_BOLT = 43649, + H_SPELL_SHADOW_BOLT = 59575, + H_SPELL_SUMMON_SKELETONS = 52611, + SPELL_DEBILITATE = 43650, + SPELL_SUMMON_DALRONN_GHOST = 48612, + MOB_DALRONN_GHOST = 27389 +}; + +struct TRINITY_DLL_DECL boss_skarvald_the_constructorAI : public ScriptedAI +{ + boss_skarvald_the_constructorAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + ScriptedInstance* pInstance; + + bool ghost; + bool HeroicMode; + uint32 Charge_Timer; + uint32 StoneStrike_Timer; + uint32 Response_Timer; + uint32 Check_Timer; + bool Dalronn_isDead; + + void Reset() + { + Charge_Timer = 5000; + StoneStrike_Timer = 10000; + Dalronn_isDead = false; + Check_Timer = 5000; + + ghost = (m_creature->GetEntry() == MOB_SKARVALD_GHOST); + if (!ghost) + { + Unit* dalronn = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_DALRONN)); + if (dalronn && dalronn->isDead()) + CAST_CRE(dalronn)->Respawn(); + + if (pInstance) + pInstance->SetData(DATA_SKARVALD_DALRONN_EVENT, NOT_STARTED); + } + } + + void EnterCombat(Unit *who) + { + if (!ghost) + { + DoScriptText(YELL_SKARVALD_AGGRO,m_creature); + + Unit* dalronn = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_DALRONN)); + if (dalronn && dalronn->isAlive() && !dalronn->getVictim()) + dalronn->getThreatManager().addThreat(who,0.0f); + + if (pInstance) + pInstance->SetData(DATA_SKARVALD_DALRONN_EVENT, IN_PROGRESS); + } + } + + void JustDied(Unit* Killer) + { + if (!ghost) + { + Unit* dalronn = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_DALRONN)); + if (dalronn) + { + if (dalronn->isDead()) + { + DoScriptText(YELL_SKARVALD_DAL_DIED,m_creature); + + if (pInstance) + pInstance->SetData(DATA_SKARVALD_DALRONN_EVENT, DONE); + } + else + { + DoScriptText(YELL_SKARVALD_SKA_DIEDFIRST,m_creature); + + m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); + //DoCast(m_creature,SPELL_SUMMON_SKARVALD_GHOST,true); + Creature* temp = m_creature->SummonCreature(MOB_SKARVALD_GHOST,m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ(),0,TEMPSUMMON_CORPSE_DESPAWN,5000); + if (temp) + { + temp->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NON_ATTACKABLE); + temp->AI()->AttackStart(Killer); + } + } + } + } + } + + void KilledUnit(Unit *victim) + { + if (!ghost) + { + DoScriptText(YELL_SKARVALD_KILL,m_creature); + } + } + + void UpdateAI(const uint32 diff) + { + if (ghost) + { + if (pInstance->GetData(DATA_SKARVALD_DALRONN_EVENT) != IN_PROGRESS) + { + m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + } + } + + if (!UpdateVictim()) + return; + + if (!ghost) + { + if (Check_Timer) + if (Check_Timer < diff) + { + Check_Timer = 5000; + Unit* dalronn = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_DALRONN)); + if (dalronn && dalronn->isDead()) + { + Dalronn_isDead = true; + Response_Timer = 2000; + Check_Timer = 0; + } + }else Check_Timer -= diff; + + if (Response_Timer) + if (Dalronn_isDead) + if (Response_Timer < diff) + { + DoScriptText(YELL_SKARVALD_DAL_DIEDFIRST,m_creature); + + Response_Timer = 0; + }else Response_Timer -= diff; + } + + if (Charge_Timer < diff) + { + DoCast(SelectUnit(SELECT_TARGET_RANDOM, 1), SPELL_CHARGE); + Charge_Timer = 5000+rand()%5000; + }else Charge_Timer -= diff; + + if (StoneStrike_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_STONE_STRIKE); + StoneStrike_Timer = 5000+rand()%5000; + }else StoneStrike_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_skarvald_the_constructor(Creature* pCreature) +{ + return new boss_skarvald_the_constructorAI (pCreature); +} + +struct TRINITY_DLL_DECL boss_dalronn_the_controllerAI : public ScriptedAI +{ + boss_dalronn_the_controllerAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + ScriptedInstance* pInstance; + + bool ghost; + bool HeroicMode; + uint32 ShadowBolt_Timer; + uint32 Debilitate_Timer; + uint32 Summon_Timer; + + uint32 Response_Timer; + uint32 Check_Timer; + uint32 AggroYell_Timer; + bool Skarvald_isDead; + + + void Reset() + { + ShadowBolt_Timer = 1000; + Debilitate_Timer = 5000; + Summon_Timer = 10000; + Check_Timer = 5000; + Skarvald_isDead = false; + AggroYell_Timer = 0; + + ghost = m_creature->GetEntry() == MOB_DALRONN_GHOST; + if (!ghost) + { + Unit* skarvald = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_SKARVALD)); + if (skarvald && skarvald->isDead()) + CAST_CRE(skarvald)->Respawn(); + + if (pInstance) + pInstance->SetData(DATA_SKARVALD_DALRONN_EVENT, NOT_STARTED); + } + } + + void EnterCombat(Unit *who) + { + if (!ghost) + { + Unit* skarvald = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_SKARVALD)); + if (skarvald && skarvald->isAlive() && !skarvald->getVictim()) + skarvald->getThreatManager().addThreat(who,0.0f); + + AggroYell_Timer = 5000; + + if (pInstance) + pInstance->SetData(DATA_SKARVALD_DALRONN_EVENT, IN_PROGRESS); + } + } + + void JustDied(Unit* Killer) + { + if (!ghost) + { + Unit* skarvald = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_SKARVALD)); + if (skarvald) + if (skarvald->isDead()) + { + DoScriptText(YELL_DALRONN_SKA_DIED,m_creature); + + if (pInstance) + pInstance->SetData(DATA_SKARVALD_DALRONN_EVENT, DONE); + } + else + { + DoScriptText(YELL_DALRONN_DAL_DIEDFIRST,m_creature); + + m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); + //DoCast(m_creature,SPELL_SUMMON_DALRONN_GHOST,true); + Creature* temp = m_creature->SummonCreature(MOB_DALRONN_GHOST,m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ(),0,TEMPSUMMON_CORPSE_DESPAWN,5000); + if (temp) + { + temp->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NON_ATTACKABLE); + temp->AI()->AttackStart(Killer); + } + } + } + } + + void KilledUnit(Unit *victim) + { + if (!ghost) + { + DoScriptText(YELL_DALRONN_KILL,m_creature); + } + } + + void UpdateAI(const uint32 diff) + { + if (ghost) + { + if (pInstance->GetData(DATA_SKARVALD_DALRONN_EVENT) != IN_PROGRESS) + { + m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + } + } + + if (!UpdateVictim()) + return; + + if (AggroYell_Timer) + if (AggroYell_Timer < diff) + { + DoScriptText(YELL_DALRONN_AGGRO,m_creature); + + AggroYell_Timer = 0; + }else AggroYell_Timer -= diff; + + if (!ghost) + { + if (Check_Timer) + if (Check_Timer < diff) + { + Check_Timer = 5000; + Unit* skarvald = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_SKARVALD)); + if (skarvald && skarvald->isDead()) + { + Skarvald_isDead = true; + Response_Timer = 2000; + Check_Timer = 0; + } + }else Check_Timer -= diff; + + if (Response_Timer) + if (Skarvald_isDead) + if (Response_Timer < diff) + { + DoScriptText(YELL_DALRONN_SKA_DIEDFIRST,m_creature); + + Response_Timer = 0; + }else Response_Timer -= diff; + } + + if (ShadowBolt_Timer < diff) + { + if (!m_creature->IsNonMeleeSpellCasted(false)) + { + DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0),HeroicMode ? H_SPELL_SHADOW_BOLT : SPELL_SHADOW_BOLT); + ShadowBolt_Timer = 1000; + } + }else ShadowBolt_Timer -= diff; + + if (Debilitate_Timer < diff) + { + if (!m_creature->IsNonMeleeSpellCasted(false)) + { + DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0),SPELL_DEBILITATE); + Debilitate_Timer = 5000+rand()%5000; + } + }else Debilitate_Timer -= diff; + + if (HeroicMode) + if (Summon_Timer < diff) + { + DoCast(m_creature,H_SPELL_SUMMON_SKELETONS); + Summon_Timer = (rand()%10000) + 20000; + }else Summon_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_dalronn_the_controller(Creature* pCreature) +{ + return new boss_dalronn_the_controllerAI (pCreature); +} + +void AddSC_boss_skarvald_dalronn() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_skarvald_the_constructor"; + newscript->GetAI = &GetAI_boss_skarvald_the_constructor; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="boss_dalronn_the_controller"; + newscript->GetAI = &GetAI_boss_dalronn_the_controller; + newscript->RegisterSelf(); +} \ No newline at end of file diff --git a/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_keep/def_utgarde_keep.h b/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_keep/def_utgarde_keep.h new file mode 100644 index 00000000000..b630e156564 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_keep/def_utgarde_keep.h @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2009 Trinity + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef DEF_UTGARDE_KEEP_H +#define DEF_UTGARDE_KEEP_H + +#define DATA_PRINCEKELESETH 1 +#define DATA_SKARVALD 3 +#define DATA_DALRONN 4 +#define DATA_INGVAR 6 + +#define DATA_PRINCEKELESETH_EVENT 2 +#define DATA_SKARVALD_DALRONN_EVENT 5 +#define DATA_INGVAR_EVENT 7 + +#define EVENT_FORGE_1 8 +#define EVENT_FORGE_2 9 +#define EVENT_FORGE_3 10 + +#endif diff --git a/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_keep/instance_utgarde_keep.cpp b/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_keep/instance_utgarde_keep.cpp new file mode 100644 index 00000000000..4c7668970da --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_keep/instance_utgarde_keep.cpp @@ -0,0 +1,291 @@ +/* + * Copyright (C) 2009 Trinity + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Utgarde_Keep +SD%Complete: 90 +SDComment: Instance Data Scripts and functions to acquire mobs and set encounter status for use in various Utgarde Keep Scripts +SDCategory: Utgarde Keep +EndScriptData */ + +#include "precompiled.h" +#include "def_utgarde_keep.h" + +#define MAX_ENCOUNTER 3 + +#define ENTRY_BELLOW_1 186688 +#define ENTRY_BELLOW_2 186689 +#define ENTRY_BELLOW_3 186690 + +#define ENTRY_FORGEFIRE_1 186692 +#define ENTRY_FORGEFIRE_2 186693 +#define ENTRY_FORGEFIRE_3 186691 + +#define ENTRY_GLOWING_ANVIL_1 186609 +#define ENTRY_GLOWING_ANVIL_2 186610 +#define ENTRY_GLOWING_ANVIL_3 186611 + +/* Utgarde Keep encounters: +0 - Prince Keleseth +1 - Skarvald Dalronn +2 - Ingvar the Plunderer +*/ + +struct TRINITY_DLL_DECL instance_utgarde_keep : public ScriptedInstance +{ + instance_utgarde_keep(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint64 Keleseth; + uint64 Skarvald; + uint64 Dalronn; + uint64 Ingvar; + + uint64 forge_bellow[3]; + uint64 forge_fire[3]; + uint64 forge_anvil[3]; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + std::string str_data; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + Keleseth = 0; + Skarvald = 0; + Dalronn =0; + Ingvar =0; + + for(uint8 i= 0; i < 3; ++i) + { + forge_bellow[i] = 0; + forge_fire[i] = 0; + forge_anvil[i] = 0; + } + } + + bool IsEncounterInProgress() const + { + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) return true; + + return false; + } + + Player* GetPlayerInMap() + { + Map::PlayerList const& players = instance->GetPlayers(); + + if (!players.isEmpty()) + { + for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + { + if (Player* plr = itr->getSource()) + return plr; + } + } + + debug_log("TSCR: Instance Utgarde Keep: GetPlayerInMap, but PlayerList is empty!"); + return NULL; + } + + void OnCreatureCreate(Creature* pCreature, bool add) + { + switch(pCreature->GetEntry()) + { + case 23953: Keleseth = pCreature->GetGUID(); break; + case 24201: Dalronn = pCreature->GetGUID(); break; + case 24200: Skarvald = pCreature->GetGUID(); break; + case 23954: Ingvar = pCreature->GetGUID(); break; + } + } + + void OnGameObjectCreate(GameObject* pGo, bool add) + { + switch(pGo->GetEntry()) + { + //door and object id + case ENTRY_BELLOW_1: forge_bellow[0] = pGo->GetGUID(); break; + case ENTRY_BELLOW_2: forge_bellow[1] = pGo->GetGUID(); break; + case ENTRY_BELLOW_3: forge_bellow[2] = pGo->GetGUID(); break; + case ENTRY_FORGEFIRE_1: forge_fire[0] = pGo->GetGUID(); break; + case ENTRY_FORGEFIRE_2: forge_fire[1] = pGo->GetGUID(); break; + case ENTRY_FORGEFIRE_3: forge_fire[2] = pGo->GetGUID(); break; + case ENTRY_GLOWING_ANVIL_1: forge_anvil[0] = pGo->GetGUID(); break; + case ENTRY_GLOWING_ANVIL_2: forge_anvil[1] = pGo->GetGUID(); break; + case ENTRY_GLOWING_ANVIL_3: forge_anvil[2] = pGo->GetGUID(); break; + } + } + + uint64 GetData64(uint32 identifier) + { + switch(identifier) + { + case DATA_PRINCEKELESETH: return Keleseth; + case DATA_DALRONN: return Dalronn; + case DATA_SKARVALD: return Skarvald; + case DATA_INGVAR: return Ingvar; + } + + return 0; + } + + void SetData(uint32 type, uint32 data) + { + switch(type) + { + case DATA_PRINCEKELESETH_EVENT: + if (data == DONE) + { + //HandleGameObject(doorname, 0); + } + m_auiEncounter[0] = data; + break; + case DATA_SKARVALD_DALRONN_EVENT: + if (data == DONE) + { + //HandleGameObject(doorname, 0); + } + m_auiEncounter[1] = data; + break; + case DATA_INGVAR_EVENT: + if (data == DONE) + { + //HandleGameObject(doorname, 0); + } + m_auiEncounter[2] = data; + break; + case EVENT_FORGE_1: + if (data == NOT_STARTED) + { + HandleGameObject(forge_bellow[0],false); + HandleGameObject(forge_fire[0],false); + HandleGameObject(forge_anvil[0],false); + }else + { + HandleGameObject(forge_bellow[0],true); + HandleGameObject(forge_fire[0],true); + HandleGameObject(forge_anvil[0],true); + } + break; + case EVENT_FORGE_2: + if (data == NOT_STARTED) + { + HandleGameObject(forge_bellow[1],false); + HandleGameObject(forge_fire[1],false); + HandleGameObject(forge_anvil[1],false); + }else + { + HandleGameObject(forge_bellow[1],true); + HandleGameObject(forge_fire[1],true); + HandleGameObject(forge_anvil[1],true); + } + break; + case EVENT_FORGE_3: + if (data == NOT_STARTED) + { + HandleGameObject(forge_bellow[2],false); + HandleGameObject(forge_fire[2],false); + HandleGameObject(forge_anvil[2],false); + }else + { + HandleGameObject(forge_bellow[2],true); + HandleGameObject(forge_fire[2],true); + HandleGameObject(forge_anvil[2],true); + } + break; + } + + + if (data == DONE) + { + SaveToDB(); + } + } + + uint32 GetData(uint32 type) + { + switch(type) + { + case DATA_PRINCEKELESETH_EVENT: return m_auiEncounter[0]; + case DATA_SKARVALD_DALRONN_EVENT: return m_auiEncounter[1]; + case DATA_INGVAR_EVENT: return m_auiEncounter[2]; + } + + return 0; + } + + std::string GetSaveData() + { + OUT_SAVE_INST_DATA; + + std::ostringstream saveStream; + saveStream << "U K " << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " + << m_auiEncounter[2]; + + str_data = saveStream.str(); + + OUT_SAVE_INST_DATA_COMPLETE; + return str_data; + } + + void Load(const char* in) + { + if (!in) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(in); + + char dataHead1, dataHead2; + uint16 data0,data1,data2; + + std::istringstream loadStream(in); + loadStream >> dataHead1 >> dataHead2 >> data0 >> data1 >> data2; + + if (dataHead1 == 'U' && dataHead2 == 'K') + { + m_auiEncounter[0] = data0; + m_auiEncounter[1] = data1; + m_auiEncounter[2] = data2; + + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) + m_auiEncounter[i] = NOT_STARTED; + + }else OUT_LOAD_INST_DATA_FAIL; + + OUT_LOAD_INST_DATA_COMPLETE; + } +}; + +InstanceData* GetInstanceData_instance_utgarde_keep(Map* pMap) +{ + return new instance_utgarde_keep(pMap); +} + +void AddSC_instance_utgarde_keep() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_utgarde_keep"; + newscript->GetInstanceData = &GetInstanceData_instance_utgarde_keep; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_keep/utgarde_keep.cpp b/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_keep/utgarde_keep.cpp new file mode 100644 index 00000000000..d82e45f28d4 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_keep/utgarde_keep.cpp @@ -0,0 +1,160 @@ +/* + * Copyright (C) 2009 Trinity + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "precompiled.h" +#include "def_utgarde_keep.h" + +uint32 entry_search[3] = +{ + 186609, + 186610, + 186611 +}; + +struct TRINITY_DLL_DECL npc_dragonflayer_forge_masterAI : public ScriptedAI +{ + npc_dragonflayer_forge_masterAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + fm_Type = 0; + } + + ScriptedInstance* pInstance; + uint8 fm_Type; + + void Reset() + { + if (fm_Type == 0) fm_Type = GetForgeMasterType(); + CheckForge(); + } + + void CheckForge() + { + if (pInstance) + { + switch(fm_Type) + { + case 1: + pInstance->SetData(EVENT_FORGE_1,m_creature->isAlive() ? NOT_STARTED : DONE); + break; + case 2: + pInstance->SetData(EVENT_FORGE_2,m_creature->isAlive() ? NOT_STARTED : DONE); + break; + case 3: + pInstance->SetData(EVENT_FORGE_3,m_creature->isAlive() ? NOT_STARTED : DONE); + break; + } + } + } + + void JustDied(Unit *killer) + { + if (fm_Type == 0) fm_Type = GetForgeMasterType(); + if (pInstance) + { + switch(fm_Type) + { + case 1: + pInstance->SetData(EVENT_FORGE_1,DONE); + break; + case 2: + pInstance->SetData(EVENT_FORGE_2,DONE); + break; + case 3: + pInstance->SetData(EVENT_FORGE_3,DONE); + break; + } + } + } + + void EnterCombat(Unit *who) + { + if (fm_Type == 0) fm_Type = GetForgeMasterType(); + if (pInstance) + { + switch(fm_Type) + { + case 1: + pInstance->SetData(EVENT_FORGE_1,IN_PROGRESS); + break; + case 2: + pInstance->SetData(EVENT_FORGE_2,IN_PROGRESS); + break; + case 3: + pInstance->SetData(EVENT_FORGE_3,IN_PROGRESS); + break; + } + } + m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE ,EMOTE_ONESHOT_NONE); + } + + uint8 GetForgeMasterType() + { + float diff = 30.0f; + int near_f = 0; + + for(uint8 i = 0; i < 3 ; ++i) + { + GameObject* temp; + temp = m_creature->FindNearestGameObject(entry_search[i],30); + if (temp) + { + if (m_creature->IsWithinDist(temp,diff,false)) + { + near_f = i + 1; + diff = m_creature->GetDistance2d(temp); + + } + } + } + + switch (near_f) + { + case 1: return 1; + case 2: return 2; + case 3: return 3; + default: return 0; + } + } + + void UpdateAI(const uint32 diff) + { + if (fm_Type == 0) + fm_Type = GetForgeMasterType(); + + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_npc_dragonflayer_forge_master(Creature* pCreature) +{ + return new npc_dragonflayer_forge_masterAI(pCreature); +} + +void AddSC_utgarde_keep() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="npc_dragonflayer_forge_master"; + newscript->GetAI = &GetAI_npc_dragonflayer_forge_master; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_palehoof.cpp b/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_palehoof.cpp new file mode 100644 index 00000000000..503cae94f4d --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_palehoof.cpp @@ -0,0 +1,78 @@ +/* Script Data Start +SDName: Boss palehoof +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = 'boss_palehoof' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_ARCING_SMASH 48260 +#define SPELL_IMPALE 48261 +#define SPELL_WITHERING_ROAR 48256 + +//Yell +#define SAY_AGGRO -1575000 +#define SAY_SLAY_1 -1575001 +#define SAY_SLAY_2 -1575002 +#define SAY_DEATH -1575003 + +struct TRINITY_DLL_DECL boss_palehoofAI : public ScriptedAI +{ + boss_palehoofAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + + switch(rand()%2) + { + case 0: + DoScriptText(SAY_SLAY_1, m_creature); + break; + case 1: + DoScriptText(SAY_SLAY_2, m_creature); + break; + } + } +}; + +CreatureAI* GetAI_boss_palehoof(Creature* pCreature) +{ + return new boss_palehoofAI (pCreature); +} + +void AddSC_boss_palehoof() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_palehoof"; + newscript->GetAI = &GetAI_boss_palehoof; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_skadi.cpp b/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_skadi.cpp new file mode 100644 index 00000000000..f21ae75318a --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_skadi.cpp @@ -0,0 +1,89 @@ +/* Script Data Start +SDName: Boss skadi +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = 'boss_skadi' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Phase 0 "gauntlet even" Skadi on a flying mount, waves of adds charging to the group periodicaly carrying harpoons +//Phase 1 Kill the Skadi drake mount with harppons launcher +//Phase 2 Kill the Skadi + +//Skadi Spells +#define SPELL_CRUSH 50234 +#define SPELL_POISONED_SPEAR 50225 +#define SPELL_WHIRLWIND 50228 //random target, but not the tank approx. every 20s + +//Yell +#define SAY_AGGRO -1575004 +#define SAY_KILL_1 -1575005 +#define SAY_KILL_2 -1575006 +#define SAY_KILL_3 -1575007 +#define SAY_DEATH -1575008 +#define SAY_DRAKE_DEATH -1575009 +#define SAY_DRAKE_HIT_1 -1575010 +#define SAY_DRAKE_HIT_2 -1575011 +#define SAY_DRAKE_BREATH_1 -1575012 +#define SAY_DRAKE_BREATH_2 -1575013 +#define SAY_DRAKE_BREATH_3 -1575014 + +struct TRINITY_DLL_DECL boss_skadiAI : public ScriptedAI +{ + boss_skadiAI(Creature *c) : ScriptedAI(c) {} + + uint32 phase; + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + phase = 0; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + switch(rand()%3) + { + case 0: DoScriptText(SAY_KILL_1, m_creature);break; + case 1: DoScriptText(SAY_KILL_2, m_creature);break; + case 2: DoScriptText(SAY_KILL_3, m_creature);break; + } + } +}; + +CreatureAI* GetAI_boss_skadi(Creature* pCreature) +{ + return new boss_skadiAI (pCreature); +} + +void AddSC_boss_skadi() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_skadi"; + newscript->GetAI = &GetAI_boss_skadi; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_svala.cpp b/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_svala.cpp new file mode 100644 index 00000000000..e43d0cd9d4d --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_svala.cpp @@ -0,0 +1,83 @@ +/* Script Data Start +SDName: Boss svala +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = 'boss_svala' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_CALL_FLAMES 48258 +#define SPELL_RITUAL_OF_THE_SWORD 48276 //Effect #1 Teleport, Effect #2 Dummy +#define SPELL_SINSTER_STRIKE 15667 + +//Yells +#define SAY_DIALOG_WITH_ARTHAS_1 -1575015 +#define SAY_DIALOG_WITH_ARTHAS_2 -1575016 +#define SAY_DIALOG_WITH_ARTHAS_3 -1575017 +#define SAY_AGGRO -1575018 +#define SAY_SLAY_1 -1575019 +#define SAY_SLAY_2 -1575020 +#define SAY_SLAY_3 -1575021 +#define SAY_DEATH -1575022 +#define SAY_SACRIFICE_PLAYER_1 -1575023 +#define SAY_SACRIFICE_PLAYER_2 -1575024 +#define SAY_SACRIFICE_PLAYER_3 -1575025 +#define SAY_SACRIFICE_PLAYER_4 -1575026 +#define SAY_SACRIFICE_PLAYER_5 -1575027 + +struct TRINITY_DLL_DECL boss_svalaAI : public ScriptedAI +{ + boss_svalaAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature);break; + case 1: DoScriptText(SAY_SLAY_2, m_creature);break; + case 2: DoScriptText(SAY_SLAY_3, m_creature);break; + } + } +}; + +CreatureAI* GetAI_boss_svala(Creature* pCreature) +{ + return new boss_svalaAI (pCreature); +} + +void AddSC_boss_svala() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_svala"; + newscript->GetAI = &GetAI_boss_svala; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_ymiron.cpp b/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_ymiron.cpp new file mode 100644 index 00000000000..43a16a78db4 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_ymiron.cpp @@ -0,0 +1,85 @@ +/* Script Data Start +SDName: Boss ymiron +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = 'boss_ymiron' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_BANE 48294 +#define SPELL_DARK_SLASH 48292 +#define SPELL_FETID_ROT 48291 +#define SPELL_SCREAMS_OF_THE_DEAD 51750 +#define SPELL_SPIRIT_BURST 48529 +#define SPELL_SPIRIT_STRIKE 48423 +//every 20% stuns the party and runs to a boat + +//Yell +#define SAY_AGGRO -1575028 +#define SAY_SLAY_1 -1575029 +#define SAY_SLAY_2 -1575030 +#define SAY_SLAY_3 -1575031 +#define SAY_SLAY_4 -1575032 +#define SAY_DEATH -1575033 +#define SAY_SUMMON_BJORN -1575034 +#define SAY_SUMMON_HALDOR -1575035 +#define SAY_SUMMON_RANULF -1575036 +#define SAY_SUMMON_TORGYN -1575037 + +struct TRINITY_DLL_DECL boss_ymironAI : public ScriptedAI +{ + boss_ymironAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + switch(rand()%4) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature);break; + case 1: DoScriptText(SAY_SLAY_2, m_creature);break; + case 2: DoScriptText(SAY_SLAY_3, m_creature);break; + case 3: DoScriptText(SAY_SLAY_4, m_creature);break; + } + } +}; + +CreatureAI* GetAI_boss_ymiron(Creature* pCreature) +{ + return new boss_ymironAI (pCreature); +} + +void AddSC_boss_ymiron() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_ymiron"; + newscript->GetAI = &GetAI_boss_ymiron; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_pinnacle/def_pinnacle.h b/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_pinnacle/def_pinnacle.h new file mode 100644 index 00000000000..82e2173fab5 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_pinnacle/def_pinnacle.h @@ -0,0 +1,4 @@ +#ifndef DEF_PINNACLE_H +#define DEF_PINNACLE_H + +#endif diff --git a/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_pinnacle/instance_pinnacle.cpp b/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_pinnacle/instance_pinnacle.cpp new file mode 100644 index 00000000000..e1361c8960e --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_pinnacle/instance_pinnacle.cpp @@ -0,0 +1,21 @@ +#include "precompiled.h" +#include "def_pinnacle.h" + +struct TRINITY_DLL_DECL instance_pinnacle : public ScriptedInstance +{ + instance_pinnacle(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; +}; + +InstanceData* GetInstanceData_instance_pinnacle(Map* pMap) +{ + return new instance_pinnacle(pMap); +} + +void AddSC_instance_pinnacle() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_pinnacle"; + newscript->GetInstanceData = &GetInstanceData_instance_pinnacle; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/vault_of_archavon/boss_archavon.cpp b/src/bindings/scripts/scripts/northrend/vault_of_archavon/boss_archavon.cpp new file mode 100644 index 00000000000..2a0e7fcd007 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/vault_of_archavon/boss_archavon.cpp @@ -0,0 +1,199 @@ +/*** SQL START *** +UPDATE `creature_template` SET `ScriptName`='boss_archavon' WHERE `entry`='31125'; +UPDATE `creature_template` SET `ScriptName`='mob_archavon_warder' WHERE `entry`='32353'; +*** SQL END ***/ +#include "precompiled.h" +#include "def_vault_of_archavon.h" + +#define EMOTE_BERSERK -1590002 + +//Spells Archavon +#define SPELL_ROCK_SHARDS 58678 +#define SPELL_CRUSHING_LEAP HEROIC(58960,60894)//Instant (10-80yr range) -- Leaps at an enemy, inflicting 8000 Physical damage, knocking all nearby enemies away, and creating a cloud of choking debris. +#define SPELL_STOMP HEROIC(58663,60880) +#define SPELL_IMPALE HEROIC(58666,60882) //Lifts an enemy off the ground with a spiked fist, inflicting 47125 to 52875 Physical damage and 9425 to 10575 additional damage each second for 8 sec. +#define SPELL_BERSERK 47008 +//Spells Archavon Warders +#define SPELL_ROCK_SHOWER HEROIC(60919,60923) +#define SPELL_SHIELD_CRUSH HEROIC(60897,60899) +#define SPELL_WHIRL HEROIC(60902,60916) + +//4 Warders spawned +#define ARCHAVON_WARDER 32353 //npc 32353 + +//Yell +#define SAY_LEAP "Archavon the Stone Watcher lunges for $N!" //$N should be the target + +#define EVENT_ROCK_SHARDS 1 //15s cd +#define EVENT_CHOKING_CLOUD 2 //30s cd +#define EVENT_STOMP 3 //45s cd +#define EVENT_IMPALE 4 +#define EVENT_BERSERK 5 //300s cd + +//mob +#define EVENT_ROCK_SHOWER 5 //set = 20s cd,unkown cd +#define EVENT_SHIELD_CRUSH 6 //set = 30s cd +#define EVENT_WHIRL 8 //set= 10s cd + +struct TRINITY_DLL_DECL boss_archavonAI : public ScriptedAI +{ + boss_archavonAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + EventMap events; + + void Reset() + { + events.Reset(); + + if (pInstance) + pInstance->SetData(DATA_ARCHAVON_EVENT, NOT_STARTED); + } + + void KilledUnit(Unit* Victim){} + + void JustDied(Unit* Killer) + { + if (pInstance) + pInstance->SetData(DATA_ARCHAVON_EVENT, DONE); + } + + void EnterCombat(Unit *who) + { + DoZoneInCombat(); + events.ScheduleEvent(EVENT_ROCK_SHARDS, 15000); + events.ScheduleEvent(EVENT_CHOKING_CLOUD, 30000); + events.ScheduleEvent(EVENT_STOMP, 45000); + events.ScheduleEvent(EVENT_BERSERK, 300000); + + if (pInstance) + pInstance->SetData(DATA_ARCHAVON_EVENT, IN_PROGRESS); + } + + // Below UpdateAI may need review/debug. + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + events.Update(diff); + + if (me->hasUnitState(UNIT_STAT_CASTING)) + return; + + while(uint32 eventId = events.ExecuteEvent()) + { + switch(eventId) + { + case EVENT_ROCK_SHARDS: + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + DoCast(target, SPELL_ROCK_SHARDS); + events.ScheduleEvent(EVENT_ROCK_SHARDS, 15000); + return; + case EVENT_CHOKING_CLOUD: + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + DoCast(target, SPELL_CRUSHING_LEAP, true); //10y~80y, ignore range + events.ScheduleEvent(EVENT_CHOKING_CLOUD, 30000); + return; + case EVENT_STOMP: + DoCast(me->getVictim(), SPELL_STOMP); + events.ScheduleEvent(EVENT_IMPALE, 3000); + events.ScheduleEvent(EVENT_STOMP, 45000); + return; + case EVENT_IMPALE: + DoCast(me->getVictim(), SPELL_IMPALE); + return; + case EVENT_BERSERK: + DoCast(m_creature, SPELL_BERSERK); + DoScriptText(EMOTE_BERSERK, m_creature); + return; + } + } + + DoMeleeAttackIfReady(); + } +}; + +/*###### +## Mob Archavon Warder +######*/ +struct TRINITY_DLL_DECL mob_warderAI : public ScriptedAI //npc 32353 +{ + mob_warderAI(Creature *c) : ScriptedAI(c) {} + + EventMap events; + + void Reset() + { + events.Reset(); + } + + void EnterCombat(Unit *who) + { + DoZoneInCombat(); + events.ScheduleEvent(EVENT_ROCK_SHOWER, 2000); + events.ScheduleEvent(EVENT_SHIELD_CRUSH, 20000); + events.ScheduleEvent(EVENT_WHIRL, 7500); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + events.Update(diff); + + while(uint32 eventId = events.ExecuteEvent()) + { + switch(eventId) + { + case EVENT_ROCK_SHOWER: + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + DoCast(target, SPELL_ROCK_SHOWER); + events.ScheduleEvent(EVENT_ROCK_SHARDS, 6000); + return; + } + case EVENT_SHIELD_CRUSH: + DoCast(m_creature->getVictim(), SPELL_SHIELD_CRUSH); + events.ScheduleEvent(EVENT_SHIELD_CRUSH, 20000); + return; + case EVENT_WHIRL: + DoCast(m_creature->getVictim(), SPELL_WHIRL); + events.ScheduleEvent(EVENT_WHIRL, 8000); + return; + } + } + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_warder(Creature* pCreature) +{ + return new mob_warderAI (pCreature); +} + +CreatureAI* GetAI_boss_archavon(Creature* pCreature) +{ + return new boss_archavonAI (pCreature); +} + +void AddSC_boss_archavon() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_archavon"; + newscript->GetAI = &GetAI_boss_archavon; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_archavon_warder"; + newscript->GetAI = &GetAI_mob_warder; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/vault_of_archavon/boss_emalon.cpp b/src/bindings/scripts/scripts/northrend/vault_of_archavon/boss_emalon.cpp new file mode 100644 index 00000000000..94290a05007 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/vault_of_archavon/boss_emalon.cpp @@ -0,0 +1,275 @@ +#include "precompiled.h" +#include "def_vault_of_archavon.h" + +//Emalon spells +#define SPELL_CHAIN_LIGHTNING HEROIC(64213, 64215) +#define SPELL_LIGHTNING_NOVA HEROIC(64216, 65279) +#define SPELL_OVERCHARGE 64218 //Casted every 45 sec on a random Tempest Minion +#define SPELL_BERSERK 26662 + +//Tempest Minion spells +#define SPELL_SHOCK 64363 +#define SPELL_OVERCHARGED 64217 +#define SPELL_OVERCHARGED_BLAST 64219 //Casted when Overcharged reaches 10 stacks. Mob dies after that + +//Emotes +#define EMOTE_OVERCHARGE -1590000 +#define EMOTE_MINION_RESPAWN -1590001 +#define EMOTE_BERSERK -1590002 + +//Events +#define EVENT_CHAIN_LIGHTNING 1 +#define EVENT_LIGHTNING_NOVA 2 +#define EVENT_OVERCHARGE 3 +#define EVENT_BERSERK 4 +#define EVENT_SHOCK 5 + +//Creatures +#define MOB_TEMPEST_MINION 33998 + +float TempestMinions[4][5] = +{ + {33998, -203.980103, -281.287720, 91.650223, 1.598807}, + {33998, -233.489410, -281.139282, 91.652412, 1.598807}, + {33998, -233.267578, -297.104645, 91.681915, 1.598807}, + {33998, -203.842529, -297.097015, 91.745163, 1.598807} +}; + +/*###### +## Emalon the Storm Watcher +######*/ +struct TRINITY_DLL_DECL boss_emalonAI : public ScriptedAI +{ + boss_emalonAI(Creature *c) : ScriptedAI(c), summons(m_creature) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + EventMap events; + std::list MinionList; + SummonList summons; + + void Reset() + { + events.Reset(); + summons.DespawnAll(); + MinionList.clear(); + + Creature* Minion; + for (uint32 i = 0; i < 4; ++i) + { + Minion = m_creature->SummonCreature(((uint32)TempestMinions[i][0]),TempestMinions[i][1],TempestMinions[i][2],TempestMinions[i][3],TempestMinions[i][4],TEMPSUMMON_DEAD_DESPAWN, 0); + MinionList.push_back(Minion->GetGUID()); + if(Unit* target = m_creature->getVictim()) + Minion->AI()->AttackStart(target); + } + + if (pInstance) + pInstance->SetData(DATA_EMALON_EVENT, NOT_STARTED); + } + + void JustSummoned(Creature* summoned) + { + summons.Summon(summoned); + } + + void SummonedCreatureDespawn(Creature *summon) {summons.Despawn(summon);} + + void JustDied(Unit* Killer) + { + summons.DespawnAll(); + + if (pInstance) + pInstance->SetData(DATA_EMALON_EVENT, DONE); + } + + void EnterCombat(Unit *who) + { + if(!MinionList.empty()) + { + for(std::list::const_iterator itr = MinionList.begin(); itr != MinionList.end(); ++itr) + { + Creature* Minion = (Unit::GetCreature(*m_creature, *itr)); + Minion->AI()->AttackStart(who); + } + } + + DoZoneInCombat(); + events.ScheduleEvent(EVENT_CHAIN_LIGHTNING, 5000); + events.ScheduleEvent(EVENT_LIGHTNING_NOVA, 40000); + events.ScheduleEvent(EVENT_BERSERK, 360000); + events.ScheduleEvent(EVENT_OVERCHARGE, 45000); + + if (pInstance) + pInstance->SetData(DATA_EMALON_EVENT, IN_PROGRESS); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if(!UpdateVictim()) + return; + + events.Update(diff); + + if(me->hasUnitState(UNIT_STAT_CASTING)) + return; + + while(uint32 eventId = events.ExecuteEvent()) + { + switch(eventId) + { + case EVENT_CHAIN_LIGHTNING: + if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + DoCast(target, SPELL_CHAIN_LIGHTNING); + events.ScheduleEvent(EVENT_CHAIN_LIGHTNING, 25000); + return; + case EVENT_LIGHTNING_NOVA: + DoCastAOE(SPELL_LIGHTNING_NOVA, false); + events.ScheduleEvent(EVENT_LIGHTNING_NOVA, 40000); + return; + case EVENT_OVERCHARGE: + if(Creature* Minion = GetClosestCreatureWithEntry(me, MOB_TEMPEST_MINION, 1000.0f)) + { + Minion->CastSpell(me, SPELL_OVERCHARGED, true); + Minion->SetHealth(Minion->GetMaxHealth()); + DoScriptText(EMOTE_OVERCHARGE, m_creature); + } + events.ScheduleEvent(EVENT_OVERCHARGE, 45000); + return; + case EVENT_BERSERK: + DoCast(m_creature, SPELL_BERSERK); + DoScriptText(EMOTE_BERSERK, m_creature); + return; + } + } + + DoMeleeAttackIfReady(); + } +}; + +/*###### +## Tempest Minion +######*/ +struct TRINITY_DLL_DECL mob_tempest_minionAI : public ScriptedAI +{ + mob_tempest_minionAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + EmalonGUID = pInstance ? pInstance->GetData64(DATA_EMALON) : 0; + Emalon = Unit::GetCreature(*m_creature, EmalonGUID); + } + + ScriptedInstance* pInstance; + + EventMap events; + + uint64 EmalonGUID; + Creature* Emalon; + + uint32 OverchargedTimer; + + void Reset() + { + events.Reset(); + + OverchargedTimer = 0; + } + + void JustDied(Unit* Killer) + { + Creature* Emalon; + Emalon = Unit::GetCreature(*m_creature, EmalonGUID); + float x,y,z; + Emalon->GetPosition(x,y,z); + Emalon->SummonCreature(MOB_TEMPEST_MINION,x,y,z,m_creature->GetOrientation(),TEMPSUMMON_DEAD_DESPAWN,0); + DoScriptText(EMOTE_MINION_RESPAWN, m_creature); + } + + void EnterCombat(Unit *who) + { + DoZoneInCombat(); + events.ScheduleEvent(EVENT_SHOCK, 20000); + + if(Emalon) + Emalon->AI()->AttackStart(who); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if(!UpdateVictim()) + return; + + events.Update(diff); + + if(me->hasUnitState(UNIT_STAT_CASTING)) + return; + + if(Aura *OverchargedAura = m_creature->GetAura(SPELL_OVERCHARGED)) + { + if(OverchargedAura->GetStackAmount() < 10) + { + if(OverchargedTimer < diff) + { + DoCast(me, SPELL_OVERCHARGED); + OverchargedTimer = 2000; + }else OverchargedTimer -=diff; + } + else + { + if(OverchargedAura->GetStackAmount() == 10) + { + DoCast(me,SPELL_OVERCHARGED_BLAST); + m_creature->setDeathState(JUST_DIED); + Creature* Emalon; + Emalon = Unit::GetCreature(*m_creature, EmalonGUID); + float x,y,z; + Emalon->GetPosition(x,y,z); + Emalon->SummonCreature(MOB_TEMPEST_MINION,x,y,z,m_creature->GetOrientation(),TEMPSUMMON_DEAD_DESPAWN,0); + DoScriptText(EMOTE_MINION_RESPAWN, m_creature); + } + } + } + + while(uint32 eventId = events.ExecuteEvent()) + { + switch(eventId) + { + case EVENT_SHOCK: + DoCast(me->getVictim(), SPELL_SHOCK); + events.ScheduleEvent(EVENT_SHOCK, 20000); + return; + } + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_tempest_minion(Creature *_Creature) +{ + return new mob_tempest_minionAI (_Creature); +} + +CreatureAI* GetAI_boss_emalon(Creature *_Creature) +{ + return new boss_emalonAI (_Creature); +} + +void AddSC_boss_emalon() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_emalon"; + newscript->GetAI = &GetAI_boss_emalon; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_tempest_minion"; + newscript->GetAI = &GetAI_mob_tempest_minion; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/vault_of_archavon/def_vault_of_archavon.h b/src/bindings/scripts/scripts/northrend/vault_of_archavon/def_vault_of_archavon.h new file mode 100644 index 00000000000..95c44035184 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/vault_of_archavon/def_vault_of_archavon.h @@ -0,0 +1,8 @@ +#ifndef DEF_ARCHAVON_H +#define DEF_ARCHAVON_H + +#define DATA_ARCHAVON_EVENT 1 +#define DATA_EMALON_EVENT 2 +#define DATA_EMALON 3 +#define DATA_ARCHAVON 4 +#endif diff --git a/src/bindings/scripts/scripts/northrend/vault_of_archavon/instance_vault_of_archavon.cpp b/src/bindings/scripts/scripts/northrend/vault_of_archavon/instance_vault_of_archavon.cpp new file mode 100644 index 00000000000..45d0a4be7ae --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/vault_of_archavon/instance_vault_of_archavon.cpp @@ -0,0 +1,124 @@ +#include "precompiled.h" +#include "def_vault_of_archavon.h" + +#define ENCOUNTERS 2 + +/* Vault of Archavon encounters: +1 - Archavon the Stone Watcher event +2 - Emalon the Storm Watcher event +*/ + +struct TRINITY_DLL_DECL instance_archavon : public ScriptedInstance +{ + instance_archavon(Map *Map) : ScriptedInstance(Map) {Initialize();}; + + uint32 Encounters[ENCOUNTERS]; + + uint64 Archavon; + uint64 Emalon; + + void Initialize() + { + Archavon = 0; + Emalon = 0; + + for(uint8 i = 0; i < ENCOUNTERS; i++) + Encounters[i] = NOT_STARTED; + } + + bool IsEncounterInProgress() const + { + for(uint8 i = 0; i < ENCOUNTERS; i++) + if(Encounters[i] == IN_PROGRESS) return true; + + return false; + } + + void OnCreatureCreate(Creature *creature, bool add) + { + switch(creature->GetEntry()) + { + case 31125: Archavon = creature->GetGUID(); break; + case 33993: Emalon = creature->GetGUID(); break; + } + } + + uint32 GetData(uint32 type) + { + switch(type) + { + case DATA_ARCHAVON_EVENT: return Encounters[0]; + case DATA_EMALON_EVENT: return Encounters[1]; + } + return 0; + } + + uint64 GetData64(uint32 identifier) + { + switch(identifier) + { + case DATA_ARCHAVON: return Archavon; + case DATA_EMALON: return Emalon; + } + return 0; + } + + void SetData(uint32 type, uint32 data) + { + switch(type) + { + case DATA_ARCHAVON_EVENT: Encounters[0] = data; break; + case DATA_EMALON_EVENT: Encounters[1] = data; break; + } + + if(data == DONE) + SaveToDB(); + } + + std::string GetSaveData() + { + OUT_SAVE_INST_DATA; + std::ostringstream stream; + stream << Encounters[0] << " " << Encounters[1]; + char* out = new char[stream.str().length() + 1]; + strcpy(out, stream.str().c_str()); + if(out) + { + OUT_SAVE_INST_DATA_COMPLETE; + return out; + } + + return NULL; + } + + void Load(const char* in) + { + if(!in) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(in); + std::istringstream stream(in); + stream >> Encounters[0] >> Encounters[1]; + for(uint8 i = 0; i < ENCOUNTERS; ++i) + if(Encounters[i] == IN_PROGRESS) + Encounters[i] = NOT_STARTED; + OUT_LOAD_INST_DATA_COMPLETE; + } +}; + +InstanceData* GetInstanceData_instance_archavon(Map* map) +{ + return new instance_archavon(map); +} + +void AddSC_instance_archavon() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_archavon"; + newscript->GetInstanceData = &GetInstanceData_instance_archavon; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/violet_hold/boss_cyanigosa.cpp b/src/bindings/scripts/scripts/northrend/violet_hold/boss_cyanigosa.cpp new file mode 100644 index 00000000000..13ad8c27a75 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/violet_hold/boss_cyanigosa.cpp @@ -0,0 +1,82 @@ +/* Script Data Start +SDName: Boss cyanigosa +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = '' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_ARCANE_VACUM 58694 +#define SPELL_BLIZZARD 58693 +#define SPELL_MANA_DESTRUCTION 59374 +#define SPELL_TAIL_SWEEP 58690 +#define SPELL_UNCONTROLLABLE_ENERGY 58688 + +//Yells +#define SAY_AGGRO -1608000 +#define SAY_SLAY_1 -1608001 +#define SAY_SLAY_2 -1608002 +#define SAY_SLAY_3 -1608003 +#define SAY_DEATH -1608004 +#define SAY_SPAWN -1608005 +#define SAY_DISRUPTION -1608006 +#define SAY_BREATH_ATTACK -1608007 +#define SAY_SPECIAL_ATTACK_1 -1608008 +#define SAY_SPECIAL_ATTACK_2 -1608009 + +struct TRINITY_DLL_DECL boss_cyanigosaAI : public ScriptedAI +{ + boss_cyanigosaAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature);break; + case 1: DoScriptText(SAY_SLAY_2, m_creature);break; + case 2: DoScriptText(SAY_SLAY_3, m_creature);break; + } + } +}; + +CreatureAI* GetAI_boss_cyanigosa(Creature* pCreature) +{ + return new boss_cyanigosaAI (pCreature); +} + +void AddSC_boss_cyanigosa() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_cyanigosa"; + newscript->GetAI = &GetAI_boss_cyanigosa; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/violet_hold/boss_erekem.cpp b/src/bindings/scripts/scripts/northrend/violet_hold/boss_erekem.cpp new file mode 100644 index 00000000000..d5f18ac806f --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/violet_hold/boss_erekem.cpp @@ -0,0 +1,82 @@ +/* Script Data Start +SDName: Boss erekem +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = '' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_BLOODLUST 54516 +#define SPELL_BREAK_BONDS 59463 +#define SPELL_CHAIN_HEAL 54481 +#define SPELL_EARTH_SHIELD 54479 +#define SPELL_EARTH_SHOCK 54511 +#define SPELL_LIGHTNING_BOLT 53044 +#define SPELL_STORMSTRIKE 51876 + +//Yells +#define SAY_AGGRO -1608010 +#define SAY_SLAY_1 -1608011 +#define SAY_SLAY_2 -1608012 +#define SAY_SLAY_3 -1608013 +#define SAY_DEATH -1608014 +#define SAY_SPAWN -1608015 +#define SAY_ADD_KILED -1608016 +#define SAY_BOTH_ADDS_KILED -1608017 + +struct TRINITY_DLL_DECL boss_erekemAI : public ScriptedAI +{ + boss_erekemAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature);break; + case 1: DoScriptText(SAY_SLAY_2, m_creature);break; + case 2: DoScriptText(SAY_SLAY_3, m_creature);break; + } + } +}; + +CreatureAI* GetAI_boss_erekem(Creature* pCreature) +{ + return new boss_erekemAI (pCreature); +} + +void AddSC_boss_erekem() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_erekem"; + newscript->GetAI = &GetAI_boss_erekem; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/violet_hold/boss_ichoron.cpp b/src/bindings/scripts/scripts/northrend/violet_hold/boss_ichoron.cpp new file mode 100644 index 00000000000..60b1c656808 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/violet_hold/boss_ichoron.cpp @@ -0,0 +1,81 @@ +/* Script Data Start +SDName: Boss ichoron +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = '' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_DRAINED 59820 +#define SPELL_FRENZY 54312 +#define SPELL_PROTECTIVE_BUBBLE 54306 +#define SPELL_WATER_BLAST 54237 +#define SPELL_WATER_BOLT_VOLLEY 54241 + +//Yells +#define SAY_AGGRO -1608018 +#define SAY_SLAY_1 -1608019 +#define SAY_SLAY_2 -1608020 +#define SAY_SLAY_3 -1608021 +#define SAY_DEATH -1608022 +#define SAY_SPAWN -1608023 +#define SAY_ENRAGE -1608024 +#define SAY_SHATTER -1608025 +#define SAY_BUBBLE -1608026 + +struct TRINITY_DLL_DECL boss_ichoronAI : public ScriptedAI +{ + boss_ichoronAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature);break; + case 1: DoScriptText(SAY_SLAY_2, m_creature);break; + case 2: DoScriptText(SAY_SLAY_3, m_creature);break; + } + } +}; + +CreatureAI* GetAI_boss_ichoron(Creature* pCreature) +{ + return new boss_ichoronAI (pCreature); +} + +void AddSC_boss_ichoron() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_ichoron"; + newscript->GetAI = &GetAI_boss_ichoron; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/violet_hold/boss_lavanthor.cpp b/src/bindings/scripts/scripts/northrend/violet_hold/boss_lavanthor.cpp new file mode 100644 index 00000000000..430a8acb178 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/violet_hold/boss_lavanthor.cpp @@ -0,0 +1,52 @@ +/* Script Data Start +SDName: Boss lavanthor +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = '' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_CAUTERIZING_FLAMES 59466 +#define SPELL_FIREBOLT 54235 +#define SPELL_FLAME_BREATH 54282 +#define SPELL_LAVA_BURN 54249 + +struct TRINITY_DLL_DECL boss_lavanthorAI : public ScriptedAI +{ + boss_lavanthorAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) {} + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) {} +}; + +CreatureAI* GetAI_boss_lavanthor(Creature* pCreature) +{ + return new boss_lavanthorAI (pCreature); +} + +void AddSC_boss_lavanthor() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_lavanthor"; + newscript->GetAI = &GetAI_boss_lavanthor; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/violet_hold/boss_moragg.cpp b/src/bindings/scripts/scripts/northrend/violet_hold/boss_moragg.cpp new file mode 100644 index 00000000000..fdc18a3c549 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/violet_hold/boss_moragg.cpp @@ -0,0 +1,50 @@ +/* Script Data Start +SDName: Boss moragg +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = '' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_CORROSICE_SALIVA 54527 +#define SPELL_OPTIC_LINK 54396 + +struct TRINITY_DLL_DECL boss_moraggAI : public ScriptedAI +{ + boss_moraggAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) {} + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) {} +}; + +CreatureAI* GetAI_boss_moragg(Creature* pCreature) +{ + return new boss_moraggAI (pCreature); +} + +void AddSC_boss_moragg() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_moragg"; + newscript->GetAI = &GetAI_boss_moragg; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/violet_hold/boss_xevozz.cpp b/src/bindings/scripts/scripts/northrend/violet_hold/boss_xevozz.cpp new file mode 100644 index 00000000000..b59c4aec4e1 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/violet_hold/boss_xevozz.cpp @@ -0,0 +1,82 @@ +/* Script Data Start +SDName: Boss xevozz +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = '' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_ARCANE_BARRAGE_VOLLEY 54202 +#define SPELL_ARCANE_BUFFET 54226 +#define SPELL_SUMMON_ETHEREAL_SPHERE_1 54102 +#define SPELL_SUMMON_ETHEREAL_SPHERE_2 54137 +#define SPELL_SUMMON_ETHEREAL_SPHERE_3 54138 + +//Yells +#define SAY_AGGRO -1608027 +#define SAY_SLAY_1 -1608028 +#define SAY_SLAY_2 -1608029 +#define SAY_SLAY_3 -1608030 +#define SAY_DEATH -1608031 +#define SAY_SPAWN -1608032 +#define SAY_CHARGED -1608033 +#define SAY_REPEAT_SUMMON_1 -1608034 +#define SAY_REPEAT_SUMMON_2 -1608035 +#define SAY_SUMMON_ENERGY -1608036 + +struct TRINITY_DLL_DECL boss_xevozzAI : public ScriptedAI +{ + boss_xevozzAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature);break; + case 1: DoScriptText(SAY_SLAY_2, m_creature);break; + case 2: DoScriptText(SAY_SLAY_3, m_creature);break; + } + } +}; + +CreatureAI* GetAI_boss_xevozz(Creature* pCreature) +{ + return new boss_xevozzAI (pCreature); +} + +void AddSC_boss_xevozz() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_xevozz"; + newscript->GetAI = &GetAI_boss_xevozz; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/violet_hold/boss_zuramat.cpp b/src/bindings/scripts/scripts/northrend/violet_hold/boss_zuramat.cpp new file mode 100644 index 00000000000..218b5915bec --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/violet_hold/boss_zuramat.cpp @@ -0,0 +1,82 @@ +/* Script Data Start +SDName: Boss zuramat +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = '' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_SHROUD_OF_DARKNESS 54524 +#define SPELL_SUMMON_VOID_SENTRY 54524 +#define SPELL_VOID_SHIFT 54524 + +#define NPC_VOID_SENTRY 29364 + +//Yells +#define SAY_AGGRO -1608037 +#define SAY_SLAY_1 -1608038 +#define SAY_SLAY_2 -1608039 +#define SAY_SLAY_3 -1608040 +#define SAY_DEATH -1608041 +#define SAY_SPAWN -1608042 +#define SAY_SHIELD -1608043 +#define SAY_WHISPER -1608044 + +struct TRINITY_DLL_DECL boss_zuramatAI : public ScriptedAI +{ + boss_zuramatAI(Creature *c) : ScriptedAI(c) {} + + uint32 void_shift; + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature);break; + case 1: DoScriptText(SAY_SLAY_2, m_creature);break; + case 2: DoScriptText(SAY_SLAY_3, m_creature);break; + } + } +}; + +CreatureAI* GetAI_boss_zuramat(Creature* pCreature) +{ + return new boss_zuramatAI (pCreature); +} + +void AddSC_boss_zuramat() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_zuramat"; + newscript->GetAI = &GetAI_boss_zuramat; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/violet_hold/def_violet_hold.h b/src/bindings/scripts/scripts/northrend/violet_hold/def_violet_hold.h new file mode 100644 index 00000000000..71bc0d18d2f --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/violet_hold/def_violet_hold.h @@ -0,0 +1,4 @@ +#ifndef DEF_VIOLET_HOLD_H +#define DEF_VIOLET_HOLD_H + +#endif diff --git a/src/bindings/scripts/scripts/northrend/violet_hold/instance_violet_hold.cpp b/src/bindings/scripts/scripts/northrend/violet_hold/instance_violet_hold.cpp new file mode 100644 index 00000000000..98962b919e0 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/violet_hold/instance_violet_hold.cpp @@ -0,0 +1,21 @@ +#include "precompiled.h" +#include "def_violet_hold.h" + +struct TRINITY_DLL_DECL instance_violet_hold : public ScriptedInstance +{ + instance_violet_hold(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; +}; + +InstanceData* GetInstanceData_instance_violet_hold(Map* pMap) +{ + return new instance_violet_hold(pMap); +} + +void AddSC_instance_violet_hold() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_violet_hold"; + newscript->GetInstanceData = &GetInstanceData_instance_violet_hold; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/wintergrasp.cpp b/src/bindings/scripts/scripts/northrend/wintergrasp.cpp new file mode 100644 index 00000000000..275043d91e5 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/wintergrasp.cpp @@ -0,0 +1,60 @@ +/* Copyright (C) 2008 - 2009 Trinity + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "precompiled.h" +#include "Wintergrasp.h" + +bool GossipHello_npc_demolisher_engineerer(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->HasAura(SPELL_CORPORAL)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Build catapult.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + else if (pPlayer->HasAura(SPELL_LIEUTENANT)) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Build catapult.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Build demolisher.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Build siege engine.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + } + + pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_demolisher_engineerer(Player* pPlayer, Creature* me, uint32 uiSender, uint32 uiAction) +{ + pPlayer->CLOSE_GOSSIP_MENU(); + switch(uiAction - GOSSIP_ACTION_INFO_DEF) + { + case 0: pPlayer->CastSpell(pPlayer, 56663, false, NULL, NULL, me->GetGUID()); break; + case 1: pPlayer->CastSpell(pPlayer, 56575, false, NULL, NULL, me->GetGUID()); break; + case 2: pPlayer->CastSpell(pPlayer, pPlayer->GetTeamId() ? 61408 : 56661, false, NULL, NULL, me->GetGUID()); break; + } + + return true; +} + +void AddSC_wintergrasp() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "npc_demolisher_engineerer"; + newscript->pGossipHello = &GossipHello_npc_demolisher_engineerer; + newscript->pGossipSelect = &GossipSelect_npc_demolisher_engineerer; + newscript->RegisterSelf(); +} \ No newline at end of file diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/auchenai_crypts/boss_exarch_maladaar.cpp b/src/bindings/scripts/scripts/outland/aunchindoun/auchenai_crypts/boss_exarch_maladaar.cpp new file mode 100644 index 00000000000..414804a6576 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/aunchindoun/auchenai_crypts/boss_exarch_maladaar.cpp @@ -0,0 +1,358 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Exarch_Maladaar +SD%Complete: 95 +SDComment: Most of event implemented, some adjustments to timers remain and possibly make some better code for switching his dark side in to better "images" of player. +SDCategory: Auchindoun, Auchenai Crypts +EndScriptData */ + +/* ContentData +mob_stolen_soul +boss_exarch_maladaar +mob_avatar_of_martyred +EndContentData */ + +#include "precompiled.h" + +#define SPELL_MOONFIRE 37328 +#define SPELL_FIREBALL 37329 +#define SPELL_MIND_FLAY 37330 +#define SPELL_HEMORRHAGE 37331 +#define SPELL_FROSTSHOCK 37332 +#define SPELL_CURSE_OF_AGONY 37334 +#define SPELL_MORTAL_STRIKE 37335 +#define SPELL_FREEZING_TRAP 37368 +#define SPELL_HAMMER_OF_JUSTICE 37369 + +struct TRINITY_DLL_DECL mob_stolen_soulAI : public ScriptedAI +{ + mob_stolen_soulAI(Creature *c) : ScriptedAI(c) {} + + uint8 myClass; + uint32 Class_Timer; + + void Reset() + { + Class_Timer = 1000; + } + + void EnterCombat(Unit *who) + { } + + void SetMyClass(uint8 myclass) + { + myClass = myclass; + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (Class_Timer < diff) + { + switch (myClass) + { + case CLASS_WARRIOR: + DoCast(m_creature->getVictim(), SPELL_MORTAL_STRIKE); + Class_Timer = 6000; + break; + case CLASS_PALADIN: + DoCast(m_creature->getVictim(), SPELL_HAMMER_OF_JUSTICE); + Class_Timer = 6000; + break; + case CLASS_HUNTER: + DoCast(m_creature->getVictim(), SPELL_FREEZING_TRAP); + Class_Timer = 20000; + break; + case CLASS_ROGUE: + DoCast(m_creature->getVictim(), SPELL_HEMORRHAGE); + Class_Timer = 10000; + break; + case CLASS_PRIEST: + DoCast(m_creature->getVictim(), SPELL_MIND_FLAY); + Class_Timer = 5000; + break; + case CLASS_SHAMAN: + DoCast(m_creature->getVictim(), SPELL_FROSTSHOCK); + Class_Timer = 8000; + break; + case CLASS_MAGE: + DoCast(m_creature->getVictim(), SPELL_FIREBALL); + Class_Timer = 5000; + break; + case CLASS_WARLOCK: + DoCast(m_creature->getVictim(), SPELL_CURSE_OF_AGONY); + Class_Timer = 20000; + break; + case CLASS_DRUID: + DoCast(m_creature->getVictim(), SPELL_MOONFIRE); + Class_Timer = 10000; + break; + } + } else Class_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_stolen_soul(Creature* pCreature) +{ + return new mob_stolen_soulAI (pCreature); +} + +#define SAY_INTRO -1558000 +#define SAY_SUMMON -1558001 + +#define SAY_AGGRO_1 -1558002 +#define SAY_AGGRO_2 -1558003 +#define SAY_AGGRO_3 -1558004 + +#define SAY_ROAR -1558005 +#define SAY_SOUL_CLEAVE -1558006 + +#define SAY_SLAY_1 -1558007 +#define SAY_SLAY_2 -1558008 + +#define SAY_DEATH -1558009 + +#define SPELL_RIBBON_OF_SOULS 32422 +#define SPELL_SOUL_SCREAM 32421 + +#define SPELL_STOLEN_SOUL 32346 +#define SPELL_STOLEN_SOUL_VISUAL 32395 + +#define SPELL_SUMMON_AVATAR 32424 + +#define ENTRY_STOLEN_SOUL 18441 + +struct TRINITY_DLL_DECL boss_exarch_maladaarAI : public ScriptedAI +{ + boss_exarch_maladaarAI(Creature *c) : ScriptedAI(c) + { + HasTaunted = false; + } + + uint32 soulmodel; + uint64 soulholder; + uint8 soulclass; + + uint32 Fear_timer; + uint32 Ribbon_of_Souls_timer; + uint32 StolenSoul_Timer; + + bool HasTaunted; + bool Avatar_summoned; + + void Reset() + { + soulmodel = 0; + soulholder = 0; + soulclass = 0; + + Fear_timer = 15000 + rand()% 5000; + Ribbon_of_Souls_timer = 5000; + StolenSoul_Timer = 25000 + rand()% 10000; + + Avatar_summoned = false; + } + + void MoveInLineOfSight(Unit *who) + { + if (!HasTaunted && m_creature->IsWithinDistInMap(who, 150.0)) + { + DoScriptText(SAY_INTRO, m_creature); + HasTaunted = true; + } + + ScriptedAI::MoveInLineOfSight(who); + } + + + void EnterCombat(Unit *who) + { + switch (rand()%3) + { + case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; + } + } + + void JustSummoned(Creature *summoned) + { + if (summoned->GetEntry() == ENTRY_STOLEN_SOUL) + { + //SPELL_STOLEN_SOUL_VISUAL has shapeshift effect, but not implemented feature in Trinity for this spell. + summoned->CastSpell(summoned,SPELL_STOLEN_SOUL_VISUAL,false); + summoned->SetDisplayId(soulmodel); + summoned->setFaction(m_creature->getFaction()); + + if (Unit *target = Unit::GetUnit(*m_creature,soulholder)) + { + + CAST_AI(mob_stolen_soulAI, summoned->AI())->SetMyClass(soulclass); + summoned->AI()->AttackStart(target); + } + } + } + + void KilledUnit(Unit* victim) + { + if (rand()%2) + return; + + switch (rand()%2) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature); break; + case 1: DoScriptText(SAY_SLAY_2, m_creature); break; + } + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEATH, m_creature); + //When Exarch Maladar is defeated D'ore appear. + m_creature->SummonCreature(19412, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 600000); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (!Avatar_summoned && ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 25)) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(true); + + DoScriptText(SAY_SUMMON, m_creature); + + DoCast(m_creature, SPELL_SUMMON_AVATAR); + Avatar_summoned = true; + StolenSoul_Timer = 15000 + rand()% 15000; + } + + if (StolenSoul_Timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + { + if (target->GetTypeId() == TYPEID_PLAYER) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(true); + + uint32 i = urand(1,2); + if (i == 1) + DoScriptText(SAY_ROAR, m_creature); + else + DoScriptText(SAY_SOUL_CLEAVE, m_creature); + + soulmodel = target->GetDisplayId(); + soulholder = target->GetGUID(); + soulclass = target->getClass(); + + DoCast(target,SPELL_STOLEN_SOUL); + m_creature->SummonCreature(ENTRY_STOLEN_SOUL, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000); + + StolenSoul_Timer = 20000 + rand()% 10000; + } else StolenSoul_Timer = 1000; + } + }else StolenSoul_Timer -= diff; + + if (Ribbon_of_Souls_timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_RIBBON_OF_SOULS); + + Ribbon_of_Souls_timer = 5000 + (rand()%20 * 1000); + }else Ribbon_of_Souls_timer -= diff; + + if (Fear_timer < diff) + { + DoCast(m_creature,SPELL_SOUL_SCREAM); + Fear_timer = 15000 + rand()% 15000; + }else Fear_timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_exarch_maladaar(Creature* pCreature) +{ + return new boss_exarch_maladaarAI (pCreature); +} + +#define SPELL_AV_MORTAL_STRIKE 16856 +#define SPELL_AV_SUNDER_ARMOR 16145 + +struct TRINITY_DLL_DECL mob_avatar_of_martyredAI : public ScriptedAI +{ + mob_avatar_of_martyredAI(Creature *c) : ScriptedAI(c) {} + + uint32 Mortal_Strike_timer; + + void Reset() + { + Mortal_Strike_timer = 10000; + } + + void EnterCombat(Unit *who) + { + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (Mortal_Strike_timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_AV_MORTAL_STRIKE); + Mortal_Strike_timer = 10000 + rand()%20 * 1000; + } else Mortal_Strike_timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_avatar_of_martyred(Creature* pCreature) +{ + return new mob_avatar_of_martyredAI (pCreature); +} + +void AddSC_boss_exarch_maladaar() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_exarch_maladaar"; + newscript->GetAI = &GetAI_boss_exarch_maladaar; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_avatar_of_martyred"; + newscript->GetAI = &GetAI_mob_avatar_of_martyred; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_stolen_soul"; + newscript->GetAI = &GetAI_mob_stolen_soul; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp b/src/bindings/scripts/scripts/outland/aunchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp new file mode 100644 index 00000000000..4dfdd407731 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/aunchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp @@ -0,0 +1,212 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +Name: Boss_Shirrak_the_dead_watcher +%Complete: 80 +Comment: InhibitMagic should stack slower far from the boss, proper Visual for Focus Fire, heroic implemented +Category: Auchindoun, Auchenai Crypts +EndScriptData */ + +#include "precompiled.h" + +#define SPELL_INHIBITMAGIC 32264 +#define SPELL_ATTRACTMAGIC 32265 +#define N_SPELL_CARNIVOROUSBITE 36383 +#define H_SPELL_CARNIVOROUSBITE 39382 +#define SPELL_CARNIVOROUSBITE (HeroicMode?H_SPELL_CARNIVOROUSBITE:N_SPELL_CARNIVOROUSBITE) + +#define ENTRY_FOCUS_FIRE 18374 + +#define N_SPELL_FIERY_BLAST 32302 +#define H_SPELL_FIERY_BLAST 38382 +#define SPELL_FIERY_BLAST (HeroicMode?H_SPELL_FIERY_BLAST:N_SPELL_FIERY_BLAST) +#define SPELL_FOCUS_FIRE_VISUAL 42075 //need to find better visual + +struct TRINITY_DLL_DECL boss_shirrak_the_dead_watcherAI : public ScriptedAI +{ + boss_shirrak_the_dead_watcherAI(Creature *c) : ScriptedAI(c) + { + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + uint32 Inhibitmagic_Timer; + uint32 Attractmagic_Timer; + uint32 Carnivorousbite_Timer; + uint32 FocusFire_Timer; + bool HeroicMode; + Unit *focusedTarget; + + void Reset() + { + Inhibitmagic_Timer = 0; + Attractmagic_Timer = 28000; + Carnivorousbite_Timer = 10000; + FocusFire_Timer = 17000; + focusedTarget = NULL; + } + + void EnterCombat(Unit *who) + { } + + void JustSummoned(Creature *summoned) + { + if (summoned && summoned->GetEntry() == ENTRY_FOCUS_FIRE) + { + summoned->CastSpell(summoned,SPELL_FOCUS_FIRE_VISUAL,false); + summoned->setFaction(m_creature->getFaction()); + summoned->SetLevel(m_creature->getLevel()); + summoned->addUnitState(UNIT_STAT_ROOT); + + if (focusedTarget) + summoned->AI()->AttackStart(focusedTarget); + } + } + + void UpdateAI(const uint32 diff) + { + //Inhibitmagic_Timer + if (Inhibitmagic_Timer < diff) + { + float dist; + Map* pMap = m_creature->GetMap(); + Map::PlayerList const &PlayerList = pMap->GetPlayers(); + for(Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) + if (Player* i_pl = i->getSource()) + if (i_pl->isAlive() && (dist = i_pl->IsWithinDist(m_creature, 45))) + { + i_pl->RemoveAurasDueToSpell(SPELL_INHIBITMAGIC); + m_creature->AddAura(SPELL_INHIBITMAGIC, i_pl); + if (dist < 35) + m_creature->AddAura(SPELL_INHIBITMAGIC, i_pl); + if (dist < 25) + m_creature->AddAura(SPELL_INHIBITMAGIC, i_pl); + if (dist < 15) + m_creature->AddAura(SPELL_INHIBITMAGIC, i_pl); + } + Inhibitmagic_Timer = 3000+(rand()%1000); + }else Inhibitmagic_Timer -= diff; + + //Return since we have no target + if (!UpdateVictim()) + return; + + //Attractmagic_Timer + if (Attractmagic_Timer < diff) + { + DoCast(m_creature,SPELL_ATTRACTMAGIC); + Attractmagic_Timer = 30000; + Carnivorousbite_Timer = 1500; + }else Attractmagic_Timer -= diff; + + //Carnivorousbite_Timer + if (Carnivorousbite_Timer < diff) + { + DoCast(m_creature,SPELL_CARNIVOROUSBITE); + Carnivorousbite_Timer = 10000; + }else Carnivorousbite_Timer -= diff; + + //FocusFire_Timer + if (FocusFire_Timer < diff) + { + // Summon Focus Fire & Emote + Unit *target = SelectUnit(SELECT_TARGET_RANDOM,1); + if (target && target->GetTypeId() == TYPEID_PLAYER && target->isAlive()) + { + focusedTarget = target; + m_creature->SummonCreature(ENTRY_FOCUS_FIRE,target->GetPositionX(),target->GetPositionY(),target->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN,5500); + + // TODO: Find better way to handle emote + // Emote + std::string *emote = new std::string("focuses on "); + emote->append(target->GetName()); + emote->append("!"); + const char* text = emote->c_str(); + m_creature->MonsterTextEmote(text, 0, true); + delete emote; + } + FocusFire_Timer = 15000+(rand()%5000); + }else FocusFire_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_shirrak_the_dead_watcher(Creature* pCreature) +{ + return new boss_shirrak_the_dead_watcherAI (pCreature); +} + +struct TRINITY_DLL_DECL mob_focus_fireAI : public ScriptedAI +{ + mob_focus_fireAI(Creature *c) : ScriptedAI(c) + { + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + bool HeroicMode; + uint32 FieryBlast_Timer; + bool fiery1, fiery2; + + void Reset() + { + FieryBlast_Timer = 3000+(rand()%1000); + fiery1 = fiery2 = true; + } + + void EnterCombat(Unit *who) + { } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + //FieryBlast_Timer + if (fiery2 && FieryBlast_Timer < diff) + { + DoCast(m_creature,SPELL_FIERY_BLAST); + + if (fiery1) fiery1 = false; + else if (fiery2) fiery2 = false; + + FieryBlast_Timer = 1000; + }else FieryBlast_Timer -= diff; + + //DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_focus_fire(Creature* pCreature) +{ + return new mob_focus_fireAI (pCreature); +} + +void AddSC_boss_shirrak_the_dead_watcher() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_shirrak_the_dead_watcher"; + newscript->GetAI = &GetAI_boss_shirrak_the_dead_watcher; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_focus_fire"; + newscript->GetAI = &GetAI_mob_focus_fire; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp b/src/bindings/scripts/scripts/outland/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp new file mode 100644 index 00000000000..dcaaefee8c2 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp @@ -0,0 +1,369 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_NexusPrince_Shaffar +SD%Complete: 80 +SDComment: Need more tuning of spell timers, it should not be as linear fight as current. Also should possibly find a better way to deal with his three initial beacons to make sure all aggro. +SDCategory: Auchindoun, Mana Tombs +EndScriptData */ + +/* ContentData +boss_nexusprince_shaffar +mob_ethereal_beacon +EndContentData */ + +#include "precompiled.h" + +enum +{ + SAY_INTRO = -1557000, + SAY_AGGRO_1 = -1557001, + SAY_AGGRO_2 = -1557002, + SAY_AGGRO_3 = -1557003, + SAY_SLAY_1 = -1557004, + SAY_SLAY_2 = -1557005, + SAY_SUMMON = -1557006, + SAY_DEAD = -1557007, + + SPELL_BLINK = 34605, + SPELL_FROSTBOLT = 32364, + SPELL_FIREBALL = 32363, + SPELL_FROSTNOVA = 32365, + + SPELL_ETHEREAL_BEACON = 32371, // Summons NPC_BEACON + SPELL_ETHEREAL_BEACON_VISUAL = 32368, + + NPC_BEACON = 18431, + NPC_SHAFFAR = 18344, + + NR_INITIAL_BEACONS = 3 +}; + +struct TRINITY_DLL_DECL boss_nexusprince_shaffarAI : public ScriptedAI +{ + boss_nexusprince_shaffarAI(Creature *c) : ScriptedAI(c), summons(me) { HasTaunted = false; } + + uint32 Blink_Timer; + uint32 Beacon_Timer; + uint32 FireBall_Timer; + uint32 Frostbolt_Timer; + uint32 FrostNova_Timer; + + SummonList summons; + + bool HasTaunted; + bool CanBlink; + + void Reset() + { + Blink_Timer = 1500; + Beacon_Timer = 10000; + FireBall_Timer = 8000; + Frostbolt_Timer = 4000; + FrostNova_Timer = 15000; + + CanBlink = false; + + float dist = 8.0f; + float posX, posY, posZ, angle; + m_creature->GetHomePosition(posX, posY, posZ, angle); + + m_creature->SummonCreature(NPC_BEACON, posX - dist, posY - dist, posZ, angle, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 7200000); + m_creature->SummonCreature(NPC_BEACON, posX - dist, posY + dist, posZ, angle, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 7200000); + m_creature->SummonCreature(NPC_BEACON, posX + dist, posY, posZ, angle, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 7200000); + } + + void EnterEvadeMode() + { + summons.DespawnAll(); + ScriptedAI::EnterEvadeMode(); + } + + void MoveInLineOfSight(Unit *who) + { + if (!HasTaunted && who->GetTypeId() == TYPEID_PLAYER && m_creature->IsWithinDistInMap(who, 100.0f)) + { + DoScriptText(SAY_INTRO, m_creature); + HasTaunted = true; + } + } + + void EnterCombat(Unit *who) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; + } + + DoZoneInCombat(); + summons.DoZoneInCombat(); + } + + void JustSummoned(Creature *summoned) + { + if (summoned->GetEntry() == NPC_BEACON) + { + summoned->CastSpell(summoned,SPELL_ETHEREAL_BEACON_VISUAL,false); + + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + summoned->AI()->AttackStart(target); + } + + summons.Summon(summoned); + } + + void SummonedCreatureDespawn(Creature *summon) + { + summons.Despawn(summon); + } + + void KilledUnit(Unit* victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature); break; + case 1: DoScriptText(SAY_SLAY_2, m_creature); break; + } + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEAD, m_creature); + summons.DespawnAll(); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (FrostNova_Timer < diff) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(true); + + DoCast(m_creature,SPELL_FROSTNOVA); + FrostNova_Timer = 17500 + rand()%7500; + CanBlink = true; + }else FrostNova_Timer -= diff; + + if (Frostbolt_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_FROSTBOLT); + Frostbolt_Timer = 4500 + rand()%1500; + }else Frostbolt_Timer -= diff; + + if (FireBall_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_FIREBALL); + FireBall_Timer = 4500 + rand()%1500; + }else FireBall_Timer -= diff; + + if (CanBlink) + { + if (Blink_Timer < diff) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(true); + + //expire movement, will prevent from running right back to victim after cast + //(but should MoveChase be used again at a certain time or should he not move?) + if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE) + m_creature->GetMotionMaster()->MovementExpired(); + + DoCast(m_creature,SPELL_BLINK); + Blink_Timer = 1000 + rand()%1500; + CanBlink = false; + }else Blink_Timer -= diff; + } + + if (Beacon_Timer < diff) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(true); + + if (!urand(0,3)) + DoScriptText(SAY_SUMMON, m_creature); + + DoCast(m_creature,SPELL_ETHEREAL_BEACON, true); + + Beacon_Timer = 10000; + }else Beacon_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_nexusprince_shaffar(Creature* pCreature) +{ + return new boss_nexusprince_shaffarAI (pCreature); +} + +enum +{ + SPELL_ARCANE_BOLT = 15254, + SPELL_ETHEREAL_APPRENTICE = 32372 // Summon 18430 +}; + +struct TRINITY_DLL_DECL mob_ethereal_beaconAI : public ScriptedAI +{ + mob_ethereal_beaconAI(Creature *c) : ScriptedAI(c) + { + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + bool HeroicMode; + uint32 Apprentice_Timer; + uint32 ArcaneBolt_Timer; + uint32 Check_Timer; + + void KillSelf() + { + m_creature->Kill(m_creature); + } + + void Reset() + { + Apprentice_Timer = (HeroicMode ? 10000 : 20000); + ArcaneBolt_Timer = 1000; + Check_Timer = 1000; + } + + void EnterCombat(Unit *who) + { + // Send Shaffar to fight + Creature* Shaffar = me->FindNearestCreature(NPC_SHAFFAR, 100); + if (!Shaffar || Shaffar->isDead()) + { + KillSelf(); + return; + } + if (!Shaffar->isInCombat()) + Shaffar->AI()->AttackStart(who); + } + + void JustSummoned(Creature *summoned) + { + summoned->AI()->AttackStart(m_creature->getVictim()); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (Check_Timer < diff) + { + Creature *Shaffar = me->FindNearestCreature(NPC_SHAFFAR, 100); + if (!Shaffar || Shaffar->isDead() || !Shaffar->isInCombat()) + { + KillSelf(); + return; + } + Check_Timer = 1000; + }else Check_Timer -= diff; + + if (ArcaneBolt_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_ARCANE_BOLT); + ArcaneBolt_Timer = 2000 + rand()%2500; + }else ArcaneBolt_Timer -= diff; + + if (Apprentice_Timer < diff) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(true); + + m_creature->CastSpell(m_creature,SPELL_ETHEREAL_APPRENTICE,true); + m_creature->ForcedDespawn(); + return; + }else Apprentice_Timer -= diff; + } +}; + +CreatureAI* GetAI_mob_ethereal_beacon(Creature* pCreature) +{ + return new mob_ethereal_beaconAI (pCreature); +} + +enum +{ + SPELL_ETHEREAL_APPRENTICE_FIREBOLT = 32369, + SPELL_ETHEREAL_APPRENTICE_FROSTBOLT = 32370 +}; + +struct TRINITY_DLL_DECL mob_ethereal_apprenticeAI : public ScriptedAI +{ + mob_ethereal_apprenticeAI(Creature *c) : ScriptedAI(c) {} + + uint32 Cast_Timer; + + bool isFireboltTurn; + + void Reset() + { + Cast_Timer = 3000; + isFireboltTurn = true; + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (Cast_Timer < diff) + { + if (isFireboltTurn) + { + m_creature->CastSpell(m_creature->getVictim(), SPELL_ETHEREAL_APPRENTICE_FIREBOLT, true); + isFireboltTurn = false; + }else{ + m_creature->CastSpell(m_creature->getVictim(), SPELL_ETHEREAL_APPRENTICE_FROSTBOLT, true); + isFireboltTurn = true; + } + Cast_Timer = 3000; + }else Cast_Timer -= diff; + } +}; + +CreatureAI* GetAI_mob_ethereal_apprentice(Creature* pCreature) +{ + return new mob_ethereal_apprenticeAI (pCreature); +} + +void AddSC_boss_nexusprince_shaffar() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_nexusprince_shaffar"; + newscript->GetAI = &GetAI_boss_nexusprince_shaffar; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_ethereal_beacon"; + newscript->GetAI = &GetAI_mob_ethereal_beacon; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_ethereal_apprentice"; + newscript->GetAI = &GetAI_mob_ethereal_apprentice; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/mana_tombs/boss_pandemonius.cpp b/src/bindings/scripts/scripts/outland/aunchindoun/mana_tombs/boss_pandemonius.cpp new file mode 100644 index 00000000000..77e1c535340 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/aunchindoun/mana_tombs/boss_pandemonius.cpp @@ -0,0 +1,138 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Pandemonius +SD%Complete: 75 +SDComment: Not known how void blast is done (amount of rapid cast seems to be related to players in party). All mobs remaining in surrounding area should aggro when engaged. +SDCategory: Auchindoun, Mana Tombs +EndScriptData */ + +#include "precompiled.h" + +#define SAY_AGGRO_1 -1557008 +#define SAY_AGGRO_2 -1557009 +#define SAY_AGGRO_3 -1557010 + +#define SAY_KILL_1 -1557011 +#define SAY_KILL_2 -1557012 + +#define SAY_DEATH -1557013 + +#define EMOTE_DARK_SHELL -1557014 + +#define SPELL_VOID_BLAST 32325 +#define H_SPELL_VOID_BLAST 38760 +#define SPELL_DARK_SHELL 32358 +#define H_SPELL_DARK_SHELL 38759 + +struct TRINITY_DLL_DECL boss_pandemoniusAI : public ScriptedAI +{ + boss_pandemoniusAI(Creature *c) : ScriptedAI(c) + { + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + bool HeroicMode; + uint32 VoidBlast_Timer; + uint32 DarkShell_Timer; + uint32 VoidBlast_Counter; + + void Reset() + { + VoidBlast_Timer = 8000+rand()%15000; + DarkShell_Timer = 20000; + VoidBlast_Counter = 0; + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + + void KilledUnit(Unit* victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_KILL_1, m_creature); break; + case 1: DoScriptText(SAY_KILL_2, m_creature); break; + } + } + + void EnterCombat(Unit *who) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; + } + + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (VoidBlast_Timer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + { + DoCast(target,HeroicMode ? H_SPELL_VOID_BLAST : SPELL_VOID_BLAST); + VoidBlast_Timer = 500; + ++VoidBlast_Counter; + } + + if (VoidBlast_Counter == 5) + { + VoidBlast_Timer = 15000+rand()%10000; + VoidBlast_Counter = 0; + } + }else VoidBlast_Timer -= diff; + + if (!VoidBlast_Counter) + { + if (DarkShell_Timer < diff) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(true); + + DoScriptText(EMOTE_DARK_SHELL, m_creature); + + DoCast(m_creature,HeroicMode ? H_SPELL_DARK_SHELL : SPELL_DARK_SHELL); + DarkShell_Timer = 20000; + }else DarkShell_Timer -= diff; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_pandemonius(Creature* pCreature) +{ + return new boss_pandemoniusAI (pCreature); +} + +void AddSC_boss_pandemonius() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_pandemonius"; + newscript->GetAI = &GetAI_boss_pandemonius; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/boss_darkweaver_syth.cpp b/src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/boss_darkweaver_syth.cpp new file mode 100644 index 00000000000..00e43fa257d --- /dev/null +++ b/src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/boss_darkweaver_syth.cpp @@ -0,0 +1,438 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Darkweaver_Syth +SD%Complete: 85 +SDComment: Shock spells/times need more work. Heroic partly implemented. +SDCategory: Auchindoun, Sethekk Halls +EndScriptData */ + +#include "precompiled.h" + +#define SAY_SUMMON -1556000 + +#define SAY_AGGRO_1 -1556001 +#define SAY_AGGRO_2 -1556002 +#define SAY_AGGRO_3 -1556003 + +#define SAY_SLAY_1 -1556004 +#define SAY_SLAY_2 -1556005 + +#define SAY_DEATH -1556006 + +#define SPELL_FROST_SHOCK 21401 //37865 +#define SPELL_FLAME_SHOCK 34354 +#define SPELL_SHADOW_SHOCK 30138 +#define SPELL_ARCANE_SHOCK 37132 + +#define SPELL_CHAIN_LIGHTNING 15659 //15305 + +#define SPELL_SUMMON_SYTH_FIRE 33537 // Spawns 19203 +#define SPELL_SUMMON_SYTH_ARCANE 33538 // Spawns 19205 +#define SPELL_SUMMON_SYTH_FROST 33539 // Spawns 19204 +#define SPELL_SUMMON_SYTH_SHADOW 33540 // Spawns 19206 + +#define SPELL_FLAME_BUFFET (HeroicMode?38141:33526) +#define SPELL_ARCANE_BUFFET (HeroicMode?38138:33527) +#define SPELL_FROST_BUFFET (HeroicMode?38142:33528) +#define SPELL_SHADOW_BUFFET (HeroicMode?38143:33529) + +struct TRINITY_DLL_DECL boss_darkweaver_sythAI : public ScriptedAI +{ + boss_darkweaver_sythAI(Creature *c) : ScriptedAI(c) + + { + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + uint32 flameshock_timer; + uint32 arcaneshock_timer; + uint32 frostshock_timer; + uint32 shadowshock_timer; + uint32 chainlightning_timer; + + bool summon90; + bool summon50; + bool summon10; + bool HeroicMode; + + void Reset() + { + flameshock_timer = 2000; + arcaneshock_timer = 4000; + frostshock_timer = 6000; + shadowshock_timer = 8000; + chainlightning_timer = 15000; + + summon90 = false; + summon50 = false; + summon10 = false; + } + + void EnterCombat(Unit *who) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; + } + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + + void KilledUnit(Unit* victim) + { + if (rand()%2) + return; + + switch(rand()%2) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature); break; + case 1: DoScriptText(SAY_SLAY_2, m_creature); break; + } + } + + void JustSummoned(Creature *summoned) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + summoned->AI()->AttackStart(target); + } + + void SythSummoning() + { + DoScriptText(SAY_SUMMON, m_creature); + + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(false); + + DoCast(m_creature,SPELL_SUMMON_SYTH_ARCANE,true); //front + DoCast(m_creature,SPELL_SUMMON_SYTH_FIRE,true); //back + DoCast(m_creature,SPELL_SUMMON_SYTH_FROST,true); //left + DoCast(m_creature,SPELL_SUMMON_SYTH_SHADOW,true); //right + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 90) && !summon90) + { + SythSummoning(); + summon90 = true; + } + + if (((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 50) && !summon50) + { + SythSummoning(); + summon50 = true; + } + + if (((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 10) && !summon10) + { + SythSummoning(); + summon10 = true; + } + + if (flameshock_timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_FLAME_SHOCK); + + flameshock_timer = 10000 + rand()%5000; + } else flameshock_timer -= diff; + + if (arcaneshock_timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_ARCANE_SHOCK); + + arcaneshock_timer = 10000 + rand()%5000; + } else arcaneshock_timer -= diff; + + if (frostshock_timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_FROST_SHOCK); + + frostshock_timer = 10000 + rand()%5000; + } else frostshock_timer -= diff; + + if (shadowshock_timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_SHADOW_SHOCK); + + shadowshock_timer = 10000 + rand()%5000; + } else shadowshock_timer -= diff; + + if (chainlightning_timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_CHAIN_LIGHTNING); + + chainlightning_timer = 25000; + } else chainlightning_timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_darkweaver_syth(Creature* pCreature) +{ + return new boss_darkweaver_sythAI (pCreature); +} + +/* ELEMENTALS */ + +struct TRINITY_DLL_DECL mob_syth_fireAI : public ScriptedAI +{ + mob_syth_fireAI(Creature *c) : ScriptedAI(c) + + { + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + uint32 flameshock_timer; + uint32 flamebuffet_timer; + bool HeroicMode; + + void Reset() + { + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true); + flameshock_timer = 2500; + flamebuffet_timer = 5000; + } + + void EnterCombat(Unit *who) { } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (flameshock_timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_FLAME_SHOCK); + + flameshock_timer = 5000; + }else flameshock_timer -= diff; + + if (flamebuffet_timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_FLAME_BUFFET); + + flamebuffet_timer = 5000; + }else flamebuffet_timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_syth_fire(Creature* pCreature) +{ + return new mob_syth_fireAI (pCreature); +} + +struct TRINITY_DLL_DECL mob_syth_arcaneAI : public ScriptedAI +{ + mob_syth_arcaneAI(Creature *c) : ScriptedAI(c) + + { + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + uint32 arcaneshock_timer; + uint32 arcanebuffet_timer; + bool HeroicMode; + + void Reset() + { + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, true); + arcaneshock_timer = 2500; + arcanebuffet_timer = 5000; + } + + void EnterCombat(Unit *who) { } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (arcaneshock_timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_ARCANE_SHOCK); + + arcaneshock_timer = 5000; + }else arcaneshock_timer -= diff; + + if (arcanebuffet_timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_ARCANE_BUFFET); + + arcanebuffet_timer = 5000; + }else arcanebuffet_timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_syth_arcane(Creature* pCreature) +{ + return new mob_syth_arcaneAI (pCreature); +} + +struct TRINITY_DLL_DECL mob_syth_frostAI : public ScriptedAI +{ + mob_syth_frostAI(Creature *c) : ScriptedAI(c) + + { + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + uint32 frostshock_timer; + uint32 frostbuffet_timer; + bool HeroicMode; + + void Reset() + { + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true); + frostshock_timer = 2500; + frostbuffet_timer = 5000; + } + + void EnterCombat(Unit *who) { } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (frostshock_timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_FROST_SHOCK); + + frostshock_timer = 5000; + }else frostshock_timer -= diff; + + if (frostbuffet_timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_FROST_BUFFET); + + frostbuffet_timer = 5000; + }else frostbuffet_timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_syth_frost(Creature* pCreature) +{ + return new mob_syth_frostAI (pCreature); +} + +struct TRINITY_DLL_DECL mob_syth_shadowAI : public ScriptedAI +{ + mob_syth_shadowAI(Creature *c) : ScriptedAI(c) + + { + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + uint32 shadowshock_timer; + uint32 shadowbuffet_timer; + bool HeroicMode; + + void Reset() + { + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, true); + shadowshock_timer = 2500; + shadowbuffet_timer = 5000; + } + + void EnterCombat(Unit *who) { } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (shadowshock_timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_SHADOW_SHOCK); + + shadowshock_timer = 5000; + }else shadowshock_timer -= diff; + + if (shadowbuffet_timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_SHADOW_BUFFET); + + shadowbuffet_timer = 5000; + }else shadowbuffet_timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_syth_shadow(Creature* pCreature) +{ + return new mob_syth_shadowAI (pCreature); +} + +void AddSC_boss_darkweaver_syth() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_darkweaver_syth"; + newscript->GetAI = &GetAI_boss_darkweaver_syth; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_syth_fire"; + newscript->GetAI = &GetAI_mob_syth_arcane; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_syth_arcane"; + newscript->GetAI = &GetAI_mob_syth_arcane; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_syth_frost"; + newscript->GetAI = &GetAI_mob_syth_frost; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_syth_shadow"; + newscript->GetAI = &GetAI_mob_syth_shadow; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/boss_tailonking_ikiss.cpp b/src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/boss_tailonking_ikiss.cpp new file mode 100644 index 00000000000..7830fc10645 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/boss_tailonking_ikiss.cpp @@ -0,0 +1,221 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Talon_King_Ikiss +SD%Complete: 80 +SDComment: Heroic supported. Some details missing, but most are spell related. +SDCategory: Auchindoun, Sethekk Halls +EndScriptData */ + +#include "precompiled.h" +#include "def_sethekk_halls.h" + +#define SAY_INTRO -1556007 + +#define SAY_AGGRO_1 -1556008 +#define SAY_AGGRO_2 -1556009 +#define SAY_AGGRO_3 -1556010 + +#define SAY_SLAY_1 -1556011 +#define SAY_SLAY_2 -1556012 +#define SAY_DEATH -1556013 +#define EMOTE_ARCANE_EXP -1556015 + +#define SPELL_BLINK 38194 +#define SPELL_BLINK_TELEPORT 38203 +#define SPELL_MANA_SHIELD 38151 +#define SPELL_ARCANE_BUBBLE 9438 +#define H_SPELL_SLOW 35032 + +#define SPELL_POLYMORPH 38245 +#define H_SPELL_POLYMORPH 43309 + +#define SPELL_ARCANE_VOLLEY 35059 +#define H_SPELL_ARCANE_VOLLEY 40424 + +#define SPELL_ARCANE_EXPLOSION 38197 +#define H_SPELL_ARCANE_EXPLOSION 40425 + +struct TRINITY_DLL_DECL boss_talon_king_ikissAI : public ScriptedAI +{ + boss_talon_king_ikissAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + bool HeroicMode; + + uint32 ArcaneVolley_Timer; + uint32 Sheep_Timer; + uint32 Blink_Timer; + uint32 Slow_Timer; + + bool ManaShield; + bool Blink; + bool Intro; + + void Reset() + { + HeroicMode = m_creature->GetMap()->IsHeroic(); + + ArcaneVolley_Timer = 5000; + Sheep_Timer = 8000; + Blink_Timer = 35000; + Slow_Timer = 15000+rand()%15000; + Blink = false; + Intro = false; + ManaShield = false; + } + + void MoveInLineOfSight(Unit *who) + { + if (!m_creature->getVictim() && who->isTargetableForAttack() && (m_creature->IsHostileTo(who)) && who->isInAccessiblePlaceFor(m_creature)) + { + if (!Intro && m_creature->IsWithinDistInMap(who, 100)) + { + Intro = true; + DoScriptText(SAY_INTRO, m_creature); + } + + if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) + return; + + float attackRadius = m_creature->GetAttackDistance(who); + if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who)) + { + //who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); + AttackStart(who); + } + } + } + + void EnterCombat(Unit *who) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; + } + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEATH, m_creature); + + if (pInstance) + pInstance->SetData(DATA_IKISSDOOREVENT, DONE); + } + + void KilledUnit(Unit* victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature); break; + case 1: DoScriptText(SAY_SLAY_2, m_creature); break; + } + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (Blink) + { + DoCast(m_creature,HeroicMode ? H_SPELL_ARCANE_EXPLOSION : SPELL_ARCANE_EXPLOSION); + m_creature->CastSpell(m_creature,SPELL_ARCANE_BUBBLE,true); + Blink = false; + } + + if (ArcaneVolley_Timer < diff) + { + DoCast(m_creature,HeroicMode ? H_SPELL_ARCANE_VOLLEY : SPELL_ARCANE_VOLLEY); + ArcaneVolley_Timer = 7000+rand()%5000; + }else ArcaneVolley_Timer -= diff; + + if (Sheep_Timer < diff) + { + //second top aggro target in normal, random target in heroic correct? + Unit *target = NULL; + target = HeroicMode ? SelectUnit(SELECT_TARGET_RANDOM,0) : SelectUnit(SELECT_TARGET_TOPAGGRO,1); + if (target) + DoCast(target,HeroicMode ? H_SPELL_POLYMORPH : SPELL_POLYMORPH); + Sheep_Timer = 15000+rand()%2500; + }else Sheep_Timer -= diff; + + //may not be correct time to cast + if (!ManaShield && ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 20)) + { + DoCast(m_creature,SPELL_MANA_SHIELD); + ManaShield = true; + } + + if (HeroicMode) + { + if (Slow_Timer < diff) + { + DoCast(m_creature,H_SPELL_SLOW); + Slow_Timer = 15000+rand()%25000; + }else Slow_Timer -= diff; + } + + if (Blink_Timer < diff) + { + DoScriptText(EMOTE_ARCANE_EXP, m_creature); + + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(false); + + //Spell doesn't work, but we use for visual effect at least + DoCast(target,SPELL_BLINK); + + float X = target->GetPositionX(); + float Y = target->GetPositionY(); + float Z = target->GetPositionZ(); + + DoTeleportTo(X,Y,Z); + + DoCast(target,SPELL_BLINK_TELEPORT); + Blink = true; + } + Blink_Timer = 35000+rand()%5000; + }else Blink_Timer -= diff; + + if (!Blink) + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_talon_king_ikiss(Creature* pCreature) +{ + return new boss_talon_king_ikissAI (pCreature); +} + +void AddSC_boss_talon_king_ikiss() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_talon_king_ikiss"; + newscript->GetAI = &GetAI_boss_talon_king_ikiss; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/def_sethekk_halls.h b/src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/def_sethekk_halls.h new file mode 100644 index 00000000000..6156f354d84 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/def_sethekk_halls.h @@ -0,0 +1,14 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_SETHEKK_HALLS_H +#define DEF_SETHEKK_HALLS_H + +enum +{ + DATA_IKISSDOOREVENT = 1, + TYPE_ANZU_ENCOUNTER = 2, +}; +#endif + diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/instance_sethekk_halls.cpp b/src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/instance_sethekk_halls.cpp new file mode 100644 index 00000000000..060e09a1325 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/instance_sethekk_halls.cpp @@ -0,0 +1,91 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance - Sethekk Halls +SD%Complete: 50 +SDComment: Instance Data for Sethekk Halls instance +SDCategory: Auchindoun, Sethekk Halls +EndScriptData */ + +#include "precompiled.h" +#include "def_sethekk_halls.h" + +enum +{ + NPC_ANZU = 23035, + IKISS_DOOR = 177203, +}; + +struct TRINITY_DLL_DECL instance_sethekk_halls : public ScriptedInstance +{ + instance_sethekk_halls(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint32 AnzuEncounter; + uint64 m_uiIkissDoorGUID; + + void Initialize() + { + AnzuEncounter = NOT_STARTED; + m_uiIkissDoorGUID = 0; + } + + void OnCreatureCreate(Creature* pCreature, bool add) + { + if (pCreature->GetEntry() == NPC_ANZU && AnzuEncounter >= IN_PROGRESS) + { + pCreature->DealDamage(pCreature, pCreature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + pCreature->RemoveCorpse(); + } else { + AnzuEncounter = IN_PROGRESS; + } + } + + void OnGameObjectCreate(GameObject* pGo, bool add) + { + if (pGo->GetEntry() == IKISS_DOOR) + m_uiIkissDoorGUID = pGo->GetGUID(); + } + + void SetData(uint32 type, uint32 data) + { + switch(type) + { + case DATA_IKISSDOOREVENT: + if (data == DONE) + DoUseDoorOrButton(m_uiIkissDoorGUID,DAY*IN_MILISECONDS); + break; + case TYPE_ANZU_ENCOUNTER: + AnzuEncounter = data; + break; + } + } +}; + +InstanceData* GetInstanceData_instance_sethekk_halls(Map* pMap) +{ + return new instance_sethekk_halls(pMap); +} + +void AddSC_instance_sethekk_halls() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_sethekk_halls"; + newscript->GetInstanceData = &GetInstanceData_instance_sethekk_halls; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp b/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp new file mode 100644 index 00000000000..f9961e10174 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp @@ -0,0 +1,217 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Ambassador_Hellmaw +SD%Complete: 80 +SDComment: Enrage spell missing/not known +SDCategory: Auchindoun, Shadow Labyrinth +EndScriptData */ + +#include "precompiled.h" +#include "escortAI.h" +#include "def_shadow_labyrinth.h" + +enum +{ + SAY_INTRO = -1555000, + SAY_AGGRO1 = -1555001, + SAY_AGGRO2 = -1555002, + SAY_AGGRO3 = -1555003, + SAY_HELP = -1555004, + SAY_SLAY1 = -1555005, + SAY_SLAY2 = -1555006, + SAY_DEATH = -1555007, + + SPELL_BANISH = 30231, + SPELL_CORROSIVE_ACID = 33551, + SPELL_FEAR = 33547, + SPELL_ENRAGE = 34970 +}; + +struct TRINITY_DLL_DECL boss_ambassador_hellmawAI : public npc_escortAI +{ + boss_ambassador_hellmawAI(Creature* pCreature) : npc_escortAI(pCreature) + { + m_pInstance = pCreature->GetInstanceData(); + HeroicMode = pCreature->GetMap()->IsHeroic(); + } + + ScriptedInstance* m_pInstance; + bool HeroicMode; + + uint32 EventCheck_Timer; + uint32 CorrosiveAcid_Timer; + uint32 Fear_Timer; + uint32 Enrage_Timer; + bool Intro; + bool IsBanished; + bool Enraged; + + void Reset() + { + EventCheck_Timer = 5000; + CorrosiveAcid_Timer = 5000 + rand()%5000; + Fear_Timer = 25000 + rand()%5000; + Enrage_Timer = 180000; + Intro = false; + IsBanished = true; + Enraged = false; + + if (m_pInstance && m_creature->isAlive()) + { + if (m_pInstance->GetData(TYPE_OVERSEER) != DONE) + m_creature->CastSpell(m_creature, SPELL_BANISH, true); + } + } + + void JustReachedHome() + { + if (m_pInstance) + m_pInstance->SetData(TYPE_HELLMAW, FAIL); + } + + void MoveInLineOfSight(Unit* pWho) + { + if (m_creature->HasAura(SPELL_BANISH)) + return; + + npc_escortAI::MoveInLineOfSight(pWho); + } + + void WaypointReached(uint32 i) + { + } + + void DoIntro() + { + if (m_creature->HasAura(SPELL_BANISH)) + m_creature->RemoveAurasDueToSpell(SPELL_BANISH); + + IsBanished = false; + Intro = true; + + if (m_pInstance) + { + if (m_pInstance->GetData(TYPE_HELLMAW) != FAIL) + { + DoScriptText(SAY_INTRO, m_creature); + Start(true, false, 0, NULL, false, true); + } + + m_pInstance->SetData(TYPE_HELLMAW, IN_PROGRESS); + } + } + + void EnterCombat(Unit *who) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_AGGRO1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO3, m_creature); break; + } + } + + void KilledUnit(Unit *victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + } + } + + void JustDied(Unit *victim) + { + DoScriptText(SAY_DEATH, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_HELLMAW, DONE); + } + + void UpdateAI(const uint32 diff) + { + if (!Intro && !IsBeingEscorted) + { + if (EventCheck_Timer < diff) + { + if (m_pInstance) + { + if (m_pInstance->GetData(TYPE_OVERSEER) == DONE) + { + DoIntro(); + return; + } + } + EventCheck_Timer = 5000; + return; + } + else + { + EventCheck_Timer -= diff; + return; + } + } + + npc_escortAI::UpdateAI(diff); + + if (!UpdateVictim()) + return; + + if (m_creature->HasAura(SPELL_BANISH, 0)) + { + EnterEvadeMode(); + return; + } + + if (CorrosiveAcid_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_CORROSIVE_ACID); + CorrosiveAcid_Timer = 15000 + rand()%10000; + }else CorrosiveAcid_Timer -= diff; + + if (Fear_Timer < diff) + { + DoCast(m_creature,SPELL_FEAR); + Fear_Timer = 20000 + rand()%15000; + }else Fear_Timer -= diff; + + if (HeroicMode) + { + if (!Enraged && Enrage_Timer < diff) + { + DoCast(m_creature,SPELL_ENRAGE); + Enraged = true; + }else Enrage_Timer -= diff; + } + } +}; + +CreatureAI* GetAI_boss_ambassador_hellmaw(Creature* pCreature) +{ + return new boss_ambassador_hellmawAI(pCreature); +} + +void AddSC_boss_ambassador_hellmaw() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_ambassador_hellmaw"; + newscript->GetAI = &GetAI_boss_ambassador_hellmaw; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp b/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp new file mode 100644 index 00000000000..73374c08f8c --- /dev/null +++ b/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp @@ -0,0 +1,177 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Blackheart_the_Inciter +SD%Complete: 75 +SDComment: Incite Chaos not functional since core lacks Mind Control support +SDCategory: Auchindoun, Shadow Labyrinth +EndScriptData */ + +#include "precompiled.h" +#include "def_shadow_labyrinth.h" + +#define SPELL_INCITE_CHAOS 33676 +#define SPELL_INCITE_CHAOS_B 33684 //debuff applied to each member of party +#define SPELL_CHARGE 33709 +#define SPELL_WAR_STOMP 33707 + +#define SAY_INTRO1 -1555008 +#define SAY_INTRO2 -1555009 +#define SAY_INTRO3 -1555010 +#define SAY_AGGRO1 -1555011 +#define SAY_AGGRO2 -1555012 +#define SAY_AGGRO3 -1555013 +#define SAY_SLAY1 -1555014 +#define SAY_SLAY2 -1555015 +#define SAY_HELP -1555016 +#define SAY_DEATH -1555017 + +#define SAY2_INTRO1 -1555018 +#define SAY2_INTRO2 -1555019 +#define SAY2_INTRO3 -1555020 +#define SAY2_AGGRO1 -1555021 +#define SAY2_AGGRO2 -1555022 +#define SAY2_AGGRO3 -1555023 +#define SAY2_SLAY1 -1555024 +#define SAY2_SLAY2 -1555025 +#define SAY2_HELP -1555026 +#define SAY2_DEATH -1555027 + +struct TRINITY_DLL_DECL boss_blackheart_the_inciterAI : public ScriptedAI +{ + boss_blackheart_the_inciterAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance *pInstance; + + bool InciteChaos; + uint32 InciteChaos_Timer; + uint32 InciteChaosWait_Timer; + uint32 Charge_Timer; + uint32 Knockback_Timer; + + void Reset() + { + InciteChaos = false; + InciteChaos_Timer = 20000; + InciteChaosWait_Timer = 15000; + Charge_Timer = 5000; + Knockback_Timer = 15000; + + if (pInstance) + pInstance->SetData(DATA_BLACKHEARTTHEINCITEREVENT, NOT_STARTED); + } + + void KilledUnit(Unit *victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + } + } + + void JustDied(Unit *victim) + { + DoScriptText(SAY_DEATH, m_creature); + + if (pInstance) + pInstance->SetData(DATA_BLACKHEARTTHEINCITEREVENT, DONE); + } + + void EnterCombat(Unit *who) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_AGGRO1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO3, m_creature); break; + } + + if (pInstance) + pInstance->SetData(DATA_BLACKHEARTTHEINCITEREVENT, IN_PROGRESS); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + if (InciteChaos) + { + if (InciteChaosWait_Timer < diff) + { + InciteChaos = false; + InciteChaosWait_Timer = 15000; + }else InciteChaosWait_Timer -= diff; + + return; + } + + if (InciteChaos_Timer < diff) + { + DoCast(m_creature, SPELL_INCITE_CHAOS); + + std::list t_list = m_creature->getThreatManager().getThreatList(); + for(std::list::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr) + { + Unit* target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()); + if (target && target->GetTypeId() == TYPEID_PLAYER) + target->CastSpell(target,SPELL_INCITE_CHAOS_B,true); + } + + DoResetThreat(); + InciteChaos = true; + InciteChaos_Timer = 40000; + return; + }else InciteChaos_Timer -= diff; + + //Charge_Timer + if (Charge_Timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + DoCast(target, SPELL_CHARGE); + Charge_Timer = 15000 + rand()%10000; + }else Charge_Timer -= diff; + + //Knockback_Timer + if (Knockback_Timer < diff) + { + DoCast(m_creature, SPELL_WAR_STOMP); + Knockback_Timer = 18000 + rand()%6000; + }else Knockback_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_blackheart_the_inciter(Creature* pCreature) +{ + return new boss_blackheart_the_inciterAI (pCreature); +} + +void AddSC_boss_blackheart_the_inciter() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_blackheart_the_inciter"; + newscript->GetAI = &GetAI_boss_blackheart_the_inciter; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp b/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp new file mode 100644 index 00000000000..0cc6255f3cf --- /dev/null +++ b/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp @@ -0,0 +1,321 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Grandmaster_Vorpil +SD%Complete: 100 +SDComment: +SDCategory: Auchindoun, Shadow Labyrinth +EndScriptData */ + +#include "precompiled.h" +#include "def_shadow_labyrinth.h" + +#define SAY_INTRO -1555028 +#define SAY_AGGRO1 -1555029 +#define SAY_AGGRO2 -1555030 +#define SAY_AGGRO3 -1555031 +#define SAY_HELP -1555032 +#define SAY_SLAY1 -1555033 +#define SAY_SLAY2 -1555034 +#define SAY_DEATH -1555035 + +#define SPELL_RAIN_OF_FIRE 33617 +#define H_SPELL_RAIN_OF_FIRE 39363 + +#define SPELL_DRAW_SHADOWS 33563 +#define SPELL_SHADOWBOLT_VOLLEY 33841 +#define SPELL_BANISH 38791 + +#define MOB_VOID_TRAVELER 19226 +#define SPELL_SACRIFICE 33587 +#define SPELL_SHADOW_NOVA 33846 +#define SPELL_EMPOWERING_SHADOWS 33783 +#define H_SPELL_EMPOWERING_SHADOWS 39364 + +#define MOB_VOID_PORTAL 19224 +#define SPELL_VOID_PORTAL_VISUAL 33569 + +float VorpilPosition[3] = {-252.8820,-264.3030,17.1}; + +float VoidPortalCoords[5][3] = +{ + {-283.5894, -239.5718, 12.7}, + {-306.5853, -258.4539, 12.7}, + {-295.8789, -269.0899, 12.7}, + {-209.3401, -262.7564, 17.1}, + {-261.4533, -297.3298, 17.1} +}; + +struct TRINITY_DLL_DECL mob_voidtravelerAI : public ScriptedAI +{ + mob_voidtravelerAI(Creature *c) : ScriptedAI(c) + { + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + bool HeroicMode; + Unit *Vorpil; + uint32 move; + bool sacrificed; + + void Reset() + { + Vorpil = NULL; + move = 0; + sacrificed = false; + } + + void EnterCombat(Unit *who){} + + void UpdateAI(const uint32 diff) + { + if (!Vorpil) + { + m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + return; + } + if (move < diff) + { + if (sacrificed) + { + SpellEntry *spell = GET_SPELL(HeroicMode?H_SPELL_EMPOWERING_SHADOWS:SPELL_EMPOWERING_SHADOWS); + if (spell) + Vorpil->AddAura(new Aura(spell, 1, NULL, Vorpil, m_creature)); + Vorpil->SetHealth(Vorpil->GetHealth()+Vorpil->GetMaxHealth()/25); + DoCast(m_creature, SPELL_SHADOW_NOVA, true); + m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + return; + } + m_creature->GetMotionMaster()->MoveFollow(Vorpil,0,0); + if (m_creature->IsWithinDist(Vorpil, 3)) + { + DoCast(m_creature, SPELL_SACRIFICE, false); + sacrificed = true; + move = 500; + return; + } + if (!Vorpil->isInCombat() || Vorpil->isDead()) + { + m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + return; + } + move = 1000; + }else move -= diff; + } +}; +CreatureAI* GetAI_mob_voidtraveler(Creature* pCreature) +{ + return new mob_voidtravelerAI (pCreature); +} + +struct TRINITY_DLL_DECL boss_grandmaster_vorpilAI : public ScriptedAI +{ + boss_grandmaster_vorpilAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + HeroicMode = m_creature->GetMap()->IsHeroic(); + Intro = false; + } + + ScriptedInstance *pInstance; + bool Intro, HelpYell; + bool sumportals; + bool HeroicMode; + + uint32 ShadowBoltVolley_Timer; + uint32 DrawShadows_Timer; + uint32 summonTraveler_Timer; + uint32 banish_Timer; + uint64 PortalsGuid[5]; + + void Reset() + { + ShadowBoltVolley_Timer = 7000 + rand()%7000; + DrawShadows_Timer = 45000; + summonTraveler_Timer = 90000; + banish_Timer = 17000; + HelpYell = false; + destroyPortals(); + + if (pInstance) + pInstance->SetData(DATA_GRANDMASTERVORPILEVENT, NOT_STARTED); + } + + void summonPortals() + { + if (!sumportals) + { + for (int i = 0;i<5; ++i) + { + Creature *Portal = NULL; + Portal = m_creature->SummonCreature(MOB_VOID_PORTAL,VoidPortalCoords[i][0],VoidPortalCoords[i][1],VoidPortalCoords[i][2],0,TEMPSUMMON_CORPSE_DESPAWN,3000000); + if (Portal) + { + PortalsGuid[i] = Portal->GetGUID(); + Portal->CastSpell(Portal,SPELL_VOID_PORTAL_VISUAL,false); + } + } + sumportals = true; + summonTraveler_Timer = 5000; + } + } + + void destroyPortals() + { + if (sumportals) + { + for (int i = 0;i < 5; i ++) + { + Unit *Portal = Unit::GetUnit((*m_creature), PortalsGuid[i]); + if (Portal && Portal->isAlive()) + Portal->DealDamage(Portal, Portal->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + PortalsGuid[i] = 0; + } + sumportals = false; + } + } + + void spawnVoidTraveler() + { + int pos = rand()%5; + m_creature->SummonCreature(MOB_VOID_TRAVELER,VoidPortalCoords[pos][0],VoidPortalCoords[pos][1],VoidPortalCoords[pos][2],0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,5000); + if (!HelpYell) + { + DoScriptText(SAY_HELP, m_creature); + HelpYell = true; + } + } + + void JustSummoned(Creature *summoned) + { + if (summoned && summoned->GetEntry() == MOB_VOID_TRAVELER) + CAST_AI(mob_voidtravelerAI, summoned->AI())->Vorpil = m_creature; + } + + void KilledUnit(Unit *victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + } + } + + void JustDied(Unit *victim) + { + DoScriptText(SAY_DEATH, m_creature); + destroyPortals(); + + if (pInstance) + pInstance->SetData(DATA_GRANDMASTERVORPILEVENT, DONE); + } + + void EnterCombat(Unit *who) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_AGGRO1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO3, m_creature); break; + } + summonPortals(); + + if (pInstance) + pInstance->SetData(DATA_GRANDMASTERVORPILEVENT, IN_PROGRESS); + } + + void MoveInLineOfSight(Unit *who) + { + ScriptedAI::MoveInLineOfSight(who); + + if (!Intro && m_creature->IsWithinLOSInMap(who)&& m_creature->IsWithinDistInMap(who, 100) && m_creature->IsHostileTo(who)) + { + DoScriptText(SAY_INTRO, m_creature); + Intro = true; + } + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (ShadowBoltVolley_Timer < diff) + { + DoCast(m_creature,SPELL_SHADOWBOLT_VOLLEY); + ShadowBoltVolley_Timer = 15000 + rand()%15000;; + }else ShadowBoltVolley_Timer -= diff; + + if (HeroicMode && banish_Timer < diff) + { + Unit *target = SelectTarget(SELECT_TARGET_RANDOM,0,30,false); + if (target) + { + DoCast(target,SPELL_BANISH); + banish_Timer = 16000; + } + }else banish_Timer -= diff; + + if (DrawShadows_Timer < diff) + { + Map* pMap = m_creature->GetMap(); + Map::PlayerList const &PlayerList = pMap->GetPlayers(); + for(Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) + if (Player* i_pl = i->getSource()) + if (i_pl->isAlive() && !i_pl->HasAura(SPELL_BANISH)) + i_pl->TeleportTo(m_creature->GetMapId(), VorpilPosition[0],VorpilPosition[1],VorpilPosition[2], 0, TELE_TO_NOT_LEAVE_COMBAT); + + m_creature->GetMap()->CreatureRelocation(m_creature, VorpilPosition[0],VorpilPosition[1],VorpilPosition[2],0.0f); + DoCast(m_creature,SPELL_DRAW_SHADOWS,true); + + DoCast(m_creature,HeroicMode?H_SPELL_RAIN_OF_FIRE:SPELL_RAIN_OF_FIRE); + + ShadowBoltVolley_Timer = 6000; + DrawShadows_Timer = 30000; + }else DrawShadows_Timer -= diff; + + if (summonTraveler_Timer < diff) + { + spawnVoidTraveler(); + summonTraveler_Timer = 10000; + //enrage at 20% + if ((m_creature->GetHealth()*5) < m_creature->GetMaxHealth()) + summonTraveler_Timer = 5000; + }else summonTraveler_Timer -=diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_grandmaster_vorpil(Creature* pCreature) +{ + return new boss_grandmaster_vorpilAI (pCreature); +} + +void AddSC_boss_grandmaster_vorpil() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_grandmaster_vorpil"; + newscript->GetAI = &GetAI_boss_grandmaster_vorpil; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_voidtraveler"; + newscript->GetAI = &GetAI_mob_voidtraveler; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_murmur.cpp b/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_murmur.cpp new file mode 100644 index 00000000000..259f6091af6 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_murmur.cpp @@ -0,0 +1,207 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Murmur +SD%Complete: 90 +SDComment: Timers may be incorrect +SDCategory: Auchindoun, Shadow Labyrinth +EndScriptData */ + +#include "precompiled.h" +#include "def_shadow_labyrinth.h" + +#define EMOTE_SONIC_BOOM -1555036 + +#define SPELL_SONIC_BOOM_CAST (HeroicMode?38796:33923) +#define SPELL_SONIC_BOOM_EFFECT (HeroicMode?38795:33666) +#define SPELL_RESONANCE 33657 +#define SPELL_MURMURS_TOUCH (HeroicMode?38794:33711) +#define SPELL_MAGNETIC_PULL 33689 +#define SPELL_SONIC_SHOCK 38797 +#define SPELL_THUNDERING_STORM 39365 + +struct TRINITY_DLL_DECL boss_murmurAI : public ScriptedAI +{ + boss_murmurAI(Creature *c) : ScriptedAI(c) + { + SetCombatMovement(false); + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + uint32 SonicBoom_Timer; + uint32 MurmursTouch_Timer; + uint32 Resonance_Timer; + uint32 MagneticPull_Timer; + uint32 SonicShock_Timer; + uint32 ThunderingStorm_Timer; + bool HeroicMode; + bool SonicBoom; + + void Reset() + { + SonicBoom_Timer = 30000; + MurmursTouch_Timer = 8000 + rand()%12000; + Resonance_Timer = 5000; + MagneticPull_Timer = 15000 + rand()%15000; + ThunderingStorm_Timer = 15000; + SonicShock_Timer = 10000; + SonicBoom = false; + + //database should have `RegenHealth`=0 to prevent regen + uint32 hp = (m_creature->GetMaxHealth()*40)/100; + if (hp) m_creature->SetHealth(hp); + m_creature->ResetPlayerDamageReq(); + } + + void SonicBoomEffect() + { + std::list t_list = m_creature->getThreatManager().getThreatList(); + for(std::list::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr) + { + Unit* target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()); + if (target && target->GetTypeId() == TYPEID_PLAYER) + { + //Not do anything without aura, spell can be resisted! + if (target->HasAura(SPELL_SONIC_BOOM_CAST) && m_creature->IsWithinDistInMap(target, 34.0f)) + { + //This will be wrong calculation. Also, comments suggest it must deal damage + target->SetHealth(uint32(target->GetMaxHealth() - target->GetMaxHealth() * 0.8)); + } + } + } + } + + void EnterCombat(Unit *who) { } + + // Sonic Boom instant damage (needs core fix instead of this) + void SpellHitTarget(Unit *target, const SpellEntry *spell) + { + if (target && target->isAlive() && spell && spell->Id == SPELL_SONIC_BOOM_EFFECT) + m_creature->DealDamage(target,(target->GetHealth()*90)/100,NULL,SPELL_DIRECT_DAMAGE,SPELL_SCHOOL_MASK_NATURE,spell); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target or casting + if (!UpdateVictim() || m_creature->IsNonMeleeSpellCasted(false)) + return; + + // Sonic Boom + if (SonicBoom) + { + DoCast(m_creature, SPELL_SONIC_BOOM_EFFECT, true); + SonicBoomEffect(); + + SonicBoom = false; + Resonance_Timer = 1500; + } + if (SonicBoom_Timer < diff) + { + DoScriptText(EMOTE_SONIC_BOOM, m_creature); + DoCast(m_creature, SPELL_SONIC_BOOM_CAST); + SonicBoom_Timer = 30000; + SonicBoom = true; + return; + }else SonicBoom_Timer -= diff; + + // Murmur's Touch + if (MurmursTouch_Timer < diff) + { + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM,0,80,true)) + DoCast(target, SPELL_MURMURS_TOUCH); + MurmursTouch_Timer = 25000 + rand()%10000; + }else MurmursTouch_Timer -= diff; + + // Resonance + if (!SonicBoom && !(m_creature->IsWithinMeleeRange(m_creature->getVictim()))) + { + if (Resonance_Timer < diff) + { + DoCast(m_creature, SPELL_RESONANCE); + Resonance_Timer = 5000; + }else Resonance_Timer -= diff; + } + + // Magnetic Pull + if (MagneticPull_Timer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (target->GetTypeId() == TYPEID_PLAYER && target->isAlive()) + { + DoCast(target, SPELL_MAGNETIC_PULL); + MagneticPull_Timer = 15000+rand()%15000; + return; + } + MagneticPull_Timer = 500; + }else MagneticPull_Timer -= diff; + + if (HeroicMode) + { + // Thundering Storm + if (ThunderingStorm_Timer < diff) + { + std::list& m_threatlist = m_creature->getThreatManager().getThreatList(); + for(std::list::iterator i = m_threatlist.begin(); i != m_threatlist.end(); ++i) + if (Unit* target = Unit::GetUnit((*m_creature),(*i)->getUnitGuid())) + if (target->isAlive() && !m_creature->IsWithinDist(target, 35, false)) + DoCast(target, SPELL_THUNDERING_STORM, true); + ThunderingStorm_Timer = 15000; + }else ThunderingStorm_Timer -= diff; + + // Sonic Shock + if (SonicShock_Timer < diff) + { + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM,0,20,false)) + if (target->isAlive()) + DoCast(target, SPELL_SONIC_SHOCK); + SonicShock_Timer = 10000+rand()%10000; + }else SonicShock_Timer -= diff; + } + + // Select nearest most aggro target if top aggro too far + if (!m_creature->isAttackReady()) + return; + if (!m_creature->IsWithinMeleeRange(m_creature->getVictim())) + { + std::list& m_threatlist = m_creature->getThreatManager().getThreatList(); + for(std::list::iterator i = m_threatlist.begin(); i != m_threatlist.end(); ++i) + if (Unit* target = Unit::GetUnit((*m_creature),(*i)->getUnitGuid())) + if (target->isAlive() && m_creature->IsWithinMeleeRange(target)) + { + m_creature->TauntApply(target); + break; + } + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_murmur(Creature* pCreature) +{ + return new boss_murmurAI (pCreature); +} + +void AddSC_boss_murmur() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_murmur"; + newscript->GetAI = &GetAI_boss_murmur; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/def_shadow_labyrinth.h b/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/def_shadow_labyrinth.h new file mode 100644 index 00000000000..a78955368bf --- /dev/null +++ b/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/def_shadow_labyrinth.h @@ -0,0 +1,15 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_SHADOW_LABYRINTH_H +#define DEF_SHADOW_LABYRINTH_H + +#define TYPE_HELLMAW 1 +#define TYPE_OVERSEER 2 +#define DATA_BLACKHEARTTHEINCITEREVENT 3 +#define DATA_GRANDMASTERVORPILEVENT 4 +#define DATA_MURMUREVENT 5 +#define DATA_GRANDMASTERVORPIL 6 +#endif + diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp b/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp new file mode 100644 index 00000000000..f8f3b73bffa --- /dev/null +++ b/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp @@ -0,0 +1,227 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Shadow_Labyrinth +SD%Complete: 85 +SDComment: Some cleanup left along with save +SDCategory: Auchindoun, Shadow Labyrinth +EndScriptData */ + +#include "precompiled.h" +#include "def_shadow_labyrinth.h" + +#define MAX_ENCOUNTER 5 + +#define REFECTORY_DOOR 183296 //door opened when blackheart the inciter dies +#define SCREAMING_HALL_DOOR 183295 //door opened when grandmaster vorpil dies + +/* Shadow Labyrinth encounters: +1 - Ambassador Hellmaw event +2 - Blackheart the Inciter event +3 - Grandmaster Vorpil event +4 - Murmur event +*/ + +struct TRINITY_DLL_DECL instance_shadow_labyrinth : public ScriptedInstance +{ + instance_shadow_labyrinth(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + std::string str_data; + + uint64 m_uiRefectoryDoorGUID; + uint64 m_uiScreamingHallDoorGUID; + + uint64 m_uiGrandmasterVorpil; + uint32 m_uiFelOverseerCount; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + m_uiRefectoryDoorGUID = 0; + m_uiScreamingHallDoorGUID = 0; + + m_uiGrandmasterVorpil = 0; + m_uiFelOverseerCount = 0; + } + + bool IsEncounterInProgress() const + { + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) return true; + + return false; + } + + void OnGameObjectCreate(GameObject* pGo, bool add) + { + switch(pGo->GetEntry()) + { + case REFECTORY_DOOR: + m_uiRefectoryDoorGUID = pGo->GetGUID(); + if (m_auiEncounter[2] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + case SCREAMING_HALL_DOOR: + m_uiScreamingHallDoorGUID = pGo->GetGUID(); + if (m_auiEncounter[3] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + } + } + + void OnCreatureCreate(Creature* pCreature, bool add) + { + switch(pCreature->GetEntry()) + { + case 18732: + m_uiGrandmasterVorpil = pCreature->GetGUID(); + break; + case 18796: + if (pCreature->isAlive()) + { + ++m_uiFelOverseerCount; + debug_log("TSCR: Shadow Labyrinth: counting %u Fel Overseers.",m_uiFelOverseerCount); + } + break; + } + } + + void SetData(uint32 type, uint32 uiData) + { + switch(type) + { + case TYPE_HELLMAW: + m_auiEncounter[0] = uiData; + break; + + case TYPE_OVERSEER: + if (uiData != DONE) + { + error_log("TSCR: Shadow Labyrinth: TYPE_OVERSEER did not expect other data than DONE"); + return; + } + if (m_uiFelOverseerCount) + { + --m_uiFelOverseerCount; + + if (m_uiFelOverseerCount) + debug_log("TSCR: Shadow Labyrinth: %u Fel Overseers left to kill.",m_uiFelOverseerCount); + else + { + m_auiEncounter[1] = DONE; + debug_log("TSCR: Shadow Labyrinth: TYPE_OVERSEER == DONE"); + } + } + break; + + case DATA_BLACKHEARTTHEINCITEREVENT: + if (uiData == DONE) + DoUseDoorOrButton(m_uiRefectoryDoorGUID); + m_auiEncounter[2] = uiData; + break; + + case DATA_GRANDMASTERVORPILEVENT: + if (uiData == DONE) + DoUseDoorOrButton(m_uiScreamingHallDoorGUID); + m_auiEncounter[3] = uiData; + break; + + case DATA_MURMUREVENT: + m_auiEncounter[4] = uiData; + break; + } + + if (uiData == DONE) + { + if (type == TYPE_OVERSEER && m_uiFelOverseerCount != 0) + return; + + OUT_SAVE_INST_DATA; + + std::ostringstream saveStream; + saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " + << m_auiEncounter[2] << " " << m_auiEncounter[3] << " " << m_auiEncounter[4]; + + str_data = saveStream.str(); + + SaveToDB(); + OUT_SAVE_INST_DATA_COMPLETE; + } + } + + uint32 GetData(uint32 type) + { + switch(type) + { + case TYPE_HELLMAW: return m_auiEncounter[0]; + case TYPE_OVERSEER: return m_auiEncounter[1]; + case DATA_GRANDMASTERVORPILEVENT: return m_auiEncounter[3]; + case DATA_MURMUREVENT: return m_auiEncounter[4]; + } + return false; + } + + uint64 GetData64(uint32 identifier) + { + if (identifier == DATA_GRANDMASTERVORPIL) + return m_uiGrandmasterVorpil; + + return 0; + } + + std::string GetSaveData() + { + return str_data; + } + + void Load(const char* in) + { + if (!in) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(in); + + std::istringstream loadStream(in); + loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3] >> m_auiEncounter[4]; + + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) + m_auiEncounter[i] = NOT_STARTED; + + OUT_LOAD_INST_DATA_COMPLETE; + } +}; + +InstanceData* GetInstanceData_instance_shadow_labyrinth(Map* pMap) +{ + return new instance_shadow_labyrinth(pMap); +} + +void AddSC_instance_shadow_labyrinth() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_shadow_labyrinth"; + newscript->GetInstanceData = &GetInstanceData_instance_shadow_labyrinth; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/black_temple/black_temple.cpp b/src/bindings/scripts/scripts/outland/black_temple/black_temple.cpp new file mode 100644 index 00000000000..7f0f1e570ba --- /dev/null +++ b/src/bindings/scripts/scripts/outland/black_temple/black_temple.cpp @@ -0,0 +1,69 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Black_Temple +SD%Complete: 95 +SDComment: Spirit of Olum: Player Teleporter to Seer Kanai Teleport after defeating Naj'entus and Supremus. TODO: Find proper gossip. +SDCategory: Black Temple +EndScriptData */ + +/* ContentData +npc_spirit_of_olum +EndContentData */ + +#include "precompiled.h" +#include "def_black_temple.h" + +/*### +# npc_spirit_of_olum +####*/ + +#define SPELL_TELEPORT 41566 // s41566 - Teleport to Ashtongue NPC's +#define GOSSIP_OLUM1 "Teleport me to the other Ashtongue Deathsworn" + +bool GossipHello_npc_spirit_of_olum(Player* pPlayer, Creature* pCreature) +{ + ScriptedInstance* pInstance = (pCreature->GetInstanceData()); + + if (pInstance && (pInstance->GetData(DATA_SUPREMUSEVENT) >= DONE) && (pInstance->GetData(DATA_HIGHWARLORDNAJENTUSEVENT) >= DONE)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_OLUM1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + + pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_spirit_of_olum(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) + pPlayer->CLOSE_GOSSIP_MENU(); + + pPlayer->InterruptNonMeleeSpells(false); + pPlayer->CastSpell(pPlayer, SPELL_TELEPORT, false); + return true; +} + +void AddSC_black_temple() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "npc_spirit_of_olum"; + newscript->pGossipHello = &GossipHello_npc_spirit_of_olum; + newscript->pGossipSelect = &GossipSelect_npc_spirit_of_olum; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/black_temple/boss_bloodboil.cpp b/src/bindings/scripts/scripts/outland/black_temple/boss_bloodboil.cpp new file mode 100644 index 00000000000..12c3d445018 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/black_temple/boss_bloodboil.cpp @@ -0,0 +1,344 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Bloodboil +SD%Complete: 80 +SDComment: Bloodboil not working correctly, missing enrage +SDCategory: Black Temple +EndScriptData */ + +#include "precompiled.h" +#include "def_black_temple.h" + +//Speech'n'Sound +#define SAY_AGGRO -1564029 +#define SAY_SLAY1 -1564030 +#define SAY_SLAY2 -1564031 +#define SAY_SPECIAL1 -1564032 +#define SAY_SPECIAL2 -1564033 +#define SAY_ENRAGE1 -1564034 +#define SAY_ENRAGE2 -1564035 +#define SAY_DEATH -1564036 + +//Spells +#define SPELL_ACID_GEYSER 40630 +#define SPELL_ACIDIC_WOUND 40481 +#define SPELL_ARCING_SMASH 40599 +#define SPELL_BLOODBOIL 42005 // This spell is AoE whereas it shouldn't be +#define SPELL_FEL_ACID 40508 +#define SPELL_FEL_RAGE_SELF 40594 +#define SPELL_FEL_RAGE_TARGET 40604 +#define SPELL_FEL_RAGE_2 40616 +#define SPELL_FEL_RAGE_3 41625 +#define SPELL_BEWILDERING_STRIKE 40491 +#define SPELL_EJECT1 40486 // 1000 Physical damage + knockback + script effect (should handle threat reduction I think) +#define SPELL_EJECT2 40597 // 1000 Physical damage + Stun (used in phase 2?) +#define SPELL_TAUNT_GURTOGG 40603 +#define SPELL_INSIGNIFIGANCE 40618 +#define SPELL_BERSERK 45078 + +//This is used to sort the players by distance in preparation for the Bloodboil cast. + +struct TRINITY_DLL_DECL boss_gurtogg_bloodboilAI : public ScriptedAI +{ + boss_gurtogg_bloodboilAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + uint64 TargetGUID; + + float TargetThreat; + + uint32 BloodboilTimer; + uint32 BloodboilCount; + uint32 AcidGeyserTimer; + uint32 AcidicWoundTimer; + uint32 ArcingSmashTimer; + uint32 EnrageTimer; + uint32 FelAcidTimer; + uint32 EjectTimer; + uint32 BewilderingStrikeTimer; + uint32 PhaseChangeTimer; + + bool Phase1; + + void Reset() + { + if (pInstance) + pInstance->SetData(DATA_GURTOGGBLOODBOILEVENT, NOT_STARTED); + + TargetGUID = 0; + + TargetThreat = 0; + + BloodboilTimer = 10000; + BloodboilCount = 0; + AcidGeyserTimer = 1000; + AcidicWoundTimer = 6000; + ArcingSmashTimer = 19000; + EnrageTimer = 600000; + FelAcidTimer = 25000; + EjectTimer = 10000; + BewilderingStrikeTimer = 15000; + PhaseChangeTimer = 60000; + + Phase1 = true; + + m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, false); + m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, false); + } + + void EnterCombat(Unit *who) + { + DoZoneInCombat(); + DoScriptText(SAY_AGGRO, m_creature); + if (pInstance) + pInstance->SetData(DATA_GURTOGGBLOODBOILEVENT, IN_PROGRESS); + } + + void KilledUnit(Unit *victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + } + } + + void JustDied(Unit *victim) + { + if (pInstance) + pInstance->SetData(DATA_GURTOGGBLOODBOILEVENT, DONE); + + DoScriptText(SAY_DEATH, m_creature); + } + + // Note: This seems like a very complicated fix. The fix needs to be handled by the core, as implementation of limited-target AoE spells are still not limited. + void CastBloodboil() + { + // Get the Threat List + std::list m_threatlist = m_creature->getThreatManager().getThreatList(); + + if (!m_threatlist.size()) // He doesn't have anyone in his threatlist, useless to continue + return; + + std::list targets; + std::list::iterator itr = m_threatlist.begin(); + for(; itr!= m_threatlist.end(); ++itr) //store the threat list in a different container + { + Unit *target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()); + //only on alive players + if (target && target->isAlive() && target->GetTypeId() == TYPEID_PLAYER) + targets.push_back(target); + } + + //Sort the list of players + targets.sort(ObjectDistanceOrderReversed(m_creature)); + //Resize so we only get top 5 + targets.resize(5); + + //Aura each player in the targets list with Bloodboil. Aura code copied+pasted from Aura command in Level3.cpp + /*SpellEntry const *spellInfo = GetSpellStore()->LookupEntry(SPELL_BLOODBOIL); + if (spellInfo) + { + for(std::list::iterator itr = targets.begin(); itr != targets.end(); ++itr) + { + Unit* target = *itr; + if (!target) return; + for(uint32 i = 0;i<3; ++i) + { + uint8 eff = spellInfo->Effect[i]; + if (eff>=TOTAL_SPELL_EFFECTS) + continue; + + Aura *Aur = new Aura(spellInfo, i, NULL, target); + target->AddAura(Aur); + } + } + }*/ + } + + void RevertThreatOnTarget(uint64 guid) + { + Unit* pUnit = NULL; + pUnit = Unit::GetUnit((*m_creature), guid); + if (pUnit) + { + if (DoGetThreat(pUnit)) + DoModifyThreatPercent(pUnit, -100); + if (TargetThreat) + m_creature->AddThreat(pUnit, TargetThreat); + } + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (ArcingSmashTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_ARCING_SMASH); + ArcingSmashTimer = 10000; + }else ArcingSmashTimer -= diff; + + if (FelAcidTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_FEL_ACID); + FelAcidTimer = 25000; + }else FelAcidTimer -= diff; + + if (!m_creature->HasAura(SPELL_BERSERK)) + { + if (EnrageTimer < diff) + { + DoCast(m_creature, SPELL_BERSERK); + switch(rand()%2) + { + case 0: DoScriptText(SAY_ENRAGE1, m_creature); break; + case 1: DoScriptText(SAY_ENRAGE2, m_creature); break; + } + }else EnrageTimer -= diff; + } + + if (Phase1) + { + if (BewilderingStrikeTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_BEWILDERING_STRIKE); + float mt_threat = DoGetThreat(m_creature->getVictim()); + if (Unit* target = SelectUnit(SELECT_TARGET_TOPAGGRO, 1)) + m_creature->AddThreat(target, mt_threat); + BewilderingStrikeTimer = 20000; + }else BewilderingStrikeTimer -= diff; + + if (EjectTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_EJECT1); + DoModifyThreatPercent(m_creature->getVictim(), -40); + EjectTimer = 15000; + }else EjectTimer -= diff; + + if (AcidicWoundTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_ACIDIC_WOUND); + AcidicWoundTimer = 10000; + }else AcidicWoundTimer -= diff; + + if (BloodboilTimer < diff) + { + if (BloodboilCount < 5) // Only cast it five times. + { + //CastBloodboil(); // Causes issues on windows, so is commented out. + DoCast(m_creature->getVictim(), SPELL_BLOODBOIL); + ++BloodboilCount; + BloodboilTimer = 10000*BloodboilCount; + } + }else BloodboilTimer -= diff; + } + + if (!Phase1) + { + if (AcidGeyserTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_ACID_GEYSER); + AcidGeyserTimer = 30000; + }else AcidGeyserTimer -= diff; + + if (EjectTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_EJECT2); + EjectTimer = 15000; + }else EjectTimer -= diff; + } + + if (PhaseChangeTimer < diff) + { + if (Phase1) + { + Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (target && target->isAlive()) + { + Phase1 = false; + + TargetThreat = DoGetThreat(target); + TargetGUID = target->GetGUID(); + target->CastSpell(m_creature, SPELL_TAUNT_GURTOGG, true); + if (DoGetThreat(target)) + DoModifyThreatPercent(target, -100); + m_creature->AddThreat(target, 50000000.0f); + m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true); + m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true); + // If VMaps are disabled, this spell can call the whole instance + DoCast(m_creature, SPELL_INSIGNIFIGANCE, true); + DoCast(target, SPELL_FEL_RAGE_TARGET, true); + DoCast(target,SPELL_FEL_RAGE_2, true); + /* These spells do not work, comment them out for now. + DoCast(target, SPELL_FEL_RAGE_2, true); + DoCast(target, SPELL_FEL_RAGE_3, true);*/ + + //Cast this without triggered so that it appears in combat logs and shows visual. + DoCast(m_creature, SPELL_FEL_RAGE_SELF); + + switch(rand()%2) + { + case 0: DoScriptText(SAY_SPECIAL1, m_creature); break; + case 1: DoScriptText(SAY_SPECIAL2, m_creature); break; + } + + AcidGeyserTimer = 1000; + PhaseChangeTimer = 30000; + } + }else // Encounter is a loop pretty much. Phase 1 -> Phase 2 -> Phase 1 -> Phase 2 till death or enrage + { + if (TargetGUID) + RevertThreatOnTarget(TargetGUID); + TargetGUID = 0; + Phase1 = true; + BloodboilTimer = 10000; + BloodboilCount = 0; + AcidicWoundTimer += 2000; + ArcingSmashTimer += 2000; + FelAcidTimer += 2000; + EjectTimer += 2000; + PhaseChangeTimer = 60000; + m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, false); + m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, false); + } + }else PhaseChangeTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_gurtogg_bloodboil(Creature* pCreature) +{ + return new boss_gurtogg_bloodboilAI (pCreature); +} + +void AddSC_boss_gurtogg_bloodboil() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_gurtogg_bloodboil"; + newscript->GetAI = &GetAI_boss_gurtogg_bloodboil; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/black_temple/boss_illidan.cpp b/src/bindings/scripts/scripts/outland/black_temple/boss_illidan.cpp new file mode 100644 index 00000000000..2baa0abbe81 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/black_temple/boss_illidan.cpp @@ -0,0 +1,2208 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +/* ScriptData +SDName: boss_illidan_stormrage +SD%Complete: 90 +SDComment: Somewhat of a workaround for Parasitic Shadowfiend, unable to summon GOs for Cage Trap. +SDCategory: Black Temple +EndScriptData */ + +#include "precompiled.h" +#include "def_black_temple.h" + +#define GETGO(obj, guid) GameObject* obj = pInstance->instance->GetGameObject(guid) +#define GETUNIT(unit, guid) Unit* unit = Unit::GetUnit(*m_creature, guid) +#define GETCRE(cre, guid) Creature* cre = Unit::GetCreature(*m_creature, guid) +#define HPPCT(unit) unit->GetHealth()*100 / unit->GetMaxHealth() + +/************* Quotes and Sounds ***********************/ +// Gossip for when a player clicks Akama +#define GOSSIP_ITEM "We are ready to face Illidan" + +// Yells for/by Akama +#define SAY_AKAMA_BEWARE "Be wary friends, The Betrayer meditates in the court just beyond." +#define SOUND_AKAMA_BEWARE 11388 +#define SAY_AKAMA_MINION "Come, my minions. Deal with this traitor as he deserves!" +#define SOUND_AKAMA_MINION 11465 +#define SAY_AKAMA_LEAVE "I'll deal with these mongrels. Strike now, friends! Strike at the betrayer!" +#define SOUND_AKAMA_LEAVE 11390 + +// Self explanatory +const char* SAY_KILL1 = "Who shall be next to taste my blades?!"; +#define SOUND_KILL1 11473 +const char* SAY_KILL2 = "This is too easy!"; +#define SOUND_KILL2 11472 + +// I think I'll fly now and let my subordinates take you on +#define SAY_TAKEOFF "I will not be touched by rabble such as you!" +#define SOUND_TAKEOFF 11479 +#define SAY_SUMMONFLAMES "Behold the flames of Azzinoth!" +#define SOUND_SUMMONFLAMES 11480 + +// When casting Eye Blast. Demon Fire will be appear on places that he casts this +#define SAY_EYE_BLAST "Stare into the eyes of the Betrayer!" +#define SOUND_EYE_BLAST 11481 + +// kk, I go big, dark and demon on you. +#define SAY_MORPH "Behold the power... of the demon within!" +#define SOUND_MORPH 11475 + +// I KILL! +#define SAY_ENRAGE "You've wasted too much time mortals, now you shall fall!" +#define SOUND_ENRAGE 11474 + +/************** Spells *************/ +// Normal Form +#define SPELL_SHEAR 37335 // 41032 is bugged, cannot be block/dodge/parry// Reduces Max. Health by 60% for 7 seconds. Can stack 19 times. 1.5 second cast +#define SPELL_FLAME_CRASH 40832 // Summons an invis/unselect passive mob that has an aura of flame in a circle around him. +#define SPELL_DRAW_SOUL 40904 // 5k Shadow Damage in front of him. Heals Illidan for 100k health (script effect) +#define SPELL_PARASITIC_SHADOWFIEND 41917 // DoT of 3k Shadow every 2 seconds. Lasts 10 seconds. (Script effect: Summon 2 parasites once the debuff has ticked off) +#define SPELL_PARASITIC_SHADOWFIEND2 41914 // Used by Parasitic +#define SPELL_SUMMON_PARASITICS 41915 // Summons 2 Parasitic Shadowfiends on the target. It's supposed to be cast as soon as the Parasitic Shadowfiend debuff is gone, but the spells aren't linked :( +#define SPELL_AGONIZING_FLAMES 40932 // 4k fire damage initial to target and anyone w/i 5 yards. PHASE 3 ONLY +#define SPELL_ENRAGE 40683 // Increases damage by 50% and attack speed by 30%. 20 seconds, PHASE 5 ONLY +// Flying (Phase 2) +#define SPELL_THROW_GLAIVE 39635 // Throws a glaive on the ground +#define SPELL_THROW_GLAIVE2 39849 // Animation for the above spell +#define SPELL_GLAIVE_RETURNS 39873 // Glaive flies back to Illidan +#define SPELL_FIREBALL 40598 // 2.5k-3.5k damage in 10 yard radius. 2 second cast time. +#define SPELL_DARK_BARRAGE 40585 // 10 second channeled spell, 3k shadow damage per second. +// Demon Form +#define SPELL_DEMON_TRANSFORM_1 40511 // First phase of animations for transforming into Dark Illidan (fall to ground) +#define SPELL_DEMON_TRANSFORM_2 40398 // Second phase of animations (kneel) +#define SPELL_DEMON_TRANSFORM_3 40510 // Final phase of animations (stand up and roar) +#define SPELL_DEMON_FORM 40506 // Transforms into Demon Illidan. Has an Aura of Dread on him. +#define SPELL_SHADOW_BLAST 41078 // 8k - 11k Shadow Damage. Targets highest threat. Has a splash effect, damaging anyone in 20 yards of the target. +#define SPELL_FLAME_BURST 41126 // Hurls fire at entire raid for ~3.5k damage every 10 seconds. Resistable. (Does not work: Script effect) +#define SPELL_FLAME_BURST_EFFECT 41131 // The actual damage. Have each player cast it on itself (workaround) +// Other Illidan spells +#define SPELL_KNEEL 39656 // Before beginning encounter, this is how he appears (talking to skully). +#define SPELL_SHADOW_PRISON 40647 // Illidan casts this spell to immobilize entire raid when he summons Maiev. +#define SPELL_DEATH 41220 // This spell doesn't do anything except stun Illidan and set him on his knees. +#define SPELL_BERSERK 45078 // Damage increased by 500%, attack speed by 150% +#define SPELL_DUAL_WIELD 42459 +//Phase Normal spells +#define SPELL_FLAME_CRASH_EFFECT 40836 // Firey blue ring of circle that the other flame crash summons +#define SPELL_SUMMON_SHADOWDEMON 41117 // Summon four shadowfiends +#define SPELL_SHADOWFIEND_PASSIVE 41913 // Passive aura for shadowfiends +#define SPELL_SHADOW_DEMON_PASSIVE 41079 // Adds the "shadowform" aura to Shadow Demons. +#define SPELL_CONSUME_SOUL 41080 // Once the Shadow Demons reach their target, they use this to kill them +#define SPELL_PARALYZE 41083 // Shadow Demons cast this on their target +#define SPELL_PURPLE_BEAM 39123 // Purple Beam connecting Shadow Demon to their target +//Phase Flight spells +#define SPELL_AZZINOTH_CHANNEL 39857 // Glaives cast it on Flames. Not sure if this is the right spell. +#define SPELL_EYE_BLAST_TRIGGER 40017 // This summons Demon Form every few seconds and deals ~20k damage in its radius +#define SPELL_EYE_BLAST 39908 // This does the blue flamey animation. +#define SPELL_BLAZE_EFFECT 40610 // Green flame on the ground, triggers damage (5k) every few seconds +#define SPELL_BLAZE_SUMMON 40637 // Summons the Blaze creature +#define SPELL_DEMON_FIRE 40029 // Blue fire trail left by Eye Blast. Deals 2k per second if players stand on it. +#define SPELL_FLAME_BLAST 40631 // Flames of Azzinoth use this. Frontal cone AoE 7k-9k damage. +#define SPELL_CHARGE 41581 //40602 // Flames of Azzinoth charges whoever is too far from them. They enrage after this. For simplicity, we'll use the same enrage as Illidan. +#define SPELL_FLAME_ENRAGE 45078 +//Akama spells +#define SPELL_AKAMA_DOOR_CHANNEL 41268 // Akama's channel spell on the door before the Temple Summit +#define SPELL_DEATHSWORN_DOOR_CHANNEL 41269 // Olum and Udalo's channel spell on the door before the Temple Summit +#define SPELL_AKAMA_DOOR_FAIL 41271 // Not sure where this is really used... +#define SPELL_HEALING_POTION 40535 // Akama uses this to heal himself to full. +#define SPELL_CHAIN_LIGHTNING 40536 // 6938 to 8062 for 5 targets +//Maiev spells +#define SPELL_CAGE_TRAP_DUMMY 40761 // Put this in DB for cage trap GO. +#define SPELL_CAGED 40695 // Caged Trap triggers will cast this on Illidan if he is within 3 yards +#define SPELL_CAGE_TRAP_SUMMON 40694 // Summons a Cage Trap GO (bugged) on the ground along with a Cage Trap Disturb Trigger mob (working) +#define SPELL_CAGE_TRAP_BEAM 40713 // 8 Triggers on the ground in an octagon cast spells like this on Illidan 'caging him' +#define SPELL_TELEPORT_VISUAL 41232 // Teleport visual for Maiev +#define SPELL_SHADOW_STRIKE 40685 // 4375 to 5625 every 3 seconds for 12 seconds +#define SPELL_THROW_DAGGER 41152 // 5400 to 6600 damage, need dagger +#define SPELL_FAN_BLADES 39954 // bugged visual + +// Other defines +#define CENTER_X 676.740 +#define CENTER_Y 305.297 +#define CENTER_Z 353.192 + +#define FLAME_ENRAGE_DISTANCE 30 +#define FLAME_CHARGE_DISTANCE 50 + +#define EQUIP_ID_MAIN_HAND 32837 +#define EQUIP_ID_OFF_HAND 32838 + +/**** Creature Summon and Recognition IDs ****/ +enum CreatureEntry +{ + EMPTY = 0, + AKAMA = 22990, + ILLIDAN_STORMRAGE = 22917, + BLADE_OF_AZZINOTH = 22996, + FLAME_OF_AZZINOTH = 22997, + MAIEV_SHADOWSONG = 23197, + SHADOW_DEMON = 23375, + DEMON_FIRE = 23069, + FLAME_CRASH = 23336, + ILLIDAN_DOOR_TRIGGER = 23412, + SPIRIT_OF_OLUM = 23411, + SPIRIT_OF_UDALO = 23410, + ILLIDARI_ELITE = 23226, + PARASITIC_SHADOWFIEND = 23498, + CAGE_TRAP_TRIGGER = 23292, +}; + +/*** Phase Names ***/ +enum PhaseIllidan +{ + PHASE_ILLIDAN_NULL = 0, + PHASE_NORMAL = 1, + PHASE_FLIGHT = 2, + PHASE_NORMAL_2 = 3, + PHASE_DEMON = 4, + PHASE_NORMAL_MAIEV = 5, + PHASE_TALK_SEQUENCE = 6, + PHASE_FLIGHT_SEQUENCE = 7, + PHASE_TRANSFORM_SEQUENCE = 8, + PHASE_ILLIDAN_MAX = 9, +};//Maiev uses the same phase + +enum PhaseAkama +{ + PHASE_AKAMA_NULL = 0, + PHASE_CHANNEL = 1, + PHASE_WALK = 2, + PHASE_TALK = 3, + PHASE_FIGHT_ILLIDAN = 4, + PHASE_FIGHT_MINIONS = 5, + PHASE_RETURN = 6, +}; + +enum EventIllidan +{ + EVENT_NULL = 0, + EVENT_BERSERK = 1, + //normal phase + EVENT_TAUNT = 2, + EVENT_SHEAR = 3, + EVENT_FLAME_CRASH = 4, + EVENT_PARASITIC_SHADOWFIEND = 5, + EVENT_PARASITE_CHECK = 6, + EVENT_DRAW_SOUL = 7, + EVENT_AGONIZING_FLAMES = 8, + EVENT_TRANSFORM_NORMAL = 9, + EVENT_ENRAGE = 10, + //flight phase + EVENT_FIREBALL = 2, + EVENT_DARK_BARRAGE = 3, + EVENT_EYE_BLAST = 4, + EVENT_MOVE_POINT = 5, + //demon phase + EVENT_SHADOW_BLAST = 2, + EVENT_FLAME_BURST = 3, + EVENT_SHADOWDEMON = 4, + EVENT_TRANSFORM_DEMON = 5, + //sequence phase + EVENT_TALK_SEQUENCE = 2, + EVENT_FLIGHT_SEQUENCE = 2, + EVENT_TRANSFORM_SEQUENCE = 2, +}; + +enum EventMaiev +{ + EVENT_MAIEV_NULL = 0, + EVENT_MAIEV_STEALTH = 1, + EVENT_MAIEV_TAUNT = 2, + EVENT_MAIEV_SHADOW_STRIKE = 3, + EVENT_MAIEV_THROW_DAGGER = 4, + EVENT_MAIEV_TRAP = 4, +}; + +static EventIllidan MaxTimer[]= +{ + EVENT_NULL, + EVENT_DRAW_SOUL, + EVENT_MOVE_POINT, + EVENT_TRANSFORM_NORMAL, + EVENT_TRANSFORM_DEMON, + EVENT_ENRAGE, + EVENT_TALK_SEQUENCE, + EVENT_FLIGHT_SEQUENCE, + EVENT_TRANSFORM_SEQUENCE +}; + +struct Yells +{ + uint32 sound; + char* text; + uint32 pCreature, timer, emote; + bool Talk; +}; + +static Yells Conversation[]= +{ + {11463, "Akama... your duplicity is hardly surprising. I should have slaughtered you and your malformed brethren long ago.", ILLIDAN_STORMRAGE, 8000, 0, true}, + {0, NULL, ILLIDAN_STORMRAGE, 5000, 396, true}, + {11389, "We've come to end your reign, Illidan. My people and all of Outland shall be free!", AKAMA, 7000, 25, true}, + {0, NULL, AKAMA, 5000, 66, true}, + {11464, "Boldly said. But I remain unconvinced.", ILLIDAN_STORMRAGE, 8000, 396, true}, + {11380, "The time has come! The moment is at hand!", AKAMA, 3000, 22, true}, + {0, NULL, AKAMA, 2000, 15, true}, + {11466, "You are not prepared!", ILLIDAN_STORMRAGE, 3000, 406, true}, + {0, NULL, EMPTY, 1000, 0, true}, + {0, NULL, EMPTY, 0, 0, false},//9 + {11476, "Is this it, mortals? Is this all the fury you can muster?", ILLIDAN_STORMRAGE, 8000, 0, true}, + {11491, "Their fury pales before mine, Illidan. We have some unsettled business between us.", MAIEV_SHADOWSONG, 8000, 5, true}, + {11477, "Maiev... How is this even possible?", ILLIDAN_STORMRAGE, 5000, 1, true}, + {11492, "Ah... my long hunt is finally over. Today, Justice will be done!", MAIEV_SHADOWSONG, 8000, 15, true}, + {11470, "Feel the hatred of ten thousand years!", ILLIDAN_STORMRAGE, 1000, 0, false},//14 + {11496, "Ahh... It is finished. You are beaten.", MAIEV_SHADOWSONG, 6000, 0, true},//15 + {11478, "You have won... Maiev...but the huntress... is nothing...without the hunt... you... are nothing... without me..", ILLIDAN_STORMRAGE, 30000, 65, true}, // Emote dead for now. Kill him later + {11497, "He is right. I feel nothing... I am nothing... Farewell, champions.", MAIEV_SHADOWSONG, 9000, 0, true}, + {11498, NULL, MAIEV_SHADOWSONG, 5000, 0, true}, + {11498, NULL, EMPTY, 1000, 0, true},//19 Maiev disappear + {11387, "The Light will fill these dismal halls once again. I swear it.", AKAMA, 8000, 0, true}, + {0, NULL, EMPTY, 1000, 0, false}//21 +}; + +static Yells RandomTaunts[]= +{ + {11467, "I can feel your hatred.", ILLIDAN_STORMRAGE, 0, 0, false}, + {11468, "Give in to your fear!", ILLIDAN_STORMRAGE, 0, 0, false}, + {11469, "You know nothing of power!", ILLIDAN_STORMRAGE, 0, 0, false}, + {11471, "Such... arrogance!", ILLIDAN_STORMRAGE, 0, 0, false} +}; + +static Yells MaievTaunts[]= +{ + {11493, "That is for Naisha!", MAIEV_SHADOWSONG, 0, false}, + {11494, "Bleed as I have bled!", MAIEV_SHADOWSONG, 0, 0, false}, + {11495, "There shall be no prison for you this time!", MAIEV_SHADOWSONG, 0, 0, false}, + {11500, "Meet your end, demon!", MAIEV_SHADOWSONG, 0, 0, false} +}; + +struct Locations +{ + float x, y, z; +}; + +static Locations HoverPosition[]= +{ + {657, 340, 355}, + {657, 275, 355}, + {705, 275, 355}, + {705, 340, 355} +}; + +static Locations GlaivePosition[]= +{ + {695.105, 305.303, 354.256}, + {659.338, 305.303, 354.256},//the distance between two glaives is 36 + {700.105, 305.303, 354.256}, + {664.338, 305.303, 354.256} +}; + +static Locations EyeBlast[]= +{ + {677, 350, 354},//start point, pass through glaive point + {677, 260, 354} +}; + +static Locations AkamaWP[]= +{ + {770.01, 304.50, 312.29}, // Bottom of the first stairs, at the doors + {780.66, 304.50, 319.74}, // Top of the first stairs + {790.13, 319.68, 319.76}, // Bottom of the second stairs (left from the entrance) + {787.17, 347.38, 341.42}, // Top of the second stairs + {781.34, 350.31, 341.44}, // Bottom of the third stairs + {762.60, 361.06, 353.60}, // Top of the third stairs + {756.35, 360.52, 353.27}, // Before the door-thingy + {743.82, 342.21, 353.00}, // Somewhere further + {732.69, 305.13, 353.00}, // In front of Illidan - (8) + {738.11, 365.44, 353.00}, // in front of the door-thingy (the other one!) + {792.18, 366.62, 341.42}, // Down the first flight of stairs + {796.84, 304.89, 319.76}, // Down the second flight of stairs + {782.01, 304.55, 319.76} // Final location - back at the initial gates. This is where he will fight the minions! (12) +}; +// 755.762, 304.0747, 312.1769 -- This is where Akama should be spawned +static Locations SpiritSpawns[]= +{ + {755.5426, 309.9156, 312.2129}, + {755.5426, 298.7923, 312.0834} +}; + +struct Animation // For the demon transformation +{ + uint32 aura, unaura, timer, size, displayid, phase; + bool equip; +}; + +static Animation DemonTransformation[]= +{ + {SPELL_DEMON_TRANSFORM_1, 0, 1000, 0, 0, 6, true}, + {SPELL_DEMON_TRANSFORM_2, SPELL_DEMON_TRANSFORM_1, 4000, 0, 0, 6, true}, + {0, 0, 3000, 1073741824, 21322, 6, false},//stunned, cannot cast demon form + {SPELL_DEMON_TRANSFORM_3, SPELL_DEMON_TRANSFORM_2, 3500, 0, 0, 6, false}, + {SPELL_DEMON_FORM, SPELL_DEMON_TRANSFORM_3, 0, 0, 0, 4, false}, + {SPELL_DEMON_TRANSFORM_1, 0, 1000, 0, 0, 6, false}, + {SPELL_DEMON_TRANSFORM_2, SPELL_DEMON_TRANSFORM_1, 4000, 0, 0, 6, false}, + {0, SPELL_DEMON_FORM, 3000, 1069547520, 21135, 6, false}, + {SPELL_DEMON_TRANSFORM_3, SPELL_DEMON_TRANSFORM_2, 3500, 0, 0, 6, true}, + {0, SPELL_DEMON_TRANSFORM_3, 0, 0, 0, 8, true} +}; + + + +/************************************** Illidan's AI ***************************************/ +struct TRINITY_DLL_DECL boss_illidan_stormrageAI : public ScriptedAI +{ + boss_illidan_stormrageAI(Creature* c) : ScriptedAI(c), Summons(m_creature) + { + pInstance = c->GetInstanceData(); + m_creature->CastSpell(m_creature, SPELL_DUAL_WIELD, true); + + SpellEntry *TempSpell = GET_SPELL(SPELL_SHADOWFIEND_PASSIVE); + if (TempSpell) + TempSpell->EffectApplyAuraName[0] = 4; // proc debuff, and summon infinite fiends + } + + ScriptedInstance* pInstance; + + PhaseIllidan Phase; + EventIllidan Event; + uint32 Timer[EVENT_ENRAGE + 1]; + + uint32 TalkCount; + uint32 TransformCount; + uint32 FlightCount; + + uint32 HoverPoint; + + uint64 AkamaGUID; + uint64 MaievGUID; + uint64 FlameGUID[2]; + uint64 GlaiveGUID[2]; + + SummonList Summons; + + void Reset(); + + void JustSummoned(Creature* summon); + + void SummonedCreatureDespawn(Creature* summon) + { + if (summon->GetCreatureInfo()->Entry == FLAME_OF_AZZINOTH) + { + for(uint8 i = 0; i < 2; ++i) + if (summon->GetGUID() == FlameGUID[i]) + FlameGUID[i] = 0; + + if (!FlameGUID[0] && !FlameGUID[1] && Phase != PHASE_ILLIDAN_NULL) + { + m_creature->InterruptNonMeleeSpells(true); + EnterPhase(PHASE_FLIGHT_SEQUENCE); + } + } + Summons.Despawn(summon); + } + + void MovementInform(uint32 MovementType, uint32 Data) + { + if (FlightCount == 7) //change hover point + { + if (m_creature->getVictim()) + { + m_creature->SetInFront(m_creature->getVictim()); + m_creature->StopMoving(); + } + EnterPhase(PHASE_FLIGHT); + } + else // handle flight sequence + Timer[EVENT_FLIGHT_SEQUENCE] = 1000; + } + + void EnterCombat(Unit *who) + { + m_creature->setActive(true); + DoZoneInCombat(); + } + + void AttackStart(Unit *who) + { + if (!who || Phase >= PHASE_TALK_SEQUENCE) + return; + + if (Phase == PHASE_FLIGHT || Phase == PHASE_DEMON) + AttackStartNoMove(who); + else + ScriptedAI::AttackStart(who); + } + + void MoveInLineOfSight(Unit *who) {} + + void JustDied(Unit *killer) + { + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + + if (!pInstance) + return; + + pInstance->SetData(DATA_ILLIDANSTORMRAGEEVENT, DONE); // Completed + + for(uint8 i = DATA_GAMEOBJECT_ILLIDAN_DOOR_R; i < DATA_GAMEOBJECT_ILLIDAN_DOOR_L + 1; ++i) + pInstance->HandleGameObject(pInstance->GetData64(i), true); + } + + void KilledUnit(Unit *victim) + { + if (victim == m_creature) return; + // TODO: Find better way to handle emote + switch(rand()%2) + { + case 0: + m_creature->MonsterYell(SAY_KILL1, LANG_UNIVERSAL, victim->GetGUID()); + DoPlaySoundToSet(m_creature, SOUND_KILL1); + break; + case 1: + m_creature->MonsterYell(SAY_KILL2, LANG_UNIVERSAL, victim->GetGUID()); + DoPlaySoundToSet(m_creature, SOUND_KILL2); + break; + } + } + + void DamageTaken(Unit *done_by, uint32 &damage) + { + if (damage >= m_creature->GetHealth() && done_by != m_creature) + damage = 0; + if (done_by->GetGUID() == MaievGUID) + done_by->AddThreat(m_creature, -(3*(float)damage)/4); // do not let maiev tank him + } + + void SpellHit(Unit *caster, const SpellEntry *spell) + { + if (spell->Id == SPELL_GLAIVE_RETURNS) // Re-equip our warblades! + { + if (!m_creature->GetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID)) + SetEquipmentSlots(false, EQUIP_ID_MAIN_HAND, EQUIP_UNEQUIP, EQUIP_NO_CHANGE); + else + SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_ID_OFF_HAND, EQUIP_NO_CHANGE); + m_creature->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE); + } + } + + void DeleteFromThreatList(uint64 TargetGUID) + { + for(std::list::iterator itr = m_creature->getThreatManager().getThreatList().begin(); itr != m_creature->getThreatManager().getThreatList().end(); ++itr) + { + if ((*itr)->getUnitGuid() == TargetGUID) + { + (*itr)->removeReference(); + break; + } + } + } + + void Talk(uint32 count) + { + Timer[EVENT_TALK_SEQUENCE] = Conversation[count].timer; + + Creature* pCreature = NULL; + if (Conversation[count].pCreature == ILLIDAN_STORMRAGE) + pCreature = m_creature; + else if (Conversation[count].pCreature == AKAMA) + pCreature = (Unit::GetCreature((*m_creature), AkamaGUID)); + else if (Conversation[count].pCreature == MAIEV_SHADOWSONG) + pCreature = (Unit::GetCreature((*m_creature), MaievGUID)); + + if (pCreature) + { + if (Conversation[count].emote) + pCreature->HandleEmoteCommand(Conversation[count].emote); // Make the Creature do some animation! + if (Conversation[count].text) + pCreature->MonsterYell(Conversation[count].text, LANG_UNIVERSAL, 0); // Have the Creature yell out some text + if (Conversation[count].sound) + DoPlaySoundToSet(pCreature, Conversation[count].sound); // Play some sound on the creature + } + } + + void EnterPhase(PhaseIllidan NextPhase); + void CastEyeBlast(); + void SummonFlamesOfAzzinoth(); + void SummonMaiev(); + void HandleTalkSequence(); + void HandleFlightSequence() + { + switch(FlightCount) + { + case 1://lift off + m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF); + m_creature->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); + m_creature->StopMoving(); + m_creature->MonsterYell(SAY_TAKEOFF, LANG_UNIVERSAL, 0); + DoPlaySoundToSet(m_creature, SOUND_TAKEOFF); + Timer[EVENT_FLIGHT_SEQUENCE] = 3000; + break; + case 2://move to center + m_creature->GetMotionMaster()->MovePoint(0, CENTER_X + 5, CENTER_Y, CENTER_Z); //+5, for SPELL_THROW_GLAIVE bug + Timer[EVENT_FLIGHT_SEQUENCE] = 0; + break; + case 3://throw one glaive + { + uint8 i=1; + Creature* Glaive = m_creature->SummonCreature(BLADE_OF_AZZINOTH, GlaivePosition[i].x, GlaivePosition[i].y, GlaivePosition[i].z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); + if (Glaive) + { + GlaiveGUID[i] = Glaive->GetGUID(); + Glaive->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + Glaive->SetDisplayId(11686); + Glaive->setFaction(m_creature->getFaction()); + DoCast(Glaive, SPELL_THROW_GLAIVE2); + } + } + Timer[EVENT_FLIGHT_SEQUENCE] = 700; + break; + case 4://throw another + SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_UNEQUIP, EQUIP_NO_CHANGE); + { + uint8 i=0; + Creature* Glaive = m_creature->SummonCreature(BLADE_OF_AZZINOTH, GlaivePosition[i].x, GlaivePosition[i].y, GlaivePosition[i].z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); + if (Glaive) + { + GlaiveGUID[i] = Glaive->GetGUID(); + Glaive->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + Glaive->SetDisplayId(11686); + Glaive->setFaction(m_creature->getFaction()); + DoCast(Glaive, SPELL_THROW_GLAIVE, true); + } + } + Timer[EVENT_FLIGHT_SEQUENCE] = 5000; + break; + case 5://summon flames + SummonFlamesOfAzzinoth(); + Timer[EVENT_FLIGHT_SEQUENCE] = 3000; + break; + case 6://fly to hover point + m_creature->GetMotionMaster()->MovePoint(0, HoverPosition[HoverPoint].x, HoverPosition[HoverPoint].y, HoverPosition[HoverPoint].z); + Timer[EVENT_FLIGHT_SEQUENCE] = 0; + break; + case 7://return to center + m_creature->GetMotionMaster()->MovePoint(0, CENTER_X, CENTER_Y, CENTER_Z); + Timer[EVENT_FLIGHT_SEQUENCE] = 0; + break; + case 8://glaive return + for(uint8 i = 0; i < 2; ++i) + { + if (GlaiveGUID[i]) + { + Unit* Glaive = Unit::GetUnit((*m_creature), GlaiveGUID[i]); + if (Glaive) + { + Glaive->CastSpell(m_creature, SPELL_GLAIVE_RETURNS, false); // Make it look like the Glaive flies back up to us + Glaive->SetDisplayId(11686); // disappear but not die for now + } + } + } + Timer[EVENT_FLIGHT_SEQUENCE] = 2000; + break; + case 9://land + m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + m_creature->StopMoving(); + m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LAND); + for(uint8 i = 0; i < 2; ++i) + { + if (GlaiveGUID[i]) + { + if (GETUNIT(Glaive, GlaiveGUID[i])) + { + Glaive->SetVisibility(VISIBILITY_OFF); + Glaive->setDeathState(JUST_DIED); // Despawn the Glaive + } + GlaiveGUID[i] = 0; + } + } + Timer[EVENT_FLIGHT_SEQUENCE] = 2000; + break; + case 10://attack + DoResetThreat(); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE); + EnterPhase(PHASE_NORMAL_2); + break; + default: + break; + } + FlightCount++; + } + + void HandleTransformSequence() + { + if (DemonTransformation[TransformCount].unaura) + m_creature->RemoveAurasDueToSpell(DemonTransformation[TransformCount].unaura); + + if (DemonTransformation[TransformCount].aura) + DoCast(m_creature, DemonTransformation[TransformCount].aura, true); + + if (DemonTransformation[TransformCount].displayid) + m_creature->SetDisplayId(DemonTransformation[TransformCount].displayid); // It's morphin time! + + if (DemonTransformation[TransformCount].equip) + { + // Requip warglaives if needed + SetEquipmentSlots(false, EQUIP_ID_MAIN_HAND, EQUIP_ID_OFF_HAND, EQUIP_NO_CHANGE); + m_creature->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE); + } + else + { + // Unequip warglaives if needed + SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_UNEQUIP, EQUIP_NO_CHANGE); + } + + switch(TransformCount) + { + case 2: + DoResetThreat(); + break; + case 4: + EnterPhase(PHASE_DEMON); + break; + case 7: + DoResetThreat(); + break; + case 9: + if (MaievGUID) + EnterPhase(PHASE_NORMAL_MAIEV); // Depending on whether we summoned Maiev, we switch to either phase 5 or 3 + else + EnterPhase(PHASE_NORMAL_2); + break; + default: + break; + } + if (Phase == PHASE_TRANSFORM_SEQUENCE) + Timer[EVENT_TRANSFORM_SEQUENCE] = DemonTransformation[TransformCount].timer; + TransformCount++; + } + + void UpdateAI(const uint32 diff) + { + if ((!UpdateVictim()) && Phase < PHASE_TALK_SEQUENCE) + return; + + Event = EVENT_NULL; + for(uint32 i = 1; i <= MaxTimer[Phase]; ++i) + { + if (Timer[i]) // Event is enabled + if (Timer[i] <= diff) + { + if (!Event) // No event with higher priority + Event = (EventIllidan)i; + } + else Timer[i] -= diff; + } + + switch(Phase) + { + case PHASE_NORMAL: + if (HPPCT(m_creature) < 65) + EnterPhase(PHASE_FLIGHT_SEQUENCE); + break; + + case PHASE_NORMAL_2: + if (HPPCT(m_creature) < 30) + EnterPhase(PHASE_TALK_SEQUENCE); + break; + + case PHASE_NORMAL_MAIEV: + if (HPPCT(m_creature) < 1) + EnterPhase(PHASE_TALK_SEQUENCE); + break; + + case PHASE_TALK_SEQUENCE: + if (Event == EVENT_TALK_SEQUENCE) + HandleTalkSequence(); + break; + + case PHASE_FLIGHT_SEQUENCE: + if (Event == EVENT_FLIGHT_SEQUENCE) + HandleFlightSequence(); + break; + + case PHASE_TRANSFORM_SEQUENCE: + if (Event == EVENT_TRANSFORM_SEQUENCE) + HandleTransformSequence(); + break; + } + + if (m_creature->IsNonMeleeSpellCasted(false)) + return; + + if (Phase == PHASE_NORMAL || Phase == PHASE_NORMAL_2 || Phase == PHASE_NORMAL_MAIEV && !m_creature->HasAura(SPELL_CAGED)) + { + switch(Event) + { + //PHASE_NORMAL + case EVENT_BERSERK: + m_creature->MonsterYell(SAY_ENRAGE, LANG_UNIVERSAL, 0); + DoPlaySoundToSet(m_creature, SOUND_ENRAGE); + DoCast(m_creature, SPELL_BERSERK, true); + Timer[EVENT_BERSERK] = 5000;//The buff actually lasts forever. + break; + + case EVENT_TAUNT: + { + uint32 random = rand()%4; + char* yell = RandomTaunts[random].text; + uint32 soundid = RandomTaunts[random].sound; + if (yell) + m_creature->MonsterYell(yell, LANG_UNIVERSAL, 0); + if (soundid) + DoPlaySoundToSet(m_creature, soundid); + } + Timer[EVENT_TAUNT] = 25000 + rand()%10000; + break; + + case EVENT_SHEAR: + DoCast(m_creature->getVictim(), SPELL_SHEAR); + Timer[EVENT_SHEAR] = 25000 + (rand()%16 * 1000); + break; + + case EVENT_FLAME_CRASH: + DoCast(m_creature->getVictim(), SPELL_FLAME_CRASH); + Timer[EVENT_FLAME_CRASH] = 30000 + rand()%10000; + break; + + case EVENT_PARASITIC_SHADOWFIEND: + { + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 200, true)) + m_creature->CastSpell(target, SPELL_PARASITIC_SHADOWFIEND, true); + Timer[EVENT_PARASITIC_SHADOWFIEND] = 35000 + rand()%10000; + }break; + + case EVENT_PARASITE_CHECK: + Timer[EVENT_PARASITE_CHECK] = 0; + break; + + case EVENT_DRAW_SOUL: + DoCast(m_creature->getVictim(), SPELL_DRAW_SOUL); + Timer[EVENT_DRAW_SOUL] = 50000 + rand()%10000; + break; + + //PHASE_NORMAL_2 + case EVENT_AGONIZING_FLAMES: + DoCast(SelectUnit(SELECT_TARGET_RANDOM,0), SPELL_AGONIZING_FLAMES); + Timer[EVENT_AGONIZING_FLAMES] = 0; + break; + + case EVENT_TRANSFORM_NORMAL: + EnterPhase(PHASE_TRANSFORM_SEQUENCE); + break; + + //PHASE_NORMAL_MAIEV + case EVENT_ENRAGE: + DoCast(m_creature, SPELL_ENRAGE); + Timer[EVENT_ENRAGE] = 0; + break; + + default: + break; + } + DoMeleeAttackIfReady(); + } + + if (Phase == PHASE_FLIGHT) + { + switch(Event) + { + case EVENT_FIREBALL: + DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_FIREBALL); + Timer[EVENT_FIREBALL] = 3000; + break; + + case EVENT_DARK_BARRAGE: + DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_DARK_BARRAGE); + Timer[EVENT_DARK_BARRAGE] = 0; + break; + + case EVENT_EYE_BLAST: + CastEyeBlast(); + Timer[EVENT_EYE_BLAST] = 0; + break; + + case EVENT_MOVE_POINT: + Phase = PHASE_FLIGHT_SEQUENCE; + Timer[EVENT_FLIGHT_SEQUENCE] = 0;//do not start Event when changing hover point + HoverPoint += (rand()%3 + 1); + if (HoverPoint > 3) + HoverPoint -= 4; + m_creature->GetMotionMaster()->MovePoint(0, HoverPosition[HoverPoint].x, HoverPosition[HoverPoint].y, HoverPosition[HoverPoint].z); + break; + + default: + break; + } + } + + if (Phase == PHASE_DEMON) + { + switch(Event) + { + case EVENT_SHADOW_BLAST: + m_creature->GetMotionMaster()->Clear(false); + if (!m_creature->IsWithinDistInMap(m_creature->getVictim(), 50)||!m_creature->IsWithinLOSInMap(m_creature->getVictim())) + m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim(), 30); + else + m_creature->GetMotionMaster()->MoveIdle(); + DoCast(m_creature->getVictim(), SPELL_SHADOW_BLAST); + Timer[EVENT_SHADOW_BLAST] = 4000; + break; + case EVENT_SHADOWDEMON: + DoCast(m_creature, SPELL_SUMMON_SHADOWDEMON); + Timer[EVENT_SHADOWDEMON] = 0; + Timer[EVENT_FLAME_BURST] += 10000; + break; + case EVENT_FLAME_BURST: + DoCast(m_creature, SPELL_FLAME_BURST); + Timer[EVENT_FLAME_BURST] = 15000; + break; + case EVENT_TRANSFORM_DEMON: + EnterPhase(PHASE_TRANSFORM_SEQUENCE); + break; + default: + break; + } + } + } +}; + +/********************************** End of Illidan AI ******************************************/ + +struct TRINITY_DLL_DECL flame_of_azzinothAI : public ScriptedAI +{ + flame_of_azzinothAI(Creature *c) : ScriptedAI(c) {} + + uint32 FlameBlastTimer; + uint32 CheckTimer; + uint64 GlaiveGUID; + + void Reset() + { + FlameBlastTimer = 15000; + CheckTimer = 5000; + GlaiveGUID = 0; + } + + void EnterCombat(Unit *who) {DoZoneInCombat();} + + void ChargeCheck() + { + Unit* target = SelectTarget(SELECT_TARGET_FARTHEST, 0, 200, false); + if (target && (!m_creature->IsWithinCombatRange(target, FLAME_CHARGE_DISTANCE))) + { + m_creature->AddThreat(target, 5000000.0f); + AttackStart(target); + DoCast(target, SPELL_CHARGE); + m_creature->MonsterTextEmote("sets its gaze on $N!", target->GetGUID()); + } + } + + void EnrageCheck() + { + if (GETUNIT(Glaive, GlaiveGUID)) + { + if (!m_creature->IsWithinDistInMap(Glaive, FLAME_ENRAGE_DISTANCE)) + { + Glaive->InterruptNonMeleeSpells(true); + DoCast(m_creature, SPELL_FLAME_ENRAGE, true); + DoResetThreat(); + Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (target && target->isAlive()) + { + m_creature->AddThreat(m_creature->getVictim(), 5000000.0f); + AttackStart(m_creature->getVictim()); + } + } + else if (!m_creature->HasAura(SPELL_AZZINOTH_CHANNEL)) + { + Glaive->CastSpell(m_creature, SPELL_AZZINOTH_CHANNEL, false); + m_creature->RemoveAurasDueToSpell(SPELL_FLAME_ENRAGE); + } + } + } + + void SetGlaiveGUID(uint64 guid){ GlaiveGUID = guid; } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (FlameBlastTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_BLAZE_SUMMON, true); //appear at victim + DoCast(m_creature->getVictim(), SPELL_FLAME_BLAST); + FlameBlastTimer = 15000; //10000 is official-like? + DoZoneInCombat(); //in case someone is revived + }else FlameBlastTimer -= diff; + + if (CheckTimer < diff) + { + ChargeCheck(); + EnrageCheck(); + CheckTimer = 1000; + }else CheckTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + + + +/******* Functions and vars for Akama's AI ******/ +struct TRINITY_DLL_DECL npc_akama_illidanAI : public ScriptedAI +{ + npc_akama_illidanAI(Creature* c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + PhaseAkama Phase; + bool Event; + uint32 Timer; + + uint64 IllidanGUID; + uint64 ChannelGUID; + uint64 SpiritGUID[2]; + uint64 GateGUID; + uint64 DoorGUID[2]; + + uint32 ChannelCount; + uint32 WalkCount; + uint32 TalkCount; + + void Reset() + { + if (pInstance) + { + pInstance->SetData(DATA_ILLIDANSTORMRAGEEVENT, NOT_STARTED); + + IllidanGUID = pInstance->GetData64(DATA_ILLIDANSTORMRAGE); + GateGUID = pInstance->GetData64(DATA_GAMEOBJECT_ILLIDAN_GATE); + DoorGUID[0] = pInstance->GetData64(DATA_GAMEOBJECT_ILLIDAN_DOOR_R); + DoorGUID[1] = pInstance->GetData64(DATA_GAMEOBJECT_ILLIDAN_DOOR_L); + + pInstance->HandleGameObject(GateGUID, false); + + for(uint8 i = 0; i < 2; ++i) + pInstance->HandleGameObject(DoorGUID[i], false); + + } + else + { + IllidanGUID = 0; + GateGUID = 0; + DoorGUID[0] = 0; + DoorGUID[1] = 0; + } + + ChannelGUID = 0; + SpiritGUID[0] = 0; + SpiritGUID[1] = 0; + + Phase = PHASE_AKAMA_NULL; + Timer = 0; + + ChannelCount = 0; + WalkCount = 0; + TalkCount = 0; + + KillAllElites(); + + m_creature->SetUInt32Value(UNIT_NPC_FLAGS, 0); // Database sometimes has strange values.. + m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + m_creature->setActive(false); + } + + // Do not call reset in Akama's evade mode, as this will stop him from summoning minions after he kills the first bit + void EnterEvadeMode() + { + m_creature->RemoveAllAuras(); + m_creature->DeleteThreatList(); + m_creature->CombatStop(true); + } + + void EnterCombat(Unit *who) {} + void MoveInLineOfSight(Unit* who) {} + + void MovementInform(uint32 MovementType, uint32 Data) {Timer = 1;} + + void DamageTaken(Unit *done_by, uint32 &damage) + { + if (damage > m_creature->GetHealth() || done_by->GetGUID() != IllidanGUID) + damage = 0; + } + + void KillAllElites() + { + std::list& threatList = m_creature->getThreatManager().getThreatList(); + std::vector eliteList; + for(std::list::iterator itr = threatList.begin(); itr != threatList.end(); ++itr) + { + Unit* pUnit = Unit::GetUnit((*m_creature), (*itr)->getUnitGuid()); + if (pUnit && pUnit->GetEntry() == ILLIDARI_ELITE) + eliteList.push_back(pUnit); + } + for(std::vector::iterator itr = eliteList.begin(); itr != eliteList.end(); ++itr) + (*itr)->setDeathState(JUST_DIED); + EnterEvadeMode(); + } + + void BeginTalk() + { + if (!pInstance) + return; + + pInstance->SetData(DATA_ILLIDANSTORMRAGEEVENT, IN_PROGRESS); + + for(uint8 i = 0; i < 2; ++i) + pInstance->HandleGameObject(DoorGUID[i], false); + + if (GETCRE(Illidan, IllidanGUID)) + { + Illidan->RemoveAurasDueToSpell(SPELL_KNEEL); + m_creature->SetInFront(Illidan); + Illidan->SetInFront(m_creature); + m_creature->GetMotionMaster()->MoveIdle(); + Illidan->GetMotionMaster()->MoveIdle(); + CAST_AI(boss_illidan_stormrageAI, Illidan->AI())->AkamaGUID = m_creature->GetGUID(); + CAST_AI(boss_illidan_stormrageAI, Illidan->AI())->EnterPhase(PHASE_TALK_SEQUENCE); + } + } + + void BeginChannel() + { + m_creature->setActive(true); + + float x, y, z; + if (GETGO(Gate, GateGUID)) + Gate->GetPosition(x, y, z); + else + return;//if door not spawned, don't crash server + + if (Creature* Channel = m_creature->SummonCreature(ILLIDAN_DOOR_TRIGGER, x, y, z+5, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 360000)) + { + ChannelGUID = Channel->GetGUID(); + Channel->SetDisplayId(11686); // Invisible but spell visuals can still be seen. + m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + DoCast(Channel, SPELL_AKAMA_DOOR_FAIL); + } + + for(uint8 i = 0; i < 2; ++i) + if (Creature* Spirit = m_creature->SummonCreature(i ? SPIRIT_OF_OLUM : SPIRIT_OF_UDALO, SpiritSpawns[i].x, SpiritSpawns[i].y, SpiritSpawns[i].z, 0, TEMPSUMMON_TIMED_DESPAWN, 20000)) + { + Spirit->SetVisibility(VISIBILITY_OFF); + SpiritGUID[i] = Spirit->GetGUID(); + } + } + + void BeginWalk() + { + m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + m_creature->SetSpeed(MOVE_RUN, 1.0f); + m_creature->GetMotionMaster()->MovePoint(0, AkamaWP[WalkCount].x, AkamaWP[WalkCount].y, AkamaWP[WalkCount].z); + } + + void EnterPhase(PhaseAkama NextPhase) + { + if (!pInstance) return; + switch(NextPhase) + { + case PHASE_CHANNEL: + BeginChannel(); + Timer = 5000; + ChannelCount = 0; + break; + case PHASE_WALK: + if (Phase == PHASE_CHANNEL) + WalkCount = 0; + else if (Phase == PHASE_TALK) + { + if (GETCRE(Illidan, IllidanGUID)) + CAST_AI(boss_illidan_stormrageAI, Illidan->AI())->DeleteFromThreatList(m_creature->GetGUID()); + EnterEvadeMode(); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + WalkCount++; + } + BeginWalk(); + Timer = 0; + break; + case PHASE_TALK: + if (Phase == PHASE_WALK) + { + BeginTalk(); + Timer = 0; + } + else if (Phase == PHASE_FIGHT_ILLIDAN) + { + Timer = 1; + TalkCount = 0; + } + break; + case PHASE_FIGHT_ILLIDAN: + if (GETUNIT(Illidan, IllidanGUID)) + { + m_creature->AddThreat(Illidan, 10000000.0f); + m_creature->GetMotionMaster()->MoveChase(Illidan); + } + Timer = 30000; //chain lightning + break; + case PHASE_FIGHT_MINIONS: + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + Timer = 10000 + rand()%6000;//summon minion + break; + case PHASE_RETURN: + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + KillAllElites(); + WalkCount = 0; + BeginWalk(); + Timer = 1; + break; + default: + break; + } + Phase = NextPhase; + Event = false; + } + + void HandleTalkSequence() + { + switch(TalkCount) + { + case 0: + if (GETCRE(Illidan, IllidanGUID)) + { + CAST_AI(boss_illidan_stormrageAI, Illidan->AI())->Timer[EVENT_TAUNT] += 30000; + Illidan->MonsterYell(SAY_AKAMA_MINION, LANG_UNIVERSAL, 0); + DoPlaySoundToSet(Illidan, SOUND_AKAMA_MINION); + } + Timer = 8000; + break; + case 1: + m_creature->MonsterYell(SAY_AKAMA_LEAVE, LANG_UNIVERSAL, 0); + DoPlaySoundToSet(m_creature, SOUND_AKAMA_LEAVE); + Timer = 3000; + break; + case 2: + EnterPhase(PHASE_WALK); + break; + } + TalkCount++; + } + + void HandleChannelSequence() + { + Unit* Channel, *Spirit[2]; + if (ChannelCount <= 5) + { + Channel = Unit::GetUnit((*m_creature), ChannelGUID); + Spirit[0] = Unit::GetUnit((*m_creature), SpiritGUID[0]); + Spirit[1] = Unit::GetUnit((*m_creature), SpiritGUID[1]); + if (!Channel || !Spirit[0] || !Spirit[1]) + return; + } + + switch(ChannelCount) + { + case 0: // channel failed + m_creature->InterruptNonMeleeSpells(true); + Timer = 2000; + break; + case 1: // spirit appear + Spirit[0]->SetVisibility(VISIBILITY_ON); + Spirit[1]->SetVisibility(VISIBILITY_ON); + Timer = 2000; + break; + case 2: // spirit help + DoCast(Channel, SPELL_AKAMA_DOOR_CHANNEL); + Spirit[0]->CastSpell(Channel, SPELL_DEATHSWORN_DOOR_CHANNEL,false); + Spirit[1]->CastSpell(Channel, SPELL_DEATHSWORN_DOOR_CHANNEL,false); + Timer = 5000; + break; + case 3: //open the gate + m_creature->InterruptNonMeleeSpells(true); + Spirit[0]->InterruptNonMeleeSpells(true); + Spirit[1]->InterruptNonMeleeSpells(true); + pInstance->HandleGameObject(GateGUID, true); + Timer = 2000; + break; + case 4: + m_creature->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE); + Timer = 2000; + break; + case 5: + m_creature->MonsterYell(SAY_AKAMA_BEWARE, LANG_UNIVERSAL, 0); + DoPlaySoundToSet(m_creature, SOUND_AKAMA_BEWARE); + Channel->setDeathState(JUST_DIED); + Spirit[0]->SetVisibility(VISIBILITY_OFF); + Spirit[1]->SetVisibility(VISIBILITY_OFF); + Timer = 3000; + break; + case 6: + EnterPhase(PHASE_WALK); + break; + default: + break; + } + ChannelCount++; + } + + void HandleWalkSequence() + { + switch(WalkCount) + { + case 6: + for(uint8 i = 0; i < 2; ++i) + pInstance->HandleGameObject(DoorGUID[i], true); + break; + case 8: + if (Phase == PHASE_WALK) + EnterPhase(PHASE_TALK); + else + EnterPhase(PHASE_FIGHT_ILLIDAN); + break; + case 12: + EnterPhase(PHASE_FIGHT_MINIONS); + break; + } + + if (Phase == PHASE_WALK) + { + Timer = 0; + WalkCount++; + m_creature->GetMotionMaster()->MovePoint(WalkCount, AkamaWP[WalkCount].x, AkamaWP[WalkCount].y, AkamaWP[WalkCount].z); + } + } + + void UpdateAI(const uint32 diff) + { + Event = false; + if (Timer) + { + if (Timer <= diff) + Event = true; + else Timer -= diff; + } + + if (Event) + { + switch(Phase) + { + case PHASE_CHANNEL: + HandleChannelSequence(); + break; + case PHASE_TALK: + HandleTalkSequence(); + break; + case PHASE_WALK: + case PHASE_RETURN: + HandleWalkSequence(); + break; + case PHASE_FIGHT_ILLIDAN: + { + GETUNIT(Illidan, IllidanGUID); + if (Illidan && HPPCT(Illidan) < 90) + EnterPhase(PHASE_TALK); + else + { + DoCast(m_creature->getVictim(), SPELL_CHAIN_LIGHTNING); + Timer = 30000; + } + }break; + case PHASE_FIGHT_MINIONS: + { + float x, y, z; + m_creature->GetPosition(x, y, z); + Creature* Elite = m_creature->SummonCreature(ILLIDARI_ELITE, x+rand()%10, y+rand()%10, z, 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 30000); + //Creature* Elite = m_creature->SummonCreature(ILLIDARI_ELITE, x, y, z, 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 30000); + if (Elite) + { + Elite->AI()->AttackStart(m_creature); + Elite->AddThreat(m_creature, 1000000.0f); + AttackStart(Elite); + m_creature->AddThreat(Elite, 1000000.0f); + } + Timer = 10000 + rand()%6000; + GETUNIT(Illidan, IllidanGUID); + if (Illidan && HPPCT(Illidan) < 10) + EnterPhase(PHASE_RETURN); + } + break; + default: + break; + } + } + + if (!UpdateVictim()) + return; + + if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 20) + DoCast(m_creature, SPELL_HEALING_POTION); + + DoMeleeAttackIfReady(); + } +}; + + +struct TRINITY_DLL_DECL boss_maievAI : public ScriptedAI +{ + boss_maievAI(Creature *c) : ScriptedAI(c) {}; + + uint64 IllidanGUID; + + PhaseIllidan Phase; + EventMaiev Event; + uint32 Timer[5]; + uint32 MaxTimer; + + void Reset() + { + MaxTimer = 0; + Phase = PHASE_NORMAL_MAIEV; + IllidanGUID = 0; + Timer[EVENT_MAIEV_STEALTH] = 0; + Timer[EVENT_MAIEV_TAUNT] = 22000 + rand()%21 * 1000; + Timer[EVENT_MAIEV_SHADOW_STRIKE] = 30000; + SetEquipmentSlots(false, 44850, EQUIP_UNEQUIP, EQUIP_NO_CHANGE); + m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 2, 45738); + } + + void EnterCombat(Unit *who) {} + void MoveInLineOfSight(Unit *who) {} + void EnterEvadeMode() {} + void GetIllidanGUID(uint64 guid) { IllidanGUID = guid; } + + void DamageTaken(Unit *done_by, uint32 &damage) + { + if (done_by->GetGUID() != IllidanGUID) + damage = 0; + else + { + GETUNIT(Illidan, IllidanGUID); + if (Illidan && Illidan->getVictim() == m_creature) + damage = m_creature->GetMaxHealth()/10; + if (damage >= m_creature->GetHealth()) + damage = 0; + } + } + + void AttackStart(Unit *who) + { + if (!who || Timer[EVENT_MAIEV_STEALTH]) + return; + + if (Phase == PHASE_TALK_SEQUENCE) + AttackStartNoMove(who); + else if (Phase == PHASE_DEMON || Phase == PHASE_TRANSFORM_SEQUENCE) + { + GETUNIT(Illidan, IllidanGUID); + if (Illidan && m_creature->IsWithinDistInMap(Illidan, 25)) + BlinkToPlayer();//Do not let dread aura hurt her. + AttackStartNoMove(who); + } + else + ScriptedAI::AttackStart(who); + } + + void DoAction(const int32 param) + { + if (param > PHASE_ILLIDAN_NULL && param < PHASE_ILLIDAN_MAX) + EnterPhase(PhaseIllidan(param)); + } + + void EnterPhase(PhaseIllidan NextPhase)//This is in fact Illidan's phase. + { + switch(NextPhase) + { + case PHASE_TALK_SEQUENCE: + if (Timer[EVENT_MAIEV_STEALTH]) + { + m_creature->SetHealth(m_creature->GetMaxHealth()); + m_creature->SetVisibility(VISIBILITY_ON); + Timer[EVENT_MAIEV_STEALTH] = 0; + } + m_creature->InterruptNonMeleeSpells(false); + m_creature->GetMotionMaster()->Clear(false); + m_creature->AttackStop(); + m_creature->SetUInt64Value(UNIT_FIELD_TARGET, IllidanGUID); + MaxTimer = 0; + break; + case PHASE_TRANSFORM_SEQUENCE: + MaxTimer = 4; + Timer[EVENT_MAIEV_TAUNT] += 10000; + Timer[EVENT_MAIEV_THROW_DAGGER] = 2000; + break; + case PHASE_DEMON: + break; + case PHASE_NORMAL_MAIEV: + MaxTimer = 4; + Timer[EVENT_MAIEV_TAUNT] += 10000; + Timer[EVENT_MAIEV_TRAP] = 22000; + break; + default: + break; + } + if (Timer[EVENT_MAIEV_STEALTH]) + MaxTimer = 1; + Phase = NextPhase; + } + + void BlinkTo(float x, float y, float z) + { + m_creature->AttackStop(); + m_creature->InterruptNonMeleeSpells(false); + m_creature->GetMotionMaster()->Clear(false); + DoTeleportTo(x, y, z); + DoCast(m_creature, SPELL_TELEPORT_VISUAL, true); + } + + void BlinkToPlayer() + { + if (GETCRE(Illidan, IllidanGUID)) + { + Unit* target = CAST_AI(boss_illidan_stormrageAI, Illidan->AI())->SelectUnit(SELECT_TARGET_RANDOM, 0); + + if (!target || !m_creature->IsWithinDistInMap(target, 80) || Illidan->IsWithinDistInMap(target, 20)) + { + uint8 pos = rand()%4; + BlinkTo(HoverPosition[pos].x, HoverPosition[pos].y, HoverPosition[pos].z); + } + else + { + float x, y, z; + target->GetPosition(x, y, z); + BlinkTo(x, y, z); + } + } + } + + void UpdateAI(const uint32 diff) + { + if ((!UpdateVictim()) + && !Timer[EVENT_MAIEV_STEALTH]) + return; + + Event = EVENT_MAIEV_NULL; + for(uint8 i = 1; i <= MaxTimer; ++i) + if (Timer[i]) + { + if (Timer[i] <= diff) + Event = (EventMaiev)i; + else Timer[i] -= diff; + } + + switch(Event) + { + case EVENT_MAIEV_STEALTH: + { + m_creature->SetHealth(m_creature->GetMaxHealth()); + m_creature->SetVisibility(VISIBILITY_ON); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + Timer[EVENT_MAIEV_STEALTH] = 0; + BlinkToPlayer(); + EnterPhase(Phase); + }break; + case EVENT_MAIEV_TAUNT: + { + uint32 random = rand()%4; + char* text = MaievTaunts[random].text; + uint32 sound = MaievTaunts[random].sound; + m_creature->MonsterYell(text, LANG_UNIVERSAL, 0); + DoPlaySoundToSet(m_creature, sound); + Timer[EVENT_MAIEV_TAUNT] = 22000 + rand()%21 * 1000; + }break; + case EVENT_MAIEV_SHADOW_STRIKE: + DoCast(m_creature->getVictim(), SPELL_SHADOW_STRIKE); + Timer[EVENT_MAIEV_SHADOW_STRIKE] = 60000; + break; + case EVENT_MAIEV_TRAP: + if (Phase == PHASE_NORMAL_MAIEV) + { + BlinkToPlayer(); + DoCast(m_creature, SPELL_CAGE_TRAP_SUMMON); + Timer[EVENT_MAIEV_TRAP] = 22000; + } + else + { + if (!m_creature->IsWithinDistInMap(m_creature->getVictim(), 40)) + m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim(), 30); + DoCast(m_creature->getVictim(), SPELL_THROW_DAGGER); + Timer[EVENT_MAIEV_THROW_DAGGER] = 2000; + } + break; + default: + break; + } + + if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 50) + { + m_creature->SetVisibility(VISIBILITY_OFF); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + if (GETCRE(Illidan, IllidanGUID)) + CAST_AI(boss_illidan_stormrageAI, Illidan->AI())->DeleteFromThreatList(m_creature->GetGUID()); + m_creature->AttackStop(); + Timer[EVENT_MAIEV_STEALTH] = 60000; //reappear after 1 minute + MaxTimer = 1; + } + + if (Phase == PHASE_NORMAL_MAIEV) + DoMeleeAttackIfReady(); + } +}; + + +bool GossipSelect_npc_akama_at_illidan(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF) // Time to begin the Event + { + pPlayer->CLOSE_GOSSIP_MENU(); + CAST_AI(npc_akama_illidanAI, pCreature->AI())->EnterPhase(PHASE_CHANNEL); + } + return true; +} + +bool GossipHello_npc_akama_at_illidan(Player* pPlayer, Creature* pCreature) +{ + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + pPlayer->SEND_GOSSIP_MENU(10465, pCreature->GetGUID()); + + return true; +} + +struct TRINITY_DLL_DECL cage_trap_triggerAI : public ScriptedAI +{ + cage_trap_triggerAI(Creature *c) : ScriptedAI(c) {} + + uint64 IllidanGUID; + uint32 DespawnTimer; + + bool Active; + bool SummonedBeams; + + void Reset() + { + IllidanGUID = 0; + + Active = false; + SummonedBeams = false; + + DespawnTimer = 0; + + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + } + + void EnterCombat(Unit *who){} + + void MoveInLineOfSight(Unit *who) + { + if (!Active) + return; + + if (who && (who->GetTypeId() != TYPEID_PLAYER)) + { + if (who->GetEntry() == ILLIDAN_STORMRAGE) // Check if who is Illidan + { + if (!IllidanGUID && m_creature->IsWithinDistInMap(who, 3) && (!who->HasAura(SPELL_CAGED))) + { + IllidanGUID = who->GetGUID(); + who->CastSpell(who, SPELL_CAGED, true); + DespawnTimer = 5000; + if (who->HasAura(SPELL_ENRAGE)) + who->RemoveAurasDueToSpell(SPELL_ENRAGE); // Dispel his enrage + //if (GameObject* CageTrap = pInstance->instance->GetGameObject(pInstance->GetData64(CageTrapGUID))) + // CageTrap->SetLootState(GO_JUST_DEACTIVATED); + } + } + } + } + + void UpdateAI(const uint32 diff) + { + if (DespawnTimer) + if (DespawnTimer < diff) + m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + else DespawnTimer -= diff; + + //if (IllidanGUID && !SummonedBeams) + //{ + // if (Unit* Illidan = Unit::GetUnit(*m_creature, IllidanGUID) + // { + // //TODO: Find proper spells and properly apply 'caged' Illidan effect + // } + //} + } +}; + +bool GOHello_cage_trap(Player* pPlayer, GameObject* pGo) +{ + float x, y, z; + pPlayer->GetPosition(x, y, z); + + // Grid search for nearest live Creature of entry 23304 within 10 yards + if (Creature* pTrigger = pGo->FindNearestCreature(23304, 10.0f)) + CAST_AI(cage_trap_triggerAI, pTrigger->AI())->Active = true; + pGo->SetGoState(GO_STATE_ACTIVE); + return true; +} + +struct TRINITY_DLL_DECL shadow_demonAI : public ScriptedAI +{ + shadow_demonAI(Creature *c) : ScriptedAI(c) {} + + uint64 TargetGUID; + + void EnterCombat(Unit *who) {DoZoneInCombat();} + + void Reset() + { + TargetGUID = 0; + m_creature->CastSpell(m_creature, SPELL_SHADOW_DEMON_PASSIVE, true); + } + + void JustDied(Unit *killer) + { + if (Unit* target = Unit::GetUnit((*m_creature), TargetGUID)) + target->RemoveAurasDueToSpell(SPELL_PARALYZE); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) return; + + if (m_creature->getVictim()->GetTypeId() != TYPEID_PLAYER) return; // Only cast the below on players. + + if (!m_creature->getVictim()->HasAura(SPELL_PARALYZE)) + { + TargetGUID = m_creature->getVictim()->GetGUID(); + m_creature->AddThreat(m_creature->getVictim(), 10000000.0f); + DoCast(m_creature->getVictim(), SPELL_PURPLE_BEAM, true); + DoCast(m_creature->getVictim(), SPELL_PARALYZE, true); + } + // Kill our target if we're very close. + if (m_creature->IsWithinDistInMap(m_creature->getVictim(), 3)) + DoCast(m_creature->getVictim(), SPELL_CONSUME_SOUL); + } +}; + +// Shadowfiends interact with Illidan, setting more targets in Illidan's hashmap +struct TRINITY_DLL_DECL mob_parasitic_shadowfiendAI : public ScriptedAI +{ + mob_parasitic_shadowfiendAI(Creature* c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + uint64 IllidanGUID; + uint32 CheckTimer; + + void Reset() + { + if (pInstance) + IllidanGUID = pInstance->GetData64(DATA_ILLIDANSTORMRAGE); + else + IllidanGUID = 0; + + CheckTimer = 5000; + DoCast(m_creature, SPELL_SHADOWFIEND_PASSIVE, true); + } + + void EnterCombat(Unit* who) { DoZoneInCombat(); } + + void DoMeleeAttackIfReady() + { + if (m_creature->isAttackReady() && m_creature->IsWithinMeleeRange(m_creature->getVictim())) + { + if (!m_creature->getVictim()->HasAura(SPELL_PARASITIC_SHADOWFIEND) + && !m_creature->getVictim()->HasAura(SPELL_PARASITIC_SHADOWFIEND2)) + { + if (Creature* illidan = Unit::GetCreature((*m_creature),IllidanGUID))//summon only in 1. phase + if (CAST_AI(boss_illidan_stormrageAI, illidan->AI())->Phase == PHASE_NORMAL) + m_creature->CastSpell(m_creature->getVictim(), SPELL_PARASITIC_SHADOWFIEND2, true, 0, 0, IllidanGUID); //do not stack + } + m_creature->AttackerStateUpdate(m_creature->getVictim()); + m_creature->resetAttackTimer(); + } + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->getVictim()) + { + if (Unit *target = SelectTarget(SELECT_TARGET_RANDOM, 0, 999, true)) + AttackStart(target); + else + { + m_creature->SetVisibility(VISIBILITY_OFF); + m_creature->setDeathState(JUST_DIED); + return; + } + } + + if (CheckTimer < diff) + { + GETUNIT(Illidan, IllidanGUID); + if (!Illidan || CAST_CRE(Illidan)->IsInEvadeMode()) + { + m_creature->SetVisibility(VISIBILITY_OFF); + m_creature->setDeathState(JUST_DIED); + return; + }else CheckTimer = 5000; + }else CheckTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +struct TRINITY_DLL_DECL blade_of_azzinothAI : public NullCreatureAI +{ + blade_of_azzinothAI(Creature* c) : NullCreatureAI(c) {} + + void SpellHit(Unit *caster, const SpellEntry *spell) + { + if (spell->Id == SPELL_THROW_GLAIVE2 || spell->Id == SPELL_THROW_GLAIVE) + me->SetDisplayId(21431);//appear when hit by Illidan's glaive + } +}; + +void boss_illidan_stormrageAI::Reset() +{ + if (pInstance) + pInstance->SetData(DATA_ILLIDANSTORMRAGEEVENT, NOT_STARTED); + + if (AkamaGUID) + { + if (GETCRE(Akama, AkamaGUID)) + { + if (!Akama->isAlive()) + Akama->Respawn(); + else + { + CAST_AI(npc_akama_illidanAI, Akama->AI())->EnterEvadeMode(); + Akama->GetMotionMaster()->MoveTargetedHome(); + CAST_AI(npc_akama_illidanAI, Akama->AI())->Reset(); + } + } + AkamaGUID = 0; + } + + MaievGUID = 0; + for(uint8 i = 0; i < 2; ++i) + { + FlameGUID[i] = 0; + GlaiveGUID[i] = 0; + } + + Phase = PHASE_ILLIDAN_NULL; + Event = EVENT_NULL; + Timer[EVENT_BERSERK] = 1500000; + + HoverPoint = 0; + TalkCount = 0; + FlightCount = 0; + TransformCount = 0; + + m_creature->SetDisplayId(21135); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_UNEQUIP, EQUIP_NO_CHANGE); + m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + m_creature->setActive(false); + Summons.DespawnAll(); +} + +void boss_illidan_stormrageAI::JustSummoned(Creature* summon) +{ + Summons.Summon(summon); + switch(summon->GetEntry()) + { + case PARASITIC_SHADOWFIEND: + { + if (Phase == PHASE_TALK_SEQUENCE) + { + summon->SetVisibility(VISIBILITY_OFF); + summon->setDeathState(JUST_DIED); + return; + } + Unit *target = SelectTarget(SELECT_TARGET_TOPAGGRO, 0, 999, true); + if (!target || target->HasAura(SPELL_PARASITIC_SHADOWFIEND) + || target->HasAura(SPELL_PARASITIC_SHADOWFIEND2)) + target = SelectTarget(SELECT_TARGET_RANDOM, 0, 999, true); + if (target) + summon->AI()->AttackStart(target); + }break; + case SHADOW_DEMON: + if (Unit *target = SelectTarget(SELECT_TARGET_RANDOM, 0, 999, true)) // only on players. + { + summon->AddThreat(target, 5000000.0f); + summon->AI()->AttackStart(target); + }break; + case MAIEV_SHADOWSONG: + { + summon->SetVisibility(VISIBILITY_OFF); // Leave her invisible until she has to talk + summon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + MaievGUID = summon->GetGUID(); + CAST_AI(boss_maievAI, summon->AI())->GetIllidanGUID(m_creature->GetGUID()); + summon->AI()->DoAction(PHASE_TALK_SEQUENCE); + }break; + case FLAME_OF_AZZINOTH: + { + summon->AI()->AttackStart(summon->SelectNearestTarget(999)); + }break; + default: + break; + } +} + +void boss_illidan_stormrageAI::HandleTalkSequence() +{ + switch(TalkCount) + { + case 0: + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + break; + case 8: + // Equip our warglaives! + SetEquipmentSlots(false, EQUIP_ID_MAIN_HAND, EQUIP_ID_OFF_HAND, EQUIP_NO_CHANGE); + m_creature->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE); + m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + break; + case 9: + if (GETCRE(Akama, AkamaGUID)) + { + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE); + m_creature->AddThreat(Akama, 100.0f); + CAST_AI(npc_akama_illidanAI, Akama->AI())->EnterPhase(PHASE_FIGHT_ILLIDAN); + EnterPhase(PHASE_NORMAL); + } + break; + case 10: + SummonMaiev(); + break; + case 11: + if (GETUNIT(Maiev, MaievGUID)) + { + Maiev->SetVisibility(VISIBILITY_ON); // Maiev is now visible + Maiev->CastSpell(Maiev, SPELL_TELEPORT_VISUAL, true); // onoz she looks like she teleported! + Maiev->SetInFront(m_creature); // Have her face us + m_creature->SetInFront(Maiev); // Face her, so it's not rude =P + Maiev->GetMotionMaster()->MoveIdle(); + m_creature->GetMotionMaster()->MoveIdle(); + }break; + case 14: + if (GETCRE(Maiev, MaievGUID)) + { + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE); + Maiev->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE); + Maiev->AddThreat(m_creature, 10000000.0f); // Have Maiev add a lot of threat on us so that players don't pull her off if they damage her via AOE + Maiev->AI()->AttackStart(m_creature); // Force Maiev to attack us. + EnterPhase(PHASE_NORMAL_MAIEV); + }break; + case 15: + DoCast(m_creature, SPELL_DEATH); // Animate his kneeling + stun him + Summons.DespawnAll(); + break; + case 17: + if (GETUNIT(Akama, AkamaGUID)) + { + if (!m_creature->IsWithinDistInMap(Akama, 15)) + { + float x, y, z; + m_creature->GetPosition(x, y, z); + x += 10; y += 10; + Akama->GetMotionMaster()->Clear(false); + //Akama->GetMotionMaster()->MoveIdle(); + Akama->GetMap()->CreatureRelocation(m_creature, x, y, z, 0.0f); + Akama->SendMonsterMove(x, y, z, 0, MOVEMENTFLAG_NONE, 0);//Illidan must not die until Akama arrives. + Akama->GetMotionMaster()->MoveChase(m_creature); + } + } + break; + case 19: // Make Maiev leave + if (GETUNIT(Maiev, MaievGUID)) + { + Maiev->CastSpell(Maiev, SPELL_TELEPORT_VISUAL, true); + Maiev->setDeathState(JUST_DIED); + m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,UNIT_STAND_STATE_DEAD); + } + break; + case 21: // Kill ourself. + m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + break; + default: + break; + } + if (Phase == PHASE_TALK_SEQUENCE) + Talk(TalkCount); // This function does most of the talking + TalkCount++; +} + + +void boss_illidan_stormrageAI::CastEyeBlast() +{ + m_creature->InterruptNonMeleeSpells(false); + + m_creature->MonsterYell(SAY_EYE_BLAST, LANG_UNIVERSAL, 0); + DoPlaySoundToSet(m_creature, SOUND_EYE_BLAST); + + float distx, disty, dist[2]; + for(uint8 i = 0; i < 2; ++i) + { + distx = EyeBlast[i].x - HoverPosition[HoverPoint].x; + disty = EyeBlast[i].y - HoverPosition[HoverPoint].y; + dist[i] = distx * distx + disty * disty; + } + Locations initial = EyeBlast[dist[0] < dist[1] ? 0 : 1]; + for(uint8 i = 0; i < 2; ++i) + { + distx = GlaivePosition[i].x - HoverPosition[HoverPoint].x; + disty = GlaivePosition[i].y - HoverPosition[HoverPoint].y; + dist[i] = distx * distx + disty * disty; + } + Locations final = GlaivePosition[dist[0] < dist[1] ? 0 : 1]; + + final.x = 2 * final.x - initial.x; + final.y = 2 * final.y - initial.y; + + Creature* Trigger = m_creature->SummonTrigger(initial.x, initial.y, initial.z, 0, 13000); + if (!Trigger) return; + + Trigger->SetSpeed(MOVE_WALK, 3); + Trigger->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + Trigger->GetMotionMaster()->MovePoint(0, final.x, final.y, final.z); + + //Trigger->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetUInt64Value(UNIT_FIELD_TARGET, Trigger->GetGUID()); + DoCast(Trigger, SPELL_EYE_BLAST); +} + +void boss_illidan_stormrageAI::SummonFlamesOfAzzinoth() +{ + m_creature->MonsterYell(SAY_SUMMONFLAMES, LANG_UNIVERSAL, 0); + DoPlaySoundToSet(m_creature, SOUND_SUMMONFLAMES); + + for(uint8 i = 0; i < 2; ++i) + { + if (GETUNIT(Glaive, GlaiveGUID[i])) + { + Creature* Flame = m_creature->SummonCreature(FLAME_OF_AZZINOTH, GlaivePosition[i+2].x, GlaivePosition[i+2].y, GlaivePosition[i+2].z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000); + if (Flame) + { + Flame->setFaction(m_creature->getFaction()); // Just in case the database has it as a different faction + Flame->SetMeleeDamageSchool(SPELL_SCHOOL_FIRE); + FlameGUID[i] = Flame->GetGUID(); // Record GUID in order to check if they're dead later on to move to the next phase + CAST_AI(flame_of_azzinothAI, Flame->AI())->SetGlaiveGUID(GlaiveGUID[i]); + Glaive->CastSpell(Flame, SPELL_AZZINOTH_CHANNEL, false); // Glaives do some random Beam type channel on it. + } + } + } +} + +void boss_illidan_stormrageAI::SummonMaiev() +{ + m_creature->CastSpell(m_creature, SPELL_SHADOW_PRISON, true); + m_creature->CastSpell(m_creature, 40403, true); + if (!MaievGUID) // If Maiev cannot be summoned, reset the encounter and post some errors to the console. + { + EnterEvadeMode(); + m_creature->MonsterTextEmote("is unable to summon Maiev Shadowsong and enter Phase 4. Resetting Encounter.", 0); + error_log("SD2 ERROR: Unable to summon Maiev Shadowsong (entry: 23197). Check your database to see if you have the proper SQL for Maiev Shadowsong (entry: 23197)"); + } +} + + +void boss_illidan_stormrageAI::EnterPhase(PhaseIllidan NextPhase) +{ + DoZoneInCombat(); + switch(NextPhase) + { + case PHASE_NORMAL: + case PHASE_NORMAL_2: + case PHASE_NORMAL_MAIEV: + AttackStart(m_creature->getVictim()); + Timer[EVENT_TAUNT] = 32000; + Timer[EVENT_SHEAR] = 10000 + rand()%15 * 1000; + Timer[EVENT_FLAME_CRASH] = 20000; + Timer[EVENT_PARASITIC_SHADOWFIEND] = 25000; + Timer[EVENT_PARASITE_CHECK] = 0; + Timer[EVENT_DRAW_SOUL] = 30000; + if (NextPhase == PHASE_NORMAL) + break; + Timer[EVENT_AGONIZING_FLAMES] = 35000; + Timer[EVENT_TRANSFORM_NORMAL] = 60000; + if (NextPhase == PHASE_NORMAL_2) + break; + Timer[EVENT_ENRAGE] = 30000 + rand()%10 * 1000; + break; + case PHASE_FLIGHT: + Timer[EVENT_FIREBALL] = 1000; + if (!(rand()%4)) + Timer[EVENT_DARK_BARRAGE] = 10000; + Timer[EVENT_EYE_BLAST] = 10000 + rand()%15 * 1000; + Timer[EVENT_MOVE_POINT] = 20000 + rand()%20 * 1000; + break; + case PHASE_DEMON: + Timer[EVENT_SHADOW_BLAST] = 1000; + Timer[EVENT_FLAME_BURST] = 10000; + Timer[EVENT_SHADOWDEMON] = 30000; + Timer[EVENT_TRANSFORM_DEMON] = 60000; + AttackStart(m_creature->getVictim()); + break; + case PHASE_TALK_SEQUENCE: + Timer[EVENT_TALK_SEQUENCE] = 100; + m_creature->RemoveAllAuras(); + m_creature->InterruptNonMeleeSpells(false); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE); + m_creature->GetMotionMaster()->Clear(false); + m_creature->AttackStop(); + break; + case PHASE_FLIGHT_SEQUENCE: + if (Phase == PHASE_NORMAL) //lift off + { + FlightCount = 1; + Timer[EVENT_FLIGHT_SEQUENCE] = 1; + m_creature->RemoveAllAuras(); + m_creature->InterruptNonMeleeSpells(false); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->GetMotionMaster()->Clear(false); + m_creature->AttackStop(); + } + else //land + Timer[EVENT_FLIGHT_SEQUENCE] = 2000; + break; + case PHASE_TRANSFORM_SEQUENCE: + if (Phase == PHASE_DEMON) + Timer[EVENT_TRANSFORM_SEQUENCE] = 500; + else + { + TransformCount = 0; + Timer[EVENT_TRANSFORM_SEQUENCE] = 500; + m_creature->MonsterYell(SAY_MORPH, LANG_UNIVERSAL, 0); + DoPlaySoundToSet(m_creature, SOUND_MORPH); + } + m_creature->GetMotionMaster()->Clear(); + m_creature->AttackStop(); + break; + default: + break; + } + if (MaievGUID) + { + GETCRE(Maiev, MaievGUID); + if (Maiev && Maiev->isAlive()) + Maiev->AI()->DoAction(NextPhase); + } + Phase = NextPhase; + Event = EVENT_NULL; +} + +CreatureAI* GetAI_boss_illidan_stormrage(Creature* pCreature) +{ + return new boss_illidan_stormrageAI (pCreature); +} + +CreatureAI* GetAI_npc_akama_at_illidan(Creature* pCreature) +{ + return new npc_akama_illidanAI(pCreature); +} + +CreatureAI* GetAI_boss_maiev(Creature* pCreature) +{ + return new boss_maievAI (pCreature); +} + +CreatureAI* GetAI_mob_flame_of_azzinoth(Creature* pCreature) +{ + return new flame_of_azzinothAI (pCreature); +} + +CreatureAI* GetAI_cage_trap_trigger(Creature* pCreature) +{ + return new cage_trap_triggerAI (pCreature); +} + +CreatureAI* GetAI_shadow_demon(Creature* pCreature) +{ + return new shadow_demonAI (pCreature); +} + +CreatureAI* GetAI_blade_of_azzinoth(Creature* pCreature) +{ + return new blade_of_azzinothAI (pCreature); +} + +CreatureAI* GetAI_parasitic_shadowfiend(Creature* pCreature) +{ + return new mob_parasitic_shadowfiendAI (pCreature); +} + +void AddSC_boss_illidan() +{ + Script* newscript; + + newscript = new Script; + newscript->Name = "boss_illidan_stormrage"; + newscript->GetAI = &GetAI_boss_illidan_stormrage; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_akama_illidan"; + newscript->GetAI = &GetAI_npc_akama_at_illidan; + newscript->pGossipHello = &GossipHello_npc_akama_at_illidan; + newscript->pGossipSelect = &GossipSelect_npc_akama_at_illidan; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_maiev_shadowsong"; + newscript->GetAI = &GetAI_boss_maiev; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_flame_of_azzinoth"; + newscript->GetAI = &GetAI_mob_flame_of_azzinoth; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_blade_of_azzinoth"; + newscript->GetAI = &GetAI_blade_of_azzinoth; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "gameobject_cage_trap"; + newscript->pGOHello = &GOHello_cage_trap; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_cage_trap_trigger"; + newscript->GetAI = &GetAI_cage_trap_trigger; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_shadow_demon"; + newscript->GetAI = &GetAI_shadow_demon; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_parasitic_shadowfiend"; + newscript->GetAI = &GetAI_parasitic_shadowfiend; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/black_temple/boss_mother_shahraz.cpp b/src/bindings/scripts/scripts/outland/black_temple/boss_mother_shahraz.cpp new file mode 100644 index 00000000000..a33874c74cf --- /dev/null +++ b/src/bindings/scripts/scripts/outland/black_temple/boss_mother_shahraz.cpp @@ -0,0 +1,315 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Mother_Shahraz +SD%Complete: 80 +SDComment: Saber Lash missing, Fatal Attraction slightly incorrect; need to damage only if affected players are within range of each other +SDCategory: Black Temple +EndScriptData */ + +#include "precompiled.h" +#include "def_black_temple.h" + +//Speech'n'Sounds +#define SAY_TAUNT1 -1564018 +#define SAY_TAUNT2 -1564019 +#define SAY_TAUNT3 -1564020 +#define SAY_AGGRO -1564021 +#define SAY_SPELL1 -1564022 +#define SAY_SPELL2 -1564023 +#define SAY_SPELL3 -1564024 +#define SAY_SLAY1 -1564025 +#define SAY_SLAY2 -1564026 +#define SAY_ENRAGE -1564027 +#define SAY_DEATH -1564028 + +//Spells +#define SPELL_BEAM_SINISTER 40859 +#define SPELL_BEAM_VILE 40860 +#define SPELL_BEAM_WICKED 40861 +#define SPELL_BEAM_SINFUL 40827 +#define SPELL_ATTRACTION 40871 +#define SPELL_SILENCING_SHRIEK 40823 +#define SPELL_ENRAGE 23537 +#define SPELL_SABER_LASH 40810//43267 +#define SPELL_SABER_LASH_IMM 43690 +#define SPELL_TELEPORT_VISUAL 40869 +#define SPELL_BERSERK 45078 + +uint32 PrismaticAuras[]= +{ + 40880, // Shadow + 40882, // Fire + 40883, // Nature + 40891, // Arcane + 40896, // Frost + 40897, // Holy +}; + +struct Locations +{ + float x,y,z; +}; + +static Locations TeleportPoint[]= +{ + {959.996, 212.576, 193.843}, + {932.537, 231.813, 193.838}, + {958.675, 254.767, 193.822}, + {946.955, 201.316, 192.535}, + {944.294, 149.676, 197.551}, + {930.548, 284.888, 193.367}, + {965.997, 278.398, 195.777} +}; + +struct TRINITY_DLL_DECL boss_shahrazAI : public ScriptedAI +{ + boss_shahrazAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + uint64 TargetGUID[3]; + uint32 BeamTimer; + uint32 BeamCount; + uint32 CurrentBeam; + uint32 PrismaticShieldTimer; + uint32 FatalAttractionTimer; + uint32 FatalAttractionExplodeTimer; + uint32 ShriekTimer; + uint32 SaberTimer; + uint32 RandomYellTimer; + uint32 EnrageTimer; + uint32 ExplosionCount; + + bool Enraged; + + void Reset() + { + if (pInstance) + pInstance->SetData(DATA_MOTHERSHAHRAZEVENT, NOT_STARTED); + + for(uint8 i = 0; i<3; ++i) + TargetGUID[i] = 0; + + BeamTimer = 20000; // Timers may be incorrect + BeamCount = 0; + CurrentBeam = 0; // 0 - Sinister, 1 - Vile, 2 - Wicked, 3 - Sinful + PrismaticShieldTimer = 0; + FatalAttractionTimer = 60000; + FatalAttractionExplodeTimer = 70000; + ShriekTimer = 30000; + SaberTimer = 35000; + RandomYellTimer = 70000 + rand()%41 * 1000; + EnrageTimer = 600000; + ExplosionCount = 0; + + Enraged = false; + } + + void EnterCombat(Unit *who) + { + if (pInstance) + pInstance->SetData(DATA_MOTHERSHAHRAZEVENT, IN_PROGRESS); + + DoZoneInCombat(); + DoScriptText(SAY_AGGRO, m_creature); + } + + void KilledUnit(Unit *victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + } + } + + void JustDied(Unit *victim) + { + if (pInstance) + pInstance->SetData(DATA_MOTHERSHAHRAZEVENT, DONE); + + DoScriptText(SAY_DEATH, m_creature); + } + + void TeleportPlayers() + { + uint32 random = rand()%7; + float X = TeleportPoint[random].x; + float Y = TeleportPoint[random].y; + float Z = TeleportPoint[random].z; + for(uint8 i = 0; i < 3; ++i) + { + Unit* pUnit = SelectUnit(SELECT_TARGET_RANDOM, 1); + if (pUnit && pUnit->isAlive() && (pUnit->GetTypeId() == TYPEID_PLAYER)) + { + TargetGUID[i] = pUnit->GetGUID(); + pUnit->CastSpell(pUnit, SPELL_TELEPORT_VISUAL, true); + DoTeleportPlayer(pUnit, X, Y, Z, pUnit->GetOrientation()); + } + } + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 10) && !Enraged) + { + Enraged = true; + DoCast(m_creature, SPELL_ENRAGE, true); + DoScriptText(SAY_ENRAGE, m_creature); + } + + //Randomly cast one beam. + if (BeamTimer < diff) + { + Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (!target || !target->isAlive()) + return; + + BeamTimer = 9000; + + switch(CurrentBeam) + { + case 0: + DoCast(target, SPELL_BEAM_SINISTER); + break; + case 1: + DoCast(target, SPELL_BEAM_VILE); + break; + case 2: + DoCast(target, SPELL_BEAM_WICKED); + break; + case 3: + DoCast(target, SPELL_BEAM_SINFUL); + break; + } + BeamCount++; + uint32 Beam = CurrentBeam; + if (BeamCount > 3) + while(CurrentBeam == Beam) + CurrentBeam = rand()%3; + + }else BeamTimer -= diff; + + // Random Prismatic Shield every 15 seconds. + if (PrismaticShieldTimer < diff) + { + uint32 random = rand()%6; + if (PrismaticAuras[random]) + DoCast(m_creature, PrismaticAuras[random]); + PrismaticShieldTimer = 15000; + }else PrismaticShieldTimer -= diff; + + // Select 3 random targets (can select same target more than once), teleport to a random location then make them cast explosions until they get away from each other. + if (FatalAttractionTimer < diff) + { + ExplosionCount = 0; + + TeleportPlayers(); + + switch(rand()%2) + { + case 0: DoScriptText(SAY_SPELL2, m_creature); break; + case 1: DoScriptText(SAY_SPELL3, m_creature); break; + } + FatalAttractionExplodeTimer = 2000; + FatalAttractionTimer = 40000 + rand()%31 * 1000; + }else FatalAttractionTimer -= diff; + + if (FatalAttractionExplodeTimer < diff) + { + // Just make them explode three times... they're supposed to keep exploding while they are in range, but it'll take too much code. I'll try to think of an efficient way for it later. + if (ExplosionCount < 3) + { + for(uint8 i = 0; i < 3; ++i) + { + Unit* pUnit = NULL; + if (TargetGUID[i]) + { + pUnit = Unit::GetUnit((*m_creature), TargetGUID[i]); + if (pUnit) + pUnit->CastSpell(pUnit, SPELL_ATTRACTION, true); + TargetGUID[i] = 0; + } + } + + ExplosionCount++; + FatalAttractionExplodeTimer = 1000; + } + else + { + FatalAttractionExplodeTimer = FatalAttractionTimer + 2000; + ExplosionCount = 0; + } + }else FatalAttractionExplodeTimer -= diff; + + if (ShriekTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_SILENCING_SHRIEK); + ShriekTimer = 25000+rand()%10 * 1000; + }else ShriekTimer -= diff; + + if (SaberTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_SABER_LASH); + SaberTimer = 25000+rand()%10 * 1000; + }else SaberTimer -= diff; + + //Enrage + if (!m_creature->HasAura(SPELL_BERSERK)) + if (EnrageTimer < diff) + { + DoCast(m_creature, SPELL_BERSERK); + DoScriptText(SAY_ENRAGE, m_creature); + }else EnrageTimer -= diff; + + //Random taunts + if (RandomYellTimer < diff) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_TAUNT1, m_creature); break; + case 1: DoScriptText(SAY_TAUNT2, m_creature); break; + case 2: DoScriptText(SAY_TAUNT3, m_creature); break; + } + RandomYellTimer = 60000 + rand()%91 * 1000; + }else RandomYellTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_shahraz(Creature* pCreature) +{ + return new boss_shahrazAI (pCreature); +} + +void AddSC_boss_mother_shahraz() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_mother_shahraz"; + newscript->GetAI = &GetAI_boss_shahraz; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/black_temple/boss_reliquary_of_souls.cpp b/src/bindings/scripts/scripts/outland/black_temple/boss_reliquary_of_souls.cpp new file mode 100644 index 00000000000..aa81259e451 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/black_temple/boss_reliquary_of_souls.cpp @@ -0,0 +1,710 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +/* ScriptData +SDName: Boss_Reliquary_of_Souls +SD%Complete: 90 +SDComment: +SDCategory: Black Temple +EndScriptData */ + +#include "precompiled.h" +#include "def_black_temple.h" +#include "Spell.h" + +//Sound'n'speech +//Suffering +#define SUFF_SAY_FREED -1564047 +#define SUFF_SAY_AGGRO -1564048 +#define SUFF_SAY_SLAY1 -1564049 +#define SUFF_SAY_SLAY2 -1564050 +#define SUFF_SAY_SLAY3 -1564051 +#define SUFF_SAY_RECAP -1564052 +#define SUFF_SAY_AFTER -1564053 +#define SUFF_EMOTE_ENRAGE -1564054 + +//Desire +#define DESI_SAY_FREED -1564055 +#define DESI_SAY_SLAY1 -1564056 +#define DESI_SAY_SLAY2 -1564057 +#define DESI_SAY_SLAY3 -1564058 +#define DESI_SAY_SPEC -1564059 +#define DESI_SAY_RECAP -1564060 +#define DESI_SAY_AFTER -1564061 + +//Anger +#define ANGER_SAY_FREED -1564062 +#define ANGER_SAY_FREED2 -1564063 +#define ANGER_SAY_SLAY1 -1564064 +#define ANGER_SAY_SLAY2 -1564065 +#define ANGER_SAY_SPEC -1564066 +#define ANGER_SAY_BEFORE -1564067 +#define ANGER_SAY_DEATH -1564068 + +//Spells +#define AURA_OF_SUFFERING 41292 +#define AURA_OF_SUFFERING_ARMOR 42017 // linked aura, need core support +#define ESSENCE_OF_SUFFERING_PASSIVE 41296 // periodic trigger 41294 +#define ESSENCE_OF_SUFFERING_PASSIVE2 41623 +#define SPELL_FIXATE_TARGET 41294 // dummy, select target +#define SPELL_FIXATE_TAUNT 41295 // force taunt +#define SPELL_ENRAGE 41305 +#define SPELL_SOUL_DRAIN 41303 + +#define AURA_OF_DESIRE 41350 +#define AURA_OF_DESIRE_DAMAGE 41352 +#define SPELL_RUNE_SHIELD 41431 +#define SPELL_DEADEN 41410 +#define SPELL_SOUL_SHOCK 41426 + +#define AURA_OF_ANGER 41337 +#define SPELL_SELF_SEETHE 41364 // force cast 41520 +#define SPELL_ENEMY_SEETHE 41520 +#define SPELL_SOUL_SCREAM 41545 +#define SPELL_SPITE_TARGET 41376 // cast 41377 after 6 sec +#define SPELL_SPITE_DAMAGE 41377 + +#define ENSLAVED_SOUL_PASSIVE 41535 +#define SPELL_SOUL_RELEASE 41542 +#define SPELL_SUBMERGE 37550 //dropout 'head' + +#define CREATURE_ENSLAVED_SOUL 23469 +#define NUMBER_ENSLAVED_SOUL 8 + +struct Position2d +{ + float x,y; +}; + +static Position2d Coords[]= +{ + {450.4, 212.3}, + {542.1, 212.3}, + {542.1, 168.3}, + {542.1, 137.4}, + {450.4, 137.4}, + {450.4, 168.3} +}; + +struct TRINITY_DLL_DECL npc_enslaved_soulAI : public ScriptedAI +{ + npc_enslaved_soulAI(Creature *c) : ScriptedAI(c) {} + + uint64 ReliquaryGUID; + + void Reset() {ReliquaryGUID = 0;} + + void EnterCombat(Unit* who) + { + m_creature->CastSpell(m_creature, ENSLAVED_SOUL_PASSIVE, true); + DoZoneInCombat(); + } + + void JustDied(Unit *killer); +}; + +struct TRINITY_DLL_DECL boss_reliquary_of_soulsAI : public ScriptedAI +{ + boss_reliquary_of_soulsAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + EssenceGUID = 0; + } + + ScriptedInstance* pInstance; + + uint64 EssenceGUID; + + uint32 Phase; + uint32 Counter; + uint32 Timer; + + uint32 SoulCount; + uint32 SoulDeathCount; + + void Reset() + { + if (pInstance) + pInstance->SetData(DATA_RELIQUARYOFSOULSEVENT, NOT_STARTED); + + if (EssenceGUID) + { + if (Creature* Essence = Unit::GetCreature(*m_creature, EssenceGUID)) + { + Essence->ForcedDespawn(); + } + EssenceGUID = 0; + } + + Phase = 0; + + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE); + m_creature->RemoveAurasDueToSpell(SPELL_SUBMERGE); + } + + void EnterCombat(Unit* who) + { + m_creature->AddThreat(who, 10000.0f); + DoZoneInCombat(); + if (pInstance) + pInstance->SetData(DATA_RELIQUARYOFSOULSEVENT, IN_PROGRESS); + + Phase = 1; + Counter = 0; + Timer = 0; + } + + bool SummonSoul() + { + uint32 random = rand()%6; + float x = Coords[random].x; + float y = Coords[random].y; + Creature* Soul = m_creature->SummonCreature(CREATURE_ENSLAVED_SOUL, x, y, m_creature->GetPositionZ(), m_creature->GetOrientation(), TEMPSUMMON_CORPSE_DESPAWN, 0); + if (!Soul) return false; + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + { + CAST_AI(npc_enslaved_soulAI, Soul->AI())->ReliquaryGUID = m_creature->GetGUID(); + Soul->AI()->AttackStart(target); + }else EnterEvadeMode(); + return true; + } + + void MergeThreatList(Creature* target) + { + if (!target) + return; + + std::list& m_threatlist = target->getThreatManager().getThreatList(); + std::list::iterator itr = m_threatlist.begin(); + for(; itr != m_threatlist.end(); itr++) + { + Unit* pUnit = Unit::GetUnit((*m_creature), (*itr)->getUnitGuid()); + if (pUnit) + { + m_creature->AddThreat(pUnit, 1.0f); // This is so that we make sure the unit is in Reliquary's threat list before we reset the unit's threat. + m_creature->getThreatManager().modifyThreatPercent(pUnit, -100); + float threat = target->getThreatManager().getThreat(pUnit); + m_creature->AddThreat(pUnit, threat); // This makes it so that the unit has the same amount of threat in Reliquary's threatlist as in the target creature's (One of the Essences). + } + } + } + + void JustDied(Unit* killer) + { + if (pInstance) + pInstance->SetData(DATA_RELIQUARYOFSOULSEVENT, DONE); + } + + void UpdateAI(const uint32 diff) + { + if (!Phase) + return; + + if (m_creature->getThreatManager().getThreatList().empty()) // Reset if event is begun and we don't have a threatlist + { + EnterEvadeMode(); + return; + } + + Creature* Essence; + if (EssenceGUID) + { + Essence = Unit::GetCreature(*m_creature, EssenceGUID); + if (!Essence) + { + EnterEvadeMode(); + return; + } + } + + if (Timer < diff) + { + switch(Counter) + { + case 0: + m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_READY2H); // I R ANNNGRRRY! + DoStartNoMovement(m_creature); + Timer = 3000; + break; + case 1: + Timer = 2800; + m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_SUBMERGE); // Release the cube + DoCast(m_creature,SPELL_SUBMERGE); + DoStartNoMovement(m_creature); + break; + case 2: + Timer = 5000; + if (Creature* Summon = DoSpawnCreature(23417+Phase, 0, 0, 0, 0, TEMPSUMMON_DEAD_DESPAWN, 0)) + { + m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_SUBMERGED); // Ribs: open + Summon->AI()->AttackStart(SelectUnit(SELECT_TARGET_TOPAGGRO, 0)); + EssenceGUID = Summon->GetGUID(); + DoStartNoMovement(m_creature); + }else EnterEvadeMode(); + break; + case 3: + Timer = 1000; + if (Phase == 3) + { + if (!Essence->isAlive()) + m_creature->CastSpell(m_creature, 7, true); + else return; + } + else + { + if (Essence->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE)) + { + MergeThreatList(Essence); + Essence->RemoveAllAuras(); + Essence->DeleteThreatList(); + Essence->GetMotionMaster()->MoveFollow(m_creature,0.0f,0.0f); + }else return; + } + break; + case 4: + Timer = 1500; + if (Essence->IsWithinDistInMap(m_creature, 10)) + { + Essence->SetUInt32Value(UNIT_NPC_EMOTESTATE,374); //rotate and disappear + Timer = 2000; + m_creature->RemoveAurasDueToSpell(SPELL_SUBMERGE); + } + else + { + MergeThreatList(Essence); + Essence->RemoveAllAuras(); + Essence->DeleteThreatList(); + Essence->GetMotionMaster()->MoveFollow(m_creature, 0, 0); + return; + } + break; + case 5: + if (Phase == 1) + { + DoScriptText(SUFF_SAY_AFTER, Essence); + } + else + { + DoScriptText(DESI_SAY_AFTER, Essence); + } + Essence->ForcedDespawn(); + m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE,0); + EssenceGUID = 0; + SoulCount = 0; + SoulDeathCount = 0; + Timer = 3000; + break; + case 6: + if (SoulCount < NUMBER_ENSLAVED_SOUL) + { + if (SummonSoul()) + SoulCount++; + Timer = 500; + return; + }break; + case 7: + if (SoulDeathCount >= SoulCount) + { + Counter = 1; + Phase++; + Timer = 5000; + } + return; + default: + break; + } + Counter++; + }else Timer -= diff; + } +}; + +struct TRINITY_DLL_DECL boss_essence_of_sufferingAI : public ScriptedAI +{ + boss_essence_of_sufferingAI(Creature *c) : ScriptedAI(c) {} + + uint64 StatAuraGUID; + + uint32 AggroYellTimer; + uint32 FixateTimer; + uint32 EnrageTimer; + uint32 SoulDrainTimer; + uint32 AuraTimer; + + void Reset() + { + StatAuraGUID = 0; + + AggroYellTimer = 5000; + FixateTimer = 8000; + EnrageTimer = 30000; + SoulDrainTimer = 45000; + AuraTimer = 5000; + } + + void DamageTaken(Unit *done_by, uint32 &damage) + { + if (damage >= m_creature->GetHealth()) + { + damage = 0; + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->Yell(SUFF_SAY_RECAP,LANG_UNIVERSAL,0); + DoScriptText(SUFF_SAY_RECAP, m_creature); + } + } + + void EnterCombat(Unit *who) + { + if (!m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE)) + { + DoScriptText(SUFF_SAY_FREED, m_creature); + DoZoneInCombat(); + m_creature->CastSpell(m_creature, AURA_OF_SUFFERING, true); // linked aura need core support + m_creature->CastSpell(m_creature, ESSENCE_OF_SUFFERING_PASSIVE, true); + m_creature->CastSpell(m_creature, ESSENCE_OF_SUFFERING_PASSIVE2, true); + } + else return; + } + + void KilledUnit(Unit *victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SUFF_SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SUFF_SAY_SLAY2, m_creature); break; + case 2: DoScriptText(SUFF_SAY_SLAY3, m_creature); break; + } + } + + void CastFixate() + { + std::list& m_threatlist = m_creature->getThreatManager().getThreatList(); + if (m_threatlist.empty()) + return; // No point continuing if empty threatlist. + std::list targets; + std::list::iterator itr = m_threatlist.begin(); + for(; itr != m_threatlist.end(); ++itr) + { + Unit* pUnit = Unit::GetUnit((*m_creature), (*itr)->getUnitGuid()); + if (pUnit && pUnit->isAlive() && (pUnit->GetTypeId() == TYPEID_PLAYER)) // Only alive players + targets.push_back(pUnit); + } + if (targets.empty()) + return; // No targets added for some reason. No point continuing. + targets.sort(ObjectDistanceOrder(m_creature)); // Sort players by distance. + targets.resize(1); // Only need closest target. + Unit* target = targets.front(); // Get the first target. + if (target) + target->CastSpell(m_creature, SPELL_FIXATE_TAUNT, true); + DoResetThreat(); + m_creature->AddThreat(target,1000000); + } + + void UpdateAI(const uint32 diff) + { + if (m_creature->isInCombat()) + { + //Supposed to be cast on nearest target + if (FixateTimer < diff) + { + CastFixate(); + FixateTimer = 5000; + if (!(rand()%16)) + { + DoScriptText(SUFF_SAY_AGGRO, m_creature); + } + }else FixateTimer -= diff; + } + + //Return since we have no target + if (!UpdateVictim()) + return; + + if (EnrageTimer < diff) + { + DoCast(m_creature, SPELL_ENRAGE); + EnrageTimer = 60000; + DoScriptText(SUFF_EMOTE_ENRAGE, m_creature); + }else EnrageTimer -= diff; + + if (SoulDrainTimer < diff) + { + DoCast(SelectUnit(SELECT_TARGET_RANDOM,0), SPELL_SOUL_DRAIN); + SoulDrainTimer = 60000; + }else SoulDrainTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +struct TRINITY_DLL_DECL boss_essence_of_desireAI : public ScriptedAI +{ + boss_essence_of_desireAI(Creature *c) : ScriptedAI(c) {} + + uint32 RuneShieldTimer; + uint32 DeadenTimer; + uint32 SoulShockTimer; + + void Reset() + { + RuneShieldTimer = 60000; + DeadenTimer = 30000; + SoulShockTimer = 5000; + m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_CONFUSE, true); + } + + void DamageTaken(Unit *done_by, uint32 &damage) + { + if (done_by == m_creature) + return; + + if (damage >= m_creature->GetHealth()) + { + damage = 0; + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + DoScriptText(SUFF_SAY_RECAP, m_creature); + } + else + { + int32 bp0 = damage / 2; + m_creature->CastCustomSpell(done_by, AURA_OF_DESIRE_DAMAGE, &bp0, NULL, NULL, true); + } + } + + void SpellHit(Unit *caster, const SpellEntry *spell) + { + if (m_creature->m_currentSpells[CURRENT_GENERIC_SPELL]) + for(uint8 i = 0; i < 3; ++i) + if (spell->Effect[i] == SPELL_EFFECT_INTERRUPT_CAST) + if (m_creature->m_currentSpells[CURRENT_GENERIC_SPELL]->m_spellInfo->Id == SPELL_SOUL_SHOCK + || m_creature->m_currentSpells[CURRENT_GENERIC_SPELL]->m_spellInfo->Id == SPELL_DEADEN) + m_creature->InterruptSpell(CURRENT_GENERIC_SPELL, false); + } + + void EnterCombat(Unit *who) + { + DoScriptText(DESI_SAY_FREED, m_creature); + DoZoneInCombat(); + DoCast(m_creature, AURA_OF_DESIRE, true); + } + + void KilledUnit(Unit *victim) + { + switch(rand()%3) + { + case 0: DoScriptText(DESI_SAY_SLAY1, m_creature); break; + case 1: DoScriptText(DESI_SAY_SLAY2, m_creature); break; + case 2: DoScriptText(DESI_SAY_SLAY3, m_creature); break; + } + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (RuneShieldTimer < diff) + { + m_creature->InterruptNonMeleeSpells(false); + m_creature->CastSpell(m_creature, SPELL_RUNE_SHIELD, true); + SoulShockTimer += 2000; + DeadenTimer += 2000; + RuneShieldTimer = 60000; + }else RuneShieldTimer -= diff; + + if (SoulShockTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_SOUL_SHOCK); + SoulShockTimer = 5000; + }else SoulShockTimer -= diff; + + if (DeadenTimer < diff) + { + m_creature->InterruptNonMeleeSpells(false); + DoCast(m_creature->getVictim(), SPELL_DEADEN); + DeadenTimer = 25000 + rand()%10000; + if (!(rand()%2)) + { + DoScriptText(DESI_SAY_SPEC, m_creature); + } + }else DeadenTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +struct TRINITY_DLL_DECL boss_essence_of_angerAI : public ScriptedAI +{ + boss_essence_of_angerAI(Creature *c) : ScriptedAI(c) {} + + uint64 AggroTargetGUID; + + uint32 CheckTankTimer; + uint32 SoulScreamTimer; + uint32 SpiteTimer; + + std::list SpiteTargetGUID; + + bool CheckedAggro; + + void Reset() + { + AggroTargetGUID = 0; + + CheckTankTimer = 5000; + SoulScreamTimer = 10000; + SpiteTimer = 30000; + + SpiteTargetGUID.clear(); + + CheckedAggro = false; + } + + void EnterCombat(Unit *who) + { + switch(rand()%2) + { + case 0: DoScriptText(ANGER_SAY_FREED, m_creature); break; + case 1: DoScriptText(ANGER_SAY_FREED2, m_creature); break; + } + + DoZoneInCombat(); + DoCast(m_creature, AURA_OF_ANGER, true); + } + + void JustDied(Unit *victim) + { + DoScriptText(ANGER_SAY_DEATH, m_creature); + } + + void KilledUnit(Unit *victim) + { + switch(rand()%2) + { + case 0: DoScriptText(ANGER_SAY_SLAY1, m_creature); break; + case 1: DoScriptText(ANGER_SAY_SLAY2, m_creature); break; + } + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + if (!CheckedAggro) + { + AggroTargetGUID = m_creature->getVictim()->GetGUID(); + CheckedAggro = true; + } + + if (CheckTankTimer < diff) + { + if (m_creature->getVictim()->GetGUID() != AggroTargetGUID) + { + DoScriptText(ANGER_SAY_BEFORE, m_creature); + DoCast(m_creature, SPELL_SELF_SEETHE, true); + AggroTargetGUID = m_creature->getVictim()->GetGUID(); + } + CheckTankTimer = 2000; + }else CheckTankTimer -= diff; + + if (SoulScreamTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_SOUL_SCREAM); + SoulScreamTimer = 9000 + rand()%2000; + if (!(rand()%3)) + { + DoScriptText(ANGER_SAY_SPEC, m_creature); + } + }else SoulScreamTimer -= diff; + + if (SpiteTimer < diff) + { + DoCast(m_creature, SPELL_SPITE_TARGET); + SpiteTimer = 30000; + DoScriptText(ANGER_SAY_SPEC, m_creature); + }else SpiteTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +void npc_enslaved_soulAI::JustDied(Unit *killer) +{ + if (ReliquaryGUID) + { + Creature* Reliquary = (Unit::GetCreature((*m_creature), ReliquaryGUID)); + if (Reliquary) + CAST_AI(boss_reliquary_of_soulsAI, Reliquary->AI())->SoulDeathCount++; + } + DoCast(m_creature, SPELL_SOUL_RELEASE, true); +} + +CreatureAI* GetAI_boss_reliquary_of_souls(Creature* pCreature) +{ + return new boss_reliquary_of_soulsAI (pCreature); +} + +CreatureAI* GetAI_boss_essence_of_suffering(Creature* pCreature) +{ + return new boss_essence_of_sufferingAI (pCreature); +} + +CreatureAI* GetAI_boss_essence_of_desire(Creature* pCreature) +{ + return new boss_essence_of_desireAI (pCreature); +} + +CreatureAI* GetAI_boss_essence_of_anger(Creature* pCreature) +{ + return new boss_essence_of_angerAI (pCreature); +} + +CreatureAI* GetAI_npc_enslaved_soul(Creature* pCreature) +{ + return new npc_enslaved_soulAI (pCreature); +} + +void AddSC_boss_reliquary_of_souls() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_reliquary_of_souls"; + newscript->GetAI = &GetAI_boss_reliquary_of_souls; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="boss_essence_of_suffering"; + newscript->GetAI = &GetAI_boss_essence_of_suffering; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="boss_essence_of_desire"; + newscript->GetAI = &GetAI_boss_essence_of_desire; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="boss_essence_of_anger"; + newscript->GetAI = &GetAI_boss_essence_of_anger; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_enslaved_soul"; + newscript->GetAI = &GetAI_npc_enslaved_soul; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/black_temple/boss_shade_of_akama.cpp b/src/bindings/scripts/scripts/outland/black_temple/boss_shade_of_akama.cpp new file mode 100644 index 00000000000..ea987bf4963 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/black_temple/boss_shade_of_akama.cpp @@ -0,0 +1,870 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Shade_of_Akama +SD%Complete: 90 +SDComment: Seems to be complete. +SDCategory: Black Temple +EndScriptData */ + +#include "precompiled.h" +#include "def_black_temple.h" + +#define SAY_DEATH -1564013 +#define SAY_LOW_HEALTH -1564014 +// Ending cinematic text +#define SAY_FREE -1564015 +#define SAY_BROKEN_FREE_01 -1564016 +#define SAY_BROKEN_FREE_02 -1564017 + +#define GOSSIP_ITEM "We are ready to fight alongside you, Akama" + +struct Location +{ + float x, y, o, z; +}; + +static Location ChannelerLocations[]= +{ + {463.161285, 401.219757, 3.141592}, + {457.377625, 391.227661, 2.106461}, + {446.012421, 391.227661, 1.071904}, + {439.533783, 401.219757, 0.000000}, + {446.012421, 411.211853, 5.210546}, + {457.377625, 411.211853, 4.177494} +}; + +static Location SpawnLocations[]= +{ + {498.652740, 461.728119, 0}, + {498.505003, 339.619324, 0} +}; + +static Location AkamaWP[]= +{ + {482.352448, 401.162720, 0, 112.783928}, + {469.597443, 402.264404, 0, 118.537910} +}; + +static Location BrokenCoords[]= +{ + {541.375916, 401.439575, M_PI, 112.783997}, // The place where Akama channels + {534.130005, 352.394531, 2.164150, 112.783737}, // Behind a 'pillar' which is behind the east alcove + {499.621185, 341.534729, 1.652856, 112.783730}, // East Alcove + {499.151093, 461.036438, 4.770888, 112.78370}, // West Alcove +}; + +static Location BrokenWP[]= +{ + {492.491638, 400.744690, 3.122336, 112.783737}, + {494.335724, 382.221771, 2.676230, 112.783737}, + {489.555939, 373.507202, 2.416263, 112.783737}, + {491.136353, 427.868774, 3.519748, 112.783737}, +}; + +// Locations +#define Z1 118.543144 +#define Z2 120.783768 +#define Z_SPAWN 113.537949 +#define AGGRO_X 482.793182 +#define AGGRO_Y 401.270172 +#define AGGRO_Z 112.783928 +#define AKAMA_X 514.583984 +#define AKAMA_Y 400.601013 +#define AKAMA_Z 112.783997 + +// Spells +#define SPELL_VERTEX_SHADE_BLACK 39833 +#define SPELL_SHADE_SOUL_CHANNEL 40401 +#define SPELL_DESTRUCTIVE_POISON 40874 +#define SPELL_LIGHTNING_BOLT 42024 +#define SPELL_AKAMA_SOUL_CHANNEL 40447 +#define SPELL_AKAMA_SOUL_RETRIEVE 40902 +#define AKAMA_SOUL_EXPEL 40855 +#define SPELL_SHADE_SOUL_CHANNEL_2 40520 + +// Channeler entry +#define CREATURE_CHANNELER 23421 +#define CREATURE_SORCERER 23215 +#define CREATURE_DEFENDER 23216 +#define CREATURE_BROKEN 23319 + +const uint32 spawnEntries[4]= { 23523, 23318, 23524 }; + +struct TRINITY_DLL_DECL mob_ashtongue_channelerAI : public ScriptedAI +{ + mob_ashtongue_channelerAI(Creature* c) : ScriptedAI(c) {ShadeGUID = 0;} + + uint64 ShadeGUID; + + void Reset() {} + void JustDied(Unit* killer); + void EnterCombat(Unit* who) {} + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) {} +}; + +struct TRINITY_DLL_DECL mob_ashtongue_sorcererAI : public ScriptedAI +{ + mob_ashtongue_sorcererAI(Creature* c) : ScriptedAI(c) {ShadeGUID = 0;} + + uint64 ShadeGUID; + uint32 CheckTimer; + bool StartBanishing; + + void Reset() + { + StartBanishing = false; + CheckTimer = 5000; + } + + void JustDied(Unit* killer); + void EnterCombat(Unit* who) {} + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + if (StartBanishing) + return; + + if (CheckTimer < diff) + { + Creature* Shade = Unit::GetCreature((*m_creature), ShadeGUID); + if (Shade && Shade->isAlive() && m_creature->isAlive()) + { + if (m_creature->IsWithinDist(Shade, 20,false)) + { + m_creature->GetMotionMaster()->Clear(false); + m_creature->GetMotionMaster()->MoveIdle(); + DoCast(Shade, SPELL_SHADE_SOUL_CHANNEL, true); + DoCast(Shade, SPELL_SHADE_SOUL_CHANNEL_2, true); + + StartBanishing = true; + } + } + CheckTimer = 2000; + }else CheckTimer -= diff; + } +}; + +struct TRINITY_DLL_DECL boss_shade_of_akamaAI : public ScriptedAI +{ + boss_shade_of_akamaAI(Creature* c) : ScriptedAI(c), summons(m_creature) + { + pInstance = c->GetInstanceData(); + AkamaGUID = pInstance ? pInstance->GetData64(DATA_AKAMA_SHADE) : 0; + m_creature->setActive(true);//if view distance is too low + m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true); + m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true); + } + + ScriptedInstance* pInstance; + + std::list Channelers; + std::list Sorcerers; + uint64 AkamaGUID; + + uint32 SorcererCount; + uint32 DeathCount; + + uint32 ReduceHealthTimer; + uint32 SummonTimer; + uint32 ResetTimer; + uint32 DefenderTimer; // They are on a flat 15 second timer, independant of the other summon Creature timer. + + bool IsBanished; + bool HasKilledAkama; + bool reseting; + bool GridSearcherSucceeded; + bool HasKilledAkamaAndReseting; + SummonList summons; + + void Reset() + { + reseting = true; + HasKilledAkamaAndReseting = false; + + GridSearcherSucceeded = false; + + Sorcerers.clear(); + summons.DespawnAll();//despawn all adds + + if (Creature* Akama = Unit::GetCreature(*m_creature, AkamaGUID)) + { + Akama->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);//turn gossip on so players can restart the event + if (Akama->isDead()) + { + Akama->Respawn();//respawn akama if dead + Akama->AI()->EnterEvadeMode(); + } + } + SorcererCount = 0; + DeathCount = 0; + + SummonTimer = 10000; + ReduceHealthTimer = 0; + ResetTimer = 60000; + DefenderTimer = 15000; + + IsBanished = true; + HasKilledAkama = false; + + m_creature->SetVisibility(VISIBILITY_ON); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + //m_creature->GetMotionMaster()->Clear(); + //m_creature->GetMotionMaster()->MoveIdle(); + m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_STUN); + + if (pInstance && m_creature->isAlive()) + pInstance->SetData(DATA_SHADEOFAKAMAEVENT, NOT_STARTED); + + reseting = false; + } + void JustDied(Unit* killer) + { + summons.DespawnAll(); + } + void JustSummoned(Creature *summon) + { + if (summon->GetEntry() == CREATURE_DEFENDER || summon->GetEntry() == 23523 || summon->GetEntry() == 23318 || summon->GetEntry() == 23524) + summons.Summon(summon); + } + void SummonedCreatureDespawn(Creature *summon) + { + if (summon->GetEntry() == CREATURE_DEFENDER || summon->GetEntry() == 23523 || summon->GetEntry() == 23318 || summon->GetEntry() == 23524) + summons.Despawn(summon); + } + + void MoveInLineOfSight(Unit *who) + { + if (!GridSearcherSucceeded) + { + FindChannelers(); + + if (!Channelers.empty()) + { + for(std::list::iterator itr = Channelers.begin(); itr != Channelers.end(); ++itr) + { + Creature* Channeler = (Unit::GetCreature(*m_creature, *itr)); + if (Channeler) + { + if (Channeler->isDead()) + { + Channeler->RemoveCorpse(); + Channeler->Respawn(); + } + + Channeler->CastSpell(m_creature, SPELL_SHADE_SOUL_CHANNEL, true); + Channeler->CastSpell(m_creature, SPELL_SHADE_SOUL_CHANNEL_2, true); + Channeler->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + GridSearcherSucceeded = true; + } + } + }else error_log("SD2 ERROR: No Channelers are stored in the list. This encounter will not work properly"); + } + } + + void AttackStart(Unit* who) + { + if (!who || IsBanished) return; + + if (who->isTargetableForAttack() && who != m_creature) + DoStartMovement(who); + } + + void IncrementDeathCount(uint64 guid = 0) // If guid is set, will remove it from list of sorcerer + { + if (reseting) + return; + + debug_log("TSCR: Increasing Death Count for Shade of Akama encounter"); + ++DeathCount; + m_creature->RemoveAuraFromStack(SPELL_SHADE_SOUL_CHANNEL_2); + if (guid) + { + if (Sorcerers.empty()) + error_log("SD2 ERROR: Shade of Akama - attempt to remove guid %u from Sorcerers list but list is already empty", guid); + else Sorcerers.remove(guid); + } + } + + void SummonCreature() + { + uint32 random = rand()%2; + float X = SpawnLocations[random].x; + float Y = SpawnLocations[random].y; + // max of 6 sorcerers can be summoned + if ((rand()%3 == 0) && (DeathCount > 0) && (SorcererCount < 7)) + { + Creature* Sorcerer = m_creature->SummonCreature(CREATURE_SORCERER, X, Y, Z_SPAWN, 0, TEMPSUMMON_DEAD_DESPAWN, 0); + if (Sorcerer) + { + CAST_AI(mob_ashtongue_sorcererAI, Sorcerer->AI())->ShadeGUID = m_creature->GetGUID(); + Sorcerer->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + Sorcerer->GetMotionMaster()->MovePoint(0, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ()); + Sorcerer->SetUInt64Value(UNIT_FIELD_TARGET, m_creature->GetGUID()); + Sorcerers.push_back(Sorcerer->GetGUID()); + --DeathCount; + ++SorcererCount; + } + } + else + { + for(uint8 i = 0; i < 3; ++i) + { + Creature* Spawn = m_creature->SummonCreature(spawnEntries[i], X, Y, Z_SPAWN, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 25000); + if (Spawn) + { + Spawn->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + Spawn->GetMotionMaster()->MovePoint(0, AGGRO_X, AGGRO_Y, AGGRO_Z); + Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1); + Spawn->AI()->AttackStart(target); + } + } + } + } + + void FindChannelers() + { + std::list ChannelerList; + m_creature->GetCreatureListWithEntryInGrid(ChannelerList,CREATURE_CHANNELER,50.0f); + + if (!ChannelerList.empty()) + { + for(std::list::iterator itr = ChannelerList.begin(); itr != ChannelerList.end(); ++itr) + { + CAST_AI(mob_ashtongue_channelerAI, (*itr)->AI())->ShadeGUID = m_creature->GetGUID(); + Channelers.push_back((*itr)->GetGUID()); + debug_log("TSCR: Shade of Akama Grid Search found channeler %u. Adding to list", (*itr)->GetGUID()); + } + } + else error_log("SD2 ERROR: Grid Search was unable to find any channelers. Shade of Akama encounter will be buggy"); + } + + void SetSelectableChannelers() + { + if (Channelers.empty()) + { + error_log("SD2 ERROR: Channeler List is empty, Shade of Akama encounter will be buggy"); + return; + } + + for(std::list::iterator itr = Channelers.begin(); itr != Channelers.end(); ++itr) + if (Creature* Channeler = (Unit::GetCreature(*m_creature, *itr))) + Channeler->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + } + + void SetAkamaGUID(uint64 guid) { AkamaGUID = guid; } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->isInCombat()) + return; + + if (IsBanished) + { + // Akama is set in the threatlist so when we reset, we make sure that he is not included in our check + if (m_creature->getThreatManager().getThreatList().size() < 2) + { + EnterEvadeMode(); + return; + } + + if (DefenderTimer < diff) + { + uint32 ran = rand()%2; + Creature* Defender = m_creature->SummonCreature(CREATURE_DEFENDER, SpawnLocations[ran].x, SpawnLocations[ran].y, Z_SPAWN, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 25000); + if (Defender) + { + Defender->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + bool move = true; + if (AkamaGUID) + { + if (Creature* Akama = Unit::GetCreature(*m_creature, AkamaGUID)) + { + float x, y, z; + Akama->GetPosition(x,y,z); + // They move towards AKama + Defender->GetMotionMaster()->MovePoint(0, x, y, z); + Defender->AI()->AttackStart(Akama); + }else move = false; + }else move = false; + if (!move) + Defender->GetMotionMaster()->MovePoint(0, AKAMA_X, AKAMA_Y, AKAMA_Z); + } + DefenderTimer = 15000; + }else DefenderTimer -= diff; + + if (SummonTimer < diff) + { + SummonCreature(); + SummonTimer = 35000; + }else SummonTimer -= diff; + + if (DeathCount >= 6) + { + if (AkamaGUID) + { + Creature* Akama = Unit::GetCreature((*m_creature), AkamaGUID); + if (Akama && Akama->isAlive()) + { + IsBanished = false; + m_creature->GetMotionMaster()->Clear(false); + m_creature->GetMotionMaster()->MoveChase(Akama); + Akama->GetMotionMaster()->Clear(); + // Shade should move to Akama, not the other way around + Akama->GetMotionMaster()->MoveIdle(); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + // Crazy amount of threat + m_creature->AddThreat(Akama, 10000000.0f); + Akama->AddThreat(m_creature, 10000000.0f); + m_creature->Attack(Akama, true); + Akama->Attack(m_creature, true); + } + } + } + } + else // No longer banished, let's fight Akama now + { + if (ReduceHealthTimer < diff) + { + if (AkamaGUID) + { + Creature* Akama = Unit::GetCreature((*m_creature), AkamaGUID); + if (Akama && Akama->isAlive()) + { + //10 % less health every few seconds. + m_creature->DealDamage(Akama, Akama->GetMaxHealth()/10, NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + ReduceHealthTimer = 12000; + } + } + }else ReduceHealthTimer -= diff; + + if (HasKilledAkama) + { + if (!HasKilledAkamaAndReseting)//do not let players kill Shade if Akama is dead and Shade is waiting for ResetTimer!! event would bug + { + HasKilledAkamaAndReseting = true; + m_creature->RemoveAllAuras(); + m_creature->DeleteThreatList(); + m_creature->CombatStop(); + //m_creature->SetHealth(m_creature->GetMaxHealth()); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->GetMotionMaster()->MoveTargetedHome(); + } + if (ResetTimer < diff) + { + EnterEvadeMode();// Reset a little while after killing Akama, evade and respawn Akama + return; + }else ResetTimer -= diff; + } + + DoMeleeAttackIfReady(); + } + } +}; + +void mob_ashtongue_channelerAI::JustDied(Unit* killer) +{ + Creature* Shade = (Unit::GetCreature((*m_creature), ShadeGUID)); + if (Shade && Shade->isAlive()) + CAST_AI(boss_shade_of_akamaAI, Shade->AI())->IncrementDeathCount(); + else error_log("SD2 ERROR: Channeler dead but unable to increment DeathCount for Shade of Akama."); +} + +void mob_ashtongue_sorcererAI::JustDied(Unit* killer) +{ + Creature* Shade = (Unit::GetCreature((*m_creature), ShadeGUID)); + if (Shade && Shade->isAlive()) + CAST_AI(boss_shade_of_akamaAI, Shade->AI())->IncrementDeathCount(m_creature->GetGUID()); + else error_log("SD2 ERROR: Sorcerer dead but unable to increment DeathCount for Shade of Akama."); +} + +struct TRINITY_DLL_DECL npc_akamaAI : public ScriptedAI +{ + npc_akamaAI(Creature* c) : ScriptedAI(c), summons(m_creature) + { + ShadeHasDied = false; + StartCombat = false; + pInstance = c->GetInstanceData(); + ShadeGUID = pInstance ? pInstance->GetData64(DATA_SHADEOFAKAMA) : NOT_STARTED; + m_creature->setActive(true); + EventBegun = false; + CastSoulRetrieveTimer = 0; + SoulRetrieveTimer = 0; + SummonBrokenTimer = 0; + EndingTalkCount = 0; + WayPointId = 0; + BrokenSummonIndex = 0; + BrokenList.clear(); + HasYelledOnce = false; + } + + ScriptedInstance* pInstance; + + uint64 ShadeGUID; + + uint32 DestructivePoisonTimer; + uint32 LightningBoltTimer; + uint32 CheckTimer; + uint32 CastSoulRetrieveTimer; + uint32 SoulRetrieveTimer; + uint32 SummonBrokenTimer; + uint32 EndingTalkCount; + uint32 WayPointId; + uint32 BrokenSummonIndex; + + std::list BrokenList; + + bool EventBegun; + bool ShadeHasDied; + bool StartCombat; + bool HasYelledOnce; + SummonList summons; + + void Reset() + { + DestructivePoisonTimer = 15000; + LightningBoltTimer = 10000; + CheckTimer = 2000; + + if (!EventBegun) + { + m_creature->SetUInt32Value(UNIT_NPC_FLAGS, 0); // Database sometimes has very very strange values + m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + } + summons.DespawnAll(); + } + + void JustSummoned(Creature *summon) + { + if (summon->GetEntry() == CREATURE_BROKEN) + summons.Summon(summon); + } + void SummonedCreatureDespawn(Creature *summon) + { + if (summon->GetEntry() == CREATURE_BROKEN) + summons.Despawn(summon); + } + + void EnterCombat(Unit* who) {} + + void BeginEvent(Player* pl) + { + if (!pInstance) + return; + + ShadeGUID = pInstance->GetData64(DATA_SHADEOFAKAMA); + if (!ShadeGUID) + return; + + Creature* Shade = (Unit::GetCreature((*m_creature), ShadeGUID)); + if (Shade) + { + pInstance->SetData(DATA_SHADEOFAKAMAEVENT, IN_PROGRESS); + // Prevent players from trying to restart event + m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + CAST_AI(boss_shade_of_akamaAI, Shade->AI())->SetAkamaGUID(m_creature->GetGUID()); + CAST_AI(boss_shade_of_akamaAI, Shade->AI())->SetSelectableChannelers(); + Shade->AddThreat(m_creature, 1000000.0f); + m_creature->CombatStart(Shade); + Shade->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_NONE); + Shade->SetUInt64Value(UNIT_FIELD_TARGET, m_creature->GetGUID()); + if (pl) Shade->AddThreat(pl, 1.0f); + DoZoneInCombat(Shade); + EventBegun = true; + } + } + + void MovementInform(uint32 type, uint32 id) + { + if (type != POINT_MOTION_TYPE) + return; + + switch(id) + { + case 0: ++WayPointId; break; + + case 1: + if (Creature* Shade = Unit::GetCreature(*m_creature, ShadeGUID)) + { + m_creature->SetUInt64Value(UNIT_FIELD_TARGET, ShadeGUID); + DoCast(Shade, SPELL_AKAMA_SOUL_RETRIEVE); + EndingTalkCount = 0; + SoulRetrieveTimer = 16000; + } + break; + } + } + + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + EventBegun = false; + ShadeHasDied = false; + StartCombat = false; + CastSoulRetrieveTimer = 0; + SoulRetrieveTimer = 0; + SummonBrokenTimer = 0; + EndingTalkCount = 0; + WayPointId = 0; + BrokenSummonIndex = 0; + BrokenList.clear(); + HasYelledOnce = false; + Creature* Shade = Unit::GetCreature((*m_creature), ShadeGUID); + if (Shade && Shade->isAlive()) + CAST_AI(boss_shade_of_akamaAI, Shade->AI())->HasKilledAkama = true; + summons.DespawnAll(); + } + + void UpdateAI(const uint32 diff) + { + if (!EventBegun) + return; + + if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 15 && !HasYelledOnce) + { + DoScriptText(SAY_LOW_HEALTH, m_creature); + HasYelledOnce = true; + } + + if (ShadeGUID && !StartCombat) + { + Creature* Shade = (Unit::GetCreature((*m_creature), ShadeGUID)); + if (Shade && Shade->isAlive()) + { + if (CAST_AI(boss_shade_of_akamaAI, Shade->AI())->IsBanished) + { + if (CastSoulRetrieveTimer < diff) + { + DoCast(Shade, SPELL_AKAMA_SOUL_CHANNEL); + CastSoulRetrieveTimer = 500; + }else CastSoulRetrieveTimer -= diff; + } + else + { + m_creature->InterruptNonMeleeSpells(false); + StartCombat = true; + } + } + } + + if (ShadeHasDied && (WayPointId == 1)) + { + if (pInstance) pInstance->SetData(DATA_SHADEOFAKAMAEVENT, DONE); + m_creature->GetMotionMaster()->MovePoint(WayPointId, AkamaWP[1].x, AkamaWP[1].y, AkamaWP[1].z); + ++WayPointId; + } + + if (!ShadeHasDied && StartCombat) + { + if (CheckTimer < diff) + { + if (ShadeGUID) + { + Creature* Shade = Unit::GetCreature((*m_creature), ShadeGUID); + if (Shade && !Shade->isAlive()) + { + ShadeHasDied = true; + WayPointId = 0; + m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + m_creature->GetMotionMaster()->MovePoint(WayPointId, AkamaWP[0].x, AkamaWP[0].y, AkamaWP[0].z); + } + if (Shade && Shade->isAlive()) + { + if (Shade->getThreatManager().getThreatList().size() < 2) + Shade->AI()->EnterEvadeMode(); + } + } + CheckTimer = 5000; + }else CheckTimer -= diff; + } + + if (SummonBrokenTimer && BrokenSummonIndex < 4) + { + if (SummonBrokenTimer <= diff) + { + for(uint8 i = 0; i < 4; ++i) + { + float x = BrokenCoords[BrokenSummonIndex].x + (i*5); + float y = BrokenCoords[BrokenSummonIndex].y + (1*5); + float z = BrokenCoords[BrokenSummonIndex].z; + float o = BrokenCoords[BrokenSummonIndex].o; + Creature* Broken = m_creature->SummonCreature(CREATURE_BROKEN, x, y, z, o, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 360000); + if (Broken) + { + float wx = BrokenWP[BrokenSummonIndex].x + (i*5); + float wy = BrokenWP[BrokenSummonIndex].y + (i*5); + float wz = BrokenWP[BrokenSummonIndex].z; + Broken->GetMotionMaster()->MovePoint(0, wx, wy, wz); + Broken->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + BrokenList.push_back(Broken->GetGUID()); + } + } + ++BrokenSummonIndex; + SummonBrokenTimer = 1000; + }else SummonBrokenTimer -= diff; + } + + if (SoulRetrieveTimer) + if (SoulRetrieveTimer <= diff) + { + switch(EndingTalkCount) + { + case 0: + m_creature->HandleEmoteCommand(EMOTE_ONESHOT_ROAR); + ++EndingTalkCount; + SoulRetrieveTimer = 2000; + SummonBrokenTimer = 1; + break; + case 1: + DoScriptText(SAY_FREE, m_creature); + ++EndingTalkCount; + SoulRetrieveTimer = 25000; + break; + case 2: + if (!BrokenList.empty()) + { + bool Yelled = false; + for(std::list::iterator itr = BrokenList.begin(); itr != BrokenList.end(); ++itr) + if (Creature* pUnit = Unit::GetCreature(*m_creature, *itr)) + { + if (!Yelled) + { + DoScriptText(SAY_BROKEN_FREE_01, pUnit); + Yelled = true; + } + pUnit->HandleEmoteCommand(EMOTE_ONESHOT_KNEEL); + } + } + ++EndingTalkCount; + SoulRetrieveTimer = 1500; + break; + case 3: + if (!BrokenList.empty()) + { + for(std::list::iterator itr = BrokenList.begin(); itr != BrokenList.end(); ++itr) + if (Creature* pUnit = Unit::GetCreature(*m_creature, *itr)) + // This is the incorrect spell, but can't seem to find the right one. + pUnit->CastSpell(pUnit, 39656, true); + } + ++EndingTalkCount; + SoulRetrieveTimer = 5000; + break; + case 4: + if (!BrokenList.empty()) + { + for(std::list::iterator itr = BrokenList.begin(); itr != BrokenList.end(); ++itr) + if (Creature* pUnit = Unit::GetCreature((*m_creature), *itr)) + pUnit->MonsterYell(SAY_BROKEN_FREE_02, LANG_UNIVERSAL, 0); + } + SoulRetrieveTimer = 0; + break; + } + }else SoulRetrieveTimer -= diff; + + if (!UpdateVictim()) + return; + + if (DestructivePoisonTimer < diff) + { + Creature* Shade = Unit::GetCreature((*m_creature), ShadeGUID); + if (Shade && Shade->isAlive()) + DoCast(Shade, SPELL_DESTRUCTIVE_POISON); + DestructivePoisonTimer = 15000; + }else DestructivePoisonTimer -= diff; + + if (LightningBoltTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_LIGHTNING_BOLT); + LightningBoltTimer = 10000; + }else LightningBoltTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_shade_of_akama(Creature* pCreature) +{ + return new boss_shade_of_akamaAI (pCreature); +} + +CreatureAI* GetAI_mob_ashtongue_channeler(Creature* pCreature) +{ + return new mob_ashtongue_channelerAI (pCreature); +} + +CreatureAI* GetAI_mob_ashtongue_sorcerer(Creature* pCreature) +{ + return new mob_ashtongue_sorcererAI (pCreature); +} + +CreatureAI* GetAI_npc_akama_shade(Creature* pCreature) +{ + return new npc_akamaAI (pCreature); +} + +bool GossipSelect_npc_akama(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) //Fight time + { + pPlayer->CLOSE_GOSSIP_MENU(); + CAST_AI(npc_akamaAI, pCreature->AI())->BeginEvent(pPlayer); + } + + return true; +} + +bool GossipHello_npc_akama(Player* pPlayer, Creature* pCreature) +{ + if (pPlayer->isAlive()) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + pPlayer->SEND_GOSSIP_MENU(907, pCreature->GetGUID()); + } + + return true; +} + +void AddSC_boss_shade_of_akama() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_shade_of_akama"; + newscript->GetAI = &GetAI_boss_shade_of_akama; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_ashtongue_channeler"; + newscript->GetAI = &GetAI_mob_ashtongue_channeler; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_ashtongue_sorcerer"; + newscript->GetAI = &GetAI_mob_ashtongue_sorcerer; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_akama_shade"; + newscript->GetAI = &GetAI_npc_akama_shade; + newscript->pGossipHello = &GossipHello_npc_akama; + newscript->pGossipSelect = &GossipSelect_npc_akama; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/black_temple/boss_supremus.cpp b/src/bindings/scripts/scripts/outland/black_temple/boss_supremus.cpp new file mode 100644 index 00000000000..669b0a25629 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/black_temple/boss_supremus.cpp @@ -0,0 +1,296 @@ +/* Copyright (C) 2006 - 2008 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Supremus +SD%Complete: 95 +SDComment: Need to implement molten punch +SDCategory: Black Temple +EndScriptData */ + +#include "precompiled.h" +#include "def_black_temple.h" + +#define EMOTE_NEW_TARGET -1564010 +#define EMOTE_PUNCH_GROUND -1564011 //DoScriptText(EMOTE_PUNCH_GROUND, m_creature); +#define EMOTE_GROUND_CRACK -1564012 + +//Spells +#define SPELL_MOLTEN_PUNCH 40126 +#define SPELL_HATEFUL_STRIKE 41926 +#define SPELL_MOLTEN_FLAME 40980 +#define SPELL_VOLCANIC_ERUPTION 40117 +#define SPELL_VOLCANIC_SUMMON 40276 +#define SPELL_BERSERK 45078 + +#define CREATURE_VOLCANO 23085 +#define CREATURE_STALKER 23095 + +#define PHASE_STRIKE 1 +#define PHASE_CHASE 2 + +#define EVENT_BERSERK 1 +#define EVENT_SWITCH_PHASE 2 +#define EVENT_FLAME 3 +#define EVENT_VOLCANO 4 +#define EVENT_SWITCH_TARGET 5 +#define EVENT_HATEFUL_STRIKE 6 + +#define GCD_CAST 1 + +struct TRINITY_DLL_DECL molten_flameAI : public NullCreatureAI +{ + molten_flameAI(Creature *c) : NullCreatureAI(c) {} + + void InitializeAI() + { + float x, y, z; + me->GetNearPoint(me, x, y, z, 1, 100, M_PI*2*rand_norm()); + me->GetMotionMaster()->MovePoint(0, x, y, z); + me->SetVisibility(VISIBILITY_OFF); + me->CastSpell(me,SPELL_MOLTEN_FLAME,true); + } +}; + +struct TRINITY_DLL_DECL boss_supremusAI : public ScriptedAI +{ + boss_supremusAI(Creature *c) : ScriptedAI(c), summons(m_creature) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + EventMap events; + SummonList summons; + uint32 phase; + + void Reset() + { + if (pInstance) + { + if (m_creature->isAlive()) + { + pInstance->SetData(DATA_SUPREMUSEVENT, NOT_STARTED); + //ToggleDoors(true); + } + //else ToggleDoors(false); + } + + phase = 0; + + events.Reset(); + summons.DespawnAll(); + } + + void EnterCombat(Unit *who) + { + if (pInstance) + pInstance->SetData(DATA_SUPREMUSEVENT, IN_PROGRESS); + + ChangePhase(); + events.ScheduleEvent(EVENT_BERSERK, 900000, GCD_CAST); + events.ScheduleEvent(EVENT_FLAME, 20000, GCD_CAST); + } + + void ChangePhase() + { + if (!phase || phase == PHASE_CHASE) + { + phase = PHASE_STRIKE; + summons.DoAction(EVENT_VOLCANO, 0); + events.ScheduleEvent(EVENT_HATEFUL_STRIKE, 5000, GCD_CAST, PHASE_STRIKE); + m_creature->SetSpeed(MOVE_RUN, 1.2f); + m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, false); + m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, false); + } + else + { + phase = PHASE_CHASE; + events.ScheduleEvent(EVENT_VOLCANO, 5000, GCD_CAST, PHASE_CHASE); + events.ScheduleEvent(EVENT_SWITCH_TARGET, 10000, 0, PHASE_CHASE); + m_creature->SetSpeed(MOVE_RUN, 0.9f); + m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true); + m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true); + } + DoResetThreat(); + DoZoneInCombat(); + events.SetPhase(phase); + events.ScheduleEvent(EVENT_SWITCH_PHASE, 60000, GCD_CAST); + } + + void JustDied(Unit *killer) + { + if (pInstance) + { + pInstance->SetData(DATA_SUPREMUSEVENT, DONE); + pInstance->HandleGameObject(pInstance->GetData64(DATA_GAMEOBJECT_SUPREMUS_DOORS), true); + } + summons.DespawnAll(); + } + + void JustSummoned(Creature *summon) {summons.Summon(summon);} + void SummonedCreatureDespawn(Creature *summon) {summons.Despawn(summon);} + + Unit* CalculateHatefulStrikeTarget() + { + uint32 health = 0; + Unit* target = NULL; + + std::list& m_threatlist = m_creature->getThreatManager().getThreatList(); + std::list::iterator i = m_threatlist.begin(); + for (i = m_threatlist.begin(); i!= m_threatlist.end(); ++i) + { + Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid()); + if (pUnit && m_creature->IsWithinMeleeRange(pUnit)) + { + if (pUnit->GetHealth() > health) + { + health = pUnit->GetHealth(); + target = pUnit; + } + } + } + + return target; + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + events.Update(diff); + + while(uint32 eventId = events.ExecuteEvent()) + { + switch(eventId) + { + case EVENT_BERSERK: + m_creature->CastSpell(m_creature, SPELL_BERSERK, true); + break; + case EVENT_FLAME: + DoCast(m_creature, SPELL_MOLTEN_PUNCH); + events.DelayEvents(1500, GCD_CAST); + events.ScheduleEvent(EVENT_FLAME, 20000, GCD_CAST); + break; + case EVENT_HATEFUL_STRIKE: + if (Unit* target = CalculateHatefulStrikeTarget()) + DoCast(target, SPELL_HATEFUL_STRIKE); + events.DelayEvents(1000, GCD_CAST); + events.ScheduleEvent(EVENT_HATEFUL_STRIKE, 5000, GCD_CAST, PHASE_STRIKE); + break; + case EVENT_SWITCH_TARGET: + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true)) + { + DoResetThreat(); + m_creature->AddThreat(target, 5000000.0f); + DoScriptText(EMOTE_NEW_TARGET, m_creature); + } + events.ScheduleEvent(EVENT_SWITCH_TARGET, 10000, 0, PHASE_CHASE); + break; + case EVENT_VOLCANO: + { + Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 999, true); + if (!target) target = m_creature->getVictim(); + if (target) + { + //DoCast(target, SPELL_VOLCANIC_SUMMON);//movement bugged + m_creature->SummonCreature(CREATURE_VOLCANO,target->GetPositionX(),target->GetPositionY(),target->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN,30000); + DoScriptText(EMOTE_GROUND_CRACK, m_creature); + events.DelayEvents(1500, GCD_CAST); + } + events.ScheduleEvent(EVENT_VOLCANO, 10000, GCD_CAST, PHASE_CHASE); + return; + } + case EVENT_SWITCH_PHASE: + ChangePhase(); + break; + } + } + + DoMeleeAttackIfReady(); + } +}; + +struct TRINITY_DLL_DECL npc_volcanoAI : public Scripted_NoMovementAI +{ + npc_volcanoAI(Creature *c) : Scripted_NoMovementAI(c) {} + + void Reset() + { + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + //DoCast(m_creature, SPELL_VOLCANIC_ERUPTION); + me->SetReactState(REACT_PASSIVE); + wait = 3000; + } + uint32 wait; + + void EnterCombat(Unit *who) {} + + void MoveInLineOfSight(Unit *who) {} + + void DoAction(const uint32 info) + { + m_creature->RemoveAura(SPELL_VOLCANIC_ERUPTION); + } + + void UpdateAI(const uint32 diff) + { + if (wait<=diff)//wait 3secs before casting + { + DoCast(m_creature, SPELL_VOLCANIC_ERUPTION); + wait = 60000; + } + else wait -= diff; + } + +}; + +CreatureAI* GetAI_boss_supremus(Creature* pCreature) +{ + return new boss_supremusAI (pCreature); +} + +CreatureAI* GetAI_molten_flame(Creature* pCreature) +{ + return new molten_flameAI (pCreature); +} + +CreatureAI* GetAI_npc_volcano(Creature* pCreature) +{ + return new npc_volcanoAI (pCreature); +} + +void AddSC_boss_supremus() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_supremus"; + newscript->GetAI = &GetAI_boss_supremus; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="molten_flame"; + newscript->GetAI = &GetAI_molten_flame; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_volcano"; + newscript->GetAI = &GetAI_npc_volcano; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/black_temple/boss_teron_gorefiend.cpp b/src/bindings/scripts/scripts/outland/black_temple/boss_teron_gorefiend.cpp new file mode 100644 index 00000000000..25a82877388 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/black_temple/boss_teron_gorefiend.cpp @@ -0,0 +1,520 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Teron_Gorefiend +SD%Complete: 60 +SDComment: Requires Mind Control support for Ghosts. +SDCategory: Black Temple +EndScriptData */ + +#include "precompiled.h" +#include "def_black_temple.h" + + //Speech'n'sound +#define SAY_INTRO -1564037 +#define SAY_AGGRO -1564038 +#define SAY_SLAY1 -1564039 +#define SAY_SLAY2 -1564040 +#define SAY_SPELL1 -1564041 +#define SAY_SPELL2 -1564042 +#define SAY_SPECIAL1 -1564043 +#define SAY_SPECIAL2 -1564044 +#define SAY_ENRAGE -1564045 +#define SAY_DEATH -1564046 + +//Spells +#define SPELL_INCINERATE 40239 +#define SPELL_CRUSHING_SHADOWS 40243 +#define SPELL_SHADOWBOLT 40185 +#define SPELL_PASSIVE_SHADOWFORM 40326 +#define SPELL_SHADOW_OF_DEATH 40251 +#define SPELL_BERSERK 45078 + +#define SPELL_ATROPHY 40327 // Shadowy Constructs use this when they get within melee range of a player + +#define CREATURE_DOOM_BLOSSOM 23123 +#define CREATURE_SHADOWY_CONSTRUCT 23111 + +struct TRINITY_DLL_DECL mob_doom_blossomAI : public ScriptedAI +{ + mob_doom_blossomAI(Creature *c) : ScriptedAI(c) {} + + uint32 CheckTeronTimer; + uint32 ShadowBoltTimer; + uint64 TeronGUID; + + void Reset() + { + CheckTeronTimer = 5000; + ShadowBoltTimer = 12000; + TeronGUID = 0; + } + + void EnterCombat(Unit *who) { } + void AttackStart(Unit* who) { } + void MoveInLineOfSight(Unit* who) { } + + void Despawn() + { + m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + m_creature->RemoveCorpse(); + } + + void UpdateAI(const uint32 diff) + { + if (CheckTeronTimer < diff) + { + if (TeronGUID) + { + DoZoneInCombat(); + + Creature* Teron = (Unit::GetCreature((*m_creature), TeronGUID)); + if ((Teron) && (!Teron->isAlive() || Teron->IsInEvadeMode())) + Despawn(); + } + else + Despawn(); + + CheckTeronTimer = 5000; + }else CheckTeronTimer -= diff; + + if (ShadowBoltTimer < diff && m_creature->isInCombat()) + { + DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_SHADOWBOLT); + ShadowBoltTimer = 10000; + }else ShadowBoltTimer -= diff; + return; + } + + void SetTeronGUID(uint64 guid){ TeronGUID = guid; } +}; + +struct TRINITY_DLL_DECL mob_shadowy_constructAI : public ScriptedAI +{ + mob_shadowy_constructAI(Creature* c) : ScriptedAI(c) {} + + uint64 GhostGUID; + uint64 TeronGUID; + + uint32 CheckPlayerTimer; + uint32 CheckTeronTimer; + + void Reset() + { + GhostGUID = 0; + TeronGUID = 0; + + CheckPlayerTimer = 2000; + CheckTeronTimer = 5000; + } + + void EnterCombat(Unit* who) { } + + void MoveInLineOfSight(Unit *who) + { + if (!who || (!who->isAlive()) || (who->GetGUID() == GhostGUID)) + return; + + ScriptedAI::MoveInLineOfSight(who); + } + +/* Comment it out for now. NOTE TO FUTURE DEV: UNCOMMENT THIS OUT ONLY AFTER MIND CONTROL IS IMPLEMENTED + void DamageTaken(Unit* done_by, uint32 &damage) + { + if (done_by->GetGUID() != GhostGUID) + damage = 0; // Only the ghost can deal damage. + } + */ + + void CheckPlayers() + { + std::list& m_threatlist = m_creature->getThreatManager().getThreatList(); + if (m_threatlist.empty()) + return; // No threat list. Don't continue. + std::list::iterator itr = m_threatlist.begin(); + std::list targets; + for(; itr != m_threatlist.end(); ++itr) + { + Unit* pUnit = Unit::GetUnit((*m_creature), (*itr)->getUnitGuid()); + if (pUnit && pUnit->isAlive()) + targets.push_back(pUnit); + } + targets.sort(ObjectDistanceOrder(m_creature)); + Unit* target = targets.front(); + if (target && m_creature->IsWithinDistInMap(target, m_creature->GetAttackDistance(target))) + { + DoCast(target, SPELL_ATROPHY); + m_creature->AI()->AttackStart(target); + } + } + + void UpdateAI(const uint32 diff) + { + if (CheckPlayerTimer < diff) + { + CheckPlayers(); + CheckPlayerTimer = 3000; + }else CheckPlayerTimer -= diff; + + if (CheckTeronTimer < diff) + { + Creature* Teron = (Unit::GetCreature((*m_creature), TeronGUID)); + if (!Teron || !Teron->isAlive() || Teron->IsInEvadeMode()) + m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + + CheckTeronTimer = 5000; + }else CheckTeronTimer -= diff; + } +}; + +struct TRINITY_DLL_DECL boss_teron_gorefiendAI : public ScriptedAI +{ + boss_teron_gorefiendAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + uint32 IncinerateTimer; + uint32 SummonDoomBlossomTimer; + uint32 EnrageTimer; + uint32 CrushingShadowsTimer; + uint32 ShadowOfDeathTimer; + uint32 SummonShadowsTimer; + uint32 RandomYellTimer; + uint32 AggroTimer; + + uint64 AggroTargetGUID; + uint64 GhostGUID; // Player that gets killed by Shadow of Death and gets turned into a ghost + + bool Intro; + bool Done; + + void Reset() + { + if (pInstance) + pInstance->SetData(DATA_TERONGOREFIENDEVENT, NOT_STARTED); + + IncinerateTimer = 20000 + rand()%11000; + SummonDoomBlossomTimer = 12000; + EnrageTimer = 600000; + CrushingShadowsTimer = 22000; + SummonShadowsTimer = 60000; + RandomYellTimer = 50000; + + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + // Start off unattackable so that the intro is done properly + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + AggroTimer = 20000; + AggroTargetGUID = 0; + Intro = false; + Done = false; + } + + void EnterCombat(Unit *who) {} + + void MoveInLineOfSight(Unit* pWho) + { + if (!Intro && pWho->GetTypeId() == TYPEID_PLAYER && pWho->isTargetableForAttack() && m_creature->IsHostileTo(pWho) && pWho->isInAccessiblePlaceFor(m_creature)) + { + if (m_creature->IsWithinDistInMap(pWho, VISIBLE_RANGE) && m_creature->IsWithinLOSInMap(pWho)) + { + if (pInstance) + pInstance->SetData(DATA_TERONGOREFIENDEVENT, IN_PROGRESS); + + m_creature->GetMotionMaster()->Clear(false); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + DoScriptText(SAY_INTRO, m_creature); + m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_TALK); + AggroTargetGUID = pWho->GetGUID(); + Intro = true; + } + } + if (Done) + ScriptedAI::MoveInLineOfSight(pWho); + } + + void KilledUnit(Unit *victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + } + } + + void JustDied(Unit *victim) + { + if (pInstance) + pInstance->SetData(DATA_TERONGOREFIENDEVENT, DONE); + + DoScriptText(SAY_DEATH, m_creature); + } + + float CalculateRandomLocation(float Loc, uint32 radius) + { + float coord = Loc; + switch(rand()%2) + { + case 0: + coord += rand()%radius; + break; + case 1: + coord -= rand()%radius; + break; + } + return coord; + } + + void SetThreatList(Creature* Blossom) + { + if (!Blossom) return; + + std::list& m_threatlist = m_creature->getThreatManager().getThreatList(); + std::list::iterator i = m_threatlist.begin(); + for(i = m_threatlist.begin(); i != m_threatlist.end(); ++i) + { + Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid()); + if (pUnit && pUnit->isAlive()) + { + float threat = DoGetThreat(pUnit); + Blossom->AddThreat(pUnit, threat); + } + } + } + + void MindControlGhost() + { + /************************************************************************/ + /** NOTE FOR FUTURE DEVELOPER: PROPERLY IMPLEMENT THE GHOST PORTION *****/ + /** ONLY AFTER TrinIty FULLY IMPLEMENTS MIND CONTROL ABILITIES *****/ + /** THE CURRENT CODE IN THIS FUNCTION IS ONLY THE BEGINNING OF *****/ + /** WHAT IS FULLY NECESSARY FOR GOREFIEND TO BE 100% COMPLETE *****/ + /************************************************************************/ + + Unit* Ghost = NULL; + if (GhostGUID) + Ghost = Unit::GetUnit((*m_creature), GhostGUID); + if (Ghost && Ghost->isAlive() && Ghost->HasAura(SPELL_SHADOW_OF_DEATH)) + { + /*float x,y,z; + Ghost->GetPosition(x,y,z); + Creature* control = m_creature->SummonCreature(CREATURE_GHOST, x, y, z, 0, TEMPSUMMON_TIMED_DESAWN, 30000); + if (control) + { + CAST_PLR(Ghost)->Possess(control); + Ghost->DealDamage(Ghost, Ghost->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, + false); + }*/ + for(uint8 i = 0; i < 4; ++i) + { + Creature* Construct = NULL; + float X = CalculateRandomLocation(Ghost->GetPositionX(), 10); + float Y = CalculateRandomLocation(Ghost->GetPositionY(), 10); + Construct = m_creature->SummonCreature(CREATURE_SHADOWY_CONSTRUCT, X, Y, Ghost->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45000); + if (Construct) + { + Construct->CastSpell(Construct, SPELL_PASSIVE_SHADOWFORM, true); + SetThreatList(Construct); // Use same function as Doom Blossom to set Threat List. + CAST_AI(mob_shadowy_constructAI, Construct->AI())->GhostGUID = GhostGUID; + Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1); + if (!target) // someone's trying to solo. + target = m_creature->getVictim(); + + if (target) + Construct->GetMotionMaster()->MoveChase(target); + } + } + } + } + + void UpdateAI(const uint32 diff) + { + if (Intro && !Done) + { + if (AggroTimer < diff) + { + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + DoScriptText(SAY_AGGRO, m_creature); + m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_NONE); + Done = true; + if (AggroTargetGUID) + { + Unit* pUnit = Unit::GetUnit((*m_creature), AggroTargetGUID); + if (pUnit) + AttackStart(pUnit); + + DoZoneInCombat(); + } + else + { + EnterEvadeMode(); + return; + } + }else AggroTimer -= diff; + } + + if (!UpdateVictim() || !Done) + return; + + if (SummonShadowsTimer < diff) + { + //MindControlGhost(); + + for(uint8 i = 0; i < 2; ++i) + { + Creature* Shadow = NULL; + float X = CalculateRandomLocation(m_creature->GetPositionX(), 10); + Shadow = m_creature->SummonCreature(CREATURE_SHADOWY_CONSTRUCT, X, m_creature->GetPositionY(), m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 0); + if (Shadow) + { + Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1); + if (!target) + target = m_creature->getVictim(); + + if (target) + Shadow->AI()->AttackStart(target); + } + } + SummonShadowsTimer = 60000; + }else SummonShadowsTimer -= diff; + + if (SummonDoomBlossomTimer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + { + float X = CalculateRandomLocation(target->GetPositionX(), 20); + float Y = CalculateRandomLocation(target->GetPositionY(), 20); + float Z = target->GetPositionZ(); + Z = m_creature->GetMap()->GetVmapHeight(X, Y, Z, true); + Creature* DoomBlossom = m_creature->SummonCreature(CREATURE_DOOM_BLOSSOM, X, Y, Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 20000); + if (DoomBlossom) + { + DoomBlossom->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + DoomBlossom->setFaction(m_creature->getFaction()); + DoomBlossom->AddThreat(target, 1.0f); + CAST_AI(mob_doom_blossomAI, DoomBlossom->AI())->SetTeronGUID(m_creature->GetGUID()); + target->CombatStart(DoomBlossom); + SetThreatList(DoomBlossom); + SummonDoomBlossomTimer = 35000; + } + } + }else SummonDoomBlossomTimer -= diff; + + if (IncinerateTimer < diff) + { + Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1); + if (!target) + target = m_creature->getVictim(); + + if (target) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_SPECIAL1, m_creature); break; + case 1: DoScriptText(SAY_SPECIAL2, m_creature); break; + } + DoCast(target, SPELL_INCINERATE); + IncinerateTimer = 20000 + rand()%31 * 1000; + } + }else IncinerateTimer -= diff; + + if (CrushingShadowsTimer < diff) + { + Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (target && target->isAlive()) + DoCast(target, SPELL_CRUSHING_SHADOWS); + CrushingShadowsTimer = 10000 + rand()%16 * 1000; + }else CrushingShadowsTimer -= diff; + + /*** NOTE FOR FUTURE DEV: UNCOMMENT BELOW ONLY IF MIND CONTROL IS FULLY IMPLEMENTED **/ + /*if (ShadowOfDeathTimer < diff) + { + Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1); + + if (!target) + target = m_creature->getVictim(); + + if (target && target->isAlive() && target->GetTypeId() == TYPEID_PLAYER) + { + DoCast(target, SPELL_SHADOW_OF_DEATH); + GhostGUID = target->GetGUID(); + ShadowOfDeathTimer = 30000; + SummonShadowsTimer = 53000; // Make it VERY close but slightly less so that we can check if the aura is still on the player + } + }else ShadowOfDeathTimer -= diff;*/ + + if (RandomYellTimer < diff) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_SPELL1, m_creature); break; + case 1: DoScriptText(SAY_SPELL2, m_creature); break; + } + RandomYellTimer = 50000 + rand()%51 * 1000; + }else RandomYellTimer -= diff; + + if (!m_creature->HasAura(SPELL_BERSERK)) + { + if (EnrageTimer < diff) + { + DoCast(m_creature, SPELL_BERSERK); + DoScriptText(SAY_ENRAGE, m_creature); + }else EnrageTimer -= diff; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_doom_blossom(Creature* pCreature) +{ + return new mob_doom_blossomAI(pCreature); +} + +CreatureAI* GetAI_mob_shadowy_construct(Creature* pCreature) +{ + return new mob_shadowy_constructAI(pCreature); +} + +CreatureAI* GetAI_boss_teron_gorefiend(Creature* pCreature) +{ + return new boss_teron_gorefiendAI (pCreature); +} + +void AddSC_boss_teron_gorefiend() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "mob_doom_blossom"; + newscript->GetAI = &GetAI_mob_doom_blossom; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_shadowy_construct"; + newscript->GetAI = &GetAI_mob_shadowy_construct; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="boss_teron_gorefiend"; + newscript->GetAI = &GetAI_boss_teron_gorefiend; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/black_temple/boss_warlord_najentus.cpp b/src/bindings/scripts/scripts/outland/black_temple/boss_warlord_najentus.cpp new file mode 100644 index 00000000000..1616333b007 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/black_temple/boss_warlord_najentus.cpp @@ -0,0 +1,226 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Warlord_Najentus +SD%Complete: 95 +SDComment: +SDCategory: Black Temple +EndScriptData */ + +#include "precompiled.h" +#include "def_black_temple.h" + +enum +{ + SAY_AGGRO = -1564000, + SAY_NEEDLE1 = -1564001, + SAY_NEEDLE2 = -1564002, + SAY_SLAY1 = -1564003, + SAY_SLAY2 = -1564004, + SAY_SPECIAL1 = -1564005, + SAY_SPECIAL2 = -1564006, + SAY_ENRAGE1 = -1564007, //is this text actually in use? + SAY_ENRAGE2 = -1564008, + SAY_DEATH = -1564009, + + //Spells + SPELL_NEEDLE_SPINE = 39992, + SPELL_TIDAL_BURST = 39878, + SPELL_TIDAL_SHIELD = 39872, + SPELL_IMPALING_SPINE = 39837, + SPELL_CREATE_NAJENTUS_SPINE = 39956, + SPELL_HURL_SPINE = 39948, + SPELL_BERSERK = 26662, + + GOBJECT_SPINE = 185584, + + EVENT_BERSERK = 1, + EVENT_YELL = 2, + EVENT_NEEDLE = 3, + EVENT_SPINE = 4, + EVENT_SHIELD = 5, + + GCD_CAST = 1, + GCD_YELL = 2 +}; + +struct TRINITY_DLL_DECL boss_najentusAI : public ScriptedAI +{ + boss_najentusAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + EventMap events; + + uint64 SpineTargetGUID; + + void Reset() + { + events.Reset(); + + SpineTargetGUID = 0; + + if (pInstance) + pInstance->SetData(DATA_HIGHWARLORDNAJENTUSEVENT, NOT_STARTED); + } + + void KilledUnit(Unit *victim) + { + DoScriptText(rand()%2 ? SAY_SLAY1 : SAY_SLAY2, m_creature); + events.DelayEvents(5000, GCD_YELL); + } + + void JustDied(Unit *victim) + { + if (pInstance) + pInstance->SetData(DATA_HIGHWARLORDNAJENTUSEVENT, DONE); + + DoScriptText(SAY_DEATH, m_creature); + } + + void SpellHit(Unit *caster, const SpellEntry *spell) + { + if (spell->Id == SPELL_HURL_SPINE && m_creature->HasAura(SPELL_TIDAL_SHIELD)) + { + m_creature->RemoveAurasDueToSpell(SPELL_TIDAL_SHIELD); + m_creature->CastSpell(m_creature, SPELL_TIDAL_BURST, true); + ResetTimer(); + } + } + + void EnterCombat(Unit *who) + { + if (pInstance) + pInstance->SetData(DATA_HIGHWARLORDNAJENTUSEVENT, IN_PROGRESS); + + DoScriptText(SAY_AGGRO, m_creature); + DoZoneInCombat(); + events.ScheduleEvent(EVENT_BERSERK, 480000, GCD_CAST); + events.ScheduleEvent(EVENT_YELL, 45000 + (rand()%76)*1000, GCD_YELL); + ResetTimer(); + } + + bool RemoveImpalingSpine() + { + if (!SpineTargetGUID) return false; + Unit* target = Unit::GetUnit(*m_creature, SpineTargetGUID); + if (target && target->HasAura(SPELL_IMPALING_SPINE)) + target->RemoveAurasDueToSpell(SPELL_IMPALING_SPINE); + SpineTargetGUID=0; + return true; + } + + void ResetTimer(uint32 inc = 0) + { + events.RescheduleEvent(EVENT_NEEDLE, 10000 + inc, GCD_CAST); + events.RescheduleEvent(EVENT_SPINE, 20000 + inc, GCD_CAST); + events.RescheduleEvent(EVENT_SHIELD, 60000 + inc); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + events.Update(diff); + + while(uint32 eventId = events.ExecuteEvent()) + { + switch(eventId) + { + case EVENT_SHIELD: + m_creature->CastSpell(m_creature, SPELL_TIDAL_SHIELD, true); + ResetTimer(45000); + break; + case EVENT_BERSERK: + DoScriptText(SAY_ENRAGE2, m_creature); + m_creature->CastSpell(m_creature, SPELL_BERSERK, true); + events.DelayEvents(15000, GCD_YELL); + break; + case EVENT_SPINE: + { + Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1); + if (!target) target = m_creature->getVictim(); + if (target) + { + m_creature->CastSpell(target, SPELL_IMPALING_SPINE, true); + SpineTargetGUID = target->GetGUID(); + //must let target summon, otherwise you cannot click the spine + target->SummonGameObject(GOBJECT_SPINE, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), m_creature->GetOrientation(), 0, 0, 0, 0, 30); + DoScriptText(rand()%2 ? SAY_NEEDLE1 : SAY_NEEDLE2, m_creature); + events.DelayEvents(1500, GCD_CAST); + events.DelayEvents(15000, GCD_YELL); + } + events.ScheduleEvent(EVENT_SPINE, 21000, GCD_CAST); + return; + } + case EVENT_NEEDLE: + { + //m_creature->CastSpell(m_creature, SPELL_NEEDLE_SPINE, true); + std::list target; + SelectTargetList(target, 3, SELECT_TARGET_RANDOM, 80, true); + for(std::list::iterator i = target.begin(); i != target.end(); ++i) + m_creature->CastSpell(*i, 39835, true); + events.ScheduleEvent(EVENT_NEEDLE, 15000+rand()%10000, GCD_CAST); + events.DelayEvents(1500, GCD_CAST); + return; + } + case EVENT_YELL: + DoScriptText(rand()%2 ? SAY_SPECIAL1 : SAY_SPECIAL2, m_creature); + events.ScheduleEvent(EVENT_YELL, 25000 + (rand()%76)*1000, GCD_YELL); + events.DelayEvents(15000, GCD_YELL); + break; + } + } + + DoMeleeAttackIfReady(); + } +}; + +bool GOHello_go_najentus_spine(Player* pPlayer, GameObject* pGo) +{ + if (ScriptedInstance* pInstance = pGo->GetInstanceData()) + if (Creature* Najentus = Unit::GetCreature(*pGo, pInstance->GetData64(DATA_HIGHWARLORDNAJENTUS))) + if (CAST_AI(boss_najentusAI, Najentus->AI())->RemoveImpalingSpine()) + { + pPlayer->CastSpell(pPlayer, SPELL_CREATE_NAJENTUS_SPINE, true); + pGo->DeleteObjectWithOwner(); + } + return true; +} + +CreatureAI* GetAI_boss_najentus(Creature* pCreature) +{ + return new boss_najentusAI (pCreature); +} + +void AddSC_boss_najentus() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_najentus"; + newscript->GetAI = &GetAI_boss_najentus; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "go_najentus_spine"; + newscript->pGOHello = &GOHello_go_najentus_spine; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/black_temple/def_black_temple.h b/src/bindings/scripts/scripts/outland/black_temple/def_black_temple.h new file mode 100644 index 00000000000..c98c0b1c363 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/black_temple/def_black_temple.h @@ -0,0 +1,39 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_BLACK_TEMPLE_H +#define DEF_BLACK_TEMPLE_H + +enum +{ + DATA_AKAMA = 1, + DATA_AKAMA_SHADE = 2, + DATA_GURTOGGBLOODBOILEVENT = 3, + DATA_HIGHWARLORDNAJENTUS = 4, + DATA_HIGHWARLORDNAJENTUSEVENT = 5, + DATA_ILLIDANSTORMRAGE = 6, + DATA_ILLIDANSTORMRAGEEVENT = 7, + DATA_ILLIDARICOUNCILEVENT = 8, + DATA_ILLIDARICOUNCIL = 9, + DATA_LADYMALANDE = 10, + DATA_HIGHNETHERMANCERZEREVOR = 11, + DATA_GATHIOSTHESHATTERER = 12, + DATA_VERASDARKSHADOW = 13, + DATA_MOTHERSHAHRAZEVENT = 14, + DATA_RELIQUARYOFSOULSEVENT = 15, + DATA_SHADEOFAKAMA = 16, + DATA_SHADEOFAKAMAEVENT = 17, + DATA_SUPREMUS = 18, + DATA_SUPREMUSEVENT = 19, + DATA_TERONGOREFIENDEVENT = 20, + DATA_GAMEOBJECT_NAJENTUS_GATE = 21, + DATA_GAMEOBJECT_ILLIDAN_GATE = 22, + DATA_GAMEOBJECT_ILLIDAN_DOOR_R = 23, + DATA_GAMEOBJECT_ILLIDAN_DOOR_L = 24, + DATA_GAMEOBJECT_SUPREMUS_DOORS = 25, + DATA_BLOOD_ELF_COUNCIL_VOICE = 26 +}; + +#endif + diff --git a/src/bindings/scripts/scripts/outland/black_temple/illidari_council.cpp b/src/bindings/scripts/scripts/outland/black_temple/illidari_council.cpp new file mode 100644 index 00000000000..6b86140b659 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/black_temple/illidari_council.cpp @@ -0,0 +1,872 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Illidari_Council +SD%Complete: 95 +SDComment: Circle of Healing not working properly. +SDCategory: Black Temple +EndScriptData */ + +#include "precompiled.h" +#include "def_black_temple.h" + +//Speech'n'Sounds +#define SAY_GATH_SLAY -1564085 +#define SAY_GATH_SLAY_COMNT -1564089 +#define SAY_GATH_DEATH -1564093 +#define SAY_GATH_SPECIAL1 -1564077 +#define SAY_GATH_SPECIAL2 -1564081 + +#define SAY_VERA_SLAY -1564086 +#define SAY_VERA_COMNT -1564089 +#define SAY_VERA_DEATH -1564094 +#define SAY_VERA_SPECIAL1 -1564078 +#define SAY_VERA_SPECIAL2 -1564082 + +#define SAY_MALA_SLAY -1564087 +#define SAY_MALA_COMNT -1564090 +#define SAY_MALA_DEATH -1564095 +#define SAY_MALA_SPECIAL1 -1564079 +#define SAY_MALA_SPECIAL2 -1564083 + +#define SAY_ZERE_SLAY -1564088 +#define SAY_ZERE_COMNT -1564091 +#define SAY_ZERE_DEATH -1564096 +#define SAY_ZERE_SPECIAL1 -1564080 +#define SAY_ZERE_SPECIAL2 -1564084 + +#define ERROR_INST_DATA "SD2 ERROR: Instance Data for Black Temple not set properly; Illidari Council event will not function properly." + +#define AKAMAID 23089 + +struct CouncilYells +{ + int32 entry; + uint32 timer; +}; + +static CouncilYells CouncilAggro[]= +{ + {-1564069, 5000}, // Gathios + {-1564070, 5500}, // Veras + {-1564071, 5000}, // Malande + {-1564072, 0}, // Zerevor +}; + +// Need to get proper timers for this later +static CouncilYells CouncilEnrage[]= +{ + {-1564073, 2000}, // Gathios + {-1564074, 6000}, // Veras + {-1564075, 5000}, // Malande + {-1564076, 0}, // Zerevor +}; + +// High Nethermancer Zerevor's spells +#define SPELL_FLAMESTRIKE 41481 +#define SPELL_BLIZZARD 41482 +#define SPELL_ARCANE_BOLT 41483 +#define SPELL_ARCANE_EXPLOSION 41524 +#define SPELL_DAMPEN_MAGIC 41478 + +// Lady Malande's spells +#define SPELL_EMPOWERED_SMITE 41471 +#define SPELL_CIRCLE_OF_HEALING 41455 +#define SPELL_REFLECTIVE_SHIELD 41475 +#define SPELL_DIVINE_WRATH 41472 +#define SPELL_HEAL_VISUAL 24171 + +// Gathios the Shatterer's spells +#define SPELL_BLESS_PROTECTION 41450 +#define SPELL_BLESS_SPELLWARD 41451 +#define SPELL_CONSECRATION 41541 +#define SPELL_HAMMER_OF_JUSTICE 41468 +#define SPELL_SEAL_OF_COMMAND 41469 +#define SPELL_SEAL_OF_BLOOD 41459 +#define SPELL_CHROMATIC_AURA 41453 +#define SPELL_DEVOTION_AURA 41452 + +// Veras Darkshadow's spells +#define SPELL_DEADLY_POISON 41485 +#define SPELL_ENVENOM 41487 +#define SPELL_VANISH 41479 + +#define SPELL_BERSERK 45078 + +struct TRINITY_DLL_DECL mob_blood_elf_council_voice_triggerAI : public ScriptedAI +{ + mob_blood_elf_council_voice_triggerAI(Creature* c) : ScriptedAI(c) + { + for(uint8 i = 0; i < 4; ++i) + Council[i] = 0; + } + + uint64 Council[4]; + + uint32 EnrageTimer; + uint32 AggroYellTimer; + + uint8 YellCounter; // Serves as the counter for both the aggro and enrage yells + + bool EventStarted; + + void Reset() + { + EnrageTimer = 900000; // 15 minutes + AggroYellTimer = 500; + + YellCounter = 0; + + EventStarted = false; + } + + // finds and stores the GUIDs for each Council member using instance data system. + void LoadCouncilGUIDs() + { + if (ScriptedInstance* pInstance = (m_creature->GetInstanceData())) + { + Council[0] = pInstance->GetData64(DATA_GATHIOSTHESHATTERER); + Council[1] = pInstance->GetData64(DATA_VERASDARKSHADOW); + Council[2] = pInstance->GetData64(DATA_LADYMALANDE); + Council[3] = pInstance->GetData64(DATA_HIGHNETHERMANCERZEREVOR); + }else error_log(ERROR_INST_DATA); + } + + void EnterCombat(Unit* who) {} + + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + + void UpdateAI(const uint32 diff) + { + if (!EventStarted) + return; + + if (YellCounter > 3) + return; + + if (AggroYellTimer) + { + if (AggroYellTimer <= diff) + { + if (Unit* pMember = Unit::GetUnit(*m_creature, Council[YellCounter])) + { + DoScriptText(CouncilAggro[YellCounter].entry, pMember); + AggroYellTimer = CouncilAggro[YellCounter].timer; + } + ++YellCounter; + if (YellCounter > 3) + YellCounter = 0; // Reuse for Enrage Yells + }else AggroYellTimer -= diff; + } + + if (EnrageTimer) + { + if (EnrageTimer <= diff) + { + if (Unit* pMember = Unit::GetUnit(*m_creature, Council[YellCounter])) + { + pMember->CastSpell(pMember, SPELL_BERSERK, true); + DoScriptText(CouncilEnrage[YellCounter].entry, pMember); + EnrageTimer = CouncilEnrage[YellCounter].timer; + } + ++YellCounter; + }else EnrageTimer -= diff; + } + } +}; + +struct TRINITY_DLL_DECL mob_illidari_councilAI : public ScriptedAI +{ + mob_illidari_councilAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + for(uint8 i = 0; i < 4; ++i) + Council[i] = 0; + } + + ScriptedInstance* pInstance; + + uint64 Council[4]; + + uint32 CheckTimer; + uint32 EndEventTimer; + + uint8 DeathCount; + + bool EventBegun; + + void Reset() + { + CheckTimer = 2000; + EndEventTimer = 0; + + DeathCount = 0; + + Creature* pMember = NULL; + for(uint8 i = 0; i < 4; ++i) + { + if (pMember = (Unit::GetCreature((*m_creature), Council[i]))) + { + if (!pMember->isAlive()) + { + pMember->RemoveCorpse(); + pMember->Respawn(); + } + pMember->AI()->EnterEvadeMode(); + } + } + + if (pInstance) + { + pInstance->SetData(DATA_ILLIDARICOUNCILEVENT, NOT_STARTED); + if (Creature* VoiceTrigger = (Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_BLOOD_ELF_COUNCIL_VOICE)))) + VoiceTrigger->AI()->EnterEvadeMode(); + } + + EventBegun = false; + + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetDisplayId(11686); + } + + void EnterCombat(Unit *who) {} + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + + void StartEvent(Unit *target) + { + if (!pInstance) return; + + if (target && target->isAlive()) + { + Council[0] = pInstance->GetData64(DATA_GATHIOSTHESHATTERER); + Council[1] = pInstance->GetData64(DATA_HIGHNETHERMANCERZEREVOR); + Council[2] = pInstance->GetData64(DATA_LADYMALANDE); + Council[3] = pInstance->GetData64(DATA_VERASDARKSHADOW); + + // Start the event for the Voice Trigger + if (Creature* VoiceTrigger = (Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_BLOOD_ELF_COUNCIL_VOICE)))) + { + CAST_AI(mob_blood_elf_council_voice_triggerAI, VoiceTrigger->AI())->LoadCouncilGUIDs(); + CAST_AI(mob_blood_elf_council_voice_triggerAI, VoiceTrigger->AI())->EventStarted = true; + } + + for(uint8 i = 0; i < 4; ++i) + { + Unit* Member = NULL; + if (Council[i]) + { + Member = Unit::GetUnit((*m_creature), Council[i]); + if (Member && Member->isAlive()) + CAST_CRE(Member)->AI()->AttackStart(target); + } + } + + pInstance->SetData(DATA_ILLIDARICOUNCILEVENT, IN_PROGRESS); + + EventBegun = true; + } + } + + void UpdateAI(const uint32 diff) + { + if (!EventBegun) return; + + if (EndEventTimer) + { + if (EndEventTimer <= diff) + { + if (DeathCount > 3) + { + if (pInstance) + { + if (Creature* VoiceTrigger = (Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_BLOOD_ELF_COUNCIL_VOICE)))) + VoiceTrigger->DealDamage(VoiceTrigger, VoiceTrigger->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + pInstance->SetData(DATA_ILLIDARICOUNCILEVENT, DONE); + m_creature->SummonCreature(AKAMAID,746.466980f,304.394989f,311.90208f,6.272870f,TEMPSUMMON_DEAD_DESPAWN,0); + } + m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + return; + } + + Creature* pMember = (Unit::GetCreature(*m_creature, Council[DeathCount])); + if (pMember && pMember->isAlive()) + pMember->DealDamage(pMember, pMember->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + ++DeathCount; + EndEventTimer = 1500; + }else EndEventTimer -= diff; + } + + if (CheckTimer) + { + if (CheckTimer <= diff) + { + uint8 EvadeCheck = 0; + for(uint8 i = 0; i < 4; ++i) + { + if (Council[i]) + { + if (Creature* Member = (Unit::GetCreature((*m_creature), Council[i]))) + { + // This is the evade/death check. + if (Member->isAlive() && !Member->getVictim()) + ++EvadeCheck; //If all members evade, we reset so that players can properly reset the event + else if (!Member->isAlive()) // If even one member dies, kill the rest, set instance data, and kill self. + { + EndEventTimer = 1000; + CheckTimer = 0; + return; + } + } + } + } + + if (EvadeCheck > 3) + Reset(); + + CheckTimer = 2000; + }else CheckTimer -= diff; + } + + } +}; + +struct TRINITY_DLL_DECL boss_illidari_councilAI : public ScriptedAI +{ + boss_illidari_councilAI(Creature* c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + for(uint8 i = 0; i < 4; ++i) + Council[i] = 0; + LoadedGUIDs = false; + } + + uint64 Council[4]; + + ScriptedInstance* pInstance; + + bool LoadedGUIDs; + + void EnterCombat(Unit* who) + { + if (pInstance) + { + Creature* Controller = (Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_ILLIDARICOUNCIL))); + if (Controller) + CAST_AI(mob_illidari_councilAI, Controller->AI())->StartEvent(who); + } + else + { + error_log(ERROR_INST_DATA); + EnterEvadeMode(); + return; + } + DoZoneInCombat(); + // Load GUIDs on first aggro because the Creature guids are only set as the creatures are created in world- + // this means that for each pCreature, it will attempt to LoadGUIDs even though some of the other creatures are + // not in world, and thus have no GUID set in the instance data system. Putting it in aggro ensures that all the creatures + // have been loaded and have their GUIDs set in the instance data system. + if (!LoadedGUIDs) + LoadGUIDs(); + } + + void EnterEvadeMode() + { + for(uint8 i = 0; i < 4; ++i) + { + if (Unit* pUnit = Unit::GetUnit(*m_creature, Council[i])) + if (pUnit != m_creature && pUnit->getVictim()) + { + AttackStart(pUnit->getVictim()); + return; + } + } + ScriptedAI::EnterEvadeMode(); + } + + void DamageTaken(Unit* done_by, uint32 &damage) + { + if (done_by == m_creature) + return; + + damage /= 4; + for(uint8 i = 0; i < 4; ++i) + { + if (Creature* pUnit = Unit::GetCreature(*m_creature, Council[i])) + if (pUnit != m_creature && damage < pUnit->GetHealth()) + { + pUnit->SetHealth(pUnit->GetHealth() - damage); + pUnit->LowerPlayerDamageReq(damage); + } + } + } + + void LoadGUIDs() + { + if (!pInstance) + { + error_log(ERROR_INST_DATA); + return; + } + + Council[0] = pInstance->GetData64(DATA_LADYMALANDE); + Council[1] = pInstance->GetData64(DATA_HIGHNETHERMANCERZEREVOR); + Council[2] = pInstance->GetData64(DATA_GATHIOSTHESHATTERER); + Council[3] = pInstance->GetData64(DATA_VERASDARKSHADOW); + + LoadedGUIDs = true; + } +}; + +struct TRINITY_DLL_DECL boss_gathios_the_shattererAI : public boss_illidari_councilAI +{ + boss_gathios_the_shattererAI(Creature *c) : boss_illidari_councilAI(c) {} + + uint32 ConsecrationTimer; + uint32 HammerOfJusticeTimer; + uint32 SealTimer; + uint32 AuraTimer; + uint32 BlessingTimer; + + void Reset() + { + ConsecrationTimer = 40000; + HammerOfJusticeTimer = 10000; + SealTimer = 40000; + AuraTimer = 90000; + BlessingTimer = 60000; + } + + void KilledUnit(Unit *victim) + { + DoScriptText(SAY_GATH_SLAY, m_creature); + } + + void JustDied(Unit *victim) + { + DoScriptText(SAY_GATH_DEATH, m_creature); + } + + Unit* SelectCouncilMember() + { + Unit* pUnit = m_creature; + uint32 member = 0; // He chooses Lady Malande most often + + if (rand()%10 == 0) // But there is a chance he picks someone else. + member = urand(1, 3); + + if (member != 2) // No need to create another pointer to us using Unit::GetUnit + pUnit = Unit::GetUnit((*m_creature), Council[member]); + return pUnit; + } + + void CastAuraOnCouncil() + { + uint32 spellid = 0; + switch(rand()%2) + { + case 0: spellid = SPELL_DEVOTION_AURA; break; + case 1: spellid = SPELL_CHROMATIC_AURA; break; + } + for(uint8 i = 0; i < 4; ++i) + { + Unit* pUnit = Unit::GetUnit((*m_creature), Council[i]); + if (pUnit) + pUnit->CastSpell(pUnit, spellid, true, 0, 0, m_creature->GetGUID()); + } + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (BlessingTimer < diff) + { + if (Unit* pUnit = SelectCouncilMember()) + { + switch(rand()%2) + { + case 0: DoCast(pUnit, SPELL_BLESS_SPELLWARD); break; + case 1: DoCast(pUnit, SPELL_BLESS_PROTECTION); break; + } + } + BlessingTimer = 60000; + }else BlessingTimer -= diff; + + if (ConsecrationTimer < diff) + { + DoCast(m_creature, SPELL_CONSECRATION); + ConsecrationTimer = 40000; + }else ConsecrationTimer -= diff; + + if (HammerOfJusticeTimer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + { + // is in ~10-40 yd range + if (m_creature->IsInRange(target, 10.0f, 40.0f, false)) + { + DoCast(target, SPELL_HAMMER_OF_JUSTICE); + HammerOfJusticeTimer = 20000; + } + } + }else HammerOfJusticeTimer -= diff; + + if (SealTimer < diff) + { + switch(rand()%2) + { + case 0: DoCast(m_creature, SPELL_SEAL_OF_COMMAND); break; + case 1: DoCast(m_creature, SPELL_SEAL_OF_BLOOD); break; + } + SealTimer = 40000; + }else SealTimer -= diff; + + if (AuraTimer < diff) + { + CastAuraOnCouncil(); + AuraTimer = 90000; + }else AuraTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +struct TRINITY_DLL_DECL boss_high_nethermancer_zerevorAI : public boss_illidari_councilAI +{ + boss_high_nethermancer_zerevorAI(Creature *c) : boss_illidari_councilAI(c) {} + + uint32 BlizzardTimer; + uint32 FlamestrikeTimer; + uint32 ArcaneBoltTimer; + uint32 DampenMagicTimer; + uint32 Cooldown; + uint32 ArcaneExplosionTimer; + + void Reset() + { + BlizzardTimer = 30000 + rand()%61 * 1000; + FlamestrikeTimer = 30000 + rand()%61 * 1000; + ArcaneBoltTimer = 10000; + DampenMagicTimer = 2000; + ArcaneExplosionTimer = 14000; + Cooldown = 0; + } + + void KilledUnit(Unit *victim) + { + DoScriptText(SAY_ZERE_SLAY, m_creature); + } + + void JustDied(Unit *victim) + { + DoScriptText(SAY_ZERE_DEATH, m_creature); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (Cooldown) + { + if (Cooldown < diff) Cooldown = 0; + else + { + Cooldown -= diff; + return; // Don't cast any other spells if global cooldown is still ticking + } + } + + if (DampenMagicTimer < diff) + { + DoCast(m_creature, SPELL_DAMPEN_MAGIC); + Cooldown = 1000; + DampenMagicTimer = 67200; // almost 1,12 minutes + ArcaneBoltTimer += 1000; // Give the Mage some time to spellsteal Dampen. + }else DampenMagicTimer -= diff; + + if (ArcaneExplosionTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_ARCANE_EXPLOSION); + Cooldown = 1000; + ArcaneExplosionTimer = 14000; + }else ArcaneExplosionTimer -= diff; + + if (ArcaneBoltTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_ARCANE_BOLT); + ArcaneBoltTimer = 3000; + Cooldown = 2000; + }else ArcaneBoltTimer -= diff; + + if (BlizzardTimer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + { + DoCast(target, SPELL_BLIZZARD); + BlizzardTimer = 45000 + rand()%46 * 1000; + FlamestrikeTimer += 10000; + Cooldown = 1000; + } + }else BlizzardTimer -= diff; + + if (FlamestrikeTimer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + { + DoCast(target, SPELL_FLAMESTRIKE); + FlamestrikeTimer = 55000 + rand()%46 * 1000; + BlizzardTimer += 10000; + Cooldown = 2000; + } + }else FlamestrikeTimer -= diff; + } +}; + +struct TRINITY_DLL_DECL boss_lady_malandeAI : public boss_illidari_councilAI +{ + boss_lady_malandeAI(Creature *c) : boss_illidari_councilAI(c) {} + + uint32 EmpoweredSmiteTimer; + uint32 CircleOfHealingTimer; + uint32 DivineWrathTimer; + uint32 ReflectiveShieldTimer; + + void Reset() + { + EmpoweredSmiteTimer = 38000; + CircleOfHealingTimer = 20000; + DivineWrathTimer = 40000; + ReflectiveShieldTimer = 0; + } + + void KilledUnit(Unit *victim) + { + DoScriptText(SAY_MALA_SLAY, m_creature); + } + + void JustDied(Unit *victim) + { + DoScriptText(SAY_MALA_DEATH, m_creature); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (EmpoweredSmiteTimer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + { + DoCast(target, SPELL_EMPOWERED_SMITE); + EmpoweredSmiteTimer = 38000; + } + }else EmpoweredSmiteTimer -= diff; + + if (CircleOfHealingTimer < diff) + { + DoCast(m_creature, SPELL_CIRCLE_OF_HEALING); + CircleOfHealingTimer = 60000; + }else CircleOfHealingTimer -= diff; + + if (DivineWrathTimer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + { + DoCast(target, SPELL_DIVINE_WRATH); + DivineWrathTimer = 40000 + rand()%41 * 1000; + } + }else DivineWrathTimer -= diff; + + if (ReflectiveShieldTimer < diff) + { + DoCast(m_creature, SPELL_REFLECTIVE_SHIELD); + ReflectiveShieldTimer = 65000; + }else ReflectiveShieldTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +struct TRINITY_DLL_DECL boss_veras_darkshadowAI : public boss_illidari_councilAI +{ + boss_veras_darkshadowAI(Creature *c) : boss_illidari_councilAI(c) {} + + uint64 EnvenomTargetGUID; + + uint32 DeadlyPoisonTimer; + uint32 VanishTimer; + uint32 AppearEnvenomTimer; + + bool HasVanished; + + void Reset() + { + EnvenomTargetGUID = 0; + + DeadlyPoisonTimer = 20000; + VanishTimer = 60000 + rand()%61 * 1000; + AppearEnvenomTimer = 150000; + + HasVanished = false; + m_creature->SetVisibility(VISIBILITY_ON); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + } + + void KilledUnit(Unit *victim) + { + DoScriptText(SAY_VERA_SLAY, m_creature); + } + + void JustDied(Unit *victim) + { + DoScriptText(SAY_VERA_DEATH, m_creature); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (!HasVanished) + { + if (DeadlyPoisonTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_DEADLY_POISON); + DeadlyPoisonTimer = 15000 + rand()%31 * 1000; + }else DeadlyPoisonTimer -= diff; + + if (AppearEnvenomTimer < diff) // Cast Envenom. This is cast 4 seconds after Vanish is over + { + DoCast(m_creature->getVictim(), SPELL_ENVENOM); + AppearEnvenomTimer = 90000; + }else AppearEnvenomTimer -= diff; + + if (VanishTimer < diff) // Disappear and stop attacking, but follow a random unit + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + { + VanishTimer = 30000; + AppearEnvenomTimer= 28000; + HasVanished = true; + m_creature->SetVisibility(VISIBILITY_OFF); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + DoResetThreat(); + // Chase a unit. Check before DoMeleeAttackIfReady prevents from attacking + m_creature->AddThreat(target, 500000.0f); + m_creature->GetMotionMaster()->MoveChase(target); + } + }else VanishTimer -= diff; + + DoMeleeAttackIfReady(); + } + else + { + if (VanishTimer < diff) // Become attackable and poison current target + { + Unit* target = m_creature->getVictim(); + DoCast(target, SPELL_DEADLY_POISON); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + DoResetThreat(); + m_creature->AddThreat(target, 3000.0f); // Make Veras attack his target for a while, he will cast Envenom 4 seconds after. + DeadlyPoisonTimer += 6000; + VanishTimer = 90000; + AppearEnvenomTimer = 4000; + HasVanished = false; + }else VanishTimer -= diff; + + if (AppearEnvenomTimer < diff) // Appear 2 seconds before becoming attackable (Shifting out of vanish) + { + m_creature->GetMotionMaster()->Clear(); + m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); + m_creature->SetVisibility(VISIBILITY_ON); + AppearEnvenomTimer = 6000; + }else AppearEnvenomTimer -= diff; + } + } +}; + +CreatureAI* GetAI_mob_blood_elf_council_voice_trigger(Creature* c) +{ + return new mob_blood_elf_council_voice_triggerAI(c); +} + +CreatureAI* GetAI_mob_illidari_council(Creature* pCreature) +{ + return new mob_illidari_councilAI (pCreature); +} + +CreatureAI* GetAI_boss_gathios_the_shatterer(Creature* pCreature) +{ + return new boss_gathios_the_shattererAI (pCreature); +} + +CreatureAI* GetAI_boss_lady_malande(Creature* pCreature) +{ + return new boss_lady_malandeAI (pCreature); +} + +CreatureAI* GetAI_boss_veras_darkshadow(Creature* pCreature) +{ + return new boss_veras_darkshadowAI (pCreature); +} + +CreatureAI* GetAI_boss_high_nethermancer_zerevor(Creature* pCreature) +{ + return new boss_high_nethermancer_zerevorAI (pCreature); +} + +void AddSC_boss_illidari_council() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="mob_illidari_council"; + newscript->GetAI = &GetAI_mob_illidari_council; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_blood_elf_council_voice_trigger"; + newscript->GetAI = &GetAI_mob_blood_elf_council_voice_trigger; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="boss_gathios_the_shatterer"; + newscript->GetAI = &GetAI_boss_gathios_the_shatterer; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="boss_lady_malande"; + newscript->GetAI = &GetAI_boss_lady_malande; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="boss_veras_darkshadow"; + newscript->GetAI = &GetAI_boss_veras_darkshadow; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="boss_high_nethermancer_zerevor"; + newscript->GetAI = &GetAI_boss_high_nethermancer_zerevor; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/black_temple/instance_black_temple.cpp b/src/bindings/scripts/scripts/outland/black_temple/instance_black_temple.cpp new file mode 100644 index 00000000000..173632009ba --- /dev/null +++ b/src/bindings/scripts/scripts/outland/black_temple/instance_black_temple.cpp @@ -0,0 +1,346 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +/* ScriptData +SDName: Instance_Black_Temple +SD%Complete: 100 +SDComment: Instance Data Scripts and functions to acquire mobs and set encounter status for use in various Black Temple Scripts +SDCategory: Black Temple +EndScriptData */ + +#include "precompiled.h" +#include "def_black_temple.h" + +#define MAX_ENCOUNTER 9 + +/* Black Temple encounters: +0 - High Warlord Naj'entus event +1 - Supremus Event +2 - Shade of Akama Event +3 - Teron Gorefiend Event +4 - Gurtogg Bloodboil Event +5 - Reliquary Of Souls Event +6 - Mother Shahraz Event +7 - Illidari Council Event +8 - Illidan Stormrage Event +*/ + +struct TRINITY_DLL_DECL instance_black_temple : public ScriptedInstance +{ + instance_black_temple(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + std::string str_data; + + uint64 Najentus; + uint64 Akama; // This is the Akama that starts the Illidan encounter. + uint64 Akama_Shade; // This is the Akama that starts the Shade of Akama encounter. + uint64 ShadeOfAkama; + uint64 Supremus; + uint64 LadyMalande; + uint64 GathiosTheShatterer; + uint64 HighNethermancerZerevor; + uint64 VerasDarkshadow; + uint64 IllidariCouncil; + uint64 BloodElfCouncilVoice; + uint64 IllidanStormrage; + + uint64 NajentusGate; + uint64 MainTempleDoors; + uint64 ShadeOfAkamaDoor; + uint64 CommonDoor;//Teron + uint64 TeronDoor; + uint64 GuurtogDoor; + uint64 MotherDoor; + uint64 TempleDoor;//Befor mother + uint64 CouncilDoor; + uint64 SimpleDoor;//council + uint64 IllidanGate; + uint64 IllidanDoor[2]; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + Najentus = 0; + Akama = 0; + Akama_Shade = 0; + ShadeOfAkama = 0; + Supremus = 0; + LadyMalande = 0; + GathiosTheShatterer = 0; + HighNethermancerZerevor = 0; + VerasDarkshadow = 0; + IllidariCouncil = 0; + BloodElfCouncilVoice = 0; + IllidanStormrage = 0; + + NajentusGate = 0; + MainTempleDoors = 0; + ShadeOfAkamaDoor= 0; + CommonDoor = 0;//teron + TeronDoor = 0; + GuurtogDoor = 0; + MotherDoor = 0; + TempleDoor = 0; + SimpleDoor = 0;//Bycouncil + CouncilDoor = 0; + IllidanGate = 0; + IllidanDoor[0] = 0; + IllidanDoor[1] = 0; + } + + bool IsEncounterInProgress() const + { + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) return true; + + return false; + } + + Player* GetPlayerInMap() + { + Map::PlayerList const& players = instance->GetPlayers(); + + if (!players.isEmpty()) + { + for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + { + if (Player* plr = itr->getSource()) + return plr; + } + } + + debug_log("TSCR: Instance Black Temple: GetPlayerInMap, but PlayerList is empty!"); + return NULL; + } + + void OnCreatureCreate(Creature* pCreature, bool add) + { + switch(pCreature->GetEntry()) + { + case 22887: Najentus = pCreature->GetGUID(); break; + case 23089: Akama = pCreature->GetGUID(); break; + case 22990: Akama_Shade = pCreature->GetGUID(); break; + case 22841: ShadeOfAkama = pCreature->GetGUID(); break; + case 22898: Supremus = pCreature->GetGUID(); break; + case 22917: IllidanStormrage = pCreature->GetGUID(); break; + case 22949: GathiosTheShatterer = pCreature->GetGUID(); break; + case 22950: HighNethermancerZerevor = pCreature->GetGUID(); break; + case 22951: LadyMalande = pCreature->GetGUID(); break; + case 22952: VerasDarkshadow = pCreature->GetGUID(); break; + case 23426: IllidariCouncil = pCreature->GetGUID(); break; + case 23499: BloodElfCouncilVoice = pCreature->GetGUID(); break; + } + } + + void OnGameObjectCreate(GameObject* pGo, bool add) + { + switch(pGo->GetEntry()) + { + case 185483: NajentusGate = pGo->GetGUID();// Gate past Naj'entus (at the entrance to Supermoose's courtyards) + if (m_auiEncounter[0] == DONE)HandleGameObject(NULL,true,pGo);break; + case 185882: MainTempleDoors = pGo->GetGUID();// Main Temple Doors - right past Supermoose (Supremus) + if (m_auiEncounter[1] == DONE)HandleGameObject(NULL,true,pGo);break; + case 185478: ShadeOfAkamaDoor = pGo->GetGUID();break; + case 185480: CommonDoor = pGo->GetGUID(); + if (m_auiEncounter[3] == DONE)HandleGameObject(NULL,true,pGo);;break; + case 186153: TeronDoor = pGo->GetGUID(); + if (m_auiEncounter[3] == DONE)HandleGameObject(NULL,true,pGo);;break; + case 185892: GuurtogDoor = pGo->GetGUID(); + if (m_auiEncounter[4] == DONE)HandleGameObject(NULL,true,pGo);break; + case 185479: TempleDoor = pGo->GetGUID(); + if (m_auiEncounter[5] == DONE)HandleGameObject(NULL,true,pGo);break; + case 185482: MotherDoor = pGo->GetGUID(); + if (m_auiEncounter[6] == DONE)HandleGameObject(NULL,true,pGo);break; + case 185481: CouncilDoor = pGo->GetGUID(); + if (m_auiEncounter[7] == DONE)HandleGameObject(NULL,true,pGo);break; + case 186152: SimpleDoor = pGo->GetGUID(); + if (m_auiEncounter[7] == DONE)HandleGameObject(NULL,true,pGo);break; + case 185905: IllidanGate = pGo->GetGUID(); break; // Gate leading to Temple Summit + case 186261: IllidanDoor[0] = pGo->GetGUID(); break; // Right door at Temple Summit + case 186262: IllidanDoor[1] = pGo->GetGUID(); break; // Left door at Temple Summit + } + } + + uint64 GetData64(uint32 identifier) + { + switch(identifier) + { + case DATA_HIGHWARLORDNAJENTUS: return Najentus; + case DATA_AKAMA: return Akama; + case DATA_AKAMA_SHADE: return Akama_Shade; + case DATA_SHADEOFAKAMA: return ShadeOfAkama; + case DATA_SUPREMUS: return Supremus; + case DATA_ILLIDANSTORMRAGE: return IllidanStormrage; + case DATA_GATHIOSTHESHATTERER: return GathiosTheShatterer; + case DATA_HIGHNETHERMANCERZEREVOR: return HighNethermancerZerevor; + case DATA_LADYMALANDE: return LadyMalande; + case DATA_VERASDARKSHADOW: return VerasDarkshadow; + case DATA_ILLIDARICOUNCIL: return IllidariCouncil; + case DATA_GAMEOBJECT_NAJENTUS_GATE: return NajentusGate; + case DATA_GAMEOBJECT_ILLIDAN_GATE: return IllidanGate; + case DATA_GAMEOBJECT_ILLIDAN_DOOR_R: return IllidanDoor[0]; + case DATA_GAMEOBJECT_ILLIDAN_DOOR_L: return IllidanDoor[1]; + case DATA_GAMEOBJECT_SUPREMUS_DOORS: return MainTempleDoors; + case DATA_BLOOD_ELF_COUNCIL_VOICE: return BloodElfCouncilVoice; + } + + return 0; + } + + void SetData(uint32 type, uint32 data) + { + switch(type) + { + case DATA_HIGHWARLORDNAJENTUSEVENT: + if (data == DONE) + { + HandleGameObject(NajentusGate, true); + } + m_auiEncounter[0] = data;break; + case DATA_SUPREMUSEVENT: + if (data == DONE) + { + HandleGameObject(NajentusGate, true); + } + m_auiEncounter[1] = data; break; + case DATA_SHADEOFAKAMAEVENT: + if (data == IN_PROGRESS) + { + HandleGameObject(ShadeOfAkamaDoor, false); + }else HandleGameObject(ShadeOfAkamaDoor, true); + m_auiEncounter[2] = data; break; + case DATA_TERONGOREFIENDEVENT: + if (data == IN_PROGRESS) + { + HandleGameObject(TeronDoor, false); + HandleGameObject(CommonDoor, false); + }else + { + HandleGameObject(TeronDoor, true); + HandleGameObject(CommonDoor, true); + } + m_auiEncounter[3] = data; break; + case DATA_GURTOGGBLOODBOILEVENT: + if (data == DONE) + { + HandleGameObject(GuurtogDoor, true); + } + m_auiEncounter[4] = data; break; + case DATA_RELIQUARYOFSOULSEVENT: + if (data == DONE) + { + HandleGameObject(TempleDoor, true); + } + m_auiEncounter[5] = data; break; + case DATA_MOTHERSHAHRAZEVENT: + if (data == DONE) + { + HandleGameObject(MotherDoor, true); + } + m_auiEncounter[6] = data; break; + case DATA_ILLIDARICOUNCILEVENT: + if (data == IN_PROGRESS) + { + HandleGameObject(CouncilDoor, false); + HandleGameObject(SimpleDoor, false); + }else + { + HandleGameObject(CouncilDoor, true); + HandleGameObject(SimpleDoor, true); + } + m_auiEncounter[7] = data; break; + case DATA_ILLIDANSTORMRAGEEVENT: m_auiEncounter[8] = data; break; + } + + if (data == DONE) + { + OUT_SAVE_INST_DATA; + + std::ostringstream saveStream; + saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " + << m_auiEncounter[2] << " " << m_auiEncounter[3] << " " << m_auiEncounter[4] + << " " << m_auiEncounter[5] << " " << m_auiEncounter[6] << " " << m_auiEncounter[7] + << " " << m_auiEncounter[8]; + + str_data = saveStream.str(); + + SaveToDB(); + OUT_SAVE_INST_DATA_COMPLETE; + } + } + + uint32 GetData(uint32 type) + { + switch(type) + { + case DATA_HIGHWARLORDNAJENTUSEVENT: return m_auiEncounter[0]; + case DATA_SUPREMUSEVENT: return m_auiEncounter[1]; + case DATA_SHADEOFAKAMAEVENT: return m_auiEncounter[2]; + case DATA_TERONGOREFIENDEVENT: return m_auiEncounter[3]; + case DATA_GURTOGGBLOODBOILEVENT: return m_auiEncounter[4]; + case DATA_RELIQUARYOFSOULSEVENT: return m_auiEncounter[5]; + case DATA_MOTHERSHAHRAZEVENT: return m_auiEncounter[6]; + case DATA_ILLIDARICOUNCILEVENT: return m_auiEncounter[7]; + case DATA_ILLIDANSTORMRAGEEVENT: return m_auiEncounter[8]; + } + + return 0; + } + + std::string GetSaveData() + { + return str_data; + } + + void Load(const char* in) + { + if (!in) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(in); + + std::istringstream loadStream(in); + loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] + >> m_auiEncounter[3] >> m_auiEncounter[4] >> m_auiEncounter[5] >> m_auiEncounter[6] + >> m_auiEncounter[7] >> m_auiEncounter[8]; + + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) + m_auiEncounter[i] = NOT_STARTED; + + OUT_LOAD_INST_DATA_COMPLETE; + } +}; + +InstanceData* GetInstanceData_instance_black_temple(Map* pMap) +{ + return new instance_black_temple(pMap); +} + +void AddSC_instance_black_temple() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_black_temple"; + newscript->GetInstanceData = &GetInstanceData_instance_black_temple; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/boss_fathomlord_karathress.cpp b/src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/boss_fathomlord_karathress.cpp new file mode 100644 index 00000000000..1e62083f1f9 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/boss_fathomlord_karathress.cpp @@ -0,0 +1,759 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Fathomlord_Karathress +SD%Complete: 70 +SDComment: Cyclone workaround +SDCategory: Coilfang Resevoir, Serpent Shrine Cavern +EndScriptData */ + +#include "precompiled.h" +#include "def_serpent_shrine.h" +#include "escortAI.h" + +#define SAY_AGGRO -1548021 +#define SAY_GAIN_BLESSING -1548022 +#define SAY_GAIN_ABILITY1 -1548023 +#define SAY_GAIN_ABILITY2 -1548024 +#define SAY_GAIN_ABILITY3 -1548025 +#define SAY_SLAY1 -1548026 +#define SAY_SLAY2 -1548027 +#define SAY_SLAY3 -1548028 +#define SAY_DEATH -1548029 + +//Karathress spells +#define SPELL_CATACLYSMIC_BOLT 38441 +#define SPELL_POWER_OF_SHARKKIS 38455 +#define SPELL_POWER_OF_TIDALVESS 38452 +#define SPELL_POWER_OF_CARIBDIS 38451 +#define SPELL_ENRAGE 24318 +#define SPELL_SEAR_NOVA 38445 +#define SPELL_BLESSING_OF_THE_TIDES 38449 + +//Sharkkis spells +#define SPELL_LEECHING_THROW 29436 +#define SPELL_THE_BEAST_WITHIN 38373 +#define SPELL_MULTISHOT 38366 +#define SPELL_SUMMON_FATHOM_LURKER 38433 +#define SPELL_SUMMON_FATHOM_SPOREBAT 38431 +#define SPELL_PET_ENRAGE 19574 + +//Tidalvess spells +#define SPELL_FROST_SHOCK 38234 +#define SPELL_SPITFIRE_TOTEM 38236 +#define SPELL_POISON_CLEANSING_TOTEM 38306 +// Spell obsolete +// #define SPELL_POISON_CLEANSING_EFFECT 8167 +#define SPELL_EARTHBIND_TOTEM 38304 +#define SPELL_EARTHBIND_TOTEM_EFFECT 6474 +#define SPELL_WINDFURY_WEAPON 38184 + +//Caribdis Spells +#define SPELL_WATER_BOLT_VOLLEY 38335 +#define SPELL_TIDAL_SURGE 38358 +#define SPELL_TIDAL_SURGE_FREEZE 38357 +#define SPELL_HEAL 38330 +#define SPELL_SUMMON_CYCLONE 38337 +#define SPELL_CYCLONE_CYCLONE 29538 + +//Yells and Quotes +#define SAY_GAIN_BLESSING_OF_TIDES "Your overconfidence will be your undoing! Guards, lend me your strength!" +#define SOUND_GAIN_BLESSING_OF_TIDES 11278 +#define SAY_MISC "Alana be'lendor!" //don't know what use this +#define SOUND_MISC 11283 + +//Summoned Unit GUIDs +#define CREATURE_CYCLONE 22104 +#define CREATURE_FATHOM_SPOREBAT 22120 +#define CREATURE_FATHOM_LURKER 22119 +#define CREATURE_SPITFIRE_TOTEM 22091 +#define CREATURE_EARTHBIND_TOTEM 22486 +#define CREATURE_POISON_CLEANSING_TOTEM 22487 + +//entry and position for Seer Olum +#define SEER_OLUM 22820 +#define OLUM_X 446.78f +#define OLUM_Y -542.76f +#define OLUM_Z -7.54773f +#define OLUM_O 0.401581f + +//Fathom-Lord Karathress AI +struct TRINITY_DLL_DECL boss_fathomlord_karathressAI : public ScriptedAI +{ + boss_fathomlord_karathressAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + Advisors[0] = 0; + Advisors[1] = 0; + Advisors[2] = 0; + } + + ScriptedInstance* pInstance; + + uint32 CataclysmicBolt_Timer; + uint32 Enrage_Timer; + uint32 SearNova_Timer; + + bool BlessingOfTides; + + uint64 Advisors[3]; + + void Reset() + { + CataclysmicBolt_Timer = 10000; + Enrage_Timer = 600000; //10 minutes + SearNova_Timer = 20000+rand()%40000; // 20 - 60 seconds + + BlessingOfTides = false; + + + + if (pInstance) + { + uint64 RAdvisors[3]; + RAdvisors[0] = pInstance->GetData64(DATA_SHARKKIS); + RAdvisors[1] = pInstance->GetData64(DATA_TIDALVESS); + RAdvisors[2] = pInstance->GetData64(DATA_CARIBDIS); + //Respawn of the 3 Advisors + Creature* pAdvisor = NULL; + for(int i=0; i<3; ++i) + + if (RAdvisors[i]) + { + pAdvisor = (Unit::GetCreature((*m_creature), RAdvisors[i])); + if (pAdvisor && !pAdvisor->isAlive()) + { + pAdvisor->Respawn(); + pAdvisor->AI()->EnterEvadeMode(); + pAdvisor->GetMotionMaster()->MoveTargetedHome(); + } + } + pInstance->SetData(DATA_KARATHRESSEVENT, NOT_STARTED); + } + + + } + + void EventSharkkisDeath() + { + DoScriptText(SAY_GAIN_ABILITY1, m_creature); + DoCast(m_creature, SPELL_POWER_OF_SHARKKIS); + } + + void EventTidalvessDeath() + { + DoScriptText(SAY_GAIN_ABILITY2, m_creature); + DoCast(m_creature, SPELL_POWER_OF_TIDALVESS); + } + + void EventCaribdisDeath() + { + DoScriptText(SAY_GAIN_ABILITY3, m_creature); + DoCast(m_creature, SPELL_POWER_OF_CARIBDIS); + } + + void GetAdvisors() + { + if (!pInstance) + return; + + Advisors[0] = pInstance->GetData64(DATA_SHARKKIS); + Advisors[1] = pInstance->GetData64(DATA_TIDALVESS); + Advisors[2] = pInstance->GetData64(DATA_CARIBDIS); + } + + void StartEvent(Unit *who) + { + if (!pInstance) + return; + + GetAdvisors(); + + DoScriptText(SAY_AGGRO, m_creature); + DoZoneInCombat(); + + pInstance->SetData64(DATA_KARATHRESSEVENT_STARTER, who->GetGUID()); + pInstance->SetData(DATA_KARATHRESSEVENT, IN_PROGRESS); + } + + void KilledUnit(Unit *victim) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + case 2: DoScriptText(SAY_SLAY3, m_creature); break; + } + } + + void JustDied(Unit *killer) + { + DoScriptText(SAY_DEATH, m_creature); + + if (pInstance) + pInstance->SetData(DATA_FATHOMLORDKARATHRESSEVENT, DONE); + + //support for quest 10944 + m_creature->SummonCreature(SEER_OLUM, OLUM_X, OLUM_Y, OLUM_Z, OLUM_O, TEMPSUMMON_TIMED_DESPAWN, 3600000); + } + + void EnterCombat(Unit *who) + { + StartEvent(who); + } + + void UpdateAI(const uint32 diff) + { + //Only if not incombat check if the event is started + if (!m_creature->isInCombat() && pInstance && pInstance->GetData(DATA_KARATHRESSEVENT)) + { + Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_KARATHRESSEVENT_STARTER)); + + if (target) + { + AttackStart(target); + GetAdvisors(); + } + } + + //Return since we have no target + if (!UpdateVictim()) + return; + + //someone evaded! + if (pInstance && !pInstance->GetData(DATA_KARATHRESSEVENT)) + { + EnterEvadeMode(); + return; + } + + //CataclysmicBolt_Timer + if (CataclysmicBolt_Timer < diff) + { + //select a random unit other than the main tank + Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 1); + + //if there aren't other units, cast on the tank + if (!target) + target = m_creature->getVictim(); + + if (target) + DoCast(target, SPELL_CATACLYSMIC_BOLT); + CataclysmicBolt_Timer = 10000; + }else CataclysmicBolt_Timer -= diff; + + //SearNova_Timer + if (SearNova_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_SEAR_NOVA); + SearNova_Timer = 20000+rand()%40000; + }else SearNova_Timer -= diff; + + //Enrage_Timer + if (Enrage_Timer < diff) + { + DoCast(m_creature, SPELL_ENRAGE); + Enrage_Timer = 90000; + }else Enrage_Timer -= diff; + + //Blessing of Tides Trigger + if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) <= 75 && !BlessingOfTides) + { + BlessingOfTides = true; + bool continueTriggering; + Creature* Advisor; + for(uint8 i = 0; i < 4; ++i) + if (Advisors[i]) + { + Advisor = (Unit::GetCreature(*m_creature, Advisors[i])); + if (Advisor) + { + if (Advisor->isAlive()) + { + continueTriggering = true; + break; + } + } + } + if (continueTriggering) + { + DoCast(m_creature, SPELL_BLESSING_OF_THE_TIDES); + m_creature->MonsterYell(SAY_GAIN_BLESSING_OF_TIDES, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(m_creature, SOUND_GAIN_BLESSING_OF_TIDES); + } + } + + DoMeleeAttackIfReady(); + } +}; + +//Fathom-Guard Sharkkis AI +struct TRINITY_DLL_DECL boss_fathomguard_sharkkisAI : public ScriptedAI +{ + boss_fathomguard_sharkkisAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + uint32 LeechingThrow_Timer; + uint32 TheBeastWithin_Timer; + uint32 Multishot_Timer; + uint32 Pet_Timer; + + bool pet; + + uint64 SummonedPet; + + + void Reset() + { + LeechingThrow_Timer = 20000; + TheBeastWithin_Timer = 30000; + Multishot_Timer = 15000; + Pet_Timer = 10000; + + pet = false; + + Creature *Pet = Unit::GetCreature(*m_creature, SummonedPet); + if (Pet && Pet->isAlive()) + { + Pet->DealDamage(Pet, Pet->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + } + + SummonedPet = 0; + + if (pInstance) + pInstance->SetData(DATA_KARATHRESSEVENT, NOT_STARTED); + } + + void JustDied(Unit *victim) + { + if (pInstance) + { + Creature *Karathress = NULL; + Karathress = (Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_KARATHRESS))); + + if (Karathress) + CAST_AI(boss_fathomlord_karathressAI, Karathress->AI())->EventSharkkisDeath(); + CAST_AI(boss_fathomlord_karathressAI, Karathress->AI())->EventSharkkisDeath(); + } + } + + void EnterCombat(Unit *who) + { + if (pInstance) + { + pInstance->SetData64(DATA_KARATHRESSEVENT_STARTER, who->GetGUID()); + pInstance->SetData(DATA_KARATHRESSEVENT, IN_PROGRESS); + } + } + + void UpdateAI(const uint32 diff) + { + //Only if not incombat check if the event is started + if (!m_creature->isInCombat() && pInstance && pInstance->GetData(DATA_KARATHRESSEVENT)) + { + Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_KARATHRESSEVENT_STARTER)); + + if (target) + { + AttackStart(target); + } + } + + //Return since we have no target + if (!UpdateVictim()) + return; + + //someone evaded! + if (pInstance && !pInstance->GetData(DATA_KARATHRESSEVENT)) + { + EnterEvadeMode(); + return; + } + + //LeechingThrow_Timer + if (LeechingThrow_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_LEECHING_THROW); + LeechingThrow_Timer = 20000; + }else LeechingThrow_Timer -= diff; + + //Multishot_Timer + if (Multishot_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_MULTISHOT); + Multishot_Timer = 20000; + }else Multishot_Timer -= diff; + + //TheBeastWithin_Timer + if (TheBeastWithin_Timer < diff) + { + DoCast(m_creature, SPELL_THE_BEAST_WITHIN); + Creature *Pet = Unit::GetCreature(*m_creature, SummonedPet); + if (Pet && Pet->isAlive()) + { + Pet->CastSpell(Pet, SPELL_PET_ENRAGE, true); + } + TheBeastWithin_Timer = 30000; + }else TheBeastWithin_Timer -= diff; + + //Pet_Timer + if (Pet_Timer < diff && pet == false) + { + pet = true; + //uint32 spell_id; + uint32 pet_id; + switch(rand()%2) + { + case 0: + //spell_id = SPELL_SUMMON_FATHOM_LURKER; + pet_id = CREATURE_FATHOM_LURKER; + break; + case 1: + //spell_id = SPELL_SUMMON_FATHOM_SPOREBAT; + pet_id = CREATURE_FATHOM_SPOREBAT; + break; + } + //DoCast(m_creature, spell_id, true); + Creature *Pet = DoSpawnCreature(pet_id,0,0,0,0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0); + if (Pet && target) + { + Pet->AI()->AttackStart(target); + SummonedPet = Pet->GetGUID(); + } + }else Pet_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +//Fathom-Guard Tidalvess AI +struct TRINITY_DLL_DECL boss_fathomguard_tidalvessAI : public ScriptedAI +{ + boss_fathomguard_tidalvessAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + uint32 FrostShock_Timer; + uint32 Spitfire_Timer; + uint32 PoisonCleansing_Timer; + uint32 Earthbind_Timer; + + void Reset() + { + FrostShock_Timer = 25000; + Spitfire_Timer = 60000; + PoisonCleansing_Timer = 30000; + Earthbind_Timer = 45000; + + if (pInstance) + pInstance->SetData(DATA_KARATHRESSEVENT, NOT_STARTED); + } + + void JustDied(Unit *victim) + { + if (pInstance) + { + Creature *Karathress = NULL; + Karathress = (Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_KARATHRESS))); + + if (Karathress) + if (!m_creature->isAlive() && Karathress) + CAST_AI(boss_fathomlord_karathressAI, Karathress->AI())->EventTidalvessDeath(); + } + } + + void EnterCombat(Unit *who) + { + if (pInstance) + { + pInstance->SetData64(DATA_KARATHRESSEVENT_STARTER, who->GetGUID()); + pInstance->SetData(DATA_KARATHRESSEVENT, IN_PROGRESS); + } + DoCast(m_creature, SPELL_WINDFURY_WEAPON); + } + + void UpdateAI(const uint32 diff) + { + //Only if not incombat check if the event is started + if (!m_creature->isInCombat() && pInstance && pInstance->GetData(DATA_KARATHRESSEVENT)) + { + Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_KARATHRESSEVENT_STARTER)); + + if (target) + { + AttackStart(target); + } + } + + //Return since we have no target + if (!UpdateVictim()) + return; + + //someone evaded! + if (pInstance && !pInstance->GetData(DATA_KARATHRESSEVENT)) + { + EnterEvadeMode(); + return; + } + + if (!m_creature->HasAura(SPELL_WINDFURY_WEAPON)) + { + DoCast(m_creature, SPELL_WINDFURY_WEAPON); + } + + //FrostShock_Timer + if (FrostShock_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_FROST_SHOCK); + FrostShock_Timer = 25000+rand()%5000; + }else FrostShock_Timer -= diff; + + //Spitfire_Timer + if (Spitfire_Timer < diff) + { + DoCast(m_creature, SPELL_SPITFIRE_TOTEM); + Unit *SpitfireTotem = Unit::GetUnit(*m_creature, CREATURE_SPITFIRE_TOTEM); + if (SpitfireTotem) + { + CAST_CRE(SpitfireTotem)->AI()->AttackStart(m_creature->getVictim()); + } + Spitfire_Timer = 60000; + }else Spitfire_Timer -= diff; + + //PoisonCleansing_Timer + if (PoisonCleansing_Timer < diff) + { + DoCast(m_creature, SPELL_POISON_CLEANSING_TOTEM); + PoisonCleansing_Timer = 30000; + }else PoisonCleansing_Timer -= diff; + + //Earthbind_Timer + if (Earthbind_Timer < diff) + { + DoCast(m_creature, SPELL_EARTHBIND_TOTEM); + Earthbind_Timer = 45000; + }else Earthbind_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +//Fathom-Guard Caribdis AI +struct TRINITY_DLL_DECL boss_fathomguard_caribdisAI : public ScriptedAI +{ + boss_fathomguard_caribdisAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + uint32 WaterBoltVolley_Timer; + uint32 TidalSurge_Timer; + uint32 Heal_Timer; + uint32 Cyclone_Timer; + + void Reset() + { + WaterBoltVolley_Timer = 35000; + TidalSurge_Timer = 15000+rand()%5000; + Heal_Timer = 55000; + Cyclone_Timer = 30000+rand()%10000; + + if (pInstance) + pInstance->SetData(DATA_KARATHRESSEVENT, NOT_STARTED); + } + + void JustDied(Unit *victim) + { + if (pInstance) + { + Creature *Karathress = NULL; + Karathress = (Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_KARATHRESS))); + + if (Karathress) + if (!m_creature->isAlive() && Karathress) + CAST_AI(boss_fathomlord_karathressAI, Karathress->AI())->EventCaribdisDeath(); + } + } + + void EnterCombat(Unit *who) + { + if (pInstance) + { + pInstance->SetData64(DATA_KARATHRESSEVENT_STARTER, who->GetGUID()); + pInstance->SetData(DATA_KARATHRESSEVENT, IN_PROGRESS); + } + } + + void UpdateAI(const uint32 diff) + { + //Only if not incombat check if the event is started + if (!m_creature->isInCombat() && pInstance && pInstance->GetData(DATA_KARATHRESSEVENT)) + { + Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_KARATHRESSEVENT_STARTER)); + + if (target) + { + AttackStart(target); + } + } + + //Return since we have no target + if (!UpdateVictim()) + return; + + //someone evaded! + if (pInstance && !pInstance->GetData(DATA_KARATHRESSEVENT)) + { + EnterEvadeMode(); + return; + } + + //WaterBoltVolley_Timer + if (WaterBoltVolley_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_WATER_BOLT_VOLLEY); + WaterBoltVolley_Timer = 30000; + }else WaterBoltVolley_Timer -= diff; + + //TidalSurge_Timer + if (TidalSurge_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_TIDAL_SURGE); + // Hacky way to do it - won't trigger elseways + m_creature->getVictim()->CastSpell(m_creature->getVictim(), SPELL_TIDAL_SURGE_FREEZE, true); + TidalSurge_Timer = 15000+rand()%5000; + }else TidalSurge_Timer -= diff; + + //Cyclone_Timer + if (Cyclone_Timer < diff) + { + //DoCast(m_creature, SPELL_SUMMON_CYCLONE); // Doesn't work + Cyclone_Timer = 30000+rand()%10000; + Creature *Cyclone = m_creature->SummonCreature(CREATURE_CYCLONE, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), (rand()%5), TEMPSUMMON_TIMED_DESPAWN, 15000); + if (Cyclone) + { + CAST_CRE(Cyclone)->SetFloatValue(OBJECT_FIELD_SCALE_X, 3.0f); + Cyclone->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + Cyclone->setFaction(m_creature->getFaction()); + Cyclone->CastSpell(Cyclone, SPELL_CYCLONE_CYCLONE, true); + Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (target) + { + Cyclone->AI()->AttackStart(target); + } + } + }else Cyclone_Timer -= diff; + + //Heal_Timer + if (Heal_Timer < diff) + { + // It can be cast on any of the mobs + Unit *pUnit = NULL; + + while(pUnit == NULL || !pUnit->isAlive()) + { + pUnit = selectAdvisorUnit(); + } + + if (pUnit && pUnit->isAlive()) + DoCast(pUnit, SPELL_HEAL); + Heal_Timer = 60000; + }else Heal_Timer -= diff; + + DoMeleeAttackIfReady(); + } + + Unit* selectAdvisorUnit() + { + Unit* pUnit = NULL; + if (pInstance) + { + switch(rand()%4) + { + case 0: + pUnit = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_KARATHRESS)); + break; + case 1: + pUnit = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_SHARKKIS)); + break; + case 2: + pUnit = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_TIDALVESS)); + break; + case 3: + pUnit = m_creature; + break; + } + }else pUnit = m_creature; + + return pUnit; + } +}; + +CreatureAI* GetAI_boss_fathomlord_karathress(Creature* pCreature) +{ + return new boss_fathomlord_karathressAI (pCreature); +} + +CreatureAI* GetAI_boss_fathomguard_sharkkis(Creature* pCreature) +{ + return new boss_fathomguard_sharkkisAI (pCreature); +} + +CreatureAI* GetAI_boss_fathomguard_tidalvess(Creature* pCreature) +{ + return new boss_fathomguard_tidalvessAI (pCreature); +} + +CreatureAI* GetAI_boss_fathomguard_caribdis(Creature* pCreature) +{ + return new boss_fathomguard_caribdisAI (pCreature); +} + +void AddSC_boss_fathomlord_karathress() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_fathomlord_karathress"; + newscript->GetAI = &GetAI_boss_fathomlord_karathress; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="boss_fathomguard_sharkkis"; + newscript->GetAI = &GetAI_boss_fathomguard_sharkkis; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="boss_fathomguard_tidalvess"; + newscript->GetAI = &GetAI_boss_fathomguard_tidalvess; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="boss_fathomguard_caribdis"; + newscript->GetAI = &GetAI_boss_fathomguard_caribdis; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/boss_hydross_the_unstable.cpp b/src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/boss_hydross_the_unstable.cpp new file mode 100644 index 00000000000..434e088cd99 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/boss_hydross_the_unstable.cpp @@ -0,0 +1,386 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Hydross_The_Unstable +SD%Complete: 90 +SDComment: Some details and adjustments left to do, probably nothing major. Spawns may be spawned in different way/location. +SDCategory: Coilfang Resevoir, Serpent Shrine Cavern +EndScriptData */ + +#include "precompiled.h" +#include "def_serpent_shrine.h" + +#define SAY_AGGRO -1548000 +#define SAY_SWITCH_TO_CLEAN -1548001 +#define SAY_CLEAN_SLAY1 -1548002 +#define SAY_CLEAN_SLAY2 -1548003 +#define SAY_CLEAN_DEATH -1548004 +#define SAY_SWITCH_TO_CORRUPT -1548005 +#define SAY_CORRUPT_SLAY1 -1548006 +#define SAY_CORRUPT_SLAY2 -1548007 +#define SAY_CORRUPT_DEATH -1548008 + +#define SWITCH_RADIUS 18 + +#define MODEL_CORRUPT 20609 +#define MODEL_CLEAN 20162 + +#define SPELL_WATER_TOMB 38235 +#define SPELL_MARK_OF_HYDROSS1 38215 +#define SPELL_MARK_OF_HYDROSS2 38216 +#define SPELL_MARK_OF_HYDROSS3 38217 +#define SPELL_MARK_OF_HYDROSS4 38218 +#define SPELL_MARK_OF_HYDROSS5 38231 +#define SPELL_MARK_OF_HYDROSS6 40584 +#define SPELL_MARK_OF_CORRUPTION1 38219 +#define SPELL_MARK_OF_CORRUPTION2 38220 +#define SPELL_MARK_OF_CORRUPTION3 38221 +#define SPELL_MARK_OF_CORRUPTION4 38222 +#define SPELL_MARK_OF_CORRUPTION5 38230 +#define SPELL_MARK_OF_CORRUPTION6 40583 +#define SPELL_VILE_SLUDGE 38246 +#define SPELL_ENRAGE 27680 //this spell need verification +#define SPELL_SUMMON_WATER_ELEMENT 36459 //not in use yet(in use ever?) +#define SPELL_ELEMENTAL_SPAWNIN 25035 +#define SPELL_BLUE_BEAM 40227 //channeled Hydross Beam Helper (not in use yet) + +#define ENTRY_PURE_SPAWN 22035 +#define ENTRY_TAINTED_SPAWN 22036 +#define ENTRY_BEAM_DUMMY 21934 + +#define HYDROSS_X -239.439 +#define HYDROSS_Y -363.481 + +#define SPAWN_X_DIFF1 6.934003 +#define SPAWN_Y_DIFF1 -11.255012 +#define SPAWN_X_DIFF2 -6.934003 +#define SPAWN_Y_DIFF2 11.255012 +#define SPAWN_X_DIFF3 -12.577011 +#define SPAWN_Y_DIFF3 -4.72702 +#define SPAWN_X_DIFF4 12.577011 +#define SPAWN_Y_DIFF4 4.72702 + +struct TRINITY_DLL_DECL boss_hydross_the_unstableAI : public ScriptedAI +{ + boss_hydross_the_unstableAI(Creature *c) : ScriptedAI(c), Summons(m_creature) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + uint64 beams[2]; + uint32 PosCheck_Timer; + uint32 MarkOfHydross_Timer; + uint32 MarkOfCorruption_Timer; + uint32 WaterTomb_Timer; + uint32 VileSludge_Timer; + uint32 MarkOfHydross_Count; + uint32 MarkOfCorruption_Count; + uint32 EnrageTimer; + bool CorruptedForm; + bool beam; + SummonList Summons; + + void Reset() + { + DeSummonBeams(); + beams[0] = 0; + beams[1] = 0; + PosCheck_Timer = 2500; + MarkOfHydross_Timer = 15000; + MarkOfCorruption_Timer = 15000; + WaterTomb_Timer = 7000; + VileSludge_Timer = 7000; + MarkOfHydross_Count = 0; + MarkOfCorruption_Count = 0; + EnrageTimer = 600000; + + CorruptedForm = false; + m_creature->SetMeleeDamageSchool(SPELL_SCHOOL_FROST); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false); + + m_creature->SetDisplayId(MODEL_CLEAN); + + if (pInstance) + pInstance->SetData(DATA_HYDROSSTHEUNSTABLEEVENT, NOT_STARTED); + beam = false; + Summons.DespawnAll(); + } + + void SummonBeams() + { + Creature* beamer = m_creature->SummonCreature(ENTRY_BEAM_DUMMY,-258.333,-356.34,22.0499,5.90835,TEMPSUMMON_CORPSE_DESPAWN,0); + if (beamer) + { + beamer->CastSpell(m_creature,SPELL_BLUE_BEAM,true); + beamer->SetDisplayId(11686); //invisible + beamer->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + beams[0]=beamer->GetGUID(); + } + beamer = beamer = m_creature->SummonCreature(ENTRY_BEAM_DUMMY,-219.918,-371.308,22.0042,2.73072,TEMPSUMMON_CORPSE_DESPAWN,0); + if (beamer) + { + beamer->CastSpell(m_creature,SPELL_BLUE_BEAM,true); + beamer->SetDisplayId(11686); //invisible + beamer->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + beams[1]=beamer->GetGUID(); + } + } + void DeSummonBeams() + { + for(uint8 i=0;i<2; ++i) + { + Creature* mob = Unit::GetCreature(*m_creature,beams[i]); + if (mob) + { + mob->setDeathState(DEAD); + mob->RemoveCorpse(); + } + } + } + void EnterCombat(Unit *who) + { + DoScriptText(SAY_AGGRO, m_creature); + + if (pInstance) + pInstance->SetData(DATA_HYDROSSTHEUNSTABLEEVENT, IN_PROGRESS); + } + + void KilledUnit(Unit *victim) + { + if (CorruptedForm) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_CORRUPT_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_CORRUPT_SLAY2, m_creature); break; + } + } + else + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_CLEAN_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_CLEAN_SLAY2, m_creature); break; + } + } + } + + void JustSummoned(Creature* summoned) + { + if (summoned->GetEntry() == ENTRY_PURE_SPAWN) + { + summoned->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true); + summoned->CastSpell(summoned,SPELL_ELEMENTAL_SPAWNIN,true); + Summons.Summon(summoned); + } + if (summoned->GetEntry() == ENTRY_TAINTED_SPAWN) + { + summoned->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, true); + summoned->CastSpell(summoned,SPELL_ELEMENTAL_SPAWNIN,true); + Summons.Summon(summoned); + } + } + + void SummonedCreatureDespawn(Creature *summon) + { + Summons.Despawn(summon); + } + + void JustDied(Unit *victim) + { + if (CorruptedForm) + DoScriptText(SAY_CORRUPT_DEATH, m_creature); + else + DoScriptText(SAY_CLEAN_DEATH, m_creature); + + if (pInstance) + pInstance->SetData(DATA_HYDROSSTHEUNSTABLEEVENT, DONE); + Summons.DespawnAll(); + } + + void UpdateAI(const uint32 diff) + { + if (!beam) + { + SummonBeams(); + beam=true; + } + //Return since we have no target + if (!UpdateVictim()) + return; + + // corrupted form + if (CorruptedForm) + { + //MarkOfCorruption_Timer + if (MarkOfCorruption_Timer < diff) + { + if (MarkOfCorruption_Count <= 5) + { + uint32 mark_spell; + + switch(MarkOfCorruption_Count) + { + case 0: mark_spell = SPELL_MARK_OF_CORRUPTION1; break; + case 1: mark_spell = SPELL_MARK_OF_CORRUPTION2; break; + case 2: mark_spell = SPELL_MARK_OF_CORRUPTION3; break; + case 3: mark_spell = SPELL_MARK_OF_CORRUPTION4; break; + case 4: mark_spell = SPELL_MARK_OF_CORRUPTION5; break; + case 5: mark_spell = SPELL_MARK_OF_CORRUPTION6; break; + } + + DoCast(m_creature->getVictim(), mark_spell); + + if (MarkOfCorruption_Count < 5) + MarkOfCorruption_Count++; + } + + MarkOfCorruption_Timer = 15000; + }else MarkOfCorruption_Timer -= diff; + + //VileSludge_Timer + if (VileSludge_Timer < diff) + { + Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (target) + DoCast(target, SPELL_VILE_SLUDGE); + + VileSludge_Timer = 15000; + }else VileSludge_Timer -= diff; + + //PosCheck_Timer + if (PosCheck_Timer < diff) + { + if (m_creature->IsWithinDist2d(HYDROSS_X, HYDROSS_Y, SWITCH_RADIUS)) + { + // switch to clean form + m_creature->SetDisplayId(MODEL_CLEAN); + CorruptedForm = false; + MarkOfHydross_Count = 0; + + DoScriptText(SAY_SWITCH_TO_CLEAN, m_creature); + DoResetThreat(); + SummonBeams(); + + // spawn 4 adds + DoSpawnCreature(ENTRY_PURE_SPAWN, SPAWN_X_DIFF1, SPAWN_Y_DIFF1, 3, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); + DoSpawnCreature(ENTRY_PURE_SPAWN, SPAWN_X_DIFF2, SPAWN_Y_DIFF2, 3, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); + DoSpawnCreature(ENTRY_PURE_SPAWN, SPAWN_X_DIFF3, SPAWN_Y_DIFF3, 3, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); + DoSpawnCreature(ENTRY_PURE_SPAWN, SPAWN_X_DIFF4, SPAWN_Y_DIFF4, 3, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); + + m_creature->SetMeleeDamageSchool(SPELL_SCHOOL_FROST); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false); + } + + PosCheck_Timer = 2500; + }else PosCheck_Timer -=diff; + } + // clean form + else + { + //MarkOfHydross_Timer + if (MarkOfHydross_Timer < diff) + { + if (MarkOfHydross_Count <= 5) + { + uint32 mark_spell; + + switch(MarkOfHydross_Count) + { + case 0: mark_spell = SPELL_MARK_OF_HYDROSS1; break; + case 1: mark_spell = SPELL_MARK_OF_HYDROSS2; break; + case 2: mark_spell = SPELL_MARK_OF_HYDROSS3; break; + case 3: mark_spell = SPELL_MARK_OF_HYDROSS4; break; + case 4: mark_spell = SPELL_MARK_OF_HYDROSS5; break; + case 5: mark_spell = SPELL_MARK_OF_HYDROSS6; break; + } + + DoCast(m_creature->getVictim(), mark_spell); + + if (MarkOfHydross_Count < 5) + MarkOfHydross_Count++; + } + + MarkOfHydross_Timer = 15000; + }else MarkOfHydross_Timer -= diff; + + //WaterTomb_Timer + if (WaterTomb_Timer < diff) + { + Unit *target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true); + if (target) + DoCast(target, SPELL_WATER_TOMB); + + WaterTomb_Timer = 7000; + }else WaterTomb_Timer -= diff; + + //PosCheck_Timer + if (PosCheck_Timer < diff) + { + if (!m_creature->IsWithinDist2d(HYDROSS_X, HYDROSS_Y, SWITCH_RADIUS)) + { + // switch to corrupted form + m_creature->SetDisplayId(MODEL_CORRUPT); + MarkOfCorruption_Count = 0; + CorruptedForm = true; + + DoScriptText(SAY_SWITCH_TO_CORRUPT, m_creature); + DoResetThreat(); + DeSummonBeams(); + + // spawn 4 adds + DoSpawnCreature(ENTRY_TAINTED_SPAWN, SPAWN_X_DIFF1, SPAWN_Y_DIFF1, 3, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); + DoSpawnCreature(ENTRY_TAINTED_SPAWN, SPAWN_X_DIFF2, SPAWN_Y_DIFF2, 3, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); + DoSpawnCreature(ENTRY_TAINTED_SPAWN, SPAWN_X_DIFF3, SPAWN_Y_DIFF3, 3, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); + DoSpawnCreature(ENTRY_TAINTED_SPAWN, SPAWN_X_DIFF4, SPAWN_Y_DIFF4, 3, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); + + m_creature->SetMeleeDamageSchool(SPELL_SCHOOL_NATURE); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, true); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, false); + } + + PosCheck_Timer = 2500; + }else PosCheck_Timer -=diff; + } + + //EnrageTimer + if (EnrageTimer < diff) + { + DoCast(m_creature, SPELL_ENRAGE); + EnrageTimer = 60000; + }else EnrageTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_hydross_the_unstable(Creature* pCreature) +{ + return new boss_hydross_the_unstableAI (pCreature); +} + +void AddSC_boss_hydross_the_unstable() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_hydross_the_unstable"; + newscript->GetAI = &GetAI_boss_hydross_the_unstable; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/boss_lady_vashj.cpp b/src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/boss_lady_vashj.cpp new file mode 100644 index 00000000000..c1a2280653c --- /dev/null +++ b/src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/boss_lady_vashj.cpp @@ -0,0 +1,1066 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA02111-1307USA + */ + +/* ScriptData +SDName: Boss_Lady_Vashj +SD%Complete: 99 +SDComment: Missing blizzlike Shield Generators coords +SDCategory: Coilfang Resevoir, Serpent Shrine Cavern +EndScriptData */ + +#include "precompiled.h" +#include "def_serpent_shrine.h" +#include "simple_ai.h" +#include "Spell.h" + +#define SAY_INTRO -1548042 +#define SAY_AGGRO1 -1548043 +#define SAY_AGGRO2 -1548044 +#define SAY_AGGRO3 -1548045 +#define SAY_AGGRO4 -1548046 +#define SAY_PHASE1 -1548047 +#define SAY_PHASE2 -1548048 +#define SAY_PHASE3 -1548049 +#define SAY_BOWSHOT1 -1548050 +#define SAY_BOWSHOT2 -1548051 +#define SAY_SLAY1 -1548052 +#define SAY_SLAY2 -1548053 +#define SAY_SLAY3 -1548054 +#define SAY_DEATH -1548055 + +#define SPELL_SURGE 38044 +#define SPELL_MULTI_SHOT 38310 +#define SPELL_SHOCK_BLAST 38509 +#define SPELL_ENTANGLE 38316 +#define SPELL_STATIC_CHARGE_TRIGGER 38280 +#define SPELL_FORKED_LIGHTNING 40088 +#define SPELL_SHOOT 40873 +#define SPELL_POISON_BOLT 40095 +#define SPELL_TOXIC_SPORES 38575 +#define SPELL_MAGIC_BARRIER 38112 + +#define MIDDLE_X 30.134 +#define MIDDLE_Y -923.65 +#define MIDDLE_Z 42.9 + +#define SPOREBAT_X 30.977156 +#define SPOREBAT_Y -925.297761 +#define SPOREBAT_Z 77.176567 +#define SPOREBAT_O 5.223932 + +#define SHIED_GENERATOR_CHANNEL 19870 +#define ENCHANTED_ELEMENTAL 21958 +#define TAINTED_ELEMENTAL 22009 +#define COILFANG_STRIDER 22056 +#define COILFANG_ELITE 22055 +#define TOXIC_SPOREBAT 22140 +#define TOXIC_SPORES_TRIGGER 22207 + +float ElementPos[8][4] = +{ + {8.3, -835.3, 21.9, 5}, + {53.4, -835.3, 21.9, 4.5}, + {96, -861.9, 21.8, 4}, + {96, -986.4, 21.4, 2.5}, + {54.4, -1010.6, 22, 1.8}, + {9.8, -1012, 21.7, 1.4}, + {-35, -987.6, 21.5, 0.8}, + {-58.9, -901.6, 21.5, 6} +}; + +float ElementWPPos[8][3] = +{ + {71.700752, -883.905884, 41.097168}, + {45.039848, -868.022827, 41.097015}, + {14.585141, -867.894470, 41.097061}, + {-25.415508, -906.737732, 41.097061}, + {-11.801594, -963.405884, 41.097067}, + {14.556657, -979.051514, 41.097137}, + {43.466549, -979.406677, 41.097027}, + {69.945908, -964.663940, 41.097054} +}; + +float SporebatWPPos[8][3] = +{ + {31.6,-896.3,59.1}, + {9.1, -913.9, 56}, + {5.2, -934.4, 52.4}, + {20.7, -946.9, 49.7}, + {41, -941.9, 51}, + {47.7, -927.3, 55}, + {42.2, -912.4, 51.7}, + {27, -905.9, 50} +}; + +float CoilfangElitePos[3][4] = +{ + {28.84, -923.28, 42.9, 6}, + {31.183281, -953.502625, 41.523602, 1.640957}, + {58.895180, -923.124268, 41.545307, 3.152848} +}; + +float CoilfangStriderPos[3][4] = +{ + {66.427010, -948.778503, 41.262245, 2.584220}, + {7.513962, -959.538208, 41.300422, 1.034629}, + {-12.843201, -907.798401, 41.239620, 6.087094} +}; + +float ShieldGeneratorChannelPos[4][4] = +{ + {49.6262, -902.181, 43.0975, 3.95683}, + {10.988, -901.616, 42.5371, 5.4373}, + {10.3859, -944.036, 42.5446, 0.779888}, + {49.3126, -943.398, 42.5501, 2.40174} +}; + +//Lady Vashj AI +struct TRINITY_DLL_DECL boss_lady_vashjAI : public ScriptedAI +{ + boss_lady_vashjAI (Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + Intro = false; + JustCreated = true; + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); //set it only once on Creature create (no need do intro if wiped) + } + + ScriptedInstance *pInstance; + + uint64 ShieldGeneratorChannel[4]; + + uint32 AggroTimer; + uint32 ShockBlast_Timer; + uint32 Entangle_Timer; + uint32 StaticCharge_Timer; + uint32 ForkedLightning_Timer; + uint32 Check_Timer; + uint32 EnchantedElemental_Timer; + uint32 TaintedElemental_Timer; + uint32 CoilfangElite_Timer; + uint32 CoilfangStrider_Timer; + uint32 SummonSporebat_Timer; + uint32 SummonSporebat_StaticTimer; + uint8 EnchantedElemental_Pos; + uint8 Phase; + + bool Entangle; + bool Intro; + bool CanAttack; + bool JustCreated; + + void Reset() + { + AggroTimer = 19000; + ShockBlast_Timer = 1+rand()%60000; + Entangle_Timer = 30000; + StaticCharge_Timer = 10000+rand()%15000; + ForkedLightning_Timer = 2000; + Check_Timer = 15000; + EnchantedElemental_Timer = 5000; + TaintedElemental_Timer = 50000; + CoilfangElite_Timer = 45000+rand()%5000; + CoilfangStrider_Timer = 60000+rand()%10000; + SummonSporebat_Timer = 10000; + SummonSporebat_StaticTimer = 30000; + EnchantedElemental_Pos = 0; + Phase = 0; + + Entangle = false; + if (JustCreated) + { + CanAttack = false; + JustCreated = false; + }else CanAttack = true; + + Unit *remo; + for(uint8 i = 0; i < 4; ++i) + { + remo = Unit::GetUnit(*m_creature, ShieldGeneratorChannel[i]); + if (remo) + remo->setDeathState(JUST_DIED); + } + + if (pInstance) + pInstance->SetData(DATA_LADYVASHJEVENT, NOT_STARTED); + ShieldGeneratorChannel[0] = 0; + ShieldGeneratorChannel[1] = 0; + ShieldGeneratorChannel[2] = 0; + ShieldGeneratorChannel[3] = 0; + + m_creature->SetCorpseDelay(1000*60*60); + } + + //Called when a tainted elemental dies + void EventTaintedElementalDeath() + { + //the next will spawn 50 seconds after the previous one's death + if (TaintedElemental_Timer > 50000) + TaintedElemental_Timer = 50000; + } + void KilledUnit(Unit *victim) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + case 2: DoScriptText(SAY_SLAY3, m_creature); break; + } + } + + void JustDied(Unit *victim) + { + DoScriptText(SAY_DEATH, m_creature); + + if (pInstance) + pInstance->SetData(DATA_LADYVASHJEVENT, DONE); + } + + void StartEvent() + { + switch(rand()%4) + { + case 0: DoScriptText(SAY_AGGRO1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO3, m_creature); break; + case 3: DoScriptText(SAY_AGGRO4, m_creature); break; + } + + Phase = 1; + + if (pInstance) + pInstance->SetData(DATA_LADYVASHJEVENT, IN_PROGRESS); + } + + void EnterCombat(Unit *who) + { + if (pInstance) + { + //remove old tainted cores to prevent cheating in phase 2 + Map* pMap = m_creature->GetMap(); + Map::PlayerList const &PlayerList = pMap->GetPlayers(); + for(Map::PlayerList::const_iterator i = PlayerList.begin();i != PlayerList.end(); ++i) + { + if (Player* i_pl = i->getSource()) + { + i_pl->DestroyItemCount(31088, 1, true); + } + } + } + StartEvent();//this is EnterCombat(), so were are 100% in combat, start the event + + if (Phase != 2) + AttackStart(who); + } + + void MoveInLineOfSight(Unit *who) + { + if (!Intro) + { + Intro = true; + DoScriptText(SAY_INTRO, m_creature); + } + if (!CanAttack) + return; + if (!who || m_creature->getVictim()) + return; + + if (who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who)) + { + float attackRadius = m_creature->GetAttackDistance(who); + if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->GetDistanceZ(who) <= CREATURE_Z_ATTACK_RANGE && m_creature->IsWithinLOSInMap(who)) + { + //if (who->HasStealthAura()) + // who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); + + if (!m_creature->isInCombat())//AttackStart() sets UNIT_FLAG_IN_COMBAT, so this msut be before attacking + StartEvent(); + + if (Phase != 2) + AttackStart(who); + } + } + } + + void CastShootOrMultishot() + { + switch(rand()%2) + { + case 0: + //Shoot + //Used in Phases 1 and 3 after Entangle or while having nobody in melee range. A shot that hits her target for 4097-5543 Physical damage. + DoCast(m_creature->getVictim(), SPELL_SHOOT); + break; + case 1: + //Multishot + //Used in Phases 1 and 3 after Entangle or while having nobody in melee range. A shot that hits 1 person and 4 people around him for 6475-7525 physical damage. + DoCast(m_creature->getVictim(), SPELL_MULTI_SHOT); + break; + } + if (rand()%3) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_BOWSHOT1, m_creature); break; + case 1: DoScriptText(SAY_BOWSHOT2, m_creature); break; + } + } + } + + void UpdateAI(const uint32 diff) + { + if (!CanAttack && Intro) + { + if (AggroTimer < diff) + { + CanAttack = true; + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + AggroTimer=19000; + }else + { + AggroTimer-=diff; + return; + } + } + //to prevent abuses during phase 2 + if (Phase == 2 && !m_creature->getVictim() && m_creature->isInCombat()) + { + EnterEvadeMode(); + return; + } + //Return since we have no target + if (!UpdateVictim()) + return; + + if (Phase == 1 || Phase == 3) + { + //ShockBlast_Timer + if (ShockBlast_Timer < diff) + { + //Shock Burst + //Randomly used in Phases 1 and 3 on Vashj's target, it's a Shock spell doing 8325-9675 nature damage and stunning the target for 5 seconds, during which she will not attack her target but switch to the next person on the aggro list. + DoCast(m_creature->getVictim(), SPELL_SHOCK_BLAST); + m_creature->TauntApply(m_creature->getVictim()); + + ShockBlast_Timer = 1000+rand()%14000; //random cooldown + }else ShockBlast_Timer -= diff; + + //StaticCharge_Timer + if (StaticCharge_Timer < diff) + { + //Static Charge + //Used on random people (only 1 person at any given time) in Phases 1 and 3, it's a debuff doing 2775 to 3225 Nature damage to the target and everybody in about 5 yards around it, every 1 seconds for 30 seconds. It can be removed by Cloak of Shadows, Iceblock, Divine Shield, etc, but not by Cleanse or Dispel Magic. + Unit *target = NULL; + target = SelectTarget(SELECT_TARGET_RANDOM, 0, 200, true); + + if (target && !target->HasAura(SPELL_STATIC_CHARGE_TRIGGER)) + //cast Static Charge every 2 seconds for 20 seconds + DoCast(target, SPELL_STATIC_CHARGE_TRIGGER); + + StaticCharge_Timer = 10000+rand()%20000; //blizzlike + }else StaticCharge_Timer -= diff; + + //Entangle_Timer + if (Entangle_Timer < diff) + { + if (!Entangle) + { + //Entangle + //Used in Phases 1 and 3, it casts Entangling Roots on everybody in a 15 yard radius of Vashj, immobilzing them for 10 seconds and dealing 500 damage every 2 seconds. It's not a magic effect so it cannot be dispelled, but is removed by various buffs such as Cloak of Shadows or Blessing of Freedom. + DoCast(m_creature->getVictim(), SPELL_ENTANGLE); + Entangle = true; + Entangle_Timer = 10000; + } + else + { + CastShootOrMultishot(); + Entangle = false; + Entangle_Timer = 20000+rand()%5000; + } + }else Entangle_Timer -= diff; + + //Phase 1 + if (Phase == 1) + { + //Start phase 2 + if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 70) + { + //Phase 2 begins when Vashj hits 70%. She will run to the middle of her platform and surround herself in a shield making her invulerable. + Phase = 2; + + m_creature->GetMotionMaster()->Clear(); + DoTeleportTo(MIDDLE_X, MIDDLE_Y, MIDDLE_Z); + + Creature *pCreature; + for(uint8 i = 0; i < 4; ++i) + { + pCreature = m_creature->SummonCreature(SHIED_GENERATOR_CHANNEL, ShieldGeneratorChannelPos[i][0], ShieldGeneratorChannelPos[i][1], ShieldGeneratorChannelPos[i][2], ShieldGeneratorChannelPos[i][3], TEMPSUMMON_CORPSE_DESPAWN, 0); + if (pCreature) + ShieldGeneratorChannel[i] = pCreature->GetGUID(); + } + DoScriptText(SAY_PHASE2, m_creature); + } + } + //Phase 3 + else + { + //SummonSporebat_Timer + if (SummonSporebat_Timer < diff) + { + Creature *Sporebat = NULL; + Sporebat = m_creature->SummonCreature(TOXIC_SPOREBAT, SPOREBAT_X, SPOREBAT_Y, SPOREBAT_Z, SPOREBAT_O, TEMPSUMMON_CORPSE_DESPAWN, 0); + + if (Sporebat) + { + Unit *target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (target) + Sporebat->AI()->AttackStart(target); + } + + //summon sporebats faster and faster + if (SummonSporebat_StaticTimer > 1000) + SummonSporebat_StaticTimer -= 1000; + + SummonSporebat_Timer = SummonSporebat_StaticTimer; + + if (SummonSporebat_Timer < 5000) + SummonSporebat_Timer = 5000; + + }else SummonSporebat_Timer -= diff; + } + + //Melee attack + DoMeleeAttackIfReady(); + + //Check_Timer - used to check if somebody is in melee range + if (Check_Timer < diff) + { + bool InMeleeRange = false; + Unit *target; + std::list t_list = m_creature->getThreatManager().getThreatList(); + for(std::list::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr) + { + target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()); + //if in melee range + if (target && target->IsWithinDistInMap(m_creature, 5)) + { + InMeleeRange = true; + break; + } + } + + //if nobody is in melee range + if (!InMeleeRange) + CastShootOrMultishot(); + + Check_Timer = 5000; + }else Check_Timer -= diff; + } + //Phase 2 + else + { + //ForkedLightning_Timer + if (ForkedLightning_Timer < diff) + { + //Forked Lightning + //Used constantly in Phase 2, it shoots out completely randomly targeted bolts of lightning which hit everybody in a roughtly 60 degree cone in front of Vashj for 2313-2687 nature damage. + Unit *target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM, 0); + + if (!target) + target = m_creature->getVictim(); + + DoCast(target, SPELL_FORKED_LIGHTNING); + + ForkedLightning_Timer = 2000+rand()%6000; //blizzlike + }else ForkedLightning_Timer -= diff; + + //EnchantedElemental_Timer + if (EnchantedElemental_Timer < diff) + { + Creature *Elemental; + Elemental = m_creature->SummonCreature(ENCHANTED_ELEMENTAL, ElementPos[EnchantedElemental_Pos][0], ElementPos[EnchantedElemental_Pos][1], ElementPos[EnchantedElemental_Pos][2], ElementPos[EnchantedElemental_Pos][3], TEMPSUMMON_CORPSE_DESPAWN, 0); + + if (EnchantedElemental_Pos == 7) + EnchantedElemental_Pos = 0; + else + EnchantedElemental_Pos++; + + EnchantedElemental_Timer = 10000+rand()%5000; + }else EnchantedElemental_Timer -= diff; + + //TaintedElemental_Timer + if (TaintedElemental_Timer < diff) + { + Creature *Tain_Elemental; + uint32 pos = rand()%8; + Tain_Elemental = m_creature->SummonCreature(TAINTED_ELEMENTAL, ElementPos[pos][0], ElementPos[pos][1], ElementPos[pos][2], ElementPos[pos][3], TEMPSUMMON_DEAD_DESPAWN, 0); + + TaintedElemental_Timer = 120000; + }else TaintedElemental_Timer -= diff; + + //CoilfangElite_Timer + if (CoilfangElite_Timer < diff) + { + uint32 pos = rand()%3; + Creature* CoilfangElite = NULL; + CoilfangElite = m_creature->SummonCreature(COILFANG_ELITE, CoilfangElitePos[pos][0], CoilfangElitePos[pos][1], CoilfangElitePos[pos][2], CoilfangElitePos[pos][3], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + if (CoilfangElite) + { + Unit *target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (target) + CoilfangElite->AI()->AttackStart(target); + else if (m_creature->getVictim()) + CoilfangElite->AI()->AttackStart(m_creature->getVictim()); + } + CoilfangElite_Timer = 45000+rand()%5000; + }else CoilfangElite_Timer -= diff; + + //CoilfangStrider_Timer + if (CoilfangStrider_Timer < diff) + { + uint32 pos = rand()%3; + Creature* CoilfangStrider = NULL; + CoilfangStrider = m_creature->SummonCreature(COILFANG_STRIDER, CoilfangStriderPos[pos][0], CoilfangStriderPos[pos][1], CoilfangStriderPos[pos][2], CoilfangStriderPos[pos][3], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + if (CoilfangStrider) + { + Unit *target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (target) + CoilfangStrider->AI()->AttackStart(target); + else if (m_creature->getVictim()) + CoilfangStrider->AI()->AttackStart(m_creature->getVictim()); + } + CoilfangStrider_Timer = 60000+rand()%10000; + }else CoilfangStrider_Timer -= diff; + + //Check_Timer + if (Check_Timer < diff) + { + //Start Phase 3 + if (pInstance && pInstance->GetData(DATA_CANSTARTPHASE3)) + { + //set life 50% + m_creature->SetHealth(m_creature->GetMaxHealth()/2); + + m_creature->RemoveAurasDueToSpell(SPELL_MAGIC_BARRIER); + + DoScriptText(SAY_PHASE3, m_creature); + + Phase = 3; + + //return to the tank + m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); + } + Check_Timer = 1000; + }else Check_Timer -= diff; + } + } +}; + +//Enchanted Elemental +//If one of them reaches Vashj he will increase her damage done by 5%. +struct TRINITY_DLL_DECL mob_enchanted_elementalAI : public ScriptedAI +{ + mob_enchanted_elementalAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance *pInstance; + uint32 move; + uint32 phase; + float x, y, z; + Creature *Vashj; + + void Reset() + { + m_creature->SetSpeed(MOVE_WALK,0.6);//walk + m_creature->SetSpeed(MOVE_RUN,0.6);//run + move = 0; + phase = 1; + Vashj = NULL; + + for (int i = 0;i<8; ++i)//search for nearest waypoint (up on stairs) + { + if (!x || !y || !z) + { + x = ElementWPPos[i][0]; + y = ElementWPPos[i][1]; + z = ElementWPPos[i][2]; + } + else + { + if (m_creature->GetDistance(ElementWPPos[i][0],ElementWPPos[i][1],ElementWPPos[i][2]) < m_creature->GetDistance(x,y,z)) + { + x = ElementWPPos[i][0]; + y = ElementWPPos[i][1]; + z = ElementWPPos[i][2]; + } + } + } + if (pInstance) + Vashj = Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_LADYVASHJ)); + } + + void EnterCombat(Unit *who) { return; } + + void MoveInLineOfSight(Unit *who){return;} + + void UpdateAI(const uint32 diff) + { + if (!pInstance) + return; + + if (!Vashj) + { + return; + } + + if (move < diff) + { + m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + if (phase == 1) + { + m_creature->GetMotionMaster()->MovePoint(0, x, y, z); + } + if (phase == 1 && m_creature->IsWithinDist3d(x,y,z, 0.1)) + { + phase = 2; + } + if (phase == 2) + { + m_creature->GetMotionMaster()->MovePoint(0, MIDDLE_X, MIDDLE_Y, MIDDLE_Z); + phase = 3; + } + if (phase == 3) + { + m_creature->GetMotionMaster()->MovePoint(0, MIDDLE_X, MIDDLE_Y, MIDDLE_Z); + if (m_creature->IsWithinDist3d(MIDDLE_X, MIDDLE_Y, MIDDLE_Z, 3)) + { + SpellEntry *spell = GET_SPELL(SPELL_SURGE); + if (spell) + { + uint8 eff_mask=0; + for (int i=0; i<3; ++i) + { + if (!spell->Effect[i]) + continue; + eff_mask|=1<AddAura(new Aura(spell, eff_mask, NULL, Vashj, Vashj)); + } + m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + } + } + if (!Vashj->isInCombat() || CAST_AI(boss_lady_vashjAI, Vashj->AI())->Phase != 2 || Vashj->isDead()) + { + //call Unsummon() + m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + } + move = 1000; + }else move -= diff; + } +}; + +//Tainted Elemental +//This mob has 7,900 life, doesn't move, and shoots Poison Bolts at one person anywhere in the area, doing 3,000 nature damage and placing a posion doing 2,000 damage every 2 seconds. He will switch targets often, or sometimes just hang on a single player, but there is nothing you can do about it except heal the damage and kill the Tainted Elemental +struct TRINITY_DLL_DECL mob_tainted_elementalAI : public ScriptedAI +{ + mob_tainted_elementalAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance *pInstance; + + uint32 PoisonBolt_Timer; + uint32 Despawn_Timer; + + void Reset() + { + PoisonBolt_Timer = 5000+rand()%5000; + Despawn_Timer = 30000; + } + + void JustDied(Unit *killer) + { + if (pInstance) + { + Creature *Vashj = NULL; + Vashj = (Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_LADYVASHJ))); + + if (Vashj) + CAST_AI(boss_lady_vashjAI, Vashj->AI())->EventTaintedElementalDeath(); + } + } + + void EnterCombat(Unit *who) + { + m_creature->AddThreat(who, 0.1f); + } + + void UpdateAI(const uint32 diff) + { + //PoisonBolt_Timer + if (PoisonBolt_Timer < diff) + { + Unit *target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM, 0); + + if (target && target->IsWithinDistInMap(m_creature, 30)) + DoCast(target, SPELL_POISON_BOLT); + + PoisonBolt_Timer = 5000+rand()%5000; + }else PoisonBolt_Timer -= diff; + + //Despawn_Timer + if (Despawn_Timer < diff) + { + //call Unsummon() + m_creature->setDeathState(DEAD); + + //to prevent crashes + Despawn_Timer = 1000; + }else Despawn_Timer -= diff; + } +}; + +//Toxic Sporebat +//Toxic Spores: Used in Phase 3 by the Spore Bats, it creates a contaminated green patch of ground, dealing about 2775-3225 nature damage every second to anyone who stands in it. +struct TRINITY_DLL_DECL mob_toxic_sporebatAI : public ScriptedAI +{ + mob_toxic_sporebatAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + EnterEvadeMode(); + } + + ScriptedInstance *pInstance; + + uint32 movement_timer; + uint32 ToxicSpore_Timer; + uint32 bolt_timer; + uint32 Check_Timer; + + void Reset() + { + m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + m_creature->setFaction(14); + movement_timer = 0; + ToxicSpore_Timer = 5000; + bolt_timer = 5500; + Check_Timer = 1000; + } + + void EnterCombat(Unit *who) + { + + } + + void MoveInLineOfSight(Unit *who) + { + + } + + void MovementInform(uint32 type, uint32 id) + { + if (type != POINT_MOTION_TYPE) + return; + + if (id == 1) + movement_timer = 0; + } + + void UpdateAI (const uint32 diff) + { + //Random movement + if (movement_timer < diff) + { + uint32 rndpos = rand()%8; + m_creature->GetMotionMaster()->MovePoint(1,SporebatWPPos[rndpos][0], SporebatWPPos[rndpos][1], SporebatWPPos[rndpos][2]); + movement_timer = 6000; + }else movement_timer -= diff; + + //toxic spores + if (bolt_timer < diff) + { + Unit *target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (target) + { + Creature* trig = m_creature->SummonCreature(TOXIC_SPORES_TRIGGER,target->GetPositionX(),target->GetPositionY(),target->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN,30000); + if (trig) + { + trig->setFaction(14); + trig->CastSpell(trig, SPELL_TOXIC_SPORES,true); + } + } + bolt_timer = 10000+rand()%5000; + } + else bolt_timer -= diff; + + //Check_Timer + if (Check_Timer < diff) + { + if (pInstance) + { + //check if vashj is death + Unit *Vashj = NULL; + Vashj = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_LADYVASHJ)); + if (!Vashj || (Vashj && !Vashj->isAlive()) || (Vashj && CAST_AI(boss_lady_vashjAI, CAST_CRE(Vashj)->AI())->Phase != 3)) + { + //remove + m_creature->setDeathState(DEAD); + m_creature->RemoveCorpse(); + m_creature->setFaction(35); + } + } + + Check_Timer = 1000; + }else Check_Timer -= diff; + } +}; + +//Coilfang Elite +//It's an elite Naga mob with 170,000 HP. It does about 5000 damage on plate, and has a nasty cleave hitting for about 7500 damage +CreatureAI* GetAI_mob_coilfang_elite(Creature* pCreature) +{ + SimpleAI* ai = new SimpleAI (pCreature); + + ai->Spell[0].Enabled = true; + ai->Spell[0].Spell_Id = 31345; //Cleave + ai->Spell[0].Cooldown = 15000; + ai->Spell[0].CooldownRandomAddition = 5000; + ai->Spell[0].First_Cast = 5000; + ai->Spell[0].Cast_Target_Type = CAST_HOSTILE_RANDOM; + + ai->EnterEvadeMode(); + + return ai; +} + +//Coilfang Strider +//It hits plate for about 8000 damage, has a Mind Blast spell doing about 3000 shadow damage, and a Psychic Scream Aura, which fears everybody in a 8 yard range of it every 2-3 seconds , for 5 seconds and increasing their movement speed by 150% during the fear. +CreatureAI* GetAI_mob_coilfang_strider(Creature* pCreature) +{ + SimpleAI* ai = new SimpleAI (pCreature); + + ai->Spell[0].Enabled = true; + ai->Spell[0].Spell_Id = 41374; //Mind Blast + ai->Spell[0].Cooldown = 30000; + ai->Spell[0].CooldownRandomAddition = 10000; + ai->Spell[0].First_Cast = 8000; + ai->Spell[0].Cast_Target_Type = CAST_HOSTILE_TARGET; + + //Scream aura not implemented + + ai->EnterEvadeMode(); + + return ai; +} + +struct TRINITY_DLL_DECL mob_shield_generator_channelAI : public ScriptedAI +{ + mob_shield_generator_channelAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance *pInstance; + uint32 Check_Timer; + bool Casted; + void Reset() + { + Check_Timer = 0; + Casted = false; + m_creature->SetDisplayId(11686); //invisible + + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + } + + void EnterCombat(Unit *who) { return; } + + void MoveInLineOfSight(Unit *who) { return; } + + void UpdateAI (const uint32 diff) + { + if (!pInstance) + return; + + if (Check_Timer < diff) + { + Unit *Vashj = NULL; + Vashj = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_LADYVASHJ)); + + if (Vashj && Vashj->isAlive()) + { + //start visual channel + if (!Casted || !Vashj->HasAura(SPELL_MAGIC_BARRIER)) + { + m_creature->CastSpell(Vashj,SPELL_MAGIC_BARRIER,true); + Casted = true; + } + } + Check_Timer = 1000; + }else Check_Timer -= diff; + } +}; + +bool ItemUse_item_tainted_core(Player* pPlayer, Item* _Item, SpellCastTargets const& targets) +{ + ScriptedInstance *pInstance = (pPlayer->GetInstanceData()) ? (pPlayer->GetInstanceData()) : NULL; + + if (!pInstance) + { + pPlayer->GetSession()->SendNotification("Instance script not initialized"); + return true; + } + + Creature *Vashj = NULL; + Vashj = (Unit::GetCreature((*pPlayer), pInstance->GetData64(DATA_LADYVASHJ))); + if (Vashj && CAST_AI(boss_lady_vashjAI, Vashj->AI())->Phase == 2) + { + if (targets.getGOTarget() && targets.getGOTarget()->GetTypeId()==TYPEID_GAMEOBJECT) + { + uint32 identifier; + uint8 channel_identifier; + switch(targets.getGOTarget()->GetEntry()) + { + case 185052: + identifier = DATA_SHIELDGENERATOR1; + channel_identifier = 0; + break; + case 185053: + identifier = DATA_SHIELDGENERATOR2; + channel_identifier = 1; + break; + case 185051: + identifier = DATA_SHIELDGENERATOR3; + channel_identifier = 2; + break; + case 185054: + identifier = DATA_SHIELDGENERATOR4; + channel_identifier = 3; + break; + default: + return true; + } + + if (pInstance->GetData(identifier)) + { + pPlayer->GetSession()->SendNotification("Already deactivated"); + return true; + } + + //get and remove channel + Unit *Channel = NULL; + Channel = Unit::GetCreature(*Vashj, CAST_AI(boss_lady_vashjAI, Vashj->AI())->ShieldGeneratorChannel[channel_identifier]); + if (Channel) + { + //call Unsummon() + Channel->setDeathState(JUST_DIED); + } + + pInstance->SetData(identifier, 1); + + //remove this item + pPlayer->DestroyItemCount(31088, 1, true); + return true; + } + else if (targets.getUnitTarget()->GetTypeId() == TYPEID_UNIT) + return false; + else if (targets.getUnitTarget()->GetTypeId() == TYPEID_PLAYER) + { + pPlayer->DestroyItemCount(31088, 1, true); + pPlayer->CastSpell(targets.getUnitTarget(), 38134, true); + return true; + } + } + return true; +} + +CreatureAI* GetAI_boss_lady_vashj(Creature* pCreature) +{ + return new boss_lady_vashjAI (pCreature); +} + +CreatureAI* GetAI_mob_enchanted_elemental(Creature* pCreature) +{ + return new mob_enchanted_elementalAI (pCreature); +} + +CreatureAI* GetAI_mob_tainted_elemental(Creature* pCreature) +{ + return new mob_tainted_elementalAI (pCreature); +} + +CreatureAI* GetAI_mob_toxic_sporebat(Creature* pCreature) +{ + return new mob_toxic_sporebatAI (pCreature); +} + +CreatureAI* GetAI_mob_shield_generator_channel(Creature* pCreature) +{ + return new mob_shield_generator_channelAI (pCreature); +} + +void AddSC_boss_lady_vashj() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_lady_vashj"; + newscript->GetAI = &GetAI_boss_lady_vashj; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_enchanted_elemental"; + newscript->GetAI = &GetAI_mob_enchanted_elemental; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_tainted_elemental"; + newscript->GetAI = &GetAI_mob_tainted_elemental; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_toxic_sporebat"; + newscript->GetAI = &GetAI_mob_toxic_sporebat; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_coilfang_elite"; + newscript->GetAI = &GetAI_mob_coilfang_elite; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_coilfang_strider"; + newscript->GetAI = &GetAI_mob_coilfang_strider; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_shield_generator_channel"; + newscript->GetAI = &GetAI_mob_shield_generator_channel; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="item_tainted_core"; + newscript->pItemUse = &ItemUse_item_tainted_core; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/boss_leotheras_the_blind.cpp b/src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/boss_leotheras_the_blind.cpp new file mode 100644 index 00000000000..e43afc2926f --- /dev/null +++ b/src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/boss_leotheras_the_blind.cpp @@ -0,0 +1,808 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Leotheras_The_Blind +SD%Complete: 80 +SDComment: Possesion Support +SDCategory: Coilfang Resevoir, Serpent Shrine Cavern +EndScriptData */ + +#include "precompiled.h" +#include "def_serpent_shrine.h" + +// --- Spells used by Leotheras The Blind +#define SPELL_WHIRLWIND 37640 +#define SPELL_CHAOS_BLAST 37674 +#define SPELL_BERSERK 26662 +#define SPELL_INSIDIOUS_WHISPER 37676 +#define SPELL_DUAL_WIELD 42459 + +// --- Spells used in banish phase --- +#define BANISH_BEAM 38909 +#define AURA_BANISH 37833 + +// --- Spells used by Greyheart Spellbinders +#define SPELL_EARTHSHOCK 39076 +#define SPELL_MINDBLAST 37531 + +// --- Spells used by Inner Demons and Creature ID +#define INNER_DEMON_ID 21857 +#define AURA_DEMONIC_ALIGNMENT 37713 +#define SPELL_SHADOWBOLT 39309 +#define SPELL_SOUL_LINK 38007 +#define SPELL_CONSUMING_MADNESS 37749 //not supported by core yet + +//Misc. +#define MODEL_DEMON 20125 +#define MODEL_NIGHTELF 20514 +#define DEMON_FORM 21875 +#define MOB_SPELLBINDER 21806 + +#define SAY_AGGRO -1548009 +#define SAY_SWITCH_TO_DEMON -1548010 +#define SAY_INNER_DEMONS -1548011 +#define SAY_DEMON_SLAY1 -1548012 +#define SAY_DEMON_SLAY2 -1548013 +#define SAY_DEMON_SLAY3 -1548014 +#define SAY_NIGHTELF_SLAY1 -1548015 +#define SAY_NIGHTELF_SLAY2 -1548016 +#define SAY_NIGHTELF_SLAY3 -1548017 +#define SAY_FINAL_FORM -1548018 +#define SAY_FREE -1548019 +#define SAY_DEATH -1548020 + +struct TRINITY_DLL_DECL mob_inner_demonAI : public ScriptedAI +{ + mob_inner_demonAI(Creature *c) : ScriptedAI(c) + { + victimGUID = 0; + } + + uint32 ShadowBolt_Timer; + + uint32 Link_Timer; + uint64 victimGUID; + + void Reset() + { + ShadowBolt_Timer = 10000; + Link_Timer = 1000; + } + void JustDied(Unit *victim) + { + Unit* pUnit = Unit::GetUnit((*m_creature),victimGUID); + if (pUnit && pUnit->HasAura(SPELL_INSIDIOUS_WHISPER)) + pUnit->RemoveAurasDueToSpell(SPELL_INSIDIOUS_WHISPER); + } + + void DamageTaken(Unit *done_by, uint32 &damage) + { + if (done_by->GetGUID() != victimGUID && done_by->GetGUID() != m_creature->GetGUID()) + { + damage = 0; + DoModifyThreatPercent(done_by, -100); + } + } + + void EnterCombat(Unit *who) + { + if (!victimGUID) return; + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + if (m_creature->getVictim()->GetGUID() != victimGUID) + { + DoModifyThreatPercent(m_creature->getVictim(), -100); + Unit* owner = Unit::GetUnit((*m_creature),victimGUID); + if (owner && owner->isAlive()) + { + m_creature->AddThreat(owner,999999); + AttackStart(owner); + }else if (owner && owner->isDead()) + { + m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + return; + } + } + + if (Link_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_SOUL_LINK, true); + Link_Timer = 1000; + }else Link_Timer -= diff; + + + if (!m_creature->HasAura(AURA_DEMONIC_ALIGNMENT)) + DoCast(m_creature, AURA_DEMONIC_ALIGNMENT,true); + + if (ShadowBolt_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_SHADOWBOLT, false); + ShadowBolt_Timer = 10000; + }else ShadowBolt_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +//Original Leotheras the Blind AI +struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI +{ + boss_leotheras_the_blindAI(Creature *c) : ScriptedAI(c) + { + m_creature->GetPosition(x,y,z); + pInstance = c->GetInstanceData(); + Demon = 0; + + for(uint8 i = 0; i < 3; ++i)//clear guids + SpellBinderGUID[i] = 0; + } + + ScriptedInstance *pInstance; + + uint32 Whirlwind_Timer; + uint32 ChaosBlast_Timer; + uint32 SwitchToDemon_Timer; + uint32 SwitchToHuman_Timer; + uint32 Berserk_Timer; + uint32 InnerDemons_Timer; + uint32 BanishTimer; + + bool DealDamage; + bool NeedThreatReset; + bool DemonForm; + bool IsFinalForm; + bool EnrageUsed; + float x,y,z; + + uint64 InnderDemon[5]; + uint32 InnderDemon_Count; + uint64 Demon; + uint64 SpellBinderGUID[3]; + + void Reset() + { + CheckChannelers(); + BanishTimer = 1000; + Whirlwind_Timer = 15000; + ChaosBlast_Timer = 1000; + SwitchToDemon_Timer = 45000; + SwitchToHuman_Timer = 60000; + Berserk_Timer = 600000; + InnerDemons_Timer = 30000; + m_creature->SetCanDualWield(true); + DealDamage = true; + DemonForm = false; + IsFinalForm = false; + NeedThreatReset = false; + EnrageUsed = false; + InnderDemon_Count = 0; + m_creature->SetSpeed(MOVE_RUN, 2.0f, true); + m_creature->SetDisplayId(MODEL_NIGHTELF); + m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID , 0); + m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, 0); + m_creature->CastSpell(m_creature, SPELL_DUAL_WIELD, true); + m_creature->SetCorpseDelay(1000*60*60); + if (pInstance) + pInstance->SetData(DATA_LEOTHERASTHEBLINDEVENT, NOT_STARTED); + } + + void CheckChannelers(bool DoEvade = true) + { + for(uint8 i = 0; i < 3; ++i) + { + if (Creature *add = Unit::GetCreature(*m_creature,SpellBinderGUID[i])) + add->DisappearAndDie(); + + float nx = x; + float ny = y; + float o = 2.4f; + if (i == 0) {nx += 10; ny -= 5; o=2.5f;} + if (i == 1) {nx -= 8; ny -= 7; o=0.9f;} + if (i == 2) {nx -= 3; ny += 9; o=5.0f;} + Creature* binder = m_creature->SummonCreature(MOB_SPELLBINDER,nx,ny,z,o,TEMPSUMMON_DEAD_DESPAWN,0); + if (binder) + SpellBinderGUID[i] = binder->GetGUID(); + + } + } + void MoveInLineOfSight(Unit *who) + { + if (m_creature->HasAura(AURA_BANISH)) + return; + + if (!m_creature->getVictim() && who->isTargetableForAttack() && (m_creature->IsHostileTo(who)) && who->isInAccessiblePlaceFor(m_creature)) + { + if (m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) + return; + + float attackRadius = m_creature->GetAttackDistance(who); + if (m_creature->IsWithinDistInMap(who, attackRadius)) + { + // Check first that object is in an angle in front of this one before LoS check + if (m_creature->HasInArc(M_PI/2.0f, who) && m_creature->IsWithinLOSInMap(who)) + { + AttackStart(who); + } + } + } + } + + void StartEvent() + { + DoScriptText(SAY_AGGRO, m_creature); + if (pInstance) + pInstance->SetData(DATA_LEOTHERASTHEBLINDEVENT, IN_PROGRESS); + } + + void CheckBanish() + { + uint8 AliveChannelers = 0; + for(uint8 i = 0; i < 3; ++i) + { + Unit *add = Unit::GetUnit(*m_creature,SpellBinderGUID[i]); + if (add && add->isAlive()) + AliveChannelers++; + } + + // channelers == 0 remove banish aura + if (AliveChannelers == 0 && m_creature->HasAura(AURA_BANISH)) + { + // removing banish aura + m_creature->RemoveAurasDueToSpell(AURA_BANISH); + + // Leotheras is getting immune again + m_creature->ApplySpellImmune(AURA_BANISH, IMMUNITY_MECHANIC, MECHANIC_BANISH, true); + + // changing model to bloodelf + m_creature->SetDisplayId(MODEL_NIGHTELF); + + // and reseting equipment + m_creature->LoadEquipment(m_creature->GetEquipmentId()); + + if (pInstance && pInstance->GetData64(DATA_LEOTHERAS_EVENT_STARTER)) + { + Unit *victim = NULL; + victim = Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_LEOTHERAS_EVENT_STARTER)); + if (victim) + m_creature->getThreatManager().addThreat(victim, 1); + StartEvent(); + } + } + else if (AliveChannelers != 0 && !m_creature->HasAura(AURA_BANISH)) + { + // channelers != 0 apply banish aura + // removing Leotheras banish immune to apply AURA_BANISH + m_creature->ApplySpellImmune(AURA_BANISH, IMMUNITY_MECHANIC, MECHANIC_BANISH, false); + DoCast(m_creature, AURA_BANISH); + + // changing model + m_creature->SetDisplayId(MODEL_DEMON); + + // and removing weapons + m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID , 0); + m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, 0); + } + } + + //Despawn all Inner Demon summoned + void DespawnDemon() + { + for(uint8 i=0; i<5; ++i) + { + if (InnderDemon[i]) + { + //delete creature + Creature* pCreature = Unit::GetCreature((*m_creature), InnderDemon[i]); + if (pCreature && pCreature->isAlive()) + { + pCreature->ForcedDespawn(); + } + InnderDemon[i] = 0; + } + } + + InnderDemon_Count = 0; + } + + void CastConsumingMadness() //remove this once SPELL_INSIDIOUS_WHISPER is supported by core + { + for(uint8 i=0; i<5; ++i) + { + if (InnderDemon[i] > 0) + { + Creature* pUnit = Unit::GetCreature((*m_creature), InnderDemon[i]); + if (pUnit && pUnit->isAlive()) + { + Unit* pUnit_target = Unit::GetUnit(*pUnit, CAST_AI(mob_inner_demonAI, pUnit->AI())->victimGUID); + if (pUnit_target && pUnit_target->isAlive()) + { + pUnit->CastSpell(pUnit_target, SPELL_CONSUMING_MADNESS, true); + DoModifyThreatPercent(pUnit_target, -100); + } + } + } + } + } + + void KilledUnit(Unit *victim) + { + if (victim->GetTypeId() != TYPEID_PLAYER) + return; + + if (DemonForm) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_DEMON_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_DEMON_SLAY2, m_creature); break; + case 2: DoScriptText(SAY_DEMON_SLAY3, m_creature); break; + } + } + else + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_NIGHTELF_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_NIGHTELF_SLAY2, m_creature); break; + case 2: DoScriptText(SAY_NIGHTELF_SLAY3, m_creature); break; + } + } + } + + void JustDied(Unit *victim) + { + DoScriptText(SAY_DEATH, m_creature); + + //despawn copy + if (Demon) + { + if (Creature* pDemon = Unit::GetCreature(*m_creature, Demon)) + pDemon->ForcedDespawn(); + } + if (pInstance) + pInstance->SetData(DATA_LEOTHERASTHEBLINDEVENT, DONE); + } + + void EnterCombat(Unit *who) + { + if (m_creature->HasAura(AURA_BANISH)) + return; + + m_creature->LoadEquipment(m_creature->GetEquipmentId()); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (m_creature->HasAura(AURA_BANISH) || !UpdateVictim()) + { + if (BanishTimerHasAura(SPELL_WHIRLWIND)) + if (Whirlwind_Timer < diff) + { + Unit *newTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (newTarget) + { + DoResetThreat(); + m_creature->GetMotionMaster()->Clear(); + m_creature->GetMotionMaster()->MovePoint(0,newTarget->GetPositionX(),newTarget->GetPositionY(),newTarget->GetPositionZ()); + } + Whirlwind_Timer = 2000; + }else Whirlwind_Timer -= diff; + + // reseting after changing forms and after ending whirlwind + if (NeedThreatReset && !m_creature->HasAura(SPELL_WHIRLWIND)) + { + // when changing forms seting timers (or when ending whirlwind - to avoid adding new variable i use Whirlwind_Timer to countdown 2s while whirlwinding) + if (DemonForm) + InnerDemons_Timer = 30000; + else + Whirlwind_Timer = 15000; + + NeedThreatReset = false; + DoResetThreat(); + m_creature->GetMotionMaster()->Clear(); + m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); + } + + //Enrage_Timer (10 min) + if (Berserk_Timer < diff && !EnrageUsed) + { + m_creature->InterruptNonMeleeSpells(false); + DoCast(m_creature, SPELL_BERSERK); + EnrageUsed = true; + }else Berserk_Timer -= diff; + + if (!DemonForm) + { + //Whirldind Timer + if (!m_creature->HasAura(SPELL_WHIRLWIND)) + { + if (Whirlwind_Timer < diff) + { + DoCast(m_creature, SPELL_WHIRLWIND); + // while whirlwinding this variable is used to countdown target's change + Whirlwind_Timer = 2000; + NeedThreatReset = true; + }else Whirlwind_Timer -= diff; + } + //Switch_Timer + + if (!IsFinalForm) + if (SwitchToDemon_Timer < diff) + { + //switch to demon form + m_creature->RemoveAurasDueToSpell(SPELL_WHIRLWIND,0); + m_creature->SetDisplayId(MODEL_DEMON); + DoScriptText(SAY_SWITCH_TO_DEMON, m_creature); + m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID , 0); + m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, 0); + DemonForm = true; + NeedThreatReset = true; + SwitchToDemon_Timer = 45000; + }else SwitchToDemon_Timer -= diff; + DoMeleeAttackIfReady(); + } + else + { + //ChaosBlast_Timer + if (!m_creature->getVictim()) + return; + if (m_creature->IsWithinDist(m_creature->getVictim(), 30)) + m_creature->StopMoving(); + if (ChaosBlast_Timer < diff) + { + // will cast only when in range of spell + if (m_creature->IsWithinDist(m_creature->getVictim(), 30)) + { + //m_creature->CastSpell(m_creature->getVictim(), SPELL_CHAOS_BLAST, true); + int damage = 100; + m_creature->CastCustomSpell(m_creature->getVictim(), SPELL_CHAOS_BLAST, &damage, NULL, NULL, false, NULL, NULL, m_creature->GetGUID()); + } + ChaosBlast_Timer = 3000; + }else ChaosBlast_Timer -= diff; + //Summon Inner Demon + if (InnerDemons_Timer < diff) + { + std::list& ThreatList = m_creature->getThreatManager().getThreatList(); + std::vector TargetList; + for(std::list::iterator itr = ThreatList.begin(); itr != ThreatList.end(); ++itr) + { + Unit *tempTarget = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()); + if (tempTarget && tempTarget->GetTypeId() == TYPEID_PLAYER && tempTarget->GetGUID() != m_creature->getVictim()->GetGUID() && TargetList.size()<5) + TargetList.push_back(tempTarget); + } + SpellEntry *spell = GET_SPELL(SPELL_INSIDIOUS_WHISPER); + for(std::vector::iterator itr = TargetList.begin(); itr != TargetList.end(); ++itr) + { + if ((*itr) && (*itr)->isAlive()) + { + Creature * demon = m_creature->SummonCreature(INNER_DEMON_ID, (*itr)->GetPositionX()+10, (*itr)->GetPositionY()+10, (*itr)->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + if (demon) + { + demon->AI()->AttackStart((*itr)); + CAST_AI(mob_inner_demonAI, demon->AI())->victimGUID = (*itr)->GetGUID(); + + uint8 eff_mask=0; + for (int i=0; i<3; ++i) + { + if (!spell->Effect[i]) + continue; + eff_mask|=1<AddAura(new Aura(spell, eff_mask, NULL, (*itr), (*itr))); + if (InnderDemon_Count > 4) InnderDemon_Count = 0; + + //Safe storing of creatures + InnderDemon[InnderDemon_Count] = demon->GetGUID(); + + //Update demon count + InnderDemon_Count++; + } + } + } + DoScriptText(SAY_INNER_DEMONS, m_creature); + + InnerDemons_Timer = 999999; + }else InnerDemons_Timer -= diff; + + //Switch_Timer + if (SwitchToHuman_Timer < diff) + { + //switch to nightelf form + m_creature->SetDisplayId(MODEL_NIGHTELF); + m_creature->LoadEquipment(m_creature->GetEquipmentId()); + + CastConsumingMadness(); + DespawnDemon(); + + DemonForm = false; + NeedThreatReset = true; + + SwitchToHuman_Timer = 60000; + }else SwitchToHuman_Timer -= diff; + } + + if (!IsFinalForm && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 15) + { + //at this point he divides himself in two parts + CastConsumingMadness(); + DespawnDemon(); + Creature *Copy = NULL; + Copy = DoSpawnCreature(DEMON_FORM, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 6000); + if (Copy) + { + Demon = Copy->GetGUID(); + if (m_creature->getVictim()) + Copy->AI()->AttackStart(m_creature->getVictim()); + } + //set nightelf final form + IsFinalForm = true; + DemonForm = false; + + DoScriptText(SAY_FINAL_FORM, m_creature); + m_creature->SetDisplayId(MODEL_NIGHTELF); + m_creature->LoadEquipment(m_creature->GetEquipmentId()); + } + } +}; + +//Leotheras the Blind Demon Form AI +struct TRINITY_DLL_DECL boss_leotheras_the_blind_demonformAI : public ScriptedAI +{ + boss_leotheras_the_blind_demonformAI(Creature *c) : ScriptedAI(c) {} + + uint32 ChaosBlast_Timer; + bool DealDamage; + + void Reset() + { + ChaosBlast_Timer = 1000; + DealDamage = true; + } + + void StartEvent() + { + DoScriptText(SAY_FREE, m_creature); + } + + void KilledUnit(Unit *victim) + { + if (victim->GetTypeId() != TYPEID_PLAYER) + return; + + switch(rand()%3) + { + case 0: DoScriptText(SAY_DEMON_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_DEMON_SLAY2, m_creature); break; + case 2: DoScriptText(SAY_DEMON_SLAY3, m_creature); break; + } + } + + void JustDied(Unit *victim) + { + //invisibility (blizzlike, at the end of the fight he doesn't die, he disappears) + m_creature->CastSpell(m_creature, 8149, true); + } + + void EnterCombat(Unit *who) + { + StartEvent(); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + //ChaosBlast_Timer + if (m_creature->IsWithinDist(m_creature->getVictim(), 30)) + m_creature->StopMoving(); + + if (ChaosBlast_Timer < diff) + { + // will cast only when in range od spell + if (m_creature->IsWithinDist(m_creature->getVictim(), 30)) + { + //m_creature->CastSpell(m_creature->getVictim(),SPELL_CHAOS_BLAST,true); + int damage = 100; + m_creature->CastCustomSpell(m_creature->getVictim(), SPELL_CHAOS_BLAST, &damage, NULL, NULL, false, NULL, NULL, m_creature->GetGUID()); + ChaosBlast_Timer = 3000; + } + }else ChaosBlast_Timer -= diff; + + //Do NOT deal any melee damage to the target. + } +}; +struct TRINITY_DLL_DECL mob_greyheart_spellbinderAI : public ScriptedAI +{ + mob_greyheart_spellbinderAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData();; + leotherasGUID = 0; + AddedBanish = false; + } + + ScriptedInstance *pInstance; + + uint64 leotherasGUID; + + uint32 Mindblast_Timer; + uint32 Earthshock_Timer; + + bool AddedBanish; + + void Reset() + { + Mindblast_Timer = 3000 + rand()%5000; + Earthshock_Timer = 5000 + rand()%5000; + + if (pInstance) + { + pInstance->SetData64(DATA_LEOTHERAS_EVENT_STARTER, 0); + Creature *leotheras = Unit::GetCreature(*m_creature, leotherasGUID); + if (leotheras && leotheras->isAlive()) + CAST_AI(boss_leotheras_the_blindAI, leotheras->AI())->CheckChannelers(false); + } + } + + void EnterCombat(Unit *who) + { + m_creature->InterruptNonMeleeSpells(false); + if (pInstance) + pInstance->SetData64(DATA_LEOTHERAS_EVENT_STARTER, who->GetGUID()); + } + + void JustRespawned() + { + AddedBanish = false; + Reset(); + } + + void CastChanneling() + { + if (!m_creature->isInCombat() && !m_creature->m_currentSpells[CURRENT_CHANNELED_SPELL]) + { + if (leotherasGUID) + { + Creature *leotheras = Unit::GetCreature(*m_creature, leotherasGUID); + if (leotheras && leotheras->isAlive()) + DoCast(leotheras, BANISH_BEAM); + } + } + } + + void UpdateAI(const uint32 diff) + { + if (pInstance) + { + if (!leotherasGUID) + leotherasGUID = pInstance->GetData64(DATA_LEOTHERAS); + + if (!m_creature->isInCombat() && pInstance->GetData64(DATA_LEOTHERAS_EVENT_STARTER)) + { + Unit *victim = NULL; + victim = Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_LEOTHERAS_EVENT_STARTER)); + if (victim) + AttackStart(victim); + } + } + + if (!UpdateVictim()) + { + CastChanneling(); + return; + } + + if (pInstance && !pInstance->GetData64(DATA_LEOTHERAS_EVENT_STARTER)) + { + EnterEvadeMode(); + return; + } + + if (Mindblast_Timer < diff) + { + Unit* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM,0); + + if (target)DoCast(target, SPELL_MINDBLAST); + + Mindblast_Timer = 10000 + rand()%5000; + }else Mindblast_Timer -= diff; + + if (Earthshock_Timer < diff) + { + Map* pMap = m_creature->GetMap(); + Map::PlayerList const &PlayerList = pMap->GetPlayers(); + for(Map::PlayerList::const_iterator itr = PlayerList.begin();itr != PlayerList.end(); ++itr) + { + if (Player* i_pl = itr->getSource()) + { + bool isCasting = false; + for(uint8 i = 0; i < CURRENT_MAX_SPELL; ++i) + if (i_pl->m_currentSpells[i]) + isCasting = true; + + if (isCasting) + { + DoCast(i_pl, SPELL_EARTHSHOCK); + break; + } + } + } + Earthshock_Timer = 8000 + rand()%7000; + }else Earthshock_Timer -= diff; + DoMeleeAttackIfReady(); + } + + void JustDied(Unit *killer) {} +}; +CreatureAI* GetAI_boss_leotheras_the_blind(Creature* pCreature) +{ + return new boss_leotheras_the_blindAI (pCreature); +} + +CreatureAI* GetAI_boss_leotheras_the_blind_demonform(Creature* pCreature) +{ + return new boss_leotheras_the_blind_demonformAI (pCreature); +} + +CreatureAI* GetAI_mob_greyheart_spellbinder(Creature* pCreature) +{ + return new mob_greyheart_spellbinderAI (pCreature); +} + +CreatureAI* GetAI_mob_inner_demon(Creature* pCreature) +{ + return new mob_inner_demonAI (pCreature); +} +void AddSC_boss_leotheras_the_blind() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_leotheras_the_blind"; + newscript->GetAI = &GetAI_boss_leotheras_the_blind; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="boss_leotheras_the_blind_demonform"; + newscript->GetAI = &GetAI_boss_leotheras_the_blind_demonform; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_greyheart_spellbinder"; + newscript->GetAI = &GetAI_mob_greyheart_spellbinder; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_inner_demon"; + newscript->GetAI = &GetAI_mob_inner_demon; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/boss_lurker_below.cpp b/src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/boss_lurker_below.cpp new file mode 100644 index 00000000000..38abc8f1507 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/boss_lurker_below.cpp @@ -0,0 +1,489 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: boss_the_lurker_below +SD%Complete: 80 +SDComment: Coilfang Frenzy, find out how could we fishing in the strangepool +SDCategory: The Lurker Below +EndScriptData */ + +#include "precompiled.h" +#include "def_serpent_shrine.h" +#include "simple_ai.h" +#include "Spell.h" + +#define SPELL_SPOUT 37433 +#define SPELL_SPOUT_ANIM 42835 +#define SPELL_SPOUT_BREATH 37431 +#define SPELL_KNOCKBACK 19813 +#define SPELL_GEYSER 37478 +#define SPELL_WHIRL 37660 +#define SPELL_WATERBOLT 37138 +#define SPELL_SUBMERGE 37550 +#define SPELL_EMERGE 20568 +#define SPELL_SCALDINGWATER 37284 + +#define EMOTE_SPOUT "takes a deep breath." + +#define SPOUT_DIST 100 + +#define MOB_COILFANG_GUARDIAN 21873 +#define MOB_COILFANG_AMBUSHER 21865 + +//Ambusher spells +#define SPELL_SPREAD_SHOT 37790 +#define SPELL_SHOOT 37770 + +//Guardian spells +#define SPELL_ARCINGSMASH 38761 // Wrong SpellId. Can't find the right one. +#define SPELL_HAMSTRING 26211 + +float AddPos[9][3] = +{ + {2.8553810, -459.823914, -19.182686}, //MOVE_AMBUSHER_1 X, Y, Z + {12.400000, -466.042267, -19.182686}, //MOVE_AMBUSHER_2 X, Y, Z + {51.366653, -460.836060, -19.182686}, //MOVE_AMBUSHER_3 X, Y, Z + {62.597980, -457.433044, -19.182686}, //MOVE_AMBUSHER_4 X, Y, Z + {77.607452, -384.302765, -19.182686}, //MOVE_AMBUSHER_5 X, Y, Z + {63.897900, -378.984924, -19.182686}, //MOVE_AMBUSHER_6 X, Y, Z + {34.447250, -387.333618, -19.182686}, //MOVE_GUARDIAN_1 X, Y, Z + {14.388216, -423.468018, -19.625271}, //MOVE_GUARDIAN_2 X, Y, Z + {42.471519, -445.115295, -19.769423} //MOVE_GUARDIAN_3 X, Y, Z +}; + +enum RotationType +{ + NOROTATE = 0, + CLOCKWISE = 1, + COUNTERCLOCKWISE = 2, +}; + +struct TRINITY_DLL_DECL boss_the_lurker_belowAI : public Scripted_NoMovementAI +{ + boss_the_lurker_belowAI(Creature *c) : Scripted_NoMovementAI(c), Summons(m_creature) + { + pInstance = c->GetInstanceData(); + SpellEntry *TempSpell = GET_SPELL(SPELL_SPOUT_ANIM); + if (TempSpell) + { + TempSpell->Effect[0] = 0;//remove all spell effect, only anim is needed + TempSpell->Effect[1] = 0; + TempSpell->Effect[2] = 0; + } + } + + ScriptedInstance* pInstance; + SummonList Summons; + + bool Spawned; + bool Submerged; + + double SpoutAngle; + + uint8 RotType; + + uint32 RotTimer; + uint32 SpoutAnimTimer; + uint32 WaterboltTimer; + uint32 SpoutTimer; + uint32 WhirlTimer;//after avery spout + uint32 PhaseTimer; + uint32 GeyserTimer; + + void Reset() + { + m_creature->AddUnitMovementFlag(MOVEMENTFLAG_SWIMMING + MOVEMENTFLAG_LEVITATING); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetCorpseDelay(1000*60*60); + + RotType = NOROTATE; + + SpoutAngle = 0; + SpoutAnimTimer = 1000; + RotTimer = 20000; + WaterboltTimer = 3000; + SpoutTimer = 15000; + WhirlTimer = 18000;//after avery spout + PhaseTimer = 120000; + GeyserTimer = rand()%5000 + 15000; + + Submerged = false; + Spawned = false; + + Summons.DespawnAll(); + + if (pInstance) + pInstance->SetData(DATA_THELURKERBELOWEVENT, NOT_STARTED); + + /*if (pInstance->GetData(DATA_STRANGE_POOL) != DONE) + { + m_creature->SetReactState(REACT_PASSIVE); + m_creature->SetVisibility(VISIBILITY_OFF); + }else { + m_creature->SetVisibility(VISIBILITY_ON); + m_creature->SetReactState(REACT_AGGRESSIVE); + }*/ + } + + void MoveInLineOfSight(Unit *who) + { + if (!who || m_creature->getVictim()) + return; + + if (who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who)) + { + float attackRadius = m_creature->GetAttackDistance(who); + if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who)) + AttackStart(who); + } + } + + void EnterCombat(Unit *who) + { + if (pInstance) + pInstance->SetData(DATA_THELURKERBELOWEVENT, IN_PROGRESS); + + if (!who || m_creature->getVictim()) + return; + + if (who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who)) + { + float attackRadius = m_creature->GetAttackDistance(who); + if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who)) + AttackStart(who); + } + } + + void JustDied(Unit* Killer) + { + if (pInstance) + pInstance->SetData(DATA_THELURKERBELOWEVENT, DONE); + + Summons.DespawnAll(); + } + + void Rotate(const uint32 diff) + { + bool Spout = false; + switch (RotType) + { + case NOROTATE: + return; + case CLOCKWISE://20secs for 360turn + //no target if rotating! + m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0); + SpoutAngle += (double)diff/20000*(double)M_PI*2; + if (SpoutAngle >= M_PI*2)SpoutAngle = 0; + m_creature->SetOrientation(SpoutAngle); + m_creature->StopMoving(); + Spout = true; + break; + case COUNTERCLOCKWISE://20secs for 360turn + //no target if rotating! + m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0); + SpoutAngle -= (double)diff/20000*(double)M_PI*2; + if (SpoutAngle <= 0)SpoutAngle = M_PI*2; + m_creature->SetOrientation(SpoutAngle); + m_creature->StopMoving(); + Spout = true; + break; + } + + if (!Spout) + return; + + if (RotTimerInterruptNonMeleeSpells(false); + WhirlTimer = 4000; //whirl directly after spout ends + return; + }else RotTimer-=diff; + + if (SpoutAnimTimerGetMap(); + if (pMap->IsDungeon() && pInstance->GetData(DATA_THELURKERBELOWEVENT) == IN_PROGRESS) + { + Map::PlayerList const &PlayerList = pMap->GetPlayers(); + for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) + { + Player *target = i->getSource(); + if (target && target->isAlive() && m_creature->HasInArc((double)diff/20000*(double)M_PI*2,target) && m_creature->IsWithinDist(target, SPOUT_DIST) && !target->IsInWater()) + DoCast(target,SPELL_SPOUT,true);//only knock back palyers in arc, in 100yards, not in water + } + } + } + + void StartRotate(Unit* victim) + { + switch (rand()%2) + { + case 0: RotType = CLOCKWISE; break; + case 1: RotType = COUNTERCLOCKWISE; break; + } + RotTimer=20000; + + if (victim) + SpoutAngle = m_creature->GetAngle(victim); + + m_creature->MonsterTextEmote(EMOTE_SPOUT,0,true); + //DoCast(m_creature,SPELL_SPOUT_BREATH);//take breath anim + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim() /*|| !m_creature->getVictim()*/)//rotate resets target + return; + + //Check if players in water and if in water cast spell + Map* pMap = m_creature->GetMap(); + if (pMap->IsDungeon() && pInstance->GetData(DATA_THELURKERBELOWEVENT) == IN_PROGRESS) + { + Map::PlayerList const &PlayerList = pMap->GetPlayers(); + + if (PlayerList.isEmpty()) + return; + + for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) + { + if (i->getSource()->isAlive() && i->getSource()->IsInWater() && !i->getSource()->HasAura(SPELL_SCALDINGWATER)) + i->getSource()->CastSpell(i->getSource(), SPELL_SCALDINGWATER, true); + else if (!i->getSource()->IsInWater()) + i->getSource()->RemoveAurasDueToSpell(SPELL_SCALDINGWATER); + } + } + + Rotate(diff);//always check rotate things + if (!Submerged) + { + if (PhaseTimer < diff) + { + m_creature->InterruptNonMeleeSpells(false); + DoCast(m_creature,SPELL_SUBMERGE); + PhaseTimer = 60000;//60secs submerged + Submerged = true; + }else PhaseTimer-=diff; + } + + if (!Submerged && RotType == NOROTATE)//is not spouting and not submerged + { + if (SpoutTimer < diff) + { + if (m_creature->getVictim() && RotType == NOROTATE) + StartRotate(m_creature->getVictim());//start spout and random rotate + + SpoutTimer= 35000; + return; + }else SpoutTimer -= diff; + + //Whirl directly after a Spout and at random times + if (WhirlTimer < diff) + { + WhirlTimer = rand()%5000 + 15000; + DoCast(m_creature,SPELL_WHIRL); + WaterboltTimer += 5000;//add 5secs to waterbolt timer, to add some time to run back to boss + }else WhirlTimer -= diff; + + if (GeyserTimer < diff) + { + Unit* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM,1); + + if (target) + DoCast(target,SPELL_GEYSER,true); + else + target = SelectUnit(SELECT_TARGET_RANDOM,0); + if (target) + DoCast(target,SPELL_GEYSER,true); + + GeyserTimer = rand()%5000 + 15000; + }else GeyserTimer -= diff; + + if (WaterboltTimer < diff) + { + Unit* target = SelectTarget(SELECT_TARGET_NEAREST,0,14,true); + if (!target) + { + target = SelectUnit(SELECT_TARGET_RANDOM,0); + if (target) + DoCast(target,SPELL_WATERBOLT); + } + WaterboltTimer = 3000; + }else WaterboltTimer -= diff; + + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + + }else if (!Submerged) + return; + else if (Submerged)//phase 2, submerged + { + if (PhaseTimer < diff) + { + Submerged = false; + m_creature->InterruptNonMeleeSpells(false);//shouldn't be any + m_creature->RemoveAllAuras(); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->RemoveFlag(UNIT_NPC_EMOTESTATE,EMOTE_STATE_SUBMERGED); + m_creature->RemoveFlag(UNIT_FIELD_BYTES_1,9); + DoCast(m_creature,SPELL_EMERGE); + Spawned = false; + SpoutTimer = 4000; // directly cast Spout after emerging! + WhirlTimer = 26000; + PhaseTimer = 120000; + return; + }else PhaseTimer-=diff; + + if (!m_creature->isInCombat()) + DoZoneInCombat(); + + if (!Spawned) + { + m_creature->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + //spawn adds + for (uint8 i = 0; i < 9; ++i) + { + Creature* Summoned; + if (i < 7) + Summoned = m_creature->SummonCreature(MOB_COILFANG_AMBUSHER,AddPos[i][0],AddPos[i][1],AddPos[i][2], 0, TEMPSUMMON_CORPSE_DESPAWN, 0); + else Summoned = m_creature->SummonCreature(MOB_COILFANG_GUARDIAN,AddPos[i][0],AddPos[i][1],AddPos[i][2], 0, TEMPSUMMON_CORPSE_DESPAWN, 0); + + if (Summoned) + Summons.Summon(Summoned); + Spawned = true; + } + } + } + } + }; + +CreatureAI* GetAI_mob_coilfang_guardian(Creature* pCreature) +{ + SimpleAI* ai = new SimpleAI (pCreature); + + ai->Spell[0].Enabled = true; + ai->Spell[0].Spell_Id = SPELL_ARCINGSMASH; + ai->Spell[0].Cooldown = 15000; + ai->Spell[0].First_Cast = 5000; + ai->Spell[0].Cast_Target_Type = CAST_HOSTILE_TARGET; + + ai->Spell[1].Enabled = true; + ai->Spell[1].Spell_Id = SPELL_HAMSTRING; + ai->Spell[1].Cooldown = 10000; + ai->Spell[1].First_Cast = 2000; + ai->Spell[1].Cast_Target_Type = CAST_HOSTILE_TARGET; + + return ai; +} + +struct TRINITY_DLL_DECL mob_coilfang_ambusherAI : public Scripted_NoMovementAI +{ + mob_coilfang_ambusherAI(Creature *c) : Scripted_NoMovementAI(c) + { + SpellEntry *TempSpell = GET_SPELL(SPELL_SHOOT); + if (TempSpell) + TempSpell->Effect[0] = 2;//change spell effect from weapon % dmg to simple phisical dmg + } + + uint32 MultiShotTimer; + uint32 ShootBowTimer; + + void Reset() + { + MultiShotTimer = 10000; + ShootBowTimer = 4000; + + } + + void EnterCombat(Unit *who) + { + + } + + void MoveInLineOfSight(Unit *who) + { + if (!who || m_creature->getVictim()) return; + + if (who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who)) + { + AttackStart(who); + } + } + + void UpdateAI(const uint32 diff) + { + if (MultiShotTimer < diff) + { + if (m_creature->getVictim()) + DoCast(m_creature->getVictim(), SPELL_SPREAD_SHOT, true); + + MultiShotTimer = 10000; + ShootBowTimer += 1500;//add global cooldown + }else MultiShotTimer -= diff; + + if (ShootBowTimer < diff) + { + Unit* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM, 0); + int bp0 = 1100; + if (target) + m_creature->CastCustomSpell(target,SPELL_SHOOT,&bp0,NULL,NULL,true); + ShootBowTimer = 4000; + MultiShotTimer += 1500;//add global cooldown + }else ShootBowTimer -= diff; + } +}; + +CreatureAI* GetAI_mob_coilfang_ambusher(Creature* pCreature) +{ + return new mob_coilfang_ambusherAI (pCreature); +} + +CreatureAI* GetAI_boss_the_lurker_below(Creature* pCreature) +{ + return new boss_the_lurker_belowAI (pCreature); +} + +void AddSC_boss_the_lurker_below() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_the_lurker_below"; + newscript->GetAI = &GetAI_boss_the_lurker_below; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_coilfang_guardian"; + newscript->GetAI = &GetAI_mob_coilfang_guardian; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_coilfang_ambusher"; + newscript->GetAI = &GetAI_mob_coilfang_ambusher; + newscript->RegisterSelf(); +} + + diff --git a/src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/boss_morogrim_tidewalker.cpp b/src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/boss_morogrim_tidewalker.cpp new file mode 100644 index 00000000000..80e05cc494b --- /dev/null +++ b/src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/boss_morogrim_tidewalker.cpp @@ -0,0 +1,372 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +/* ScriptData +SDName: Boss_Morogrim_Tidewalker +SD%Complete: 90 +SDComment: Water globules don't explode properly, remove hacks +SDCategory: Coilfang Resevoir, Serpent Shrine Cavern +EndScriptData */ + +#include "precompiled.h" +#include "def_serpent_shrine.h" + +#define SAY_AGGRO -1548030 +#define SAY_SUMMON1 -1548031 +#define SAY_SUMMON2 -1548032 +#define SAY_SUMMON_BUBL1 -1548033 +#define SAY_SUMMON_BUBL2 -1548034 +#define SAY_SLAY1 -1548035 +#define SAY_SLAY2 -1548036 +#define SAY_SLAY3 -1548037 +#define SAY_DEATH -1548038 +#define EMOTE_WATERY_GRAVE -1548039 +#define EMOTE_EARTHQUAKE -1548040 +#define EMOTE_WATERY_GLOBULES -1548041 + +#define SPELL_TIDAL_WAVE 37730 +#define SPELL_WATERY_GRAVE 38049 +#define SPELL_EARTHQUAKE 37764 +#define SPELL_WATERY_GRAVE_EXPLOSION 37852 + +#define WATERY_GRAVE_X1 334.64 +#define WATERY_GRAVE_Y1 -728.89 +#define WATERY_GRAVE_Z1 -14.42 +#define WATERY_GRAVE_X2 365.51 +#define WATERY_GRAVE_Y2 -737.14 +#define WATERY_GRAVE_Z2 -14.44 +#define WATERY_GRAVE_X3 366.19 +#define WATERY_GRAVE_Y3 -709.59 +#define WATERY_GRAVE_Z3 -14.36 +#define WATERY_GRAVE_X4 372.93 +#define WATERY_GRAVE_Y4 -690.96 +#define WATERY_GRAVE_Z4 -14.44 + +#define SPELL_WATERY_GRAVE_1 38023 +#define SPELL_WATERY_GRAVE_2 38024 +#define SPELL_WATERY_GRAVE_3 38025 +#define SPELL_WATERY_GRAVE_4 37850 + +#define SPELL_SUMMON_WATER_GLOBULE_1 37854 +#define SPELL_SUMMON_WATER_GLOBULE_2 37858 +#define SPELL_SUMMON_WATER_GLOBULE_3 37860 +#define SPELL_SUMMON_WATER_GLOBULE_4 37861 + +/*#define SPELL_SUMMON_MURLOC_A6 39813 +#define SPELL_SUMMON_MURLOC_A7 39814 +#define SPELL_SUMMON_MURLOC_A8 39815 +#define SPELL_SUMMON_MURLOC_A9 39816 +#define SPELL_SUMMON_MURLOC_A10 39817 + +#define SPELL_SUMMON_MURLOC_B6 39818 +#define SPELL_SUMMON_MURLOC_B7 39819 +#define SPELL_SUMMON_MURLOC_B8 39820 +#define SPELL_SUMMON_MURLOC_B9 39821 +#define SPELL_SUMMON_MURLOC_B10 39822*/ + +float MurlocCords[10][5] = +{ + {21920, 424.36, -715.4, -7.14, 0.124}, + {21920, 425.13, -719.3, -7.14, 0.124}, + {21920, 425.05, -724.23, -7.14, 0.124}, + {21920, 424.91, -728.68, -7.14, 0.124}, + {21920, 424.84, -732.18, -7.14, 0.124}, + {21920, 321.05, -734.2, -13.15, 0.124}, + {21920, 321.05, -729.4, -13.15, 0.124}, + {21920, 321.05, -724.03, -13.15, 0.124}, + {21920, 321.05, -718.73, -13.15, 0.124}, + {21920, 321.05, -714.24, -13.15, 0.124} +}; + +//Creatures +#define WATER_GLOBULE 21913 +#define TIDEWALKER_LURKER 21920 + +//Morogrim Tidewalker AI +struct TRINITY_DLL_DECL boss_morogrim_tidewalkerAI : public ScriptedAI +{ + boss_morogrim_tidewalkerAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + Map::PlayerList const *PlayerList; + + uint32 TidalWave_Timer; + uint32 WateryGrave_Timer; + uint32 Earthquake_Timer; + uint32 WateryGlobules_Timer; + uint32 globulespell[4]; + int8 Playercount; + int8 counter; + + bool Earthquake; + bool Phase2; + + void Reset() + { + TidalWave_Timer = 10000; + WateryGrave_Timer = 30000; + Earthquake_Timer = 40000; + WateryGlobules_Timer = 0; + globulespell[0] = SPELL_SUMMON_WATER_GLOBULE_1; + globulespell[1] = SPELL_SUMMON_WATER_GLOBULE_2; + globulespell[2] = SPELL_SUMMON_WATER_GLOBULE_3; + globulespell[3] = SPELL_SUMMON_WATER_GLOBULE_4; + + Earthquake = false; + Phase2 = false; + + if (pInstance) + pInstance->SetData(DATA_MOROGRIMTIDEWALKEREVENT, NOT_STARTED); + } + + void StartEvent() + { + DoScriptText(SAY_AGGRO, m_creature); + + if (pInstance) + pInstance->SetData(DATA_MOROGRIMTIDEWALKEREVENT, IN_PROGRESS); + } + + void KilledUnit(Unit *victim) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + case 2: DoScriptText(SAY_SLAY3, m_creature); break; + } + } + + void JustDied(Unit *victim) + { + DoScriptText(SAY_DEATH, m_creature); + + if (pInstance) + pInstance->SetData(DATA_MOROGRIMTIDEWALKEREVENT, DONE); + } + + void EnterCombat(Unit *who) + { + PlayerList = &m_creature->GetMap()->GetPlayers(); + Playercount = PlayerList->getSize(); + StartEvent(); + } + + void ApplyWateryGrave(Unit* pPlayer, uint8 i) + { + switch(i) + { + case 0: pPlayer->CastSpell(pPlayer, SPELL_WATERY_GRAVE_1, true); break; + case 1: pPlayer->CastSpell(pPlayer, SPELL_WATERY_GRAVE_2, true); break; + case 2: pPlayer->CastSpell(pPlayer, SPELL_WATERY_GRAVE_3, true); break; + case 3: pPlayer->CastSpell(pPlayer, SPELL_WATERY_GRAVE_4, true); break; + } + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + //Earthquake_Timer + if (Earthquake_Timer < diff) + { + if (!Earthquake) + { + DoCast(m_creature->getVictim(), SPELL_EARTHQUAKE); + Earthquake = true; + Earthquake_Timer = 10000; + } + else + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_SUMMON1, m_creature); break; + case 1: DoScriptText(SAY_SUMMON2, m_creature); break; + } + + for(uint8 i = 0; i < 10; ++i) + { + Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0); + Creature* Murloc = m_creature->SummonCreature(MurlocCords[i][0],MurlocCords[i][1],MurlocCords[i][2],MurlocCords[i][3],MurlocCords[i][4], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000); + if (target && Murloc) + Murloc->AI()->AttackStart(target); + } + DoScriptText(EMOTE_EARTHQUAKE, m_creature); + Earthquake = false; + Earthquake_Timer = 40000+rand()%5000; + } + }else Earthquake_Timer -= diff; + + //TidalWave_Timer + if (TidalWave_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_TIDAL_WAVE); + TidalWave_Timer = 20000; + }else TidalWave_Timer -= diff; + + if (!Phase2) + { + //WateryGrave_Timer + if (WateryGrave_Timer < diff) + { + //Teleport 4 players under the waterfalls + Unit *target; + using std::set; + setlist; + set::iterator itr; + for(uint8 i = 0; i < 4; ++i) + { + counter = 0; + do{target = SelectTarget(SELECT_TARGET_RANDOM, 1, 50, true); //target players only + if (counter < Playercount) + break; + if (target) itr = list.find(target->GetGUID()); + counter++; + }while(itr != list.end()); + if (target){list.insert(target->GetGUID()); + ApplyWateryGrave(target, i); + } + } + + switch(rand()%2) + { + case 0: DoScriptText(SAY_SUMMON_BUBL1, m_creature); break; + case 1: DoScriptText(SAY_SUMMON_BUBL2, m_creature); break; + } + + DoScriptText(EMOTE_WATERY_GRAVE, m_creature); + WateryGrave_Timer = 30000; + }else WateryGrave_Timer -= diff; + + //Start Phase2 + if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 25) + Phase2 = true; + } + else + { + //WateryGlobules_Timer + if (WateryGlobules_Timer < diff) + { + Unit* globuletarget; + using std::set; + setglobulelist; + set::iterator itr; + for (int8 g = 0; g < 4; g++) //one unit cant cast more than one spell per update, so some players have to cast for us XD + { + counter = 0; + do {globuletarget = SelectTarget(SELECT_TARGET_RANDOM, 0,50,true); + if (globuletarget) itr = globulelist.find(globuletarget->GetGUID()); + if (counter > Playercount) + break; + counter++; + } while (itr != globulelist.end()); + if (globuletarget)globulelist.insert(globuletarget->GetGUID()); + globuletarget->CastSpell(globuletarget, globulespell[g], true); + } + DoScriptText(EMOTE_WATERY_GLOBULES, m_creature); + WateryGlobules_Timer = 25000; + }else WateryGlobules_Timer -= diff; + } + + DoMeleeAttackIfReady(); + } +}; + +//Water Globule AI +#define SPELL_GLOBULE_EXPLOSION 37871 + +struct TRINITY_DLL_DECL mob_water_globuleAI : public ScriptedAI +{ + mob_water_globuleAI(Creature *c) : ScriptedAI(c) {} + + uint32 Check_Timer; + + void Reset() + { + Check_Timer = 1000; + + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->setFaction(14); + } + + void EnterCombat(Unit *who) {} + + void MoveInLineOfSight(Unit *who) + { + if (!who || m_creature->getVictim()) + return; + + if (who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who)) + { + //no attack radius check - it attacks the first target that moves in his los + //who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); + AttackStart(who); + } + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + if (Check_Timer < diff) + { + if (m_creature->IsWithinDistInMap(m_creature->getVictim(), 5)) + { + DoCast(m_creature->getVictim(), SPELL_GLOBULE_EXPLOSION); + + //despawn + m_creature->ForcedDespawn(); + return; + } + Check_Timer = 500; + }else Check_Timer -= diff; + + //do NOT deal any melee damage to the target. + } +}; + +CreatureAI* GetAI_boss_morogrim_tidewalker(Creature* pCreature) +{ + return new boss_morogrim_tidewalkerAI (pCreature); +} +CreatureAI* GetAI_mob_water_globule(Creature* pCreature) +{ + return new mob_water_globuleAI (pCreature); +} + +void AddSC_boss_morogrim_tidewalker() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_morogrim_tidewalker"; + newscript->GetAI = &GetAI_boss_morogrim_tidewalker; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_water_globule"; + newscript->GetAI = &GetAI_mob_water_globule; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/def_serpent_shrine.h b/src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/def_serpent_shrine.h new file mode 100644 index 00000000000..13144bc93c0 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/def_serpent_shrine.h @@ -0,0 +1,32 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_SERPENT_SHRINE_H +#define DEF_SERPENT_SHRINE_H + +#define DATA_CANSTARTPHASE3 1 +#define DATA_CARIBDIS 2 +#define DATA_HYDROSSTHEUNSTABLEEVENT 3 +#define DATA_KARATHRESS 4 +#define DATA_KARATHRESSEVENT 5 +#define DATA_KARATHRESSEVENT_STARTER 6 +#define DATA_LADYVASHJ 7 +#define DATA_LADYVASHJEVENT 8 +#define DATA_LEOTHERASTHEBLINDEVENT 9 +#define DATA_MOROGRIMTIDEWALKEREVENT 10 +#define DATA_SHARKKIS 11 +#define DATA_SHIELDGENERATOR1 12 +#define DATA_SHIELDGENERATOR2 13 +#define DATA_SHIELDGENERATOR3 14 +#define DATA_SHIELDGENERATOR4 15 +#define DATA_THELURKERBELOW 16 +#define DATA_THELURKERBELOWEVENT 17 +#define DATA_TIDALVESS 18 +#define DATA_FATHOMLORDKARATHRESSEVENT 19 +#define DATA_LEOTHERAS 20 +#define DATA_LEOTHERAS_EVENT_STARTER 21 +#define DATA_CONTROL_CONSOLE 22 +#define DATA_STRANGE_POOL 23 +#endif + diff --git a/src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/instance_serpent_shrine.cpp b/src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/instance_serpent_shrine.cpp new file mode 100644 index 00000000000..ebeda6aa565 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/instance_serpent_shrine.cpp @@ -0,0 +1,285 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Serpent_Shrine +SD%Complete: 100 +SDComment: Instance Data Scripts and functions to acquire mobs and set encounter status for use in various Serpent Shrine Scripts +SDCategory: Coilfang Resevoir, Serpent Shrine Cavern +EndScriptData */ + +#include "precompiled.h" +#include "def_serpent_shrine.h" + +#define MAX_ENCOUNTER 6 + +/* Serpentshrine cavern encounters: +0 - Hydross The Unstable event +1 - Leotheras The Blind Event +2 - The Lurker Below Event +3 - Fathom-Lord Karathress Event +4 - Morogrim Tidewalker Event +5 - Lady Vashj Event +*/ + +bool GOHello_go_bridge_console(Player* pPlayer, GameObject* pGo) +{ + ScriptedInstance* pInstance = pGo->GetInstanceData(); + + if (!pInstance) + return false; + + if (pInstance) + pInstance->SetData(DATA_CONTROL_CONSOLE, DONE); + + return true; +} + +struct TRINITY_DLL_DECL instance_serpentshrine_cavern : public ScriptedInstance +{ + instance_serpentshrine_cavern(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint64 LurkerBelow; + uint64 Sharkkis; + uint64 Tidalvess; + uint64 Caribdis; + uint64 LadyVashj; + uint64 Karathress; + uint64 KarathressEvent_Starter; + uint64 LeotherasTheBlind; + uint64 LeotherasEventStarter; + + uint64 ControlConsole; + uint64 BridgePart[3]; + uint64 StrangePool; + + bool ShieldGeneratorDeactivated[4]; + uint32 m_auiEncounter[MAX_ENCOUNTER]; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + LurkerBelow = 0; + Sharkkis = 0; + Tidalvess = 0; + Caribdis = 0; + LadyVashj = 0; + Karathress = 0; + KarathressEvent_Starter = 0; + LeotherasTheBlind = 0; + LeotherasEventStarter = 0; + + ControlConsole = 0; + BridgePart[0] = 0; + BridgePart[1] = 0; + BridgePart[2] = 0; + StrangePool = 0; + + ShieldGeneratorDeactivated[0] = false; + ShieldGeneratorDeactivated[1] = false; + ShieldGeneratorDeactivated[2] = false; + ShieldGeneratorDeactivated[3] = false; + } + + bool IsEncounterInProgress() const + { + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) return true; + + return false; + } + + void OnGameObjectCreate(GameObject* pGo, bool add) + { + switch(pGo->GetEntry()) + { + case 184568: + ControlConsole = pGo->GetGUID(); + pGo->setActive(true); + break; + + case 184203: + BridgePart[0] = pGo->GetGUID(); + pGo->setActive(true); + break; + + case 184204: + BridgePart[1] = pGo->GetGUID(); + pGo->setActive(true); + break; + + case 184205: + BridgePart[2] = pGo->GetGUID(); + pGo->setActive(true); + break; + case 184956: + StrangePool = pGo->GetGUID(); + if (pGo->isActiveObject()) + SetData(DATA_STRANGE_POOL, DONE); + } + } + + void OnCreatureCreate(Creature* pCreature, bool add) + { + switch(pCreature->GetEntry()) + { + case 21212: LadyVashj = pCreature->GetGUID(); break; + case 21214: Karathress = pCreature->GetGUID(); break; + case 21966: Sharkkis = pCreature->GetGUID(); break; + case 21217: LurkerBelow = pCreature->GetGUID(); break; + case 21965: Tidalvess = pCreature->GetGUID(); break; + case 21964: Caribdis = pCreature->GetGUID(); break; + case 21215: LeotherasTheBlind = pCreature->GetGUID(); break;} + } + + void SetData64(uint32 type, uint64 data) + { + if (type == DATA_KARATHRESSEVENT_STARTER) + KarathressEvent_Starter = data; + if (type == DATA_LEOTHERAS_EVENT_STARTER) + LeotherasEventStarter = data; + } + + uint64 GetData64(uint32 identifier) + { + switch(identifier) + { + case DATA_THELURKERBELOW: return LurkerBelow; + case DATA_SHARKKIS: return Sharkkis; + case DATA_TIDALVESS: return Tidalvess; + case DATA_CARIBDIS: return Caribdis; + case DATA_LADYVASHJ: return LadyVashj; + case DATA_KARATHRESS: return Karathress; + case DATA_KARATHRESSEVENT_STARTER: return KarathressEvent_Starter; + case DATA_LEOTHERAS: return LeotherasTheBlind; + case DATA_LEOTHERAS_EVENT_STARTER: return LeotherasEventStarter; + } + return 0; + } + + void SetData(uint32 type, uint32 data) + { + switch(type) + { + case DATA_STRANGE_POOL: StrangePool = data; + case DATA_CONTROL_CONSOLE: + if (data == DONE) + { + HandleGameObject(BridgePart[0], true); + HandleGameObject(BridgePart[0], true); + HandleGameObject(BridgePart[0], true); + } + ControlConsole = data; + case DATA_HYDROSSTHEUNSTABLEEVENT: m_auiEncounter[0] = data; break; + case DATA_LEOTHERASTHEBLINDEVENT: m_auiEncounter[1] = data; break; + case DATA_THELURKERBELOWEVENT: m_auiEncounter[2] = data; break; + case DATA_KARATHRESSEVENT: m_auiEncounter[3] = data; break; + case DATA_MOROGRIMTIDEWALKEREVENT: m_auiEncounter[4] = data; break; + //Lady Vashj + case DATA_LADYVASHJEVENT: + if (data == NOT_STARTED) + { + ShieldGeneratorDeactivated[0] = false; + ShieldGeneratorDeactivated[1] = false; + ShieldGeneratorDeactivated[2] = false; + ShieldGeneratorDeactivated[3] = false; + } + m_auiEncounter[5] = data; break; + case DATA_SHIELDGENERATOR1:ShieldGeneratorDeactivated[0] = (data) ? true : false; break; + case DATA_SHIELDGENERATOR2:ShieldGeneratorDeactivated[1] = (data) ? true : false; break; + case DATA_SHIELDGENERATOR3:ShieldGeneratorDeactivated[2] = (data) ? true : false; break; + case DATA_SHIELDGENERATOR4:ShieldGeneratorDeactivated[3] = (data) ? true : false; break; + } + + if (data == DONE) + SaveToDB(); + } + + uint32 GetData(uint32 type) + { + switch(type) + { + case DATA_HYDROSSTHEUNSTABLEEVENT: return m_auiEncounter[0]; + case DATA_LEOTHERASTHEBLINDEVENT: return m_auiEncounter[1]; + case DATA_THELURKERBELOWEVENT: return m_auiEncounter[2]; + case DATA_KARATHRESSEVENT: return m_auiEncounter[3]; + case DATA_MOROGRIMTIDEWALKEREVENT: return m_auiEncounter[4]; + //Lady Vashj + case DATA_LADYVASHJEVENT: return m_auiEncounter[5]; + case DATA_SHIELDGENERATOR1: return ShieldGeneratorDeactivated[0]; + case DATA_SHIELDGENERATOR2: return ShieldGeneratorDeactivated[1]; + case DATA_SHIELDGENERATOR3: return ShieldGeneratorDeactivated[2]; + case DATA_SHIELDGENERATOR4: return ShieldGeneratorDeactivated[3]; + case DATA_CANSTARTPHASE3: + if (ShieldGeneratorDeactivated[0] && ShieldGeneratorDeactivated[1] && ShieldGeneratorDeactivated[2] && ShieldGeneratorDeactivated[3])return 1;break; + } + return 0; + } + std::string GetSaveData() + { + OUT_SAVE_INST_DATA; + std::ostringstream stream; + stream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " " + << m_auiEncounter[3] << " " << m_auiEncounter[4] << " " << m_auiEncounter[5]; + char* out = new char[stream.str().length() + 1]; + strcpy(out, stream.str().c_str()); + if (out) + { + OUT_SAVE_INST_DATA_COMPLETE; + return out; + } + return NULL; + } + + void Load(const char* in) + { + if (!in) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + OUT_LOAD_INST_DATA(in); + std::istringstream stream(in); + stream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3] + >> m_auiEncounter[4] >> m_auiEncounter[5]; + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) // Do not load an encounter as "In Progress" - reset it instead. + m_auiEncounter[i] = NOT_STARTED; + OUT_LOAD_INST_DATA_COMPLETE; + } +}; + +InstanceData* GetInstanceData_instance_serpentshrine_cavern(Map* pMap) +{ + return new instance_serpentshrine_cavern(pMap); +} + +void AddSC_instance_serpentshrine_cavern() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "instance_serpent_shrine"; + newscript->GetInstanceData = &GetInstanceData_instance_serpentshrine_cavern; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="go_bridge_console"; + newscript->pGOHello = &GOHello_go_bridge_console; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/coilfang_resevoir/steam_vault/boss_hydromancer_thespia.cpp b/src/bindings/scripts/scripts/outland/coilfang_resevoir/steam_vault/boss_hydromancer_thespia.cpp new file mode 100644 index 00000000000..3bec4de6876 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/coilfang_resevoir/steam_vault/boss_hydromancer_thespia.cpp @@ -0,0 +1,197 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Hydromancer_Thespia +SD%Complete: 80 +SDComment: Needs additional adjustments (when instance script is adjusted) +SDCategory: Coilfang Resevoir, The Steamvault +EndScriptData */ + +/* ContentData +boss_hydromancer_thespia +mob_coilfang_waterelemental +EndContentData */ + +#include "precompiled.h" +#include "def_steam_vault.h" + +#define SAY_SUMMON -1545000 +#define SAY_AGGRO_1 -1545001 +#define SAY_AGGRO_2 -1545002 +#define SAY_AGGRO_3 -1545003 +#define SAY_SLAY_1 -1545004 +#define SAY_SLAY_2 -1545005 +#define SAY_DEAD -1545006 + +#define SPELL_LIGHTNING_CLOUD 25033 +#define SPELL_LUNG_BURST 31481 +#define SPELL_ENVELOPING_WINDS 31718 + +struct TRINITY_DLL_DECL boss_thespiaAI : public ScriptedAI +{ + boss_thespiaAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + ScriptedInstance *pInstance; + bool HeroicMode; + + uint32 LightningCloud_Timer; + uint32 LungBurst_Timer; + uint32 EnvelopingWinds_Timer; + + void Reset() + { + LightningCloud_Timer = 15000; + LungBurst_Timer = 7000; + EnvelopingWinds_Timer = 9000; + + if (pInstance && m_creature->isAlive()) + pInstance->SetData(TYPE_HYDROMANCER_THESPIA, NOT_STARTED); + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEAD, m_creature); + + if (pInstance) + pInstance->SetData(TYPE_HYDROMANCER_THESPIA, DONE); + } + + void KilledUnit(Unit* victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature); break; + case 1: DoScriptText(SAY_SLAY_2, m_creature); break; + } + } + + void EnterCombat(Unit *who) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; + } + + if (pInstance) + pInstance->SetData(TYPE_HYDROMANCER_THESPIA, IN_PROGRESS); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + //LightningCloud_Timer + if (LightningCloud_Timer < diff) + { + //cast twice in Heroic mode + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target, SPELL_LIGHTNING_CLOUD); + if (HeroicMode) + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target, SPELL_LIGHTNING_CLOUD); + LightningCloud_Timer = 15000+rand()%10000; + }else LightningCloud_Timer -=diff; + + //LungBurst_Timer + if (LungBurst_Timer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target, SPELL_LUNG_BURST); + LungBurst_Timer = 7000+rand()%5000; + }else LungBurst_Timer -=diff; + + //EnvelopingWinds_Timer + if (EnvelopingWinds_Timer < diff) + { + //cast twice in Heroic mode + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target, SPELL_ENVELOPING_WINDS); + if (HeroicMode) + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target, SPELL_ENVELOPING_WINDS); + EnvelopingWinds_Timer = 10000+rand()%5000; + }else EnvelopingWinds_Timer -=diff; + + DoMeleeAttackIfReady(); + } +}; + +#define SPELL_WATER_BOLT_VOLLEY 34449 +#define H_SPELL_WATER_BOLT_VOLLEY 37924 + +struct TRINITY_DLL_DECL mob_coilfang_waterelementalAI : public ScriptedAI +{ + mob_coilfang_waterelementalAI(Creature *c) : ScriptedAI(c) {} + + bool HeroicMode; + uint32 WaterBoltVolley_Timer; + + void Reset() + { + HeroicMode = m_creature->GetMap()->IsHeroic(); + WaterBoltVolley_Timer = 3000+rand()%3000; + } + + void EnterCombat(Unit *who) { } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (WaterBoltVolley_Timer < diff) + { + DoCast(m_creature, HeroicMode ? H_SPELL_WATER_BOLT_VOLLEY : SPELL_WATER_BOLT_VOLLEY); + WaterBoltVolley_Timer = 7000+rand()%5000; + }else WaterBoltVolley_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_thespiaAI(Creature* pCreature) +{ + return new boss_thespiaAI (pCreature); +} + +CreatureAI* GetAI_mob_coilfang_waterelementalAI(Creature* pCreature) +{ + return new mob_coilfang_waterelementalAI (pCreature); +} + +void AddSC_boss_hydromancer_thespia() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_hydromancer_thespia"; + newscript->GetAI = &GetAI_boss_thespiaAI; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_coilfang_waterelemental"; + newscript->GetAI = &GetAI_mob_coilfang_waterelementalAI; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/coilfang_resevoir/steam_vault/boss_mekgineer_steamrigger.cpp b/src/bindings/scripts/scripts/outland/coilfang_resevoir/steam_vault/boss_mekgineer_steamrigger.cpp new file mode 100644 index 00000000000..d8cc2e0ef47 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/coilfang_resevoir/steam_vault/boss_mekgineer_steamrigger.cpp @@ -0,0 +1,279 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Mekgineer_Steamrigger +SD%Complete: 60 +SDComment: Mechanics' interrrupt heal doesn't work very well, also a proper movement needs to be implemented -> summon further away and move towards target to repair. +SDCategory: Coilfang Resevoir, The Steamvault +EndScriptData */ + +/* ContentData +boss_mekgineer_steamrigger +mob_steamrigger_mechanic +EndContentData */ + +#include "precompiled.h" +#include "def_steam_vault.h" + +#define SAY_MECHANICS -1545007 +#define SAY_AGGRO_1 -1545008 +#define SAY_AGGRO_2 -1545009 +#define SAY_AGGRO_3 -1545010 +#define SAY_AGGRO_4 -1545011 +#define SAY_SLAY_1 -1545012 +#define SAY_SLAY_2 -1545013 +#define SAY_SLAY_3 -1545014 +#define SAY_DEATH -1545015 + +#define SPELL_SUPER_SHRINK_RAY 31485 +#define SPELL_SAW_BLADE 31486 +#define SPELL_ELECTRIFIED_NET 35107 +#define H_SPELL_ENRAGE 1 //corrent enrage spell not known + +#define ENTRY_STREAMRIGGER_MECHANIC 17951 + +struct TRINITY_DLL_DECL boss_mekgineer_steamriggerAI : public ScriptedAI +{ + boss_mekgineer_steamriggerAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + ScriptedInstance *pInstance; + bool HeroicMode; + + uint32 Shrink_Timer; + uint32 Saw_Blade_Timer; + uint32 Electrified_Net_Timer; + bool Summon75; + bool Summon50; + bool Summon25; + + void Reset() + { + Shrink_Timer = 20000; + Saw_Blade_Timer = 15000; + Electrified_Net_Timer = 10000; + + Summon75 = false; + Summon50 = false; + Summon25 = false; + + if (pInstance && m_creature->isAlive()) + pInstance->SetData(TYPE_MEKGINEER_STEAMRIGGER, NOT_STARTED); + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEATH, m_creature); + + if (pInstance) + pInstance->SetData(TYPE_MEKGINEER_STEAMRIGGER, DONE); + } + + void KilledUnit(Unit* victim) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature); break; + case 1: DoScriptText(SAY_SLAY_2, m_creature); break; + case 2: DoScriptText(SAY_SLAY_3, m_creature); break; + } + } + + void EnterCombat(Unit *who) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; + } + + if (pInstance) + pInstance->SetData(TYPE_MEKGINEER_STEAMRIGGER, IN_PROGRESS); + } + + //no known summon spells exist + void SummonMechanichs() + { + DoScriptText(SAY_MECHANICS, m_creature); + + DoSpawnCreature(ENTRY_STREAMRIGGER_MECHANIC,5,5,0,0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 240000); + DoSpawnCreature(ENTRY_STREAMRIGGER_MECHANIC,-5,5,0,0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 240000); + DoSpawnCreature(ENTRY_STREAMRIGGER_MECHANIC,-5,-5,0,0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 240000); + + if (rand()%2) + DoSpawnCreature(ENTRY_STREAMRIGGER_MECHANIC,5,-7,0,0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 240000); + if (rand()%2) + DoSpawnCreature(ENTRY_STREAMRIGGER_MECHANIC,7,-5,0,0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 240000); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (Shrink_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_SUPER_SHRINK_RAY); + Shrink_Timer = 20000; + }else Shrink_Timer -= diff; + + if (Saw_Blade_Timer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,1)) + DoCast(target,SPELL_SAW_BLADE); + else + DoCast(m_creature->getVictim(),SPELL_SAW_BLADE); + + Saw_Blade_Timer = 15000; + } else Saw_Blade_Timer -= diff; + + if (Electrified_Net_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_ELECTRIFIED_NET); + Electrified_Net_Timer = 10000; + } + else Electrified_Net_Timer -= diff; + + if (!Summon75) + { + if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 75) + { + SummonMechanichs(); + Summon75 = true; + } + } + + if (!Summon50) + { + if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 50) + { + SummonMechanichs(); + Summon50 = true; + } + } + + if (!Summon25) + { + if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 25) + { + SummonMechanichs(); + Summon25 = true; + } + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_mekgineer_steamrigger(Creature* pCreature) +{ + return new boss_mekgineer_steamriggerAI (pCreature); +} + +#define SPELL_DISPEL_MAGIC 17201 +#define SPELL_REPAIR 31532 +#define H_SPELL_REPAIR 37936 + +#define MAX_REPAIR_RANGE (13.0f) //we should be at least at this range for repair +#define MIN_REPAIR_RANGE (7.0f) //we can stop movement at this range to repair but not required + +struct TRINITY_DLL_DECL mob_steamrigger_mechanicAI : public ScriptedAI +{ + mob_steamrigger_mechanicAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + ScriptedInstance* pInstance; + bool HeroicMode; + + uint32 Repair_Timer; + + void Reset() + { + Repair_Timer = 2000; + } + + void MoveInLineOfSight(Unit* who) + { + //react only if attacked + return; + } + + void EnterCombat(Unit *who) { } + + void UpdateAI(const uint32 diff) + { + if (Repair_Timer < diff) + { + if (pInstance && pInstance->GetData64(DATA_MEKGINEERSTEAMRIGGER) && pInstance->GetData(TYPE_MEKGINEER_STEAMRIGGER) == IN_PROGRESS) + { + if (Unit* pMekgineer = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_MEKGINEERSTEAMRIGGER))) + { + if (m_creature->IsWithinDistInMap(pMekgineer, MAX_REPAIR_RANGE)) + { + //are we already channeling? Doesn't work very well, find better check? + if (!m_creature->GetUInt32Value(UNIT_CHANNEL_SPELL)) + { + //m_creature->GetMotionMaster()->MovementExpired(); + //m_creature->GetMotionMaster()->MoveIdle(); + + DoCast(m_creature,HeroicMode ? H_SPELL_REPAIR : SPELL_REPAIR, true); + } + Repair_Timer = 5000; + } + else + { + //m_creature->GetMotionMaster()->MovementExpired(); + //m_creature->GetMotionMaster()->MoveFollow(pMekgineer,0,0); + } + } + }else Repair_Timer = 5000; + }else Repair_Timer -= diff; + + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_steamrigger_mechanic(Creature* pCreature) +{ + return new mob_steamrigger_mechanicAI (pCreature); +} + +void AddSC_boss_mekgineer_steamrigger() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_mekgineer_steamrigger"; + newscript->GetAI = &GetAI_boss_mekgineer_steamrigger; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_steamrigger_mechanic"; + newscript->GetAI = &GetAI_mob_steamrigger_mechanic; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/coilfang_resevoir/steam_vault/boss_warlord_kalithresh.cpp b/src/bindings/scripts/scripts/outland/coilfang_resevoir/steam_vault/boss_warlord_kalithresh.cpp new file mode 100644 index 00000000000..0f4f2689398 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/coilfang_resevoir/steam_vault/boss_warlord_kalithresh.cpp @@ -0,0 +1,213 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Warlord_Kalithres +SD%Complete: 65 +SDComment: Contains workarounds regarding warlord's rage spells not acting as expected. Both scripts here require review and fine tuning. +SDCategory: Coilfang Resevoir, The Steamvault +EndScriptData */ + +#include "precompiled.h" +#include "def_steam_vault.h" + +#define SAY_INTRO -1545016 +#define SAY_REGEN -1545017 +#define SAY_AGGRO1 -1545018 +#define SAY_AGGRO2 -1545019 +#define SAY_AGGRO3 -1545020 +#define SAY_SLAY1 -1545021 +#define SAY_SLAY2 -1545022 +#define SAY_DEATH -1545023 + +#define SPELL_SPELL_REFLECTION 31534 +#define SPELL_IMPALE 39061 +#define SPELL_WARLORDS_RAGE 37081 +#define SPELL_WARLORDS_RAGE_NAGA 31543 + +#define SPELL_WARLORDS_RAGE_PROC 36453 + +struct TRINITY_DLL_DECL mob_naga_distillerAI : public ScriptedAI +{ + mob_naga_distillerAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance *pInstance; + + void Reset() + { + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + //hack, due to really weird spell behaviour :( + if (pInstance) + { + if (pInstance->GetData(TYPE_DISTILLER) == IN_PROGRESS) + { + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + } + } + } + + void EnterCombat(Unit *who) { } + + void StartRageGen(Unit *caster) + { + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + DoCast(m_creature,SPELL_WARLORDS_RAGE_NAGA,true); + + if (pInstance) + pInstance->SetData(TYPE_DISTILLER,IN_PROGRESS); + } + + void DamageTaken(Unit *done_by, uint32 &damage) + { + if (m_creature->GetHealth() <= damage) + if (pInstance) + pInstance->SetData(TYPE_DISTILLER,DONE); + } +}; + +struct TRINITY_DLL_DECL boss_warlord_kalithreshAI : public ScriptedAI +{ + boss_warlord_kalithreshAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance *pInstance; + + uint32 Reflection_Timer; + uint32 Impale_Timer; + uint32 Rage_Timer; + bool CanRage; + + void Reset() + { + Reflection_Timer = 10000; + Impale_Timer = 7000+rand()%7000; + Rage_Timer = 45000; + CanRage = false; + + if (pInstance) + pInstance->SetData(TYPE_WARLORD_KALITHRESH, NOT_STARTED); + } + + void EnterCombat(Unit *who) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_AGGRO1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO3, m_creature); break; + } + + if (pInstance) + pInstance->SetData(TYPE_WARLORD_KALITHRESH, IN_PROGRESS); + } + + void KilledUnit(Unit* victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + } + } + + void SpellHit(Unit *caster, const SpellEntry *spell) + { + //hack :( + if (spell->Id == SPELL_WARLORDS_RAGE_PROC) + if (pInstance) + if (pInstance->GetData(TYPE_DISTILLER) == DONE) + m_creature->RemoveAurasDueToSpell(SPELL_WARLORDS_RAGE_PROC); + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEATH, m_creature); + + if (pInstance) + pInstance->SetData(TYPE_WARLORD_KALITHRESH, DONE); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (Rage_Timer < diff) + { + if (Creature* distiller = me->FindNearestCreature(17954, 100.0f)) + { + DoScriptText(SAY_REGEN, m_creature); + DoCast(m_creature,SPELL_WARLORDS_RAGE); + CAST_AI(mob_naga_distillerAI, distiller->AI())->StartRageGen(m_creature); + } + Rage_Timer = 3000+rand()%15000; + }else Rage_Timer -= diff; + + //Reflection_Timer + if (Reflection_Timer < diff) + { + DoCast(m_creature, SPELL_SPELL_REFLECTION); + Reflection_Timer = 15000+rand()%10000; + }else Reflection_Timer -= diff; + + //Impale_Timer + if (Impale_Timer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_IMPALE); + + Impale_Timer = 7500+rand()%5000; + }else Impale_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_naga_distiller(Creature* pCreature) +{ + return new mob_naga_distillerAI (pCreature); +} + +CreatureAI* GetAI_boss_warlord_kalithresh(Creature* pCreature) +{ + return new boss_warlord_kalithreshAI (pCreature); +} + +void AddSC_boss_warlord_kalithresh() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="mob_naga_distiller"; + newscript->GetAI = &GetAI_mob_naga_distiller; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="boss_warlord_kalithresh"; + newscript->GetAI = &GetAI_boss_warlord_kalithresh; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/coilfang_resevoir/steam_vault/def_steam_vault.h b/src/bindings/scripts/scripts/outland/coilfang_resevoir/steam_vault/def_steam_vault.h new file mode 100644 index 00000000000..4b407ac4816 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/coilfang_resevoir/steam_vault/def_steam_vault.h @@ -0,0 +1,17 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_STEAM_VAULT_H +#define DEF_STEAM_VAULT_H + +#define TYPE_HYDROMANCER_THESPIA 1 +#define TYPE_MEKGINEER_STEAMRIGGER 2 +#define TYPE_WARLORD_KALITHRESH 3 +#define TYPE_DISTILLER 4 + +#define DATA_MEKGINEERSTEAMRIGGER 5 +#define DATA_KALITRESH 6 +#define DATA_THESPIA 7 +#endif + diff --git a/src/bindings/scripts/scripts/outland/coilfang_resevoir/steam_vault/instance_steam_vault.cpp b/src/bindings/scripts/scripts/outland/coilfang_resevoir/steam_vault/instance_steam_vault.cpp new file mode 100644 index 00000000000..29616a123ad --- /dev/null +++ b/src/bindings/scripts/scripts/outland/coilfang_resevoir/steam_vault/instance_steam_vault.cpp @@ -0,0 +1,231 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Steam_Vault +SD%Complete: 80 +SDComment: Instance script and access panel GO +SDCategory: Coilfang Resevoir, The Steamvault +EndScriptData */ + +#include "precompiled.h" +#include "def_steam_vault.h" + +#define MAX_ENCOUNTER 4 + +#define MAIN_CHAMBERS_DOOR 183049 +#define ACCESS_PANEL_HYDRO 184125 +#define ACCESS_PANEL_MEK 184126 + +/* Steam Vaults encounters: +1 - Hydromancer Thespia Event +2 - Mekgineer Steamrigger Event +3 - Warlord Kalithresh Event +*/ + +bool GOHello_go_main_chambers_access_panel(Player* pPlayer, GameObject* pGo) +{ + ScriptedInstance* pInstance = pGo->GetInstanceData(); + + if (!pInstance) + return false; + + if (pGo->GetEntry() == ACCESS_PANEL_HYDRO && (pInstance->GetData(TYPE_HYDROMANCER_THESPIA) == DONE || pInstance->GetData(TYPE_HYDROMANCER_THESPIA) == SPECIAL)) + pInstance->SetData(TYPE_HYDROMANCER_THESPIA,SPECIAL); + + if (pGo->GetEntry() == ACCESS_PANEL_MEK && (pInstance->GetData(TYPE_MEKGINEER_STEAMRIGGER) == DONE || pInstance->GetData(TYPE_MEKGINEER_STEAMRIGGER) == SPECIAL)) + pInstance->SetData(TYPE_MEKGINEER_STEAMRIGGER,SPECIAL); + + return true; +} + +struct TRINITY_DLL_DECL instance_steam_vault : public ScriptedInstance +{ + instance_steam_vault(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + + uint64 ThespiaGUID; + uint64 MekgineerGUID; + uint64 KalithreshGUID; + + uint64 MainChambersDoor; + uint64 AccessPanelHydro; + uint64 AccessPanelMek; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + ThespiaGUID = 0; + MekgineerGUID = 0; + KalithreshGUID = 0; + MainChambersDoor = 0; + AccessPanelHydro = 0; + AccessPanelMek = 0; + } + + bool IsEncounterInProgress() const + { + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) + return true; + + return false; + } + + void OnCreatureCreate(Creature* pCreature, bool add) + { + switch(pCreature->GetEntry()) + { + case 17797: ThespiaGUID = pCreature->GetGUID(); break; + case 17796: MekgineerGUID = pCreature->GetGUID(); break; + case 17798: KalithreshGUID = pCreature->GetGUID(); break; + } + } + + void OnGameObjectCreate(GameObject* pGo, bool add) + { + switch(pGo->GetEntry()) + { + case MAIN_CHAMBERS_DOOR: MainChambersDoor = pGo->GetGUID(); break; + case ACCESS_PANEL_HYDRO: AccessPanelHydro = pGo->GetGUID(); break; + case ACCESS_PANEL_MEK: AccessPanelMek = pGo->GetGUID(); break; + } + } + + void SetData(uint32 type, uint32 data) + { + switch(type) + { + case TYPE_HYDROMANCER_THESPIA: + if (data == SPECIAL) + { + HandleGameObject(AccessPanelHydro, true); + + if (GetData(TYPE_MEKGINEER_STEAMRIGGER) == SPECIAL) + HandleGameObject(MainChambersDoor, true); + + debug_log("TSCR: Instance Steamvault: Access panel used."); + } + m_auiEncounter[0] = data; + break; + case TYPE_MEKGINEER_STEAMRIGGER: + if (data == SPECIAL) + { + HandleGameObject(AccessPanelMek, true); + + if (GetData(TYPE_HYDROMANCER_THESPIA) == SPECIAL) + HandleGameObject(MainChambersDoor, true); + + debug_log("TSCR: Instance Steamvault: Access panel used."); + } + m_auiEncounter[1] = data; + break; + case TYPE_WARLORD_KALITHRESH: + m_auiEncounter[2] = data; + break; + case TYPE_DISTILLER: + m_auiEncounter[3] = data; + break; + } + + if (data == DONE || data == SPECIAL) + SaveToDB(); + } + + uint32 GetData(uint32 type) + { + switch(type) + { + case TYPE_HYDROMANCER_THESPIA: + return m_auiEncounter[0]; + case TYPE_MEKGINEER_STEAMRIGGER: + return m_auiEncounter[1]; + case TYPE_WARLORD_KALITHRESH: + return m_auiEncounter[2]; + case TYPE_DISTILLER: + return m_auiEncounter[3]; + } + return 0; + } + + uint64 GetData64(uint32 data) + { + switch(data) + { + case DATA_THESPIA: + return ThespiaGUID; + case DATA_MEKGINEERSTEAMRIGGER: + return MekgineerGUID; + case DATA_KALITRESH: + return KalithreshGUID; + } + return 0; + } + + std::string GetSaveData() + { + OUT_SAVE_INST_DATA; + std::ostringstream stream; + stream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " " << m_auiEncounter[3]; + char* out = new char[stream.str().length() + 1]; + strcpy(out, stream.str().c_str()); + if (out) + { + OUT_SAVE_INST_DATA_COMPLETE; + return out; + } + return NULL; + } + + void Load(const char* in) + { + if (!in) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + OUT_LOAD_INST_DATA(in); + std::istringstream stream(in); + stream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3]; + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) + m_auiEncounter[i] = NOT_STARTED; + OUT_LOAD_INST_DATA_COMPLETE; + } +}; + +InstanceData* GetInstanceData_instance_steam_vault(Map* pMap) +{ + return new instance_steam_vault(pMap); +} + +void AddSC_instance_steam_vault() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "go_main_chambers_access_panel"; + newscript->pGOHello = &GOHello_go_main_chambers_access_panel; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "instance_steam_vault"; + newscript->GetInstanceData = &GetInstanceData_instance_steam_vault; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/coilfang_resevoir/underbog/boss_hungarfen.cpp b/src/bindings/scripts/scripts/outland/coilfang_resevoir/underbog/boss_hungarfen.cpp new file mode 100644 index 00000000000..309c63d857e --- /dev/null +++ b/src/bindings/scripts/scripts/outland/coilfang_resevoir/underbog/boss_hungarfen.cpp @@ -0,0 +1,156 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Hungarfen +SD%Complete: 95 +SDComment: Need confirmation if spell data are same in both modes. Summons should have faster rate in heroic +SDCategory: Coilfang Resevoir, Underbog +EndScriptData */ + +#include "precompiled.h" + +#define SPELL_FOUL_SPORES 31673 +#define SPELL_ACID_GEYSER 38739 + +struct TRINITY_DLL_DECL boss_hungarfenAI : public ScriptedAI +{ + boss_hungarfenAI(Creature *c) : ScriptedAI(c) + { + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + bool HeroicMode; + bool Root; + uint32 Mushroom_Timer; + uint32 AcidGeyser_Timer; + + void Reset() + { + Root = false; + Mushroom_Timer = 5000; // 1 mushroom after 5s, then one per 10s. This should be different in heroic mode + AcidGeyser_Timer = 10000; + } + + void EnterCombat(Unit *who) + { + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() <= 20) + { + if (!Root) + { + DoCast(m_creature,SPELL_FOUL_SPORES); + Root = true; + } + } + + if (Mushroom_Timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + m_creature->SummonCreature(17990, target->GetPositionX()+(rand()%8), target->GetPositionY()+(rand()%8), target->GetPositionZ(), (rand()%5), TEMPSUMMON_TIMED_DESPAWN, 22000); + else + m_creature->SummonCreature(17990, m_creature->GetPositionX()+(rand()%8), m_creature->GetPositionY()+(rand()%8), m_creature->GetPositionZ(), (rand()%5), TEMPSUMMON_TIMED_DESPAWN, 22000); + + Mushroom_Timer = 10000; + }else Mushroom_Timer -= diff; + + if (AcidGeyser_Timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_ACID_GEYSER); + AcidGeyser_Timer = 10000+rand()%7500; + }else AcidGeyser_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_hungarfen(Creature* pCreature) +{ + return new boss_hungarfenAI (pCreature); +} + +#define SPELL_SPORE_CLOUD 34168 +#define SPELL_PUTRID_MUSHROOM 31690 +#define SPELL_GROW 31698 + +struct TRINITY_DLL_DECL mob_underbog_mushroomAI : public ScriptedAI +{ + mob_underbog_mushroomAI(Creature *c) : ScriptedAI(c) {} + + bool Stop; + uint32 Grow_Timer; + uint32 Shrink_Timer; + + void Reset() + { + Stop = false; + Grow_Timer = 0; + Shrink_Timer = 20000; + + DoCast(m_creature,SPELL_PUTRID_MUSHROOM,true); + DoCast(m_creature,SPELL_SPORE_CLOUD,true); + } + + void MoveInLineOfSight(Unit *who) { return; } + + void AttackStart(Unit* who) { return; } + + void EnterCombat(Unit* who) { } + + void UpdateAI(const uint32 diff) + { + if (Stop) + return; + + if (Grow_Timer <= diff) + { + DoCast(m_creature,SPELL_GROW); + Grow_Timer = 3000; + }else Grow_Timer -= diff; + + if (Shrink_Timer <= diff) + { + m_creature->RemoveAurasDueToSpell(SPELL_GROW); + Stop = true; + }else Shrink_Timer -= diff; + } +}; +CreatureAI* GetAI_mob_underbog_mushroom(Creature* pCreature) +{ + return new mob_underbog_mushroomAI (pCreature); +} + +void AddSC_boss_hungarfen() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_hungarfen"; + newscript->GetAI = &GetAI_boss_hungarfen; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_underbog_mushroom"; + newscript->GetAI = &GetAI_mob_underbog_mushroom; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/coilfang_resevoir/underbog/boss_the_black_stalker.cpp b/src/bindings/scripts/scripts/outland/coilfang_resevoir/underbog/boss_the_black_stalker.cpp new file mode 100644 index 00000000000..6da2a022adf --- /dev/null +++ b/src/bindings/scripts/scripts/outland/coilfang_resevoir/underbog/boss_the_black_stalker.cpp @@ -0,0 +1,191 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_the_black_stalker +SD%Complete: 95 +SDComment: Timers may be incorrect +SDCategory: Coilfang Resevoir, Underbog +EndScriptData */ + +#include "precompiled.h" + +#define SPELL_LEVITATE 31704 +#define SPELL_SUSPENSION 31719 +#define SPELL_LEVITATION_PULSE 31701 +#define SPELL_MAGNETIC_PULL 31705 +#define SPELL_CHAIN_LIGHTNING 31717 +#define SPELL_STATIC_CHARGE 31715 +#define SPELL_SUMMON_SPORE_STRIDER 38755 + +#define ENTRY_SPORE_STRIDER 22299 + +struct TRINITY_DLL_DECL boss_the_black_stalkerAI : public ScriptedAI +{ + boss_the_black_stalkerAI(Creature *c) : ScriptedAI(c) + { + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + bool HeroicMode; + uint32 SporeStriders_Timer; + uint32 Levitate_Timer; + uint32 ChainLightning_Timer; + uint32 StaticCharge_Timer; + uint64 LevitatedTarget; + uint32 LevitatedTarget_Timer; + bool InAir; + uint32 check_Timer; + std::list Striders; + + void Reset() + { + Levitate_Timer = 12000; + ChainLightning_Timer = 6000; + StaticCharge_Timer = 10000; + SporeStriders_Timer = 10000+rand()%5000; + check_Timer = 5000; + LevitatedTarget = 0; + LevitatedTarget_Timer = 0; + Striders.clear(); + } + + void EnterCombat(Unit *who) {} + + void JustSummoned(Creature *summon) + { + if (summon && summon->GetEntry() == ENTRY_SPORE_STRIDER) + { + Striders.push_back(summon->GetGUID()); + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,1)) + summon->AI()->AttackStart(target); + else + if (m_creature->getVictim()) + summon->AI()->AttackStart(m_creature->getVictim()); + } + } + + void JustDied(Unit *who) + { + for(std::list::iterator i = Striders.begin(); i != Striders.end(); ++i) + if (Creature *strider = Unit::GetCreature(*m_creature, *i)) + { + strider->SetLootRecipient(NULL); + strider->DealDamage(strider,strider->GetMaxHealth(),NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + strider->RemoveCorpse(); + } + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + // Evade if too far + if (check_Timer < diff) + { + float x,y,z,o; + m_creature->GetHomePosition(x,y,z,o); + if (!m_creature->IsWithinDist3d(x,y,z, 60)) + { + EnterEvadeMode(); + return; + } + check_Timer = 1000; + }else check_Timer -= diff; + + // Spore Striders + if (HeroicMode && SporeStriders_Timer < diff) + { + DoCast(m_creature,SPELL_SUMMON_SPORE_STRIDER); + SporeStriders_Timer = 10000+rand()%5000; + }else SporeStriders_Timer -= diff; + + // Levitate + if (LevitatedTarget) + { + if (LevitatedTarget_Timer < diff) + { + if (Unit* target = Unit::GetUnit(*m_creature, LevitatedTarget)) + { + if (!target->HasAura(SPELL_LEVITATE)) + { + LevitatedTarget = 0; + return; + } + if (InAir) + { + target->AddAura(SPELL_SUSPENSION, target); + LevitatedTarget = 0; + } + else + { + target->CastSpell(target, SPELL_MAGNETIC_PULL, true); + InAir = true; + LevitatedTarget_Timer = 1500; + } + } + else + LevitatedTarget = 0; + }else LevitatedTarget_Timer -= diff; + } + if (Levitate_Timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,1)) + { + DoCast(target, SPELL_LEVITATE); + LevitatedTarget = target->GetGUID(); + LevitatedTarget_Timer = 2000; + InAir = false; + } + Levitate_Timer = 12000+rand()%3000; + }else Levitate_Timer -= diff; + + // Chain Lightning + if (ChainLightning_Timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target, SPELL_CHAIN_LIGHTNING); + ChainLightning_Timer = 7000; + }else ChainLightning_Timer -= diff; + + // Static Charge + if (StaticCharge_Timer < diff) + { + if (Unit *target = SelectTarget(SELECT_TARGET_RANDOM,0,30,true)) + DoCast(target, SPELL_STATIC_CHARGE); + StaticCharge_Timer = 10000; + }else StaticCharge_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_the_black_stalker(Creature* pCreature) +{ + return new boss_the_black_stalkerAI (pCreature); +} + +void AddSC_boss_the_black_stalker() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_the_black_stalker"; + newscript->GetAI = &GetAI_boss_the_black_stalker; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/gruuls_lair/boss_gruul.cpp b/src/bindings/scripts/scripts/outland/gruuls_lair/boss_gruul.cpp new file mode 100644 index 00000000000..dc4d9df18c4 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/gruuls_lair/boss_gruul.cpp @@ -0,0 +1,260 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Gruul +SD%Complete: 60 +SDComment: Ground Slam need further development (knock back effect and shatter effect must be added to mangos) +SDCategory: Gruul's Lair +EndScriptData */ + +#include "precompiled.h" +#include "def_gruuls_lair.h" + +enum +{ + SAY_AGGRO = -1565010, + SAY_SLAM1 = -1565011, + SAY_SLAM2 = -1565012, + SAY_SHATTER1 = -1565013, + SAY_SHATTER2 = -1565014, + SAY_SLAY1 = -1565015, + SAY_SLAY2 = -1565016, + SAY_SLAY3 = -1565017, + SAY_DEATH = -1565018, + + EMOTE_GROW = -1565019, + + SPELL_GROWTH = 36300, + SPELL_CAVE_IN = 36240, + SPELL_GROUND_SLAM = 33525, //AoE Ground Slam applying Ground Slam to everyone with a script effect (most likely the knock back, we can code it to a set knockback) + SPELL_REVERBERATION = 36297, + SPELL_SHATTER = 33654, + + SPELL_SHATTER_EFFECT = 33671, + SPELL_HURTFUL_STRIKE = 33813, + SPELL_STONED = 33652, //Spell is self cast by target + + SPELL_MAGNETIC_PULL = 28337, + SPELL_KNOCK_BACK = 24199, //Knockback spell until correct implementation is made +}; + +struct TRINITY_DLL_DECL boss_gruulAI : public ScriptedAI +{ + boss_gruulAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance *pInstance; + + uint32 m_uiGrowth_Timer; + uint32 m_uiCaveIn_Timer; + uint32 m_uiCaveIn_StaticTimer; + uint32 m_uiGroundSlamTimer; + uint32 m_uiHurtfulStrike_Timer; + uint32 m_uiReverberation_Timer; + + bool m_bPerformingGroundSlam; + + void Reset() + { + m_uiGrowth_Timer= 30000; + m_uiCaveIn_Timer= 27000; + m_uiCaveIn_StaticTimer = 30000; + m_uiGroundSlamTimer= 35000; + m_bPerformingGroundSlam= false; + m_uiHurtfulStrike_Timer= 8000; + m_uiReverberation_Timer= 60000+45000; + + if (pInstance) + pInstance->SetData(DATA_GRUULEVENT, NOT_STARTED); + } + + void EnterCombat(Unit *who) + { + DoScriptText(SAY_AGGRO, m_creature); + + if (pInstance) + pInstance->SetData(DATA_GRUULEVENT, IN_PROGRESS); + } + + void KilledUnit() + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + case 2: DoScriptText(SAY_SLAY3, m_creature); break; + } + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEATH, m_creature); + + if (pInstance) + { + pInstance->SetData(DATA_GRUULEVENT, DONE); + pInstance->HandleGameObject(pInstance->GetData64(DATA_GRUULDOOR), true); // Open the encounter door + } + } + + void SpellHitTarget(Unit* pTarget, const SpellEntry* pSpell) + { + //This to emulate effect1 (77) of SPELL_GROUND_SLAM, knock back to any direction + //It's initially wrong, since this will cause fall damage, which is by comments, not intended. + if (pSpell->Id == SPELL_GROUND_SLAM) + { + if (pTarget->GetTypeId() == TYPEID_PLAYER) + { + switch(rand()%2) + { + case 0: pTarget->CastSpell(pTarget, SPELL_MAGNETIC_PULL, true, NULL, NULL, m_creature->GetGUID()); break; + case 1: pTarget->CastSpell(pTarget, SPELL_KNOCK_BACK, true, NULL, NULL, m_creature->GetGUID()); break; + } + } + } + + //this part should be in mangos + if (pSpell->Id == SPELL_SHATTER) + { + //this spell must have custom handling in mangos, dealing damage based on distance + pTarget->CastSpell(pTarget, SPELL_SHATTER_EFFECT, true); + + if (pTarget->HasAura(SPELL_STONED)) + pTarget->RemoveAurasDueToSpell(SPELL_STONED); + + //clear this, if we are still performing + if (m_bPerformingGroundSlam) + { + m_bPerformingGroundSlam = false; + + //and correct movement, if not already + if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() != TARGETED_MOTION_TYPE) + { + if (m_creature->getVictim()) + m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); + } + } + } + } + + void UpdateAI(const uint32 uiDiff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + // Growth + // Gruul can cast this spell up to 30 times + if (m_uiGrowth_Timer < uiDiff) + { + DoScriptText(EMOTE_GROW, m_creature); + DoCast(m_creature,SPELL_GROWTH); + m_uiGrowth_Timer = 30000; + } + else + m_uiGrowth_Timer -= uiDiff; + + if (m_bPerformingGroundSlam) + { + if (m_uiGroundSlamTimer < uiDiff) + { + m_uiGroundSlamTimer =120000; + m_uiHurtfulStrike_Timer= 8000; + + if (m_uiReverberation_Timer < 10000) //Give a little time to the players to undo the damage from shatter + m_uiReverberation_Timer += 10000; + + DoCast(m_creature, SPELL_SHATTER); + } + else + m_uiGroundSlamTimer -= uiDiff; + } + else + { + // Hurtful Strike + if (m_uiHurtfulStrike_Timer < uiDiff) + { + Unit* target = SelectUnit(SELECT_TARGET_TOPAGGRO,1); + + if (target && m_creature->IsWithinMeleeRange(m_creature->getVictim())) + DoCast(target,SPELL_HURTFUL_STRIKE); + else + DoCast(m_creature->getVictim(),SPELL_HURTFUL_STRIKE); + + m_uiHurtfulStrike_Timer= 8000; + } + else + m_uiHurtfulStrike_Timer -= uiDiff; + + // Reverberation + if (m_uiReverberation_Timer < uiDiff) + { + DoCast(m_creature->getVictim(), SPELL_REVERBERATION, true); + m_uiReverberation_Timer = 15000 + rand()%10000; + } + else + m_uiReverberation_Timer -= uiDiff; + + // Cave In + if (m_uiCaveIn_Timer < uiDiff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_CAVE_IN); + + if (m_uiCaveIn_StaticTimer >= 4000) + m_uiCaveIn_StaticTimer -= 2000; + + m_uiCaveIn_Timer = m_uiCaveIn_StaticTimer; + } + else + m_uiCaveIn_Timer -= uiDiff; + + // Ground Slam, Gronn Lord's Grasp, Stoned, Shatter + if (m_uiGroundSlamTimer < uiDiff) + { + m_creature->GetMotionMaster()->Clear(); + m_creature->GetMotionMaster()->MoveIdle(); + + m_bPerformingGroundSlam= true; + m_uiGroundSlamTimer = 10000; + + DoCast(m_creature, SPELL_GROUND_SLAM); + } + else + m_uiGroundSlamTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } + } +}; + +CreatureAI* GetAI_boss_gruul(Creature* pCreature) +{ + return new boss_gruulAI (pCreature); +} + +void AddSC_boss_gruul() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_gruul"; + newscript->GetAI = &GetAI_boss_gruul; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/gruuls_lair/boss_high_king_maulgar.cpp b/src/bindings/scripts/scripts/outland/gruuls_lair/boss_high_king_maulgar.cpp new file mode 100644 index 00000000000..6918feaabba --- /dev/null +++ b/src/bindings/scripts/scripts/outland/gruuls_lair/boss_high_king_maulgar.cpp @@ -0,0 +1,793 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_High_King_Maulgar +SD%Complete: 90 +SDComment: Correct timers, after whirlwind melee attack bug, prayer of healing +SDCategory: Gruul's Lair +EndScriptData */ + +#include "precompiled.h" +#include "def_gruuls_lair.h" + +#define SAY_AGGRO -1565000 +#define SAY_ENRAGE -1565001 +#define SAY_OGRE_DEATH1 -1565002 +#define SAY_OGRE_DEATH2 -1565003 +#define SAY_OGRE_DEATH3 -1565004 +#define SAY_OGRE_DEATH4 -1565005 +#define SAY_SLAY1 -1565006 +#define SAY_SLAY2 -1565007 +#define SAY_SLAY3 -1565008 +#define SAY_DEATH -1565009 + +// High King Maulgar +#define SPELL_ARCING_SMASH 39144 +#define SPELL_MIGHTY_BLOW 33230 +#define SPELL_WHIRLWIND 33238 +#define SPELL_BERSERKER_C 26561 +#define SPELL_ROAR 16508 +#define SPELL_FLURRY 33232 +#define SPELL_DUAL_WIELD 29651 //used in phase + +// Olm the Summoner +#define SPELL_DARK_DECAY 33129 +#define SPELL_DEATH_COIL 33130 +#define SPELL_SUMMON_WFH 33131 + +//Kiggler the Craed +#define SPELL_GREATER_POLYMORPH 33173 +#define SPELL_LIGHTNING_BOLT 36152 +#define SPELL_ARCANE_SHOCK 33175 +#define SPELL_ARCANE_EXPLOSION 33237 + +//Blindeye the Seer +#define SPELL_GREATER_PW_SHIELD 33147 +#define SPELL_HEAL 33144 +#define SPELL_PRAYER_OH 33152 + +//Krosh Firehand +#define SPELL_GREATER_FIREBALL 33051 +#define SPELL_SPELLSHIELD 33054 +#define SPELL_BLAST_WAVE 33061 + +bool CheckAllBossDied(ScriptedInstance* pInstance, Creature* m_creature) +{ + if (!pInstance || !m_creature) + return false; + + uint64 MaulgarGUID = 0; + uint64 KigglerGUID = 0; + uint64 BlindeyeGUID = 0; + uint64 OlmGUID = 0; + uint64 KroshGUID = 0; + + Creature* Maulgar = NULL; + Creature* Kiggler = NULL; + Creature* Blindeye = NULL; + Creature* Olm = NULL; + Creature* Krosh = NULL; + + MaulgarGUID = pInstance->GetData64(DATA_MAULGAR); + KigglerGUID = pInstance->GetData64(DATA_KIGGLERTHECRAZED); + BlindeyeGUID = pInstance->GetData64(DATA_BLINDEYETHESEER); + OlmGUID = pInstance->GetData64(DATA_OLMTHESUMMONER); + KroshGUID = pInstance->GetData64(DATA_KROSHFIREHAND); + + Maulgar = (Unit::GetCreature((*m_creature), MaulgarGUID)); + Kiggler = (Unit::GetCreature((*m_creature), KigglerGUID)); + Blindeye = (Unit::GetCreature((*m_creature), BlindeyeGUID)); + Olm = (Unit::GetCreature((*m_creature), OlmGUID)); + Krosh = (Unit::GetCreature((*m_creature), KroshGUID)); + + if (!Maulgar || !Kiggler || !Blindeye || !Olm || !Krosh) + return false; + + if (!Maulgar->isAlive() && !Kiggler->isAlive() && !Blindeye->isAlive() && !Olm->isAlive() && !Krosh->isAlive()) + return true; + + return false; +} + +//High King Maulgar AI +struct TRINITY_DLL_DECL boss_high_king_maulgarAI : public ScriptedAI +{ + boss_high_king_maulgarAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + for(uint8 i = 0; i < 4; ++i) + Council[i] = 0; + } + + ScriptedInstance* pInstance; + + uint32 ArcingSmash_Timer; + uint32 MightyBlow_Timer; + uint32 Whirlwind_Timer; + uint32 Charging_Timer; + uint32 Roar_Timer; + + bool Phase2; + + uint64 Council[4]; + + void Reset() + { + ArcingSmash_Timer = 10000; + MightyBlow_Timer = 40000; + Whirlwind_Timer = 30000; + Charging_Timer = 0; + Roar_Timer = 0; + + m_creature->CastSpell(m_creature, SPELL_DUAL_WIELD, false); + + Phase2 = false; + + Creature *pCreature = NULL; + for(uint8 i = 0; i < 4; ++i) + { + if (Council[i]) + { + pCreature = (Unit::GetCreature((*m_creature), Council[i])); + if (pCreature && !pCreature->isAlive()) + { + pCreature->Respawn(); + pCreature->AI()->EnterEvadeMode(); + } + } + } + + //reset encounter + if (pInstance) + pInstance->SetData(DATA_MAULGAREVENT, NOT_STARTED); + } + + void KilledUnit() + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + case 2: DoScriptText(SAY_SLAY3, m_creature); break; + } + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEATH, m_creature); + + if (CheckAllBossDied(pInstance, m_creature)) + pInstance->SetData(DATA_MAULGAREVENT, DONE); + } + + void AddDeath() + { + switch(rand()%4) + { + case 0: DoScriptText(SAY_OGRE_DEATH1, m_creature);break; + case 1: DoScriptText(SAY_OGRE_DEATH2, m_creature);break; + case 2: DoScriptText(SAY_OGRE_DEATH3, m_creature);break; + case 3: DoScriptText(SAY_OGRE_DEATH4, m_creature);break; + } + } + + + void EnterCombat(Unit *who) + { + StartEvent(who); + } + + void GetCouncil() + { + //get council member's guid to respawn them if needed + Council[0] = pInstance->GetData64(DATA_KIGGLERTHECRAZED); + Council[1] = pInstance->GetData64(DATA_BLINDEYETHESEER); + Council[2] = pInstance->GetData64(DATA_OLMTHESUMMONER); + Council[3] = pInstance->GetData64(DATA_KROSHFIREHAND); + } + + void StartEvent(Unit *who) + { + if (!pInstance) + return; + + GetCouncil(); + + DoScriptText(SAY_AGGRO, m_creature); + + pInstance->SetData64(DATA_MAULGAREVENT_TANK, who->GetGUID()); + pInstance->SetData(DATA_MAULGAREVENT, IN_PROGRESS); + + DoZoneInCombat(); + } + + void UpdateAI(const uint32 diff) + { + //Only if not incombat check if the event is started + if (!m_creature->isInCombat() && pInstance && pInstance->GetData(DATA_MAULGAREVENT)) + { + Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_MAULGAREVENT_TANK)); + + if (target) + { + AttackStart(target); + GetCouncil(); + } + } + + //Return since we have no target + if (!UpdateVictim()) + return; + + //someone evaded! + if (pInstance && !pInstance->GetData(DATA_MAULGAREVENT)) + { + EnterEvadeMode(); + return; + } + + //ArcingSmash_Timer + if (ArcingSmash_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_ARCING_SMASH); + ArcingSmash_Timer = 10000; + }else ArcingSmash_Timer -= diff; + + //Whirlwind_Timer + if (Whirlwind_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_WHIRLWIND); + Whirlwind_Timer = 55000; + }else Whirlwind_Timer -= diff; + + //MightyBlow_Timer + if (MightyBlow_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_MIGHTY_BLOW); + MightyBlow_Timer = 30000+rand()%10000; + }else MightyBlow_Timer -= diff; + + //Entering Phase 2 + if (!Phase2 && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 50) + { + Phase2 = true; + DoScriptText(SAY_ENRAGE, m_creature); + + m_creature->CastSpell(m_creature, SPELL_DUAL_WIELD, true); + m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, 0); + m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, 0); + } + + if (Phase2) + { + //Charging_Timer + if (Charging_Timer < diff) + { + Unit* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (target) + { + AttackStart(target); + DoCast(target, SPELL_BERSERKER_C); + } + Charging_Timer = 20000; + }else Charging_Timer -= diff; + + //Intimidating Roar + if (Roar_Timer < diff) + { + DoCast(m_creature, SPELL_ROAR); + Roar_Timer = 40000+(rand()%10000); + }else Roar_Timer -= diff; + } + + DoMeleeAttackIfReady(); + } +}; + +//Olm The Summoner AI +struct TRINITY_DLL_DECL boss_olm_the_summonerAI : public ScriptedAI +{ + boss_olm_the_summonerAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + uint32 DarkDecay_Timer; + uint32 Summon_Timer; + uint32 DeathCoil_Timer; + + ScriptedInstance* pInstance; + + void Reset() + { + DarkDecay_Timer = 10000; + Summon_Timer = 15000; + DeathCoil_Timer = 20000; + + //reset encounter + if (pInstance) + pInstance->SetData(DATA_MAULGAREVENT, NOT_STARTED); + } + + void AttackStart(Unit* pWho) + { + if (!pWho) + return; + + if (m_creature->Attack(pWho, true)) + { + m_creature->AddThreat(pWho, 0.0f); + m_creature->SetInCombatWith(pWho); + pWho->SetInCombatWith(m_creature); + + m_creature->GetMotionMaster()->MoveChase(pWho, 30.0f); + } + } + + void EnterCombat(Unit *who) + { + if (pInstance) + { + pInstance->SetData64(DATA_MAULGAREVENT_TANK, who->GetGUID()); + pInstance->SetData(DATA_MAULGAREVENT, IN_PROGRESS); + } + } + + void JustDied(Unit* Killer) + { + if (pInstance) + { + Creature *Maulgar = NULL; + Maulgar = (Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_MAULGAR))); + + if (Maulgar) + CAST_AI(boss_high_king_maulgarAI, Maulgar->AI())->AddDeath(); + + if (CheckAllBossDied(pInstance, m_creature)) + pInstance->SetData(DATA_MAULGAREVENT, DONE); + } + } + + void UpdateAI(const uint32 diff) + { + //Only if not incombat check if the event is started + if (!m_creature->isInCombat() && pInstance && pInstance->GetData(DATA_MAULGAREVENT)) + { + Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_MAULGAREVENT_TANK)); + + if (target) + { + AttackStart(target); + } + } + + //Return since we have no target + if (!UpdateVictim()) + return; + + //someone evaded! + if (pInstance && !pInstance->GetData(DATA_MAULGAREVENT)) + { + EnterEvadeMode(); + return; + } + + //DarkDecay_Timer + if (DarkDecay_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_DARK_DECAY); + DarkDecay_Timer = 20000; + }else DarkDecay_Timer -= diff; + + //Summon_Timer + if (Summon_Timer < diff) + { + DoCast(m_creature, SPELL_SUMMON_WFH); + Summon_Timer = 30000; + }else Summon_Timer -= diff; + + //DeathCoil Timer /need correct timer + if (DeathCoil_Timer < diff) + { + Unit* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (target) + DoCast(target, SPELL_DEATH_COIL); + DeathCoil_Timer = 20000; + }else DeathCoil_Timer -= diff; + + + DoMeleeAttackIfReady(); + } +}; + +//Kiggler The Crazed AI +struct TRINITY_DLL_DECL boss_kiggler_the_crazedAI : public ScriptedAI +{ + boss_kiggler_the_crazedAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + uint32 GreaterPolymorph_Timer; + uint32 LightningBolt_Timer; + uint32 ArcaneShock_Timer; + uint32 ArcaneExplosion_Timer; + + ScriptedInstance* pInstance; + + void Reset() + { + GreaterPolymorph_Timer = 5000; + LightningBolt_Timer = 10000; + ArcaneShock_Timer = 20000; + ArcaneExplosion_Timer = 30000; + + //reset encounter + if (pInstance) + pInstance->SetData(DATA_MAULGAREVENT, NOT_STARTED); + } + + void EnterCombat(Unit *who) + { + if (pInstance) + { + pInstance->SetData64(DATA_MAULGAREVENT_TANK, who->GetGUID()); + pInstance->SetData(DATA_MAULGAREVENT, IN_PROGRESS); + } + } + + void JustDied(Unit* Killer) + { + if (pInstance) + { + Creature *Maulgar = NULL; + Maulgar = (Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_MAULGAR))); + + if (Maulgar) + CAST_AI(boss_high_king_maulgarAI, Maulgar->AI())->AddDeath(); + + if (CheckAllBossDied(pInstance, m_creature)) + pInstance->SetData(DATA_MAULGAREVENT, DONE); + } + } + + void UpdateAI(const uint32 diff) + { + //Only if not incombat check if the event is started + if (!m_creature->isInCombat() && pInstance && pInstance->GetData(DATA_MAULGAREVENT)) + { + Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_MAULGAREVENT_TANK)); + + if (target) + { + AttackStart(target); + } + } + + //Return since we have no target + if (!UpdateVictim()) + return; + + //someone evaded! + if (pInstance && !pInstance->GetData(DATA_MAULGAREVENT)) + { + EnterEvadeMode(); + return; + } + + //GreaterPolymorph_Timer + if (GreaterPolymorph_Timer < diff) + { + Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (target) + DoCast(target, SPELL_GREATER_POLYMORPH); + + GreaterPolymorph_Timer = 15000 + rand()%5000; + }else GreaterPolymorph_Timer -= diff; + + //LightningBolt_Timer + if (LightningBolt_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_LIGHTNING_BOLT); + LightningBolt_Timer = 15000; + }else LightningBolt_Timer -= diff; + + //ArcaneShock_Timer + if (ArcaneShock_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_ARCANE_SHOCK); + ArcaneShock_Timer = 20000; + }else ArcaneShock_Timer -= diff; + + //ArcaneExplosion_Timer + if (ArcaneExplosion_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_ARCANE_EXPLOSION); + ArcaneExplosion_Timer = 30000; + }else ArcaneExplosion_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +//Blindeye The Seer AI +struct TRINITY_DLL_DECL boss_blindeye_the_seerAI : public ScriptedAI +{ + boss_blindeye_the_seerAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + uint32 GreaterPowerWordShield_Timer; + uint32 Heal_Timer; + uint32 PrayerofHealing_Timer; + + ScriptedInstance* pInstance; + + void Reset() + { + GreaterPowerWordShield_Timer = 5000; + Heal_Timer = 25000 + rand()%15000; + PrayerofHealing_Timer = 45000 + rand()%10000; + + //reset encounter + if (pInstance) + pInstance->SetData(DATA_MAULGAREVENT, NOT_STARTED); + } + + void EnterCombat(Unit *who) + { + if (pInstance) + { + pInstance->SetData64(DATA_MAULGAREVENT_TANK, who->GetGUID()); + pInstance->SetData(DATA_MAULGAREVENT, IN_PROGRESS); + } + } + + void JustDied(Unit* Killer) + { + if (pInstance) + { + Creature *Maulgar = NULL; + Maulgar = (Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_MAULGAR))); + + if (Maulgar) + CAST_AI(boss_high_king_maulgarAI, Maulgar->AI())->AddDeath(); + + if (CheckAllBossDied(pInstance, m_creature)) + pInstance->SetData(DATA_MAULGAREVENT, DONE); + } + } + + void UpdateAI(const uint32 diff) + { + //Only if not incombat check if the event is started + if (!m_creature->isInCombat() && pInstance && pInstance->GetData(DATA_MAULGAREVENT)) + { + Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_MAULGAREVENT_TANK)); + + if (target) + { + AttackStart(target); + } + } + + //Return since we have no target + if (!UpdateVictim()) + return; + + //someone evaded! + if (pInstance && !pInstance->GetData(DATA_MAULGAREVENT)) + { + EnterEvadeMode(); + return; + } + + //GreaterPowerWordShield_Timer + if (GreaterPowerWordShield_Timer < diff) + { + DoCast(m_creature, SPELL_GREATER_PW_SHIELD); + GreaterPowerWordShield_Timer = 40000; + }else GreaterPowerWordShield_Timer -= diff; + + //Heal_Timer + if (Heal_Timer < diff) + { + DoCast(m_creature, SPELL_HEAL); + Heal_Timer = 15000 + rand()%25000; + }else Heal_Timer -= diff; + + //PrayerofHealing_Timer + if (PrayerofHealing_Timer < diff) + { + DoCast(m_creature, SPELL_PRAYER_OH); + PrayerofHealing_Timer = 35000 + rand()%15000; + }else PrayerofHealing_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +//Krosh Firehand AI +struct TRINITY_DLL_DECL boss_krosh_firehandAI : public ScriptedAI +{ + boss_krosh_firehandAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + uint32 GreaterFireball_Timer; + uint32 SpellShield_Timer; + uint32 BlastWave_Timer; + + ScriptedInstance* pInstance; + + void Reset() + { + GreaterFireball_Timer = 1000; + SpellShield_Timer = 5000; + BlastWave_Timer = 20000; + + //reset encounter + if (pInstance) + pInstance->SetData(DATA_MAULGAREVENT, NOT_STARTED); + } + + void EnterCombat(Unit *who) + { + if (pInstance) + { + pInstance->SetData64(DATA_MAULGAREVENT_TANK, who->GetGUID()); + pInstance->SetData(DATA_MAULGAREVENT, IN_PROGRESS); + } + } + + void JustDied(Unit* Killer) + { + if (pInstance) + { + Creature *Maulgar = NULL; + Maulgar = (Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_MAULGAR))); + + if (Maulgar) + CAST_AI(boss_high_king_maulgarAI, Maulgar->AI())->AddDeath(); + + if (CheckAllBossDied(pInstance, m_creature)) + pInstance->SetData(DATA_MAULGAREVENT, DONE); + } + } + + void UpdateAI(const uint32 diff) + { + //Only if not incombat check if the event is started + if (!m_creature->isInCombat() && pInstance && pInstance->GetData(DATA_MAULGAREVENT)) + { + Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_MAULGAREVENT_TANK)); + + if (target) + { + AttackStart(target); + } + } + + //Return since we have no target + if (!UpdateVictim()) + return; + + //someone evaded! + if (pInstance && !pInstance->GetData(DATA_MAULGAREVENT)) + { + EnterEvadeMode(); + return; + } + + //GreaterFireball_Timer + if (GreaterFireball_Timer < diff || m_creature->IsWithinDist(m_creature->getVictim(), 30)) + { + DoCast(m_creature->getVictim(), SPELL_GREATER_FIREBALL); + GreaterFireball_Timer = 2000; + }else GreaterFireball_Timer -= diff; + + //SpellShield_Timer + if (SpellShield_Timer < diff) + { + m_creature->InterruptNonMeleeSpells(false); + DoCast(m_creature->getVictim(), SPELL_SPELLSHIELD); + SpellShield_Timer = 30000; + }else SpellShield_Timer -= diff; + + //BlastWave_Timer + if (BlastWave_Timer < diff) + { + Unit *target; + std::list t_list = m_creature->getThreatManager().getThreatList(); + std::vector target_list; + for(std::list::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr) + { + target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()); + //15 yard radius minimum + if (target && target->IsWithinDist(m_creature, 15,false)) + target_list.push_back(target); + target = NULL; + } + if (target_list.size()) + target = *(target_list.begin()+rand()%target_list.size()); + + m_creature->InterruptNonMeleeSpells(false); + DoCast(target, SPELL_BLAST_WAVE); + BlastWave_Timer = 60000; + }else BlastWave_Timer -= diff; + } +}; + +CreatureAI* GetAI_boss_high_king_maulgar(Creature* pCreature) +{ + return new boss_high_king_maulgarAI (pCreature); +} + +CreatureAI* GetAI_boss_olm_the_summoner(Creature* pCreature) +{ + return new boss_olm_the_summonerAI (pCreature); +} + +CreatureAI *GetAI_boss_kiggler_the_crazed(Creature* pCreature) +{ + return new boss_kiggler_the_crazedAI (pCreature); +} + +CreatureAI *GetAI_boss_blindeye_the_seer(Creature* pCreature) +{ + return new boss_blindeye_the_seerAI (pCreature); +} + +CreatureAI *GetAI_boss_krosh_firehand(Creature* pCreature) +{ + return new boss_krosh_firehandAI (pCreature); +} + +void AddSC_boss_high_king_maulgar() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_high_king_maulgar"; + newscript->GetAI = &GetAI_boss_high_king_maulgar; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="boss_kiggler_the_crazed"; + newscript->GetAI = &GetAI_boss_kiggler_the_crazed; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="boss_blindeye_the_seer"; + newscript->GetAI = &GetAI_boss_blindeye_the_seer; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="boss_olm_the_summoner"; + newscript->GetAI = &GetAI_boss_olm_the_summoner; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="boss_krosh_firehand"; + newscript->GetAI = &GetAI_boss_krosh_firehand; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/gruuls_lair/def_gruuls_lair.h b/src/bindings/scripts/scripts/outland/gruuls_lair/def_gruuls_lair.h new file mode 100644 index 00000000000..7003dcb1e26 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/gruuls_lair/def_gruuls_lair.h @@ -0,0 +1,21 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_GRUULS_LAIR_H +#define DEF_GRUULS_LAIR_H + +#define DATA_BLINDEYETHESEER 1 +#define DATA_GRUULEVENT 2 +#define DATA_KIGGLERTHECRAZED 3 +#define DATA_KROSHFIREHAND 4 +#define DATA_MAULGAREVENT 5 +#define DATA_MAULGAREVENT_TANK 6 +#define DATA_OLMTHESUMMONER 7 +#define DATA_MAULGARDOOR 8 +#define DATA_GRUULDOOR 9 +#define DATA_MAULGAR 10 + +#define ERROR_INST_DATA "TSCR Error: Instance Data not set properly for Gruul's Lair instance (map 565). Encounters will be buggy." +#endif + diff --git a/src/bindings/scripts/scripts/outland/gruuls_lair/instance_gruuls_lair.cpp b/src/bindings/scripts/scripts/outland/gruuls_lair/instance_gruuls_lair.cpp new file mode 100644 index 00000000000..0ac5cbcaf7a --- /dev/null +++ b/src/bindings/scripts/scripts/outland/gruuls_lair/instance_gruuls_lair.cpp @@ -0,0 +1,193 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Gruuls_Lair +SD%Complete: 100 +SDComment: +SDCategory: Gruul's Lair +EndScriptData */ + +#include "precompiled.h" +#include "def_gruuls_lair.h" + +#define MAX_ENCOUNTER 2 + +/* Gruuls Lair encounters: +1 - High King Maulgar event +2 - Gruul event +*/ + +struct TRINITY_DLL_DECL instance_gruuls_lair : public ScriptedInstance +{ + instance_gruuls_lair(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + + uint64 MaulgarEvent_Tank; + uint64 KigglerTheCrazed; + uint64 BlindeyeTheSeer; + uint64 OlmTheSummoner; + uint64 KroshFirehand; + uint64 Maulgar; + + uint64 MaulgarDoor; + uint64 GruulDoor; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + MaulgarEvent_Tank = 0; + KigglerTheCrazed = 0; + BlindeyeTheSeer = 0; + OlmTheSummoner = 0; + KroshFirehand = 0; + Maulgar = 0; + + MaulgarDoor = 0; + GruulDoor = 0; + } + + bool IsEncounterInProgress() const + { + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) return true; + + return false; + } + + void OnCreatureCreate(Creature* pCreature, bool add) + { + switch(pCreature->GetEntry()) + { + case 18835: KigglerTheCrazed = pCreature->GetGUID(); break; + case 18836: BlindeyeTheSeer = pCreature->GetGUID(); break; + case 18834: OlmTheSummoner = pCreature->GetGUID(); break; + case 18832: KroshFirehand = pCreature->GetGUID(); break; + case 18831: Maulgar = pCreature->GetGUID(); break; + } + } + + void OnGameObjectCreate(GameObject* pGo, bool add) + { + switch(pGo->GetEntry()) + { + case 184468: + MaulgarDoor = pGo->GetGUID(); + if (m_auiEncounter[0] == DONE) HandleGameObject(NULL, true, pGo); + break; + case 184662: GruulDoor = pGo->GetGUID(); break; + } + } + + void SetData64(uint32 type, uint64 data) + { + if (type == DATA_MAULGAREVENT_TANK) + MaulgarEvent_Tank = data; + } + + uint64 GetData64(uint32 identifier) + { + switch(identifier) + { + case DATA_MAULGAREVENT_TANK: return MaulgarEvent_Tank; + case DATA_KIGGLERTHECRAZED: return KigglerTheCrazed; + case DATA_BLINDEYETHESEER: return BlindeyeTheSeer; + case DATA_OLMTHESUMMONER: return OlmTheSummoner; + case DATA_KROSHFIREHAND: return KroshFirehand; + case DATA_MAULGARDOOR: return MaulgarDoor; + case DATA_GRUULDOOR: return GruulDoor; + case DATA_MAULGAR: return Maulgar; + } + return 0; + } + + void SetData(uint32 type, uint32 data) + { + switch(type) + { + case DATA_MAULGAREVENT: + if (data == DONE) HandleGameObject(MaulgarDoor, true); + m_auiEncounter[0] = data; break; + case DATA_GRUULEVENT: + if (data == IN_PROGRESS) HandleGameObject(GruulDoor, false); + else HandleGameObject(GruulDoor, true); + m_auiEncounter[1] = data; break; + } + + if (data == DONE) + SaveToDB(); + } + + uint32 GetData(uint32 type) + { + switch(type) + { + case DATA_MAULGAREVENT: return m_auiEncounter[0]; + case DATA_GRUULEVENT: return m_auiEncounter[1]; + } + return 0; + } + + std::string GetSaveData() + { + OUT_SAVE_INST_DATA; + std::ostringstream stream; + stream << m_auiEncounter[0] << " " << m_auiEncounter[1]; + char* out = new char[stream.str().length() + 1]; + strcpy(out, stream.str().c_str()); + if (out) + { + OUT_SAVE_INST_DATA_COMPLETE; + return out; + } + + return NULL; + } + + void Load(const char* in) + { + if (!in) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(in); + std::istringstream stream(in); + stream >> m_auiEncounter[0] >> m_auiEncounter[1]; + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) // Do not load an encounter as "In Progress" - reset it instead. + m_auiEncounter[i] = NOT_STARTED; + OUT_LOAD_INST_DATA_COMPLETE; + } +}; + +InstanceData* GetInstanceData_instance_gruuls_lair(Map* pMap) +{ + return new instance_gruuls_lair(pMap); +} + +void AddSC_instance_gruuls_lair() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_gruuls_lair"; + newscript->GetInstanceData = &GetInstanceData_instance_gruuls_lair; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/hellfire_citadel/blood_furnace/boss_broggok.cpp b/src/bindings/scripts/scripts/outland/hellfire_citadel/blood_furnace/boss_broggok.cpp new file mode 100644 index 00000000000..6c877602426 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/hellfire_citadel/blood_furnace/boss_broggok.cpp @@ -0,0 +1,131 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Broggok +SD%Complete: 70 +SDComment: pre-event not made +SDCategory: Hellfire Citadel, Blood Furnace +EndScriptData */ + +#include "precompiled.h" +#include "def_blood_furnace.h" + +enum +{ + SAY_AGGRO = -1542008, + + SPELL_SLIME_SPRAY = 30913, + SPELL_POISON_CLOUD = 30916, + SPELL_POISON_BOLT = 30917, + + SPELL_POISON = 30914 +}; + +struct TRINITY_DLL_DECL boss_broggokAI : public ScriptedAI +{ + boss_broggokAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + uint32 AcidSpray_Timer; + uint32 PoisonSpawn_Timer; + uint32 PoisonBolt_Timer; + + void Reset() + { + AcidSpray_Timer = 10000; + PoisonSpawn_Timer = 5000; + PoisonBolt_Timer = 7000; + if (pInstance) + { + pInstance->SetData(TYPE_BROGGOK_EVENT, NOT_STARTED); + pInstance->HandleGameObject(pInstance->GetData64(DATA_DOOR4), true); + } + } + + void EnterCombat(Unit *who) + { + DoScriptText(SAY_AGGRO, m_creature); + if (pInstance) + { + pInstance->SetData(TYPE_BROGGOK_EVENT, IN_PROGRESS); + pInstance->HandleGameObject(pInstance->GetData64(DATA_DOOR4), false); + } + } + + void JustSummoned(Creature *summoned) + { + summoned->setFaction(16); + summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + summoned->CastSpell(summoned,SPELL_POISON,false,0,0,m_creature->GetGUID()); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (AcidSpray_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_SLIME_SPRAY); + AcidSpray_Timer = 4000+rand()%8000; + }else AcidSpray_Timer -=diff; + + if (PoisonBolt_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_POISON_BOLT); + PoisonBolt_Timer = 4000+rand()%8000; + }else PoisonBolt_Timer -=diff; + + if (PoisonSpawn_Timer < diff) + { + DoCast(m_creature,SPELL_POISON_CLOUD); + PoisonSpawn_Timer = 20000; + }else PoisonSpawn_Timer -=diff; + + DoMeleeAttackIfReady(); + } + + void JustDied(Unit* who) + { + if (pInstance) + { + pInstance->HandleGameObject(pInstance->GetData64(DATA_DOOR4), true); + pInstance->HandleGameObject(pInstance->GetData64(DATA_DOOR5), true); + pInstance->SetData(TYPE_BROGGOK_EVENT, DONE); + } + } + +}; + +CreatureAI* GetAI_boss_broggok(Creature* pCreature) +{ + return new boss_broggokAI (pCreature); +} + +void AddSC_boss_broggok() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_broggok"; + newscript->GetAI = &GetAI_boss_broggok; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/outland/hellfire_citadel/blood_furnace/boss_kelidan_the_breaker.cpp b/src/bindings/scripts/scripts/outland/hellfire_citadel/blood_furnace/boss_kelidan_the_breaker.cpp new file mode 100644 index 00000000000..097a1f21a0d --- /dev/null +++ b/src/bindings/scripts/scripts/outland/hellfire_citadel/blood_furnace/boss_kelidan_the_breaker.cpp @@ -0,0 +1,378 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Kelidan_The_Breaker +SD%Complete: 100 +SDComment: +SDCategory: Hellfire Citadel, Blood Furnace +EndScriptData */ + +/* ContentData +boss_kelidan_the_breaker +mob_shadowmoon_channeler +EndContentData */ + +#include "precompiled.h" +#include "def_blood_furnace.h" + +enum +{ + SAY_WAKE = -1542000, + SAY_ADD_AGGRO_1 = -1542001, + SAY_ADD_AGGRO_2 = -1542002, + SAY_ADD_AGGRO_3 = -1542003, + SAY_KILL_1 = -1542004, + SAY_KILL_2 = -1542005, + SAY_NOVA = -1542006, + SAY_DIE = -1542007, + + SPELL_CORRUPTION = 30938, + SPELL_EVOCATION = 30935, + + SPELL_FIRE_NOVA = 33132, + H_SPELL_FIRE_NOVA = 37371, + + SPELL_SHADOW_BOLT_VOLLEY = 28599, + H_SPELL_SHADOW_BOLT_VOLLEY = 40070, + + SPELL_BURNING_NOVA = 30940, + SPELL_VORTEX = 37370, + + ENTRY_KELIDAN = 17377, + ENTRY_CHANNELER = 17653 +}; + +const float ShadowmoonChannelers[5][4]= +{ + {302,-87,-24.4,0.157}, + {321,-63.5,-24.6,4.887}, + {346,-74.5,-24.6,3.595}, + {344,-103.5,-24.5,2.356}, + {316,-109,-24.6,1.257} +}; + +struct TRINITY_DLL_DECL boss_kelidan_the_breakerAI : public ScriptedAI +{ + boss_kelidan_the_breakerAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + HeroicMode = c->GetMap()->IsHeroic(); + for(uint8 i=0; i<5; ++i) + Channelers[i] = 0; + } + + ScriptedInstance* pInstance; + bool HeroicMode; + + uint32 ShadowVolley_Timer; + uint32 BurningNova_Timer; + uint32 Firenova_Timer; + uint32 Corruption_Timer; + uint32 check_Timer; + bool Firenova; + bool addYell; + uint64 Channelers[5]; + + void Reset() + { + ShadowVolley_Timer = 1000; + BurningNova_Timer = 15000; + Corruption_Timer = 5000; + check_Timer = 0; + Firenova = false; + addYell = false; + SummonChannelers(); + if (pInstance) + pInstance->SetData(TYPE_KELIDAN_THE_BREAKER_EVENT, NOT_STARTED); + } + + void EnterCombat(Unit *who) + { + DoScriptText(SAY_WAKE, m_creature); + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(true); + DoStartMovement(who); + if (pInstance) + pInstance->SetData(TYPE_KELIDAN_THE_BREAKER_EVENT, IN_PROGRESS); + } + + void KilledUnit(Unit* victim) + { + if (rand()%2) + return; + + switch(rand()%2) + { + case 0: DoScriptText(SAY_KILL_1, m_creature); break; + case 1: DoScriptText(SAY_KILL_2, m_creature); break; + } + } + + void ChannelerEngaged(Unit* who) + { + if (who && !addYell) + { + addYell = true; + switch(rand()%3) + { + case 0: DoScriptText(SAY_ADD_AGGRO_1, m_creature); break; + case 1: DoScriptText(SAY_ADD_AGGRO_2, m_creature); break; + default: DoScriptText(SAY_ADD_AGGRO_3, m_creature); break; + } + } + for(uint8 i=0; i<5; ++i) + { + Creature *channeler = Unit::GetCreature(*m_creature, Channelers[i]); + if (who && channeler && !channeler->isInCombat()) + channeler->AI()->AttackStart(who); + } + } + + void ChannelerDied(Unit* killer) + { + for(uint8 i=0; i<5; ++i) + { + Creature *channeler = Unit::GetCreature(*m_creature, Channelers[i]); + if (channeler && channeler->isAlive()) + return; + } + + if (killer) + m_creature->AI()->AttackStart(killer); + } + + uint64 GetChanneled(Creature *channeler1) + { + SummonChannelers(); + if (!channeler1) return NULL; + uint8 i; + for(i=0; i<5; ++i) + { + Creature *channeler = Unit::GetCreature(*m_creature, Channelers[i]); + if (channeler && channeler->GetGUID() == channeler1->GetGUID()) + break; + } + return Channelers[(i+2)%5]; + } + + void SummonChannelers() + { + for(uint8 i=0; i<5; ++i) + { + Creature *channeler = Unit::GetCreature(*m_creature, Channelers[i]); + if (!channeler || channeler->isDead()) + channeler = m_creature->SummonCreature(ENTRY_CHANNELER,ShadowmoonChannelers[i][0],ShadowmoonChannelers[i][1],ShadowmoonChannelers[i][2],ShadowmoonChannelers[i][3],TEMPSUMMON_CORPSE_TIMED_DESPAWN,300000); + if (channeler) + Channelers[i] = channeler->GetGUID(); + else + Channelers[i] = 0; + } + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DIE, m_creature); + + if (!pInstance) + return; + + pInstance->SetData(TYPE_KELIDAN_THE_BREAKER_EVENT, DONE); + pInstance->HandleGameObject(pInstance->GetData64(DATA_DOOR1), true); + pInstance->HandleGameObject(pInstance->GetData64(DATA_DOOR6), true); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + { + if (check_Timer < diff) + { + if (!m_creature->IsNonMeleeSpellCasted(false)) + DoCast(m_creature,SPELL_EVOCATION); + check_Timer = 5000; + }else check_Timer -= diff; + return; + } + + if (Firenova) + { + if (Firenova_Timer < diff) + { + DoCast(m_creature,HeroicMode ? H_SPELL_FIRE_NOVA : SPELL_FIRE_NOVA,true); + Firenova = false; + ShadowVolley_Timer = 2000; + }else Firenova_Timer -=diff; + + return; + } + + if (ShadowVolley_Timer < diff) + { + DoCast(m_creature,HeroicMode ? H_SPELL_SHADOW_BOLT_VOLLEY : SPELL_SHADOW_BOLT_VOLLEY); + ShadowVolley_Timer = 5000+rand()%8000; + }else ShadowVolley_Timer -=diff; + + if (Corruption_Timer < diff) + { + DoCast(m_creature,SPELL_CORRUPTION); + Corruption_Timer = 30000+rand()%20000; + }else Corruption_Timer -=diff; + + if (BurningNova_Timer < diff) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(true); + + DoScriptText(SAY_NOVA, m_creature); + + if (SpellEntry *nova = GET_SPELL(SPELL_BURNING_NOVA)) + { + uint8 eff_mask=0; + for (int i=0; i<3; ++i) + { + if (!nova->Effect[i]) + continue; + eff_mask|=1<AddAura(new Aura(nova, eff_mask, NULL, m_creature, m_creature)); + } + + if (HeroicMode) + DoTeleportAll(m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ(),m_creature->GetOrientation()); + + BurningNova_Timer = 20000+rand()%8000; + Firenova_Timer= 5000; + Firenova = true; + }else BurningNova_Timer -=diff; + + DoMeleeAttackIfReady(); + } + +}; + +CreatureAI* GetAI_boss_kelidan_the_breaker(Creature* pCreature) +{ + return new boss_kelidan_the_breakerAI (pCreature); +} + +/*###### +## mob_shadowmoon_channeler +######*/ + +enum +{ + SPELL_SHADOW_BOLT = 12739, + H_SPELL_SHADOW_BOLT = 15472, + + SPELL_MARK_OF_SHADOW = 30937, + SPELL_CHANNELING = 39123 +}; + +struct TRINITY_DLL_DECL mob_shadowmoon_channelerAI : public ScriptedAI +{ + mob_shadowmoon_channelerAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + HeroicMode = c->GetMap()->IsHeroic(); + } + + ScriptedInstance* pInstance; + bool HeroicMode; + + uint32 ShadowBolt_Timer; + uint32 MarkOfShadow_Timer; + uint32 check_Timer; + + void Reset() + { + ShadowBolt_Timer = 1000+rand()%1000; + MarkOfShadow_Timer = 5000+rand()%2000; + check_Timer = 0; + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(true); + } + + void EnterCombat(Unit* who) + { + if (Creature *Kelidan = me->FindNearestCreature(ENTRY_KELIDAN, 100)) + CAST_AI(boss_kelidan_the_breakerAI, Kelidan->AI())->ChannelerEngaged(who); + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(true); + DoStartMovement(who); + } + + void JustDied(Unit* Killer) + { + if (Creature *Kelidan = me->FindNearestCreature(ENTRY_KELIDAN, 100)) + CAST_AI(boss_kelidan_the_breakerAI, Kelidan->AI())->ChannelerDied(Killer); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + { + if (check_Timer < diff) + { + if (!m_creature->IsNonMeleeSpellCasted(false)) + if (Creature *Kelidan = me->FindNearestCreature(ENTRY_KELIDAN, 100)) + { + uint64 channeler = CAST_AI(boss_kelidan_the_breakerAI, Kelidan->AI())->GetChanneled(m_creature); + if (Unit *channeled = Unit::GetUnit(*m_creature, channeler)) + DoCast(channeled,SPELL_CHANNELING); + } + check_Timer = 5000; + }else check_Timer -= diff; + return; + } + + if (MarkOfShadow_Timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + DoCast(target,SPELL_MARK_OF_SHADOW); + MarkOfShadow_Timer = 15000+rand()%5000; + }else MarkOfShadow_Timer -=diff; + + if (ShadowBolt_Timer < diff) + { + DoCast(m_creature->getVictim(),HeroicMode ? H_SPELL_SHADOW_BOLT : SPELL_SHADOW_BOLT); + ShadowBolt_Timer = 5000+rand()%1000; + }else ShadowBolt_Timer -=diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_shadowmoon_channeler(Creature* pCreature) +{ + return new mob_shadowmoon_channelerAI (pCreature); +} + +void AddSC_boss_kelidan_the_breaker() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_kelidan_the_breaker"; + newscript->GetAI = &GetAI_boss_kelidan_the_breaker; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_shadowmoon_channeler"; + newscript->GetAI = &GetAI_mob_shadowmoon_channeler; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/hellfire_citadel/blood_furnace/boss_the_maker.cpp b/src/bindings/scripts/scripts/outland/hellfire_citadel/blood_furnace/boss_the_maker.cpp new file mode 100644 index 00000000000..9902c505b6b --- /dev/null +++ b/src/bindings/scripts/scripts/outland/hellfire_citadel/blood_furnace/boss_the_maker.cpp @@ -0,0 +1,162 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_The_Maker +SD%Complete: 80 +SDComment: Mind control no support +SDCategory: Hellfire Citadel, Blood Furnace +EndScriptData */ + +#include "precompiled.h" +#include "def_blood_furnace.h" + +enum +{ + SAY_AGGRO_1 = -1542009, + SAY_AGGRO_2 = -1542010, + SAY_AGGRO_3 = -1542011, + SAY_KILL_1 = -1542012, + SAY_KILL_2 = -1542013, + SAY_DIE = -1542014, + + SPELL_ACID_SPRAY = 38153, // heroic 38973 ??? 38153 + SPELL_EXPLODING_BREAKER = 30925, + SPELL_KNOCKDOWN = 20276, + SPELL_DOMINATION = 25772 // ??? +}; + +struct TRINITY_DLL_DECL boss_the_makerAI : public ScriptedAI +{ + boss_the_makerAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + uint32 AcidSpray_Timer; + uint32 ExplodingBreaker_Timer; + uint32 Domination_Timer; + uint32 Knockdown_Timer; + + void Reset() + { + AcidSpray_Timer = 15000; + ExplodingBreaker_Timer = 6000; + Domination_Timer = 120000; + Knockdown_Timer = 10000; + + if (!pInstance) + return; + + pInstance->SetData(TYPE_THE_MAKER_EVENT, NOT_STARTED); + pInstance->HandleGameObject(pInstance->GetData64(DATA_DOOR2), true); + } + + void EnterCombat(Unit *who) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; + } + + if (!pInstance) + return; + + pInstance->SetData(TYPE_THE_MAKER_EVENT, IN_PROGRESS); + pInstance->HandleGameObject(pInstance->GetData64(DATA_DOOR2), false); + } + + void KilledUnit(Unit* victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_KILL_1, m_creature); break; + case 1: DoScriptText(SAY_KILL_2, m_creature); break; + } + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DIE, m_creature); + + if (!pInstance) + return; + + pInstance->SetData(TYPE_THE_MAKER_EVENT, DONE); + pInstance->HandleGameObject(pInstance->GetData64(DATA_DOOR2), true); + pInstance->HandleGameObject(pInstance->GetData64(DATA_DOOR3), true); + + + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (AcidSpray_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_ACID_SPRAY); + AcidSpray_Timer = 15000+rand()%8000; + }else AcidSpray_Timer -=diff; + + if (ExplodingBreaker_Timer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_EXPLODING_BREAKER); + ExplodingBreaker_Timer = 4000+rand()%8000; + }else ExplodingBreaker_Timer -=diff; + + /* // Disabled until Core Support for mind control + if (domination_timer_timer < diff) + { + Unit* target; + target = SelectUnit(SELECT_TARGET_RANDOM,0); + + DoCast(target,SPELL_DOMINATION); + + domination_timer = 120000; + }else domination_timer -=diff; + */ + + if (Knockdown_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_KNOCKDOWN); + Knockdown_Timer = 4000+rand()%8000; + }else Knockdown_Timer -=diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_the_makerAI(Creature* pCreature) +{ + return new boss_the_makerAI (pCreature); +} + +void AddSC_boss_the_maker() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_the_maker"; + newscript->GetAI = &GetAI_boss_the_makerAI; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/hellfire_citadel/blood_furnace/def_blood_furnace.h b/src/bindings/scripts/scripts/outland/hellfire_citadel/blood_furnace/def_blood_furnace.h new file mode 100644 index 00000000000..b845c66823f --- /dev/null +++ b/src/bindings/scripts/scripts/outland/hellfire_citadel/blood_furnace/def_blood_furnace.h @@ -0,0 +1,29 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_BLOOD_FURNACE_H +#define DEF_BLOOD_FURNACE_H + +#define DATA_THE_MAKER 1 +#define DATA_BROGGOK 2 +#define DATA_KELIDAN_THE_MAKER 3 +#define TYPE_THE_MAKER_EVENT 4 +#define TYPE_BROGGOK_EVENT 5 +#define TYPE_KELIDAN_THE_BREAKER_EVENT 6 +#define DATA_DOOR1 7 +#define DATA_DOOR2 8 +#define DATA_DOOR3 9 +#define DATA_DOOR4 10 +#define DATA_DOOR5 11 +#define DATA_DOOR6 12 +#define DATA_PRISON_CELL1 13 +#define DATA_PRISON_CELL2 14 +#define DATA_PRISON_CELL3 15 +#define DATA_PRISON_CELL4 16 +#define DATA_PRISON_CELL5 17 +#define DATA_PRISON_CELL6 18 +#define DATA_PRISON_CELL7 19 +#define DATA_PRISON_CELL8 20 +#endif + diff --git a/src/bindings/scripts/scripts/outland/hellfire_citadel/blood_furnace/instance_blood_furnace.cpp b/src/bindings/scripts/scripts/outland/hellfire_citadel/blood_furnace/instance_blood_furnace.cpp new file mode 100644 index 00000000000..5a18ded0c08 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/hellfire_citadel/blood_furnace/instance_blood_furnace.cpp @@ -0,0 +1,234 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Blood_Furnace +SD%Complete: 85 +SDComment: +SDCategory: Hellfire Citadel, Blood Furnace +EndScriptData */ + +#include "precompiled.h" +#include "def_blood_furnace.h" + +#define ENTRY_SEWER1 181823 +#define ENTRY_SEWER2 181766 +#define MAX_ENCOUNTER 3 + +struct TRINITY_DLL_DECL instance_blood_furnace : public ScriptedInstance +{ + instance_blood_furnace(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint64 The_MakerGUID; + uint64 BroggokGUID; + uint64 Kelidan_The_BreakerGUID; + + uint64 Door1GUID; + uint64 Door2GUID; + uint64 Door3GUID; + uint64 Door4GUID; + uint64 Door5GUID; + uint64 Door6GUID; + + uint64 PrisonCell1GUID; + uint64 PrisonCell2GUID; + uint64 PrisonCell3GUID; + uint64 PrisonCell4GUID; + uint64 PrisonCell5GUID; + uint64 PrisonCell6GUID; + uint64 PrisonCell7GUID; + uint64 PrisonCell8GUID; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + std::string str_data; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + The_MakerGUID = 0; + BroggokGUID = 0; + Kelidan_The_BreakerGUID = 0; + + Door1GUID = 0; + Door2GUID = 0; + Door3GUID = 0; + Door4GUID = 0; + Door5GUID = 0; + Door6GUID = 0; + + PrisonCell1GUID = 0; + PrisonCell2GUID = 0; + PrisonCell3GUID = 0; + PrisonCell4GUID = 0; + PrisonCell5GUID = 0; + PrisonCell6GUID = 0; + PrisonCell7GUID = 0; + PrisonCell8GUID = 0; + } + + + void OnCreatureCreate(Creature* pCreature, bool add) + { + if (!add) + return; + + switch(pCreature->GetEntry()) + { + case 17381: The_MakerGUID = pCreature->GetGUID(); break; + case 17380: BroggokGUID = pCreature->GetGUID(); break; + case 17377: Kelidan_The_BreakerGUID = pCreature->GetGUID(); break; + } + } + + void OnGameObjectCreate(GameObject* pGo, bool add) + { + if (!add) + return; + + if (pGo->GetEntry() == 181766) //Final exit door + Door1GUID = pGo->GetGUID(); + if (pGo->GetEntry() == 181811) //The Maker Front door + Door2GUID = pGo->GetGUID(); + if (pGo->GetEntry() == 181812) //The Maker Rear door + Door3GUID = pGo->GetGUID(); + if (pGo->GetEntry() == 181822) //Broggok Front door + Door4GUID = pGo->GetGUID(); + if (pGo->GetEntry() == 181819) //Broggok Rear door + Door5GUID = pGo->GetGUID(); + if (pGo->GetEntry() == 181823) //Kelidan exit door + Door6GUID = pGo->GetGUID(); + + if (pGo->GetEntry() == 181813) //The Maker prison cell front right + PrisonCell1GUID = pGo->GetGUID(); + if (pGo->GetEntry() == 181814) //The Maker prison cell back right + PrisonCell2GUID = pGo->GetGUID(); + if (pGo->GetEntry() == 181816) //The Maker prison cell front left + PrisonCell3GUID = pGo->GetGUID(); + if (pGo->GetEntry() == 181815) //The Maker prison cell back left + PrisonCell4GUID = pGo->GetGUID(); + if (pGo->GetEntry() == 181821) //Broggok prison cell front right + PrisonCell5GUID = pGo->GetGUID(); + if (pGo->GetEntry() == 181818) //Broggok prison cell back right + PrisonCell6GUID = pGo->GetGUID(); + if (pGo->GetEntry() == 181820) //Broggok prison cell front left + PrisonCell7GUID = pGo->GetGUID(); + if (pGo->GetEntry() == 181817) //Broggok prison cell back left + PrisonCell8GUID = pGo->GetGUID(); + } + + uint64 GetData64(uint32 data) + { + switch(data) + { + case DATA_THE_MAKER: return The_MakerGUID; + case DATA_BROGGOK: return BroggokGUID; + case DATA_KELIDAN_THE_MAKER: return Kelidan_The_BreakerGUID; + case DATA_DOOR1: return Door1GUID; + case DATA_DOOR2: return Door2GUID; + case DATA_DOOR3: return Door3GUID; + case DATA_DOOR4: return Door4GUID; + case DATA_DOOR5: return Door5GUID; + case DATA_DOOR6: return Door6GUID; + case DATA_PRISON_CELL1: return PrisonCell1GUID; + case DATA_PRISON_CELL2: return PrisonCell2GUID; + case DATA_PRISON_CELL3: return PrisonCell3GUID; + case DATA_PRISON_CELL4: return PrisonCell4GUID; + case DATA_PRISON_CELL5: return PrisonCell5GUID; + case DATA_PRISON_CELL6: return PrisonCell6GUID; + case DATA_PRISON_CELL7: return PrisonCell7GUID; + case DATA_PRISON_CELL8: return PrisonCell8GUID; + } + + return 0; + } + + void SetData(uint32 type, uint32 data) + { + switch(data) + { + case TYPE_THE_MAKER_EVENT: m_auiEncounter[0] = data; break; + case TYPE_BROGGOK_EVENT: m_auiEncounter[1] = data; break; + case TYPE_KELIDAN_THE_BREAKER_EVENT: m_auiEncounter[2] = data; break; + } + + if (data == DONE) + { + OUT_SAVE_INST_DATA; + + std::ostringstream saveStream; + saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2]; + + str_data = saveStream.str(); + + SaveToDB(); + OUT_SAVE_INST_DATA_COMPLETE; + } + } + + uint32 GetData(uint32 data) + { + switch(data) + { + case TYPE_THE_MAKER_EVENT: return m_auiEncounter[0]; + case TYPE_BROGGOK_EVENT: return m_auiEncounter[1]; + case TYPE_KELIDAN_THE_BREAKER_EVENT: return m_auiEncounter[2]; + } + + return 0; + } + + const char* Save() + { + return str_data.c_str(); + } + + void Load(const char* in) + { + if (!in) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(in); + + std::istringstream loadStream(in); + loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2]; + + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS || m_auiEncounter[i] == FAIL) + m_auiEncounter[i] = NOT_STARTED; + + OUT_LOAD_INST_DATA_COMPLETE; + } +}; + + +InstanceData* GetInstanceData_instance_blood_furnace(Map* pMap) +{ + return new instance_blood_furnace(pMap); +} + +void AddSC_instance_blood_furnace() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_blood_furnace"; + newscript->GetInstanceData = &GetInstanceData_instance_blood_furnace; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/hellfire_citadel/hellfire_ramparts/boss_omor_the_unscarred.cpp b/src/bindings/scripts/scripts/outland/hellfire_citadel/hellfire_ramparts/boss_omor_the_unscarred.cpp new file mode 100644 index 00000000000..e7411187e86 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/hellfire_citadel/hellfire_ramparts/boss_omor_the_unscarred.cpp @@ -0,0 +1,214 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Omar_The_Unscarred +SD%Complete: 90 +SDComment: Temporary solution for orbital/shadow whip-ability. Needs more core support before making it more proper. +SDCategory: Hellfire Citadel, Hellfire Ramparts +EndScriptData */ + +#include "precompiled.h" + +#define SAY_AGGRO_1 -1543009 +#define SAY_AGGRO_2 -1543010 +#define SAY_AGGRO_3 -1543011 +#define SAY_SUMMON -1543012 +#define SAY_CURSE -1543013 +#define SAY_KILL_1 -1543014 +#define SAY_DIE -1543015 +#define SAY_WIPE -1543016 + +#define SPELL_ORBITAL_STRIKE 30637 +#define SPELL_SHADOW_WHIP 30638 +#define SPELL_TREACHEROUS_AURA 30695 +#define H_SPELL_BANE_OF_TREACHERY 37566 +#define SPELL_DEMONIC_SHIELD 31901 +#define SPELL_SHADOW_BOLT 30686 +#define H_SPELL_SHADOW_BOLT 39297 +#define SPELL_SUMMON_FIENDISH_HOUND 30707 + +struct TRINITY_DLL_DECL boss_omor_the_unscarredAI : public ScriptedAI +{ + boss_omor_the_unscarredAI(Creature *c) : ScriptedAI(c) + { + SetCombatMovement(false); + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + bool HeroicMode; + + uint32 OrbitalStrike_Timer; + uint32 ShadowWhip_Timer; + uint32 Aura_Timer; + uint32 DemonicShield_Timer; + uint32 Shadowbolt_Timer; + uint32 Summon_Timer; + uint32 SummonedCount; + uint64 PlayerGUID; + bool CanPullBack; + + void Reset() + { + DoScriptText(SAY_WIPE, m_creature); + + OrbitalStrike_Timer = 25000; + ShadowWhip_Timer = 2000; + Aura_Timer = 10000; + DemonicShield_Timer = 1000; + Shadowbolt_Timer = 2000; + Summon_Timer = 10000; + SummonedCount = 0; + PlayerGUID = 0; + CanPullBack = false; + } + + void EnterCombat(Unit *who) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; + } + } + + void KilledUnit(Unit* victim) + { + if (rand()%2) + return; + + DoScriptText(SAY_KILL_1, m_creature); + } + + void JustSummoned(Creature* summoned) + { + DoScriptText(SAY_SUMMON, m_creature); + + if (Unit* random = SelectUnit(SELECT_TARGET_RANDOM,0)) + summoned->AI()->AttackStart(random); + + ++SummonedCount; + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DIE, m_creature); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + //only two may be wrong, perhaps increase timer and spawn periodically instead. + if (SummonedCount < 2) + { + if (Summon_Timer < diff) + { + m_creature->InterruptNonMeleeSpells(false); + DoCast(m_creature,SPELL_SUMMON_FIENDISH_HOUND); + Summon_Timer = 15000+rand()%15000; + }else Summon_Timer -= diff; + } + + if (CanPullBack) + { + if (ShadowWhip_Timer < diff) + { + if (Player* temp = Unit::GetPlayer(PlayerGUID)) + { + //if unit dosen't have this flag, then no pulling back (script will attempt cast, even if orbital strike was resisted) + if (temp->HasUnitMovementFlag(MOVEMENTFLAG_FALLING)) + { + m_creature->InterruptNonMeleeSpells(false); + DoCast(temp,SPELL_SHADOW_WHIP); + } + } + PlayerGUID = 0; + ShadowWhip_Timer = 2000; + CanPullBack = false; + }else ShadowWhip_Timer -= diff; + } + else if (OrbitalStrike_Timer < diff) + { + Unit* temp = NULL; + if (m_creature->IsWithinMeleeRange(m_creature->getVictim())) + temp = m_creature->getVictim(); + else temp = SelectUnit(SELECT_TARGET_RANDOM,0); + + if (temp && temp->GetTypeId() == TYPEID_PLAYER) + { + DoCast(temp,SPELL_ORBITAL_STRIKE); + OrbitalStrike_Timer = 14000+rand()%2000; + PlayerGUID = temp->GetGUID(); + + if (PlayerGUID) + CanPullBack = true; + } + }else OrbitalStrike_Timer -= diff; + + if ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 20) + { + if (DemonicShield_Timer < diff) + { + DoCast(m_creature,SPELL_DEMONIC_SHIELD); + DemonicShield_Timer = 15000; + }else DemonicShield_Timer -= diff; + } + + if (Aura_Timer < diff) + { + DoScriptText(SAY_CURSE, m_creature); + + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) + { + DoCast(target,HeroicMode ? H_SPELL_BANE_OF_TREACHERY : SPELL_TREACHEROUS_AURA); + Aura_Timer = 8000+rand()%8000; + } + }else Aura_Timer -= diff; + + if (Shadowbolt_Timer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) + { + if (target) + target = m_creature->getVictim(); + + DoCast(target,HeroicMode ? H_SPELL_SHADOW_BOLT : SPELL_SHADOW_BOLT); + Shadowbolt_Timer = 4000+rand()%2500; + } + }else Shadowbolt_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_omor_the_unscarredAI(Creature* pCreature) +{ + return new boss_omor_the_unscarredAI (pCreature); +} + +void AddSC_boss_omor_the_unscarred() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_omor_the_unscarred"; + newscript->GetAI = &GetAI_boss_omor_the_unscarredAI; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/hellfire_citadel/hellfire_ramparts/boss_vazruden_the_herald.cpp b/src/bindings/scripts/scripts/outland/hellfire_citadel/hellfire_ramparts/boss_vazruden_the_herald.cpp new file mode 100644 index 00000000000..98aa4627be2 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/hellfire_citadel/hellfire_ramparts/boss_vazruden_the_herald.cpp @@ -0,0 +1,490 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +Name: Boss_Vazruden_the_Herald +%Complete: 90 +Comment: +Category: Hellfire Citadel, Hellfire Ramparts +EndScriptData */ + +#include "precompiled.h" + +#define SPELL_FIREBALL (HeroicMode?36920:34653) +#define SPELL_CONE_OF_FIRE (HeroicMode?36921:30926) +#define SPELL_SUMMON_LIQUID_FIRE (HeroicMode?30928:23971) +#define SPELL_BELLOWING_ROAR 39427 +#define SPELL_REVENGE (HeroicMode?40392:19130) +#define SPELL_KIDNEY_SHOT 30621 +#define SPELL_FIRE_NOVA_VISUAL 19823 + +#define ENTRY_HELLFIRE_SENTRY 17517 +#define ENTRY_VAZRUDEN_HERALD 17307 +#define ENTRY_VAZRUDEN 17537 +#define ENTRY_NAZAN 17536 +#define ENTRY_LIQUID_FIRE 22515 +#define ENTRY_REINFORCED_FEL_IRON_CHEST (HeroicMode?185169:185168) + +#define SAY_INTRO -1543017 +#define SAY_WIPE -1543018 +#define SAY_AGGRO_1 -1543019 +#define SAY_AGGRO_2 -1543020 +#define SAY_AGGRO_3 -1543021 +#define SAY_KILL_1 -1543022 +#define SAY_KILL_2 -1543023 +#define SAY_DIE -1543024 +#define EMOTE -1543025 + +#define PATH_ENTRY 2081 + +const float VazrudenMiddle[3] = {-1406.5, 1746.5, 81.2}; +const float VazrudenRing[2][3] = +{ + {-1430, 1705, 112}, + {-1377, 1760, 112} +}; + +struct TRINITY_DLL_DECL boss_nazanAI : public ScriptedAI +{ + boss_nazanAI(Creature *c) : ScriptedAI(c) + { + HeroicMode = m_creature->GetMap()->IsHeroic(); + VazrudenGUID = 0; + flight = true; + } + + uint32 Fireball_Timer; + uint32 ConeOfFire_Timer; + uint32 BellowingRoar_Timer; + uint32 Fly_Timer; + uint32 Turn_Timer; + uint32 UnsummonCheck; + bool flight; + uint64 VazrudenGUID; + bool HeroicMode; + SpellEntry *liquid_fire; + + void Reset() + { + Fireball_Timer = 4000; + Fly_Timer = 45000; + Turn_Timer = 0; + UnsummonCheck = 5000; + } + + void EnterCombat(Unit* who) {} + + void JustSummoned(Creature *summoned) + { + if (summoned && summoned->GetEntry() == ENTRY_LIQUID_FIRE) + { + summoned->SetLevel(m_creature->getLevel()); + summoned->setFaction(m_creature->getFaction()); + summoned->CastSpell(summoned,SPELL_SUMMON_LIQUID_FIRE,true); + summoned->CastSpell(summoned,SPELL_FIRE_NOVA_VISUAL,true); + } + } + + void SpellHitTarget(Unit* target, const SpellEntry* entry) + { + if (target && entry->Id == SPELL_FIREBALL) + m_creature->SummonCreature(ENTRY_LIQUID_FIRE,target->GetPositionX(),target->GetPositionY(),target->GetPositionZ(),target->GetOrientation(),TEMPSUMMON_TIMED_DESPAWN,30000); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + { + if (UnsummonCheck < diff && m_creature->isAlive()) + { + m_creature->SetLootRecipient(NULL); + m_creature->SetVisibility(VISIBILITY_OFF); + m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + m_creature->RemoveCorpse(); + }else UnsummonCheck -= diff; + return; + } + + if (Fireball_Timer < diff) + { + if (Unit *victim = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(victim, SPELL_FIREBALL,true); + Fireball_Timer = 4000+rand()%3000; + }else Fireball_Timer -= diff; + + if (flight) // phase 1 - the flight + { + Creature *Vazruden = Unit::GetCreature(*m_creature,VazrudenGUID); + if (Fly_Timer < diff || !(Vazruden && Vazruden->isAlive() && (Vazruden->GetHealth()*5 > Vazruden->GetMaxHealth()))) + { + flight = false; + BellowingRoar_Timer = 6000; + ConeOfFire_Timer = 12000; + m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + m_creature->GetMotionMaster()->Clear(); + if (Unit *victim = SelectUnit(SELECT_TARGET_NEAREST,0)) + m_creature->AI()->AttackStart(victim); + DoStartMovement(m_creature->getVictim()); + DoScriptText(EMOTE, m_creature); + return; + }else Fly_Timer -= diff; + + if (Turn_Timer < diff) + { + uint32 waypoint = (Fly_Timer/10000)%2; + if (m_creature->IsWithinDist3d(VazrudenRing[waypoint][0],VazrudenRing[waypoint][1],VazrudenRing[waypoint][2], 5)) + m_creature->GetMotionMaster()->MovePoint(0,VazrudenRing[waypoint][0],VazrudenRing[waypoint][1],VazrudenRing[waypoint][2]); + Turn_Timer = 10000; + }else Turn_Timer -= diff; + } + else // phase 2 - land fight + { + if (ConeOfFire_Timer < diff) + { + DoCast(m_creature, SPELL_CONE_OF_FIRE); + ConeOfFire_Timer = 12000; + Fireball_Timer = 4000; + }else ConeOfFire_Timer -= diff; + + if (HeroicMode && BellowingRoar_Timer < diff) + { + DoCast(m_creature, SPELL_BELLOWING_ROAR); + BellowingRoar_Timer = 45000; + }else BellowingRoar_Timer -= diff; + + DoMeleeAttackIfReady(); + } + } +}; + +struct TRINITY_DLL_DECL boss_vazrudenAI : public ScriptedAI +{ + boss_vazrudenAI(Creature *c) : ScriptedAI(c) + { + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + uint32 Revenge_Timer; + bool HeroicMode; + bool WipeSaid; + uint32 UnsummonCheck; + + void Reset() + { + Revenge_Timer = 4000; + UnsummonCheck = 2000; + WipeSaid = false; + } + + void EnterCombat(Unit *who) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; + default: DoScriptText(SAY_AGGRO_3, m_creature); break; + } + } + + void KilledUnit(Unit* who) + { + if (who && who->GetEntry()!=ENTRY_VAZRUDEN) + switch(rand()%2) + { + case 0: DoScriptText(SAY_KILL_1, m_creature); break; + default: DoScriptText(SAY_KILL_2, m_creature); break; + } + } + + void JustDied(Unit* who) + { + if (who && who != m_creature) + DoScriptText(SAY_DIE, m_creature); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + { + if (UnsummonCheck < diff && m_creature->isAlive()) + { + if (!WipeSaid) + { + DoScriptText(SAY_WIPE, m_creature); + WipeSaid = true; + } + m_creature->SetLootRecipient(NULL); + m_creature->SetVisibility(VISIBILITY_OFF); + m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + m_creature->RemoveCorpse(); + }else UnsummonCheck -= diff; + return; + } + + if (Revenge_Timer < diff) + { + if (Unit *victim = m_creature->getVictim()) + DoCast(victim, SPELL_REVENGE); + Revenge_Timer = 5000; + }else Revenge_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +struct TRINITY_DLL_DECL boss_vazruden_the_heraldAI : public ScriptedAI +{ + boss_vazruden_the_heraldAI(Creature *c) : ScriptedAI(c) + { + summoned = false; + sentryDown = false; + NazanGUID = 0; + VazrudenGUID = 0; + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + uint32 phase; + uint32 waypoint; + uint32 check; + bool sentryDown; + uint64 NazanGUID; + uint64 VazrudenGUID; + bool summoned; + bool HeroicMode; + + void Reset() + { + phase = 0; + waypoint = 0; + check = 0; + UnsummonAdds(); + m_creature->GetMotionMaster()->MovePath(PATH_ENTRY, true); + } + + void UnsummonAdds() + { + if (summoned) + { + Creature *Nazan = Unit::GetCreature(*m_creature, NazanGUID); + Creature *Vazruden = Unit::GetCreature(*m_creature, VazrudenGUID); + if (Nazan || (Nazan = me->FindNearestCreature(ENTRY_NAZAN, 5000))) + { + Nazan->SetLootRecipient(NULL); + Nazan->SetVisibility(VISIBILITY_OFF); + Nazan->DealDamage(Nazan, Nazan->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + Nazan->RemoveCorpse(); + NazanGUID = 0; + } + if (Vazruden || (Vazruden = me->FindNearestCreature(ENTRY_VAZRUDEN, 5000))) + { + Vazruden->SetLootRecipient(NULL); + Vazruden->SetVisibility(VISIBILITY_OFF); + Vazruden->DealDamage(Vazruden, Vazruden->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + Vazruden->RemoveCorpse(); + VazrudenGUID = 0; + } + summoned = false; + m_creature->clearUnitState(UNIT_STAT_ROOT); + m_creature->SetVisibility(VISIBILITY_ON); + } + } + + void SummonAdds() + { + if (!summoned) + { + Creature* Vazruden = m_creature->SummonCreature(ENTRY_VAZRUDEN,VazrudenMiddle[0],VazrudenMiddle[1],VazrudenMiddle[2],0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,6000000); + if (Vazruden) + VazrudenGUID = Vazruden->GetGUID(); + Creature* Nazan = m_creature->SummonCreature(ENTRY_NAZAN,VazrudenMiddle[0],VazrudenMiddle[1],VazrudenMiddle[2],0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,6000000); + if (Nazan) + NazanGUID = Nazan->GetGUID(); + summoned = true; + m_creature->SetVisibility(VISIBILITY_OFF); + m_creature->addUnitState(UNIT_STAT_ROOT); + } + } + + void EnterCombat(Unit *who) + { + if (phase==0) + { + phase = 1; + check = 0; + DoScriptText(SAY_INTRO, m_creature); + } + } + + void JustSummoned(Creature *summoned) + { + if (!summoned) return; + Unit *victim = m_creature->getVictim(); + if (summoned->GetEntry() == ENTRY_NAZAN) + { + CAST_AI(boss_nazanAI, summoned->AI())->VazrudenGUID = VazrudenGUID; + summoned->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + summoned->SetSpeed(MOVE_FLIGHT, 2.5); + if (victim) + AttackStartNoMove(victim); + } + else if (victim) + summoned->AI()->AttackStart(victim); + } + + void SentryDownBy(Unit* killer) + { + if (sentryDown) + { + AttackStartNoMove(killer); + sentryDown = false; + } + else + sentryDown = true; + } + + void UpdateAI(const uint32 diff) + { + switch(phase) + { + case 0: // circle around the platform + return; + break; + case 1: // go to the middle and begin the fight + if (check < diff) + { + if (!m_creature->IsWithinDist3d(VazrudenMiddle[0],VazrudenMiddle[1],VazrudenMiddle[2],5)) + { + m_creature->GetMotionMaster()->Clear(); + m_creature->GetMotionMaster()->MovePoint(0,VazrudenMiddle[0],VazrudenMiddle[1],VazrudenMiddle[2]); + check = 1000; + } + else + { + SummonAdds(); + phase = 2; + return; + } + }else check -= diff; + break; + default: // adds do the job now + if (check < diff) + { + Creature *Nazan = Unit::GetCreature(*m_creature, NazanGUID); + Creature *Vazruden = Unit::GetCreature(*m_creature, VazrudenGUID); + if (Nazan && Nazan->isAlive() || Vazruden && Vazruden->isAlive()) + { + if (Nazan && Nazan->getVictim() || Vazruden && Vazruden->getVictim()) + return; + else + { + UnsummonAdds(); + EnterEvadeMode(); + return; + } + }else + { + m_creature->SummonGameObject(ENTRY_REINFORCED_FEL_IRON_CHEST,VazrudenMiddle[0],VazrudenMiddle[1],VazrudenMiddle[2],0,0,0,0,0,0); + m_creature->SetLootRecipient(NULL); + m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + } + check = 2000; + }else check -= diff; + break; + } + } +}; + +struct TRINITY_DLL_DECL mob_hellfire_sentryAI : public ScriptedAI +{ + mob_hellfire_sentryAI(Creature *c) : ScriptedAI(c) {} + + uint32 KidneyShot_Timer; + + void Reset() + { + KidneyShot_Timer = 3000+rand()%4000; + } + + void EnterCombat(Unit* who) {} + + void JustDied(Unit* who) + { + if (Creature *herald = me->FindNearestCreature(ENTRY_VAZRUDEN_HERALD,150)) + CAST_AI(boss_vazruden_the_heraldAI, herald->AI())->SentryDownBy(who); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (KidneyShot_Timer < diff) + { + if (Unit *victim = m_creature->getVictim()) + DoCast(victim, SPELL_KIDNEY_SHOT); + KidneyShot_Timer = 20000; + }else KidneyShot_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_vazruden_the_herald(Creature* pCreature) +{ + return new boss_vazruden_the_heraldAI (pCreature); +} + +CreatureAI* GetAI_boss_vazruden(Creature* pCreature) +{ + return new boss_vazrudenAI (pCreature); +} + + +CreatureAI* GetAI_boss_nazan(Creature* pCreature) +{ + return new boss_nazanAI (pCreature); +} + +CreatureAI* GetAI_mob_hellfire_sentry(Creature* pCreature) +{ + return new mob_hellfire_sentryAI (pCreature); +} + +void AddSC_boss_vazruden_the_herald() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_vazruden_the_herald"; + newscript->GetAI = &GetAI_boss_vazruden_the_herald; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="boss_vazruden"; + newscript->GetAI = &GetAI_boss_vazruden; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="boss_nazan"; + newscript->GetAI = &GetAI_boss_nazan; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_hellfire_sentry"; + newscript->GetAI = &GetAI_mob_hellfire_sentry; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/hellfire_citadel/hellfire_ramparts/boss_watchkeeper_gargolmar.cpp b/src/bindings/scripts/scripts/outland/hellfire_citadel/hellfire_ramparts/boss_watchkeeper_gargolmar.cpp new file mode 100644 index 00000000000..13059c55ff2 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/hellfire_citadel/hellfire_ramparts/boss_watchkeeper_gargolmar.cpp @@ -0,0 +1,168 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Watchkeeper_Gargolmar +SD%Complete: 80 +SDComment: Missing adds to heal him. Surge should be used on target furthest away, not random. +SDCategory: Hellfire Citadel, Hellfire Ramparts +EndScriptData */ + +#include "precompiled.h" + +#define SAY_TAUNT -1543000 +#define SAY_HEAL -1543001 +#define SAY_SURGE -1543002 +#define SAY_AGGRO_1 -1543003 +#define SAY_AGGRO_2 -1543004 +#define SAY_AGGRO_3 -1543005 +#define SAY_KILL_1 -1543006 +#define SAY_KILL_2 -1543007 +#define SAY_DIE -1543008 + +#define SPELL_MORTAL_WOUND 30641 +#define H_SPELL_MORTAL_WOUND 36814 +#define SPELL_SURGE 34645 +#define SPELL_RETALIATION 22857 + +struct TRINITY_DLL_DECL boss_watchkeeper_gargolmarAI : public ScriptedAI +{ + boss_watchkeeper_gargolmarAI(Creature *c) : ScriptedAI(c) + { + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + bool HeroicMode; + + uint32 Surge_Timer; + uint32 MortalWound_Timer; + uint32 Retaliation_Timer; + + bool HasTaunted; + bool YelledForHeal; + + void Reset() + { + Surge_Timer = 5000; + MortalWound_Timer = 4000; + Retaliation_Timer = 0; + + HasTaunted = false; + YelledForHeal = false; + } + + void EnterCombat(Unit *who) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; + } + } + + void MoveInLineOfSight(Unit* who) + { + if (!m_creature->getVictim() && who->isTargetableForAttack() && (m_creature->IsHostileTo(who)) && who->isInAccessiblePlaceFor(m_creature)) + { + if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) + return; + + float attackRadius = m_creature->GetAttackDistance(who); + if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who)) + { + //who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); + AttackStart(who); + } + else if (!HasTaunted && m_creature->IsWithinDistInMap(who, 60.0f)) + { + DoScriptText(SAY_TAUNT, m_creature); + HasTaunted = true; + } + } + } + + void KilledUnit(Unit* victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_KILL_1, m_creature); break; + case 1: DoScriptText(SAY_KILL_2, m_creature); break; + } + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DIE, m_creature); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (MortalWound_Timer < diff) + { + DoCast(m_creature->getVictim(),HeroicMode ? H_SPELL_MORTAL_WOUND : SPELL_MORTAL_WOUND); + MortalWound_Timer = 5000+rand()%8000; + }else MortalWound_Timer -= diff; + + if (Surge_Timer < diff) + { + DoScriptText(SAY_SURGE, m_creature); + + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_SURGE); + + Surge_Timer = 5000+rand()%8000; + }else Surge_Timer -= diff; + + if ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 20) + { + if (Retaliation_Timer < diff) + { + DoCast(m_creature,SPELL_RETALIATION); + Retaliation_Timer = 30000; + }else Retaliation_Timer -= diff; + } + + if (!YelledForHeal) + { + if ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 40) + { + DoScriptText(SAY_HEAL, m_creature); + YelledForHeal = true; + } + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_watchkeeper_gargolmarAI(Creature* pCreature) +{ + return new boss_watchkeeper_gargolmarAI (pCreature); +} + +void AddSC_boss_watchkeeper_gargolmar() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_watchkeeper_gargolmar"; + newscript->GetAI = &GetAI_boss_watchkeeper_gargolmarAI; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/hellfire_citadel/hellfire_ramparts/def_hellfire_ramparts.h b/src/bindings/scripts/scripts/outland/hellfire_citadel/hellfire_ramparts/def_hellfire_ramparts.h new file mode 100644 index 00000000000..4adf140b0ca --- /dev/null +++ b/src/bindings/scripts/scripts/outland/hellfire_citadel/hellfire_ramparts/def_hellfire_ramparts.h @@ -0,0 +1,16 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_RAMPARTS_H +#define DEF_RAMPARTS_H + +#define MAX_ENCOUNTER 2 + +enum +{ + TYPE_VAZRUDEN = 1, + TYPE_NAZAN = 2 +}; + +#endif diff --git a/src/bindings/scripts/scripts/outland/hellfire_citadel/hellfire_ramparts/instance_hellfire_ramparts.cpp b/src/bindings/scripts/scripts/outland/hellfire_citadel/hellfire_ramparts/instance_hellfire_ramparts.cpp new file mode 100644 index 00000000000..5942f0142ef --- /dev/null +++ b/src/bindings/scripts/scripts/outland/hellfire_citadel/hellfire_ramparts/instance_hellfire_ramparts.cpp @@ -0,0 +1,84 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Hellfire_Ramparts +SD%Complete: 50 +SDComment: +SDCategory: Hellfire Ramparts +EndScriptData */ + +#include "precompiled.h" +#include "def_hellfire_ramparts.h" + +struct TRINITY_DLL_DECL instance_ramparts : public ScriptedInstance +{ + instance_ramparts(Map* pMap) : ScriptedInstance(pMap) {Initialize();} + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + uint64 m_uiChestNGUID; + uint64 m_uiChestHGUID; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + m_uiChestNGUID = 0; + m_uiChestHGUID = 0; + } + + void OnGameObjectCreate(GameObject* pGo, bool add) + { + switch(pGo->GetEntry()) + { + case 185168: m_uiChestNGUID = pGo->GetGUID(); break; + case 185169: m_uiChestHGUID = pGo->GetGUID(); break; + } + } + + void SetData(uint32 uiType, uint32 uiData) + { + debug_log("TSCR: Instance Ramparts: SetData received for type %u with data %u",uiType,uiData); + + switch(uiType) + { + case TYPE_VAZRUDEN: + if (uiData == DONE && m_auiEncounter[1] == DONE) + DoRespawnGameObject(instance->IsHeroic() ? m_uiChestHGUID : m_uiChestNGUID, HOUR*IN_MILISECONDS); + m_auiEncounter[0] = uiData; + break; + case TYPE_NAZAN: + if (uiData == DONE && m_auiEncounter[0] == DONE) + DoRespawnGameObject(instance->IsHeroic() ? m_uiChestHGUID : m_uiChestNGUID, HOUR*IN_MILISECONDS); + m_auiEncounter[1] = uiData; + break; + } + } +}; + +InstanceData* GetInstanceData_instance_ramparts(Map* pMap) +{ + return new instance_ramparts(pMap); +} + +void AddSC_instance_ramparts() +{ + Script* pNewScript; + pNewScript = new Script; + pNewScript->Name = "instance_ramparts"; + pNewScript->GetInstanceData = &GetInstanceData_instance_ramparts; + pNewScript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/outland/hellfire_citadel/magtheridons_lair/boss_magtheridon.cpp b/src/bindings/scripts/scripts/outland/hellfire_citadel/magtheridons_lair/boss_magtheridon.cpp new file mode 100644 index 00000000000..8f7c076a701 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/hellfire_citadel/magtheridons_lair/boss_magtheridon.cpp @@ -0,0 +1,562 @@ +/* Copyright(C) 2006 - 2008 ScriptDev2 +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +*(at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +/* ScriptData +SDName: Boss_Magtheridon +SD%Complete: 60 +SDComment: In Development +SDCategory: Hellfire Citadel, Magtheridon's lair +EndScriptData */ + +#include "precompiled.h" +#include "def_magtheridons_lair.h" + +struct Yell +{ + int32 id; +}; + +static Yell RandomTaunt[]= +{ + {-1544000}, + {-1544001}, + {-1544002}, + {-1544003}, + {-1544004}, + {-1544005}, +}; + +#define SAY_FREED -1544006 +#define SAY_AGGRO -1544007 +#define SAY_BANISH -1544008 +#define SAY_CHAMBER_DESTROY -1544009 +#define SAY_PLAYER_KILLED -1544010 +#define SAY_DEATH -1544011 + +#define EMOTE_BERSERK -1544012 +#define EMOTE_BLASTNOVA -1544013 +#define EMOTE_BEGIN -1544014 + +#define MOB_MAGTHERIDON 17257 +#define MOB_ROOM 17516 +#define MOB_CHANNELLER 17256 +#define MOB_ABYSSAL 17454 + +#define SPELL_BLASTNOVA 30616 +#define SPELL_CLEAVE 30619 +#define SPELL_QUAKE_TRIGGER 30657 // must be cast with 30561 as the proc spell +#define SPELL_QUAKE_KNOCKBACK 30571 +#define SPELL_BLAZE_TARGET 30541 // core bug, does not support target 7 +#define SPELL_BLAZE_TRAP 30542 +#define SPELL_DEBRIS_KNOCKDOWN 36449 +#define SPELL_DEBRIS_VISUAL 30632 +#define SPELL_DEBRIS_DAMAGE 30631 // core bug, does not support target 8 +#define SPELL_CAMERA_SHAKE 36455 +#define SPELL_BERSERK 27680 + +#define SPELL_SHADOW_CAGE 30168 +#define SPELL_SHADOW_GRASP 30410 +#define SPELL_SHADOW_GRASP_VISUAL 30166 +#define SPELL_MIND_EXHAUSTION 44032 //Casted by the cubes when channeling ends + +#define SPELL_SHADOW_CAGE_C 30205 +#define SPELL_SHADOW_GRASP_C 30207 + +#define SPELL_SHADOW_BOLT_VOLLEY 30510 +#define SPELL_DARK_MENDING 30528 +#define SPELL_FEAR 30530 //39176 +#define SPELL_BURNING_ABYSSAL 30511 +#define SPELL_SOUL_TRANSFER 30531 // core bug, does not support target 7 + +#define SPELL_FIRE_BLAST 37110 + +// count of clickers needed to interrupt blast nova +#define CLICKERS_COUNT 5 + +typedef std::map CubeMap; + +struct TRINITY_DLL_DECL mob_abyssalAI : public ScriptedAI +{ + mob_abyssalAI(Creature *c) : ScriptedAI(c) + { + trigger = 0; + Despawn_Timer = 60000; + } + + uint32 FireBlast_Timer; + uint32 Despawn_Timer; + uint32 trigger; + + void Reset() + { + FireBlast_Timer = 6000; + } + + void SpellHit(Unit*, const SpellEntry *spell) + { + if (trigger == 2 && spell->Id == SPELL_BLAZE_TARGET) + { + m_creature->CastSpell(m_creature, SPELL_BLAZE_TRAP, true); + m_creature->SetVisibility(VISIBILITY_OFF); + Despawn_Timer = 130000; + } + } + + void SetTrigger(uint32 _trigger) + { + trigger = _trigger; + m_creature->SetDisplayId(11686); + if (trigger == 1) //debris + { + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->CastSpell(m_creature, SPELL_DEBRIS_VISUAL, true); + FireBlast_Timer = 5000; + Despawn_Timer = 10000; + } + } + + void EnterCombat(Unit* who) {DoZoneInCombat();} + void AttackStart(Unit *who) {if (!trigger) ScriptedAI::AttackStart(who);} + void MoveInLineOfSight(Unit *who) {if (!trigger) ScriptedAI::MoveInLineOfSight(who);} + + void UpdateAI(const uint32 diff) + { + if (trigger) + { + if (trigger == 1) + { + if (FireBlast_Timer < diff) + { + m_creature->CastSpell(m_creature, SPELL_DEBRIS_DAMAGE, true); + trigger = 3; + }else FireBlast_Timer -= diff; + } + return; + } + + if (Despawn_Timer < diff) + { + m_creature->ForcedDespawn(); + }else Despawn_Timer -= diff; + + if (!UpdateVictim()) + return; + + if (FireBlast_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_FIRE_BLAST); + FireBlast_Timer = 5000+rand()%10000; + }else FireBlast_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +struct TRINITY_DLL_DECL boss_magtheridonAI : public ScriptedAI +{ + boss_magtheridonAI(Creature *c) : ScriptedAI(c) + { + pInstance =m_creature->GetInstanceData(); + m_creature->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 10); + m_creature->SetFloatValue(UNIT_FIELD_COMBATREACH, 10); + + // target 7, random target with certain entry spell, need core fix + SpellEntry *TempSpell; + TempSpell = GET_SPELL(SPELL_BLAZE_TARGET); + if (TempSpell && TempSpell->EffectImplicitTargetA[0] != 6) + { + TempSpell->EffectImplicitTargetA[0] = 6; + TempSpell->EffectImplicitTargetB[0] = 0; + } + TempSpell = GET_SPELL(SPELL_QUAKE_TRIGGER); + if (TempSpell && TempSpell->EffectTriggerSpell[0] != SPELL_QUAKE_KNOCKBACK) + { + TempSpell->EffectTriggerSpell[0] = SPELL_QUAKE_KNOCKBACK; + } + } + + CubeMap Cube; + + ScriptedInstance* pInstance; + + uint32 Berserk_Timer; + uint32 Quake_Timer; + uint32 Cleave_Timer; + uint32 BlastNova_Timer; + uint32 Blaze_Timer; + uint32 Debris_Timer; + uint32 RandChat_Timer; + + bool Phase3; + bool NeedCheckCube; + + void Reset() + { + if (pInstance) + { + pInstance->SetData(DATA_MAGTHERIDON_EVENT, NOT_STARTED); + pInstance->SetData(DATA_COLLAPSE, false); + } + + Berserk_Timer = 1320000; + Quake_Timer = 40000; + Debris_Timer = 10000; + Blaze_Timer = 10000+rand()%20000; + BlastNova_Timer = 60000; + Cleave_Timer = 15000; + RandChat_Timer = 90000; + + Phase3 = false; + NeedCheckCube = false; + + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); + m_creature->addUnitState(UNIT_STAT_STUNNED); + m_creature->CastSpell(m_creature, SPELL_SHADOW_CAGE_C, true); + } + + void SetClicker(uint64 cubeGUID, uint64 clickerGUID) + { + // to avoid multiclicks from 1 cube + if (uint64 guid = Cube[cubeGUID]) + DebuffClicker(Unit::GetUnit(*m_creature, guid)); + Cube[cubeGUID] = clickerGUID; + NeedCheckCube = true; + } + + //function to interrupt channeling and debuff clicker with mind exh(used if second person clicks with same cube or after dispeling/ending shadow grasp DoT) + void DebuffClicker(Unit *clicker) + { + if (!clicker || !clicker->isAlive()) + return; + + clicker->RemoveAurasDueToSpell(SPELL_SHADOW_GRASP); // cannot interrupt triggered spells + clicker->InterruptNonMeleeSpells(false); + clicker->CastSpell(clicker, SPELL_MIND_EXHAUSTION, true); + } + + void NeedCheckCubeStatus() + { + uint32 ClickerNum = 0; + // now checking if every clicker has debuff from manticron(it is dispelable atm rev 6110 : S) + // if not - apply mind exhaustion and delete from clicker's list + for(CubeMap::iterator i = Cube.begin(); i != Cube.end(); ++i) + { + Unit *clicker = Unit::GetUnit(*m_creature, (*i).second); + if (!clicker || !clicker->HasAura(SPELL_SHADOW_GRASP)) + { + DebuffClicker(clicker); + (*i).second = 0; + }else ClickerNum++; + } + + // if 5 clickers from other cubes apply shadow cage + if (ClickerNum >= CLICKERS_COUNT && !m_creature->HasAura(SPELL_SHADOW_CAGE)) + { + DoScriptText(SAY_BANISH, m_creature); + m_creature->CastSpell(m_creature, SPELL_SHADOW_CAGE, true); + } + else if (ClickerNum < CLICKERS_COUNT && m_creature->HasAura(SPELL_SHADOW_CAGE)) + m_creature->RemoveAurasDueToSpell(SPELL_SHADOW_CAGE); + + if (!ClickerNum) NeedCheckCube = false; + } + + void KilledUnit(Unit* victim) + { + DoScriptText(SAY_PLAYER_KILLED, m_creature); + } + + void JustDied(Unit* Killer) + { + if (pInstance) + pInstance->SetData(DATA_MAGTHERIDON_EVENT, DONE); + + DoScriptText(SAY_DEATH, m_creature); + } + + void MoveInLineOfSight(Unit* who) {} + + void AttackStart(Unit *who) + { + if (!m_creature->hasUnitState(UNIT_STAT_STUNNED)) + ScriptedAI::AttackStart(who); + } + + void EnterCombat(Unit *who) + { + if (pInstance) + pInstance->SetData(DATA_MAGTHERIDON_EVENT, IN_PROGRESS); + DoZoneInCombat(); + + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->RemoveAurasDueToSpell(SPELL_SHADOW_CAGE_C); + + DoScriptText(SAY_FREED, m_creature); + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->isInCombat()) + { + if (RandChat_Timer < diff) + { + DoScriptText(RandomTaunt[rand()%6].id, m_creature); + RandChat_Timer = 90000; + }else RandChat_Timer -= diff; + } + + if (!UpdateVictim()) + return; + + if (NeedCheckCube) NeedCheckCubeStatus(); + + if (Berserk_Timer < diff) + { + m_creature->CastSpell(m_creature, SPELL_BERSERK, true); + DoScriptText(EMOTE_BERSERK, m_creature); + Berserk_Timer = 60000; + }else Berserk_Timer -= diff; + + if (Cleave_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_CLEAVE); + Cleave_Timer = 10000; + }else Cleave_Timer -= diff; + + if (BlastNova_Timer < diff) + { + // to avoid earthquake interruption + if (!m_creature->hasUnitState(UNIT_STAT_STUNNED)) + { + DoScriptText(EMOTE_BLASTNOVA, m_creature); + DoCast(m_creature, SPELL_BLASTNOVA); + BlastNova_Timer = 60000; + } + }else BlastNova_Timer -= diff; + + if (Quake_Timer < diff) + { + // to avoid blastnova interruption + if (!m_creature->IsNonMeleeSpellCasted(false)) + { + m_creature->CastSpell(m_creature, SPELL_QUAKE_TRIGGER, true); + Quake_Timer = 50000; + } + }else Quake_Timer -= diff; + + if (Blaze_Timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + { + float x, y, z; + target->GetPosition(x, y, z); + Creature *summon = m_creature->SummonCreature(MOB_ABYSSAL, x, y, z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); + if (summon) + { + CAST_AI(mob_abyssalAI, summon->AI())->SetTrigger(2); + m_creature->CastSpell(summon, SPELL_BLAZE_TARGET, true); + summon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + } + } + Blaze_Timer = 20000 + rand()%20000; + }else Blaze_Timer -= diff; + + if (!Phase3 && m_creature->GetHealth()*10 < m_creature->GetMaxHealth()*3 + && !m_creature->IsNonMeleeSpellCasted(false) // blast nova + && !m_creature->hasUnitState(UNIT_STAT_STUNNED)) // shadow cage and earthquake + { + Phase3 = true; + DoScriptText(SAY_CHAMBER_DESTROY, m_creature); + m_creature->CastSpell(m_creature, SPELL_CAMERA_SHAKE, true); + m_creature->CastSpell(m_creature, SPELL_DEBRIS_KNOCKDOWN, true); + + if (pInstance) + pInstance->SetData(DATA_COLLAPSE, true); + } + + if (Phase3) + { + if (Debris_Timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + { + float x, y, z; + target->GetPosition(x, y, z); + Creature *summon = m_creature->SummonCreature(MOB_ABYSSAL, x, y, z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); + if (summon) CAST_AI(mob_abyssalAI, summon->AI())->SetTrigger(1); + } + Debris_Timer = 10000; + }else Debris_Timer -= diff; + } + + DoMeleeAttackIfReady(); + } +}; + +struct TRINITY_DLL_DECL mob_hellfire_channelerAI : public ScriptedAI +{ + mob_hellfire_channelerAI(Creature *c) : ScriptedAI(c) + { + pInstance =m_creature->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + uint32 ShadowBoltVolley_Timer; + uint32 DarkMending_Timer; + uint32 Fear_Timer; + uint32 Infernal_Timer; + + uint32 Check_Timer; + + void Reset() + { + ShadowBoltVolley_Timer = 8000 + rand()%2000; + DarkMending_Timer = 10000; + Fear_Timer = 15000 + rand()%5000; + Infernal_Timer = 10000 + rand()%40000; + + Check_Timer = 5000; + + if (pInstance) + pInstance->SetData(DATA_CHANNELER_EVENT, NOT_STARTED); + + m_creature->CastSpell(m_creature, SPELL_SHADOW_GRASP_C, false); + } + + void EnterCombat(Unit *who) + { + if (pInstance) + pInstance->SetData(DATA_CHANNELER_EVENT, IN_PROGRESS); + + m_creature->InterruptNonMeleeSpells(false); + DoZoneInCombat(); + } + + void JustSummoned(Creature *summon) {summon->AI()->AttackStart(m_creature->getVictim());} + + void MoveInLineOfSight(Unit* who) {} + + void DamageTaken(Unit*, uint32 &damage) + { + if (damage >= m_creature->GetHealth()) + m_creature->CastSpell(m_creature, SPELL_SOUL_TRANSFER, true); + } + + void JustDied(Unit* who) + { + if (pInstance) + pInstance->SetData(DATA_CHANNELER_EVENT, DONE); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (ShadowBoltVolley_Timer < diff) + { + DoCast(m_creature, SPELL_SHADOW_BOLT_VOLLEY); + ShadowBoltVolley_Timer = 10000 + rand()%10000; + }else ShadowBoltVolley_Timer -= diff; + + if (DarkMending_Timer < diff) + { + if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 50) + DoCast(m_creature, SPELL_DARK_MENDING); + DarkMending_Timer = 10000 +(rand() % 10000); + }else DarkMending_Timer -= diff; + + if (Fear_Timer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1)) + DoCast(target, SPELL_FEAR); + Fear_Timer = 25000 + rand()%15000; + }else Fear_Timer -= diff; + + if (Infernal_Timer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + m_creature->CastSpell(target, SPELL_BURNING_ABYSSAL, true); + Infernal_Timer = 30000 + rand()%10000; + }else Infernal_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +//Manticron Cube +bool GOHello_go_Manticron_Cube(Player* pPlayer, GameObject* pGo) +{ + ScriptedInstance* pInstance = pGo->GetInstanceData(); + if (!pInstance) return true; + if (pInstance->GetData(DATA_MAGTHERIDON_EVENT) != IN_PROGRESS) return true; + Creature *Magtheridon =Unit::GetCreature(*pGo, pInstance->GetData64(DATA_MAGTHERIDON)); + if (!Magtheridon || !Magtheridon->isAlive()) return true; + + // if exhausted or already channeling return + if (pPlayer->HasAura(SPELL_MIND_EXHAUSTION) || pPlayer->HasAura(SPELL_SHADOW_GRASP)) + return true; + + pPlayer->InterruptNonMeleeSpells(false); + pPlayer->CastSpell(pPlayer, SPELL_SHADOW_GRASP, true); + pPlayer->CastSpell(pPlayer, SPELL_SHADOW_GRASP_VISUAL, false); + CAST_AI(boss_magtheridonAI, Magtheridon->AI())->SetClicker(pGo->GetGUID(), pPlayer->GetGUID()); + return true; +} + +CreatureAI* GetAI_boss_magtheridon(Creature* pCreature) +{ + return new boss_magtheridonAI(pCreature); +} + +CreatureAI* GetAI_mob_hellfire_channeler(Creature* pCreature) +{ + return new mob_hellfire_channelerAI(pCreature); +} + +CreatureAI* GetAI_mob_abyssalAI(Creature* pCreature) +{ + return new mob_abyssalAI(pCreature); +} + +void AddSC_boss_magtheridon() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_magtheridon"; + newscript->GetAI = &GetAI_boss_magtheridon; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_hellfire_channeler"; + newscript->GetAI = &GetAI_mob_hellfire_channeler; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="go_manticron_cube"; + newscript->pGOHello = &GOHello_go_Manticron_Cube; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_abyssal"; + newscript->GetAI = &GetAI_mob_abyssalAI; + newscript->RegisterSelf(); + +} + diff --git a/src/bindings/scripts/scripts/outland/hellfire_citadel/magtheridons_lair/def_magtheridons_lair.h b/src/bindings/scripts/scripts/outland/hellfire_citadel/magtheridons_lair/def_magtheridons_lair.h new file mode 100644 index 00000000000..c5469acaea0 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/hellfire_citadel/magtheridons_lair/def_magtheridons_lair.h @@ -0,0 +1,14 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_MAGTHERIDONS_LAIR_H +#define DEF_MAGTHERIDONS_LAIR_H + +#define DATA_MAGTHERIDON_EVENT 1 +#define DATA_MAGTHERIDON 3 +#define DATA_CHANNELER_EVENT 2 +#define DATA_COLLAPSE 6 +#define DATA_CHANNELER 9 +#endif + diff --git a/src/bindings/scripts/scripts/outland/hellfire_citadel/magtheridons_lair/instance_magtheridons_lair.cpp b/src/bindings/scripts/scripts/outland/hellfire_citadel/magtheridons_lair/instance_magtheridons_lair.cpp new file mode 100644 index 00000000000..eb8e9b1a961 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/hellfire_citadel/magtheridons_lair/instance_magtheridons_lair.cpp @@ -0,0 +1,249 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Magtheridons_Lair +SD%Complete: 100 +SDComment: +SDCategory: Hellfire Citadel, Magtheridon's lair +EndScriptData */ + +#include "precompiled.h" +#include "def_magtheridons_lair.h" + +#define SPELL_SOUL_TRANSFER 30531 // core bug, does not support target 7 +#define SPELL_BLAZE_TARGET 30541 // core bug, does not support target 7 + +#define CHAMBER_CENTER_X -15.14 +#define CHAMBER_CENTER_Y 1.8 +#define CHAMBER_CENTER_Z -0.4 + +#define MAX_ENCOUNTER 2 + +struct TRINITY_DLL_DECL instance_magtheridons_lair : public ScriptedInstance +{ + instance_magtheridons_lair(Map* pMap) : ScriptedInstance(pMap) + { + Initialize(); + } + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + + uint64 MagtheridonGUID; + std::set ChannelerGUID; + uint64 DoorGUID; + std::set ColumnGUID; + + uint32 CageTimer; + uint32 RespawnTimer; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + MagtheridonGUID = 0; + ChannelerGUID.clear(); + DoorGUID = 0; + ColumnGUID.clear(); + + CageTimer = 0; + RespawnTimer = 0; + } + + bool IsEncounterInProgress() const + { + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) return true; + return false; + } + + void OnCreatureCreate(Creature* pCreature, bool add) + { + switch(pCreature->GetEntry()) + { + case 17257: + MagtheridonGUID = pCreature->GetGUID(); + break; + case 17256: + ChannelerGUID.insert(pCreature->GetGUID()); + break; + } + } + + void OnGameObjectCreate(GameObject* pGo, bool add) + { + switch(pGo->GetEntry()) + { + case 181713: + pGo->SetUInt32Value(GAMEOBJECT_FLAGS, 0); + break; + case 183847: + DoorGUID = pGo->GetGUID(); + break; + case 184653: // hall + case 184634: // six columns + case 184635: + case 184636: + case 184637: + case 184638: + case 184639: + ColumnGUID.insert(pGo->GetGUID()); + break; + } + } + + uint64 GetData64(uint32 type) + { + switch(type) + { + case DATA_MAGTHERIDON: + return MagtheridonGUID; + } + return 0; + } + + void SetData(uint32 type, uint32 data) + { + switch(type) + { + case DATA_MAGTHERIDON_EVENT: + m_auiEncounter[0] = data; + if (data == NOT_STARTED) + RespawnTimer = 10000; + if (data != IN_PROGRESS) + HandleGameObject(DoorGUID, true); + break; + case DATA_CHANNELER_EVENT: + switch(data) + { + case NOT_STARTED: // Reset all channelers once one is reset. + if (m_auiEncounter[1] != NOT_STARTED) + { + m_auiEncounter[1] = NOT_STARTED; + for(std::set::iterator i = ChannelerGUID.begin(); i != ChannelerGUID.end(); ++i) + { + if (Creature *Channeler = instance->GetCreature(*i)) + { + if (Channeler->isAlive()) + Channeler->AI()->EnterEvadeMode(); + else + Channeler->Respawn(); + } + } + CageTimer = 0; + HandleGameObject(DoorGUID, true); + }break; + case IN_PROGRESS: // Event start. + if (m_auiEncounter[1] != IN_PROGRESS) + { + m_auiEncounter[1] = IN_PROGRESS; + // Let all five channelers aggro. + for(std::set::iterator i = ChannelerGUID.begin(); i != ChannelerGUID.end(); ++i) + { + Creature *Channeler = instance->GetCreature(*i); + if (Channeler && Channeler->isAlive()) + Channeler->AI()->AttackStart(Channeler->SelectNearestTarget(999)); + } + // Release Magtheridon after two minutes. + Creature *Magtheridon = instance->GetCreature(MagtheridonGUID); + if (Magtheridon && Magtheridon->isAlive()) + { + Magtheridon->MonsterTextEmote("'s bonds begin to weaken!", 0); + CageTimer = 120000; + } + HandleGameObject(DoorGUID, false); + }break; + case DONE: // Add buff and check if all channelers are dead. + for(std::set::iterator i = ChannelerGUID.begin(); i != ChannelerGUID.end(); ++i) + { + Creature *Channeler = instance->GetCreature(*i); + if (Channeler && Channeler->isAlive()) + { + //Channeler->CastSpell(Channeler, SPELL_SOUL_TRANSFER, true); + data = IN_PROGRESS; + break; + } + }break; + } + m_auiEncounter[1] = data; + break; + case DATA_COLLAPSE: + // true - collapse / false - reset + for(std::set::iterator i = ColumnGUID.begin(); i != ColumnGUID.end(); ++i) + DoUseDoorOrButton(*i); + break; + default: + break; + } + } + + uint32 GetData(uint32 type) + { + if (type == DATA_MAGTHERIDON_EVENT) + return m_auiEncounter[0]; + return 0; + } + + void Update(uint32 diff) + { + if (CageTimer) + { + if (CageTimer <= diff) + { + Creature *Magtheridon = instance->GetCreature(MagtheridonGUID); + if (Magtheridon && Magtheridon->isAlive()) + { + Magtheridon->clearUnitState(UNIT_STAT_STUNNED); + Magtheridon->AI()->AttackStart(Magtheridon->SelectNearestTarget(999)); + } + CageTimer = 0; + }else CageTimer -= diff; + } + + if (RespawnTimer) + { + if (RespawnTimer <= diff) + { + for(std::set::iterator i = ChannelerGUID.begin(); i != ChannelerGUID.end(); ++i) + { + if (Creature *Channeler = instance->GetCreature(*i)) + { + if (Channeler->isAlive()) + Channeler->AI()->EnterEvadeMode(); + else + Channeler->Respawn(); + } + } + RespawnTimer = 0; + }else RespawnTimer -= diff; + } + } +}; + +InstanceData* GetInstanceData_instance_magtheridons_lair(Map* pMap) +{ + return new instance_magtheridons_lair(pMap); +} + +void AddSC_instance_magtheridons_lair() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_magtheridons_lair"; + newscript->GetInstanceData = &GetInstanceData_instance_magtheridons_lair; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/hellfire_citadel/shattered_halls/boss_nethekurse.cpp b/src/bindings/scripts/scripts/outland/hellfire_citadel/shattered_halls/boss_nethekurse.cpp new file mode 100644 index 00000000000..721d1efd03c --- /dev/null +++ b/src/bindings/scripts/scripts/outland/hellfire_citadel/shattered_halls/boss_nethekurse.cpp @@ -0,0 +1,412 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Grand_Warlock_Nethekurse +SD%Complete: 75 +SDComment: encounter not fully completed. missing part where boss kill minions. +SDCategory: Hellfire Citadel, Shattered Halls +EndScriptData */ + +/* ContentData +boss_grand_warlock_nethekurse +mob_fel_orc_convert +mob_lesser_shadow_fissure +EndContentData */ + +#include "precompiled.h" +#include "def_shattered_halls.h" + +struct Say +{ + int32 id; +}; + +static Say PeonAttacked[]= +{ + {-1540001}, + {-1540002}, + {-1540003}, + {-1540004}, +}; +static Say PeonDies[]= +{ + {-1540005}, + {-1540006}, + {-1540007}, + {-1540008}, +}; + +#define SAY_INTRO -1540000 +#define SAY_TAUNT_1 -1540009 +#define SAY_TAUNT_2 -1540010 +#define SAY_TAUNT_3 -1540011 +#define SAY_AGGRO_1 -1540012 +#define SAY_AGGRO_2 -1540013 +#define SAY_AGGRO_3 -1540014 +#define SAY_SLAY_1 -1540015 +#define SAY_SLAY_2 -1540016 +#define SAY_DIE -1540017 + +#define SPELL_DEATH_COIL 30500 +#define SPELL_DARK_SPIN 30502 // core bug spell attack caster :D +#define SPELL_SHADOW_FISSURE 30496 // Summon the ShadowFissure NPC + +#define SPELL_SHADOW_CLEAVE 30495 +#define H_SPELL_SHADOW_SLAM 35953 + +#define SPELL_HEMORRHAGE 30478 + +#define SPELL_CONSUMPTION 30497 +#define SPELL_TEMPORARY_VISUAL 39312 // this is wrong, a temporary solution. spell consumption already has the purple visual, but doesn't display as it should + +struct TRINITY_DLL_DECL boss_grand_warlock_nethekurseAI : public ScriptedAI +{ + boss_grand_warlock_nethekurseAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + ScriptedInstance* pInstance; + bool HeroicMode; + + bool IntroOnce; + bool IsIntroEvent; + bool IsMainEvent; + bool SpinOnce; + //bool HasTaunted; + bool Phase; + + uint32 PeonEngagedCount; + uint32 PeonKilledCount; + + uint32 IntroEvent_Timer; + uint32 DeathCoil_Timer; + uint32 ShadowFissure_Timer; + uint32 Cleave_Timer; + + void Reset() + { + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + IsIntroEvent = false; + IntroOnce = false; + IsMainEvent = false; + //HasTaunted = false; + SpinOnce = false; + Phase = false; + + PeonEngagedCount = 0; + PeonKilledCount = 0; + + IntroEvent_Timer = 90000; //how long before getting bored and kills his minions? + DeathCoil_Timer = 20000; + ShadowFissure_Timer = 8000; + Cleave_Timer = 5000; + } + + void DoYellForPeonAggro() + { + if (PeonEngagedCount >= 4) + return; + + DoScriptText(PeonAttacked[PeonEngagedCount].id, m_creature); + ++PeonEngagedCount; + } + + void DoYellForPeonDeath() + { + if (PeonKilledCount >= 4) + return; + + DoScriptText(PeonDies[PeonKilledCount].id, m_creature); + ++PeonKilledCount; + + if (PeonKilledCount == 4) + { + IsIntroEvent = false; + IsMainEvent = true; + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + } + } + + void DoTauntPeons() + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_TAUNT_1, m_creature); break; + case 1: DoScriptText(SAY_TAUNT_2, m_creature); break; + case 2: DoScriptText(SAY_TAUNT_3, m_creature); break; + } + + //TODO: kill the peons first + IsIntroEvent = false; + PeonEngagedCount = 4; + PeonKilledCount = 4; + IsMainEvent = true; + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + } + + void AttackStart(Unit* who) + { + if (IsIntroEvent || !IsMainEvent) + return; + + if (m_creature->Attack(who, true)) + { + if (Phase) DoStartNoMovement(who); + else DoStartMovement(who); + } + } + + void MoveInLineOfSight(Unit *who) + { + if (!IntroOnce && m_creature->IsWithinDistInMap(who, 50.0f)) + { + if (who->GetTypeId() != TYPEID_PLAYER) + return; + + DoScriptText(SAY_INTRO, m_creature); + IntroOnce = true; + IsIntroEvent = true; + + if (pInstance) + pInstance->SetData(TYPE_NETHEKURSE,IN_PROGRESS); + } + + if (IsIntroEvent || !IsMainEvent) + return; + + ScriptedAI::MoveInLineOfSight(who); + } + + void EnterCombat(Unit *who) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; + } + } + + void JustSummoned(Creature *summoned) + { + summoned->setFaction(16); + summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + + //triggered spell of consumption does not properly show it's SpellVisual, wrong spellid? + summoned->CastSpell(summoned,SPELL_TEMPORARY_VISUAL,true); + summoned->CastSpell(summoned,SPELL_CONSUMPTION,false,0,0,m_creature->GetGUID()); + } + + void KilledUnit(Unit* victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature); break; + case 1: DoScriptText(SAY_SLAY_2, m_creature); break; + } + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DIE, m_creature); + + if (!pInstance) + return; + + pInstance->SetData(TYPE_NETHEKURSE,DONE); + pInstance->HandleGameObject(pInstance->GetData64(DATA_NETHEKURSE_DOOR), true); + } + + void UpdateAI(const uint32 diff) + { + if (IsIntroEvent) + { + if (!pInstance) + return; + + if (pInstance->GetData(TYPE_NETHEKURSE) == IN_PROGRESS) + { + if (IntroEvent_Timer < diff) + { + DoTauntPeons(); + }else IntroEvent_Timer -= diff; + } + } + + if (!UpdateVictim()) + return; + + if (!IsMainEvent) + return; + + if (Phase) + { + if (!SpinOnce) + { + DoCast(m_creature->getVictim(),SPELL_DARK_SPIN); + SpinOnce = true; + } + + if (Cleave_Timer < diff) + { + DoCast(m_creature->getVictim(),(HeroicMode ? H_SPELL_SHADOW_SLAM : SPELL_SHADOW_CLEAVE)); + Cleave_Timer = 6000+rand()%2500; + }else Cleave_Timer -= diff; + } + else + { + if (ShadowFissure_Timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_SHADOW_FISSURE); + ShadowFissure_Timer = 7500+rand()%7500; + }else ShadowFissure_Timer -= diff; + + if (DeathCoil_Timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_DEATH_COIL); + DeathCoil_Timer = 15000+rand()%5000; + }else DeathCoil_Timer -= diff; + + if ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() <= 20) + Phase = true; + + DoMeleeAttackIfReady(); + } + } +}; + +struct TRINITY_DLL_DECL mob_fel_orc_convertAI : public ScriptedAI +{ + mob_fel_orc_convertAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + uint32 Hemorrhage_Timer; + + void Reset() + { + m_creature->SetNoCallAssistance(true); //we don't want any assistance (WE R HEROZ!) + Hemorrhage_Timer = 3000; + } + + void MoveInLineOfSight(Unit *who) + { + } + + void EnterCombat(Unit* who) + { + if (pInstance) + { + if (pInstance->GetData64(DATA_NETHEKURSE)) + { + Creature *pKurse = Unit::GetCreature(*m_creature,pInstance->GetData64(DATA_NETHEKURSE)); + if (pKurse && m_creature->IsWithinDist(pKurse, 45.0f)) + { + CAST_AI(boss_grand_warlock_nethekurseAI, pKurse->AI())->DoYellForPeonAggro(); + + if (pInstance->GetData(TYPE_NETHEKURSE) == IN_PROGRESS) + return; + else pInstance->SetData(TYPE_NETHEKURSE,IN_PROGRESS); + } + } + } + } + + void JustDied(Unit* Killer) + { + if (pInstance) + { + if (pInstance->GetData(TYPE_NETHEKURSE) != IN_PROGRESS) + return; + if (pInstance->GetData64(DATA_NETHEKURSE)) + { + Creature *pKurse = Unit::GetCreature(*m_creature,pInstance->GetData64(DATA_NETHEKURSE)); + if (pKurse) + CAST_AI(boss_grand_warlock_nethekurseAI, pKurse->AI())->DoYellForPeonDeath(); + } + } + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (Hemorrhage_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_HEMORRHAGE); + Hemorrhage_Timer = 15000; + }else Hemorrhage_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +//NOTE: this Creature are also summoned by other spells, for different creatures +struct TRINITY_DLL_DECL mob_lesser_shadow_fissureAI : public ScriptedAI +{ + mob_lesser_shadow_fissureAI(Creature *c) : ScriptedAI(c) {} + + void Reset() { } + void MoveInLineOfSight(Unit *who) { } + void AttackStart(Unit* who) { } + void EnterCombat(Unit* who) { } +}; + +CreatureAI* GetAI_boss_grand_warlock_nethekurse(Creature* pCreature) +{ + return new boss_grand_warlock_nethekurseAI (pCreature); +} + +CreatureAI* GetAI_mob_fel_orc_convert(Creature* pCreature) +{ + return new mob_fel_orc_convertAI (pCreature); +} + +CreatureAI* GetAI_mob_lesser_shadow_fissure(Creature* pCreature) +{ + return new mob_lesser_shadow_fissureAI (pCreature); +} + +void AddSC_boss_grand_warlock_nethekurse() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_grand_warlock_nethekurse"; + newscript->GetAI = &GetAI_boss_grand_warlock_nethekurse; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_fel_orc_convert"; + newscript->GetAI = &GetAI_mob_fel_orc_convert; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_lesser_shadow_fissure"; + newscript->GetAI = &GetAI_mob_lesser_shadow_fissure; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/hellfire_citadel/shattered_halls/boss_warbringer_omrogg.cpp b/src/bindings/scripts/scripts/outland/hellfire_citadel/shattered_halls/boss_warbringer_omrogg.cpp new file mode 100644 index 00000000000..0681e94e2b0 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/hellfire_citadel/shattered_halls/boss_warbringer_omrogg.cpp @@ -0,0 +1,408 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Warbringer_Omrogg +SD%Complete: 85 +SDComment: Heroic enabled. Spell timing may need additional tweaks +SDCategory: Hellfire Citadel, Shattered Halls +EndScriptData */ + +/* ContentData +mob_omrogg_heads +boss_warbringer_omrogg +EndContentData */ + +#include "precompiled.h" +#include "def_shattered_halls.h" + +enum +{ + YELL_DIE_L = -1540039, + YELL_DIE_R = -1540040, + EMOTE_ENRAGE = -1540041, + + SPELL_BLAST_WAVE = 30600, + SPELL_FEAR = 30584, + SPELL_THUNDERCLAP = 30633, + + SPELL_BURNING_MAUL = 30598, + H_SPELL_BURNING_MAUL = 36056, + + NPC_LEFT_HEAD = 19523, + NPC_RIGHT_HEAD = 19524 +}; + +struct Yell +{ + int32 id; + uint32 creature; +}; + +static Yell GoCombat[]= +{ + {-1540018, NPC_LEFT_HEAD}, + {-1540019, NPC_LEFT_HEAD}, + {-1540020, NPC_LEFT_HEAD}, +}; +static Yell GoCombatDelay[]= +{ + {-1540021, NPC_RIGHT_HEAD}, + {-1540022, NPC_RIGHT_HEAD}, + {-1540023, NPC_RIGHT_HEAD}, +}; + +static Yell Threat[]= +{ + {-1540024, NPC_LEFT_HEAD}, + {-1540025, NPC_RIGHT_HEAD}, + {-1540026, NPC_LEFT_HEAD}, + {-1540027, NPC_LEFT_HEAD}, +}; +static Yell ThreatDelay1[]= +{ + {-1540028, NPC_RIGHT_HEAD}, + {-1540029, NPC_LEFT_HEAD}, + {-1540030, NPC_RIGHT_HEAD}, + {-1540031, NPC_RIGHT_HEAD}, +}; +static Yell ThreatDelay2[]= +{ + {-1540032, NPC_LEFT_HEAD}, + {-1540033, NPC_RIGHT_HEAD}, + {-1540034, NPC_LEFT_HEAD}, + {-1540035, NPC_LEFT_HEAD}, +}; + +static Yell Killing[]= +{ + {-1540036, NPC_LEFT_HEAD}, + {-1540037, NPC_RIGHT_HEAD}, +}; +static Yell KillingDelay[]= +{ + {-1540038, NPC_RIGHT_HEAD}, + {-1000000, NPC_LEFT_HEAD}, +}; + +struct TRINITY_DLL_DECL mob_omrogg_headsAI : public ScriptedAI +{ + mob_omrogg_headsAI(Creature *c) : ScriptedAI(c) {} + + bool DeathYell; + uint32 Death_Timer; + + void Reset() + { + Death_Timer = 4000; + DeathYell = false; + } + void EnterCombat(Unit* who) { } + + void DoDeathYell() + { + DeathYell = true; + } + + void UpdateAI(const uint32 diff) + { + if (!DeathYell) + return; + + if (Death_Timer < diff) + { + DoScriptText(YELL_DIE_R, m_creature); + Death_Timer = false; + m_creature->setDeathState(JUST_DIED); + }else Death_Timer -= diff; + } +}; + +struct TRINITY_DLL_DECL boss_warbringer_omroggAI : public ScriptedAI +{ + boss_warbringer_omroggAI(Creature *c) : ScriptedAI(c) + { + LeftHeadGUID = 0; + RightHeadGUID = 0; + pInstance = c->GetInstanceData(); + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + ScriptedInstance* pInstance; + bool HeroicMode; + + uint64 LeftHeadGUID; + uint64 RightHeadGUID; + int iaggro; + int ithreat; + int ikilling; + + bool AggroYell; + bool ThreatYell; + bool ThreatYell2; + bool KillingYell; + + uint32 Delay_Timer; + uint32 BlastWave_Timer; + uint32 BlastCount; + uint32 Fear_Timer; + uint32 BurningMaul_Timer; + uint32 ThunderClap_Timer; + uint32 ResetThreat_Timer; + + void Reset() + { + if (Unit* pLeftHead = Unit::GetUnit(*m_creature,LeftHeadGUID)) + { + pLeftHead->setDeathState(JUST_DIED); + LeftHeadGUID = 0; + } + + if (Unit* pRightHead = Unit::GetUnit(*m_creature,RightHeadGUID)) + { + pRightHead->setDeathState(JUST_DIED); + RightHeadGUID = 0; + } + + + AggroYell = false; + ThreatYell = false; + ThreatYell2 = false; + KillingYell = false; + + Delay_Timer = 4000; + BlastWave_Timer = 0; + BlastCount = 0; + Fear_Timer = 8000; + BurningMaul_Timer = 25000; + ThunderClap_Timer = 15000; + ResetThreat_Timer = 30000; + + if (pInstance) + pInstance->SetData(TYPE_OMROGG, NOT_STARTED); //End boss can use this later. O'mrogg must be defeated(DONE) or he will come to aid. + } + + void DoYellForThreat() + { + Unit *pLeftHead = Unit::GetUnit(*m_creature,LeftHeadGUID); + Unit *pRightHead = Unit::GetUnit(*m_creature,RightHeadGUID); + + if (!pLeftHead || !pRightHead) + return; + + ithreat = rand()%4; + + Unit *source = (pLeftHead->GetEntry() == Threat[ithreat].creature ? pLeftHead : pRightHead); + + DoScriptText(Threat[ithreat].id, source); + + Delay_Timer = 3500; + ThreatYell = true; + } + + void EnterCombat(Unit *who) + { + m_creature->SummonCreature(NPC_LEFT_HEAD, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_DEAD_DESPAWN, 0); + m_creature->SummonCreature(NPC_RIGHT_HEAD, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_DEAD_DESPAWN, 0); + + if (Unit *pLeftHead = Unit::GetUnit(*m_creature,LeftHeadGUID)) + { + iaggro = rand()%3; + + DoScriptText(GoCombat[iaggro].id, pLeftHead); + + Delay_Timer = 3500; + AggroYell = true; + } + + if (pInstance) + pInstance->SetData(TYPE_OMROGG, IN_PROGRESS); + } + + void JustSummoned(Creature *summoned) + { + if (summoned->GetEntry() == NPC_LEFT_HEAD) + LeftHeadGUID = summoned->GetGUID(); + + if (summoned->GetEntry() == NPC_RIGHT_HEAD) + RightHeadGUID = summoned->GetGUID(); + + //summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + //summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + summoned->SetVisibility(VISIBILITY_OFF); + } + + void KilledUnit(Unit* victim) + { + Unit* pLeftHead = Unit::GetUnit(*m_creature,LeftHeadGUID); + Unit* pRightHead = Unit::GetUnit(*m_creature,RightHeadGUID); + + + if (!pLeftHead || !pRightHead) + return; + + ikilling = rand()%2; + + Unit *source = (pLeftHead->GetEntry() == Killing[ikilling].creature ? pLeftHead : pRightHead); + + switch(ikilling) + { + case 0: + DoScriptText(Killing[ikilling].id, source); + Delay_Timer = 3500; + KillingYell = true; + break; + case 1: + DoScriptText(Killing[ikilling].id, source); + KillingYell = false; + break; + } + } + + void JustDied(Unit* Killer) + { + Unit* pLeftHead = Unit::GetUnit(*m_creature,LeftHeadGUID); + Unit* pRightHead = Unit::GetUnit(*m_creature,RightHeadGUID); + + if (!pLeftHead || !pRightHead) + return; + + DoScriptText(YELL_DIE_L, pLeftHead); + + CAST_AI(mob_omrogg_headsAI, CAST_CRE(pRightHead)->AI())->DoDeathYell(); + + if (pInstance) + pInstance->SetData(TYPE_OMROGG, DONE); + } + + void UpdateAI(const uint32 diff) + { + if (Delay_Timer < diff) + { + Delay_Timer = 3500; + + Unit* pLeftHead = Unit::GetUnit(*m_creature,LeftHeadGUID); + Unit* pRightHead = Unit::GetUnit(*m_creature,RightHeadGUID); + + if (!pLeftHead || !pRightHead) + return; + + if (AggroYell) + { + DoScriptText(GoCombatDelay[iaggro].id, pRightHead); + AggroYell = false; + } + + if (ThreatYell2) + { + Unit *source = (pLeftHead->GetEntry() == ThreatDelay2[ithreat].creature ? pLeftHead : pRightHead); + + DoScriptText(ThreatDelay2[ithreat].id, source); + ThreatYell2 = false; + } + + if (ThreatYell) + { + Unit *source = (pLeftHead->GetEntry() == ThreatDelay1[ithreat].creature ? pLeftHead : pRightHead); + + DoScriptText(ThreatDelay1[ithreat].id, source); + ThreatYell = false; + ThreatYell2 = true; + } + + if (KillingYell) + { + Unit *source = (pLeftHead->GetEntry() == KillingDelay[ikilling].creature ? pLeftHead : pRightHead); + + DoScriptText(KillingDelay[ikilling].id, source); + KillingYell = false; + } + }else Delay_Timer -= diff; + + if (!UpdateVictim()) + return; + + if (BlastCount && BlastWave_Timer <= diff) + { + DoCast(m_creature,SPELL_BLAST_WAVE); + BlastWave_Timer = 5000; + ++BlastCount; + + if (BlastCount == 3) + BlastCount = 0; + }else BlastWave_Timer -= diff; + + if (BurningMaul_Timer < diff) + { + DoScriptText(EMOTE_ENRAGE, m_creature); + DoCast(m_creature,HeroicMode ? H_SPELL_BURNING_MAUL : SPELL_BURNING_MAUL); + BurningMaul_Timer = 40000; + BlastWave_Timer = 16000; + BlastCount = 1; + }else BurningMaul_Timer -= diff; + + if (ResetThreat_Timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + { + DoYellForThreat(); + DoResetThreat(); + m_creature->AddThreat(target, 0.0f); + } + ResetThreat_Timer = 25000+rand()%15000; + }else ResetThreat_Timer -= diff; + + if (Fear_Timer < diff) + { + DoCast(m_creature,SPELL_FEAR); + Fear_Timer = 15000+rand()%20000; + }else Fear_Timer -= diff; + + if (ThunderClap_Timer < diff) + { + DoCast(m_creature,SPELL_THUNDERCLAP); + ThunderClap_Timer = 15000+rand()%15000; + }else ThunderClap_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_warbringer_omrogg(Creature* pCreature) +{ + return new boss_warbringer_omroggAI (pCreature); +} + +CreatureAI* GetAI_mob_omrogg_heads(Creature* pCreature) +{ + return new mob_omrogg_headsAI (pCreature); +} + +void AddSC_boss_warbringer_omrogg() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_warbringer_omrogg"; + newscript->GetAI = &GetAI_boss_warbringer_omrogg; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_omrogg_heads"; + newscript->GetAI = &GetAI_mob_omrogg_heads; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/hellfire_citadel/shattered_halls/boss_warchief_kargath_bladefist.cpp b/src/bindings/scripts/scripts/outland/hellfire_citadel/shattered_halls/boss_warchief_kargath_bladefist.cpp new file mode 100644 index 00000000000..4fa673f3560 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/hellfire_citadel/shattered_halls/boss_warchief_kargath_bladefist.cpp @@ -0,0 +1,303 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Warchief_Kargath_Bladefist +SD%Complete: 90 +SDComment: +SDCategory: Hellfire Citadel, Shattered Halls +EndScriptData */ + +/* ContentData +boss_warchief_kargath_bladefist +EndContentData */ + +#include "precompiled.h" + +#define SAY_AGGRO1 -1540042 +#define SAY_AGGRO2 -1540043 +#define SAY_AGGRO3 -1540044 +#define SAY_SLAY1 -1540045 +#define SAY_SLAY2 -1540046 +#define SAY_DEATH -1540047 + +#define SPELL_BLADE_DANCE 30739 +#define H_SPELL_CHARGE 25821 + +#define TARGET_NUM 5 + +#define MOB_SHATTERED_ASSASSIN 17695 +#define MOB_HEARTHEN_GUARD 17621 +#define MOB_SHARPSHOOTER_GUARD 17622 +#define MOB_REAVER_GUARD 17623 + +float AssassEntrance[3] = {275.136,-84.29,2.3}; // y -8 +float AssassExit[3] = {184.233,-84.29,2.3}; // y -8 +float AddsEntrance[3] = {306.036,-84.29,1.93}; + +struct TRINITY_DLL_DECL boss_warchief_kargath_bladefistAI : public ScriptedAI +{ + boss_warchief_kargath_bladefistAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + ScriptedInstance* pInstance; + bool HeroicMode; + + std::vector adds; + std::vector assassins; + + uint32 Charge_timer; + uint32 Blade_Dance_Timer; + uint32 Summon_Assistant_Timer; + uint32 resetcheck_timer; + uint32 Wait_Timer; + + uint32 Assassins_Timer; + + uint32 summoned; + bool InBlade; + + uint32 target_num; + + void Reset() + { + removeAdds(); + + m_creature->SetSpeed(MOVE_RUN,2); + m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + + summoned = 2; + InBlade = false; + Wait_Timer = 0; + + Charge_timer = 0; + Blade_Dance_Timer = 45000; + Summon_Assistant_Timer = 30000; + Assassins_Timer = 5000; + resetcheck_timer = 5000; + } + + void EnterCombat(Unit *who) + { + switch (rand()%3) + { + case 0:DoScriptText(SAY_AGGRO1, m_creature);break; + case 1:DoScriptText(SAY_AGGRO2, m_creature);break; + case 2:DoScriptText(SAY_AGGRO3, m_creature);break; + } + } + + void JustSummoned(Creature *summoned) + { + switch(summoned->GetEntry()) + { + case MOB_HEARTHEN_GUARD: + case MOB_SHARPSHOOTER_GUARD: + case MOB_REAVER_GUARD: + summoned->AI()->AttackStart(SelectUnit(SELECT_TARGET_RANDOM,0)); + adds.push_back(summoned->GetGUID()); + break; + case MOB_SHATTERED_ASSASSIN: + assassins.push_back(summoned->GetGUID()); + break; + } + } + + void KilledUnit(Unit *victim) + { + if (victim->GetTypeId() == TYPEID_PLAYER) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + } + } + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEATH, m_creature); + removeAdds(); + } + + void MovementInform(uint32 type, uint32 id) + { + if (InBlade) + { + if (type != POINT_MOTION_TYPE) + return; + + if (id != 1) + return; + + if (target_num > 0) // to prevent loops + { + Wait_Timer = 1; + DoCast(m_creature,SPELL_BLADE_DANCE,true); + target_num--; + } + } + } + + void removeAdds() + { + for(std::vector::iterator itr = adds.begin(); itr!= adds.end(); ++itr) + { + Unit* temp = Unit::GetUnit((*m_creature),*itr); + if (temp && temp->isAlive()) + { + (*temp).GetMotionMaster()->Clear(true); + m_creature->DealDamage(temp,temp->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + CAST_CRE(temp)->RemoveCorpse(); + } + } + adds.clear(); + + for(std::vector::iterator itr = assassins.begin(); itr!= assassins.end(); ++itr) + { + Unit* temp = Unit::GetUnit((*m_creature),*itr); + if (temp && temp->isAlive()) + { + (*temp).GetMotionMaster()->Clear(true); + m_creature->DealDamage(temp,temp->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + CAST_CRE(temp)->RemoveCorpse(); + } + } + assassins.clear(); + } + void SpawnAssassin() + { + m_creature->SummonCreature(MOB_SHATTERED_ASSASSIN,AssassEntrance[0],AssassEntrance[1]+8, AssassEntrance[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); + m_creature->SummonCreature(MOB_SHATTERED_ASSASSIN,AssassEntrance[0],AssassEntrance[1]-8, AssassEntrance[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); + m_creature->SummonCreature(MOB_SHATTERED_ASSASSIN,AssassExit[0],AssassExit[1]+8, AssassExit[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); + m_creature->SummonCreature(MOB_SHATTERED_ASSASSIN,AssassExit[0],AssassExit[1]-8, AssassExit[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + if (Assassins_Timer) + if (Assassins_Timer < diff) + { + SpawnAssassin(); + Assassins_Timer = 0; + }else Assassins_Timer -= diff; + + if (InBlade) + { + if (Wait_Timer) + if (Wait_Timer < diff) + { + if (target_num <= 0) + { + // stop bladedance + InBlade = false; + m_creature->SetSpeed(MOVE_RUN,2); + (*m_creature).GetMotionMaster()->MoveChase(m_creature->getVictim()); + Blade_Dance_Timer = 30000; + Wait_Timer = 0; + if (HeroicMode) + Charge_timer = 5000; + } + else + { + //move in bladedance + float x,y,randx,randy; + randx = (rand()%40); + randy = (rand()%40); + x = 210+ randx ; + y = -60- randy ; + (*m_creature).GetMotionMaster()->MovePoint(1,x,y,m_creature->GetPositionZ()); + Wait_Timer = 0; + } + }else Wait_Timer -= diff; + } + else + { + if (Blade_Dance_Timer) + if (Blade_Dance_Timer < diff) + { + target_num = TARGET_NUM; + Wait_Timer = 1; + InBlade = true; + Blade_Dance_Timer = 0; + m_creature->SetSpeed(MOVE_RUN,4); + return; + }else Blade_Dance_Timer -= diff; + + if (Charge_timer) + if (Charge_timer < diff) + { + DoCast(SelectUnit(SELECT_TARGET_RANDOM,0),H_SPELL_CHARGE); + Charge_timer = 0; + }else Charge_timer -= diff; + + if (Summon_Assistant_Timer < diff) + { + Unit* target = NULL; + + for(uint8 i = 0; i < summoned; ++i) + { + switch(rand()%3) + { + case 0: m_creature->SummonCreature(MOB_HEARTHEN_GUARD,AddsEntrance[0],AddsEntrance[1], AddsEntrance[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); break; + case 1: m_creature->SummonCreature(MOB_SHARPSHOOTER_GUARD,AddsEntrance[0],AddsEntrance[1], AddsEntrance[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); break; + case 2: m_creature->SummonCreature(MOB_REAVER_GUARD,AddsEntrance[0],AddsEntrance[1], AddsEntrance[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); break; + } + } + if (rand()%100 < 20) summoned++; + Summon_Assistant_Timer = 25000 + (rand()%10000) ; + }else Summon_Assistant_Timer -= diff; + + DoMeleeAttackIfReady(); + } + + if (resetcheck_timer < diff) + { + uint32 tempx,tempy; + tempx = uint32(m_creature->GetPositionX()); + tempy = uint32(m_creature->GetPositionY()); + if (tempx > 255 || tempx < 205) + { + EnterEvadeMode(); + return; + } + resetcheck_timer = 5000; + }else resetcheck_timer -= diff; + } +}; + +CreatureAI* GetAI_boss_warchief_kargath_bladefist(Creature* pCreature) +{ + return new boss_warchief_kargath_bladefistAI (pCreature); +} + +void AddSC_boss_warchief_kargath_bladefist() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_warchief_kargath_bladefist"; + newscript->GetAI = &GetAI_boss_warchief_kargath_bladefist; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/hellfire_citadel/shattered_halls/def_shattered_halls.h b/src/bindings/scripts/scripts/outland/hellfire_citadel/shattered_halls/def_shattered_halls.h new file mode 100644 index 00000000000..cbfa23ec4e0 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/hellfire_citadel/shattered_halls/def_shattered_halls.h @@ -0,0 +1,14 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_SHATTERED_H +#define DEF_SHATTERED_H + +#define TYPE_NETHEKURSE 1 +#define DATA_NETHEKURSE 2 +#define DATA_NETHEKURSE_DOOR 3 + +#define TYPE_OMROGG 4 +#endif + diff --git a/src/bindings/scripts/scripts/outland/hellfire_citadel/shattered_halls/instance_shattered_halls.cpp b/src/bindings/scripts/scripts/outland/hellfire_citadel/shattered_halls/instance_shattered_halls.cpp new file mode 100644 index 00000000000..864a49a84ba --- /dev/null +++ b/src/bindings/scripts/scripts/outland/hellfire_citadel/shattered_halls/instance_shattered_halls.cpp @@ -0,0 +1,114 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Shattered_Halls +SD%Complete: 50 +SDComment: currently missing info about door. instance not complete +SDCategory: Hellfire Citadel, Shattered Halls +EndScriptData */ + +#include "precompiled.h" +#include "def_shattered_halls.h" + +#define MAX_ENCOUNTER 2 + +#define DOOR_NETHEKURSE 1 + +struct TRINITY_DLL_DECL instance_shattered_halls : public ScriptedInstance +{ + instance_shattered_halls(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + uint64 nethekurseGUID; + uint64 nethekurseDoorGUID; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + nethekurseGUID = 0; + nethekurseDoorGUID = 0; + } + + void OnGameObjectCreate(GameObject* pGo, bool add) + { + switch(pGo->GetEntry()) + { + case DOOR_NETHEKURSE: nethekurseDoorGUID = pGo->GetGUID(); break; + } + } + + void OnCreatureCreate(Creature* pCreature, bool add) + { + switch(pCreature->GetEntry()) + { + case 16807: nethekurseGUID = pCreature->GetGUID(); break; + } + } + + void SetData(uint32 type, uint32 data) + { + switch(type) + { + case TYPE_NETHEKURSE: + m_auiEncounter[0] = data; + break; + case TYPE_OMROGG: + m_auiEncounter[1] = data; + break; + } + } + + uint32 GetData(uint32 type) + { + switch(type) + { + case TYPE_NETHEKURSE: + return m_auiEncounter[0]; + case TYPE_OMROGG: + return m_auiEncounter[1]; + } + return 0; + } + + uint64 GetData64(uint32 data) + { + switch(data) + { + case DATA_NETHEKURSE: + return nethekurseGUID; + case DATA_NETHEKURSE_DOOR: + return nethekurseDoorGUID; + } + return 0; + } +}; + +InstanceData* GetInstanceData_instance_shattered_halls(Map* pMap) +{ + return new instance_shattered_halls(pMap); +} + +void AddSC_instance_shattered_halls() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_shattered_halls"; + newscript->GetInstanceData = &GetInstanceData_instance_shattered_halls; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/tempest_keep/arcatraz/arcatraz.cpp b/src/bindings/scripts/scripts/outland/tempest_keep/arcatraz/arcatraz.cpp new file mode 100644 index 00000000000..fc855b74bd9 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/tempest_keep/arcatraz/arcatraz.cpp @@ -0,0 +1,521 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Arcatraz +SD%Complete: 60 +SDComment: Warden Mellichar, event controller for Skyriss event. Millhouse Manastorm. TODO: make better combatAI for Millhouse. +SDCategory: Tempest Keep, The Arcatraz +EndScriptData */ + +/* ContentData +npc_millhouse_manastorm +npc_warden_mellichar +mob_zerekethvoidzone +EndContentData */ + +#include "precompiled.h" +#include "def_arcatraz.h" + +/*##### +# npc_millhouse_manastorm +#####*/ + +#define SAY_INTRO_1 -1552010 +#define SAY_INTRO_2 -1552011 +#define SAY_WATER -1552012 +#define SAY_BUFFS -1552013 +#define SAY_DRINK -1552014 +#define SAY_READY -1552015 +#define SAY_KILL_1 -1552016 +#define SAY_KILL_2 -1552017 +#define SAY_PYRO -1552018 +#define SAY_ICEBLOCK -1552019 +#define SAY_LOWHP -1552020 +#define SAY_DEATH -1552021 +#define SAY_COMPLETE -1552022 + +#define SPELL_CONJURE_WATER 36879 +#define SPELL_ARCANE_INTELLECT 36880 +#define SPELL_ICE_ARMOR 36881 + +#define SPELL_ARCANE_MISSILES 33833 +#define SPELL_CONE_OF_COLD 12611 +#define SPELL_FIRE_BLAST 13341 +#define SPELL_FIREBALL 14034 +#define SPELL_FROSTBOLT 15497 +#define SPELL_PYROBLAST 33975 + +struct TRINITY_DLL_DECL npc_millhouse_manastormAI : public ScriptedAI +{ + npc_millhouse_manastormAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + uint32 EventProgress_Timer; + uint32 Phase; + bool Init; + bool LowHp; + + uint32 Pyroblast_Timer; + uint32 Fireball_Timer; + + void Reset() + { + EventProgress_Timer = 2000; + LowHp = false; + Init = false; + Phase = 1; + + Pyroblast_Timer = 1000; + Fireball_Timer = 2500; + + if (pInstance) + { + if (pInstance->GetData(TYPE_WARDEN_2) == DONE) + Init = true; + + if (pInstance->GetData(TYPE_HARBINGERSKYRISS) == DONE) + { + DoScriptText(SAY_COMPLETE, m_creature); + } + } + } + + void AttackStart(Unit* pWho) + { + if (m_creature->Attack(pWho, true)) + { + m_creature->AddThreat(pWho, 0.0f); + m_creature->SetInCombatWith(pWho); + pWho->SetInCombatWith(m_creature); + + m_creature->GetMotionMaster()->MoveChase(pWho, 25.0f); + } + } + + void EnterCombat(Unit *who) + { + } + + void KilledUnit(Unit *victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_KILL_1, m_creature); break; + case 1: DoScriptText(SAY_KILL_2, m_creature); break; + } + } + + void JustDied(Unit *victim) + { + DoScriptText(SAY_DEATH, m_creature); + + /*for questId 10886 (heroic mode only) + if (pInstance && pInstance->GetData(TYPE_HARBINGERSKYRISS) != DONE) + ->FailQuest();*/ + } + + void UpdateAI(const uint32 diff) + { + if (!Init) + { + if (EventProgress_Timer < diff) + { + if (Phase < 8) + { + switch(Phase) + { + case 1: + DoScriptText(SAY_INTRO_1, m_creature); + EventProgress_Timer = 18000; + break; + case 2: + DoScriptText(SAY_INTRO_2, m_creature); + EventProgress_Timer = 18000; + break; + case 3: + DoScriptText(SAY_WATER, m_creature); + DoCast(m_creature,SPELL_CONJURE_WATER); + EventProgress_Timer = 7000; + break; + case 4: + DoScriptText(SAY_BUFFS, m_creature); + DoCast(m_creature,SPELL_ICE_ARMOR); + EventProgress_Timer = 7000; + break; + case 5: + DoScriptText(SAY_DRINK, m_creature); + DoCast(m_creature,SPELL_ARCANE_INTELLECT); + EventProgress_Timer = 7000; + break; + case 6: + DoScriptText(SAY_READY, m_creature); + EventProgress_Timer = 6000; + break; + case 7: + if (pInstance) + pInstance->SetData(TYPE_WARDEN_2,DONE); + Init = true; + break; + } + ++Phase; + } + } else EventProgress_Timer -= diff; + } + + if (!UpdateVictim()) + return; + + if (!LowHp && ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 20)) + { + DoScriptText(SAY_LOWHP, m_creature); + LowHp = true; + } + + if (Pyroblast_Timer < diff) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + return; + + DoScriptText(SAY_PYRO, m_creature); + + DoCast(m_creature->getVictim(),SPELL_PYROBLAST); + Pyroblast_Timer = 40000; + }else Pyroblast_Timer -=diff; + + if (Fireball_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_FIREBALL); + Fireball_Timer = 4000; + }else Fireball_Timer -=diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_npc_millhouse_manastorm(Creature* pCreature) +{ + return new npc_millhouse_manastormAI (pCreature); +} + +/*##### +# npc_warden_mellichar +#####*/ + +#define YELL_INTRO1 -1552023 +#define YELL_INTRO2 -1552024 +#define YELL_RELEASE1 -1552025 +#define YELL_RELEASE2A -1552026 +#define YELL_RELEASE2B -1552027 +#define YELL_RELEASE3 -1552028 +#define YELL_RELEASE4 -1552029 +#define YELL_WELCOME -1552030 + +//phase 2(acid mobs) +#define ENTRY_TRICKSTER 20905 +#define ENTRY_PH_HUNTER 20906 +//phase 3 +#define ENTRY_MILLHOUSE 20977 +//phase 4(acid mobs) +#define ENTRY_AKKIRIS 20908 +#define ENTRY_SULFURON 20909 +//phase 5(acid mobs) +#define ENTRY_TW_DRAK 20910 +#define ENTRY_BL_DRAK 20911 +//phase 6 +#define ENTRY_SKYRISS 20912 + +//TARGET_SCRIPT +#define SPELL_TARGET_ALPHA 36856 +#define SPELL_TARGET_BETA 36854 +#define SPELL_TARGET_DELTA 36857 +#define SPELL_TARGET_GAMMA 36858 +#define SPELL_TARGET_OMEGA 36852 +#define SPELL_BUBBLE_VISUAL 36849 + +struct TRINITY_DLL_DECL npc_warden_mellicharAI : public ScriptedAI +{ + npc_warden_mellicharAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + bool IsRunning; + bool CanSpawn; + + uint32 EventProgress_Timer; + uint32 Phase; + + void Reset() + { + IsRunning = false; + CanSpawn = false; + + EventProgress_Timer = 22000; + Phase = 1; + + m_creature->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NON_ATTACKABLE); + DoCast(m_creature,SPELL_TARGET_OMEGA); + + if (pInstance) + pInstance->SetData(TYPE_HARBINGERSKYRISS,NOT_STARTED); + } + + void AttackStart(Unit* who) { } + + void MoveInLineOfSight(Unit *who) + { + if (IsRunning) + return; + + if (!m_creature->getVictim() && who->isTargetableForAttack() && (m_creature->IsHostileTo(who)) && who->isInAccessiblePlaceFor(m_creature)) + { + if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) + return; + if (who->GetTypeId() != TYPEID_PLAYER) + return; + + float attackRadius = m_creature->GetAttackDistance(who)/10; + if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who)) + EnterCombat(who); + } + } + + void EnterCombat(Unit *who) + { + DoScriptText(YELL_INTRO1, m_creature); + DoCast(m_creature,SPELL_BUBBLE_VISUAL); + + if (pInstance) + { + pInstance->SetData(TYPE_HARBINGERSKYRISS,IN_PROGRESS); + pInstance->HandleGameObject(pInstance->GetData64(DATA_SPHERE_SHIELD), false); + IsRunning = true; + } + } + + bool CanProgress() + { + if (pInstance) + { + if (Phase == 7 && pInstance->GetData(TYPE_WARDEN_4) == DONE) + return true; + if (Phase == 6 && pInstance->GetData(TYPE_WARDEN_3) == DONE) + return true; + if (Phase == 5 && pInstance->GetData(TYPE_WARDEN_2) == DONE) + return true; + if (Phase == 4) + return true; + if (Phase == 3 && pInstance->GetData(TYPE_WARDEN_1) == DONE) + return true; + if (Phase == 2 && pInstance->GetData(TYPE_HARBINGERSKYRISS) == IN_PROGRESS) + return true; + if (Phase == 1 && pInstance->GetData(TYPE_HARBINGERSKYRISS) == IN_PROGRESS) + return true; + return false; + } + return false; + } + + void DoPrepareForPhase() + { + if (pInstance) + { + m_creature->InterruptNonMeleeSpells(true); + m_creature->RemoveAurasByType(SPELL_AURA_DUMMY); + + switch(Phase) + { + case 2: + DoCast(m_creature,SPELL_TARGET_ALPHA); + pInstance->SetData(TYPE_WARDEN_1,IN_PROGRESS); + pInstance->HandleGameObject(pInstance->GetData64(DATA_SPHERE_SHIELD), false); + break; + case 3: + DoCast(m_creature,SPELL_TARGET_BETA); + pInstance->SetData(TYPE_WARDEN_2,IN_PROGRESS); + break; + case 5: + DoCast(m_creature,SPELL_TARGET_DELTA); + pInstance->SetData(TYPE_WARDEN_3,IN_PROGRESS); + break; + case 6: + DoCast(m_creature,SPELL_TARGET_GAMMA); + pInstance->SetData(TYPE_WARDEN_4,IN_PROGRESS); + break; + case 7: + pInstance->SetData(TYPE_WARDEN_5,IN_PROGRESS); + break; + } + CanSpawn = true; + } + } + + void UpdateAI(const uint32 diff) + { + if (!IsRunning) + return; + + if (EventProgress_Timer < diff) + { + if (pInstance) + { + if (pInstance->GetData(TYPE_HARBINGERSKYRISS) == FAIL) + Reset(); + } + + if (CanSpawn) + { + //continue beam omega pod, unless we are about to summon skyriss + if (Phase != 7) + DoCast(m_creature,SPELL_TARGET_OMEGA); + + switch(Phase) + { + case 2: + switch(rand()%2) + { + case 0: m_creature->SummonCreature(ENTRY_TRICKSTER,478.326,-148.505,42.56,3.19,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); break; + case 1: m_creature->SummonCreature(ENTRY_PH_HUNTER,478.326,-148.505,42.56,3.19,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); break; + } + break; + case 3: + m_creature->SummonCreature(ENTRY_MILLHOUSE,413.292,-148.378,42.56,6.27,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); + break; + case 4: + DoScriptText(YELL_RELEASE2B, m_creature); + break; + case 5: + switch(rand()%2) + { + case 0: m_creature->SummonCreature(ENTRY_AKKIRIS,420.179,-174.396,42.58,0.02,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); break; + case 1: m_creature->SummonCreature(ENTRY_SULFURON,420.179,-174.396,42.58,0.02,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); break; + } + break; + case 6: + switch(rand()%2) + { + case 0: m_creature->SummonCreature(ENTRY_TW_DRAK,471.795,-174.58,42.58,3.06,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); break; + case 1: m_creature->SummonCreature(ENTRY_BL_DRAK,471.795,-174.58,42.58,3.06,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); break; + } + break; + case 7: + m_creature->SummonCreature(ENTRY_SKYRISS,445.763,-191.639,44.64,1.60,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); + DoScriptText(YELL_WELCOME, m_creature); + break; + } + CanSpawn = false; + ++Phase; + } + if (CanProgress()) + { + switch(Phase) + { + case 1: + DoScriptText(YELL_INTRO2, m_creature); + EventProgress_Timer = 10000; + ++Phase; + break; + case 2: + DoScriptText(YELL_RELEASE1, m_creature); + DoPrepareForPhase(); + EventProgress_Timer = 7000; + break; + case 3: + DoScriptText(YELL_RELEASE2A, m_creature); + DoPrepareForPhase(); + EventProgress_Timer = 10000; + break; + case 4: + DoPrepareForPhase(); + EventProgress_Timer = 15000; + break; + case 5: + DoScriptText(YELL_RELEASE3, m_creature); + DoPrepareForPhase(); + EventProgress_Timer = 15000; + break; + case 6: + DoScriptText(YELL_RELEASE4, m_creature); + DoPrepareForPhase(); + EventProgress_Timer = 15000; + break; + case 7: + DoPrepareForPhase(); + EventProgress_Timer = 15000; + break; + } + } + } else EventProgress_Timer -= diff; + } +}; +CreatureAI* GetAI_npc_warden_mellichar(Creature* pCreature) +{ + return new npc_warden_mellicharAI (pCreature); +} + +/*##### +# mob_zerekethvoidzone (this script probably not needed in future -> `creature_template_addon`.`auras`='36120 0') +#####*/ + +#define SPELL_VOID_ZONE_DAMAGE 36120 + +struct TRINITY_DLL_DECL mob_zerekethvoidzoneAI : public ScriptedAI +{ + mob_zerekethvoidzoneAI(Creature *c) : ScriptedAI(c) {} + + void Reset() + { + m_creature->SetUInt32Value(UNIT_NPC_FLAGS,0); + m_creature->setFaction(16); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + + DoCast(m_creature,SPELL_VOID_ZONE_DAMAGE); + } + + void EnterCombat(Unit* who) {} +}; +CreatureAI* GetAI_mob_zerekethvoidzoneAI(Creature* pCreature) +{ + return new mob_zerekethvoidzoneAI (pCreature); +} + +void AddSC_arcatraz() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="npc_millhouse_manastorm"; + newscript->GetAI = &GetAI_npc_millhouse_manastorm; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_warden_mellichar"; + newscript->GetAI = &GetAI_npc_warden_mellichar; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_zerekethvoidzone"; + newscript->GetAI = &GetAI_mob_zerekethvoidzoneAI; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/tempest_keep/arcatraz/boss_harbinger_skyriss.cpp b/src/bindings/scripts/scripts/outland/tempest_keep/arcatraz/boss_harbinger_skyriss.cpp new file mode 100644 index 00000000000..bcab1a6257f --- /dev/null +++ b/src/bindings/scripts/scripts/outland/tempest_keep/arcatraz/boss_harbinger_skyriss.cpp @@ -0,0 +1,312 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Harbinger_Skyriss +SD%Complete: 45 +SDComment: CombatAI not fully implemented. Timers will need adjustments. Need more docs on how event fully work. Reset all event and force start over if fail at one point? +SDCategory: Tempest Keep, The Arcatraz +EndScriptData */ + +/* ContentData +boss_harbinger_skyriss +boss_harbinger_skyriss_illusion +EndContentData */ + +#include "precompiled.h" +#include "def_arcatraz.h" + +#define SAY_INTRO -1552000 +#define SAY_AGGRO -1552001 +#define SAY_KILL_1 -1552002 +#define SAY_KILL_2 -1552003 +#define SAY_MIND_1 -1552004 +#define SAY_MIND_2 -1552005 +#define SAY_FEAR_1 -1552006 +#define SAY_FEAR_2 -1552007 +#define SAY_IMAGE -1552008 +#define SAY_DEATH -1552009 + +#define SPELL_FEAR 39415 + +#define SPELL_MIND_REND 36924 +#define H_SPELL_MIND_REND 39017 + +#define SPELL_DOMINATION 37162 +#define H_SPELL_DOMINATION 39019 + +#define H_SPELL_MANA_BURN 39020 + +#define SPELL_66_ILLUSION 36931 //entry 21466 +#define SPELL_33_ILLUSION 36932 //entry 21467 + +struct TRINITY_DLL_DECL boss_harbinger_skyrissAI : public ScriptedAI +{ + boss_harbinger_skyrissAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + HeroicMode = m_creature->GetMap()->IsHeroic(); + Intro = false; + } + + ScriptedInstance *pInstance; + bool HeroicMode; + + bool Intro; + bool IsImage33; + bool IsImage66; + + uint32 Intro_Phase; + uint32 Intro_Timer; + uint32 MindRend_Timer; + uint32 Fear_Timer; + uint32 Domination_Timer; + uint32 ManaBurn_Timer; + + void Reset() + { + if (!Intro) + m_creature->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NOT_ATTACKABLE_2); + + IsImage33 = false; + IsImage66 = false; + + Intro_Phase = 1; + Intro_Timer = 5000; + MindRend_Timer = 3000; + Fear_Timer = 15000; + Domination_Timer = 30000; + ManaBurn_Timer = 25000; + } + + void MoveInLineOfSight(Unit *who) + { + if (!Intro) + { + return; + } + ScriptedAI::MoveInLineOfSight(who); + } + + void EnterCombat(Unit *who) {} + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEATH, m_creature); + if (pInstance) + pInstance->SetData(TYPE_HARBINGERSKYRISS,DONE); + } + + void JustSummoned(Creature *summon) + { + if (!summon) + return; + if (IsImage66) + summon->SetHealth((summon->GetMaxHealth()*33)/100); + else + summon->SetHealth((summon->GetMaxHealth()*66)/100); + if (m_creature->getVictim()) + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + summon->AI()->AttackStart(target); + } + + void KilledUnit(Unit* victim) + { + //won't yell killing pet/other unit + if (victim->GetEntry() == 21436) + return; + + switch(rand()%2) + { + case 0: DoScriptText(SAY_KILL_1, m_creature); break; + case 1: DoScriptText(SAY_KILL_2, m_creature); break; + } + } + + void DoSplit(uint32 val) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(false); + + DoScriptText(SAY_IMAGE, m_creature); + + if (val == 66) + DoCast(m_creature, SPELL_66_ILLUSION); + else + DoCast(m_creature, SPELL_33_ILLUSION); + } + + void UpdateAI(const uint32 diff) + { + if (!Intro) + { + if (!pInstance) + return; + + if (Intro_Timer < diff) + { + switch(Intro_Phase) + { + case 1: + DoScriptText(SAY_INTRO, m_creature); + pInstance->HandleGameObject(pInstance->GetData64(DATA_SPHERE_SHIELD), true); + ++Intro_Phase; + Intro_Timer = 25000; + break; + case 2: + DoScriptText(SAY_AGGRO, m_creature); + if (Unit *mellic = Unit::GetUnit(*m_creature,pInstance->GetData64(DATA_MELLICHAR))) + { + //should have a better way to do this. possibly spell exist. + mellic->setDeathState(JUST_DIED); + mellic->SetHealth(0); + pInstance->SetData(TYPE_SHIELD_OPEN,IN_PROGRESS); + } + ++Intro_Phase; + Intro_Timer = 3000; + break; + case 3: + m_creature->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NOT_ATTACKABLE_2); + Intro = true; + break; + } + }else Intro_Timer -=diff; + } + + if (!UpdateVictim()) + return; + + if (!IsImage66 && ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() <= 66)) + { + DoSplit(66); + IsImage66 = true; + } + if (!IsImage33 && ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() <= 33)) + { + DoSplit(33); + IsImage33 = true; + } + + if (MindRend_Timer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,1)) + DoCast(target,HeroicMode ? H_SPELL_MIND_REND : SPELL_MIND_REND); + else + DoCast(m_creature->getVictim(),HeroicMode ? H_SPELL_MIND_REND : SPELL_MIND_REND); + + MindRend_Timer = 8000; + }else MindRend_Timer -=diff; + + if (Fear_Timer < diff) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + return; + + switch(rand()%2) + { + case 0: DoScriptText(SAY_FEAR_1, m_creature); break; + case 1: DoScriptText(SAY_FEAR_2, m_creature); break; + } + + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,1)) + DoCast(target,SPELL_FEAR); + else + DoCast(m_creature->getVictim(),SPELL_FEAR); + + Fear_Timer = 25000; + }else Fear_Timer -=diff; + + if (Domination_Timer < diff) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + return; + + switch(rand()%2) + { + case 0: DoScriptText(SAY_MIND_1, m_creature); break; + case 1: DoScriptText(SAY_MIND_2, m_creature); break; + } + + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,1)) + DoCast(target,HeroicMode ? H_SPELL_DOMINATION : SPELL_DOMINATION); + else + DoCast(m_creature->getVictim(),HeroicMode ? H_SPELL_DOMINATION : SPELL_DOMINATION); + + Domination_Timer = 16000+rand()%16000; + }else Domination_Timer -=diff; + + if (HeroicMode) + { + if (ManaBurn_Timer < diff) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + return; + + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,1)) + DoCast(target,H_SPELL_MANA_BURN); + + ManaBurn_Timer = 16000+rand()%16000; + }else ManaBurn_Timer -=diff; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_harbinger_skyriss(Creature* pCreature) +{ + return new boss_harbinger_skyrissAI (pCreature); +} + +#define SPELL_MIND_REND_IMAGE 36929 +#define H_SPELL_MIND_REND_IMAGE 39021 + +struct TRINITY_DLL_DECL boss_harbinger_skyriss_illusionAI : public ScriptedAI +{ + boss_harbinger_skyriss_illusionAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + ScriptedInstance *pInstance; + bool HeroicMode; + + void Reset() { } + + void EnterCombat(Unit *who) { } +}; + +CreatureAI* GetAI_boss_harbinger_skyriss_illusion(Creature* pCreature) +{ + return new boss_harbinger_skyriss_illusionAI (pCreature); +} + +void AddSC_boss_harbinger_skyriss() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_harbinger_skyriss"; + newscript->GetAI = &GetAI_boss_harbinger_skyriss; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="boss_harbinger_skyriss_illusion"; + newscript->GetAI = &GetAI_boss_harbinger_skyriss_illusion; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/tempest_keep/arcatraz/def_arcatraz.h b/src/bindings/scripts/scripts/outland/tempest_keep/arcatraz/def_arcatraz.h new file mode 100644 index 00000000000..3f8dee8bbd0 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/tempest_keep/arcatraz/def_arcatraz.h @@ -0,0 +1,21 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_ARCATRAZ_H +#define DEF_ARCATRAZ_H + +#define TYPE_ZEREKETH 1 +#define TYPE_DALLIAH 2 +#define TYPE_SOCCOTHRATES 3 +#define TYPE_HARBINGERSKYRISS 4 +#define TYPE_WARDEN_1 5 +#define TYPE_WARDEN_2 6 +#define TYPE_WARDEN_3 7 +#define TYPE_WARDEN_4 8 +#define TYPE_WARDEN_5 9 +#define DATA_MELLICHAR 10 +#define TYPE_SHIELD_OPEN 11 +#define DATA_SPHERE_SHIELD 12 +#endif + diff --git a/src/bindings/scripts/scripts/outland/tempest_keep/arcatraz/instance_arcatraz.cpp b/src/bindings/scripts/scripts/outland/tempest_keep/arcatraz/instance_arcatraz.cpp new file mode 100644 index 00000000000..081c80c56e5 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/tempest_keep/arcatraz/instance_arcatraz.cpp @@ -0,0 +1,238 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Arcatraz +SD%Complete: 80 +SDComment: Mainly Harbringer Skyriss event +SDCategory: Tempest Keep, The Arcatraz +EndScriptData */ + +#include "precompiled.h" +#include "def_arcatraz.h" + +#define MAX_ENCOUNTER 9 + +#define CONTAINMENT_CORE_SECURITY_FIELD_ALPHA 184318 //door opened when Wrath-Scryer Soccothrates dies +#define CONTAINMENT_CORE_SECURITY_FIELD_BETA 184319 //door opened when Dalliah the Doomsayer dies +#define POD_ALPHA 183961 //pod first boss wave +#define POD_BETA 183963 //pod second boss wave +#define POD_DELTA 183964 //pod third boss wave +#define POD_GAMMA 183962 //pod fourth boss wave +#define POD_OMEGA 183965 //pod fifth boss wave +#define WARDENS_SHIELD 184802 // warden shield +#define SEAL_SPHERE 184802 //shield 'protecting' mellichar + +#define MELLICHAR 20904 //skyriss will kill this unit + + +/* Arcatraz encounters: +1 - Zereketh the Unbound event +2 - Dalliah the Doomsayer event +3 - Wrath-Scryer Soccothrates event +4 - Harbinger Skyriss event, 5 sub-events +*/ + +struct TRINITY_DLL_DECL instance_arcatraz : public ScriptedInstance +{ + instance_arcatraz(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + + GameObject *Containment_Core_Security_Field_Alpha; + GameObject *Containment_Core_Security_Field_Beta; + GameObject *Pod_Alpha; + GameObject *Pod_Gamma; + GameObject *Pod_Beta; + GameObject *Pod_Delta; + GameObject *Pod_Omega; + GameObject *Wardens_Shield; + + uint64 GoSphereGUID; + uint64 MellicharGUID; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + Containment_Core_Security_Field_Alpha = NULL; + Containment_Core_Security_Field_Beta = NULL; + Pod_Alpha = NULL; + Pod_Beta = NULL; + Pod_Delta = NULL; + Pod_Gamma = NULL; + Pod_Omega = NULL; + Wardens_Shield = NULL; + + GoSphereGUID = 0; + MellicharGUID = 0; + } + + bool IsEncounterInProgress() const + { + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) + return true; + + return false; + } + + void OnGameObjectCreate(GameObject* pGo, bool add) + { + switch(pGo->GetEntry()) + { + case CONTAINMENT_CORE_SECURITY_FIELD_ALPHA: Containment_Core_Security_Field_Alpha = pGo; break; + case CONTAINMENT_CORE_SECURITY_FIELD_BETA: Containment_Core_Security_Field_Beta = pGo; break; + case SEAL_SPHERE: GoSphereGUID = pGo->GetGUID(); break; + case POD_ALPHA: Pod_Alpha = pGo; break; + case POD_BETA: Pod_Beta = pGo; break; + case POD_DELTA: Pod_Delta = pGo; break; + case POD_GAMMA: Pod_Gamma = pGo; break; + case POD_OMEGA: Pod_Omega = pGo; break; + //case WARDENS_SHIELD: Wardens_Shield = pGo; break; + } + } + + void OnCreatureCreate(Creature* pCreature, bool add) + { + if (pCreature->GetEntry() == MELLICHAR) + MellicharGUID = pCreature->GetGUID(); + } + + void SetData(uint32 type, uint32 data) + { + switch(type) + { + case TYPE_ZEREKETH: + m_auiEncounter[0] = data; + break; + + case TYPE_DALLIAH: + if (data == DONE) + if (Containment_Core_Security_Field_Beta) + Containment_Core_Security_Field_Beta->UseDoorOrButton(); + m_auiEncounter[1] = data; + break; + + case TYPE_SOCCOTHRATES: + if (data == DONE) + if (Containment_Core_Security_Field_Alpha) + Containment_Core_Security_Field_Alpha->UseDoorOrButton(); + m_auiEncounter[2] = data; + break; + + case TYPE_HARBINGERSKYRISS: + if (data == NOT_STARTED || data == FAIL) + { + m_auiEncounter[4] = NOT_STARTED; + m_auiEncounter[5] = NOT_STARTED; + m_auiEncounter[6] = NOT_STARTED; + m_auiEncounter[7] = NOT_STARTED; + m_auiEncounter[8] = NOT_STARTED; + } + m_auiEncounter[3] = data; + break; + + case TYPE_WARDEN_1: + if (data == IN_PROGRESS) + if (Pod_Alpha) + Pod_Alpha->UseDoorOrButton(); + m_auiEncounter[4] = data; + break; + + case TYPE_WARDEN_2: + if (data == IN_PROGRESS) + if (Pod_Beta) + Pod_Beta->UseDoorOrButton(); + m_auiEncounter[5] = data; + break; + + case TYPE_WARDEN_3: + if (data == IN_PROGRESS) + if (Pod_Delta) + Pod_Delta->UseDoorOrButton(); + m_auiEncounter[6] = data; + break; + + case TYPE_WARDEN_4: + if (data == IN_PROGRESS) + if (Pod_Gamma) + Pod_Gamma->UseDoorOrButton(); + m_auiEncounter[7] = data; + break; + + case TYPE_WARDEN_5: + if (data == IN_PROGRESS) + if (Pod_Omega) + Pod_Omega->UseDoorOrButton(); + m_auiEncounter[8] = data; + break; + + case TYPE_SHIELD_OPEN: + if (data == IN_PROGRESS) + if (Wardens_Shield) + Wardens_Shield->UseDoorOrButton(); + break; + } + } + + uint32 GetData(uint32 type) + { + switch(type) + { + case TYPE_HARBINGERSKYRISS: + return m_auiEncounter[3]; + case TYPE_WARDEN_1: + return m_auiEncounter[4]; + case TYPE_WARDEN_2: + return m_auiEncounter[5]; + case TYPE_WARDEN_3: + return m_auiEncounter[6]; + case TYPE_WARDEN_4: + return m_auiEncounter[7]; + case TYPE_WARDEN_5: + return m_auiEncounter[8]; + } + return 0; + } + + uint64 GetData64(uint32 data) + { + switch(data) + { + case DATA_MELLICHAR: + return MellicharGUID; + case DATA_SPHERE_SHIELD: + return GoSphereGUID; + } + return 0; + } +}; + +InstanceData* GetInstanceData_instance_arcatraz(Map* pMap) +{ + return new instance_arcatraz(pMap); +} + +void AddSC_instance_arcatraz() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_arcatraz"; + newscript->GetInstanceData = &GetInstanceData_instance_arcatraz; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/tempest_keep/botanica/boss_high_botanist_freywinn.cpp b/src/bindings/scripts/scripts/outland/tempest_keep/botanica/boss_high_botanist_freywinn.cpp new file mode 100644 index 00000000000..c63fb1b8d58 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/tempest_keep/botanica/boss_high_botanist_freywinn.cpp @@ -0,0 +1,199 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_High_Botanist_Freywinn +SD%Complete: 90 +SDComment: some strange visual related to tree form(if aura lost before normal duration end). possible make summon&transform -process smoother(transform after delay) +SDCategory: Tempest Keep, The Botanica +EndScriptData */ + +#include "precompiled.h" + +#define SAY_AGGRO -1553000 +#define SAY_KILL_1 -1553001 +#define SAY_KILL_2 -1553002 +#define SAY_TREE_1 -1553003 +#define SAY_TREE_2 -1553004 +#define SAY_DEATH -1553005 + +#define SPELL_TRANQUILITY 34550 +#define SPELL_TREE_FORM 34551 + +#define SPELL_SUMMON_FRAYER 34557 +#define ENTRY_FRAYER 19953 + +#define SPELL_PLANT_WHITE 34759 +#define SPELL_PLANT_GREEN 34761 +#define SPELL_PLANT_BLUE 34762 +#define SPELL_PLANT_RED 34763 + +struct TRINITY_DLL_DECL boss_high_botanist_freywinnAI : public ScriptedAI +{ + boss_high_botanist_freywinnAI(Creature *c) : ScriptedAI(c) {} + + std::list Adds_List; + + uint32 SummonSeedling_Timer; + uint32 TreeForm_Timer; + uint32 MoveCheck_Timer; + uint32 DeadAddsCount; + bool MoveFree; + + void Reset() + { + Adds_List.clear(); + + SummonSeedling_Timer = 6000; + TreeForm_Timer = 30000; + MoveCheck_Timer = 1000; + DeadAddsCount = 0; + MoveFree = true; + } + + void EnterCombat(Unit *who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + + void JustSummoned(Creature *summoned) + { + if (summoned->GetEntry() == ENTRY_FRAYER) + Adds_List.push_back(summoned->GetGUID()); + } + + void DoSummonSeedling() + { + switch(rand()%4) + { + case 0: DoCast(m_creature,SPELL_PLANT_WHITE); break; + case 1: DoCast(m_creature,SPELL_PLANT_GREEN); break; + case 2: DoCast(m_creature,SPELL_PLANT_BLUE); break; + case 3: DoCast(m_creature,SPELL_PLANT_RED); break; + } + } + + void KilledUnit(Unit* victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_KILL_1, m_creature); break; + case 1: DoScriptText(SAY_KILL_2, m_creature); break; + } + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (TreeForm_Timer < diff) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_TREE_1, m_creature); break; + case 1: DoScriptText(SAY_TREE_2, m_creature); break; + } + + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(true); + + m_creature->RemoveAllAuras(); + + DoCast(m_creature,SPELL_SUMMON_FRAYER,true); + DoCast(m_creature,SPELL_TRANQUILITY,true); + DoCast(m_creature,SPELL_TREE_FORM,true); + + m_creature->GetMotionMaster()->MoveIdle(); + MoveFree = false; + + TreeForm_Timer = 75000; + }else TreeForm_Timer -= diff; + + if (!MoveFree) + { + if (MoveCheck_Timer < diff) + { + if (!Adds_List.empty()) + { + for(std::list::iterator itr = Adds_List.begin(); itr != Adds_List.end(); ++itr) + { + if (Unit *temp = Unit::GetUnit(*m_creature,*itr)) + { + if (!temp->isAlive()) + { + Adds_List.erase(itr); + ++DeadAddsCount; + break; + } + } + } + } + + if (DeadAddsCount < 3 && TreeForm_Timer-30000 < diff) + DeadAddsCount = 3; + + if (DeadAddsCount >= 3) + { + Adds_List.clear(); + DeadAddsCount = 0; + + m_creature->InterruptNonMeleeSpells(true); + m_creature->RemoveAllAuras(); + m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); + MoveFree = true; + } + MoveCheck_Timer = 500; + } + else MoveCheck_Timer -= diff; + + return; + } + + /*if (m_creature->HasAura(SPELL_TREE_FORM,0) || m_creature->HasAura(SPELL_TRANQUILITY,0)) + return;*/ + + //one random seedling every 5 secs, but not in tree form + if (SummonSeedling_Timer < diff) + { + DoSummonSeedling(); + SummonSeedling_Timer = 6000; + }else SummonSeedling_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_high_botanist_freywinn(Creature* pCreature) +{ + return new boss_high_botanist_freywinnAI (pCreature); +} + +void AddSC_boss_high_botanist_freywinn() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_high_botanist_freywinn"; + newscript->GetAI = &GetAI_boss_high_botanist_freywinn; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/tempest_keep/botanica/boss_laj.cpp b/src/bindings/scripts/scripts/outland/tempest_keep/botanica/boss_laj.cpp new file mode 100644 index 00000000000..ddd5745f93c --- /dev/null +++ b/src/bindings/scripts/scripts/outland/tempest_keep/botanica/boss_laj.cpp @@ -0,0 +1,205 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Laj +SD%Complete: 90 +SDComment: Immunities are wrong, must be adjusted to use resistance from creature_templates. Most spells require database support. +SDCategory: Tempest Keep, The Botanica +EndScriptData */ + +#include "precompiled.h" + +#define EMOTE_SUMMON -1553006 + +#define SPELL_ALLERGIC_REACTION 34697 +#define SPELL_TELEPORT_SELF 34673 + +#define SPELL_SUMMON_LASHER_1 34681 +#define SPELL_SUMMON_FLAYER_1 34682 +#define SPELL_SUMMON_LASHER_2 34684 +#define SPELL_SUMMON_FLAYER_2 34685 +#define SPELL_SUMMON_LASHER_3 34686 +#define SPELL_SUMMON_FLAYER_4 34687 +#define SPELL_SUMMON_LASHER_4 34688 +#define SPELL_SUMMON_FLAYER_3 34690 + +#define MODEL_DEFAULT 13109 +#define MODEL_ARCANE 14213 +#define MODEL_FIRE 13110 +#define MODEL_FROST 14112 +#define MODEL_NATURE 14214 + +struct TRINITY_DLL_DECL boss_lajAI : public ScriptedAI +{ + boss_lajAI(Creature *c) : ScriptedAI(c) {} + + bool CanSummon; + uint32 Teleport_Timer; + uint32 Summon_Timer; + uint32 Transform_Timer; + uint32 Allergic_Timer; + + void Reset() + { + m_creature->SetDisplayId(MODEL_DEFAULT); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, true); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, false); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, false); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, false); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false); + + CanSummon = false; + Teleport_Timer = 20000; + Summon_Timer = 2500; + Transform_Timer = 30000; + Allergic_Timer = 5000; + } + + void DoTransform() + { + switch(rand()%5) + { + case 0: + m_creature->SetDisplayId(MODEL_DEFAULT); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, true); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, false); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, false); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, false); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false); + break; + case 1: + m_creature->SetDisplayId(MODEL_ARCANE); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, false); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, true); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, false); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, false); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false); + break; + case 2: + m_creature->SetDisplayId(MODEL_FIRE); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, false); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, false); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, false); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false); + break; + case 3: + m_creature->SetDisplayId(MODEL_FROST); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, false); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, false); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, false); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false); + break; + case 4: + m_creature->SetDisplayId(MODEL_NATURE); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, false); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, false); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, false); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, false); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, true); + break; + } + } + + void DoSummons() + { + switch(rand()%4) + { + case 0: + DoCast(m_creature,SPELL_SUMMON_LASHER_1,true); + DoCast(m_creature,SPELL_SUMMON_FLAYER_1,true); + break; + case 1: + DoCast(m_creature,SPELL_SUMMON_LASHER_2,true); + DoCast(m_creature,SPELL_SUMMON_FLAYER_2,true); + break; + case 2: + DoCast(m_creature,SPELL_SUMMON_LASHER_3,true); + DoCast(m_creature,SPELL_SUMMON_FLAYER_3,true); + break; + case 3: + DoCast(m_creature,SPELL_SUMMON_LASHER_4,true); + DoCast(m_creature,SPELL_SUMMON_FLAYER_4,true); + break; + } + CanSummon = false; + } + + void EnterCombat(Unit *who) + { + } + + void JustSummoned(Creature *summon) + { + if (summon && m_creature->getVictim()) + summon->AI()->AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 0)); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (CanSummon) + { + if (Summon_Timer < diff) + { + DoScriptText(EMOTE_SUMMON, m_creature); + DoSummons(); + Summon_Timer = 2500; + }else Summon_Timer -= diff; + } + + if (Allergic_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_ALLERGIC_REACTION); + Allergic_Timer = 25000+rand()%15000; + }else Allergic_Timer -= diff; + + if (Teleport_Timer < diff) + { + DoCast(m_creature,SPELL_TELEPORT_SELF); + Teleport_Timer = 30000+rand()%10000; + CanSummon = true; + }else Teleport_Timer -= diff; + + if (Transform_Timer < diff) + { + DoTransform(); + Transform_Timer = 25000+rand()%15000; + }else Transform_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_laj(Creature* pCreature) +{ + return new boss_lajAI (pCreature); +} + +void AddSC_boss_laj() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_laj"; + newscript->GetAI = &GetAI_boss_laj; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/tempest_keep/botanica/boss_warp_splinter.cpp b/src/bindings/scripts/scripts/outland/tempest_keep/botanica/boss_warp_splinter.cpp new file mode 100644 index 00000000000..a9b111be839 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/tempest_keep/botanica/boss_warp_splinter.cpp @@ -0,0 +1,226 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +/* ScriptData +SDName: Boss_Warp_Splinter +SD%Complete: 80 +SDComment: Includes Sapling (need some better control with these). +SDCategory: Tempest Keep, The Botanica +EndScriptData */ + +#include "precompiled.h" + +/*##### +# mob_treant (Sapling) +#####*/ + +#define SPELL_HEAL_FATHER 6262 + +struct TRINITY_DLL_DECL mob_treantAI : public ScriptedAI +{ + mob_treantAI (Creature *c) : ScriptedAI(c) + { + WarpGuid = 0; + } + + uint64 WarpGuid; + uint32 check_Timer; + + void Reset() + { + check_Timer = 0; + } + + void EnterCombat(Unit *who) {} + + void MoveInLineOfSight(Unit* who) {} + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + { + if (WarpGuid && check_Timer < diff) + { + if (Unit *Warp = Unit::GetUnit(*m_creature, WarpGuid)) + { + if (m_creature->IsWithinMeleeRange(Warp,2.5f)) + { + int32 CurrentHP_Treant = (int32)m_creature->GetHealth(); + Warp->CastCustomSpell(Warp,SPELL_HEAL_FATHER,&CurrentHP_Treant, 0, 0, true,0 ,0, m_creature->GetGUID()); + m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + return; + } + m_creature->GetMotionMaster()->MoveFollow(Warp,0,0); + } + check_Timer = 1000; + }else check_Timer -= diff; + return; + } + + if (m_creature->getVictim()->GetGUID() != WarpGuid) + DoMeleeAttackIfReady(); + } +}; + +/*##### +# boss_warp_splinter +#####*/ + +#define SAY_AGGRO -1553007 +#define SAY_SLAY_1 -1553008 +#define SAY_SLAY_2 -1553009 +#define SAY_SUMMON_1 -1553010 +#define SAY_SUMMON_2 -1553011 +#define SAY_DEATH -1553012 + +#define WAR_STOMP 34716 +#define SUMMON_TREANTS 34727 // DBC: 34727, 34731, 34733, 34734, 34736, 34739, 34741 (with Ancestral Life spell 34742) // won't work (guardian summon) +#define ARCANE_VOLLEY (HeroicMode?39133:36705) + +#define CREATURE_TREANT 19949 + +#define TREANT_SPAWN_DIST 50 //50 yards from Warp Splinter's spawn point + +float treant_pos[6][3] = +{ + {24.301233, 427.221100, -27.060635}, + {16.795492, 359.678802, -27.355425}, + {53.493484, 345.381470, -26.196192}, + {61.867096, 439.362732, -25.921030}, + {109.861877, 423.201630, -27.356019}, + {106.780159, 355.582581, -27.593357} +}; + +struct TRINITY_DLL_DECL boss_warp_splinterAI : public ScriptedAI +{ + boss_warp_splinterAI(Creature *c) : ScriptedAI(c) + { + HeroicMode = c->GetMap()->IsHeroic(); + Treant_Spawn_Pos_X = c->GetPositionX(); + Treant_Spawn_Pos_Y = c->GetPositionY(); + } + + uint32 War_Stomp_Timer; + uint32 Summon_Treants_Timer; + uint32 Arcane_Volley_Timer; + bool HeroicMode; + + float Treant_Spawn_Pos_X; + float Treant_Spawn_Pos_Y; + + void Reset() + { + War_Stomp_Timer = 25000 + rand()%15000; + Summon_Treants_Timer = 45000; + Arcane_Volley_Timer = 8000 + rand()%12000; + + m_creature->SetSpeed(MOVE_RUN, 0.7f, true); + } + + void EnterCombat(Unit *who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + + void KilledUnit(Unit* victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature); break; + case 1: DoScriptText(SAY_SLAY_2, m_creature); break; + } + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + + void SummonTreants() + { + for(uint8 i = 0; i < 6; ++i) + { + float angle = (M_PI / 3) * i; + + float X = Treant_Spawn_Pos_X + TREANT_SPAWN_DIST * cos(angle); + float Y = Treant_Spawn_Pos_Y + TREANT_SPAWN_DIST * sin(angle); + float O = - m_creature->GetAngle(X,Y); + + if (Creature *pTreant = m_creature->SummonCreature(CREATURE_TREANT,treant_pos[i][0],treant_pos[i][1],treant_pos[i][2],O,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,25000)) + CAST_AI(mob_treantAI, pTreant->AI())->WarpGuid = m_creature->GetGUID(); + } + switch(rand()%2) + { + case 0: DoScriptText(SAY_SUMMON_1, m_creature); break; + case 1: DoScriptText(SAY_SUMMON_2, m_creature); break; + } + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + //Check for War Stomp + if (War_Stomp_Timer < diff) + { + DoCast(m_creature->getVictim(),WAR_STOMP); + War_Stomp_Timer = 25000 + rand()%15000; + }else War_Stomp_Timer -= diff; + + //Check for Arcane Volley + if (Arcane_Volley_Timer < diff) + { + DoCast(m_creature->getVictim(),ARCANE_VOLLEY); + Arcane_Volley_Timer = 20000 + rand()%15000; + }else Arcane_Volley_Timer -= diff; + + //Check for Summon Treants + if (Summon_Treants_Timer < diff) + { + SummonTreants(); + Summon_Treants_Timer = 45000; + }else Summon_Treants_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_warp_splinter(Creature* pCreature) +{ + return new boss_warp_splinterAI (pCreature); +} + +CreatureAI* GetAI_mob_treant(Creature* pCreature) +{ + return new mob_treantAI (pCreature); +} + +void AddSC_boss_warp_splinter() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_warp_splinter"; + newscript->GetAI = &GetAI_boss_warp_splinter; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_warp_splinter_treant"; + newscript->GetAI = &GetAI_mob_treant; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/tempest_keep/the_eye/boss_alar.cpp b/src/bindings/scripts/scripts/outland/tempest_keep/the_eye/boss_alar.cpp new file mode 100644 index 00000000000..e57f3294a55 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/tempest_keep/the_eye/boss_alar.cpp @@ -0,0 +1,525 @@ +/* Copyright(C) 2006 - 2008 ScriptDev2 +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +*(at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +/* ScriptData +SDName: boss_alar +SD%Complete: 95 +SDComment: +SDCategory: Tempest Keep, The Eye +EndScriptData */ + +#include "precompiled.h" +#include "def_the_eye.h" + +#define SPELL_FLAME_BUFFET 34121 // Flame Buffet - every 1,5 secs in phase 1 if there is no victim in melee range and after Dive Bomb in phase 2 with same conditions +#define SPELL_FLAME_QUILLS 34229 // Randomly after changing position in phase after watching tonns of movies, set probability 20% +#define SPELL_REBIRTH 34342 // Rebirth - beginning of second phase(after loose all health in phase 1) +#define SPELL_REBIRTH_2 35369 // Rebirth(another, without healing to full HP) - after Dive Bomb in phase 2 +#define SPELL_MELT_ARMOR 35410 // Melt Armor - every 60 sec in phase 2 +#define SPELL_CHARGE 35412 // Charge - 30 sec cooldown +#define SPELL_DIVE_BOMB_VISUAL 35367 // Bosskillers says 30 sec cooldown, wowwiki says 30 sec colldown, DBM and BigWigs addons says ~47 sec +#define SPELL_DIVE_BOMB 35181 // after watching tonns of movies, set cooldown to 40+rand()%5. +#define SPELL_BERSERK 45078 // 10 minutes after phase 2 starts(id is wrong, but proper id is unknown) + +#define CREATURE_EMBER_OF_ALAR 19551 // Al'ar summons one Ember of Al'ar every position change in phase 1 and two after Dive Bomb. Also in phase 2 when Ember of Al'ar dies, boss loose 3% health. +#define SPELL_EMBER_BLAST 34133 // When Ember of Al'ar dies, it casts Ember Blast + +#define CREATURE_FLAME_PATCH_ALAR 20602 // Flame Patch - every 30 sec in phase 2 +#define SPELL_FLAME_PATCH 35380 // + +static float waypoint[6][3] = +{ + {340.15, 58.65, 17.71}, + {388.09, 31.54, 20.18}, + {388.18, -32.85, 20.18}, + {340.29, -60.19, 17.72}, + {332, 0.01, 39}, // better not use the same xy coord + {331, 0.01, -2.39} +}; + +enum WaitEventType +{ + WE_NONE = 0, + WE_DUMMY = 1, + WE_PLATFORM = 2, + WE_QUILL = 3, + WE_DIE = 4, + WE_REVIVE = 5, + WE_CHARGE = 6, + WE_METEOR = 7, + WE_DIVE = 8, + WE_LAND = 9, + WE_SUMMON = 10 +}; + +struct TRINITY_DLL_DECL boss_alarAI : public ScriptedAI +{ + boss_alarAI(Creature *c) : ScriptedAI(c) + { + pInstance =c->GetInstanceData(); + DefaultMoveSpeedRate = m_creature->GetSpeedRate(MOVE_RUN); + } + + ScriptedInstance *pInstance; + + WaitEventType WaitEvent; + uint32 WaitTimer; + + bool AfterMoving; + + uint32 Platforms_Move_Timer; + uint32 DiveBomb_Timer; + uint32 MeltArmor_Timer; + uint32 Charge_Timer; + uint32 FlamePatch_Timer; + uint32 Berserk_Timer; + + float DefaultMoveSpeedRate; + + bool Phase1; + bool ForceMove; + uint32 ForceTimer; + + int8 cur_wp; + + void Reset() + { + if (pInstance) + pInstance->SetData(DATA_ALAREVENT, NOT_STARTED); + + Berserk_Timer = 1200000; + Platforms_Move_Timer = 0; + + Phase1 = true; + WaitEvent = WE_NONE; + WaitTimer = 0; + AfterMoving = false; + ForceMove = false; + ForceTimer = 5000; + + cur_wp = 4; + + m_creature->SetDisplayId(m_creature->GetNativeDisplayId()); + m_creature->SetSpeed(MOVE_RUN, DefaultMoveSpeedRate); + //m_creature->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 10); + //m_creature->SetFloatValue(UNIT_FIELD_COMBATREACH, 10); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true); + m_creature->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->setActive(false); + } + + void EnterCombat(Unit *who) + { + if (pInstance) + pInstance->SetData(DATA_ALAREVENT, IN_PROGRESS); + + m_creature->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); // after enterevademode will be set walk movement + DoZoneInCombat(); + m_creature->setActive(true); + } + + void JustDied(Unit *victim) + { + if (pInstance) + pInstance->SetData(DATA_ALAREVENT, DONE); + } + + void JustSummoned(Creature *summon) + { + if (summon->GetEntry() == CREATURE_EMBER_OF_ALAR) + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + summon->AI()->AttackStart(target); + } + + void MoveInLineOfSight(Unit *who) {} + + void AttackStart(Unit* who) + { + if (Phase1) + AttackStartNoMove(who); + else + ScriptedAI::AttackStart(who); + } + + void DamageTaken(Unit* pKiller, uint32 &damage) + { + if (damage >= m_creature->GetHealth() && Phase1) + { + damage = 0; + if (!WaitEvent) + { + WaitEvent = WE_DIE; + WaitTimer = 0; + m_creature->SetHealth(0); + m_creature->InterruptNonMeleeSpells(true); + m_creature->RemoveAllAuras(); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->AttackStop(); + m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0); + m_creature->SetSpeed(MOVE_RUN, 5.0f); + m_creature->GetMotionMaster()->Clear(); + m_creature->GetMotionMaster()->MovePoint(0, waypoint[5][0], waypoint[5][1], waypoint[5][2]); + } + } + } + + void SpellHit(Unit*, const SpellEntry *spell) + { + if (spell->Id == SPELL_DIVE_BOMB_VISUAL) + { + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true); + m_creature->SetDisplayId(11686); + //m_creature->SendUpdateObjectToAllExcept(NULL); + } + } + + void MovementInform(uint32 type, uint32 id) + { + if (type == POINT_MOTION_TYPE) + { + WaitTimer = 1; + AfterMoving = true; + ForceMove = false; + } + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->isInCombat()) // sometimes isincombat but !incombat, faction bug? + return; + + if (Berserk_Timer < diff) + { + m_creature->CastSpell(m_creature, SPELL_BERSERK, true); + Berserk_Timer = 60000; + }else Berserk_Timer -= diff; + + if (ForceMove) + { + if (ForceTimer < diff) + { + m_creature->GetMotionMaster()->MovePoint(0, waypoint[cur_wp][0], waypoint[cur_wp][1], waypoint[cur_wp][2]); + ForceTimer = 5000; + }else ForceTimer -= diff; + + } + if (WaitEvent) + { + if (WaitTimer) + { + if (WaitTimer <= diff) + { + if (AfterMoving) + { + m_creature->GetMotionMaster()->MoveIdle(); + AfterMoving = false; + } + + switch(WaitEvent) + { + case WE_PLATFORM: + Platforms_Move_Timer = 30000+rand()%5000; + break; + case WE_QUILL: + m_creature->CastSpell(m_creature, SPELL_FLAME_QUILLS, true); + Platforms_Move_Timer = 1; + WaitTimer = 10000; + WaitEvent = WE_DUMMY; + return; + case WE_DIE: + m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_DEAD); + WaitTimer = 5000; + WaitEvent = WE_REVIVE; + return; + case WE_REVIVE: + m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_STAND); + m_creature->SetHealth(m_creature->GetMaxHealth()); + m_creature->SetSpeed(MOVE_RUN, DefaultMoveSpeedRate); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + DoResetThreat(); + DoZoneInCombat(); + m_creature->CastSpell(m_creature, SPELL_REBIRTH, true); + MeltArmor_Timer = 60000; + Charge_Timer = 7000; + DiveBomb_Timer = 40000+rand()%5000; + FlamePatch_Timer = 30000; + Phase1 = false; + break; + case WE_METEOR: + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, false); + m_creature->CastSpell(m_creature, SPELL_DIVE_BOMB_VISUAL, false); + WaitEvent = WE_DIVE; + WaitTimer = 4000; + return; + case WE_DIVE: + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + { + m_creature->RemoveAurasDueToSpell(SPELL_DIVE_BOMB_VISUAL); + m_creature->CastSpell(target, SPELL_DIVE_BOMB, true); + float dist; + if (m_creature->IsWithinDist3d(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 5.0f)) dist = 5.0f; + WaitTimer = 1000 + floor(dist / 80 * 1000.0f); + m_creature->GetMap()->CreatureRelocation(m_creature, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(),0.0f); + m_creature->StopMoving(); + WaitEvent = WE_LAND; + } + else + { + EnterEvadeMode(); + return; + } + case WE_LAND: + WaitEvent = WE_SUMMON; + WaitTimer = 2000; + return; + case WE_SUMMON: + for(uint8 i = 0; i < 2; ++i) + DoSpawnCreature(CREATURE_EMBER_OF_ALAR, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + m_creature->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 10); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetDisplayId(m_creature->GetNativeDisplayId()); + m_creature->CastSpell(m_creature, SPELL_REBIRTH_2, true); + break; + case WE_DUMMY: + default: + break; + } + + WaitEvent = WE_NONE; + WaitTimer = 0; + }else WaitTimer -= diff; + } + return; + } + + if (Phase1) + { + if (m_creature->getThreatManager().getThreatList().empty()) + { + EnterEvadeMode(); + return; + } + + if (Platforms_Move_Timer < diff) + { + if (cur_wp == 4) + { + cur_wp = 0; + WaitEvent = WE_PLATFORM; + } + else + { + if (rand()%5) // next platform + { + DoSpawnCreature(CREATURE_EMBER_OF_ALAR, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + if (cur_wp == 3) + cur_wp = 0; + else + cur_wp++; + WaitEvent = WE_PLATFORM; + } + else // flame quill + { + cur_wp = 4; + WaitEvent = WE_QUILL; + } + } + ForceMove = true; + ForceTimer = 5000; + m_creature->GetMotionMaster()->MovePoint(0, waypoint[cur_wp][0], waypoint[cur_wp][1], waypoint[cur_wp][2]); + WaitTimer = 0; + return; + }else Platforms_Move_Timer -= diff; + } + else + { + if (!UpdateVictim()) + return; + + if (Charge_Timer < diff) + { + Unit *target= SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true); + if (target) + DoCast(target, SPELL_CHARGE); + Charge_Timer = 30000; + }else Charge_Timer -= diff; + + if (MeltArmor_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_MELT_ARMOR); + MeltArmor_Timer = 60000; + }else MeltArmor_Timer -= diff; + + if (DiveBomb_Timer < diff) + { + m_creature->AttackStop(); + m_creature->GetMotionMaster()->MovePoint(6, waypoint[4][0], waypoint[4][1], waypoint[4][2]); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 50); + WaitEvent = WE_METEOR; + WaitTimer = 0; + DiveBomb_Timer = 40000+rand()%5000; + return; + }else DiveBomb_Timer -= diff; + + if (FlamePatch_Timer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + { + Creature* Summoned = m_creature->SummonCreature(CREATURE_FLAME_PATCH_ALAR, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 120000); + if (Summoned) + { + Summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + Summoned->SetFloatValue(OBJECT_FIELD_SCALE_X, Summoned->GetFloatValue(OBJECT_FIELD_SCALE_X)*2.5f); + Summoned->SetDisplayId(11686); + Summoned->setFaction(m_creature->getFaction()); + Summoned->SetLevel(m_creature->getLevel()); + Summoned->CastSpell(Summoned, SPELL_FLAME_PATCH, false); + } + } + FlamePatch_Timer = 30000; + }else FlamePatch_Timer -= diff; + } + + DoMeleeAttackIfReady(); + } + + void DoMeleeAttackIfReady() + { + if (m_creature->isAttackReady() && !m_creature->IsNonMeleeSpellCasted(false)) + { + if (m_creature->IsWithinMeleeRange(m_creature->getVictim())) + { + m_creature->AttackerStateUpdate(m_creature->getVictim()); + m_creature->resetAttackTimer(); + } + else + { + Unit *target = NULL; + target = m_creature->SelectNearestTarget(5); + if (Phase1 && target) + m_creature->AI()->AttackStart(target); + else + { + m_creature->CastSpell(m_creature, SPELL_FLAME_BUFFET, true); + m_creature->setAttackTimer(BASE_ATTACK, 1500); + } + } + } + } +}; + +CreatureAI* GetAI_boss_alar(Creature* pCreature) +{ + return new boss_alarAI(pCreature); +} + +struct TRINITY_DLL_DECL mob_ember_of_alarAI : public ScriptedAI +{ + mob_ember_of_alarAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + m_creature->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true); + } + + ScriptedInstance *pInstance; + bool toDie; + + void Reset() {toDie = false;} + void EnterCombat(Unit *who) {DoZoneInCombat();} + void EnterEvadeMode() {m_creature->setDeathState(JUST_DIED);} + + void DamageTaken(Unit* pKiller, uint32 &damage) + { + if (damage >= m_creature->GetHealth() && pKiller != m_creature && !toDie) + { + damage = 0; + m_creature->CastSpell(m_creature, SPELL_EMBER_BLAST, true); + m_creature->SetDisplayId(11686); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + if (pInstance && pInstance->GetData(DATA_ALAREVENT) == 2) + { + if (Unit* Alar = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_ALAR))) + { + int AlarHealth = Alar->GetHealth() - Alar->GetMaxHealth()*0.03; + if (AlarHealth > 0) + Alar->SetHealth(AlarHealth); + else + Alar->SetHealth(1); + } + } + toDie = true; + } + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (toDie) + { + m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + //m_creature->SetVisibility(VISIBILITY_OFF); + } + + DoMeleeAttackIfReady(); + } + +}; + +CreatureAI* GetAI_mob_ember_of_alar(Creature* pCreature) +{ + return new mob_ember_of_alarAI(pCreature); +} + +struct TRINITY_DLL_DECL mob_flame_patch_alarAI : public ScriptedAI +{ + mob_flame_patch_alarAI(Creature *c) : ScriptedAI(c) {} + void Reset() {} + void EnterCombat(Unit *who) {} + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) {} +}; + +CreatureAI* GetAI_mob_flame_patch_alar(Creature* pCreature) +{ + return new mob_flame_patch_alarAI(pCreature); +} + +void AddSC_boss_alar() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_alar"; + newscript->GetAI = &GetAI_boss_alar; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_ember_of_alar"; + newscript->GetAI = &GetAI_mob_ember_of_alar; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_flame_patch_alar"; + newscript->GetAI = &GetAI_mob_flame_patch_alar; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/tempest_keep/the_eye/boss_astromancer.cpp b/src/bindings/scripts/scripts/outland/tempest_keep/the_eye/boss_astromancer.cpp new file mode 100644 index 00000000000..81f3c619bac --- /dev/null +++ b/src/bindings/scripts/scripts/outland/tempest_keep/the_eye/boss_astromancer.cpp @@ -0,0 +1,474 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Astromancer +SD%Complete: 80 +SDComment: +SDCategory: Tempest Keep, The Eye +EndScriptData */ + +#include "precompiled.h" +#include "def_the_eye.h" + +enum +{ + SAY_AGGRO = -1550007, + SAY_SUMMON1 = -1550008, + SAY_SUMMON2 = -1550009, + SAY_KILL1 = -1550010, + SAY_KILL2 = -1550011, + SAY_KILL3 = -1550012, + SAY_DEATH = -1550013, + SAY_VOIDA = -1550014, + SAY_VOIDB = -1550015, + + SPELL_ARCANE_MISSILES = 33031, + SPELL_WRATH_OF_THE_ASTROMANCER = 42783, + SPELL_BLINDING_LIGHT = 33009, + SPELL_FEAR = 34322, + SPELL_VOID_BOLT = 39329, + + SPELL_SPOTLIGHT = 25824, + NPC_ASTROMANCER_SOLARIAN_SPOTLIGHT = 18928, + + NPC_SOLARIUM_AGENT = 18925, + NPC_SOLARIUM_PRIEST = 18806, + + MODEL_HUMAN = 18239, + MODEL_VOIDWALKER = 18988, + + SPELL_SOLARIUM_GREAT_HEAL = 33387, + SPELL_SOLARIUM_HOLY_SMITE = 25054, + SPELL_SOLARIUM_ARCANE_TORRENT = 33390, + + WV_ARMOR = 31000 +}; + +const float CENTER_X = 432.909f; +const float CENTER_Y = -373.424f; +const float CENTER_Z = 17.9608f; +const float CENTER_O = 1.06421f; +const float SMALL_PORTAL_RADIUS = 12.6f; +const float LARGE_PORTAL_RADIUS = 26.0f; +const float PORTAL_Z = 17.005f; + + // x, y, z, o +static float SolarianPos[4] = {432.909, -373.424, 17.9608, 1.06421}; + +struct TRINITY_DLL_DECL boss_high_astromancer_solarianAI : public ScriptedAI +{ + boss_high_astromancer_solarianAI(Creature *c) : ScriptedAI(c), Summons(m_creature) + { + pInstance = c->GetInstanceData(); + + defaultarmor = m_creature->GetArmor(); + defaultsize = m_creature->GetFloatValue(OBJECT_FIELD_SCALE_X); + } + + ScriptedInstance *pInstance; + SummonList Summons; + + uint8 Phase; + + uint32 ArcaneMissiles_Timer; + uint32 m_uiWrathOfTheAstromancer_Timer; + uint32 BlindingLight_Timer; + uint32 Fear_Timer; + uint32 VoidBolt_Timer; + uint32 Phase1_Timer; + uint32 Phase2_Timer; + uint32 Phase3_Timer; + uint32 AppearDelay_Timer; + uint32 defaultarmor; + uint32 Wrath_Timer; + + float defaultsize; + float Portals[3][3]; + + bool AppearDelay; + bool BlindingLight; + + void Reset() + { + ArcaneMissiles_Timer = 2000; + m_uiWrathOfTheAstromancer_Timer = 15000; + BlindingLight_Timer = 41000; + Fear_Timer = 20000; + VoidBolt_Timer = 10000; + Phase1_Timer = 50000; + Phase2_Timer = 10000; + Phase3_Timer = 15000; + AppearDelay_Timer = 2000; + BlindingLight = false; + AppearDelay = false; + Wrath_Timer = 20000+rand()%5000;//twice in phase one + Phase = 1; + Wrath_Timer = 20000+rand()%5000;//twice in phase one + + if (pInstance) + pInstance->SetData(DATA_HIGHASTROMANCERSOLARIANEVENT, NOT_STARTED); + + m_creature->SetArmor(defaultarmor); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetVisibility(VISIBILITY_ON); + m_creature->SetFloatValue(OBJECT_FIELD_SCALE_X, defaultsize); + m_creature->SetDisplayId(MODEL_HUMAN); + + Summons.DespawnAll(); + } + + void KilledUnit(Unit *victim) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_KILL1, m_creature); break; + case 1: DoScriptText(SAY_KILL2, m_creature); break; + case 2: DoScriptText(SAY_KILL3, m_creature); break; + } + } + + void JustDied(Unit *victim) + { + m_creature->SetFloatValue(OBJECT_FIELD_SCALE_X, defaultsize); + m_creature->SetDisplayId(MODEL_HUMAN); + DoScriptText(SAY_DEATH, m_creature); + + if (pInstance) + pInstance->SetData(DATA_HIGHASTROMANCERSOLARIANEVENT, DONE); + } + + void EnterCombat(Unit *who) + { + DoScriptText(SAY_AGGRO, m_creature); + DoZoneInCombat(); + + if (pInstance) + pInstance->SetData(DATA_HIGHASTROMANCERSOLARIANEVENT, IN_PROGRESS); + } + + void SummonMinion(uint32 entry, float x, float y, float z) + { + Creature* Summoned = m_creature->SummonCreature(entry, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + if (Summoned) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + Summoned->AI()->AttackStart(target); + + Summons.Summon(Summoned); + } + } + + float Portal_X(float radius) + { + if ((rand()%2)==1) + radius = -radius; + + return (radius * (float)(rand()%100)/100.0f + CENTER_X); + } + + float Portal_Y(float x, float radius) + { + float z = 0.0f; + + switch(rand()%2) + { + case 0: z = 1; break; + case 1: z = -1; break; + } + return (z*sqrt(radius*radius - (x - CENTER_X)*(x - CENTER_X)) + CENTER_Y); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (AppearDelay) + { + m_creature->StopMoving(); + m_creature->AttackStop(); + if (AppearDelay_Timer < diff) + { + AppearDelay = false; + if (Phase == 2) + { + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetVisibility(VISIBILITY_OFF); + } + AppearDelay_Timer = 2000; + }else AppearDelay_Timer -= diff; + } + + if (Phase == 1) + { + if (BlindingLight_Timer < diff){ + BlindingLight = true; + BlindingLight_Timer = 45000; + }else BlindingLight_Timer -= diff; + + if (Wrath_Timer < diff) + { + m_creature->InterruptNonMeleeSpells(false); + DoCast(SelectTarget(SELECT_TARGET_RANDOM,1,100,true), SPELL_WRATH_OF_THE_ASTROMANCER, true); + Wrath_Timer = 20000+rand()%5000; + }else Wrath_Timer -= diff; + + if (ArcaneMissiles_Timer < diff) + { + if (BlindingLight) + { + DoCast(m_creature->getVictim(), SPELL_BLINDING_LIGHT); + BlindingLight = false; + }else{ + Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0); + + if (!m_creature->HasInArc(2.5f, target)) + target = m_creature->getVictim(); + + if (target) + DoCast(target, SPELL_ARCANE_MISSILES); + } + ArcaneMissiles_Timer = 3000; + }else ArcaneMissiles_Timer -= diff; + + if (m_uiWrathOfTheAstromancer_Timer < diff) + { + m_creature->InterruptNonMeleeSpells(false); + + //Target the tank ? + if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1)) + if (pTarget->GetTypeId() == TYPEID_PLAYER) + { + DoCast(pTarget, SPELL_WRATH_OF_THE_ASTROMANCER); + m_uiWrathOfTheAstromancer_Timer = 25000; + } + else + m_uiWrathOfTheAstromancer_Timer = 1000; + }else m_uiWrathOfTheAstromancer_Timer -= diff; + + //Phase1_Timer + if (Phase1_Timer < diff) + { + Phase = 2; + Phase1_Timer = 50000; + //After these 50 seconds she portals to the middle of the room and disappears, leaving 3 light portals behind. + m_creature->GetMotionMaster()->Clear(); + m_creature->GetMap()->CreatureRelocation(m_creature, CENTER_X, CENTER_Y, CENTER_Z, CENTER_O); + for(uint8 i=0; i<=2; ++i) + { + if (!i) + { + Portals[i][0] = Portal_X(SMALL_PORTAL_RADIUS); + Portals[i][1] = Portal_Y(Portals[i][0], SMALL_PORTAL_RADIUS); + Portals[i][2] = CENTER_Z; + } + else + { + Portals[i][0] = Portal_X(LARGE_PORTAL_RADIUS); + Portals[i][1] = Portal_Y(Portals[i][0], LARGE_PORTAL_RADIUS); + Portals[i][2] = PORTAL_Z; + } + } + if ((abs(Portals[2][0] - Portals[1][0]) < 7) && (abs(Portals[2][1] - Portals[1][1]) < 7)) + { + int i=1; + if (abs(CENTER_X + 26.0f - Portals[2][0]) < 7) + i = -1; + Portals[2][0] = Portals[2][0]+7*i; + Portals[2][1] = Portal_Y(Portals[2][0], LARGE_PORTAL_RADIUS); + } + for (int i=0; i<=2; ++i) + { + if (Creature* Summoned = m_creature->SummonCreature(NPC_ASTROMANCER_SOLARIAN_SPOTLIGHT, Portals[i][0], Portals[i][1], Portals[i][2], CENTER_O, TEMPSUMMON_TIMED_DESPAWN, Phase2_Timer+Phase3_Timer+AppearDelay_Timer+1700)) + { + Summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + Summoned->CastSpell(Summoned, SPELL_SPOTLIGHT, false); + } + } + AppearDelay = true; + }else Phase1_Timer-=diff; + } + else if (Phase == 2) + { + //10 seconds after Solarian disappears, 12 mobs spawn out of the three portals. + m_creature->AttackStop(); + m_creature->StopMoving(); + if (Phase2_Timer < diff) + { + Phase = 3; + for (int i=0; i<=2; ++i) + for (int j=1; j<=4; j++) + SummonMinion(NPC_SOLARIUM_AGENT, Portals[i][0], Portals[i][1], Portals[i][2]); + + DoScriptText(SAY_SUMMON1, m_creature); + Phase2_Timer = 10000; + } else Phase2_Timer -= diff; + } + else if (Phase == 3) + { + m_creature->AttackStop(); + m_creature->StopMoving(); + + //Check Phase3_Timer + if (Phase3_Timer < diff) + { + Phase = 1; + + //15 seconds later Solarian reappears out of one of the 3 portals. Simultaneously, 2 healers appear in the two other portals. + int i = rand()%3; + m_creature->GetMotionMaster()->Clear(); + m_creature->GetMap()->CreatureRelocation(m_creature, Portals[i][0], Portals[i][1], Portals[i][2], CENTER_O); + + for (int j=0; j<=2; j++) + if (j!=i) + SummonMinion(NPC_SOLARIUM_PRIEST, Portals[j][0], Portals[j][1], Portals[j][2]); + + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetVisibility(VISIBILITY_ON); + + DoScriptText(SAY_SUMMON2, m_creature); + AppearDelay = true; + Phase3_Timer = 15000; + }else Phase3_Timer -= diff; + } + else if (Phase == 4) + { + //Fear_Timer + if (Fear_Timer < diff) + { + DoCast(m_creature, SPELL_FEAR); + Fear_Timer = 20000; + }else Fear_Timer -= diff; + + //VoidBolt_Timer + if (VoidBolt_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_VOID_BOLT); + VoidBolt_Timer = 10000; + }else VoidBolt_Timer -= diff; + } + + //When Solarian reaches 20% she will transform into a huge void walker. + if (Phase != 4 && ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth())<20)) + { + Phase = 4; + + //To make sure she wont be invisible or not selecatble + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetVisibility(VISIBILITY_ON); + DoScriptText(SAY_VOIDA, m_creature); + DoScriptText(SAY_VOIDB, m_creature); + m_creature->SetArmor(WV_ARMOR); + m_creature->SetDisplayId(MODEL_VOIDWALKER); + m_creature->SetFloatValue(OBJECT_FIELD_SCALE_X, defaultsize*2.5f); + } + + DoMeleeAttackIfReady(); + } +}; + +struct TRINITY_DLL_DECL mob_solarium_priestAI : public ScriptedAI +{ + mob_solarium_priestAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance *pInstance; + + uint32 healTimer; + uint32 holysmiteTimer; + uint32 aoesilenceTimer; + + void Reset() + { + healTimer = 9000; + holysmiteTimer = 1; + aoesilenceTimer = 15000; + } + + void EnterCombat(Unit *who) + { + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (healTimer < diff) + { + Unit* target = NULL; + + switch(rand()%2) + { + case 0: + if (pInstance) + target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_ASTROMANCER)); + break; + case 1: + target = m_creature; + break; + } + + if (target) + { + DoCast(target,SPELL_SOLARIUM_GREAT_HEAL); + healTimer = 9000; + } + } else healTimer -= diff; + + if (holysmiteTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_SOLARIUM_HOLY_SMITE); + holysmiteTimer = 4000; + } else holysmiteTimer -= diff; + + if (aoesilenceTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_SOLARIUM_ARCANE_TORRENT); + aoesilenceTimer = 13000; + } else aoesilenceTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_solarium_priest(Creature* pCreature) +{ + return new mob_solarium_priestAI (pCreature); +} + +CreatureAI* GetAI_boss_high_astromancer_solarian(Creature* pCreature) +{ + return new boss_high_astromancer_solarianAI (pCreature); +} + +void AddSC_boss_high_astromancer_solarian() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_high_astromancer_solarian"; + newscript->GetAI = &GetAI_boss_high_astromancer_solarian; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_solarium_priest"; + newscript->GetAI = &GetAI_mob_solarium_priest; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/tempest_keep/the_eye/boss_kaelthas.cpp b/src/bindings/scripts/scripts/outland/tempest_keep/the_eye/boss_kaelthas.cpp new file mode 100644 index 00000000000..d341e52ae06 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/tempest_keep/the_eye/boss_kaelthas.cpp @@ -0,0 +1,1515 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Kaelthas +SD%Complete: 60 +SDComment: SQL, weapon scripts, mind control, need correct spells(interruptible/uninterruptible), phoenix spawn location & animation, phoenix behaviour & spawn during gravity lapse +SDCategory: Tempest Keep, The Eye +EndScriptData */ + +#include "precompiled.h" +#include "def_the_eye.h" +#include "WorldPacket.h" + +enum +{ + //kael'thas Speech + SAY_INTRO = -1550016, + SAY_INTRO_CAPERNIAN = -1550017, + SAY_INTRO_TELONICUS = -1550018, + SAY_INTRO_THALADRED = -1550019, + SAY_INTRO_SANGUINAR = -1550020, + SAY_PHASE2_WEAPON = -1550021, + SAY_PHASE3_ADVANCE = -1550022, + SAY_PHASE4_INTRO2 = -1550023, + SAY_PHASE5_NUTS = -1550024, + SAY_SLAY1 = -1550025, + SAY_SLAY2 = -1550026, + SAY_SLAY3 = -1550027, + SAY_MINDCONTROL1 = -1550028, + SAY_MINDCONTROL2 = -1550029, + SAY_GRAVITYLAPSE1 = -1550030, + SAY_GRAVITYLAPSE2 = -1550031, + SAY_SUMMON_PHOENIX1 = -1550032, + SAY_SUMMON_PHOENIX2 = -1550033, + SAY_DEATH = -1550034, + + //Thaladred the Darkener speech + SAY_THALADRED_AGGRO = -1550035, + SAY_THALADRED_DEATH = -1550036, + EMOTE_THALADRED_GAZE = -1550037, + + //Lord Sanguinar speech + SAY_SANGUINAR_AGGRO = -1550038, + SAY_SANGUINAR_DEATH = -1550039, + + //Grand Astromancer Capernian speech + SAY_CAPERNIAN_AGGRO = -1550040, + SAY_CAPERNIAN_DEATH = -1550041, + + //Master Engineer Telonicus speech + SAY_TELONICUS_AGGRO = -1550042, + SAY_TELONICUS_DEATH = -1550043, + + //Phase 2 spells + SPELL_SUMMON_WEAPONS = 36976, + SPELL_SUMMON_WEAPONA = 36958, + SPELL_SUMMON_WEAPONB = 36959, + SPELL_SUMMON_WEAPONC = 36960, + SPELL_SUMMON_WEAPOND = 36961, + SPELL_SUMMON_WEAPONE = 36962, + SPELL_SUMMON_WEAPONF = 36963, + SPELL_SUMMON_WEAPONG = 36964, + SPELL_RES_VISUAL = 24171, + + //Phase 4 spells + SPELL_FIREBALL = 22088, //wrong but works with CastCustomSpell + SPELL_PYROBLAST = 36819, + SPELL_FLAME_STRIKE = 36735, + SPELL_FLAME_STRIKE_VIS = 36730, + SPELL_FLAME_STRIKE_DMG = 36731, + SPELL_ARCANE_DISRUPTION = 36834, + SPELL_SHOCK_BARRIER = 36815, + SPELL_PHOENIX_ANIMATION = 36723, + SPELL_MIND_CONTROL = 32830, + + //Phase 5 spells + SPELL_EXPLODE = 36092, + SPELL_FULLPOWER = 36187, + SPELL_KNOCKBACK = 11027, + SPELL_GRAVITY_LAPSE = 34480, + SPELL_GRAVITY_LAPSE_AURA = 39432, + SPELL_NETHER_BEAM = 35873, + + //Thaladred the Darkener spells + SPELL_PSYCHIC_BLOW = 10689, + SPELL_SILENCE = 30225, + //Lord Sanguinar spells + SPELL_BELLOWING_ROAR = 40636, + //Grand Astromancer Capernian spells + + SPELL_CAPERNIAN_FIREBALL = 36971, + SPELL_CONFLAGRATION = 37018, + SPELL_ARCANE_EXPLOSION = 36970, + //Master Engineer Telonicus spells + SPELL_BOMB = 37036, + SPELL_REMOTE_TOY = 37027, + //Nether Vapor spell + SPELL_NETHER_VAPOR = 35859, + //Phoenix spell + SPELL_BURN = 36720, + SPELL_EMBER_BLAST = 34341, + SPELL_REBIRTH = 41587, + + //Creature IDs + NPC_PHOENIX = 21362, + NPC_PHOENIX_EGG = 21364, + + //Phoenix egg and phoenix model + MODEL_ID_PHOENIX = 19682, + MODEL_ID_PHOENIX_EGG = 20245, + + MAX_ADVISORS = 4 +}; + +uint32 m_auiSpellSummonWeapon[]= +{ + SPELL_SUMMON_WEAPONA, SPELL_SUMMON_WEAPONB, SPELL_SUMMON_WEAPONC, SPELL_SUMMON_WEAPOND, + SPELL_SUMMON_WEAPONE, SPELL_SUMMON_WEAPONF, SPELL_SUMMON_WEAPONG +}; + +const float CAPERNIAN_DISTANCE = 20.0f; //she casts away from the target +const float KAEL_VISIBLE_RANGE = 50.0f; + +const float afGravityPos[3] = {795.0f, 0.0f, 70.0f}; + +#define TIME_PHASE_2_3 120000 +#define TIME_PHASE_3_4 180000 + +//Base AI for Advisors +struct TRINITY_DLL_DECL advisorbase_ai : public ScriptedAI +{ + advisorbase_ai(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = pCreature->GetInstanceData(); + m_bDoubled_Health = false; + } + + ScriptedInstance* m_pInstance; + bool FakeDeath; + bool m_bDoubled_Health; + uint32 DelayRes_Timer; + uint64 DelayRes_Target; + + void Reset() + { + if (m_bDoubled_Health) + { + m_creature->SetMaxHealth(m_creature->GetMaxHealth() / 2); + m_bDoubled_Health = false; + } + + FakeDeath = false; + DelayRes_Timer = 0; + DelayRes_Target = 0; + + m_creature->SetStandState(UNIT_STAND_STATE_STAND); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + + //reset encounter + if (m_pInstance && (m_pInstance->GetData(DATA_KAELTHASEVENT) == 1 || m_pInstance->GetData(DATA_KAELTHASEVENT) == 3)) + { + if (Creature *Kaelthas = Unit::GetCreature((*m_creature), m_pInstance->GetData64(DATA_KAELTHAS))) + Kaelthas->AI()->EnterEvadeMode(); + } + } + + void MoveInLineOfSight(Unit *who) + { + if (!who || FakeDeath || m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + return; + + ScriptedAI::MoveInLineOfSight(who); + } + + void AttackStart(Unit* who) + { + if (!who || FakeDeath || m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + return; + + ScriptedAI::AttackStart(who); + } + + void Revive(Unit* Target) + { + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + // double health for phase 3 + m_creature->SetMaxHealth(m_creature->GetMaxHealth() * 2); + m_bDoubled_Health = true; + m_creature->SetHealth(m_creature->GetMaxHealth()); + m_creature->SetStandState(UNIT_STAND_STATE_STAND); + + DoCast(m_creature, SPELL_RES_VISUAL, false); + DelayRes_Timer = 2000; + } + + void DamageTaken(Unit* pKiller, uint32 &damage) + { + if (damage < m_creature->GetHealth()) + return; + + //Prevent glitch if in fake death + if (FakeDeath && m_pInstance && m_pInstance->GetData(DATA_KAELTHASEVENT) != 0) + { + damage = 0; + return; + } + + //Don't really die in phase 1 & 3, only die after that + if (m_pInstance && m_pInstance->GetData(DATA_KAELTHASEVENT) != 0) + { + //prevent death + damage = 0; + FakeDeath = true; + + m_creature->InterruptNonMeleeSpells(false); + m_creature->SetHealth(0); + m_creature->StopMoving(); + m_creature->ClearComboPointHolders(); + m_creature->RemoveAllAurasOnDeath(); + m_creature->ModifyAuraState(AURA_STATE_HEALTHLESS_20_PERCENT, false); + m_creature->ModifyAuraState(AURA_STATE_HEALTHLESS_35_PERCENT, false); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->ClearAllReactives(); + m_creature->SetUInt64Value(UNIT_FIELD_TARGET,0); + m_creature->GetMotionMaster()->Clear(); + m_creature->GetMotionMaster()->MoveIdle(); + m_creature->SetStandState(UNIT_STAND_STATE_DEAD); + JustDied(pKiller); + } + } + + void UpdateAI(const uint32 diff) + { + if (DelayRes_Timer) + { + if (DelayRes_Timer <= diff) + { + DelayRes_Timer = 0; + FakeDeath = false; + + Unit* Target = Unit::GetUnit((*m_creature), DelayRes_Target); + if (!Target) + Target = m_creature->getVictim(); + + DoResetThreat(); + AttackStart(Target); + m_creature->GetMotionMaster()->Clear(); + m_creature->GetMotionMaster()->MoveChase(Target); + m_creature->AddThreat(Target, 0.0f); + }else DelayRes_Timer -= diff; + } + } + +}; + +//Kael'thas AI +struct TRINITY_DLL_DECL boss_kaelthasAI : public ScriptedAI +{ + boss_kaelthasAI(Creature* pCreature) : ScriptedAI(pCreature), summons(m_creature) + { + m_pInstance = pCreature->GetInstanceData(); + memset(&m_auiAdvisorGuid, 0, sizeof(m_auiAdvisorGuid)); + } + + ScriptedInstance* m_pInstance; + + uint32 Fireball_Timer; + uint32 ArcaneDisruption_Timer; + uint32 Phoenix_Timer; + uint32 ShockBarrier_Timer; + uint32 GravityLapse_Timer; + uint32 GravityLapse_Phase; + uint32 NetherBeam_Timer; + uint32 NetherVapor_Timer; + uint32 FlameStrike_Timer; + uint32 MindControl_Timer; + uint32 Phase; + uint32 PhaseSubphase; //generic + uint32 Phase_Timer; //generic timer + uint32 PyrosCasted; + + bool InGravityLapse; + bool IsCastingFireball; + bool ChainPyros; + + SummonList summons; + + uint64 m_auiAdvisorGuid[MAX_ADVISORS]; + + void Reset() + { + Fireball_Timer = 5000+rand()%10000; + ArcaneDisruption_Timer = 45000; + MindControl_Timer = 40000; + Phoenix_Timer = 50000; + ShockBarrier_Timer = 60000; + FlameStrike_Timer = 30000; + GravityLapse_Timer = 20000; + GravityLapse_Phase = 0; + NetherBeam_Timer = 8000; + NetherVapor_Timer = 10000; + PyrosCasted = 0; + Phase = 0; + InGravityLapse = false; + IsCastingFireball = false; + ChainPyros = false; + + if (m_creature->isInCombat()) + PrepareAdvisors(); + + summons.DespawnAll(); + + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + if (m_pInstance) + m_pInstance->SetData(DATA_KAELTHASEVENT, 0); + } + + void PrepareAdvisors() + { + for(uint8 i = 0; i < MAX_ADVISORS; ++i) + { + if (Creature *pCreature = Unit::GetCreature((*m_creature), m_auiAdvisorGuid[i])) + { + pCreature->Respawn(); + pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + pCreature->setFaction(m_creature->getFaction()); + pCreature->AI()->EnterEvadeMode(); + } + } + } + + void StartEvent() + { + if (!m_pInstance) + return; + + m_auiAdvisorGuid[0] = m_pInstance->GetData64(DATA_THALADREDTHEDARKENER); + m_auiAdvisorGuid[1] = m_pInstance->GetData64(DATA_LORDSANGUINAR); + m_auiAdvisorGuid[2] = m_pInstance->GetData64(DATA_GRANDASTROMANCERCAPERNIAN); + m_auiAdvisorGuid[3] = m_pInstance->GetData64(DATA_MASTERENGINEERTELONICUS); + + if (!m_auiAdvisorGuid[0] || !m_auiAdvisorGuid[1] || !m_auiAdvisorGuid[2] || !m_auiAdvisorGuid[3]) + { + error_log("TSCR: Kael'Thas One or more advisors missing, Skipping Phases 1-3"); + + DoScriptText(SAY_PHASE4_INTRO2, m_creature); + + Phase = 4; + + m_pInstance->SetData(DATA_KAELTHASEVENT, 4); + + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + AttackStart(target); + + } + else + { + PrepareAdvisors(); + + DoScriptText(SAY_INTRO, m_creature); + + m_pInstance->SetData(DATA_KAELTHASEVENT, 1); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + PhaseSubphase = 0; + Phase_Timer = 23000; + Phase = 1; + } + } + + void MoveInLineOfSight(Unit *who) + { + if (!m_creature->hasUnitState(UNIT_STAT_STUNNED) && who->isTargetableForAttack() && + m_creature->IsHostileTo(who) && who->isInAccessiblePlaceFor(m_creature)) + { + if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) + return; + + float attackRadius = m_creature->GetAttackDistance(who); + if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who)) + { + if (!m_creature->getVictim() && Phase >= 4) + { + who->RemoveAurasDueToSpell(SPELL_AURA_MOD_STEALTH); + AttackStart(who); + } + else if (m_creature->GetMap()->IsDungeon()) + { + if (m_pInstance && !m_pInstance->GetData(DATA_KAELTHASEVENT) && !Phase) + StartEvent(); + + who->SetInCombatWith(m_creature); + m_creature->AddThreat(who, 0.0f); + } + } + } + } + + void Aggro(Unit *who) + { + if (m_pInstance && !m_pInstance->GetData(DATA_KAELTHASEVENT) && !Phase) + StartEvent(); + } + + void KilledUnit() + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + case 2: DoScriptText(SAY_SLAY3, m_creature); break; + } + } + + void JustSummoned(Creature* pSummoned) + { + // if not phoenix, then it's one of the 7 weapons + if (pSummoned->GetEntry() != NPC_PHOENIX) + { + if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + pSummoned->AI()->AttackStart(pTarget); + + summons.Summon(pSummoned); + } + } + + void SummonedCreatureDespawn(Creature *summon) {summons.Despawn(summon);} + + void JustDied(Unit* Killer) + { + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + DoScriptText(SAY_DEATH, m_creature); + + summons.DespawnAll(); + + if (m_pInstance) + m_pInstance->SetData(DATA_KAELTHASEVENT, 0); + + for(uint8 i = 0; i < MAX_ADVISORS; ++i) + { + if (Unit* pAdvisor = Unit::GetUnit((*m_creature), m_auiAdvisorGuid[i])) + pAdvisor->DealDamage(pAdvisor, pAdvisor->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + } + } + + void UpdateAI(const uint32 diff) + { + //Phase 1 + switch (Phase) + { + case 1: + { + Unit *target = NULL; + Creature* Advisor = NULL; + + //Subphase switch + switch(PhaseSubphase) + { + //Subphase 1 - Start + case 0: + if (Phase_Timer < diff) + { + DoScriptText(SAY_INTRO_THALADRED, m_creature); + + //start advisor within 7 seconds + Phase_Timer = 7000; + PhaseSubphase++; + }else Phase_Timer -= diff; + break; + + //Subphase 1 - Unlock advisor + case 1: + if (Phase_Timer < diff) + { + Advisor = (Unit::GetCreature((*m_creature), m_auiAdvisorGuid[0])); + + if (Advisor) + { + Advisor->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + Advisor->setFaction(m_creature->getFaction()); + + target = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (target) + Advisor->AI()->AttackStart(target); + } + + PhaseSubphase++; + }else Phase_Timer -= diff; + break; + + //Subphase 2 - Start + case 2: + Advisor = (Unit::GetCreature((*m_creature), m_auiAdvisorGuid[0])); + + if (Advisor && (Advisor->getStandState() == UNIT_STAND_STATE_DEAD)) + { + DoScriptText(SAY_INTRO_SANGUINAR, m_creature); + + //start advisor within 12.5 seconds + Phase_Timer = 12500; + PhaseSubphase++; + } + break; + + //Subphase 2 - Unlock advisor + case 3: + if (Phase_Timer < diff) + { + Advisor = (Unit::GetCreature((*m_creature), m_auiAdvisorGuid[1])); + + if (Advisor) + { + Advisor->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + Advisor->setFaction(m_creature->getFaction()); + + target = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (target) + Advisor->AI()->AttackStart(target); + } + + PhaseSubphase++; + }else Phase_Timer -= diff; + break; + + //Subphase 3 - Start + case 4: + Advisor = (Unit::GetCreature((*m_creature), m_auiAdvisorGuid[1])); + + if (Advisor && (Advisor->getStandState() == UNIT_STAND_STATE_DEAD)) + { + DoScriptText(SAY_INTRO_CAPERNIAN, m_creature); + + //start advisor within 7 seconds + Phase_Timer = 7000; + PhaseSubphase++; + } + break; + + //Subphase 3 - Unlock advisor + case 5: + if (Phase_Timer < diff) + { + Advisor = (Unit::GetCreature((*m_creature), m_auiAdvisorGuid[2])); + + if (Advisor) + { + Advisor->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + Advisor->setFaction(m_creature->getFaction()); + + target = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (target) + Advisor->AI()->AttackStart(target); + } + + PhaseSubphase++; + }else Phase_Timer -= diff; + break; + + //Subphase 4 - Start + case 6: + Advisor = (Unit::GetCreature((*m_creature), m_auiAdvisorGuid[2])); + + if (Advisor && (Advisor->getStandState() == UNIT_STAND_STATE_DEAD)) + { + DoScriptText(SAY_INTRO_TELONICUS, m_creature); + + //start advisor within 8.4 seconds + Phase_Timer = 8400; + PhaseSubphase++; + } + break; + + //Subphase 4 - Unlock advisor + case 7: + if (Phase_Timer < diff) + { + Advisor = (Unit::GetCreature((*m_creature), m_auiAdvisorGuid[3])); + + if (Advisor) + { + Advisor->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + Advisor->setFaction(m_creature->getFaction()); + + target = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (target) + Advisor->AI()->AttackStart(target); + } + + Phase_Timer = 3000; + PhaseSubphase++; + }else Phase_Timer -= diff; + break; + + //End of phase 1 + case 8: + Advisor = (Unit::GetCreature((*m_creature), m_auiAdvisorGuid[3])); + + if (Advisor && (Advisor->getStandState() == UNIT_STAND_STATE_DEAD)) + { + Phase = 2; + m_pInstance->SetData(DATA_KAELTHASEVENT, 2); + + DoScriptText(SAY_PHASE2_WEAPON, m_creature); + + PhaseSubphase = 0; + Phase_Timer = 3500; + DoCast(m_creature, SPELL_SUMMON_WEAPONS); + } + break; + } + }break; + + case 2: + { + if (PhaseSubphase == 0) + { + if (Phase_Timer < diff) + { + PhaseSubphase = 1; + }else Phase_Timer -= diff; + } + + //Spawn weapons + if (PhaseSubphase == 1) + { + m_creature->CastSpell(m_creature, SPELL_SUMMON_WEAPONS, false); + + uint8 uiMaxWeapon = sizeof(m_auiSpellSummonWeapon)/sizeof(uint32); + + for (uint32 i = 0; i < uiMaxWeapon; ++i) + m_creature->CastSpell(m_creature,m_auiSpellSummonWeapon[i],true); + + PhaseSubphase = 2; + Phase_Timer = TIME_PHASE_2_3; + } + + if (PhaseSubphase == 2) + { + if (Phase_Timer < diff) + { + DoScriptText(SAY_PHASE3_ADVANCE, m_creature); + m_pInstance->SetData(DATA_KAELTHASEVENT, 3); + Phase = 3; + PhaseSubphase = 0; + }else Phase_Timer -= diff; + } + }break; + + case 3: + { + if (PhaseSubphase == 0) + { + //Respawn advisors + Unit* Target = SelectUnit(SELECT_TARGET_RANDOM, 0); + + Creature* Advisor; + for (uint32 i = 0; i < MAX_ADVISORS; ++i) + { + Advisor = (Unit::GetCreature((*m_creature), m_auiAdvisorGuid[i])); + + if (!Advisor) + error_log("SD2: Kael'Thas Advisor %u does not exist. Possibly despawned? Incorrectly Killed?", i); + else + CAST_AI(advisorbase_ai, Advisor->AI())->Revive(Target); + } + + PhaseSubphase = 1; + Phase_Timer = TIME_PHASE_3_4; + } + + if (Phase_Timer < diff) + { + DoScriptText(SAY_PHASE4_INTRO2, m_creature); + Phase = 4; + + m_pInstance->SetData(DATA_KAELTHASEVENT, 4); + + // Sometimes people can collect Aggro in Phase 1-3. Reset threat before releasing Kael. + DoResetThreat(); + + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + AttackStart(target); + + Phase_Timer = 30000; + }else Phase_Timer -= diff; + } + break; + + case 4: + case 5: + case 6: + { + //Return since we have no target + if (!UpdateVictim()) + return; + + //Fireball_Timer + if (!InGravityLapse && !ChainPyros && Phase != 5) + { + if (Fireball_Timer < diff) + { + if (!IsCastingFireball) + { + if (!m_creature->IsNonMeleeSpellCasted(false)) + { + //interruptable + m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_INTERRUPT_CAST, false); + int32 dmg = 20000+rand()%5000; + m_creature->CastCustomSpell(m_creature->getVictim(), SPELL_FIREBALL, &dmg, 0, 0, false); + IsCastingFireball = true; + Fireball_Timer = 2500; + } + } + else + { + //apply resistance + m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_INTERRUPT_CAST, true); + IsCastingFireball = false; + Fireball_Timer = 5000+rand()%10000; + } + }else Fireball_Timer -= diff; + + //ArcaneDisruption_Timer + if (ArcaneDisruption_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_ARCANE_DISRUPTION, true); + ArcaneDisruption_Timer = 60000; + }else ArcaneDisruption_Timer -= diff; + + if (FlameStrike_Timer < diff) + { + if (Unit* pUnit = SelectUnit(SELECT_TARGET_RANDOM, 0)) + DoCast(pUnit, SPELL_FLAME_STRIKE); + + FlameStrike_Timer = 30000; + }FlameStrike_Timer -= diff; + + if (MindControl_Timer < diff) + { + if (m_creature->getThreatManager().getThreatList().size() >= 2) + for (uint32 i = 0; i < 3; ++i) + { + debug_log("SD2: Kael'Thas mind control not supported."); + //DoCast(pUnit, SPELL_MIND_CONTROL); + } + + MindControl_Timer = 60000; + }MindControl_Timer -= diff; + } + + //Phoenix_Timer + if (Phoenix_Timer < diff) + { + DoCast(m_creature, SPELL_PHOENIX_ANIMATION); + + if (Creature* pPhoenix = m_creature->SummonCreature(NPC_PHOENIX, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45000)) + { + if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + pPhoenix->AI()->AttackStart(pTarget); + } + else + error_log("SD2: Kael'Thas Phoenix could not be spawned"); + + switch(rand()%2) + { + case 0: DoScriptText(SAY_SUMMON_PHOENIX1, m_creature); break; + case 1: DoScriptText(SAY_SUMMON_PHOENIX2, m_creature); break; + } + + Phoenix_Timer = 60000; + }else Phoenix_Timer -= diff; + + //Phase 4 specific spells + if (Phase == 4) + { + if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 50) + { + m_pInstance->SetData(DATA_KAELTHASEVENT, 4); + Phase = 5; + Phase_Timer = 10000; + + DoScriptText(SAY_PHASE5_NUTS, m_creature); + + m_creature->StopMoving(); + m_creature->GetMotionMaster()->Clear(); + m_creature->GetMotionMaster()->MoveIdle(); + m_creature->GetMap()->CreatureRelocation(m_creature, afGravityPos[0], afGravityPos[1], afGravityPos[2], 0); + m_creature->SendMonsterMove(afGravityPos[0], afGravityPos[1], afGravityPos[2], 0, 0, 0); + + m_creature->InterruptNonMeleeSpells(false); + DoCast(m_creature, SPELL_FULLPOWER); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + } + + //ShockBarrier_Timer + if (ShockBarrier_Timer < diff) + { + DoCast(m_creature, SPELL_SHOCK_BARRIER); + ChainPyros = true; + PyrosCasted = 0; + ShockBarrier_Timer = 60000; + }else ShockBarrier_Timer -= diff; + + //Chain Pyros (3 of them max) + if (ChainPyros && !m_creature->IsNonMeleeSpellCasted(false)) + { + if (PyrosCasted < 3) + { + DoCast(m_creature->getVictim(), SPELL_PYROBLAST); + PyrosCasted++; + + } + else + { + ChainPyros = false; + Fireball_Timer = 2500; + ArcaneDisruption_Timer = 60000; + } + } + } + + if (Phase == 5) + { + if (Phase_Timer < diff) + { + m_creature->InterruptNonMeleeSpells(false); + m_creature->RemoveAurasDueToSpell(SPELL_FULLPOWER); + + DoCast(m_creature, SPELL_EXPLODE); + + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + Phase = 6; + AttackStart(m_creature->getVictim()); + }else Phase_Timer -= diff; + } + + //Phase 5 + if (Phase == 6) + { + + //GravityLapse_Timer + if (GravityLapse_Timer < diff) + { + std::list::iterator i = m_creature->getThreatManager().getThreatList().begin(); + switch(GravityLapse_Phase) + { + case 0: + m_creature->StopMoving(); + m_creature->GetMotionMaster()->Clear(); + m_creature->GetMotionMaster()->MoveIdle(); + m_creature->GetMap()->CreatureRelocation(m_creature, afGravityPos[0], afGravityPos[1], afGravityPos[2], 0); + m_creature->SendMonsterMove(afGravityPos[0], afGravityPos[1], afGravityPos[2], 0, MOVEMENTFLAG_NONE, 0); + + // 1) Kael'thas will portal the whole raid right into his body + for (i = m_creature->getThreatManager().getThreatList().begin(); i!= m_creature->getThreatManager().getThreatList().end(); ++i) + { + Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid()); + if (pUnit && (pUnit->GetTypeId() == TYPEID_PLAYER)) + { + //Use work around packet to prevent player from being dropped from combat + DoTeleportPlayer(pUnit, afGravityPos[0], afGravityPos[1], afGravityPos[2], pUnit->GetOrientation()); + } + } + + GravityLapse_Timer = 500; + ++GravityLapse_Phase; + InGravityLapse = true; + ShockBarrier_Timer = 1000; + NetherBeam_Timer = 5000; + break; + + case 1: + switch(rand()%2) + { + case 0: DoScriptText(SAY_GRAVITYLAPSE1, m_creature); break; + case 1: DoScriptText(SAY_GRAVITYLAPSE2, m_creature); break; + } + + // 2) At that point he will put a Gravity Lapse debuff on everyone + for (i = m_creature->getThreatManager().getThreatList().begin(); i!= m_creature->getThreatManager().getThreatList().end(); ++i) + { + if (Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid())) + { + m_creature->CastSpell(pUnit, SPELL_KNOCKBACK, true); + //Gravity lapse - needs an exception in Spell system to work + + pUnit->CastSpell(pUnit, SPELL_GRAVITY_LAPSE, true, 0, 0, m_creature->GetGUID()); + pUnit->CastSpell(pUnit, SPELL_GRAVITY_LAPSE_AURA, true, 0, 0, m_creature->GetGUID()); + + //Using packet workaround + WorldPacket data(12); + data.SetOpcode(SMSG_MOVE_SET_CAN_FLY); + data.append(pUnit->GetPackGUID()); + data << uint32(0); + pUnit->SendMessageToSet(&data, true); + } + } + GravityLapse_Timer = 10000; + GravityLapse_Phase++; + break; + + case 2: + //Cast nether vapor aura on self + m_creature->InterruptNonMeleeSpells(false); + DoCast(m_creature, SPELL_NETHER_VAPOR); + + GravityLapse_Timer = 20000; + GravityLapse_Phase++; + break; + + case 3: + //Remove flight + for (i = m_creature->getThreatManager().getThreatList().begin(); i!= m_creature->getThreatManager().getThreatList().end(); ++i) + { + if (Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid())) + { + //Using packet workaround + WorldPacket data(12); + data.SetOpcode(SMSG_MOVE_UNSET_CAN_FLY); + data.append(pUnit->GetPackGUID()); + data << uint32(0); + pUnit->SendMessageToSet(&data, true); + } + } + + m_creature->RemoveAurasDueToSpell(SPELL_NETHER_VAPOR); + InGravityLapse = false; + GravityLapse_Timer = 60000; + GravityLapse_Phase = 0; + AttackStart(m_creature->getVictim()); + break; + } + }else GravityLapse_Timer -= diff; + + if (InGravityLapse) + { + //ShockBarrier_Timer + if (ShockBarrier_Timer < diff) + { + DoCast(m_creature, SPELL_SHOCK_BARRIER); + ShockBarrier_Timer = 20000; + }else ShockBarrier_Timer -= diff; + + //NetherBeam_Timer + if (NetherBeam_Timer < diff) + { + if (Unit* pUnit = SelectUnit(SELECT_TARGET_RANDOM, 0)) + DoCast(pUnit, SPELL_NETHER_BEAM); + + NetherBeam_Timer = 4000; + }else NetherBeam_Timer -= diff; + } + } + + if (!InGravityLapse) + DoMeleeAttackIfReady(); + } + } + } +}; + +//Thaladred the Darkener AI +struct TRINITY_DLL_DECL boss_thaladred_the_darkenerAI : public advisorbase_ai +{ + boss_thaladred_the_darkenerAI(Creature* pCreature) : advisorbase_ai(pCreature) {} + + uint32 Gaze_Timer; + uint32 Silence_Timer; + uint32 PsychicBlow_Timer; + + void Reset() + { + Gaze_Timer = 100; + Silence_Timer = 20000; + PsychicBlow_Timer = 10000; + + advisorbase_ai::Reset(); + } + + void Aggro(Unit *who) + { + if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + return; + + if (!who || FakeDeath) + return; + + DoScriptText(SAY_THALADRED_AGGRO, m_creature); + m_creature->AddThreat(who, 5000000.0f); + } + + void JustDied(Unit* pKiller) + { + if (m_pInstance && m_pInstance->GetData(DATA_KAELTHASEVENT) == 3) + DoScriptText(SAY_THALADRED_DEATH, m_creature); + } + + void UpdateAI(const uint32 diff) + { + advisorbase_ai::UpdateAI(diff); + + //Faking death, don't do anything + if (FakeDeath) + return; + + //Return since we have no target + if (!UpdateVictim()) + return; + + //Gaze_Timer + if (Gaze_Timer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + { + DoResetThreat(); + m_creature->AddThreat(target, 5000000.0f); + DoScriptText(EMOTE_THALADRED_GAZE, m_creature, target); + Gaze_Timer = 8500; + } + }else Gaze_Timer -= diff; + + //Silence_Timer + if (Silence_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_SILENCE); + Silence_Timer = 20000; + }else Silence_Timer -= diff; + + //PsychicBlow_Timer + if (PsychicBlow_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_PSYCHIC_BLOW); + PsychicBlow_Timer = 20000+rand()%5000; + }else PsychicBlow_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +//Lord Sanguinar AI +struct TRINITY_DLL_DECL boss_lord_sanguinarAI : public advisorbase_ai +{ + boss_lord_sanguinarAI(Creature* pCreature) : advisorbase_ai(pCreature) {} + + uint32 Fear_Timer; + + void Reset() + { + Fear_Timer = 20000; + advisorbase_ai::Reset(); + } + + void Aggro(Unit *who) + { + if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + return; + + if (!who || FakeDeath) + return; + + DoScriptText(SAY_SANGUINAR_AGGRO, m_creature); + } + + void JustDied(Unit* Killer) + { + if (m_pInstance && m_pInstance->GetData(DATA_KAELTHASEVENT) == 3) + DoScriptText(SAY_SANGUINAR_DEATH, m_creature); + } + + void UpdateAI(const uint32 diff) + { + advisorbase_ai::UpdateAI(diff); + + //Faking death, don't do anything + if (FakeDeath) + return; + + //Return since we have no target + if (!UpdateVictim()) + return; + + //Fear_Timer + if (Fear_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_BELLOWING_ROAR); + Fear_Timer = 25000+rand()%10000; //approximately every 30 seconds + }else Fear_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +//Grand Astromancer Capernian AI +struct TRINITY_DLL_DECL boss_grand_astromancer_capernianAI : public advisorbase_ai +{ + boss_grand_astromancer_capernianAI(Creature* pCreature) : advisorbase_ai(pCreature) {} + + uint32 Fireball_Timer; + uint32 Conflagration_Timer; + uint32 ArcaneExplosion_Timer; + uint32 Yell_Timer; + bool Yell; + + void Reset() + { + Fireball_Timer = 2000; + Conflagration_Timer = 20000; + ArcaneExplosion_Timer = 5000; + Yell_Timer = 2000; + Yell = false; + + advisorbase_ai::Reset(); + } + + void JustDied(Unit* pKiller) + { + if (m_pInstance && m_pInstance->GetData(DATA_KAELTHASEVENT) == 3) + DoScriptText(SAY_CAPERNIAN_DEATH, m_creature); + } + + void AttackStart(Unit* who) + { + if (!who || FakeDeath || m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + return; + + if (m_creature->Attack(who, true)) + { + m_creature->AddThreat(who, 0.0f); + m_creature->SetInCombatWith(who); + who->SetInCombatWith(m_creature); + + m_creature->GetMotionMaster()->MoveChase(who, CAPERNIAN_DISTANCE); + } + } + + void Aggro(Unit *who) + { + if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + return; + + if (!who || FakeDeath) + return; + } + + void UpdateAI(const uint32 diff) + { + advisorbase_ai::UpdateAI(diff); + + //Faking Death, don't do anything + if (FakeDeath) + return; + + //Return since we have no target + if (!UpdateVictim()) + return; + + //Yell_Timer + if (!Yell) + { + if (Yell_Timer < diff) + { + DoScriptText(SAY_CAPERNIAN_AGGRO, m_creature); + Yell = true; + }else Yell_Timer -= diff; + } + + //Fireball_Timer + if (Fireball_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_CAPERNIAN_FIREBALL); + Fireball_Timer = 4000; + }else Fireball_Timer -= diff; + + //Conflagration_Timer + if (Conflagration_Timer < diff) + { + Unit *target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM, 0); + + if (target && m_creature->IsWithinDistInMap(target, 30)) + DoCast(target, SPELL_CONFLAGRATION); + else + DoCast(m_creature->getVictim(), SPELL_CONFLAGRATION); + + Conflagration_Timer = 10000+rand()%5000; + }else Conflagration_Timer -= diff; + + //ArcaneExplosion_Timer + if (ArcaneExplosion_Timer < diff) + { + bool InMeleeRange = false; + Unit *target = NULL; + std::list& m_threatlist = m_creature->getThreatManager().getThreatList(); + for (std::list::iterator i = m_threatlist.begin(); i!= m_threatlist.end(); ++i) + { + Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid()); + //if in melee range + if (pUnit && pUnit->IsWithinDistInMap(m_creature, 5)) + { + InMeleeRange = true; + target = pUnit; + break; + } + } + + if (InMeleeRange) + DoCast(target, SPELL_ARCANE_EXPLOSION); + + ArcaneExplosion_Timer = 4000+rand()%2000; + }else ArcaneExplosion_Timer -= diff; + + //Do NOT deal any melee damage. + } +}; + +//Master Engineer Telonicus AI +struct TRINITY_DLL_DECL boss_master_engineer_telonicusAI : public advisorbase_ai +{ + boss_master_engineer_telonicusAI(Creature* pCreature) : advisorbase_ai(pCreature) {} + + uint32 Bomb_Timer; + uint32 RemoteToy_Timer; + + void Reset() + { + Bomb_Timer = 10000; + RemoteToy_Timer = 5000; + + advisorbase_ai::Reset(); + } + + void JustDied(Unit* pKiller) + { + if (m_pInstance && m_pInstance->GetData(DATA_KAELTHASEVENT) == 3) + DoScriptText(SAY_TELONICUS_DEATH, m_creature); + } + + void Aggro(Unit *who) + { + if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + return; + + if (!who || FakeDeath) + return; + + DoScriptText(SAY_TELONICUS_AGGRO, m_creature); + } + + void UpdateAI(const uint32 diff) + { + advisorbase_ai::UpdateAI(diff); + + //Faking Death, do nothing + if (FakeDeath) + return; + + //Return since we have no target + if (!UpdateVictim()) + return; + + //Bomb_Timer + if (Bomb_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_BOMB); + Bomb_Timer = 25000; + }else Bomb_Timer -= diff; + + //RemoteToy_Timer + if (RemoteToy_Timer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + DoCast(target, SPELL_REMOTE_TOY); + + RemoteToy_Timer = 10000+rand()%5000; + }else RemoteToy_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +//Flame Strike AI +struct TRINITY_DLL_DECL mob_kael_flamestrikeAI : public ScriptedAI +{ + mob_kael_flamestrikeAI(Creature* pCreature) : ScriptedAI(pCreature) {} + + uint32 Timer; + bool Casting; + bool KillSelf; + + void Reset() + { + Timer = 5000; + Casting = false; + KillSelf = false; + + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->setFaction(14); + } + + void MoveInLineOfSight(Unit *who) { } + + void UpdateAI(const uint32 diff) + { + if (!Casting) + { + DoCast(m_creature, SPELL_FLAME_STRIKE_VIS); + Casting = true; + } + + //Timer + if (Timer < diff) + { + if (!KillSelf) + { + m_creature->InterruptNonMeleeSpells(false); + DoCast(m_creature, SPELL_FLAME_STRIKE_DMG); + }else m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + + KillSelf = true; + Timer = 1000; + }else Timer -= diff; + } +}; + +//Phoenix AI +struct TRINITY_DLL_DECL mob_phoenix_tkAI : public ScriptedAI +{ + mob_phoenix_tkAI(Creature* pCreature) : ScriptedAI(pCreature) {} + + uint32 Cycle_Timer; + + void Reset() + { + Cycle_Timer = 2000; + m_creature->CastSpell(m_creature,SPELL_BURN,true); + } + + void JustDied(Unit* killer) + { + //is this spell in use anylonger? + //m_creature->CastSpell(m_creature,SPELL_EMBER_BLAST,true); + m_creature->SummonCreature(NPC_PHOENIX_EGG,m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ(),m_creature->GetOrientation(),TEMPSUMMON_TIMED_DESPAWN,16000); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (Cycle_Timer < diff) + { + //spell Burn should possible do this, but it doesn't, so do this for now. + uint32 dmg = urand(4500,5500); + if (m_creature->GetHealth() > dmg) + m_creature->SetHealth(uint32(m_creature->GetHealth()-dmg)); + Cycle_Timer = 2000; + }else Cycle_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +//Phoenix Egg AI +struct TRINITY_DLL_DECL mob_phoenix_egg_tkAI : public ScriptedAI +{ + mob_phoenix_egg_tkAI(Creature* pCreature) : ScriptedAI(pCreature) {} + + uint32 Rebirth_Timer; + + void Reset() + { + Rebirth_Timer = 15000; + } + + //ignore any + void MoveInLineOfSight(Unit* who) { return; } + + void AttackStart(Unit* who) + { + if (m_creature->Attack(who, false)) + { + m_creature->SetInCombatWith(who); + who->SetInCombatWith(m_creature); + + DoStartNoMovement(who); + } + } + + void JustSummoned(Creature* summoned) + { + summoned->AddThreat(m_creature->getVictim(), 0.0f); + summoned->CastSpell(summoned,SPELL_REBIRTH,false); + } + + void UpdateAI(const uint32 diff) + { + if (!Rebirth_Timer) + return; + + if (Rebirth_Timer <= diff) + { + m_creature->SummonCreature(NPC_PHOENIX,m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ(),m_creature->GetOrientation(),TEMPSUMMON_CORPSE_DESPAWN,5000); + Rebirth_Timer = 0; + }else Rebirth_Timer -= diff; + } +}; + +CreatureAI* GetAI_boss_kaelthas(Creature* pCreature) +{ + return new boss_kaelthasAI(pCreature); +} + +CreatureAI* GetAI_boss_thaladred_the_darkener(Creature* pCreature) +{ + return new boss_thaladred_the_darkenerAI(pCreature); +} + +CreatureAI* GetAI_boss_lord_sanguinar(Creature* pCreature) +{ + return new boss_lord_sanguinarAI(pCreature); +} + +CreatureAI* GetAI_boss_grand_astromancer_capernian(Creature* pCreature) +{ + return new boss_grand_astromancer_capernianAI(pCreature); +} + +CreatureAI* GetAI_boss_master_engineer_telonicus(Creature* pCreature) +{ + return new boss_master_engineer_telonicusAI(pCreature); +} + +CreatureAI* GetAI_mob_kael_flamestrike(Creature* pCreature) +{ + return new mob_kael_flamestrikeAI(pCreature); +} + +CreatureAI* GetAI_mob_phoenix_tk(Creature* pCreature) +{ + return new mob_phoenix_tkAI(pCreature); +} + +CreatureAI* GetAI_mob_phoenix_egg_tk(Creature* pCreature) +{ + return new mob_phoenix_egg_tkAI(pCreature); +} + +void AddSC_boss_kaelthas() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_kaelthas"; + newscript->GetAI = &GetAI_boss_kaelthas; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_thaladred_the_darkener"; + newscript->GetAI = &GetAI_boss_thaladred_the_darkener; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_lord_sanguinar"; + newscript->GetAI = &GetAI_boss_lord_sanguinar; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_grand_astromancer_capernian"; + newscript->GetAI = &GetAI_boss_grand_astromancer_capernian; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_master_engineer_telonicus"; + newscript->GetAI = &GetAI_boss_master_engineer_telonicus; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name= "mob_kael_flamestrike"; + newscript->GetAI = &GetAI_mob_kael_flamestrike; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_phoenix_tk"; + newscript->GetAI = &GetAI_mob_phoenix_tk; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_phoenix_egg_tk"; + newscript->GetAI = &GetAI_mob_phoenix_egg_tk; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/outland/tempest_keep/the_eye/boss_void_reaver.cpp b/src/bindings/scripts/scripts/outland/tempest_keep/the_eye/boss_void_reaver.cpp new file mode 100644 index 00000000000..60cfaf1609d --- /dev/null +++ b/src/bindings/scripts/scripts/outland/tempest_keep/the_eye/boss_void_reaver.cpp @@ -0,0 +1,185 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Void_Reaver +SD%Complete: 90 +SDComment: Should reset if raid are out of room. +SDCategory: Tempest Keep, The Eye +EndScriptData */ + +#include "precompiled.h" +#include "def_the_eye.h" + +enum +{ + SAY_AGGRO = -1550000, + SAY_SLAY1 = -1550001, + SAY_SLAY2 = -1550002, + SAY_SLAY3 = -1550003, + SAY_DEATH = -1550004, + SAY_POUNDING1 = -1550005, + SAY_POUNDING2 = -1550006, + + SPELL_POUNDING = 34162, + SPELL_ARCANE_ORB = 34172, + SPELL_KNOCK_AWAY = 25778, + SPELL_BERSERK = 27680 +}; + +struct TRINITY_DLL_DECL boss_void_reaverAI : public ScriptedAI +{ + boss_void_reaverAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + uint32 Pounding_Timer; + uint32 ArcaneOrb_Timer; + uint32 KnockAway_Timer; + uint32 Berserk_Timer; + + bool Enraged; + + void Reset() + { + Pounding_Timer = 15000; + ArcaneOrb_Timer = 3000; + KnockAway_Timer = 30000; + Berserk_Timer = 600000; + + Enraged = false; + + if (pInstance && m_creature->isAlive()) + pInstance->SetData(DATA_VOIDREAVEREVENT, NOT_STARTED); + } + + void KilledUnit(Unit *victim) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + case 2: DoScriptText(SAY_SLAY3, m_creature); break; + } + } + + void JustDied(Unit *victim) + { + DoScriptText(SAY_DEATH, m_creature); + DoZoneInCombat(); + + if (pInstance) + pInstance->SetData(DATA_VOIDREAVEREVENT, DONE); + } + + void EnterCombat(Unit *who) + { + DoScriptText(SAY_AGGRO, m_creature); + + if (pInstance) + pInstance->SetData(DATA_VOIDREAVEREVENT, IN_PROGRESS); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + // Pounding + if (Pounding_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_POUNDING); + + switch(rand()%2) + { + case 0: DoScriptText(SAY_POUNDING1, m_creature); break; + case 1: DoScriptText(SAY_POUNDING2, m_creature); break; + } + Pounding_Timer = 15000; //cast time(3000) + cooldown time(12000) + }else Pounding_Timer -= diff; + + // Arcane Orb + if (ArcaneOrb_Timer < diff) + { + Unit *target = NULL; + std::list t_list = m_creature->getThreatManager().getThreatList(); + std::vector target_list; + for(std::list::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr) + { + target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()); + // exclude pets & totems + if (target->GetTypeId() != TYPEID_PLAYER) + continue; + + //18 yard radius minimum + if (target && target->GetTypeId() == TYPEID_PLAYER && target->isAlive() && !target->IsWithinDist(m_creature, 18, false)) + target_list.push_back(target); + target = NULL; + } + + if (target_list.size()) + target = *(target_list.begin()+rand()%target_list.size()); + else + target = m_creature->getVictim(); + + if (target) + m_creature->CastSpell(target->GetPositionX(),target->GetPositionY(),target->GetPositionZ(), SPELL_ARCANE_ORB, false, NULL, NULL, NULL, target); + + ArcaneOrb_Timer = 3000; + }else ArcaneOrb_Timer -= diff; + + // Single Target knock back, reduces aggro + if (KnockAway_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_KNOCK_AWAY); + + //Drop 25% aggro + if (DoGetThreat(m_creature->getVictim())) + DoModifyThreatPercent(m_creature->getVictim(),-25); + + KnockAway_Timer = 30000; + }else KnockAway_Timer -= diff; + + //Berserk + if (Berserk_Timer < diff && !Enraged) + { + DoCast(m_creature,SPELL_BERSERK); + Enraged = true; + }else Berserk_Timer -= diff; + + DoMeleeAttackIfReady(); + + EnterEvadeIfOutOfCombatArea(diff); + } +}; + +CreatureAI* GetAI_boss_void_reaver(Creature* pCreature) +{ + return new boss_void_reaverAI (pCreature); +} + +void AddSC_boss_void_reaver() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_void_reaver"; + newscript->GetAI = &GetAI_boss_void_reaver; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/tempest_keep/the_eye/def_the_eye.h b/src/bindings/scripts/scripts/outland/tempest_keep/the_eye/def_the_eye.h new file mode 100644 index 00000000000..d0d3ea09061 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/tempest_keep/the_eye/def_the_eye.h @@ -0,0 +1,20 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_THE_EYE_H +#define DEF_THE_EYE_H + +#define DATA_ALAREVENT 1 +#define DATA_ASTROMANCER 2 +#define DATA_GRANDASTROMANCERCAPERNIAN 3 +#define DATA_HIGHASTROMANCERSOLARIANEVENT 4 +#define DATA_KAELTHAS 5 +#define DATA_KAELTHASEVENT 6 +#define DATA_LORDSANGUINAR 7 +#define DATA_MASTERENGINEERTELONICUS 8 +#define DATA_THALADREDTHEDARKENER 10 +#define DATA_VOIDREAVEREVENT 11 +#define DATA_ALAR 12 +#endif + diff --git a/src/bindings/scripts/scripts/outland/tempest_keep/the_eye/instance_the_eye.cpp b/src/bindings/scripts/scripts/outland/tempest_keep/the_eye/instance_the_eye.cpp new file mode 100644 index 00000000000..f973f96c1ff --- /dev/null +++ b/src/bindings/scripts/scripts/outland/tempest_keep/the_eye/instance_the_eye.cpp @@ -0,0 +1,176 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_The_Eye +SD%Complete: 100 +SDComment: +SDCategory: Tempest Keep, The Eye +EndScriptData */ + +#include "precompiled.h" +#include "def_the_eye.h" + +#define MAX_ENCOUNTER 5 + +/* The Eye encounters: +0 - Kael'thas event +1 - Al' ar event +2 - Solarian Event +3 - Void Reaver event +*/ + +struct TRINITY_DLL_DECL instance_the_eye : public ScriptedInstance +{ + instance_the_eye(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint64 ThaladredTheDarkener; + uint64 LordSanguinar; + uint64 GrandAstromancerCapernian; + uint64 MasterEngineerTelonicus; + uint64 Kaelthas; + uint64 Astromancer; + uint64 Alar; + + uint8 KaelthasEventPhase; + uint8 AlarEventPhase; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + ThaladredTheDarkener = 0; + LordSanguinar = 0; + GrandAstromancerCapernian = 0; + MasterEngineerTelonicus = 0; + Kaelthas = 0; + Astromancer = 0; + Alar = 0; + + KaelthasEventPhase = 0; + AlarEventPhase = 0; + } + + bool IsEncounterInProgress() const + { + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) return true; + + return false; + } + + void OnCreatureCreate(Creature* pCreature, bool add) + { + switch(pCreature->GetEntry()) + { + case 20064: ThaladredTheDarkener = pCreature->GetGUID(); break; + case 20063: MasterEngineerTelonicus = pCreature->GetGUID(); break; + case 20062: GrandAstromancerCapernian = pCreature->GetGUID(); break; + case 20060: LordSanguinar = pCreature->GetGUID(); break; + case 19622: Kaelthas = pCreature->GetGUID(); break; + case 18805: Astromancer = pCreature->GetGUID(); break; + case 19514: Alar = pCreature->GetGUID(); break; + } + } + + uint64 GetData64(uint32 identifier) + { + switch(identifier) + { + case DATA_THALADREDTHEDARKENER: return ThaladredTheDarkener; + case DATA_LORDSANGUINAR: return LordSanguinar; + case DATA_GRANDASTROMANCERCAPERNIAN: return GrandAstromancerCapernian; + case DATA_MASTERENGINEERTELONICUS: return MasterEngineerTelonicus; + case DATA_KAELTHAS: return Kaelthas; + case DATA_ASTROMANCER: return Astromancer; + case DATA_ALAR: return Alar; + } + return 0; + } + + void SetData(uint32 type, uint32 data) + { + switch(type) + { + case DATA_ALAREVENT: AlarEventPhase = data; m_auiEncounter[0] = data; break; + case DATA_HIGHASTROMANCERSOLARIANEVENT: m_auiEncounter[1] = data; break; + case DATA_VOIDREAVEREVENT: m_auiEncounter[2] = data; break; + case DATA_KAELTHASEVENT: KaelthasEventPhase = data; m_auiEncounter[3] = data; break; + } + if (data == DONE) + SaveToDB(); + } + + uint32 GetData(uint32 type) + { + switch(type) + { + case DATA_ALAREVENT: return AlarEventPhase; + case DATA_HIGHASTROMANCERSOLARIANEVENT: return m_auiEncounter[1]; + case DATA_VOIDREAVEREVENT: return m_auiEncounter[2]; + case DATA_KAELTHASEVENT: return KaelthasEventPhase; + } + return 0; + } + + std::string GetSaveData() + { + OUT_SAVE_INST_DATA; + std::ostringstream stream; + stream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " " << m_auiEncounter[3]; + char* out = new char[stream.str().length() + 1]; + strcpy(out, stream.str().c_str()); + if (out) + { + OUT_SAVE_INST_DATA_COMPLETE; + return out; + } + return NULL; + } + + void Load(const char* in) + { + if (!in) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + OUT_LOAD_INST_DATA(in); + std::istringstream stream(in); + stream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3]; + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) // Do not load an encounter as "In Progress" - reset it instead. + m_auiEncounter[i] = NOT_STARTED; + OUT_LOAD_INST_DATA_COMPLETE; + } +}; + +InstanceData* GetInstanceData_instance_the_eye(Map* pMap) +{ + return new instance_the_eye(pMap); +} + +void AddSC_instance_the_eye() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_the_eye"; + newscript->GetInstanceData = &GetInstanceData_instance_the_eye; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/tempest_keep/the_eye/the_eye.cpp b/src/bindings/scripts/scripts/outland/tempest_keep/the_eye/the_eye.cpp new file mode 100644 index 00000000000..2dfff45796f --- /dev/null +++ b/src/bindings/scripts/scripts/outland/tempest_keep/the_eye/the_eye.cpp @@ -0,0 +1,99 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: The_Eye +SD%Complete: 100 +SDComment: +SDCategory: Tempest Keep, The Eye +EndScriptData */ + +/* ContentData +mob_crystalcore_devastator +EndContentData */ + +#include "precompiled.h" +#include "def_the_eye.h" + +#define SPELL_COUNTERCHARGE 35035 +#define SPELL_KNOCKAWAY 22893 + +struct TRINITY_DLL_DECL mob_crystalcore_devastatorAI : public ScriptedAI +{ + mob_crystalcore_devastatorAI(Creature *c) : ScriptedAI(c) {} + + uint32 Knockaway_Timer; + uint32 Countercharge_Timer; + + void Reset() + { + Countercharge_Timer = 9000; + Knockaway_Timer = 25000; + } + + void EnterCombat(Unit *who) + { + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + //Check if we have a current target + //Knockaway_Timer + if (Knockaway_Timer < diff) + { + m_creature->CastSpell(m_creature->getVictim(),SPELL_KNOCKAWAY, true); + + // current aggro target is knocked away pick new target + Unit* Target = SelectUnit(SELECT_TARGET_TOPAGGRO, 0); + + if (!Target || Target == m_creature->getVictim()) + Target = SelectUnit(SELECT_TARGET_TOPAGGRO, 1); + + if (Target) + m_creature->TauntApply(Target); + + Knockaway_Timer = 23000; + } + else Knockaway_Timer -= diff; + + //Countercharge_Timer + if (Countercharge_Timer < diff) + { + DoCast(this->m_creature,SPELL_COUNTERCHARGE); + Countercharge_Timer = 45000; + }else Countercharge_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_crystalcore_devastator(Creature* pCreature) +{ + return new mob_crystalcore_devastatorAI (pCreature); +} + +void AddSC_the_eye() +{ + Script *newscript; + newscript = new Script; + newscript->Name="mob_crystalcore_devastator"; + newscript->GetAI = &GetAI_mob_crystalcore_devastator; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/tempest_keep/the_mechanar/boss_gatewatcher_gyrokill.cpp b/src/bindings/scripts/scripts/outland/tempest_keep/the_mechanar/boss_gatewatcher_gyrokill.cpp new file mode 100644 index 00000000000..268cfeb2918 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/tempest_keep/the_mechanar/boss_gatewatcher_gyrokill.cpp @@ -0,0 +1,38 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Gatewatcher_Gyrokill +SD%Complete: 0 +SDComment: Place Holder +SDCategory: Tempest Keep, The Mechanar +EndScriptData */ + +#include "precompiled.h" + +#define SAY_AGGRO -1554000 +#define SAY_SAW_ATTACK1 -1554001 +#define SAY_SAW_ATTACK2 -1554002 +#define SAY_SLAY1 -1554003 +#define SAY_SLAY2 -1554004 +#define SAY_DEATH -1554005 + +#define SPELL_STREAM_OF_MACHINE_FLUID 35311 +#define SPELL_SAW_BLADE 35318 +#define H_SPELL_SAW_BLADE 39192 +#define SPELL_SHADOW_POWER 35322 +#define H_SPELL_SHADOW_POWER 39193 + diff --git a/src/bindings/scripts/scripts/outland/tempest_keep/the_mechanar/boss_gatewatcher_ironhand.cpp b/src/bindings/scripts/scripts/outland/tempest_keep/the_mechanar/boss_gatewatcher_ironhand.cpp new file mode 100644 index 00000000000..a1ca31c3e5e --- /dev/null +++ b/src/bindings/scripts/scripts/outland/tempest_keep/the_mechanar/boss_gatewatcher_ironhand.cpp @@ -0,0 +1,148 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +/* ScriptData +SDName: Boss_Gatewatcher_Ironhand +SD%Complete: 75 +SDComment: +SDCategory: Tempest Keep, The Mechanar +EndScriptData */ + +#include "precompiled.h" + +#define SAY_AGGRO_1 -1554006 +#define SAY_HAMMER_1 -1554007 +#define SAY_HAMMER_2 -1554008 +#define SAY_SLAY_1 -1554009 +#define SAY_SLAY_2 -1554010 +#define SAY_DEATH_1 -1554011 +#define EMOTE_HAMMER -1554012 + +// Spells to be casted +#define SPELL_SHADOW_POWER 35322 +#define H_SPELL_SHADOW_POWER 39193 +#define SPELL_HAMMER_PUNCH 35326 +#define SPELL_JACKHAMMER 35327 +#define H_SPELL_JACKHAMMER 39194 +#define SPELL_STREAM_OF_MACHINE_FLUID 35311 + +// Gatewatcher Iron-Hand AI +struct TRINITY_DLL_DECL boss_gatewatcher_iron_handAI : public ScriptedAI +{ + boss_gatewatcher_iron_handAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + ScriptedInstance *pInstance; + + bool HeroicMode; + + uint32 Shadow_Power_Timer; + uint32 Jackhammer_Timer; + uint32 Stream_of_Machine_Fluid_Timer; + + void Reset() + { + Shadow_Power_Timer = 25000; + Jackhammer_Timer = 45000; + Stream_of_Machine_Fluid_Timer = 55000; + + } + void EnterCombat(Unit *who) + { + DoScriptText(SAY_AGGRO_1, m_creature); + } + + void KilledUnit(Unit* victim) + { + if (rand()%2) + return; + + switch(rand()%2) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature); break; + case 1: DoScriptText(SAY_SLAY_2, m_creature); break; + } + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEATH_1, m_creature); + + if (!pInstance) + return; + + //TODO: Add door check/open code + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + //Shadow Power + if (Shadow_Power_Timer < diff) + { + DoCast(m_creature,HeroicMode ? H_SPELL_SHADOW_POWER : SPELL_SHADOW_POWER); + Shadow_Power_Timer = 20000 + rand()%8000; + }else Shadow_Power_Timer -= diff; + + //Jack Hammer + if (Jackhammer_Timer < diff) + { + //TODO: expect cast this about 5 times in a row (?), announce it by emote only once + DoScriptText(EMOTE_HAMMER, m_creature); + DoCast(m_creature->getVictim(),HeroicMode ? H_SPELL_JACKHAMMER : SPELL_JACKHAMMER); + + //chance to yell, but not same time as emote (after spell in fact casted) + if (rand()%2) + return; + + switch(rand()%2) + { + case 0: DoScriptText(SAY_HAMMER_1, m_creature); break; + case 1: DoScriptText(SAY_HAMMER_2, m_creature); break; + } + Jackhammer_Timer = 30000; + }else Jackhammer_Timer -= diff; + + //Stream of Machine Fluid + if (Stream_of_Machine_Fluid_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_STREAM_OF_MACHINE_FLUID); + Stream_of_Machine_Fluid_Timer = 35000 + rand()%15000; + }else Stream_of_Machine_Fluid_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_gatewatcher_iron_hand(Creature* pCreature) +{ + return new boss_gatewatcher_iron_handAI (pCreature); +} + +void AddSC_boss_gatewatcher_iron_hand() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_gatewatcher_iron_hand"; + newscript->GetAI = &GetAI_boss_gatewatcher_iron_hand; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/tempest_keep/the_mechanar/boss_nethermancer_sepethrea.cpp b/src/bindings/scripts/scripts/outland/tempest_keep/the_mechanar/boss_nethermancer_sepethrea.cpp new file mode 100644 index 00000000000..da6c613d794 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/tempest_keep/the_mechanar/boss_nethermancer_sepethrea.cpp @@ -0,0 +1,258 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +/* ScriptData +SDName: Boss_Nethermancer_Sepethrea +SD%Complete: 90 +SDComment: Need adjustments to initial summons +SDCategory: Tempest Keep, The Mechanar +EndScriptData */ + +#include "precompiled.h" +#include "def_mechanar.h" + +#define SAY_AGGRO -1554013 +#define SAY_SUMMON -1554014 +#define SAY_DRAGONS_BREATH_1 -1554015 +#define SAY_DRAGONS_BREATH_2 -1554016 +#define SAY_SLAY1 -1554017 +#define SAY_SLAY2 -1554018 +#define SAY_DEATH -1554019 + +#define SPELL_SUMMON_RAGIN_FLAMES 35275 +#define H_SPELL_SUMMON_RAGIN_FLAMES 39084 + +#define SPELL_FROST_ATTACK 35263 +#define SPELL_ARCANE_BLAST 35314 +#define SPELL_DRAGONS_BREATH 35250 +#define SPELL_KNOCKBACK 37317 +#define SPELL_SOLARBURN 35267 + +struct TRINITY_DLL_DECL boss_nethermancer_sepethreaAI : public ScriptedAI +{ + boss_nethermancer_sepethreaAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + ScriptedInstance *pInstance; + + bool HeroicMode; + + uint32 frost_attack_Timer; + uint32 arcane_blast_Timer; + uint32 dragons_breath_Timer; + uint32 knockback_Timer; + uint32 solarburn_Timer; + + void Reset() + { + frost_attack_Timer = 7000 + rand()%3000; + arcane_blast_Timer = 12000 + rand()%6000; + dragons_breath_Timer = 18000 + rand()%4000; + knockback_Timer = 22000 + rand()%6000; + solarburn_Timer = 30000; + + if (pInstance) + pInstance->SetData(DATA_NETHERMANCER_EVENT, NOT_STARTED); + } + + void EnterCombat(Unit *who) + { + if (pInstance) + pInstance->SetData(DATA_NETHERMANCER_EVENT, IN_PROGRESS); + + DoScriptText(SAY_AGGRO, m_creature); + DoCast(who, HeroicMode ? H_SPELL_SUMMON_RAGIN_FLAMES : SPELL_SUMMON_RAGIN_FLAMES); + DoScriptText(SAY_SUMMON, m_creature); + } + + void KilledUnit(Unit* victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + } + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEATH, m_creature); + + if (pInstance) + pInstance->SetData(DATA_NETHERMANCER_EVENT, DONE); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + //Frost Attack + if (frost_attack_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_FROST_ATTACK); + frost_attack_Timer = 7000 + rand()%3000; + }else frost_attack_Timer -= diff; + + //Arcane Blast + if (arcane_blast_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_ARCANE_BLAST); + arcane_blast_Timer = 15000; + }else arcane_blast_Timer -= diff; + + //Dragons Breath + if (dragons_breath_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_DRAGONS_BREATH); + { + if (rand()%2) + return; + + switch(rand()%2) + { + case 0: DoScriptText(SAY_DRAGONS_BREATH_1, m_creature); break; + case 1: DoScriptText(SAY_DRAGONS_BREATH_2, m_creature); break; + } + } + dragons_breath_Timer = 12000 + rand()%10000; + }else dragons_breath_Timer -= diff; + + //Knockback + if (knockback_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_KNOCKBACK); + knockback_Timer = 15000 + rand()%10000; + }else knockback_Timer -= diff; + + //Solarburn + if (solarburn_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_SOLARBURN); + solarburn_Timer = 30000; + }else solarburn_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_nethermancer_sepethrea(Creature* pCreature) +{ + return new boss_nethermancer_sepethreaAI (pCreature); +} + +#define SPELL_INFERNO 35268 +#define H_SPELL_INFERNO 39346 +#define SPELL_FIRE_TAIL 35278 + +struct TRINITY_DLL_DECL mob_ragin_flamesAI : public ScriptedAI +{ + mob_ragin_flamesAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + ScriptedInstance *pInstance; + + bool HeroicMode; + + uint32 inferno_Timer; + uint32 flame_timer; + uint32 Check_Timer; + + bool onlyonce; + + void Reset() + { + inferno_Timer = 10000; + flame_timer = 500; + Check_Timer = 2000; + onlyonce = false; + m_creature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_MAGIC, true); + m_creature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, true); + m_creature->SetSpeed(MOVE_RUN, HeroicMode ? 0.7f : 0.5f); + } + + void EnterCombat(Unit* who) + { + } + + void UpdateAI(const uint32 diff) + { + //Check_Timer + if (Check_Timer < diff) + { + if (pInstance) + { + if (pInstance->GetData(DATA_NETHERMANCER_EVENT) != IN_PROGRESS) + { + //remove + m_creature->setDeathState(JUST_DIED); + m_creature->RemoveCorpse(); + } + } + Check_Timer = 1000; + }else Check_Timer -= diff; + + if (!UpdateVictim()) + return; + + if (!onlyonce) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) + m_creature->GetMotionMaster()->MoveChase(target); + onlyonce = true; + } + + if (inferno_Timer < diff) + { + DoCast(m_creature->getVictim(),HeroicMode ? H_SPELL_INFERNO : SPELL_INFERNO); + m_creature->TauntApply(m_creature->getVictim()); + inferno_Timer = 10000; + }else inferno_Timer -= diff; + + if (flame_timer < diff) + { + DoCast(m_creature,SPELL_FIRE_TAIL); + flame_timer = 500; + }else flame_timer -=diff; + + DoMeleeAttackIfReady(); + } + +}; +CreatureAI* GetAI_mob_ragin_flames(Creature* pCreature) +{ + return new mob_ragin_flamesAI (pCreature); +} +void AddSC_boss_nethermancer_sepethrea() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_nethermancer_sepethrea"; + newscript->GetAI = &GetAI_boss_nethermancer_sepethrea; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_ragin_flames"; + newscript->GetAI = &GetAI_mob_ragin_flames; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/tempest_keep/the_mechanar/boss_pathaleon_the_calculator.cpp b/src/bindings/scripts/scripts/outland/tempest_keep/the_mechanar/boss_pathaleon_the_calculator.cpp new file mode 100644 index 00000000000..1e06232c9b6 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/tempest_keep/the_mechanar/boss_pathaleon_the_calculator.cpp @@ -0,0 +1,257 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +/* ScriptData +SDName: Boss Pathaleon the Calculator +SD%Complete: 50 +SDComment: Event missing. Script for himself 99% blizzlike. +SDCategory: Tempest Keep, The Mechanar +EndScriptData */ + +#include "precompiled.h" + +#define SAY_AGGRO -1554020 +#define SAY_DOMINATION_1 -1554021 +#define SAY_DOMINATION_2 -1554022 +#define SAY_SUMMON -1554023 +#define SAY_ENRAGE -1554024 +#define SAY_SLAY_1 -1554025 +#define SAY_SLAY_2 -1554026 +#define SAY_DEATH -1554027 + +// Spells to be casted +#define SPELL_MANA_TAP 36021 +#define SPELL_ARCANE_TORRENT 36022 +#define SPELL_DOMINATION 35280 +#define H_SPELL_ARCANE_EXPLOSION 15453 +#define SPELL_FRENZY 36992 + +#define SPELL_SUMMON_NETHER_WRAITH_1 35285 //Spells work, but not implemented +#define SPELL_SUMMON_NETHER_WRAITH_2 35286 +#define SPELL_SUMMON_NETHER_WRAITH_3 35287 +#define SPELL_SUMMON_NETHER_WRAITH_4 35288 + +// Add Spells +#define SPELL_DETONATION 35058 +#define SPELL_ARCANE_MISSILES 35034 + +struct TRINITY_DLL_DECL boss_pathaleon_the_calculatorAI : public ScriptedAI +{ + boss_pathaleon_the_calculatorAI(Creature *c) : ScriptedAI(c), summons(m_creature) + { + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + uint32 Summon_Timer; + SummonList summons; + uint32 ManaTap_Timer; + uint32 ArcaneTorrent_Timer; + uint32 Domination_Timer; + uint32 ArcaneExplosion_Timer; + bool HeroicMode; + bool Enraged; + + uint32 Counter; + + void Reset() + { + Summon_Timer = 30000; + ManaTap_Timer = 12000 + rand()%8000; + ArcaneTorrent_Timer = 16000 + rand()%9000; + Domination_Timer = 25000 + rand()%15000; + ArcaneExplosion_Timer = 8000 + rand()%5000; + + Enraged = false; + + Counter = 0; + summons.DespawnAll(); + } + void EnterCombat(Unit *who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + + void KilledUnit(Unit* victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature); break; + case 1: DoScriptText(SAY_SLAY_2, m_creature); break; + } + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEATH, m_creature); + + summons.DespawnAll(); + } + + void JustSummoned(Creature *summon) {summons.Summon(summon);} + void SummonedCreatureDespawn(Creature *summon) {summons.Despawn(summon);} + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + if (Summon_Timer < diff) + { + for(uint8 i = 0; i < 3; ++i) + { + Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0); + Creature* Wraith = m_creature->SummonCreature(21062,m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + if (target && Wraith) + Wraith->AI()->AttackStart(target); + } + DoScriptText(SAY_SUMMON, m_creature); + Summon_Timer = 30000 + rand()%15000; + }else Summon_Timer -= diff; + + if (ManaTap_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_MANA_TAP); + ManaTap_Timer = 14000 + rand()%8000; + }else ManaTap_Timer -= diff; + + if (ArcaneTorrent_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_ARCANE_TORRENT); + ArcaneTorrent_Timer = 12000 + rand()%6000; + }else ArcaneTorrent_Timer -= diff; + + if (Domination_Timer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,1)) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_DOMINATION_1, m_creature); break; + case 1: DoScriptText(SAY_DOMINATION_2, m_creature); break; + } + + DoCast(target,SPELL_DOMINATION); + } + Domination_Timer = 25000 + rand()%5000; + }else Domination_Timer -= diff; + + //Only casting if Heroic Mode is used + if (HeroicMode) + { + if (ArcaneExplosion_Timer < diff) + { + DoCast(m_creature->getVictim(),H_SPELL_ARCANE_EXPLOSION); + ArcaneExplosion_Timer = 10000 + rand()%4000; + }else ArcaneExplosion_Timer -= diff; + } + + if (!Enraged && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 21) + { + DoCast(m_creature, SPELL_FRENZY); + DoScriptText(SAY_ENRAGE, m_creature); + Enraged = true; + + } + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_pathaleon_the_calculator(Creature* pCreature) +{ + return new boss_pathaleon_the_calculatorAI (pCreature); +} + +struct TRINITY_DLL_DECL mob_nether_wraithAI : public ScriptedAI +{ + mob_nether_wraithAI(Creature *c) : ScriptedAI(c) {} + + ScriptedInstance *pInstance; + + uint32 ArcaneMissiles_Timer; + uint32 Detonation_Timer; + uint32 Die_Timer; + bool Detonation; + + void Reset() + { + ArcaneMissiles_Timer = 1000 + rand()%3000; + Detonation_Timer = 20000; + Die_Timer = 2200; + Detonation = false; + + } + + void EnterCombat(Unit* who) + { + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (ArcaneMissiles_Timer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,1)) + DoCast(target,SPELL_ARCANE_MISSILES); + else + DoCast(m_creature->getVictim(),SPELL_ARCANE_MISSILES); + + ArcaneMissiles_Timer = 5000 + rand()%5000; + }else ArcaneMissiles_Timer -=diff; + + if (!Detonation) + { + if (Detonation_Timer < diff) + { + DoCast(m_creature,SPELL_DETONATION); + Detonation = true; + }else Detonation_Timer -= diff; + } + + if (Detonation) + { + if (Die_Timer < diff) + { + m_creature->setDeathState(JUST_DIED); + m_creature->RemoveCorpse(); + }else Die_Timer -= diff; + } + + DoMeleeAttackIfReady(); + } + +}; +CreatureAI* GetAI_mob_nether_wraith(Creature* pCreature) +{ + return new mob_nether_wraithAI (pCreature); +} + +void AddSC_boss_pathaleon_the_calculator() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_pathaleon_the_calculator"; + newscript->GetAI = &GetAI_boss_pathaleon_the_calculator; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_nether_wraith"; + newscript->GetAI = &GetAI_mob_nether_wraith; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/tempest_keep/the_mechanar/def_mechanar.h b/src/bindings/scripts/scripts/outland/tempest_keep/the_mechanar/def_mechanar.h new file mode 100644 index 00000000000..d1b53eebf53 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/tempest_keep/the_mechanar/def_mechanar.h @@ -0,0 +1,6 @@ +#ifndef DEF_MECHANAR_H +#define DEF_MECHANAR_H + +#define DATA_NETHERMANCER_EVENT 1 +#endif + diff --git a/src/bindings/scripts/scripts/outland/tempest_keep/the_mechanar/instance_mechanar.cpp b/src/bindings/scripts/scripts/outland/tempest_keep/the_mechanar/instance_mechanar.cpp new file mode 100644 index 00000000000..e43190620d9 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/tempest_keep/the_mechanar/instance_mechanar.cpp @@ -0,0 +1,87 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Mechanar +SD%Complete: 100 +SDComment: +SDCategory: Mechanar +EndScriptData */ + +#include "precompiled.h" +#include "def_mechanar.h" + +#define MAX_ENCOUNTER 1 + +struct TRINITY_DLL_DECL instance_mechanar : public ScriptedInstance +{ + instance_mechanar(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + } + + bool IsEncounterInProgress() const + { + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) + return true; + + return false; + } + + uint32 GetData(uint32 type) + { + switch(type) + { + case DATA_NETHERMANCER_EVENT: return m_auiEncounter[0]; + } + + return false; + } + + uint64 GetData64 (uint32 identifier) + { + return 0; + } + + void SetData(uint32 type, uint32 data) + { + switch(type) + { + case DATA_NETHERMANCER_EVENT: m_auiEncounter[0] = data; break; + } + } +}; + +InstanceData* GetInstanceData_instance_mechanar(Map* pMap) +{ + return new instance_mechanar(pMap); +} + +void AddSC_instance_mechanar() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_mechanar"; + newscript->GetInstanceData = &GetInstanceData_instance_mechanar; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/auchenai_crypts/boss_exarch_maladaar.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/auchenai_crypts/boss_exarch_maladaar.cpp deleted file mode 100644 index 414804a6576..00000000000 --- a/src/bindings/scripts/scripts/zone/aunchindoun/auchenai_crypts/boss_exarch_maladaar.cpp +++ /dev/null @@ -1,358 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Exarch_Maladaar -SD%Complete: 95 -SDComment: Most of event implemented, some adjustments to timers remain and possibly make some better code for switching his dark side in to better "images" of player. -SDCategory: Auchindoun, Auchenai Crypts -EndScriptData */ - -/* ContentData -mob_stolen_soul -boss_exarch_maladaar -mob_avatar_of_martyred -EndContentData */ - -#include "precompiled.h" - -#define SPELL_MOONFIRE 37328 -#define SPELL_FIREBALL 37329 -#define SPELL_MIND_FLAY 37330 -#define SPELL_HEMORRHAGE 37331 -#define SPELL_FROSTSHOCK 37332 -#define SPELL_CURSE_OF_AGONY 37334 -#define SPELL_MORTAL_STRIKE 37335 -#define SPELL_FREEZING_TRAP 37368 -#define SPELL_HAMMER_OF_JUSTICE 37369 - -struct TRINITY_DLL_DECL mob_stolen_soulAI : public ScriptedAI -{ - mob_stolen_soulAI(Creature *c) : ScriptedAI(c) {} - - uint8 myClass; - uint32 Class_Timer; - - void Reset() - { - Class_Timer = 1000; - } - - void EnterCombat(Unit *who) - { } - - void SetMyClass(uint8 myclass) - { - myClass = myclass; - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (Class_Timer < diff) - { - switch (myClass) - { - case CLASS_WARRIOR: - DoCast(m_creature->getVictim(), SPELL_MORTAL_STRIKE); - Class_Timer = 6000; - break; - case CLASS_PALADIN: - DoCast(m_creature->getVictim(), SPELL_HAMMER_OF_JUSTICE); - Class_Timer = 6000; - break; - case CLASS_HUNTER: - DoCast(m_creature->getVictim(), SPELL_FREEZING_TRAP); - Class_Timer = 20000; - break; - case CLASS_ROGUE: - DoCast(m_creature->getVictim(), SPELL_HEMORRHAGE); - Class_Timer = 10000; - break; - case CLASS_PRIEST: - DoCast(m_creature->getVictim(), SPELL_MIND_FLAY); - Class_Timer = 5000; - break; - case CLASS_SHAMAN: - DoCast(m_creature->getVictim(), SPELL_FROSTSHOCK); - Class_Timer = 8000; - break; - case CLASS_MAGE: - DoCast(m_creature->getVictim(), SPELL_FIREBALL); - Class_Timer = 5000; - break; - case CLASS_WARLOCK: - DoCast(m_creature->getVictim(), SPELL_CURSE_OF_AGONY); - Class_Timer = 20000; - break; - case CLASS_DRUID: - DoCast(m_creature->getVictim(), SPELL_MOONFIRE); - Class_Timer = 10000; - break; - } - } else Class_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_stolen_soul(Creature* pCreature) -{ - return new mob_stolen_soulAI (pCreature); -} - -#define SAY_INTRO -1558000 -#define SAY_SUMMON -1558001 - -#define SAY_AGGRO_1 -1558002 -#define SAY_AGGRO_2 -1558003 -#define SAY_AGGRO_3 -1558004 - -#define SAY_ROAR -1558005 -#define SAY_SOUL_CLEAVE -1558006 - -#define SAY_SLAY_1 -1558007 -#define SAY_SLAY_2 -1558008 - -#define SAY_DEATH -1558009 - -#define SPELL_RIBBON_OF_SOULS 32422 -#define SPELL_SOUL_SCREAM 32421 - -#define SPELL_STOLEN_SOUL 32346 -#define SPELL_STOLEN_SOUL_VISUAL 32395 - -#define SPELL_SUMMON_AVATAR 32424 - -#define ENTRY_STOLEN_SOUL 18441 - -struct TRINITY_DLL_DECL boss_exarch_maladaarAI : public ScriptedAI -{ - boss_exarch_maladaarAI(Creature *c) : ScriptedAI(c) - { - HasTaunted = false; - } - - uint32 soulmodel; - uint64 soulholder; - uint8 soulclass; - - uint32 Fear_timer; - uint32 Ribbon_of_Souls_timer; - uint32 StolenSoul_Timer; - - bool HasTaunted; - bool Avatar_summoned; - - void Reset() - { - soulmodel = 0; - soulholder = 0; - soulclass = 0; - - Fear_timer = 15000 + rand()% 5000; - Ribbon_of_Souls_timer = 5000; - StolenSoul_Timer = 25000 + rand()% 10000; - - Avatar_summoned = false; - } - - void MoveInLineOfSight(Unit *who) - { - if (!HasTaunted && m_creature->IsWithinDistInMap(who, 150.0)) - { - DoScriptText(SAY_INTRO, m_creature); - HasTaunted = true; - } - - ScriptedAI::MoveInLineOfSight(who); - } - - - void EnterCombat(Unit *who) - { - switch (rand()%3) - { - case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; - case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; - case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; - } - } - - void JustSummoned(Creature *summoned) - { - if (summoned->GetEntry() == ENTRY_STOLEN_SOUL) - { - //SPELL_STOLEN_SOUL_VISUAL has shapeshift effect, but not implemented feature in Trinity for this spell. - summoned->CastSpell(summoned,SPELL_STOLEN_SOUL_VISUAL,false); - summoned->SetDisplayId(soulmodel); - summoned->setFaction(m_creature->getFaction()); - - if (Unit *target = Unit::GetUnit(*m_creature,soulholder)) - { - - CAST_AI(mob_stolen_soulAI, summoned->AI())->SetMyClass(soulclass); - summoned->AI()->AttackStart(target); - } - } - } - - void KilledUnit(Unit* victim) - { - if (rand()%2) - return; - - switch (rand()%2) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature); break; - case 1: DoScriptText(SAY_SLAY_2, m_creature); break; - } - } - - void JustDied(Unit* Killer) - { - DoScriptText(SAY_DEATH, m_creature); - //When Exarch Maladar is defeated D'ore appear. - m_creature->SummonCreature(19412, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 600000); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (!Avatar_summoned && ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 25)) - { - if (m_creature->IsNonMeleeSpellCasted(false)) - m_creature->InterruptNonMeleeSpells(true); - - DoScriptText(SAY_SUMMON, m_creature); - - DoCast(m_creature, SPELL_SUMMON_AVATAR); - Avatar_summoned = true; - StolenSoul_Timer = 15000 + rand()% 15000; - } - - if (StolenSoul_Timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - { - if (target->GetTypeId() == TYPEID_PLAYER) - { - if (m_creature->IsNonMeleeSpellCasted(false)) - m_creature->InterruptNonMeleeSpells(true); - - uint32 i = urand(1,2); - if (i == 1) - DoScriptText(SAY_ROAR, m_creature); - else - DoScriptText(SAY_SOUL_CLEAVE, m_creature); - - soulmodel = target->GetDisplayId(); - soulholder = target->GetGUID(); - soulclass = target->getClass(); - - DoCast(target,SPELL_STOLEN_SOUL); - m_creature->SummonCreature(ENTRY_STOLEN_SOUL, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000); - - StolenSoul_Timer = 20000 + rand()% 10000; - } else StolenSoul_Timer = 1000; - } - }else StolenSoul_Timer -= diff; - - if (Ribbon_of_Souls_timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_RIBBON_OF_SOULS); - - Ribbon_of_Souls_timer = 5000 + (rand()%20 * 1000); - }else Ribbon_of_Souls_timer -= diff; - - if (Fear_timer < diff) - { - DoCast(m_creature,SPELL_SOUL_SCREAM); - Fear_timer = 15000 + rand()% 15000; - }else Fear_timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_exarch_maladaar(Creature* pCreature) -{ - return new boss_exarch_maladaarAI (pCreature); -} - -#define SPELL_AV_MORTAL_STRIKE 16856 -#define SPELL_AV_SUNDER_ARMOR 16145 - -struct TRINITY_DLL_DECL mob_avatar_of_martyredAI : public ScriptedAI -{ - mob_avatar_of_martyredAI(Creature *c) : ScriptedAI(c) {} - - uint32 Mortal_Strike_timer; - - void Reset() - { - Mortal_Strike_timer = 10000; - } - - void EnterCombat(Unit *who) - { - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (Mortal_Strike_timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_AV_MORTAL_STRIKE); - Mortal_Strike_timer = 10000 + rand()%20 * 1000; - } else Mortal_Strike_timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_avatar_of_martyred(Creature* pCreature) -{ - return new mob_avatar_of_martyredAI (pCreature); -} - -void AddSC_boss_exarch_maladaar() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_exarch_maladaar"; - newscript->GetAI = &GetAI_boss_exarch_maladaar; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_avatar_of_martyred"; - newscript->GetAI = &GetAI_mob_avatar_of_martyred; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_stolen_soul"; - newscript->GetAI = &GetAI_mob_stolen_soul; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp deleted file mode 100644 index 4dfdd407731..00000000000 --- a/src/bindings/scripts/scripts/zone/aunchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp +++ /dev/null @@ -1,212 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -Name: Boss_Shirrak_the_dead_watcher -%Complete: 80 -Comment: InhibitMagic should stack slower far from the boss, proper Visual for Focus Fire, heroic implemented -Category: Auchindoun, Auchenai Crypts -EndScriptData */ - -#include "precompiled.h" - -#define SPELL_INHIBITMAGIC 32264 -#define SPELL_ATTRACTMAGIC 32265 -#define N_SPELL_CARNIVOROUSBITE 36383 -#define H_SPELL_CARNIVOROUSBITE 39382 -#define SPELL_CARNIVOROUSBITE (HeroicMode?H_SPELL_CARNIVOROUSBITE:N_SPELL_CARNIVOROUSBITE) - -#define ENTRY_FOCUS_FIRE 18374 - -#define N_SPELL_FIERY_BLAST 32302 -#define H_SPELL_FIERY_BLAST 38382 -#define SPELL_FIERY_BLAST (HeroicMode?H_SPELL_FIERY_BLAST:N_SPELL_FIERY_BLAST) -#define SPELL_FOCUS_FIRE_VISUAL 42075 //need to find better visual - -struct TRINITY_DLL_DECL boss_shirrak_the_dead_watcherAI : public ScriptedAI -{ - boss_shirrak_the_dead_watcherAI(Creature *c) : ScriptedAI(c) - { - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - uint32 Inhibitmagic_Timer; - uint32 Attractmagic_Timer; - uint32 Carnivorousbite_Timer; - uint32 FocusFire_Timer; - bool HeroicMode; - Unit *focusedTarget; - - void Reset() - { - Inhibitmagic_Timer = 0; - Attractmagic_Timer = 28000; - Carnivorousbite_Timer = 10000; - FocusFire_Timer = 17000; - focusedTarget = NULL; - } - - void EnterCombat(Unit *who) - { } - - void JustSummoned(Creature *summoned) - { - if (summoned && summoned->GetEntry() == ENTRY_FOCUS_FIRE) - { - summoned->CastSpell(summoned,SPELL_FOCUS_FIRE_VISUAL,false); - summoned->setFaction(m_creature->getFaction()); - summoned->SetLevel(m_creature->getLevel()); - summoned->addUnitState(UNIT_STAT_ROOT); - - if (focusedTarget) - summoned->AI()->AttackStart(focusedTarget); - } - } - - void UpdateAI(const uint32 diff) - { - //Inhibitmagic_Timer - if (Inhibitmagic_Timer < diff) - { - float dist; - Map* pMap = m_creature->GetMap(); - Map::PlayerList const &PlayerList = pMap->GetPlayers(); - for(Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) - if (Player* i_pl = i->getSource()) - if (i_pl->isAlive() && (dist = i_pl->IsWithinDist(m_creature, 45))) - { - i_pl->RemoveAurasDueToSpell(SPELL_INHIBITMAGIC); - m_creature->AddAura(SPELL_INHIBITMAGIC, i_pl); - if (dist < 35) - m_creature->AddAura(SPELL_INHIBITMAGIC, i_pl); - if (dist < 25) - m_creature->AddAura(SPELL_INHIBITMAGIC, i_pl); - if (dist < 15) - m_creature->AddAura(SPELL_INHIBITMAGIC, i_pl); - } - Inhibitmagic_Timer = 3000+(rand()%1000); - }else Inhibitmagic_Timer -= diff; - - //Return since we have no target - if (!UpdateVictim()) - return; - - //Attractmagic_Timer - if (Attractmagic_Timer < diff) - { - DoCast(m_creature,SPELL_ATTRACTMAGIC); - Attractmagic_Timer = 30000; - Carnivorousbite_Timer = 1500; - }else Attractmagic_Timer -= diff; - - //Carnivorousbite_Timer - if (Carnivorousbite_Timer < diff) - { - DoCast(m_creature,SPELL_CARNIVOROUSBITE); - Carnivorousbite_Timer = 10000; - }else Carnivorousbite_Timer -= diff; - - //FocusFire_Timer - if (FocusFire_Timer < diff) - { - // Summon Focus Fire & Emote - Unit *target = SelectUnit(SELECT_TARGET_RANDOM,1); - if (target && target->GetTypeId() == TYPEID_PLAYER && target->isAlive()) - { - focusedTarget = target; - m_creature->SummonCreature(ENTRY_FOCUS_FIRE,target->GetPositionX(),target->GetPositionY(),target->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN,5500); - - // TODO: Find better way to handle emote - // Emote - std::string *emote = new std::string("focuses on "); - emote->append(target->GetName()); - emote->append("!"); - const char* text = emote->c_str(); - m_creature->MonsterTextEmote(text, 0, true); - delete emote; - } - FocusFire_Timer = 15000+(rand()%5000); - }else FocusFire_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_shirrak_the_dead_watcher(Creature* pCreature) -{ - return new boss_shirrak_the_dead_watcherAI (pCreature); -} - -struct TRINITY_DLL_DECL mob_focus_fireAI : public ScriptedAI -{ - mob_focus_fireAI(Creature *c) : ScriptedAI(c) - { - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - bool HeroicMode; - uint32 FieryBlast_Timer; - bool fiery1, fiery2; - - void Reset() - { - FieryBlast_Timer = 3000+(rand()%1000); - fiery1 = fiery2 = true; - } - - void EnterCombat(Unit *who) - { } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //FieryBlast_Timer - if (fiery2 && FieryBlast_Timer < diff) - { - DoCast(m_creature,SPELL_FIERY_BLAST); - - if (fiery1) fiery1 = false; - else if (fiery2) fiery2 = false; - - FieryBlast_Timer = 1000; - }else FieryBlast_Timer -= diff; - - //DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_focus_fire(Creature* pCreature) -{ - return new mob_focus_fireAI (pCreature); -} - -void AddSC_boss_shirrak_the_dead_watcher() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_shirrak_the_dead_watcher"; - newscript->GetAI = &GetAI_boss_shirrak_the_dead_watcher; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_focus_fire"; - newscript->GetAI = &GetAI_mob_focus_fire; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp deleted file mode 100644 index dcaaefee8c2..00000000000 --- a/src/bindings/scripts/scripts/zone/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp +++ /dev/null @@ -1,369 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_NexusPrince_Shaffar -SD%Complete: 80 -SDComment: Need more tuning of spell timers, it should not be as linear fight as current. Also should possibly find a better way to deal with his three initial beacons to make sure all aggro. -SDCategory: Auchindoun, Mana Tombs -EndScriptData */ - -/* ContentData -boss_nexusprince_shaffar -mob_ethereal_beacon -EndContentData */ - -#include "precompiled.h" - -enum -{ - SAY_INTRO = -1557000, - SAY_AGGRO_1 = -1557001, - SAY_AGGRO_2 = -1557002, - SAY_AGGRO_3 = -1557003, - SAY_SLAY_1 = -1557004, - SAY_SLAY_2 = -1557005, - SAY_SUMMON = -1557006, - SAY_DEAD = -1557007, - - SPELL_BLINK = 34605, - SPELL_FROSTBOLT = 32364, - SPELL_FIREBALL = 32363, - SPELL_FROSTNOVA = 32365, - - SPELL_ETHEREAL_BEACON = 32371, // Summons NPC_BEACON - SPELL_ETHEREAL_BEACON_VISUAL = 32368, - - NPC_BEACON = 18431, - NPC_SHAFFAR = 18344, - - NR_INITIAL_BEACONS = 3 -}; - -struct TRINITY_DLL_DECL boss_nexusprince_shaffarAI : public ScriptedAI -{ - boss_nexusprince_shaffarAI(Creature *c) : ScriptedAI(c), summons(me) { HasTaunted = false; } - - uint32 Blink_Timer; - uint32 Beacon_Timer; - uint32 FireBall_Timer; - uint32 Frostbolt_Timer; - uint32 FrostNova_Timer; - - SummonList summons; - - bool HasTaunted; - bool CanBlink; - - void Reset() - { - Blink_Timer = 1500; - Beacon_Timer = 10000; - FireBall_Timer = 8000; - Frostbolt_Timer = 4000; - FrostNova_Timer = 15000; - - CanBlink = false; - - float dist = 8.0f; - float posX, posY, posZ, angle; - m_creature->GetHomePosition(posX, posY, posZ, angle); - - m_creature->SummonCreature(NPC_BEACON, posX - dist, posY - dist, posZ, angle, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 7200000); - m_creature->SummonCreature(NPC_BEACON, posX - dist, posY + dist, posZ, angle, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 7200000); - m_creature->SummonCreature(NPC_BEACON, posX + dist, posY, posZ, angle, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 7200000); - } - - void EnterEvadeMode() - { - summons.DespawnAll(); - ScriptedAI::EnterEvadeMode(); - } - - void MoveInLineOfSight(Unit *who) - { - if (!HasTaunted && who->GetTypeId() == TYPEID_PLAYER && m_creature->IsWithinDistInMap(who, 100.0f)) - { - DoScriptText(SAY_INTRO, m_creature); - HasTaunted = true; - } - } - - void EnterCombat(Unit *who) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; - case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; - case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; - } - - DoZoneInCombat(); - summons.DoZoneInCombat(); - } - - void JustSummoned(Creature *summoned) - { - if (summoned->GetEntry() == NPC_BEACON) - { - summoned->CastSpell(summoned,SPELL_ETHEREAL_BEACON_VISUAL,false); - - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - summoned->AI()->AttackStart(target); - } - - summons.Summon(summoned); - } - - void SummonedCreatureDespawn(Creature *summon) - { - summons.Despawn(summon); - } - - void KilledUnit(Unit* victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature); break; - case 1: DoScriptText(SAY_SLAY_2, m_creature); break; - } - } - - void JustDied(Unit* Killer) - { - DoScriptText(SAY_DEAD, m_creature); - summons.DespawnAll(); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (FrostNova_Timer < diff) - { - if (m_creature->IsNonMeleeSpellCasted(false)) - m_creature->InterruptNonMeleeSpells(true); - - DoCast(m_creature,SPELL_FROSTNOVA); - FrostNova_Timer = 17500 + rand()%7500; - CanBlink = true; - }else FrostNova_Timer -= diff; - - if (Frostbolt_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_FROSTBOLT); - Frostbolt_Timer = 4500 + rand()%1500; - }else Frostbolt_Timer -= diff; - - if (FireBall_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_FIREBALL); - FireBall_Timer = 4500 + rand()%1500; - }else FireBall_Timer -= diff; - - if (CanBlink) - { - if (Blink_Timer < diff) - { - if (m_creature->IsNonMeleeSpellCasted(false)) - m_creature->InterruptNonMeleeSpells(true); - - //expire movement, will prevent from running right back to victim after cast - //(but should MoveChase be used again at a certain time or should he not move?) - if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE) - m_creature->GetMotionMaster()->MovementExpired(); - - DoCast(m_creature,SPELL_BLINK); - Blink_Timer = 1000 + rand()%1500; - CanBlink = false; - }else Blink_Timer -= diff; - } - - if (Beacon_Timer < diff) - { - if (m_creature->IsNonMeleeSpellCasted(false)) - m_creature->InterruptNonMeleeSpells(true); - - if (!urand(0,3)) - DoScriptText(SAY_SUMMON, m_creature); - - DoCast(m_creature,SPELL_ETHEREAL_BEACON, true); - - Beacon_Timer = 10000; - }else Beacon_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_nexusprince_shaffar(Creature* pCreature) -{ - return new boss_nexusprince_shaffarAI (pCreature); -} - -enum -{ - SPELL_ARCANE_BOLT = 15254, - SPELL_ETHEREAL_APPRENTICE = 32372 // Summon 18430 -}; - -struct TRINITY_DLL_DECL mob_ethereal_beaconAI : public ScriptedAI -{ - mob_ethereal_beaconAI(Creature *c) : ScriptedAI(c) - { - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - bool HeroicMode; - uint32 Apprentice_Timer; - uint32 ArcaneBolt_Timer; - uint32 Check_Timer; - - void KillSelf() - { - m_creature->Kill(m_creature); - } - - void Reset() - { - Apprentice_Timer = (HeroicMode ? 10000 : 20000); - ArcaneBolt_Timer = 1000; - Check_Timer = 1000; - } - - void EnterCombat(Unit *who) - { - // Send Shaffar to fight - Creature* Shaffar = me->FindNearestCreature(NPC_SHAFFAR, 100); - if (!Shaffar || Shaffar->isDead()) - { - KillSelf(); - return; - } - if (!Shaffar->isInCombat()) - Shaffar->AI()->AttackStart(who); - } - - void JustSummoned(Creature *summoned) - { - summoned->AI()->AttackStart(m_creature->getVictim()); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (Check_Timer < diff) - { - Creature *Shaffar = me->FindNearestCreature(NPC_SHAFFAR, 100); - if (!Shaffar || Shaffar->isDead() || !Shaffar->isInCombat()) - { - KillSelf(); - return; - } - Check_Timer = 1000; - }else Check_Timer -= diff; - - if (ArcaneBolt_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_ARCANE_BOLT); - ArcaneBolt_Timer = 2000 + rand()%2500; - }else ArcaneBolt_Timer -= diff; - - if (Apprentice_Timer < diff) - { - if (m_creature->IsNonMeleeSpellCasted(false)) - m_creature->InterruptNonMeleeSpells(true); - - m_creature->CastSpell(m_creature,SPELL_ETHEREAL_APPRENTICE,true); - m_creature->ForcedDespawn(); - return; - }else Apprentice_Timer -= diff; - } -}; - -CreatureAI* GetAI_mob_ethereal_beacon(Creature* pCreature) -{ - return new mob_ethereal_beaconAI (pCreature); -} - -enum -{ - SPELL_ETHEREAL_APPRENTICE_FIREBOLT = 32369, - SPELL_ETHEREAL_APPRENTICE_FROSTBOLT = 32370 -}; - -struct TRINITY_DLL_DECL mob_ethereal_apprenticeAI : public ScriptedAI -{ - mob_ethereal_apprenticeAI(Creature *c) : ScriptedAI(c) {} - - uint32 Cast_Timer; - - bool isFireboltTurn; - - void Reset() - { - Cast_Timer = 3000; - isFireboltTurn = true; - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (Cast_Timer < diff) - { - if (isFireboltTurn) - { - m_creature->CastSpell(m_creature->getVictim(), SPELL_ETHEREAL_APPRENTICE_FIREBOLT, true); - isFireboltTurn = false; - }else{ - m_creature->CastSpell(m_creature->getVictim(), SPELL_ETHEREAL_APPRENTICE_FROSTBOLT, true); - isFireboltTurn = true; - } - Cast_Timer = 3000; - }else Cast_Timer -= diff; - } -}; - -CreatureAI* GetAI_mob_ethereal_apprentice(Creature* pCreature) -{ - return new mob_ethereal_apprenticeAI (pCreature); -} - -void AddSC_boss_nexusprince_shaffar() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_nexusprince_shaffar"; - newscript->GetAI = &GetAI_boss_nexusprince_shaffar; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_ethereal_beacon"; - newscript->GetAI = &GetAI_mob_ethereal_beacon; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_ethereal_apprentice"; - newscript->GetAI = &GetAI_mob_ethereal_apprentice; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/mana_tombs/boss_pandemonius.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/mana_tombs/boss_pandemonius.cpp deleted file mode 100644 index 77e1c535340..00000000000 --- a/src/bindings/scripts/scripts/zone/aunchindoun/mana_tombs/boss_pandemonius.cpp +++ /dev/null @@ -1,138 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Pandemonius -SD%Complete: 75 -SDComment: Not known how void blast is done (amount of rapid cast seems to be related to players in party). All mobs remaining in surrounding area should aggro when engaged. -SDCategory: Auchindoun, Mana Tombs -EndScriptData */ - -#include "precompiled.h" - -#define SAY_AGGRO_1 -1557008 -#define SAY_AGGRO_2 -1557009 -#define SAY_AGGRO_3 -1557010 - -#define SAY_KILL_1 -1557011 -#define SAY_KILL_2 -1557012 - -#define SAY_DEATH -1557013 - -#define EMOTE_DARK_SHELL -1557014 - -#define SPELL_VOID_BLAST 32325 -#define H_SPELL_VOID_BLAST 38760 -#define SPELL_DARK_SHELL 32358 -#define H_SPELL_DARK_SHELL 38759 - -struct TRINITY_DLL_DECL boss_pandemoniusAI : public ScriptedAI -{ - boss_pandemoniusAI(Creature *c) : ScriptedAI(c) - { - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - bool HeroicMode; - uint32 VoidBlast_Timer; - uint32 DarkShell_Timer; - uint32 VoidBlast_Counter; - - void Reset() - { - VoidBlast_Timer = 8000+rand()%15000; - DarkShell_Timer = 20000; - VoidBlast_Counter = 0; - } - - void JustDied(Unit* Killer) - { - DoScriptText(SAY_DEATH, m_creature); - } - - void KilledUnit(Unit* victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_KILL_1, m_creature); break; - case 1: DoScriptText(SAY_KILL_2, m_creature); break; - } - } - - void EnterCombat(Unit *who) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; - case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; - case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; - } - - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (VoidBlast_Timer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - { - DoCast(target,HeroicMode ? H_SPELL_VOID_BLAST : SPELL_VOID_BLAST); - VoidBlast_Timer = 500; - ++VoidBlast_Counter; - } - - if (VoidBlast_Counter == 5) - { - VoidBlast_Timer = 15000+rand()%10000; - VoidBlast_Counter = 0; - } - }else VoidBlast_Timer -= diff; - - if (!VoidBlast_Counter) - { - if (DarkShell_Timer < diff) - { - if (m_creature->IsNonMeleeSpellCasted(false)) - m_creature->InterruptNonMeleeSpells(true); - - DoScriptText(EMOTE_DARK_SHELL, m_creature); - - DoCast(m_creature,HeroicMode ? H_SPELL_DARK_SHELL : SPELL_DARK_SHELL); - DarkShell_Timer = 20000; - }else DarkShell_Timer -= diff; - } - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_pandemonius(Creature* pCreature) -{ - return new boss_pandemoniusAI (pCreature); -} - -void AddSC_boss_pandemonius() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_pandemonius"; - newscript->GetAI = &GetAI_boss_pandemonius; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/boss_darkweaver_syth.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/boss_darkweaver_syth.cpp deleted file mode 100644 index 00e43fa257d..00000000000 --- a/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/boss_darkweaver_syth.cpp +++ /dev/null @@ -1,438 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Darkweaver_Syth -SD%Complete: 85 -SDComment: Shock spells/times need more work. Heroic partly implemented. -SDCategory: Auchindoun, Sethekk Halls -EndScriptData */ - -#include "precompiled.h" - -#define SAY_SUMMON -1556000 - -#define SAY_AGGRO_1 -1556001 -#define SAY_AGGRO_2 -1556002 -#define SAY_AGGRO_3 -1556003 - -#define SAY_SLAY_1 -1556004 -#define SAY_SLAY_2 -1556005 - -#define SAY_DEATH -1556006 - -#define SPELL_FROST_SHOCK 21401 //37865 -#define SPELL_FLAME_SHOCK 34354 -#define SPELL_SHADOW_SHOCK 30138 -#define SPELL_ARCANE_SHOCK 37132 - -#define SPELL_CHAIN_LIGHTNING 15659 //15305 - -#define SPELL_SUMMON_SYTH_FIRE 33537 // Spawns 19203 -#define SPELL_SUMMON_SYTH_ARCANE 33538 // Spawns 19205 -#define SPELL_SUMMON_SYTH_FROST 33539 // Spawns 19204 -#define SPELL_SUMMON_SYTH_SHADOW 33540 // Spawns 19206 - -#define SPELL_FLAME_BUFFET (HeroicMode?38141:33526) -#define SPELL_ARCANE_BUFFET (HeroicMode?38138:33527) -#define SPELL_FROST_BUFFET (HeroicMode?38142:33528) -#define SPELL_SHADOW_BUFFET (HeroicMode?38143:33529) - -struct TRINITY_DLL_DECL boss_darkweaver_sythAI : public ScriptedAI -{ - boss_darkweaver_sythAI(Creature *c) : ScriptedAI(c) - - { - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - uint32 flameshock_timer; - uint32 arcaneshock_timer; - uint32 frostshock_timer; - uint32 shadowshock_timer; - uint32 chainlightning_timer; - - bool summon90; - bool summon50; - bool summon10; - bool HeroicMode; - - void Reset() - { - flameshock_timer = 2000; - arcaneshock_timer = 4000; - frostshock_timer = 6000; - shadowshock_timer = 8000; - chainlightning_timer = 15000; - - summon90 = false; - summon50 = false; - summon10 = false; - } - - void EnterCombat(Unit *who) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; - case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; - case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; - } - } - - void JustDied(Unit* Killer) - { - DoScriptText(SAY_DEATH, m_creature); - } - - void KilledUnit(Unit* victim) - { - if (rand()%2) - return; - - switch(rand()%2) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature); break; - case 1: DoScriptText(SAY_SLAY_2, m_creature); break; - } - } - - void JustSummoned(Creature *summoned) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - summoned->AI()->AttackStart(target); - } - - void SythSummoning() - { - DoScriptText(SAY_SUMMON, m_creature); - - if (m_creature->IsNonMeleeSpellCasted(false)) - m_creature->InterruptNonMeleeSpells(false); - - DoCast(m_creature,SPELL_SUMMON_SYTH_ARCANE,true); //front - DoCast(m_creature,SPELL_SUMMON_SYTH_FIRE,true); //back - DoCast(m_creature,SPELL_SUMMON_SYTH_FROST,true); //left - DoCast(m_creature,SPELL_SUMMON_SYTH_SHADOW,true); //right - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 90) && !summon90) - { - SythSummoning(); - summon90 = true; - } - - if (((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 50) && !summon50) - { - SythSummoning(); - summon50 = true; - } - - if (((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 10) && !summon10) - { - SythSummoning(); - summon10 = true; - } - - if (flameshock_timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_FLAME_SHOCK); - - flameshock_timer = 10000 + rand()%5000; - } else flameshock_timer -= diff; - - if (arcaneshock_timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_ARCANE_SHOCK); - - arcaneshock_timer = 10000 + rand()%5000; - } else arcaneshock_timer -= diff; - - if (frostshock_timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_FROST_SHOCK); - - frostshock_timer = 10000 + rand()%5000; - } else frostshock_timer -= diff; - - if (shadowshock_timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_SHADOW_SHOCK); - - shadowshock_timer = 10000 + rand()%5000; - } else shadowshock_timer -= diff; - - if (chainlightning_timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_CHAIN_LIGHTNING); - - chainlightning_timer = 25000; - } else chainlightning_timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_darkweaver_syth(Creature* pCreature) -{ - return new boss_darkweaver_sythAI (pCreature); -} - -/* ELEMENTALS */ - -struct TRINITY_DLL_DECL mob_syth_fireAI : public ScriptedAI -{ - mob_syth_fireAI(Creature *c) : ScriptedAI(c) - - { - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - uint32 flameshock_timer; - uint32 flamebuffet_timer; - bool HeroicMode; - - void Reset() - { - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true); - flameshock_timer = 2500; - flamebuffet_timer = 5000; - } - - void EnterCombat(Unit *who) { } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (flameshock_timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_FLAME_SHOCK); - - flameshock_timer = 5000; - }else flameshock_timer -= diff; - - if (flamebuffet_timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_FLAME_BUFFET); - - flamebuffet_timer = 5000; - }else flamebuffet_timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_syth_fire(Creature* pCreature) -{ - return new mob_syth_fireAI (pCreature); -} - -struct TRINITY_DLL_DECL mob_syth_arcaneAI : public ScriptedAI -{ - mob_syth_arcaneAI(Creature *c) : ScriptedAI(c) - - { - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - uint32 arcaneshock_timer; - uint32 arcanebuffet_timer; - bool HeroicMode; - - void Reset() - { - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, true); - arcaneshock_timer = 2500; - arcanebuffet_timer = 5000; - } - - void EnterCombat(Unit *who) { } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (arcaneshock_timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_ARCANE_SHOCK); - - arcaneshock_timer = 5000; - }else arcaneshock_timer -= diff; - - if (arcanebuffet_timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_ARCANE_BUFFET); - - arcanebuffet_timer = 5000; - }else arcanebuffet_timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_syth_arcane(Creature* pCreature) -{ - return new mob_syth_arcaneAI (pCreature); -} - -struct TRINITY_DLL_DECL mob_syth_frostAI : public ScriptedAI -{ - mob_syth_frostAI(Creature *c) : ScriptedAI(c) - - { - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - uint32 frostshock_timer; - uint32 frostbuffet_timer; - bool HeroicMode; - - void Reset() - { - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true); - frostshock_timer = 2500; - frostbuffet_timer = 5000; - } - - void EnterCombat(Unit *who) { } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (frostshock_timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_FROST_SHOCK); - - frostshock_timer = 5000; - }else frostshock_timer -= diff; - - if (frostbuffet_timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_FROST_BUFFET); - - frostbuffet_timer = 5000; - }else frostbuffet_timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_syth_frost(Creature* pCreature) -{ - return new mob_syth_frostAI (pCreature); -} - -struct TRINITY_DLL_DECL mob_syth_shadowAI : public ScriptedAI -{ - mob_syth_shadowAI(Creature *c) : ScriptedAI(c) - - { - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - uint32 shadowshock_timer; - uint32 shadowbuffet_timer; - bool HeroicMode; - - void Reset() - { - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, true); - shadowshock_timer = 2500; - shadowbuffet_timer = 5000; - } - - void EnterCombat(Unit *who) { } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (shadowshock_timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_SHADOW_SHOCK); - - shadowshock_timer = 5000; - }else shadowshock_timer -= diff; - - if (shadowbuffet_timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_SHADOW_BUFFET); - - shadowbuffet_timer = 5000; - }else shadowbuffet_timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_syth_shadow(Creature* pCreature) -{ - return new mob_syth_shadowAI (pCreature); -} - -void AddSC_boss_darkweaver_syth() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_darkweaver_syth"; - newscript->GetAI = &GetAI_boss_darkweaver_syth; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_syth_fire"; - newscript->GetAI = &GetAI_mob_syth_arcane; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_syth_arcane"; - newscript->GetAI = &GetAI_mob_syth_arcane; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_syth_frost"; - newscript->GetAI = &GetAI_mob_syth_frost; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_syth_shadow"; - newscript->GetAI = &GetAI_mob_syth_shadow; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/boss_tailonking_ikiss.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/boss_tailonking_ikiss.cpp deleted file mode 100644 index 7830fc10645..00000000000 --- a/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/boss_tailonking_ikiss.cpp +++ /dev/null @@ -1,221 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Talon_King_Ikiss -SD%Complete: 80 -SDComment: Heroic supported. Some details missing, but most are spell related. -SDCategory: Auchindoun, Sethekk Halls -EndScriptData */ - -#include "precompiled.h" -#include "def_sethekk_halls.h" - -#define SAY_INTRO -1556007 - -#define SAY_AGGRO_1 -1556008 -#define SAY_AGGRO_2 -1556009 -#define SAY_AGGRO_3 -1556010 - -#define SAY_SLAY_1 -1556011 -#define SAY_SLAY_2 -1556012 -#define SAY_DEATH -1556013 -#define EMOTE_ARCANE_EXP -1556015 - -#define SPELL_BLINK 38194 -#define SPELL_BLINK_TELEPORT 38203 -#define SPELL_MANA_SHIELD 38151 -#define SPELL_ARCANE_BUBBLE 9438 -#define H_SPELL_SLOW 35032 - -#define SPELL_POLYMORPH 38245 -#define H_SPELL_POLYMORPH 43309 - -#define SPELL_ARCANE_VOLLEY 35059 -#define H_SPELL_ARCANE_VOLLEY 40424 - -#define SPELL_ARCANE_EXPLOSION 38197 -#define H_SPELL_ARCANE_EXPLOSION 40425 - -struct TRINITY_DLL_DECL boss_talon_king_ikissAI : public ScriptedAI -{ - boss_talon_king_ikissAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - bool HeroicMode; - - uint32 ArcaneVolley_Timer; - uint32 Sheep_Timer; - uint32 Blink_Timer; - uint32 Slow_Timer; - - bool ManaShield; - bool Blink; - bool Intro; - - void Reset() - { - HeroicMode = m_creature->GetMap()->IsHeroic(); - - ArcaneVolley_Timer = 5000; - Sheep_Timer = 8000; - Blink_Timer = 35000; - Slow_Timer = 15000+rand()%15000; - Blink = false; - Intro = false; - ManaShield = false; - } - - void MoveInLineOfSight(Unit *who) - { - if (!m_creature->getVictim() && who->isTargetableForAttack() && (m_creature->IsHostileTo(who)) && who->isInAccessiblePlaceFor(m_creature)) - { - if (!Intro && m_creature->IsWithinDistInMap(who, 100)) - { - Intro = true; - DoScriptText(SAY_INTRO, m_creature); - } - - if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) - return; - - float attackRadius = m_creature->GetAttackDistance(who); - if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who)) - { - //who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); - AttackStart(who); - } - } - } - - void EnterCombat(Unit *who) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; - case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; - case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; - } - } - - void JustDied(Unit* Killer) - { - DoScriptText(SAY_DEATH, m_creature); - - if (pInstance) - pInstance->SetData(DATA_IKISSDOOREVENT, DONE); - } - - void KilledUnit(Unit* victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature); break; - case 1: DoScriptText(SAY_SLAY_2, m_creature); break; - } - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (Blink) - { - DoCast(m_creature,HeroicMode ? H_SPELL_ARCANE_EXPLOSION : SPELL_ARCANE_EXPLOSION); - m_creature->CastSpell(m_creature,SPELL_ARCANE_BUBBLE,true); - Blink = false; - } - - if (ArcaneVolley_Timer < diff) - { - DoCast(m_creature,HeroicMode ? H_SPELL_ARCANE_VOLLEY : SPELL_ARCANE_VOLLEY); - ArcaneVolley_Timer = 7000+rand()%5000; - }else ArcaneVolley_Timer -= diff; - - if (Sheep_Timer < diff) - { - //second top aggro target in normal, random target in heroic correct? - Unit *target = NULL; - target = HeroicMode ? SelectUnit(SELECT_TARGET_RANDOM,0) : SelectUnit(SELECT_TARGET_TOPAGGRO,1); - if (target) - DoCast(target,HeroicMode ? H_SPELL_POLYMORPH : SPELL_POLYMORPH); - Sheep_Timer = 15000+rand()%2500; - }else Sheep_Timer -= diff; - - //may not be correct time to cast - if (!ManaShield && ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 20)) - { - DoCast(m_creature,SPELL_MANA_SHIELD); - ManaShield = true; - } - - if (HeroicMode) - { - if (Slow_Timer < diff) - { - DoCast(m_creature,H_SPELL_SLOW); - Slow_Timer = 15000+rand()%25000; - }else Slow_Timer -= diff; - } - - if (Blink_Timer < diff) - { - DoScriptText(EMOTE_ARCANE_EXP, m_creature); - - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - { - if (m_creature->IsNonMeleeSpellCasted(false)) - m_creature->InterruptNonMeleeSpells(false); - - //Spell doesn't work, but we use for visual effect at least - DoCast(target,SPELL_BLINK); - - float X = target->GetPositionX(); - float Y = target->GetPositionY(); - float Z = target->GetPositionZ(); - - DoTeleportTo(X,Y,Z); - - DoCast(target,SPELL_BLINK_TELEPORT); - Blink = true; - } - Blink_Timer = 35000+rand()%5000; - }else Blink_Timer -= diff; - - if (!Blink) - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_talon_king_ikiss(Creature* pCreature) -{ - return new boss_talon_king_ikissAI (pCreature); -} - -void AddSC_boss_talon_king_ikiss() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_talon_king_ikiss"; - newscript->GetAI = &GetAI_boss_talon_king_ikiss; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/def_sethekk_halls.h b/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/def_sethekk_halls.h deleted file mode 100644 index 6156f354d84..00000000000 --- a/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/def_sethekk_halls.h +++ /dev/null @@ -1,14 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ - -#ifndef DEF_SETHEKK_HALLS_H -#define DEF_SETHEKK_HALLS_H - -enum -{ - DATA_IKISSDOOREVENT = 1, - TYPE_ANZU_ENCOUNTER = 2, -}; -#endif - diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/instance_sethekk_halls.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/instance_sethekk_halls.cpp deleted file mode 100644 index 060e09a1325..00000000000 --- a/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/instance_sethekk_halls.cpp +++ /dev/null @@ -1,91 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Instance - Sethekk Halls -SD%Complete: 50 -SDComment: Instance Data for Sethekk Halls instance -SDCategory: Auchindoun, Sethekk Halls -EndScriptData */ - -#include "precompiled.h" -#include "def_sethekk_halls.h" - -enum -{ - NPC_ANZU = 23035, - IKISS_DOOR = 177203, -}; - -struct TRINITY_DLL_DECL instance_sethekk_halls : public ScriptedInstance -{ - instance_sethekk_halls(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; - - uint32 AnzuEncounter; - uint64 m_uiIkissDoorGUID; - - void Initialize() - { - AnzuEncounter = NOT_STARTED; - m_uiIkissDoorGUID = 0; - } - - void OnCreatureCreate(Creature* pCreature, bool add) - { - if (pCreature->GetEntry() == NPC_ANZU && AnzuEncounter >= IN_PROGRESS) - { - pCreature->DealDamage(pCreature, pCreature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - pCreature->RemoveCorpse(); - } else { - AnzuEncounter = IN_PROGRESS; - } - } - - void OnGameObjectCreate(GameObject* pGo, bool add) - { - if (pGo->GetEntry() == IKISS_DOOR) - m_uiIkissDoorGUID = pGo->GetGUID(); - } - - void SetData(uint32 type, uint32 data) - { - switch(type) - { - case DATA_IKISSDOOREVENT: - if (data == DONE) - DoUseDoorOrButton(m_uiIkissDoorGUID,DAY*IN_MILISECONDS); - break; - case TYPE_ANZU_ENCOUNTER: - AnzuEncounter = data; - break; - } - } -}; - -InstanceData* GetInstanceData_instance_sethekk_halls(Map* pMap) -{ - return new instance_sethekk_halls(pMap); -} - -void AddSC_instance_sethekk_halls() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_sethekk_halls"; - newscript->GetInstanceData = &GetInstanceData_instance_sethekk_halls; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp deleted file mode 100644 index f9961e10174..00000000000 --- a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp +++ /dev/null @@ -1,217 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Ambassador_Hellmaw -SD%Complete: 80 -SDComment: Enrage spell missing/not known -SDCategory: Auchindoun, Shadow Labyrinth -EndScriptData */ - -#include "precompiled.h" -#include "escortAI.h" -#include "def_shadow_labyrinth.h" - -enum -{ - SAY_INTRO = -1555000, - SAY_AGGRO1 = -1555001, - SAY_AGGRO2 = -1555002, - SAY_AGGRO3 = -1555003, - SAY_HELP = -1555004, - SAY_SLAY1 = -1555005, - SAY_SLAY2 = -1555006, - SAY_DEATH = -1555007, - - SPELL_BANISH = 30231, - SPELL_CORROSIVE_ACID = 33551, - SPELL_FEAR = 33547, - SPELL_ENRAGE = 34970 -}; - -struct TRINITY_DLL_DECL boss_ambassador_hellmawAI : public npc_escortAI -{ - boss_ambassador_hellmawAI(Creature* pCreature) : npc_escortAI(pCreature) - { - m_pInstance = pCreature->GetInstanceData(); - HeroicMode = pCreature->GetMap()->IsHeroic(); - } - - ScriptedInstance* m_pInstance; - bool HeroicMode; - - uint32 EventCheck_Timer; - uint32 CorrosiveAcid_Timer; - uint32 Fear_Timer; - uint32 Enrage_Timer; - bool Intro; - bool IsBanished; - bool Enraged; - - void Reset() - { - EventCheck_Timer = 5000; - CorrosiveAcid_Timer = 5000 + rand()%5000; - Fear_Timer = 25000 + rand()%5000; - Enrage_Timer = 180000; - Intro = false; - IsBanished = true; - Enraged = false; - - if (m_pInstance && m_creature->isAlive()) - { - if (m_pInstance->GetData(TYPE_OVERSEER) != DONE) - m_creature->CastSpell(m_creature, SPELL_BANISH, true); - } - } - - void JustReachedHome() - { - if (m_pInstance) - m_pInstance->SetData(TYPE_HELLMAW, FAIL); - } - - void MoveInLineOfSight(Unit* pWho) - { - if (m_creature->HasAura(SPELL_BANISH)) - return; - - npc_escortAI::MoveInLineOfSight(pWho); - } - - void WaypointReached(uint32 i) - { - } - - void DoIntro() - { - if (m_creature->HasAura(SPELL_BANISH)) - m_creature->RemoveAurasDueToSpell(SPELL_BANISH); - - IsBanished = false; - Intro = true; - - if (m_pInstance) - { - if (m_pInstance->GetData(TYPE_HELLMAW) != FAIL) - { - DoScriptText(SAY_INTRO, m_creature); - Start(true, false, 0, NULL, false, true); - } - - m_pInstance->SetData(TYPE_HELLMAW, IN_PROGRESS); - } - } - - void EnterCombat(Unit *who) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_AGGRO1, m_creature); break; - case 1: DoScriptText(SAY_AGGRO2, m_creature); break; - case 2: DoScriptText(SAY_AGGRO3, m_creature); break; - } - } - - void KilledUnit(Unit *victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; - } - } - - void JustDied(Unit *victim) - { - DoScriptText(SAY_DEATH, m_creature); - - if (m_pInstance) - m_pInstance->SetData(TYPE_HELLMAW, DONE); - } - - void UpdateAI(const uint32 diff) - { - if (!Intro && !IsBeingEscorted) - { - if (EventCheck_Timer < diff) - { - if (m_pInstance) - { - if (m_pInstance->GetData(TYPE_OVERSEER) == DONE) - { - DoIntro(); - return; - } - } - EventCheck_Timer = 5000; - return; - } - else - { - EventCheck_Timer -= diff; - return; - } - } - - npc_escortAI::UpdateAI(diff); - - if (!UpdateVictim()) - return; - - if (m_creature->HasAura(SPELL_BANISH, 0)) - { - EnterEvadeMode(); - return; - } - - if (CorrosiveAcid_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_CORROSIVE_ACID); - CorrosiveAcid_Timer = 15000 + rand()%10000; - }else CorrosiveAcid_Timer -= diff; - - if (Fear_Timer < diff) - { - DoCast(m_creature,SPELL_FEAR); - Fear_Timer = 20000 + rand()%15000; - }else Fear_Timer -= diff; - - if (HeroicMode) - { - if (!Enraged && Enrage_Timer < diff) - { - DoCast(m_creature,SPELL_ENRAGE); - Enraged = true; - }else Enrage_Timer -= diff; - } - } -}; - -CreatureAI* GetAI_boss_ambassador_hellmaw(Creature* pCreature) -{ - return new boss_ambassador_hellmawAI(pCreature); -} - -void AddSC_boss_ambassador_hellmaw() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_ambassador_hellmaw"; - newscript->GetAI = &GetAI_boss_ambassador_hellmaw; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp deleted file mode 100644 index 73374c08f8c..00000000000 --- a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp +++ /dev/null @@ -1,177 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Blackheart_the_Inciter -SD%Complete: 75 -SDComment: Incite Chaos not functional since core lacks Mind Control support -SDCategory: Auchindoun, Shadow Labyrinth -EndScriptData */ - -#include "precompiled.h" -#include "def_shadow_labyrinth.h" - -#define SPELL_INCITE_CHAOS 33676 -#define SPELL_INCITE_CHAOS_B 33684 //debuff applied to each member of party -#define SPELL_CHARGE 33709 -#define SPELL_WAR_STOMP 33707 - -#define SAY_INTRO1 -1555008 -#define SAY_INTRO2 -1555009 -#define SAY_INTRO3 -1555010 -#define SAY_AGGRO1 -1555011 -#define SAY_AGGRO2 -1555012 -#define SAY_AGGRO3 -1555013 -#define SAY_SLAY1 -1555014 -#define SAY_SLAY2 -1555015 -#define SAY_HELP -1555016 -#define SAY_DEATH -1555017 - -#define SAY2_INTRO1 -1555018 -#define SAY2_INTRO2 -1555019 -#define SAY2_INTRO3 -1555020 -#define SAY2_AGGRO1 -1555021 -#define SAY2_AGGRO2 -1555022 -#define SAY2_AGGRO3 -1555023 -#define SAY2_SLAY1 -1555024 -#define SAY2_SLAY2 -1555025 -#define SAY2_HELP -1555026 -#define SAY2_DEATH -1555027 - -struct TRINITY_DLL_DECL boss_blackheart_the_inciterAI : public ScriptedAI -{ - boss_blackheart_the_inciterAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance *pInstance; - - bool InciteChaos; - uint32 InciteChaos_Timer; - uint32 InciteChaosWait_Timer; - uint32 Charge_Timer; - uint32 Knockback_Timer; - - void Reset() - { - InciteChaos = false; - InciteChaos_Timer = 20000; - InciteChaosWait_Timer = 15000; - Charge_Timer = 5000; - Knockback_Timer = 15000; - - if (pInstance) - pInstance->SetData(DATA_BLACKHEARTTHEINCITEREVENT, NOT_STARTED); - } - - void KilledUnit(Unit *victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; - } - } - - void JustDied(Unit *victim) - { - DoScriptText(SAY_DEATH, m_creature); - - if (pInstance) - pInstance->SetData(DATA_BLACKHEARTTHEINCITEREVENT, DONE); - } - - void EnterCombat(Unit *who) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_AGGRO1, m_creature); break; - case 1: DoScriptText(SAY_AGGRO2, m_creature); break; - case 2: DoScriptText(SAY_AGGRO3, m_creature); break; - } - - if (pInstance) - pInstance->SetData(DATA_BLACKHEARTTHEINCITEREVENT, IN_PROGRESS); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - if (InciteChaos) - { - if (InciteChaosWait_Timer < diff) - { - InciteChaos = false; - InciteChaosWait_Timer = 15000; - }else InciteChaosWait_Timer -= diff; - - return; - } - - if (InciteChaos_Timer < diff) - { - DoCast(m_creature, SPELL_INCITE_CHAOS); - - std::list t_list = m_creature->getThreatManager().getThreatList(); - for(std::list::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr) - { - Unit* target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()); - if (target && target->GetTypeId() == TYPEID_PLAYER) - target->CastSpell(target,SPELL_INCITE_CHAOS_B,true); - } - - DoResetThreat(); - InciteChaos = true; - InciteChaos_Timer = 40000; - return; - }else InciteChaos_Timer -= diff; - - //Charge_Timer - if (Charge_Timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - DoCast(target, SPELL_CHARGE); - Charge_Timer = 15000 + rand()%10000; - }else Charge_Timer -= diff; - - //Knockback_Timer - if (Knockback_Timer < diff) - { - DoCast(m_creature, SPELL_WAR_STOMP); - Knockback_Timer = 18000 + rand()%6000; - }else Knockback_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_blackheart_the_inciter(Creature* pCreature) -{ - return new boss_blackheart_the_inciterAI (pCreature); -} - -void AddSC_boss_blackheart_the_inciter() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_blackheart_the_inciter"; - newscript->GetAI = &GetAI_boss_blackheart_the_inciter; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp deleted file mode 100644 index 0cc6255f3cf..00000000000 --- a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp +++ /dev/null @@ -1,321 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Grandmaster_Vorpil -SD%Complete: 100 -SDComment: -SDCategory: Auchindoun, Shadow Labyrinth -EndScriptData */ - -#include "precompiled.h" -#include "def_shadow_labyrinth.h" - -#define SAY_INTRO -1555028 -#define SAY_AGGRO1 -1555029 -#define SAY_AGGRO2 -1555030 -#define SAY_AGGRO3 -1555031 -#define SAY_HELP -1555032 -#define SAY_SLAY1 -1555033 -#define SAY_SLAY2 -1555034 -#define SAY_DEATH -1555035 - -#define SPELL_RAIN_OF_FIRE 33617 -#define H_SPELL_RAIN_OF_FIRE 39363 - -#define SPELL_DRAW_SHADOWS 33563 -#define SPELL_SHADOWBOLT_VOLLEY 33841 -#define SPELL_BANISH 38791 - -#define MOB_VOID_TRAVELER 19226 -#define SPELL_SACRIFICE 33587 -#define SPELL_SHADOW_NOVA 33846 -#define SPELL_EMPOWERING_SHADOWS 33783 -#define H_SPELL_EMPOWERING_SHADOWS 39364 - -#define MOB_VOID_PORTAL 19224 -#define SPELL_VOID_PORTAL_VISUAL 33569 - -float VorpilPosition[3] = {-252.8820,-264.3030,17.1}; - -float VoidPortalCoords[5][3] = -{ - {-283.5894, -239.5718, 12.7}, - {-306.5853, -258.4539, 12.7}, - {-295.8789, -269.0899, 12.7}, - {-209.3401, -262.7564, 17.1}, - {-261.4533, -297.3298, 17.1} -}; - -struct TRINITY_DLL_DECL mob_voidtravelerAI : public ScriptedAI -{ - mob_voidtravelerAI(Creature *c) : ScriptedAI(c) - { - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - bool HeroicMode; - Unit *Vorpil; - uint32 move; - bool sacrificed; - - void Reset() - { - Vorpil = NULL; - move = 0; - sacrificed = false; - } - - void EnterCombat(Unit *who){} - - void UpdateAI(const uint32 diff) - { - if (!Vorpil) - { - m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - return; - } - if (move < diff) - { - if (sacrificed) - { - SpellEntry *spell = GET_SPELL(HeroicMode?H_SPELL_EMPOWERING_SHADOWS:SPELL_EMPOWERING_SHADOWS); - if (spell) - Vorpil->AddAura(new Aura(spell, 1, NULL, Vorpil, m_creature)); - Vorpil->SetHealth(Vorpil->GetHealth()+Vorpil->GetMaxHealth()/25); - DoCast(m_creature, SPELL_SHADOW_NOVA, true); - m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - return; - } - m_creature->GetMotionMaster()->MoveFollow(Vorpil,0,0); - if (m_creature->IsWithinDist(Vorpil, 3)) - { - DoCast(m_creature, SPELL_SACRIFICE, false); - sacrificed = true; - move = 500; - return; - } - if (!Vorpil->isInCombat() || Vorpil->isDead()) - { - m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - return; - } - move = 1000; - }else move -= diff; - } -}; -CreatureAI* GetAI_mob_voidtraveler(Creature* pCreature) -{ - return new mob_voidtravelerAI (pCreature); -} - -struct TRINITY_DLL_DECL boss_grandmaster_vorpilAI : public ScriptedAI -{ - boss_grandmaster_vorpilAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - HeroicMode = m_creature->GetMap()->IsHeroic(); - Intro = false; - } - - ScriptedInstance *pInstance; - bool Intro, HelpYell; - bool sumportals; - bool HeroicMode; - - uint32 ShadowBoltVolley_Timer; - uint32 DrawShadows_Timer; - uint32 summonTraveler_Timer; - uint32 banish_Timer; - uint64 PortalsGuid[5]; - - void Reset() - { - ShadowBoltVolley_Timer = 7000 + rand()%7000; - DrawShadows_Timer = 45000; - summonTraveler_Timer = 90000; - banish_Timer = 17000; - HelpYell = false; - destroyPortals(); - - if (pInstance) - pInstance->SetData(DATA_GRANDMASTERVORPILEVENT, NOT_STARTED); - } - - void summonPortals() - { - if (!sumportals) - { - for (int i = 0;i<5; ++i) - { - Creature *Portal = NULL; - Portal = m_creature->SummonCreature(MOB_VOID_PORTAL,VoidPortalCoords[i][0],VoidPortalCoords[i][1],VoidPortalCoords[i][2],0,TEMPSUMMON_CORPSE_DESPAWN,3000000); - if (Portal) - { - PortalsGuid[i] = Portal->GetGUID(); - Portal->CastSpell(Portal,SPELL_VOID_PORTAL_VISUAL,false); - } - } - sumportals = true; - summonTraveler_Timer = 5000; - } - } - - void destroyPortals() - { - if (sumportals) - { - for (int i = 0;i < 5; i ++) - { - Unit *Portal = Unit::GetUnit((*m_creature), PortalsGuid[i]); - if (Portal && Portal->isAlive()) - Portal->DealDamage(Portal, Portal->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - PortalsGuid[i] = 0; - } - sumportals = false; - } - } - - void spawnVoidTraveler() - { - int pos = rand()%5; - m_creature->SummonCreature(MOB_VOID_TRAVELER,VoidPortalCoords[pos][0],VoidPortalCoords[pos][1],VoidPortalCoords[pos][2],0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,5000); - if (!HelpYell) - { - DoScriptText(SAY_HELP, m_creature); - HelpYell = true; - } - } - - void JustSummoned(Creature *summoned) - { - if (summoned && summoned->GetEntry() == MOB_VOID_TRAVELER) - CAST_AI(mob_voidtravelerAI, summoned->AI())->Vorpil = m_creature; - } - - void KilledUnit(Unit *victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; - } - } - - void JustDied(Unit *victim) - { - DoScriptText(SAY_DEATH, m_creature); - destroyPortals(); - - if (pInstance) - pInstance->SetData(DATA_GRANDMASTERVORPILEVENT, DONE); - } - - void EnterCombat(Unit *who) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_AGGRO1, m_creature); break; - case 1: DoScriptText(SAY_AGGRO2, m_creature); break; - case 2: DoScriptText(SAY_AGGRO3, m_creature); break; - } - summonPortals(); - - if (pInstance) - pInstance->SetData(DATA_GRANDMASTERVORPILEVENT, IN_PROGRESS); - } - - void MoveInLineOfSight(Unit *who) - { - ScriptedAI::MoveInLineOfSight(who); - - if (!Intro && m_creature->IsWithinLOSInMap(who)&& m_creature->IsWithinDistInMap(who, 100) && m_creature->IsHostileTo(who)) - { - DoScriptText(SAY_INTRO, m_creature); - Intro = true; - } - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (ShadowBoltVolley_Timer < diff) - { - DoCast(m_creature,SPELL_SHADOWBOLT_VOLLEY); - ShadowBoltVolley_Timer = 15000 + rand()%15000;; - }else ShadowBoltVolley_Timer -= diff; - - if (HeroicMode && banish_Timer < diff) - { - Unit *target = SelectTarget(SELECT_TARGET_RANDOM,0,30,false); - if (target) - { - DoCast(target,SPELL_BANISH); - banish_Timer = 16000; - } - }else banish_Timer -= diff; - - if (DrawShadows_Timer < diff) - { - Map* pMap = m_creature->GetMap(); - Map::PlayerList const &PlayerList = pMap->GetPlayers(); - for(Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) - if (Player* i_pl = i->getSource()) - if (i_pl->isAlive() && !i_pl->HasAura(SPELL_BANISH)) - i_pl->TeleportTo(m_creature->GetMapId(), VorpilPosition[0],VorpilPosition[1],VorpilPosition[2], 0, TELE_TO_NOT_LEAVE_COMBAT); - - m_creature->GetMap()->CreatureRelocation(m_creature, VorpilPosition[0],VorpilPosition[1],VorpilPosition[2],0.0f); - DoCast(m_creature,SPELL_DRAW_SHADOWS,true); - - DoCast(m_creature,HeroicMode?H_SPELL_RAIN_OF_FIRE:SPELL_RAIN_OF_FIRE); - - ShadowBoltVolley_Timer = 6000; - DrawShadows_Timer = 30000; - }else DrawShadows_Timer -= diff; - - if (summonTraveler_Timer < diff) - { - spawnVoidTraveler(); - summonTraveler_Timer = 10000; - //enrage at 20% - if ((m_creature->GetHealth()*5) < m_creature->GetMaxHealth()) - summonTraveler_Timer = 5000; - }else summonTraveler_Timer -=diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_grandmaster_vorpil(Creature* pCreature) -{ - return new boss_grandmaster_vorpilAI (pCreature); -} - -void AddSC_boss_grandmaster_vorpil() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_grandmaster_vorpil"; - newscript->GetAI = &GetAI_boss_grandmaster_vorpil; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_voidtraveler"; - newscript->GetAI = &GetAI_mob_voidtraveler; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_murmur.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_murmur.cpp deleted file mode 100644 index 259f6091af6..00000000000 --- a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_murmur.cpp +++ /dev/null @@ -1,207 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Murmur -SD%Complete: 90 -SDComment: Timers may be incorrect -SDCategory: Auchindoun, Shadow Labyrinth -EndScriptData */ - -#include "precompiled.h" -#include "def_shadow_labyrinth.h" - -#define EMOTE_SONIC_BOOM -1555036 - -#define SPELL_SONIC_BOOM_CAST (HeroicMode?38796:33923) -#define SPELL_SONIC_BOOM_EFFECT (HeroicMode?38795:33666) -#define SPELL_RESONANCE 33657 -#define SPELL_MURMURS_TOUCH (HeroicMode?38794:33711) -#define SPELL_MAGNETIC_PULL 33689 -#define SPELL_SONIC_SHOCK 38797 -#define SPELL_THUNDERING_STORM 39365 - -struct TRINITY_DLL_DECL boss_murmurAI : public ScriptedAI -{ - boss_murmurAI(Creature *c) : ScriptedAI(c) - { - SetCombatMovement(false); - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - uint32 SonicBoom_Timer; - uint32 MurmursTouch_Timer; - uint32 Resonance_Timer; - uint32 MagneticPull_Timer; - uint32 SonicShock_Timer; - uint32 ThunderingStorm_Timer; - bool HeroicMode; - bool SonicBoom; - - void Reset() - { - SonicBoom_Timer = 30000; - MurmursTouch_Timer = 8000 + rand()%12000; - Resonance_Timer = 5000; - MagneticPull_Timer = 15000 + rand()%15000; - ThunderingStorm_Timer = 15000; - SonicShock_Timer = 10000; - SonicBoom = false; - - //database should have `RegenHealth`=0 to prevent regen - uint32 hp = (m_creature->GetMaxHealth()*40)/100; - if (hp) m_creature->SetHealth(hp); - m_creature->ResetPlayerDamageReq(); - } - - void SonicBoomEffect() - { - std::list t_list = m_creature->getThreatManager().getThreatList(); - for(std::list::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr) - { - Unit* target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()); - if (target && target->GetTypeId() == TYPEID_PLAYER) - { - //Not do anything without aura, spell can be resisted! - if (target->HasAura(SPELL_SONIC_BOOM_CAST) && m_creature->IsWithinDistInMap(target, 34.0f)) - { - //This will be wrong calculation. Also, comments suggest it must deal damage - target->SetHealth(uint32(target->GetMaxHealth() - target->GetMaxHealth() * 0.8)); - } - } - } - } - - void EnterCombat(Unit *who) { } - - // Sonic Boom instant damage (needs core fix instead of this) - void SpellHitTarget(Unit *target, const SpellEntry *spell) - { - if (target && target->isAlive() && spell && spell->Id == SPELL_SONIC_BOOM_EFFECT) - m_creature->DealDamage(target,(target->GetHealth()*90)/100,NULL,SPELL_DIRECT_DAMAGE,SPELL_SCHOOL_MASK_NATURE,spell); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target or casting - if (!UpdateVictim() || m_creature->IsNonMeleeSpellCasted(false)) - return; - - // Sonic Boom - if (SonicBoom) - { - DoCast(m_creature, SPELL_SONIC_BOOM_EFFECT, true); - SonicBoomEffect(); - - SonicBoom = false; - Resonance_Timer = 1500; - } - if (SonicBoom_Timer < diff) - { - DoScriptText(EMOTE_SONIC_BOOM, m_creature); - DoCast(m_creature, SPELL_SONIC_BOOM_CAST); - SonicBoom_Timer = 30000; - SonicBoom = true; - return; - }else SonicBoom_Timer -= diff; - - // Murmur's Touch - if (MurmursTouch_Timer < diff) - { - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM,0,80,true)) - DoCast(target, SPELL_MURMURS_TOUCH); - MurmursTouch_Timer = 25000 + rand()%10000; - }else MurmursTouch_Timer -= diff; - - // Resonance - if (!SonicBoom && !(m_creature->IsWithinMeleeRange(m_creature->getVictim()))) - { - if (Resonance_Timer < diff) - { - DoCast(m_creature, SPELL_RESONANCE); - Resonance_Timer = 5000; - }else Resonance_Timer -= diff; - } - - // Magnetic Pull - if (MagneticPull_Timer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) - if (target->GetTypeId() == TYPEID_PLAYER && target->isAlive()) - { - DoCast(target, SPELL_MAGNETIC_PULL); - MagneticPull_Timer = 15000+rand()%15000; - return; - } - MagneticPull_Timer = 500; - }else MagneticPull_Timer -= diff; - - if (HeroicMode) - { - // Thundering Storm - if (ThunderingStorm_Timer < diff) - { - std::list& m_threatlist = m_creature->getThreatManager().getThreatList(); - for(std::list::iterator i = m_threatlist.begin(); i != m_threatlist.end(); ++i) - if (Unit* target = Unit::GetUnit((*m_creature),(*i)->getUnitGuid())) - if (target->isAlive() && !m_creature->IsWithinDist(target, 35, false)) - DoCast(target, SPELL_THUNDERING_STORM, true); - ThunderingStorm_Timer = 15000; - }else ThunderingStorm_Timer -= diff; - - // Sonic Shock - if (SonicShock_Timer < diff) - { - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM,0,20,false)) - if (target->isAlive()) - DoCast(target, SPELL_SONIC_SHOCK); - SonicShock_Timer = 10000+rand()%10000; - }else SonicShock_Timer -= diff; - } - - // Select nearest most aggro target if top aggro too far - if (!m_creature->isAttackReady()) - return; - if (!m_creature->IsWithinMeleeRange(m_creature->getVictim())) - { - std::list& m_threatlist = m_creature->getThreatManager().getThreatList(); - for(std::list::iterator i = m_threatlist.begin(); i != m_threatlist.end(); ++i) - if (Unit* target = Unit::GetUnit((*m_creature),(*i)->getUnitGuid())) - if (target->isAlive() && m_creature->IsWithinMeleeRange(target)) - { - m_creature->TauntApply(target); - break; - } - } - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_murmur(Creature* pCreature) -{ - return new boss_murmurAI (pCreature); -} - -void AddSC_boss_murmur() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_murmur"; - newscript->GetAI = &GetAI_boss_murmur; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/def_shadow_labyrinth.h b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/def_shadow_labyrinth.h deleted file mode 100644 index a78955368bf..00000000000 --- a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/def_shadow_labyrinth.h +++ /dev/null @@ -1,15 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ - -#ifndef DEF_SHADOW_LABYRINTH_H -#define DEF_SHADOW_LABYRINTH_H - -#define TYPE_HELLMAW 1 -#define TYPE_OVERSEER 2 -#define DATA_BLACKHEARTTHEINCITEREVENT 3 -#define DATA_GRANDMASTERVORPILEVENT 4 -#define DATA_MURMUREVENT 5 -#define DATA_GRANDMASTERVORPIL 6 -#endif - diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp deleted file mode 100644 index f8f3b73bffa..00000000000 --- a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp +++ /dev/null @@ -1,227 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Instance_Shadow_Labyrinth -SD%Complete: 85 -SDComment: Some cleanup left along with save -SDCategory: Auchindoun, Shadow Labyrinth -EndScriptData */ - -#include "precompiled.h" -#include "def_shadow_labyrinth.h" - -#define MAX_ENCOUNTER 5 - -#define REFECTORY_DOOR 183296 //door opened when blackheart the inciter dies -#define SCREAMING_HALL_DOOR 183295 //door opened when grandmaster vorpil dies - -/* Shadow Labyrinth encounters: -1 - Ambassador Hellmaw event -2 - Blackheart the Inciter event -3 - Grandmaster Vorpil event -4 - Murmur event -*/ - -struct TRINITY_DLL_DECL instance_shadow_labyrinth : public ScriptedInstance -{ - instance_shadow_labyrinth(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; - - uint32 m_auiEncounter[MAX_ENCOUNTER]; - std::string str_data; - - uint64 m_uiRefectoryDoorGUID; - uint64 m_uiScreamingHallDoorGUID; - - uint64 m_uiGrandmasterVorpil; - uint32 m_uiFelOverseerCount; - - void Initialize() - { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - - m_uiRefectoryDoorGUID = 0; - m_uiScreamingHallDoorGUID = 0; - - m_uiGrandmasterVorpil = 0; - m_uiFelOverseerCount = 0; - } - - bool IsEncounterInProgress() const - { - for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) return true; - - return false; - } - - void OnGameObjectCreate(GameObject* pGo, bool add) - { - switch(pGo->GetEntry()) - { - case REFECTORY_DOOR: - m_uiRefectoryDoorGUID = pGo->GetGUID(); - if (m_auiEncounter[2] == DONE) - pGo->SetGoState(GO_STATE_ACTIVE); - break; - case SCREAMING_HALL_DOOR: - m_uiScreamingHallDoorGUID = pGo->GetGUID(); - if (m_auiEncounter[3] == DONE) - pGo->SetGoState(GO_STATE_ACTIVE); - break; - } - } - - void OnCreatureCreate(Creature* pCreature, bool add) - { - switch(pCreature->GetEntry()) - { - case 18732: - m_uiGrandmasterVorpil = pCreature->GetGUID(); - break; - case 18796: - if (pCreature->isAlive()) - { - ++m_uiFelOverseerCount; - debug_log("TSCR: Shadow Labyrinth: counting %u Fel Overseers.",m_uiFelOverseerCount); - } - break; - } - } - - void SetData(uint32 type, uint32 uiData) - { - switch(type) - { - case TYPE_HELLMAW: - m_auiEncounter[0] = uiData; - break; - - case TYPE_OVERSEER: - if (uiData != DONE) - { - error_log("TSCR: Shadow Labyrinth: TYPE_OVERSEER did not expect other data than DONE"); - return; - } - if (m_uiFelOverseerCount) - { - --m_uiFelOverseerCount; - - if (m_uiFelOverseerCount) - debug_log("TSCR: Shadow Labyrinth: %u Fel Overseers left to kill.",m_uiFelOverseerCount); - else - { - m_auiEncounter[1] = DONE; - debug_log("TSCR: Shadow Labyrinth: TYPE_OVERSEER == DONE"); - } - } - break; - - case DATA_BLACKHEARTTHEINCITEREVENT: - if (uiData == DONE) - DoUseDoorOrButton(m_uiRefectoryDoorGUID); - m_auiEncounter[2] = uiData; - break; - - case DATA_GRANDMASTERVORPILEVENT: - if (uiData == DONE) - DoUseDoorOrButton(m_uiScreamingHallDoorGUID); - m_auiEncounter[3] = uiData; - break; - - case DATA_MURMUREVENT: - m_auiEncounter[4] = uiData; - break; - } - - if (uiData == DONE) - { - if (type == TYPE_OVERSEER && m_uiFelOverseerCount != 0) - return; - - OUT_SAVE_INST_DATA; - - std::ostringstream saveStream; - saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " - << m_auiEncounter[2] << " " << m_auiEncounter[3] << " " << m_auiEncounter[4]; - - str_data = saveStream.str(); - - SaveToDB(); - OUT_SAVE_INST_DATA_COMPLETE; - } - } - - uint32 GetData(uint32 type) - { - switch(type) - { - case TYPE_HELLMAW: return m_auiEncounter[0]; - case TYPE_OVERSEER: return m_auiEncounter[1]; - case DATA_GRANDMASTERVORPILEVENT: return m_auiEncounter[3]; - case DATA_MURMUREVENT: return m_auiEncounter[4]; - } - return false; - } - - uint64 GetData64(uint32 identifier) - { - if (identifier == DATA_GRANDMASTERVORPIL) - return m_uiGrandmasterVorpil; - - return 0; - } - - std::string GetSaveData() - { - return str_data; - } - - void Load(const char* in) - { - if (!in) - { - OUT_LOAD_INST_DATA_FAIL; - return; - } - - OUT_LOAD_INST_DATA(in); - - std::istringstream loadStream(in); - loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3] >> m_auiEncounter[4]; - - for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) - m_auiEncounter[i] = NOT_STARTED; - - OUT_LOAD_INST_DATA_COMPLETE; - } -}; - -InstanceData* GetInstanceData_instance_shadow_labyrinth(Map* pMap) -{ - return new instance_shadow_labyrinth(pMap); -} - -void AddSC_instance_shadow_labyrinth() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_shadow_labyrinth"; - newscript->GetInstanceData = &GetInstanceData_instance_shadow_labyrinth; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/boss_amanitar.cpp b/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/boss_amanitar.cpp deleted file mode 100644 index 3538aee0c5b..00000000000 --- a/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/boss_amanitar.cpp +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (C) 2009 Trinity - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* Script Data Start -SDName: boss_amanitar -SDAuthor: LordVanMartin -SD%Complete: 0 -SDComment: Only appears in heroic mode -SDCategory: Ahn'kahet -Script Data End */ - -/*** SQL START *** -update creature_template set scriptname = 'boss_amanitar' where entry = ''; -*** SQL END ***/ - -#include "precompiled.h" -#include "def_ahnkahet.h" - -#define SPELL_BASH 57094 -#define SPELL_ENTANGLING_ROOTS 57095 -#define SPELL_MINI 57055 -#define SPELL_VENOM_BOLT_VOLLEY 57088 - -struct TRINITY_DLL_DECL boss_amanitarAI : public ScriptedAI -{ - boss_amanitarAI(Creature *c) : ScriptedAI(c) {} - - void Reset() {} - - void EnterCombat(Unit* who) {} - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - - void JustDied(Unit* killer) {} - - void KilledUnit(Unit *victim) - { - if (victim == m_creature) - return; - } -}; - -CreatureAI* GetAI_boss_amanitar(Creature* pCreature) -{ - return new boss_amanitarAI (pCreature); -} - -void AddSC_boss_amanitar() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_amanitar"; - newscript->GetAI = &GetAI_boss_amanitar; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/boss_elder_nadox.cpp b/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/boss_elder_nadox.cpp deleted file mode 100644 index 129f7b34db6..00000000000 --- a/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/boss_elder_nadox.cpp +++ /dev/null @@ -1,274 +0,0 @@ -/* - * Copyright (C) 2009 Trinity - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: boss_elder_nadox -SD%Complete: 100 -SDComment: -SDCategory: Ahn'kahet -EndScriptData */ - -#include "precompiled.h" -#include "def_ahnkahet.h" - -bool DeadAhnkaharGuardian; // needed for achievement: Respect Your Elders(2038) - -#define ACHIEVEMENT_RESPECT_YOUR_ELDERS 2038 - -#define SAY_AGGRO -1619014 -#define SAY_SLAY_1 -1619015 -#define SAY_SLAY_2 -1619016 -#define SAY_SLAY_3 -1619017 -#define SAY_DEATH -1619018 -#define SAY_EGG_SAC_1 -1619019 -#define SAY_EGG_SAC_2 -1619020 - -#define SPELL_BROOD_PLAGUE 56130 -#define H_SPELL_BROOD_PLAGUE 59467 -#define H_SPELL_BROOD_RAGE 59465 -#define SPELL_ENRAGE 26662// Enraged if too far away from home - -#define MOB_AHNKAHAR_SWARMER 30178 -#define SPELL_SUMMON_SWARMERS 56119//2x 30178 -- 2x every 10secs - -#define MOB_AHNKAHAR_GUARDIAN_ENTRY 30176 -#define SPELL_SUMMON_SWARM_GUARD 56120//1x 30176 -- every 25secs -#define SPELL_GUARDIAN_AURA 56151 - -struct TRINITY_DLL_DECL boss_elder_nadoxAI : public ScriptedAI -{ - boss_elder_nadoxAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - HeroicMode = c->GetMap()->IsHeroic(); - } - - bool HeroicMode; - uint32 plague_Timer; - uint32 rage_Timer; - - uint32 swarmer_spawn_Timer; - uint32 guard_spawn_Timer; - uint32 enrage_Timer; - - - ScriptedInstance *pInstance; - - void Reset() - { - plague_Timer = 13000; - rage_Timer = 20000; - - swarmer_spawn_Timer = 10000; - guard_spawn_Timer = 25000; - - enrage_Timer = 5000; - - DeadAhnkaharGuardian = false; - - if (pInstance) - pInstance->SetData(DATA_ELDER_NADOX_EVENT, NOT_STARTED); - } - - void EnterCombat(Unit *who) - { - DoScriptText(SAY_DEATH,m_creature); - - if (pInstance) - pInstance->SetData(DATA_ELDER_NADOX_EVENT, IN_PROGRESS); - } - - void KilledUnit(Unit *victim) - { - if (victim == m_creature) - return; - switch(rand()%3) - { - case 0: DoScriptText(SAY_SLAY_1,m_creature); break; - case 1: DoScriptText(SAY_SLAY_2,m_creature); break; - case 2: DoScriptText(SAY_SLAY_3,m_creature); break; - } - } - - void JustDied(Unit* killer) - { - DoScriptText(SAY_SLAY_3,m_creature); - - if (HeroicMode && !DeadAhnkaharGuardian) - { - AchievementEntry const *AchievRespectYourElders = GetAchievementStore()->LookupEntry(ACHIEVEMENT_RESPECT_YOUR_ELDERS); - if (AchievRespectYourElders) - { - Map* pMap = m_creature->GetMap(); - if (pMap && pMap->IsDungeon()) - { - Map::PlayerList const &players = pMap->GetPlayers(); - for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) - itr->getSource()->CompletedAchievement(AchievRespectYourElders); - } - } - } - - if (pInstance) - pInstance->SetData(DATA_ELDER_NADOX_EVENT, DONE); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (plague_Timer < diff) - { - DoCast(m_creature->getVictim(),HeroicMode ? H_SPELL_BROOD_PLAGUE : SPELL_BROOD_PLAGUE); - plague_Timer = 15000; - }else plague_Timer -= diff; - - if (HeroicMode) - if (rage_Timer < diff) - { - Unit* Swarmer = m_creature->FindNearestCreature(MOB_AHNKAHAR_SWARMER, 35); - - if (Swarmer) - { - DoCast(Swarmer,H_SPELL_BROOD_RAGE,true); - rage_Timer = 15000; - } - }else rage_Timer -= diff; - - if (swarmer_spawn_Timer < diff) - { - DoCast(m_creature,SPELL_SUMMON_SWARMERS,true); - DoCast(m_creature,SPELL_SUMMON_SWARMERS); - if (rand()%3 == 0) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_EGG_SAC_1,m_creature); break; - case 1: DoScriptText(SAY_EGG_SAC_2,m_creature); break; - } - } - swarmer_spawn_Timer = 10000; - }else swarmer_spawn_Timer -= diff; - - if (guard_spawn_Timer < diff) - { - m_creature->MonsterTextEmote("An Ahn'kahar Guardian hatches!",m_creature->GetGUID(),true); - DoCast(m_creature,SPELL_SUMMON_SWARM_GUARD); - guard_spawn_Timer = 25000; - }else guard_spawn_Timer -= diff; - - if (enrage_Timer < diff) - { - if (m_creature->HasAura(SPELL_ENRAGE,0)) - return; - - float x, y, z, o; - m_creature->GetHomePosition(x, y, z, o); - if (z < 24) - { - if (!m_creature->IsNonMeleeSpellCasted(false)) - { - DoCast(m_creature,SPELL_ENRAGE,true); - } - } - enrage_Timer = 5000; - }else enrage_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_elder_nadox(Creature* pCreature) -{ - return new boss_elder_nadoxAI(pCreature); -} - -#define SPELL_SPRINT 56354 - -struct TRINITY_DLL_DECL mob_ahnkahar_nerubianAI : public ScriptedAI -{ - mob_ahnkahar_nerubianAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance *pInstance; - uint32 sprint_Timer; - - void Reset() - { - if (m_creature->GetEntry() == 30176) - DoCast(m_creature,SPELL_GUARDIAN_AURA,true); - sprint_Timer = 10000; - } - - void JustDied(Unit *killer) - { - if (m_creature->GetEntry() == MOB_AHNKAHAR_GUARDIAN_ENTRY) - DeadAhnkaharGuardian = true; - } - - void EnterCombat(Unit *who){} - - void UpdateAI(const uint32 diff) - { - if (m_creature->GetEntry() == 30176) - m_creature->RemoveAurasDueToSpell(SPELL_GUARDIAN_AURA); - - if (pInstance) - { - if (pInstance->GetData(DATA_ELDER_NADOX_EVENT) != IN_PROGRESS) - { - m_creature->DealDamage(m_creature,m_creature->GetHealth()); - m_creature->RemoveCorpse(); - } - } - - if (!UpdateVictim()) - return; - - if (sprint_Timer < diff) - { - DoCast(m_creature,SPELL_SPRINT); - sprint_Timer = 25000; - }else sprint_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_ahnkahar_nerubian(Creature* pCreature) -{ - return new mob_ahnkahar_nerubianAI(pCreature); -} - -void AddSC_boss_elder_nadox() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_elder_nadox"; - newscript->GetAI = &GetAI_boss_elder_nadox; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_ahnkahar_nerubian"; - newscript->GetAI = &GetAI_mob_ahnkahar_nerubian; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/boss_herald_volazj.cpp b/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/boss_herald_volazj.cpp deleted file mode 100644 index 820c260801e..00000000000 --- a/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/boss_herald_volazj.cpp +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Copyright (C) 2009 Trinity - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: boss_herald_volazj -SDAuthor: LordVanMartin -SD%Complete: 0 -SDComment: -SDCategory: Ahn'kahet -EndScriptData */ - -/*** SQL START *** -update creature_template set scriptname = 'boss_volazj' where entry = ''; -*** SQL END ***/ - -#include "precompiled.h" -#include "def_ahnkahet.h" - -//Spells -#define SPELL_INSANITY 57496 //Dummy -#define INSANITY_VISUAL 57561 -#define SPELL_MIND_FLAY_N 57941 -#define SPELL_MIND_FLAY_H 59974 -#define SPELL_SHADOW_BOLT_VOLLEY_1 57942 -#define SPELL_SHADOW_BOLT_VOLLEY_2 59975 -#define SPELL_SHIVER_N 57949 -#define SPELL_SHIVER_H 59978 - -//Yell -#define SAY_AGGRO -1619030 -#define SAY_SLAY_1 -1619031 -#define SAY_SLAY_2 -1619032 -#define SAY_SLAY_3 -1619033 -#define SAY_DEATH_1 -1619034 -#define SAY_DEATH_2 -1619035 -#define SAY_PHASE -1619036 - -struct TRINITY_DLL_DECL boss_volazjAI : public ScriptedAI -{ - boss_volazjAI(Creature *c) : ScriptedAI(c) {} - - uint32 phase; - - void Reset() {} - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - phase =1; - - DoMeleeAttackIfReady(); - } - void JustDied(Unit* killer) - { - if (phase == 1) - DoScriptText(SAY_DEATH_1, m_creature); - else - DoScriptText(SAY_DEATH_2, m_creature); - } - - void KilledUnit(Unit *victim) - { - if (victim == m_creature) - return; - - switch(rand()%3) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature);break; - case 1: DoScriptText(SAY_SLAY_2, m_creature);break; - case 2: DoScriptText(SAY_SLAY_3, m_creature);break; - } - } -}; - -CreatureAI* GetAI_boss_volazj(Creature* pCreature) -{ - return new boss_volazjAI (pCreature); -} - -void AddSC_boss_volazj() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_volazj"; - newscript->GetAI = &GetAI_boss_volazj; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/boss_jedoga_shadowseeker.cpp b/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/boss_jedoga_shadowseeker.cpp deleted file mode 100644 index 47a7d79e87b..00000000000 --- a/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/boss_jedoga_shadowseeker.cpp +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Copyright (C) 2009 Trinity - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: boss_jedoga_shadowseeker -SDAuthor: LordVanMartin -SD%Complete: 0 -SDComment: -SDCategory: Ahn'kahet -EndScriptData */ - -/*** SQL START *** -update creature_template set scriptname = 'boss_jedoga' where entry = ''; -*** SQL END ***/ - -#include "precompiled.h" -#include "def_ahnkahet.h" - -#define SPELL_CYCLONE_STRIKE 56855 -#define H_SPELL_CYCLONE_STRIKE 60030//kein unterschied zu 56855 außer das 60030 1,5sec cast ist -#define SPELL_LIGHTNING_BOLT 56891 -#define H_SPELL_LIGHTNING_BOLT 60032 -#define SPELL_THUNDERSHOCK 56926//AOE works -#define H_SPELL_THUNDERSHOCK 60029//AOE works -#define SPELL_GIFT_OF_THE_HERALD 56219//triggert if sucessfull sacreficed - -#define SAY_AGGRO -1619000 -#define SAY_C_SACRIFICE_1 -1619001 -#define SAY_C_SACRIFICE_2 -1619002 -#define SAY_SACRIFICE_1 -1619003 -#define SAY_SACRIFICE_2 -1619004 -#define SAY_SLAY_1 -1619005 -#define SAY_SLAY_2 -1619006 -#define SAY_SLAY_3 -1619007 -#define SAY_DEATH -1619008 -#define SAY_PREACHING_1 -1619009 -#define SAY_PREACHING_2 -1619010 -#define SAY_PREACHING_3 -1619011 -#define SAY_PREACHING_4 -1619012 -#define SAY_PREACHING_5 -1619013 - -struct TRINITY_DLL_DECL boss_jedogaAI : public ScriptedAI -{ - boss_jedogaAI(Creature *c) : ScriptedAI(c) {} - - void Reset() {} - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - - void JustDied(Unit* killer) - { - DoScriptText(SAY_DEATH, m_creature); - } - - void KilledUnit(Unit *victim) - { - if (victim == m_creature) - return; - - switch(rand()%3) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature);break; - case 1: DoScriptText(SAY_SLAY_2, m_creature);break; - case 2: DoScriptText(SAY_SLAY_3, m_creature);break; - } - } -}; - -CreatureAI* GetAI_boss_jedoga(Creature* pCreature) -{ - return new boss_jedogaAI (pCreature); -} - -void AddSC_boss_jedoga() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_jedoga"; - newscript->GetAI = &GetAI_boss_jedoga; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/boss_prince_taldaram.cpp b/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/boss_prince_taldaram.cpp deleted file mode 100644 index cb34d8919d7..00000000000 --- a/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/boss_prince_taldaram.cpp +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Copyright (C) 2009 Trinity - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: boss_prince_taldaram -SDAuthor: LordVanMartin -SD%Complete: 0 -SDComment: -SDCategory: Ahn'kahet -EndScriptData */ - -#include "precompiled.h" -#include "def_ahnkahet.h" - -#define SPELL_BLOODTHIRST 55968 //Trigger Spell + add aura -#define SPELL_CONJURE_FLAME_SPHERE 55931 - -#define SPELL_FLAME_SPHERE_SUMMON_1 55895// 1x 30106 -#define H_SPELL_FLAME_SPHERE_SUMMON_1 59511// 1x 31686 -#define H_SPELL_FLAME_SPHERE_SUMMON_2 59512// 1x 31687 -#define SPELL_FLAME_SPHERE_SPAWN_EFFEKT 55891 -#define SPELL_FLAME_SPHERE_VISUAL 55928 -#define SPELL_FLAME_SPHERE_PERIODIC 55926 -#define H_SPELL_FLAME_SPHERE_PERIODIC 59508 -#define SPELL_FLAME_SPHERE_DEATH_EFFEKT 55947 - -#define SPELL_EMBRACE_OF_THE_VAMPYR 55959 -#define H_SPELL_EMBRACE_OF_THE_VAMPYR 59513 - -#define SPELL_VANISH 55964 - -//Yell -#define SAY_AGGRO -1619021 -#define SAY_SLAY_1 -1619022 -#define SAY_SLAY_2 -1619023 -#define SAY_SLAY_3 -1619024 -#define SAY_DEATH -1619025 -#define SAY_FEED_1 -1619026 -#define SAY_FEED_2 -1619027 -#define SAY_VANISH_1 -1619028 -#define SAY_VANISH_2 -1619029 - -struct TRINITY_DLL_DECL boss_taldaramAI : public ScriptedAI -{ - boss_taldaramAI(Creature *c) : ScriptedAI(c) {} - - void Reset() {} - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - void JustDied(Unit* killer) - { - DoScriptText(SAY_DEATH, m_creature); - } - - void KilledUnit(Unit *victim) - { - if (victim == m_creature) - return; - - switch(rand()%3) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature);break; - case 1: DoScriptText(SAY_SLAY_2, m_creature);break; - case 2: DoScriptText(SAY_SLAY_3, m_creature);break; - } - } -}; - -CreatureAI* GetAI_boss_taldaram(Creature* pCreature) -{ - return new boss_taldaramAI (pCreature); -} - -void AddSC_boss_taldaram() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_taldaram"; - newscript->GetAI = &GetAI_boss_taldaram; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/def_ahnkahet.h b/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/def_ahnkahet.h deleted file mode 100644 index 97c0db55d72..00000000000 --- a/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/def_ahnkahet.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (C) 2009 Trinity - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef DEF_AHNKAHET_H -#define DEF_AHNKAHET_H - -#define DATA_ELDER_NADOX 1 -#define DATA_PRINCE_TALDARAM 2 -#define DATA_JEDOGA_SHADOWSEEKER 3 -#define DATA_HERALD_VOLAZJ 4 -#define DATA_AMANITAR 5 - -#define DATA_ELDER_NADOX_EVENT 6 -#define DATA_PRINCE_TALDARAM_EVENT 7 -#define DATA_JEDOGA_SHADOWSEEKER_EVENT 8 -#define DATA_HERALD_VOLAZJ_EVENT 9 -#define DATA_AMANITAR_EVENT 10 -#endif diff --git a/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/instance_ahnkahet.cpp b/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/instance_ahnkahet.cpp deleted file mode 100644 index db9befd65cf..00000000000 --- a/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/instance_ahnkahet.cpp +++ /dev/null @@ -1,194 +0,0 @@ -/* - * Copyright (C) 2009 Trinity - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Instance_Azjol_Nerub -SD%Complete: 0 -SDComment: -SDCategory: Azjol Nerub -EndScriptData */ - -#include "precompiled.h" -#include "def_ahnkahet.h" - -#define MAX_ENCOUNTER 5 - -/* Ahn'kahet encounters: -0 - Elder Nadox -1 - Prince Taldaram -2 - Jedoga Shadowseeker -3 - Herald Volazj -4 - Amanitar (Heroic only) -*/ - -struct TRINITY_DLL_DECL instance_ahnkahet : public ScriptedInstance -{ - instance_ahnkahet(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; - - uint64 Elder_Nadox; - uint64 Prince_Taldaram; - uint64 Jedoga_Shadowseeker; - uint64 Herald_Volazj; - uint64 Amanitar; - - uint32 m_auiEncounter[MAX_ENCOUNTER]; - - void Initialize() - { - Elder_Nadox =0; - Prince_Taldaram =0; - Jedoga_Shadowseeker =0; - Herald_Volazj =0; - Amanitar =0; - - for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) - m_auiEncounter[i] = NOT_STARTED; - } - - bool IsEncounterInProgress() const - { - for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) return true; - - return false; - } - - - void OnCreatureCreate(Creature* pCreature, bool add) - { - switch(pCreature->GetEntry()) - { - case 29309: Elder_Nadox = pCreature->GetGUID(); break; - case 29308: Prince_Taldaram = pCreature->GetGUID(); break; - case 29310: Jedoga_Shadowseeker = pCreature->GetGUID(); break; - case 29311: Herald_Volazj = pCreature->GetGUID(); break; - case 30258: Amanitar = pCreature->GetGUID(); break; - } - } - - uint64 GetData64(uint32 identifier) - { - switch(identifier) - { - case DATA_ELDER_NADOX: return Elder_Nadox; - case DATA_PRINCE_TALDARAM: return Prince_Taldaram; - case DATA_JEDOGA_SHADOWSEEKER: return Jedoga_Shadowseeker; - case DATA_HERALD_VOLAZJ: return Herald_Volazj; - case DATA_AMANITAR: return Amanitar; - } - return 0; - } - - void SetData(uint32 type, uint32 data) - { - switch(type) - { - case DATA_ELDER_NADOX_EVENT: - m_auiEncounter[0] = data;break; - case DATA_PRINCE_TALDARAM_EVENT: - m_auiEncounter[1] = data; break; - case DATA_JEDOGA_SHADOWSEEKER_EVENT: - m_auiEncounter[2] = data; break; - case DATA_HERALD_VOLAZJ: - m_auiEncounter[3] = data; break; - case DATA_AMANITAR: - m_auiEncounter[4] = data; break; - } - - if (data == DONE) - { - SaveToDB(); - } - } - - uint32 GetData(uint32 type) - { - switch(type) - { - case DATA_ELDER_NADOX_EVENT: return m_auiEncounter[0]; - case DATA_PRINCE_TALDARAM_EVENT: return m_auiEncounter[1]; - case DATA_JEDOGA_SHADOWSEEKER_EVENT: return m_auiEncounter[2]; - case DATA_HERALD_VOLAZJ: return m_auiEncounter[3]; - case DATA_AMANITAR: return m_auiEncounter[4]; - } - return 0; - } - - std::string GetSaveData() - { - OUT_SAVE_INST_DATA; - - std::string str_data; - - std::ostringstream saveStream; - saveStream << "A K " << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " - << m_auiEncounter[2] << m_auiEncounter[3] << m_auiEncounter[4]; - - str_data = saveStream.str(); - - OUT_SAVE_INST_DATA_COMPLETE; - return str_data; - } - - void Load(const char* in) - { - if (!in) - { - OUT_LOAD_INST_DATA_FAIL; - return; - } - - OUT_LOAD_INST_DATA(in); - - char dataHead1, dataHead2; - uint16 data0,data1,data2,data3,data4; - - std::istringstream loadStream(in); - loadStream >> dataHead1 >> dataHead2 >> data0 >> data1 >> data2 >> data3 >> data4; - - if (dataHead1 == 'A' && dataHead2 == 'K') - { - m_auiEncounter[0] = data0; - m_auiEncounter[1] = data1; - m_auiEncounter[2] = data2; - m_auiEncounter[3] = data3; - m_auiEncounter[4] = data4; - - for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) - m_auiEncounter[i] = NOT_STARTED; - - }else OUT_LOAD_INST_DATA_FAIL; - - OUT_LOAD_INST_DATA_COMPLETE; - } -}; - -InstanceData* GetInstanceData_instance_ahnkahet(Map* pMap) -{ - return new instance_ahnkahet(pMap); -} - -void AddSC_instance_ahnkahet() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_ahnkahet"; - newscript->GetInstanceData = &GetInstanceData_instance_ahnkahet; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/azjol_nerub/azjol_nerub/boss_anubarak.cpp b/src/bindings/scripts/scripts/zone/azjol_nerub/azjol_nerub/boss_anubarak.cpp deleted file mode 100644 index b4717824443..00000000000 --- a/src/bindings/scripts/scripts/zone/azjol_nerub/azjol_nerub/boss_anubarak.cpp +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Copyright (C) 2009 Trinity - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: boss_anubarak -SDAuthor: LordVanMartin -SD%Complete: 0 -SDComment: -SDCategory: Azjol Nerub -EndScriptData */ - -/*** SQL START *** -update creature_template set scriptname = 'boss_anub_arak' where entry = ''; -*** SQL END ***/ - -#include "precompiled.h" -#include "def_azjol_nerub.h" - -//Spells -#define SPELL_CARRION_BEETLES 53520 -#define SPELL_LOCUST_SWARM 53467 -#define SPELL_IMPALE 53454 -#define SPELL_POUND 53472 - -//Yell -#define SAY_INTRO -1601010 -#define SAY_AGGRO -1601000 -#define SAY_SLAY_1 -1601001 -#define SAY_SLAY_2 -1601002 -#define SAY_SLAY_3 -1601003 -#define SAY_LOCUST_1 -1601005 -#define SAY_LOCUST_2 -1601006 -#define SAY_LOCUST_3 -1601007 -#define SAY_SUBMERGE_1 -1601008 -#define SAY_SUBMERGE_2 -1601009 -#define SAY_DEATH -1601004 - -struct TRINITY_DLL_DECL boss_anub_arakAI : public ScriptedAI -{ - boss_anub_arakAI(Creature *c) : ScriptedAI(c) {} - - uint32 phase; - - void Reset() {} - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - phase =1; - - if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) <= 33) - phase = 2; - if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) == 15) - phase = 3; - - DoMeleeAttackIfReady(); - } - void JustDied(Unit* killer) - { - DoScriptText(SAY_DEATH, m_creature); - } - void KilledUnit(Unit *victim) - { - if (victim == m_creature) - return; - - switch(rand()%3) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature);break; - case 1: DoScriptText(SAY_SLAY_2, m_creature);break; - case 2: DoScriptText(SAY_SLAY_3, m_creature);break; - } - } -}; - -CreatureAI* GetAI_boss_anub_arak(Creature* pCreature) -{ - return new boss_anub_arakAI (pCreature); -} - -void AddSC_boss_anub_arak() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_anub_arak"; - newscript->GetAI = &GetAI_boss_anub_arak; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/azjol_nerub/azjol_nerub/boss_hadronox.cpp b/src/bindings/scripts/scripts/zone/azjol_nerub/azjol_nerub/boss_hadronox.cpp deleted file mode 100644 index fa85563a2e7..00000000000 --- a/src/bindings/scripts/scripts/zone/azjol_nerub/azjol_nerub/boss_hadronox.cpp +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Copyright (C) 2009 Trinity - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: boss_hadronox -SD%Complete: 0 -SDComment: Placeholder -SDCategory: Azjol Nerub -EndScriptData */ - -#include "precompiled.h" -#include "def_azjol_nerub.h" - -#define SPELL_WEB_FRONT_DOORS 53177//dummy - -#define SPELL_ACID_CLOUD 53400 -#define H_SPELL_ACID_CLOUD 59419 -#define SPELL_LEECH_POISON 53030 -#define H_SPELL_LEECH_POISON 59417 -#define SPELL_LEECH_POISON_DEADTRIGGER 53800//heal 10% heroic und normal -#define SPELL_PIECE_ARMOR 53418 -#define SPELL_WEB_GRAB 53406 -#define H_SPELL_WEB_GRAB 59420 - -/* Script Data Start -SDName: Boss hadronox -SDAuthor: LordVanMartin -SD%Complete: -SDComment: -SDCategory: -Script Data End */ - -/*** SQL START *** -update creature_template set scriptname = 'boss_hadronox' where entry = ''; -*** SQL END ***/ - -//Spells -#define SPELL_LEECH_POISON 53030 -#define SPELL_ACID_CLOUD 53400 -#define SPELL_PIERCE_ARMOR 53418 //Source SUN++ -#define SPELL_WEB_GRAB 53406 - -//Phase 0 => Gauntlet Event described below -//Phase 1 => Boss Encounter - -/*When your group enters the main room (the one after the bridge), you will notice a group of 3 Nerubians. -When you engage them, 2 more groups like this one spawn behind the first one - it is important to pull the first group back, -so you don't aggro all 3. Hadronox will be under you, fighting Nerubians. - -This is the timed gauntlet - waves of non-elite spiders - will spawn from the 3 doors located a little above the main room, and will then head down to fight Hadronox. After clearing the - main room, it is recommended to just stay in it, kill the occasional non-elites that will attack you instead of the boss, and wait for - Hadronox to make his way to you. When Hadronox enters the main room, she will web the doors, and no more non-elites will spawn.*/ - -struct TRINITY_DLL_DECL boss_hadronoxAI : public ScriptedAI -{ - boss_hadronoxAI(Creature *c) : ScriptedAI(c) {} - - uint32 phase; - - void Reset() {} - void EnterCombat(Unit* who) {} - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - phase =1; - - DoMeleeAttackIfReady(); - } - void JustDied(Unit* killer) {} - - void KilledUnit(Unit *victim) - { - if (victim == m_creature) - return; - - //when Hadronox kills any enemy (that includes a party member) she will regain 10% of her HP if the target had Leech Poison on - } -}; - -CreatureAI* GetAI_boss_hadronox(Creature* pCreature) -{ - return new boss_hadronoxAI (pCreature); -} - -void AddSC_boss_hadronox() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_hadronox"; - newscript->GetAI = &GetAI_boss_hadronox; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/azjol_nerub/azjol_nerub/boss_krikthir_the_gatewatcher.cpp b/src/bindings/scripts/scripts/zone/azjol_nerub/azjol_nerub/boss_krikthir_the_gatewatcher.cpp deleted file mode 100644 index 3e0d3e97a51..00000000000 --- a/src/bindings/scripts/scripts/zone/azjol_nerub/azjol_nerub/boss_krikthir_the_gatewatcher.cpp +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Copyright (C) 2009 Trinity - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: boss_krikthir_the_gatewatcher -SDAuthor: LordVanMartin -SD%Complete: 0 -SDComment: Placeholder -SDCategory: Azjol Nerub -EndScriptData */ - -/*** SQL START *** -update creature_template set scriptname = 'boss_krik_thir' where entry = ''; -*** SQL END ***/ - -#include "precompiled.h" -#include "def_azjol_nerub.h" - -#define SPELL_MIND_FLAY 52586 -#define H_SPELL_MIND_FLAY 59367 -#define SPELL_CURSE_OF_FATIGUE 52592 -#define H_SPELL_CURSE_OF_FATIGUE 59368 -#define SPELL_FRENZY 28747 // maybe 53361 - -#define MOB_SKITTERING_SWARMER 28735 -#define MOB_SKITTERING_SWARMER_CONTROLLER 32593 - -#define SPELL_SUMMON_SKITTERING_SWARMER 52438//AOE Effekt 140, maybe 52439 -#define SPELL_SUMMON_SKITTERING_SWARMER 52439//Summon 3x 28735 - -//Yell -#define SAY_AGGRO -1601011 -#define SAY_SLAY_1 -1601012 -#define SAY_SLAY_2 -1601013 -#define SAY_SLAY_3 -1601014 -#define SAY_DEATH -1601015 -#define SAY_SEND_GROUP_1 -1601018 -#define SAY_SEND_GROUP_2 -1601019 -#define SAY_SEND_GROUP_3 -1601020 -#define SAY_SWARM_1 -1601016 -#define SAY_SWARM_2 -1601017 -#define SAY_PREFIGHT_1 -1601021 -#define SAY_PREFIGHT_2 -1601022 -#define SAY_PREFIGHT_3 -1601023 - -struct TRINITY_DLL_DECL boss_krik_thirAI : public ScriptedAI -{ - boss_krik_thirAI(Creature *c) : ScriptedAI(c) {} - - void Reset() {} - - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) >= 10) - { - //Frenzy - } - - DoMeleeAttackIfReady(); - } - void JustDied(Unit* killer) - { - DoScriptText(SAY_DEATH, m_creature); - } - void KilledUnit(Unit *victim) - { - if (victim == m_creature) - return; - - switch(rand()%3) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature);break; - case 1: DoScriptText(SAY_SLAY_2, m_creature);break; - case 2: DoScriptText(SAY_SLAY_3, m_creature);break; - } - } -}; - -CreatureAI* GetAI_boss_krik_thir(Creature* pCreature) -{ - return new boss_krik_thirAI (pCreature); -} - -void AddSC_boss_krik_thir() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_krik_thir"; - newscript->GetAI = &GetAI_boss_krik_thir; - newscript->RegisterSelf(); - -} diff --git a/src/bindings/scripts/scripts/zone/azjol_nerub/azjol_nerub/def_azjol_nerub.h b/src/bindings/scripts/scripts/zone/azjol_nerub/azjol_nerub/def_azjol_nerub.h deleted file mode 100644 index 9e319e8fde0..00000000000 --- a/src/bindings/scripts/scripts/zone/azjol_nerub/azjol_nerub/def_azjol_nerub.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (C) 2009 Trinity - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef DEF_AZJOL_NERUB_H -#define DEF_AZJOL_NERUB_H - -#define DATA_KRIKTHIR_THE_GATEWATCHER 1 -#define DATA_HADRONOX 2 -#define DATA_ANUBARAK 3 - -#define DATA_KRIKTHIR_THE_GATEWATCHER_EVENT 4 -#define DATA_HADRONOX_EVENT 5 -#define DATA_ANUBARAK_EVENT 6 -#endif diff --git a/src/bindings/scripts/scripts/zone/azjol_nerub/azjol_nerub/instance_azjol_nerub.cpp b/src/bindings/scripts/scripts/zone/azjol_nerub/azjol_nerub/instance_azjol_nerub.cpp deleted file mode 100644 index bac772acc6f..00000000000 --- a/src/bindings/scripts/scripts/zone/azjol_nerub/azjol_nerub/instance_azjol_nerub.cpp +++ /dev/null @@ -1,178 +0,0 @@ -/* - * Copyright (C) 2009 Trinity - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Instance_Azjol_Nerub -SD%Complete: 0 -SDComment: Placeholder -SDCategory: Azjol Nerub -EndScriptData */ - -#include "precompiled.h" -#include "def_azjol_nerub.h" - -#define MAX_ENCOUNTER 3 - -/* Azjol Nerub encounters: -0 - Krik'thir the Gatewatcher -1 - Hadronox -2 - Anub'arak -*/ - -struct TRINITY_DLL_DECL instance_azjol_nerub : public ScriptedInstance -{ - instance_azjol_nerub(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; - - uint64 m_uiKrikthir; - uint64 m_uiHadronox; - uint64 m_uiAnubarak; - - uint32 m_auiEncounter[MAX_ENCOUNTER]; - - void Initialize() - { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - - m_uiKrikthir = 0; - m_uiHadronox = 0; - m_uiAnubarak =0; - } - - bool IsEncounterInProgress() const - { - for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) return true; - - return false; - } - - - void OnCreatureCreate(Creature* pCreature, bool add) - { - switch(pCreature->GetEntry()) - { - case 28684: m_uiKrikthir = pCreature->GetGUID(); break; - case 28921: m_uiHadronox = pCreature->GetGUID(); break; - case 29120: m_uiAnubarak = pCreature->GetGUID(); break; - - } - } - - uint64 GetData64(uint32 identifier) - { - switch(identifier) - { - case DATA_KRIKTHIR_THE_GATEWATCHER: return m_uiKrikthir; - case DATA_HADRONOX: return m_uiHadronox; - case DATA_ANUBARAK: return m_uiAnubarak; - } - - return 0; - } - - void SetData(uint32 type, uint32 data) - { - switch(type) - { - case DATA_KRIKTHIR_THE_GATEWATCHER_EVENT: - m_auiEncounter[0] = data;break; - case DATA_HADRONOX_EVENT: - m_auiEncounter[1] = data; break; - case DATA_ANUBARAK_EVENT: - m_auiEncounter[2] = data; break; - } - - if (data == DONE) - { - SaveToDB(); - } - } - - uint32 GetData(uint32 type) - { - switch(type) - { - case DATA_KRIKTHIR_THE_GATEWATCHER_EVENT: return m_auiEncounter[0]; - case DATA_HADRONOX_EVENT: return m_auiEncounter[1]; - case DATA_ANUBARAK_EVENT: return m_auiEncounter[2]; - } - - return 0; - } - - std::string GetSaveData() - { - OUT_SAVE_INST_DATA; - - std::string str_data; - - std::ostringstream saveStream; - saveStream << "A N " << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " - << m_auiEncounter[2]; - - str_data = saveStream.str(); - - OUT_SAVE_INST_DATA_COMPLETE; - return str_data; - } - - void Load(const char* in) - { - if (!in) - { - OUT_LOAD_INST_DATA_FAIL; - return; - } - - OUT_LOAD_INST_DATA(in); - - char dataHead1, dataHead2; - uint16 data0,data1,data2; - - std::istringstream loadStream(in); - loadStream >> dataHead1 >> dataHead2 >> data0 >> data1 >> data2; - - if (dataHead1 == 'A' && dataHead2 == 'N') - { - m_auiEncounter[0] = data0; - m_auiEncounter[1] = data1; - m_auiEncounter[2] = data2; - - for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) - m_auiEncounter[i] = NOT_STARTED; - - }else OUT_LOAD_INST_DATA_FAIL; - - OUT_LOAD_INST_DATA_COMPLETE; - } -}; - -InstanceData* GetInstanceData_instance_azjol_nerub(Map* pMap) -{ - return new instance_azjol_nerub(pMap); -} - -void AddSC_instance_azjol_nerub() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_azjol_nerub"; - newscript->GetInstanceData = &GetInstanceData_instance_azjol_nerub; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/black_temple/.instance_black_temple.cpp-s8inyu b/src/bindings/scripts/scripts/zone/black_temple/.instance_black_temple.cpp-s8inyu deleted file mode 100644 index 43646746505..00000000000 --- a/src/bindings/scripts/scripts/zone/black_temple/.instance_black_temple.cpp-s8inyu +++ /dev/null @@ -1,347 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -/* ScriptData -SDName: Instance_Black_Temple -SD%Complete: 100 -SDComment: Instance Data Scripts and functions to acquire mobs and set encounter status for use in various Black Temple Scripts -SDCategory: Black Temple -EndScriptData */ - -#include "precompiled.h" -#include "def_black_temple.h" - -#define ENCOUNTERS 9 - -/* Black Temple encounters: -0 - High Warlord Naj'entus event -1 - Supremus Event -2 - Shade of Akama Event -3 - Teron Gorefiend Event -4 - Gurtogg Bloodboil Event -5 - Reliquary Of Souls Event -6 - Mother Shahraz Event -7 - Illidari Council Event -8 - Illidan Stormrage Event -*/ - -struct TRINITY_DLL_DECL instance_black_temple : public ScriptedInstance -{ - instance_black_temple(Map *map) : ScriptedInstance(map) {Initialize();}; - - uint32 Encounters[ENCOUNTERS]; - std::string str_data; - - uint64 Najentus; - uint64 Akama; // This is the Akama that starts the Illidan encounter. - uint64 Akama_Shade; // This is the Akama that starts the Shade of Akama encounter. - uint64 ShadeOfAkama; - uint64 Supremus; - uint64 LadyMalande; - uint64 GathiosTheShatterer; - uint64 HighNethermancerZerevor; - uint64 VerasDarkshadow; - uint64 IllidariCouncil; - uint64 BloodElfCouncilVoice; - uint64 IllidanStormrage; - - uint64 NajentusGate; - uint64 MainTempleDoors; - uint64 ShadeOfAkamaDoor; - uint64 CommonDoor;//Teron - uint64 TeronDoor; - uint64 GuurtogDoor; - uint64 MotherDoor; - uint64 TempleDoor;//Befor mother - uint64 CouncilDoor; - uint64 SimpleDoor;//council - uint64 IllidanGate; - uint64 IllidanDoor[2]; - - void Initialize() - { - Najentus = 0; - Akama = 0; - Akama_Shade = 0; - ShadeOfAkama = 0; - Supremus = 0; - LadyMalande = 0; - GathiosTheShatterer = 0; - HighNethermancerZerevor = 0; - VerasDarkshadow = 0; - IllidariCouncil = 0; - BloodElfCouncilVoice = 0; - IllidanStormrage = 0; - - NajentusGate = 0; - MainTempleDoors = 0; - ShadeOfAkamaDoor= 0; - CommonDoor = 0;//teron - TeronDoor = 0; - GuurtogDoor = 0; - MotherDoor = 0; - TempleDoor = 0; - SimpleDoor = 0;//Bycouncil - CouncilDoor = 0; - IllidanGate = 0; - IllidanDoor[0] = 0; - IllidanDoor[1] = 0; - - for(uint8 i = 0; i < ENCOUNTERS; ++i) - Encounters[i] = NOT_STARTED; - } - - bool IsEncounterInProgress() const - { - for(uint8 i = 0; i < ENCOUNTERS; ++i) - if(Encounters[i] == IN_PROGRESS) return true; - - return false; - } - - Player* GetPlayerInMap() - { - Map::PlayerList const& players = instance->GetPlayers(); - - if (!players.isEmpty()) - { - for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) - { - if (Player* plr = itr->getSource()) - return plr; - } - } - - debug_log("TSCR: Instance Black Temple: GetPlayerInMap, but PlayerList is empty!"); - return NULL; - } - - void OnCreatureCreate(Creature *creature, uint32 creature_entry) - { - switch(creature->GetEntry()) - { - case 22887: Najentus = creature->GetGUID(); break; - case 23089: Akama = creature->GetGUID(); break; - case 22990: Akama_Shade = creature->GetGUID(); break; - case 22841: ShadeOfAkama = creature->GetGUID(); break; - case 22898: Supremus = creature->GetGUID(); break; - case 22917: IllidanStormrage = creature->GetGUID(); break; - case 22949: GathiosTheShatterer = creature->GetGUID(); break; - case 22950: HighNethermancerZerevor = creature->GetGUID(); break; - case 22951: LadyMalande = creature->GetGUID(); break; - case 22952: VerasDarkshadow = creature->GetGUID(); break; - case 23426: IllidariCouncil = creature->GetGUID(); break; - case 23499: BloodElfCouncilVoice = creature->GetGUID(); break; - } - } - - void OnObjectCreate(GameObject* go) - { - switch(go->GetEntry()) - { - case 185483: NajentusGate = go->GetGUID();// Gate past Naj'entus (at the entrance to Supermoose's courtyards) - if(Encounters[0] == DONE)HandleGameObject(NULL,true,go);break; - case 185882: MainTempleDoors = go->GetGUID();// Main Temple Doors - right past Supermoose (Supremus) - if(Encounters[1] == DONE)HandleGameObject(NULL,true,go);break; - case 185478: ShadeOfAkamaDoor = go->GetGUID();break; - case 185480: CommonDoor = go->GetGUID(); - if(Encounters[3] == DONE)HandleGameObject(NULL,true,go);;break; - case 186153: TeronDoor = go->GetGUID(); - if(Encounters[3] == DONE)HandleGameObject(NULL,true,go);;break; - case 185892: GuurtogDoor = go->GetGUID(); - if(Encounters[4] == DONE)HandleGameObject(NULL,true,go);break; - case 185479: TempleDoor = go->GetGUID(); - if(Encounters[5] == DONE)HandleGameObject(NULL,true,go);break; - case 185482: MotherDoor = go->GetGUID(); - if(Encounters[6] == DONE)HandleGameObject(NULL,true,go);break; - case 185481: CouncilDoor = go->GetGUID(); - if(Encounters[7] == DONE)HandleGameObject(NULL,true,go);break; - case 186152: SimpleDoor = go->GetGUID(); - if(Encounters[7] == DONE)HandleGameObject(NULL,true,go);break; - case 185905: IllidanGate = go->GetGUID(); break; // Gate leading to Temple Summit - case 186261: IllidanDoor[0] = go->GetGUID(); break; // Right door at Temple Summit - case 186262: IllidanDoor[1] = go->GetGUID(); break; // Left door at Temple Summit - } - } - - uint64 GetData64(uint32 identifier) - { - switch(identifier) - { - case DATA_HIGHWARLORDNAJENTUS: return Najentus; - case DATA_AKAMA: return Akama; - case DATA_AKAMA_SHADE: return Akama_Shade; - case DATA_SHADEOFAKAMA: return ShadeOfAkama; - case DATA_SUPREMUS: return Supremus; - case DATA_ILLIDANSTORMRAGE: return IllidanStormrage; - case DATA_GATHIOSTHESHATTERER: return GathiosTheShatterer; - case DATA_HIGHNETHERMANCERZEREVOR: return HighNethermancerZerevor; - case DATA_LADYMALANDE: return LadyMalande; - case DATA_VERASDARKSHADOW: return VerasDarkshadow; - case DATA_ILLIDARICOUNCIL: return IllidariCouncil; - case DATA_GAMEOBJECT_NAJENTUS_GATE: return NajentusGate; - case DATA_GAMEOBJECT_ILLIDAN_GATE: return IllidanGate; - case DATA_GAMEOBJECT_ILLIDAN_DOOR_R: return IllidanDoor[0]; - case DATA_GAMEOBJECT_ILLIDAN_DOOR_L: return IllidanDoor[1]; - case DATA_GAMEOBJECT_SUPREMUS_DOORS: return MainTempleDoors; - case DATA_BLOOD_ELF_COUNCIL_VOICE: return BloodElfCouncilVoice; - } - - return 0; - } - - void SetData(uint32 type, uint32 data) - { - switch(type) - { - case DATA_HIGHWARLORDNAJENTUSEVENT: - if(data == DONE) - { - HandleGameObject(NajentusGate, true); - } - Encounters[0] = data;break; - case DATA_SUPREMUSEVENT: - if(data == DONE) - { - HandleGameObject(NajentusGate, true); - } - Encounters[1] = data; break; - case DATA_SHADEOFAKAMAEVENT: - if(data == IN_PROGRESS) - { - HandleGameObject(ShadeOfAkamaDoor, false); - }else HandleGameObject(ShadeOfAkamaDoor, true); - Encounters[2] = data; break; - case DATA_TERONGOREFIENDEVENT: - if(data == IN_PROGRESS) - { - HandleGameObject(TeronDoor, false); - HandleGameObject(CommonDoor, false); - }else - { - HandleGameObject(TeronDoor, true); - HandleGameObject(CommonDoor, true); - } - Encounters[3] = data; break; - case DATA_GURTOGGBLOODBOILEVENT: - if(data == DONE) - { - HandleGameObject(GuurtogDoor, true); - } - Encounters[4] = data; break; - case DATA_RELIQUARYOFSOULSEVENT: - if(data == DONE) - { - HandleGameObject(TempleDoor, true); - } - Encounters[5] = data; break; - case DATA_MOTHERSHAHRAZEVENT: - if(data == DONE) - { - HandleGameObject(MotherDoor, true); - } - Encounters[6] = data; break; - case DATA_ILLIDARICOUNCILEVENT: - if(data == IN_PROGRESS) - { - HandleGameObject(CouncilDoor, false); - HandleGameObject(SimpleDoor, false); - }else - { - HandleGameObject(CouncilDoor, true); - HandleGameObject(SimpleDoor, true); - } - Encounters[7] = data; break; - case DATA_ILLIDANSTORMRAGEEVENT: Encounters[8] = data; break; - } - - if (data == DONE) - { - OUT_SAVE_INST_DATA; - - std::ostringstream saveStream; - saveStream << Encounters[0] << " " << Encounters[1] << " " - << Encounters[2] << " " << Encounters[3] << " " << Encounters[4] - << " " << Encounters[5] << " " << Encounters[6] << " " << Encounters[7] - << " " << Encounters[8]; - - str_data = saveStream.str(); - - SaveToDB(); - OUT_SAVE_INST_DATA_COMPLETE; - } - } - - uint32 GetData(uint32 type) - { - switch(type) - { - case DATA_HIGHWARLORDNAJENTUSEVENT: return Encounters[0]; - case DATA_SUPREMUSEVENT: return Encounters[1]; - case DATA_SHADEOFAKAMAEVENT: return Encounters[2]; - case DATA_TERONGOREFIENDEVENT: return Encounters[3]; - case DATA_GURTOGGBLOODBOILEVENT: return Encounters[4]; - case DATA_RELIQUARYOFSOULSEVENT: return Encounters[5]; - case DATA_MOTHERSHAHRAZEVENT: return Encounters[6]; - case DATA_ILLIDARICOUNCILEVENT: return Encounters[7]; - case DATA_ILLIDANSTORMRAGEEVENT: return Encounters[8]; - } - - return 0; - } - - const char* Save() - { - return str_data.c_str(); - } - - void Load(const char* in) - { - if (!in) - { - OUT_LOAD_INST_DATA_FAIL; - return; - } - - OUT_LOAD_INST_DATA(in); - - std::istringstream loadStream(in); - loadStream >> Encounters[0] >> Encounters[1] >> Encounters[2] - >> Encounters[3] >> Encounters[4] >> Encounters[5] >> Encounters[6] - >> Encounters[7] >> Encounters[8]; - - for(uint8 i = 0; i < ENCOUNTERS; ++i) - if (Encounters[i] == IN_PROGRESS) - Encounters[i] = NOT_STARTED; - - OUT_LOAD_INST_DATA_COMPLETE; - } -}; - -InstanceData* GetInstanceData_instance_black_temple(Map* map) -{ - return new instance_black_temple(map); -} - -void AddSC_instance_black_temple() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_black_temple"; - newscript->GetInstanceData = &GetInstanceData_instance_black_temple; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/black_temple/black_temple.cpp b/src/bindings/scripts/scripts/zone/black_temple/black_temple.cpp deleted file mode 100644 index 7f0f1e570ba..00000000000 --- a/src/bindings/scripts/scripts/zone/black_temple/black_temple.cpp +++ /dev/null @@ -1,69 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Black_Temple -SD%Complete: 95 -SDComment: Spirit of Olum: Player Teleporter to Seer Kanai Teleport after defeating Naj'entus and Supremus. TODO: Find proper gossip. -SDCategory: Black Temple -EndScriptData */ - -/* ContentData -npc_spirit_of_olum -EndContentData */ - -#include "precompiled.h" -#include "def_black_temple.h" - -/*### -# npc_spirit_of_olum -####*/ - -#define SPELL_TELEPORT 41566 // s41566 - Teleport to Ashtongue NPC's -#define GOSSIP_OLUM1 "Teleport me to the other Ashtongue Deathsworn" - -bool GossipHello_npc_spirit_of_olum(Player* pPlayer, Creature* pCreature) -{ - ScriptedInstance* pInstance = (pCreature->GetInstanceData()); - - if (pInstance && (pInstance->GetData(DATA_SUPREMUSEVENT) >= DONE) && (pInstance->GetData(DATA_HIGHWARLORDNAJENTUSEVENT) >= DONE)) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_OLUM1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - - pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); - return true; -} - -bool GossipSelect_npc_spirit_of_olum(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) - pPlayer->CLOSE_GOSSIP_MENU(); - - pPlayer->InterruptNonMeleeSpells(false); - pPlayer->CastSpell(pPlayer, SPELL_TELEPORT, false); - return true; -} - -void AddSC_black_temple() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "npc_spirit_of_olum"; - newscript->pGossipHello = &GossipHello_npc_spirit_of_olum; - newscript->pGossipSelect = &GossipSelect_npc_spirit_of_olum; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_bloodboil.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_bloodboil.cpp deleted file mode 100644 index 12c3d445018..00000000000 --- a/src/bindings/scripts/scripts/zone/black_temple/boss_bloodboil.cpp +++ /dev/null @@ -1,344 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Bloodboil -SD%Complete: 80 -SDComment: Bloodboil not working correctly, missing enrage -SDCategory: Black Temple -EndScriptData */ - -#include "precompiled.h" -#include "def_black_temple.h" - -//Speech'n'Sound -#define SAY_AGGRO -1564029 -#define SAY_SLAY1 -1564030 -#define SAY_SLAY2 -1564031 -#define SAY_SPECIAL1 -1564032 -#define SAY_SPECIAL2 -1564033 -#define SAY_ENRAGE1 -1564034 -#define SAY_ENRAGE2 -1564035 -#define SAY_DEATH -1564036 - -//Spells -#define SPELL_ACID_GEYSER 40630 -#define SPELL_ACIDIC_WOUND 40481 -#define SPELL_ARCING_SMASH 40599 -#define SPELL_BLOODBOIL 42005 // This spell is AoE whereas it shouldn't be -#define SPELL_FEL_ACID 40508 -#define SPELL_FEL_RAGE_SELF 40594 -#define SPELL_FEL_RAGE_TARGET 40604 -#define SPELL_FEL_RAGE_2 40616 -#define SPELL_FEL_RAGE_3 41625 -#define SPELL_BEWILDERING_STRIKE 40491 -#define SPELL_EJECT1 40486 // 1000 Physical damage + knockback + script effect (should handle threat reduction I think) -#define SPELL_EJECT2 40597 // 1000 Physical damage + Stun (used in phase 2?) -#define SPELL_TAUNT_GURTOGG 40603 -#define SPELL_INSIGNIFIGANCE 40618 -#define SPELL_BERSERK 45078 - -//This is used to sort the players by distance in preparation for the Bloodboil cast. - -struct TRINITY_DLL_DECL boss_gurtogg_bloodboilAI : public ScriptedAI -{ - boss_gurtogg_bloodboilAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - uint64 TargetGUID; - - float TargetThreat; - - uint32 BloodboilTimer; - uint32 BloodboilCount; - uint32 AcidGeyserTimer; - uint32 AcidicWoundTimer; - uint32 ArcingSmashTimer; - uint32 EnrageTimer; - uint32 FelAcidTimer; - uint32 EjectTimer; - uint32 BewilderingStrikeTimer; - uint32 PhaseChangeTimer; - - bool Phase1; - - void Reset() - { - if (pInstance) - pInstance->SetData(DATA_GURTOGGBLOODBOILEVENT, NOT_STARTED); - - TargetGUID = 0; - - TargetThreat = 0; - - BloodboilTimer = 10000; - BloodboilCount = 0; - AcidGeyserTimer = 1000; - AcidicWoundTimer = 6000; - ArcingSmashTimer = 19000; - EnrageTimer = 600000; - FelAcidTimer = 25000; - EjectTimer = 10000; - BewilderingStrikeTimer = 15000; - PhaseChangeTimer = 60000; - - Phase1 = true; - - m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, false); - m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, false); - } - - void EnterCombat(Unit *who) - { - DoZoneInCombat(); - DoScriptText(SAY_AGGRO, m_creature); - if (pInstance) - pInstance->SetData(DATA_GURTOGGBLOODBOILEVENT, IN_PROGRESS); - } - - void KilledUnit(Unit *victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; - } - } - - void JustDied(Unit *victim) - { - if (pInstance) - pInstance->SetData(DATA_GURTOGGBLOODBOILEVENT, DONE); - - DoScriptText(SAY_DEATH, m_creature); - } - - // Note: This seems like a very complicated fix. The fix needs to be handled by the core, as implementation of limited-target AoE spells are still not limited. - void CastBloodboil() - { - // Get the Threat List - std::list m_threatlist = m_creature->getThreatManager().getThreatList(); - - if (!m_threatlist.size()) // He doesn't have anyone in his threatlist, useless to continue - return; - - std::list targets; - std::list::iterator itr = m_threatlist.begin(); - for(; itr!= m_threatlist.end(); ++itr) //store the threat list in a different container - { - Unit *target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()); - //only on alive players - if (target && target->isAlive() && target->GetTypeId() == TYPEID_PLAYER) - targets.push_back(target); - } - - //Sort the list of players - targets.sort(ObjectDistanceOrderReversed(m_creature)); - //Resize so we only get top 5 - targets.resize(5); - - //Aura each player in the targets list with Bloodboil. Aura code copied+pasted from Aura command in Level3.cpp - /*SpellEntry const *spellInfo = GetSpellStore()->LookupEntry(SPELL_BLOODBOIL); - if (spellInfo) - { - for(std::list::iterator itr = targets.begin(); itr != targets.end(); ++itr) - { - Unit* target = *itr; - if (!target) return; - for(uint32 i = 0;i<3; ++i) - { - uint8 eff = spellInfo->Effect[i]; - if (eff>=TOTAL_SPELL_EFFECTS) - continue; - - Aura *Aur = new Aura(spellInfo, i, NULL, target); - target->AddAura(Aur); - } - } - }*/ - } - - void RevertThreatOnTarget(uint64 guid) - { - Unit* pUnit = NULL; - pUnit = Unit::GetUnit((*m_creature), guid); - if (pUnit) - { - if (DoGetThreat(pUnit)) - DoModifyThreatPercent(pUnit, -100); - if (TargetThreat) - m_creature->AddThreat(pUnit, TargetThreat); - } - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (ArcingSmashTimer < diff) - { - DoCast(m_creature->getVictim(), SPELL_ARCING_SMASH); - ArcingSmashTimer = 10000; - }else ArcingSmashTimer -= diff; - - if (FelAcidTimer < diff) - { - DoCast(m_creature->getVictim(), SPELL_FEL_ACID); - FelAcidTimer = 25000; - }else FelAcidTimer -= diff; - - if (!m_creature->HasAura(SPELL_BERSERK)) - { - if (EnrageTimer < diff) - { - DoCast(m_creature, SPELL_BERSERK); - switch(rand()%2) - { - case 0: DoScriptText(SAY_ENRAGE1, m_creature); break; - case 1: DoScriptText(SAY_ENRAGE2, m_creature); break; - } - }else EnrageTimer -= diff; - } - - if (Phase1) - { - if (BewilderingStrikeTimer < diff) - { - DoCast(m_creature->getVictim(), SPELL_BEWILDERING_STRIKE); - float mt_threat = DoGetThreat(m_creature->getVictim()); - if (Unit* target = SelectUnit(SELECT_TARGET_TOPAGGRO, 1)) - m_creature->AddThreat(target, mt_threat); - BewilderingStrikeTimer = 20000; - }else BewilderingStrikeTimer -= diff; - - if (EjectTimer < diff) - { - DoCast(m_creature->getVictim(), SPELL_EJECT1); - DoModifyThreatPercent(m_creature->getVictim(), -40); - EjectTimer = 15000; - }else EjectTimer -= diff; - - if (AcidicWoundTimer < diff) - { - DoCast(m_creature->getVictim(), SPELL_ACIDIC_WOUND); - AcidicWoundTimer = 10000; - }else AcidicWoundTimer -= diff; - - if (BloodboilTimer < diff) - { - if (BloodboilCount < 5) // Only cast it five times. - { - //CastBloodboil(); // Causes issues on windows, so is commented out. - DoCast(m_creature->getVictim(), SPELL_BLOODBOIL); - ++BloodboilCount; - BloodboilTimer = 10000*BloodboilCount; - } - }else BloodboilTimer -= diff; - } - - if (!Phase1) - { - if (AcidGeyserTimer < diff) - { - DoCast(m_creature->getVictim(), SPELL_ACID_GEYSER); - AcidGeyserTimer = 30000; - }else AcidGeyserTimer -= diff; - - if (EjectTimer < diff) - { - DoCast(m_creature->getVictim(), SPELL_EJECT2); - EjectTimer = 15000; - }else EjectTimer -= diff; - } - - if (PhaseChangeTimer < diff) - { - if (Phase1) - { - Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (target && target->isAlive()) - { - Phase1 = false; - - TargetThreat = DoGetThreat(target); - TargetGUID = target->GetGUID(); - target->CastSpell(m_creature, SPELL_TAUNT_GURTOGG, true); - if (DoGetThreat(target)) - DoModifyThreatPercent(target, -100); - m_creature->AddThreat(target, 50000000.0f); - m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true); - m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true); - // If VMaps are disabled, this spell can call the whole instance - DoCast(m_creature, SPELL_INSIGNIFIGANCE, true); - DoCast(target, SPELL_FEL_RAGE_TARGET, true); - DoCast(target,SPELL_FEL_RAGE_2, true); - /* These spells do not work, comment them out for now. - DoCast(target, SPELL_FEL_RAGE_2, true); - DoCast(target, SPELL_FEL_RAGE_3, true);*/ - - //Cast this without triggered so that it appears in combat logs and shows visual. - DoCast(m_creature, SPELL_FEL_RAGE_SELF); - - switch(rand()%2) - { - case 0: DoScriptText(SAY_SPECIAL1, m_creature); break; - case 1: DoScriptText(SAY_SPECIAL2, m_creature); break; - } - - AcidGeyserTimer = 1000; - PhaseChangeTimer = 30000; - } - }else // Encounter is a loop pretty much. Phase 1 -> Phase 2 -> Phase 1 -> Phase 2 till death or enrage - { - if (TargetGUID) - RevertThreatOnTarget(TargetGUID); - TargetGUID = 0; - Phase1 = true; - BloodboilTimer = 10000; - BloodboilCount = 0; - AcidicWoundTimer += 2000; - ArcingSmashTimer += 2000; - FelAcidTimer += 2000; - EjectTimer += 2000; - PhaseChangeTimer = 60000; - m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, false); - m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, false); - } - }else PhaseChangeTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_gurtogg_bloodboil(Creature* pCreature) -{ - return new boss_gurtogg_bloodboilAI (pCreature); -} - -void AddSC_boss_gurtogg_bloodboil() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_gurtogg_bloodboil"; - newscript->GetAI = &GetAI_boss_gurtogg_bloodboil; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_illidan.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_illidan.cpp deleted file mode 100644 index 2baa0abbe81..00000000000 --- a/src/bindings/scripts/scripts/zone/black_temple/boss_illidan.cpp +++ /dev/null @@ -1,2208 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -/* ScriptData -SDName: boss_illidan_stormrage -SD%Complete: 90 -SDComment: Somewhat of a workaround for Parasitic Shadowfiend, unable to summon GOs for Cage Trap. -SDCategory: Black Temple -EndScriptData */ - -#include "precompiled.h" -#include "def_black_temple.h" - -#define GETGO(obj, guid) GameObject* obj = pInstance->instance->GetGameObject(guid) -#define GETUNIT(unit, guid) Unit* unit = Unit::GetUnit(*m_creature, guid) -#define GETCRE(cre, guid) Creature* cre = Unit::GetCreature(*m_creature, guid) -#define HPPCT(unit) unit->GetHealth()*100 / unit->GetMaxHealth() - -/************* Quotes and Sounds ***********************/ -// Gossip for when a player clicks Akama -#define GOSSIP_ITEM "We are ready to face Illidan" - -// Yells for/by Akama -#define SAY_AKAMA_BEWARE "Be wary friends, The Betrayer meditates in the court just beyond." -#define SOUND_AKAMA_BEWARE 11388 -#define SAY_AKAMA_MINION "Come, my minions. Deal with this traitor as he deserves!" -#define SOUND_AKAMA_MINION 11465 -#define SAY_AKAMA_LEAVE "I'll deal with these mongrels. Strike now, friends! Strike at the betrayer!" -#define SOUND_AKAMA_LEAVE 11390 - -// Self explanatory -const char* SAY_KILL1 = "Who shall be next to taste my blades?!"; -#define SOUND_KILL1 11473 -const char* SAY_KILL2 = "This is too easy!"; -#define SOUND_KILL2 11472 - -// I think I'll fly now and let my subordinates take you on -#define SAY_TAKEOFF "I will not be touched by rabble such as you!" -#define SOUND_TAKEOFF 11479 -#define SAY_SUMMONFLAMES "Behold the flames of Azzinoth!" -#define SOUND_SUMMONFLAMES 11480 - -// When casting Eye Blast. Demon Fire will be appear on places that he casts this -#define SAY_EYE_BLAST "Stare into the eyes of the Betrayer!" -#define SOUND_EYE_BLAST 11481 - -// kk, I go big, dark and demon on you. -#define SAY_MORPH "Behold the power... of the demon within!" -#define SOUND_MORPH 11475 - -// I KILL! -#define SAY_ENRAGE "You've wasted too much time mortals, now you shall fall!" -#define SOUND_ENRAGE 11474 - -/************** Spells *************/ -// Normal Form -#define SPELL_SHEAR 37335 // 41032 is bugged, cannot be block/dodge/parry// Reduces Max. Health by 60% for 7 seconds. Can stack 19 times. 1.5 second cast -#define SPELL_FLAME_CRASH 40832 // Summons an invis/unselect passive mob that has an aura of flame in a circle around him. -#define SPELL_DRAW_SOUL 40904 // 5k Shadow Damage in front of him. Heals Illidan for 100k health (script effect) -#define SPELL_PARASITIC_SHADOWFIEND 41917 // DoT of 3k Shadow every 2 seconds. Lasts 10 seconds. (Script effect: Summon 2 parasites once the debuff has ticked off) -#define SPELL_PARASITIC_SHADOWFIEND2 41914 // Used by Parasitic -#define SPELL_SUMMON_PARASITICS 41915 // Summons 2 Parasitic Shadowfiends on the target. It's supposed to be cast as soon as the Parasitic Shadowfiend debuff is gone, but the spells aren't linked :( -#define SPELL_AGONIZING_FLAMES 40932 // 4k fire damage initial to target and anyone w/i 5 yards. PHASE 3 ONLY -#define SPELL_ENRAGE 40683 // Increases damage by 50% and attack speed by 30%. 20 seconds, PHASE 5 ONLY -// Flying (Phase 2) -#define SPELL_THROW_GLAIVE 39635 // Throws a glaive on the ground -#define SPELL_THROW_GLAIVE2 39849 // Animation for the above spell -#define SPELL_GLAIVE_RETURNS 39873 // Glaive flies back to Illidan -#define SPELL_FIREBALL 40598 // 2.5k-3.5k damage in 10 yard radius. 2 second cast time. -#define SPELL_DARK_BARRAGE 40585 // 10 second channeled spell, 3k shadow damage per second. -// Demon Form -#define SPELL_DEMON_TRANSFORM_1 40511 // First phase of animations for transforming into Dark Illidan (fall to ground) -#define SPELL_DEMON_TRANSFORM_2 40398 // Second phase of animations (kneel) -#define SPELL_DEMON_TRANSFORM_3 40510 // Final phase of animations (stand up and roar) -#define SPELL_DEMON_FORM 40506 // Transforms into Demon Illidan. Has an Aura of Dread on him. -#define SPELL_SHADOW_BLAST 41078 // 8k - 11k Shadow Damage. Targets highest threat. Has a splash effect, damaging anyone in 20 yards of the target. -#define SPELL_FLAME_BURST 41126 // Hurls fire at entire raid for ~3.5k damage every 10 seconds. Resistable. (Does not work: Script effect) -#define SPELL_FLAME_BURST_EFFECT 41131 // The actual damage. Have each player cast it on itself (workaround) -// Other Illidan spells -#define SPELL_KNEEL 39656 // Before beginning encounter, this is how he appears (talking to skully). -#define SPELL_SHADOW_PRISON 40647 // Illidan casts this spell to immobilize entire raid when he summons Maiev. -#define SPELL_DEATH 41220 // This spell doesn't do anything except stun Illidan and set him on his knees. -#define SPELL_BERSERK 45078 // Damage increased by 500%, attack speed by 150% -#define SPELL_DUAL_WIELD 42459 -//Phase Normal spells -#define SPELL_FLAME_CRASH_EFFECT 40836 // Firey blue ring of circle that the other flame crash summons -#define SPELL_SUMMON_SHADOWDEMON 41117 // Summon four shadowfiends -#define SPELL_SHADOWFIEND_PASSIVE 41913 // Passive aura for shadowfiends -#define SPELL_SHADOW_DEMON_PASSIVE 41079 // Adds the "shadowform" aura to Shadow Demons. -#define SPELL_CONSUME_SOUL 41080 // Once the Shadow Demons reach their target, they use this to kill them -#define SPELL_PARALYZE 41083 // Shadow Demons cast this on their target -#define SPELL_PURPLE_BEAM 39123 // Purple Beam connecting Shadow Demon to their target -//Phase Flight spells -#define SPELL_AZZINOTH_CHANNEL 39857 // Glaives cast it on Flames. Not sure if this is the right spell. -#define SPELL_EYE_BLAST_TRIGGER 40017 // This summons Demon Form every few seconds and deals ~20k damage in its radius -#define SPELL_EYE_BLAST 39908 // This does the blue flamey animation. -#define SPELL_BLAZE_EFFECT 40610 // Green flame on the ground, triggers damage (5k) every few seconds -#define SPELL_BLAZE_SUMMON 40637 // Summons the Blaze creature -#define SPELL_DEMON_FIRE 40029 // Blue fire trail left by Eye Blast. Deals 2k per second if players stand on it. -#define SPELL_FLAME_BLAST 40631 // Flames of Azzinoth use this. Frontal cone AoE 7k-9k damage. -#define SPELL_CHARGE 41581 //40602 // Flames of Azzinoth charges whoever is too far from them. They enrage after this. For simplicity, we'll use the same enrage as Illidan. -#define SPELL_FLAME_ENRAGE 45078 -//Akama spells -#define SPELL_AKAMA_DOOR_CHANNEL 41268 // Akama's channel spell on the door before the Temple Summit -#define SPELL_DEATHSWORN_DOOR_CHANNEL 41269 // Olum and Udalo's channel spell on the door before the Temple Summit -#define SPELL_AKAMA_DOOR_FAIL 41271 // Not sure where this is really used... -#define SPELL_HEALING_POTION 40535 // Akama uses this to heal himself to full. -#define SPELL_CHAIN_LIGHTNING 40536 // 6938 to 8062 for 5 targets -//Maiev spells -#define SPELL_CAGE_TRAP_DUMMY 40761 // Put this in DB for cage trap GO. -#define SPELL_CAGED 40695 // Caged Trap triggers will cast this on Illidan if he is within 3 yards -#define SPELL_CAGE_TRAP_SUMMON 40694 // Summons a Cage Trap GO (bugged) on the ground along with a Cage Trap Disturb Trigger mob (working) -#define SPELL_CAGE_TRAP_BEAM 40713 // 8 Triggers on the ground in an octagon cast spells like this on Illidan 'caging him' -#define SPELL_TELEPORT_VISUAL 41232 // Teleport visual for Maiev -#define SPELL_SHADOW_STRIKE 40685 // 4375 to 5625 every 3 seconds for 12 seconds -#define SPELL_THROW_DAGGER 41152 // 5400 to 6600 damage, need dagger -#define SPELL_FAN_BLADES 39954 // bugged visual - -// Other defines -#define CENTER_X 676.740 -#define CENTER_Y 305.297 -#define CENTER_Z 353.192 - -#define FLAME_ENRAGE_DISTANCE 30 -#define FLAME_CHARGE_DISTANCE 50 - -#define EQUIP_ID_MAIN_HAND 32837 -#define EQUIP_ID_OFF_HAND 32838 - -/**** Creature Summon and Recognition IDs ****/ -enum CreatureEntry -{ - EMPTY = 0, - AKAMA = 22990, - ILLIDAN_STORMRAGE = 22917, - BLADE_OF_AZZINOTH = 22996, - FLAME_OF_AZZINOTH = 22997, - MAIEV_SHADOWSONG = 23197, - SHADOW_DEMON = 23375, - DEMON_FIRE = 23069, - FLAME_CRASH = 23336, - ILLIDAN_DOOR_TRIGGER = 23412, - SPIRIT_OF_OLUM = 23411, - SPIRIT_OF_UDALO = 23410, - ILLIDARI_ELITE = 23226, - PARASITIC_SHADOWFIEND = 23498, - CAGE_TRAP_TRIGGER = 23292, -}; - -/*** Phase Names ***/ -enum PhaseIllidan -{ - PHASE_ILLIDAN_NULL = 0, - PHASE_NORMAL = 1, - PHASE_FLIGHT = 2, - PHASE_NORMAL_2 = 3, - PHASE_DEMON = 4, - PHASE_NORMAL_MAIEV = 5, - PHASE_TALK_SEQUENCE = 6, - PHASE_FLIGHT_SEQUENCE = 7, - PHASE_TRANSFORM_SEQUENCE = 8, - PHASE_ILLIDAN_MAX = 9, -};//Maiev uses the same phase - -enum PhaseAkama -{ - PHASE_AKAMA_NULL = 0, - PHASE_CHANNEL = 1, - PHASE_WALK = 2, - PHASE_TALK = 3, - PHASE_FIGHT_ILLIDAN = 4, - PHASE_FIGHT_MINIONS = 5, - PHASE_RETURN = 6, -}; - -enum EventIllidan -{ - EVENT_NULL = 0, - EVENT_BERSERK = 1, - //normal phase - EVENT_TAUNT = 2, - EVENT_SHEAR = 3, - EVENT_FLAME_CRASH = 4, - EVENT_PARASITIC_SHADOWFIEND = 5, - EVENT_PARASITE_CHECK = 6, - EVENT_DRAW_SOUL = 7, - EVENT_AGONIZING_FLAMES = 8, - EVENT_TRANSFORM_NORMAL = 9, - EVENT_ENRAGE = 10, - //flight phase - EVENT_FIREBALL = 2, - EVENT_DARK_BARRAGE = 3, - EVENT_EYE_BLAST = 4, - EVENT_MOVE_POINT = 5, - //demon phase - EVENT_SHADOW_BLAST = 2, - EVENT_FLAME_BURST = 3, - EVENT_SHADOWDEMON = 4, - EVENT_TRANSFORM_DEMON = 5, - //sequence phase - EVENT_TALK_SEQUENCE = 2, - EVENT_FLIGHT_SEQUENCE = 2, - EVENT_TRANSFORM_SEQUENCE = 2, -}; - -enum EventMaiev -{ - EVENT_MAIEV_NULL = 0, - EVENT_MAIEV_STEALTH = 1, - EVENT_MAIEV_TAUNT = 2, - EVENT_MAIEV_SHADOW_STRIKE = 3, - EVENT_MAIEV_THROW_DAGGER = 4, - EVENT_MAIEV_TRAP = 4, -}; - -static EventIllidan MaxTimer[]= -{ - EVENT_NULL, - EVENT_DRAW_SOUL, - EVENT_MOVE_POINT, - EVENT_TRANSFORM_NORMAL, - EVENT_TRANSFORM_DEMON, - EVENT_ENRAGE, - EVENT_TALK_SEQUENCE, - EVENT_FLIGHT_SEQUENCE, - EVENT_TRANSFORM_SEQUENCE -}; - -struct Yells -{ - uint32 sound; - char* text; - uint32 pCreature, timer, emote; - bool Talk; -}; - -static Yells Conversation[]= -{ - {11463, "Akama... your duplicity is hardly surprising. I should have slaughtered you and your malformed brethren long ago.", ILLIDAN_STORMRAGE, 8000, 0, true}, - {0, NULL, ILLIDAN_STORMRAGE, 5000, 396, true}, - {11389, "We've come to end your reign, Illidan. My people and all of Outland shall be free!", AKAMA, 7000, 25, true}, - {0, NULL, AKAMA, 5000, 66, true}, - {11464, "Boldly said. But I remain unconvinced.", ILLIDAN_STORMRAGE, 8000, 396, true}, - {11380, "The time has come! The moment is at hand!", AKAMA, 3000, 22, true}, - {0, NULL, AKAMA, 2000, 15, true}, - {11466, "You are not prepared!", ILLIDAN_STORMRAGE, 3000, 406, true}, - {0, NULL, EMPTY, 1000, 0, true}, - {0, NULL, EMPTY, 0, 0, false},//9 - {11476, "Is this it, mortals? Is this all the fury you can muster?", ILLIDAN_STORMRAGE, 8000, 0, true}, - {11491, "Their fury pales before mine, Illidan. We have some unsettled business between us.", MAIEV_SHADOWSONG, 8000, 5, true}, - {11477, "Maiev... How is this even possible?", ILLIDAN_STORMRAGE, 5000, 1, true}, - {11492, "Ah... my long hunt is finally over. Today, Justice will be done!", MAIEV_SHADOWSONG, 8000, 15, true}, - {11470, "Feel the hatred of ten thousand years!", ILLIDAN_STORMRAGE, 1000, 0, false},//14 - {11496, "Ahh... It is finished. You are beaten.", MAIEV_SHADOWSONG, 6000, 0, true},//15 - {11478, "You have won... Maiev...but the huntress... is nothing...without the hunt... you... are nothing... without me..", ILLIDAN_STORMRAGE, 30000, 65, true}, // Emote dead for now. Kill him later - {11497, "He is right. I feel nothing... I am nothing... Farewell, champions.", MAIEV_SHADOWSONG, 9000, 0, true}, - {11498, NULL, MAIEV_SHADOWSONG, 5000, 0, true}, - {11498, NULL, EMPTY, 1000, 0, true},//19 Maiev disappear - {11387, "The Light will fill these dismal halls once again. I swear it.", AKAMA, 8000, 0, true}, - {0, NULL, EMPTY, 1000, 0, false}//21 -}; - -static Yells RandomTaunts[]= -{ - {11467, "I can feel your hatred.", ILLIDAN_STORMRAGE, 0, 0, false}, - {11468, "Give in to your fear!", ILLIDAN_STORMRAGE, 0, 0, false}, - {11469, "You know nothing of power!", ILLIDAN_STORMRAGE, 0, 0, false}, - {11471, "Such... arrogance!", ILLIDAN_STORMRAGE, 0, 0, false} -}; - -static Yells MaievTaunts[]= -{ - {11493, "That is for Naisha!", MAIEV_SHADOWSONG, 0, false}, - {11494, "Bleed as I have bled!", MAIEV_SHADOWSONG, 0, 0, false}, - {11495, "There shall be no prison for you this time!", MAIEV_SHADOWSONG, 0, 0, false}, - {11500, "Meet your end, demon!", MAIEV_SHADOWSONG, 0, 0, false} -}; - -struct Locations -{ - float x, y, z; -}; - -static Locations HoverPosition[]= -{ - {657, 340, 355}, - {657, 275, 355}, - {705, 275, 355}, - {705, 340, 355} -}; - -static Locations GlaivePosition[]= -{ - {695.105, 305.303, 354.256}, - {659.338, 305.303, 354.256},//the distance between two glaives is 36 - {700.105, 305.303, 354.256}, - {664.338, 305.303, 354.256} -}; - -static Locations EyeBlast[]= -{ - {677, 350, 354},//start point, pass through glaive point - {677, 260, 354} -}; - -static Locations AkamaWP[]= -{ - {770.01, 304.50, 312.29}, // Bottom of the first stairs, at the doors - {780.66, 304.50, 319.74}, // Top of the first stairs - {790.13, 319.68, 319.76}, // Bottom of the second stairs (left from the entrance) - {787.17, 347.38, 341.42}, // Top of the second stairs - {781.34, 350.31, 341.44}, // Bottom of the third stairs - {762.60, 361.06, 353.60}, // Top of the third stairs - {756.35, 360.52, 353.27}, // Before the door-thingy - {743.82, 342.21, 353.00}, // Somewhere further - {732.69, 305.13, 353.00}, // In front of Illidan - (8) - {738.11, 365.44, 353.00}, // in front of the door-thingy (the other one!) - {792.18, 366.62, 341.42}, // Down the first flight of stairs - {796.84, 304.89, 319.76}, // Down the second flight of stairs - {782.01, 304.55, 319.76} // Final location - back at the initial gates. This is where he will fight the minions! (12) -}; -// 755.762, 304.0747, 312.1769 -- This is where Akama should be spawned -static Locations SpiritSpawns[]= -{ - {755.5426, 309.9156, 312.2129}, - {755.5426, 298.7923, 312.0834} -}; - -struct Animation // For the demon transformation -{ - uint32 aura, unaura, timer, size, displayid, phase; - bool equip; -}; - -static Animation DemonTransformation[]= -{ - {SPELL_DEMON_TRANSFORM_1, 0, 1000, 0, 0, 6, true}, - {SPELL_DEMON_TRANSFORM_2, SPELL_DEMON_TRANSFORM_1, 4000, 0, 0, 6, true}, - {0, 0, 3000, 1073741824, 21322, 6, false},//stunned, cannot cast demon form - {SPELL_DEMON_TRANSFORM_3, SPELL_DEMON_TRANSFORM_2, 3500, 0, 0, 6, false}, - {SPELL_DEMON_FORM, SPELL_DEMON_TRANSFORM_3, 0, 0, 0, 4, false}, - {SPELL_DEMON_TRANSFORM_1, 0, 1000, 0, 0, 6, false}, - {SPELL_DEMON_TRANSFORM_2, SPELL_DEMON_TRANSFORM_1, 4000, 0, 0, 6, false}, - {0, SPELL_DEMON_FORM, 3000, 1069547520, 21135, 6, false}, - {SPELL_DEMON_TRANSFORM_3, SPELL_DEMON_TRANSFORM_2, 3500, 0, 0, 6, true}, - {0, SPELL_DEMON_TRANSFORM_3, 0, 0, 0, 8, true} -}; - - - -/************************************** Illidan's AI ***************************************/ -struct TRINITY_DLL_DECL boss_illidan_stormrageAI : public ScriptedAI -{ - boss_illidan_stormrageAI(Creature* c) : ScriptedAI(c), Summons(m_creature) - { - pInstance = c->GetInstanceData(); - m_creature->CastSpell(m_creature, SPELL_DUAL_WIELD, true); - - SpellEntry *TempSpell = GET_SPELL(SPELL_SHADOWFIEND_PASSIVE); - if (TempSpell) - TempSpell->EffectApplyAuraName[0] = 4; // proc debuff, and summon infinite fiends - } - - ScriptedInstance* pInstance; - - PhaseIllidan Phase; - EventIllidan Event; - uint32 Timer[EVENT_ENRAGE + 1]; - - uint32 TalkCount; - uint32 TransformCount; - uint32 FlightCount; - - uint32 HoverPoint; - - uint64 AkamaGUID; - uint64 MaievGUID; - uint64 FlameGUID[2]; - uint64 GlaiveGUID[2]; - - SummonList Summons; - - void Reset(); - - void JustSummoned(Creature* summon); - - void SummonedCreatureDespawn(Creature* summon) - { - if (summon->GetCreatureInfo()->Entry == FLAME_OF_AZZINOTH) - { - for(uint8 i = 0; i < 2; ++i) - if (summon->GetGUID() == FlameGUID[i]) - FlameGUID[i] = 0; - - if (!FlameGUID[0] && !FlameGUID[1] && Phase != PHASE_ILLIDAN_NULL) - { - m_creature->InterruptNonMeleeSpells(true); - EnterPhase(PHASE_FLIGHT_SEQUENCE); - } - } - Summons.Despawn(summon); - } - - void MovementInform(uint32 MovementType, uint32 Data) - { - if (FlightCount == 7) //change hover point - { - if (m_creature->getVictim()) - { - m_creature->SetInFront(m_creature->getVictim()); - m_creature->StopMoving(); - } - EnterPhase(PHASE_FLIGHT); - } - else // handle flight sequence - Timer[EVENT_FLIGHT_SEQUENCE] = 1000; - } - - void EnterCombat(Unit *who) - { - m_creature->setActive(true); - DoZoneInCombat(); - } - - void AttackStart(Unit *who) - { - if (!who || Phase >= PHASE_TALK_SEQUENCE) - return; - - if (Phase == PHASE_FLIGHT || Phase == PHASE_DEMON) - AttackStartNoMove(who); - else - ScriptedAI::AttackStart(who); - } - - void MoveInLineOfSight(Unit *who) {} - - void JustDied(Unit *killer) - { - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - - if (!pInstance) - return; - - pInstance->SetData(DATA_ILLIDANSTORMRAGEEVENT, DONE); // Completed - - for(uint8 i = DATA_GAMEOBJECT_ILLIDAN_DOOR_R; i < DATA_GAMEOBJECT_ILLIDAN_DOOR_L + 1; ++i) - pInstance->HandleGameObject(pInstance->GetData64(i), true); - } - - void KilledUnit(Unit *victim) - { - if (victim == m_creature) return; - // TODO: Find better way to handle emote - switch(rand()%2) - { - case 0: - m_creature->MonsterYell(SAY_KILL1, LANG_UNIVERSAL, victim->GetGUID()); - DoPlaySoundToSet(m_creature, SOUND_KILL1); - break; - case 1: - m_creature->MonsterYell(SAY_KILL2, LANG_UNIVERSAL, victim->GetGUID()); - DoPlaySoundToSet(m_creature, SOUND_KILL2); - break; - } - } - - void DamageTaken(Unit *done_by, uint32 &damage) - { - if (damage >= m_creature->GetHealth() && done_by != m_creature) - damage = 0; - if (done_by->GetGUID() == MaievGUID) - done_by->AddThreat(m_creature, -(3*(float)damage)/4); // do not let maiev tank him - } - - void SpellHit(Unit *caster, const SpellEntry *spell) - { - if (spell->Id == SPELL_GLAIVE_RETURNS) // Re-equip our warblades! - { - if (!m_creature->GetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID)) - SetEquipmentSlots(false, EQUIP_ID_MAIN_HAND, EQUIP_UNEQUIP, EQUIP_NO_CHANGE); - else - SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_ID_OFF_HAND, EQUIP_NO_CHANGE); - m_creature->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE); - } - } - - void DeleteFromThreatList(uint64 TargetGUID) - { - for(std::list::iterator itr = m_creature->getThreatManager().getThreatList().begin(); itr != m_creature->getThreatManager().getThreatList().end(); ++itr) - { - if ((*itr)->getUnitGuid() == TargetGUID) - { - (*itr)->removeReference(); - break; - } - } - } - - void Talk(uint32 count) - { - Timer[EVENT_TALK_SEQUENCE] = Conversation[count].timer; - - Creature* pCreature = NULL; - if (Conversation[count].pCreature == ILLIDAN_STORMRAGE) - pCreature = m_creature; - else if (Conversation[count].pCreature == AKAMA) - pCreature = (Unit::GetCreature((*m_creature), AkamaGUID)); - else if (Conversation[count].pCreature == MAIEV_SHADOWSONG) - pCreature = (Unit::GetCreature((*m_creature), MaievGUID)); - - if (pCreature) - { - if (Conversation[count].emote) - pCreature->HandleEmoteCommand(Conversation[count].emote); // Make the Creature do some animation! - if (Conversation[count].text) - pCreature->MonsterYell(Conversation[count].text, LANG_UNIVERSAL, 0); // Have the Creature yell out some text - if (Conversation[count].sound) - DoPlaySoundToSet(pCreature, Conversation[count].sound); // Play some sound on the creature - } - } - - void EnterPhase(PhaseIllidan NextPhase); - void CastEyeBlast(); - void SummonFlamesOfAzzinoth(); - void SummonMaiev(); - void HandleTalkSequence(); - void HandleFlightSequence() - { - switch(FlightCount) - { - case 1://lift off - m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF); - m_creature->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); - m_creature->StopMoving(); - m_creature->MonsterYell(SAY_TAKEOFF, LANG_UNIVERSAL, 0); - DoPlaySoundToSet(m_creature, SOUND_TAKEOFF); - Timer[EVENT_FLIGHT_SEQUENCE] = 3000; - break; - case 2://move to center - m_creature->GetMotionMaster()->MovePoint(0, CENTER_X + 5, CENTER_Y, CENTER_Z); //+5, for SPELL_THROW_GLAIVE bug - Timer[EVENT_FLIGHT_SEQUENCE] = 0; - break; - case 3://throw one glaive - { - uint8 i=1; - Creature* Glaive = m_creature->SummonCreature(BLADE_OF_AZZINOTH, GlaivePosition[i].x, GlaivePosition[i].y, GlaivePosition[i].z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); - if (Glaive) - { - GlaiveGUID[i] = Glaive->GetGUID(); - Glaive->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - Glaive->SetDisplayId(11686); - Glaive->setFaction(m_creature->getFaction()); - DoCast(Glaive, SPELL_THROW_GLAIVE2); - } - } - Timer[EVENT_FLIGHT_SEQUENCE] = 700; - break; - case 4://throw another - SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_UNEQUIP, EQUIP_NO_CHANGE); - { - uint8 i=0; - Creature* Glaive = m_creature->SummonCreature(BLADE_OF_AZZINOTH, GlaivePosition[i].x, GlaivePosition[i].y, GlaivePosition[i].z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); - if (Glaive) - { - GlaiveGUID[i] = Glaive->GetGUID(); - Glaive->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - Glaive->SetDisplayId(11686); - Glaive->setFaction(m_creature->getFaction()); - DoCast(Glaive, SPELL_THROW_GLAIVE, true); - } - } - Timer[EVENT_FLIGHT_SEQUENCE] = 5000; - break; - case 5://summon flames - SummonFlamesOfAzzinoth(); - Timer[EVENT_FLIGHT_SEQUENCE] = 3000; - break; - case 6://fly to hover point - m_creature->GetMotionMaster()->MovePoint(0, HoverPosition[HoverPoint].x, HoverPosition[HoverPoint].y, HoverPosition[HoverPoint].z); - Timer[EVENT_FLIGHT_SEQUENCE] = 0; - break; - case 7://return to center - m_creature->GetMotionMaster()->MovePoint(0, CENTER_X, CENTER_Y, CENTER_Z); - Timer[EVENT_FLIGHT_SEQUENCE] = 0; - break; - case 8://glaive return - for(uint8 i = 0; i < 2; ++i) - { - if (GlaiveGUID[i]) - { - Unit* Glaive = Unit::GetUnit((*m_creature), GlaiveGUID[i]); - if (Glaive) - { - Glaive->CastSpell(m_creature, SPELL_GLAIVE_RETURNS, false); // Make it look like the Glaive flies back up to us - Glaive->SetDisplayId(11686); // disappear but not die for now - } - } - } - Timer[EVENT_FLIGHT_SEQUENCE] = 2000; - break; - case 9://land - m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - m_creature->StopMoving(); - m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LAND); - for(uint8 i = 0; i < 2; ++i) - { - if (GlaiveGUID[i]) - { - if (GETUNIT(Glaive, GlaiveGUID[i])) - { - Glaive->SetVisibility(VISIBILITY_OFF); - Glaive->setDeathState(JUST_DIED); // Despawn the Glaive - } - GlaiveGUID[i] = 0; - } - } - Timer[EVENT_FLIGHT_SEQUENCE] = 2000; - break; - case 10://attack - DoResetThreat(); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE); - EnterPhase(PHASE_NORMAL_2); - break; - default: - break; - } - FlightCount++; - } - - void HandleTransformSequence() - { - if (DemonTransformation[TransformCount].unaura) - m_creature->RemoveAurasDueToSpell(DemonTransformation[TransformCount].unaura); - - if (DemonTransformation[TransformCount].aura) - DoCast(m_creature, DemonTransformation[TransformCount].aura, true); - - if (DemonTransformation[TransformCount].displayid) - m_creature->SetDisplayId(DemonTransformation[TransformCount].displayid); // It's morphin time! - - if (DemonTransformation[TransformCount].equip) - { - // Requip warglaives if needed - SetEquipmentSlots(false, EQUIP_ID_MAIN_HAND, EQUIP_ID_OFF_HAND, EQUIP_NO_CHANGE); - m_creature->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE); - } - else - { - // Unequip warglaives if needed - SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_UNEQUIP, EQUIP_NO_CHANGE); - } - - switch(TransformCount) - { - case 2: - DoResetThreat(); - break; - case 4: - EnterPhase(PHASE_DEMON); - break; - case 7: - DoResetThreat(); - break; - case 9: - if (MaievGUID) - EnterPhase(PHASE_NORMAL_MAIEV); // Depending on whether we summoned Maiev, we switch to either phase 5 or 3 - else - EnterPhase(PHASE_NORMAL_2); - break; - default: - break; - } - if (Phase == PHASE_TRANSFORM_SEQUENCE) - Timer[EVENT_TRANSFORM_SEQUENCE] = DemonTransformation[TransformCount].timer; - TransformCount++; - } - - void UpdateAI(const uint32 diff) - { - if ((!UpdateVictim()) && Phase < PHASE_TALK_SEQUENCE) - return; - - Event = EVENT_NULL; - for(uint32 i = 1; i <= MaxTimer[Phase]; ++i) - { - if (Timer[i]) // Event is enabled - if (Timer[i] <= diff) - { - if (!Event) // No event with higher priority - Event = (EventIllidan)i; - } - else Timer[i] -= diff; - } - - switch(Phase) - { - case PHASE_NORMAL: - if (HPPCT(m_creature) < 65) - EnterPhase(PHASE_FLIGHT_SEQUENCE); - break; - - case PHASE_NORMAL_2: - if (HPPCT(m_creature) < 30) - EnterPhase(PHASE_TALK_SEQUENCE); - break; - - case PHASE_NORMAL_MAIEV: - if (HPPCT(m_creature) < 1) - EnterPhase(PHASE_TALK_SEQUENCE); - break; - - case PHASE_TALK_SEQUENCE: - if (Event == EVENT_TALK_SEQUENCE) - HandleTalkSequence(); - break; - - case PHASE_FLIGHT_SEQUENCE: - if (Event == EVENT_FLIGHT_SEQUENCE) - HandleFlightSequence(); - break; - - case PHASE_TRANSFORM_SEQUENCE: - if (Event == EVENT_TRANSFORM_SEQUENCE) - HandleTransformSequence(); - break; - } - - if (m_creature->IsNonMeleeSpellCasted(false)) - return; - - if (Phase == PHASE_NORMAL || Phase == PHASE_NORMAL_2 || Phase == PHASE_NORMAL_MAIEV && !m_creature->HasAura(SPELL_CAGED)) - { - switch(Event) - { - //PHASE_NORMAL - case EVENT_BERSERK: - m_creature->MonsterYell(SAY_ENRAGE, LANG_UNIVERSAL, 0); - DoPlaySoundToSet(m_creature, SOUND_ENRAGE); - DoCast(m_creature, SPELL_BERSERK, true); - Timer[EVENT_BERSERK] = 5000;//The buff actually lasts forever. - break; - - case EVENT_TAUNT: - { - uint32 random = rand()%4; - char* yell = RandomTaunts[random].text; - uint32 soundid = RandomTaunts[random].sound; - if (yell) - m_creature->MonsterYell(yell, LANG_UNIVERSAL, 0); - if (soundid) - DoPlaySoundToSet(m_creature, soundid); - } - Timer[EVENT_TAUNT] = 25000 + rand()%10000; - break; - - case EVENT_SHEAR: - DoCast(m_creature->getVictim(), SPELL_SHEAR); - Timer[EVENT_SHEAR] = 25000 + (rand()%16 * 1000); - break; - - case EVENT_FLAME_CRASH: - DoCast(m_creature->getVictim(), SPELL_FLAME_CRASH); - Timer[EVENT_FLAME_CRASH] = 30000 + rand()%10000; - break; - - case EVENT_PARASITIC_SHADOWFIEND: - { - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 200, true)) - m_creature->CastSpell(target, SPELL_PARASITIC_SHADOWFIEND, true); - Timer[EVENT_PARASITIC_SHADOWFIEND] = 35000 + rand()%10000; - }break; - - case EVENT_PARASITE_CHECK: - Timer[EVENT_PARASITE_CHECK] = 0; - break; - - case EVENT_DRAW_SOUL: - DoCast(m_creature->getVictim(), SPELL_DRAW_SOUL); - Timer[EVENT_DRAW_SOUL] = 50000 + rand()%10000; - break; - - //PHASE_NORMAL_2 - case EVENT_AGONIZING_FLAMES: - DoCast(SelectUnit(SELECT_TARGET_RANDOM,0), SPELL_AGONIZING_FLAMES); - Timer[EVENT_AGONIZING_FLAMES] = 0; - break; - - case EVENT_TRANSFORM_NORMAL: - EnterPhase(PHASE_TRANSFORM_SEQUENCE); - break; - - //PHASE_NORMAL_MAIEV - case EVENT_ENRAGE: - DoCast(m_creature, SPELL_ENRAGE); - Timer[EVENT_ENRAGE] = 0; - break; - - default: - break; - } - DoMeleeAttackIfReady(); - } - - if (Phase == PHASE_FLIGHT) - { - switch(Event) - { - case EVENT_FIREBALL: - DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_FIREBALL); - Timer[EVENT_FIREBALL] = 3000; - break; - - case EVENT_DARK_BARRAGE: - DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_DARK_BARRAGE); - Timer[EVENT_DARK_BARRAGE] = 0; - break; - - case EVENT_EYE_BLAST: - CastEyeBlast(); - Timer[EVENT_EYE_BLAST] = 0; - break; - - case EVENT_MOVE_POINT: - Phase = PHASE_FLIGHT_SEQUENCE; - Timer[EVENT_FLIGHT_SEQUENCE] = 0;//do not start Event when changing hover point - HoverPoint += (rand()%3 + 1); - if (HoverPoint > 3) - HoverPoint -= 4; - m_creature->GetMotionMaster()->MovePoint(0, HoverPosition[HoverPoint].x, HoverPosition[HoverPoint].y, HoverPosition[HoverPoint].z); - break; - - default: - break; - } - } - - if (Phase == PHASE_DEMON) - { - switch(Event) - { - case EVENT_SHADOW_BLAST: - m_creature->GetMotionMaster()->Clear(false); - if (!m_creature->IsWithinDistInMap(m_creature->getVictim(), 50)||!m_creature->IsWithinLOSInMap(m_creature->getVictim())) - m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim(), 30); - else - m_creature->GetMotionMaster()->MoveIdle(); - DoCast(m_creature->getVictim(), SPELL_SHADOW_BLAST); - Timer[EVENT_SHADOW_BLAST] = 4000; - break; - case EVENT_SHADOWDEMON: - DoCast(m_creature, SPELL_SUMMON_SHADOWDEMON); - Timer[EVENT_SHADOWDEMON] = 0; - Timer[EVENT_FLAME_BURST] += 10000; - break; - case EVENT_FLAME_BURST: - DoCast(m_creature, SPELL_FLAME_BURST); - Timer[EVENT_FLAME_BURST] = 15000; - break; - case EVENT_TRANSFORM_DEMON: - EnterPhase(PHASE_TRANSFORM_SEQUENCE); - break; - default: - break; - } - } - } -}; - -/********************************** End of Illidan AI ******************************************/ - -struct TRINITY_DLL_DECL flame_of_azzinothAI : public ScriptedAI -{ - flame_of_azzinothAI(Creature *c) : ScriptedAI(c) {} - - uint32 FlameBlastTimer; - uint32 CheckTimer; - uint64 GlaiveGUID; - - void Reset() - { - FlameBlastTimer = 15000; - CheckTimer = 5000; - GlaiveGUID = 0; - } - - void EnterCombat(Unit *who) {DoZoneInCombat();} - - void ChargeCheck() - { - Unit* target = SelectTarget(SELECT_TARGET_FARTHEST, 0, 200, false); - if (target && (!m_creature->IsWithinCombatRange(target, FLAME_CHARGE_DISTANCE))) - { - m_creature->AddThreat(target, 5000000.0f); - AttackStart(target); - DoCast(target, SPELL_CHARGE); - m_creature->MonsterTextEmote("sets its gaze on $N!", target->GetGUID()); - } - } - - void EnrageCheck() - { - if (GETUNIT(Glaive, GlaiveGUID)) - { - if (!m_creature->IsWithinDistInMap(Glaive, FLAME_ENRAGE_DISTANCE)) - { - Glaive->InterruptNonMeleeSpells(true); - DoCast(m_creature, SPELL_FLAME_ENRAGE, true); - DoResetThreat(); - Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (target && target->isAlive()) - { - m_creature->AddThreat(m_creature->getVictim(), 5000000.0f); - AttackStart(m_creature->getVictim()); - } - } - else if (!m_creature->HasAura(SPELL_AZZINOTH_CHANNEL)) - { - Glaive->CastSpell(m_creature, SPELL_AZZINOTH_CHANNEL, false); - m_creature->RemoveAurasDueToSpell(SPELL_FLAME_ENRAGE); - } - } - } - - void SetGlaiveGUID(uint64 guid){ GlaiveGUID = guid; } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (FlameBlastTimer < diff) - { - DoCast(m_creature->getVictim(), SPELL_BLAZE_SUMMON, true); //appear at victim - DoCast(m_creature->getVictim(), SPELL_FLAME_BLAST); - FlameBlastTimer = 15000; //10000 is official-like? - DoZoneInCombat(); //in case someone is revived - }else FlameBlastTimer -= diff; - - if (CheckTimer < diff) - { - ChargeCheck(); - EnrageCheck(); - CheckTimer = 1000; - }else CheckTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - - - -/******* Functions and vars for Akama's AI ******/ -struct TRINITY_DLL_DECL npc_akama_illidanAI : public ScriptedAI -{ - npc_akama_illidanAI(Creature* c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - PhaseAkama Phase; - bool Event; - uint32 Timer; - - uint64 IllidanGUID; - uint64 ChannelGUID; - uint64 SpiritGUID[2]; - uint64 GateGUID; - uint64 DoorGUID[2]; - - uint32 ChannelCount; - uint32 WalkCount; - uint32 TalkCount; - - void Reset() - { - if (pInstance) - { - pInstance->SetData(DATA_ILLIDANSTORMRAGEEVENT, NOT_STARTED); - - IllidanGUID = pInstance->GetData64(DATA_ILLIDANSTORMRAGE); - GateGUID = pInstance->GetData64(DATA_GAMEOBJECT_ILLIDAN_GATE); - DoorGUID[0] = pInstance->GetData64(DATA_GAMEOBJECT_ILLIDAN_DOOR_R); - DoorGUID[1] = pInstance->GetData64(DATA_GAMEOBJECT_ILLIDAN_DOOR_L); - - pInstance->HandleGameObject(GateGUID, false); - - for(uint8 i = 0; i < 2; ++i) - pInstance->HandleGameObject(DoorGUID[i], false); - - } - else - { - IllidanGUID = 0; - GateGUID = 0; - DoorGUID[0] = 0; - DoorGUID[1] = 0; - } - - ChannelGUID = 0; - SpiritGUID[0] = 0; - SpiritGUID[1] = 0; - - Phase = PHASE_AKAMA_NULL; - Timer = 0; - - ChannelCount = 0; - WalkCount = 0; - TalkCount = 0; - - KillAllElites(); - - m_creature->SetUInt32Value(UNIT_NPC_FLAGS, 0); // Database sometimes has strange values.. - m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - m_creature->setActive(false); - } - - // Do not call reset in Akama's evade mode, as this will stop him from summoning minions after he kills the first bit - void EnterEvadeMode() - { - m_creature->RemoveAllAuras(); - m_creature->DeleteThreatList(); - m_creature->CombatStop(true); - } - - void EnterCombat(Unit *who) {} - void MoveInLineOfSight(Unit* who) {} - - void MovementInform(uint32 MovementType, uint32 Data) {Timer = 1;} - - void DamageTaken(Unit *done_by, uint32 &damage) - { - if (damage > m_creature->GetHealth() || done_by->GetGUID() != IllidanGUID) - damage = 0; - } - - void KillAllElites() - { - std::list& threatList = m_creature->getThreatManager().getThreatList(); - std::vector eliteList; - for(std::list::iterator itr = threatList.begin(); itr != threatList.end(); ++itr) - { - Unit* pUnit = Unit::GetUnit((*m_creature), (*itr)->getUnitGuid()); - if (pUnit && pUnit->GetEntry() == ILLIDARI_ELITE) - eliteList.push_back(pUnit); - } - for(std::vector::iterator itr = eliteList.begin(); itr != eliteList.end(); ++itr) - (*itr)->setDeathState(JUST_DIED); - EnterEvadeMode(); - } - - void BeginTalk() - { - if (!pInstance) - return; - - pInstance->SetData(DATA_ILLIDANSTORMRAGEEVENT, IN_PROGRESS); - - for(uint8 i = 0; i < 2; ++i) - pInstance->HandleGameObject(DoorGUID[i], false); - - if (GETCRE(Illidan, IllidanGUID)) - { - Illidan->RemoveAurasDueToSpell(SPELL_KNEEL); - m_creature->SetInFront(Illidan); - Illidan->SetInFront(m_creature); - m_creature->GetMotionMaster()->MoveIdle(); - Illidan->GetMotionMaster()->MoveIdle(); - CAST_AI(boss_illidan_stormrageAI, Illidan->AI())->AkamaGUID = m_creature->GetGUID(); - CAST_AI(boss_illidan_stormrageAI, Illidan->AI())->EnterPhase(PHASE_TALK_SEQUENCE); - } - } - - void BeginChannel() - { - m_creature->setActive(true); - - float x, y, z; - if (GETGO(Gate, GateGUID)) - Gate->GetPosition(x, y, z); - else - return;//if door not spawned, don't crash server - - if (Creature* Channel = m_creature->SummonCreature(ILLIDAN_DOOR_TRIGGER, x, y, z+5, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 360000)) - { - ChannelGUID = Channel->GetGUID(); - Channel->SetDisplayId(11686); // Invisible but spell visuals can still be seen. - m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - DoCast(Channel, SPELL_AKAMA_DOOR_FAIL); - } - - for(uint8 i = 0; i < 2; ++i) - if (Creature* Spirit = m_creature->SummonCreature(i ? SPIRIT_OF_OLUM : SPIRIT_OF_UDALO, SpiritSpawns[i].x, SpiritSpawns[i].y, SpiritSpawns[i].z, 0, TEMPSUMMON_TIMED_DESPAWN, 20000)) - { - Spirit->SetVisibility(VISIBILITY_OFF); - SpiritGUID[i] = Spirit->GetGUID(); - } - } - - void BeginWalk() - { - m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - m_creature->SetSpeed(MOVE_RUN, 1.0f); - m_creature->GetMotionMaster()->MovePoint(0, AkamaWP[WalkCount].x, AkamaWP[WalkCount].y, AkamaWP[WalkCount].z); - } - - void EnterPhase(PhaseAkama NextPhase) - { - if (!pInstance) return; - switch(NextPhase) - { - case PHASE_CHANNEL: - BeginChannel(); - Timer = 5000; - ChannelCount = 0; - break; - case PHASE_WALK: - if (Phase == PHASE_CHANNEL) - WalkCount = 0; - else if (Phase == PHASE_TALK) - { - if (GETCRE(Illidan, IllidanGUID)) - CAST_AI(boss_illidan_stormrageAI, Illidan->AI())->DeleteFromThreatList(m_creature->GetGUID()); - EnterEvadeMode(); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - WalkCount++; - } - BeginWalk(); - Timer = 0; - break; - case PHASE_TALK: - if (Phase == PHASE_WALK) - { - BeginTalk(); - Timer = 0; - } - else if (Phase == PHASE_FIGHT_ILLIDAN) - { - Timer = 1; - TalkCount = 0; - } - break; - case PHASE_FIGHT_ILLIDAN: - if (GETUNIT(Illidan, IllidanGUID)) - { - m_creature->AddThreat(Illidan, 10000000.0f); - m_creature->GetMotionMaster()->MoveChase(Illidan); - } - Timer = 30000; //chain lightning - break; - case PHASE_FIGHT_MINIONS: - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - Timer = 10000 + rand()%6000;//summon minion - break; - case PHASE_RETURN: - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - KillAllElites(); - WalkCount = 0; - BeginWalk(); - Timer = 1; - break; - default: - break; - } - Phase = NextPhase; - Event = false; - } - - void HandleTalkSequence() - { - switch(TalkCount) - { - case 0: - if (GETCRE(Illidan, IllidanGUID)) - { - CAST_AI(boss_illidan_stormrageAI, Illidan->AI())->Timer[EVENT_TAUNT] += 30000; - Illidan->MonsterYell(SAY_AKAMA_MINION, LANG_UNIVERSAL, 0); - DoPlaySoundToSet(Illidan, SOUND_AKAMA_MINION); - } - Timer = 8000; - break; - case 1: - m_creature->MonsterYell(SAY_AKAMA_LEAVE, LANG_UNIVERSAL, 0); - DoPlaySoundToSet(m_creature, SOUND_AKAMA_LEAVE); - Timer = 3000; - break; - case 2: - EnterPhase(PHASE_WALK); - break; - } - TalkCount++; - } - - void HandleChannelSequence() - { - Unit* Channel, *Spirit[2]; - if (ChannelCount <= 5) - { - Channel = Unit::GetUnit((*m_creature), ChannelGUID); - Spirit[0] = Unit::GetUnit((*m_creature), SpiritGUID[0]); - Spirit[1] = Unit::GetUnit((*m_creature), SpiritGUID[1]); - if (!Channel || !Spirit[0] || !Spirit[1]) - return; - } - - switch(ChannelCount) - { - case 0: // channel failed - m_creature->InterruptNonMeleeSpells(true); - Timer = 2000; - break; - case 1: // spirit appear - Spirit[0]->SetVisibility(VISIBILITY_ON); - Spirit[1]->SetVisibility(VISIBILITY_ON); - Timer = 2000; - break; - case 2: // spirit help - DoCast(Channel, SPELL_AKAMA_DOOR_CHANNEL); - Spirit[0]->CastSpell(Channel, SPELL_DEATHSWORN_DOOR_CHANNEL,false); - Spirit[1]->CastSpell(Channel, SPELL_DEATHSWORN_DOOR_CHANNEL,false); - Timer = 5000; - break; - case 3: //open the gate - m_creature->InterruptNonMeleeSpells(true); - Spirit[0]->InterruptNonMeleeSpells(true); - Spirit[1]->InterruptNonMeleeSpells(true); - pInstance->HandleGameObject(GateGUID, true); - Timer = 2000; - break; - case 4: - m_creature->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE); - Timer = 2000; - break; - case 5: - m_creature->MonsterYell(SAY_AKAMA_BEWARE, LANG_UNIVERSAL, 0); - DoPlaySoundToSet(m_creature, SOUND_AKAMA_BEWARE); - Channel->setDeathState(JUST_DIED); - Spirit[0]->SetVisibility(VISIBILITY_OFF); - Spirit[1]->SetVisibility(VISIBILITY_OFF); - Timer = 3000; - break; - case 6: - EnterPhase(PHASE_WALK); - break; - default: - break; - } - ChannelCount++; - } - - void HandleWalkSequence() - { - switch(WalkCount) - { - case 6: - for(uint8 i = 0; i < 2; ++i) - pInstance->HandleGameObject(DoorGUID[i], true); - break; - case 8: - if (Phase == PHASE_WALK) - EnterPhase(PHASE_TALK); - else - EnterPhase(PHASE_FIGHT_ILLIDAN); - break; - case 12: - EnterPhase(PHASE_FIGHT_MINIONS); - break; - } - - if (Phase == PHASE_WALK) - { - Timer = 0; - WalkCount++; - m_creature->GetMotionMaster()->MovePoint(WalkCount, AkamaWP[WalkCount].x, AkamaWP[WalkCount].y, AkamaWP[WalkCount].z); - } - } - - void UpdateAI(const uint32 diff) - { - Event = false; - if (Timer) - { - if (Timer <= diff) - Event = true; - else Timer -= diff; - } - - if (Event) - { - switch(Phase) - { - case PHASE_CHANNEL: - HandleChannelSequence(); - break; - case PHASE_TALK: - HandleTalkSequence(); - break; - case PHASE_WALK: - case PHASE_RETURN: - HandleWalkSequence(); - break; - case PHASE_FIGHT_ILLIDAN: - { - GETUNIT(Illidan, IllidanGUID); - if (Illidan && HPPCT(Illidan) < 90) - EnterPhase(PHASE_TALK); - else - { - DoCast(m_creature->getVictim(), SPELL_CHAIN_LIGHTNING); - Timer = 30000; - } - }break; - case PHASE_FIGHT_MINIONS: - { - float x, y, z; - m_creature->GetPosition(x, y, z); - Creature* Elite = m_creature->SummonCreature(ILLIDARI_ELITE, x+rand()%10, y+rand()%10, z, 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 30000); - //Creature* Elite = m_creature->SummonCreature(ILLIDARI_ELITE, x, y, z, 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 30000); - if (Elite) - { - Elite->AI()->AttackStart(m_creature); - Elite->AddThreat(m_creature, 1000000.0f); - AttackStart(Elite); - m_creature->AddThreat(Elite, 1000000.0f); - } - Timer = 10000 + rand()%6000; - GETUNIT(Illidan, IllidanGUID); - if (Illidan && HPPCT(Illidan) < 10) - EnterPhase(PHASE_RETURN); - } - break; - default: - break; - } - } - - if (!UpdateVictim()) - return; - - if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 20) - DoCast(m_creature, SPELL_HEALING_POTION); - - DoMeleeAttackIfReady(); - } -}; - - -struct TRINITY_DLL_DECL boss_maievAI : public ScriptedAI -{ - boss_maievAI(Creature *c) : ScriptedAI(c) {}; - - uint64 IllidanGUID; - - PhaseIllidan Phase; - EventMaiev Event; - uint32 Timer[5]; - uint32 MaxTimer; - - void Reset() - { - MaxTimer = 0; - Phase = PHASE_NORMAL_MAIEV; - IllidanGUID = 0; - Timer[EVENT_MAIEV_STEALTH] = 0; - Timer[EVENT_MAIEV_TAUNT] = 22000 + rand()%21 * 1000; - Timer[EVENT_MAIEV_SHADOW_STRIKE] = 30000; - SetEquipmentSlots(false, 44850, EQUIP_UNEQUIP, EQUIP_NO_CHANGE); - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 2, 45738); - } - - void EnterCombat(Unit *who) {} - void MoveInLineOfSight(Unit *who) {} - void EnterEvadeMode() {} - void GetIllidanGUID(uint64 guid) { IllidanGUID = guid; } - - void DamageTaken(Unit *done_by, uint32 &damage) - { - if (done_by->GetGUID() != IllidanGUID) - damage = 0; - else - { - GETUNIT(Illidan, IllidanGUID); - if (Illidan && Illidan->getVictim() == m_creature) - damage = m_creature->GetMaxHealth()/10; - if (damage >= m_creature->GetHealth()) - damage = 0; - } - } - - void AttackStart(Unit *who) - { - if (!who || Timer[EVENT_MAIEV_STEALTH]) - return; - - if (Phase == PHASE_TALK_SEQUENCE) - AttackStartNoMove(who); - else if (Phase == PHASE_DEMON || Phase == PHASE_TRANSFORM_SEQUENCE) - { - GETUNIT(Illidan, IllidanGUID); - if (Illidan && m_creature->IsWithinDistInMap(Illidan, 25)) - BlinkToPlayer();//Do not let dread aura hurt her. - AttackStartNoMove(who); - } - else - ScriptedAI::AttackStart(who); - } - - void DoAction(const int32 param) - { - if (param > PHASE_ILLIDAN_NULL && param < PHASE_ILLIDAN_MAX) - EnterPhase(PhaseIllidan(param)); - } - - void EnterPhase(PhaseIllidan NextPhase)//This is in fact Illidan's phase. - { - switch(NextPhase) - { - case PHASE_TALK_SEQUENCE: - if (Timer[EVENT_MAIEV_STEALTH]) - { - m_creature->SetHealth(m_creature->GetMaxHealth()); - m_creature->SetVisibility(VISIBILITY_ON); - Timer[EVENT_MAIEV_STEALTH] = 0; - } - m_creature->InterruptNonMeleeSpells(false); - m_creature->GetMotionMaster()->Clear(false); - m_creature->AttackStop(); - m_creature->SetUInt64Value(UNIT_FIELD_TARGET, IllidanGUID); - MaxTimer = 0; - break; - case PHASE_TRANSFORM_SEQUENCE: - MaxTimer = 4; - Timer[EVENT_MAIEV_TAUNT] += 10000; - Timer[EVENT_MAIEV_THROW_DAGGER] = 2000; - break; - case PHASE_DEMON: - break; - case PHASE_NORMAL_MAIEV: - MaxTimer = 4; - Timer[EVENT_MAIEV_TAUNT] += 10000; - Timer[EVENT_MAIEV_TRAP] = 22000; - break; - default: - break; - } - if (Timer[EVENT_MAIEV_STEALTH]) - MaxTimer = 1; - Phase = NextPhase; - } - - void BlinkTo(float x, float y, float z) - { - m_creature->AttackStop(); - m_creature->InterruptNonMeleeSpells(false); - m_creature->GetMotionMaster()->Clear(false); - DoTeleportTo(x, y, z); - DoCast(m_creature, SPELL_TELEPORT_VISUAL, true); - } - - void BlinkToPlayer() - { - if (GETCRE(Illidan, IllidanGUID)) - { - Unit* target = CAST_AI(boss_illidan_stormrageAI, Illidan->AI())->SelectUnit(SELECT_TARGET_RANDOM, 0); - - if (!target || !m_creature->IsWithinDistInMap(target, 80) || Illidan->IsWithinDistInMap(target, 20)) - { - uint8 pos = rand()%4; - BlinkTo(HoverPosition[pos].x, HoverPosition[pos].y, HoverPosition[pos].z); - } - else - { - float x, y, z; - target->GetPosition(x, y, z); - BlinkTo(x, y, z); - } - } - } - - void UpdateAI(const uint32 diff) - { - if ((!UpdateVictim()) - && !Timer[EVENT_MAIEV_STEALTH]) - return; - - Event = EVENT_MAIEV_NULL; - for(uint8 i = 1; i <= MaxTimer; ++i) - if (Timer[i]) - { - if (Timer[i] <= diff) - Event = (EventMaiev)i; - else Timer[i] -= diff; - } - - switch(Event) - { - case EVENT_MAIEV_STEALTH: - { - m_creature->SetHealth(m_creature->GetMaxHealth()); - m_creature->SetVisibility(VISIBILITY_ON); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - Timer[EVENT_MAIEV_STEALTH] = 0; - BlinkToPlayer(); - EnterPhase(Phase); - }break; - case EVENT_MAIEV_TAUNT: - { - uint32 random = rand()%4; - char* text = MaievTaunts[random].text; - uint32 sound = MaievTaunts[random].sound; - m_creature->MonsterYell(text, LANG_UNIVERSAL, 0); - DoPlaySoundToSet(m_creature, sound); - Timer[EVENT_MAIEV_TAUNT] = 22000 + rand()%21 * 1000; - }break; - case EVENT_MAIEV_SHADOW_STRIKE: - DoCast(m_creature->getVictim(), SPELL_SHADOW_STRIKE); - Timer[EVENT_MAIEV_SHADOW_STRIKE] = 60000; - break; - case EVENT_MAIEV_TRAP: - if (Phase == PHASE_NORMAL_MAIEV) - { - BlinkToPlayer(); - DoCast(m_creature, SPELL_CAGE_TRAP_SUMMON); - Timer[EVENT_MAIEV_TRAP] = 22000; - } - else - { - if (!m_creature->IsWithinDistInMap(m_creature->getVictim(), 40)) - m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim(), 30); - DoCast(m_creature->getVictim(), SPELL_THROW_DAGGER); - Timer[EVENT_MAIEV_THROW_DAGGER] = 2000; - } - break; - default: - break; - } - - if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 50) - { - m_creature->SetVisibility(VISIBILITY_OFF); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - if (GETCRE(Illidan, IllidanGUID)) - CAST_AI(boss_illidan_stormrageAI, Illidan->AI())->DeleteFromThreatList(m_creature->GetGUID()); - m_creature->AttackStop(); - Timer[EVENT_MAIEV_STEALTH] = 60000; //reappear after 1 minute - MaxTimer = 1; - } - - if (Phase == PHASE_NORMAL_MAIEV) - DoMeleeAttackIfReady(); - } -}; - - -bool GossipSelect_npc_akama_at_illidan(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - if (uiAction == GOSSIP_ACTION_INFO_DEF) // Time to begin the Event - { - pPlayer->CLOSE_GOSSIP_MENU(); - CAST_AI(npc_akama_illidanAI, pCreature->AI())->EnterPhase(PHASE_CHANNEL); - } - return true; -} - -bool GossipHello_npc_akama_at_illidan(Player* pPlayer, Creature* pCreature) -{ - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - pPlayer->SEND_GOSSIP_MENU(10465, pCreature->GetGUID()); - - return true; -} - -struct TRINITY_DLL_DECL cage_trap_triggerAI : public ScriptedAI -{ - cage_trap_triggerAI(Creature *c) : ScriptedAI(c) {} - - uint64 IllidanGUID; - uint32 DespawnTimer; - - bool Active; - bool SummonedBeams; - - void Reset() - { - IllidanGUID = 0; - - Active = false; - SummonedBeams = false; - - DespawnTimer = 0; - - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - } - - void EnterCombat(Unit *who){} - - void MoveInLineOfSight(Unit *who) - { - if (!Active) - return; - - if (who && (who->GetTypeId() != TYPEID_PLAYER)) - { - if (who->GetEntry() == ILLIDAN_STORMRAGE) // Check if who is Illidan - { - if (!IllidanGUID && m_creature->IsWithinDistInMap(who, 3) && (!who->HasAura(SPELL_CAGED))) - { - IllidanGUID = who->GetGUID(); - who->CastSpell(who, SPELL_CAGED, true); - DespawnTimer = 5000; - if (who->HasAura(SPELL_ENRAGE)) - who->RemoveAurasDueToSpell(SPELL_ENRAGE); // Dispel his enrage - //if (GameObject* CageTrap = pInstance->instance->GetGameObject(pInstance->GetData64(CageTrapGUID))) - // CageTrap->SetLootState(GO_JUST_DEACTIVATED); - } - } - } - } - - void UpdateAI(const uint32 diff) - { - if (DespawnTimer) - if (DespawnTimer < diff) - m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - else DespawnTimer -= diff; - - //if (IllidanGUID && !SummonedBeams) - //{ - // if (Unit* Illidan = Unit::GetUnit(*m_creature, IllidanGUID) - // { - // //TODO: Find proper spells and properly apply 'caged' Illidan effect - // } - //} - } -}; - -bool GOHello_cage_trap(Player* pPlayer, GameObject* pGo) -{ - float x, y, z; - pPlayer->GetPosition(x, y, z); - - // Grid search for nearest live Creature of entry 23304 within 10 yards - if (Creature* pTrigger = pGo->FindNearestCreature(23304, 10.0f)) - CAST_AI(cage_trap_triggerAI, pTrigger->AI())->Active = true; - pGo->SetGoState(GO_STATE_ACTIVE); - return true; -} - -struct TRINITY_DLL_DECL shadow_demonAI : public ScriptedAI -{ - shadow_demonAI(Creature *c) : ScriptedAI(c) {} - - uint64 TargetGUID; - - void EnterCombat(Unit *who) {DoZoneInCombat();} - - void Reset() - { - TargetGUID = 0; - m_creature->CastSpell(m_creature, SPELL_SHADOW_DEMON_PASSIVE, true); - } - - void JustDied(Unit *killer) - { - if (Unit* target = Unit::GetUnit((*m_creature), TargetGUID)) - target->RemoveAurasDueToSpell(SPELL_PARALYZE); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) return; - - if (m_creature->getVictim()->GetTypeId() != TYPEID_PLAYER) return; // Only cast the below on players. - - if (!m_creature->getVictim()->HasAura(SPELL_PARALYZE)) - { - TargetGUID = m_creature->getVictim()->GetGUID(); - m_creature->AddThreat(m_creature->getVictim(), 10000000.0f); - DoCast(m_creature->getVictim(), SPELL_PURPLE_BEAM, true); - DoCast(m_creature->getVictim(), SPELL_PARALYZE, true); - } - // Kill our target if we're very close. - if (m_creature->IsWithinDistInMap(m_creature->getVictim(), 3)) - DoCast(m_creature->getVictim(), SPELL_CONSUME_SOUL); - } -}; - -// Shadowfiends interact with Illidan, setting more targets in Illidan's hashmap -struct TRINITY_DLL_DECL mob_parasitic_shadowfiendAI : public ScriptedAI -{ - mob_parasitic_shadowfiendAI(Creature* c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - uint64 IllidanGUID; - uint32 CheckTimer; - - void Reset() - { - if (pInstance) - IllidanGUID = pInstance->GetData64(DATA_ILLIDANSTORMRAGE); - else - IllidanGUID = 0; - - CheckTimer = 5000; - DoCast(m_creature, SPELL_SHADOWFIEND_PASSIVE, true); - } - - void EnterCombat(Unit* who) { DoZoneInCombat(); } - - void DoMeleeAttackIfReady() - { - if (m_creature->isAttackReady() && m_creature->IsWithinMeleeRange(m_creature->getVictim())) - { - if (!m_creature->getVictim()->HasAura(SPELL_PARASITIC_SHADOWFIEND) - && !m_creature->getVictim()->HasAura(SPELL_PARASITIC_SHADOWFIEND2)) - { - if (Creature* illidan = Unit::GetCreature((*m_creature),IllidanGUID))//summon only in 1. phase - if (CAST_AI(boss_illidan_stormrageAI, illidan->AI())->Phase == PHASE_NORMAL) - m_creature->CastSpell(m_creature->getVictim(), SPELL_PARASITIC_SHADOWFIEND2, true, 0, 0, IllidanGUID); //do not stack - } - m_creature->AttackerStateUpdate(m_creature->getVictim()); - m_creature->resetAttackTimer(); - } - } - - void UpdateAI(const uint32 diff) - { - if (!m_creature->getVictim()) - { - if (Unit *target = SelectTarget(SELECT_TARGET_RANDOM, 0, 999, true)) - AttackStart(target); - else - { - m_creature->SetVisibility(VISIBILITY_OFF); - m_creature->setDeathState(JUST_DIED); - return; - } - } - - if (CheckTimer < diff) - { - GETUNIT(Illidan, IllidanGUID); - if (!Illidan || CAST_CRE(Illidan)->IsInEvadeMode()) - { - m_creature->SetVisibility(VISIBILITY_OFF); - m_creature->setDeathState(JUST_DIED); - return; - }else CheckTimer = 5000; - }else CheckTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -struct TRINITY_DLL_DECL blade_of_azzinothAI : public NullCreatureAI -{ - blade_of_azzinothAI(Creature* c) : NullCreatureAI(c) {} - - void SpellHit(Unit *caster, const SpellEntry *spell) - { - if (spell->Id == SPELL_THROW_GLAIVE2 || spell->Id == SPELL_THROW_GLAIVE) - me->SetDisplayId(21431);//appear when hit by Illidan's glaive - } -}; - -void boss_illidan_stormrageAI::Reset() -{ - if (pInstance) - pInstance->SetData(DATA_ILLIDANSTORMRAGEEVENT, NOT_STARTED); - - if (AkamaGUID) - { - if (GETCRE(Akama, AkamaGUID)) - { - if (!Akama->isAlive()) - Akama->Respawn(); - else - { - CAST_AI(npc_akama_illidanAI, Akama->AI())->EnterEvadeMode(); - Akama->GetMotionMaster()->MoveTargetedHome(); - CAST_AI(npc_akama_illidanAI, Akama->AI())->Reset(); - } - } - AkamaGUID = 0; - } - - MaievGUID = 0; - for(uint8 i = 0; i < 2; ++i) - { - FlameGUID[i] = 0; - GlaiveGUID[i] = 0; - } - - Phase = PHASE_ILLIDAN_NULL; - Event = EVENT_NULL; - Timer[EVENT_BERSERK] = 1500000; - - HoverPoint = 0; - TalkCount = 0; - FlightCount = 0; - TransformCount = 0; - - m_creature->SetDisplayId(21135); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_UNEQUIP, EQUIP_NO_CHANGE); - m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - m_creature->setActive(false); - Summons.DespawnAll(); -} - -void boss_illidan_stormrageAI::JustSummoned(Creature* summon) -{ - Summons.Summon(summon); - switch(summon->GetEntry()) - { - case PARASITIC_SHADOWFIEND: - { - if (Phase == PHASE_TALK_SEQUENCE) - { - summon->SetVisibility(VISIBILITY_OFF); - summon->setDeathState(JUST_DIED); - return; - } - Unit *target = SelectTarget(SELECT_TARGET_TOPAGGRO, 0, 999, true); - if (!target || target->HasAura(SPELL_PARASITIC_SHADOWFIEND) - || target->HasAura(SPELL_PARASITIC_SHADOWFIEND2)) - target = SelectTarget(SELECT_TARGET_RANDOM, 0, 999, true); - if (target) - summon->AI()->AttackStart(target); - }break; - case SHADOW_DEMON: - if (Unit *target = SelectTarget(SELECT_TARGET_RANDOM, 0, 999, true)) // only on players. - { - summon->AddThreat(target, 5000000.0f); - summon->AI()->AttackStart(target); - }break; - case MAIEV_SHADOWSONG: - { - summon->SetVisibility(VISIBILITY_OFF); // Leave her invisible until she has to talk - summon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - MaievGUID = summon->GetGUID(); - CAST_AI(boss_maievAI, summon->AI())->GetIllidanGUID(m_creature->GetGUID()); - summon->AI()->DoAction(PHASE_TALK_SEQUENCE); - }break; - case FLAME_OF_AZZINOTH: - { - summon->AI()->AttackStart(summon->SelectNearestTarget(999)); - }break; - default: - break; - } -} - -void boss_illidan_stormrageAI::HandleTalkSequence() -{ - switch(TalkCount) - { - case 0: - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - break; - case 8: - // Equip our warglaives! - SetEquipmentSlots(false, EQUIP_ID_MAIN_HAND, EQUIP_ID_OFF_HAND, EQUIP_NO_CHANGE); - m_creature->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE); - m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - break; - case 9: - if (GETCRE(Akama, AkamaGUID)) - { - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE); - m_creature->AddThreat(Akama, 100.0f); - CAST_AI(npc_akama_illidanAI, Akama->AI())->EnterPhase(PHASE_FIGHT_ILLIDAN); - EnterPhase(PHASE_NORMAL); - } - break; - case 10: - SummonMaiev(); - break; - case 11: - if (GETUNIT(Maiev, MaievGUID)) - { - Maiev->SetVisibility(VISIBILITY_ON); // Maiev is now visible - Maiev->CastSpell(Maiev, SPELL_TELEPORT_VISUAL, true); // onoz she looks like she teleported! - Maiev->SetInFront(m_creature); // Have her face us - m_creature->SetInFront(Maiev); // Face her, so it's not rude =P - Maiev->GetMotionMaster()->MoveIdle(); - m_creature->GetMotionMaster()->MoveIdle(); - }break; - case 14: - if (GETCRE(Maiev, MaievGUID)) - { - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE); - Maiev->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE); - Maiev->AddThreat(m_creature, 10000000.0f); // Have Maiev add a lot of threat on us so that players don't pull her off if they damage her via AOE - Maiev->AI()->AttackStart(m_creature); // Force Maiev to attack us. - EnterPhase(PHASE_NORMAL_MAIEV); - }break; - case 15: - DoCast(m_creature, SPELL_DEATH); // Animate his kneeling + stun him - Summons.DespawnAll(); - break; - case 17: - if (GETUNIT(Akama, AkamaGUID)) - { - if (!m_creature->IsWithinDistInMap(Akama, 15)) - { - float x, y, z; - m_creature->GetPosition(x, y, z); - x += 10; y += 10; - Akama->GetMotionMaster()->Clear(false); - //Akama->GetMotionMaster()->MoveIdle(); - Akama->GetMap()->CreatureRelocation(m_creature, x, y, z, 0.0f); - Akama->SendMonsterMove(x, y, z, 0, MOVEMENTFLAG_NONE, 0);//Illidan must not die until Akama arrives. - Akama->GetMotionMaster()->MoveChase(m_creature); - } - } - break; - case 19: // Make Maiev leave - if (GETUNIT(Maiev, MaievGUID)) - { - Maiev->CastSpell(Maiev, SPELL_TELEPORT_VISUAL, true); - Maiev->setDeathState(JUST_DIED); - m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,UNIT_STAND_STATE_DEAD); - } - break; - case 21: // Kill ourself. - m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - break; - default: - break; - } - if (Phase == PHASE_TALK_SEQUENCE) - Talk(TalkCount); // This function does most of the talking - TalkCount++; -} - - -void boss_illidan_stormrageAI::CastEyeBlast() -{ - m_creature->InterruptNonMeleeSpells(false); - - m_creature->MonsterYell(SAY_EYE_BLAST, LANG_UNIVERSAL, 0); - DoPlaySoundToSet(m_creature, SOUND_EYE_BLAST); - - float distx, disty, dist[2]; - for(uint8 i = 0; i < 2; ++i) - { - distx = EyeBlast[i].x - HoverPosition[HoverPoint].x; - disty = EyeBlast[i].y - HoverPosition[HoverPoint].y; - dist[i] = distx * distx + disty * disty; - } - Locations initial = EyeBlast[dist[0] < dist[1] ? 0 : 1]; - for(uint8 i = 0; i < 2; ++i) - { - distx = GlaivePosition[i].x - HoverPosition[HoverPoint].x; - disty = GlaivePosition[i].y - HoverPosition[HoverPoint].y; - dist[i] = distx * distx + disty * disty; - } - Locations final = GlaivePosition[dist[0] < dist[1] ? 0 : 1]; - - final.x = 2 * final.x - initial.x; - final.y = 2 * final.y - initial.y; - - Creature* Trigger = m_creature->SummonTrigger(initial.x, initial.y, initial.z, 0, 13000); - if (!Trigger) return; - - Trigger->SetSpeed(MOVE_WALK, 3); - Trigger->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - Trigger->GetMotionMaster()->MovePoint(0, final.x, final.y, final.z); - - //Trigger->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetUInt64Value(UNIT_FIELD_TARGET, Trigger->GetGUID()); - DoCast(Trigger, SPELL_EYE_BLAST); -} - -void boss_illidan_stormrageAI::SummonFlamesOfAzzinoth() -{ - m_creature->MonsterYell(SAY_SUMMONFLAMES, LANG_UNIVERSAL, 0); - DoPlaySoundToSet(m_creature, SOUND_SUMMONFLAMES); - - for(uint8 i = 0; i < 2; ++i) - { - if (GETUNIT(Glaive, GlaiveGUID[i])) - { - Creature* Flame = m_creature->SummonCreature(FLAME_OF_AZZINOTH, GlaivePosition[i+2].x, GlaivePosition[i+2].y, GlaivePosition[i+2].z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000); - if (Flame) - { - Flame->setFaction(m_creature->getFaction()); // Just in case the database has it as a different faction - Flame->SetMeleeDamageSchool(SPELL_SCHOOL_FIRE); - FlameGUID[i] = Flame->GetGUID(); // Record GUID in order to check if they're dead later on to move to the next phase - CAST_AI(flame_of_azzinothAI, Flame->AI())->SetGlaiveGUID(GlaiveGUID[i]); - Glaive->CastSpell(Flame, SPELL_AZZINOTH_CHANNEL, false); // Glaives do some random Beam type channel on it. - } - } - } -} - -void boss_illidan_stormrageAI::SummonMaiev() -{ - m_creature->CastSpell(m_creature, SPELL_SHADOW_PRISON, true); - m_creature->CastSpell(m_creature, 40403, true); - if (!MaievGUID) // If Maiev cannot be summoned, reset the encounter and post some errors to the console. - { - EnterEvadeMode(); - m_creature->MonsterTextEmote("is unable to summon Maiev Shadowsong and enter Phase 4. Resetting Encounter.", 0); - error_log("SD2 ERROR: Unable to summon Maiev Shadowsong (entry: 23197). Check your database to see if you have the proper SQL for Maiev Shadowsong (entry: 23197)"); - } -} - - -void boss_illidan_stormrageAI::EnterPhase(PhaseIllidan NextPhase) -{ - DoZoneInCombat(); - switch(NextPhase) - { - case PHASE_NORMAL: - case PHASE_NORMAL_2: - case PHASE_NORMAL_MAIEV: - AttackStart(m_creature->getVictim()); - Timer[EVENT_TAUNT] = 32000; - Timer[EVENT_SHEAR] = 10000 + rand()%15 * 1000; - Timer[EVENT_FLAME_CRASH] = 20000; - Timer[EVENT_PARASITIC_SHADOWFIEND] = 25000; - Timer[EVENT_PARASITE_CHECK] = 0; - Timer[EVENT_DRAW_SOUL] = 30000; - if (NextPhase == PHASE_NORMAL) - break; - Timer[EVENT_AGONIZING_FLAMES] = 35000; - Timer[EVENT_TRANSFORM_NORMAL] = 60000; - if (NextPhase == PHASE_NORMAL_2) - break; - Timer[EVENT_ENRAGE] = 30000 + rand()%10 * 1000; - break; - case PHASE_FLIGHT: - Timer[EVENT_FIREBALL] = 1000; - if (!(rand()%4)) - Timer[EVENT_DARK_BARRAGE] = 10000; - Timer[EVENT_EYE_BLAST] = 10000 + rand()%15 * 1000; - Timer[EVENT_MOVE_POINT] = 20000 + rand()%20 * 1000; - break; - case PHASE_DEMON: - Timer[EVENT_SHADOW_BLAST] = 1000; - Timer[EVENT_FLAME_BURST] = 10000; - Timer[EVENT_SHADOWDEMON] = 30000; - Timer[EVENT_TRANSFORM_DEMON] = 60000; - AttackStart(m_creature->getVictim()); - break; - case PHASE_TALK_SEQUENCE: - Timer[EVENT_TALK_SEQUENCE] = 100; - m_creature->RemoveAllAuras(); - m_creature->InterruptNonMeleeSpells(false); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE); - m_creature->GetMotionMaster()->Clear(false); - m_creature->AttackStop(); - break; - case PHASE_FLIGHT_SEQUENCE: - if (Phase == PHASE_NORMAL) //lift off - { - FlightCount = 1; - Timer[EVENT_FLIGHT_SEQUENCE] = 1; - m_creature->RemoveAllAuras(); - m_creature->InterruptNonMeleeSpells(false); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->GetMotionMaster()->Clear(false); - m_creature->AttackStop(); - } - else //land - Timer[EVENT_FLIGHT_SEQUENCE] = 2000; - break; - case PHASE_TRANSFORM_SEQUENCE: - if (Phase == PHASE_DEMON) - Timer[EVENT_TRANSFORM_SEQUENCE] = 500; - else - { - TransformCount = 0; - Timer[EVENT_TRANSFORM_SEQUENCE] = 500; - m_creature->MonsterYell(SAY_MORPH, LANG_UNIVERSAL, 0); - DoPlaySoundToSet(m_creature, SOUND_MORPH); - } - m_creature->GetMotionMaster()->Clear(); - m_creature->AttackStop(); - break; - default: - break; - } - if (MaievGUID) - { - GETCRE(Maiev, MaievGUID); - if (Maiev && Maiev->isAlive()) - Maiev->AI()->DoAction(NextPhase); - } - Phase = NextPhase; - Event = EVENT_NULL; -} - -CreatureAI* GetAI_boss_illidan_stormrage(Creature* pCreature) -{ - return new boss_illidan_stormrageAI (pCreature); -} - -CreatureAI* GetAI_npc_akama_at_illidan(Creature* pCreature) -{ - return new npc_akama_illidanAI(pCreature); -} - -CreatureAI* GetAI_boss_maiev(Creature* pCreature) -{ - return new boss_maievAI (pCreature); -} - -CreatureAI* GetAI_mob_flame_of_azzinoth(Creature* pCreature) -{ - return new flame_of_azzinothAI (pCreature); -} - -CreatureAI* GetAI_cage_trap_trigger(Creature* pCreature) -{ - return new cage_trap_triggerAI (pCreature); -} - -CreatureAI* GetAI_shadow_demon(Creature* pCreature) -{ - return new shadow_demonAI (pCreature); -} - -CreatureAI* GetAI_blade_of_azzinoth(Creature* pCreature) -{ - return new blade_of_azzinothAI (pCreature); -} - -CreatureAI* GetAI_parasitic_shadowfiend(Creature* pCreature) -{ - return new mob_parasitic_shadowfiendAI (pCreature); -} - -void AddSC_boss_illidan() -{ - Script* newscript; - - newscript = new Script; - newscript->Name = "boss_illidan_stormrage"; - newscript->GetAI = &GetAI_boss_illidan_stormrage; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "npc_akama_illidan"; - newscript->GetAI = &GetAI_npc_akama_at_illidan; - newscript->pGossipHello = &GossipHello_npc_akama_at_illidan; - newscript->pGossipSelect = &GossipSelect_npc_akama_at_illidan; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "boss_maiev_shadowsong"; - newscript->GetAI = &GetAI_boss_maiev; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_flame_of_azzinoth"; - newscript->GetAI = &GetAI_mob_flame_of_azzinoth; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_blade_of_azzinoth"; - newscript->GetAI = &GetAI_blade_of_azzinoth; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "gameobject_cage_trap"; - newscript->pGOHello = &GOHello_cage_trap; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_cage_trap_trigger"; - newscript->GetAI = &GetAI_cage_trap_trigger; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_shadow_demon"; - newscript->GetAI = &GetAI_shadow_demon; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_parasitic_shadowfiend"; - newscript->GetAI = &GetAI_parasitic_shadowfiend; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_mother_shahraz.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_mother_shahraz.cpp deleted file mode 100644 index a33874c74cf..00000000000 --- a/src/bindings/scripts/scripts/zone/black_temple/boss_mother_shahraz.cpp +++ /dev/null @@ -1,315 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Mother_Shahraz -SD%Complete: 80 -SDComment: Saber Lash missing, Fatal Attraction slightly incorrect; need to damage only if affected players are within range of each other -SDCategory: Black Temple -EndScriptData */ - -#include "precompiled.h" -#include "def_black_temple.h" - -//Speech'n'Sounds -#define SAY_TAUNT1 -1564018 -#define SAY_TAUNT2 -1564019 -#define SAY_TAUNT3 -1564020 -#define SAY_AGGRO -1564021 -#define SAY_SPELL1 -1564022 -#define SAY_SPELL2 -1564023 -#define SAY_SPELL3 -1564024 -#define SAY_SLAY1 -1564025 -#define SAY_SLAY2 -1564026 -#define SAY_ENRAGE -1564027 -#define SAY_DEATH -1564028 - -//Spells -#define SPELL_BEAM_SINISTER 40859 -#define SPELL_BEAM_VILE 40860 -#define SPELL_BEAM_WICKED 40861 -#define SPELL_BEAM_SINFUL 40827 -#define SPELL_ATTRACTION 40871 -#define SPELL_SILENCING_SHRIEK 40823 -#define SPELL_ENRAGE 23537 -#define SPELL_SABER_LASH 40810//43267 -#define SPELL_SABER_LASH_IMM 43690 -#define SPELL_TELEPORT_VISUAL 40869 -#define SPELL_BERSERK 45078 - -uint32 PrismaticAuras[]= -{ - 40880, // Shadow - 40882, // Fire - 40883, // Nature - 40891, // Arcane - 40896, // Frost - 40897, // Holy -}; - -struct Locations -{ - float x,y,z; -}; - -static Locations TeleportPoint[]= -{ - {959.996, 212.576, 193.843}, - {932.537, 231.813, 193.838}, - {958.675, 254.767, 193.822}, - {946.955, 201.316, 192.535}, - {944.294, 149.676, 197.551}, - {930.548, 284.888, 193.367}, - {965.997, 278.398, 195.777} -}; - -struct TRINITY_DLL_DECL boss_shahrazAI : public ScriptedAI -{ - boss_shahrazAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - uint64 TargetGUID[3]; - uint32 BeamTimer; - uint32 BeamCount; - uint32 CurrentBeam; - uint32 PrismaticShieldTimer; - uint32 FatalAttractionTimer; - uint32 FatalAttractionExplodeTimer; - uint32 ShriekTimer; - uint32 SaberTimer; - uint32 RandomYellTimer; - uint32 EnrageTimer; - uint32 ExplosionCount; - - bool Enraged; - - void Reset() - { - if (pInstance) - pInstance->SetData(DATA_MOTHERSHAHRAZEVENT, NOT_STARTED); - - for(uint8 i = 0; i<3; ++i) - TargetGUID[i] = 0; - - BeamTimer = 20000; // Timers may be incorrect - BeamCount = 0; - CurrentBeam = 0; // 0 - Sinister, 1 - Vile, 2 - Wicked, 3 - Sinful - PrismaticShieldTimer = 0; - FatalAttractionTimer = 60000; - FatalAttractionExplodeTimer = 70000; - ShriekTimer = 30000; - SaberTimer = 35000; - RandomYellTimer = 70000 + rand()%41 * 1000; - EnrageTimer = 600000; - ExplosionCount = 0; - - Enraged = false; - } - - void EnterCombat(Unit *who) - { - if (pInstance) - pInstance->SetData(DATA_MOTHERSHAHRAZEVENT, IN_PROGRESS); - - DoZoneInCombat(); - DoScriptText(SAY_AGGRO, m_creature); - } - - void KilledUnit(Unit *victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; - } - } - - void JustDied(Unit *victim) - { - if (pInstance) - pInstance->SetData(DATA_MOTHERSHAHRAZEVENT, DONE); - - DoScriptText(SAY_DEATH, m_creature); - } - - void TeleportPlayers() - { - uint32 random = rand()%7; - float X = TeleportPoint[random].x; - float Y = TeleportPoint[random].y; - float Z = TeleportPoint[random].z; - for(uint8 i = 0; i < 3; ++i) - { - Unit* pUnit = SelectUnit(SELECT_TARGET_RANDOM, 1); - if (pUnit && pUnit->isAlive() && (pUnit->GetTypeId() == TYPEID_PLAYER)) - { - TargetGUID[i] = pUnit->GetGUID(); - pUnit->CastSpell(pUnit, SPELL_TELEPORT_VISUAL, true); - DoTeleportPlayer(pUnit, X, Y, Z, pUnit->GetOrientation()); - } - } - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 10) && !Enraged) - { - Enraged = true; - DoCast(m_creature, SPELL_ENRAGE, true); - DoScriptText(SAY_ENRAGE, m_creature); - } - - //Randomly cast one beam. - if (BeamTimer < diff) - { - Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (!target || !target->isAlive()) - return; - - BeamTimer = 9000; - - switch(CurrentBeam) - { - case 0: - DoCast(target, SPELL_BEAM_SINISTER); - break; - case 1: - DoCast(target, SPELL_BEAM_VILE); - break; - case 2: - DoCast(target, SPELL_BEAM_WICKED); - break; - case 3: - DoCast(target, SPELL_BEAM_SINFUL); - break; - } - BeamCount++; - uint32 Beam = CurrentBeam; - if (BeamCount > 3) - while(CurrentBeam == Beam) - CurrentBeam = rand()%3; - - }else BeamTimer -= diff; - - // Random Prismatic Shield every 15 seconds. - if (PrismaticShieldTimer < diff) - { - uint32 random = rand()%6; - if (PrismaticAuras[random]) - DoCast(m_creature, PrismaticAuras[random]); - PrismaticShieldTimer = 15000; - }else PrismaticShieldTimer -= diff; - - // Select 3 random targets (can select same target more than once), teleport to a random location then make them cast explosions until they get away from each other. - if (FatalAttractionTimer < diff) - { - ExplosionCount = 0; - - TeleportPlayers(); - - switch(rand()%2) - { - case 0: DoScriptText(SAY_SPELL2, m_creature); break; - case 1: DoScriptText(SAY_SPELL3, m_creature); break; - } - FatalAttractionExplodeTimer = 2000; - FatalAttractionTimer = 40000 + rand()%31 * 1000; - }else FatalAttractionTimer -= diff; - - if (FatalAttractionExplodeTimer < diff) - { - // Just make them explode three times... they're supposed to keep exploding while they are in range, but it'll take too much code. I'll try to think of an efficient way for it later. - if (ExplosionCount < 3) - { - for(uint8 i = 0; i < 3; ++i) - { - Unit* pUnit = NULL; - if (TargetGUID[i]) - { - pUnit = Unit::GetUnit((*m_creature), TargetGUID[i]); - if (pUnit) - pUnit->CastSpell(pUnit, SPELL_ATTRACTION, true); - TargetGUID[i] = 0; - } - } - - ExplosionCount++; - FatalAttractionExplodeTimer = 1000; - } - else - { - FatalAttractionExplodeTimer = FatalAttractionTimer + 2000; - ExplosionCount = 0; - } - }else FatalAttractionExplodeTimer -= diff; - - if (ShriekTimer < diff) - { - DoCast(m_creature->getVictim(), SPELL_SILENCING_SHRIEK); - ShriekTimer = 25000+rand()%10 * 1000; - }else ShriekTimer -= diff; - - if (SaberTimer < diff) - { - DoCast(m_creature->getVictim(), SPELL_SABER_LASH); - SaberTimer = 25000+rand()%10 * 1000; - }else SaberTimer -= diff; - - //Enrage - if (!m_creature->HasAura(SPELL_BERSERK)) - if (EnrageTimer < diff) - { - DoCast(m_creature, SPELL_BERSERK); - DoScriptText(SAY_ENRAGE, m_creature); - }else EnrageTimer -= diff; - - //Random taunts - if (RandomYellTimer < diff) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_TAUNT1, m_creature); break; - case 1: DoScriptText(SAY_TAUNT2, m_creature); break; - case 2: DoScriptText(SAY_TAUNT3, m_creature); break; - } - RandomYellTimer = 60000 + rand()%91 * 1000; - }else RandomYellTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_shahraz(Creature* pCreature) -{ - return new boss_shahrazAI (pCreature); -} - -void AddSC_boss_mother_shahraz() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_mother_shahraz"; - newscript->GetAI = &GetAI_boss_shahraz; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_reliquary_of_souls.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_reliquary_of_souls.cpp deleted file mode 100644 index aa81259e451..00000000000 --- a/src/bindings/scripts/scripts/zone/black_temple/boss_reliquary_of_souls.cpp +++ /dev/null @@ -1,710 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -/* ScriptData -SDName: Boss_Reliquary_of_Souls -SD%Complete: 90 -SDComment: -SDCategory: Black Temple -EndScriptData */ - -#include "precompiled.h" -#include "def_black_temple.h" -#include "Spell.h" - -//Sound'n'speech -//Suffering -#define SUFF_SAY_FREED -1564047 -#define SUFF_SAY_AGGRO -1564048 -#define SUFF_SAY_SLAY1 -1564049 -#define SUFF_SAY_SLAY2 -1564050 -#define SUFF_SAY_SLAY3 -1564051 -#define SUFF_SAY_RECAP -1564052 -#define SUFF_SAY_AFTER -1564053 -#define SUFF_EMOTE_ENRAGE -1564054 - -//Desire -#define DESI_SAY_FREED -1564055 -#define DESI_SAY_SLAY1 -1564056 -#define DESI_SAY_SLAY2 -1564057 -#define DESI_SAY_SLAY3 -1564058 -#define DESI_SAY_SPEC -1564059 -#define DESI_SAY_RECAP -1564060 -#define DESI_SAY_AFTER -1564061 - -//Anger -#define ANGER_SAY_FREED -1564062 -#define ANGER_SAY_FREED2 -1564063 -#define ANGER_SAY_SLAY1 -1564064 -#define ANGER_SAY_SLAY2 -1564065 -#define ANGER_SAY_SPEC -1564066 -#define ANGER_SAY_BEFORE -1564067 -#define ANGER_SAY_DEATH -1564068 - -//Spells -#define AURA_OF_SUFFERING 41292 -#define AURA_OF_SUFFERING_ARMOR 42017 // linked aura, need core support -#define ESSENCE_OF_SUFFERING_PASSIVE 41296 // periodic trigger 41294 -#define ESSENCE_OF_SUFFERING_PASSIVE2 41623 -#define SPELL_FIXATE_TARGET 41294 // dummy, select target -#define SPELL_FIXATE_TAUNT 41295 // force taunt -#define SPELL_ENRAGE 41305 -#define SPELL_SOUL_DRAIN 41303 - -#define AURA_OF_DESIRE 41350 -#define AURA_OF_DESIRE_DAMAGE 41352 -#define SPELL_RUNE_SHIELD 41431 -#define SPELL_DEADEN 41410 -#define SPELL_SOUL_SHOCK 41426 - -#define AURA_OF_ANGER 41337 -#define SPELL_SELF_SEETHE 41364 // force cast 41520 -#define SPELL_ENEMY_SEETHE 41520 -#define SPELL_SOUL_SCREAM 41545 -#define SPELL_SPITE_TARGET 41376 // cast 41377 after 6 sec -#define SPELL_SPITE_DAMAGE 41377 - -#define ENSLAVED_SOUL_PASSIVE 41535 -#define SPELL_SOUL_RELEASE 41542 -#define SPELL_SUBMERGE 37550 //dropout 'head' - -#define CREATURE_ENSLAVED_SOUL 23469 -#define NUMBER_ENSLAVED_SOUL 8 - -struct Position2d -{ - float x,y; -}; - -static Position2d Coords[]= -{ - {450.4, 212.3}, - {542.1, 212.3}, - {542.1, 168.3}, - {542.1, 137.4}, - {450.4, 137.4}, - {450.4, 168.3} -}; - -struct TRINITY_DLL_DECL npc_enslaved_soulAI : public ScriptedAI -{ - npc_enslaved_soulAI(Creature *c) : ScriptedAI(c) {} - - uint64 ReliquaryGUID; - - void Reset() {ReliquaryGUID = 0;} - - void EnterCombat(Unit* who) - { - m_creature->CastSpell(m_creature, ENSLAVED_SOUL_PASSIVE, true); - DoZoneInCombat(); - } - - void JustDied(Unit *killer); -}; - -struct TRINITY_DLL_DECL boss_reliquary_of_soulsAI : public ScriptedAI -{ - boss_reliquary_of_soulsAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - EssenceGUID = 0; - } - - ScriptedInstance* pInstance; - - uint64 EssenceGUID; - - uint32 Phase; - uint32 Counter; - uint32 Timer; - - uint32 SoulCount; - uint32 SoulDeathCount; - - void Reset() - { - if (pInstance) - pInstance->SetData(DATA_RELIQUARYOFSOULSEVENT, NOT_STARTED); - - if (EssenceGUID) - { - if (Creature* Essence = Unit::GetCreature(*m_creature, EssenceGUID)) - { - Essence->ForcedDespawn(); - } - EssenceGUID = 0; - } - - Phase = 0; - - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE); - m_creature->RemoveAurasDueToSpell(SPELL_SUBMERGE); - } - - void EnterCombat(Unit* who) - { - m_creature->AddThreat(who, 10000.0f); - DoZoneInCombat(); - if (pInstance) - pInstance->SetData(DATA_RELIQUARYOFSOULSEVENT, IN_PROGRESS); - - Phase = 1; - Counter = 0; - Timer = 0; - } - - bool SummonSoul() - { - uint32 random = rand()%6; - float x = Coords[random].x; - float y = Coords[random].y; - Creature* Soul = m_creature->SummonCreature(CREATURE_ENSLAVED_SOUL, x, y, m_creature->GetPositionZ(), m_creature->GetOrientation(), TEMPSUMMON_CORPSE_DESPAWN, 0); - if (!Soul) return false; - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - { - CAST_AI(npc_enslaved_soulAI, Soul->AI())->ReliquaryGUID = m_creature->GetGUID(); - Soul->AI()->AttackStart(target); - }else EnterEvadeMode(); - return true; - } - - void MergeThreatList(Creature* target) - { - if (!target) - return; - - std::list& m_threatlist = target->getThreatManager().getThreatList(); - std::list::iterator itr = m_threatlist.begin(); - for(; itr != m_threatlist.end(); itr++) - { - Unit* pUnit = Unit::GetUnit((*m_creature), (*itr)->getUnitGuid()); - if (pUnit) - { - m_creature->AddThreat(pUnit, 1.0f); // This is so that we make sure the unit is in Reliquary's threat list before we reset the unit's threat. - m_creature->getThreatManager().modifyThreatPercent(pUnit, -100); - float threat = target->getThreatManager().getThreat(pUnit); - m_creature->AddThreat(pUnit, threat); // This makes it so that the unit has the same amount of threat in Reliquary's threatlist as in the target creature's (One of the Essences). - } - } - } - - void JustDied(Unit* killer) - { - if (pInstance) - pInstance->SetData(DATA_RELIQUARYOFSOULSEVENT, DONE); - } - - void UpdateAI(const uint32 diff) - { - if (!Phase) - return; - - if (m_creature->getThreatManager().getThreatList().empty()) // Reset if event is begun and we don't have a threatlist - { - EnterEvadeMode(); - return; - } - - Creature* Essence; - if (EssenceGUID) - { - Essence = Unit::GetCreature(*m_creature, EssenceGUID); - if (!Essence) - { - EnterEvadeMode(); - return; - } - } - - if (Timer < diff) - { - switch(Counter) - { - case 0: - m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_READY2H); // I R ANNNGRRRY! - DoStartNoMovement(m_creature); - Timer = 3000; - break; - case 1: - Timer = 2800; - m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_SUBMERGE); // Release the cube - DoCast(m_creature,SPELL_SUBMERGE); - DoStartNoMovement(m_creature); - break; - case 2: - Timer = 5000; - if (Creature* Summon = DoSpawnCreature(23417+Phase, 0, 0, 0, 0, TEMPSUMMON_DEAD_DESPAWN, 0)) - { - m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_SUBMERGED); // Ribs: open - Summon->AI()->AttackStart(SelectUnit(SELECT_TARGET_TOPAGGRO, 0)); - EssenceGUID = Summon->GetGUID(); - DoStartNoMovement(m_creature); - }else EnterEvadeMode(); - break; - case 3: - Timer = 1000; - if (Phase == 3) - { - if (!Essence->isAlive()) - m_creature->CastSpell(m_creature, 7, true); - else return; - } - else - { - if (Essence->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE)) - { - MergeThreatList(Essence); - Essence->RemoveAllAuras(); - Essence->DeleteThreatList(); - Essence->GetMotionMaster()->MoveFollow(m_creature,0.0f,0.0f); - }else return; - } - break; - case 4: - Timer = 1500; - if (Essence->IsWithinDistInMap(m_creature, 10)) - { - Essence->SetUInt32Value(UNIT_NPC_EMOTESTATE,374); //rotate and disappear - Timer = 2000; - m_creature->RemoveAurasDueToSpell(SPELL_SUBMERGE); - } - else - { - MergeThreatList(Essence); - Essence->RemoveAllAuras(); - Essence->DeleteThreatList(); - Essence->GetMotionMaster()->MoveFollow(m_creature, 0, 0); - return; - } - break; - case 5: - if (Phase == 1) - { - DoScriptText(SUFF_SAY_AFTER, Essence); - } - else - { - DoScriptText(DESI_SAY_AFTER, Essence); - } - Essence->ForcedDespawn(); - m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE,0); - EssenceGUID = 0; - SoulCount = 0; - SoulDeathCount = 0; - Timer = 3000; - break; - case 6: - if (SoulCount < NUMBER_ENSLAVED_SOUL) - { - if (SummonSoul()) - SoulCount++; - Timer = 500; - return; - }break; - case 7: - if (SoulDeathCount >= SoulCount) - { - Counter = 1; - Phase++; - Timer = 5000; - } - return; - default: - break; - } - Counter++; - }else Timer -= diff; - } -}; - -struct TRINITY_DLL_DECL boss_essence_of_sufferingAI : public ScriptedAI -{ - boss_essence_of_sufferingAI(Creature *c) : ScriptedAI(c) {} - - uint64 StatAuraGUID; - - uint32 AggroYellTimer; - uint32 FixateTimer; - uint32 EnrageTimer; - uint32 SoulDrainTimer; - uint32 AuraTimer; - - void Reset() - { - StatAuraGUID = 0; - - AggroYellTimer = 5000; - FixateTimer = 8000; - EnrageTimer = 30000; - SoulDrainTimer = 45000; - AuraTimer = 5000; - } - - void DamageTaken(Unit *done_by, uint32 &damage) - { - if (damage >= m_creature->GetHealth()) - { - damage = 0; - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->Yell(SUFF_SAY_RECAP,LANG_UNIVERSAL,0); - DoScriptText(SUFF_SAY_RECAP, m_creature); - } - } - - void EnterCombat(Unit *who) - { - if (!m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE)) - { - DoScriptText(SUFF_SAY_FREED, m_creature); - DoZoneInCombat(); - m_creature->CastSpell(m_creature, AURA_OF_SUFFERING, true); // linked aura need core support - m_creature->CastSpell(m_creature, ESSENCE_OF_SUFFERING_PASSIVE, true); - m_creature->CastSpell(m_creature, ESSENCE_OF_SUFFERING_PASSIVE2, true); - } - else return; - } - - void KilledUnit(Unit *victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SUFF_SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SUFF_SAY_SLAY2, m_creature); break; - case 2: DoScriptText(SUFF_SAY_SLAY3, m_creature); break; - } - } - - void CastFixate() - { - std::list& m_threatlist = m_creature->getThreatManager().getThreatList(); - if (m_threatlist.empty()) - return; // No point continuing if empty threatlist. - std::list targets; - std::list::iterator itr = m_threatlist.begin(); - for(; itr != m_threatlist.end(); ++itr) - { - Unit* pUnit = Unit::GetUnit((*m_creature), (*itr)->getUnitGuid()); - if (pUnit && pUnit->isAlive() && (pUnit->GetTypeId() == TYPEID_PLAYER)) // Only alive players - targets.push_back(pUnit); - } - if (targets.empty()) - return; // No targets added for some reason. No point continuing. - targets.sort(ObjectDistanceOrder(m_creature)); // Sort players by distance. - targets.resize(1); // Only need closest target. - Unit* target = targets.front(); // Get the first target. - if (target) - target->CastSpell(m_creature, SPELL_FIXATE_TAUNT, true); - DoResetThreat(); - m_creature->AddThreat(target,1000000); - } - - void UpdateAI(const uint32 diff) - { - if (m_creature->isInCombat()) - { - //Supposed to be cast on nearest target - if (FixateTimer < diff) - { - CastFixate(); - FixateTimer = 5000; - if (!(rand()%16)) - { - DoScriptText(SUFF_SAY_AGGRO, m_creature); - } - }else FixateTimer -= diff; - } - - //Return since we have no target - if (!UpdateVictim()) - return; - - if (EnrageTimer < diff) - { - DoCast(m_creature, SPELL_ENRAGE); - EnrageTimer = 60000; - DoScriptText(SUFF_EMOTE_ENRAGE, m_creature); - }else EnrageTimer -= diff; - - if (SoulDrainTimer < diff) - { - DoCast(SelectUnit(SELECT_TARGET_RANDOM,0), SPELL_SOUL_DRAIN); - SoulDrainTimer = 60000; - }else SoulDrainTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -struct TRINITY_DLL_DECL boss_essence_of_desireAI : public ScriptedAI -{ - boss_essence_of_desireAI(Creature *c) : ScriptedAI(c) {} - - uint32 RuneShieldTimer; - uint32 DeadenTimer; - uint32 SoulShockTimer; - - void Reset() - { - RuneShieldTimer = 60000; - DeadenTimer = 30000; - SoulShockTimer = 5000; - m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_CONFUSE, true); - } - - void DamageTaken(Unit *done_by, uint32 &damage) - { - if (done_by == m_creature) - return; - - if (damage >= m_creature->GetHealth()) - { - damage = 0; - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - DoScriptText(SUFF_SAY_RECAP, m_creature); - } - else - { - int32 bp0 = damage / 2; - m_creature->CastCustomSpell(done_by, AURA_OF_DESIRE_DAMAGE, &bp0, NULL, NULL, true); - } - } - - void SpellHit(Unit *caster, const SpellEntry *spell) - { - if (m_creature->m_currentSpells[CURRENT_GENERIC_SPELL]) - for(uint8 i = 0; i < 3; ++i) - if (spell->Effect[i] == SPELL_EFFECT_INTERRUPT_CAST) - if (m_creature->m_currentSpells[CURRENT_GENERIC_SPELL]->m_spellInfo->Id == SPELL_SOUL_SHOCK - || m_creature->m_currentSpells[CURRENT_GENERIC_SPELL]->m_spellInfo->Id == SPELL_DEADEN) - m_creature->InterruptSpell(CURRENT_GENERIC_SPELL, false); - } - - void EnterCombat(Unit *who) - { - DoScriptText(DESI_SAY_FREED, m_creature); - DoZoneInCombat(); - DoCast(m_creature, AURA_OF_DESIRE, true); - } - - void KilledUnit(Unit *victim) - { - switch(rand()%3) - { - case 0: DoScriptText(DESI_SAY_SLAY1, m_creature); break; - case 1: DoScriptText(DESI_SAY_SLAY2, m_creature); break; - case 2: DoScriptText(DESI_SAY_SLAY3, m_creature); break; - } - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (RuneShieldTimer < diff) - { - m_creature->InterruptNonMeleeSpells(false); - m_creature->CastSpell(m_creature, SPELL_RUNE_SHIELD, true); - SoulShockTimer += 2000; - DeadenTimer += 2000; - RuneShieldTimer = 60000; - }else RuneShieldTimer -= diff; - - if (SoulShockTimer < diff) - { - DoCast(m_creature->getVictim(), SPELL_SOUL_SHOCK); - SoulShockTimer = 5000; - }else SoulShockTimer -= diff; - - if (DeadenTimer < diff) - { - m_creature->InterruptNonMeleeSpells(false); - DoCast(m_creature->getVictim(), SPELL_DEADEN); - DeadenTimer = 25000 + rand()%10000; - if (!(rand()%2)) - { - DoScriptText(DESI_SAY_SPEC, m_creature); - } - }else DeadenTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -struct TRINITY_DLL_DECL boss_essence_of_angerAI : public ScriptedAI -{ - boss_essence_of_angerAI(Creature *c) : ScriptedAI(c) {} - - uint64 AggroTargetGUID; - - uint32 CheckTankTimer; - uint32 SoulScreamTimer; - uint32 SpiteTimer; - - std::list SpiteTargetGUID; - - bool CheckedAggro; - - void Reset() - { - AggroTargetGUID = 0; - - CheckTankTimer = 5000; - SoulScreamTimer = 10000; - SpiteTimer = 30000; - - SpiteTargetGUID.clear(); - - CheckedAggro = false; - } - - void EnterCombat(Unit *who) - { - switch(rand()%2) - { - case 0: DoScriptText(ANGER_SAY_FREED, m_creature); break; - case 1: DoScriptText(ANGER_SAY_FREED2, m_creature); break; - } - - DoZoneInCombat(); - DoCast(m_creature, AURA_OF_ANGER, true); - } - - void JustDied(Unit *victim) - { - DoScriptText(ANGER_SAY_DEATH, m_creature); - } - - void KilledUnit(Unit *victim) - { - switch(rand()%2) - { - case 0: DoScriptText(ANGER_SAY_SLAY1, m_creature); break; - case 1: DoScriptText(ANGER_SAY_SLAY2, m_creature); break; - } - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - if (!CheckedAggro) - { - AggroTargetGUID = m_creature->getVictim()->GetGUID(); - CheckedAggro = true; - } - - if (CheckTankTimer < diff) - { - if (m_creature->getVictim()->GetGUID() != AggroTargetGUID) - { - DoScriptText(ANGER_SAY_BEFORE, m_creature); - DoCast(m_creature, SPELL_SELF_SEETHE, true); - AggroTargetGUID = m_creature->getVictim()->GetGUID(); - } - CheckTankTimer = 2000; - }else CheckTankTimer -= diff; - - if (SoulScreamTimer < diff) - { - DoCast(m_creature->getVictim(), SPELL_SOUL_SCREAM); - SoulScreamTimer = 9000 + rand()%2000; - if (!(rand()%3)) - { - DoScriptText(ANGER_SAY_SPEC, m_creature); - } - }else SoulScreamTimer -= diff; - - if (SpiteTimer < diff) - { - DoCast(m_creature, SPELL_SPITE_TARGET); - SpiteTimer = 30000; - DoScriptText(ANGER_SAY_SPEC, m_creature); - }else SpiteTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -void npc_enslaved_soulAI::JustDied(Unit *killer) -{ - if (ReliquaryGUID) - { - Creature* Reliquary = (Unit::GetCreature((*m_creature), ReliquaryGUID)); - if (Reliquary) - CAST_AI(boss_reliquary_of_soulsAI, Reliquary->AI())->SoulDeathCount++; - } - DoCast(m_creature, SPELL_SOUL_RELEASE, true); -} - -CreatureAI* GetAI_boss_reliquary_of_souls(Creature* pCreature) -{ - return new boss_reliquary_of_soulsAI (pCreature); -} - -CreatureAI* GetAI_boss_essence_of_suffering(Creature* pCreature) -{ - return new boss_essence_of_sufferingAI (pCreature); -} - -CreatureAI* GetAI_boss_essence_of_desire(Creature* pCreature) -{ - return new boss_essence_of_desireAI (pCreature); -} - -CreatureAI* GetAI_boss_essence_of_anger(Creature* pCreature) -{ - return new boss_essence_of_angerAI (pCreature); -} - -CreatureAI* GetAI_npc_enslaved_soul(Creature* pCreature) -{ - return new npc_enslaved_soulAI (pCreature); -} - -void AddSC_boss_reliquary_of_souls() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_reliquary_of_souls"; - newscript->GetAI = &GetAI_boss_reliquary_of_souls; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="boss_essence_of_suffering"; - newscript->GetAI = &GetAI_boss_essence_of_suffering; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="boss_essence_of_desire"; - newscript->GetAI = &GetAI_boss_essence_of_desire; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="boss_essence_of_anger"; - newscript->GetAI = &GetAI_boss_essence_of_anger; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_enslaved_soul"; - newscript->GetAI = &GetAI_npc_enslaved_soul; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_shade_of_akama.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_shade_of_akama.cpp deleted file mode 100644 index ea987bf4963..00000000000 --- a/src/bindings/scripts/scripts/zone/black_temple/boss_shade_of_akama.cpp +++ /dev/null @@ -1,870 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Shade_of_Akama -SD%Complete: 90 -SDComment: Seems to be complete. -SDCategory: Black Temple -EndScriptData */ - -#include "precompiled.h" -#include "def_black_temple.h" - -#define SAY_DEATH -1564013 -#define SAY_LOW_HEALTH -1564014 -// Ending cinematic text -#define SAY_FREE -1564015 -#define SAY_BROKEN_FREE_01 -1564016 -#define SAY_BROKEN_FREE_02 -1564017 - -#define GOSSIP_ITEM "We are ready to fight alongside you, Akama" - -struct Location -{ - float x, y, o, z; -}; - -static Location ChannelerLocations[]= -{ - {463.161285, 401.219757, 3.141592}, - {457.377625, 391.227661, 2.106461}, - {446.012421, 391.227661, 1.071904}, - {439.533783, 401.219757, 0.000000}, - {446.012421, 411.211853, 5.210546}, - {457.377625, 411.211853, 4.177494} -}; - -static Location SpawnLocations[]= -{ - {498.652740, 461.728119, 0}, - {498.505003, 339.619324, 0} -}; - -static Location AkamaWP[]= -{ - {482.352448, 401.162720, 0, 112.783928}, - {469.597443, 402.264404, 0, 118.537910} -}; - -static Location BrokenCoords[]= -{ - {541.375916, 401.439575, M_PI, 112.783997}, // The place where Akama channels - {534.130005, 352.394531, 2.164150, 112.783737}, // Behind a 'pillar' which is behind the east alcove - {499.621185, 341.534729, 1.652856, 112.783730}, // East Alcove - {499.151093, 461.036438, 4.770888, 112.78370}, // West Alcove -}; - -static Location BrokenWP[]= -{ - {492.491638, 400.744690, 3.122336, 112.783737}, - {494.335724, 382.221771, 2.676230, 112.783737}, - {489.555939, 373.507202, 2.416263, 112.783737}, - {491.136353, 427.868774, 3.519748, 112.783737}, -}; - -// Locations -#define Z1 118.543144 -#define Z2 120.783768 -#define Z_SPAWN 113.537949 -#define AGGRO_X 482.793182 -#define AGGRO_Y 401.270172 -#define AGGRO_Z 112.783928 -#define AKAMA_X 514.583984 -#define AKAMA_Y 400.601013 -#define AKAMA_Z 112.783997 - -// Spells -#define SPELL_VERTEX_SHADE_BLACK 39833 -#define SPELL_SHADE_SOUL_CHANNEL 40401 -#define SPELL_DESTRUCTIVE_POISON 40874 -#define SPELL_LIGHTNING_BOLT 42024 -#define SPELL_AKAMA_SOUL_CHANNEL 40447 -#define SPELL_AKAMA_SOUL_RETRIEVE 40902 -#define AKAMA_SOUL_EXPEL 40855 -#define SPELL_SHADE_SOUL_CHANNEL_2 40520 - -// Channeler entry -#define CREATURE_CHANNELER 23421 -#define CREATURE_SORCERER 23215 -#define CREATURE_DEFENDER 23216 -#define CREATURE_BROKEN 23319 - -const uint32 spawnEntries[4]= { 23523, 23318, 23524 }; - -struct TRINITY_DLL_DECL mob_ashtongue_channelerAI : public ScriptedAI -{ - mob_ashtongue_channelerAI(Creature* c) : ScriptedAI(c) {ShadeGUID = 0;} - - uint64 ShadeGUID; - - void Reset() {} - void JustDied(Unit* killer); - void EnterCombat(Unit* who) {} - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) {} -}; - -struct TRINITY_DLL_DECL mob_ashtongue_sorcererAI : public ScriptedAI -{ - mob_ashtongue_sorcererAI(Creature* c) : ScriptedAI(c) {ShadeGUID = 0;} - - uint64 ShadeGUID; - uint32 CheckTimer; - bool StartBanishing; - - void Reset() - { - StartBanishing = false; - CheckTimer = 5000; - } - - void JustDied(Unit* killer); - void EnterCombat(Unit* who) {} - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) - { - if (StartBanishing) - return; - - if (CheckTimer < diff) - { - Creature* Shade = Unit::GetCreature((*m_creature), ShadeGUID); - if (Shade && Shade->isAlive() && m_creature->isAlive()) - { - if (m_creature->IsWithinDist(Shade, 20,false)) - { - m_creature->GetMotionMaster()->Clear(false); - m_creature->GetMotionMaster()->MoveIdle(); - DoCast(Shade, SPELL_SHADE_SOUL_CHANNEL, true); - DoCast(Shade, SPELL_SHADE_SOUL_CHANNEL_2, true); - - StartBanishing = true; - } - } - CheckTimer = 2000; - }else CheckTimer -= diff; - } -}; - -struct TRINITY_DLL_DECL boss_shade_of_akamaAI : public ScriptedAI -{ - boss_shade_of_akamaAI(Creature* c) : ScriptedAI(c), summons(m_creature) - { - pInstance = c->GetInstanceData(); - AkamaGUID = pInstance ? pInstance->GetData64(DATA_AKAMA_SHADE) : 0; - m_creature->setActive(true);//if view distance is too low - m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true); - m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true); - } - - ScriptedInstance* pInstance; - - std::list Channelers; - std::list Sorcerers; - uint64 AkamaGUID; - - uint32 SorcererCount; - uint32 DeathCount; - - uint32 ReduceHealthTimer; - uint32 SummonTimer; - uint32 ResetTimer; - uint32 DefenderTimer; // They are on a flat 15 second timer, independant of the other summon Creature timer. - - bool IsBanished; - bool HasKilledAkama; - bool reseting; - bool GridSearcherSucceeded; - bool HasKilledAkamaAndReseting; - SummonList summons; - - void Reset() - { - reseting = true; - HasKilledAkamaAndReseting = false; - - GridSearcherSucceeded = false; - - Sorcerers.clear(); - summons.DespawnAll();//despawn all adds - - if (Creature* Akama = Unit::GetCreature(*m_creature, AkamaGUID)) - { - Akama->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);//turn gossip on so players can restart the event - if (Akama->isDead()) - { - Akama->Respawn();//respawn akama if dead - Akama->AI()->EnterEvadeMode(); - } - } - SorcererCount = 0; - DeathCount = 0; - - SummonTimer = 10000; - ReduceHealthTimer = 0; - ResetTimer = 60000; - DefenderTimer = 15000; - - IsBanished = true; - HasKilledAkama = false; - - m_creature->SetVisibility(VISIBILITY_ON); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - //m_creature->GetMotionMaster()->Clear(); - //m_creature->GetMotionMaster()->MoveIdle(); - m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_STUN); - - if (pInstance && m_creature->isAlive()) - pInstance->SetData(DATA_SHADEOFAKAMAEVENT, NOT_STARTED); - - reseting = false; - } - void JustDied(Unit* killer) - { - summons.DespawnAll(); - } - void JustSummoned(Creature *summon) - { - if (summon->GetEntry() == CREATURE_DEFENDER || summon->GetEntry() == 23523 || summon->GetEntry() == 23318 || summon->GetEntry() == 23524) - summons.Summon(summon); - } - void SummonedCreatureDespawn(Creature *summon) - { - if (summon->GetEntry() == CREATURE_DEFENDER || summon->GetEntry() == 23523 || summon->GetEntry() == 23318 || summon->GetEntry() == 23524) - summons.Despawn(summon); - } - - void MoveInLineOfSight(Unit *who) - { - if (!GridSearcherSucceeded) - { - FindChannelers(); - - if (!Channelers.empty()) - { - for(std::list::iterator itr = Channelers.begin(); itr != Channelers.end(); ++itr) - { - Creature* Channeler = (Unit::GetCreature(*m_creature, *itr)); - if (Channeler) - { - if (Channeler->isDead()) - { - Channeler->RemoveCorpse(); - Channeler->Respawn(); - } - - Channeler->CastSpell(m_creature, SPELL_SHADE_SOUL_CHANNEL, true); - Channeler->CastSpell(m_creature, SPELL_SHADE_SOUL_CHANNEL_2, true); - Channeler->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - GridSearcherSucceeded = true; - } - } - }else error_log("SD2 ERROR: No Channelers are stored in the list. This encounter will not work properly"); - } - } - - void AttackStart(Unit* who) - { - if (!who || IsBanished) return; - - if (who->isTargetableForAttack() && who != m_creature) - DoStartMovement(who); - } - - void IncrementDeathCount(uint64 guid = 0) // If guid is set, will remove it from list of sorcerer - { - if (reseting) - return; - - debug_log("TSCR: Increasing Death Count for Shade of Akama encounter"); - ++DeathCount; - m_creature->RemoveAuraFromStack(SPELL_SHADE_SOUL_CHANNEL_2); - if (guid) - { - if (Sorcerers.empty()) - error_log("SD2 ERROR: Shade of Akama - attempt to remove guid %u from Sorcerers list but list is already empty", guid); - else Sorcerers.remove(guid); - } - } - - void SummonCreature() - { - uint32 random = rand()%2; - float X = SpawnLocations[random].x; - float Y = SpawnLocations[random].y; - // max of 6 sorcerers can be summoned - if ((rand()%3 == 0) && (DeathCount > 0) && (SorcererCount < 7)) - { - Creature* Sorcerer = m_creature->SummonCreature(CREATURE_SORCERER, X, Y, Z_SPAWN, 0, TEMPSUMMON_DEAD_DESPAWN, 0); - if (Sorcerer) - { - CAST_AI(mob_ashtongue_sorcererAI, Sorcerer->AI())->ShadeGUID = m_creature->GetGUID(); - Sorcerer->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - Sorcerer->GetMotionMaster()->MovePoint(0, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ()); - Sorcerer->SetUInt64Value(UNIT_FIELD_TARGET, m_creature->GetGUID()); - Sorcerers.push_back(Sorcerer->GetGUID()); - --DeathCount; - ++SorcererCount; - } - } - else - { - for(uint8 i = 0; i < 3; ++i) - { - Creature* Spawn = m_creature->SummonCreature(spawnEntries[i], X, Y, Z_SPAWN, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 25000); - if (Spawn) - { - Spawn->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - Spawn->GetMotionMaster()->MovePoint(0, AGGRO_X, AGGRO_Y, AGGRO_Z); - Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1); - Spawn->AI()->AttackStart(target); - } - } - } - } - - void FindChannelers() - { - std::list ChannelerList; - m_creature->GetCreatureListWithEntryInGrid(ChannelerList,CREATURE_CHANNELER,50.0f); - - if (!ChannelerList.empty()) - { - for(std::list::iterator itr = ChannelerList.begin(); itr != ChannelerList.end(); ++itr) - { - CAST_AI(mob_ashtongue_channelerAI, (*itr)->AI())->ShadeGUID = m_creature->GetGUID(); - Channelers.push_back((*itr)->GetGUID()); - debug_log("TSCR: Shade of Akama Grid Search found channeler %u. Adding to list", (*itr)->GetGUID()); - } - } - else error_log("SD2 ERROR: Grid Search was unable to find any channelers. Shade of Akama encounter will be buggy"); - } - - void SetSelectableChannelers() - { - if (Channelers.empty()) - { - error_log("SD2 ERROR: Channeler List is empty, Shade of Akama encounter will be buggy"); - return; - } - - for(std::list::iterator itr = Channelers.begin(); itr != Channelers.end(); ++itr) - if (Creature* Channeler = (Unit::GetCreature(*m_creature, *itr))) - Channeler->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - } - - void SetAkamaGUID(uint64 guid) { AkamaGUID = guid; } - - void UpdateAI(const uint32 diff) - { - if (!m_creature->isInCombat()) - return; - - if (IsBanished) - { - // Akama is set in the threatlist so when we reset, we make sure that he is not included in our check - if (m_creature->getThreatManager().getThreatList().size() < 2) - { - EnterEvadeMode(); - return; - } - - if (DefenderTimer < diff) - { - uint32 ran = rand()%2; - Creature* Defender = m_creature->SummonCreature(CREATURE_DEFENDER, SpawnLocations[ran].x, SpawnLocations[ran].y, Z_SPAWN, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 25000); - if (Defender) - { - Defender->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - bool move = true; - if (AkamaGUID) - { - if (Creature* Akama = Unit::GetCreature(*m_creature, AkamaGUID)) - { - float x, y, z; - Akama->GetPosition(x,y,z); - // They move towards AKama - Defender->GetMotionMaster()->MovePoint(0, x, y, z); - Defender->AI()->AttackStart(Akama); - }else move = false; - }else move = false; - if (!move) - Defender->GetMotionMaster()->MovePoint(0, AKAMA_X, AKAMA_Y, AKAMA_Z); - } - DefenderTimer = 15000; - }else DefenderTimer -= diff; - - if (SummonTimer < diff) - { - SummonCreature(); - SummonTimer = 35000; - }else SummonTimer -= diff; - - if (DeathCount >= 6) - { - if (AkamaGUID) - { - Creature* Akama = Unit::GetCreature((*m_creature), AkamaGUID); - if (Akama && Akama->isAlive()) - { - IsBanished = false; - m_creature->GetMotionMaster()->Clear(false); - m_creature->GetMotionMaster()->MoveChase(Akama); - Akama->GetMotionMaster()->Clear(); - // Shade should move to Akama, not the other way around - Akama->GetMotionMaster()->MoveIdle(); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - // Crazy amount of threat - m_creature->AddThreat(Akama, 10000000.0f); - Akama->AddThreat(m_creature, 10000000.0f); - m_creature->Attack(Akama, true); - Akama->Attack(m_creature, true); - } - } - } - } - else // No longer banished, let's fight Akama now - { - if (ReduceHealthTimer < diff) - { - if (AkamaGUID) - { - Creature* Akama = Unit::GetCreature((*m_creature), AkamaGUID); - if (Akama && Akama->isAlive()) - { - //10 % less health every few seconds. - m_creature->DealDamage(Akama, Akama->GetMaxHealth()/10, NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - ReduceHealthTimer = 12000; - } - } - }else ReduceHealthTimer -= diff; - - if (HasKilledAkama) - { - if (!HasKilledAkamaAndReseting)//do not let players kill Shade if Akama is dead and Shade is waiting for ResetTimer!! event would bug - { - HasKilledAkamaAndReseting = true; - m_creature->RemoveAllAuras(); - m_creature->DeleteThreatList(); - m_creature->CombatStop(); - //m_creature->SetHealth(m_creature->GetMaxHealth()); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->GetMotionMaster()->MoveTargetedHome(); - } - if (ResetTimer < diff) - { - EnterEvadeMode();// Reset a little while after killing Akama, evade and respawn Akama - return; - }else ResetTimer -= diff; - } - - DoMeleeAttackIfReady(); - } - } -}; - -void mob_ashtongue_channelerAI::JustDied(Unit* killer) -{ - Creature* Shade = (Unit::GetCreature((*m_creature), ShadeGUID)); - if (Shade && Shade->isAlive()) - CAST_AI(boss_shade_of_akamaAI, Shade->AI())->IncrementDeathCount(); - else error_log("SD2 ERROR: Channeler dead but unable to increment DeathCount for Shade of Akama."); -} - -void mob_ashtongue_sorcererAI::JustDied(Unit* killer) -{ - Creature* Shade = (Unit::GetCreature((*m_creature), ShadeGUID)); - if (Shade && Shade->isAlive()) - CAST_AI(boss_shade_of_akamaAI, Shade->AI())->IncrementDeathCount(m_creature->GetGUID()); - else error_log("SD2 ERROR: Sorcerer dead but unable to increment DeathCount for Shade of Akama."); -} - -struct TRINITY_DLL_DECL npc_akamaAI : public ScriptedAI -{ - npc_akamaAI(Creature* c) : ScriptedAI(c), summons(m_creature) - { - ShadeHasDied = false; - StartCombat = false; - pInstance = c->GetInstanceData(); - ShadeGUID = pInstance ? pInstance->GetData64(DATA_SHADEOFAKAMA) : NOT_STARTED; - m_creature->setActive(true); - EventBegun = false; - CastSoulRetrieveTimer = 0; - SoulRetrieveTimer = 0; - SummonBrokenTimer = 0; - EndingTalkCount = 0; - WayPointId = 0; - BrokenSummonIndex = 0; - BrokenList.clear(); - HasYelledOnce = false; - } - - ScriptedInstance* pInstance; - - uint64 ShadeGUID; - - uint32 DestructivePoisonTimer; - uint32 LightningBoltTimer; - uint32 CheckTimer; - uint32 CastSoulRetrieveTimer; - uint32 SoulRetrieveTimer; - uint32 SummonBrokenTimer; - uint32 EndingTalkCount; - uint32 WayPointId; - uint32 BrokenSummonIndex; - - std::list BrokenList; - - bool EventBegun; - bool ShadeHasDied; - bool StartCombat; - bool HasYelledOnce; - SummonList summons; - - void Reset() - { - DestructivePoisonTimer = 15000; - LightningBoltTimer = 10000; - CheckTimer = 2000; - - if (!EventBegun) - { - m_creature->SetUInt32Value(UNIT_NPC_FLAGS, 0); // Database sometimes has very very strange values - m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - } - summons.DespawnAll(); - } - - void JustSummoned(Creature *summon) - { - if (summon->GetEntry() == CREATURE_BROKEN) - summons.Summon(summon); - } - void SummonedCreatureDespawn(Creature *summon) - { - if (summon->GetEntry() == CREATURE_BROKEN) - summons.Despawn(summon); - } - - void EnterCombat(Unit* who) {} - - void BeginEvent(Player* pl) - { - if (!pInstance) - return; - - ShadeGUID = pInstance->GetData64(DATA_SHADEOFAKAMA); - if (!ShadeGUID) - return; - - Creature* Shade = (Unit::GetCreature((*m_creature), ShadeGUID)); - if (Shade) - { - pInstance->SetData(DATA_SHADEOFAKAMAEVENT, IN_PROGRESS); - // Prevent players from trying to restart event - m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - CAST_AI(boss_shade_of_akamaAI, Shade->AI())->SetAkamaGUID(m_creature->GetGUID()); - CAST_AI(boss_shade_of_akamaAI, Shade->AI())->SetSelectableChannelers(); - Shade->AddThreat(m_creature, 1000000.0f); - m_creature->CombatStart(Shade); - Shade->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_NONE); - Shade->SetUInt64Value(UNIT_FIELD_TARGET, m_creature->GetGUID()); - if (pl) Shade->AddThreat(pl, 1.0f); - DoZoneInCombat(Shade); - EventBegun = true; - } - } - - void MovementInform(uint32 type, uint32 id) - { - if (type != POINT_MOTION_TYPE) - return; - - switch(id) - { - case 0: ++WayPointId; break; - - case 1: - if (Creature* Shade = Unit::GetCreature(*m_creature, ShadeGUID)) - { - m_creature->SetUInt64Value(UNIT_FIELD_TARGET, ShadeGUID); - DoCast(Shade, SPELL_AKAMA_SOUL_RETRIEVE); - EndingTalkCount = 0; - SoulRetrieveTimer = 16000; - } - break; - } - } - - void JustDied(Unit* killer) - { - DoScriptText(SAY_DEATH, m_creature); - EventBegun = false; - ShadeHasDied = false; - StartCombat = false; - CastSoulRetrieveTimer = 0; - SoulRetrieveTimer = 0; - SummonBrokenTimer = 0; - EndingTalkCount = 0; - WayPointId = 0; - BrokenSummonIndex = 0; - BrokenList.clear(); - HasYelledOnce = false; - Creature* Shade = Unit::GetCreature((*m_creature), ShadeGUID); - if (Shade && Shade->isAlive()) - CAST_AI(boss_shade_of_akamaAI, Shade->AI())->HasKilledAkama = true; - summons.DespawnAll(); - } - - void UpdateAI(const uint32 diff) - { - if (!EventBegun) - return; - - if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 15 && !HasYelledOnce) - { - DoScriptText(SAY_LOW_HEALTH, m_creature); - HasYelledOnce = true; - } - - if (ShadeGUID && !StartCombat) - { - Creature* Shade = (Unit::GetCreature((*m_creature), ShadeGUID)); - if (Shade && Shade->isAlive()) - { - if (CAST_AI(boss_shade_of_akamaAI, Shade->AI())->IsBanished) - { - if (CastSoulRetrieveTimer < diff) - { - DoCast(Shade, SPELL_AKAMA_SOUL_CHANNEL); - CastSoulRetrieveTimer = 500; - }else CastSoulRetrieveTimer -= diff; - } - else - { - m_creature->InterruptNonMeleeSpells(false); - StartCombat = true; - } - } - } - - if (ShadeHasDied && (WayPointId == 1)) - { - if (pInstance) pInstance->SetData(DATA_SHADEOFAKAMAEVENT, DONE); - m_creature->GetMotionMaster()->MovePoint(WayPointId, AkamaWP[1].x, AkamaWP[1].y, AkamaWP[1].z); - ++WayPointId; - } - - if (!ShadeHasDied && StartCombat) - { - if (CheckTimer < diff) - { - if (ShadeGUID) - { - Creature* Shade = Unit::GetCreature((*m_creature), ShadeGUID); - if (Shade && !Shade->isAlive()) - { - ShadeHasDied = true; - WayPointId = 0; - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - m_creature->GetMotionMaster()->MovePoint(WayPointId, AkamaWP[0].x, AkamaWP[0].y, AkamaWP[0].z); - } - if (Shade && Shade->isAlive()) - { - if (Shade->getThreatManager().getThreatList().size() < 2) - Shade->AI()->EnterEvadeMode(); - } - } - CheckTimer = 5000; - }else CheckTimer -= diff; - } - - if (SummonBrokenTimer && BrokenSummonIndex < 4) - { - if (SummonBrokenTimer <= diff) - { - for(uint8 i = 0; i < 4; ++i) - { - float x = BrokenCoords[BrokenSummonIndex].x + (i*5); - float y = BrokenCoords[BrokenSummonIndex].y + (1*5); - float z = BrokenCoords[BrokenSummonIndex].z; - float o = BrokenCoords[BrokenSummonIndex].o; - Creature* Broken = m_creature->SummonCreature(CREATURE_BROKEN, x, y, z, o, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 360000); - if (Broken) - { - float wx = BrokenWP[BrokenSummonIndex].x + (i*5); - float wy = BrokenWP[BrokenSummonIndex].y + (i*5); - float wz = BrokenWP[BrokenSummonIndex].z; - Broken->GetMotionMaster()->MovePoint(0, wx, wy, wz); - Broken->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - BrokenList.push_back(Broken->GetGUID()); - } - } - ++BrokenSummonIndex; - SummonBrokenTimer = 1000; - }else SummonBrokenTimer -= diff; - } - - if (SoulRetrieveTimer) - if (SoulRetrieveTimer <= diff) - { - switch(EndingTalkCount) - { - case 0: - m_creature->HandleEmoteCommand(EMOTE_ONESHOT_ROAR); - ++EndingTalkCount; - SoulRetrieveTimer = 2000; - SummonBrokenTimer = 1; - break; - case 1: - DoScriptText(SAY_FREE, m_creature); - ++EndingTalkCount; - SoulRetrieveTimer = 25000; - break; - case 2: - if (!BrokenList.empty()) - { - bool Yelled = false; - for(std::list::iterator itr = BrokenList.begin(); itr != BrokenList.end(); ++itr) - if (Creature* pUnit = Unit::GetCreature(*m_creature, *itr)) - { - if (!Yelled) - { - DoScriptText(SAY_BROKEN_FREE_01, pUnit); - Yelled = true; - } - pUnit->HandleEmoteCommand(EMOTE_ONESHOT_KNEEL); - } - } - ++EndingTalkCount; - SoulRetrieveTimer = 1500; - break; - case 3: - if (!BrokenList.empty()) - { - for(std::list::iterator itr = BrokenList.begin(); itr != BrokenList.end(); ++itr) - if (Creature* pUnit = Unit::GetCreature(*m_creature, *itr)) - // This is the incorrect spell, but can't seem to find the right one. - pUnit->CastSpell(pUnit, 39656, true); - } - ++EndingTalkCount; - SoulRetrieveTimer = 5000; - break; - case 4: - if (!BrokenList.empty()) - { - for(std::list::iterator itr = BrokenList.begin(); itr != BrokenList.end(); ++itr) - if (Creature* pUnit = Unit::GetCreature((*m_creature), *itr)) - pUnit->MonsterYell(SAY_BROKEN_FREE_02, LANG_UNIVERSAL, 0); - } - SoulRetrieveTimer = 0; - break; - } - }else SoulRetrieveTimer -= diff; - - if (!UpdateVictim()) - return; - - if (DestructivePoisonTimer < diff) - { - Creature* Shade = Unit::GetCreature((*m_creature), ShadeGUID); - if (Shade && Shade->isAlive()) - DoCast(Shade, SPELL_DESTRUCTIVE_POISON); - DestructivePoisonTimer = 15000; - }else DestructivePoisonTimer -= diff; - - if (LightningBoltTimer < diff) - { - DoCast(m_creature->getVictim(), SPELL_LIGHTNING_BOLT); - LightningBoltTimer = 10000; - }else LightningBoltTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_shade_of_akama(Creature* pCreature) -{ - return new boss_shade_of_akamaAI (pCreature); -} - -CreatureAI* GetAI_mob_ashtongue_channeler(Creature* pCreature) -{ - return new mob_ashtongue_channelerAI (pCreature); -} - -CreatureAI* GetAI_mob_ashtongue_sorcerer(Creature* pCreature) -{ - return new mob_ashtongue_sorcererAI (pCreature); -} - -CreatureAI* GetAI_npc_akama_shade(Creature* pCreature) -{ - return new npc_akamaAI (pCreature); -} - -bool GossipSelect_npc_akama(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) //Fight time - { - pPlayer->CLOSE_GOSSIP_MENU(); - CAST_AI(npc_akamaAI, pCreature->AI())->BeginEvent(pPlayer); - } - - return true; -} - -bool GossipHello_npc_akama(Player* pPlayer, Creature* pCreature) -{ - if (pPlayer->isAlive()) - { - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - pPlayer->SEND_GOSSIP_MENU(907, pCreature->GetGUID()); - } - - return true; -} - -void AddSC_boss_shade_of_akama() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_shade_of_akama"; - newscript->GetAI = &GetAI_boss_shade_of_akama; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_ashtongue_channeler"; - newscript->GetAI = &GetAI_mob_ashtongue_channeler; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_ashtongue_sorcerer"; - newscript->GetAI = &GetAI_mob_ashtongue_sorcerer; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_akama_shade"; - newscript->GetAI = &GetAI_npc_akama_shade; - newscript->pGossipHello = &GossipHello_npc_akama; - newscript->pGossipSelect = &GossipSelect_npc_akama; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_supremus.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_supremus.cpp deleted file mode 100644 index 669b0a25629..00000000000 --- a/src/bindings/scripts/scripts/zone/black_temple/boss_supremus.cpp +++ /dev/null @@ -1,296 +0,0 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Supremus -SD%Complete: 95 -SDComment: Need to implement molten punch -SDCategory: Black Temple -EndScriptData */ - -#include "precompiled.h" -#include "def_black_temple.h" - -#define EMOTE_NEW_TARGET -1564010 -#define EMOTE_PUNCH_GROUND -1564011 //DoScriptText(EMOTE_PUNCH_GROUND, m_creature); -#define EMOTE_GROUND_CRACK -1564012 - -//Spells -#define SPELL_MOLTEN_PUNCH 40126 -#define SPELL_HATEFUL_STRIKE 41926 -#define SPELL_MOLTEN_FLAME 40980 -#define SPELL_VOLCANIC_ERUPTION 40117 -#define SPELL_VOLCANIC_SUMMON 40276 -#define SPELL_BERSERK 45078 - -#define CREATURE_VOLCANO 23085 -#define CREATURE_STALKER 23095 - -#define PHASE_STRIKE 1 -#define PHASE_CHASE 2 - -#define EVENT_BERSERK 1 -#define EVENT_SWITCH_PHASE 2 -#define EVENT_FLAME 3 -#define EVENT_VOLCANO 4 -#define EVENT_SWITCH_TARGET 5 -#define EVENT_HATEFUL_STRIKE 6 - -#define GCD_CAST 1 - -struct TRINITY_DLL_DECL molten_flameAI : public NullCreatureAI -{ - molten_flameAI(Creature *c) : NullCreatureAI(c) {} - - void InitializeAI() - { - float x, y, z; - me->GetNearPoint(me, x, y, z, 1, 100, M_PI*2*rand_norm()); - me->GetMotionMaster()->MovePoint(0, x, y, z); - me->SetVisibility(VISIBILITY_OFF); - me->CastSpell(me,SPELL_MOLTEN_FLAME,true); - } -}; - -struct TRINITY_DLL_DECL boss_supremusAI : public ScriptedAI -{ - boss_supremusAI(Creature *c) : ScriptedAI(c), summons(m_creature) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - EventMap events; - SummonList summons; - uint32 phase; - - void Reset() - { - if (pInstance) - { - if (m_creature->isAlive()) - { - pInstance->SetData(DATA_SUPREMUSEVENT, NOT_STARTED); - //ToggleDoors(true); - } - //else ToggleDoors(false); - } - - phase = 0; - - events.Reset(); - summons.DespawnAll(); - } - - void EnterCombat(Unit *who) - { - if (pInstance) - pInstance->SetData(DATA_SUPREMUSEVENT, IN_PROGRESS); - - ChangePhase(); - events.ScheduleEvent(EVENT_BERSERK, 900000, GCD_CAST); - events.ScheduleEvent(EVENT_FLAME, 20000, GCD_CAST); - } - - void ChangePhase() - { - if (!phase || phase == PHASE_CHASE) - { - phase = PHASE_STRIKE; - summons.DoAction(EVENT_VOLCANO, 0); - events.ScheduleEvent(EVENT_HATEFUL_STRIKE, 5000, GCD_CAST, PHASE_STRIKE); - m_creature->SetSpeed(MOVE_RUN, 1.2f); - m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, false); - m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, false); - } - else - { - phase = PHASE_CHASE; - events.ScheduleEvent(EVENT_VOLCANO, 5000, GCD_CAST, PHASE_CHASE); - events.ScheduleEvent(EVENT_SWITCH_TARGET, 10000, 0, PHASE_CHASE); - m_creature->SetSpeed(MOVE_RUN, 0.9f); - m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true); - m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true); - } - DoResetThreat(); - DoZoneInCombat(); - events.SetPhase(phase); - events.ScheduleEvent(EVENT_SWITCH_PHASE, 60000, GCD_CAST); - } - - void JustDied(Unit *killer) - { - if (pInstance) - { - pInstance->SetData(DATA_SUPREMUSEVENT, DONE); - pInstance->HandleGameObject(pInstance->GetData64(DATA_GAMEOBJECT_SUPREMUS_DOORS), true); - } - summons.DespawnAll(); - } - - void JustSummoned(Creature *summon) {summons.Summon(summon);} - void SummonedCreatureDespawn(Creature *summon) {summons.Despawn(summon);} - - Unit* CalculateHatefulStrikeTarget() - { - uint32 health = 0; - Unit* target = NULL; - - std::list& m_threatlist = m_creature->getThreatManager().getThreatList(); - std::list::iterator i = m_threatlist.begin(); - for (i = m_threatlist.begin(); i!= m_threatlist.end(); ++i) - { - Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid()); - if (pUnit && m_creature->IsWithinMeleeRange(pUnit)) - { - if (pUnit->GetHealth() > health) - { - health = pUnit->GetHealth(); - target = pUnit; - } - } - } - - return target; - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - events.Update(diff); - - while(uint32 eventId = events.ExecuteEvent()) - { - switch(eventId) - { - case EVENT_BERSERK: - m_creature->CastSpell(m_creature, SPELL_BERSERK, true); - break; - case EVENT_FLAME: - DoCast(m_creature, SPELL_MOLTEN_PUNCH); - events.DelayEvents(1500, GCD_CAST); - events.ScheduleEvent(EVENT_FLAME, 20000, GCD_CAST); - break; - case EVENT_HATEFUL_STRIKE: - if (Unit* target = CalculateHatefulStrikeTarget()) - DoCast(target, SPELL_HATEFUL_STRIKE); - events.DelayEvents(1000, GCD_CAST); - events.ScheduleEvent(EVENT_HATEFUL_STRIKE, 5000, GCD_CAST, PHASE_STRIKE); - break; - case EVENT_SWITCH_TARGET: - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true)) - { - DoResetThreat(); - m_creature->AddThreat(target, 5000000.0f); - DoScriptText(EMOTE_NEW_TARGET, m_creature); - } - events.ScheduleEvent(EVENT_SWITCH_TARGET, 10000, 0, PHASE_CHASE); - break; - case EVENT_VOLCANO: - { - Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 999, true); - if (!target) target = m_creature->getVictim(); - if (target) - { - //DoCast(target, SPELL_VOLCANIC_SUMMON);//movement bugged - m_creature->SummonCreature(CREATURE_VOLCANO,target->GetPositionX(),target->GetPositionY(),target->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN,30000); - DoScriptText(EMOTE_GROUND_CRACK, m_creature); - events.DelayEvents(1500, GCD_CAST); - } - events.ScheduleEvent(EVENT_VOLCANO, 10000, GCD_CAST, PHASE_CHASE); - return; - } - case EVENT_SWITCH_PHASE: - ChangePhase(); - break; - } - } - - DoMeleeAttackIfReady(); - } -}; - -struct TRINITY_DLL_DECL npc_volcanoAI : public Scripted_NoMovementAI -{ - npc_volcanoAI(Creature *c) : Scripted_NoMovementAI(c) {} - - void Reset() - { - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - //DoCast(m_creature, SPELL_VOLCANIC_ERUPTION); - me->SetReactState(REACT_PASSIVE); - wait = 3000; - } - uint32 wait; - - void EnterCombat(Unit *who) {} - - void MoveInLineOfSight(Unit *who) {} - - void DoAction(const uint32 info) - { - m_creature->RemoveAura(SPELL_VOLCANIC_ERUPTION); - } - - void UpdateAI(const uint32 diff) - { - if (wait<=diff)//wait 3secs before casting - { - DoCast(m_creature, SPELL_VOLCANIC_ERUPTION); - wait = 60000; - } - else wait -= diff; - } - -}; - -CreatureAI* GetAI_boss_supremus(Creature* pCreature) -{ - return new boss_supremusAI (pCreature); -} - -CreatureAI* GetAI_molten_flame(Creature* pCreature) -{ - return new molten_flameAI (pCreature); -} - -CreatureAI* GetAI_npc_volcano(Creature* pCreature) -{ - return new npc_volcanoAI (pCreature); -} - -void AddSC_boss_supremus() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_supremus"; - newscript->GetAI = &GetAI_boss_supremus; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="molten_flame"; - newscript->GetAI = &GetAI_molten_flame; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_volcano"; - newscript->GetAI = &GetAI_npc_volcano; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_teron_gorefiend.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_teron_gorefiend.cpp deleted file mode 100644 index 25a82877388..00000000000 --- a/src/bindings/scripts/scripts/zone/black_temple/boss_teron_gorefiend.cpp +++ /dev/null @@ -1,520 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Teron_Gorefiend -SD%Complete: 60 -SDComment: Requires Mind Control support for Ghosts. -SDCategory: Black Temple -EndScriptData */ - -#include "precompiled.h" -#include "def_black_temple.h" - - //Speech'n'sound -#define SAY_INTRO -1564037 -#define SAY_AGGRO -1564038 -#define SAY_SLAY1 -1564039 -#define SAY_SLAY2 -1564040 -#define SAY_SPELL1 -1564041 -#define SAY_SPELL2 -1564042 -#define SAY_SPECIAL1 -1564043 -#define SAY_SPECIAL2 -1564044 -#define SAY_ENRAGE -1564045 -#define SAY_DEATH -1564046 - -//Spells -#define SPELL_INCINERATE 40239 -#define SPELL_CRUSHING_SHADOWS 40243 -#define SPELL_SHADOWBOLT 40185 -#define SPELL_PASSIVE_SHADOWFORM 40326 -#define SPELL_SHADOW_OF_DEATH 40251 -#define SPELL_BERSERK 45078 - -#define SPELL_ATROPHY 40327 // Shadowy Constructs use this when they get within melee range of a player - -#define CREATURE_DOOM_BLOSSOM 23123 -#define CREATURE_SHADOWY_CONSTRUCT 23111 - -struct TRINITY_DLL_DECL mob_doom_blossomAI : public ScriptedAI -{ - mob_doom_blossomAI(Creature *c) : ScriptedAI(c) {} - - uint32 CheckTeronTimer; - uint32 ShadowBoltTimer; - uint64 TeronGUID; - - void Reset() - { - CheckTeronTimer = 5000; - ShadowBoltTimer = 12000; - TeronGUID = 0; - } - - void EnterCombat(Unit *who) { } - void AttackStart(Unit* who) { } - void MoveInLineOfSight(Unit* who) { } - - void Despawn() - { - m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - m_creature->RemoveCorpse(); - } - - void UpdateAI(const uint32 diff) - { - if (CheckTeronTimer < diff) - { - if (TeronGUID) - { - DoZoneInCombat(); - - Creature* Teron = (Unit::GetCreature((*m_creature), TeronGUID)); - if ((Teron) && (!Teron->isAlive() || Teron->IsInEvadeMode())) - Despawn(); - } - else - Despawn(); - - CheckTeronTimer = 5000; - }else CheckTeronTimer -= diff; - - if (ShadowBoltTimer < diff && m_creature->isInCombat()) - { - DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_SHADOWBOLT); - ShadowBoltTimer = 10000; - }else ShadowBoltTimer -= diff; - return; - } - - void SetTeronGUID(uint64 guid){ TeronGUID = guid; } -}; - -struct TRINITY_DLL_DECL mob_shadowy_constructAI : public ScriptedAI -{ - mob_shadowy_constructAI(Creature* c) : ScriptedAI(c) {} - - uint64 GhostGUID; - uint64 TeronGUID; - - uint32 CheckPlayerTimer; - uint32 CheckTeronTimer; - - void Reset() - { - GhostGUID = 0; - TeronGUID = 0; - - CheckPlayerTimer = 2000; - CheckTeronTimer = 5000; - } - - void EnterCombat(Unit* who) { } - - void MoveInLineOfSight(Unit *who) - { - if (!who || (!who->isAlive()) || (who->GetGUID() == GhostGUID)) - return; - - ScriptedAI::MoveInLineOfSight(who); - } - -/* Comment it out for now. NOTE TO FUTURE DEV: UNCOMMENT THIS OUT ONLY AFTER MIND CONTROL IS IMPLEMENTED - void DamageTaken(Unit* done_by, uint32 &damage) - { - if (done_by->GetGUID() != GhostGUID) - damage = 0; // Only the ghost can deal damage. - } - */ - - void CheckPlayers() - { - std::list& m_threatlist = m_creature->getThreatManager().getThreatList(); - if (m_threatlist.empty()) - return; // No threat list. Don't continue. - std::list::iterator itr = m_threatlist.begin(); - std::list targets; - for(; itr != m_threatlist.end(); ++itr) - { - Unit* pUnit = Unit::GetUnit((*m_creature), (*itr)->getUnitGuid()); - if (pUnit && pUnit->isAlive()) - targets.push_back(pUnit); - } - targets.sort(ObjectDistanceOrder(m_creature)); - Unit* target = targets.front(); - if (target && m_creature->IsWithinDistInMap(target, m_creature->GetAttackDistance(target))) - { - DoCast(target, SPELL_ATROPHY); - m_creature->AI()->AttackStart(target); - } - } - - void UpdateAI(const uint32 diff) - { - if (CheckPlayerTimer < diff) - { - CheckPlayers(); - CheckPlayerTimer = 3000; - }else CheckPlayerTimer -= diff; - - if (CheckTeronTimer < diff) - { - Creature* Teron = (Unit::GetCreature((*m_creature), TeronGUID)); - if (!Teron || !Teron->isAlive() || Teron->IsInEvadeMode()) - m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - - CheckTeronTimer = 5000; - }else CheckTeronTimer -= diff; - } -}; - -struct TRINITY_DLL_DECL boss_teron_gorefiendAI : public ScriptedAI -{ - boss_teron_gorefiendAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - uint32 IncinerateTimer; - uint32 SummonDoomBlossomTimer; - uint32 EnrageTimer; - uint32 CrushingShadowsTimer; - uint32 ShadowOfDeathTimer; - uint32 SummonShadowsTimer; - uint32 RandomYellTimer; - uint32 AggroTimer; - - uint64 AggroTargetGUID; - uint64 GhostGUID; // Player that gets killed by Shadow of Death and gets turned into a ghost - - bool Intro; - bool Done; - - void Reset() - { - if (pInstance) - pInstance->SetData(DATA_TERONGOREFIENDEVENT, NOT_STARTED); - - IncinerateTimer = 20000 + rand()%11000; - SummonDoomBlossomTimer = 12000; - EnrageTimer = 600000; - CrushingShadowsTimer = 22000; - SummonShadowsTimer = 60000; - RandomYellTimer = 50000; - - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - // Start off unattackable so that the intro is done properly - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - - AggroTimer = 20000; - AggroTargetGUID = 0; - Intro = false; - Done = false; - } - - void EnterCombat(Unit *who) {} - - void MoveInLineOfSight(Unit* pWho) - { - if (!Intro && pWho->GetTypeId() == TYPEID_PLAYER && pWho->isTargetableForAttack() && m_creature->IsHostileTo(pWho) && pWho->isInAccessiblePlaceFor(m_creature)) - { - if (m_creature->IsWithinDistInMap(pWho, VISIBLE_RANGE) && m_creature->IsWithinLOSInMap(pWho)) - { - if (pInstance) - pInstance->SetData(DATA_TERONGOREFIENDEVENT, IN_PROGRESS); - - m_creature->GetMotionMaster()->Clear(false); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - DoScriptText(SAY_INTRO, m_creature); - m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_TALK); - AggroTargetGUID = pWho->GetGUID(); - Intro = true; - } - } - if (Done) - ScriptedAI::MoveInLineOfSight(pWho); - } - - void KilledUnit(Unit *victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; - } - } - - void JustDied(Unit *victim) - { - if (pInstance) - pInstance->SetData(DATA_TERONGOREFIENDEVENT, DONE); - - DoScriptText(SAY_DEATH, m_creature); - } - - float CalculateRandomLocation(float Loc, uint32 radius) - { - float coord = Loc; - switch(rand()%2) - { - case 0: - coord += rand()%radius; - break; - case 1: - coord -= rand()%radius; - break; - } - return coord; - } - - void SetThreatList(Creature* Blossom) - { - if (!Blossom) return; - - std::list& m_threatlist = m_creature->getThreatManager().getThreatList(); - std::list::iterator i = m_threatlist.begin(); - for(i = m_threatlist.begin(); i != m_threatlist.end(); ++i) - { - Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid()); - if (pUnit && pUnit->isAlive()) - { - float threat = DoGetThreat(pUnit); - Blossom->AddThreat(pUnit, threat); - } - } - } - - void MindControlGhost() - { - /************************************************************************/ - /** NOTE FOR FUTURE DEVELOPER: PROPERLY IMPLEMENT THE GHOST PORTION *****/ - /** ONLY AFTER TrinIty FULLY IMPLEMENTS MIND CONTROL ABILITIES *****/ - /** THE CURRENT CODE IN THIS FUNCTION IS ONLY THE BEGINNING OF *****/ - /** WHAT IS FULLY NECESSARY FOR GOREFIEND TO BE 100% COMPLETE *****/ - /************************************************************************/ - - Unit* Ghost = NULL; - if (GhostGUID) - Ghost = Unit::GetUnit((*m_creature), GhostGUID); - if (Ghost && Ghost->isAlive() && Ghost->HasAura(SPELL_SHADOW_OF_DEATH)) - { - /*float x,y,z; - Ghost->GetPosition(x,y,z); - Creature* control = m_creature->SummonCreature(CREATURE_GHOST, x, y, z, 0, TEMPSUMMON_TIMED_DESAWN, 30000); - if (control) - { - CAST_PLR(Ghost)->Possess(control); - Ghost->DealDamage(Ghost, Ghost->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, - false); - }*/ - for(uint8 i = 0; i < 4; ++i) - { - Creature* Construct = NULL; - float X = CalculateRandomLocation(Ghost->GetPositionX(), 10); - float Y = CalculateRandomLocation(Ghost->GetPositionY(), 10); - Construct = m_creature->SummonCreature(CREATURE_SHADOWY_CONSTRUCT, X, Y, Ghost->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45000); - if (Construct) - { - Construct->CastSpell(Construct, SPELL_PASSIVE_SHADOWFORM, true); - SetThreatList(Construct); // Use same function as Doom Blossom to set Threat List. - CAST_AI(mob_shadowy_constructAI, Construct->AI())->GhostGUID = GhostGUID; - Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1); - if (!target) // someone's trying to solo. - target = m_creature->getVictim(); - - if (target) - Construct->GetMotionMaster()->MoveChase(target); - } - } - } - } - - void UpdateAI(const uint32 diff) - { - if (Intro && !Done) - { - if (AggroTimer < diff) - { - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - DoScriptText(SAY_AGGRO, m_creature); - m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_NONE); - Done = true; - if (AggroTargetGUID) - { - Unit* pUnit = Unit::GetUnit((*m_creature), AggroTargetGUID); - if (pUnit) - AttackStart(pUnit); - - DoZoneInCombat(); - } - else - { - EnterEvadeMode(); - return; - } - }else AggroTimer -= diff; - } - - if (!UpdateVictim() || !Done) - return; - - if (SummonShadowsTimer < diff) - { - //MindControlGhost(); - - for(uint8 i = 0; i < 2; ++i) - { - Creature* Shadow = NULL; - float X = CalculateRandomLocation(m_creature->GetPositionX(), 10); - Shadow = m_creature->SummonCreature(CREATURE_SHADOWY_CONSTRUCT, X, m_creature->GetPositionY(), m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 0); - if (Shadow) - { - Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1); - if (!target) - target = m_creature->getVictim(); - - if (target) - Shadow->AI()->AttackStart(target); - } - } - SummonShadowsTimer = 60000; - }else SummonShadowsTimer -= diff; - - if (SummonDoomBlossomTimer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - { - float X = CalculateRandomLocation(target->GetPositionX(), 20); - float Y = CalculateRandomLocation(target->GetPositionY(), 20); - float Z = target->GetPositionZ(); - Z = m_creature->GetMap()->GetVmapHeight(X, Y, Z, true); - Creature* DoomBlossom = m_creature->SummonCreature(CREATURE_DOOM_BLOSSOM, X, Y, Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 20000); - if (DoomBlossom) - { - DoomBlossom->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - DoomBlossom->setFaction(m_creature->getFaction()); - DoomBlossom->AddThreat(target, 1.0f); - CAST_AI(mob_doom_blossomAI, DoomBlossom->AI())->SetTeronGUID(m_creature->GetGUID()); - target->CombatStart(DoomBlossom); - SetThreatList(DoomBlossom); - SummonDoomBlossomTimer = 35000; - } - } - }else SummonDoomBlossomTimer -= diff; - - if (IncinerateTimer < diff) - { - Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1); - if (!target) - target = m_creature->getVictim(); - - if (target) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_SPECIAL1, m_creature); break; - case 1: DoScriptText(SAY_SPECIAL2, m_creature); break; - } - DoCast(target, SPELL_INCINERATE); - IncinerateTimer = 20000 + rand()%31 * 1000; - } - }else IncinerateTimer -= diff; - - if (CrushingShadowsTimer < diff) - { - Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (target && target->isAlive()) - DoCast(target, SPELL_CRUSHING_SHADOWS); - CrushingShadowsTimer = 10000 + rand()%16 * 1000; - }else CrushingShadowsTimer -= diff; - - /*** NOTE FOR FUTURE DEV: UNCOMMENT BELOW ONLY IF MIND CONTROL IS FULLY IMPLEMENTED **/ - /*if (ShadowOfDeathTimer < diff) - { - Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1); - - if (!target) - target = m_creature->getVictim(); - - if (target && target->isAlive() && target->GetTypeId() == TYPEID_PLAYER) - { - DoCast(target, SPELL_SHADOW_OF_DEATH); - GhostGUID = target->GetGUID(); - ShadowOfDeathTimer = 30000; - SummonShadowsTimer = 53000; // Make it VERY close but slightly less so that we can check if the aura is still on the player - } - }else ShadowOfDeathTimer -= diff;*/ - - if (RandomYellTimer < diff) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_SPELL1, m_creature); break; - case 1: DoScriptText(SAY_SPELL2, m_creature); break; - } - RandomYellTimer = 50000 + rand()%51 * 1000; - }else RandomYellTimer -= diff; - - if (!m_creature->HasAura(SPELL_BERSERK)) - { - if (EnrageTimer < diff) - { - DoCast(m_creature, SPELL_BERSERK); - DoScriptText(SAY_ENRAGE, m_creature); - }else EnrageTimer -= diff; - } - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_doom_blossom(Creature* pCreature) -{ - return new mob_doom_blossomAI(pCreature); -} - -CreatureAI* GetAI_mob_shadowy_construct(Creature* pCreature) -{ - return new mob_shadowy_constructAI(pCreature); -} - -CreatureAI* GetAI_boss_teron_gorefiend(Creature* pCreature) -{ - return new boss_teron_gorefiendAI (pCreature); -} - -void AddSC_boss_teron_gorefiend() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "mob_doom_blossom"; - newscript->GetAI = &GetAI_mob_doom_blossom; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_shadowy_construct"; - newscript->GetAI = &GetAI_mob_shadowy_construct; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="boss_teron_gorefiend"; - newscript->GetAI = &GetAI_boss_teron_gorefiend; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_warlord_najentus.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_warlord_najentus.cpp deleted file mode 100644 index 1616333b007..00000000000 --- a/src/bindings/scripts/scripts/zone/black_temple/boss_warlord_najentus.cpp +++ /dev/null @@ -1,226 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Warlord_Najentus -SD%Complete: 95 -SDComment: -SDCategory: Black Temple -EndScriptData */ - -#include "precompiled.h" -#include "def_black_temple.h" - -enum -{ - SAY_AGGRO = -1564000, - SAY_NEEDLE1 = -1564001, - SAY_NEEDLE2 = -1564002, - SAY_SLAY1 = -1564003, - SAY_SLAY2 = -1564004, - SAY_SPECIAL1 = -1564005, - SAY_SPECIAL2 = -1564006, - SAY_ENRAGE1 = -1564007, //is this text actually in use? - SAY_ENRAGE2 = -1564008, - SAY_DEATH = -1564009, - - //Spells - SPELL_NEEDLE_SPINE = 39992, - SPELL_TIDAL_BURST = 39878, - SPELL_TIDAL_SHIELD = 39872, - SPELL_IMPALING_SPINE = 39837, - SPELL_CREATE_NAJENTUS_SPINE = 39956, - SPELL_HURL_SPINE = 39948, - SPELL_BERSERK = 26662, - - GOBJECT_SPINE = 185584, - - EVENT_BERSERK = 1, - EVENT_YELL = 2, - EVENT_NEEDLE = 3, - EVENT_SPINE = 4, - EVENT_SHIELD = 5, - - GCD_CAST = 1, - GCD_YELL = 2 -}; - -struct TRINITY_DLL_DECL boss_najentusAI : public ScriptedAI -{ - boss_najentusAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - EventMap events; - - uint64 SpineTargetGUID; - - void Reset() - { - events.Reset(); - - SpineTargetGUID = 0; - - if (pInstance) - pInstance->SetData(DATA_HIGHWARLORDNAJENTUSEVENT, NOT_STARTED); - } - - void KilledUnit(Unit *victim) - { - DoScriptText(rand()%2 ? SAY_SLAY1 : SAY_SLAY2, m_creature); - events.DelayEvents(5000, GCD_YELL); - } - - void JustDied(Unit *victim) - { - if (pInstance) - pInstance->SetData(DATA_HIGHWARLORDNAJENTUSEVENT, DONE); - - DoScriptText(SAY_DEATH, m_creature); - } - - void SpellHit(Unit *caster, const SpellEntry *spell) - { - if (spell->Id == SPELL_HURL_SPINE && m_creature->HasAura(SPELL_TIDAL_SHIELD)) - { - m_creature->RemoveAurasDueToSpell(SPELL_TIDAL_SHIELD); - m_creature->CastSpell(m_creature, SPELL_TIDAL_BURST, true); - ResetTimer(); - } - } - - void EnterCombat(Unit *who) - { - if (pInstance) - pInstance->SetData(DATA_HIGHWARLORDNAJENTUSEVENT, IN_PROGRESS); - - DoScriptText(SAY_AGGRO, m_creature); - DoZoneInCombat(); - events.ScheduleEvent(EVENT_BERSERK, 480000, GCD_CAST); - events.ScheduleEvent(EVENT_YELL, 45000 + (rand()%76)*1000, GCD_YELL); - ResetTimer(); - } - - bool RemoveImpalingSpine() - { - if (!SpineTargetGUID) return false; - Unit* target = Unit::GetUnit(*m_creature, SpineTargetGUID); - if (target && target->HasAura(SPELL_IMPALING_SPINE)) - target->RemoveAurasDueToSpell(SPELL_IMPALING_SPINE); - SpineTargetGUID=0; - return true; - } - - void ResetTimer(uint32 inc = 0) - { - events.RescheduleEvent(EVENT_NEEDLE, 10000 + inc, GCD_CAST); - events.RescheduleEvent(EVENT_SPINE, 20000 + inc, GCD_CAST); - events.RescheduleEvent(EVENT_SHIELD, 60000 + inc); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - events.Update(diff); - - while(uint32 eventId = events.ExecuteEvent()) - { - switch(eventId) - { - case EVENT_SHIELD: - m_creature->CastSpell(m_creature, SPELL_TIDAL_SHIELD, true); - ResetTimer(45000); - break; - case EVENT_BERSERK: - DoScriptText(SAY_ENRAGE2, m_creature); - m_creature->CastSpell(m_creature, SPELL_BERSERK, true); - events.DelayEvents(15000, GCD_YELL); - break; - case EVENT_SPINE: - { - Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1); - if (!target) target = m_creature->getVictim(); - if (target) - { - m_creature->CastSpell(target, SPELL_IMPALING_SPINE, true); - SpineTargetGUID = target->GetGUID(); - //must let target summon, otherwise you cannot click the spine - target->SummonGameObject(GOBJECT_SPINE, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), m_creature->GetOrientation(), 0, 0, 0, 0, 30); - DoScriptText(rand()%2 ? SAY_NEEDLE1 : SAY_NEEDLE2, m_creature); - events.DelayEvents(1500, GCD_CAST); - events.DelayEvents(15000, GCD_YELL); - } - events.ScheduleEvent(EVENT_SPINE, 21000, GCD_CAST); - return; - } - case EVENT_NEEDLE: - { - //m_creature->CastSpell(m_creature, SPELL_NEEDLE_SPINE, true); - std::list target; - SelectTargetList(target, 3, SELECT_TARGET_RANDOM, 80, true); - for(std::list::iterator i = target.begin(); i != target.end(); ++i) - m_creature->CastSpell(*i, 39835, true); - events.ScheduleEvent(EVENT_NEEDLE, 15000+rand()%10000, GCD_CAST); - events.DelayEvents(1500, GCD_CAST); - return; - } - case EVENT_YELL: - DoScriptText(rand()%2 ? SAY_SPECIAL1 : SAY_SPECIAL2, m_creature); - events.ScheduleEvent(EVENT_YELL, 25000 + (rand()%76)*1000, GCD_YELL); - events.DelayEvents(15000, GCD_YELL); - break; - } - } - - DoMeleeAttackIfReady(); - } -}; - -bool GOHello_go_najentus_spine(Player* pPlayer, GameObject* pGo) -{ - if (ScriptedInstance* pInstance = pGo->GetInstanceData()) - if (Creature* Najentus = Unit::GetCreature(*pGo, pInstance->GetData64(DATA_HIGHWARLORDNAJENTUS))) - if (CAST_AI(boss_najentusAI, Najentus->AI())->RemoveImpalingSpine()) - { - pPlayer->CastSpell(pPlayer, SPELL_CREATE_NAJENTUS_SPINE, true); - pGo->DeleteObjectWithOwner(); - } - return true; -} - -CreatureAI* GetAI_boss_najentus(Creature* pCreature) -{ - return new boss_najentusAI (pCreature); -} - -void AddSC_boss_najentus() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_najentus"; - newscript->GetAI = &GetAI_boss_najentus; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "go_najentus_spine"; - newscript->pGOHello = &GOHello_go_najentus_spine; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/black_temple/def_black_temple.h b/src/bindings/scripts/scripts/zone/black_temple/def_black_temple.h deleted file mode 100644 index c98c0b1c363..00000000000 --- a/src/bindings/scripts/scripts/zone/black_temple/def_black_temple.h +++ /dev/null @@ -1,39 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ - -#ifndef DEF_BLACK_TEMPLE_H -#define DEF_BLACK_TEMPLE_H - -enum -{ - DATA_AKAMA = 1, - DATA_AKAMA_SHADE = 2, - DATA_GURTOGGBLOODBOILEVENT = 3, - DATA_HIGHWARLORDNAJENTUS = 4, - DATA_HIGHWARLORDNAJENTUSEVENT = 5, - DATA_ILLIDANSTORMRAGE = 6, - DATA_ILLIDANSTORMRAGEEVENT = 7, - DATA_ILLIDARICOUNCILEVENT = 8, - DATA_ILLIDARICOUNCIL = 9, - DATA_LADYMALANDE = 10, - DATA_HIGHNETHERMANCERZEREVOR = 11, - DATA_GATHIOSTHESHATTERER = 12, - DATA_VERASDARKSHADOW = 13, - DATA_MOTHERSHAHRAZEVENT = 14, - DATA_RELIQUARYOFSOULSEVENT = 15, - DATA_SHADEOFAKAMA = 16, - DATA_SHADEOFAKAMAEVENT = 17, - DATA_SUPREMUS = 18, - DATA_SUPREMUSEVENT = 19, - DATA_TERONGOREFIENDEVENT = 20, - DATA_GAMEOBJECT_NAJENTUS_GATE = 21, - DATA_GAMEOBJECT_ILLIDAN_GATE = 22, - DATA_GAMEOBJECT_ILLIDAN_DOOR_R = 23, - DATA_GAMEOBJECT_ILLIDAN_DOOR_L = 24, - DATA_GAMEOBJECT_SUPREMUS_DOORS = 25, - DATA_BLOOD_ELF_COUNCIL_VOICE = 26 -}; - -#endif - diff --git a/src/bindings/scripts/scripts/zone/black_temple/illidari_council.cpp b/src/bindings/scripts/scripts/zone/black_temple/illidari_council.cpp deleted file mode 100644 index 6b86140b659..00000000000 --- a/src/bindings/scripts/scripts/zone/black_temple/illidari_council.cpp +++ /dev/null @@ -1,872 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Illidari_Council -SD%Complete: 95 -SDComment: Circle of Healing not working properly. -SDCategory: Black Temple -EndScriptData */ - -#include "precompiled.h" -#include "def_black_temple.h" - -//Speech'n'Sounds -#define SAY_GATH_SLAY -1564085 -#define SAY_GATH_SLAY_COMNT -1564089 -#define SAY_GATH_DEATH -1564093 -#define SAY_GATH_SPECIAL1 -1564077 -#define SAY_GATH_SPECIAL2 -1564081 - -#define SAY_VERA_SLAY -1564086 -#define SAY_VERA_COMNT -1564089 -#define SAY_VERA_DEATH -1564094 -#define SAY_VERA_SPECIAL1 -1564078 -#define SAY_VERA_SPECIAL2 -1564082 - -#define SAY_MALA_SLAY -1564087 -#define SAY_MALA_COMNT -1564090 -#define SAY_MALA_DEATH -1564095 -#define SAY_MALA_SPECIAL1 -1564079 -#define SAY_MALA_SPECIAL2 -1564083 - -#define SAY_ZERE_SLAY -1564088 -#define SAY_ZERE_COMNT -1564091 -#define SAY_ZERE_DEATH -1564096 -#define SAY_ZERE_SPECIAL1 -1564080 -#define SAY_ZERE_SPECIAL2 -1564084 - -#define ERROR_INST_DATA "SD2 ERROR: Instance Data for Black Temple not set properly; Illidari Council event will not function properly." - -#define AKAMAID 23089 - -struct CouncilYells -{ - int32 entry; - uint32 timer; -}; - -static CouncilYells CouncilAggro[]= -{ - {-1564069, 5000}, // Gathios - {-1564070, 5500}, // Veras - {-1564071, 5000}, // Malande - {-1564072, 0}, // Zerevor -}; - -// Need to get proper timers for this later -static CouncilYells CouncilEnrage[]= -{ - {-1564073, 2000}, // Gathios - {-1564074, 6000}, // Veras - {-1564075, 5000}, // Malande - {-1564076, 0}, // Zerevor -}; - -// High Nethermancer Zerevor's spells -#define SPELL_FLAMESTRIKE 41481 -#define SPELL_BLIZZARD 41482 -#define SPELL_ARCANE_BOLT 41483 -#define SPELL_ARCANE_EXPLOSION 41524 -#define SPELL_DAMPEN_MAGIC 41478 - -// Lady Malande's spells -#define SPELL_EMPOWERED_SMITE 41471 -#define SPELL_CIRCLE_OF_HEALING 41455 -#define SPELL_REFLECTIVE_SHIELD 41475 -#define SPELL_DIVINE_WRATH 41472 -#define SPELL_HEAL_VISUAL 24171 - -// Gathios the Shatterer's spells -#define SPELL_BLESS_PROTECTION 41450 -#define SPELL_BLESS_SPELLWARD 41451 -#define SPELL_CONSECRATION 41541 -#define SPELL_HAMMER_OF_JUSTICE 41468 -#define SPELL_SEAL_OF_COMMAND 41469 -#define SPELL_SEAL_OF_BLOOD 41459 -#define SPELL_CHROMATIC_AURA 41453 -#define SPELL_DEVOTION_AURA 41452 - -// Veras Darkshadow's spells -#define SPELL_DEADLY_POISON 41485 -#define SPELL_ENVENOM 41487 -#define SPELL_VANISH 41479 - -#define SPELL_BERSERK 45078 - -struct TRINITY_DLL_DECL mob_blood_elf_council_voice_triggerAI : public ScriptedAI -{ - mob_blood_elf_council_voice_triggerAI(Creature* c) : ScriptedAI(c) - { - for(uint8 i = 0; i < 4; ++i) - Council[i] = 0; - } - - uint64 Council[4]; - - uint32 EnrageTimer; - uint32 AggroYellTimer; - - uint8 YellCounter; // Serves as the counter for both the aggro and enrage yells - - bool EventStarted; - - void Reset() - { - EnrageTimer = 900000; // 15 minutes - AggroYellTimer = 500; - - YellCounter = 0; - - EventStarted = false; - } - - // finds and stores the GUIDs for each Council member using instance data system. - void LoadCouncilGUIDs() - { - if (ScriptedInstance* pInstance = (m_creature->GetInstanceData())) - { - Council[0] = pInstance->GetData64(DATA_GATHIOSTHESHATTERER); - Council[1] = pInstance->GetData64(DATA_VERASDARKSHADOW); - Council[2] = pInstance->GetData64(DATA_LADYMALANDE); - Council[3] = pInstance->GetData64(DATA_HIGHNETHERMANCERZEREVOR); - }else error_log(ERROR_INST_DATA); - } - - void EnterCombat(Unit* who) {} - - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - - void UpdateAI(const uint32 diff) - { - if (!EventStarted) - return; - - if (YellCounter > 3) - return; - - if (AggroYellTimer) - { - if (AggroYellTimer <= diff) - { - if (Unit* pMember = Unit::GetUnit(*m_creature, Council[YellCounter])) - { - DoScriptText(CouncilAggro[YellCounter].entry, pMember); - AggroYellTimer = CouncilAggro[YellCounter].timer; - } - ++YellCounter; - if (YellCounter > 3) - YellCounter = 0; // Reuse for Enrage Yells - }else AggroYellTimer -= diff; - } - - if (EnrageTimer) - { - if (EnrageTimer <= diff) - { - if (Unit* pMember = Unit::GetUnit(*m_creature, Council[YellCounter])) - { - pMember->CastSpell(pMember, SPELL_BERSERK, true); - DoScriptText(CouncilEnrage[YellCounter].entry, pMember); - EnrageTimer = CouncilEnrage[YellCounter].timer; - } - ++YellCounter; - }else EnrageTimer -= diff; - } - } -}; - -struct TRINITY_DLL_DECL mob_illidari_councilAI : public ScriptedAI -{ - mob_illidari_councilAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - for(uint8 i = 0; i < 4; ++i) - Council[i] = 0; - } - - ScriptedInstance* pInstance; - - uint64 Council[4]; - - uint32 CheckTimer; - uint32 EndEventTimer; - - uint8 DeathCount; - - bool EventBegun; - - void Reset() - { - CheckTimer = 2000; - EndEventTimer = 0; - - DeathCount = 0; - - Creature* pMember = NULL; - for(uint8 i = 0; i < 4; ++i) - { - if (pMember = (Unit::GetCreature((*m_creature), Council[i]))) - { - if (!pMember->isAlive()) - { - pMember->RemoveCorpse(); - pMember->Respawn(); - } - pMember->AI()->EnterEvadeMode(); - } - } - - if (pInstance) - { - pInstance->SetData(DATA_ILLIDARICOUNCILEVENT, NOT_STARTED); - if (Creature* VoiceTrigger = (Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_BLOOD_ELF_COUNCIL_VOICE)))) - VoiceTrigger->AI()->EnterEvadeMode(); - } - - EventBegun = false; - - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetDisplayId(11686); - } - - void EnterCombat(Unit *who) {} - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - - void StartEvent(Unit *target) - { - if (!pInstance) return; - - if (target && target->isAlive()) - { - Council[0] = pInstance->GetData64(DATA_GATHIOSTHESHATTERER); - Council[1] = pInstance->GetData64(DATA_HIGHNETHERMANCERZEREVOR); - Council[2] = pInstance->GetData64(DATA_LADYMALANDE); - Council[3] = pInstance->GetData64(DATA_VERASDARKSHADOW); - - // Start the event for the Voice Trigger - if (Creature* VoiceTrigger = (Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_BLOOD_ELF_COUNCIL_VOICE)))) - { - CAST_AI(mob_blood_elf_council_voice_triggerAI, VoiceTrigger->AI())->LoadCouncilGUIDs(); - CAST_AI(mob_blood_elf_council_voice_triggerAI, VoiceTrigger->AI())->EventStarted = true; - } - - for(uint8 i = 0; i < 4; ++i) - { - Unit* Member = NULL; - if (Council[i]) - { - Member = Unit::GetUnit((*m_creature), Council[i]); - if (Member && Member->isAlive()) - CAST_CRE(Member)->AI()->AttackStart(target); - } - } - - pInstance->SetData(DATA_ILLIDARICOUNCILEVENT, IN_PROGRESS); - - EventBegun = true; - } - } - - void UpdateAI(const uint32 diff) - { - if (!EventBegun) return; - - if (EndEventTimer) - { - if (EndEventTimer <= diff) - { - if (DeathCount > 3) - { - if (pInstance) - { - if (Creature* VoiceTrigger = (Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_BLOOD_ELF_COUNCIL_VOICE)))) - VoiceTrigger->DealDamage(VoiceTrigger, VoiceTrigger->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - pInstance->SetData(DATA_ILLIDARICOUNCILEVENT, DONE); - m_creature->SummonCreature(AKAMAID,746.466980f,304.394989f,311.90208f,6.272870f,TEMPSUMMON_DEAD_DESPAWN,0); - } - m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - return; - } - - Creature* pMember = (Unit::GetCreature(*m_creature, Council[DeathCount])); - if (pMember && pMember->isAlive()) - pMember->DealDamage(pMember, pMember->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - ++DeathCount; - EndEventTimer = 1500; - }else EndEventTimer -= diff; - } - - if (CheckTimer) - { - if (CheckTimer <= diff) - { - uint8 EvadeCheck = 0; - for(uint8 i = 0; i < 4; ++i) - { - if (Council[i]) - { - if (Creature* Member = (Unit::GetCreature((*m_creature), Council[i]))) - { - // This is the evade/death check. - if (Member->isAlive() && !Member->getVictim()) - ++EvadeCheck; //If all members evade, we reset so that players can properly reset the event - else if (!Member->isAlive()) // If even one member dies, kill the rest, set instance data, and kill self. - { - EndEventTimer = 1000; - CheckTimer = 0; - return; - } - } - } - } - - if (EvadeCheck > 3) - Reset(); - - CheckTimer = 2000; - }else CheckTimer -= diff; - } - - } -}; - -struct TRINITY_DLL_DECL boss_illidari_councilAI : public ScriptedAI -{ - boss_illidari_councilAI(Creature* c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - for(uint8 i = 0; i < 4; ++i) - Council[i] = 0; - LoadedGUIDs = false; - } - - uint64 Council[4]; - - ScriptedInstance* pInstance; - - bool LoadedGUIDs; - - void EnterCombat(Unit* who) - { - if (pInstance) - { - Creature* Controller = (Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_ILLIDARICOUNCIL))); - if (Controller) - CAST_AI(mob_illidari_councilAI, Controller->AI())->StartEvent(who); - } - else - { - error_log(ERROR_INST_DATA); - EnterEvadeMode(); - return; - } - DoZoneInCombat(); - // Load GUIDs on first aggro because the Creature guids are only set as the creatures are created in world- - // this means that for each pCreature, it will attempt to LoadGUIDs even though some of the other creatures are - // not in world, and thus have no GUID set in the instance data system. Putting it in aggro ensures that all the creatures - // have been loaded and have their GUIDs set in the instance data system. - if (!LoadedGUIDs) - LoadGUIDs(); - } - - void EnterEvadeMode() - { - for(uint8 i = 0; i < 4; ++i) - { - if (Unit* pUnit = Unit::GetUnit(*m_creature, Council[i])) - if (pUnit != m_creature && pUnit->getVictim()) - { - AttackStart(pUnit->getVictim()); - return; - } - } - ScriptedAI::EnterEvadeMode(); - } - - void DamageTaken(Unit* done_by, uint32 &damage) - { - if (done_by == m_creature) - return; - - damage /= 4; - for(uint8 i = 0; i < 4; ++i) - { - if (Creature* pUnit = Unit::GetCreature(*m_creature, Council[i])) - if (pUnit != m_creature && damage < pUnit->GetHealth()) - { - pUnit->SetHealth(pUnit->GetHealth() - damage); - pUnit->LowerPlayerDamageReq(damage); - } - } - } - - void LoadGUIDs() - { - if (!pInstance) - { - error_log(ERROR_INST_DATA); - return; - } - - Council[0] = pInstance->GetData64(DATA_LADYMALANDE); - Council[1] = pInstance->GetData64(DATA_HIGHNETHERMANCERZEREVOR); - Council[2] = pInstance->GetData64(DATA_GATHIOSTHESHATTERER); - Council[3] = pInstance->GetData64(DATA_VERASDARKSHADOW); - - LoadedGUIDs = true; - } -}; - -struct TRINITY_DLL_DECL boss_gathios_the_shattererAI : public boss_illidari_councilAI -{ - boss_gathios_the_shattererAI(Creature *c) : boss_illidari_councilAI(c) {} - - uint32 ConsecrationTimer; - uint32 HammerOfJusticeTimer; - uint32 SealTimer; - uint32 AuraTimer; - uint32 BlessingTimer; - - void Reset() - { - ConsecrationTimer = 40000; - HammerOfJusticeTimer = 10000; - SealTimer = 40000; - AuraTimer = 90000; - BlessingTimer = 60000; - } - - void KilledUnit(Unit *victim) - { - DoScriptText(SAY_GATH_SLAY, m_creature); - } - - void JustDied(Unit *victim) - { - DoScriptText(SAY_GATH_DEATH, m_creature); - } - - Unit* SelectCouncilMember() - { - Unit* pUnit = m_creature; - uint32 member = 0; // He chooses Lady Malande most often - - if (rand()%10 == 0) // But there is a chance he picks someone else. - member = urand(1, 3); - - if (member != 2) // No need to create another pointer to us using Unit::GetUnit - pUnit = Unit::GetUnit((*m_creature), Council[member]); - return pUnit; - } - - void CastAuraOnCouncil() - { - uint32 spellid = 0; - switch(rand()%2) - { - case 0: spellid = SPELL_DEVOTION_AURA; break; - case 1: spellid = SPELL_CHROMATIC_AURA; break; - } - for(uint8 i = 0; i < 4; ++i) - { - Unit* pUnit = Unit::GetUnit((*m_creature), Council[i]); - if (pUnit) - pUnit->CastSpell(pUnit, spellid, true, 0, 0, m_creature->GetGUID()); - } - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (BlessingTimer < diff) - { - if (Unit* pUnit = SelectCouncilMember()) - { - switch(rand()%2) - { - case 0: DoCast(pUnit, SPELL_BLESS_SPELLWARD); break; - case 1: DoCast(pUnit, SPELL_BLESS_PROTECTION); break; - } - } - BlessingTimer = 60000; - }else BlessingTimer -= diff; - - if (ConsecrationTimer < diff) - { - DoCast(m_creature, SPELL_CONSECRATION); - ConsecrationTimer = 40000; - }else ConsecrationTimer -= diff; - - if (HammerOfJusticeTimer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - { - // is in ~10-40 yd range - if (m_creature->IsInRange(target, 10.0f, 40.0f, false)) - { - DoCast(target, SPELL_HAMMER_OF_JUSTICE); - HammerOfJusticeTimer = 20000; - } - } - }else HammerOfJusticeTimer -= diff; - - if (SealTimer < diff) - { - switch(rand()%2) - { - case 0: DoCast(m_creature, SPELL_SEAL_OF_COMMAND); break; - case 1: DoCast(m_creature, SPELL_SEAL_OF_BLOOD); break; - } - SealTimer = 40000; - }else SealTimer -= diff; - - if (AuraTimer < diff) - { - CastAuraOnCouncil(); - AuraTimer = 90000; - }else AuraTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -struct TRINITY_DLL_DECL boss_high_nethermancer_zerevorAI : public boss_illidari_councilAI -{ - boss_high_nethermancer_zerevorAI(Creature *c) : boss_illidari_councilAI(c) {} - - uint32 BlizzardTimer; - uint32 FlamestrikeTimer; - uint32 ArcaneBoltTimer; - uint32 DampenMagicTimer; - uint32 Cooldown; - uint32 ArcaneExplosionTimer; - - void Reset() - { - BlizzardTimer = 30000 + rand()%61 * 1000; - FlamestrikeTimer = 30000 + rand()%61 * 1000; - ArcaneBoltTimer = 10000; - DampenMagicTimer = 2000; - ArcaneExplosionTimer = 14000; - Cooldown = 0; - } - - void KilledUnit(Unit *victim) - { - DoScriptText(SAY_ZERE_SLAY, m_creature); - } - - void JustDied(Unit *victim) - { - DoScriptText(SAY_ZERE_DEATH, m_creature); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (Cooldown) - { - if (Cooldown < diff) Cooldown = 0; - else - { - Cooldown -= diff; - return; // Don't cast any other spells if global cooldown is still ticking - } - } - - if (DampenMagicTimer < diff) - { - DoCast(m_creature, SPELL_DAMPEN_MAGIC); - Cooldown = 1000; - DampenMagicTimer = 67200; // almost 1,12 minutes - ArcaneBoltTimer += 1000; // Give the Mage some time to spellsteal Dampen. - }else DampenMagicTimer -= diff; - - if (ArcaneExplosionTimer < diff) - { - DoCast(m_creature->getVictim(), SPELL_ARCANE_EXPLOSION); - Cooldown = 1000; - ArcaneExplosionTimer = 14000; - }else ArcaneExplosionTimer -= diff; - - if (ArcaneBoltTimer < diff) - { - DoCast(m_creature->getVictim(), SPELL_ARCANE_BOLT); - ArcaneBoltTimer = 3000; - Cooldown = 2000; - }else ArcaneBoltTimer -= diff; - - if (BlizzardTimer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - { - DoCast(target, SPELL_BLIZZARD); - BlizzardTimer = 45000 + rand()%46 * 1000; - FlamestrikeTimer += 10000; - Cooldown = 1000; - } - }else BlizzardTimer -= diff; - - if (FlamestrikeTimer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - { - DoCast(target, SPELL_FLAMESTRIKE); - FlamestrikeTimer = 55000 + rand()%46 * 1000; - BlizzardTimer += 10000; - Cooldown = 2000; - } - }else FlamestrikeTimer -= diff; - } -}; - -struct TRINITY_DLL_DECL boss_lady_malandeAI : public boss_illidari_councilAI -{ - boss_lady_malandeAI(Creature *c) : boss_illidari_councilAI(c) {} - - uint32 EmpoweredSmiteTimer; - uint32 CircleOfHealingTimer; - uint32 DivineWrathTimer; - uint32 ReflectiveShieldTimer; - - void Reset() - { - EmpoweredSmiteTimer = 38000; - CircleOfHealingTimer = 20000; - DivineWrathTimer = 40000; - ReflectiveShieldTimer = 0; - } - - void KilledUnit(Unit *victim) - { - DoScriptText(SAY_MALA_SLAY, m_creature); - } - - void JustDied(Unit *victim) - { - DoScriptText(SAY_MALA_DEATH, m_creature); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (EmpoweredSmiteTimer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - { - DoCast(target, SPELL_EMPOWERED_SMITE); - EmpoweredSmiteTimer = 38000; - } - }else EmpoweredSmiteTimer -= diff; - - if (CircleOfHealingTimer < diff) - { - DoCast(m_creature, SPELL_CIRCLE_OF_HEALING); - CircleOfHealingTimer = 60000; - }else CircleOfHealingTimer -= diff; - - if (DivineWrathTimer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - { - DoCast(target, SPELL_DIVINE_WRATH); - DivineWrathTimer = 40000 + rand()%41 * 1000; - } - }else DivineWrathTimer -= diff; - - if (ReflectiveShieldTimer < diff) - { - DoCast(m_creature, SPELL_REFLECTIVE_SHIELD); - ReflectiveShieldTimer = 65000; - }else ReflectiveShieldTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -struct TRINITY_DLL_DECL boss_veras_darkshadowAI : public boss_illidari_councilAI -{ - boss_veras_darkshadowAI(Creature *c) : boss_illidari_councilAI(c) {} - - uint64 EnvenomTargetGUID; - - uint32 DeadlyPoisonTimer; - uint32 VanishTimer; - uint32 AppearEnvenomTimer; - - bool HasVanished; - - void Reset() - { - EnvenomTargetGUID = 0; - - DeadlyPoisonTimer = 20000; - VanishTimer = 60000 + rand()%61 * 1000; - AppearEnvenomTimer = 150000; - - HasVanished = false; - m_creature->SetVisibility(VISIBILITY_ON); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - } - - void KilledUnit(Unit *victim) - { - DoScriptText(SAY_VERA_SLAY, m_creature); - } - - void JustDied(Unit *victim) - { - DoScriptText(SAY_VERA_DEATH, m_creature); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (!HasVanished) - { - if (DeadlyPoisonTimer < diff) - { - DoCast(m_creature->getVictim(), SPELL_DEADLY_POISON); - DeadlyPoisonTimer = 15000 + rand()%31 * 1000; - }else DeadlyPoisonTimer -= diff; - - if (AppearEnvenomTimer < diff) // Cast Envenom. This is cast 4 seconds after Vanish is over - { - DoCast(m_creature->getVictim(), SPELL_ENVENOM); - AppearEnvenomTimer = 90000; - }else AppearEnvenomTimer -= diff; - - if (VanishTimer < diff) // Disappear and stop attacking, but follow a random unit - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - { - VanishTimer = 30000; - AppearEnvenomTimer= 28000; - HasVanished = true; - m_creature->SetVisibility(VISIBILITY_OFF); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - DoResetThreat(); - // Chase a unit. Check before DoMeleeAttackIfReady prevents from attacking - m_creature->AddThreat(target, 500000.0f); - m_creature->GetMotionMaster()->MoveChase(target); - } - }else VanishTimer -= diff; - - DoMeleeAttackIfReady(); - } - else - { - if (VanishTimer < diff) // Become attackable and poison current target - { - Unit* target = m_creature->getVictim(); - DoCast(target, SPELL_DEADLY_POISON); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - DoResetThreat(); - m_creature->AddThreat(target, 3000.0f); // Make Veras attack his target for a while, he will cast Envenom 4 seconds after. - DeadlyPoisonTimer += 6000; - VanishTimer = 90000; - AppearEnvenomTimer = 4000; - HasVanished = false; - }else VanishTimer -= diff; - - if (AppearEnvenomTimer < diff) // Appear 2 seconds before becoming attackable (Shifting out of vanish) - { - m_creature->GetMotionMaster()->Clear(); - m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); - m_creature->SetVisibility(VISIBILITY_ON); - AppearEnvenomTimer = 6000; - }else AppearEnvenomTimer -= diff; - } - } -}; - -CreatureAI* GetAI_mob_blood_elf_council_voice_trigger(Creature* c) -{ - return new mob_blood_elf_council_voice_triggerAI(c); -} - -CreatureAI* GetAI_mob_illidari_council(Creature* pCreature) -{ - return new mob_illidari_councilAI (pCreature); -} - -CreatureAI* GetAI_boss_gathios_the_shatterer(Creature* pCreature) -{ - return new boss_gathios_the_shattererAI (pCreature); -} - -CreatureAI* GetAI_boss_lady_malande(Creature* pCreature) -{ - return new boss_lady_malandeAI (pCreature); -} - -CreatureAI* GetAI_boss_veras_darkshadow(Creature* pCreature) -{ - return new boss_veras_darkshadowAI (pCreature); -} - -CreatureAI* GetAI_boss_high_nethermancer_zerevor(Creature* pCreature) -{ - return new boss_high_nethermancer_zerevorAI (pCreature); -} - -void AddSC_boss_illidari_council() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="mob_illidari_council"; - newscript->GetAI = &GetAI_mob_illidari_council; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_blood_elf_council_voice_trigger"; - newscript->GetAI = &GetAI_mob_blood_elf_council_voice_trigger; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="boss_gathios_the_shatterer"; - newscript->GetAI = &GetAI_boss_gathios_the_shatterer; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="boss_lady_malande"; - newscript->GetAI = &GetAI_boss_lady_malande; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="boss_veras_darkshadow"; - newscript->GetAI = &GetAI_boss_veras_darkshadow; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="boss_high_nethermancer_zerevor"; - newscript->GetAI = &GetAI_boss_high_nethermancer_zerevor; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/black_temple/instance_black_temple.cpp b/src/bindings/scripts/scripts/zone/black_temple/instance_black_temple.cpp deleted file mode 100644 index 173632009ba..00000000000 --- a/src/bindings/scripts/scripts/zone/black_temple/instance_black_temple.cpp +++ /dev/null @@ -1,346 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -/* ScriptData -SDName: Instance_Black_Temple -SD%Complete: 100 -SDComment: Instance Data Scripts and functions to acquire mobs and set encounter status for use in various Black Temple Scripts -SDCategory: Black Temple -EndScriptData */ - -#include "precompiled.h" -#include "def_black_temple.h" - -#define MAX_ENCOUNTER 9 - -/* Black Temple encounters: -0 - High Warlord Naj'entus event -1 - Supremus Event -2 - Shade of Akama Event -3 - Teron Gorefiend Event -4 - Gurtogg Bloodboil Event -5 - Reliquary Of Souls Event -6 - Mother Shahraz Event -7 - Illidari Council Event -8 - Illidan Stormrage Event -*/ - -struct TRINITY_DLL_DECL instance_black_temple : public ScriptedInstance -{ - instance_black_temple(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; - - uint32 m_auiEncounter[MAX_ENCOUNTER]; - std::string str_data; - - uint64 Najentus; - uint64 Akama; // This is the Akama that starts the Illidan encounter. - uint64 Akama_Shade; // This is the Akama that starts the Shade of Akama encounter. - uint64 ShadeOfAkama; - uint64 Supremus; - uint64 LadyMalande; - uint64 GathiosTheShatterer; - uint64 HighNethermancerZerevor; - uint64 VerasDarkshadow; - uint64 IllidariCouncil; - uint64 BloodElfCouncilVoice; - uint64 IllidanStormrage; - - uint64 NajentusGate; - uint64 MainTempleDoors; - uint64 ShadeOfAkamaDoor; - uint64 CommonDoor;//Teron - uint64 TeronDoor; - uint64 GuurtogDoor; - uint64 MotherDoor; - uint64 TempleDoor;//Befor mother - uint64 CouncilDoor; - uint64 SimpleDoor;//council - uint64 IllidanGate; - uint64 IllidanDoor[2]; - - void Initialize() - { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - - Najentus = 0; - Akama = 0; - Akama_Shade = 0; - ShadeOfAkama = 0; - Supremus = 0; - LadyMalande = 0; - GathiosTheShatterer = 0; - HighNethermancerZerevor = 0; - VerasDarkshadow = 0; - IllidariCouncil = 0; - BloodElfCouncilVoice = 0; - IllidanStormrage = 0; - - NajentusGate = 0; - MainTempleDoors = 0; - ShadeOfAkamaDoor= 0; - CommonDoor = 0;//teron - TeronDoor = 0; - GuurtogDoor = 0; - MotherDoor = 0; - TempleDoor = 0; - SimpleDoor = 0;//Bycouncil - CouncilDoor = 0; - IllidanGate = 0; - IllidanDoor[0] = 0; - IllidanDoor[1] = 0; - } - - bool IsEncounterInProgress() const - { - for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) return true; - - return false; - } - - Player* GetPlayerInMap() - { - Map::PlayerList const& players = instance->GetPlayers(); - - if (!players.isEmpty()) - { - for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) - { - if (Player* plr = itr->getSource()) - return plr; - } - } - - debug_log("TSCR: Instance Black Temple: GetPlayerInMap, but PlayerList is empty!"); - return NULL; - } - - void OnCreatureCreate(Creature* pCreature, bool add) - { - switch(pCreature->GetEntry()) - { - case 22887: Najentus = pCreature->GetGUID(); break; - case 23089: Akama = pCreature->GetGUID(); break; - case 22990: Akama_Shade = pCreature->GetGUID(); break; - case 22841: ShadeOfAkama = pCreature->GetGUID(); break; - case 22898: Supremus = pCreature->GetGUID(); break; - case 22917: IllidanStormrage = pCreature->GetGUID(); break; - case 22949: GathiosTheShatterer = pCreature->GetGUID(); break; - case 22950: HighNethermancerZerevor = pCreature->GetGUID(); break; - case 22951: LadyMalande = pCreature->GetGUID(); break; - case 22952: VerasDarkshadow = pCreature->GetGUID(); break; - case 23426: IllidariCouncil = pCreature->GetGUID(); break; - case 23499: BloodElfCouncilVoice = pCreature->GetGUID(); break; - } - } - - void OnGameObjectCreate(GameObject* pGo, bool add) - { - switch(pGo->GetEntry()) - { - case 185483: NajentusGate = pGo->GetGUID();// Gate past Naj'entus (at the entrance to Supermoose's courtyards) - if (m_auiEncounter[0] == DONE)HandleGameObject(NULL,true,pGo);break; - case 185882: MainTempleDoors = pGo->GetGUID();// Main Temple Doors - right past Supermoose (Supremus) - if (m_auiEncounter[1] == DONE)HandleGameObject(NULL,true,pGo);break; - case 185478: ShadeOfAkamaDoor = pGo->GetGUID();break; - case 185480: CommonDoor = pGo->GetGUID(); - if (m_auiEncounter[3] == DONE)HandleGameObject(NULL,true,pGo);;break; - case 186153: TeronDoor = pGo->GetGUID(); - if (m_auiEncounter[3] == DONE)HandleGameObject(NULL,true,pGo);;break; - case 185892: GuurtogDoor = pGo->GetGUID(); - if (m_auiEncounter[4] == DONE)HandleGameObject(NULL,true,pGo);break; - case 185479: TempleDoor = pGo->GetGUID(); - if (m_auiEncounter[5] == DONE)HandleGameObject(NULL,true,pGo);break; - case 185482: MotherDoor = pGo->GetGUID(); - if (m_auiEncounter[6] == DONE)HandleGameObject(NULL,true,pGo);break; - case 185481: CouncilDoor = pGo->GetGUID(); - if (m_auiEncounter[7] == DONE)HandleGameObject(NULL,true,pGo);break; - case 186152: SimpleDoor = pGo->GetGUID(); - if (m_auiEncounter[7] == DONE)HandleGameObject(NULL,true,pGo);break; - case 185905: IllidanGate = pGo->GetGUID(); break; // Gate leading to Temple Summit - case 186261: IllidanDoor[0] = pGo->GetGUID(); break; // Right door at Temple Summit - case 186262: IllidanDoor[1] = pGo->GetGUID(); break; // Left door at Temple Summit - } - } - - uint64 GetData64(uint32 identifier) - { - switch(identifier) - { - case DATA_HIGHWARLORDNAJENTUS: return Najentus; - case DATA_AKAMA: return Akama; - case DATA_AKAMA_SHADE: return Akama_Shade; - case DATA_SHADEOFAKAMA: return ShadeOfAkama; - case DATA_SUPREMUS: return Supremus; - case DATA_ILLIDANSTORMRAGE: return IllidanStormrage; - case DATA_GATHIOSTHESHATTERER: return GathiosTheShatterer; - case DATA_HIGHNETHERMANCERZEREVOR: return HighNethermancerZerevor; - case DATA_LADYMALANDE: return LadyMalande; - case DATA_VERASDARKSHADOW: return VerasDarkshadow; - case DATA_ILLIDARICOUNCIL: return IllidariCouncil; - case DATA_GAMEOBJECT_NAJENTUS_GATE: return NajentusGate; - case DATA_GAMEOBJECT_ILLIDAN_GATE: return IllidanGate; - case DATA_GAMEOBJECT_ILLIDAN_DOOR_R: return IllidanDoor[0]; - case DATA_GAMEOBJECT_ILLIDAN_DOOR_L: return IllidanDoor[1]; - case DATA_GAMEOBJECT_SUPREMUS_DOORS: return MainTempleDoors; - case DATA_BLOOD_ELF_COUNCIL_VOICE: return BloodElfCouncilVoice; - } - - return 0; - } - - void SetData(uint32 type, uint32 data) - { - switch(type) - { - case DATA_HIGHWARLORDNAJENTUSEVENT: - if (data == DONE) - { - HandleGameObject(NajentusGate, true); - } - m_auiEncounter[0] = data;break; - case DATA_SUPREMUSEVENT: - if (data == DONE) - { - HandleGameObject(NajentusGate, true); - } - m_auiEncounter[1] = data; break; - case DATA_SHADEOFAKAMAEVENT: - if (data == IN_PROGRESS) - { - HandleGameObject(ShadeOfAkamaDoor, false); - }else HandleGameObject(ShadeOfAkamaDoor, true); - m_auiEncounter[2] = data; break; - case DATA_TERONGOREFIENDEVENT: - if (data == IN_PROGRESS) - { - HandleGameObject(TeronDoor, false); - HandleGameObject(CommonDoor, false); - }else - { - HandleGameObject(TeronDoor, true); - HandleGameObject(CommonDoor, true); - } - m_auiEncounter[3] = data; break; - case DATA_GURTOGGBLOODBOILEVENT: - if (data == DONE) - { - HandleGameObject(GuurtogDoor, true); - } - m_auiEncounter[4] = data; break; - case DATA_RELIQUARYOFSOULSEVENT: - if (data == DONE) - { - HandleGameObject(TempleDoor, true); - } - m_auiEncounter[5] = data; break; - case DATA_MOTHERSHAHRAZEVENT: - if (data == DONE) - { - HandleGameObject(MotherDoor, true); - } - m_auiEncounter[6] = data; break; - case DATA_ILLIDARICOUNCILEVENT: - if (data == IN_PROGRESS) - { - HandleGameObject(CouncilDoor, false); - HandleGameObject(SimpleDoor, false); - }else - { - HandleGameObject(CouncilDoor, true); - HandleGameObject(SimpleDoor, true); - } - m_auiEncounter[7] = data; break; - case DATA_ILLIDANSTORMRAGEEVENT: m_auiEncounter[8] = data; break; - } - - if (data == DONE) - { - OUT_SAVE_INST_DATA; - - std::ostringstream saveStream; - saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " - << m_auiEncounter[2] << " " << m_auiEncounter[3] << " " << m_auiEncounter[4] - << " " << m_auiEncounter[5] << " " << m_auiEncounter[6] << " " << m_auiEncounter[7] - << " " << m_auiEncounter[8]; - - str_data = saveStream.str(); - - SaveToDB(); - OUT_SAVE_INST_DATA_COMPLETE; - } - } - - uint32 GetData(uint32 type) - { - switch(type) - { - case DATA_HIGHWARLORDNAJENTUSEVENT: return m_auiEncounter[0]; - case DATA_SUPREMUSEVENT: return m_auiEncounter[1]; - case DATA_SHADEOFAKAMAEVENT: return m_auiEncounter[2]; - case DATA_TERONGOREFIENDEVENT: return m_auiEncounter[3]; - case DATA_GURTOGGBLOODBOILEVENT: return m_auiEncounter[4]; - case DATA_RELIQUARYOFSOULSEVENT: return m_auiEncounter[5]; - case DATA_MOTHERSHAHRAZEVENT: return m_auiEncounter[6]; - case DATA_ILLIDARICOUNCILEVENT: return m_auiEncounter[7]; - case DATA_ILLIDANSTORMRAGEEVENT: return m_auiEncounter[8]; - } - - return 0; - } - - std::string GetSaveData() - { - return str_data; - } - - void Load(const char* in) - { - if (!in) - { - OUT_LOAD_INST_DATA_FAIL; - return; - } - - OUT_LOAD_INST_DATA(in); - - std::istringstream loadStream(in); - loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] - >> m_auiEncounter[3] >> m_auiEncounter[4] >> m_auiEncounter[5] >> m_auiEncounter[6] - >> m_auiEncounter[7] >> m_auiEncounter[8]; - - for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) - m_auiEncounter[i] = NOT_STARTED; - - OUT_LOAD_INST_DATA_COMPLETE; - } -}; - -InstanceData* GetInstanceData_instance_black_temple(Map* pMap) -{ - return new instance_black_temple(pMap); -} - -void AddSC_instance_black_temple() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_black_temple"; - newscript->GetInstanceData = &GetInstanceData_instance_black_temple; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_fathomlord_karathress.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_fathomlord_karathress.cpp deleted file mode 100644 index 1e62083f1f9..00000000000 --- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_fathomlord_karathress.cpp +++ /dev/null @@ -1,759 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Fathomlord_Karathress -SD%Complete: 70 -SDComment: Cyclone workaround -SDCategory: Coilfang Resevoir, Serpent Shrine Cavern -EndScriptData */ - -#include "precompiled.h" -#include "def_serpent_shrine.h" -#include "escortAI.h" - -#define SAY_AGGRO -1548021 -#define SAY_GAIN_BLESSING -1548022 -#define SAY_GAIN_ABILITY1 -1548023 -#define SAY_GAIN_ABILITY2 -1548024 -#define SAY_GAIN_ABILITY3 -1548025 -#define SAY_SLAY1 -1548026 -#define SAY_SLAY2 -1548027 -#define SAY_SLAY3 -1548028 -#define SAY_DEATH -1548029 - -//Karathress spells -#define SPELL_CATACLYSMIC_BOLT 38441 -#define SPELL_POWER_OF_SHARKKIS 38455 -#define SPELL_POWER_OF_TIDALVESS 38452 -#define SPELL_POWER_OF_CARIBDIS 38451 -#define SPELL_ENRAGE 24318 -#define SPELL_SEAR_NOVA 38445 -#define SPELL_BLESSING_OF_THE_TIDES 38449 - -//Sharkkis spells -#define SPELL_LEECHING_THROW 29436 -#define SPELL_THE_BEAST_WITHIN 38373 -#define SPELL_MULTISHOT 38366 -#define SPELL_SUMMON_FATHOM_LURKER 38433 -#define SPELL_SUMMON_FATHOM_SPOREBAT 38431 -#define SPELL_PET_ENRAGE 19574 - -//Tidalvess spells -#define SPELL_FROST_SHOCK 38234 -#define SPELL_SPITFIRE_TOTEM 38236 -#define SPELL_POISON_CLEANSING_TOTEM 38306 -// Spell obsolete -// #define SPELL_POISON_CLEANSING_EFFECT 8167 -#define SPELL_EARTHBIND_TOTEM 38304 -#define SPELL_EARTHBIND_TOTEM_EFFECT 6474 -#define SPELL_WINDFURY_WEAPON 38184 - -//Caribdis Spells -#define SPELL_WATER_BOLT_VOLLEY 38335 -#define SPELL_TIDAL_SURGE 38358 -#define SPELL_TIDAL_SURGE_FREEZE 38357 -#define SPELL_HEAL 38330 -#define SPELL_SUMMON_CYCLONE 38337 -#define SPELL_CYCLONE_CYCLONE 29538 - -//Yells and Quotes -#define SAY_GAIN_BLESSING_OF_TIDES "Your overconfidence will be your undoing! Guards, lend me your strength!" -#define SOUND_GAIN_BLESSING_OF_TIDES 11278 -#define SAY_MISC "Alana be'lendor!" //don't know what use this -#define SOUND_MISC 11283 - -//Summoned Unit GUIDs -#define CREATURE_CYCLONE 22104 -#define CREATURE_FATHOM_SPOREBAT 22120 -#define CREATURE_FATHOM_LURKER 22119 -#define CREATURE_SPITFIRE_TOTEM 22091 -#define CREATURE_EARTHBIND_TOTEM 22486 -#define CREATURE_POISON_CLEANSING_TOTEM 22487 - -//entry and position for Seer Olum -#define SEER_OLUM 22820 -#define OLUM_X 446.78f -#define OLUM_Y -542.76f -#define OLUM_Z -7.54773f -#define OLUM_O 0.401581f - -//Fathom-Lord Karathress AI -struct TRINITY_DLL_DECL boss_fathomlord_karathressAI : public ScriptedAI -{ - boss_fathomlord_karathressAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - Advisors[0] = 0; - Advisors[1] = 0; - Advisors[2] = 0; - } - - ScriptedInstance* pInstance; - - uint32 CataclysmicBolt_Timer; - uint32 Enrage_Timer; - uint32 SearNova_Timer; - - bool BlessingOfTides; - - uint64 Advisors[3]; - - void Reset() - { - CataclysmicBolt_Timer = 10000; - Enrage_Timer = 600000; //10 minutes - SearNova_Timer = 20000+rand()%40000; // 20 - 60 seconds - - BlessingOfTides = false; - - - - if (pInstance) - { - uint64 RAdvisors[3]; - RAdvisors[0] = pInstance->GetData64(DATA_SHARKKIS); - RAdvisors[1] = pInstance->GetData64(DATA_TIDALVESS); - RAdvisors[2] = pInstance->GetData64(DATA_CARIBDIS); - //Respawn of the 3 Advisors - Creature* pAdvisor = NULL; - for(int i=0; i<3; ++i) - - if (RAdvisors[i]) - { - pAdvisor = (Unit::GetCreature((*m_creature), RAdvisors[i])); - if (pAdvisor && !pAdvisor->isAlive()) - { - pAdvisor->Respawn(); - pAdvisor->AI()->EnterEvadeMode(); - pAdvisor->GetMotionMaster()->MoveTargetedHome(); - } - } - pInstance->SetData(DATA_KARATHRESSEVENT, NOT_STARTED); - } - - - } - - void EventSharkkisDeath() - { - DoScriptText(SAY_GAIN_ABILITY1, m_creature); - DoCast(m_creature, SPELL_POWER_OF_SHARKKIS); - } - - void EventTidalvessDeath() - { - DoScriptText(SAY_GAIN_ABILITY2, m_creature); - DoCast(m_creature, SPELL_POWER_OF_TIDALVESS); - } - - void EventCaribdisDeath() - { - DoScriptText(SAY_GAIN_ABILITY3, m_creature); - DoCast(m_creature, SPELL_POWER_OF_CARIBDIS); - } - - void GetAdvisors() - { - if (!pInstance) - return; - - Advisors[0] = pInstance->GetData64(DATA_SHARKKIS); - Advisors[1] = pInstance->GetData64(DATA_TIDALVESS); - Advisors[2] = pInstance->GetData64(DATA_CARIBDIS); - } - - void StartEvent(Unit *who) - { - if (!pInstance) - return; - - GetAdvisors(); - - DoScriptText(SAY_AGGRO, m_creature); - DoZoneInCombat(); - - pInstance->SetData64(DATA_KARATHRESSEVENT_STARTER, who->GetGUID()); - pInstance->SetData(DATA_KARATHRESSEVENT, IN_PROGRESS); - } - - void KilledUnit(Unit *victim) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; - case 2: DoScriptText(SAY_SLAY3, m_creature); break; - } - } - - void JustDied(Unit *killer) - { - DoScriptText(SAY_DEATH, m_creature); - - if (pInstance) - pInstance->SetData(DATA_FATHOMLORDKARATHRESSEVENT, DONE); - - //support for quest 10944 - m_creature->SummonCreature(SEER_OLUM, OLUM_X, OLUM_Y, OLUM_Z, OLUM_O, TEMPSUMMON_TIMED_DESPAWN, 3600000); - } - - void EnterCombat(Unit *who) - { - StartEvent(who); - } - - void UpdateAI(const uint32 diff) - { - //Only if not incombat check if the event is started - if (!m_creature->isInCombat() && pInstance && pInstance->GetData(DATA_KARATHRESSEVENT)) - { - Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_KARATHRESSEVENT_STARTER)); - - if (target) - { - AttackStart(target); - GetAdvisors(); - } - } - - //Return since we have no target - if (!UpdateVictim()) - return; - - //someone evaded! - if (pInstance && !pInstance->GetData(DATA_KARATHRESSEVENT)) - { - EnterEvadeMode(); - return; - } - - //CataclysmicBolt_Timer - if (CataclysmicBolt_Timer < diff) - { - //select a random unit other than the main tank - Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 1); - - //if there aren't other units, cast on the tank - if (!target) - target = m_creature->getVictim(); - - if (target) - DoCast(target, SPELL_CATACLYSMIC_BOLT); - CataclysmicBolt_Timer = 10000; - }else CataclysmicBolt_Timer -= diff; - - //SearNova_Timer - if (SearNova_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_SEAR_NOVA); - SearNova_Timer = 20000+rand()%40000; - }else SearNova_Timer -= diff; - - //Enrage_Timer - if (Enrage_Timer < diff) - { - DoCast(m_creature, SPELL_ENRAGE); - Enrage_Timer = 90000; - }else Enrage_Timer -= diff; - - //Blessing of Tides Trigger - if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) <= 75 && !BlessingOfTides) - { - BlessingOfTides = true; - bool continueTriggering; - Creature* Advisor; - for(uint8 i = 0; i < 4; ++i) - if (Advisors[i]) - { - Advisor = (Unit::GetCreature(*m_creature, Advisors[i])); - if (Advisor) - { - if (Advisor->isAlive()) - { - continueTriggering = true; - break; - } - } - } - if (continueTriggering) - { - DoCast(m_creature, SPELL_BLESSING_OF_THE_TIDES); - m_creature->MonsterYell(SAY_GAIN_BLESSING_OF_TIDES, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_GAIN_BLESSING_OF_TIDES); - } - } - - DoMeleeAttackIfReady(); - } -}; - -//Fathom-Guard Sharkkis AI -struct TRINITY_DLL_DECL boss_fathomguard_sharkkisAI : public ScriptedAI -{ - boss_fathomguard_sharkkisAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - uint32 LeechingThrow_Timer; - uint32 TheBeastWithin_Timer; - uint32 Multishot_Timer; - uint32 Pet_Timer; - - bool pet; - - uint64 SummonedPet; - - - void Reset() - { - LeechingThrow_Timer = 20000; - TheBeastWithin_Timer = 30000; - Multishot_Timer = 15000; - Pet_Timer = 10000; - - pet = false; - - Creature *Pet = Unit::GetCreature(*m_creature, SummonedPet); - if (Pet && Pet->isAlive()) - { - Pet->DealDamage(Pet, Pet->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - } - - SummonedPet = 0; - - if (pInstance) - pInstance->SetData(DATA_KARATHRESSEVENT, NOT_STARTED); - } - - void JustDied(Unit *victim) - { - if (pInstance) - { - Creature *Karathress = NULL; - Karathress = (Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_KARATHRESS))); - - if (Karathress) - CAST_AI(boss_fathomlord_karathressAI, Karathress->AI())->EventSharkkisDeath(); - CAST_AI(boss_fathomlord_karathressAI, Karathress->AI())->EventSharkkisDeath(); - } - } - - void EnterCombat(Unit *who) - { - if (pInstance) - { - pInstance->SetData64(DATA_KARATHRESSEVENT_STARTER, who->GetGUID()); - pInstance->SetData(DATA_KARATHRESSEVENT, IN_PROGRESS); - } - } - - void UpdateAI(const uint32 diff) - { - //Only if not incombat check if the event is started - if (!m_creature->isInCombat() && pInstance && pInstance->GetData(DATA_KARATHRESSEVENT)) - { - Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_KARATHRESSEVENT_STARTER)); - - if (target) - { - AttackStart(target); - } - } - - //Return since we have no target - if (!UpdateVictim()) - return; - - //someone evaded! - if (pInstance && !pInstance->GetData(DATA_KARATHRESSEVENT)) - { - EnterEvadeMode(); - return; - } - - //LeechingThrow_Timer - if (LeechingThrow_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_LEECHING_THROW); - LeechingThrow_Timer = 20000; - }else LeechingThrow_Timer -= diff; - - //Multishot_Timer - if (Multishot_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_MULTISHOT); - Multishot_Timer = 20000; - }else Multishot_Timer -= diff; - - //TheBeastWithin_Timer - if (TheBeastWithin_Timer < diff) - { - DoCast(m_creature, SPELL_THE_BEAST_WITHIN); - Creature *Pet = Unit::GetCreature(*m_creature, SummonedPet); - if (Pet && Pet->isAlive()) - { - Pet->CastSpell(Pet, SPELL_PET_ENRAGE, true); - } - TheBeastWithin_Timer = 30000; - }else TheBeastWithin_Timer -= diff; - - //Pet_Timer - if (Pet_Timer < diff && pet == false) - { - pet = true; - //uint32 spell_id; - uint32 pet_id; - switch(rand()%2) - { - case 0: - //spell_id = SPELL_SUMMON_FATHOM_LURKER; - pet_id = CREATURE_FATHOM_LURKER; - break; - case 1: - //spell_id = SPELL_SUMMON_FATHOM_SPOREBAT; - pet_id = CREATURE_FATHOM_SPOREBAT; - break; - } - //DoCast(m_creature, spell_id, true); - Creature *Pet = DoSpawnCreature(pet_id,0,0,0,0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0); - if (Pet && target) - { - Pet->AI()->AttackStart(target); - SummonedPet = Pet->GetGUID(); - } - }else Pet_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -//Fathom-Guard Tidalvess AI -struct TRINITY_DLL_DECL boss_fathomguard_tidalvessAI : public ScriptedAI -{ - boss_fathomguard_tidalvessAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - uint32 FrostShock_Timer; - uint32 Spitfire_Timer; - uint32 PoisonCleansing_Timer; - uint32 Earthbind_Timer; - - void Reset() - { - FrostShock_Timer = 25000; - Spitfire_Timer = 60000; - PoisonCleansing_Timer = 30000; - Earthbind_Timer = 45000; - - if (pInstance) - pInstance->SetData(DATA_KARATHRESSEVENT, NOT_STARTED); - } - - void JustDied(Unit *victim) - { - if (pInstance) - { - Creature *Karathress = NULL; - Karathress = (Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_KARATHRESS))); - - if (Karathress) - if (!m_creature->isAlive() && Karathress) - CAST_AI(boss_fathomlord_karathressAI, Karathress->AI())->EventTidalvessDeath(); - } - } - - void EnterCombat(Unit *who) - { - if (pInstance) - { - pInstance->SetData64(DATA_KARATHRESSEVENT_STARTER, who->GetGUID()); - pInstance->SetData(DATA_KARATHRESSEVENT, IN_PROGRESS); - } - DoCast(m_creature, SPELL_WINDFURY_WEAPON); - } - - void UpdateAI(const uint32 diff) - { - //Only if not incombat check if the event is started - if (!m_creature->isInCombat() && pInstance && pInstance->GetData(DATA_KARATHRESSEVENT)) - { - Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_KARATHRESSEVENT_STARTER)); - - if (target) - { - AttackStart(target); - } - } - - //Return since we have no target - if (!UpdateVictim()) - return; - - //someone evaded! - if (pInstance && !pInstance->GetData(DATA_KARATHRESSEVENT)) - { - EnterEvadeMode(); - return; - } - - if (!m_creature->HasAura(SPELL_WINDFURY_WEAPON)) - { - DoCast(m_creature, SPELL_WINDFURY_WEAPON); - } - - //FrostShock_Timer - if (FrostShock_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_FROST_SHOCK); - FrostShock_Timer = 25000+rand()%5000; - }else FrostShock_Timer -= diff; - - //Spitfire_Timer - if (Spitfire_Timer < diff) - { - DoCast(m_creature, SPELL_SPITFIRE_TOTEM); - Unit *SpitfireTotem = Unit::GetUnit(*m_creature, CREATURE_SPITFIRE_TOTEM); - if (SpitfireTotem) - { - CAST_CRE(SpitfireTotem)->AI()->AttackStart(m_creature->getVictim()); - } - Spitfire_Timer = 60000; - }else Spitfire_Timer -= diff; - - //PoisonCleansing_Timer - if (PoisonCleansing_Timer < diff) - { - DoCast(m_creature, SPELL_POISON_CLEANSING_TOTEM); - PoisonCleansing_Timer = 30000; - }else PoisonCleansing_Timer -= diff; - - //Earthbind_Timer - if (Earthbind_Timer < diff) - { - DoCast(m_creature, SPELL_EARTHBIND_TOTEM); - Earthbind_Timer = 45000; - }else Earthbind_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -//Fathom-Guard Caribdis AI -struct TRINITY_DLL_DECL boss_fathomguard_caribdisAI : public ScriptedAI -{ - boss_fathomguard_caribdisAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - uint32 WaterBoltVolley_Timer; - uint32 TidalSurge_Timer; - uint32 Heal_Timer; - uint32 Cyclone_Timer; - - void Reset() - { - WaterBoltVolley_Timer = 35000; - TidalSurge_Timer = 15000+rand()%5000; - Heal_Timer = 55000; - Cyclone_Timer = 30000+rand()%10000; - - if (pInstance) - pInstance->SetData(DATA_KARATHRESSEVENT, NOT_STARTED); - } - - void JustDied(Unit *victim) - { - if (pInstance) - { - Creature *Karathress = NULL; - Karathress = (Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_KARATHRESS))); - - if (Karathress) - if (!m_creature->isAlive() && Karathress) - CAST_AI(boss_fathomlord_karathressAI, Karathress->AI())->EventCaribdisDeath(); - } - } - - void EnterCombat(Unit *who) - { - if (pInstance) - { - pInstance->SetData64(DATA_KARATHRESSEVENT_STARTER, who->GetGUID()); - pInstance->SetData(DATA_KARATHRESSEVENT, IN_PROGRESS); - } - } - - void UpdateAI(const uint32 diff) - { - //Only if not incombat check if the event is started - if (!m_creature->isInCombat() && pInstance && pInstance->GetData(DATA_KARATHRESSEVENT)) - { - Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_KARATHRESSEVENT_STARTER)); - - if (target) - { - AttackStart(target); - } - } - - //Return since we have no target - if (!UpdateVictim()) - return; - - //someone evaded! - if (pInstance && !pInstance->GetData(DATA_KARATHRESSEVENT)) - { - EnterEvadeMode(); - return; - } - - //WaterBoltVolley_Timer - if (WaterBoltVolley_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_WATER_BOLT_VOLLEY); - WaterBoltVolley_Timer = 30000; - }else WaterBoltVolley_Timer -= diff; - - //TidalSurge_Timer - if (TidalSurge_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_TIDAL_SURGE); - // Hacky way to do it - won't trigger elseways - m_creature->getVictim()->CastSpell(m_creature->getVictim(), SPELL_TIDAL_SURGE_FREEZE, true); - TidalSurge_Timer = 15000+rand()%5000; - }else TidalSurge_Timer -= diff; - - //Cyclone_Timer - if (Cyclone_Timer < diff) - { - //DoCast(m_creature, SPELL_SUMMON_CYCLONE); // Doesn't work - Cyclone_Timer = 30000+rand()%10000; - Creature *Cyclone = m_creature->SummonCreature(CREATURE_CYCLONE, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), (rand()%5), TEMPSUMMON_TIMED_DESPAWN, 15000); - if (Cyclone) - { - CAST_CRE(Cyclone)->SetFloatValue(OBJECT_FIELD_SCALE_X, 3.0f); - Cyclone->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - Cyclone->setFaction(m_creature->getFaction()); - Cyclone->CastSpell(Cyclone, SPELL_CYCLONE_CYCLONE, true); - Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (target) - { - Cyclone->AI()->AttackStart(target); - } - } - }else Cyclone_Timer -= diff; - - //Heal_Timer - if (Heal_Timer < diff) - { - // It can be cast on any of the mobs - Unit *pUnit = NULL; - - while(pUnit == NULL || !pUnit->isAlive()) - { - pUnit = selectAdvisorUnit(); - } - - if (pUnit && pUnit->isAlive()) - DoCast(pUnit, SPELL_HEAL); - Heal_Timer = 60000; - }else Heal_Timer -= diff; - - DoMeleeAttackIfReady(); - } - - Unit* selectAdvisorUnit() - { - Unit* pUnit = NULL; - if (pInstance) - { - switch(rand()%4) - { - case 0: - pUnit = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_KARATHRESS)); - break; - case 1: - pUnit = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_SHARKKIS)); - break; - case 2: - pUnit = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_TIDALVESS)); - break; - case 3: - pUnit = m_creature; - break; - } - }else pUnit = m_creature; - - return pUnit; - } -}; - -CreatureAI* GetAI_boss_fathomlord_karathress(Creature* pCreature) -{ - return new boss_fathomlord_karathressAI (pCreature); -} - -CreatureAI* GetAI_boss_fathomguard_sharkkis(Creature* pCreature) -{ - return new boss_fathomguard_sharkkisAI (pCreature); -} - -CreatureAI* GetAI_boss_fathomguard_tidalvess(Creature* pCreature) -{ - return new boss_fathomguard_tidalvessAI (pCreature); -} - -CreatureAI* GetAI_boss_fathomguard_caribdis(Creature* pCreature) -{ - return new boss_fathomguard_caribdisAI (pCreature); -} - -void AddSC_boss_fathomlord_karathress() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_fathomlord_karathress"; - newscript->GetAI = &GetAI_boss_fathomlord_karathress; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="boss_fathomguard_sharkkis"; - newscript->GetAI = &GetAI_boss_fathomguard_sharkkis; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="boss_fathomguard_tidalvess"; - newscript->GetAI = &GetAI_boss_fathomguard_tidalvess; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="boss_fathomguard_caribdis"; - newscript->GetAI = &GetAI_boss_fathomguard_caribdis; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_hydross_the_unstable.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_hydross_the_unstable.cpp deleted file mode 100644 index 434e088cd99..00000000000 --- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_hydross_the_unstable.cpp +++ /dev/null @@ -1,386 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Hydross_The_Unstable -SD%Complete: 90 -SDComment: Some details and adjustments left to do, probably nothing major. Spawns may be spawned in different way/location. -SDCategory: Coilfang Resevoir, Serpent Shrine Cavern -EndScriptData */ - -#include "precompiled.h" -#include "def_serpent_shrine.h" - -#define SAY_AGGRO -1548000 -#define SAY_SWITCH_TO_CLEAN -1548001 -#define SAY_CLEAN_SLAY1 -1548002 -#define SAY_CLEAN_SLAY2 -1548003 -#define SAY_CLEAN_DEATH -1548004 -#define SAY_SWITCH_TO_CORRUPT -1548005 -#define SAY_CORRUPT_SLAY1 -1548006 -#define SAY_CORRUPT_SLAY2 -1548007 -#define SAY_CORRUPT_DEATH -1548008 - -#define SWITCH_RADIUS 18 - -#define MODEL_CORRUPT 20609 -#define MODEL_CLEAN 20162 - -#define SPELL_WATER_TOMB 38235 -#define SPELL_MARK_OF_HYDROSS1 38215 -#define SPELL_MARK_OF_HYDROSS2 38216 -#define SPELL_MARK_OF_HYDROSS3 38217 -#define SPELL_MARK_OF_HYDROSS4 38218 -#define SPELL_MARK_OF_HYDROSS5 38231 -#define SPELL_MARK_OF_HYDROSS6 40584 -#define SPELL_MARK_OF_CORRUPTION1 38219 -#define SPELL_MARK_OF_CORRUPTION2 38220 -#define SPELL_MARK_OF_CORRUPTION3 38221 -#define SPELL_MARK_OF_CORRUPTION4 38222 -#define SPELL_MARK_OF_CORRUPTION5 38230 -#define SPELL_MARK_OF_CORRUPTION6 40583 -#define SPELL_VILE_SLUDGE 38246 -#define SPELL_ENRAGE 27680 //this spell need verification -#define SPELL_SUMMON_WATER_ELEMENT 36459 //not in use yet(in use ever?) -#define SPELL_ELEMENTAL_SPAWNIN 25035 -#define SPELL_BLUE_BEAM 40227 //channeled Hydross Beam Helper (not in use yet) - -#define ENTRY_PURE_SPAWN 22035 -#define ENTRY_TAINTED_SPAWN 22036 -#define ENTRY_BEAM_DUMMY 21934 - -#define HYDROSS_X -239.439 -#define HYDROSS_Y -363.481 - -#define SPAWN_X_DIFF1 6.934003 -#define SPAWN_Y_DIFF1 -11.255012 -#define SPAWN_X_DIFF2 -6.934003 -#define SPAWN_Y_DIFF2 11.255012 -#define SPAWN_X_DIFF3 -12.577011 -#define SPAWN_Y_DIFF3 -4.72702 -#define SPAWN_X_DIFF4 12.577011 -#define SPAWN_Y_DIFF4 4.72702 - -struct TRINITY_DLL_DECL boss_hydross_the_unstableAI : public ScriptedAI -{ - boss_hydross_the_unstableAI(Creature *c) : ScriptedAI(c), Summons(m_creature) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - uint64 beams[2]; - uint32 PosCheck_Timer; - uint32 MarkOfHydross_Timer; - uint32 MarkOfCorruption_Timer; - uint32 WaterTomb_Timer; - uint32 VileSludge_Timer; - uint32 MarkOfHydross_Count; - uint32 MarkOfCorruption_Count; - uint32 EnrageTimer; - bool CorruptedForm; - bool beam; - SummonList Summons; - - void Reset() - { - DeSummonBeams(); - beams[0] = 0; - beams[1] = 0; - PosCheck_Timer = 2500; - MarkOfHydross_Timer = 15000; - MarkOfCorruption_Timer = 15000; - WaterTomb_Timer = 7000; - VileSludge_Timer = 7000; - MarkOfHydross_Count = 0; - MarkOfCorruption_Count = 0; - EnrageTimer = 600000; - - CorruptedForm = false; - m_creature->SetMeleeDamageSchool(SPELL_SCHOOL_FROST); - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true); - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false); - - m_creature->SetDisplayId(MODEL_CLEAN); - - if (pInstance) - pInstance->SetData(DATA_HYDROSSTHEUNSTABLEEVENT, NOT_STARTED); - beam = false; - Summons.DespawnAll(); - } - - void SummonBeams() - { - Creature* beamer = m_creature->SummonCreature(ENTRY_BEAM_DUMMY,-258.333,-356.34,22.0499,5.90835,TEMPSUMMON_CORPSE_DESPAWN,0); - if (beamer) - { - beamer->CastSpell(m_creature,SPELL_BLUE_BEAM,true); - beamer->SetDisplayId(11686); //invisible - beamer->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - beams[0]=beamer->GetGUID(); - } - beamer = beamer = m_creature->SummonCreature(ENTRY_BEAM_DUMMY,-219.918,-371.308,22.0042,2.73072,TEMPSUMMON_CORPSE_DESPAWN,0); - if (beamer) - { - beamer->CastSpell(m_creature,SPELL_BLUE_BEAM,true); - beamer->SetDisplayId(11686); //invisible - beamer->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - beams[1]=beamer->GetGUID(); - } - } - void DeSummonBeams() - { - for(uint8 i=0;i<2; ++i) - { - Creature* mob = Unit::GetCreature(*m_creature,beams[i]); - if (mob) - { - mob->setDeathState(DEAD); - mob->RemoveCorpse(); - } - } - } - void EnterCombat(Unit *who) - { - DoScriptText(SAY_AGGRO, m_creature); - - if (pInstance) - pInstance->SetData(DATA_HYDROSSTHEUNSTABLEEVENT, IN_PROGRESS); - } - - void KilledUnit(Unit *victim) - { - if (CorruptedForm) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_CORRUPT_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_CORRUPT_SLAY2, m_creature); break; - } - } - else - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_CLEAN_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_CLEAN_SLAY2, m_creature); break; - } - } - } - - void JustSummoned(Creature* summoned) - { - if (summoned->GetEntry() == ENTRY_PURE_SPAWN) - { - summoned->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true); - summoned->CastSpell(summoned,SPELL_ELEMENTAL_SPAWNIN,true); - Summons.Summon(summoned); - } - if (summoned->GetEntry() == ENTRY_TAINTED_SPAWN) - { - summoned->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, true); - summoned->CastSpell(summoned,SPELL_ELEMENTAL_SPAWNIN,true); - Summons.Summon(summoned); - } - } - - void SummonedCreatureDespawn(Creature *summon) - { - Summons.Despawn(summon); - } - - void JustDied(Unit *victim) - { - if (CorruptedForm) - DoScriptText(SAY_CORRUPT_DEATH, m_creature); - else - DoScriptText(SAY_CLEAN_DEATH, m_creature); - - if (pInstance) - pInstance->SetData(DATA_HYDROSSTHEUNSTABLEEVENT, DONE); - Summons.DespawnAll(); - } - - void UpdateAI(const uint32 diff) - { - if (!beam) - { - SummonBeams(); - beam=true; - } - //Return since we have no target - if (!UpdateVictim()) - return; - - // corrupted form - if (CorruptedForm) - { - //MarkOfCorruption_Timer - if (MarkOfCorruption_Timer < diff) - { - if (MarkOfCorruption_Count <= 5) - { - uint32 mark_spell; - - switch(MarkOfCorruption_Count) - { - case 0: mark_spell = SPELL_MARK_OF_CORRUPTION1; break; - case 1: mark_spell = SPELL_MARK_OF_CORRUPTION2; break; - case 2: mark_spell = SPELL_MARK_OF_CORRUPTION3; break; - case 3: mark_spell = SPELL_MARK_OF_CORRUPTION4; break; - case 4: mark_spell = SPELL_MARK_OF_CORRUPTION5; break; - case 5: mark_spell = SPELL_MARK_OF_CORRUPTION6; break; - } - - DoCast(m_creature->getVictim(), mark_spell); - - if (MarkOfCorruption_Count < 5) - MarkOfCorruption_Count++; - } - - MarkOfCorruption_Timer = 15000; - }else MarkOfCorruption_Timer -= diff; - - //VileSludge_Timer - if (VileSludge_Timer < diff) - { - Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (target) - DoCast(target, SPELL_VILE_SLUDGE); - - VileSludge_Timer = 15000; - }else VileSludge_Timer -= diff; - - //PosCheck_Timer - if (PosCheck_Timer < diff) - { - if (m_creature->IsWithinDist2d(HYDROSS_X, HYDROSS_Y, SWITCH_RADIUS)) - { - // switch to clean form - m_creature->SetDisplayId(MODEL_CLEAN); - CorruptedForm = false; - MarkOfHydross_Count = 0; - - DoScriptText(SAY_SWITCH_TO_CLEAN, m_creature); - DoResetThreat(); - SummonBeams(); - - // spawn 4 adds - DoSpawnCreature(ENTRY_PURE_SPAWN, SPAWN_X_DIFF1, SPAWN_Y_DIFF1, 3, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); - DoSpawnCreature(ENTRY_PURE_SPAWN, SPAWN_X_DIFF2, SPAWN_Y_DIFF2, 3, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); - DoSpawnCreature(ENTRY_PURE_SPAWN, SPAWN_X_DIFF3, SPAWN_Y_DIFF3, 3, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); - DoSpawnCreature(ENTRY_PURE_SPAWN, SPAWN_X_DIFF4, SPAWN_Y_DIFF4, 3, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); - - m_creature->SetMeleeDamageSchool(SPELL_SCHOOL_FROST); - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true); - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false); - } - - PosCheck_Timer = 2500; - }else PosCheck_Timer -=diff; - } - // clean form - else - { - //MarkOfHydross_Timer - if (MarkOfHydross_Timer < diff) - { - if (MarkOfHydross_Count <= 5) - { - uint32 mark_spell; - - switch(MarkOfHydross_Count) - { - case 0: mark_spell = SPELL_MARK_OF_HYDROSS1; break; - case 1: mark_spell = SPELL_MARK_OF_HYDROSS2; break; - case 2: mark_spell = SPELL_MARK_OF_HYDROSS3; break; - case 3: mark_spell = SPELL_MARK_OF_HYDROSS4; break; - case 4: mark_spell = SPELL_MARK_OF_HYDROSS5; break; - case 5: mark_spell = SPELL_MARK_OF_HYDROSS6; break; - } - - DoCast(m_creature->getVictim(), mark_spell); - - if (MarkOfHydross_Count < 5) - MarkOfHydross_Count++; - } - - MarkOfHydross_Timer = 15000; - }else MarkOfHydross_Timer -= diff; - - //WaterTomb_Timer - if (WaterTomb_Timer < diff) - { - Unit *target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true); - if (target) - DoCast(target, SPELL_WATER_TOMB); - - WaterTomb_Timer = 7000; - }else WaterTomb_Timer -= diff; - - //PosCheck_Timer - if (PosCheck_Timer < diff) - { - if (!m_creature->IsWithinDist2d(HYDROSS_X, HYDROSS_Y, SWITCH_RADIUS)) - { - // switch to corrupted form - m_creature->SetDisplayId(MODEL_CORRUPT); - MarkOfCorruption_Count = 0; - CorruptedForm = true; - - DoScriptText(SAY_SWITCH_TO_CORRUPT, m_creature); - DoResetThreat(); - DeSummonBeams(); - - // spawn 4 adds - DoSpawnCreature(ENTRY_TAINTED_SPAWN, SPAWN_X_DIFF1, SPAWN_Y_DIFF1, 3, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); - DoSpawnCreature(ENTRY_TAINTED_SPAWN, SPAWN_X_DIFF2, SPAWN_Y_DIFF2, 3, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); - DoSpawnCreature(ENTRY_TAINTED_SPAWN, SPAWN_X_DIFF3, SPAWN_Y_DIFF3, 3, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); - DoSpawnCreature(ENTRY_TAINTED_SPAWN, SPAWN_X_DIFF4, SPAWN_Y_DIFF4, 3, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); - - m_creature->SetMeleeDamageSchool(SPELL_SCHOOL_NATURE); - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, true); - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, false); - } - - PosCheck_Timer = 2500; - }else PosCheck_Timer -=diff; - } - - //EnrageTimer - if (EnrageTimer < diff) - { - DoCast(m_creature, SPELL_ENRAGE); - EnrageTimer = 60000; - }else EnrageTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_hydross_the_unstable(Creature* pCreature) -{ - return new boss_hydross_the_unstableAI (pCreature); -} - -void AddSC_boss_hydross_the_unstable() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_hydross_the_unstable"; - newscript->GetAI = &GetAI_boss_hydross_the_unstable; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_lady_vashj.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_lady_vashj.cpp deleted file mode 100644 index c1a2280653c..00000000000 --- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_lady_vashj.cpp +++ /dev/null @@ -1,1066 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA02111-1307USA - */ - -/* ScriptData -SDName: Boss_Lady_Vashj -SD%Complete: 99 -SDComment: Missing blizzlike Shield Generators coords -SDCategory: Coilfang Resevoir, Serpent Shrine Cavern -EndScriptData */ - -#include "precompiled.h" -#include "def_serpent_shrine.h" -#include "simple_ai.h" -#include "Spell.h" - -#define SAY_INTRO -1548042 -#define SAY_AGGRO1 -1548043 -#define SAY_AGGRO2 -1548044 -#define SAY_AGGRO3 -1548045 -#define SAY_AGGRO4 -1548046 -#define SAY_PHASE1 -1548047 -#define SAY_PHASE2 -1548048 -#define SAY_PHASE3 -1548049 -#define SAY_BOWSHOT1 -1548050 -#define SAY_BOWSHOT2 -1548051 -#define SAY_SLAY1 -1548052 -#define SAY_SLAY2 -1548053 -#define SAY_SLAY3 -1548054 -#define SAY_DEATH -1548055 - -#define SPELL_SURGE 38044 -#define SPELL_MULTI_SHOT 38310 -#define SPELL_SHOCK_BLAST 38509 -#define SPELL_ENTANGLE 38316 -#define SPELL_STATIC_CHARGE_TRIGGER 38280 -#define SPELL_FORKED_LIGHTNING 40088 -#define SPELL_SHOOT 40873 -#define SPELL_POISON_BOLT 40095 -#define SPELL_TOXIC_SPORES 38575 -#define SPELL_MAGIC_BARRIER 38112 - -#define MIDDLE_X 30.134 -#define MIDDLE_Y -923.65 -#define MIDDLE_Z 42.9 - -#define SPOREBAT_X 30.977156 -#define SPOREBAT_Y -925.297761 -#define SPOREBAT_Z 77.176567 -#define SPOREBAT_O 5.223932 - -#define SHIED_GENERATOR_CHANNEL 19870 -#define ENCHANTED_ELEMENTAL 21958 -#define TAINTED_ELEMENTAL 22009 -#define COILFANG_STRIDER 22056 -#define COILFANG_ELITE 22055 -#define TOXIC_SPOREBAT 22140 -#define TOXIC_SPORES_TRIGGER 22207 - -float ElementPos[8][4] = -{ - {8.3, -835.3, 21.9, 5}, - {53.4, -835.3, 21.9, 4.5}, - {96, -861.9, 21.8, 4}, - {96, -986.4, 21.4, 2.5}, - {54.4, -1010.6, 22, 1.8}, - {9.8, -1012, 21.7, 1.4}, - {-35, -987.6, 21.5, 0.8}, - {-58.9, -901.6, 21.5, 6} -}; - -float ElementWPPos[8][3] = -{ - {71.700752, -883.905884, 41.097168}, - {45.039848, -868.022827, 41.097015}, - {14.585141, -867.894470, 41.097061}, - {-25.415508, -906.737732, 41.097061}, - {-11.801594, -963.405884, 41.097067}, - {14.556657, -979.051514, 41.097137}, - {43.466549, -979.406677, 41.097027}, - {69.945908, -964.663940, 41.097054} -}; - -float SporebatWPPos[8][3] = -{ - {31.6,-896.3,59.1}, - {9.1, -913.9, 56}, - {5.2, -934.4, 52.4}, - {20.7, -946.9, 49.7}, - {41, -941.9, 51}, - {47.7, -927.3, 55}, - {42.2, -912.4, 51.7}, - {27, -905.9, 50} -}; - -float CoilfangElitePos[3][4] = -{ - {28.84, -923.28, 42.9, 6}, - {31.183281, -953.502625, 41.523602, 1.640957}, - {58.895180, -923.124268, 41.545307, 3.152848} -}; - -float CoilfangStriderPos[3][4] = -{ - {66.427010, -948.778503, 41.262245, 2.584220}, - {7.513962, -959.538208, 41.300422, 1.034629}, - {-12.843201, -907.798401, 41.239620, 6.087094} -}; - -float ShieldGeneratorChannelPos[4][4] = -{ - {49.6262, -902.181, 43.0975, 3.95683}, - {10.988, -901.616, 42.5371, 5.4373}, - {10.3859, -944.036, 42.5446, 0.779888}, - {49.3126, -943.398, 42.5501, 2.40174} -}; - -//Lady Vashj AI -struct TRINITY_DLL_DECL boss_lady_vashjAI : public ScriptedAI -{ - boss_lady_vashjAI (Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - Intro = false; - JustCreated = true; - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); //set it only once on Creature create (no need do intro if wiped) - } - - ScriptedInstance *pInstance; - - uint64 ShieldGeneratorChannel[4]; - - uint32 AggroTimer; - uint32 ShockBlast_Timer; - uint32 Entangle_Timer; - uint32 StaticCharge_Timer; - uint32 ForkedLightning_Timer; - uint32 Check_Timer; - uint32 EnchantedElemental_Timer; - uint32 TaintedElemental_Timer; - uint32 CoilfangElite_Timer; - uint32 CoilfangStrider_Timer; - uint32 SummonSporebat_Timer; - uint32 SummonSporebat_StaticTimer; - uint8 EnchantedElemental_Pos; - uint8 Phase; - - bool Entangle; - bool Intro; - bool CanAttack; - bool JustCreated; - - void Reset() - { - AggroTimer = 19000; - ShockBlast_Timer = 1+rand()%60000; - Entangle_Timer = 30000; - StaticCharge_Timer = 10000+rand()%15000; - ForkedLightning_Timer = 2000; - Check_Timer = 15000; - EnchantedElemental_Timer = 5000; - TaintedElemental_Timer = 50000; - CoilfangElite_Timer = 45000+rand()%5000; - CoilfangStrider_Timer = 60000+rand()%10000; - SummonSporebat_Timer = 10000; - SummonSporebat_StaticTimer = 30000; - EnchantedElemental_Pos = 0; - Phase = 0; - - Entangle = false; - if (JustCreated) - { - CanAttack = false; - JustCreated = false; - }else CanAttack = true; - - Unit *remo; - for(uint8 i = 0; i < 4; ++i) - { - remo = Unit::GetUnit(*m_creature, ShieldGeneratorChannel[i]); - if (remo) - remo->setDeathState(JUST_DIED); - } - - if (pInstance) - pInstance->SetData(DATA_LADYVASHJEVENT, NOT_STARTED); - ShieldGeneratorChannel[0] = 0; - ShieldGeneratorChannel[1] = 0; - ShieldGeneratorChannel[2] = 0; - ShieldGeneratorChannel[3] = 0; - - m_creature->SetCorpseDelay(1000*60*60); - } - - //Called when a tainted elemental dies - void EventTaintedElementalDeath() - { - //the next will spawn 50 seconds after the previous one's death - if (TaintedElemental_Timer > 50000) - TaintedElemental_Timer = 50000; - } - void KilledUnit(Unit *victim) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; - case 2: DoScriptText(SAY_SLAY3, m_creature); break; - } - } - - void JustDied(Unit *victim) - { - DoScriptText(SAY_DEATH, m_creature); - - if (pInstance) - pInstance->SetData(DATA_LADYVASHJEVENT, DONE); - } - - void StartEvent() - { - switch(rand()%4) - { - case 0: DoScriptText(SAY_AGGRO1, m_creature); break; - case 1: DoScriptText(SAY_AGGRO2, m_creature); break; - case 2: DoScriptText(SAY_AGGRO3, m_creature); break; - case 3: DoScriptText(SAY_AGGRO4, m_creature); break; - } - - Phase = 1; - - if (pInstance) - pInstance->SetData(DATA_LADYVASHJEVENT, IN_PROGRESS); - } - - void EnterCombat(Unit *who) - { - if (pInstance) - { - //remove old tainted cores to prevent cheating in phase 2 - Map* pMap = m_creature->GetMap(); - Map::PlayerList const &PlayerList = pMap->GetPlayers(); - for(Map::PlayerList::const_iterator i = PlayerList.begin();i != PlayerList.end(); ++i) - { - if (Player* i_pl = i->getSource()) - { - i_pl->DestroyItemCount(31088, 1, true); - } - } - } - StartEvent();//this is EnterCombat(), so were are 100% in combat, start the event - - if (Phase != 2) - AttackStart(who); - } - - void MoveInLineOfSight(Unit *who) - { - if (!Intro) - { - Intro = true; - DoScriptText(SAY_INTRO, m_creature); - } - if (!CanAttack) - return; - if (!who || m_creature->getVictim()) - return; - - if (who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who)) - { - float attackRadius = m_creature->GetAttackDistance(who); - if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->GetDistanceZ(who) <= CREATURE_Z_ATTACK_RANGE && m_creature->IsWithinLOSInMap(who)) - { - //if (who->HasStealthAura()) - // who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); - - if (!m_creature->isInCombat())//AttackStart() sets UNIT_FLAG_IN_COMBAT, so this msut be before attacking - StartEvent(); - - if (Phase != 2) - AttackStart(who); - } - } - } - - void CastShootOrMultishot() - { - switch(rand()%2) - { - case 0: - //Shoot - //Used in Phases 1 and 3 after Entangle or while having nobody in melee range. A shot that hits her target for 4097-5543 Physical damage. - DoCast(m_creature->getVictim(), SPELL_SHOOT); - break; - case 1: - //Multishot - //Used in Phases 1 and 3 after Entangle or while having nobody in melee range. A shot that hits 1 person and 4 people around him for 6475-7525 physical damage. - DoCast(m_creature->getVictim(), SPELL_MULTI_SHOT); - break; - } - if (rand()%3) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_BOWSHOT1, m_creature); break; - case 1: DoScriptText(SAY_BOWSHOT2, m_creature); break; - } - } - } - - void UpdateAI(const uint32 diff) - { - if (!CanAttack && Intro) - { - if (AggroTimer < diff) - { - CanAttack = true; - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - AggroTimer=19000; - }else - { - AggroTimer-=diff; - return; - } - } - //to prevent abuses during phase 2 - if (Phase == 2 && !m_creature->getVictim() && m_creature->isInCombat()) - { - EnterEvadeMode(); - return; - } - //Return since we have no target - if (!UpdateVictim()) - return; - - if (Phase == 1 || Phase == 3) - { - //ShockBlast_Timer - if (ShockBlast_Timer < diff) - { - //Shock Burst - //Randomly used in Phases 1 and 3 on Vashj's target, it's a Shock spell doing 8325-9675 nature damage and stunning the target for 5 seconds, during which she will not attack her target but switch to the next person on the aggro list. - DoCast(m_creature->getVictim(), SPELL_SHOCK_BLAST); - m_creature->TauntApply(m_creature->getVictim()); - - ShockBlast_Timer = 1000+rand()%14000; //random cooldown - }else ShockBlast_Timer -= diff; - - //StaticCharge_Timer - if (StaticCharge_Timer < diff) - { - //Static Charge - //Used on random people (only 1 person at any given time) in Phases 1 and 3, it's a debuff doing 2775 to 3225 Nature damage to the target and everybody in about 5 yards around it, every 1 seconds for 30 seconds. It can be removed by Cloak of Shadows, Iceblock, Divine Shield, etc, but not by Cleanse or Dispel Magic. - Unit *target = NULL; - target = SelectTarget(SELECT_TARGET_RANDOM, 0, 200, true); - - if (target && !target->HasAura(SPELL_STATIC_CHARGE_TRIGGER)) - //cast Static Charge every 2 seconds for 20 seconds - DoCast(target, SPELL_STATIC_CHARGE_TRIGGER); - - StaticCharge_Timer = 10000+rand()%20000; //blizzlike - }else StaticCharge_Timer -= diff; - - //Entangle_Timer - if (Entangle_Timer < diff) - { - if (!Entangle) - { - //Entangle - //Used in Phases 1 and 3, it casts Entangling Roots on everybody in a 15 yard radius of Vashj, immobilzing them for 10 seconds and dealing 500 damage every 2 seconds. It's not a magic effect so it cannot be dispelled, but is removed by various buffs such as Cloak of Shadows or Blessing of Freedom. - DoCast(m_creature->getVictim(), SPELL_ENTANGLE); - Entangle = true; - Entangle_Timer = 10000; - } - else - { - CastShootOrMultishot(); - Entangle = false; - Entangle_Timer = 20000+rand()%5000; - } - }else Entangle_Timer -= diff; - - //Phase 1 - if (Phase == 1) - { - //Start phase 2 - if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 70) - { - //Phase 2 begins when Vashj hits 70%. She will run to the middle of her platform and surround herself in a shield making her invulerable. - Phase = 2; - - m_creature->GetMotionMaster()->Clear(); - DoTeleportTo(MIDDLE_X, MIDDLE_Y, MIDDLE_Z); - - Creature *pCreature; - for(uint8 i = 0; i < 4; ++i) - { - pCreature = m_creature->SummonCreature(SHIED_GENERATOR_CHANNEL, ShieldGeneratorChannelPos[i][0], ShieldGeneratorChannelPos[i][1], ShieldGeneratorChannelPos[i][2], ShieldGeneratorChannelPos[i][3], TEMPSUMMON_CORPSE_DESPAWN, 0); - if (pCreature) - ShieldGeneratorChannel[i] = pCreature->GetGUID(); - } - DoScriptText(SAY_PHASE2, m_creature); - } - } - //Phase 3 - else - { - //SummonSporebat_Timer - if (SummonSporebat_Timer < diff) - { - Creature *Sporebat = NULL; - Sporebat = m_creature->SummonCreature(TOXIC_SPOREBAT, SPOREBAT_X, SPOREBAT_Y, SPOREBAT_Z, SPOREBAT_O, TEMPSUMMON_CORPSE_DESPAWN, 0); - - if (Sporebat) - { - Unit *target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (target) - Sporebat->AI()->AttackStart(target); - } - - //summon sporebats faster and faster - if (SummonSporebat_StaticTimer > 1000) - SummonSporebat_StaticTimer -= 1000; - - SummonSporebat_Timer = SummonSporebat_StaticTimer; - - if (SummonSporebat_Timer < 5000) - SummonSporebat_Timer = 5000; - - }else SummonSporebat_Timer -= diff; - } - - //Melee attack - DoMeleeAttackIfReady(); - - //Check_Timer - used to check if somebody is in melee range - if (Check_Timer < diff) - { - bool InMeleeRange = false; - Unit *target; - std::list t_list = m_creature->getThreatManager().getThreatList(); - for(std::list::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr) - { - target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()); - //if in melee range - if (target && target->IsWithinDistInMap(m_creature, 5)) - { - InMeleeRange = true; - break; - } - } - - //if nobody is in melee range - if (!InMeleeRange) - CastShootOrMultishot(); - - Check_Timer = 5000; - }else Check_Timer -= diff; - } - //Phase 2 - else - { - //ForkedLightning_Timer - if (ForkedLightning_Timer < diff) - { - //Forked Lightning - //Used constantly in Phase 2, it shoots out completely randomly targeted bolts of lightning which hit everybody in a roughtly 60 degree cone in front of Vashj for 2313-2687 nature damage. - Unit *target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM, 0); - - if (!target) - target = m_creature->getVictim(); - - DoCast(target, SPELL_FORKED_LIGHTNING); - - ForkedLightning_Timer = 2000+rand()%6000; //blizzlike - }else ForkedLightning_Timer -= diff; - - //EnchantedElemental_Timer - if (EnchantedElemental_Timer < diff) - { - Creature *Elemental; - Elemental = m_creature->SummonCreature(ENCHANTED_ELEMENTAL, ElementPos[EnchantedElemental_Pos][0], ElementPos[EnchantedElemental_Pos][1], ElementPos[EnchantedElemental_Pos][2], ElementPos[EnchantedElemental_Pos][3], TEMPSUMMON_CORPSE_DESPAWN, 0); - - if (EnchantedElemental_Pos == 7) - EnchantedElemental_Pos = 0; - else - EnchantedElemental_Pos++; - - EnchantedElemental_Timer = 10000+rand()%5000; - }else EnchantedElemental_Timer -= diff; - - //TaintedElemental_Timer - if (TaintedElemental_Timer < diff) - { - Creature *Tain_Elemental; - uint32 pos = rand()%8; - Tain_Elemental = m_creature->SummonCreature(TAINTED_ELEMENTAL, ElementPos[pos][0], ElementPos[pos][1], ElementPos[pos][2], ElementPos[pos][3], TEMPSUMMON_DEAD_DESPAWN, 0); - - TaintedElemental_Timer = 120000; - }else TaintedElemental_Timer -= diff; - - //CoilfangElite_Timer - if (CoilfangElite_Timer < diff) - { - uint32 pos = rand()%3; - Creature* CoilfangElite = NULL; - CoilfangElite = m_creature->SummonCreature(COILFANG_ELITE, CoilfangElitePos[pos][0], CoilfangElitePos[pos][1], CoilfangElitePos[pos][2], CoilfangElitePos[pos][3], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); - if (CoilfangElite) - { - Unit *target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (target) - CoilfangElite->AI()->AttackStart(target); - else if (m_creature->getVictim()) - CoilfangElite->AI()->AttackStart(m_creature->getVictim()); - } - CoilfangElite_Timer = 45000+rand()%5000; - }else CoilfangElite_Timer -= diff; - - //CoilfangStrider_Timer - if (CoilfangStrider_Timer < diff) - { - uint32 pos = rand()%3; - Creature* CoilfangStrider = NULL; - CoilfangStrider = m_creature->SummonCreature(COILFANG_STRIDER, CoilfangStriderPos[pos][0], CoilfangStriderPos[pos][1], CoilfangStriderPos[pos][2], CoilfangStriderPos[pos][3], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); - if (CoilfangStrider) - { - Unit *target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (target) - CoilfangStrider->AI()->AttackStart(target); - else if (m_creature->getVictim()) - CoilfangStrider->AI()->AttackStart(m_creature->getVictim()); - } - CoilfangStrider_Timer = 60000+rand()%10000; - }else CoilfangStrider_Timer -= diff; - - //Check_Timer - if (Check_Timer < diff) - { - //Start Phase 3 - if (pInstance && pInstance->GetData(DATA_CANSTARTPHASE3)) - { - //set life 50% - m_creature->SetHealth(m_creature->GetMaxHealth()/2); - - m_creature->RemoveAurasDueToSpell(SPELL_MAGIC_BARRIER); - - DoScriptText(SAY_PHASE3, m_creature); - - Phase = 3; - - //return to the tank - m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); - } - Check_Timer = 1000; - }else Check_Timer -= diff; - } - } -}; - -//Enchanted Elemental -//If one of them reaches Vashj he will increase her damage done by 5%. -struct TRINITY_DLL_DECL mob_enchanted_elementalAI : public ScriptedAI -{ - mob_enchanted_elementalAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance *pInstance; - uint32 move; - uint32 phase; - float x, y, z; - Creature *Vashj; - - void Reset() - { - m_creature->SetSpeed(MOVE_WALK,0.6);//walk - m_creature->SetSpeed(MOVE_RUN,0.6);//run - move = 0; - phase = 1; - Vashj = NULL; - - for (int i = 0;i<8; ++i)//search for nearest waypoint (up on stairs) - { - if (!x || !y || !z) - { - x = ElementWPPos[i][0]; - y = ElementWPPos[i][1]; - z = ElementWPPos[i][2]; - } - else - { - if (m_creature->GetDistance(ElementWPPos[i][0],ElementWPPos[i][1],ElementWPPos[i][2]) < m_creature->GetDistance(x,y,z)) - { - x = ElementWPPos[i][0]; - y = ElementWPPos[i][1]; - z = ElementWPPos[i][2]; - } - } - } - if (pInstance) - Vashj = Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_LADYVASHJ)); - } - - void EnterCombat(Unit *who) { return; } - - void MoveInLineOfSight(Unit *who){return;} - - void UpdateAI(const uint32 diff) - { - if (!pInstance) - return; - - if (!Vashj) - { - return; - } - - if (move < diff) - { - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - if (phase == 1) - { - m_creature->GetMotionMaster()->MovePoint(0, x, y, z); - } - if (phase == 1 && m_creature->IsWithinDist3d(x,y,z, 0.1)) - { - phase = 2; - } - if (phase == 2) - { - m_creature->GetMotionMaster()->MovePoint(0, MIDDLE_X, MIDDLE_Y, MIDDLE_Z); - phase = 3; - } - if (phase == 3) - { - m_creature->GetMotionMaster()->MovePoint(0, MIDDLE_X, MIDDLE_Y, MIDDLE_Z); - if (m_creature->IsWithinDist3d(MIDDLE_X, MIDDLE_Y, MIDDLE_Z, 3)) - { - SpellEntry *spell = GET_SPELL(SPELL_SURGE); - if (spell) - { - uint8 eff_mask=0; - for (int i=0; i<3; ++i) - { - if (!spell->Effect[i]) - continue; - eff_mask|=1<AddAura(new Aura(spell, eff_mask, NULL, Vashj, Vashj)); - } - m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - } - } - if (!Vashj->isInCombat() || CAST_AI(boss_lady_vashjAI, Vashj->AI())->Phase != 2 || Vashj->isDead()) - { - //call Unsummon() - m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - } - move = 1000; - }else move -= diff; - } -}; - -//Tainted Elemental -//This mob has 7,900 life, doesn't move, and shoots Poison Bolts at one person anywhere in the area, doing 3,000 nature damage and placing a posion doing 2,000 damage every 2 seconds. He will switch targets often, or sometimes just hang on a single player, but there is nothing you can do about it except heal the damage and kill the Tainted Elemental -struct TRINITY_DLL_DECL mob_tainted_elementalAI : public ScriptedAI -{ - mob_tainted_elementalAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance *pInstance; - - uint32 PoisonBolt_Timer; - uint32 Despawn_Timer; - - void Reset() - { - PoisonBolt_Timer = 5000+rand()%5000; - Despawn_Timer = 30000; - } - - void JustDied(Unit *killer) - { - if (pInstance) - { - Creature *Vashj = NULL; - Vashj = (Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_LADYVASHJ))); - - if (Vashj) - CAST_AI(boss_lady_vashjAI, Vashj->AI())->EventTaintedElementalDeath(); - } - } - - void EnterCombat(Unit *who) - { - m_creature->AddThreat(who, 0.1f); - } - - void UpdateAI(const uint32 diff) - { - //PoisonBolt_Timer - if (PoisonBolt_Timer < diff) - { - Unit *target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM, 0); - - if (target && target->IsWithinDistInMap(m_creature, 30)) - DoCast(target, SPELL_POISON_BOLT); - - PoisonBolt_Timer = 5000+rand()%5000; - }else PoisonBolt_Timer -= diff; - - //Despawn_Timer - if (Despawn_Timer < diff) - { - //call Unsummon() - m_creature->setDeathState(DEAD); - - //to prevent crashes - Despawn_Timer = 1000; - }else Despawn_Timer -= diff; - } -}; - -//Toxic Sporebat -//Toxic Spores: Used in Phase 3 by the Spore Bats, it creates a contaminated green patch of ground, dealing about 2775-3225 nature damage every second to anyone who stands in it. -struct TRINITY_DLL_DECL mob_toxic_sporebatAI : public ScriptedAI -{ - mob_toxic_sporebatAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - EnterEvadeMode(); - } - - ScriptedInstance *pInstance; - - uint32 movement_timer; - uint32 ToxicSpore_Timer; - uint32 bolt_timer; - uint32 Check_Timer; - - void Reset() - { - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - m_creature->setFaction(14); - movement_timer = 0; - ToxicSpore_Timer = 5000; - bolt_timer = 5500; - Check_Timer = 1000; - } - - void EnterCombat(Unit *who) - { - - } - - void MoveInLineOfSight(Unit *who) - { - - } - - void MovementInform(uint32 type, uint32 id) - { - if (type != POINT_MOTION_TYPE) - return; - - if (id == 1) - movement_timer = 0; - } - - void UpdateAI (const uint32 diff) - { - //Random movement - if (movement_timer < diff) - { - uint32 rndpos = rand()%8; - m_creature->GetMotionMaster()->MovePoint(1,SporebatWPPos[rndpos][0], SporebatWPPos[rndpos][1], SporebatWPPos[rndpos][2]); - movement_timer = 6000; - }else movement_timer -= diff; - - //toxic spores - if (bolt_timer < diff) - { - Unit *target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (target) - { - Creature* trig = m_creature->SummonCreature(TOXIC_SPORES_TRIGGER,target->GetPositionX(),target->GetPositionY(),target->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN,30000); - if (trig) - { - trig->setFaction(14); - trig->CastSpell(trig, SPELL_TOXIC_SPORES,true); - } - } - bolt_timer = 10000+rand()%5000; - } - else bolt_timer -= diff; - - //Check_Timer - if (Check_Timer < diff) - { - if (pInstance) - { - //check if vashj is death - Unit *Vashj = NULL; - Vashj = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_LADYVASHJ)); - if (!Vashj || (Vashj && !Vashj->isAlive()) || (Vashj && CAST_AI(boss_lady_vashjAI, CAST_CRE(Vashj)->AI())->Phase != 3)) - { - //remove - m_creature->setDeathState(DEAD); - m_creature->RemoveCorpse(); - m_creature->setFaction(35); - } - } - - Check_Timer = 1000; - }else Check_Timer -= diff; - } -}; - -//Coilfang Elite -//It's an elite Naga mob with 170,000 HP. It does about 5000 damage on plate, and has a nasty cleave hitting for about 7500 damage -CreatureAI* GetAI_mob_coilfang_elite(Creature* pCreature) -{ - SimpleAI* ai = new SimpleAI (pCreature); - - ai->Spell[0].Enabled = true; - ai->Spell[0].Spell_Id = 31345; //Cleave - ai->Spell[0].Cooldown = 15000; - ai->Spell[0].CooldownRandomAddition = 5000; - ai->Spell[0].First_Cast = 5000; - ai->Spell[0].Cast_Target_Type = CAST_HOSTILE_RANDOM; - - ai->EnterEvadeMode(); - - return ai; -} - -//Coilfang Strider -//It hits plate for about 8000 damage, has a Mind Blast spell doing about 3000 shadow damage, and a Psychic Scream Aura, which fears everybody in a 8 yard range of it every 2-3 seconds , for 5 seconds and increasing their movement speed by 150% during the fear. -CreatureAI* GetAI_mob_coilfang_strider(Creature* pCreature) -{ - SimpleAI* ai = new SimpleAI (pCreature); - - ai->Spell[0].Enabled = true; - ai->Spell[0].Spell_Id = 41374; //Mind Blast - ai->Spell[0].Cooldown = 30000; - ai->Spell[0].CooldownRandomAddition = 10000; - ai->Spell[0].First_Cast = 8000; - ai->Spell[0].Cast_Target_Type = CAST_HOSTILE_TARGET; - - //Scream aura not implemented - - ai->EnterEvadeMode(); - - return ai; -} - -struct TRINITY_DLL_DECL mob_shield_generator_channelAI : public ScriptedAI -{ - mob_shield_generator_channelAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance *pInstance; - uint32 Check_Timer; - bool Casted; - void Reset() - { - Check_Timer = 0; - Casted = false; - m_creature->SetDisplayId(11686); //invisible - - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - } - - void EnterCombat(Unit *who) { return; } - - void MoveInLineOfSight(Unit *who) { return; } - - void UpdateAI (const uint32 diff) - { - if (!pInstance) - return; - - if (Check_Timer < diff) - { - Unit *Vashj = NULL; - Vashj = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_LADYVASHJ)); - - if (Vashj && Vashj->isAlive()) - { - //start visual channel - if (!Casted || !Vashj->HasAura(SPELL_MAGIC_BARRIER)) - { - m_creature->CastSpell(Vashj,SPELL_MAGIC_BARRIER,true); - Casted = true; - } - } - Check_Timer = 1000; - }else Check_Timer -= diff; - } -}; - -bool ItemUse_item_tainted_core(Player* pPlayer, Item* _Item, SpellCastTargets const& targets) -{ - ScriptedInstance *pInstance = (pPlayer->GetInstanceData()) ? (pPlayer->GetInstanceData()) : NULL; - - if (!pInstance) - { - pPlayer->GetSession()->SendNotification("Instance script not initialized"); - return true; - } - - Creature *Vashj = NULL; - Vashj = (Unit::GetCreature((*pPlayer), pInstance->GetData64(DATA_LADYVASHJ))); - if (Vashj && CAST_AI(boss_lady_vashjAI, Vashj->AI())->Phase == 2) - { - if (targets.getGOTarget() && targets.getGOTarget()->GetTypeId()==TYPEID_GAMEOBJECT) - { - uint32 identifier; - uint8 channel_identifier; - switch(targets.getGOTarget()->GetEntry()) - { - case 185052: - identifier = DATA_SHIELDGENERATOR1; - channel_identifier = 0; - break; - case 185053: - identifier = DATA_SHIELDGENERATOR2; - channel_identifier = 1; - break; - case 185051: - identifier = DATA_SHIELDGENERATOR3; - channel_identifier = 2; - break; - case 185054: - identifier = DATA_SHIELDGENERATOR4; - channel_identifier = 3; - break; - default: - return true; - } - - if (pInstance->GetData(identifier)) - { - pPlayer->GetSession()->SendNotification("Already deactivated"); - return true; - } - - //get and remove channel - Unit *Channel = NULL; - Channel = Unit::GetCreature(*Vashj, CAST_AI(boss_lady_vashjAI, Vashj->AI())->ShieldGeneratorChannel[channel_identifier]); - if (Channel) - { - //call Unsummon() - Channel->setDeathState(JUST_DIED); - } - - pInstance->SetData(identifier, 1); - - //remove this item - pPlayer->DestroyItemCount(31088, 1, true); - return true; - } - else if (targets.getUnitTarget()->GetTypeId() == TYPEID_UNIT) - return false; - else if (targets.getUnitTarget()->GetTypeId() == TYPEID_PLAYER) - { - pPlayer->DestroyItemCount(31088, 1, true); - pPlayer->CastSpell(targets.getUnitTarget(), 38134, true); - return true; - } - } - return true; -} - -CreatureAI* GetAI_boss_lady_vashj(Creature* pCreature) -{ - return new boss_lady_vashjAI (pCreature); -} - -CreatureAI* GetAI_mob_enchanted_elemental(Creature* pCreature) -{ - return new mob_enchanted_elementalAI (pCreature); -} - -CreatureAI* GetAI_mob_tainted_elemental(Creature* pCreature) -{ - return new mob_tainted_elementalAI (pCreature); -} - -CreatureAI* GetAI_mob_toxic_sporebat(Creature* pCreature) -{ - return new mob_toxic_sporebatAI (pCreature); -} - -CreatureAI* GetAI_mob_shield_generator_channel(Creature* pCreature) -{ - return new mob_shield_generator_channelAI (pCreature); -} - -void AddSC_boss_lady_vashj() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_lady_vashj"; - newscript->GetAI = &GetAI_boss_lady_vashj; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_enchanted_elemental"; - newscript->GetAI = &GetAI_mob_enchanted_elemental; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_tainted_elemental"; - newscript->GetAI = &GetAI_mob_tainted_elemental; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_toxic_sporebat"; - newscript->GetAI = &GetAI_mob_toxic_sporebat; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_coilfang_elite"; - newscript->GetAI = &GetAI_mob_coilfang_elite; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_coilfang_strider"; - newscript->GetAI = &GetAI_mob_coilfang_strider; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_shield_generator_channel"; - newscript->GetAI = &GetAI_mob_shield_generator_channel; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="item_tainted_core"; - newscript->pItemUse = &ItemUse_item_tainted_core; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_leotheras_the_blind.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_leotheras_the_blind.cpp deleted file mode 100644 index e43afc2926f..00000000000 --- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_leotheras_the_blind.cpp +++ /dev/null @@ -1,808 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Leotheras_The_Blind -SD%Complete: 80 -SDComment: Possesion Support -SDCategory: Coilfang Resevoir, Serpent Shrine Cavern -EndScriptData */ - -#include "precompiled.h" -#include "def_serpent_shrine.h" - -// --- Spells used by Leotheras The Blind -#define SPELL_WHIRLWIND 37640 -#define SPELL_CHAOS_BLAST 37674 -#define SPELL_BERSERK 26662 -#define SPELL_INSIDIOUS_WHISPER 37676 -#define SPELL_DUAL_WIELD 42459 - -// --- Spells used in banish phase --- -#define BANISH_BEAM 38909 -#define AURA_BANISH 37833 - -// --- Spells used by Greyheart Spellbinders -#define SPELL_EARTHSHOCK 39076 -#define SPELL_MINDBLAST 37531 - -// --- Spells used by Inner Demons and Creature ID -#define INNER_DEMON_ID 21857 -#define AURA_DEMONIC_ALIGNMENT 37713 -#define SPELL_SHADOWBOLT 39309 -#define SPELL_SOUL_LINK 38007 -#define SPELL_CONSUMING_MADNESS 37749 //not supported by core yet - -//Misc. -#define MODEL_DEMON 20125 -#define MODEL_NIGHTELF 20514 -#define DEMON_FORM 21875 -#define MOB_SPELLBINDER 21806 - -#define SAY_AGGRO -1548009 -#define SAY_SWITCH_TO_DEMON -1548010 -#define SAY_INNER_DEMONS -1548011 -#define SAY_DEMON_SLAY1 -1548012 -#define SAY_DEMON_SLAY2 -1548013 -#define SAY_DEMON_SLAY3 -1548014 -#define SAY_NIGHTELF_SLAY1 -1548015 -#define SAY_NIGHTELF_SLAY2 -1548016 -#define SAY_NIGHTELF_SLAY3 -1548017 -#define SAY_FINAL_FORM -1548018 -#define SAY_FREE -1548019 -#define SAY_DEATH -1548020 - -struct TRINITY_DLL_DECL mob_inner_demonAI : public ScriptedAI -{ - mob_inner_demonAI(Creature *c) : ScriptedAI(c) - { - victimGUID = 0; - } - - uint32 ShadowBolt_Timer; - - uint32 Link_Timer; - uint64 victimGUID; - - void Reset() - { - ShadowBolt_Timer = 10000; - Link_Timer = 1000; - } - void JustDied(Unit *victim) - { - Unit* pUnit = Unit::GetUnit((*m_creature),victimGUID); - if (pUnit && pUnit->HasAura(SPELL_INSIDIOUS_WHISPER)) - pUnit->RemoveAurasDueToSpell(SPELL_INSIDIOUS_WHISPER); - } - - void DamageTaken(Unit *done_by, uint32 &damage) - { - if (done_by->GetGUID() != victimGUID && done_by->GetGUID() != m_creature->GetGUID()) - { - damage = 0; - DoModifyThreatPercent(done_by, -100); - } - } - - void EnterCombat(Unit *who) - { - if (!victimGUID) return; - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - if (m_creature->getVictim()->GetGUID() != victimGUID) - { - DoModifyThreatPercent(m_creature->getVictim(), -100); - Unit* owner = Unit::GetUnit((*m_creature),victimGUID); - if (owner && owner->isAlive()) - { - m_creature->AddThreat(owner,999999); - AttackStart(owner); - }else if (owner && owner->isDead()) - { - m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - return; - } - } - - if (Link_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_SOUL_LINK, true); - Link_Timer = 1000; - }else Link_Timer -= diff; - - - if (!m_creature->HasAura(AURA_DEMONIC_ALIGNMENT)) - DoCast(m_creature, AURA_DEMONIC_ALIGNMENT,true); - - if (ShadowBolt_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_SHADOWBOLT, false); - ShadowBolt_Timer = 10000; - }else ShadowBolt_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -//Original Leotheras the Blind AI -struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI -{ - boss_leotheras_the_blindAI(Creature *c) : ScriptedAI(c) - { - m_creature->GetPosition(x,y,z); - pInstance = c->GetInstanceData(); - Demon = 0; - - for(uint8 i = 0; i < 3; ++i)//clear guids - SpellBinderGUID[i] = 0; - } - - ScriptedInstance *pInstance; - - uint32 Whirlwind_Timer; - uint32 ChaosBlast_Timer; - uint32 SwitchToDemon_Timer; - uint32 SwitchToHuman_Timer; - uint32 Berserk_Timer; - uint32 InnerDemons_Timer; - uint32 BanishTimer; - - bool DealDamage; - bool NeedThreatReset; - bool DemonForm; - bool IsFinalForm; - bool EnrageUsed; - float x,y,z; - - uint64 InnderDemon[5]; - uint32 InnderDemon_Count; - uint64 Demon; - uint64 SpellBinderGUID[3]; - - void Reset() - { - CheckChannelers(); - BanishTimer = 1000; - Whirlwind_Timer = 15000; - ChaosBlast_Timer = 1000; - SwitchToDemon_Timer = 45000; - SwitchToHuman_Timer = 60000; - Berserk_Timer = 600000; - InnerDemons_Timer = 30000; - m_creature->SetCanDualWield(true); - DealDamage = true; - DemonForm = false; - IsFinalForm = false; - NeedThreatReset = false; - EnrageUsed = false; - InnderDemon_Count = 0; - m_creature->SetSpeed(MOVE_RUN, 2.0f, true); - m_creature->SetDisplayId(MODEL_NIGHTELF); - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID , 0); - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, 0); - m_creature->CastSpell(m_creature, SPELL_DUAL_WIELD, true); - m_creature->SetCorpseDelay(1000*60*60); - if (pInstance) - pInstance->SetData(DATA_LEOTHERASTHEBLINDEVENT, NOT_STARTED); - } - - void CheckChannelers(bool DoEvade = true) - { - for(uint8 i = 0; i < 3; ++i) - { - if (Creature *add = Unit::GetCreature(*m_creature,SpellBinderGUID[i])) - add->DisappearAndDie(); - - float nx = x; - float ny = y; - float o = 2.4f; - if (i == 0) {nx += 10; ny -= 5; o=2.5f;} - if (i == 1) {nx -= 8; ny -= 7; o=0.9f;} - if (i == 2) {nx -= 3; ny += 9; o=5.0f;} - Creature* binder = m_creature->SummonCreature(MOB_SPELLBINDER,nx,ny,z,o,TEMPSUMMON_DEAD_DESPAWN,0); - if (binder) - SpellBinderGUID[i] = binder->GetGUID(); - - } - } - void MoveInLineOfSight(Unit *who) - { - if (m_creature->HasAura(AURA_BANISH)) - return; - - if (!m_creature->getVictim() && who->isTargetableForAttack() && (m_creature->IsHostileTo(who)) && who->isInAccessiblePlaceFor(m_creature)) - { - if (m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) - return; - - float attackRadius = m_creature->GetAttackDistance(who); - if (m_creature->IsWithinDistInMap(who, attackRadius)) - { - // Check first that object is in an angle in front of this one before LoS check - if (m_creature->HasInArc(M_PI/2.0f, who) && m_creature->IsWithinLOSInMap(who)) - { - AttackStart(who); - } - } - } - } - - void StartEvent() - { - DoScriptText(SAY_AGGRO, m_creature); - if (pInstance) - pInstance->SetData(DATA_LEOTHERASTHEBLINDEVENT, IN_PROGRESS); - } - - void CheckBanish() - { - uint8 AliveChannelers = 0; - for(uint8 i = 0; i < 3; ++i) - { - Unit *add = Unit::GetUnit(*m_creature,SpellBinderGUID[i]); - if (add && add->isAlive()) - AliveChannelers++; - } - - // channelers == 0 remove banish aura - if (AliveChannelers == 0 && m_creature->HasAura(AURA_BANISH)) - { - // removing banish aura - m_creature->RemoveAurasDueToSpell(AURA_BANISH); - - // Leotheras is getting immune again - m_creature->ApplySpellImmune(AURA_BANISH, IMMUNITY_MECHANIC, MECHANIC_BANISH, true); - - // changing model to bloodelf - m_creature->SetDisplayId(MODEL_NIGHTELF); - - // and reseting equipment - m_creature->LoadEquipment(m_creature->GetEquipmentId()); - - if (pInstance && pInstance->GetData64(DATA_LEOTHERAS_EVENT_STARTER)) - { - Unit *victim = NULL; - victim = Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_LEOTHERAS_EVENT_STARTER)); - if (victim) - m_creature->getThreatManager().addThreat(victim, 1); - StartEvent(); - } - } - else if (AliveChannelers != 0 && !m_creature->HasAura(AURA_BANISH)) - { - // channelers != 0 apply banish aura - // removing Leotheras banish immune to apply AURA_BANISH - m_creature->ApplySpellImmune(AURA_BANISH, IMMUNITY_MECHANIC, MECHANIC_BANISH, false); - DoCast(m_creature, AURA_BANISH); - - // changing model - m_creature->SetDisplayId(MODEL_DEMON); - - // and removing weapons - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID , 0); - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, 0); - } - } - - //Despawn all Inner Demon summoned - void DespawnDemon() - { - for(uint8 i=0; i<5; ++i) - { - if (InnderDemon[i]) - { - //delete creature - Creature* pCreature = Unit::GetCreature((*m_creature), InnderDemon[i]); - if (pCreature && pCreature->isAlive()) - { - pCreature->ForcedDespawn(); - } - InnderDemon[i] = 0; - } - } - - InnderDemon_Count = 0; - } - - void CastConsumingMadness() //remove this once SPELL_INSIDIOUS_WHISPER is supported by core - { - for(uint8 i=0; i<5; ++i) - { - if (InnderDemon[i] > 0) - { - Creature* pUnit = Unit::GetCreature((*m_creature), InnderDemon[i]); - if (pUnit && pUnit->isAlive()) - { - Unit* pUnit_target = Unit::GetUnit(*pUnit, CAST_AI(mob_inner_demonAI, pUnit->AI())->victimGUID); - if (pUnit_target && pUnit_target->isAlive()) - { - pUnit->CastSpell(pUnit_target, SPELL_CONSUMING_MADNESS, true); - DoModifyThreatPercent(pUnit_target, -100); - } - } - } - } - } - - void KilledUnit(Unit *victim) - { - if (victim->GetTypeId() != TYPEID_PLAYER) - return; - - if (DemonForm) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_DEMON_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_DEMON_SLAY2, m_creature); break; - case 2: DoScriptText(SAY_DEMON_SLAY3, m_creature); break; - } - } - else - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_NIGHTELF_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_NIGHTELF_SLAY2, m_creature); break; - case 2: DoScriptText(SAY_NIGHTELF_SLAY3, m_creature); break; - } - } - } - - void JustDied(Unit *victim) - { - DoScriptText(SAY_DEATH, m_creature); - - //despawn copy - if (Demon) - { - if (Creature* pDemon = Unit::GetCreature(*m_creature, Demon)) - pDemon->ForcedDespawn(); - } - if (pInstance) - pInstance->SetData(DATA_LEOTHERASTHEBLINDEVENT, DONE); - } - - void EnterCombat(Unit *who) - { - if (m_creature->HasAura(AURA_BANISH)) - return; - - m_creature->LoadEquipment(m_creature->GetEquipmentId()); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (m_creature->HasAura(AURA_BANISH) || !UpdateVictim()) - { - if (BanishTimerHasAura(SPELL_WHIRLWIND)) - if (Whirlwind_Timer < diff) - { - Unit *newTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (newTarget) - { - DoResetThreat(); - m_creature->GetMotionMaster()->Clear(); - m_creature->GetMotionMaster()->MovePoint(0,newTarget->GetPositionX(),newTarget->GetPositionY(),newTarget->GetPositionZ()); - } - Whirlwind_Timer = 2000; - }else Whirlwind_Timer -= diff; - - // reseting after changing forms and after ending whirlwind - if (NeedThreatReset && !m_creature->HasAura(SPELL_WHIRLWIND)) - { - // when changing forms seting timers (or when ending whirlwind - to avoid adding new variable i use Whirlwind_Timer to countdown 2s while whirlwinding) - if (DemonForm) - InnerDemons_Timer = 30000; - else - Whirlwind_Timer = 15000; - - NeedThreatReset = false; - DoResetThreat(); - m_creature->GetMotionMaster()->Clear(); - m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); - } - - //Enrage_Timer (10 min) - if (Berserk_Timer < diff && !EnrageUsed) - { - m_creature->InterruptNonMeleeSpells(false); - DoCast(m_creature, SPELL_BERSERK); - EnrageUsed = true; - }else Berserk_Timer -= diff; - - if (!DemonForm) - { - //Whirldind Timer - if (!m_creature->HasAura(SPELL_WHIRLWIND)) - { - if (Whirlwind_Timer < diff) - { - DoCast(m_creature, SPELL_WHIRLWIND); - // while whirlwinding this variable is used to countdown target's change - Whirlwind_Timer = 2000; - NeedThreatReset = true; - }else Whirlwind_Timer -= diff; - } - //Switch_Timer - - if (!IsFinalForm) - if (SwitchToDemon_Timer < diff) - { - //switch to demon form - m_creature->RemoveAurasDueToSpell(SPELL_WHIRLWIND,0); - m_creature->SetDisplayId(MODEL_DEMON); - DoScriptText(SAY_SWITCH_TO_DEMON, m_creature); - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID , 0); - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, 0); - DemonForm = true; - NeedThreatReset = true; - SwitchToDemon_Timer = 45000; - }else SwitchToDemon_Timer -= diff; - DoMeleeAttackIfReady(); - } - else - { - //ChaosBlast_Timer - if (!m_creature->getVictim()) - return; - if (m_creature->IsWithinDist(m_creature->getVictim(), 30)) - m_creature->StopMoving(); - if (ChaosBlast_Timer < diff) - { - // will cast only when in range of spell - if (m_creature->IsWithinDist(m_creature->getVictim(), 30)) - { - //m_creature->CastSpell(m_creature->getVictim(), SPELL_CHAOS_BLAST, true); - int damage = 100; - m_creature->CastCustomSpell(m_creature->getVictim(), SPELL_CHAOS_BLAST, &damage, NULL, NULL, false, NULL, NULL, m_creature->GetGUID()); - } - ChaosBlast_Timer = 3000; - }else ChaosBlast_Timer -= diff; - //Summon Inner Demon - if (InnerDemons_Timer < diff) - { - std::list& ThreatList = m_creature->getThreatManager().getThreatList(); - std::vector TargetList; - for(std::list::iterator itr = ThreatList.begin(); itr != ThreatList.end(); ++itr) - { - Unit *tempTarget = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()); - if (tempTarget && tempTarget->GetTypeId() == TYPEID_PLAYER && tempTarget->GetGUID() != m_creature->getVictim()->GetGUID() && TargetList.size()<5) - TargetList.push_back(tempTarget); - } - SpellEntry *spell = GET_SPELL(SPELL_INSIDIOUS_WHISPER); - for(std::vector::iterator itr = TargetList.begin(); itr != TargetList.end(); ++itr) - { - if ((*itr) && (*itr)->isAlive()) - { - Creature * demon = m_creature->SummonCreature(INNER_DEMON_ID, (*itr)->GetPositionX()+10, (*itr)->GetPositionY()+10, (*itr)->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); - if (demon) - { - demon->AI()->AttackStart((*itr)); - CAST_AI(mob_inner_demonAI, demon->AI())->victimGUID = (*itr)->GetGUID(); - - uint8 eff_mask=0; - for (int i=0; i<3; ++i) - { - if (!spell->Effect[i]) - continue; - eff_mask|=1<AddAura(new Aura(spell, eff_mask, NULL, (*itr), (*itr))); - if (InnderDemon_Count > 4) InnderDemon_Count = 0; - - //Safe storing of creatures - InnderDemon[InnderDemon_Count] = demon->GetGUID(); - - //Update demon count - InnderDemon_Count++; - } - } - } - DoScriptText(SAY_INNER_DEMONS, m_creature); - - InnerDemons_Timer = 999999; - }else InnerDemons_Timer -= diff; - - //Switch_Timer - if (SwitchToHuman_Timer < diff) - { - //switch to nightelf form - m_creature->SetDisplayId(MODEL_NIGHTELF); - m_creature->LoadEquipment(m_creature->GetEquipmentId()); - - CastConsumingMadness(); - DespawnDemon(); - - DemonForm = false; - NeedThreatReset = true; - - SwitchToHuman_Timer = 60000; - }else SwitchToHuman_Timer -= diff; - } - - if (!IsFinalForm && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 15) - { - //at this point he divides himself in two parts - CastConsumingMadness(); - DespawnDemon(); - Creature *Copy = NULL; - Copy = DoSpawnCreature(DEMON_FORM, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 6000); - if (Copy) - { - Demon = Copy->GetGUID(); - if (m_creature->getVictim()) - Copy->AI()->AttackStart(m_creature->getVictim()); - } - //set nightelf final form - IsFinalForm = true; - DemonForm = false; - - DoScriptText(SAY_FINAL_FORM, m_creature); - m_creature->SetDisplayId(MODEL_NIGHTELF); - m_creature->LoadEquipment(m_creature->GetEquipmentId()); - } - } -}; - -//Leotheras the Blind Demon Form AI -struct TRINITY_DLL_DECL boss_leotheras_the_blind_demonformAI : public ScriptedAI -{ - boss_leotheras_the_blind_demonformAI(Creature *c) : ScriptedAI(c) {} - - uint32 ChaosBlast_Timer; - bool DealDamage; - - void Reset() - { - ChaosBlast_Timer = 1000; - DealDamage = true; - } - - void StartEvent() - { - DoScriptText(SAY_FREE, m_creature); - } - - void KilledUnit(Unit *victim) - { - if (victim->GetTypeId() != TYPEID_PLAYER) - return; - - switch(rand()%3) - { - case 0: DoScriptText(SAY_DEMON_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_DEMON_SLAY2, m_creature); break; - case 2: DoScriptText(SAY_DEMON_SLAY3, m_creature); break; - } - } - - void JustDied(Unit *victim) - { - //invisibility (blizzlike, at the end of the fight he doesn't die, he disappears) - m_creature->CastSpell(m_creature, 8149, true); - } - - void EnterCombat(Unit *who) - { - StartEvent(); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - //ChaosBlast_Timer - if (m_creature->IsWithinDist(m_creature->getVictim(), 30)) - m_creature->StopMoving(); - - if (ChaosBlast_Timer < diff) - { - // will cast only when in range od spell - if (m_creature->IsWithinDist(m_creature->getVictim(), 30)) - { - //m_creature->CastSpell(m_creature->getVictim(),SPELL_CHAOS_BLAST,true); - int damage = 100; - m_creature->CastCustomSpell(m_creature->getVictim(), SPELL_CHAOS_BLAST, &damage, NULL, NULL, false, NULL, NULL, m_creature->GetGUID()); - ChaosBlast_Timer = 3000; - } - }else ChaosBlast_Timer -= diff; - - //Do NOT deal any melee damage to the target. - } -}; -struct TRINITY_DLL_DECL mob_greyheart_spellbinderAI : public ScriptedAI -{ - mob_greyheart_spellbinderAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData();; - leotherasGUID = 0; - AddedBanish = false; - } - - ScriptedInstance *pInstance; - - uint64 leotherasGUID; - - uint32 Mindblast_Timer; - uint32 Earthshock_Timer; - - bool AddedBanish; - - void Reset() - { - Mindblast_Timer = 3000 + rand()%5000; - Earthshock_Timer = 5000 + rand()%5000; - - if (pInstance) - { - pInstance->SetData64(DATA_LEOTHERAS_EVENT_STARTER, 0); - Creature *leotheras = Unit::GetCreature(*m_creature, leotherasGUID); - if (leotheras && leotheras->isAlive()) - CAST_AI(boss_leotheras_the_blindAI, leotheras->AI())->CheckChannelers(false); - } - } - - void EnterCombat(Unit *who) - { - m_creature->InterruptNonMeleeSpells(false); - if (pInstance) - pInstance->SetData64(DATA_LEOTHERAS_EVENT_STARTER, who->GetGUID()); - } - - void JustRespawned() - { - AddedBanish = false; - Reset(); - } - - void CastChanneling() - { - if (!m_creature->isInCombat() && !m_creature->m_currentSpells[CURRENT_CHANNELED_SPELL]) - { - if (leotherasGUID) - { - Creature *leotheras = Unit::GetCreature(*m_creature, leotherasGUID); - if (leotheras && leotheras->isAlive()) - DoCast(leotheras, BANISH_BEAM); - } - } - } - - void UpdateAI(const uint32 diff) - { - if (pInstance) - { - if (!leotherasGUID) - leotherasGUID = pInstance->GetData64(DATA_LEOTHERAS); - - if (!m_creature->isInCombat() && pInstance->GetData64(DATA_LEOTHERAS_EVENT_STARTER)) - { - Unit *victim = NULL; - victim = Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_LEOTHERAS_EVENT_STARTER)); - if (victim) - AttackStart(victim); - } - } - - if (!UpdateVictim()) - { - CastChanneling(); - return; - } - - if (pInstance && !pInstance->GetData64(DATA_LEOTHERAS_EVENT_STARTER)) - { - EnterEvadeMode(); - return; - } - - if (Mindblast_Timer < diff) - { - Unit* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM,0); - - if (target)DoCast(target, SPELL_MINDBLAST); - - Mindblast_Timer = 10000 + rand()%5000; - }else Mindblast_Timer -= diff; - - if (Earthshock_Timer < diff) - { - Map* pMap = m_creature->GetMap(); - Map::PlayerList const &PlayerList = pMap->GetPlayers(); - for(Map::PlayerList::const_iterator itr = PlayerList.begin();itr != PlayerList.end(); ++itr) - { - if (Player* i_pl = itr->getSource()) - { - bool isCasting = false; - for(uint8 i = 0; i < CURRENT_MAX_SPELL; ++i) - if (i_pl->m_currentSpells[i]) - isCasting = true; - - if (isCasting) - { - DoCast(i_pl, SPELL_EARTHSHOCK); - break; - } - } - } - Earthshock_Timer = 8000 + rand()%7000; - }else Earthshock_Timer -= diff; - DoMeleeAttackIfReady(); - } - - void JustDied(Unit *killer) {} -}; -CreatureAI* GetAI_boss_leotheras_the_blind(Creature* pCreature) -{ - return new boss_leotheras_the_blindAI (pCreature); -} - -CreatureAI* GetAI_boss_leotheras_the_blind_demonform(Creature* pCreature) -{ - return new boss_leotheras_the_blind_demonformAI (pCreature); -} - -CreatureAI* GetAI_mob_greyheart_spellbinder(Creature* pCreature) -{ - return new mob_greyheart_spellbinderAI (pCreature); -} - -CreatureAI* GetAI_mob_inner_demon(Creature* pCreature) -{ - return new mob_inner_demonAI (pCreature); -} -void AddSC_boss_leotheras_the_blind() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_leotheras_the_blind"; - newscript->GetAI = &GetAI_boss_leotheras_the_blind; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="boss_leotheras_the_blind_demonform"; - newscript->GetAI = &GetAI_boss_leotheras_the_blind_demonform; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_greyheart_spellbinder"; - newscript->GetAI = &GetAI_mob_greyheart_spellbinder; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_inner_demon"; - newscript->GetAI = &GetAI_mob_inner_demon; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_lurker_below.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_lurker_below.cpp deleted file mode 100644 index 38abc8f1507..00000000000 --- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_lurker_below.cpp +++ /dev/null @@ -1,489 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: boss_the_lurker_below -SD%Complete: 80 -SDComment: Coilfang Frenzy, find out how could we fishing in the strangepool -SDCategory: The Lurker Below -EndScriptData */ - -#include "precompiled.h" -#include "def_serpent_shrine.h" -#include "simple_ai.h" -#include "Spell.h" - -#define SPELL_SPOUT 37433 -#define SPELL_SPOUT_ANIM 42835 -#define SPELL_SPOUT_BREATH 37431 -#define SPELL_KNOCKBACK 19813 -#define SPELL_GEYSER 37478 -#define SPELL_WHIRL 37660 -#define SPELL_WATERBOLT 37138 -#define SPELL_SUBMERGE 37550 -#define SPELL_EMERGE 20568 -#define SPELL_SCALDINGWATER 37284 - -#define EMOTE_SPOUT "takes a deep breath." - -#define SPOUT_DIST 100 - -#define MOB_COILFANG_GUARDIAN 21873 -#define MOB_COILFANG_AMBUSHER 21865 - -//Ambusher spells -#define SPELL_SPREAD_SHOT 37790 -#define SPELL_SHOOT 37770 - -//Guardian spells -#define SPELL_ARCINGSMASH 38761 // Wrong SpellId. Can't find the right one. -#define SPELL_HAMSTRING 26211 - -float AddPos[9][3] = -{ - {2.8553810, -459.823914, -19.182686}, //MOVE_AMBUSHER_1 X, Y, Z - {12.400000, -466.042267, -19.182686}, //MOVE_AMBUSHER_2 X, Y, Z - {51.366653, -460.836060, -19.182686}, //MOVE_AMBUSHER_3 X, Y, Z - {62.597980, -457.433044, -19.182686}, //MOVE_AMBUSHER_4 X, Y, Z - {77.607452, -384.302765, -19.182686}, //MOVE_AMBUSHER_5 X, Y, Z - {63.897900, -378.984924, -19.182686}, //MOVE_AMBUSHER_6 X, Y, Z - {34.447250, -387.333618, -19.182686}, //MOVE_GUARDIAN_1 X, Y, Z - {14.388216, -423.468018, -19.625271}, //MOVE_GUARDIAN_2 X, Y, Z - {42.471519, -445.115295, -19.769423} //MOVE_GUARDIAN_3 X, Y, Z -}; - -enum RotationType -{ - NOROTATE = 0, - CLOCKWISE = 1, - COUNTERCLOCKWISE = 2, -}; - -struct TRINITY_DLL_DECL boss_the_lurker_belowAI : public Scripted_NoMovementAI -{ - boss_the_lurker_belowAI(Creature *c) : Scripted_NoMovementAI(c), Summons(m_creature) - { - pInstance = c->GetInstanceData(); - SpellEntry *TempSpell = GET_SPELL(SPELL_SPOUT_ANIM); - if (TempSpell) - { - TempSpell->Effect[0] = 0;//remove all spell effect, only anim is needed - TempSpell->Effect[1] = 0; - TempSpell->Effect[2] = 0; - } - } - - ScriptedInstance* pInstance; - SummonList Summons; - - bool Spawned; - bool Submerged; - - double SpoutAngle; - - uint8 RotType; - - uint32 RotTimer; - uint32 SpoutAnimTimer; - uint32 WaterboltTimer; - uint32 SpoutTimer; - uint32 WhirlTimer;//after avery spout - uint32 PhaseTimer; - uint32 GeyserTimer; - - void Reset() - { - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_SWIMMING + MOVEMENTFLAG_LEVITATING); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetCorpseDelay(1000*60*60); - - RotType = NOROTATE; - - SpoutAngle = 0; - SpoutAnimTimer = 1000; - RotTimer = 20000; - WaterboltTimer = 3000; - SpoutTimer = 15000; - WhirlTimer = 18000;//after avery spout - PhaseTimer = 120000; - GeyserTimer = rand()%5000 + 15000; - - Submerged = false; - Spawned = false; - - Summons.DespawnAll(); - - if (pInstance) - pInstance->SetData(DATA_THELURKERBELOWEVENT, NOT_STARTED); - - /*if (pInstance->GetData(DATA_STRANGE_POOL) != DONE) - { - m_creature->SetReactState(REACT_PASSIVE); - m_creature->SetVisibility(VISIBILITY_OFF); - }else { - m_creature->SetVisibility(VISIBILITY_ON); - m_creature->SetReactState(REACT_AGGRESSIVE); - }*/ - } - - void MoveInLineOfSight(Unit *who) - { - if (!who || m_creature->getVictim()) - return; - - if (who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who)) - { - float attackRadius = m_creature->GetAttackDistance(who); - if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who)) - AttackStart(who); - } - } - - void EnterCombat(Unit *who) - { - if (pInstance) - pInstance->SetData(DATA_THELURKERBELOWEVENT, IN_PROGRESS); - - if (!who || m_creature->getVictim()) - return; - - if (who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who)) - { - float attackRadius = m_creature->GetAttackDistance(who); - if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who)) - AttackStart(who); - } - } - - void JustDied(Unit* Killer) - { - if (pInstance) - pInstance->SetData(DATA_THELURKERBELOWEVENT, DONE); - - Summons.DespawnAll(); - } - - void Rotate(const uint32 diff) - { - bool Spout = false; - switch (RotType) - { - case NOROTATE: - return; - case CLOCKWISE://20secs for 360turn - //no target if rotating! - m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0); - SpoutAngle += (double)diff/20000*(double)M_PI*2; - if (SpoutAngle >= M_PI*2)SpoutAngle = 0; - m_creature->SetOrientation(SpoutAngle); - m_creature->StopMoving(); - Spout = true; - break; - case COUNTERCLOCKWISE://20secs for 360turn - //no target if rotating! - m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0); - SpoutAngle -= (double)diff/20000*(double)M_PI*2; - if (SpoutAngle <= 0)SpoutAngle = M_PI*2; - m_creature->SetOrientation(SpoutAngle); - m_creature->StopMoving(); - Spout = true; - break; - } - - if (!Spout) - return; - - if (RotTimerInterruptNonMeleeSpells(false); - WhirlTimer = 4000; //whirl directly after spout ends - return; - }else RotTimer-=diff; - - if (SpoutAnimTimerGetMap(); - if (pMap->IsDungeon() && pInstance->GetData(DATA_THELURKERBELOWEVENT) == IN_PROGRESS) - { - Map::PlayerList const &PlayerList = pMap->GetPlayers(); - for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) - { - Player *target = i->getSource(); - if (target && target->isAlive() && m_creature->HasInArc((double)diff/20000*(double)M_PI*2,target) && m_creature->IsWithinDist(target, SPOUT_DIST) && !target->IsInWater()) - DoCast(target,SPELL_SPOUT,true);//only knock back palyers in arc, in 100yards, not in water - } - } - } - - void StartRotate(Unit* victim) - { - switch (rand()%2) - { - case 0: RotType = CLOCKWISE; break; - case 1: RotType = COUNTERCLOCKWISE; break; - } - RotTimer=20000; - - if (victim) - SpoutAngle = m_creature->GetAngle(victim); - - m_creature->MonsterTextEmote(EMOTE_SPOUT,0,true); - //DoCast(m_creature,SPELL_SPOUT_BREATH);//take breath anim - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim() /*|| !m_creature->getVictim()*/)//rotate resets target - return; - - //Check if players in water and if in water cast spell - Map* pMap = m_creature->GetMap(); - if (pMap->IsDungeon() && pInstance->GetData(DATA_THELURKERBELOWEVENT) == IN_PROGRESS) - { - Map::PlayerList const &PlayerList = pMap->GetPlayers(); - - if (PlayerList.isEmpty()) - return; - - for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) - { - if (i->getSource()->isAlive() && i->getSource()->IsInWater() && !i->getSource()->HasAura(SPELL_SCALDINGWATER)) - i->getSource()->CastSpell(i->getSource(), SPELL_SCALDINGWATER, true); - else if (!i->getSource()->IsInWater()) - i->getSource()->RemoveAurasDueToSpell(SPELL_SCALDINGWATER); - } - } - - Rotate(diff);//always check rotate things - if (!Submerged) - { - if (PhaseTimer < diff) - { - m_creature->InterruptNonMeleeSpells(false); - DoCast(m_creature,SPELL_SUBMERGE); - PhaseTimer = 60000;//60secs submerged - Submerged = true; - }else PhaseTimer-=diff; - } - - if (!Submerged && RotType == NOROTATE)//is not spouting and not submerged - { - if (SpoutTimer < diff) - { - if (m_creature->getVictim() && RotType == NOROTATE) - StartRotate(m_creature->getVictim());//start spout and random rotate - - SpoutTimer= 35000; - return; - }else SpoutTimer -= diff; - - //Whirl directly after a Spout and at random times - if (WhirlTimer < diff) - { - WhirlTimer = rand()%5000 + 15000; - DoCast(m_creature,SPELL_WHIRL); - WaterboltTimer += 5000;//add 5secs to waterbolt timer, to add some time to run back to boss - }else WhirlTimer -= diff; - - if (GeyserTimer < diff) - { - Unit* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM,1); - - if (target) - DoCast(target,SPELL_GEYSER,true); - else - target = SelectUnit(SELECT_TARGET_RANDOM,0); - if (target) - DoCast(target,SPELL_GEYSER,true); - - GeyserTimer = rand()%5000 + 15000; - }else GeyserTimer -= diff; - - if (WaterboltTimer < diff) - { - Unit* target = SelectTarget(SELECT_TARGET_NEAREST,0,14,true); - if (!target) - { - target = SelectUnit(SELECT_TARGET_RANDOM,0); - if (target) - DoCast(target,SPELL_WATERBOLT); - } - WaterboltTimer = 3000; - }else WaterboltTimer -= diff; - - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - - }else if (!Submerged) - return; - else if (Submerged)//phase 2, submerged - { - if (PhaseTimer < diff) - { - Submerged = false; - m_creature->InterruptNonMeleeSpells(false);//shouldn't be any - m_creature->RemoveAllAuras(); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->RemoveFlag(UNIT_NPC_EMOTESTATE,EMOTE_STATE_SUBMERGED); - m_creature->RemoveFlag(UNIT_FIELD_BYTES_1,9); - DoCast(m_creature,SPELL_EMERGE); - Spawned = false; - SpoutTimer = 4000; // directly cast Spout after emerging! - WhirlTimer = 26000; - PhaseTimer = 120000; - return; - }else PhaseTimer-=diff; - - if (!m_creature->isInCombat()) - DoZoneInCombat(); - - if (!Spawned) - { - m_creature->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - //spawn adds - for (uint8 i = 0; i < 9; ++i) - { - Creature* Summoned; - if (i < 7) - Summoned = m_creature->SummonCreature(MOB_COILFANG_AMBUSHER,AddPos[i][0],AddPos[i][1],AddPos[i][2], 0, TEMPSUMMON_CORPSE_DESPAWN, 0); - else Summoned = m_creature->SummonCreature(MOB_COILFANG_GUARDIAN,AddPos[i][0],AddPos[i][1],AddPos[i][2], 0, TEMPSUMMON_CORPSE_DESPAWN, 0); - - if (Summoned) - Summons.Summon(Summoned); - Spawned = true; - } - } - } - } - }; - -CreatureAI* GetAI_mob_coilfang_guardian(Creature* pCreature) -{ - SimpleAI* ai = new SimpleAI (pCreature); - - ai->Spell[0].Enabled = true; - ai->Spell[0].Spell_Id = SPELL_ARCINGSMASH; - ai->Spell[0].Cooldown = 15000; - ai->Spell[0].First_Cast = 5000; - ai->Spell[0].Cast_Target_Type = CAST_HOSTILE_TARGET; - - ai->Spell[1].Enabled = true; - ai->Spell[1].Spell_Id = SPELL_HAMSTRING; - ai->Spell[1].Cooldown = 10000; - ai->Spell[1].First_Cast = 2000; - ai->Spell[1].Cast_Target_Type = CAST_HOSTILE_TARGET; - - return ai; -} - -struct TRINITY_DLL_DECL mob_coilfang_ambusherAI : public Scripted_NoMovementAI -{ - mob_coilfang_ambusherAI(Creature *c) : Scripted_NoMovementAI(c) - { - SpellEntry *TempSpell = GET_SPELL(SPELL_SHOOT); - if (TempSpell) - TempSpell->Effect[0] = 2;//change spell effect from weapon % dmg to simple phisical dmg - } - - uint32 MultiShotTimer; - uint32 ShootBowTimer; - - void Reset() - { - MultiShotTimer = 10000; - ShootBowTimer = 4000; - - } - - void EnterCombat(Unit *who) - { - - } - - void MoveInLineOfSight(Unit *who) - { - if (!who || m_creature->getVictim()) return; - - if (who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who)) - { - AttackStart(who); - } - } - - void UpdateAI(const uint32 diff) - { - if (MultiShotTimer < diff) - { - if (m_creature->getVictim()) - DoCast(m_creature->getVictim(), SPELL_SPREAD_SHOT, true); - - MultiShotTimer = 10000; - ShootBowTimer += 1500;//add global cooldown - }else MultiShotTimer -= diff; - - if (ShootBowTimer < diff) - { - Unit* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM, 0); - int bp0 = 1100; - if (target) - m_creature->CastCustomSpell(target,SPELL_SHOOT,&bp0,NULL,NULL,true); - ShootBowTimer = 4000; - MultiShotTimer += 1500;//add global cooldown - }else ShootBowTimer -= diff; - } -}; - -CreatureAI* GetAI_mob_coilfang_ambusher(Creature* pCreature) -{ - return new mob_coilfang_ambusherAI (pCreature); -} - -CreatureAI* GetAI_boss_the_lurker_below(Creature* pCreature) -{ - return new boss_the_lurker_belowAI (pCreature); -} - -void AddSC_boss_the_lurker_below() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_the_lurker_below"; - newscript->GetAI = &GetAI_boss_the_lurker_below; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_coilfang_guardian"; - newscript->GetAI = &GetAI_mob_coilfang_guardian; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_coilfang_ambusher"; - newscript->GetAI = &GetAI_mob_coilfang_ambusher; - newscript->RegisterSelf(); -} - - diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_morogrim_tidewalker.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_morogrim_tidewalker.cpp deleted file mode 100644 index 80e05cc494b..00000000000 --- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_morogrim_tidewalker.cpp +++ /dev/null @@ -1,372 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -/* ScriptData -SDName: Boss_Morogrim_Tidewalker -SD%Complete: 90 -SDComment: Water globules don't explode properly, remove hacks -SDCategory: Coilfang Resevoir, Serpent Shrine Cavern -EndScriptData */ - -#include "precompiled.h" -#include "def_serpent_shrine.h" - -#define SAY_AGGRO -1548030 -#define SAY_SUMMON1 -1548031 -#define SAY_SUMMON2 -1548032 -#define SAY_SUMMON_BUBL1 -1548033 -#define SAY_SUMMON_BUBL2 -1548034 -#define SAY_SLAY1 -1548035 -#define SAY_SLAY2 -1548036 -#define SAY_SLAY3 -1548037 -#define SAY_DEATH -1548038 -#define EMOTE_WATERY_GRAVE -1548039 -#define EMOTE_EARTHQUAKE -1548040 -#define EMOTE_WATERY_GLOBULES -1548041 - -#define SPELL_TIDAL_WAVE 37730 -#define SPELL_WATERY_GRAVE 38049 -#define SPELL_EARTHQUAKE 37764 -#define SPELL_WATERY_GRAVE_EXPLOSION 37852 - -#define WATERY_GRAVE_X1 334.64 -#define WATERY_GRAVE_Y1 -728.89 -#define WATERY_GRAVE_Z1 -14.42 -#define WATERY_GRAVE_X2 365.51 -#define WATERY_GRAVE_Y2 -737.14 -#define WATERY_GRAVE_Z2 -14.44 -#define WATERY_GRAVE_X3 366.19 -#define WATERY_GRAVE_Y3 -709.59 -#define WATERY_GRAVE_Z3 -14.36 -#define WATERY_GRAVE_X4 372.93 -#define WATERY_GRAVE_Y4 -690.96 -#define WATERY_GRAVE_Z4 -14.44 - -#define SPELL_WATERY_GRAVE_1 38023 -#define SPELL_WATERY_GRAVE_2 38024 -#define SPELL_WATERY_GRAVE_3 38025 -#define SPELL_WATERY_GRAVE_4 37850 - -#define SPELL_SUMMON_WATER_GLOBULE_1 37854 -#define SPELL_SUMMON_WATER_GLOBULE_2 37858 -#define SPELL_SUMMON_WATER_GLOBULE_3 37860 -#define SPELL_SUMMON_WATER_GLOBULE_4 37861 - -/*#define SPELL_SUMMON_MURLOC_A6 39813 -#define SPELL_SUMMON_MURLOC_A7 39814 -#define SPELL_SUMMON_MURLOC_A8 39815 -#define SPELL_SUMMON_MURLOC_A9 39816 -#define SPELL_SUMMON_MURLOC_A10 39817 - -#define SPELL_SUMMON_MURLOC_B6 39818 -#define SPELL_SUMMON_MURLOC_B7 39819 -#define SPELL_SUMMON_MURLOC_B8 39820 -#define SPELL_SUMMON_MURLOC_B9 39821 -#define SPELL_SUMMON_MURLOC_B10 39822*/ - -float MurlocCords[10][5] = -{ - {21920, 424.36, -715.4, -7.14, 0.124}, - {21920, 425.13, -719.3, -7.14, 0.124}, - {21920, 425.05, -724.23, -7.14, 0.124}, - {21920, 424.91, -728.68, -7.14, 0.124}, - {21920, 424.84, -732.18, -7.14, 0.124}, - {21920, 321.05, -734.2, -13.15, 0.124}, - {21920, 321.05, -729.4, -13.15, 0.124}, - {21920, 321.05, -724.03, -13.15, 0.124}, - {21920, 321.05, -718.73, -13.15, 0.124}, - {21920, 321.05, -714.24, -13.15, 0.124} -}; - -//Creatures -#define WATER_GLOBULE 21913 -#define TIDEWALKER_LURKER 21920 - -//Morogrim Tidewalker AI -struct TRINITY_DLL_DECL boss_morogrim_tidewalkerAI : public ScriptedAI -{ - boss_morogrim_tidewalkerAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - Map::PlayerList const *PlayerList; - - uint32 TidalWave_Timer; - uint32 WateryGrave_Timer; - uint32 Earthquake_Timer; - uint32 WateryGlobules_Timer; - uint32 globulespell[4]; - int8 Playercount; - int8 counter; - - bool Earthquake; - bool Phase2; - - void Reset() - { - TidalWave_Timer = 10000; - WateryGrave_Timer = 30000; - Earthquake_Timer = 40000; - WateryGlobules_Timer = 0; - globulespell[0] = SPELL_SUMMON_WATER_GLOBULE_1; - globulespell[1] = SPELL_SUMMON_WATER_GLOBULE_2; - globulespell[2] = SPELL_SUMMON_WATER_GLOBULE_3; - globulespell[3] = SPELL_SUMMON_WATER_GLOBULE_4; - - Earthquake = false; - Phase2 = false; - - if (pInstance) - pInstance->SetData(DATA_MOROGRIMTIDEWALKEREVENT, NOT_STARTED); - } - - void StartEvent() - { - DoScriptText(SAY_AGGRO, m_creature); - - if (pInstance) - pInstance->SetData(DATA_MOROGRIMTIDEWALKEREVENT, IN_PROGRESS); - } - - void KilledUnit(Unit *victim) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; - case 2: DoScriptText(SAY_SLAY3, m_creature); break; - } - } - - void JustDied(Unit *victim) - { - DoScriptText(SAY_DEATH, m_creature); - - if (pInstance) - pInstance->SetData(DATA_MOROGRIMTIDEWALKEREVENT, DONE); - } - - void EnterCombat(Unit *who) - { - PlayerList = &m_creature->GetMap()->GetPlayers(); - Playercount = PlayerList->getSize(); - StartEvent(); - } - - void ApplyWateryGrave(Unit* pPlayer, uint8 i) - { - switch(i) - { - case 0: pPlayer->CastSpell(pPlayer, SPELL_WATERY_GRAVE_1, true); break; - case 1: pPlayer->CastSpell(pPlayer, SPELL_WATERY_GRAVE_2, true); break; - case 2: pPlayer->CastSpell(pPlayer, SPELL_WATERY_GRAVE_3, true); break; - case 3: pPlayer->CastSpell(pPlayer, SPELL_WATERY_GRAVE_4, true); break; - } - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //Earthquake_Timer - if (Earthquake_Timer < diff) - { - if (!Earthquake) - { - DoCast(m_creature->getVictim(), SPELL_EARTHQUAKE); - Earthquake = true; - Earthquake_Timer = 10000; - } - else - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_SUMMON1, m_creature); break; - case 1: DoScriptText(SAY_SUMMON2, m_creature); break; - } - - for(uint8 i = 0; i < 10; ++i) - { - Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0); - Creature* Murloc = m_creature->SummonCreature(MurlocCords[i][0],MurlocCords[i][1],MurlocCords[i][2],MurlocCords[i][3],MurlocCords[i][4], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000); - if (target && Murloc) - Murloc->AI()->AttackStart(target); - } - DoScriptText(EMOTE_EARTHQUAKE, m_creature); - Earthquake = false; - Earthquake_Timer = 40000+rand()%5000; - } - }else Earthquake_Timer -= diff; - - //TidalWave_Timer - if (TidalWave_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_TIDAL_WAVE); - TidalWave_Timer = 20000; - }else TidalWave_Timer -= diff; - - if (!Phase2) - { - //WateryGrave_Timer - if (WateryGrave_Timer < diff) - { - //Teleport 4 players under the waterfalls - Unit *target; - using std::set; - setlist; - set::iterator itr; - for(uint8 i = 0; i < 4; ++i) - { - counter = 0; - do{target = SelectTarget(SELECT_TARGET_RANDOM, 1, 50, true); //target players only - if (counter < Playercount) - break; - if (target) itr = list.find(target->GetGUID()); - counter++; - }while(itr != list.end()); - if (target){list.insert(target->GetGUID()); - ApplyWateryGrave(target, i); - } - } - - switch(rand()%2) - { - case 0: DoScriptText(SAY_SUMMON_BUBL1, m_creature); break; - case 1: DoScriptText(SAY_SUMMON_BUBL2, m_creature); break; - } - - DoScriptText(EMOTE_WATERY_GRAVE, m_creature); - WateryGrave_Timer = 30000; - }else WateryGrave_Timer -= diff; - - //Start Phase2 - if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 25) - Phase2 = true; - } - else - { - //WateryGlobules_Timer - if (WateryGlobules_Timer < diff) - { - Unit* globuletarget; - using std::set; - setglobulelist; - set::iterator itr; - for (int8 g = 0; g < 4; g++) //one unit cant cast more than one spell per update, so some players have to cast for us XD - { - counter = 0; - do {globuletarget = SelectTarget(SELECT_TARGET_RANDOM, 0,50,true); - if (globuletarget) itr = globulelist.find(globuletarget->GetGUID()); - if (counter > Playercount) - break; - counter++; - } while (itr != globulelist.end()); - if (globuletarget)globulelist.insert(globuletarget->GetGUID()); - globuletarget->CastSpell(globuletarget, globulespell[g], true); - } - DoScriptText(EMOTE_WATERY_GLOBULES, m_creature); - WateryGlobules_Timer = 25000; - }else WateryGlobules_Timer -= diff; - } - - DoMeleeAttackIfReady(); - } -}; - -//Water Globule AI -#define SPELL_GLOBULE_EXPLOSION 37871 - -struct TRINITY_DLL_DECL mob_water_globuleAI : public ScriptedAI -{ - mob_water_globuleAI(Creature *c) : ScriptedAI(c) {} - - uint32 Check_Timer; - - void Reset() - { - Check_Timer = 1000; - - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->setFaction(14); - } - - void EnterCombat(Unit *who) {} - - void MoveInLineOfSight(Unit *who) - { - if (!who || m_creature->getVictim()) - return; - - if (who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who)) - { - //no attack radius check - it attacks the first target that moves in his los - //who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); - AttackStart(who); - } - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - if (Check_Timer < diff) - { - if (m_creature->IsWithinDistInMap(m_creature->getVictim(), 5)) - { - DoCast(m_creature->getVictim(), SPELL_GLOBULE_EXPLOSION); - - //despawn - m_creature->ForcedDespawn(); - return; - } - Check_Timer = 500; - }else Check_Timer -= diff; - - //do NOT deal any melee damage to the target. - } -}; - -CreatureAI* GetAI_boss_morogrim_tidewalker(Creature* pCreature) -{ - return new boss_morogrim_tidewalkerAI (pCreature); -} -CreatureAI* GetAI_mob_water_globule(Creature* pCreature) -{ - return new mob_water_globuleAI (pCreature); -} - -void AddSC_boss_morogrim_tidewalker() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_morogrim_tidewalker"; - newscript->GetAI = &GetAI_boss_morogrim_tidewalker; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_water_globule"; - newscript->GetAI = &GetAI_mob_water_globule; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/def_serpent_shrine.h b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/def_serpent_shrine.h deleted file mode 100644 index 13144bc93c0..00000000000 --- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/def_serpent_shrine.h +++ /dev/null @@ -1,32 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ - -#ifndef DEF_SERPENT_SHRINE_H -#define DEF_SERPENT_SHRINE_H - -#define DATA_CANSTARTPHASE3 1 -#define DATA_CARIBDIS 2 -#define DATA_HYDROSSTHEUNSTABLEEVENT 3 -#define DATA_KARATHRESS 4 -#define DATA_KARATHRESSEVENT 5 -#define DATA_KARATHRESSEVENT_STARTER 6 -#define DATA_LADYVASHJ 7 -#define DATA_LADYVASHJEVENT 8 -#define DATA_LEOTHERASTHEBLINDEVENT 9 -#define DATA_MOROGRIMTIDEWALKEREVENT 10 -#define DATA_SHARKKIS 11 -#define DATA_SHIELDGENERATOR1 12 -#define DATA_SHIELDGENERATOR2 13 -#define DATA_SHIELDGENERATOR3 14 -#define DATA_SHIELDGENERATOR4 15 -#define DATA_THELURKERBELOW 16 -#define DATA_THELURKERBELOWEVENT 17 -#define DATA_TIDALVESS 18 -#define DATA_FATHOMLORDKARATHRESSEVENT 19 -#define DATA_LEOTHERAS 20 -#define DATA_LEOTHERAS_EVENT_STARTER 21 -#define DATA_CONTROL_CONSOLE 22 -#define DATA_STRANGE_POOL 23 -#endif - diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/instance_serpent_shrine.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/instance_serpent_shrine.cpp deleted file mode 100644 index ebeda6aa565..00000000000 --- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/instance_serpent_shrine.cpp +++ /dev/null @@ -1,285 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Instance_Serpent_Shrine -SD%Complete: 100 -SDComment: Instance Data Scripts and functions to acquire mobs and set encounter status for use in various Serpent Shrine Scripts -SDCategory: Coilfang Resevoir, Serpent Shrine Cavern -EndScriptData */ - -#include "precompiled.h" -#include "def_serpent_shrine.h" - -#define MAX_ENCOUNTER 6 - -/* Serpentshrine cavern encounters: -0 - Hydross The Unstable event -1 - Leotheras The Blind Event -2 - The Lurker Below Event -3 - Fathom-Lord Karathress Event -4 - Morogrim Tidewalker Event -5 - Lady Vashj Event -*/ - -bool GOHello_go_bridge_console(Player* pPlayer, GameObject* pGo) -{ - ScriptedInstance* pInstance = pGo->GetInstanceData(); - - if (!pInstance) - return false; - - if (pInstance) - pInstance->SetData(DATA_CONTROL_CONSOLE, DONE); - - return true; -} - -struct TRINITY_DLL_DECL instance_serpentshrine_cavern : public ScriptedInstance -{ - instance_serpentshrine_cavern(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; - - uint64 LurkerBelow; - uint64 Sharkkis; - uint64 Tidalvess; - uint64 Caribdis; - uint64 LadyVashj; - uint64 Karathress; - uint64 KarathressEvent_Starter; - uint64 LeotherasTheBlind; - uint64 LeotherasEventStarter; - - uint64 ControlConsole; - uint64 BridgePart[3]; - uint64 StrangePool; - - bool ShieldGeneratorDeactivated[4]; - uint32 m_auiEncounter[MAX_ENCOUNTER]; - - void Initialize() - { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - - LurkerBelow = 0; - Sharkkis = 0; - Tidalvess = 0; - Caribdis = 0; - LadyVashj = 0; - Karathress = 0; - KarathressEvent_Starter = 0; - LeotherasTheBlind = 0; - LeotherasEventStarter = 0; - - ControlConsole = 0; - BridgePart[0] = 0; - BridgePart[1] = 0; - BridgePart[2] = 0; - StrangePool = 0; - - ShieldGeneratorDeactivated[0] = false; - ShieldGeneratorDeactivated[1] = false; - ShieldGeneratorDeactivated[2] = false; - ShieldGeneratorDeactivated[3] = false; - } - - bool IsEncounterInProgress() const - { - for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) return true; - - return false; - } - - void OnGameObjectCreate(GameObject* pGo, bool add) - { - switch(pGo->GetEntry()) - { - case 184568: - ControlConsole = pGo->GetGUID(); - pGo->setActive(true); - break; - - case 184203: - BridgePart[0] = pGo->GetGUID(); - pGo->setActive(true); - break; - - case 184204: - BridgePart[1] = pGo->GetGUID(); - pGo->setActive(true); - break; - - case 184205: - BridgePart[2] = pGo->GetGUID(); - pGo->setActive(true); - break; - case 184956: - StrangePool = pGo->GetGUID(); - if (pGo->isActiveObject()) - SetData(DATA_STRANGE_POOL, DONE); - } - } - - void OnCreatureCreate(Creature* pCreature, bool add) - { - switch(pCreature->GetEntry()) - { - case 21212: LadyVashj = pCreature->GetGUID(); break; - case 21214: Karathress = pCreature->GetGUID(); break; - case 21966: Sharkkis = pCreature->GetGUID(); break; - case 21217: LurkerBelow = pCreature->GetGUID(); break; - case 21965: Tidalvess = pCreature->GetGUID(); break; - case 21964: Caribdis = pCreature->GetGUID(); break; - case 21215: LeotherasTheBlind = pCreature->GetGUID(); break;} - } - - void SetData64(uint32 type, uint64 data) - { - if (type == DATA_KARATHRESSEVENT_STARTER) - KarathressEvent_Starter = data; - if (type == DATA_LEOTHERAS_EVENT_STARTER) - LeotherasEventStarter = data; - } - - uint64 GetData64(uint32 identifier) - { - switch(identifier) - { - case DATA_THELURKERBELOW: return LurkerBelow; - case DATA_SHARKKIS: return Sharkkis; - case DATA_TIDALVESS: return Tidalvess; - case DATA_CARIBDIS: return Caribdis; - case DATA_LADYVASHJ: return LadyVashj; - case DATA_KARATHRESS: return Karathress; - case DATA_KARATHRESSEVENT_STARTER: return KarathressEvent_Starter; - case DATA_LEOTHERAS: return LeotherasTheBlind; - case DATA_LEOTHERAS_EVENT_STARTER: return LeotherasEventStarter; - } - return 0; - } - - void SetData(uint32 type, uint32 data) - { - switch(type) - { - case DATA_STRANGE_POOL: StrangePool = data; - case DATA_CONTROL_CONSOLE: - if (data == DONE) - { - HandleGameObject(BridgePart[0], true); - HandleGameObject(BridgePart[0], true); - HandleGameObject(BridgePart[0], true); - } - ControlConsole = data; - case DATA_HYDROSSTHEUNSTABLEEVENT: m_auiEncounter[0] = data; break; - case DATA_LEOTHERASTHEBLINDEVENT: m_auiEncounter[1] = data; break; - case DATA_THELURKERBELOWEVENT: m_auiEncounter[2] = data; break; - case DATA_KARATHRESSEVENT: m_auiEncounter[3] = data; break; - case DATA_MOROGRIMTIDEWALKEREVENT: m_auiEncounter[4] = data; break; - //Lady Vashj - case DATA_LADYVASHJEVENT: - if (data == NOT_STARTED) - { - ShieldGeneratorDeactivated[0] = false; - ShieldGeneratorDeactivated[1] = false; - ShieldGeneratorDeactivated[2] = false; - ShieldGeneratorDeactivated[3] = false; - } - m_auiEncounter[5] = data; break; - case DATA_SHIELDGENERATOR1:ShieldGeneratorDeactivated[0] = (data) ? true : false; break; - case DATA_SHIELDGENERATOR2:ShieldGeneratorDeactivated[1] = (data) ? true : false; break; - case DATA_SHIELDGENERATOR3:ShieldGeneratorDeactivated[2] = (data) ? true : false; break; - case DATA_SHIELDGENERATOR4:ShieldGeneratorDeactivated[3] = (data) ? true : false; break; - } - - if (data == DONE) - SaveToDB(); - } - - uint32 GetData(uint32 type) - { - switch(type) - { - case DATA_HYDROSSTHEUNSTABLEEVENT: return m_auiEncounter[0]; - case DATA_LEOTHERASTHEBLINDEVENT: return m_auiEncounter[1]; - case DATA_THELURKERBELOWEVENT: return m_auiEncounter[2]; - case DATA_KARATHRESSEVENT: return m_auiEncounter[3]; - case DATA_MOROGRIMTIDEWALKEREVENT: return m_auiEncounter[4]; - //Lady Vashj - case DATA_LADYVASHJEVENT: return m_auiEncounter[5]; - case DATA_SHIELDGENERATOR1: return ShieldGeneratorDeactivated[0]; - case DATA_SHIELDGENERATOR2: return ShieldGeneratorDeactivated[1]; - case DATA_SHIELDGENERATOR3: return ShieldGeneratorDeactivated[2]; - case DATA_SHIELDGENERATOR4: return ShieldGeneratorDeactivated[3]; - case DATA_CANSTARTPHASE3: - if (ShieldGeneratorDeactivated[0] && ShieldGeneratorDeactivated[1] && ShieldGeneratorDeactivated[2] && ShieldGeneratorDeactivated[3])return 1;break; - } - return 0; - } - std::string GetSaveData() - { - OUT_SAVE_INST_DATA; - std::ostringstream stream; - stream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " " - << m_auiEncounter[3] << " " << m_auiEncounter[4] << " " << m_auiEncounter[5]; - char* out = new char[stream.str().length() + 1]; - strcpy(out, stream.str().c_str()); - if (out) - { - OUT_SAVE_INST_DATA_COMPLETE; - return out; - } - return NULL; - } - - void Load(const char* in) - { - if (!in) - { - OUT_LOAD_INST_DATA_FAIL; - return; - } - OUT_LOAD_INST_DATA(in); - std::istringstream stream(in); - stream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3] - >> m_auiEncounter[4] >> m_auiEncounter[5]; - for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) // Do not load an encounter as "In Progress" - reset it instead. - m_auiEncounter[i] = NOT_STARTED; - OUT_LOAD_INST_DATA_COMPLETE; - } -}; - -InstanceData* GetInstanceData_instance_serpentshrine_cavern(Map* pMap) -{ - return new instance_serpentshrine_cavern(pMap); -} - -void AddSC_instance_serpentshrine_cavern() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "instance_serpent_shrine"; - newscript->GetInstanceData = &GetInstanceData_instance_serpentshrine_cavern; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="go_bridge_console"; - newscript->pGOHello = &GOHello_go_bridge_console; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/boss_hydromancer_thespia.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/boss_hydromancer_thespia.cpp deleted file mode 100644 index 3bec4de6876..00000000000 --- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/boss_hydromancer_thespia.cpp +++ /dev/null @@ -1,197 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Hydromancer_Thespia -SD%Complete: 80 -SDComment: Needs additional adjustments (when instance script is adjusted) -SDCategory: Coilfang Resevoir, The Steamvault -EndScriptData */ - -/* ContentData -boss_hydromancer_thespia -mob_coilfang_waterelemental -EndContentData */ - -#include "precompiled.h" -#include "def_steam_vault.h" - -#define SAY_SUMMON -1545000 -#define SAY_AGGRO_1 -1545001 -#define SAY_AGGRO_2 -1545002 -#define SAY_AGGRO_3 -1545003 -#define SAY_SLAY_1 -1545004 -#define SAY_SLAY_2 -1545005 -#define SAY_DEAD -1545006 - -#define SPELL_LIGHTNING_CLOUD 25033 -#define SPELL_LUNG_BURST 31481 -#define SPELL_ENVELOPING_WINDS 31718 - -struct TRINITY_DLL_DECL boss_thespiaAI : public ScriptedAI -{ - boss_thespiaAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - ScriptedInstance *pInstance; - bool HeroicMode; - - uint32 LightningCloud_Timer; - uint32 LungBurst_Timer; - uint32 EnvelopingWinds_Timer; - - void Reset() - { - LightningCloud_Timer = 15000; - LungBurst_Timer = 7000; - EnvelopingWinds_Timer = 9000; - - if (pInstance && m_creature->isAlive()) - pInstance->SetData(TYPE_HYDROMANCER_THESPIA, NOT_STARTED); - } - - void JustDied(Unit* Killer) - { - DoScriptText(SAY_DEAD, m_creature); - - if (pInstance) - pInstance->SetData(TYPE_HYDROMANCER_THESPIA, DONE); - } - - void KilledUnit(Unit* victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature); break; - case 1: DoScriptText(SAY_SLAY_2, m_creature); break; - } - } - - void EnterCombat(Unit *who) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; - case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; - case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; - } - - if (pInstance) - pInstance->SetData(TYPE_HYDROMANCER_THESPIA, IN_PROGRESS); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //LightningCloud_Timer - if (LightningCloud_Timer < diff) - { - //cast twice in Heroic mode - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target, SPELL_LIGHTNING_CLOUD); - if (HeroicMode) - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target, SPELL_LIGHTNING_CLOUD); - LightningCloud_Timer = 15000+rand()%10000; - }else LightningCloud_Timer -=diff; - - //LungBurst_Timer - if (LungBurst_Timer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target, SPELL_LUNG_BURST); - LungBurst_Timer = 7000+rand()%5000; - }else LungBurst_Timer -=diff; - - //EnvelopingWinds_Timer - if (EnvelopingWinds_Timer < diff) - { - //cast twice in Heroic mode - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target, SPELL_ENVELOPING_WINDS); - if (HeroicMode) - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target, SPELL_ENVELOPING_WINDS); - EnvelopingWinds_Timer = 10000+rand()%5000; - }else EnvelopingWinds_Timer -=diff; - - DoMeleeAttackIfReady(); - } -}; - -#define SPELL_WATER_BOLT_VOLLEY 34449 -#define H_SPELL_WATER_BOLT_VOLLEY 37924 - -struct TRINITY_DLL_DECL mob_coilfang_waterelementalAI : public ScriptedAI -{ - mob_coilfang_waterelementalAI(Creature *c) : ScriptedAI(c) {} - - bool HeroicMode; - uint32 WaterBoltVolley_Timer; - - void Reset() - { - HeroicMode = m_creature->GetMap()->IsHeroic(); - WaterBoltVolley_Timer = 3000+rand()%3000; - } - - void EnterCombat(Unit *who) { } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (WaterBoltVolley_Timer < diff) - { - DoCast(m_creature, HeroicMode ? H_SPELL_WATER_BOLT_VOLLEY : SPELL_WATER_BOLT_VOLLEY); - WaterBoltVolley_Timer = 7000+rand()%5000; - }else WaterBoltVolley_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_thespiaAI(Creature* pCreature) -{ - return new boss_thespiaAI (pCreature); -} - -CreatureAI* GetAI_mob_coilfang_waterelementalAI(Creature* pCreature) -{ - return new mob_coilfang_waterelementalAI (pCreature); -} - -void AddSC_boss_hydromancer_thespia() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_hydromancer_thespia"; - newscript->GetAI = &GetAI_boss_thespiaAI; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_coilfang_waterelemental"; - newscript->GetAI = &GetAI_mob_coilfang_waterelementalAI; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/boss_mekgineer_steamrigger.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/boss_mekgineer_steamrigger.cpp deleted file mode 100644 index d8cc2e0ef47..00000000000 --- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/boss_mekgineer_steamrigger.cpp +++ /dev/null @@ -1,279 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Mekgineer_Steamrigger -SD%Complete: 60 -SDComment: Mechanics' interrrupt heal doesn't work very well, also a proper movement needs to be implemented -> summon further away and move towards target to repair. -SDCategory: Coilfang Resevoir, The Steamvault -EndScriptData */ - -/* ContentData -boss_mekgineer_steamrigger -mob_steamrigger_mechanic -EndContentData */ - -#include "precompiled.h" -#include "def_steam_vault.h" - -#define SAY_MECHANICS -1545007 -#define SAY_AGGRO_1 -1545008 -#define SAY_AGGRO_2 -1545009 -#define SAY_AGGRO_3 -1545010 -#define SAY_AGGRO_4 -1545011 -#define SAY_SLAY_1 -1545012 -#define SAY_SLAY_2 -1545013 -#define SAY_SLAY_3 -1545014 -#define SAY_DEATH -1545015 - -#define SPELL_SUPER_SHRINK_RAY 31485 -#define SPELL_SAW_BLADE 31486 -#define SPELL_ELECTRIFIED_NET 35107 -#define H_SPELL_ENRAGE 1 //corrent enrage spell not known - -#define ENTRY_STREAMRIGGER_MECHANIC 17951 - -struct TRINITY_DLL_DECL boss_mekgineer_steamriggerAI : public ScriptedAI -{ - boss_mekgineer_steamriggerAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - ScriptedInstance *pInstance; - bool HeroicMode; - - uint32 Shrink_Timer; - uint32 Saw_Blade_Timer; - uint32 Electrified_Net_Timer; - bool Summon75; - bool Summon50; - bool Summon25; - - void Reset() - { - Shrink_Timer = 20000; - Saw_Blade_Timer = 15000; - Electrified_Net_Timer = 10000; - - Summon75 = false; - Summon50 = false; - Summon25 = false; - - if (pInstance && m_creature->isAlive()) - pInstance->SetData(TYPE_MEKGINEER_STEAMRIGGER, NOT_STARTED); - } - - void JustDied(Unit* Killer) - { - DoScriptText(SAY_DEATH, m_creature); - - if (pInstance) - pInstance->SetData(TYPE_MEKGINEER_STEAMRIGGER, DONE); - } - - void KilledUnit(Unit* victim) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature); break; - case 1: DoScriptText(SAY_SLAY_2, m_creature); break; - case 2: DoScriptText(SAY_SLAY_3, m_creature); break; - } - } - - void EnterCombat(Unit *who) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; - case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; - case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; - } - - if (pInstance) - pInstance->SetData(TYPE_MEKGINEER_STEAMRIGGER, IN_PROGRESS); - } - - //no known summon spells exist - void SummonMechanichs() - { - DoScriptText(SAY_MECHANICS, m_creature); - - DoSpawnCreature(ENTRY_STREAMRIGGER_MECHANIC,5,5,0,0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 240000); - DoSpawnCreature(ENTRY_STREAMRIGGER_MECHANIC,-5,5,0,0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 240000); - DoSpawnCreature(ENTRY_STREAMRIGGER_MECHANIC,-5,-5,0,0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 240000); - - if (rand()%2) - DoSpawnCreature(ENTRY_STREAMRIGGER_MECHANIC,5,-7,0,0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 240000); - if (rand()%2) - DoSpawnCreature(ENTRY_STREAMRIGGER_MECHANIC,7,-5,0,0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 240000); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (Shrink_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_SUPER_SHRINK_RAY); - Shrink_Timer = 20000; - }else Shrink_Timer -= diff; - - if (Saw_Blade_Timer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,1)) - DoCast(target,SPELL_SAW_BLADE); - else - DoCast(m_creature->getVictim(),SPELL_SAW_BLADE); - - Saw_Blade_Timer = 15000; - } else Saw_Blade_Timer -= diff; - - if (Electrified_Net_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_ELECTRIFIED_NET); - Electrified_Net_Timer = 10000; - } - else Electrified_Net_Timer -= diff; - - if (!Summon75) - { - if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 75) - { - SummonMechanichs(); - Summon75 = true; - } - } - - if (!Summon50) - { - if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 50) - { - SummonMechanichs(); - Summon50 = true; - } - } - - if (!Summon25) - { - if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 25) - { - SummonMechanichs(); - Summon25 = true; - } - } - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_mekgineer_steamrigger(Creature* pCreature) -{ - return new boss_mekgineer_steamriggerAI (pCreature); -} - -#define SPELL_DISPEL_MAGIC 17201 -#define SPELL_REPAIR 31532 -#define H_SPELL_REPAIR 37936 - -#define MAX_REPAIR_RANGE (13.0f) //we should be at least at this range for repair -#define MIN_REPAIR_RANGE (7.0f) //we can stop movement at this range to repair but not required - -struct TRINITY_DLL_DECL mob_steamrigger_mechanicAI : public ScriptedAI -{ - mob_steamrigger_mechanicAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - ScriptedInstance* pInstance; - bool HeroicMode; - - uint32 Repair_Timer; - - void Reset() - { - Repair_Timer = 2000; - } - - void MoveInLineOfSight(Unit* who) - { - //react only if attacked - return; - } - - void EnterCombat(Unit *who) { } - - void UpdateAI(const uint32 diff) - { - if (Repair_Timer < diff) - { - if (pInstance && pInstance->GetData64(DATA_MEKGINEERSTEAMRIGGER) && pInstance->GetData(TYPE_MEKGINEER_STEAMRIGGER) == IN_PROGRESS) - { - if (Unit* pMekgineer = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_MEKGINEERSTEAMRIGGER))) - { - if (m_creature->IsWithinDistInMap(pMekgineer, MAX_REPAIR_RANGE)) - { - //are we already channeling? Doesn't work very well, find better check? - if (!m_creature->GetUInt32Value(UNIT_CHANNEL_SPELL)) - { - //m_creature->GetMotionMaster()->MovementExpired(); - //m_creature->GetMotionMaster()->MoveIdle(); - - DoCast(m_creature,HeroicMode ? H_SPELL_REPAIR : SPELL_REPAIR, true); - } - Repair_Timer = 5000; - } - else - { - //m_creature->GetMotionMaster()->MovementExpired(); - //m_creature->GetMotionMaster()->MoveFollow(pMekgineer,0,0); - } - } - }else Repair_Timer = 5000; - }else Repair_Timer -= diff; - - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_steamrigger_mechanic(Creature* pCreature) -{ - return new mob_steamrigger_mechanicAI (pCreature); -} - -void AddSC_boss_mekgineer_steamrigger() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_mekgineer_steamrigger"; - newscript->GetAI = &GetAI_boss_mekgineer_steamrigger; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_steamrigger_mechanic"; - newscript->GetAI = &GetAI_mob_steamrigger_mechanic; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/boss_warlord_kalithresh.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/boss_warlord_kalithresh.cpp deleted file mode 100644 index 0f4f2689398..00000000000 --- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/boss_warlord_kalithresh.cpp +++ /dev/null @@ -1,213 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Warlord_Kalithres -SD%Complete: 65 -SDComment: Contains workarounds regarding warlord's rage spells not acting as expected. Both scripts here require review and fine tuning. -SDCategory: Coilfang Resevoir, The Steamvault -EndScriptData */ - -#include "precompiled.h" -#include "def_steam_vault.h" - -#define SAY_INTRO -1545016 -#define SAY_REGEN -1545017 -#define SAY_AGGRO1 -1545018 -#define SAY_AGGRO2 -1545019 -#define SAY_AGGRO3 -1545020 -#define SAY_SLAY1 -1545021 -#define SAY_SLAY2 -1545022 -#define SAY_DEATH -1545023 - -#define SPELL_SPELL_REFLECTION 31534 -#define SPELL_IMPALE 39061 -#define SPELL_WARLORDS_RAGE 37081 -#define SPELL_WARLORDS_RAGE_NAGA 31543 - -#define SPELL_WARLORDS_RAGE_PROC 36453 - -struct TRINITY_DLL_DECL mob_naga_distillerAI : public ScriptedAI -{ - mob_naga_distillerAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance *pInstance; - - void Reset() - { - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - - //hack, due to really weird spell behaviour :( - if (pInstance) - { - if (pInstance->GetData(TYPE_DISTILLER) == IN_PROGRESS) - { - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - } - } - } - - void EnterCombat(Unit *who) { } - - void StartRageGen(Unit *caster) - { - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - - DoCast(m_creature,SPELL_WARLORDS_RAGE_NAGA,true); - - if (pInstance) - pInstance->SetData(TYPE_DISTILLER,IN_PROGRESS); - } - - void DamageTaken(Unit *done_by, uint32 &damage) - { - if (m_creature->GetHealth() <= damage) - if (pInstance) - pInstance->SetData(TYPE_DISTILLER,DONE); - } -}; - -struct TRINITY_DLL_DECL boss_warlord_kalithreshAI : public ScriptedAI -{ - boss_warlord_kalithreshAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance *pInstance; - - uint32 Reflection_Timer; - uint32 Impale_Timer; - uint32 Rage_Timer; - bool CanRage; - - void Reset() - { - Reflection_Timer = 10000; - Impale_Timer = 7000+rand()%7000; - Rage_Timer = 45000; - CanRage = false; - - if (pInstance) - pInstance->SetData(TYPE_WARLORD_KALITHRESH, NOT_STARTED); - } - - void EnterCombat(Unit *who) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_AGGRO1, m_creature); break; - case 1: DoScriptText(SAY_AGGRO2, m_creature); break; - case 2: DoScriptText(SAY_AGGRO3, m_creature); break; - } - - if (pInstance) - pInstance->SetData(TYPE_WARLORD_KALITHRESH, IN_PROGRESS); - } - - void KilledUnit(Unit* victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; - } - } - - void SpellHit(Unit *caster, const SpellEntry *spell) - { - //hack :( - if (spell->Id == SPELL_WARLORDS_RAGE_PROC) - if (pInstance) - if (pInstance->GetData(TYPE_DISTILLER) == DONE) - m_creature->RemoveAurasDueToSpell(SPELL_WARLORDS_RAGE_PROC); - } - - void JustDied(Unit* Killer) - { - DoScriptText(SAY_DEATH, m_creature); - - if (pInstance) - pInstance->SetData(TYPE_WARLORD_KALITHRESH, DONE); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (Rage_Timer < diff) - { - if (Creature* distiller = me->FindNearestCreature(17954, 100.0f)) - { - DoScriptText(SAY_REGEN, m_creature); - DoCast(m_creature,SPELL_WARLORDS_RAGE); - CAST_AI(mob_naga_distillerAI, distiller->AI())->StartRageGen(m_creature); - } - Rage_Timer = 3000+rand()%15000; - }else Rage_Timer -= diff; - - //Reflection_Timer - if (Reflection_Timer < diff) - { - DoCast(m_creature, SPELL_SPELL_REFLECTION); - Reflection_Timer = 15000+rand()%10000; - }else Reflection_Timer -= diff; - - //Impale_Timer - if (Impale_Timer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_IMPALE); - - Impale_Timer = 7500+rand()%5000; - }else Impale_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_naga_distiller(Creature* pCreature) -{ - return new mob_naga_distillerAI (pCreature); -} - -CreatureAI* GetAI_boss_warlord_kalithresh(Creature* pCreature) -{ - return new boss_warlord_kalithreshAI (pCreature); -} - -void AddSC_boss_warlord_kalithresh() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="mob_naga_distiller"; - newscript->GetAI = &GetAI_mob_naga_distiller; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="boss_warlord_kalithresh"; - newscript->GetAI = &GetAI_boss_warlord_kalithresh; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/def_steam_vault.h b/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/def_steam_vault.h deleted file mode 100644 index 4b407ac4816..00000000000 --- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/def_steam_vault.h +++ /dev/null @@ -1,17 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ - -#ifndef DEF_STEAM_VAULT_H -#define DEF_STEAM_VAULT_H - -#define TYPE_HYDROMANCER_THESPIA 1 -#define TYPE_MEKGINEER_STEAMRIGGER 2 -#define TYPE_WARLORD_KALITHRESH 3 -#define TYPE_DISTILLER 4 - -#define DATA_MEKGINEERSTEAMRIGGER 5 -#define DATA_KALITRESH 6 -#define DATA_THESPIA 7 -#endif - diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/instance_steam_vault.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/instance_steam_vault.cpp deleted file mode 100644 index 29616a123ad..00000000000 --- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/instance_steam_vault.cpp +++ /dev/null @@ -1,231 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Instance_Steam_Vault -SD%Complete: 80 -SDComment: Instance script and access panel GO -SDCategory: Coilfang Resevoir, The Steamvault -EndScriptData */ - -#include "precompiled.h" -#include "def_steam_vault.h" - -#define MAX_ENCOUNTER 4 - -#define MAIN_CHAMBERS_DOOR 183049 -#define ACCESS_PANEL_HYDRO 184125 -#define ACCESS_PANEL_MEK 184126 - -/* Steam Vaults encounters: -1 - Hydromancer Thespia Event -2 - Mekgineer Steamrigger Event -3 - Warlord Kalithresh Event -*/ - -bool GOHello_go_main_chambers_access_panel(Player* pPlayer, GameObject* pGo) -{ - ScriptedInstance* pInstance = pGo->GetInstanceData(); - - if (!pInstance) - return false; - - if (pGo->GetEntry() == ACCESS_PANEL_HYDRO && (pInstance->GetData(TYPE_HYDROMANCER_THESPIA) == DONE || pInstance->GetData(TYPE_HYDROMANCER_THESPIA) == SPECIAL)) - pInstance->SetData(TYPE_HYDROMANCER_THESPIA,SPECIAL); - - if (pGo->GetEntry() == ACCESS_PANEL_MEK && (pInstance->GetData(TYPE_MEKGINEER_STEAMRIGGER) == DONE || pInstance->GetData(TYPE_MEKGINEER_STEAMRIGGER) == SPECIAL)) - pInstance->SetData(TYPE_MEKGINEER_STEAMRIGGER,SPECIAL); - - return true; -} - -struct TRINITY_DLL_DECL instance_steam_vault : public ScriptedInstance -{ - instance_steam_vault(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; - - uint32 m_auiEncounter[MAX_ENCOUNTER]; - - uint64 ThespiaGUID; - uint64 MekgineerGUID; - uint64 KalithreshGUID; - - uint64 MainChambersDoor; - uint64 AccessPanelHydro; - uint64 AccessPanelMek; - - void Initialize() - { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - - ThespiaGUID = 0; - MekgineerGUID = 0; - KalithreshGUID = 0; - MainChambersDoor = 0; - AccessPanelHydro = 0; - AccessPanelMek = 0; - } - - bool IsEncounterInProgress() const - { - for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) - return true; - - return false; - } - - void OnCreatureCreate(Creature* pCreature, bool add) - { - switch(pCreature->GetEntry()) - { - case 17797: ThespiaGUID = pCreature->GetGUID(); break; - case 17796: MekgineerGUID = pCreature->GetGUID(); break; - case 17798: KalithreshGUID = pCreature->GetGUID(); break; - } - } - - void OnGameObjectCreate(GameObject* pGo, bool add) - { - switch(pGo->GetEntry()) - { - case MAIN_CHAMBERS_DOOR: MainChambersDoor = pGo->GetGUID(); break; - case ACCESS_PANEL_HYDRO: AccessPanelHydro = pGo->GetGUID(); break; - case ACCESS_PANEL_MEK: AccessPanelMek = pGo->GetGUID(); break; - } - } - - void SetData(uint32 type, uint32 data) - { - switch(type) - { - case TYPE_HYDROMANCER_THESPIA: - if (data == SPECIAL) - { - HandleGameObject(AccessPanelHydro, true); - - if (GetData(TYPE_MEKGINEER_STEAMRIGGER) == SPECIAL) - HandleGameObject(MainChambersDoor, true); - - debug_log("TSCR: Instance Steamvault: Access panel used."); - } - m_auiEncounter[0] = data; - break; - case TYPE_MEKGINEER_STEAMRIGGER: - if (data == SPECIAL) - { - HandleGameObject(AccessPanelMek, true); - - if (GetData(TYPE_HYDROMANCER_THESPIA) == SPECIAL) - HandleGameObject(MainChambersDoor, true); - - debug_log("TSCR: Instance Steamvault: Access panel used."); - } - m_auiEncounter[1] = data; - break; - case TYPE_WARLORD_KALITHRESH: - m_auiEncounter[2] = data; - break; - case TYPE_DISTILLER: - m_auiEncounter[3] = data; - break; - } - - if (data == DONE || data == SPECIAL) - SaveToDB(); - } - - uint32 GetData(uint32 type) - { - switch(type) - { - case TYPE_HYDROMANCER_THESPIA: - return m_auiEncounter[0]; - case TYPE_MEKGINEER_STEAMRIGGER: - return m_auiEncounter[1]; - case TYPE_WARLORD_KALITHRESH: - return m_auiEncounter[2]; - case TYPE_DISTILLER: - return m_auiEncounter[3]; - } - return 0; - } - - uint64 GetData64(uint32 data) - { - switch(data) - { - case DATA_THESPIA: - return ThespiaGUID; - case DATA_MEKGINEERSTEAMRIGGER: - return MekgineerGUID; - case DATA_KALITRESH: - return KalithreshGUID; - } - return 0; - } - - std::string GetSaveData() - { - OUT_SAVE_INST_DATA; - std::ostringstream stream; - stream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " " << m_auiEncounter[3]; - char* out = new char[stream.str().length() + 1]; - strcpy(out, stream.str().c_str()); - if (out) - { - OUT_SAVE_INST_DATA_COMPLETE; - return out; - } - return NULL; - } - - void Load(const char* in) - { - if (!in) - { - OUT_LOAD_INST_DATA_FAIL; - return; - } - OUT_LOAD_INST_DATA(in); - std::istringstream stream(in); - stream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3]; - for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) - m_auiEncounter[i] = NOT_STARTED; - OUT_LOAD_INST_DATA_COMPLETE; - } -}; - -InstanceData* GetInstanceData_instance_steam_vault(Map* pMap) -{ - return new instance_steam_vault(pMap); -} - -void AddSC_instance_steam_vault() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "go_main_chambers_access_panel"; - newscript->pGOHello = &GOHello_go_main_chambers_access_panel; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "instance_steam_vault"; - newscript->GetInstanceData = &GetInstanceData_instance_steam_vault; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/underbog/boss_hungarfen.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/underbog/boss_hungarfen.cpp deleted file mode 100644 index 309c63d857e..00000000000 --- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/underbog/boss_hungarfen.cpp +++ /dev/null @@ -1,156 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Hungarfen -SD%Complete: 95 -SDComment: Need confirmation if spell data are same in both modes. Summons should have faster rate in heroic -SDCategory: Coilfang Resevoir, Underbog -EndScriptData */ - -#include "precompiled.h" - -#define SPELL_FOUL_SPORES 31673 -#define SPELL_ACID_GEYSER 38739 - -struct TRINITY_DLL_DECL boss_hungarfenAI : public ScriptedAI -{ - boss_hungarfenAI(Creature *c) : ScriptedAI(c) - { - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - bool HeroicMode; - bool Root; - uint32 Mushroom_Timer; - uint32 AcidGeyser_Timer; - - void Reset() - { - Root = false; - Mushroom_Timer = 5000; // 1 mushroom after 5s, then one per 10s. This should be different in heroic mode - AcidGeyser_Timer = 10000; - } - - void EnterCombat(Unit *who) - { - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() <= 20) - { - if (!Root) - { - DoCast(m_creature,SPELL_FOUL_SPORES); - Root = true; - } - } - - if (Mushroom_Timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - m_creature->SummonCreature(17990, target->GetPositionX()+(rand()%8), target->GetPositionY()+(rand()%8), target->GetPositionZ(), (rand()%5), TEMPSUMMON_TIMED_DESPAWN, 22000); - else - m_creature->SummonCreature(17990, m_creature->GetPositionX()+(rand()%8), m_creature->GetPositionY()+(rand()%8), m_creature->GetPositionZ(), (rand()%5), TEMPSUMMON_TIMED_DESPAWN, 22000); - - Mushroom_Timer = 10000; - }else Mushroom_Timer -= diff; - - if (AcidGeyser_Timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_ACID_GEYSER); - AcidGeyser_Timer = 10000+rand()%7500; - }else AcidGeyser_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_hungarfen(Creature* pCreature) -{ - return new boss_hungarfenAI (pCreature); -} - -#define SPELL_SPORE_CLOUD 34168 -#define SPELL_PUTRID_MUSHROOM 31690 -#define SPELL_GROW 31698 - -struct TRINITY_DLL_DECL mob_underbog_mushroomAI : public ScriptedAI -{ - mob_underbog_mushroomAI(Creature *c) : ScriptedAI(c) {} - - bool Stop; - uint32 Grow_Timer; - uint32 Shrink_Timer; - - void Reset() - { - Stop = false; - Grow_Timer = 0; - Shrink_Timer = 20000; - - DoCast(m_creature,SPELL_PUTRID_MUSHROOM,true); - DoCast(m_creature,SPELL_SPORE_CLOUD,true); - } - - void MoveInLineOfSight(Unit *who) { return; } - - void AttackStart(Unit* who) { return; } - - void EnterCombat(Unit* who) { } - - void UpdateAI(const uint32 diff) - { - if (Stop) - return; - - if (Grow_Timer <= diff) - { - DoCast(m_creature,SPELL_GROW); - Grow_Timer = 3000; - }else Grow_Timer -= diff; - - if (Shrink_Timer <= diff) - { - m_creature->RemoveAurasDueToSpell(SPELL_GROW); - Stop = true; - }else Shrink_Timer -= diff; - } -}; -CreatureAI* GetAI_mob_underbog_mushroom(Creature* pCreature) -{ - return new mob_underbog_mushroomAI (pCreature); -} - -void AddSC_boss_hungarfen() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_hungarfen"; - newscript->GetAI = &GetAI_boss_hungarfen; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_underbog_mushroom"; - newscript->GetAI = &GetAI_mob_underbog_mushroom; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/underbog/boss_the_black_stalker.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/underbog/boss_the_black_stalker.cpp deleted file mode 100644 index 6da2a022adf..00000000000 --- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/underbog/boss_the_black_stalker.cpp +++ /dev/null @@ -1,191 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_the_black_stalker -SD%Complete: 95 -SDComment: Timers may be incorrect -SDCategory: Coilfang Resevoir, Underbog -EndScriptData */ - -#include "precompiled.h" - -#define SPELL_LEVITATE 31704 -#define SPELL_SUSPENSION 31719 -#define SPELL_LEVITATION_PULSE 31701 -#define SPELL_MAGNETIC_PULL 31705 -#define SPELL_CHAIN_LIGHTNING 31717 -#define SPELL_STATIC_CHARGE 31715 -#define SPELL_SUMMON_SPORE_STRIDER 38755 - -#define ENTRY_SPORE_STRIDER 22299 - -struct TRINITY_DLL_DECL boss_the_black_stalkerAI : public ScriptedAI -{ - boss_the_black_stalkerAI(Creature *c) : ScriptedAI(c) - { - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - bool HeroicMode; - uint32 SporeStriders_Timer; - uint32 Levitate_Timer; - uint32 ChainLightning_Timer; - uint32 StaticCharge_Timer; - uint64 LevitatedTarget; - uint32 LevitatedTarget_Timer; - bool InAir; - uint32 check_Timer; - std::list Striders; - - void Reset() - { - Levitate_Timer = 12000; - ChainLightning_Timer = 6000; - StaticCharge_Timer = 10000; - SporeStriders_Timer = 10000+rand()%5000; - check_Timer = 5000; - LevitatedTarget = 0; - LevitatedTarget_Timer = 0; - Striders.clear(); - } - - void EnterCombat(Unit *who) {} - - void JustSummoned(Creature *summon) - { - if (summon && summon->GetEntry() == ENTRY_SPORE_STRIDER) - { - Striders.push_back(summon->GetGUID()); - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,1)) - summon->AI()->AttackStart(target); - else - if (m_creature->getVictim()) - summon->AI()->AttackStart(m_creature->getVictim()); - } - } - - void JustDied(Unit *who) - { - for(std::list::iterator i = Striders.begin(); i != Striders.end(); ++i) - if (Creature *strider = Unit::GetCreature(*m_creature, *i)) - { - strider->SetLootRecipient(NULL); - strider->DealDamage(strider,strider->GetMaxHealth(),NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - strider->RemoveCorpse(); - } - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - // Evade if too far - if (check_Timer < diff) - { - float x,y,z,o; - m_creature->GetHomePosition(x,y,z,o); - if (!m_creature->IsWithinDist3d(x,y,z, 60)) - { - EnterEvadeMode(); - return; - } - check_Timer = 1000; - }else check_Timer -= diff; - - // Spore Striders - if (HeroicMode && SporeStriders_Timer < diff) - { - DoCast(m_creature,SPELL_SUMMON_SPORE_STRIDER); - SporeStriders_Timer = 10000+rand()%5000; - }else SporeStriders_Timer -= diff; - - // Levitate - if (LevitatedTarget) - { - if (LevitatedTarget_Timer < diff) - { - if (Unit* target = Unit::GetUnit(*m_creature, LevitatedTarget)) - { - if (!target->HasAura(SPELL_LEVITATE)) - { - LevitatedTarget = 0; - return; - } - if (InAir) - { - target->AddAura(SPELL_SUSPENSION, target); - LevitatedTarget = 0; - } - else - { - target->CastSpell(target, SPELL_MAGNETIC_PULL, true); - InAir = true; - LevitatedTarget_Timer = 1500; - } - } - else - LevitatedTarget = 0; - }else LevitatedTarget_Timer -= diff; - } - if (Levitate_Timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,1)) - { - DoCast(target, SPELL_LEVITATE); - LevitatedTarget = target->GetGUID(); - LevitatedTarget_Timer = 2000; - InAir = false; - } - Levitate_Timer = 12000+rand()%3000; - }else Levitate_Timer -= diff; - - // Chain Lightning - if (ChainLightning_Timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target, SPELL_CHAIN_LIGHTNING); - ChainLightning_Timer = 7000; - }else ChainLightning_Timer -= diff; - - // Static Charge - if (StaticCharge_Timer < diff) - { - if (Unit *target = SelectTarget(SELECT_TARGET_RANDOM,0,30,true)) - DoCast(target, SPELL_STATIC_CHARGE); - StaticCharge_Timer = 10000; - }else StaticCharge_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_the_black_stalker(Creature* pCreature) -{ - return new boss_the_black_stalkerAI (pCreature); -} - -void AddSC_boss_the_black_stalker() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_the_black_stalker"; - newscript->GetAI = &GetAI_boss_the_black_stalker; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/draktharon_keep/boss_dred.cpp b/src/bindings/scripts/scripts/zone/draktharon_keep/boss_dred.cpp deleted file mode 100644 index 98425a29e1a..00000000000 --- a/src/bindings/scripts/scripts/zone/draktharon_keep/boss_dred.cpp +++ /dev/null @@ -1,56 +0,0 @@ -/* Script Data Start -SDName: Boss dred -SDAuthor: LordVanMartin -SD%Complete: -SDComment: -SDCategory: -Script Data End */ - -/*** SQL START *** -update creature_template set scriptname = '' where entry = ''; -*** SQL END ***/ -#include "precompiled.h" - -//Spells -#define SPELL_BELLOWING_ROAR 44863 // fears the group, can be resisted/dispelled -#define SPELL_GRIEVOUS_BITE 48920 -#define SPELL_MANGLING_SLASH 48873 //casted on the current tank, adds debuf -#define SPELL_FEARSOME_ROAR_N 48849 -#define SPELL_FEARSOME_ROAR_H 48849 //Not stacking, debuff -#define SPELL_PIERCING_SLASH 48878 //debuff -->Armor reduced by 75% -#define SPELL_RAPTOR_CALL 59416 //dummy - - -struct TRINITY_DLL_DECL boss_dredAI : public ScriptedAI -{ - boss_dredAI(Creature *c) : ScriptedAI(c) {} - - void Reset() {} - void EnterCombat(Unit* who) {} - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - void JustDied(Unit* killer) {} -}; - -CreatureAI* GetAI_boss_dred(Creature* pCreature) -{ - return new boss_dredAI (pCreature); -} - -void AddSC_boss_dred() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_dred"; - newscript->GetAI = &GetAI_boss_dred; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/draktharon_keep/boss_novos.cpp b/src/bindings/scripts/scripts/zone/draktharon_keep/boss_novos.cpp deleted file mode 100644 index 2f1cc7d22fc..00000000000 --- a/src/bindings/scripts/scripts/zone/draktharon_keep/boss_novos.cpp +++ /dev/null @@ -1,75 +0,0 @@ -/* Script Data Start -SDName: Boss novos -SDAuthor: LordVanMartin -SD%Complete: -SDComment: -SDCategory: -Script Data End */ - -/*** SQL START *** -update creature_template set scriptname = 'boss_novos' where entry = ''; -*** SQL END ***/ -#include "precompiled.h" - -//Spells -#define SPELL_ARCANE_BLAST_N 49198 -#define SPELL_ARCANE_BLAST_H 59909 -#define SPELL_ARCANE_FIELD 47346 -#define SPELL_BLIZZARD_N 49034 -#define SPELL_BLIZZARD_H 59854 -#define SPELL_FROSTBOLT_N 49037 -#define SPELL_FROSTBOLT_H 59855 -#define SPELL_WRATH_OF_MISERY_N 50089 -#define SPELL_WRATH_OF_MISERY_H 59856 -#define SPELL_SUMMON_MINIONS 59910 //Summons an army of Fetid Troll Corpses to assist the caster. - -//Yell -#define SAY_AGGRO -1600000 -#define SAY_KILL -1600001 -#define SAY_DEATH -1600002 -#define SAY_NECRO_ADD -1600003 -#define SAY_REUBBLE_1 -1600004 -#define SAY_REUBBLE_2 -1600005 - -struct TRINITY_DLL_DECL boss_novosAI : public ScriptedAI -{ - boss_novosAI(Creature *c) : ScriptedAI(c) {} - - void Reset() {} - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - void JustDied(Unit* killer) {} - void KilledUnit(Unit *victim) - { - if (victim == m_creature) - return; - DoScriptText(SAY_KILL, m_creature); - } -}; - -CreatureAI* GetAI_boss_novos(Creature* pCreature) -{ - return new boss_novosAI (pCreature); -} - -void AddSC_boss_novos() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_novos"; - newscript->GetAI = &GetAI_boss_novos; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/draktharon_keep/boss_tharon_ja.cpp b/src/bindings/scripts/scripts/zone/draktharon_keep/boss_tharon_ja.cpp deleted file mode 100644 index 62d724f4de4..00000000000 --- a/src/bindings/scripts/scripts/zone/draktharon_keep/boss_tharon_ja.cpp +++ /dev/null @@ -1,88 +0,0 @@ -/* Script Data Start -SDName: Boss tharon_ja -SDAuthor: LordVanMartin -SD%Complete: -SDComment: -SDCategory: -Script Data End */ - -/*** SQL START *** -update creature_template set scriptname = 'boss_tharon_ja' where entry = ''; -*** SQL END ***/ -#include "precompiled.h" - -//Spells -#define SPELL_COURSE_OF_LIFE 49527 -#define SPELL_DECAY_FLESH 49356 //casted at end of pahase 1, starts phase 2 -#define SPELL_EYE_BEAM_N 49544 -#define SPELL_LIGHTNING_BREATH_N 49537 -#define SPELL_POISON_CLOUD_N 49548 -#define SPELL_RAIN_OF_FIRE_N 49518 -#define SPELL_RETURN_FLESH 53463 //Channeled spell ending phase two and returning to phase 1. This ability will stun the party for 6 seconds. -#define SPELL_SHADOW_VOLLEY_N 49528 - -//Spells Heroic -#define SPELL_COURSE_OF_LIFE_H 59972 -#define SPELL_EYE_BEAM_H 59965 -#define SPELL_LIGHTNING_BREATH_H 59963 -#define SPELL_POISON_CLOUD_H 59969 -#define SPELL_RAIN_OF_FIRE_H 59971 -#define SPELL_SHADOW_VOLLEY_H 59973 - -//Players skills durring Phase2 -#define PLAYER_PHASE2_SLAYING_STRIKE 50799 -#define PLAYER_PHASE2_TAUNT 49613 -#define PLAYER_PHASE2_BONE_ARMOR 49609 -#define PLAYER_PHASE2_TOUCH_OF_LIFE 49617 -//Phase 1 all abilities except Eye beam -//Phase 2 turns players to skeletons with new abilities, boss grows skin - -//Yell -#define SAY_AGGRO 1600011 -#define SAY_KILL_1 1600012 -#define SAY_KILL_2 1600013 -#define SAY_FLESH_1 1600014 -#define SAY_FLESH_2 1600015 -#define SAY_SKELETON_1 1600016 -#define SAY_SKELETON_2 1600017 -#define SAY_DEATH 1600018 - -struct TRINITY_DLL_DECL boss_tharon_jaAI : public ScriptedAI -{ - boss_tharon_jaAI(Creature *c) : ScriptedAI(c) {} - - void Reset() {} - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - void JustDied(Unit* killer) - { - DoScriptText(SAY_DEATH,m_creature); - } -}; - -CreatureAI* GetAI_boss_tharon_ja(Creature* pCreature) -{ - return new boss_tharon_jaAI (pCreature); -} - -void AddSC_boss_tharon_ja() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_tharon_ja"; - newscript->GetAI = &GetAI_boss_tharon_ja; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/draktharon_keep/boss_trollgore.cpp b/src/bindings/scripts/scripts/zone/draktharon_keep/boss_trollgore.cpp deleted file mode 100644 index 59f68c37205..00000000000 --- a/src/bindings/scripts/scripts/zone/draktharon_keep/boss_trollgore.cpp +++ /dev/null @@ -1,75 +0,0 @@ -/* Script Data Start -SDName: Boss trollgore -SDAuthor: LordVanMartin -SD%Complete: -SDComment: -SDCategory: -Script Data End */ - -/*** SQL START *** -update creature_template set scriptname = 'boss_trollgore' where entry = ''; -*** SQL END ***/ -#include "precompiled.h" - -//Spell -#define SPELL_INFECTED_WOUND 49637 -#define SPELL_CRUSH 49639 -#define SPELL_CORPSE_EXPLODE_N 49555 -#define SPELL_CONSUME_N 49380 - -//Spell Heroic -#define SPELL_CORPSE_EXPLODE_H 59807 -#define SPELL_CONSUME_H 59803 - -//Yell -#define SAY_AGGRO -1600006 -#define SAY_KILL -1600007 -#define SAY_CONSUME -1600008 -#define SAY_EXPLODE -1600009 -#define SAY_DEATH -1600010 - -struct TRINITY_DLL_DECL boss_trollgoreAI : public ScriptedAI -{ - boss_trollgoreAI(Creature *c) : ScriptedAI(c) {} - - void Reset() {} - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - void JustDied(Unit* killer) - { - DoScriptText(SAY_DEATH, m_creature); - } - void KilledUnit(Unit *victim) - { - if (victim == m_creature) - return; - DoScriptText(SAY_KILL, m_creature); - } -}; - -CreatureAI* GetAI_boss_trollgore(Creature* pCreature) -{ - return new boss_trollgoreAI (pCreature); -} - -void AddSC_boss_trollgore() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_trollgore"; - newscript->GetAI = &GetAI_boss_trollgore; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/draktharon_keep/def_drak_tharon_keep.h b/src/bindings/scripts/scripts/zone/draktharon_keep/def_drak_tharon_keep.h deleted file mode 100644 index 321d77a9c27..00000000000 --- a/src/bindings/scripts/scripts/zone/draktharon_keep/def_drak_tharon_keep.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef DEF_DRAK_THARON_H -#define DEF_DRAK_THARON_H - -#endif diff --git a/src/bindings/scripts/scripts/zone/draktharon_keep/instance_drak_tharon_keep.cpp b/src/bindings/scripts/scripts/zone/draktharon_keep/instance_drak_tharon_keep.cpp deleted file mode 100644 index 795f36eca18..00000000000 --- a/src/bindings/scripts/scripts/zone/draktharon_keep/instance_drak_tharon_keep.cpp +++ /dev/null @@ -1,21 +0,0 @@ -#include "precompiled.h" -#include "def_drak_tharon_keep.h" - -struct TRINITY_DLL_DECL instance_drak_tharon : public ScriptedInstance -{ - instance_drak_tharon(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; -}; - -InstanceData* GetInstanceData_instance_drak_tharon(Map* pMap) -{ - return new instance_drak_tharon(pMap); -} - -void AddSC_instance_drak_tharon() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_drak_tharon"; - newscript->GetInstanceData = &GetInstanceData_instance_drak_tharon; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/gruuls_lair/boss_gruul.cpp b/src/bindings/scripts/scripts/zone/gruuls_lair/boss_gruul.cpp deleted file mode 100644 index dc4d9df18c4..00000000000 --- a/src/bindings/scripts/scripts/zone/gruuls_lair/boss_gruul.cpp +++ /dev/null @@ -1,260 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Gruul -SD%Complete: 60 -SDComment: Ground Slam need further development (knock back effect and shatter effect must be added to mangos) -SDCategory: Gruul's Lair -EndScriptData */ - -#include "precompiled.h" -#include "def_gruuls_lair.h" - -enum -{ - SAY_AGGRO = -1565010, - SAY_SLAM1 = -1565011, - SAY_SLAM2 = -1565012, - SAY_SHATTER1 = -1565013, - SAY_SHATTER2 = -1565014, - SAY_SLAY1 = -1565015, - SAY_SLAY2 = -1565016, - SAY_SLAY3 = -1565017, - SAY_DEATH = -1565018, - - EMOTE_GROW = -1565019, - - SPELL_GROWTH = 36300, - SPELL_CAVE_IN = 36240, - SPELL_GROUND_SLAM = 33525, //AoE Ground Slam applying Ground Slam to everyone with a script effect (most likely the knock back, we can code it to a set knockback) - SPELL_REVERBERATION = 36297, - SPELL_SHATTER = 33654, - - SPELL_SHATTER_EFFECT = 33671, - SPELL_HURTFUL_STRIKE = 33813, - SPELL_STONED = 33652, //Spell is self cast by target - - SPELL_MAGNETIC_PULL = 28337, - SPELL_KNOCK_BACK = 24199, //Knockback spell until correct implementation is made -}; - -struct TRINITY_DLL_DECL boss_gruulAI : public ScriptedAI -{ - boss_gruulAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance *pInstance; - - uint32 m_uiGrowth_Timer; - uint32 m_uiCaveIn_Timer; - uint32 m_uiCaveIn_StaticTimer; - uint32 m_uiGroundSlamTimer; - uint32 m_uiHurtfulStrike_Timer; - uint32 m_uiReverberation_Timer; - - bool m_bPerformingGroundSlam; - - void Reset() - { - m_uiGrowth_Timer= 30000; - m_uiCaveIn_Timer= 27000; - m_uiCaveIn_StaticTimer = 30000; - m_uiGroundSlamTimer= 35000; - m_bPerformingGroundSlam= false; - m_uiHurtfulStrike_Timer= 8000; - m_uiReverberation_Timer= 60000+45000; - - if (pInstance) - pInstance->SetData(DATA_GRUULEVENT, NOT_STARTED); - } - - void EnterCombat(Unit *who) - { - DoScriptText(SAY_AGGRO, m_creature); - - if (pInstance) - pInstance->SetData(DATA_GRUULEVENT, IN_PROGRESS); - } - - void KilledUnit() - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; - case 2: DoScriptText(SAY_SLAY3, m_creature); break; - } - } - - void JustDied(Unit* Killer) - { - DoScriptText(SAY_DEATH, m_creature); - - if (pInstance) - { - pInstance->SetData(DATA_GRUULEVENT, DONE); - pInstance->HandleGameObject(pInstance->GetData64(DATA_GRUULDOOR), true); // Open the encounter door - } - } - - void SpellHitTarget(Unit* pTarget, const SpellEntry* pSpell) - { - //This to emulate effect1 (77) of SPELL_GROUND_SLAM, knock back to any direction - //It's initially wrong, since this will cause fall damage, which is by comments, not intended. - if (pSpell->Id == SPELL_GROUND_SLAM) - { - if (pTarget->GetTypeId() == TYPEID_PLAYER) - { - switch(rand()%2) - { - case 0: pTarget->CastSpell(pTarget, SPELL_MAGNETIC_PULL, true, NULL, NULL, m_creature->GetGUID()); break; - case 1: pTarget->CastSpell(pTarget, SPELL_KNOCK_BACK, true, NULL, NULL, m_creature->GetGUID()); break; - } - } - } - - //this part should be in mangos - if (pSpell->Id == SPELL_SHATTER) - { - //this spell must have custom handling in mangos, dealing damage based on distance - pTarget->CastSpell(pTarget, SPELL_SHATTER_EFFECT, true); - - if (pTarget->HasAura(SPELL_STONED)) - pTarget->RemoveAurasDueToSpell(SPELL_STONED); - - //clear this, if we are still performing - if (m_bPerformingGroundSlam) - { - m_bPerformingGroundSlam = false; - - //and correct movement, if not already - if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() != TARGETED_MOTION_TYPE) - { - if (m_creature->getVictim()) - m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); - } - } - } - } - - void UpdateAI(const uint32 uiDiff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - // Growth - // Gruul can cast this spell up to 30 times - if (m_uiGrowth_Timer < uiDiff) - { - DoScriptText(EMOTE_GROW, m_creature); - DoCast(m_creature,SPELL_GROWTH); - m_uiGrowth_Timer = 30000; - } - else - m_uiGrowth_Timer -= uiDiff; - - if (m_bPerformingGroundSlam) - { - if (m_uiGroundSlamTimer < uiDiff) - { - m_uiGroundSlamTimer =120000; - m_uiHurtfulStrike_Timer= 8000; - - if (m_uiReverberation_Timer < 10000) //Give a little time to the players to undo the damage from shatter - m_uiReverberation_Timer += 10000; - - DoCast(m_creature, SPELL_SHATTER); - } - else - m_uiGroundSlamTimer -= uiDiff; - } - else - { - // Hurtful Strike - if (m_uiHurtfulStrike_Timer < uiDiff) - { - Unit* target = SelectUnit(SELECT_TARGET_TOPAGGRO,1); - - if (target && m_creature->IsWithinMeleeRange(m_creature->getVictim())) - DoCast(target,SPELL_HURTFUL_STRIKE); - else - DoCast(m_creature->getVictim(),SPELL_HURTFUL_STRIKE); - - m_uiHurtfulStrike_Timer= 8000; - } - else - m_uiHurtfulStrike_Timer -= uiDiff; - - // Reverberation - if (m_uiReverberation_Timer < uiDiff) - { - DoCast(m_creature->getVictim(), SPELL_REVERBERATION, true); - m_uiReverberation_Timer = 15000 + rand()%10000; - } - else - m_uiReverberation_Timer -= uiDiff; - - // Cave In - if (m_uiCaveIn_Timer < uiDiff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_CAVE_IN); - - if (m_uiCaveIn_StaticTimer >= 4000) - m_uiCaveIn_StaticTimer -= 2000; - - m_uiCaveIn_Timer = m_uiCaveIn_StaticTimer; - } - else - m_uiCaveIn_Timer -= uiDiff; - - // Ground Slam, Gronn Lord's Grasp, Stoned, Shatter - if (m_uiGroundSlamTimer < uiDiff) - { - m_creature->GetMotionMaster()->Clear(); - m_creature->GetMotionMaster()->MoveIdle(); - - m_bPerformingGroundSlam= true; - m_uiGroundSlamTimer = 10000; - - DoCast(m_creature, SPELL_GROUND_SLAM); - } - else - m_uiGroundSlamTimer -= uiDiff; - - DoMeleeAttackIfReady(); - } - } -}; - -CreatureAI* GetAI_boss_gruul(Creature* pCreature) -{ - return new boss_gruulAI (pCreature); -} - -void AddSC_boss_gruul() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_gruul"; - newscript->GetAI = &GetAI_boss_gruul; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/gruuls_lair/boss_high_king_maulgar.cpp b/src/bindings/scripts/scripts/zone/gruuls_lair/boss_high_king_maulgar.cpp deleted file mode 100644 index 6918feaabba..00000000000 --- a/src/bindings/scripts/scripts/zone/gruuls_lair/boss_high_king_maulgar.cpp +++ /dev/null @@ -1,793 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_High_King_Maulgar -SD%Complete: 90 -SDComment: Correct timers, after whirlwind melee attack bug, prayer of healing -SDCategory: Gruul's Lair -EndScriptData */ - -#include "precompiled.h" -#include "def_gruuls_lair.h" - -#define SAY_AGGRO -1565000 -#define SAY_ENRAGE -1565001 -#define SAY_OGRE_DEATH1 -1565002 -#define SAY_OGRE_DEATH2 -1565003 -#define SAY_OGRE_DEATH3 -1565004 -#define SAY_OGRE_DEATH4 -1565005 -#define SAY_SLAY1 -1565006 -#define SAY_SLAY2 -1565007 -#define SAY_SLAY3 -1565008 -#define SAY_DEATH -1565009 - -// High King Maulgar -#define SPELL_ARCING_SMASH 39144 -#define SPELL_MIGHTY_BLOW 33230 -#define SPELL_WHIRLWIND 33238 -#define SPELL_BERSERKER_C 26561 -#define SPELL_ROAR 16508 -#define SPELL_FLURRY 33232 -#define SPELL_DUAL_WIELD 29651 //used in phase - -// Olm the Summoner -#define SPELL_DARK_DECAY 33129 -#define SPELL_DEATH_COIL 33130 -#define SPELL_SUMMON_WFH 33131 - -//Kiggler the Craed -#define SPELL_GREATER_POLYMORPH 33173 -#define SPELL_LIGHTNING_BOLT 36152 -#define SPELL_ARCANE_SHOCK 33175 -#define SPELL_ARCANE_EXPLOSION 33237 - -//Blindeye the Seer -#define SPELL_GREATER_PW_SHIELD 33147 -#define SPELL_HEAL 33144 -#define SPELL_PRAYER_OH 33152 - -//Krosh Firehand -#define SPELL_GREATER_FIREBALL 33051 -#define SPELL_SPELLSHIELD 33054 -#define SPELL_BLAST_WAVE 33061 - -bool CheckAllBossDied(ScriptedInstance* pInstance, Creature* m_creature) -{ - if (!pInstance || !m_creature) - return false; - - uint64 MaulgarGUID = 0; - uint64 KigglerGUID = 0; - uint64 BlindeyeGUID = 0; - uint64 OlmGUID = 0; - uint64 KroshGUID = 0; - - Creature* Maulgar = NULL; - Creature* Kiggler = NULL; - Creature* Blindeye = NULL; - Creature* Olm = NULL; - Creature* Krosh = NULL; - - MaulgarGUID = pInstance->GetData64(DATA_MAULGAR); - KigglerGUID = pInstance->GetData64(DATA_KIGGLERTHECRAZED); - BlindeyeGUID = pInstance->GetData64(DATA_BLINDEYETHESEER); - OlmGUID = pInstance->GetData64(DATA_OLMTHESUMMONER); - KroshGUID = pInstance->GetData64(DATA_KROSHFIREHAND); - - Maulgar = (Unit::GetCreature((*m_creature), MaulgarGUID)); - Kiggler = (Unit::GetCreature((*m_creature), KigglerGUID)); - Blindeye = (Unit::GetCreature((*m_creature), BlindeyeGUID)); - Olm = (Unit::GetCreature((*m_creature), OlmGUID)); - Krosh = (Unit::GetCreature((*m_creature), KroshGUID)); - - if (!Maulgar || !Kiggler || !Blindeye || !Olm || !Krosh) - return false; - - if (!Maulgar->isAlive() && !Kiggler->isAlive() && !Blindeye->isAlive() && !Olm->isAlive() && !Krosh->isAlive()) - return true; - - return false; -} - -//High King Maulgar AI -struct TRINITY_DLL_DECL boss_high_king_maulgarAI : public ScriptedAI -{ - boss_high_king_maulgarAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - for(uint8 i = 0; i < 4; ++i) - Council[i] = 0; - } - - ScriptedInstance* pInstance; - - uint32 ArcingSmash_Timer; - uint32 MightyBlow_Timer; - uint32 Whirlwind_Timer; - uint32 Charging_Timer; - uint32 Roar_Timer; - - bool Phase2; - - uint64 Council[4]; - - void Reset() - { - ArcingSmash_Timer = 10000; - MightyBlow_Timer = 40000; - Whirlwind_Timer = 30000; - Charging_Timer = 0; - Roar_Timer = 0; - - m_creature->CastSpell(m_creature, SPELL_DUAL_WIELD, false); - - Phase2 = false; - - Creature *pCreature = NULL; - for(uint8 i = 0; i < 4; ++i) - { - if (Council[i]) - { - pCreature = (Unit::GetCreature((*m_creature), Council[i])); - if (pCreature && !pCreature->isAlive()) - { - pCreature->Respawn(); - pCreature->AI()->EnterEvadeMode(); - } - } - } - - //reset encounter - if (pInstance) - pInstance->SetData(DATA_MAULGAREVENT, NOT_STARTED); - } - - void KilledUnit() - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; - case 2: DoScriptText(SAY_SLAY3, m_creature); break; - } - } - - void JustDied(Unit* Killer) - { - DoScriptText(SAY_DEATH, m_creature); - - if (CheckAllBossDied(pInstance, m_creature)) - pInstance->SetData(DATA_MAULGAREVENT, DONE); - } - - void AddDeath() - { - switch(rand()%4) - { - case 0: DoScriptText(SAY_OGRE_DEATH1, m_creature);break; - case 1: DoScriptText(SAY_OGRE_DEATH2, m_creature);break; - case 2: DoScriptText(SAY_OGRE_DEATH3, m_creature);break; - case 3: DoScriptText(SAY_OGRE_DEATH4, m_creature);break; - } - } - - - void EnterCombat(Unit *who) - { - StartEvent(who); - } - - void GetCouncil() - { - //get council member's guid to respawn them if needed - Council[0] = pInstance->GetData64(DATA_KIGGLERTHECRAZED); - Council[1] = pInstance->GetData64(DATA_BLINDEYETHESEER); - Council[2] = pInstance->GetData64(DATA_OLMTHESUMMONER); - Council[3] = pInstance->GetData64(DATA_KROSHFIREHAND); - } - - void StartEvent(Unit *who) - { - if (!pInstance) - return; - - GetCouncil(); - - DoScriptText(SAY_AGGRO, m_creature); - - pInstance->SetData64(DATA_MAULGAREVENT_TANK, who->GetGUID()); - pInstance->SetData(DATA_MAULGAREVENT, IN_PROGRESS); - - DoZoneInCombat(); - } - - void UpdateAI(const uint32 diff) - { - //Only if not incombat check if the event is started - if (!m_creature->isInCombat() && pInstance && pInstance->GetData(DATA_MAULGAREVENT)) - { - Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_MAULGAREVENT_TANK)); - - if (target) - { - AttackStart(target); - GetCouncil(); - } - } - - //Return since we have no target - if (!UpdateVictim()) - return; - - //someone evaded! - if (pInstance && !pInstance->GetData(DATA_MAULGAREVENT)) - { - EnterEvadeMode(); - return; - } - - //ArcingSmash_Timer - if (ArcingSmash_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_ARCING_SMASH); - ArcingSmash_Timer = 10000; - }else ArcingSmash_Timer -= diff; - - //Whirlwind_Timer - if (Whirlwind_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_WHIRLWIND); - Whirlwind_Timer = 55000; - }else Whirlwind_Timer -= diff; - - //MightyBlow_Timer - if (MightyBlow_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_MIGHTY_BLOW); - MightyBlow_Timer = 30000+rand()%10000; - }else MightyBlow_Timer -= diff; - - //Entering Phase 2 - if (!Phase2 && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 50) - { - Phase2 = true; - DoScriptText(SAY_ENRAGE, m_creature); - - m_creature->CastSpell(m_creature, SPELL_DUAL_WIELD, true); - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, 0); - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, 0); - } - - if (Phase2) - { - //Charging_Timer - if (Charging_Timer < diff) - { - Unit* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (target) - { - AttackStart(target); - DoCast(target, SPELL_BERSERKER_C); - } - Charging_Timer = 20000; - }else Charging_Timer -= diff; - - //Intimidating Roar - if (Roar_Timer < diff) - { - DoCast(m_creature, SPELL_ROAR); - Roar_Timer = 40000+(rand()%10000); - }else Roar_Timer -= diff; - } - - DoMeleeAttackIfReady(); - } -}; - -//Olm The Summoner AI -struct TRINITY_DLL_DECL boss_olm_the_summonerAI : public ScriptedAI -{ - boss_olm_the_summonerAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - uint32 DarkDecay_Timer; - uint32 Summon_Timer; - uint32 DeathCoil_Timer; - - ScriptedInstance* pInstance; - - void Reset() - { - DarkDecay_Timer = 10000; - Summon_Timer = 15000; - DeathCoil_Timer = 20000; - - //reset encounter - if (pInstance) - pInstance->SetData(DATA_MAULGAREVENT, NOT_STARTED); - } - - void AttackStart(Unit* pWho) - { - if (!pWho) - return; - - if (m_creature->Attack(pWho, true)) - { - m_creature->AddThreat(pWho, 0.0f); - m_creature->SetInCombatWith(pWho); - pWho->SetInCombatWith(m_creature); - - m_creature->GetMotionMaster()->MoveChase(pWho, 30.0f); - } - } - - void EnterCombat(Unit *who) - { - if (pInstance) - { - pInstance->SetData64(DATA_MAULGAREVENT_TANK, who->GetGUID()); - pInstance->SetData(DATA_MAULGAREVENT, IN_PROGRESS); - } - } - - void JustDied(Unit* Killer) - { - if (pInstance) - { - Creature *Maulgar = NULL; - Maulgar = (Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_MAULGAR))); - - if (Maulgar) - CAST_AI(boss_high_king_maulgarAI, Maulgar->AI())->AddDeath(); - - if (CheckAllBossDied(pInstance, m_creature)) - pInstance->SetData(DATA_MAULGAREVENT, DONE); - } - } - - void UpdateAI(const uint32 diff) - { - //Only if not incombat check if the event is started - if (!m_creature->isInCombat() && pInstance && pInstance->GetData(DATA_MAULGAREVENT)) - { - Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_MAULGAREVENT_TANK)); - - if (target) - { - AttackStart(target); - } - } - - //Return since we have no target - if (!UpdateVictim()) - return; - - //someone evaded! - if (pInstance && !pInstance->GetData(DATA_MAULGAREVENT)) - { - EnterEvadeMode(); - return; - } - - //DarkDecay_Timer - if (DarkDecay_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_DARK_DECAY); - DarkDecay_Timer = 20000; - }else DarkDecay_Timer -= diff; - - //Summon_Timer - if (Summon_Timer < diff) - { - DoCast(m_creature, SPELL_SUMMON_WFH); - Summon_Timer = 30000; - }else Summon_Timer -= diff; - - //DeathCoil Timer /need correct timer - if (DeathCoil_Timer < diff) - { - Unit* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (target) - DoCast(target, SPELL_DEATH_COIL); - DeathCoil_Timer = 20000; - }else DeathCoil_Timer -= diff; - - - DoMeleeAttackIfReady(); - } -}; - -//Kiggler The Crazed AI -struct TRINITY_DLL_DECL boss_kiggler_the_crazedAI : public ScriptedAI -{ - boss_kiggler_the_crazedAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - uint32 GreaterPolymorph_Timer; - uint32 LightningBolt_Timer; - uint32 ArcaneShock_Timer; - uint32 ArcaneExplosion_Timer; - - ScriptedInstance* pInstance; - - void Reset() - { - GreaterPolymorph_Timer = 5000; - LightningBolt_Timer = 10000; - ArcaneShock_Timer = 20000; - ArcaneExplosion_Timer = 30000; - - //reset encounter - if (pInstance) - pInstance->SetData(DATA_MAULGAREVENT, NOT_STARTED); - } - - void EnterCombat(Unit *who) - { - if (pInstance) - { - pInstance->SetData64(DATA_MAULGAREVENT_TANK, who->GetGUID()); - pInstance->SetData(DATA_MAULGAREVENT, IN_PROGRESS); - } - } - - void JustDied(Unit* Killer) - { - if (pInstance) - { - Creature *Maulgar = NULL; - Maulgar = (Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_MAULGAR))); - - if (Maulgar) - CAST_AI(boss_high_king_maulgarAI, Maulgar->AI())->AddDeath(); - - if (CheckAllBossDied(pInstance, m_creature)) - pInstance->SetData(DATA_MAULGAREVENT, DONE); - } - } - - void UpdateAI(const uint32 diff) - { - //Only if not incombat check if the event is started - if (!m_creature->isInCombat() && pInstance && pInstance->GetData(DATA_MAULGAREVENT)) - { - Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_MAULGAREVENT_TANK)); - - if (target) - { - AttackStart(target); - } - } - - //Return since we have no target - if (!UpdateVictim()) - return; - - //someone evaded! - if (pInstance && !pInstance->GetData(DATA_MAULGAREVENT)) - { - EnterEvadeMode(); - return; - } - - //GreaterPolymorph_Timer - if (GreaterPolymorph_Timer < diff) - { - Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (target) - DoCast(target, SPELL_GREATER_POLYMORPH); - - GreaterPolymorph_Timer = 15000 + rand()%5000; - }else GreaterPolymorph_Timer -= diff; - - //LightningBolt_Timer - if (LightningBolt_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_LIGHTNING_BOLT); - LightningBolt_Timer = 15000; - }else LightningBolt_Timer -= diff; - - //ArcaneShock_Timer - if (ArcaneShock_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_ARCANE_SHOCK); - ArcaneShock_Timer = 20000; - }else ArcaneShock_Timer -= diff; - - //ArcaneExplosion_Timer - if (ArcaneExplosion_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_ARCANE_EXPLOSION); - ArcaneExplosion_Timer = 30000; - }else ArcaneExplosion_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -//Blindeye The Seer AI -struct TRINITY_DLL_DECL boss_blindeye_the_seerAI : public ScriptedAI -{ - boss_blindeye_the_seerAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - uint32 GreaterPowerWordShield_Timer; - uint32 Heal_Timer; - uint32 PrayerofHealing_Timer; - - ScriptedInstance* pInstance; - - void Reset() - { - GreaterPowerWordShield_Timer = 5000; - Heal_Timer = 25000 + rand()%15000; - PrayerofHealing_Timer = 45000 + rand()%10000; - - //reset encounter - if (pInstance) - pInstance->SetData(DATA_MAULGAREVENT, NOT_STARTED); - } - - void EnterCombat(Unit *who) - { - if (pInstance) - { - pInstance->SetData64(DATA_MAULGAREVENT_TANK, who->GetGUID()); - pInstance->SetData(DATA_MAULGAREVENT, IN_PROGRESS); - } - } - - void JustDied(Unit* Killer) - { - if (pInstance) - { - Creature *Maulgar = NULL; - Maulgar = (Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_MAULGAR))); - - if (Maulgar) - CAST_AI(boss_high_king_maulgarAI, Maulgar->AI())->AddDeath(); - - if (CheckAllBossDied(pInstance, m_creature)) - pInstance->SetData(DATA_MAULGAREVENT, DONE); - } - } - - void UpdateAI(const uint32 diff) - { - //Only if not incombat check if the event is started - if (!m_creature->isInCombat() && pInstance && pInstance->GetData(DATA_MAULGAREVENT)) - { - Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_MAULGAREVENT_TANK)); - - if (target) - { - AttackStart(target); - } - } - - //Return since we have no target - if (!UpdateVictim()) - return; - - //someone evaded! - if (pInstance && !pInstance->GetData(DATA_MAULGAREVENT)) - { - EnterEvadeMode(); - return; - } - - //GreaterPowerWordShield_Timer - if (GreaterPowerWordShield_Timer < diff) - { - DoCast(m_creature, SPELL_GREATER_PW_SHIELD); - GreaterPowerWordShield_Timer = 40000; - }else GreaterPowerWordShield_Timer -= diff; - - //Heal_Timer - if (Heal_Timer < diff) - { - DoCast(m_creature, SPELL_HEAL); - Heal_Timer = 15000 + rand()%25000; - }else Heal_Timer -= diff; - - //PrayerofHealing_Timer - if (PrayerofHealing_Timer < diff) - { - DoCast(m_creature, SPELL_PRAYER_OH); - PrayerofHealing_Timer = 35000 + rand()%15000; - }else PrayerofHealing_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -//Krosh Firehand AI -struct TRINITY_DLL_DECL boss_krosh_firehandAI : public ScriptedAI -{ - boss_krosh_firehandAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - uint32 GreaterFireball_Timer; - uint32 SpellShield_Timer; - uint32 BlastWave_Timer; - - ScriptedInstance* pInstance; - - void Reset() - { - GreaterFireball_Timer = 1000; - SpellShield_Timer = 5000; - BlastWave_Timer = 20000; - - //reset encounter - if (pInstance) - pInstance->SetData(DATA_MAULGAREVENT, NOT_STARTED); - } - - void EnterCombat(Unit *who) - { - if (pInstance) - { - pInstance->SetData64(DATA_MAULGAREVENT_TANK, who->GetGUID()); - pInstance->SetData(DATA_MAULGAREVENT, IN_PROGRESS); - } - } - - void JustDied(Unit* Killer) - { - if (pInstance) - { - Creature *Maulgar = NULL; - Maulgar = (Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_MAULGAR))); - - if (Maulgar) - CAST_AI(boss_high_king_maulgarAI, Maulgar->AI())->AddDeath(); - - if (CheckAllBossDied(pInstance, m_creature)) - pInstance->SetData(DATA_MAULGAREVENT, DONE); - } - } - - void UpdateAI(const uint32 diff) - { - //Only if not incombat check if the event is started - if (!m_creature->isInCombat() && pInstance && pInstance->GetData(DATA_MAULGAREVENT)) - { - Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_MAULGAREVENT_TANK)); - - if (target) - { - AttackStart(target); - } - } - - //Return since we have no target - if (!UpdateVictim()) - return; - - //someone evaded! - if (pInstance && !pInstance->GetData(DATA_MAULGAREVENT)) - { - EnterEvadeMode(); - return; - } - - //GreaterFireball_Timer - if (GreaterFireball_Timer < diff || m_creature->IsWithinDist(m_creature->getVictim(), 30)) - { - DoCast(m_creature->getVictim(), SPELL_GREATER_FIREBALL); - GreaterFireball_Timer = 2000; - }else GreaterFireball_Timer -= diff; - - //SpellShield_Timer - if (SpellShield_Timer < diff) - { - m_creature->InterruptNonMeleeSpells(false); - DoCast(m_creature->getVictim(), SPELL_SPELLSHIELD); - SpellShield_Timer = 30000; - }else SpellShield_Timer -= diff; - - //BlastWave_Timer - if (BlastWave_Timer < diff) - { - Unit *target; - std::list t_list = m_creature->getThreatManager().getThreatList(); - std::vector target_list; - for(std::list::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr) - { - target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()); - //15 yard radius minimum - if (target && target->IsWithinDist(m_creature, 15,false)) - target_list.push_back(target); - target = NULL; - } - if (target_list.size()) - target = *(target_list.begin()+rand()%target_list.size()); - - m_creature->InterruptNonMeleeSpells(false); - DoCast(target, SPELL_BLAST_WAVE); - BlastWave_Timer = 60000; - }else BlastWave_Timer -= diff; - } -}; - -CreatureAI* GetAI_boss_high_king_maulgar(Creature* pCreature) -{ - return new boss_high_king_maulgarAI (pCreature); -} - -CreatureAI* GetAI_boss_olm_the_summoner(Creature* pCreature) -{ - return new boss_olm_the_summonerAI (pCreature); -} - -CreatureAI *GetAI_boss_kiggler_the_crazed(Creature* pCreature) -{ - return new boss_kiggler_the_crazedAI (pCreature); -} - -CreatureAI *GetAI_boss_blindeye_the_seer(Creature* pCreature) -{ - return new boss_blindeye_the_seerAI (pCreature); -} - -CreatureAI *GetAI_boss_krosh_firehand(Creature* pCreature) -{ - return new boss_krosh_firehandAI (pCreature); -} - -void AddSC_boss_high_king_maulgar() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_high_king_maulgar"; - newscript->GetAI = &GetAI_boss_high_king_maulgar; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="boss_kiggler_the_crazed"; - newscript->GetAI = &GetAI_boss_kiggler_the_crazed; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="boss_blindeye_the_seer"; - newscript->GetAI = &GetAI_boss_blindeye_the_seer; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="boss_olm_the_summoner"; - newscript->GetAI = &GetAI_boss_olm_the_summoner; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="boss_krosh_firehand"; - newscript->GetAI = &GetAI_boss_krosh_firehand; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/gruuls_lair/def_gruuls_lair.h b/src/bindings/scripts/scripts/zone/gruuls_lair/def_gruuls_lair.h deleted file mode 100644 index 7003dcb1e26..00000000000 --- a/src/bindings/scripts/scripts/zone/gruuls_lair/def_gruuls_lair.h +++ /dev/null @@ -1,21 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ - -#ifndef DEF_GRUULS_LAIR_H -#define DEF_GRUULS_LAIR_H - -#define DATA_BLINDEYETHESEER 1 -#define DATA_GRUULEVENT 2 -#define DATA_KIGGLERTHECRAZED 3 -#define DATA_KROSHFIREHAND 4 -#define DATA_MAULGAREVENT 5 -#define DATA_MAULGAREVENT_TANK 6 -#define DATA_OLMTHESUMMONER 7 -#define DATA_MAULGARDOOR 8 -#define DATA_GRUULDOOR 9 -#define DATA_MAULGAR 10 - -#define ERROR_INST_DATA "TSCR Error: Instance Data not set properly for Gruul's Lair instance (map 565). Encounters will be buggy." -#endif - diff --git a/src/bindings/scripts/scripts/zone/gruuls_lair/instance_gruuls_lair.cpp b/src/bindings/scripts/scripts/zone/gruuls_lair/instance_gruuls_lair.cpp deleted file mode 100644 index 0ac5cbcaf7a..00000000000 --- a/src/bindings/scripts/scripts/zone/gruuls_lair/instance_gruuls_lair.cpp +++ /dev/null @@ -1,193 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Instance_Gruuls_Lair -SD%Complete: 100 -SDComment: -SDCategory: Gruul's Lair -EndScriptData */ - -#include "precompiled.h" -#include "def_gruuls_lair.h" - -#define MAX_ENCOUNTER 2 - -/* Gruuls Lair encounters: -1 - High King Maulgar event -2 - Gruul event -*/ - -struct TRINITY_DLL_DECL instance_gruuls_lair : public ScriptedInstance -{ - instance_gruuls_lair(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; - - uint32 m_auiEncounter[MAX_ENCOUNTER]; - - uint64 MaulgarEvent_Tank; - uint64 KigglerTheCrazed; - uint64 BlindeyeTheSeer; - uint64 OlmTheSummoner; - uint64 KroshFirehand; - uint64 Maulgar; - - uint64 MaulgarDoor; - uint64 GruulDoor; - - void Initialize() - { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - - MaulgarEvent_Tank = 0; - KigglerTheCrazed = 0; - BlindeyeTheSeer = 0; - OlmTheSummoner = 0; - KroshFirehand = 0; - Maulgar = 0; - - MaulgarDoor = 0; - GruulDoor = 0; - } - - bool IsEncounterInProgress() const - { - for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) return true; - - return false; - } - - void OnCreatureCreate(Creature* pCreature, bool add) - { - switch(pCreature->GetEntry()) - { - case 18835: KigglerTheCrazed = pCreature->GetGUID(); break; - case 18836: BlindeyeTheSeer = pCreature->GetGUID(); break; - case 18834: OlmTheSummoner = pCreature->GetGUID(); break; - case 18832: KroshFirehand = pCreature->GetGUID(); break; - case 18831: Maulgar = pCreature->GetGUID(); break; - } - } - - void OnGameObjectCreate(GameObject* pGo, bool add) - { - switch(pGo->GetEntry()) - { - case 184468: - MaulgarDoor = pGo->GetGUID(); - if (m_auiEncounter[0] == DONE) HandleGameObject(NULL, true, pGo); - break; - case 184662: GruulDoor = pGo->GetGUID(); break; - } - } - - void SetData64(uint32 type, uint64 data) - { - if (type == DATA_MAULGAREVENT_TANK) - MaulgarEvent_Tank = data; - } - - uint64 GetData64(uint32 identifier) - { - switch(identifier) - { - case DATA_MAULGAREVENT_TANK: return MaulgarEvent_Tank; - case DATA_KIGGLERTHECRAZED: return KigglerTheCrazed; - case DATA_BLINDEYETHESEER: return BlindeyeTheSeer; - case DATA_OLMTHESUMMONER: return OlmTheSummoner; - case DATA_KROSHFIREHAND: return KroshFirehand; - case DATA_MAULGARDOOR: return MaulgarDoor; - case DATA_GRUULDOOR: return GruulDoor; - case DATA_MAULGAR: return Maulgar; - } - return 0; - } - - void SetData(uint32 type, uint32 data) - { - switch(type) - { - case DATA_MAULGAREVENT: - if (data == DONE) HandleGameObject(MaulgarDoor, true); - m_auiEncounter[0] = data; break; - case DATA_GRUULEVENT: - if (data == IN_PROGRESS) HandleGameObject(GruulDoor, false); - else HandleGameObject(GruulDoor, true); - m_auiEncounter[1] = data; break; - } - - if (data == DONE) - SaveToDB(); - } - - uint32 GetData(uint32 type) - { - switch(type) - { - case DATA_MAULGAREVENT: return m_auiEncounter[0]; - case DATA_GRUULEVENT: return m_auiEncounter[1]; - } - return 0; - } - - std::string GetSaveData() - { - OUT_SAVE_INST_DATA; - std::ostringstream stream; - stream << m_auiEncounter[0] << " " << m_auiEncounter[1]; - char* out = new char[stream.str().length() + 1]; - strcpy(out, stream.str().c_str()); - if (out) - { - OUT_SAVE_INST_DATA_COMPLETE; - return out; - } - - return NULL; - } - - void Load(const char* in) - { - if (!in) - { - OUT_LOAD_INST_DATA_FAIL; - return; - } - - OUT_LOAD_INST_DATA(in); - std::istringstream stream(in); - stream >> m_auiEncounter[0] >> m_auiEncounter[1]; - for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) // Do not load an encounter as "In Progress" - reset it instead. - m_auiEncounter[i] = NOT_STARTED; - OUT_LOAD_INST_DATA_COMPLETE; - } -}; - -InstanceData* GetInstanceData_instance_gruuls_lair(Map* pMap) -{ - return new instance_gruuls_lair(pMap); -} - -void AddSC_instance_gruuls_lair() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_gruuls_lair"; - newscript->GetInstanceData = &GetInstanceData_instance_gruuls_lair; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/gundrak/boss_drakkari_colossus.cpp b/src/bindings/scripts/scripts/zone/gundrak/boss_drakkari_colossus.cpp deleted file mode 100644 index 4d18ad6ba7c..00000000000 --- a/src/bindings/scripts/scripts/zone/gundrak/boss_drakkari_colossus.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/* Script Data Start -SDName: Boss Drakkari Colossus -SDAuthor: LordVanMartin -SD%Complete: -SDComment: -SDCategory: -Script Data End */ - -/*** SQL START *** -update creature_template set scriptname = '' where entry = ''; -*** SQL END ***/ -#include "precompiled.h" - -//Spells -#define SPELL_EMERGE 54850 //to phase2, Colossus unatackable, Elemental emerges -#define SPELL_EMERGE_2 54851 -#define SPELL_MIGHTY_BLOW 54719 - -struct TRINITY_DLL_DECL boss_drakkari_colossusAI : public ScriptedAI -{ - boss_drakkari_colossusAI(Creature *c) : ScriptedAI(c) {} - - uint32 phase; - - void Reset() {} - void EnterCombat(Unit* who) {} - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - phase =1; - - DoMeleeAttackIfReady(); - } - void JustDied(Unit* killer) {} -}; - -CreatureAI* GetAI_boss_drakkari_colossus(Creature* pCreature) -{ - return new boss_drakkari_colossusAI (pCreature); -} - -void AddSC_boss_drakkari_colossus() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_drakkari_colossus"; - newscript->GetAI = &GetAI_boss_drakkari_colossus; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/gundrak/boss_eck.cpp b/src/bindings/scripts/scripts/zone/gundrak/boss_eck.cpp deleted file mode 100644 index 8c72de6c9ad..00000000000 --- a/src/bindings/scripts/scripts/zone/gundrak/boss_eck.cpp +++ /dev/null @@ -1,65 +0,0 @@ -/* Script Data Start -SDName: Boss Eck the Ferocious -SDAuthor: LordVanMartin -SD%Complete: -SDComment: Only appears in Heroic mode -SDCategory: -Script Data End */ - -/*** SQL START *** -update creature_template set scriptname = '' where entry = ''; -*** SQL END ***/ -#include "precompiled.h" - -#define SPELL_ECK_BERSERK 55816 //Eck goes berserk, increasing his attack speed by 150% and all damage he deals by 500%. -#define SPELL_ECK_BITE 55813 //Eck bites down hard, inflicting 150% of his normal damage to an enemy. -#define SPELL_ECK_SPIT 55814 //Eck spits toxic bile at enemies in a cone in front of him, inflicting 2970 Nature damage and draining 220 mana every 1 sec for 3 sec. -#define SPELL_ECK_SPRING_1 55815 //Eck leaps at a distant target. --> Drops aggro and charges a random player. Tank can simply taunt him back. -#define SPELL_ECK_SPRING_2 55837 //Eck leaps at a distant target. - -struct TRINITY_DLL_DECL boss_eckAI : public ScriptedAI -{ - boss_eckAI(Creature *c) : ScriptedAI(c) {} - - uint32 berserk; - - void Reset() - { - //Source Deadly Boss Mod - berserk = 120000; //2min - } - - void EnterCombat(Unit* who) {} - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - if (berserk < diff) - { - DoCast(m_creature,SPELL_ECK_BERSERK); - berserk = 120000; - }else berserk -= diff; - - DoMeleeAttackIfReady(); - } - void JustDied(Unit* killer) {} -}; - -CreatureAI* GetAI_boss_eck(Creature* pCreature) -{ - return new boss_eckAI (pCreature); -} - -void AddSC_boss_eck() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_eck"; - newscript->GetAI = &GetAI_boss_eck; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/gundrak/boss_gal_darah.cpp b/src/bindings/scripts/scripts/zone/gundrak/boss_gal_darah.cpp deleted file mode 100644 index 65edd1b312e..00000000000 --- a/src/bindings/scripts/scripts/zone/gundrak/boss_gal_darah.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/* Script Data Start -SDName: Boss gal_darah -SDAuthor: LordVanMartin -SD%Complete: -SDComment: -SDCategory: -Script Data End */ - -/*** SQL START *** -update creature_template set scriptname = '' where entry = ''; -*** SQL END ***/ -#include "precompiled.h" - -//Spells -#define SPELL_ENRAGE 55285 -#define SPELL_IMPALING_CHARGE 54956 -#define SPELL_STOMP 55292 - -#define SPELL_PUNCTURE 55276 -#define SPELL_STAMPEDE 55218 -#define SPELL_WHIRLING_SLASH 55285 - -//Yells -#define SAY_AGGRO -1604000 -#define SAY_SLAY_1 -1604001 -#define SAY_SLAY_2 -1604002 -#define SAY_SLAY_3 -1604003 -#define SAY_DEATH -1604004 -#define SAY_SUMMON_RHINO_1 -1604005 -#define SAY_SUMMON_RHINO_2 -1604006 -#define SAY_SUMMON_RHINO_3 -1604007 -#define SAY_TRANSFORM_1 -1604008 //Phase change -#define SAY_TRANSFORM_2 -1604009 - -struct TRINITY_DLL_DECL boss_gal_darahAI : public ScriptedAI -{ - boss_gal_darahAI(Creature *c) : ScriptedAI(c) {} - - void Reset() {} - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - void JustDied(Unit* killer) - { - DoScriptText(SAY_DEATH, m_creature); - } - void KilledUnit(Unit *victim) - { - if (victim == m_creature) - return; - - switch(rand()%3) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature);break; - case 1: DoScriptText(SAY_SLAY_2, m_creature);break; - case 2: DoScriptText(SAY_SLAY_3, m_creature);break; - } - } -}; - -CreatureAI* GetAI_boss_gal_darah(Creature* pCreature) -{ - return new boss_gal_darahAI (pCreature); -} - -void AddSC_boss_gal_darah() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_gal_darah"; - newscript->GetAI = &GetAI_boss_gal_darah; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/gundrak/boss_moorabi.cpp b/src/bindings/scripts/scripts/zone/gundrak/boss_moorabi.cpp deleted file mode 100644 index 7bdbe0eebc9..00000000000 --- a/src/bindings/scripts/scripts/zone/gundrak/boss_moorabi.cpp +++ /dev/null @@ -1,88 +0,0 @@ -/* Script Data Start -SDName: Boss moorabi -SDAuthor: LordVanMartin -SD%Complete: -SDComment: -SDCategory: -Script Data End */ - -/*** SQL START *** -update creature_template set scriptname = 'boss_moorabi' where entry = ''; -*** SQL END ***/ -#include "precompiled.h" - -//Spells -#define SPELL_DETERMINED_GORE 55102 -#define SPELL_DETERMINED_STAB_2 59444 -#define SPELL_DETERMINED_STAB_3 55104 - -#define SPELL_GROUND_TREMOR 55142 -#define SPELL_MOJO_FRENZY 55163 -#define SPELL_NUMBING_ROAR_1 55100 -#define SPELL_NUMBING_ROAR_2 55106 -#define SPELL_TRANSFORMATION 55098 //Periodic, The caster transforms into a powerful mammoth, increasing Physical damage done by 25% and granting immunity to Stun effects. -#define SPELL_QUAKE 55101 - -//Yell -#define SAY_AGGRO -1604010 -#define SAY_SLAY_1 -1604011 -#define SAY_SLAY_2 -1604012 -#define SAY_SLAY_3 -1604013 -#define SAY_DEATH -1604014 -#define SAY_TRANSFORM -1604015 -#define SAY_QUAKE -1604016 - -struct TRINITY_DLL_DECL boss_moorabiAI : public ScriptedAI -{ - boss_moorabiAI(Creature *c) : ScriptedAI(c) {} - - uint32 phase; - - void Reset() {} - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) - { - phase =1; - //Return since we have no target - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - void JustDied(Unit* killer) - { - DoScriptText(SAY_DEATH, m_creature); - } - void KilledUnit(Unit *victim) - { - if (victim == m_creature) - return; - - switch(rand()%3) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature);break; - case 1: DoScriptText(SAY_SLAY_2, m_creature);break; - case 2: DoScriptText(SAY_SLAY_3, m_creature);break; - } - } -}; - -CreatureAI* GetAI_boss_moorabi(Creature* pCreature) -{ - return new boss_moorabiAI (pCreature); -} - -void AddSC_boss_moorabi() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_moorabi"; - newscript->GetAI = &GetAI_boss_moorabi; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/gundrak/boss_slad_ran.cpp b/src/bindings/scripts/scripts/zone/gundrak/boss_slad_ran.cpp deleted file mode 100644 index 559a0090e3b..00000000000 --- a/src/bindings/scripts/scripts/zone/gundrak/boss_slad_ran.cpp +++ /dev/null @@ -1,95 +0,0 @@ -/* Script Data Start -SDName: Boss slad_ran -SDAuthor: LordVanMartin -SD%Complete: -SDComment: -SDCategory: -Script Data End */ - -/*** SQL START *** -update creature_template set scriptname = 'boss_slad_ran' where entry = ''; -*** SQL END ***/ -#include "precompiled.h" - -//Spells -#define SPELL_POISON_NOVA 55081 -#define SPELL_POISON_NOVA_2 59842 -//-- -#define SPELL_POWERFUL_BITE 48287 -#define SPELL_POWERFUL_BITE_2 59840 -//-- -#define SPELL_VENOM_BOLT 54970 -#define SPELL_VENOM_BOLT_2 59839 -//At 30% HPStart summoning small serpents - -//Yell -#define SAY_AGGRO -1604017 -#define SAY_SLAY_1 -1604018 -#define SAY_SLAY_2 -1604019 -#define SAY_SLAY_3 -1604020 -#define SAY_DEATH -1604021 -#define SAY_SUMMON_SNAKES -1604022 //npc 29680 -#define SAY_SUMMON_CONSTRICTORS -1604023 //npc 29713, can cast Grip of Slad'ran (spell 55093) - -struct TRINITY_DLL_DECL boss_slad_ranAI : public ScriptedAI -{ - boss_slad_ranAI(Creature *c) : ScriptedAI(c) {} - - void Reset() {} - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 30) - { - //Summon 3 snakes --> npc 29680 - DoScriptText(SAY_SUMMON_SNAKES,m_creature); - } - if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 25) - { - //Summon 3 constrictors --> npc 29713 - DoScriptText(SAY_SUMMON_CONSTRICTORS,m_creature); - } - - DoMeleeAttackIfReady(); - } - void JustDied(Unit* killer) - { - DoScriptText(SAY_DEATH, m_creature); - } - void KilledUnit(Unit *victim) - { - if (victim == m_creature) - return; - - switch(rand()%3) - { - case 0:DoScriptText(SAY_SLAY_1, m_creature);break; - case 1:DoScriptText(SAY_SLAY_2, m_creature);break; - case 2:DoScriptText(SAY_SLAY_3, m_creature);break; - } - } -}; - -CreatureAI* GetAI_boss_slad_ran(Creature* pCreature) -{ - return new boss_slad_ranAI (pCreature); -} - -void AddSC_boss_slad_ran() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_slad_ran"; - newscript->GetAI = &GetAI_boss_slad_ran; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/gundrak/def_gundrak.h b/src/bindings/scripts/scripts/zone/gundrak/def_gundrak.h deleted file mode 100644 index 5f015610312..00000000000 --- a/src/bindings/scripts/scripts/zone/gundrak/def_gundrak.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef DEF_GUNDRAK_H -#define DEF_GUNDRAK_H - -#endif diff --git a/src/bindings/scripts/scripts/zone/gundrak/instance_gundrak.cpp b/src/bindings/scripts/scripts/zone/gundrak/instance_gundrak.cpp deleted file mode 100644 index 0ed874d905f..00000000000 --- a/src/bindings/scripts/scripts/zone/gundrak/instance_gundrak.cpp +++ /dev/null @@ -1,21 +0,0 @@ -#include "precompiled.h" -#include "def_gundrak.h" - -struct TRINITY_DLL_DECL instance_gundrak : public ScriptedInstance -{ - instance_gundrak(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; -}; - -InstanceData* GetInstanceData_instance_gundrak(Map* pMap) -{ - return new instance_gundrak(pMap); -} - -void AddSC_instance_gundrak() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_gundrak"; - newscript->GetInstanceData = &GetInstanceData_instance_gundrak; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_broggok.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_broggok.cpp deleted file mode 100644 index 6c877602426..00000000000 --- a/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_broggok.cpp +++ /dev/null @@ -1,131 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Broggok -SD%Complete: 70 -SDComment: pre-event not made -SDCategory: Hellfire Citadel, Blood Furnace -EndScriptData */ - -#include "precompiled.h" -#include "def_blood_furnace.h" - -enum -{ - SAY_AGGRO = -1542008, - - SPELL_SLIME_SPRAY = 30913, - SPELL_POISON_CLOUD = 30916, - SPELL_POISON_BOLT = 30917, - - SPELL_POISON = 30914 -}; - -struct TRINITY_DLL_DECL boss_broggokAI : public ScriptedAI -{ - boss_broggokAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - uint32 AcidSpray_Timer; - uint32 PoisonSpawn_Timer; - uint32 PoisonBolt_Timer; - - void Reset() - { - AcidSpray_Timer = 10000; - PoisonSpawn_Timer = 5000; - PoisonBolt_Timer = 7000; - if (pInstance) - { - pInstance->SetData(TYPE_BROGGOK_EVENT, NOT_STARTED); - pInstance->HandleGameObject(pInstance->GetData64(DATA_DOOR4), true); - } - } - - void EnterCombat(Unit *who) - { - DoScriptText(SAY_AGGRO, m_creature); - if (pInstance) - { - pInstance->SetData(TYPE_BROGGOK_EVENT, IN_PROGRESS); - pInstance->HandleGameObject(pInstance->GetData64(DATA_DOOR4), false); - } - } - - void JustSummoned(Creature *summoned) - { - summoned->setFaction(16); - summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - summoned->CastSpell(summoned,SPELL_POISON,false,0,0,m_creature->GetGUID()); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (AcidSpray_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_SLIME_SPRAY); - AcidSpray_Timer = 4000+rand()%8000; - }else AcidSpray_Timer -=diff; - - if (PoisonBolt_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_POISON_BOLT); - PoisonBolt_Timer = 4000+rand()%8000; - }else PoisonBolt_Timer -=diff; - - if (PoisonSpawn_Timer < diff) - { - DoCast(m_creature,SPELL_POISON_CLOUD); - PoisonSpawn_Timer = 20000; - }else PoisonSpawn_Timer -=diff; - - DoMeleeAttackIfReady(); - } - - void JustDied(Unit* who) - { - if (pInstance) - { - pInstance->HandleGameObject(pInstance->GetData64(DATA_DOOR4), true); - pInstance->HandleGameObject(pInstance->GetData64(DATA_DOOR5), true); - pInstance->SetData(TYPE_BROGGOK_EVENT, DONE); - } - } - -}; - -CreatureAI* GetAI_boss_broggok(Creature* pCreature) -{ - return new boss_broggokAI (pCreature); -} - -void AddSC_boss_broggok() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_broggok"; - newscript->GetAI = &GetAI_boss_broggok; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_kelidan_the_breaker.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_kelidan_the_breaker.cpp deleted file mode 100644 index 097a1f21a0d..00000000000 --- a/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_kelidan_the_breaker.cpp +++ /dev/null @@ -1,378 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Kelidan_The_Breaker -SD%Complete: 100 -SDComment: -SDCategory: Hellfire Citadel, Blood Furnace -EndScriptData */ - -/* ContentData -boss_kelidan_the_breaker -mob_shadowmoon_channeler -EndContentData */ - -#include "precompiled.h" -#include "def_blood_furnace.h" - -enum -{ - SAY_WAKE = -1542000, - SAY_ADD_AGGRO_1 = -1542001, - SAY_ADD_AGGRO_2 = -1542002, - SAY_ADD_AGGRO_3 = -1542003, - SAY_KILL_1 = -1542004, - SAY_KILL_2 = -1542005, - SAY_NOVA = -1542006, - SAY_DIE = -1542007, - - SPELL_CORRUPTION = 30938, - SPELL_EVOCATION = 30935, - - SPELL_FIRE_NOVA = 33132, - H_SPELL_FIRE_NOVA = 37371, - - SPELL_SHADOW_BOLT_VOLLEY = 28599, - H_SPELL_SHADOW_BOLT_VOLLEY = 40070, - - SPELL_BURNING_NOVA = 30940, - SPELL_VORTEX = 37370, - - ENTRY_KELIDAN = 17377, - ENTRY_CHANNELER = 17653 -}; - -const float ShadowmoonChannelers[5][4]= -{ - {302,-87,-24.4,0.157}, - {321,-63.5,-24.6,4.887}, - {346,-74.5,-24.6,3.595}, - {344,-103.5,-24.5,2.356}, - {316,-109,-24.6,1.257} -}; - -struct TRINITY_DLL_DECL boss_kelidan_the_breakerAI : public ScriptedAI -{ - boss_kelidan_the_breakerAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - HeroicMode = c->GetMap()->IsHeroic(); - for(uint8 i=0; i<5; ++i) - Channelers[i] = 0; - } - - ScriptedInstance* pInstance; - bool HeroicMode; - - uint32 ShadowVolley_Timer; - uint32 BurningNova_Timer; - uint32 Firenova_Timer; - uint32 Corruption_Timer; - uint32 check_Timer; - bool Firenova; - bool addYell; - uint64 Channelers[5]; - - void Reset() - { - ShadowVolley_Timer = 1000; - BurningNova_Timer = 15000; - Corruption_Timer = 5000; - check_Timer = 0; - Firenova = false; - addYell = false; - SummonChannelers(); - if (pInstance) - pInstance->SetData(TYPE_KELIDAN_THE_BREAKER_EVENT, NOT_STARTED); - } - - void EnterCombat(Unit *who) - { - DoScriptText(SAY_WAKE, m_creature); - if (m_creature->IsNonMeleeSpellCasted(false)) - m_creature->InterruptNonMeleeSpells(true); - DoStartMovement(who); - if (pInstance) - pInstance->SetData(TYPE_KELIDAN_THE_BREAKER_EVENT, IN_PROGRESS); - } - - void KilledUnit(Unit* victim) - { - if (rand()%2) - return; - - switch(rand()%2) - { - case 0: DoScriptText(SAY_KILL_1, m_creature); break; - case 1: DoScriptText(SAY_KILL_2, m_creature); break; - } - } - - void ChannelerEngaged(Unit* who) - { - if (who && !addYell) - { - addYell = true; - switch(rand()%3) - { - case 0: DoScriptText(SAY_ADD_AGGRO_1, m_creature); break; - case 1: DoScriptText(SAY_ADD_AGGRO_2, m_creature); break; - default: DoScriptText(SAY_ADD_AGGRO_3, m_creature); break; - } - } - for(uint8 i=0; i<5; ++i) - { - Creature *channeler = Unit::GetCreature(*m_creature, Channelers[i]); - if (who && channeler && !channeler->isInCombat()) - channeler->AI()->AttackStart(who); - } - } - - void ChannelerDied(Unit* killer) - { - for(uint8 i=0; i<5; ++i) - { - Creature *channeler = Unit::GetCreature(*m_creature, Channelers[i]); - if (channeler && channeler->isAlive()) - return; - } - - if (killer) - m_creature->AI()->AttackStart(killer); - } - - uint64 GetChanneled(Creature *channeler1) - { - SummonChannelers(); - if (!channeler1) return NULL; - uint8 i; - for(i=0; i<5; ++i) - { - Creature *channeler = Unit::GetCreature(*m_creature, Channelers[i]); - if (channeler && channeler->GetGUID() == channeler1->GetGUID()) - break; - } - return Channelers[(i+2)%5]; - } - - void SummonChannelers() - { - for(uint8 i=0; i<5; ++i) - { - Creature *channeler = Unit::GetCreature(*m_creature, Channelers[i]); - if (!channeler || channeler->isDead()) - channeler = m_creature->SummonCreature(ENTRY_CHANNELER,ShadowmoonChannelers[i][0],ShadowmoonChannelers[i][1],ShadowmoonChannelers[i][2],ShadowmoonChannelers[i][3],TEMPSUMMON_CORPSE_TIMED_DESPAWN,300000); - if (channeler) - Channelers[i] = channeler->GetGUID(); - else - Channelers[i] = 0; - } - } - - void JustDied(Unit* Killer) - { - DoScriptText(SAY_DIE, m_creature); - - if (!pInstance) - return; - - pInstance->SetData(TYPE_KELIDAN_THE_BREAKER_EVENT, DONE); - pInstance->HandleGameObject(pInstance->GetData64(DATA_DOOR1), true); - pInstance->HandleGameObject(pInstance->GetData64(DATA_DOOR6), true); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - { - if (check_Timer < diff) - { - if (!m_creature->IsNonMeleeSpellCasted(false)) - DoCast(m_creature,SPELL_EVOCATION); - check_Timer = 5000; - }else check_Timer -= diff; - return; - } - - if (Firenova) - { - if (Firenova_Timer < diff) - { - DoCast(m_creature,HeroicMode ? H_SPELL_FIRE_NOVA : SPELL_FIRE_NOVA,true); - Firenova = false; - ShadowVolley_Timer = 2000; - }else Firenova_Timer -=diff; - - return; - } - - if (ShadowVolley_Timer < diff) - { - DoCast(m_creature,HeroicMode ? H_SPELL_SHADOW_BOLT_VOLLEY : SPELL_SHADOW_BOLT_VOLLEY); - ShadowVolley_Timer = 5000+rand()%8000; - }else ShadowVolley_Timer -=diff; - - if (Corruption_Timer < diff) - { - DoCast(m_creature,SPELL_CORRUPTION); - Corruption_Timer = 30000+rand()%20000; - }else Corruption_Timer -=diff; - - if (BurningNova_Timer < diff) - { - if (m_creature->IsNonMeleeSpellCasted(false)) - m_creature->InterruptNonMeleeSpells(true); - - DoScriptText(SAY_NOVA, m_creature); - - if (SpellEntry *nova = GET_SPELL(SPELL_BURNING_NOVA)) - { - uint8 eff_mask=0; - for (int i=0; i<3; ++i) - { - if (!nova->Effect[i]) - continue; - eff_mask|=1<AddAura(new Aura(nova, eff_mask, NULL, m_creature, m_creature)); - } - - if (HeroicMode) - DoTeleportAll(m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ(),m_creature->GetOrientation()); - - BurningNova_Timer = 20000+rand()%8000; - Firenova_Timer= 5000; - Firenova = true; - }else BurningNova_Timer -=diff; - - DoMeleeAttackIfReady(); - } - -}; - -CreatureAI* GetAI_boss_kelidan_the_breaker(Creature* pCreature) -{ - return new boss_kelidan_the_breakerAI (pCreature); -} - -/*###### -## mob_shadowmoon_channeler -######*/ - -enum -{ - SPELL_SHADOW_BOLT = 12739, - H_SPELL_SHADOW_BOLT = 15472, - - SPELL_MARK_OF_SHADOW = 30937, - SPELL_CHANNELING = 39123 -}; - -struct TRINITY_DLL_DECL mob_shadowmoon_channelerAI : public ScriptedAI -{ - mob_shadowmoon_channelerAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - HeroicMode = c->GetMap()->IsHeroic(); - } - - ScriptedInstance* pInstance; - bool HeroicMode; - - uint32 ShadowBolt_Timer; - uint32 MarkOfShadow_Timer; - uint32 check_Timer; - - void Reset() - { - ShadowBolt_Timer = 1000+rand()%1000; - MarkOfShadow_Timer = 5000+rand()%2000; - check_Timer = 0; - if (m_creature->IsNonMeleeSpellCasted(false)) - m_creature->InterruptNonMeleeSpells(true); - } - - void EnterCombat(Unit* who) - { - if (Creature *Kelidan = me->FindNearestCreature(ENTRY_KELIDAN, 100)) - CAST_AI(boss_kelidan_the_breakerAI, Kelidan->AI())->ChannelerEngaged(who); - if (m_creature->IsNonMeleeSpellCasted(false)) - m_creature->InterruptNonMeleeSpells(true); - DoStartMovement(who); - } - - void JustDied(Unit* Killer) - { - if (Creature *Kelidan = me->FindNearestCreature(ENTRY_KELIDAN, 100)) - CAST_AI(boss_kelidan_the_breakerAI, Kelidan->AI())->ChannelerDied(Killer); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - { - if (check_Timer < diff) - { - if (!m_creature->IsNonMeleeSpellCasted(false)) - if (Creature *Kelidan = me->FindNearestCreature(ENTRY_KELIDAN, 100)) - { - uint64 channeler = CAST_AI(boss_kelidan_the_breakerAI, Kelidan->AI())->GetChanneled(m_creature); - if (Unit *channeled = Unit::GetUnit(*m_creature, channeler)) - DoCast(channeled,SPELL_CHANNELING); - } - check_Timer = 5000; - }else check_Timer -= diff; - return; - } - - if (MarkOfShadow_Timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - DoCast(target,SPELL_MARK_OF_SHADOW); - MarkOfShadow_Timer = 15000+rand()%5000; - }else MarkOfShadow_Timer -=diff; - - if (ShadowBolt_Timer < diff) - { - DoCast(m_creature->getVictim(),HeroicMode ? H_SPELL_SHADOW_BOLT : SPELL_SHADOW_BOLT); - ShadowBolt_Timer = 5000+rand()%1000; - }else ShadowBolt_Timer -=diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_shadowmoon_channeler(Creature* pCreature) -{ - return new mob_shadowmoon_channelerAI (pCreature); -} - -void AddSC_boss_kelidan_the_breaker() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_kelidan_the_breaker"; - newscript->GetAI = &GetAI_boss_kelidan_the_breaker; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_shadowmoon_channeler"; - newscript->GetAI = &GetAI_mob_shadowmoon_channeler; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_the_maker.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_the_maker.cpp deleted file mode 100644 index 9902c505b6b..00000000000 --- a/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_the_maker.cpp +++ /dev/null @@ -1,162 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_The_Maker -SD%Complete: 80 -SDComment: Mind control no support -SDCategory: Hellfire Citadel, Blood Furnace -EndScriptData */ - -#include "precompiled.h" -#include "def_blood_furnace.h" - -enum -{ - SAY_AGGRO_1 = -1542009, - SAY_AGGRO_2 = -1542010, - SAY_AGGRO_3 = -1542011, - SAY_KILL_1 = -1542012, - SAY_KILL_2 = -1542013, - SAY_DIE = -1542014, - - SPELL_ACID_SPRAY = 38153, // heroic 38973 ??? 38153 - SPELL_EXPLODING_BREAKER = 30925, - SPELL_KNOCKDOWN = 20276, - SPELL_DOMINATION = 25772 // ??? -}; - -struct TRINITY_DLL_DECL boss_the_makerAI : public ScriptedAI -{ - boss_the_makerAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - uint32 AcidSpray_Timer; - uint32 ExplodingBreaker_Timer; - uint32 Domination_Timer; - uint32 Knockdown_Timer; - - void Reset() - { - AcidSpray_Timer = 15000; - ExplodingBreaker_Timer = 6000; - Domination_Timer = 120000; - Knockdown_Timer = 10000; - - if (!pInstance) - return; - - pInstance->SetData(TYPE_THE_MAKER_EVENT, NOT_STARTED); - pInstance->HandleGameObject(pInstance->GetData64(DATA_DOOR2), true); - } - - void EnterCombat(Unit *who) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; - case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; - case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; - } - - if (!pInstance) - return; - - pInstance->SetData(TYPE_THE_MAKER_EVENT, IN_PROGRESS); - pInstance->HandleGameObject(pInstance->GetData64(DATA_DOOR2), false); - } - - void KilledUnit(Unit* victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_KILL_1, m_creature); break; - case 1: DoScriptText(SAY_KILL_2, m_creature); break; - } - } - - void JustDied(Unit* Killer) - { - DoScriptText(SAY_DIE, m_creature); - - if (!pInstance) - return; - - pInstance->SetData(TYPE_THE_MAKER_EVENT, DONE); - pInstance->HandleGameObject(pInstance->GetData64(DATA_DOOR2), true); - pInstance->HandleGameObject(pInstance->GetData64(DATA_DOOR3), true); - - - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (AcidSpray_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_ACID_SPRAY); - AcidSpray_Timer = 15000+rand()%8000; - }else AcidSpray_Timer -=diff; - - if (ExplodingBreaker_Timer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_EXPLODING_BREAKER); - ExplodingBreaker_Timer = 4000+rand()%8000; - }else ExplodingBreaker_Timer -=diff; - - /* // Disabled until Core Support for mind control - if (domination_timer_timer < diff) - { - Unit* target; - target = SelectUnit(SELECT_TARGET_RANDOM,0); - - DoCast(target,SPELL_DOMINATION); - - domination_timer = 120000; - }else domination_timer -=diff; - */ - - if (Knockdown_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_KNOCKDOWN); - Knockdown_Timer = 4000+rand()%8000; - }else Knockdown_Timer -=diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_the_makerAI(Creature* pCreature) -{ - return new boss_the_makerAI (pCreature); -} - -void AddSC_boss_the_maker() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_the_maker"; - newscript->GetAI = &GetAI_boss_the_makerAI; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/def_blood_furnace.h b/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/def_blood_furnace.h deleted file mode 100644 index b845c66823f..00000000000 --- a/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/def_blood_furnace.h +++ /dev/null @@ -1,29 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ - -#ifndef DEF_BLOOD_FURNACE_H -#define DEF_BLOOD_FURNACE_H - -#define DATA_THE_MAKER 1 -#define DATA_BROGGOK 2 -#define DATA_KELIDAN_THE_MAKER 3 -#define TYPE_THE_MAKER_EVENT 4 -#define TYPE_BROGGOK_EVENT 5 -#define TYPE_KELIDAN_THE_BREAKER_EVENT 6 -#define DATA_DOOR1 7 -#define DATA_DOOR2 8 -#define DATA_DOOR3 9 -#define DATA_DOOR4 10 -#define DATA_DOOR5 11 -#define DATA_DOOR6 12 -#define DATA_PRISON_CELL1 13 -#define DATA_PRISON_CELL2 14 -#define DATA_PRISON_CELL3 15 -#define DATA_PRISON_CELL4 16 -#define DATA_PRISON_CELL5 17 -#define DATA_PRISON_CELL6 18 -#define DATA_PRISON_CELL7 19 -#define DATA_PRISON_CELL8 20 -#endif - diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/instance_blood_furnace.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/instance_blood_furnace.cpp deleted file mode 100644 index 5a18ded0c08..00000000000 --- a/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/instance_blood_furnace.cpp +++ /dev/null @@ -1,234 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Instance_Blood_Furnace -SD%Complete: 85 -SDComment: -SDCategory: Hellfire Citadel, Blood Furnace -EndScriptData */ - -#include "precompiled.h" -#include "def_blood_furnace.h" - -#define ENTRY_SEWER1 181823 -#define ENTRY_SEWER2 181766 -#define MAX_ENCOUNTER 3 - -struct TRINITY_DLL_DECL instance_blood_furnace : public ScriptedInstance -{ - instance_blood_furnace(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; - - uint64 The_MakerGUID; - uint64 BroggokGUID; - uint64 Kelidan_The_BreakerGUID; - - uint64 Door1GUID; - uint64 Door2GUID; - uint64 Door3GUID; - uint64 Door4GUID; - uint64 Door5GUID; - uint64 Door6GUID; - - uint64 PrisonCell1GUID; - uint64 PrisonCell2GUID; - uint64 PrisonCell3GUID; - uint64 PrisonCell4GUID; - uint64 PrisonCell5GUID; - uint64 PrisonCell6GUID; - uint64 PrisonCell7GUID; - uint64 PrisonCell8GUID; - - uint32 m_auiEncounter[MAX_ENCOUNTER]; - std::string str_data; - - void Initialize() - { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - - The_MakerGUID = 0; - BroggokGUID = 0; - Kelidan_The_BreakerGUID = 0; - - Door1GUID = 0; - Door2GUID = 0; - Door3GUID = 0; - Door4GUID = 0; - Door5GUID = 0; - Door6GUID = 0; - - PrisonCell1GUID = 0; - PrisonCell2GUID = 0; - PrisonCell3GUID = 0; - PrisonCell4GUID = 0; - PrisonCell5GUID = 0; - PrisonCell6GUID = 0; - PrisonCell7GUID = 0; - PrisonCell8GUID = 0; - } - - - void OnCreatureCreate(Creature* pCreature, bool add) - { - if (!add) - return; - - switch(pCreature->GetEntry()) - { - case 17381: The_MakerGUID = pCreature->GetGUID(); break; - case 17380: BroggokGUID = pCreature->GetGUID(); break; - case 17377: Kelidan_The_BreakerGUID = pCreature->GetGUID(); break; - } - } - - void OnGameObjectCreate(GameObject* pGo, bool add) - { - if (!add) - return; - - if (pGo->GetEntry() == 181766) //Final exit door - Door1GUID = pGo->GetGUID(); - if (pGo->GetEntry() == 181811) //The Maker Front door - Door2GUID = pGo->GetGUID(); - if (pGo->GetEntry() == 181812) //The Maker Rear door - Door3GUID = pGo->GetGUID(); - if (pGo->GetEntry() == 181822) //Broggok Front door - Door4GUID = pGo->GetGUID(); - if (pGo->GetEntry() == 181819) //Broggok Rear door - Door5GUID = pGo->GetGUID(); - if (pGo->GetEntry() == 181823) //Kelidan exit door - Door6GUID = pGo->GetGUID(); - - if (pGo->GetEntry() == 181813) //The Maker prison cell front right - PrisonCell1GUID = pGo->GetGUID(); - if (pGo->GetEntry() == 181814) //The Maker prison cell back right - PrisonCell2GUID = pGo->GetGUID(); - if (pGo->GetEntry() == 181816) //The Maker prison cell front left - PrisonCell3GUID = pGo->GetGUID(); - if (pGo->GetEntry() == 181815) //The Maker prison cell back left - PrisonCell4GUID = pGo->GetGUID(); - if (pGo->GetEntry() == 181821) //Broggok prison cell front right - PrisonCell5GUID = pGo->GetGUID(); - if (pGo->GetEntry() == 181818) //Broggok prison cell back right - PrisonCell6GUID = pGo->GetGUID(); - if (pGo->GetEntry() == 181820) //Broggok prison cell front left - PrisonCell7GUID = pGo->GetGUID(); - if (pGo->GetEntry() == 181817) //Broggok prison cell back left - PrisonCell8GUID = pGo->GetGUID(); - } - - uint64 GetData64(uint32 data) - { - switch(data) - { - case DATA_THE_MAKER: return The_MakerGUID; - case DATA_BROGGOK: return BroggokGUID; - case DATA_KELIDAN_THE_MAKER: return Kelidan_The_BreakerGUID; - case DATA_DOOR1: return Door1GUID; - case DATA_DOOR2: return Door2GUID; - case DATA_DOOR3: return Door3GUID; - case DATA_DOOR4: return Door4GUID; - case DATA_DOOR5: return Door5GUID; - case DATA_DOOR6: return Door6GUID; - case DATA_PRISON_CELL1: return PrisonCell1GUID; - case DATA_PRISON_CELL2: return PrisonCell2GUID; - case DATA_PRISON_CELL3: return PrisonCell3GUID; - case DATA_PRISON_CELL4: return PrisonCell4GUID; - case DATA_PRISON_CELL5: return PrisonCell5GUID; - case DATA_PRISON_CELL6: return PrisonCell6GUID; - case DATA_PRISON_CELL7: return PrisonCell7GUID; - case DATA_PRISON_CELL8: return PrisonCell8GUID; - } - - return 0; - } - - void SetData(uint32 type, uint32 data) - { - switch(data) - { - case TYPE_THE_MAKER_EVENT: m_auiEncounter[0] = data; break; - case TYPE_BROGGOK_EVENT: m_auiEncounter[1] = data; break; - case TYPE_KELIDAN_THE_BREAKER_EVENT: m_auiEncounter[2] = data; break; - } - - if (data == DONE) - { - OUT_SAVE_INST_DATA; - - std::ostringstream saveStream; - saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2]; - - str_data = saveStream.str(); - - SaveToDB(); - OUT_SAVE_INST_DATA_COMPLETE; - } - } - - uint32 GetData(uint32 data) - { - switch(data) - { - case TYPE_THE_MAKER_EVENT: return m_auiEncounter[0]; - case TYPE_BROGGOK_EVENT: return m_auiEncounter[1]; - case TYPE_KELIDAN_THE_BREAKER_EVENT: return m_auiEncounter[2]; - } - - return 0; - } - - const char* Save() - { - return str_data.c_str(); - } - - void Load(const char* in) - { - if (!in) - { - OUT_LOAD_INST_DATA_FAIL; - return; - } - - OUT_LOAD_INST_DATA(in); - - std::istringstream loadStream(in); - loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2]; - - for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS || m_auiEncounter[i] == FAIL) - m_auiEncounter[i] = NOT_STARTED; - - OUT_LOAD_INST_DATA_COMPLETE; - } -}; - - -InstanceData* GetInstanceData_instance_blood_furnace(Map* pMap) -{ - return new instance_blood_furnace(pMap); -} - -void AddSC_instance_blood_furnace() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_blood_furnace"; - newscript->GetInstanceData = &GetInstanceData_instance_blood_furnace; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/boss_omor_the_unscarred.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/boss_omor_the_unscarred.cpp deleted file mode 100644 index e7411187e86..00000000000 --- a/src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/boss_omor_the_unscarred.cpp +++ /dev/null @@ -1,214 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Omar_The_Unscarred -SD%Complete: 90 -SDComment: Temporary solution for orbital/shadow whip-ability. Needs more core support before making it more proper. -SDCategory: Hellfire Citadel, Hellfire Ramparts -EndScriptData */ - -#include "precompiled.h" - -#define SAY_AGGRO_1 -1543009 -#define SAY_AGGRO_2 -1543010 -#define SAY_AGGRO_3 -1543011 -#define SAY_SUMMON -1543012 -#define SAY_CURSE -1543013 -#define SAY_KILL_1 -1543014 -#define SAY_DIE -1543015 -#define SAY_WIPE -1543016 - -#define SPELL_ORBITAL_STRIKE 30637 -#define SPELL_SHADOW_WHIP 30638 -#define SPELL_TREACHEROUS_AURA 30695 -#define H_SPELL_BANE_OF_TREACHERY 37566 -#define SPELL_DEMONIC_SHIELD 31901 -#define SPELL_SHADOW_BOLT 30686 -#define H_SPELL_SHADOW_BOLT 39297 -#define SPELL_SUMMON_FIENDISH_HOUND 30707 - -struct TRINITY_DLL_DECL boss_omor_the_unscarredAI : public ScriptedAI -{ - boss_omor_the_unscarredAI(Creature *c) : ScriptedAI(c) - { - SetCombatMovement(false); - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - bool HeroicMode; - - uint32 OrbitalStrike_Timer; - uint32 ShadowWhip_Timer; - uint32 Aura_Timer; - uint32 DemonicShield_Timer; - uint32 Shadowbolt_Timer; - uint32 Summon_Timer; - uint32 SummonedCount; - uint64 PlayerGUID; - bool CanPullBack; - - void Reset() - { - DoScriptText(SAY_WIPE, m_creature); - - OrbitalStrike_Timer = 25000; - ShadowWhip_Timer = 2000; - Aura_Timer = 10000; - DemonicShield_Timer = 1000; - Shadowbolt_Timer = 2000; - Summon_Timer = 10000; - SummonedCount = 0; - PlayerGUID = 0; - CanPullBack = false; - } - - void EnterCombat(Unit *who) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; - case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; - case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; - } - } - - void KilledUnit(Unit* victim) - { - if (rand()%2) - return; - - DoScriptText(SAY_KILL_1, m_creature); - } - - void JustSummoned(Creature* summoned) - { - DoScriptText(SAY_SUMMON, m_creature); - - if (Unit* random = SelectUnit(SELECT_TARGET_RANDOM,0)) - summoned->AI()->AttackStart(random); - - ++SummonedCount; - } - - void JustDied(Unit* Killer) - { - DoScriptText(SAY_DIE, m_creature); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //only two may be wrong, perhaps increase timer and spawn periodically instead. - if (SummonedCount < 2) - { - if (Summon_Timer < diff) - { - m_creature->InterruptNonMeleeSpells(false); - DoCast(m_creature,SPELL_SUMMON_FIENDISH_HOUND); - Summon_Timer = 15000+rand()%15000; - }else Summon_Timer -= diff; - } - - if (CanPullBack) - { - if (ShadowWhip_Timer < diff) - { - if (Player* temp = Unit::GetPlayer(PlayerGUID)) - { - //if unit dosen't have this flag, then no pulling back (script will attempt cast, even if orbital strike was resisted) - if (temp->HasUnitMovementFlag(MOVEMENTFLAG_FALLING)) - { - m_creature->InterruptNonMeleeSpells(false); - DoCast(temp,SPELL_SHADOW_WHIP); - } - } - PlayerGUID = 0; - ShadowWhip_Timer = 2000; - CanPullBack = false; - }else ShadowWhip_Timer -= diff; - } - else if (OrbitalStrike_Timer < diff) - { - Unit* temp = NULL; - if (m_creature->IsWithinMeleeRange(m_creature->getVictim())) - temp = m_creature->getVictim(); - else temp = SelectUnit(SELECT_TARGET_RANDOM,0); - - if (temp && temp->GetTypeId() == TYPEID_PLAYER) - { - DoCast(temp,SPELL_ORBITAL_STRIKE); - OrbitalStrike_Timer = 14000+rand()%2000; - PlayerGUID = temp->GetGUID(); - - if (PlayerGUID) - CanPullBack = true; - } - }else OrbitalStrike_Timer -= diff; - - if ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 20) - { - if (DemonicShield_Timer < diff) - { - DoCast(m_creature,SPELL_DEMONIC_SHIELD); - DemonicShield_Timer = 15000; - }else DemonicShield_Timer -= diff; - } - - if (Aura_Timer < diff) - { - DoScriptText(SAY_CURSE, m_creature); - - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) - { - DoCast(target,HeroicMode ? H_SPELL_BANE_OF_TREACHERY : SPELL_TREACHEROUS_AURA); - Aura_Timer = 8000+rand()%8000; - } - }else Aura_Timer -= diff; - - if (Shadowbolt_Timer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) - { - if (target) - target = m_creature->getVictim(); - - DoCast(target,HeroicMode ? H_SPELL_SHADOW_BOLT : SPELL_SHADOW_BOLT); - Shadowbolt_Timer = 4000+rand()%2500; - } - }else Shadowbolt_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_omor_the_unscarredAI(Creature* pCreature) -{ - return new boss_omor_the_unscarredAI (pCreature); -} - -void AddSC_boss_omor_the_unscarred() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_omor_the_unscarred"; - newscript->GetAI = &GetAI_boss_omor_the_unscarredAI; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/boss_vazruden_the_herald.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/boss_vazruden_the_herald.cpp deleted file mode 100644 index 98aa4627be2..00000000000 --- a/src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/boss_vazruden_the_herald.cpp +++ /dev/null @@ -1,490 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -Name: Boss_Vazruden_the_Herald -%Complete: 90 -Comment: -Category: Hellfire Citadel, Hellfire Ramparts -EndScriptData */ - -#include "precompiled.h" - -#define SPELL_FIREBALL (HeroicMode?36920:34653) -#define SPELL_CONE_OF_FIRE (HeroicMode?36921:30926) -#define SPELL_SUMMON_LIQUID_FIRE (HeroicMode?30928:23971) -#define SPELL_BELLOWING_ROAR 39427 -#define SPELL_REVENGE (HeroicMode?40392:19130) -#define SPELL_KIDNEY_SHOT 30621 -#define SPELL_FIRE_NOVA_VISUAL 19823 - -#define ENTRY_HELLFIRE_SENTRY 17517 -#define ENTRY_VAZRUDEN_HERALD 17307 -#define ENTRY_VAZRUDEN 17537 -#define ENTRY_NAZAN 17536 -#define ENTRY_LIQUID_FIRE 22515 -#define ENTRY_REINFORCED_FEL_IRON_CHEST (HeroicMode?185169:185168) - -#define SAY_INTRO -1543017 -#define SAY_WIPE -1543018 -#define SAY_AGGRO_1 -1543019 -#define SAY_AGGRO_2 -1543020 -#define SAY_AGGRO_3 -1543021 -#define SAY_KILL_1 -1543022 -#define SAY_KILL_2 -1543023 -#define SAY_DIE -1543024 -#define EMOTE -1543025 - -#define PATH_ENTRY 2081 - -const float VazrudenMiddle[3] = {-1406.5, 1746.5, 81.2}; -const float VazrudenRing[2][3] = -{ - {-1430, 1705, 112}, - {-1377, 1760, 112} -}; - -struct TRINITY_DLL_DECL boss_nazanAI : public ScriptedAI -{ - boss_nazanAI(Creature *c) : ScriptedAI(c) - { - HeroicMode = m_creature->GetMap()->IsHeroic(); - VazrudenGUID = 0; - flight = true; - } - - uint32 Fireball_Timer; - uint32 ConeOfFire_Timer; - uint32 BellowingRoar_Timer; - uint32 Fly_Timer; - uint32 Turn_Timer; - uint32 UnsummonCheck; - bool flight; - uint64 VazrudenGUID; - bool HeroicMode; - SpellEntry *liquid_fire; - - void Reset() - { - Fireball_Timer = 4000; - Fly_Timer = 45000; - Turn_Timer = 0; - UnsummonCheck = 5000; - } - - void EnterCombat(Unit* who) {} - - void JustSummoned(Creature *summoned) - { - if (summoned && summoned->GetEntry() == ENTRY_LIQUID_FIRE) - { - summoned->SetLevel(m_creature->getLevel()); - summoned->setFaction(m_creature->getFaction()); - summoned->CastSpell(summoned,SPELL_SUMMON_LIQUID_FIRE,true); - summoned->CastSpell(summoned,SPELL_FIRE_NOVA_VISUAL,true); - } - } - - void SpellHitTarget(Unit* target, const SpellEntry* entry) - { - if (target && entry->Id == SPELL_FIREBALL) - m_creature->SummonCreature(ENTRY_LIQUID_FIRE,target->GetPositionX(),target->GetPositionY(),target->GetPositionZ(),target->GetOrientation(),TEMPSUMMON_TIMED_DESPAWN,30000); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - { - if (UnsummonCheck < diff && m_creature->isAlive()) - { - m_creature->SetLootRecipient(NULL); - m_creature->SetVisibility(VISIBILITY_OFF); - m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - m_creature->RemoveCorpse(); - }else UnsummonCheck -= diff; - return; - } - - if (Fireball_Timer < diff) - { - if (Unit *victim = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(victim, SPELL_FIREBALL,true); - Fireball_Timer = 4000+rand()%3000; - }else Fireball_Timer -= diff; - - if (flight) // phase 1 - the flight - { - Creature *Vazruden = Unit::GetCreature(*m_creature,VazrudenGUID); - if (Fly_Timer < diff || !(Vazruden && Vazruden->isAlive() && (Vazruden->GetHealth()*5 > Vazruden->GetMaxHealth()))) - { - flight = false; - BellowingRoar_Timer = 6000; - ConeOfFire_Timer = 12000; - m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - m_creature->GetMotionMaster()->Clear(); - if (Unit *victim = SelectUnit(SELECT_TARGET_NEAREST,0)) - m_creature->AI()->AttackStart(victim); - DoStartMovement(m_creature->getVictim()); - DoScriptText(EMOTE, m_creature); - return; - }else Fly_Timer -= diff; - - if (Turn_Timer < diff) - { - uint32 waypoint = (Fly_Timer/10000)%2; - if (m_creature->IsWithinDist3d(VazrudenRing[waypoint][0],VazrudenRing[waypoint][1],VazrudenRing[waypoint][2], 5)) - m_creature->GetMotionMaster()->MovePoint(0,VazrudenRing[waypoint][0],VazrudenRing[waypoint][1],VazrudenRing[waypoint][2]); - Turn_Timer = 10000; - }else Turn_Timer -= diff; - } - else // phase 2 - land fight - { - if (ConeOfFire_Timer < diff) - { - DoCast(m_creature, SPELL_CONE_OF_FIRE); - ConeOfFire_Timer = 12000; - Fireball_Timer = 4000; - }else ConeOfFire_Timer -= diff; - - if (HeroicMode && BellowingRoar_Timer < diff) - { - DoCast(m_creature, SPELL_BELLOWING_ROAR); - BellowingRoar_Timer = 45000; - }else BellowingRoar_Timer -= diff; - - DoMeleeAttackIfReady(); - } - } -}; - -struct TRINITY_DLL_DECL boss_vazrudenAI : public ScriptedAI -{ - boss_vazrudenAI(Creature *c) : ScriptedAI(c) - { - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - uint32 Revenge_Timer; - bool HeroicMode; - bool WipeSaid; - uint32 UnsummonCheck; - - void Reset() - { - Revenge_Timer = 4000; - UnsummonCheck = 2000; - WipeSaid = false; - } - - void EnterCombat(Unit *who) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; - case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; - default: DoScriptText(SAY_AGGRO_3, m_creature); break; - } - } - - void KilledUnit(Unit* who) - { - if (who && who->GetEntry()!=ENTRY_VAZRUDEN) - switch(rand()%2) - { - case 0: DoScriptText(SAY_KILL_1, m_creature); break; - default: DoScriptText(SAY_KILL_2, m_creature); break; - } - } - - void JustDied(Unit* who) - { - if (who && who != m_creature) - DoScriptText(SAY_DIE, m_creature); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - { - if (UnsummonCheck < diff && m_creature->isAlive()) - { - if (!WipeSaid) - { - DoScriptText(SAY_WIPE, m_creature); - WipeSaid = true; - } - m_creature->SetLootRecipient(NULL); - m_creature->SetVisibility(VISIBILITY_OFF); - m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - m_creature->RemoveCorpse(); - }else UnsummonCheck -= diff; - return; - } - - if (Revenge_Timer < diff) - { - if (Unit *victim = m_creature->getVictim()) - DoCast(victim, SPELL_REVENGE); - Revenge_Timer = 5000; - }else Revenge_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -struct TRINITY_DLL_DECL boss_vazruden_the_heraldAI : public ScriptedAI -{ - boss_vazruden_the_heraldAI(Creature *c) : ScriptedAI(c) - { - summoned = false; - sentryDown = false; - NazanGUID = 0; - VazrudenGUID = 0; - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - uint32 phase; - uint32 waypoint; - uint32 check; - bool sentryDown; - uint64 NazanGUID; - uint64 VazrudenGUID; - bool summoned; - bool HeroicMode; - - void Reset() - { - phase = 0; - waypoint = 0; - check = 0; - UnsummonAdds(); - m_creature->GetMotionMaster()->MovePath(PATH_ENTRY, true); - } - - void UnsummonAdds() - { - if (summoned) - { - Creature *Nazan = Unit::GetCreature(*m_creature, NazanGUID); - Creature *Vazruden = Unit::GetCreature(*m_creature, VazrudenGUID); - if (Nazan || (Nazan = me->FindNearestCreature(ENTRY_NAZAN, 5000))) - { - Nazan->SetLootRecipient(NULL); - Nazan->SetVisibility(VISIBILITY_OFF); - Nazan->DealDamage(Nazan, Nazan->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - Nazan->RemoveCorpse(); - NazanGUID = 0; - } - if (Vazruden || (Vazruden = me->FindNearestCreature(ENTRY_VAZRUDEN, 5000))) - { - Vazruden->SetLootRecipient(NULL); - Vazruden->SetVisibility(VISIBILITY_OFF); - Vazruden->DealDamage(Vazruden, Vazruden->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - Vazruden->RemoveCorpse(); - VazrudenGUID = 0; - } - summoned = false; - m_creature->clearUnitState(UNIT_STAT_ROOT); - m_creature->SetVisibility(VISIBILITY_ON); - } - } - - void SummonAdds() - { - if (!summoned) - { - Creature* Vazruden = m_creature->SummonCreature(ENTRY_VAZRUDEN,VazrudenMiddle[0],VazrudenMiddle[1],VazrudenMiddle[2],0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,6000000); - if (Vazruden) - VazrudenGUID = Vazruden->GetGUID(); - Creature* Nazan = m_creature->SummonCreature(ENTRY_NAZAN,VazrudenMiddle[0],VazrudenMiddle[1],VazrudenMiddle[2],0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,6000000); - if (Nazan) - NazanGUID = Nazan->GetGUID(); - summoned = true; - m_creature->SetVisibility(VISIBILITY_OFF); - m_creature->addUnitState(UNIT_STAT_ROOT); - } - } - - void EnterCombat(Unit *who) - { - if (phase==0) - { - phase = 1; - check = 0; - DoScriptText(SAY_INTRO, m_creature); - } - } - - void JustSummoned(Creature *summoned) - { - if (!summoned) return; - Unit *victim = m_creature->getVictim(); - if (summoned->GetEntry() == ENTRY_NAZAN) - { - CAST_AI(boss_nazanAI, summoned->AI())->VazrudenGUID = VazrudenGUID; - summoned->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - summoned->SetSpeed(MOVE_FLIGHT, 2.5); - if (victim) - AttackStartNoMove(victim); - } - else if (victim) - summoned->AI()->AttackStart(victim); - } - - void SentryDownBy(Unit* killer) - { - if (sentryDown) - { - AttackStartNoMove(killer); - sentryDown = false; - } - else - sentryDown = true; - } - - void UpdateAI(const uint32 diff) - { - switch(phase) - { - case 0: // circle around the platform - return; - break; - case 1: // go to the middle and begin the fight - if (check < diff) - { - if (!m_creature->IsWithinDist3d(VazrudenMiddle[0],VazrudenMiddle[1],VazrudenMiddle[2],5)) - { - m_creature->GetMotionMaster()->Clear(); - m_creature->GetMotionMaster()->MovePoint(0,VazrudenMiddle[0],VazrudenMiddle[1],VazrudenMiddle[2]); - check = 1000; - } - else - { - SummonAdds(); - phase = 2; - return; - } - }else check -= diff; - break; - default: // adds do the job now - if (check < diff) - { - Creature *Nazan = Unit::GetCreature(*m_creature, NazanGUID); - Creature *Vazruden = Unit::GetCreature(*m_creature, VazrudenGUID); - if (Nazan && Nazan->isAlive() || Vazruden && Vazruden->isAlive()) - { - if (Nazan && Nazan->getVictim() || Vazruden && Vazruden->getVictim()) - return; - else - { - UnsummonAdds(); - EnterEvadeMode(); - return; - } - }else - { - m_creature->SummonGameObject(ENTRY_REINFORCED_FEL_IRON_CHEST,VazrudenMiddle[0],VazrudenMiddle[1],VazrudenMiddle[2],0,0,0,0,0,0); - m_creature->SetLootRecipient(NULL); - m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - } - check = 2000; - }else check -= diff; - break; - } - } -}; - -struct TRINITY_DLL_DECL mob_hellfire_sentryAI : public ScriptedAI -{ - mob_hellfire_sentryAI(Creature *c) : ScriptedAI(c) {} - - uint32 KidneyShot_Timer; - - void Reset() - { - KidneyShot_Timer = 3000+rand()%4000; - } - - void EnterCombat(Unit* who) {} - - void JustDied(Unit* who) - { - if (Creature *herald = me->FindNearestCreature(ENTRY_VAZRUDEN_HERALD,150)) - CAST_AI(boss_vazruden_the_heraldAI, herald->AI())->SentryDownBy(who); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (KidneyShot_Timer < diff) - { - if (Unit *victim = m_creature->getVictim()) - DoCast(victim, SPELL_KIDNEY_SHOT); - KidneyShot_Timer = 20000; - }else KidneyShot_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_vazruden_the_herald(Creature* pCreature) -{ - return new boss_vazruden_the_heraldAI (pCreature); -} - -CreatureAI* GetAI_boss_vazruden(Creature* pCreature) -{ - return new boss_vazrudenAI (pCreature); -} - - -CreatureAI* GetAI_boss_nazan(Creature* pCreature) -{ - return new boss_nazanAI (pCreature); -} - -CreatureAI* GetAI_mob_hellfire_sentry(Creature* pCreature) -{ - return new mob_hellfire_sentryAI (pCreature); -} - -void AddSC_boss_vazruden_the_herald() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_vazruden_the_herald"; - newscript->GetAI = &GetAI_boss_vazruden_the_herald; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="boss_vazruden"; - newscript->GetAI = &GetAI_boss_vazruden; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="boss_nazan"; - newscript->GetAI = &GetAI_boss_nazan; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_hellfire_sentry"; - newscript->GetAI = &GetAI_mob_hellfire_sentry; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/boss_watchkeeper_gargolmar.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/boss_watchkeeper_gargolmar.cpp deleted file mode 100644 index 13059c55ff2..00000000000 --- a/src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/boss_watchkeeper_gargolmar.cpp +++ /dev/null @@ -1,168 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Watchkeeper_Gargolmar -SD%Complete: 80 -SDComment: Missing adds to heal him. Surge should be used on target furthest away, not random. -SDCategory: Hellfire Citadel, Hellfire Ramparts -EndScriptData */ - -#include "precompiled.h" - -#define SAY_TAUNT -1543000 -#define SAY_HEAL -1543001 -#define SAY_SURGE -1543002 -#define SAY_AGGRO_1 -1543003 -#define SAY_AGGRO_2 -1543004 -#define SAY_AGGRO_3 -1543005 -#define SAY_KILL_1 -1543006 -#define SAY_KILL_2 -1543007 -#define SAY_DIE -1543008 - -#define SPELL_MORTAL_WOUND 30641 -#define H_SPELL_MORTAL_WOUND 36814 -#define SPELL_SURGE 34645 -#define SPELL_RETALIATION 22857 - -struct TRINITY_DLL_DECL boss_watchkeeper_gargolmarAI : public ScriptedAI -{ - boss_watchkeeper_gargolmarAI(Creature *c) : ScriptedAI(c) - { - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - bool HeroicMode; - - uint32 Surge_Timer; - uint32 MortalWound_Timer; - uint32 Retaliation_Timer; - - bool HasTaunted; - bool YelledForHeal; - - void Reset() - { - Surge_Timer = 5000; - MortalWound_Timer = 4000; - Retaliation_Timer = 0; - - HasTaunted = false; - YelledForHeal = false; - } - - void EnterCombat(Unit *who) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; - case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; - case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; - } - } - - void MoveInLineOfSight(Unit* who) - { - if (!m_creature->getVictim() && who->isTargetableForAttack() && (m_creature->IsHostileTo(who)) && who->isInAccessiblePlaceFor(m_creature)) - { - if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) - return; - - float attackRadius = m_creature->GetAttackDistance(who); - if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who)) - { - //who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); - AttackStart(who); - } - else if (!HasTaunted && m_creature->IsWithinDistInMap(who, 60.0f)) - { - DoScriptText(SAY_TAUNT, m_creature); - HasTaunted = true; - } - } - } - - void KilledUnit(Unit* victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_KILL_1, m_creature); break; - case 1: DoScriptText(SAY_KILL_2, m_creature); break; - } - } - - void JustDied(Unit* Killer) - { - DoScriptText(SAY_DIE, m_creature); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (MortalWound_Timer < diff) - { - DoCast(m_creature->getVictim(),HeroicMode ? H_SPELL_MORTAL_WOUND : SPELL_MORTAL_WOUND); - MortalWound_Timer = 5000+rand()%8000; - }else MortalWound_Timer -= diff; - - if (Surge_Timer < diff) - { - DoScriptText(SAY_SURGE, m_creature); - - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_SURGE); - - Surge_Timer = 5000+rand()%8000; - }else Surge_Timer -= diff; - - if ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 20) - { - if (Retaliation_Timer < diff) - { - DoCast(m_creature,SPELL_RETALIATION); - Retaliation_Timer = 30000; - }else Retaliation_Timer -= diff; - } - - if (!YelledForHeal) - { - if ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 40) - { - DoScriptText(SAY_HEAL, m_creature); - YelledForHeal = true; - } - } - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_watchkeeper_gargolmarAI(Creature* pCreature) -{ - return new boss_watchkeeper_gargolmarAI (pCreature); -} - -void AddSC_boss_watchkeeper_gargolmar() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_watchkeeper_gargolmar"; - newscript->GetAI = &GetAI_boss_watchkeeper_gargolmarAI; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/def_hellfire_ramparts.h b/src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/def_hellfire_ramparts.h deleted file mode 100644 index 4adf140b0ca..00000000000 --- a/src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/def_hellfire_ramparts.h +++ /dev/null @@ -1,16 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ - -#ifndef DEF_RAMPARTS_H -#define DEF_RAMPARTS_H - -#define MAX_ENCOUNTER 2 - -enum -{ - TYPE_VAZRUDEN = 1, - TYPE_NAZAN = 2 -}; - -#endif diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/instance_hellfire_ramparts.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/instance_hellfire_ramparts.cpp deleted file mode 100644 index 5942f0142ef..00000000000 --- a/src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/instance_hellfire_ramparts.cpp +++ /dev/null @@ -1,84 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Instance_Hellfire_Ramparts -SD%Complete: 50 -SDComment: -SDCategory: Hellfire Ramparts -EndScriptData */ - -#include "precompiled.h" -#include "def_hellfire_ramparts.h" - -struct TRINITY_DLL_DECL instance_ramparts : public ScriptedInstance -{ - instance_ramparts(Map* pMap) : ScriptedInstance(pMap) {Initialize();} - - uint32 m_auiEncounter[MAX_ENCOUNTER]; - uint64 m_uiChestNGUID; - uint64 m_uiChestHGUID; - - void Initialize() - { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - - m_uiChestNGUID = 0; - m_uiChestHGUID = 0; - } - - void OnGameObjectCreate(GameObject* pGo, bool add) - { - switch(pGo->GetEntry()) - { - case 185168: m_uiChestNGUID = pGo->GetGUID(); break; - case 185169: m_uiChestHGUID = pGo->GetGUID(); break; - } - } - - void SetData(uint32 uiType, uint32 uiData) - { - debug_log("TSCR: Instance Ramparts: SetData received for type %u with data %u",uiType,uiData); - - switch(uiType) - { - case TYPE_VAZRUDEN: - if (uiData == DONE && m_auiEncounter[1] == DONE) - DoRespawnGameObject(instance->IsHeroic() ? m_uiChestHGUID : m_uiChestNGUID, HOUR*IN_MILISECONDS); - m_auiEncounter[0] = uiData; - break; - case TYPE_NAZAN: - if (uiData == DONE && m_auiEncounter[0] == DONE) - DoRespawnGameObject(instance->IsHeroic() ? m_uiChestHGUID : m_uiChestNGUID, HOUR*IN_MILISECONDS); - m_auiEncounter[1] = uiData; - break; - } - } -}; - -InstanceData* GetInstanceData_instance_ramparts(Map* pMap) -{ - return new instance_ramparts(pMap); -} - -void AddSC_instance_ramparts() -{ - Script* pNewScript; - pNewScript = new Script; - pNewScript->Name = "instance_ramparts"; - pNewScript->GetInstanceData = &GetInstanceData_instance_ramparts; - pNewScript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/boss_magtheridon.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/boss_magtheridon.cpp deleted file mode 100644 index 8f7c076a701..00000000000 --- a/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/boss_magtheridon.cpp +++ /dev/null @@ -1,562 +0,0 @@ -/* Copyright(C) 2006 - 2008 ScriptDev2 -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -*(at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -/* ScriptData -SDName: Boss_Magtheridon -SD%Complete: 60 -SDComment: In Development -SDCategory: Hellfire Citadel, Magtheridon's lair -EndScriptData */ - -#include "precompiled.h" -#include "def_magtheridons_lair.h" - -struct Yell -{ - int32 id; -}; - -static Yell RandomTaunt[]= -{ - {-1544000}, - {-1544001}, - {-1544002}, - {-1544003}, - {-1544004}, - {-1544005}, -}; - -#define SAY_FREED -1544006 -#define SAY_AGGRO -1544007 -#define SAY_BANISH -1544008 -#define SAY_CHAMBER_DESTROY -1544009 -#define SAY_PLAYER_KILLED -1544010 -#define SAY_DEATH -1544011 - -#define EMOTE_BERSERK -1544012 -#define EMOTE_BLASTNOVA -1544013 -#define EMOTE_BEGIN -1544014 - -#define MOB_MAGTHERIDON 17257 -#define MOB_ROOM 17516 -#define MOB_CHANNELLER 17256 -#define MOB_ABYSSAL 17454 - -#define SPELL_BLASTNOVA 30616 -#define SPELL_CLEAVE 30619 -#define SPELL_QUAKE_TRIGGER 30657 // must be cast with 30561 as the proc spell -#define SPELL_QUAKE_KNOCKBACK 30571 -#define SPELL_BLAZE_TARGET 30541 // core bug, does not support target 7 -#define SPELL_BLAZE_TRAP 30542 -#define SPELL_DEBRIS_KNOCKDOWN 36449 -#define SPELL_DEBRIS_VISUAL 30632 -#define SPELL_DEBRIS_DAMAGE 30631 // core bug, does not support target 8 -#define SPELL_CAMERA_SHAKE 36455 -#define SPELL_BERSERK 27680 - -#define SPELL_SHADOW_CAGE 30168 -#define SPELL_SHADOW_GRASP 30410 -#define SPELL_SHADOW_GRASP_VISUAL 30166 -#define SPELL_MIND_EXHAUSTION 44032 //Casted by the cubes when channeling ends - -#define SPELL_SHADOW_CAGE_C 30205 -#define SPELL_SHADOW_GRASP_C 30207 - -#define SPELL_SHADOW_BOLT_VOLLEY 30510 -#define SPELL_DARK_MENDING 30528 -#define SPELL_FEAR 30530 //39176 -#define SPELL_BURNING_ABYSSAL 30511 -#define SPELL_SOUL_TRANSFER 30531 // core bug, does not support target 7 - -#define SPELL_FIRE_BLAST 37110 - -// count of clickers needed to interrupt blast nova -#define CLICKERS_COUNT 5 - -typedef std::map CubeMap; - -struct TRINITY_DLL_DECL mob_abyssalAI : public ScriptedAI -{ - mob_abyssalAI(Creature *c) : ScriptedAI(c) - { - trigger = 0; - Despawn_Timer = 60000; - } - - uint32 FireBlast_Timer; - uint32 Despawn_Timer; - uint32 trigger; - - void Reset() - { - FireBlast_Timer = 6000; - } - - void SpellHit(Unit*, const SpellEntry *spell) - { - if (trigger == 2 && spell->Id == SPELL_BLAZE_TARGET) - { - m_creature->CastSpell(m_creature, SPELL_BLAZE_TRAP, true); - m_creature->SetVisibility(VISIBILITY_OFF); - Despawn_Timer = 130000; - } - } - - void SetTrigger(uint32 _trigger) - { - trigger = _trigger; - m_creature->SetDisplayId(11686); - if (trigger == 1) //debris - { - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->CastSpell(m_creature, SPELL_DEBRIS_VISUAL, true); - FireBlast_Timer = 5000; - Despawn_Timer = 10000; - } - } - - void EnterCombat(Unit* who) {DoZoneInCombat();} - void AttackStart(Unit *who) {if (!trigger) ScriptedAI::AttackStart(who);} - void MoveInLineOfSight(Unit *who) {if (!trigger) ScriptedAI::MoveInLineOfSight(who);} - - void UpdateAI(const uint32 diff) - { - if (trigger) - { - if (trigger == 1) - { - if (FireBlast_Timer < diff) - { - m_creature->CastSpell(m_creature, SPELL_DEBRIS_DAMAGE, true); - trigger = 3; - }else FireBlast_Timer -= diff; - } - return; - } - - if (Despawn_Timer < diff) - { - m_creature->ForcedDespawn(); - }else Despawn_Timer -= diff; - - if (!UpdateVictim()) - return; - - if (FireBlast_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_FIRE_BLAST); - FireBlast_Timer = 5000+rand()%10000; - }else FireBlast_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -struct TRINITY_DLL_DECL boss_magtheridonAI : public ScriptedAI -{ - boss_magtheridonAI(Creature *c) : ScriptedAI(c) - { - pInstance =m_creature->GetInstanceData(); - m_creature->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 10); - m_creature->SetFloatValue(UNIT_FIELD_COMBATREACH, 10); - - // target 7, random target with certain entry spell, need core fix - SpellEntry *TempSpell; - TempSpell = GET_SPELL(SPELL_BLAZE_TARGET); - if (TempSpell && TempSpell->EffectImplicitTargetA[0] != 6) - { - TempSpell->EffectImplicitTargetA[0] = 6; - TempSpell->EffectImplicitTargetB[0] = 0; - } - TempSpell = GET_SPELL(SPELL_QUAKE_TRIGGER); - if (TempSpell && TempSpell->EffectTriggerSpell[0] != SPELL_QUAKE_KNOCKBACK) - { - TempSpell->EffectTriggerSpell[0] = SPELL_QUAKE_KNOCKBACK; - } - } - - CubeMap Cube; - - ScriptedInstance* pInstance; - - uint32 Berserk_Timer; - uint32 Quake_Timer; - uint32 Cleave_Timer; - uint32 BlastNova_Timer; - uint32 Blaze_Timer; - uint32 Debris_Timer; - uint32 RandChat_Timer; - - bool Phase3; - bool NeedCheckCube; - - void Reset() - { - if (pInstance) - { - pInstance->SetData(DATA_MAGTHERIDON_EVENT, NOT_STARTED); - pInstance->SetData(DATA_COLLAPSE, false); - } - - Berserk_Timer = 1320000; - Quake_Timer = 40000; - Debris_Timer = 10000; - Blaze_Timer = 10000+rand()%20000; - BlastNova_Timer = 60000; - Cleave_Timer = 15000; - RandChat_Timer = 90000; - - Phase3 = false; - NeedCheckCube = false; - - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); - m_creature->addUnitState(UNIT_STAT_STUNNED); - m_creature->CastSpell(m_creature, SPELL_SHADOW_CAGE_C, true); - } - - void SetClicker(uint64 cubeGUID, uint64 clickerGUID) - { - // to avoid multiclicks from 1 cube - if (uint64 guid = Cube[cubeGUID]) - DebuffClicker(Unit::GetUnit(*m_creature, guid)); - Cube[cubeGUID] = clickerGUID; - NeedCheckCube = true; - } - - //function to interrupt channeling and debuff clicker with mind exh(used if second person clicks with same cube or after dispeling/ending shadow grasp DoT) - void DebuffClicker(Unit *clicker) - { - if (!clicker || !clicker->isAlive()) - return; - - clicker->RemoveAurasDueToSpell(SPELL_SHADOW_GRASP); // cannot interrupt triggered spells - clicker->InterruptNonMeleeSpells(false); - clicker->CastSpell(clicker, SPELL_MIND_EXHAUSTION, true); - } - - void NeedCheckCubeStatus() - { - uint32 ClickerNum = 0; - // now checking if every clicker has debuff from manticron(it is dispelable atm rev 6110 : S) - // if not - apply mind exhaustion and delete from clicker's list - for(CubeMap::iterator i = Cube.begin(); i != Cube.end(); ++i) - { - Unit *clicker = Unit::GetUnit(*m_creature, (*i).second); - if (!clicker || !clicker->HasAura(SPELL_SHADOW_GRASP)) - { - DebuffClicker(clicker); - (*i).second = 0; - }else ClickerNum++; - } - - // if 5 clickers from other cubes apply shadow cage - if (ClickerNum >= CLICKERS_COUNT && !m_creature->HasAura(SPELL_SHADOW_CAGE)) - { - DoScriptText(SAY_BANISH, m_creature); - m_creature->CastSpell(m_creature, SPELL_SHADOW_CAGE, true); - } - else if (ClickerNum < CLICKERS_COUNT && m_creature->HasAura(SPELL_SHADOW_CAGE)) - m_creature->RemoveAurasDueToSpell(SPELL_SHADOW_CAGE); - - if (!ClickerNum) NeedCheckCube = false; - } - - void KilledUnit(Unit* victim) - { - DoScriptText(SAY_PLAYER_KILLED, m_creature); - } - - void JustDied(Unit* Killer) - { - if (pInstance) - pInstance->SetData(DATA_MAGTHERIDON_EVENT, DONE); - - DoScriptText(SAY_DEATH, m_creature); - } - - void MoveInLineOfSight(Unit* who) {} - - void AttackStart(Unit *who) - { - if (!m_creature->hasUnitState(UNIT_STAT_STUNNED)) - ScriptedAI::AttackStart(who); - } - - void EnterCombat(Unit *who) - { - if (pInstance) - pInstance->SetData(DATA_MAGTHERIDON_EVENT, IN_PROGRESS); - DoZoneInCombat(); - - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - m_creature->RemoveAurasDueToSpell(SPELL_SHADOW_CAGE_C); - - DoScriptText(SAY_FREED, m_creature); - } - - void UpdateAI(const uint32 diff) - { - if (!m_creature->isInCombat()) - { - if (RandChat_Timer < diff) - { - DoScriptText(RandomTaunt[rand()%6].id, m_creature); - RandChat_Timer = 90000; - }else RandChat_Timer -= diff; - } - - if (!UpdateVictim()) - return; - - if (NeedCheckCube) NeedCheckCubeStatus(); - - if (Berserk_Timer < diff) - { - m_creature->CastSpell(m_creature, SPELL_BERSERK, true); - DoScriptText(EMOTE_BERSERK, m_creature); - Berserk_Timer = 60000; - }else Berserk_Timer -= diff; - - if (Cleave_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_CLEAVE); - Cleave_Timer = 10000; - }else Cleave_Timer -= diff; - - if (BlastNova_Timer < diff) - { - // to avoid earthquake interruption - if (!m_creature->hasUnitState(UNIT_STAT_STUNNED)) - { - DoScriptText(EMOTE_BLASTNOVA, m_creature); - DoCast(m_creature, SPELL_BLASTNOVA); - BlastNova_Timer = 60000; - } - }else BlastNova_Timer -= diff; - - if (Quake_Timer < diff) - { - // to avoid blastnova interruption - if (!m_creature->IsNonMeleeSpellCasted(false)) - { - m_creature->CastSpell(m_creature, SPELL_QUAKE_TRIGGER, true); - Quake_Timer = 50000; - } - }else Quake_Timer -= diff; - - if (Blaze_Timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - { - float x, y, z; - target->GetPosition(x, y, z); - Creature *summon = m_creature->SummonCreature(MOB_ABYSSAL, x, y, z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); - if (summon) - { - CAST_AI(mob_abyssalAI, summon->AI())->SetTrigger(2); - m_creature->CastSpell(summon, SPELL_BLAZE_TARGET, true); - summon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - } - } - Blaze_Timer = 20000 + rand()%20000; - }else Blaze_Timer -= diff; - - if (!Phase3 && m_creature->GetHealth()*10 < m_creature->GetMaxHealth()*3 - && !m_creature->IsNonMeleeSpellCasted(false) // blast nova - && !m_creature->hasUnitState(UNIT_STAT_STUNNED)) // shadow cage and earthquake - { - Phase3 = true; - DoScriptText(SAY_CHAMBER_DESTROY, m_creature); - m_creature->CastSpell(m_creature, SPELL_CAMERA_SHAKE, true); - m_creature->CastSpell(m_creature, SPELL_DEBRIS_KNOCKDOWN, true); - - if (pInstance) - pInstance->SetData(DATA_COLLAPSE, true); - } - - if (Phase3) - { - if (Debris_Timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - { - float x, y, z; - target->GetPosition(x, y, z); - Creature *summon = m_creature->SummonCreature(MOB_ABYSSAL, x, y, z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); - if (summon) CAST_AI(mob_abyssalAI, summon->AI())->SetTrigger(1); - } - Debris_Timer = 10000; - }else Debris_Timer -= diff; - } - - DoMeleeAttackIfReady(); - } -}; - -struct TRINITY_DLL_DECL mob_hellfire_channelerAI : public ScriptedAI -{ - mob_hellfire_channelerAI(Creature *c) : ScriptedAI(c) - { - pInstance =m_creature->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - uint32 ShadowBoltVolley_Timer; - uint32 DarkMending_Timer; - uint32 Fear_Timer; - uint32 Infernal_Timer; - - uint32 Check_Timer; - - void Reset() - { - ShadowBoltVolley_Timer = 8000 + rand()%2000; - DarkMending_Timer = 10000; - Fear_Timer = 15000 + rand()%5000; - Infernal_Timer = 10000 + rand()%40000; - - Check_Timer = 5000; - - if (pInstance) - pInstance->SetData(DATA_CHANNELER_EVENT, NOT_STARTED); - - m_creature->CastSpell(m_creature, SPELL_SHADOW_GRASP_C, false); - } - - void EnterCombat(Unit *who) - { - if (pInstance) - pInstance->SetData(DATA_CHANNELER_EVENT, IN_PROGRESS); - - m_creature->InterruptNonMeleeSpells(false); - DoZoneInCombat(); - } - - void JustSummoned(Creature *summon) {summon->AI()->AttackStart(m_creature->getVictim());} - - void MoveInLineOfSight(Unit* who) {} - - void DamageTaken(Unit*, uint32 &damage) - { - if (damage >= m_creature->GetHealth()) - m_creature->CastSpell(m_creature, SPELL_SOUL_TRANSFER, true); - } - - void JustDied(Unit* who) - { - if (pInstance) - pInstance->SetData(DATA_CHANNELER_EVENT, DONE); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (ShadowBoltVolley_Timer < diff) - { - DoCast(m_creature, SPELL_SHADOW_BOLT_VOLLEY); - ShadowBoltVolley_Timer = 10000 + rand()%10000; - }else ShadowBoltVolley_Timer -= diff; - - if (DarkMending_Timer < diff) - { - if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 50) - DoCast(m_creature, SPELL_DARK_MENDING); - DarkMending_Timer = 10000 +(rand() % 10000); - }else DarkMending_Timer -= diff; - - if (Fear_Timer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1)) - DoCast(target, SPELL_FEAR); - Fear_Timer = 25000 + rand()%15000; - }else Fear_Timer -= diff; - - if (Infernal_Timer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - m_creature->CastSpell(target, SPELL_BURNING_ABYSSAL, true); - Infernal_Timer = 30000 + rand()%10000; - }else Infernal_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -//Manticron Cube -bool GOHello_go_Manticron_Cube(Player* pPlayer, GameObject* pGo) -{ - ScriptedInstance* pInstance = pGo->GetInstanceData(); - if (!pInstance) return true; - if (pInstance->GetData(DATA_MAGTHERIDON_EVENT) != IN_PROGRESS) return true; - Creature *Magtheridon =Unit::GetCreature(*pGo, pInstance->GetData64(DATA_MAGTHERIDON)); - if (!Magtheridon || !Magtheridon->isAlive()) return true; - - // if exhausted or already channeling return - if (pPlayer->HasAura(SPELL_MIND_EXHAUSTION) || pPlayer->HasAura(SPELL_SHADOW_GRASP)) - return true; - - pPlayer->InterruptNonMeleeSpells(false); - pPlayer->CastSpell(pPlayer, SPELL_SHADOW_GRASP, true); - pPlayer->CastSpell(pPlayer, SPELL_SHADOW_GRASP_VISUAL, false); - CAST_AI(boss_magtheridonAI, Magtheridon->AI())->SetClicker(pGo->GetGUID(), pPlayer->GetGUID()); - return true; -} - -CreatureAI* GetAI_boss_magtheridon(Creature* pCreature) -{ - return new boss_magtheridonAI(pCreature); -} - -CreatureAI* GetAI_mob_hellfire_channeler(Creature* pCreature) -{ - return new mob_hellfire_channelerAI(pCreature); -} - -CreatureAI* GetAI_mob_abyssalAI(Creature* pCreature) -{ - return new mob_abyssalAI(pCreature); -} - -void AddSC_boss_magtheridon() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_magtheridon"; - newscript->GetAI = &GetAI_boss_magtheridon; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_hellfire_channeler"; - newscript->GetAI = &GetAI_mob_hellfire_channeler; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="go_manticron_cube"; - newscript->pGOHello = &GOHello_go_Manticron_Cube; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_abyssal"; - newscript->GetAI = &GetAI_mob_abyssalAI; - newscript->RegisterSelf(); - -} - diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/def_magtheridons_lair.h b/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/def_magtheridons_lair.h deleted file mode 100644 index c5469acaea0..00000000000 --- a/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/def_magtheridons_lair.h +++ /dev/null @@ -1,14 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ - -#ifndef DEF_MAGTHERIDONS_LAIR_H -#define DEF_MAGTHERIDONS_LAIR_H - -#define DATA_MAGTHERIDON_EVENT 1 -#define DATA_MAGTHERIDON 3 -#define DATA_CHANNELER_EVENT 2 -#define DATA_COLLAPSE 6 -#define DATA_CHANNELER 9 -#endif - diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/instance_magtheridons_lair.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/instance_magtheridons_lair.cpp deleted file mode 100644 index eb8e9b1a961..00000000000 --- a/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/instance_magtheridons_lair.cpp +++ /dev/null @@ -1,249 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Instance_Magtheridons_Lair -SD%Complete: 100 -SDComment: -SDCategory: Hellfire Citadel, Magtheridon's lair -EndScriptData */ - -#include "precompiled.h" -#include "def_magtheridons_lair.h" - -#define SPELL_SOUL_TRANSFER 30531 // core bug, does not support target 7 -#define SPELL_BLAZE_TARGET 30541 // core bug, does not support target 7 - -#define CHAMBER_CENTER_X -15.14 -#define CHAMBER_CENTER_Y 1.8 -#define CHAMBER_CENTER_Z -0.4 - -#define MAX_ENCOUNTER 2 - -struct TRINITY_DLL_DECL instance_magtheridons_lair : public ScriptedInstance -{ - instance_magtheridons_lair(Map* pMap) : ScriptedInstance(pMap) - { - Initialize(); - } - - uint32 m_auiEncounter[MAX_ENCOUNTER]; - - uint64 MagtheridonGUID; - std::set ChannelerGUID; - uint64 DoorGUID; - std::set ColumnGUID; - - uint32 CageTimer; - uint32 RespawnTimer; - - void Initialize() - { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - - MagtheridonGUID = 0; - ChannelerGUID.clear(); - DoorGUID = 0; - ColumnGUID.clear(); - - CageTimer = 0; - RespawnTimer = 0; - } - - bool IsEncounterInProgress() const - { - for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) return true; - return false; - } - - void OnCreatureCreate(Creature* pCreature, bool add) - { - switch(pCreature->GetEntry()) - { - case 17257: - MagtheridonGUID = pCreature->GetGUID(); - break; - case 17256: - ChannelerGUID.insert(pCreature->GetGUID()); - break; - } - } - - void OnGameObjectCreate(GameObject* pGo, bool add) - { - switch(pGo->GetEntry()) - { - case 181713: - pGo->SetUInt32Value(GAMEOBJECT_FLAGS, 0); - break; - case 183847: - DoorGUID = pGo->GetGUID(); - break; - case 184653: // hall - case 184634: // six columns - case 184635: - case 184636: - case 184637: - case 184638: - case 184639: - ColumnGUID.insert(pGo->GetGUID()); - break; - } - } - - uint64 GetData64(uint32 type) - { - switch(type) - { - case DATA_MAGTHERIDON: - return MagtheridonGUID; - } - return 0; - } - - void SetData(uint32 type, uint32 data) - { - switch(type) - { - case DATA_MAGTHERIDON_EVENT: - m_auiEncounter[0] = data; - if (data == NOT_STARTED) - RespawnTimer = 10000; - if (data != IN_PROGRESS) - HandleGameObject(DoorGUID, true); - break; - case DATA_CHANNELER_EVENT: - switch(data) - { - case NOT_STARTED: // Reset all channelers once one is reset. - if (m_auiEncounter[1] != NOT_STARTED) - { - m_auiEncounter[1] = NOT_STARTED; - for(std::set::iterator i = ChannelerGUID.begin(); i != ChannelerGUID.end(); ++i) - { - if (Creature *Channeler = instance->GetCreature(*i)) - { - if (Channeler->isAlive()) - Channeler->AI()->EnterEvadeMode(); - else - Channeler->Respawn(); - } - } - CageTimer = 0; - HandleGameObject(DoorGUID, true); - }break; - case IN_PROGRESS: // Event start. - if (m_auiEncounter[1] != IN_PROGRESS) - { - m_auiEncounter[1] = IN_PROGRESS; - // Let all five channelers aggro. - for(std::set::iterator i = ChannelerGUID.begin(); i != ChannelerGUID.end(); ++i) - { - Creature *Channeler = instance->GetCreature(*i); - if (Channeler && Channeler->isAlive()) - Channeler->AI()->AttackStart(Channeler->SelectNearestTarget(999)); - } - // Release Magtheridon after two minutes. - Creature *Magtheridon = instance->GetCreature(MagtheridonGUID); - if (Magtheridon && Magtheridon->isAlive()) - { - Magtheridon->MonsterTextEmote("'s bonds begin to weaken!", 0); - CageTimer = 120000; - } - HandleGameObject(DoorGUID, false); - }break; - case DONE: // Add buff and check if all channelers are dead. - for(std::set::iterator i = ChannelerGUID.begin(); i != ChannelerGUID.end(); ++i) - { - Creature *Channeler = instance->GetCreature(*i); - if (Channeler && Channeler->isAlive()) - { - //Channeler->CastSpell(Channeler, SPELL_SOUL_TRANSFER, true); - data = IN_PROGRESS; - break; - } - }break; - } - m_auiEncounter[1] = data; - break; - case DATA_COLLAPSE: - // true - collapse / false - reset - for(std::set::iterator i = ColumnGUID.begin(); i != ColumnGUID.end(); ++i) - DoUseDoorOrButton(*i); - break; - default: - break; - } - } - - uint32 GetData(uint32 type) - { - if (type == DATA_MAGTHERIDON_EVENT) - return m_auiEncounter[0]; - return 0; - } - - void Update(uint32 diff) - { - if (CageTimer) - { - if (CageTimer <= diff) - { - Creature *Magtheridon = instance->GetCreature(MagtheridonGUID); - if (Magtheridon && Magtheridon->isAlive()) - { - Magtheridon->clearUnitState(UNIT_STAT_STUNNED); - Magtheridon->AI()->AttackStart(Magtheridon->SelectNearestTarget(999)); - } - CageTimer = 0; - }else CageTimer -= diff; - } - - if (RespawnTimer) - { - if (RespawnTimer <= diff) - { - for(std::set::iterator i = ChannelerGUID.begin(); i != ChannelerGUID.end(); ++i) - { - if (Creature *Channeler = instance->GetCreature(*i)) - { - if (Channeler->isAlive()) - Channeler->AI()->EnterEvadeMode(); - else - Channeler->Respawn(); - } - } - RespawnTimer = 0; - }else RespawnTimer -= diff; - } - } -}; - -InstanceData* GetInstanceData_instance_magtheridons_lair(Map* pMap) -{ - return new instance_magtheridons_lair(pMap); -} - -void AddSC_instance_magtheridons_lair() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_magtheridons_lair"; - newscript->GetInstanceData = &GetInstanceData_instance_magtheridons_lair; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/boss_nethekurse.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/boss_nethekurse.cpp deleted file mode 100644 index 721d1efd03c..00000000000 --- a/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/boss_nethekurse.cpp +++ /dev/null @@ -1,412 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Grand_Warlock_Nethekurse -SD%Complete: 75 -SDComment: encounter not fully completed. missing part where boss kill minions. -SDCategory: Hellfire Citadel, Shattered Halls -EndScriptData */ - -/* ContentData -boss_grand_warlock_nethekurse -mob_fel_orc_convert -mob_lesser_shadow_fissure -EndContentData */ - -#include "precompiled.h" -#include "def_shattered_halls.h" - -struct Say -{ - int32 id; -}; - -static Say PeonAttacked[]= -{ - {-1540001}, - {-1540002}, - {-1540003}, - {-1540004}, -}; -static Say PeonDies[]= -{ - {-1540005}, - {-1540006}, - {-1540007}, - {-1540008}, -}; - -#define SAY_INTRO -1540000 -#define SAY_TAUNT_1 -1540009 -#define SAY_TAUNT_2 -1540010 -#define SAY_TAUNT_3 -1540011 -#define SAY_AGGRO_1 -1540012 -#define SAY_AGGRO_2 -1540013 -#define SAY_AGGRO_3 -1540014 -#define SAY_SLAY_1 -1540015 -#define SAY_SLAY_2 -1540016 -#define SAY_DIE -1540017 - -#define SPELL_DEATH_COIL 30500 -#define SPELL_DARK_SPIN 30502 // core bug spell attack caster :D -#define SPELL_SHADOW_FISSURE 30496 // Summon the ShadowFissure NPC - -#define SPELL_SHADOW_CLEAVE 30495 -#define H_SPELL_SHADOW_SLAM 35953 - -#define SPELL_HEMORRHAGE 30478 - -#define SPELL_CONSUMPTION 30497 -#define SPELL_TEMPORARY_VISUAL 39312 // this is wrong, a temporary solution. spell consumption already has the purple visual, but doesn't display as it should - -struct TRINITY_DLL_DECL boss_grand_warlock_nethekurseAI : public ScriptedAI -{ - boss_grand_warlock_nethekurseAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - ScriptedInstance* pInstance; - bool HeroicMode; - - bool IntroOnce; - bool IsIntroEvent; - bool IsMainEvent; - bool SpinOnce; - //bool HasTaunted; - bool Phase; - - uint32 PeonEngagedCount; - uint32 PeonKilledCount; - - uint32 IntroEvent_Timer; - uint32 DeathCoil_Timer; - uint32 ShadowFissure_Timer; - uint32 Cleave_Timer; - - void Reset() - { - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - - IsIntroEvent = false; - IntroOnce = false; - IsMainEvent = false; - //HasTaunted = false; - SpinOnce = false; - Phase = false; - - PeonEngagedCount = 0; - PeonKilledCount = 0; - - IntroEvent_Timer = 90000; //how long before getting bored and kills his minions? - DeathCoil_Timer = 20000; - ShadowFissure_Timer = 8000; - Cleave_Timer = 5000; - } - - void DoYellForPeonAggro() - { - if (PeonEngagedCount >= 4) - return; - - DoScriptText(PeonAttacked[PeonEngagedCount].id, m_creature); - ++PeonEngagedCount; - } - - void DoYellForPeonDeath() - { - if (PeonKilledCount >= 4) - return; - - DoScriptText(PeonDies[PeonKilledCount].id, m_creature); - ++PeonKilledCount; - - if (PeonKilledCount == 4) - { - IsIntroEvent = false; - IsMainEvent = true; - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - } - } - - void DoTauntPeons() - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_TAUNT_1, m_creature); break; - case 1: DoScriptText(SAY_TAUNT_2, m_creature); break; - case 2: DoScriptText(SAY_TAUNT_3, m_creature); break; - } - - //TODO: kill the peons first - IsIntroEvent = false; - PeonEngagedCount = 4; - PeonKilledCount = 4; - IsMainEvent = true; - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - } - - void AttackStart(Unit* who) - { - if (IsIntroEvent || !IsMainEvent) - return; - - if (m_creature->Attack(who, true)) - { - if (Phase) DoStartNoMovement(who); - else DoStartMovement(who); - } - } - - void MoveInLineOfSight(Unit *who) - { - if (!IntroOnce && m_creature->IsWithinDistInMap(who, 50.0f)) - { - if (who->GetTypeId() != TYPEID_PLAYER) - return; - - DoScriptText(SAY_INTRO, m_creature); - IntroOnce = true; - IsIntroEvent = true; - - if (pInstance) - pInstance->SetData(TYPE_NETHEKURSE,IN_PROGRESS); - } - - if (IsIntroEvent || !IsMainEvent) - return; - - ScriptedAI::MoveInLineOfSight(who); - } - - void EnterCombat(Unit *who) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; - case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; - case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; - } - } - - void JustSummoned(Creature *summoned) - { - summoned->setFaction(16); - summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - - //triggered spell of consumption does not properly show it's SpellVisual, wrong spellid? - summoned->CastSpell(summoned,SPELL_TEMPORARY_VISUAL,true); - summoned->CastSpell(summoned,SPELL_CONSUMPTION,false,0,0,m_creature->GetGUID()); - } - - void KilledUnit(Unit* victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature); break; - case 1: DoScriptText(SAY_SLAY_2, m_creature); break; - } - } - - void JustDied(Unit* Killer) - { - DoScriptText(SAY_DIE, m_creature); - - if (!pInstance) - return; - - pInstance->SetData(TYPE_NETHEKURSE,DONE); - pInstance->HandleGameObject(pInstance->GetData64(DATA_NETHEKURSE_DOOR), true); - } - - void UpdateAI(const uint32 diff) - { - if (IsIntroEvent) - { - if (!pInstance) - return; - - if (pInstance->GetData(TYPE_NETHEKURSE) == IN_PROGRESS) - { - if (IntroEvent_Timer < diff) - { - DoTauntPeons(); - }else IntroEvent_Timer -= diff; - } - } - - if (!UpdateVictim()) - return; - - if (!IsMainEvent) - return; - - if (Phase) - { - if (!SpinOnce) - { - DoCast(m_creature->getVictim(),SPELL_DARK_SPIN); - SpinOnce = true; - } - - if (Cleave_Timer < diff) - { - DoCast(m_creature->getVictim(),(HeroicMode ? H_SPELL_SHADOW_SLAM : SPELL_SHADOW_CLEAVE)); - Cleave_Timer = 6000+rand()%2500; - }else Cleave_Timer -= diff; - } - else - { - if (ShadowFissure_Timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_SHADOW_FISSURE); - ShadowFissure_Timer = 7500+rand()%7500; - }else ShadowFissure_Timer -= diff; - - if (DeathCoil_Timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_DEATH_COIL); - DeathCoil_Timer = 15000+rand()%5000; - }else DeathCoil_Timer -= diff; - - if ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() <= 20) - Phase = true; - - DoMeleeAttackIfReady(); - } - } -}; - -struct TRINITY_DLL_DECL mob_fel_orc_convertAI : public ScriptedAI -{ - mob_fel_orc_convertAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - uint32 Hemorrhage_Timer; - - void Reset() - { - m_creature->SetNoCallAssistance(true); //we don't want any assistance (WE R HEROZ!) - Hemorrhage_Timer = 3000; - } - - void MoveInLineOfSight(Unit *who) - { - } - - void EnterCombat(Unit* who) - { - if (pInstance) - { - if (pInstance->GetData64(DATA_NETHEKURSE)) - { - Creature *pKurse = Unit::GetCreature(*m_creature,pInstance->GetData64(DATA_NETHEKURSE)); - if (pKurse && m_creature->IsWithinDist(pKurse, 45.0f)) - { - CAST_AI(boss_grand_warlock_nethekurseAI, pKurse->AI())->DoYellForPeonAggro(); - - if (pInstance->GetData(TYPE_NETHEKURSE) == IN_PROGRESS) - return; - else pInstance->SetData(TYPE_NETHEKURSE,IN_PROGRESS); - } - } - } - } - - void JustDied(Unit* Killer) - { - if (pInstance) - { - if (pInstance->GetData(TYPE_NETHEKURSE) != IN_PROGRESS) - return; - if (pInstance->GetData64(DATA_NETHEKURSE)) - { - Creature *pKurse = Unit::GetCreature(*m_creature,pInstance->GetData64(DATA_NETHEKURSE)); - if (pKurse) - CAST_AI(boss_grand_warlock_nethekurseAI, pKurse->AI())->DoYellForPeonDeath(); - } - } - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (Hemorrhage_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_HEMORRHAGE); - Hemorrhage_Timer = 15000; - }else Hemorrhage_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -//NOTE: this Creature are also summoned by other spells, for different creatures -struct TRINITY_DLL_DECL mob_lesser_shadow_fissureAI : public ScriptedAI -{ - mob_lesser_shadow_fissureAI(Creature *c) : ScriptedAI(c) {} - - void Reset() { } - void MoveInLineOfSight(Unit *who) { } - void AttackStart(Unit* who) { } - void EnterCombat(Unit* who) { } -}; - -CreatureAI* GetAI_boss_grand_warlock_nethekurse(Creature* pCreature) -{ - return new boss_grand_warlock_nethekurseAI (pCreature); -} - -CreatureAI* GetAI_mob_fel_orc_convert(Creature* pCreature) -{ - return new mob_fel_orc_convertAI (pCreature); -} - -CreatureAI* GetAI_mob_lesser_shadow_fissure(Creature* pCreature) -{ - return new mob_lesser_shadow_fissureAI (pCreature); -} - -void AddSC_boss_grand_warlock_nethekurse() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_grand_warlock_nethekurse"; - newscript->GetAI = &GetAI_boss_grand_warlock_nethekurse; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_fel_orc_convert"; - newscript->GetAI = &GetAI_mob_fel_orc_convert; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_lesser_shadow_fissure"; - newscript->GetAI = &GetAI_mob_lesser_shadow_fissure; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/boss_warbringer_omrogg.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/boss_warbringer_omrogg.cpp deleted file mode 100644 index 0681e94e2b0..00000000000 --- a/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/boss_warbringer_omrogg.cpp +++ /dev/null @@ -1,408 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Warbringer_Omrogg -SD%Complete: 85 -SDComment: Heroic enabled. Spell timing may need additional tweaks -SDCategory: Hellfire Citadel, Shattered Halls -EndScriptData */ - -/* ContentData -mob_omrogg_heads -boss_warbringer_omrogg -EndContentData */ - -#include "precompiled.h" -#include "def_shattered_halls.h" - -enum -{ - YELL_DIE_L = -1540039, - YELL_DIE_R = -1540040, - EMOTE_ENRAGE = -1540041, - - SPELL_BLAST_WAVE = 30600, - SPELL_FEAR = 30584, - SPELL_THUNDERCLAP = 30633, - - SPELL_BURNING_MAUL = 30598, - H_SPELL_BURNING_MAUL = 36056, - - NPC_LEFT_HEAD = 19523, - NPC_RIGHT_HEAD = 19524 -}; - -struct Yell -{ - int32 id; - uint32 creature; -}; - -static Yell GoCombat[]= -{ - {-1540018, NPC_LEFT_HEAD}, - {-1540019, NPC_LEFT_HEAD}, - {-1540020, NPC_LEFT_HEAD}, -}; -static Yell GoCombatDelay[]= -{ - {-1540021, NPC_RIGHT_HEAD}, - {-1540022, NPC_RIGHT_HEAD}, - {-1540023, NPC_RIGHT_HEAD}, -}; - -static Yell Threat[]= -{ - {-1540024, NPC_LEFT_HEAD}, - {-1540025, NPC_RIGHT_HEAD}, - {-1540026, NPC_LEFT_HEAD}, - {-1540027, NPC_LEFT_HEAD}, -}; -static Yell ThreatDelay1[]= -{ - {-1540028, NPC_RIGHT_HEAD}, - {-1540029, NPC_LEFT_HEAD}, - {-1540030, NPC_RIGHT_HEAD}, - {-1540031, NPC_RIGHT_HEAD}, -}; -static Yell ThreatDelay2[]= -{ - {-1540032, NPC_LEFT_HEAD}, - {-1540033, NPC_RIGHT_HEAD}, - {-1540034, NPC_LEFT_HEAD}, - {-1540035, NPC_LEFT_HEAD}, -}; - -static Yell Killing[]= -{ - {-1540036, NPC_LEFT_HEAD}, - {-1540037, NPC_RIGHT_HEAD}, -}; -static Yell KillingDelay[]= -{ - {-1540038, NPC_RIGHT_HEAD}, - {-1000000, NPC_LEFT_HEAD}, -}; - -struct TRINITY_DLL_DECL mob_omrogg_headsAI : public ScriptedAI -{ - mob_omrogg_headsAI(Creature *c) : ScriptedAI(c) {} - - bool DeathYell; - uint32 Death_Timer; - - void Reset() - { - Death_Timer = 4000; - DeathYell = false; - } - void EnterCombat(Unit* who) { } - - void DoDeathYell() - { - DeathYell = true; - } - - void UpdateAI(const uint32 diff) - { - if (!DeathYell) - return; - - if (Death_Timer < diff) - { - DoScriptText(YELL_DIE_R, m_creature); - Death_Timer = false; - m_creature->setDeathState(JUST_DIED); - }else Death_Timer -= diff; - } -}; - -struct TRINITY_DLL_DECL boss_warbringer_omroggAI : public ScriptedAI -{ - boss_warbringer_omroggAI(Creature *c) : ScriptedAI(c) - { - LeftHeadGUID = 0; - RightHeadGUID = 0; - pInstance = c->GetInstanceData(); - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - ScriptedInstance* pInstance; - bool HeroicMode; - - uint64 LeftHeadGUID; - uint64 RightHeadGUID; - int iaggro; - int ithreat; - int ikilling; - - bool AggroYell; - bool ThreatYell; - bool ThreatYell2; - bool KillingYell; - - uint32 Delay_Timer; - uint32 BlastWave_Timer; - uint32 BlastCount; - uint32 Fear_Timer; - uint32 BurningMaul_Timer; - uint32 ThunderClap_Timer; - uint32 ResetThreat_Timer; - - void Reset() - { - if (Unit* pLeftHead = Unit::GetUnit(*m_creature,LeftHeadGUID)) - { - pLeftHead->setDeathState(JUST_DIED); - LeftHeadGUID = 0; - } - - if (Unit* pRightHead = Unit::GetUnit(*m_creature,RightHeadGUID)) - { - pRightHead->setDeathState(JUST_DIED); - RightHeadGUID = 0; - } - - - AggroYell = false; - ThreatYell = false; - ThreatYell2 = false; - KillingYell = false; - - Delay_Timer = 4000; - BlastWave_Timer = 0; - BlastCount = 0; - Fear_Timer = 8000; - BurningMaul_Timer = 25000; - ThunderClap_Timer = 15000; - ResetThreat_Timer = 30000; - - if (pInstance) - pInstance->SetData(TYPE_OMROGG, NOT_STARTED); //End boss can use this later. O'mrogg must be defeated(DONE) or he will come to aid. - } - - void DoYellForThreat() - { - Unit *pLeftHead = Unit::GetUnit(*m_creature,LeftHeadGUID); - Unit *pRightHead = Unit::GetUnit(*m_creature,RightHeadGUID); - - if (!pLeftHead || !pRightHead) - return; - - ithreat = rand()%4; - - Unit *source = (pLeftHead->GetEntry() == Threat[ithreat].creature ? pLeftHead : pRightHead); - - DoScriptText(Threat[ithreat].id, source); - - Delay_Timer = 3500; - ThreatYell = true; - } - - void EnterCombat(Unit *who) - { - m_creature->SummonCreature(NPC_LEFT_HEAD, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_DEAD_DESPAWN, 0); - m_creature->SummonCreature(NPC_RIGHT_HEAD, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_DEAD_DESPAWN, 0); - - if (Unit *pLeftHead = Unit::GetUnit(*m_creature,LeftHeadGUID)) - { - iaggro = rand()%3; - - DoScriptText(GoCombat[iaggro].id, pLeftHead); - - Delay_Timer = 3500; - AggroYell = true; - } - - if (pInstance) - pInstance->SetData(TYPE_OMROGG, IN_PROGRESS); - } - - void JustSummoned(Creature *summoned) - { - if (summoned->GetEntry() == NPC_LEFT_HEAD) - LeftHeadGUID = summoned->GetGUID(); - - if (summoned->GetEntry() == NPC_RIGHT_HEAD) - RightHeadGUID = summoned->GetGUID(); - - //summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - //summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - summoned->SetVisibility(VISIBILITY_OFF); - } - - void KilledUnit(Unit* victim) - { - Unit* pLeftHead = Unit::GetUnit(*m_creature,LeftHeadGUID); - Unit* pRightHead = Unit::GetUnit(*m_creature,RightHeadGUID); - - - if (!pLeftHead || !pRightHead) - return; - - ikilling = rand()%2; - - Unit *source = (pLeftHead->GetEntry() == Killing[ikilling].creature ? pLeftHead : pRightHead); - - switch(ikilling) - { - case 0: - DoScriptText(Killing[ikilling].id, source); - Delay_Timer = 3500; - KillingYell = true; - break; - case 1: - DoScriptText(Killing[ikilling].id, source); - KillingYell = false; - break; - } - } - - void JustDied(Unit* Killer) - { - Unit* pLeftHead = Unit::GetUnit(*m_creature,LeftHeadGUID); - Unit* pRightHead = Unit::GetUnit(*m_creature,RightHeadGUID); - - if (!pLeftHead || !pRightHead) - return; - - DoScriptText(YELL_DIE_L, pLeftHead); - - CAST_AI(mob_omrogg_headsAI, CAST_CRE(pRightHead)->AI())->DoDeathYell(); - - if (pInstance) - pInstance->SetData(TYPE_OMROGG, DONE); - } - - void UpdateAI(const uint32 diff) - { - if (Delay_Timer < diff) - { - Delay_Timer = 3500; - - Unit* pLeftHead = Unit::GetUnit(*m_creature,LeftHeadGUID); - Unit* pRightHead = Unit::GetUnit(*m_creature,RightHeadGUID); - - if (!pLeftHead || !pRightHead) - return; - - if (AggroYell) - { - DoScriptText(GoCombatDelay[iaggro].id, pRightHead); - AggroYell = false; - } - - if (ThreatYell2) - { - Unit *source = (pLeftHead->GetEntry() == ThreatDelay2[ithreat].creature ? pLeftHead : pRightHead); - - DoScriptText(ThreatDelay2[ithreat].id, source); - ThreatYell2 = false; - } - - if (ThreatYell) - { - Unit *source = (pLeftHead->GetEntry() == ThreatDelay1[ithreat].creature ? pLeftHead : pRightHead); - - DoScriptText(ThreatDelay1[ithreat].id, source); - ThreatYell = false; - ThreatYell2 = true; - } - - if (KillingYell) - { - Unit *source = (pLeftHead->GetEntry() == KillingDelay[ikilling].creature ? pLeftHead : pRightHead); - - DoScriptText(KillingDelay[ikilling].id, source); - KillingYell = false; - } - }else Delay_Timer -= diff; - - if (!UpdateVictim()) - return; - - if (BlastCount && BlastWave_Timer <= diff) - { - DoCast(m_creature,SPELL_BLAST_WAVE); - BlastWave_Timer = 5000; - ++BlastCount; - - if (BlastCount == 3) - BlastCount = 0; - }else BlastWave_Timer -= diff; - - if (BurningMaul_Timer < diff) - { - DoScriptText(EMOTE_ENRAGE, m_creature); - DoCast(m_creature,HeroicMode ? H_SPELL_BURNING_MAUL : SPELL_BURNING_MAUL); - BurningMaul_Timer = 40000; - BlastWave_Timer = 16000; - BlastCount = 1; - }else BurningMaul_Timer -= diff; - - if (ResetThreat_Timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - { - DoYellForThreat(); - DoResetThreat(); - m_creature->AddThreat(target, 0.0f); - } - ResetThreat_Timer = 25000+rand()%15000; - }else ResetThreat_Timer -= diff; - - if (Fear_Timer < diff) - { - DoCast(m_creature,SPELL_FEAR); - Fear_Timer = 15000+rand()%20000; - }else Fear_Timer -= diff; - - if (ThunderClap_Timer < diff) - { - DoCast(m_creature,SPELL_THUNDERCLAP); - ThunderClap_Timer = 15000+rand()%15000; - }else ThunderClap_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_warbringer_omrogg(Creature* pCreature) -{ - return new boss_warbringer_omroggAI (pCreature); -} - -CreatureAI* GetAI_mob_omrogg_heads(Creature* pCreature) -{ - return new mob_omrogg_headsAI (pCreature); -} - -void AddSC_boss_warbringer_omrogg() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_warbringer_omrogg"; - newscript->GetAI = &GetAI_boss_warbringer_omrogg; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_omrogg_heads"; - newscript->GetAI = &GetAI_mob_omrogg_heads; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/boss_warchief_kargath_bladefist.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/boss_warchief_kargath_bladefist.cpp deleted file mode 100644 index 4fa673f3560..00000000000 --- a/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/boss_warchief_kargath_bladefist.cpp +++ /dev/null @@ -1,303 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Warchief_Kargath_Bladefist -SD%Complete: 90 -SDComment: -SDCategory: Hellfire Citadel, Shattered Halls -EndScriptData */ - -/* ContentData -boss_warchief_kargath_bladefist -EndContentData */ - -#include "precompiled.h" - -#define SAY_AGGRO1 -1540042 -#define SAY_AGGRO2 -1540043 -#define SAY_AGGRO3 -1540044 -#define SAY_SLAY1 -1540045 -#define SAY_SLAY2 -1540046 -#define SAY_DEATH -1540047 - -#define SPELL_BLADE_DANCE 30739 -#define H_SPELL_CHARGE 25821 - -#define TARGET_NUM 5 - -#define MOB_SHATTERED_ASSASSIN 17695 -#define MOB_HEARTHEN_GUARD 17621 -#define MOB_SHARPSHOOTER_GUARD 17622 -#define MOB_REAVER_GUARD 17623 - -float AssassEntrance[3] = {275.136,-84.29,2.3}; // y -8 -float AssassExit[3] = {184.233,-84.29,2.3}; // y -8 -float AddsEntrance[3] = {306.036,-84.29,1.93}; - -struct TRINITY_DLL_DECL boss_warchief_kargath_bladefistAI : public ScriptedAI -{ - boss_warchief_kargath_bladefistAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - ScriptedInstance* pInstance; - bool HeroicMode; - - std::vector adds; - std::vector assassins; - - uint32 Charge_timer; - uint32 Blade_Dance_Timer; - uint32 Summon_Assistant_Timer; - uint32 resetcheck_timer; - uint32 Wait_Timer; - - uint32 Assassins_Timer; - - uint32 summoned; - bool InBlade; - - uint32 target_num; - - void Reset() - { - removeAdds(); - - m_creature->SetSpeed(MOVE_RUN,2); - m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - - summoned = 2; - InBlade = false; - Wait_Timer = 0; - - Charge_timer = 0; - Blade_Dance_Timer = 45000; - Summon_Assistant_Timer = 30000; - Assassins_Timer = 5000; - resetcheck_timer = 5000; - } - - void EnterCombat(Unit *who) - { - switch (rand()%3) - { - case 0:DoScriptText(SAY_AGGRO1, m_creature);break; - case 1:DoScriptText(SAY_AGGRO2, m_creature);break; - case 2:DoScriptText(SAY_AGGRO3, m_creature);break; - } - } - - void JustSummoned(Creature *summoned) - { - switch(summoned->GetEntry()) - { - case MOB_HEARTHEN_GUARD: - case MOB_SHARPSHOOTER_GUARD: - case MOB_REAVER_GUARD: - summoned->AI()->AttackStart(SelectUnit(SELECT_TARGET_RANDOM,0)); - adds.push_back(summoned->GetGUID()); - break; - case MOB_SHATTERED_ASSASSIN: - assassins.push_back(summoned->GetGUID()); - break; - } - } - - void KilledUnit(Unit *victim) - { - if (victim->GetTypeId() == TYPEID_PLAYER) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; - } - } - } - - void JustDied(Unit* Killer) - { - DoScriptText(SAY_DEATH, m_creature); - removeAdds(); - } - - void MovementInform(uint32 type, uint32 id) - { - if (InBlade) - { - if (type != POINT_MOTION_TYPE) - return; - - if (id != 1) - return; - - if (target_num > 0) // to prevent loops - { - Wait_Timer = 1; - DoCast(m_creature,SPELL_BLADE_DANCE,true); - target_num--; - } - } - } - - void removeAdds() - { - for(std::vector::iterator itr = adds.begin(); itr!= adds.end(); ++itr) - { - Unit* temp = Unit::GetUnit((*m_creature),*itr); - if (temp && temp->isAlive()) - { - (*temp).GetMotionMaster()->Clear(true); - m_creature->DealDamage(temp,temp->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - CAST_CRE(temp)->RemoveCorpse(); - } - } - adds.clear(); - - for(std::vector::iterator itr = assassins.begin(); itr!= assassins.end(); ++itr) - { - Unit* temp = Unit::GetUnit((*m_creature),*itr); - if (temp && temp->isAlive()) - { - (*temp).GetMotionMaster()->Clear(true); - m_creature->DealDamage(temp,temp->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - CAST_CRE(temp)->RemoveCorpse(); - } - } - assassins.clear(); - } - void SpawnAssassin() - { - m_creature->SummonCreature(MOB_SHATTERED_ASSASSIN,AssassEntrance[0],AssassEntrance[1]+8, AssassEntrance[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); - m_creature->SummonCreature(MOB_SHATTERED_ASSASSIN,AssassEntrance[0],AssassEntrance[1]-8, AssassEntrance[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); - m_creature->SummonCreature(MOB_SHATTERED_ASSASSIN,AssassExit[0],AssassExit[1]+8, AssassExit[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); - m_creature->SummonCreature(MOB_SHATTERED_ASSASSIN,AssassExit[0],AssassExit[1]-8, AssassExit[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - if (Assassins_Timer) - if (Assassins_Timer < diff) - { - SpawnAssassin(); - Assassins_Timer = 0; - }else Assassins_Timer -= diff; - - if (InBlade) - { - if (Wait_Timer) - if (Wait_Timer < diff) - { - if (target_num <= 0) - { - // stop bladedance - InBlade = false; - m_creature->SetSpeed(MOVE_RUN,2); - (*m_creature).GetMotionMaster()->MoveChase(m_creature->getVictim()); - Blade_Dance_Timer = 30000; - Wait_Timer = 0; - if (HeroicMode) - Charge_timer = 5000; - } - else - { - //move in bladedance - float x,y,randx,randy; - randx = (rand()%40); - randy = (rand()%40); - x = 210+ randx ; - y = -60- randy ; - (*m_creature).GetMotionMaster()->MovePoint(1,x,y,m_creature->GetPositionZ()); - Wait_Timer = 0; - } - }else Wait_Timer -= diff; - } - else - { - if (Blade_Dance_Timer) - if (Blade_Dance_Timer < diff) - { - target_num = TARGET_NUM; - Wait_Timer = 1; - InBlade = true; - Blade_Dance_Timer = 0; - m_creature->SetSpeed(MOVE_RUN,4); - return; - }else Blade_Dance_Timer -= diff; - - if (Charge_timer) - if (Charge_timer < diff) - { - DoCast(SelectUnit(SELECT_TARGET_RANDOM,0),H_SPELL_CHARGE); - Charge_timer = 0; - }else Charge_timer -= diff; - - if (Summon_Assistant_Timer < diff) - { - Unit* target = NULL; - - for(uint8 i = 0; i < summoned; ++i) - { - switch(rand()%3) - { - case 0: m_creature->SummonCreature(MOB_HEARTHEN_GUARD,AddsEntrance[0],AddsEntrance[1], AddsEntrance[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); break; - case 1: m_creature->SummonCreature(MOB_SHARPSHOOTER_GUARD,AddsEntrance[0],AddsEntrance[1], AddsEntrance[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); break; - case 2: m_creature->SummonCreature(MOB_REAVER_GUARD,AddsEntrance[0],AddsEntrance[1], AddsEntrance[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); break; - } - } - if (rand()%100 < 20) summoned++; - Summon_Assistant_Timer = 25000 + (rand()%10000) ; - }else Summon_Assistant_Timer -= diff; - - DoMeleeAttackIfReady(); - } - - if (resetcheck_timer < diff) - { - uint32 tempx,tempy; - tempx = uint32(m_creature->GetPositionX()); - tempy = uint32(m_creature->GetPositionY()); - if (tempx > 255 || tempx < 205) - { - EnterEvadeMode(); - return; - } - resetcheck_timer = 5000; - }else resetcheck_timer -= diff; - } -}; - -CreatureAI* GetAI_boss_warchief_kargath_bladefist(Creature* pCreature) -{ - return new boss_warchief_kargath_bladefistAI (pCreature); -} - -void AddSC_boss_warchief_kargath_bladefist() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_warchief_kargath_bladefist"; - newscript->GetAI = &GetAI_boss_warchief_kargath_bladefist; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/def_shattered_halls.h b/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/def_shattered_halls.h deleted file mode 100644 index cbfa23ec4e0..00000000000 --- a/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/def_shattered_halls.h +++ /dev/null @@ -1,14 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ - -#ifndef DEF_SHATTERED_H -#define DEF_SHATTERED_H - -#define TYPE_NETHEKURSE 1 -#define DATA_NETHEKURSE 2 -#define DATA_NETHEKURSE_DOOR 3 - -#define TYPE_OMROGG 4 -#endif - diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/instance_shattered_halls.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/instance_shattered_halls.cpp deleted file mode 100644 index 864a49a84ba..00000000000 --- a/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/instance_shattered_halls.cpp +++ /dev/null @@ -1,114 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Instance_Shattered_Halls -SD%Complete: 50 -SDComment: currently missing info about door. instance not complete -SDCategory: Hellfire Citadel, Shattered Halls -EndScriptData */ - -#include "precompiled.h" -#include "def_shattered_halls.h" - -#define MAX_ENCOUNTER 2 - -#define DOOR_NETHEKURSE 1 - -struct TRINITY_DLL_DECL instance_shattered_halls : public ScriptedInstance -{ - instance_shattered_halls(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; - - uint32 m_auiEncounter[MAX_ENCOUNTER]; - uint64 nethekurseGUID; - uint64 nethekurseDoorGUID; - - void Initialize() - { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - - nethekurseGUID = 0; - nethekurseDoorGUID = 0; - } - - void OnGameObjectCreate(GameObject* pGo, bool add) - { - switch(pGo->GetEntry()) - { - case DOOR_NETHEKURSE: nethekurseDoorGUID = pGo->GetGUID(); break; - } - } - - void OnCreatureCreate(Creature* pCreature, bool add) - { - switch(pCreature->GetEntry()) - { - case 16807: nethekurseGUID = pCreature->GetGUID(); break; - } - } - - void SetData(uint32 type, uint32 data) - { - switch(type) - { - case TYPE_NETHEKURSE: - m_auiEncounter[0] = data; - break; - case TYPE_OMROGG: - m_auiEncounter[1] = data; - break; - } - } - - uint32 GetData(uint32 type) - { - switch(type) - { - case TYPE_NETHEKURSE: - return m_auiEncounter[0]; - case TYPE_OMROGG: - return m_auiEncounter[1]; - } - return 0; - } - - uint64 GetData64(uint32 data) - { - switch(data) - { - case DATA_NETHEKURSE: - return nethekurseGUID; - case DATA_NETHEKURSE_DOOR: - return nethekurseDoorGUID; - } - return 0; - } -}; - -InstanceData* GetInstanceData_instance_shattered_halls(Map* pMap) -{ - return new instance_shattered_halls(pMap); -} - -void AddSC_instance_shattered_halls() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_shattered_halls"; - newscript->GetInstanceData = &GetInstanceData_instance_shattered_halls; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_anubrekhan.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_anubrekhan.cpp deleted file mode 100644 index 835a5bfa2da..00000000000 --- a/src/bindings/scripts/scripts/zone/naxxramas/boss_anubrekhan.cpp +++ /dev/null @@ -1,123 +0,0 @@ -/* Copyright (C) 2008 - 2009 Trinity - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include "precompiled.h" -#include "def_naxxramas.h" - -#define SAY_GREET RAND(-1533000,-1533004,-1533005,-1533006,-1533007) -#define SAY_AGGRO RAND(-1533001,-1533002,-1533003) -#define SAY_SLAY -1533008 - -#define SPELL_IMPALE HEROIC(28783,56090) -#define SPELL_LOCUSTSWARM HEROIC(28785,54021) - -#define SPELL_SELF_SPAWN_5 29105 //This spawns 5 corpse scarabs ontop of us (most likely the player casts this on death) - -#define EVENT_IMPALE 1 -#define EVENT_LOCUST 2 - -#define MOB_CRYPT_GUARD 16573 - -struct TRINITY_DLL_DECL boss_anubrekhanAI : public BossAI -{ - boss_anubrekhanAI(Creature *c) : BossAI(c, BOSS_ANUBREKHAN) { HasTaunted = false; } - - bool HasTaunted; - - void Prepare() - { - HasTaunted = false; - DoSpawnCreature(MOB_CRYPT_GUARD, 0, 10, 0, me->GetOrientation(), TEMPSUMMON_CORPSE_TIMED_DESPAWN, 60000); - if (HeroicMode) - DoSpawnCreature(MOB_CRYPT_GUARD, 0, -10, 0, me->GetOrientation(), TEMPSUMMON_CORPSE_TIMED_DESPAWN, 60000); - } - - void InitializeAI() { Prepare(); } - void JustReachedHome() { Prepare(); _JustReachedHome(); } - - void KilledUnit(Unit* victim) - { - //Force the player to spawn corpse scarabs via spell - victim->CastSpell(victim, SPELL_SELF_SPAWN_5, true, NULL, NULL, me->GetGUID()); - - if (!(rand()%5)) - DoScriptText(SAY_SLAY, me); - } - - void EnterCombat(Unit *who) - { - _EnterCombat(); - DoScriptText(SAY_AGGRO, me); - events.ScheduleEvent(EVENT_IMPALE, 15000, 1); - events.ScheduleEvent(EVENT_LOCUST, 80000 + rand()%40000, 1); - } - - void MoveInLineOfSight(Unit *who) - { - if (!HasTaunted && me->IsWithinDistInMap(who, 60.0f)) - { - DoScriptText(SAY_GREET, me); - HasTaunted = true; - } - ScriptedAI::MoveInLineOfSight(who); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim() || !CheckInRoom()) - return; - - events.Update(diff); - - while(uint32 eventId = events.ExecuteEvent()) - { - switch(eventId) - { - case EVENT_IMPALE: - //Cast Impale on a random target - //Do NOT cast it when we are afflicted by locust swarm - if (!me->HasAura(SPELL_LOCUSTSWARM)) - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - DoCast(target, SPELL_IMPALE); - events.ScheduleEvent(EVENT_IMPALE, 15000, 1); - events.DelayEvents(1500, 1); - return; - case EVENT_LOCUST: - DoCast(m_creature, SPELL_LOCUSTSWARM); - DoSpawnCreature(MOB_CRYPT_GUARD, 5, 5, 0, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 60000); - events.ScheduleEvent(EVENT_LOCUST, 90000, 1); - return; - } - } - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_anubrekhan(Creature* pCreature) -{ - return new boss_anubrekhanAI (pCreature); -} - -void AddSC_boss_anubrekhan() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_anubrekhan"; - newscript->GetAI = &GetAI_boss_anubrekhan; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_faerlina.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_faerlina.cpp deleted file mode 100644 index 4be8f839e3d..00000000000 --- a/src/bindings/scripts/scripts/zone/naxxramas/boss_faerlina.cpp +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Copyright (C) 2008 - 2009 Trinity - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include "precompiled.h" -#include "def_naxxramas.h" - -#define SAY_GREET -1533009 -#define SAY_AGGRO RAND(-1533010,-1533011,-1533012,-1533013) -#define SAY_SLAY RAND(-1533014,-1533015) -#define SAY_DEATH -1533016 - -//#define SOUND_RANDOM_AGGRO 8955 //soundId containing the 4 aggro sounds, we not using this - -#define SPELL_POSION_BOLT_VOLLEY HEROIC(28796,54098) -#define SPELL_RAIN_OF_FIRE HEROIC(28794,54099) -#define SPELL_FRENZY HEROIC(28798,54100) -#define SPELL_WIDOWS_EMBRACE HEROIC(28732,54097) - -enum Events -{ - EVENT_POSION = 1, - EVENT_FIRE, - EVENT_FRENZY, -}; - -struct TRINITY_DLL_DECL boss_faerlinaAI : public BossAI -{ - boss_faerlinaAI(Creature *c) : BossAI(c, BOSS_FAERLINA), greet(false) {} - - bool greet; - - void EnterCombat(Unit *who) - { - _EnterCombat(); - DoScriptText(SAY_AGGRO, me); - events.ScheduleEvent(EVENT_POSION, 10000 + rand()%15000); - events.ScheduleEvent(EVENT_FIRE, 5000 + rand()%15000); - events.ScheduleEvent(EVENT_FRENZY, 60000 + rand()%20000); - } - - void MoveInLineOfSight(Unit *who) - { - if (!greet) - { - DoScriptText(SAY_GREET, me); - greet = true; - } - BossAI::MoveInLineOfSight(who); - } - - void KilledUnit(Unit* victim) - { - if (!(rand()%3)) - DoScriptText(SAY_SLAY, me); - } - - void JustDied(Unit* Killer) - { - _JustDied(); - DoScriptText(SAY_DEATH, me); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - events.Update(diff); - - while(uint32 eventId = events.ExecuteEvent()) - { - switch(eventId) - { - case EVENT_POSION: - if (!me->HasAura(SPELL_WIDOWS_EMBRACE)) - DoCastAOE(SPELL_POSION_BOLT_VOLLEY); - events.ScheduleEvent(EVENT_POSION, 10000 + rand()%15000); - return; - case EVENT_FIRE: - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - DoCast(target, SPELL_RAIN_OF_FIRE); - events.ScheduleEvent(EVENT_FIRE, 5000 + rand()%15000); - return; - case EVENT_FRENZY: - DoCast(me,SPELL_FRENZY); - events.ScheduleEvent(EVENT_FRENZY, 60000 + rand()%20000); - return; - } - } - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_faerlina(Creature* pCreature) -{ - return new boss_faerlinaAI (pCreature); -} - -void AddSC_boss_faerlina() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_faerlina"; - newscript->GetAI = &GetAI_boss_faerlina; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_four_horsemen.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_four_horsemen.cpp deleted file mode 100644 index 467f5ef62e9..00000000000 --- a/src/bindings/scripts/scripts/zone/naxxramas/boss_four_horsemen.cpp +++ /dev/null @@ -1,167 +0,0 @@ -/* Copyright (C) 2008 - 2009 Trinity - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include "precompiled.h" -#include "def_naxxramas.h" - -enum Horsemen -{ - HORSEMEN_THANE, - HORSEMEN_LADY, - HORSEMEN_BARON, - HORSEMEN_SIR, -}; - -enum Events -{ - EVENT_MARK = 1, - EVENT_CAST, - EVENT_BERSERK, -}; - -const uint32 MOB_HORSEMEN[] = {16064, 16065, 30549, 16063}; -const uint32 SPELL_MARK[] = {28832, 28833, 28834, 28835}; -#define SPELL_PRIMARY(i) HEROIC(SPELL_PRIMARY_N[i],SPELL_PRIMARY_H[i]) -const uint32 SPELL_PRIMARY_N[] = {28884, 28863, 28882, 28883}; -const uint32 SPELL_PRIMARY_H[] = {57467, 57463, 57369, 57466}; -#define SPELL_SECONDARY(i) HEROIC(SPELL_SECONDARY_N[i],SPELL_SECONDARY_H[i]) -const uint32 SPELL_SECONDARY_N[]= {0, 57374, 0, 57376}; -const uint32 SPELL_SECONDARY_H[]= {0, 57464, 0, 57465}; -const uint32 SPELL_PUNISH[] = {0, 57381, 0, 57377}; -#define SPELL_BERSERK 26662 - -const int32 SAY_AGGRO[] = {-1533051, -1533044, -1533065, -1533058}; -const int32 SAY_TAUNT[3][4] ={ {-1533052, -1533045, -1533071, -1533059}, - {-1533053, -1533046, -1533072, -1533060}, - {-1533054, -1533047, -1533073, -1533061},}; -const int32 SAY_SPECIAL[] = {-1533055, -1533048, -1533070, -1533062}; -const int32 SAY_SLAY[] = {-1533056, -1533049, -1533068, -1533063}; -const int32 SAY_DEATH[] = {-1533057, -1533050, -1533074, -1533064}; - -#define SAY_BARON_AGGRO RAND(-1533065,-1533066,-1533067) -#define SAY_BARON_SLAY RAND(-1533068,-1533069) - -struct TRINITY_DLL_DECL boss_four_horsemenAI : public BossAI -{ - boss_four_horsemenAI(Creature *c) : BossAI(c, BOSS_HORSEMEN) - { - id = Horsemen(0); - for(uint8 i = 1; i < 4; ++i) - if (me->GetEntry() == MOB_HORSEMEN[i]) - id = Horsemen(i); - caster = (id == HORSEMEN_LADY || id == HORSEMEN_SIR); - } - - Horsemen id; - bool caster; - - void MoveInLineOfSight(Unit *who) - { - BossAI::MoveInLineOfSight(who); - if (caster) - SelectNearestTarget(who); - } - - void AttackStart(Unit *who) - { - if (caster) - AttackStartCaster(who, 20); - else - BossAI::AttackStart(who); - } - - void KilledUnit(Unit* victim) - { - if (!(rand()%5)) - { - if (id == HORSEMEN_BARON) - DoScriptText(SAY_BARON_SLAY, me); - else - DoScriptText(SAY_SLAY[id], me); - } - } - - void JustDied(Unit* killer) - { - _JustDied(); - DoScriptText(SAY_DEATH[id], me); - } - - void EnterCombat(Unit *who) - { - _EnterCombat(); - if (id == HORSEMEN_BARON) - DoScriptText(SAY_BARON_AGGRO, me); - else - DoScriptText(SAY_AGGRO[id], me); - events.ScheduleEvent(EVENT_MARK, 15000); - events.ScheduleEvent(EVENT_CAST, 20000+rand()%5000); - events.ScheduleEvent(EVENT_BERSERK, 15*100*1000); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim() || !CheckInRoom()) - return; - - events.Update(diff); - - if (me->hasUnitState(UNIT_STAT_CASTING)) - return; - - while(uint32 eventId = events.ExecuteEvent()) - { - switch(eventId) - { - case EVENT_MARK: - if (!(rand()%5)) - DoScriptText(SAY_SPECIAL[id], me); - DoCastAOE(SPELL_MARK[id]); - events.ScheduleEvent(EVENT_MARK, 15000); - return; - case EVENT_CAST: - if (!(rand()%5)) - DoScriptText(SAY_TAUNT[rand()%3][id], me); - DoCast(SPELL_PRIMARY(id)); - events.ScheduleEvent(EVENT_CAST, 15000); - return; - case EVENT_BERSERK: - DoScriptText(SAY_SPECIAL[id], me); - DoCast(me, EVENT_BERSERK); - return; - } - } - - if (!caster) - DoMeleeAttackIfReady(); - else if (!DoSpellAttackIfReady(SPELL_SECONDARY(id))) - DoCastAOE(SPELL_PUNISH[id]); - } -}; - -CreatureAI* GetAI_four_horsemen(Creature* pCreature) -{ - return new boss_four_horsemenAI (pCreature); -} - -void AddSC_boss_four_horsemen() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_four_horsemen"; - newscript->GetAI = &GetAI_four_horsemen; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_gluth.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_gluth.cpp deleted file mode 100644 index a92c34a019c..00000000000 --- a/src/bindings/scripts/scripts/zone/naxxramas/boss_gluth.cpp +++ /dev/null @@ -1,160 +0,0 @@ -/* Copyright (C) 2008 - 2009 Trinity - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include "precompiled.h" -#include "def_naxxramas.h" - -#define SPELL_MORTAL_WOUND 25646 -#define SPELL_ENRAGE HEROIC(28371,54427) -#define SPELL_DECIMATE HEROIC(28374,54426) -#define SPELL_BERSERK 26662 -#define SPELL_INFECTED_WOUND 29306 - -#define MOB_ZOMBIE 16360 - -const float PosSummon[3][4] = -{ - {3267.9, -3172.1, 297.42, 0.94}, - {3253.2, -3132.3, 297.42, 0}, - {3308.3, -3185.8, 297.42, 1.58}, -}; - -enum Events -{ - EVENT_WOUND = 1, - EVENT_ENRAGE, - EVENT_DECIMATE, - EVENT_BERSERK, - EVENT_SUMMON, -}; - -struct TRINITY_DLL_DECL boss_gluthAI : public BossAI -{ - boss_gluthAI(Creature *c) : BossAI(c, BOSS_GLUTH) - { - // Do not let Gluth be affected by zombies' debuff - me->ApplySpellImmune(0, IMMUNITY_ID, SPELL_INFECTED_WOUND, true); - } - - std::vector triggers; - - void Reset() - { - triggers.clear(); - _Reset(); - } - - void MoveInLineOfSight(Unit *who) - { - if (who->GetEntry() == MOB_ZOMBIE && me->IsWithinDistInMap(who, 20)) - { - SetGazeOn(who); - me->MonsterTextEmote(" spots a nearby zombie to devour!", 0, true); - } - else - BossAI::MoveInLineOfSight(who); - } - - void EnterCombat(Unit *who) - { - for(uint32 i = 0; i < 3; ++i) - if (Creature *trigger = DoSummon(WORLD_TRIGGER, PosSummon[i])) - triggers.push_back(trigger); - if (triggers.size() < 3) - { - error_log("Script Gluth: cannot summon triggers!"); - EnterEvadeMode(); - return; - } - - _EnterCombat(); - events.ScheduleEvent(EVENT_WOUND, 10000); - events.ScheduleEvent(EVENT_ENRAGE, 30000); - events.ScheduleEvent(EVENT_DECIMATE, 105000); - events.ScheduleEvent(EVENT_BERSERK, 8*60000); - events.ScheduleEvent(EVENT_SUMMON, 10000); - } - - void JustSummoned(Creature *summon) - { - if (summon->GetEntry() == WORLD_TRIGGER) - summon->setActive(true); - else if (summon->GetEntry() == MOB_ZOMBIE) - summon->AI()->AttackStart(me); - summons.Summon(summon); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictimWithGaze() || !CheckInRoom()) - return; - - events.Update(diff); - - while(uint32 eventId = events.ExecuteEvent()) - { - switch(eventId) - { - case EVENT_WOUND: - DoCast(me->getVictim(), SPELL_MORTAL_WOUND); - events.ScheduleEvent(EVENT_WOUND, 10000); - return; - case EVENT_ENRAGE: - DoCast(me, SPELL_ENRAGE); - events.ScheduleEvent(EVENT_ENRAGE, 30000); - return; - case EVENT_DECIMATE: - DoCastAOE(SPELL_DECIMATE); - events.ScheduleEvent(EVENT_DECIMATE, 105000); - return; - case EVENT_BERSERK: - DoCast(me, SPELL_BERSERK); - return; - case EVENT_SUMMON: - for(uint32 i = 0; i < HEROIC(1,2); ++i) - DoSummon(MOB_ZOMBIE, triggers[rand()%3]); - events.ScheduleEvent(EVENT_SUMMON, 10000); - return; - } - } - - if (me->getVictim()->GetEntry() == MOB_ZOMBIE) - { - if (me->IsWithinMeleeRange(me->getVictim())) - { - me->Kill(me->getVictim()); - me->ModifyHealth(me->GetMaxHealth() * 0.05f); - } - } - else - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_gluth(Creature* pCreature) -{ - return new boss_gluthAI (pCreature); -} - -void AddSC_boss_gluth() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_gluth"; - newscript->GetAI = &GetAI_boss_gluth; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_gothik.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_gothik.cpp deleted file mode 100644 index f98e7667e6e..00000000000 --- a/src/bindings/scripts/scripts/zone/naxxramas/boss_gothik.cpp +++ /dev/null @@ -1,347 +0,0 @@ -/* Copyright (C) 2008 - 2009 Trinity - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include "precompiled.h" -#include "def_naxxramas.h" - -#define SAY_SPEECH -1533040 -#define SAY_KILL -1533041 -#define SAY_DEATH -1533042 -#define SAY_TELEPORT -1533043 - -//Gothik -#define SPELL_HARVEST_SOUL 28679 -#define SPELL_SHADOW_BOLT HEROIC(29317,56405) - -#define SPELL_INFORM_LIVE_TRAINEE 27892 -#define SPELL_INFORM_LIVE_KNIGHT 27928 -#define SPELL_INFORM_LIVE_RIDER 27935 -#define SPELL_INFORM_DEAD_TRAINEE 27915 -#define SPELL_INFORM_DEAD_KNIGHT 27931 -#define SPELL_INFORM_DEAD_RIDER 27937 - -#define MOB_LIVE_TRAINEE 16124 -#define MOB_LIVE_KNIGHT 16125 -#define MOB_LIVE_RIDER 16126 -#define MOB_DEAD_TRAINEE 16127 -#define MOB_DEAD_KNIGHT 16148 -#define MOB_DEAD_RIDER 16150 -#define MOB_DEAD_HORSE 16149 - -const struct Waves { uint32 entry, number, time; } -waves[] = -{ - {MOB_LIVE_TRAINEE, 2, 20000}, - {MOB_LIVE_TRAINEE, 2, 20000}, - {MOB_LIVE_TRAINEE, 2, 10000}, - {MOB_LIVE_KNIGHT, 1, 10000}, - {MOB_LIVE_TRAINEE, 2, 15000}, - {MOB_LIVE_KNIGHT, 1, 10000}, - {MOB_LIVE_TRAINEE, 2, 15000}, - {MOB_LIVE_TRAINEE, 2, 0}, - {MOB_LIVE_KNIGHT, 1, 10000}, - {MOB_LIVE_RIDER, 1, 10000}, - {MOB_LIVE_TRAINEE, 2, 5000}, - {MOB_LIVE_KNIGHT, 1, 15000}, - {MOB_LIVE_TRAINEE, 2, 0}, - {MOB_LIVE_RIDER, 1, 10000}, - {MOB_LIVE_KNIGHT, 2, 10000}, - {MOB_LIVE_TRAINEE, 2, 10000}, - {MOB_LIVE_RIDER, 1, 5000}, - {MOB_LIVE_KNIGHT, 1, 5000}, - {MOB_LIVE_TRAINEE, 2, 20000}, - {MOB_LIVE_TRAINEE, 2, 0}, - {MOB_LIVE_KNIGHT, 1, 0}, - {MOB_LIVE_RIDER, 1, 15000}, - {MOB_LIVE_TRAINEE, 2, 29000}, - {0, 0, 0}, -}; - -#define POS_Y_GATE -3360.78f - -enum Events -{ - EVENT_SUMMON = 1, - EVENT_HARVEST, - EVENT_BOLT, -}; - -#define POS_LIVE 3 -#define POS_DEAD 5 - -const float PosSummonLive[POS_LIVE][4] = -{ - {2669.7, -3430.9, 268.56, 1.6}, - {2692.0, -3430.9, 268.56, 1.6}, - {2714.1, -3430.9, 268.56, 1.6}, -}; - -const float PosSummonDead[POS_DEAD][4] = -{ - {2725.1, -3310.0, 268.85, 3.4}, - {2699.3, -3322.8, 268.60, 3.3}, - {2733.1, -3348.5, 268.84, 3.1}, - {2682.8, -3304.2, 268.85, 3.9}, - {2664.8, -3340.7, 268.23, 3.7}, -}; - -const float PosGround[4] = {2691.2, -3362.7, 267.68, 1.7}; -const float PosPlatform[4] = {2640.5, -3360.6, 285.26, 0}; - -struct TRINITY_DLL_DECL boss_gothikAI : public BossAI -{ - boss_gothikAI(Creature *c) : BossAI(c, BOSS_GOTHIK) {} - - uint32 waveCount; - std::vector liveTrigger; - std::vector deadTrigger; - - void Reset() - { - liveTrigger.clear(); - deadTrigger.clear(); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); - me->SetReactState(REACT_PASSIVE); - _Reset(); - } - - void EnterCombat(Unit *who) - { - for(uint32 i = 0; i < POS_LIVE; ++i) - if (Creature *trigger = DoSummon(WORLD_TRIGGER, PosSummonLive[i])) - liveTrigger.push_back(trigger); - for(uint32 i = 0; i < POS_DEAD; ++i) - if (Creature *trigger = DoSummon(WORLD_TRIGGER, PosSummonDead[i])) - deadTrigger.push_back(trigger); - - if (liveTrigger.size() < POS_LIVE || deadTrigger.size() < POS_DEAD) - { - error_log("Script Gothik: cannot summon triggers!"); - EnterEvadeMode(); - return; - } - - _EnterCombat(); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); - waveCount = 0; - events.ScheduleEvent(EVENT_SUMMON, 30000); - DoTeleportTo(PosPlatform); - DoScriptText(SAY_SPEECH, me); - if (instance) - instance->SetData(DATA_GOTHIK_GATE, 1); - } - - void JustSummoned(Creature *summon) - { - if (summon->GetEntry() == WORLD_TRIGGER) - summon->setActive(true); - else - { - summon->AI()->DoAction(me->HasReactState(REACT_PASSIVE) ? 1 : 0); - summon->AI()->EnterEvadeMode(); - } - summons.Summon(summon); - } - - void KilledUnit(Unit* victim) - { - if (!(rand()%5)) - DoScriptText(SAY_KILL, me); - } - - void JustDied(Unit* Killer) - { - _JustDied(); - DoScriptText(SAY_DEATH, me); - } - - void SpellHit(Unit *caster, const SpellEntry *spell) - { - uint32 spellId = 0; - switch(spell->Id) - { - case SPELL_INFORM_LIVE_TRAINEE: spellId = SPELL_INFORM_DEAD_TRAINEE; break; - case SPELL_INFORM_LIVE_KNIGHT: spellId = SPELL_INFORM_DEAD_KNIGHT; break; - case SPELL_INFORM_LIVE_RIDER: spellId = SPELL_INFORM_DEAD_RIDER; break; - } - if (spellId && me->isInCombat()) - { - me->HandleEmoteCommand(EMOTE_ONESHOT_SPELLCAST); - me->CastSpell(deadTrigger[rand()%POS_DEAD], spellId, true); - } - } - - void SpellHitTarget(Unit *target, const SpellEntry *spell) - { - if (!me->isInCombat()) - return; - - switch(spell->Id) - { - case SPELL_INFORM_DEAD_TRAINEE: DoSummon(MOB_DEAD_TRAINEE, target, 0); break; - case SPELL_INFORM_DEAD_KNIGHT: DoSummon(MOB_DEAD_KNIGHT, target, 0); break; - case SPELL_INFORM_DEAD_RIDER: DoSummon(MOB_DEAD_RIDER, target, 1.0f); - DoSummon(MOB_DEAD_HORSE, target, 1.0f); break; - } - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateCombatState() || !CheckInRoom()) - return; - - events.Update(diff); - - if (me->hasUnitState(UNIT_STAT_CASTING)) - return; - - while(uint32 eventId = events.ExecuteEvent()) - { - switch(eventId) - { - case EVENT_SUMMON: - if (waves[waveCount].entry) - { - for(uint32 i = 0; i < waves[waveCount].number; ++i) - DoSummon(waves[waveCount].entry, liveTrigger[rand()%POS_LIVE], 1.0f); - events.ScheduleEvent(EVENT_SUMMON, waves[waveCount].time); - ++waveCount; - } - else - { - DoScriptText(SAY_TELEPORT, me); - DoTeleportTo(PosGround); - me->SetReactState(REACT_AGGRESSIVE); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); - if (instance) - instance->SetData(DATA_GOTHIK_GATE, 0); - summons.DoAction(0, 0); - summons.DoZoneInCombat(); - events.ScheduleEvent(EVENT_BOLT, 1000); - events.ScheduleEvent(EVENT_HARVEST, 15000); - } - break; - case EVENT_BOLT: - DoCast(me->getVictim(), SPELL_SHADOW_BOLT); - events.ScheduleEvent(EVENT_BOLT, 1000); - return; - case EVENT_HARVEST: - DoCast(me->getVictim(), SPELL_HARVEST_SOUL); - events.ScheduleEvent(EVENT_HARVEST, 15000); - return; - } - } - - DoMeleeAttackIfReady(); - } -}; - -struct TRINITY_DLL_DECL mob_gothik_minionAI : public SpellAI -{ - mob_gothik_minionAI(Creature *c) : SpellAI(c) - { - liveSide = me->GetPositionY() < POS_Y_GATE; - } - - bool liveSide; - bool gateClose; - -#define SIDE_CHECK(who) (liveSide == (who->GetPositionY() < POS_Y_GATE)) - - void DoAction(const int32 param) - { - gateClose = param; - } - - void DamageTaken(Unit *attacker, uint32 &damage) - { - if (gateClose && !SIDE_CHECK(attacker)) - damage = 0; - } - - void JustDied(Unit *killer) - { - if (me->isSummon()) - { - if (Unit *owner = CAST_SUM(me)->GetSummoner()) - SpellAI::JustDied(owner); - } - } - - void EnterEvadeMode() - { - if (!gateClose) - { - SpellAI::EnterEvadeMode(); - return; - } - - if (!_EnterEvadeMode()) - return; - - Map* pMap = me->GetMap(); - if (pMap->IsDungeon()) - { - Map::PlayerList const &PlayerList = pMap->GetPlayers(); - for(Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) - { - if (i->getSource()->isAlive() && SIDE_CHECK(i->getSource())) - { - AttackStart(i->getSource()); - return; - } - } - } - - me->GetMotionMaster()->MoveIdle(); - Reset(); - } - - void UpdateAI(const uint32 diff) - { - if (gateClose && (!SIDE_CHECK(me) || me->getVictim() && !SIDE_CHECK(me->getVictim()))) - { - EnterEvadeMode(); - return; - } - - SpellAI::UpdateAI(diff); - } -}; - -CreatureAI* GetAI_boss_gothik(Creature* pCreature) -{ - return new boss_gothikAI (pCreature); -} - -CreatureAI* GetAI_mob_gothik_minion(Creature* pCreature) -{ - return new mob_gothik_minionAI (pCreature); -} - -void AddSC_boss_gothik() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_gothik"; - newscript->GetAI = &GetAI_boss_gothik; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_gothik_minion"; - newscript->GetAI = &GetAI_mob_gothik_minion; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_grobbulus.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_grobbulus.cpp deleted file mode 100644 index 9195e0e7828..00000000000 --- a/src/bindings/scripts/scripts/zone/naxxramas/boss_grobbulus.cpp +++ /dev/null @@ -1,103 +0,0 @@ -/* Copyright (C) 2008 - 2009 Trinity - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include "precompiled.h" -#include "def_naxxramas.h" - -#define SPELL_BOMBARD_SLIME 28280 - -#define SPELL_POISON_CLOUD 28240 -#define SPELL_MUTATING_INJECTION 28169 -#define SPELL_SLIME_SPRAY HEROIC(28157,54364) -#define SPELL_BERSERK 26662 - -#define EVENT_BERSERK 1 -#define EVENT_CLOUD 2 -#define EVENT_INJECT 3 -#define EVENT_SPRAY 4 - -#define MOB_FALLOUT_SLIME 16290 - -struct TRINITY_DLL_DECL boss_grobbulusAI : public BossAI -{ - boss_grobbulusAI(Creature *c) : BossAI(c, BOSS_GROBBULUS) {} - - void EnterCombat(Unit *who) - { - _EnterCombat(); - events.ScheduleEvent(EVENT_CLOUD, 15000); - events.ScheduleEvent(EVENT_INJECT, 20000); - events.ScheduleEvent(EVENT_SPRAY, 15000+rand()%15000); //not sure - events.ScheduleEvent(EVENT_BERSERK, 12*60000); - } - - void SpellHitTarget(Unit *target, const SpellEntry *spell) - { - if (spell->Id == SPELL_SLIME_SPRAY) - { - if (TempSummon *slime = me->SummonCreature(MOB_FALLOUT_SLIME, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 0)) - DoZoneInCombat(slime); - } - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - events.Update(diff); - - while(uint32 eventId = events.ExecuteEvent()) - { - switch(eventId) - { - case EVENT_CLOUD: - DoCastAOE(SPELL_POISON_CLOUD); - events.ScheduleEvent(EVENT_CLOUD, 15000); - return; - case EVENT_BERSERK: - DoCastAOE(SPELL_BERSERK); - return; - case EVENT_SPRAY: - DoCastAOE(SPELL_SLIME_SPRAY); - events.ScheduleEvent(EVENT_SPRAY, 15000+rand()%15000); - return; - case EVENT_INJECT: - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - if (!target->HasAura(SPELL_MUTATING_INJECTION)) - DoCast(target, SPELL_MUTATING_INJECTION); - events.ScheduleEvent(EVENT_INJECT, 8000 + 12000 * ((float)me->GetHealth() / me->GetMaxHealth())); - return; - } - } - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_grobbulus(Creature* pCreature) -{ - return new boss_grobbulusAI (pCreature); -} - -void AddSC_boss_grobbulus() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_grobbulus"; - newscript->GetAI = &GetAI_boss_grobbulus; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_heigan.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_heigan.cpp deleted file mode 100644 index 8491ab95703..00000000000 --- a/src/bindings/scripts/scripts/zone/naxxramas/boss_heigan.cpp +++ /dev/null @@ -1,150 +0,0 @@ -/* Copyright (C) 2008 - 2009 Trinity - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include "precompiled.h" -#include "def_naxxramas.h" - -#define SAY_AGGRO RAND(-1533109,-1533110,-1533111) -#define SAY_SLAY -1533112 -#define SAY_TAUNT RAND(-1533113,-1533114,-1533115,-1533116,-1533117) -#define SAY_DEATH -1533118 - -#define SPELL_SPELL_DISRUPTION 29310 -#define SPELL_DECREPIT_FEVER HEROIC(29998,55011) -#define SPELL_PLAGUE_CLOUD 29350 - -enum Events -{ - EVENT_DISRUPT = 1, - EVENT_FEVER, - EVENT_ERUPT, - EVENT_PHASE, -}; - -enum Phases -{ - PHASE_FIGHT = 1, - PHASE_DANCE, -}; - -//Spell by eye stalks -#define SPELL_MIND_FLAY 26143 - -struct TRINITY_DLL_DECL boss_heiganAI : public BossAI -{ - boss_heiganAI(Creature *c) : BossAI(c, BOSS_HEIGAN) {} - - uint32 eruptSection; - bool eruptDirection; - Phases phase; - - void KilledUnit(Unit* Victim) - { - if (!(rand()%5)) - DoScriptText(SAY_SLAY, me); - } - - void JustDied(Unit* Killer) - { - _JustDied(); - DoScriptText(SAY_DEATH, me); - } - - void EnterCombat(Unit *who) - { - _EnterCombat(); - DoScriptText(SAY_AGGRO, me); - EnterPhase(PHASE_FIGHT); - } - - void EnterPhase(Phases newPhase) - { - phase = newPhase; - events.Reset(); - eruptSection = 3; - if (phase == PHASE_FIGHT) - { - events.ScheduleEvent(EVENT_DISRUPT, 0); - events.ScheduleEvent(EVENT_FEVER, 20000); - events.ScheduleEvent(EVENT_PHASE, 85000); - events.ScheduleEvent(EVENT_ERUPT, 10000); - } - else - { - float x, y, z, o; - me->GetHomePosition(x, y, z, o); - me->NearTeleportTo(x, y, z, o); - DoCastAOE(SPELL_PLAGUE_CLOUD); - events.ScheduleEvent(EVENT_PHASE, 45000); - events.ScheduleEvent(EVENT_ERUPT, 5000); - } - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim() || !CheckInRoom()) - return; - - events.Update(diff); - - while(uint32 eventId = events.ExecuteEvent()) - { - switch(eventId) - { - case EVENT_DISRUPT: - DoCastAOE(SPELL_SPELL_DISRUPTION); - events.ScheduleEvent(EVENT_DISRUPT, 5000); - return; - case EVENT_FEVER: - DoCastAOE(SPELL_DECREPIT_FEVER); - events.ScheduleEvent(EVENT_FEVER, 20000); - return; - case EVENT_PHASE: - EnterPhase(phase == PHASE_FIGHT ? PHASE_DANCE : PHASE_FIGHT); - return; - case EVENT_ERUPT: - instance->SetData(DATA_HEIGAN_ERUPT, eruptSection); - TeleportCheaters(); - - if (eruptSection == 0) - eruptDirection = true; - else if (eruptSection == 3) - eruptDirection = false; - - eruptDirection ? ++eruptSection : --eruptSection; - - events.ScheduleEvent(EVENT_ERUPT, phase == PHASE_FIGHT ? 10000 : 3000); - break; - } - } - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_heigan(Creature* pCreature) -{ - return new boss_heiganAI (pCreature); -} - -void AddSC_boss_heigan() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_heigan"; - newscript->GetAI = &GetAI_boss_heigan; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_highlord_mograine.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_highlord_mograine.cpp deleted file mode 100644 index 9bef8ebd3f9..00000000000 --- a/src/bindings/scripts/scripts/zone/naxxramas/boss_highlord_mograine.cpp +++ /dev/null @@ -1,179 +0,0 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Highlord_Mograine -SD%Complete: 100 -SDComment: SCRIPT OBSOLETE -SDCategory: Naxxramas -EndScriptData */ - -#include "precompiled.h" - -//All horsemen -#define SPELL_SHIELDWALL 29061 -#define SPELL_BESERK 26662 - -// highlord mograine -#define SPELL_MARK_OF_MOGRAINE 28834 -#define SPELL_RIGHTEOUS_FIRE 28882 // Applied as a 25% chance on melee hit to proc. m_creature->GetVictim() - -#define SAY_TAUNT1 "Enough prattling. Let them come! We shall grind their bones to dust." -#define SAY_TAUNT2 "Conserve your anger! Harness your rage! You will all have outlets for your frustration soon enough." -#define SAY_TAUNT3 "Life is meaningless. It is in death that we are truly tested." -#define SAY_AGGRO1 "You seek death?" -#define SAY_AGGRO2 "None shall pass!" -#define SAY_AGGRO3 "Be still!" -#define SAY_SLAY1 "You will find no peace in death." -#define SAY_SLAY2 "The master's will is done." -#define SAY_SPECIAL "Bow to the might of the Highlord!" -#define SAY_DEATH "I... am... released! Perhaps it's not too late to - noo! I need... more time..." - -#define SOUND_TAUNT1 8842 -#define SOUND_TAUNT2 8843 -#define SOUND_TAUNT3 8844 -#define SOUND_AGGRO1 8835 -#define SOUND_AGGRO2 8836 -#define SOUND_AGGRO3 8837 -#define SOUND_SLAY1 8839 -#define SOUND_SLAY2 8840 -#define SOUND_SPECIAL 8841 -#define SOUND_DEATH 8838 - -#define SPIRIT_OF_MOGRAINE 16775 - -struct TRINITY_DLL_DECL boss_highlord_mograineAI : public ScriptedAI -{ - boss_highlord_mograineAI(Creature *c) : ScriptedAI(c) {} - - uint32 Mark_Timer; - uint32 RighteousFire_Timer; - bool ShieldWall1; - bool ShieldWall2; - - void Reset() - { - Mark_Timer = 20000; // First Horsemen Mark is applied at 20 sec. - RighteousFire_Timer = 2000; // applied approx 1 out of 4 attacks - ShieldWall1 = true; - ShieldWall2 = true; - } - - void InitialYell() - { - if (!m_creature->isInCombat()) - { - switch(rand()%3) - { - case 0: - DoYell(SAY_AGGRO1,LANG_UNIVERSAL,NULL); - DoPlaySoundToSet(m_creature,SOUND_AGGRO1); - break; - case 1: - DoYell(SAY_AGGRO2,LANG_UNIVERSAL,NULL); - DoPlaySoundToSet(m_creature,SOUND_AGGRO2); - break; - case 2: - DoYell(SAY_AGGRO3,LANG_UNIVERSAL,NULL); - DoPlaySoundToSet(m_creature,SOUND_AGGRO3); - break; - } - } - } - - void KilledUnit() - { - switch(rand()%2) - { - case 0: - DoYell(SAY_SLAY1,LANG_UNIVERSAL,NULL); - DoPlaySoundToSet(m_creature,SOUND_SLAY1); - break; - case 1: - DoYell(SAY_SLAY2,LANG_UNIVERSAL,NULL); - DoPlaySoundToSet(m_creature,SOUND_SLAY2); - break; - } - } - - void JustDied(Unit* Killer) - { - DoYell(SAY_DEATH,LANG_UNIVERSAL,NULL); - DoPlaySoundToSet(m_creature, SOUND_DEATH); - } - - void Aggro(Unit *who) - { - InitialYell(); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - // Mark of Mograine - if (Mark_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_MARK_OF_MOGRAINE); - Mark_Timer = 12000; - }else Mark_Timer -= diff; - - // Shield Wall - All 4 horsemen will shield wall at 50% hp and 20% hp for 20 seconds - if (ShieldWall1 && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 50) - { - if (ShieldWall1) - { - DoCast(m_creature,SPELL_SHIELDWALL); - ShieldWall1 = false; - } - } - if (ShieldWall2 && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 20) - { - if (ShieldWall2) - { - DoCast(m_creature,SPELL_SHIELDWALL); - ShieldWall2 = false; - } - } - - // Righteous Fire - if (RighteousFire_Timer < diff) - { - if (rand()%4 == 1) // 1/4 - { - DoCast(m_creature->getVictim(),SPELL_RIGHTEOUS_FIRE); - } - RighteousFire_Timer = 2000; - }else RighteousFire_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_highlord_mograine(Creature* pCreature) -{ - return new boss_highlord_mograineAI (pCreature); -} - -void AddSC_boss_highlord_mograine() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_highlord_mograine"; - newscript->GetAI = &GetAI_boss_highlord_mograine; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_kelthuzad.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_kelthuzad.cpp deleted file mode 100644 index a93ff572ab0..00000000000 --- a/src/bindings/scripts/scripts/zone/naxxramas/boss_kelthuzad.cpp +++ /dev/null @@ -1,294 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_KelThuzud -SD%Complete: 0 -SDComment: VERIFY SCRIPT -SDCategory: Naxxramas -EndScriptData */ - -#include "precompiled.h" -#include "def_naxxramas.h" - -//when shappiron dies. dialog between kel and lich king (in this order) -#define SAY_SAPP_DIALOG1 -1533084 -#define SAY_SAPP_DIALOG2_LICH -1533085 -#define SAY_SAPP_DIALOG3 -1533086 -#define SAY_SAPP_DIALOG4_LICH -1533087 -#define SAY_SAPP_DIALOG5 -1533088 - -//when cat dies -#define SAY_CAT_DIED -1533089 - -//when each of the 4 wing bosses dies -#define SAY_TAUNT1 -1533090 -#define SAY_TAUNT2 -1533091 -#define SAY_TAUNT3 -1533092 -#define SAY_TAUNT4 -1533093 - -#define SAY_SUMMON_MINIONS -1533105 //start of phase 1 - -#define SAY_AGGRO RAND(-1533094,-1533095,-1533096) //start of phase 2 -#define SAY_SLAY RAND(-1533097,-1533098) -#define SAY_DEATH -1533099 -#define SAY_CHAIN RAND(-1533100,-1533101) -#define SAY_FROST_BLAST -1533102 -#define SAY_SPECIAL RAND(-1533106,-1533107,-1533108) - -#define SAY_REQUEST_AID -1533103 //start of phase 3 -#define SAY_ANSWER_REQUEST -1533104 //lich king answer - -enum Event -{ - EVENT_BOLT = 1, - EVENT_NOVA, - EVENT_CHAIN, - EVENT_DETONATE, - EVENT_FISSURE, - EVENT_BLAST, - - EVENT_WASTE, - EVENT_ABOMIN, - EVENT_WEAVER, - EVENT_ICECROWN, - - EVENT_PHASE, -}; - -#define SPELL_FROST_BOLT HEROIC(28478,55802) -#define SPELL_FROST_BOLT_AOE HEROIC(28479,55807) -#define SPELL_SHADOW_FISURE 27810 -#define SPELL_VOID_BLAST 27812 -#define SPELL_MANA_DETONATION 27819 -#define SPELL_FROST_BLAST 27808 -#define SPELL_CHAINS_OF_KELTHUZAD 28410 //28408 script effect -#define SPELL_BERSERK 28498 - -#define MOB_WASTE 16427 // Soldiers of the Frozen Wastes -#define MOB_ABOMINATION 16428 // Unstoppable Abominations -#define MOB_WEAVER 16429 // Soul Weavers -#define MOB_ICECROWN 16441 // Guardians of Icecrown - -float Pos[12][4] = -{ - {3783.272705, -5062.697266, 143.711203,3.617599},//LEFT_FAR - {3730.291260, -5027.239258,143.956909,4.461900},//LEFT_MIDDLE - {3683.868652,-5057.281250,143.183884,5.237086},//LEFT_NEAR - {3759.355225,-5174.128418,143.802383,2.170104},//RIGHT_FAR - {3700.724365,-5185.123047,143.928024,1.309310},//RIGHT_MIDDLE - {3665.121094,-5138.679199,143.183212,0.604023},//RIGHT_NEAR - {3754.431396,-5080.727734,142.036316,3.736189},//LEFT_FAR - {3724.396484, -5061.330566,142.032700, 4.564785},//LEFT_MIDDLE - {3687.158424,-5076.834473,142.017319,5.237086},//LEFT_NEAR - {3687.571777,-5126.831055,142.017807,0.604023},//RIGHT_FAR - {3707.990733,-5151.450195,142.032562,1.376855},//RIGHT_MIDDLE - {3739.500000,-5141.883989,142.0141130, 2.121412}//RIGHT_NEAR -}; - -struct TRINITY_DLL_DECL boss_kelthuzadAI : public BossAI -{ - boss_kelthuzadAI(Creature* c) : BossAI(c, BOSS_KELTHUZAD) {} - - uint32 GuardiansOfIcecrown_Count; - - uint32 Phase; - uint32 GuardiansOfIcecrown_Timer; - - void Reset() - { - _Reset(); - me->SetReactState(REACT_AGGRESSIVE); - GuardiansOfIcecrown_Count = 0; - - GuardiansOfIcecrown_Timer = 5000; //5 seconds for summoning each Guardian of Icecrown in phase 3 - - Phase=0; - } - - void KilledUnit() - { - DoScriptText(SAY_SLAY, m_creature); - } - - void JustDied(Unit* Killer) - { - _JustDied(); - DoScriptText(SAY_DEATH, m_creature); - } - - void EnterCombat(Unit* who) - { - _EnterCombat(); - DoScriptText(SAY_AGGRO, me); - Phase=1; - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - me->SetReactState(REACT_PASSIVE); - events.ScheduleEvent(EVENT_WASTE, 3000); - events.ScheduleEvent(EVENT_ABOMIN, 25000); - events.ScheduleEvent(EVENT_WEAVER, 20000); - events.ScheduleEvent(EVENT_PHASE, 228000); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateCombatState()) - return; - - events.Update(diff); - - if (Phase == 1) - { - while(uint32 eventId = events.GetEvent()) - { - switch(eventId) - { - case EVENT_WASTE: - DoSummon(MOB_WASTE, Pos[RAND(0,3,6,9)]); - events.RepeatEvent(3000); - break; - case EVENT_ABOMIN: - DoSummon(MOB_ABOMINATION, Pos[RAND(1,4,7,10)]); - events.RepeatEvent(25000); - break; - case EVENT_WEAVER: - DoSummon(MOB_WEAVER, Pos[RAND(0,3,6,9)]); - events.RepeatEvent(20000); - break; - case EVENT_PHASE: - events.Reset(); - events.ScheduleEvent(EVENT_BOLT, 2000); - events.ScheduleEvent(EVENT_NOVA, 15000); - events.ScheduleEvent(EVENT_DETONATE, 20000); - events.ScheduleEvent(EVENT_FISSURE, 25000); - events.ScheduleEvent(EVENT_BLAST, (rand()%30+30)*1000); - if (HeroicMode) - events.ScheduleEvent(EVENT_CHAIN, (rand()%30+30)*1000); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - me->SetReactState(REACT_AGGRESSIVE); - Phase = 2; - return; - default: - events.PopEvent(); - break; - } - } - } - else - { - //start phase 3 when we are 40% health - if (Phase != 3) - { - if (HealthBelowPct(40)) - { - Phase = 3 ; - DoScriptText(SAY_REQUEST_AID, m_creature); - //here Lich King should respond to KelThuzad but I don't know which Creature to make talk - //so for now just make Kelthuzad says it. - DoScriptText(SAY_ANSWER_REQUEST, m_creature); - } - } - else if (GuardiansOfIcecrown_Count < HEROIC(2,5)) - { - if (GuardiansOfIcecrown_Timer < diff) - { - DoSummon(MOB_ICECROWN, Pos[RAND(2,5,8)]); - ++GuardiansOfIcecrown_Count; - GuardiansOfIcecrown_Timer = 5000; - } - else GuardiansOfIcecrown_Timer -= diff; - } - - if (me->hasUnitState(UNIT_STAT_CASTING)) - return; - - if (uint32 eventId = events.GetEvent()) - { - switch(eventId) - { - case EVENT_BOLT: - DoCast(m_creature->getVictim(),SPELL_FROST_BOLT); - events.RepeatEvent(2000); - return; - case EVENT_NOVA: - DoCastAOE(SPELL_FROST_BOLT_AOE); - events.RepeatEvent(15000); - return; - case EVENT_CHAIN: - if (Unit *target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0, true)) - DoCast(target, SPELL_CHAINS_OF_KELTHUZAD); - DoScriptText(SAY_CHAIN, me); - events.RepeatEvent((rand()%30+30)*1000); - return; - case EVENT_DETONATE: - { - std::vector unitList; - std::list *threatList = &me->getThreatManager().getThreatList(); - for(std::list::const_iterator itr = threatList->begin(); itr != threatList->end(); ++itr) - { - if ((*itr)->getTarget()->GetTypeId() == TYPEID_PLAYER - && (*itr)->getTarget()->getPowerType() == POWER_MANA - && (*itr)->getTarget()->GetPower(POWER_MANA)) - unitList.push_back((*itr)->getTarget()); - } - - if (!unitList.empty()) - { - std::vector::iterator itr = unitList.begin(); - advance(itr, rand()%unitList.size()); - DoCast(*itr, SPELL_MANA_DETONATION); - DoScriptText(SAY_SPECIAL, me); - } - - events.RepeatEvent(20000); - return; - } - case EVENT_FISSURE: - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target, SPELL_SHADOW_FISURE); - events.RepeatEvent(25000); - return; - case EVENT_BLAST: - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0, true)) - DoCast(target, SPELL_FROST_BLAST); - if (rand()%2) - DoScriptText(SAY_FROST_BLAST, m_creature); - events.RepeatEvent((rand()%30+30)*1000); - return; - default: - events.PopEvent(); - return; - } - } - - DoMeleeAttackIfReady(); - } - } -}; - -CreatureAI* GetAI_boss_kelthuzadAI(Creature* pCreature) -{ - return new boss_kelthuzadAI (pCreature); -} - -void AddSC_boss_kelthuzad() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_kelthuzad"; - newscript->GetAI = &GetAI_boss_kelthuzadAI; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_loatheb.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_loatheb.cpp deleted file mode 100644 index eb53583752f..00000000000 --- a/src/bindings/scripts/scripts/zone/naxxramas/boss_loatheb.cpp +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright (C) 2008 - 2009 Trinity - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include "precompiled.h" -#include "def_naxxramas.h" - -#define SPELL_NECROTIC_AURA 55593 -#define SPELL_SUMMON_SPORE 29234 -#define SPELL_DEATHBLOOM HEROIC(29865,55053) -#define SPELL_INEVITABLE_DOOM HEROIC(29204,55052) - -enum Events -{ - EVENT_AURA = 1, - EVENT_BLOOM, - EVENT_DOOM, -}; - -struct TRINITY_DLL_DECL boss_loathebAI : public BossAI -{ - boss_loathebAI(Creature *c) : BossAI(c, BOSS_LOATHEB) {} - - void EnterCombat(Unit *who) - { - _EnterCombat(); - events.ScheduleEvent(EVENT_AURA, 0); - events.ScheduleEvent(EVENT_BLOOM, 30000); - events.ScheduleEvent(EVENT_DOOM, 120000); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - events.Update(diff); - - while(uint32 eventId = events.ExecuteEvent()) - { - switch(eventId) - { - case EVENT_AURA: - DoCastAOE(SPELL_NECROTIC_AURA); - events.ScheduleEvent(EVENT_AURA, 20000); - return; - case EVENT_BLOOM: - DoCastAOE(SPELL_SUMMON_SPORE, true); - DoCastAOE(SPELL_DEATHBLOOM); - events.ScheduleEvent(EVENT_BLOOM, 30000); - return; - case EVENT_DOOM: - DoCastAOE(SPELL_INEVITABLE_DOOM); - events.ScheduleEvent(EVENT_DOOM, events.GetTimer() < 5*60000 ? 30000 : 15000); - return; - } - } - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_loatheb(Creature* pCreature) -{ - return new boss_loathebAI (pCreature); -} - -void AddSC_boss_loatheb() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_loatheb"; - newscript->GetAI = &GetAI_boss_loatheb; - newscript->RegisterSelf(); - - // Fungal Creep - GetAISpellInfo(29232)->condition = AICOND_DIE; -} - diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_maexxna.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_maexxna.cpp deleted file mode 100644 index 63ffb995cd5..00000000000 --- a/src/bindings/scripts/scripts/zone/naxxramas/boss_maexxna.cpp +++ /dev/null @@ -1,140 +0,0 @@ -/* - * Copyright (C) 2008 - 2009 Trinity - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include "precompiled.h" -#include "def_naxxramas.h" - -#define SPELL_WEB_WRAP 28622 -#define SPELL_WEB_SPRAY HEROIC(29484,54125) -#define SPELL_POISON_SHOCK HEROIC(28741,54122) -#define SPELL_NECROTIC_POISON HEROIC(54121,28776) -#define SPELL_FRENZY HEROIC(54123,54124) - -#define MOB_WEB_WRAP 16486 -#define MOB_SPIDERLING 17055 - -#define MAX_POS_WRAP 3 -const float PosWrap[MAX_POS_WRAP][3] = -{ - {3546.796, -3869.082, 296.450+20}, - {3531.271, -3847.424, 299.450+20}, - {3497.067, -3843.384, 302.384+20}, -}; - -enum Events -{ - EVENT_SPRAY = 1, - EVENT_SHOCK, - EVENT_POISON, - EVENT_WRAP, - EVENT_SUMMON, -}; - -struct TRINITY_DLL_DECL boss_maexxnaAI : public BossAI -{ - boss_maexxnaAI(Creature *c) : BossAI(c, BOSS_MAEXXNA) {} - - bool enraged; - - void EnterCombat(Unit *who) - { - _EnterCombat(); - enraged = false; - events.ScheduleEvent(EVENT_WRAP, 20000); - events.ScheduleEvent(EVENT_SPRAY, 40000); - events.ScheduleEvent(EVENT_SHOCK, 10000); - events.ScheduleEvent(EVENT_POISON, 5000); - events.ScheduleEvent(EVENT_SUMMON, 40000); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim() || !CheckInRoom()) - return; - - events.Update(diff); - - while(uint32 eventId = events.ExecuteEvent()) - { - switch(eventId) - { - case EVENT_WRAP: - for(uint32 i = 0; i < HEROIC(1,2); ++i) - { - if (Unit *target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0, true, -SPELL_WEB_WRAP)) - { - target->RemoveAura(SPELL_WEB_SPRAY); - uint32 pos = rand()%MAX_POS_WRAP; - target->GetMotionMaster()->MoveJump(PosWrap[pos][0], PosWrap[pos][1], PosWrap[pos][2], 20, 20); - if (Creature *wrap = DoSummon(MOB_WEB_WRAP, target, 0, 60000)) - { - wrap->AI()->SetGUID(target->GetGUID()); - wrap->GetMotionMaster()->MoveJump(PosWrap[pos][0], PosWrap[pos][1], PosWrap[pos][2], 20, 20); - } - } - } - events.ScheduleEvent(EVENT_WRAP, 40000); - return; - case EVENT_SPRAY: - DoCastAOE(SPELL_WEB_SPRAY); - events.ScheduleEvent(EVENT_SPRAY, 40000); - return; - case EVENT_SHOCK: - DoCastAOE(SPELL_POISON_SHOCK); - events.ScheduleEvent(EVENT_SHOCK, 10000); - return; - case EVENT_POISON: - DoCast(me->getVictim(), SPELL_NECROTIC_POISON); - events.ScheduleEvent(EVENT_POISON, 30000); - return; - case EVENT_SUMMON: - { - uint32 amount = 8+rand()%2; - for(uint32 i = 0; i < amount; ++i) - DoSummon(MOB_SPIDERLING, me); - events.ScheduleEvent(EVENT_SUMMON, 40000); - break; - } - } - } - - if (!enraged && HealthBelowPct(30)) - { - DoCast(me, SPELL_FRENZY); - enraged = true; - } - else - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_maexxna(Creature* pCreature) -{ - return new boss_maexxnaAI (pCreature); -} - -void AddSC_boss_maexxna() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_maexxna"; - newscript->GetAI = &GetAI_boss_maexxna; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_noth.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_noth.cpp deleted file mode 100644 index 87f9a96ad61..00000000000 --- a/src/bindings/scripts/scripts/zone/naxxramas/boss_noth.cpp +++ /dev/null @@ -1,210 +0,0 @@ -/* Copyright (C) 2008 - 2009 Trinity - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include "precompiled.h" -#include "def_naxxramas.h" - -#define SAY_AGGRO RAND(-1533075,-1533076,-1533077) -#define SAY_SUMMON -1533078 -#define SAY_SLAY RAND(-1533079,-1533080) -#define SAY_DEATH -1533081 - -#define SOUND_DEATH 8848 - -#define SPELL_CURSE_PLAGUEBRINGER HEROIC(29213,54835) -#define SPELL_BLINK RAND(29208,29209,29210,29211) -#define SPELL_CRIPPLE HEROIC(29212,54814) -#define SPELL_TELEPORT 29216 - -#define MOB_WARRIOR 16984 -#define MOB_CHAMPION 16983 -#define MOB_GUARDIAN 16981 - -// Teleport position of Noth on his balcony -#define TELE_X 2631.370 -#define TELE_Y -3529.680 -#define TELE_Z 274.040 -#define TELE_O 6.277 - -#define MAX_SUMMON_POS 5 - -const float SummonPos[MAX_SUMMON_POS][4] = -{ - {2728.12, -3544.43, 261.91, 6.04}, - {2729.05, -3544.47, 261.91, 5.58}, - {2728.24, -3465.08, 264.20, 3.56}, - {2704.11, -3456.81, 265.53, 4.51}, - {2663.56, -3464.43, 262.66, 5.20}, -}; - -enum Events -{ - EVENT_BERSERK = 1, - EVENT_CURSE, - EVENT_BLINK, - EVENT_WARRIOR, - EVENT_BALCONY, - EVENT_WAVE, - EVENT_GROUND, -}; - -struct TRINITY_DLL_DECL boss_nothAI : public BossAI -{ - boss_nothAI(Creature *c) : BossAI(c, BOSS_NOTH) {} - - uint32 waveCount, balconyCount; - - void Reset() - { - me->SetReactState(REACT_AGGRESSIVE); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - _Reset(); - } - - void EnterCombat(Unit *who) - { - _EnterCombat(); - DoScriptText(SAY_AGGRO, me); - balconyCount = 0; - EnterPhaseGround(); - } - - void EnterPhaseGround() - { - me->SetReactState(REACT_AGGRESSIVE); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - DoZoneInCombat(); - if (me->getThreatManager().isThreatListEmpty()) - EnterEvadeMode(); - else - { - events.ScheduleEvent(EVENT_BALCONY, 110000); - events.ScheduleEvent(EVENT_CURSE, 20000+rand()%10000); - events.ScheduleEvent(EVENT_WARRIOR, 30000); - if (HeroicMode) - events.ScheduleEvent(EVENT_BLINK, 20000+rand()%10000); - } - } - - void KilledUnit(Unit* victim) - { - if (!(rand()%5)) - DoScriptText(SAY_SLAY, me); - } - - void JustSummoned(Creature *summon) - { - summons.Summon(summon); - summon->setActive(true); - summon->AI()->DoZoneInCombat(); - } - - void JustDied(Unit* Killer) - { - _JustDied(); - DoScriptText(SAY_DEATH, me); - } - - void SummonUndead(uint32 entry, uint32 num) - { - for(uint32 i = 0; i < num; ++i) - { - uint32 pos = rand()%MAX_SUMMON_POS; - me->SummonCreature(entry, SummonPos[pos][0], SummonPos[pos][1], SummonPos[pos][2], - SummonPos[pos][3], TEMPSUMMON_CORPSE_DESPAWN, 60000); - } - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateCombatState() || !CheckInRoom()) - return; - - events.Update(diff); - - while(uint32 eventId = events.ExecuteEvent()) - { - switch(eventId) - { - case EVENT_CURSE: - DoCastAOE(SPELL_CURSE_PLAGUEBRINGER); - events.ScheduleEvent(EVENT_CURSE, 20000+rand()%10000); - return; - case EVENT_WARRIOR: - DoScriptText(SAY_SUMMON, me); - SummonUndead(MOB_WARRIOR, HEROIC(2,3)); - events.ScheduleEvent(EVENT_WARRIOR, 30000); - return; - case EVENT_BLINK: - DoCastAOE(SPELL_CRIPPLE, true); - DoCastAOE(SPELL_BLINK); - DoResetThreat(); - events.ScheduleEvent(EVENT_BLINK, 20000+rand()%10000); - return; - case EVENT_BALCONY: - me->SetReactState(REACT_PASSIVE); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->AttackStop(); - me->RemoveAllAuras(); - me->NearTeleportTo(TELE_X, TELE_Y, TELE_Z, TELE_O); - events.Reset(); - events.ScheduleEvent(EVENT_WAVE, 2000); - waveCount = 0; - return; - case EVENT_WAVE: - DoScriptText(SAY_SUMMON, me); - switch(balconyCount) - { - case 0: SummonUndead(MOB_CHAMPION, HEROIC(2,4)); break; - case 1: SummonUndead(MOB_CHAMPION, HEROIC(1,2)); - SummonUndead(MOB_GUARDIAN, HEROIC(1,2)); break; - case 2: SummonUndead(MOB_GUARDIAN, HEROIC(2,4)); break; - default:SummonUndead(MOB_CHAMPION, HEROIC(5,10)); - SummonUndead(MOB_GUARDIAN, HEROIC(5,10));break; - } - ++waveCount; - events.ScheduleEvent(waveCount < 2 ? EVENT_WAVE : EVENT_GROUND, 34000); - return; - case EVENT_GROUND: - { - ++balconyCount; - float x, y, z, o; - me->GetHomePosition(x, y, z, o); - me->NearTeleportTo(x, y, z, o); - EnterPhaseGround(); - return; - } - } - } - - if (me->HasReactState(REACT_AGGRESSIVE)) - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_noth(Creature* pCreature) -{ - return new boss_nothAI (pCreature); -} - -void AddSC_boss_noth() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_noth"; - newscript->GetAI = &GetAI_boss_noth; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_patchwerk.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_patchwerk.cpp deleted file mode 100644 index d50c72d8fa6..00000000000 --- a/src/bindings/scripts/scripts/zone/naxxramas/boss_patchwerk.cpp +++ /dev/null @@ -1,133 +0,0 @@ -/* Copyright (C) 2008 - 2009 Trinity - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include "precompiled.h" -#include "def_naxxramas.h" - -#define SAY_AGGRO RAND(-1533017,-1533018) -#define SAY_SLAY -1533019 -#define SAY_DEATH -1533020 - -#define EMOTE_BERSERK -1533021 -#define EMOTE_ENRAGE -1533022 - -#define SPELL_HATEFULSTRIKE HEROIC(41926,59192) -#define SPELL_FRENZY 28131 -#define SPELL_BERSERK 26662 -#define SPELL_SLIMEBOLT 32309 - -#define EVENT_BERSERK 1 -#define EVENT_HATEFUL 2 -#define EVENT_SLIME 3 - -struct TRINITY_DLL_DECL boss_patchwerkAI : public BossAI -{ - boss_patchwerkAI(Creature *c) : BossAI(c, BOSS_PATCHWERK) {} - - bool Enraged; - - void KilledUnit(Unit* Victim) - { - if (!(rand()%5)) - DoScriptText(SAY_SLAY, me); - } - - void JustDied(Unit* Killer) - { - _JustDied(); - DoScriptText(SAY_DEATH, me); - } - - void EnterCombat(Unit *who) - { - _EnterCombat(); - Enraged = false; - DoScriptText(SAY_AGGRO, me); - events.ScheduleEvent(EVENT_HATEFUL, 1200); - events.ScheduleEvent(EVENT_BERSERK, 360000); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - events.Update(diff); - - while(uint32 eventId = events.ExecuteEvent()) - { - switch(eventId) - { - case EVENT_HATEFUL: - { - //Cast Hateful strike on the player with the highest - //amount of HP within melee distance - uint32 MostHP = 0; - Unit* pMostHPTarget = NULL; - std::list::iterator i = me->getThreatManager().getThreatList().begin(); - for(; i != me->getThreatManager().getThreatList().end(); ++i) - { - Unit* target = (*i)->getTarget(); - if (target->isAlive() && target->GetHealth() > MostHP && me->IsWithinMeleeRange(target)) - { - MostHP = target->GetHealth(); - pMostHPTarget = target; - } - } - - if (pMostHPTarget) - DoCast(pMostHPTarget, SPELL_HATEFULSTRIKE, true); - - events.ScheduleEvent(EVENT_HATEFUL, 1200); - return; - } - case EVENT_BERSERK: - DoCast(m_creature, SPELL_BERSERK); - DoScriptText(EMOTE_BERSERK, m_creature); - events.ScheduleEvent(EVENT_SLIME, 2000); - return; - case EVENT_SLIME: - DoCast(m_creature->getVictim(), SPELL_SLIMEBOLT); - events.ScheduleEvent(EVENT_SLIME, 2000); - return; - } - } - - if (!Enraged && HealthBelowPct(5)) - { - DoCast(m_creature, SPELL_FRENZY); - DoScriptText(EMOTE_ENRAGE, NULL); - Enraged = true; - return; - } - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_patchwerk(Creature* pCreature) -{ - return new boss_patchwerkAI (pCreature); -} - -void AddSC_boss_patchwerk() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_patchwerk"; - newscript->GetAI = &GetAI_boss_patchwerk; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_razuvious.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_razuvious.cpp deleted file mode 100644 index 2ade34b6e6d..00000000000 --- a/src/bindings/scripts/scripts/zone/naxxramas/boss_razuvious.cpp +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Copyright (C) 2008 - 2009 Trinity - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include "precompiled.h" -#include "def_naxxramas.h" - -//Razuvious - NO TEXT sound only -//8852 aggro01 - Hah hah, I'm just getting warmed up! -//8853 aggro02 Stand and fight! -//8854 aggro03 Show me what you've got! -//8861 slay1 - You should've stayed home! -//8863 slay2- -//8858 cmmnd3 - You disappoint me, students! -//8855 cmmnd1 - Do as I taught you! -//8856 cmmnd2 - Show them no mercy! -//8859 cmmnd4 - The time for practice is over! Show me what you've learned! -//8861 Sweep the leg! Do you have a problem with that? -//8860 death - An honorable... death... -//8947 - Aggro Mixed? - ? - -#define SOUND_AGGRO RAND(8852,8853,8854) -#define SOUND_SLAY RAND(8861,8863) -#define SOUND_COMMND RAND(8855,8856,8858,8859,8861) -#define SOUND_DEATH 8860 -#define SOUND_AGGROMIX 8847 - -#define SPELL_UNBALANCING_STRIKE 26613 -#define SPELL_DISRUPTING_SHOUT HEROIC(29107,55543) -#define SPELL_JAGGED_KNIFE 55550 -#define SPELL_HOPELESS 29125 - -enum Events -{ - EVENT_STRIKE, - EVENT_SHOUT, - EVENT_KNIFE, - EVENT_COMMAND, -}; - -struct TRINITY_DLL_DECL boss_razuviousAI : public BossAI -{ - boss_razuviousAI(Creature *c) : BossAI(c, BOSS_RAZUVIOUS) {} - - void KilledUnit(Unit* victim) - { - if (!(rand()%3)) - DoPlaySoundToSet(me, SOUND_SLAY); - } - - void JustDied(Unit* killer) - { - _JustDied(); - DoPlaySoundToSet(me, SOUND_DEATH); - me->CastSpell(me, SPELL_HOPELESS, true); // TODO: this may affect other creatures - } - - void EnterCombat(Unit *who) - { - _EnterCombat(); - DoPlaySoundToSet(m_creature, SOUND_AGGRO); - events.ScheduleEvent(EVENT_STRIKE, 30000); - events.ScheduleEvent(EVENT_SHOUT, 25000); - events.ScheduleEvent(EVENT_COMMAND, 40000); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - events.Update(diff); - - while(uint32 eventId = events.ExecuteEvent()) - { - switch(eventId) - { - case EVENT_STRIKE: - DoCast(me->getVictim(), SPELL_UNBALANCING_STRIKE); - events.ScheduleEvent(EVENT_STRIKE, 30000); - return; - case EVENT_SHOUT: - DoCastAOE(SPELL_DISRUPTING_SHOUT); - events.ScheduleEvent(EVENT_SHOUT, 25000); - return; - case EVENT_KNIFE: - if (Unit *target = SelectTarget(SELECT_TARGET_RANDOM, 0, 45)) - DoCast(target, SPELL_JAGGED_KNIFE); - events.ScheduleEvent(EVENT_KNIFE, 25000); - return; - case EVENT_COMMAND: - DoPlaySoundToSet(me, SOUND_COMMND); - events.ScheduleEvent(EVENT_COMMAND, 40000); - return; - } - } - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_razuvious(Creature* pCreature) -{ - return new boss_razuviousAI (pCreature); -} - -void AddSC_boss_razuvious() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_razuvious"; - newscript->GetAI = &GetAI_boss_razuvious; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_sapphiron.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_sapphiron.cpp deleted file mode 100644 index f0dd9e735cb..00000000000 --- a/src/bindings/scripts/scripts/zone/naxxramas/boss_sapphiron.cpp +++ /dev/null @@ -1,350 +0,0 @@ -/* - * Copyright (C) 2008 - 2009 Trinity - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include "precompiled.h" -#include "def_naxxramas.h" - -#define EMOTE_BREATH -1533082 -#define EMOTE_ENRAGE -1533083 - -#define SPELL_FROST_AURA HEROIC(28531,55799) -#define SPELL_CLEAVE 19983 -#define SPELL_TAIL_SWEEP HEROIC(55697,55696) -#define SPELL_SUMMON_BLIZZARD 28560 -#define SPELL_LIFE_DRAIN HEROIC(28542,55665) -#define SPELL_ICEBOLT 28522 -#define SPELL_FROST_BREATH 29318 -#define SPELL_FROST_EXPLOSION 28524 -#define SPELL_FROST_MISSILE 30101 -#define SPELL_BERSERK 26662 -#define SPELL_DIES 29357 - -#define SPELL_CHILL HEROIC(28547,55699) - -#define MOB_BLIZZARD 16474 -#define GO_ICEBLOCK 181247 - -enum Phases -{ - PHASE_NULL = 0, - PHASE_BIRTH, - PHASE_GROUND, - PHASE_FLIGHT, -}; - -enum Events -{ - EVENT_BERSERK = 1, - EVENT_CLEAVE, - EVENT_TAIL, - EVENT_DRAIN, - EVENT_BLIZZARD, - EVENT_FLIGHT, - EVENT_LIFTOFF, - EVENT_ICEBOLT, - EVENT_BREATH, - EVENT_EXPLOSION, - EVENT_LAND, - EVENT_GROUND, - EVENT_BIRTH, -}; - -typedef std::map IceBlockMap; - -struct TRINITY_DLL_DECL boss_sapphironAI : public BossAI -{ - boss_sapphironAI(Creature* c) : BossAI(c, BOSS_SAPPHIRON) - , phase(PHASE_NULL) - {} - - Phases phase; - uint32 iceboltCount; - IceBlockMap iceblocks; - - void InitializeAI() - { - float x, y, z; - me->GetPosition(x, y, z); - me->SummonGameObject(GO_BIRTH, x, y, z, 0, 0, 0, 0, 0, 0); - me->SetVisibility(VISIBILITY_OFF); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - me->SetReactState(REACT_PASSIVE); - - Reset(); - } - - void Reset() - { - _Reset(); - - if (phase = PHASE_FLIGHT) - ClearIceBlock(); - - phase = PHASE_NULL; - } - - void EnterCombat(Unit *who) - { - _EnterCombat(); - - me->CastSpell(me, SPELL_FROST_AURA, true); - - events.ScheduleEvent(EVENT_BERSERK, 15*60000); - EnterPhaseGround(); - } - - void SpellHitTarget(Unit *target, const SpellEntry *spell) - { - if (spell->Id == SPELL_ICEBOLT) - { - IceBlockMap::iterator itr = iceblocks.find(target->GetGUID()); - if (itr != iceblocks.end() && !itr->second) - { - if (GameObject *iceblock = me->SummonGameObject(GO_ICEBLOCK, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, 0, 0, 0, 0, 25000)) - itr->second = iceblock->GetGUID(); - } - } - } - - void JustDied(Unit* who) - { - _JustDied(); - me->CastSpell(me, SPELL_DIES, true); - } - - void MovementInform(uint32, uint32 id) - { - if (id == 1) - events.ScheduleEvent(EVENT_LIFTOFF, 0); - } - - void DoAction(const int32 param) - { - if (param == DATA_SAPPHIRON_BIRTH) - { - phase = PHASE_BIRTH; - events.ScheduleEvent(EVENT_BIRTH, 23000); - } - } - - void EnterPhaseGround() - { - phase = PHASE_GROUND; - me->SetReactState(REACT_AGGRESSIVE); - events.SetPhase(PHASE_GROUND); - events.ScheduleEvent(EVENT_CLEAVE, 5000+rand()%10000, 0, PHASE_GROUND); - events.ScheduleEvent(EVENT_TAIL, 5000+rand()%10000, 0, PHASE_GROUND); - events.ScheduleEvent(EVENT_DRAIN, 24000, 0, PHASE_GROUND); - events.ScheduleEvent(EVENT_BLIZZARD, 5000+rand()%5000, 0, PHASE_GROUND); - events.ScheduleEvent(EVENT_FLIGHT, 45000); - } - - void ClearIceBlock() - { - for(IceBlockMap::iterator itr = iceblocks.begin(); itr != iceblocks.end(); ++itr) - { - if (Player* pPlayer = Unit::GetPlayer(itr->first)) - pPlayer->RemoveAura(SPELL_ICEBOLT); - if (GameObject* pGo = GameObject::GetGameObject(*me, itr->second)) - pGo->DeleteObjectWithOwner(); - } - iceblocks.clear(); - } - - void UpdateAI(const uint32 diff) - { - if (!phase) - return; - - events.Update(diff); - - if (phase != PHASE_BIRTH && !UpdateCombatState() || !CheckInRoom()) - return; - - if (phase == PHASE_GROUND) - { - while(uint32 eventId = events.ExecuteEvent()) - { - switch(eventId) - { - case EVENT_BERSERK: - DoScriptText(EMOTE_ENRAGE, m_creature); - DoCast(me, SPELL_BERSERK); - return; - case EVENT_CLEAVE: - DoCast(me->getVictim(), SPELL_CLEAVE); - events.ScheduleEvent(EVENT_CLEAVE, 5000+rand()%10000, 0, PHASE_GROUND); - return; - case EVENT_TAIL: - DoCastAOE(SPELL_TAIL_SWEEP); - events.ScheduleEvent(EVENT_TAIL, 5000+rand()%10000, 0, PHASE_GROUND); - return; - case EVENT_DRAIN: - DoCastAOE(SPELL_LIFE_DRAIN); - events.ScheduleEvent(EVENT_DRAIN, 24000, 0, PHASE_GROUND); - return; - case EVENT_BLIZZARD: - { - //DoCastAOE(SPELL_SUMMON_BLIZZARD); - float x, y, z; - me->GetGroundPointAroundUnit(x, y, z, rand_norm()*20, rand_norm()*2*M_PI); - if (Creature *summon = me->SummonCreature(MOB_BLIZZARD, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN, 25000+rand()%5000)) - summon->GetMotionMaster()->MoveRandom(40); - events.ScheduleEvent(EVENT_BLIZZARD, HEROIC(20000,7000), 0, PHASE_GROUND); - break; - } - case EVENT_FLIGHT: - phase = PHASE_FLIGHT; - events.SetPhase(PHASE_FLIGHT); - me->SetReactState(REACT_PASSIVE); - me->AttackStop(); - float x, y, z, o; - me->GetHomePosition(x, y, z, o); - me->GetMotionMaster()->MovePoint(1, x, y, z); - return; - } - } - - DoMeleeAttackIfReady(); - } - else - { - if (uint32 eventId = events.ExecuteEvent()) - { - switch(eventId) - { - case EVENT_LIFTOFF: - me->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF); - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - me->SendMovementFlagUpdate(); - events.ScheduleEvent(EVENT_ICEBOLT, 1500); - iceboltCount = HEROIC(2,3); - return; - case EVENT_ICEBOLT: - { - std::vector targets; - std::list::iterator i = me->getThreatManager().getThreatList().begin(); - for(; i != me->getThreatManager().getThreatList().end(); ++i) - if ((*i)->getTarget()->GetTypeId() == TYPEID_PLAYER && !(*i)->getTarget()->HasAura(SPELL_ICEBOLT)) - targets.push_back((*i)->getTarget()); - - if (targets.empty()) - iceboltCount = 0; - else - { - std::vector::iterator itr = targets.begin(); - advance(itr, rand()%targets.size()); - iceblocks.insert(std::make_pair((*itr)->GetGUID(), 0)); - DoCast(*itr, SPELL_ICEBOLT); - --iceboltCount; - } - - if (iceboltCount) - events.ScheduleEvent(EVENT_ICEBOLT, 1000); - else - events.ScheduleEvent(EVENT_BREATH, 1000); - return; - } - case EVENT_BREATH: - { - DoScriptText(EMOTE_BREATH, me); - DoCastAOE(SPELL_FROST_MISSILE); - events.ScheduleEvent(EVENT_EXPLOSION, 8000); - return; - } - case EVENT_EXPLOSION: - CastExplosion(); - ClearIceBlock(); - events.ScheduleEvent(EVENT_LAND, 3000); - return; - case EVENT_LAND: - me->HandleEmoteCommand(EMOTE_ONESHOT_LAND); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - me->SendMovementFlagUpdate(); - events.ScheduleEvent(EVENT_GROUND, 1500); - return; - case EVENT_GROUND: - EnterPhaseGround(); - return; - case EVENT_BIRTH: - me->SetVisibility(VISIBILITY_ON); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - me->SetReactState(REACT_AGGRESSIVE); - return; - } - }//if (uint32 eventId = events.ExecuteEvent()) - }//if (phase == PHASE_GROUND) - } - - void CastExplosion() - { - DoZoneInCombat(); // make sure everyone is in threatlist - std::vector targets; - std::list::iterator i = me->getThreatManager().getThreatList().begin(); - for(; i != me->getThreatManager().getThreatList().end(); ++i) - { - Unit *target = (*i)->getTarget(); - if (target->GetTypeId() != TYPEID_PLAYER) - continue; - - if (target->HasAura(SPELL_ICEBOLT)) - { - target->ApplySpellImmune(0, IMMUNITY_ID, SPELL_FROST_EXPLOSION, true); - targets.push_back(target); - continue; - } - - for(IceBlockMap::iterator itr = iceblocks.begin(); itr != iceblocks.end(); ++itr) - { - if (GameObject* pGo = GameObject::GetGameObject(*me, itr->second)) - { - if (pGo->IsInBetween(me, target, 2.0f) - && me->GetExactDistance2d(target->GetPositionX(), target->GetPositionY()) - me->GetExactDistance2d(pGo->GetPositionX(), pGo->GetPositionY()) < 5.0f) - { - target->ApplySpellImmune(0, IMMUNITY_ID, SPELL_FROST_EXPLOSION, true); - targets.push_back(target); - break; - } - } - } - } - - me->CastSpell(me, SPELL_FROST_EXPLOSION, true); - - for(std::vector::iterator itr = targets.begin(); itr != targets.end(); ++itr) - (*itr)->ApplySpellImmune(0, IMMUNITY_ID, SPELL_FROST_EXPLOSION, false); - } -}; - -CreatureAI* GetAI_boss_sapphiron(Creature* pCreature) -{ - return new boss_sapphironAI (pCreature); -} - -void AddSC_boss_sapphiron() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_sapphiron"; - newscript->GetAI = &GetAI_boss_sapphiron; - newscript->RegisterSelf(); - - // Chill - GetAISpellInfo(28547)->cooldown = 1000; - GetAISpellInfo(55699)->cooldown = 1000; -} diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_thaddius.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_thaddius.cpp deleted file mode 100644 index b40b5aca876..00000000000 --- a/src/bindings/scripts/scripts/zone/naxxramas/boss_thaddius.cpp +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Copyright (C) 2008 - 2009 Trinity - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include "precompiled.h" -#include "def_naxxramas.h" - -//Stalagg -#define SAY_STAL_AGGRO -1533023 -#define SAY_STAL_SLAY -1533024 -#define SAY_STAL_DEATH -1533025 - -#define SPELL_POWERSURGE 28134 - -//Feugen -#define SAY_FEUG_AGGRO -1533026 -#define SAY_FEUG_SLAY -1533027 -#define SAY_FEUG_DEATH -1533028 - -#define SPELL_MANABURN 28135 - -//both -#define SPELL_WARSTOMP 28125 - - - //generic -#define C_TESLA_COIL 16218 //the coils (emotes "Tesla Coil overloads!") - - -//Thaddus -#define SAY_GREET -1533029 -#define SAY_AGGRO RAND(-1533030,-1533031,-1533032) -#define SAY_SLAY -1533033 -#define SAY_ELECT -1533034 -#define SAY_DEATH -1533035 -#define SAY_SCREAM1 -1533036 -#define SAY_SCREAM2 -1533037 -#define SAY_SCREAM3 -1533038 -#define SAY_SCREAM4 -1533039 - -#define SPELL_POLARITY_SHIFT 28089 -#define SPELL_BALL_LIGHTNING 28299 -#define SPELL_CHAIN_LIGHTNING HEROIC(28167,54531) -#define SPELL_BERSERK 27680 - -enum Events -{ - EVENT_SHIFT = 1, - EVENT_CHAIN, - EVENT_BERSERK, -}; - -struct TRINITY_DLL_DECL boss_thaddiusAI : public BossAI -{ - boss_thaddiusAI(Creature *c) : BossAI(c, BOSS_THADDIUS) - { - // temp - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2 | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_STUNNED); - } - - void KilledUnit(Unit* victim) - { - if (!(rand()%5)) - DoScriptText(SAY_SLAY, me); - } - - void JustDied(Unit* Killer) - { - _JustDied(); - DoScriptText(SAY_DEATH, me); - } - - void EnterCombat(Unit *who) - { - _EnterCombat(); - DoScriptText(SAY_AGGRO, me); - events.ScheduleEvent(EVENT_SHIFT, 30000); - events.ScheduleEvent(EVENT_CHAIN, 10000+rand()%10000); - events.ScheduleEvent(EVENT_BERSERK, 6*60000); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - events.Update(diff); - - if (me->hasUnitState(UNIT_STAT_CASTING)) - return; - - while(uint32 eventId = events.ExecuteEvent()) - { - switch(eventId) - { - case EVENT_SHIFT: - DoCastAOE(SPELL_POLARITY_SHIFT); - events.ScheduleEvent(EVENT_SHIFT, 30000); - return; - case EVENT_CHAIN: - DoCast(me->getVictim(), SPELL_CHAIN_LIGHTNING); - events.ScheduleEvent(EVENT_CHAIN, 10000+rand()%10000); - return; - case EVENT_BERSERK: - DoCast(me, SPELL_BERSERK); - return; - } - } - - if (events.GetTimer() > 15000 && !me->IsWithinMeleeRange(me->getVictim())) - DoCast(me->getVictim(), SPELL_BALL_LIGHTNING); - else - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_thaddius(Creature* pCreature) -{ - return new boss_thaddiusAI (pCreature); -} - -void AddSC_boss_thaddius() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_thaddius"; - newscript->GetAI = &GetAI_boss_thaddius; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/naxxramas/def_naxxramas.h b/src/bindings/scripts/scripts/zone/naxxramas/def_naxxramas.h deleted file mode 100644 index 383200d4600..00000000000 --- a/src/bindings/scripts/scripts/zone/naxxramas/def_naxxramas.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (C) 2008 - 2009 Trinity - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef DEF_NAXXRAMAS_H -#define DEF_NAXXRAMAS_H - -enum Encounter -{ - BOSS_ANUBREKHAN, - BOSS_FAERLINA, - BOSS_MAEXXNA, - BOSS_NOTH, - BOSS_HEIGAN, - BOSS_LOATHEB, - BOSS_PATCHWERK, - BOSS_GROBBULUS, - BOSS_GLUTH, - BOSS_THADDIUS, - BOSS_RAZUVIOUS, - BOSS_GOTHIK, - BOSS_HORSEMEN, - BOSS_SAPPHIRON, - BOSS_KELTHUZAD, - MAX_BOSS_NUMBER -}; - -enum Data -{ - DATA_HEIGAN_ERUPT, - DATA_GOTHIK_GATE, - DATA_SAPPHIRON_BIRTH, -}; - -#define GO_BIRTH 181356 - -#endif - diff --git a/src/bindings/scripts/scripts/zone/naxxramas/instance_naxxramas.cpp b/src/bindings/scripts/scripts/zone/naxxramas/instance_naxxramas.cpp deleted file mode 100644 index f6121c18ef5..00000000000 --- a/src/bindings/scripts/scripts/zone/naxxramas/instance_naxxramas.cpp +++ /dev/null @@ -1,217 +0,0 @@ -/* Copyright (C) 2008 - 2009 Trinity - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include "precompiled.h" -#include "def_naxxramas.h" - -const DoorData doorData[] = -{ - {181126, BOSS_ANUBREKHAN,DOOR_TYPE_ROOM, BOUNDARY_S}, - {181195, BOSS_ANUBREKHAN,DOOR_TYPE_PASSAGE, 0}, - {194022, BOSS_FAERLINA, DOOR_TYPE_PASSAGE, 0}, - {181209, BOSS_FAERLINA, DOOR_TYPE_PASSAGE, 0}, - {181209, BOSS_MAEXXNA, DOOR_TYPE_ROOM, BOUNDARY_SW}, - {181200, BOSS_NOTH, DOOR_TYPE_ROOM, BOUNDARY_N}, - {181201, BOSS_NOTH, DOOR_TYPE_PASSAGE, BOUNDARY_E}, - {181202, BOSS_NOTH, DOOR_TYPE_PASSAGE, 0}, - {181202, BOSS_HEIGAN, DOOR_TYPE_ROOM, BOUNDARY_N}, - {181203, BOSS_HEIGAN, DOOR_TYPE_PASSAGE, BOUNDARY_E}, - {181241, BOSS_HEIGAN, DOOR_TYPE_PASSAGE, 0}, - {181241, BOSS_LOATHEB, DOOR_TYPE_ROOM, BOUNDARY_W}, - {181123, BOSS_PATCHWERK, DOOR_TYPE_PASSAGE, 0}, - {181123, BOSS_GROBBULUS, DOOR_TYPE_ROOM, 0}, - {181120, BOSS_GLUTH, DOOR_TYPE_PASSAGE, BOUNDARY_NW}, - {181121, BOSS_GLUTH, DOOR_TYPE_PASSAGE, 0}, - {181121, BOSS_THADDIUS, DOOR_TYPE_ROOM, 0}, - {181124, BOSS_RAZUVIOUS, DOOR_TYPE_PASSAGE, 0}, - {181124, BOSS_GOTHIK, DOOR_TYPE_ROOM, BOUNDARY_N}, - {181125, BOSS_GOTHIK, DOOR_TYPE_PASSAGE, BOUNDARY_S}, - {181119, BOSS_GOTHIK, DOOR_TYPE_PASSAGE, 0}, - {181119, BOSS_HORSEMEN, DOOR_TYPE_ROOM, BOUNDARY_NE}, - {181225, BOSS_SAPPHIRON, DOOR_TYPE_PASSAGE, BOUNDARY_W}, - {0, 0, DOOR_TYPE_ROOM, 0}, // EOF -}; - -const MinionData minionData[] = -{ - //{16573, BOSS_ANUBREKHAN}, there is no spawn point in db, so we do not add them here - {16506, BOSS_FAERLINA}, - {16803, BOSS_RAZUVIOUS}, - {16063, BOSS_HORSEMEN}, - {16064, BOSS_HORSEMEN}, - {16065, BOSS_HORSEMEN}, - {30549, BOSS_HORSEMEN}, - {0, 0,} -}; - -enum -{ - GO_HORSEMEN_CHEST_HERO = 193426, - GO_HORSEMEN_CHEST = 181366, //four horsemen event, DoRespawnGameObject() when event == DONE - GO_GOTHIK_GATE = 181170, - - SPELL_ERUPTION = 29371 -}; - -const float HeiganPos[2] = {2796, -3707}; -const float HeiganEruptionSlope[3] = -{ - (-3685 - HeiganPos[1]) /(2724 - HeiganPos[0]), - (-3647 - HeiganPos[1]) /(2749 - HeiganPos[0]), - (-3637 - HeiganPos[1]) /(2771 - HeiganPos[0]), -}; - -// 0 H x -// 1 ^ -// 2 | -// 3 y<--o -inline uint32 GetEruptionSection(float x, float y) -{ - y -= HeiganPos[1]; - if (y < 1.0f) - return 0; - - x -= HeiganPos[0]; - if (x > -1.0f) - return 3; - - float slope = y/x; - for(uint32 i = 0; i < 3; ++i) - if (slope > HeiganEruptionSlope[i]) - return i; - return 3; -} - -struct TRINITY_DLL_DECL instance_naxxramas : public InstanceData -{ - instance_naxxramas(Map* pMap) : InstanceData(pMap) - , Sapphiron(NULL), pGothikGate(NULL), HorsemenChest(NULL), HorsemenNum(0) - { - SetBossNumber(MAX_BOSS_NUMBER); - LoadDoorData(doorData); - LoadMinionData(minionData); - } - - std::set HeiganEruption[4]; - GameObject* pGothikGate, *HorsemenChest; - Creature* Sapphiron; - uint32 HorsemenNum; - - void OnCreatureCreate(Creature* pCreature, bool add) - { - switch(pCreature->GetEntry()) - { - case 15989: Sapphiron = add ? pCreature : NULL; return; - } - - AddMinion(pCreature, add); - } - - void OnGameObjectCreate(GameObject* pGo, bool add) - { - if (pGo->GetGOInfo()->displayId == 6785 || pGo->GetGOInfo()->displayId == 1287) - { - uint32 section = GetEruptionSection(pGo->GetPositionX(), pGo->GetPositionY()); - if (add) - HeiganEruption[section].insert(pGo); - else - HeiganEruption[section].erase(pGo); - return; - } - - switch(pGo->GetEntry()) - { - case GO_BIRTH: if (!add && Sapphiron) Sapphiron->AI()->DoAction(DATA_SAPPHIRON_BIRTH); return; - case GO_GOTHIK_GATE: pGothikGate = add ? pGo : NULL; break; - case GO_HORSEMEN_CHEST: HorsemenChest = add ? pGo : NULL; break; - } - - AddDoor(pGo, add); - } - - void SetData(uint32 id, uint32 value) - { - switch(id) - { - case DATA_HEIGAN_ERUPT: - HeiganErupt(value); - break; - case DATA_GOTHIK_GATE: - if (pGothikGate) - pGothikGate->SetGoState(GOState(value)); - break; - } - } - - bool SetBossState(uint32 id, EncounterState state) - { - if (!InstanceData::SetBossState(id, state)) - return false; - - if (id == BOSS_HORSEMEN && state == DONE && HorsemenChest) - HorsemenChest->SetRespawnTime(HorsemenChest->GetRespawnDelay()); - - return true; - } - - void HeiganErupt(uint32 section) - { - for(uint32 i = 0; i < 4; ++i) - { - if (i == section) - continue; - - for(std::set::iterator itr = HeiganEruption[i].begin(); itr != HeiganEruption[i].end(); ++itr) - { - (*itr)->SendCustomAnim(); - (*itr)->CastSpell(NULL, SPELL_ERUPTION); - } - } - } -}; - -bool AreaTrigger_at_naxxramas_frostwyrm_wing(Player* pPlayer, AreaTriggerEntry *at) -{ - if (pPlayer->isGameMaster()) - return false; - - InstanceData *data = pPlayer->GetInstanceData(); - if (data) - for(uint32 i = BOSS_ANUBREKHAN; i < BOSS_SAPPHIRON; ++i) - if (data->GetBossState(i) != DONE) - return true; - - return false; -} - -InstanceData* GetInstanceData_instance_naxxramas(Map* pMap) -{ - return new instance_naxxramas(pMap); -} - -void AddSC_instance_naxxramas() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_naxxramas"; - newscript->GetInstanceData = &GetInstanceData_instance_naxxramas; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "at_naxxramas_frostwyrm_wing"; - newscript->pAreaTrigger = &AreaTrigger_at_naxxramas_frostwyrm_wing; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/nexus/eye_of_eternity/boss_malygos.cpp b/src/bindings/scripts/scripts/zone/nexus/eye_of_eternity/boss_malygos.cpp deleted file mode 100644 index b187fa10656..00000000000 --- a/src/bindings/scripts/scripts/zone/nexus/eye_of_eternity/boss_malygos.cpp +++ /dev/null @@ -1,170 +0,0 @@ -/* Script Data Start -SDName: Boss malygos -SDAuthor: LordVanMartin -SD%Complete: -SDComment: -SDCategory: -Script Data End */ - -/*** SQL START *** -update creature_template set scriptname = '' where entry = ''; -*** SQL END ***/ -#include "precompiled.h" - -//Spells -#define SPELL_ARCANE_BREATH_N 56272 -#define SPELL_ARCANE_BREATH_H 60072 -#define SPELL_ARCANE_PULSE 57432 -#define SPELL_ARCANE_STORM_1 57459 -#define SPELL_ARCANE_STORM_2 61693 -#define SPELL_ARCANE_STORM_3 61694 -#define SPELL_STATIC_FIELD 57430 -#define SPELL_SURGE_OF_POWER_1 56505 -#define SPELL_SURGE_OF_POWER_2 57407 -#define SPELL_SURGE_OF_POWER_3 60936 -#define SPELL_VORTEX 56105 - -//Dragon "mounts" spells in Phase3 -//they use Rugelike energy -#define SPELL_DMOUNT_FLAME_SPIKE 56091 //maybe not accurate -#define SPELL_DMOUNT_ENGULF_IN_FLAMES 61621 -#define SPELL_DMOUNT_REVIVIFY 57090 -#define SPELL_DMOUNT_LIFE_BURST 57143 -#define SPELL_DMOUNT_FLAME_SHIELD 57108 -//#define SPELL_DMOUNT_UNKNOWN XYZ //Increases your drake's flight speed by 500%. - - -//Yell -//-->Other -#define SAY_ANTI_MAGIC_SHELL -1616000 -#define SAY_BREATH_ATTACK -1616001 -#define SAY_HIGH_DAMAGE_MODE -1616002 -#define SAY_MAGIC_BLAST -1616003 -//--> Generic Spells -#define SAY_GENERIC_SPELL_1 -1616004 -#define SAY_GENERIC_SPELL_2 -1616005 -#define SAY_GENERIC_SPELL_3 -1616006 -#define SAY_DEATH -1616007 -//--> Prefight -#define SAY_PREFIGHT_1 -1616008 -#define SAY_PREFIGHT_2 -1616009 -#define SAY_PREFIGHT_3 -1616010 -#define SAY_PREFIGHT_4 -1616011 -#define SAY_PREFIGHT_5 -1616012 -//--> Phase1 -#define SAY_PHASE1_AGGRO -1616013 -#define SAY_PHASE1_END -1616014 -#define SAY_PHASE1_SLAY_1 -1616015 -#define SAY_PHASE1_SLAY_2 -1616016 -#define SAY_PHASE1_SLAY_3 -1616017 - -//--> Phase2 at 50% HP, - -/*Malygos himself is not targetable during this phase, it will end when the adds he spawns are all killed. However, he does continue to play a part in the encounter. -During this phase he drops anti-magic zones onto the ground the raid MUST stand inside of, it reduces magical damage taken by 50%. They shrink over time, so it's important that your raid moves to each new one he drops. -Throughout the phase, he will deep breath doing ~4k damage per second, unless you are standing inside of the anti-magic zone. -The way the fight works during this phase is there are NPCs riding around on disks in the room. There are two types of mobs, Lords and Scions. -The Lords will move down onto the group, and need to be tanked (They will one-shot a non-tank). After they die, they drop a disk that a raid member can mount onto, which allows them to fly, to attack the Scions that do not come down to the ground. -It is recommended to let melee take the first disks, then ranged. As those mobs die, they also drop disks, which allows the rest of your dps to get onto them. -The Scions will continually cast Arcane Blast on random targets on the floor, which is mitigated by the anti-magic zones. While mounted on a disk, you will not take damage. -After all of the NPCs riding on the disks die, the players on the disks need to dismount as Phase 3 is about to begin.*/ - -#define SAY_PHASE2_AGGRO -1616018 -#define SAY_PHASE2_END -1616019 -#define SAY_PHASE2_SLAY_1 -1616020 -#define SAY_PHASE2_SLAY_2 -1616021 -#define SAY_PHASE2_SLAY_3 -1616022 -//--> Phase3 Malygos destroys the floor, encounter continues on dragon "mounts" -#define SAY_PHASE3_INTRO -1616023 -#define SAY_PHASE3_AGGRO -1616024 -#define SAY_PHASE3_SLAY_1 -1616025 -#define SAY_PHASE3_SLAY_2 -1616026 -#define SAY_PHASE3_SLAY_3 -1616027 -#define SAY_PHASE3_BIG_ATTACK -1616028 - -struct TRINITY_DLL_DECL boss_malygosAI : public ScriptedAI -{ - boss_malygosAI(Creature *c) : ScriptedAI(c) {} - - uint32 phase, - enrage; - - void Reset() - { - //Source Deadly Boss Mod - enrage = 615000; //10 min - } - void EnterCombat(Unit* who) - { - if (phase == 1) - DoScriptText(SAY_PHASE1_AGGRO, m_creature); - if (phase == 2) - DoScriptText(SAY_PHASE1_AGGRO, m_creature); - if (phase == 3) - DoScriptText(SAY_PHASE1_AGGRO, m_creature); - } - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) - { - phase =1; - //Return since we have no target - if (!UpdateVictim()) - return; - - if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) <= 50){ - phase = 2; - //spawn adds - //set malygos unatackable untill all adds spawned dead - //start phase3 - } - - DoMeleeAttackIfReady(); - } - void JustDied(Unit* killer) - { - DoScriptText(SAY_DEATH, m_creature); - } - void KilledUnit(Unit *victim) - { - if (victim == m_creature) - return; - - if (phase ==1) - switch(rand()%3) - { - case 0: DoScriptText(SAY_PHASE1_SLAY_1, m_creature); break; - case 1: DoScriptText(SAY_PHASE1_SLAY_2, m_creature);break; - case 2: DoScriptText(SAY_PHASE1_SLAY_3, m_creature);break; - } - if (phase ==2) - switch(rand()%3) - { - case 0: DoScriptText(SAY_PHASE2_SLAY_1, m_creature);break; - case 1: DoScriptText(SAY_PHASE2_SLAY_2, m_creature);break; - case 2: DoScriptText(SAY_PHASE2_SLAY_3, m_creature);break; - } - if (phase ==3) - switch(rand()%3) - { - case 0: DoScriptText(SAY_PHASE3_SLAY_1, m_creature);break; - case 1: DoScriptText(SAY_PHASE3_SLAY_2, m_creature);break; - case 2: DoScriptText(SAY_PHASE3_SLAY_3, m_creature);break; - } - } -}; - -CreatureAI* GetAI_boss_malygos(Creature* pCreature) -{ - return new boss_malygosAI (pCreature); -} - -void AddSC_boss_malygos() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_malygos"; - newscript->GetAI = &GetAI_boss_malygos; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/nexus/eye_of_eternity/def_eye_of_eternity.h b/src/bindings/scripts/scripts/zone/nexus/eye_of_eternity/def_eye_of_eternity.h deleted file mode 100644 index caa82a92e95..00000000000 --- a/src/bindings/scripts/scripts/zone/nexus/eye_of_eternity/def_eye_of_eternity.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef DEF_EYE_OF_ETERNITY_H -#define DEF_EYE_OF_ETERNITY_H - -#endif diff --git a/src/bindings/scripts/scripts/zone/nexus/eye_of_eternity/instance_eye_of_eternity.cpp b/src/bindings/scripts/scripts/zone/nexus/eye_of_eternity/instance_eye_of_eternity.cpp deleted file mode 100644 index 7c89a117d92..00000000000 --- a/src/bindings/scripts/scripts/zone/nexus/eye_of_eternity/instance_eye_of_eternity.cpp +++ /dev/null @@ -1,21 +0,0 @@ -#include "precompiled.h" -#include "def_eye_of_eternity.h" - -struct TRINITY_DLL_DECL instance_eye_of_eternity : public ScriptedInstance -{ - instance_eye_of_eternity(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; -}; - -InstanceData* GetInstanceData_instance_eye_of_eternity(Map* pMap) -{ - return new instance_eye_of_eternity(pMap); -} - -void AddSC_instance_eye_of_eternity() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_eye_of_eternity"; - newscript->GetInstanceData = &GetInstanceData_instance_eye_of_eternity; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/nexus/nexus/boss_anomalus.cpp b/src/bindings/scripts/scripts/zone/nexus/nexus/boss_anomalus.cpp deleted file mode 100644 index 832dc9274e2..00000000000 --- a/src/bindings/scripts/scripts/zone/nexus/nexus/boss_anomalus.cpp +++ /dev/null @@ -1,302 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Anomalus -SD%Complete: -SDComment: -SDCategory: The Nexus, The Nexus -EndScriptData */ - -#include "precompiled.h" -#include "def_nexus.h" - -bool DeadChaoticRift; // needed for achievement: Chaos Theory(2037) - -enum -{ - ACHIEVEMENT_CHAOS_THEORY = 2037, - - //Spells - SPELL_SPARK_N = 47751, - SPELL_SPARK_H = 57062, - SPELL_RIFT_SHIELD = 47748, - SPELL_CHARGE_RIFT = 47747, //Works wrong (affect players, not rifts) - SPELL_CREATE_RIFT = 47743, //Don't work, using WA - SPELL_ARCANE_ATTRACTION = 57063, //No idea, when it's used - - MOB_CRAZED_MANA_WRAITH = 26746, - MOB_CHAOTIC_RIFT = 26918, - SPELL_CHAOTIC_ENERGY_BURST = 47688, - SPELL_CHARGED_CHAOTIC_ENERGY_BURST = 47737, - SPELL_ARCANEFORM = 48019, //Chaotic Rift visual - - //Yell - SAY_AGGRO = -1576010, - SAY_DEATH = -1576011, - SAY_RIFT = -1576012, - SAY_SHIELD = -1576013 -}; - -float RiftLocation[6][3]= -{ - {652.64, -273.70, -8.75}, - {634.45, -265.94, -8.44}, - {620.73, -281.17, -9.02}, - {626.10, -304.67, -9.44}, - {639.87, -314.11, -9.49}, - {651.72, -297.44, -9.37} -}; - -struct TRINITY_DLL_DECL boss_anomalusAI : public ScriptedAI -{ - boss_anomalusAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - HeroicMode = c->GetMap()->IsHeroic(); - } - - ScriptedInstance* pInstance; - bool HeroicMode; - - uint8 Phase; - uint32 SPELL_SPARK_Timer; - uint32 SPELL_CREATE_RIFT_Timer; - uint64 ChaoticRiftGUID; - - void Reset() - { - Phase = 0; - SPELL_SPARK_Timer = 5000; - SPELL_CREATE_RIFT_Timer = 25000; - ChaoticRiftGUID = 0; - - DeadChaoticRift = false; - - if (pInstance) - pInstance->SetData(DATA_ANOMALUS_EVENT, NOT_STARTED); - } - - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO, m_creature); - - if (pInstance) - pInstance->SetData(DATA_ANOMALUS_EVENT, IN_PROGRESS); - } - - void JustDied(Unit* killer) - { - DoScriptText(SAY_DEATH, m_creature); - - if (HeroicMode && !DeadChaoticRift) - { - AchievementEntry const *AchievChaosTheory = GetAchievementStore()->LookupEntry(ACHIEVEMENT_CHAOS_THEORY); - if (AchievChaosTheory) - { - Map* pMap = m_creature->GetMap(); - if (pMap && pMap->IsDungeon()) - { - Map::PlayerList const &players = pMap->GetPlayers(); - for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) - itr->getSource()->CompletedAchievement(AchievChaosTheory); - } - } - } - - if (pInstance) - pInstance->SetData(DATA_ANOMALUS_EVENT, DONE); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (m_creature->HasAura(SPELL_RIFT_SHIELD)) - { - if (ChaoticRiftGUID) - { - Unit* Rift = Unit::GetUnit((*m_creature), ChaoticRiftGUID); - if (Rift && Rift->isDead()) - { - m_creature->RemoveAurasDueToSpell(SPELL_RIFT_SHIELD); - ChaoticRiftGUID = 0; - } - return; - } - } else - ChaoticRiftGUID = 0; - - if ((Phase == 0) && (m_creature->GetHealth() < m_creature->GetMaxHealth() * 0.75)) - { - Phase = 1; - DoScriptText(SAY_SHIELD, m_creature); - DoCast(m_creature, SPELL_RIFT_SHIELD); - - int tmp = rand()%(2); - Creature* Rift = m_creature->SummonCreature(MOB_CHAOTIC_RIFT, RiftLocation[tmp][0], RiftLocation[tmp][1], RiftLocation[tmp][2], 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000); - if (Rift) - { - //DoCast(Rift, SPELL_CHARGE_RIFT); - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - Rift->AI()->AttackStart(target); - ChaoticRiftGUID = Rift->GetGUID(); - DoScriptText(SAY_RIFT , m_creature); - } - } - - if ((Phase == 1) && (m_creature->GetHealth() < m_creature->GetMaxHealth() * 0.50)) - { - Phase = 2; - DoScriptText(SAY_SHIELD , m_creature); - DoCast(m_creature,SPELL_RIFT_SHIELD); - - int tmp = rand()%(2); - Creature* Rift = m_creature->SummonCreature(MOB_CHAOTIC_RIFT, RiftLocation[tmp][0], RiftLocation[tmp][1], RiftLocation[tmp][2], 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000); - if (Rift) - { - //DoCast(Rift, SPELL_CHARGE_RIFT); - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - Rift->AI()->AttackStart(target); - ChaoticRiftGUID = Rift->GetGUID(); - DoScriptText(SAY_RIFT , m_creature); - } - } - - if ((Phase == 2) && (m_creature->GetHealth() < m_creature->GetMaxHealth() * 0.25)) - { - Phase = 3; - DoScriptText(SAY_SHIELD , m_creature); - DoCast(m_creature,SPELL_RIFT_SHIELD); - - int tmp = rand()%(2); - Creature* Rift = m_creature->SummonCreature(MOB_CHAOTIC_RIFT, RiftLocation[tmp][0], RiftLocation[tmp][1], RiftLocation[tmp][2], 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000); - if (Rift) - { - //DoCast(Rift, SPELL_CHARGE_RIFT); - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - Rift->AI()->AttackStart(target); - ChaoticRiftGUID = Rift->GetGUID(); - DoScriptText(SAY_RIFT , m_creature); - } - } - - if (SPELL_SPARK_Timer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - DoCast(target, HeroicMode ? SPELL_SPARK_H : SPELL_SPARK_N); - SPELL_SPARK_Timer = 5000; - }else SPELL_SPARK_Timer -=diff; - - if (SPELL_CREATE_RIFT_Timer < diff) - { - DoScriptText(SAY_RIFT , m_creature); - - int tmp = rand()%(2); - Creature* Rift = m_creature->SummonCreature(MOB_CHAOTIC_RIFT, RiftLocation[tmp][0], RiftLocation[tmp][1], RiftLocation[tmp][2], 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000); - if (Rift) - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - Rift->AI()->AttackStart(target); - SPELL_CREATE_RIFT_Timer = 25000; - }else SPELL_CREATE_RIFT_Timer -=diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_anomalus(Creature* pCreature) -{ - return new boss_anomalusAI (pCreature); -} - -struct TRINITY_DLL_DECL mob_chaotic_riftAI : public Scripted_NoMovementAI -{ - mob_chaotic_riftAI(Creature *c) : Scripted_NoMovementAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - uint32 SPELL_CHAOTIC_ENERGY_BURST_Timer; - uint32 SUMMON_CRAZED_MANA_WRAITH_Timer; - - void Reset() - { - SPELL_CHAOTIC_ENERGY_BURST_Timer = 1000; - SUMMON_CRAZED_MANA_WRAITH_Timer = 5000; - m_creature->SetDisplayId(25206); //For some reason in DB models for ally and horde are different. - //Model for ally (1126) does not show auras. Horde model works perfect. - //Set model to horde number - DoCast(m_creature, SPELL_ARCANEFORM, false); - } - - void JustDied(Unit *killer) - { - DeadChaoticRift = true; - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (SPELL_CHAOTIC_ENERGY_BURST_Timer < diff) - { - Unit* Anomalus = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_ANOMALUS)); - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - if (Anomalus && Anomalus->HasAura(SPELL_RIFT_SHIELD)) - DoCast(target, SPELL_CHARGED_CHAOTIC_ENERGY_BURST); - else - DoCast(target, SPELL_CHAOTIC_ENERGY_BURST); - SPELL_CHAOTIC_ENERGY_BURST_Timer = 1000; - }else SPELL_CHAOTIC_ENERGY_BURST_Timer -=diff; - - if (SUMMON_CRAZED_MANA_WRAITH_Timer < diff) - { - Creature* Wraith = m_creature->SummonCreature(MOB_CRAZED_MANA_WRAITH, m_creature->GetPositionX()+1, m_creature->GetPositionY()+1, m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000); - if (Wraith) - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - Wraith->AI()->AttackStart(target); - Unit* Anomalus = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_ANOMALUS)); - if (Anomalus && Anomalus->HasAura(SPELL_RIFT_SHIELD)) - SUMMON_CRAZED_MANA_WRAITH_Timer = 5000; - else - SUMMON_CRAZED_MANA_WRAITH_Timer = 10000; - }else SUMMON_CRAZED_MANA_WRAITH_Timer -=diff; - } -}; - -CreatureAI* GetAI_mob_chaotic_rift(Creature* pCreature) -{ - return new mob_chaotic_riftAI (pCreature); -} - -void AddSC_boss_anomalus() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_anomalus"; - newscript->GetAI = &GetAI_boss_anomalus; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_chaotic_rift"; - newscript->GetAI = &GetAI_mob_chaotic_rift; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/nexus/nexus/boss_keristrasza.cpp b/src/bindings/scripts/scripts/zone/nexus/nexus/boss_keristrasza.cpp deleted file mode 100644 index 072e6db1a1f..00000000000 --- a/src/bindings/scripts/scripts/zone/nexus/nexus/boss_keristrasza.cpp +++ /dev/null @@ -1,258 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Keristrasza -SD%Complete: -SDComment: -SDCategory: The Nexus, The Nexus -EndScriptData */ - -#include "precompiled.h" -#include "def_nexus.h" - -enum -{ - CONTAINMENT_SPHERES = 3, - - ACHIEVEMENT_INTENSE_COLD = 2036, - - //Spells - SPELL_FROZEN_PRISON = 47854, - SPELL_TAIL_SWEEP = 50155, - SPELL_CRYSTAL_CHAINS = 50997, - SPELL_ENRAGE = 8599, - SPELL_CRYSTALFIRE_BREATH_N = 48096, - SPELL_CRYSTALFIRE_BREATH_H = 57091, - SPELL_CRYSTALIZE = 48179, - SPELL_INTENSE_COLD = 48094, - SPELL_INTENSE_COLD_TRIGGERED = 48095, - - //Yell - SAY_AGGRO = -1576040, - SAY_SLAY = -1576041, - SAY_ENRAGE = -1576042, - SAY_DEATH = -1576043, - SAY_CRYSTAL_NOVA = -1576044 -}; - -struct TRINITY_DLL_DECL boss_keristraszaAI : public ScriptedAI -{ - boss_keristraszaAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - HeroicMode = c->GetMap()->IsHeroic(); - } - - ScriptedInstance* pInstance; - bool HeroicMode; - - uint32 CRYSTALFIRE_BREATH_Timer; - uint32 CRYSTAL_CHAINS_CRYSTALIZE_Timer; - uint32 TAIL_SWEEP_Timer; - bool Enrage; - - uint64 ContainmentSphereGUIDs[CONTAINMENT_SPHERES]; - - uint32 CheckIntenseColdTimer; - bool MoreThanTwoIntenseCold; // needed for achievement: Intense Cold(2036) - - void Reset() - { - CRYSTALFIRE_BREATH_Timer = 14000; - CRYSTAL_CHAINS_CRYSTALIZE_Timer = HeroicMode ? 30000 : 11000; - TAIL_SWEEP_Timer = 5000; - Enrage = false; - - CheckIntenseColdTimer = 2000; - MoreThanTwoIntenseCold = false; - - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED); - - RemovePrison(CheckContainmentSpheres()); - - if (pInstance) - pInstance->SetData(DATA_KERISTRASZA_EVENT, NOT_STARTED); - } - - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO, m_creature); - DoCastAOE(SPELL_INTENSE_COLD); - - if (pInstance) - pInstance->SetData(DATA_KERISTRASZA_EVENT, IN_PROGRESS); - } - - void JustDied(Unit* killer) - { - DoScriptText(SAY_DEATH, m_creature); - - if (HeroicMode && !MoreThanTwoIntenseCold) - { - AchievementEntry const *AchievIntenseCold = GetAchievementStore()->LookupEntry(ACHIEVEMENT_INTENSE_COLD); - if (AchievIntenseCold) - { - Map* pMap = m_creature->GetMap(); - if (pMap && pMap->IsDungeon()) - { - Map::PlayerList const &players = pMap->GetPlayers(); - for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) - itr->getSource()->CompletedAchievement(AchievIntenseCold); - } - } - } - - if (pInstance) - pInstance->SetData(DATA_KERISTRASZA_EVENT, DONE); - } - - void KilledUnit(Unit *victim) - { - DoScriptText(SAY_SLAY, m_creature); - } - - bool CheckContainmentSpheres(bool remove_prison = false) - { - ContainmentSphereGUIDs[0] = pInstance->GetData64(ANOMALUS_CONTAINMET_SPHERE); - ContainmentSphereGUIDs[1] = pInstance->GetData64(ORMOROKS_CONTAINMET_SPHERE); - ContainmentSphereGUIDs[2] = pInstance->GetData64(TELESTRAS_CONTAINMET_SPHERE); - - GameObject *ContainmentSpheres[CONTAINMENT_SPHERES]; - - for(uint8 i = 0; i < CONTAINMENT_SPHERES; ++i) - { - ContainmentSpheres[i] = pInstance->instance->GetGameObject(ContainmentSphereGUIDs[i]); - if (!ContainmentSpheres[i]) - return false; - if (ContainmentSpheres[i]->GetGoState() != GO_STATE_ACTIVE) - return false; - } - if (remove_prison) - RemovePrison(true); - return true; - } - - void RemovePrison(bool remove) - { - if (remove) - { - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - if (m_creature->HasAura(SPELL_FROZEN_PRISON)) - m_creature->RemoveAurasDueToSpell(SPELL_FROZEN_PRISON); - } - else - { - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - m_creature->CastSpell(m_creature, SPELL_FROZEN_PRISON, false); - } - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (CheckIntenseColdTimer < diff && !MoreThanTwoIntenseCold) - { - std::list ThreatList = m_creature->getThreatManager().getThreatList(); - for(std::list::const_iterator itr = ThreatList.begin(); itr != ThreatList.end(); itr++) - { - Unit *target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()); - if (!target || target->GetTypeId() != TYPEID_PLAYER) - continue; - - Aura *AuraIntenseCold = target->GetAura(SPELL_INTENSE_COLD_TRIGGERED); - if (AuraIntenseCold && AuraIntenseCold->GetStackAmount() > 2) - { - MoreThanTwoIntenseCold = true; - break; - } - } - CheckIntenseColdTimer = 2000; - }else CheckIntenseColdTimer -= diff; - - if (!Enrage && (m_creature->GetHealth() < m_creature->GetMaxHealth() * 0.25)) - { - DoScriptText(SAY_ENRAGE , m_creature); - DoCast(m_creature, SPELL_ENRAGE); - Enrage = true; - } - - if (CRYSTALFIRE_BREATH_Timer < diff) - { - DoCast(m_creature->getVictim(), HeroicMode ? SPELL_CRYSTALFIRE_BREATH_H : SPELL_CRYSTALFIRE_BREATH_N); - CRYSTALFIRE_BREATH_Timer = 14000; - }else CRYSTALFIRE_BREATH_Timer -=diff; - - if (TAIL_SWEEP_Timer < diff) - { - DoCast(m_creature, SPELL_TAIL_SWEEP); - TAIL_SWEEP_Timer = 5000; - }else TAIL_SWEEP_Timer -=diff; - - if (CRYSTAL_CHAINS_CRYSTALIZE_Timer < diff) - { - DoScriptText(SAY_CRYSTAL_NOVA , m_creature); - if (HeroicMode) - DoCast(m_creature, SPELL_CRYSTALIZE); - else - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - DoCast(target, SPELL_CRYSTAL_CHAINS); - CRYSTAL_CHAINS_CRYSTALIZE_Timer = HeroicMode ? 30000 : 11000; - }else CRYSTAL_CHAINS_CRYSTALIZE_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_keristrasza(Creature* pCreature) -{ - return new boss_keristraszaAI (pCreature); -} - -bool GOHello_containment_sphere(Player *pPlayer, GameObject *pGO) -{ - ScriptedInstance *pInstance = pGO->GetInstanceData(); - - Creature *Keristrasza = Unit::GetCreature(*pGO, pInstance->GetData64(DATA_KERISTRASZA)); - if (Keristrasza && Keristrasza->isAlive()) - { - // maybe these are hacks :( - pGO->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1); - pGO->SetGoState(GO_STATE_ACTIVE); - - CAST_AI(boss_keristraszaAI, Keristrasza->AI())->CheckContainmentSpheres(true); - } - return true; -} - -void AddSC_boss_keristrasza() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "boss_keristrasza"; - newscript->GetAI = &GetAI_boss_keristrasza; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "containment_sphere"; - newscript->pGOHello = &GOHello_containment_sphere; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/nexus/nexus/boss_magus_telestra.cpp b/src/bindings/scripts/scripts/zone/nexus/nexus/boss_magus_telestra.cpp deleted file mode 100644 index 2fe856cea05..00000000000 --- a/src/bindings/scripts/scripts/zone/nexus/nexus/boss_magus_telestra.cpp +++ /dev/null @@ -1,317 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Magus_Telestra -SD%Complete: -SDComment: -SDCategory: The Nexus, The Nexus -EndScriptData */ - -#include "precompiled.h" -#include "def_nexus.h" - -enum -{ -//Spells - SPELL_ICE_NOVA_N = 47772, - SPELL_ICE_NOVA_H = 56935, - SPELL_FIREBOMB_N = 47773, - SPELL_FIREBOMB_H = 56934, - SPELL_GRAVITY_WELL = 47756, - SPELL_TELESTRA_BACK = 47714, - -//At 50% HP - 3 clones, Frost, Fire, Arcane (and in 10% HP in Heroic) - MOB_FIRE_MAGUS = 26928, - MOB_FROST_MAGUS = 26930, - MOB_ARCANE_MAGUS = 26929, - - SPELL_FIRE_MAGUS_VISUAL = 47705, - SPELL_FROST_MAGUS_VISUAL = 47706, - SPELL_ARCANE_MAGUS_VISUAL = 47704, - -//Yell - SAY_AGGRO = -1576000, - SAY_KILL = -1576001, - SAY_DEATH = -1576002, - SAY_MERGE = -1576003, - SAY_SPLIT_1 = -1576004, - SAY_SPLIT_2 = -1576005 -}; - -float CenterOfRoom[1][4] = -{ - {504.80, 89.07, -16.12, 6.27} -}; - -struct TRINITY_DLL_DECL boss_magus_telestraAI : public ScriptedAI -{ - boss_magus_telestraAI(Creature* c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - HeroicMode = c->GetMap()->IsHeroic(); - } - - ScriptedInstance* pInstance; - bool HeroicMode; - - uint64 FireMagusGUID; - uint64 FrostMagusGUID; - uint64 ArcaneMagusGUID; - bool FireMagusDead; - bool FrostMagusDead; - bool ArcaneMagusDead; - - uint32 AppearDelay_Timer; - bool AppearDelay; - - uint8 Phase; - - uint32 SPELL_ICE_NOVA_Timer; - uint32 SPELL_FIREBOMB_Timer; - uint32 SPELL_GRAVITY_WELL_Timer; - uint32 Cooldown; - - void Reset() - { - Phase = 0; - //These times are probably wrong - SPELL_ICE_NOVA_Timer = 7000; - SPELL_FIREBOMB_Timer = 0; - SPELL_GRAVITY_WELL_Timer = 15000; - Cooldown = 0; - - FireMagusGUID = 0; - FrostMagusGUID = 0; - ArcaneMagusGUID = 0; - - AppearDelay = false; - - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetVisibility(VISIBILITY_ON); - - if (pInstance) - pInstance->SetData(DATA_MAGUS_TELESTRA_EVENT, NOT_STARTED); - } - - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO, m_creature); - - if (pInstance) - pInstance->SetData(DATA_MAGUS_TELESTRA_EVENT, IN_PROGRESS); - } - - void JustDied(Unit* killer) - { - DoScriptText(SAY_DEATH, m_creature); - - if (pInstance) - pInstance->SetData(DATA_MAGUS_TELESTRA_EVENT, DONE); - } - - void KilledUnit(Unit *victim) - { - DoScriptText(SAY_KILL, m_creature); - } - - uint64 SplitPersonality(uint32 entry) - { - Creature* Summoned = m_creature->SummonCreature(entry, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), m_creature->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000); - if (Summoned) - { - switch (entry) - { - case MOB_FIRE_MAGUS: - { - Summoned->CastSpell(Summoned, SPELL_FIRE_MAGUS_VISUAL, false); - break; - } - case MOB_FROST_MAGUS: - { - Summoned->CastSpell(Summoned, SPELL_FROST_MAGUS_VISUAL, false); - break; - } - case MOB_ARCANE_MAGUS: - { - Summoned->CastSpell(Summoned, SPELL_ARCANE_MAGUS_VISUAL, false); - break; - } - } - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - Summoned->AI()->AttackStart(target); - return Summoned->GetGUID(); - } - return 0; - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - { - return; - } - - if (AppearDelay) - { - m_creature->StopMoving(); - m_creature->AttackStop(); - if (AppearDelay_Timer < diff) - { - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - AppearDelay = false; - }else AppearDelay_Timer -= diff; - return; - } - - - if ((Phase == 1)||(Phase == 3)) - { - Unit* FireMagus; - Unit* FrostMagus; - Unit* ArcaneMagus; - if (FireMagusGUID) - FireMagus = Unit::GetUnit((*m_creature), FireMagusGUID); - if (FrostMagusGUID) - FrostMagus = Unit::GetUnit((*m_creature), FrostMagusGUID); - if (ArcaneMagusGUID) - ArcaneMagus = Unit::GetUnit((*m_creature), ArcaneMagusGUID); - if (FireMagus && FireMagus->isDead()) - FireMagusDead = true; - if (FrostMagus && FrostMagus->isDead()) - FrostMagusDead = true; - if (ArcaneMagus && ArcaneMagus->isDead()) - ArcaneMagusDead = true; - if (FireMagusDead && FrostMagusDead && ArcaneMagusDead) - { - m_creature->GetMotionMaster()->Clear(); - m_creature->GetMap()->CreatureRelocation(m_creature, CenterOfRoom[0][0], CenterOfRoom[0][1], CenterOfRoom[0][2], CenterOfRoom[0][3]); - DoCast(m_creature, SPELL_TELESTRA_BACK); - m_creature->SetVisibility(VISIBILITY_ON); - if (Phase == 1) - Phase = 2; - if (Phase == 3) - Phase = 4; - FireMagusGUID = 0; - FrostMagusGUID = 0; - ArcaneMagusGUID = 0; - AppearDelay = true; - AppearDelay_Timer = 4000; - DoScriptText(SAY_MERGE, m_creature); - }else - return; - } - - if ((Phase == 0) && (m_creature->GetHealth() <= (m_creature->GetMaxHealth() * 0.5))) - { - Phase = 1; - m_creature->CastStop(); - m_creature->SetVisibility(VISIBILITY_OFF); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - FireMagusGUID = SplitPersonality(MOB_FIRE_MAGUS); - FrostMagusGUID = SplitPersonality(MOB_FROST_MAGUS); - ArcaneMagusGUID = SplitPersonality(MOB_ARCANE_MAGUS); - FireMagusDead = false; - FrostMagusDead = false; - ArcaneMagusDead = false; - switch(rand()%2) - { - case 0: DoScriptText(SAY_SPLIT_1, m_creature); break; - case 1: DoScriptText(SAY_SPLIT_2, m_creature); break; - } - return; - } - - if (HeroicMode && (Phase == 2) && (m_creature->GetHealth() <= (m_creature->GetMaxHealth() * 0.1))) - { - Phase = 3; - m_creature->CastStop(); - m_creature->SetVisibility(VISIBILITY_OFF); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - FireMagusGUID = SplitPersonality(MOB_FIRE_MAGUS); - FrostMagusGUID = SplitPersonality(MOB_FROST_MAGUS); - ArcaneMagusGUID = SplitPersonality(MOB_ARCANE_MAGUS); - FireMagusDead = false; - FrostMagusDead = false; - ArcaneMagusDead = false; - switch(rand()%2) - { - case 0: DoScriptText(SAY_SPLIT_1, m_creature); break; - case 1: DoScriptText(SAY_SPLIT_2, m_creature); break; - } - return; - } - - if (Cooldown) - { - if (Cooldown < diff) - Cooldown = 0; - else - { - Cooldown -= diff; - return; - } - } - - if (SPELL_ICE_NOVA_Timer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - { - DoCast(target, HeroicMode ? SPELL_ICE_NOVA_H : SPELL_ICE_NOVA_N); - Cooldown = 1500; - } - SPELL_ICE_NOVA_Timer = 15000; - }else SPELL_ICE_NOVA_Timer -=diff; - - if (SPELL_GRAVITY_WELL_Timer < diff) - { - if (Unit* target = m_creature->getVictim()) - { - DoCast(target, SPELL_GRAVITY_WELL); - Cooldown = 6000; - } - SPELL_GRAVITY_WELL_Timer = 15000; - }else SPELL_GRAVITY_WELL_Timer -=diff; - - if (SPELL_FIREBOMB_Timer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - { - DoCast(target, HeroicMode ? SPELL_FIREBOMB_H : SPELL_FIREBOMB_N); - Cooldown = 2000; - } - SPELL_FIREBOMB_Timer = 2000; - }else SPELL_FIREBOMB_Timer -=diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_magus_telestra(Creature* pCreature) -{ - return new boss_magus_telestraAI (pCreature); -} - -void AddSC_boss_magus_telestra() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_magus_telestra"; - newscript->GetAI = &GetAI_boss_magus_telestra; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/nexus/nexus/boss_ormorok.cpp b/src/bindings/scripts/scripts/zone/nexus/nexus/boss_ormorok.cpp deleted file mode 100644 index d55e8514cc6..00000000000 --- a/src/bindings/scripts/scripts/zone/nexus/nexus/boss_ormorok.cpp +++ /dev/null @@ -1,311 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Ormorok -SD%Complete: -SDComment: -SDCategory: The Nexus, The Nexus -EndScriptData */ - -#include "precompiled.h" -#include "def_nexus.h" - -enum -{ -//Spells - SPELL_CRYSTAL_SPIKES_N = 47958, //Don't work, using walkaround - SPELL_CRYSTAL_SPIKES_H = 57082, //Don't work, using walkaround -//Walkaround for spells Crystal Spikes ----------------- - SPELL_CRYSTALL_SPIKE_DAMAGE_N = 47944, - SPELL_CRYSTALL_SPIKE_DAMAGE_H = 57067, - SPELL_CRYSTAL_SPIKE_PREVISUAL = 50442, - MOB_CRYSTAL_SPIKE = 27099, -//------------------------------------------------------ - SPELL_SPELL_REFLECTION = 47981, - SPELL_TRAMPLE_N = 48016, - SPELL_TRAMPLE_H = 57066, - SPELL_FRENZY = 48017, - SPELL_SUMMON_CRYSTALLINE_TANGLER = 61564, //summons npc 32665 - MOB_CRYSTALLINE_TANGLER = 32665, - SPELL_ROOTS = 28858, //proper spell id is unknown - -//Yell - SAY_AGGRO = -1576020, - SAY_DEATH = -1576021, - SAY_REFLECT = -1576022, - SAY_CRYSTAL_SPIKES = -1576023, - SAY_KILL = -1576024 -}; - -#define SPIKE_DISTANCE 5.0f - -struct TRINITY_DLL_DECL boss_ormorokAI : public ScriptedAI -{ - boss_ormorokAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - HeroicMode = c->GetMap()->IsHeroic(); - } - - ScriptedInstance* pInstance; - bool HeroicMode; - bool Frenzy; - bool CrystalSpikes; - uint8 CrystalSpikes_Count; - float BaseX; - float BaseY; - float BaseZ; - float BaseO; - float SpikeXY[4][2]; - - uint32 SPELL_CRYSTAL_SPIKES_Timer; - uint32 CRYSTAL_SPIKES_Timer; - uint32 SPELL_TRAMPLE_Timer; - uint32 SPELL_FRENZY_Timer; - uint32 SPELL_SPELL_REFLECTION_Timer; - uint32 SPELL_SUMMON_CRYSTALLINE_TANGLER_Timer; - - void Reset() - { - SPELL_CRYSTAL_SPIKES_Timer = 12000; - SPELL_TRAMPLE_Timer = 10000; - SPELL_SPELL_REFLECTION_Timer = 30000; - SPELL_SUMMON_CRYSTALLINE_TANGLER_Timer = 17000; - Frenzy = false; - CrystalSpikes = false; - - if (pInstance) - pInstance->SetData(DATA_ORMOROK_EVENT, NOT_STARTED); - } - - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO, m_creature); - - if (pInstance) - pInstance->SetData(DATA_ORMOROK_EVENT, IN_PROGRESS); - } - - void JustDied(Unit* killer) - { - DoScriptText(SAY_DEATH, m_creature); - - if (pInstance) - pInstance->SetData(DATA_ORMOROK_EVENT, DONE); - } - - void KilledUnit(Unit *victim) - { - DoScriptText(SAY_KILL, m_creature); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - { - return; - } - if (CrystalSpikes) - if (CRYSTAL_SPIKES_Timer < diff) - { - SpikeXY[0][0] = BaseX+(SPIKE_DISTANCE*CrystalSpikes_Count*cos(BaseO)); - SpikeXY[0][1] = BaseY+(SPIKE_DISTANCE*CrystalSpikes_Count*sin(BaseO)); - SpikeXY[1][0] = BaseX-(SPIKE_DISTANCE*CrystalSpikes_Count*cos(BaseO)); - SpikeXY[1][1] = BaseY-(SPIKE_DISTANCE*CrystalSpikes_Count*sin(BaseO)); - SpikeXY[2][0] = BaseX+(SPIKE_DISTANCE*CrystalSpikes_Count*cos(BaseO-(M_PI/2))); - SpikeXY[2][1] = BaseY+(SPIKE_DISTANCE*CrystalSpikes_Count*sin(BaseO-(M_PI/2))); - SpikeXY[3][0] = BaseX-(SPIKE_DISTANCE*CrystalSpikes_Count*cos(BaseO-(M_PI/2))); - SpikeXY[3][1] = BaseY-(SPIKE_DISTANCE*CrystalSpikes_Count*sin(BaseO-(M_PI/2))); - for (uint8 i = 0; i < 4; ++i) - Creature* Spike = m_creature->SummonCreature(MOB_CRYSTAL_SPIKE, SpikeXY[i][0], SpikeXY[i][1], BaseZ, 0, TEMPSUMMON_TIMED_DESPAWN, 7000); - if (++CrystalSpikes_Count >= 13) - CrystalSpikes = false; - CRYSTAL_SPIKES_Timer = 200; - }else CRYSTAL_SPIKES_Timer -= diff; - - if (!Frenzy && (m_creature->GetHealth() < m_creature->GetMaxHealth() * 0.25)) - { - DoCast(m_creature, SPELL_FRENZY); - Frenzy = true; - } - - if (SPELL_TRAMPLE_Timer < diff) - { - DoCast(m_creature, HeroicMode ? SPELL_TRAMPLE_H : SPELL_TRAMPLE_N); - SPELL_TRAMPLE_Timer = 10000; - }else SPELL_TRAMPLE_Timer -= diff; - - if (SPELL_SPELL_REFLECTION_Timer < diff) - { - DoScriptText(SAY_REFLECT, m_creature); - DoCast(m_creature, SPELL_SPELL_REFLECTION); - SPELL_SPELL_REFLECTION_Timer = 30000; - }else SPELL_SPELL_REFLECTION_Timer -= diff; - - if (SPELL_CRYSTAL_SPIKES_Timer < diff) - { - DoScriptText(SAY_CRYSTAL_SPIKES, m_creature); - CrystalSpikes = true; - CrystalSpikes_Count = 1; - CRYSTAL_SPIKES_Timer = 0; - BaseX = m_creature->GetPositionX(); - BaseY = m_creature->GetPositionY(); - BaseZ = m_creature->GetPositionZ(); - BaseO = m_creature->GetOrientation(); - SPELL_CRYSTAL_SPIKES_Timer = 20000; - }else SPELL_CRYSTAL_SPIKES_Timer -=diff; - - if (HeroicMode && (SPELL_SUMMON_CRYSTALLINE_TANGLER_Timer < diff)) - { - Creature* Crystalline_Tangler = m_creature->SummonCreature(MOB_CRYSTALLINE_TANGLER, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), m_creature->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000); - if (Crystalline_Tangler) - { - Unit* target = NULL; - uint8 Healer = 0; - for (uint8 j = 1; j<=4; j++) - { - switch (j) - { - case 1: Healer = CLASS_PRIEST; break; - case 2: Healer = CLASS_PALADIN; break; - case 3: Healer = CLASS_DRUID; break; - case 4: Healer = CLASS_SHAMAN; break; - } - std::list::iterator i = m_creature->getThreatManager().getThreatList().begin(); - for (; i != m_creature->getThreatManager().getThreatList().end(); ++i) - { - Unit* pTemp = Unit::GetUnit((*m_creature),(*i)->getUnitGuid()); - if (pTemp && pTemp->GetTypeId() == TYPEID_PLAYER && pTemp->getClass() == Healer) - { - target = pTemp; - break; - } - } - if (target) - break; - } - if (!target) - target = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (target) - { - Crystalline_Tangler->AI()->AttackStart(target); - Crystalline_Tangler->getThreatManager().addThreat(target, 1000000000.0f); - } - } - SPELL_SUMMON_CRYSTALLINE_TANGLER_Timer = 17000; - }else SPELL_SUMMON_CRYSTALLINE_TANGLER_Timer -=diff; - - DoMeleeAttackIfReady(); - } -}; - -struct TRINITY_DLL_DECL mob_crystal_spikeAI : public Scripted_NoMovementAI -{ - mob_crystal_spikeAI(Creature *c) : Scripted_NoMovementAI(c) - { - HeroicMode = c->GetMap()->IsHeroic(); - } - - bool HeroicMode; - - uint32 SPELL_CRYSTALL_SPIKE_DAMAGE_Timer; - uint32 SPELL_CRYSTAL_SPIKE_PREVISUAL_Timer; - - void Reset() - { - SPELL_CRYSTALL_SPIKE_DAMAGE_Timer = 3700; - SPELL_CRYSTAL_SPIKE_PREVISUAL_Timer = 1000; - m_creature->SetLevel(80); // - m_creature->setFaction(16); //Walkaround to be independent from data in DB - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); // - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); // - } - - void UpdateAI(const uint32 diff) - { - if (SPELL_CRYSTAL_SPIKE_PREVISUAL_Timer < diff) - { - DoCast(m_creature, SPELL_CRYSTAL_SPIKE_PREVISUAL); - SPELL_CRYSTAL_SPIKE_PREVISUAL_Timer = 10000; - }else SPELL_CRYSTAL_SPIKE_PREVISUAL_Timer -=diff; - - if (SPELL_CRYSTALL_SPIKE_DAMAGE_Timer < diff) - { - DoCast(m_creature, HeroicMode ? SPELL_CRYSTALL_SPIKE_DAMAGE_H : SPELL_CRYSTALL_SPIKE_DAMAGE_N); - SPELL_CRYSTALL_SPIKE_DAMAGE_Timer = 10000; - }else SPELL_CRYSTALL_SPIKE_DAMAGE_Timer -=diff; - } -}; - -struct TRINITY_DLL_DECL mob_crystalline_tanglerAI : public ScriptedAI -{ - mob_crystalline_tanglerAI(Creature *c) : ScriptedAI(c) {} - - uint32 SPELL_ROOTS_Timer; - - void Reset() - { - SPELL_ROOTS_Timer = 1000; - } - - void UpdateAI(const uint32 diff) - { - if (SPELL_ROOTS_Timer < diff) - { - if (m_creature->IsWithinDist(m_creature->getVictim(), 5.0f, false)) - { - DoCast(m_creature->getVictim(), SPELL_ROOTS); - SPELL_ROOTS_Timer = 15000; - } - }else SPELL_ROOTS_Timer -=diff; - } -}; - -CreatureAI* GetAI_mob_crystal_spike(Creature* pCreature) -{ - return new mob_crystal_spikeAI (pCreature); -} - -CreatureAI* GetAI_mob_crystalline_tangler(Creature* pCreature) -{ - return new mob_crystalline_tanglerAI (pCreature); -} - -CreatureAI* GetAI_boss_ormorok(Creature* pCreature) -{ - return new boss_ormorokAI (pCreature); -} - -void AddSC_boss_ormorok() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_ormorok"; - newscript->GetAI = &GetAI_boss_ormorok; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_crystal_spike"; - newscript->GetAI = &GetAI_mob_crystal_spike; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_crystalline_tangler"; - newscript->GetAI = &GetAI_mob_crystalline_tangler; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/nexus/nexus/commander_kolurg.cpp b/src/bindings/scripts/scripts/zone/nexus/nexus/commander_kolurg.cpp deleted file mode 100644 index a28deb89264..00000000000 --- a/src/bindings/scripts/scripts/zone/nexus/nexus/commander_kolurg.cpp +++ /dev/null @@ -1,57 +0,0 @@ -/* Script Data Start -SDName: Boss Commander Kolurg -SDAuthor: LordVanMartin -SD%Complete: -SDComment: Only Alliance Heroic -SDCategory: -Script Data End */ - -/*** SQL START *** -update creature_template set scriptname = 'boss_commander_kolurg' where entry = ''; -*** SQL END ***/ -#include "precompiled.h" - -#define SPELL_BATTLE_SHOUT 31403 -#define SPELL_CHARGE 60067 -#define SPELL_FRIGHTENING_SHOUT 19134 -#define SPELL_WHIRLWIND_1 38619 -#define SPELL_WHIRLWIND_2 38618 - -//Yell -#define SAY_AGGRO 1576024 -#define SAY_KILL 1576025 -#define SAY_DEATH 1576026 - -struct TRINITY_DLL_DECL boss_commander_kolurgAI : public ScriptedAI -{ - boss_commander_kolurgAI(Creature *c) : ScriptedAI(c) {} - - void Reset() {} - void EnterCombat(Unit* who) {} - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - void JustDied(Unit* killer) {} -}; - -CreatureAI* GetAI_boss_commander_kolurg(Creature* pCreature) -{ - return new boss_commander_kolurgAI (pCreature); -} - -void AddSC_boss_commander_kolurg() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_commander_kolurg"; - newscript->GetAI = &GetAI_boss_commander_kolurg; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/nexus/nexus/commander_stoutbeard.cpp b/src/bindings/scripts/scripts/zone/nexus/nexus/commander_stoutbeard.cpp deleted file mode 100644 index 1bacd679e25..00000000000 --- a/src/bindings/scripts/scripts/zone/nexus/nexus/commander_stoutbeard.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/* Script Data Start -SDName: Boss Commander Stoutbeard -SDAuthor: LordVanMartin -SD%Complete: -SDComment: Only Horde Heroic -SDCategory: -Script Data End */ - -/*** SQL START *** -update creature_template set scriptname = 'boss_commander_stoutbeard' where entry = ''; -*** SQL END ***/ -#include "precompiled.h" - -#define SPELL_BATTLE_SHOUT 31403 -#define SPELL_CHARGE 60067 -#define SPELL_FRIGHTENING_SHOUT 19134 -#define SPELL_WHIRLWIND_1 38619 -#define SPELL_WHIRLWIND_2 38618 - -//Yell -#define SAY_AGGRO 1576021 -#define SAY_KILL 1576022 -#define SAY_DEATH 1576023 - -struct TRINITY_DLL_DECL boss_commander_stoutbeardAI : public ScriptedAI -{ - boss_commander_stoutbeardAI(Creature *c) : ScriptedAI(c) {} - - void Reset() {} - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - void JustDied(Unit* killer) - { - DoScriptText(SAY_DEATH, m_creature); - } -}; - -CreatureAI* GetAI_boss_commander_stoutbeard(Creature* pCreature) -{ - return new boss_commander_stoutbeardAI (pCreature); -} - -void AddSC_boss_commander_stoutbeard() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_commander_stoutbeard"; - newscript->GetAI = &GetAI_boss_commander_stoutbeard; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/nexus/nexus/def_nexus.h b/src/bindings/scripts/scripts/zone/nexus/nexus/def_nexus.h deleted file mode 100644 index 678e44e5bbe..00000000000 --- a/src/bindings/scripts/scripts/zone/nexus/nexus/def_nexus.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef DEF_NEXUS_H -#define DEF_NEXUS_H - -enum -{ - DATA_MAGUS_TELESTRA_EVENT, - DATA_ANOMALUS_EVENT, - DATA_ORMOROK_EVENT, - DATA_KERISTRASZA_EVENT, - - DATA_ANOMALUS, - DATA_KERISTRASZA, - - ANOMALUS_CONTAINMET_SPHERE, - ORMOROKS_CONTAINMET_SPHERE, - TELESTRAS_CONTAINMET_SPHERE -}; - -#endif diff --git a/src/bindings/scripts/scripts/zone/nexus/nexus/instance_nexus.cpp b/src/bindings/scripts/scripts/zone/nexus/nexus/instance_nexus.cpp deleted file mode 100644 index 169eda90d2a..00000000000 --- a/src/bindings/scripts/scripts/zone/nexus/nexus/instance_nexus.cpp +++ /dev/null @@ -1,258 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Instance_Nexus -SD%Complete: -SDComment: -SDCategory: The Nexus, The Nexus -EndScriptData */ - -#include "precompiled.h" -#include "def_nexus.h" - -#define NUMBER_OF_ENCOUNTERS 4 - -struct TRINITY_DLL_DECL instance_nexus : public ScriptedInstance -{ - instance_nexus(Map* pMap) : ScriptedInstance(pMap) { Initialize(); } - - uint32 m_auiEncounter[NUMBER_OF_ENCOUNTERS]; - - uint64 Anomalus; - uint64 Keristrasza; - - uint64 AnomalusContainmentSphere; - uint64 OrmoroksContainmentSphere; - uint64 TelestrasContainmentSphere; - - std::string strInstData; - - void Initialize() - { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - - Anomalus = 0; - } - - void OnCreatureCreate(Creature* pCreature, bool add) - { - Map::PlayerList const& players = instance->GetPlayers(); - uint32 TeamInInstance = 0; - - if (!players.isEmpty()) - { - if (Player* pPlayer = players.begin()->getSource()) - { - TeamInInstance = pPlayer->GetTeam(); - } - } - switch(pCreature->GetEntry()) - { - case 26763: Anomalus = pCreature->GetGUID(); break; - case 26723: Keristrasza = pCreature->GetGUID(); break; - case 26800: - { - //26799 - pCreature->setFaction(16); - if (TeamInInstance == ALLIANCE) - pCreature->SetDisplayId(24358); - break; - } - case 26802: - { - //26801 - pCreature->setFaction(16); - if (TeamInInstance == ALLIANCE) - pCreature->SetDisplayId(24354); - break; - } - case 26805: - { - //26803 - pCreature->setFaction(16); - if (TeamInInstance == ALLIANCE) - pCreature->SetDisplayId(24357); - break; - } - case 27949: - { - //27947 - pCreature->setFaction(16); - if (TeamInInstance == ALLIANCE) - pCreature->SetDisplayId(24352); - break; - } - case 26796: - { - //26798 - pCreature->setFaction(16); - if (TeamInInstance == ALLIANCE) - pCreature->SetDisplayId(24352); - break; - } - } - } - - void OnGameObjectCreate(GameObject* pGo, bool add) - { - switch(pGo->GetEntry()) - { - case 188527: - { - AnomalusContainmentSphere = pGo->GetGUID(); - if (m_auiEncounter[1] == DONE) - pGo->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1); - break; - } - case 188528: - { - OrmoroksContainmentSphere = pGo->GetGUID(); - if (m_auiEncounter[2] == DONE) - pGo->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1); - break; - } - case 188526: - { - TelestrasContainmentSphere = pGo->GetGUID(); - if (m_auiEncounter[0] == DONE) - pGo->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1); - break; - } - } - } - - uint32 GetData(uint32 identifier) - { - switch(identifier) - { - case DATA_MAGUS_TELESTRA_EVENT: return m_auiEncounter[0]; - case DATA_ANOMALUS_EVENT: return m_auiEncounter[1]; - case DATA_ORMOROK_EVENT: return m_auiEncounter[2]; - case DATA_KERISTRASZA_EVENT: return m_auiEncounter[3]; - } - return 0; - } - - void SetData(uint32 identifier, uint32 data) - { - switch(identifier) - { - case DATA_MAGUS_TELESTRA_EVENT: - { - if (data == DONE) - { - GameObject *Sphere = instance->GetGameObject(TelestrasContainmentSphere); - if (Sphere) - Sphere->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1); - } - m_auiEncounter[0] = data; - break; - } - case DATA_ANOMALUS_EVENT: - { - if (data == DONE) - { - GameObject *Sphere = instance->GetGameObject(AnomalusContainmentSphere); - if (Sphere) - Sphere->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1); - } - m_auiEncounter[1] = data; - break; - } - case DATA_ORMOROK_EVENT: - { - if (data == DONE) - { - GameObject *Sphere = instance->GetGameObject(OrmoroksContainmentSphere); - if (Sphere) - Sphere->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1); - } - m_auiEncounter[2] = data; - break; - } - case DATA_KERISTRASZA_EVENT: m_auiEncounter[3] = data; break; - } - - if (data == DONE) - { - OUT_SAVE_INST_DATA; - - std::ostringstream saveStream; - saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " " - << m_auiEncounter[3]; - - strInstData = saveStream.str(); - - SaveToDB(); - OUT_SAVE_INST_DATA_COMPLETE; - } - } - - uint64 GetData64(uint32 uiIdentifier) - { - switch(uiIdentifier) - { - case DATA_ANOMALUS: return Anomalus; - case DATA_KERISTRASZA: return Keristrasza; - case ANOMALUS_CONTAINMET_SPHERE: return AnomalusContainmentSphere; - case ORMOROKS_CONTAINMET_SPHERE: return OrmoroksContainmentSphere; - case TELESTRAS_CONTAINMET_SPHERE: return TelestrasContainmentSphere; - } - return 0; - } - - std::string GetSaveData() - { - return strInstData; - } - - void Load(const char* chrIn) - { - if (!chrIn) - { - OUT_LOAD_INST_DATA_FAIL; - return; - } - - OUT_LOAD_INST_DATA(chrIn); - - std::istringstream loadStream(chrIn); - loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3]; - - for(uint8 i = 1; i < NUMBER_OF_ENCOUNTERS; ++i) - { - if (m_auiEncounter[i] == IN_PROGRESS) - m_auiEncounter[i] = NOT_STARTED; - } - - OUT_LOAD_INST_DATA_COMPLETE; - } -}; - -InstanceData* GetInstanceData_instance_nexus(Map* pMap) -{ - return new instance_nexus(pMap); -} - -void AddSC_instance_nexus() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_nexus"; - newscript->GetInstanceData = &GetInstanceData_instance_nexus; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/nexus/oculus/boss_drakos.cpp b/src/bindings/scripts/scripts/zone/nexus/oculus/boss_drakos.cpp deleted file mode 100644 index bde90bf021e..00000000000 --- a/src/bindings/scripts/scripts/zone/nexus/oculus/boss_drakos.cpp +++ /dev/null @@ -1,82 +0,0 @@ -/* Script Data Start -SDName: Boss drakos -SDAuthor: LordVanMartin -SD%Complete: -SDComment: -SDCategory: -Script Data End */ - -/*** SQL START *** -update creature_template set scriptname = '' where entry = ''; -*** SQL END ***/ -#include "precompiled.h" - -//Spells -#define SPELL_MAGIC_PULL 51336 -#define SPELL_THUNDERING_STOMP 50774 -#define SPELL_THUNDERING_STOMP_2 59370 - -//Yell -#define SAY_AGGRO -1578000 -#define SAY_KILL_1 -1578001 -#define SAY_KILL_2 -1578002 -#define SAY_KILL_3 -1578003 -#define SAY_DEATH -1578004 -#define SAY_PULL_1 -1578005 -#define SAY_PULL_2 -1578006 -#define SAY_PULL_3 -1578007 -#define SAY_PULL_4 -1578008 -#define SAY_STOMP_1 -1578009 -#define SAY_STOMP_2 -1578010 -#define SAY_STOMP_3 -1578011 - -struct TRINITY_DLL_DECL boss_drakosAI : public ScriptedAI -{ - boss_drakosAI(Creature *c) : ScriptedAI(c) {} - - void Reset() {} - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - void JustDied(Unit* killer) - { - DoScriptText(SAY_DEATH, m_creature); - } - void KilledUnit(Unit *victim) - { - if (victim == m_creature) - return; - switch(rand()%3) - { - case 0: DoScriptText(SAY_KILL_1, m_creature);break; - case 1: DoScriptText(SAY_KILL_2, m_creature);break; - case 2: DoScriptText(SAY_KILL_3, m_creature);break; - } - } -}; - -CreatureAI* GetAI_boss_drakos(Creature* pCreature) -{ - return new boss_drakosAI (pCreature); -} - -void AddSC_boss_drakos() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_drakos"; - newscript->GetAI = &GetAI_boss_drakos; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/nexus/oculus/boss_eregos.cpp b/src/bindings/scripts/scripts/zone/nexus/oculus/boss_eregos.cpp deleted file mode 100644 index cc3fa3b3043..00000000000 --- a/src/bindings/scripts/scripts/zone/nexus/oculus/boss_eregos.cpp +++ /dev/null @@ -1,104 +0,0 @@ -/* Script Data Start -SDName: Boss eregos -SDAuthor: LordVanMartin -SD%Complete: -SDComment: Encounter is done entirely on drake vehicles -SDCategory: -Script Data End */ - -/*** SQL START *** -update creature_template set scriptname = '' where entry = ''; -*** SQL END ***/ -#include "precompiled.h" - -//Types of drake mounts: Ruby(Tank), Amber(DPS), Emerald(Healer) -//Two Repeating phases - -//Spells -#define SPELL_ARCANE_BARRAGE 50804 -#define SPELL_ARCANE_VOLLEY 51153 -#define SPELL_ENRAGED_ASSAULT 51170 -#define SPELL_PLANAR_ANOMALIES 57959 -#define SPELL_PLANAR_SHIFT 51162 - -//Heroic -#define SPELL_ARCANE_BARRAGE_H 59381 -#define SPELL_ARCANE_VOLLEY_H 59382 - -/*Ruby Drake , -(npc 27756) (item 37860) -(summoned by spell Ruby Essence = 37860 ---> Call Amber Drake == 49462 ---> Summon 27756) -*/ -#define NPC_RUBY_DRAKE_VEHICLE 27756 -#define SPELL_RIDE_RUBY_DRAKE_QUE 49463 //Apply Aura: Periodic Trigger, Interval: 3 seconds ---> 49464 -#define SPELL_RUBY_DRAKE_SADDLE 49464 //Allows you to ride on the back of an Amber Drake. ---> Dummy - -#define SPELL_RUBY_SEARING_WRATH 50232 //(60 yds) - Instant - Breathes a stream of fire at an enemy dragon, dealing 6800 to 9200 Fire damage and then jumping to additional dragons within 30 yards. Each jump increases the damage by 50%. Affects up to 5 total targets -#define SPELL_RUBY_EVASIVE_AURA 50248 //Instant - Allows the Ruby Drake to generate Evasive Charges when hit by hostile attacks and spells. -#define SPELL_RUBY_EVASIVE_MANEUVERS 50240 //Instant - 5 sec. cooldown - Allows your drake to dodge all incoming attacks and spells. Requires Evasive Charges to use. Each attack or spell dodged while this ability is active burns one Evasive Charge. Lasts 30 sec. or until all charges are exhausted. -//you do not have acces to until you kill Mage-Lord Urom -#define SPELL_RUBY_MARTYR 50253 //Instant - 10 sec. cooldown - Redirect all harmful spells cast at friendly drakes to yourself for 10 sec. - -/*Amber Drake, -(npc 27755) (item 37859) -(summoned by spell Amber Essence = 37859 ---> Call Amber Drake == 49461 ---> Summon 27755) -*/ -#define NPC_AMBER_DRAKE_VEHICLE 27755 -#define SPELL_RIDE_AMBER_DRAKE_QUE 49459 //Apply Aura: Periodic Trigger, Interval: 3 seconds ---> 49460 -#define SPELL_AMBER_DRAKE_SADDLE 49460 //Allows you to ride on the back of an Amber Drake. ---> Dummy - -#define SPELL_AMBER_SHOCK_LANCE 49840 //(60 yds) - Instant - Deals 4822 to 5602 Arcane damage and detonates all Shock Charges on an enemy dragon. Damage is increased by 6525 for each detonated. -#define SPELL_AMBER_STOP_TIME //Instant - 1 min cooldown - Halts the passage of time, freezing all enemy dragons in place for 10 sec. This attack applies 5 Shock Charges to each affected target. -//you do not have access to until you kill the Mage-Lord Urom. -#define SPELL_AMBER_TEMPORAL_RIFT 49592 //(60 yds) - Channeled - Channels a temporal rift on an enemy dragon for 10 sec. While trapped in the rift, all damage done to the target is increased by 100%. In addition, for every 15,000 damage done to a target affected by Temporal Rift, 1 Shock Charge is generated. - -/*Emerald Drake, -(npc 27692) (item 37815), - (summoned by spell Emerald Essence = 37815 ---> Call Emerald Drake == 49345 ---> Summon 27692) -*/ -#define NPC_EMERALD_DRAKE_VEHICLE 27692 -#define SPELL_RIDE_EMERALD_DRAKE_QUE 49427 //Apply Aura: Periodic Trigger, Interval: 3 seconds ---> 49346 -#define SPELL_EMERALD_DRAKE_SADDLE 49346 //Allows you to ride on the back of an Amber Drake. ---> Dummy - -#define SPELL_EMERALD_LEECHING_POISON 50328 //(60 yds) - Instant - Poisons the enemy dragon, leeching 1300 to the caster every 2 sec. for 12 sec. Stacks up to 3 times. -#define SPELL_EMERALD_TOUCH_THE_NIGHTMARE 50341 //(60 yds) - Instant - Consumes 30% of the caster's max health to inflict 25,000 nature damage to an enemy dragon and reduce the damage it deals by 25% for 30 sec. -// you do not have access to until you kill the Mage-Lord Urom -#define SPELL_EMERALD_DREAM_FUNNEL 50344 //(60 yds) - Channeled - Transfers 5% of the caster's max health to a friendly drake every second for 10 seconds as long as the caster channels. - -struct TRINITY_DLL_DECL boss_eregosAI : public ScriptedAI -{ - boss_eregosAI(Creature *c) : ScriptedAI(c) {} - - uint32 phase; - - void Reset() {} - void EnterCombat(Unit* who) {} - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - phase =1; - - DoMeleeAttackIfReady(); - } - void JustDied(Unit* killer) {} -}; - -CreatureAI* GetAI_boss_eregos(Creature* pCreature) -{ - return new boss_eregosAI (pCreature); -} - -void AddSC_boss_eregos() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_eregos"; - newscript->GetAI = &GetAI_boss_eregos; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/nexus/oculus/boss_urom.cpp b/src/bindings/scripts/scripts/zone/nexus/oculus/boss_urom.cpp deleted file mode 100644 index 1f34ecefbbd..00000000000 --- a/src/bindings/scripts/scripts/zone/nexus/oculus/boss_urom.cpp +++ /dev/null @@ -1,87 +0,0 @@ -/* Script Data Start -SDName: Boss urom -SDAuthor: LordVanMartin -SD%Complete: 1% -SDComment: -SDCategory: -Script Data End */ - -/*** SQL START *** -update creature_template set scriptname = '' where entry = ''; -*** SQL END ***/ -#include "precompiled.h" - -//Spells -#define SPELL_ARCANE_SHIELD 53813 //Dummy --> Channeled, shields the caster from damage. -#define SPELL_EMPOWERED_ARCANE_EXPLOSION 51110 -#define SPELL_EMPOWERED_ARCANE_EXPLOSION_2 59377 -#define SPELL_FROSTBOMB 51103 //Urom throws a bomb, hitting its target with the highest aggro which inflict directly 650 frost damage and drops a frost zone on the ground. This zone deals 650 frost damage per second and reduce the movement speed by 35%. Lasts 1 minute. -#define SPELL_SUMMON_MENAGERIE 50476 //Summons an assortment of creatures and teleports the caster to safety. -#define SPELL_SUMMON_MENAGERIE_2 50495 -#define SPELL_SUMMON_MENAGERIE_3 50496 -#define SPELL_TELEPORT 51112 //Teleports to the center of Oculus -#define SPELL_TIME_BOMB 51121 //Deals arcane damage to a random player, and after 6 seconds, deals zone damage to nearby equal to the health missing of the target afflicted by the debuff. -#define SPELL_TIME_BOMB_2 59376 - -//Yell -#define SAY_AGGRO -1578012 -#define SAY_KILL_1 -1578013 -#define SAY_KILL_2 -1578014 -#define SAY_KILL_3 -1578015 -#define SAY_DEATH -1578016 -#define SAY_EXPLOSION_1 -1578017 -#define SAY_EXPLOSION_2 -1578018 -#define SAY_SUMMON_1 -1578019 -#define SAY_SUMMON_2 -1578020 -#define SAY_SUMMON_3 -1578021 - -struct TRINITY_DLL_DECL boss_uromAI : public ScriptedAI -{ - boss_uromAI(Creature *c) : ScriptedAI(c) {} - - void Reset() {} - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - void JustDied(Unit* killer) - { - DoScriptText(SAY_DEATH, m_creature); - } - void KilledUnit(Unit *victim) - { - if (victim == m_creature) - return; - switch(rand()%3) - { - case 0: DoScriptText(SAY_KILL_1, m_creature);break; - case 1: DoScriptText(SAY_KILL_2, m_creature);break; - case 2: DoScriptText(SAY_KILL_3, m_creature);break; - } - } -}; - -CreatureAI* GetAI_boss_urom(Creature* pCreature) -{ - return new boss_uromAI (pCreature); -} - -void AddSC_boss_urom() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_urom"; - newscript->GetAI = &GetAI_boss_urom; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/nexus/oculus/boss_varos.cpp b/src/bindings/scripts/scripts/zone/nexus/oculus/boss_varos.cpp deleted file mode 100644 index 299c54dd8dc..00000000000 --- a/src/bindings/scripts/scripts/zone/nexus/oculus/boss_varos.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/* Script Data Start -SDName: Boss varos -SDAuthor: LordVanMartin -SD%Complete: -SDComment: -SDCategory: -Script Data End */ - -/*** SQL START *** -update creature_template set scriptname = '' where entry = ''; -*** SQL END ***/ -#include "precompiled.h" - -//Spells -#define SPELL_ENERGIZE_CORES 50785 //Damage 5938 to 6562, effec2 Triggers 54069, effect3 Triggers 56251 -#define SPELL_ENERGIZE_CORES_TRIGGER_1 54069 -#define SPELL_ENERGIZE_CORES_TRIGGER_2 56251 -#define SPELL_ENERGIZE_CORES_2 59372 //Damage 9025 to 9975, effect2 Triggers 54069, effect 56251 -#define SPELL_CALL_AZURE_RING_CAPTAIN 51002 //Effect Send Event (12229) -#define SPELL_CALL_AZURE_RING_CAPTAIN_2 51006 //Effect Send Event (10665) -#define SPELL_CALL_AZURE_RING_CAPTAIN_3 51007 //Effect Send Event (18454) -#define SPELL_CALL_AZURE_RING_CAPTAIN_4 51008 //Effect Send Event (18455) -#define SPELL_CALL_AMPLIFY_MAGIC 51054 -#define SPELL_CALL_AMPLIFY_MAGIC_2 59371 - -//Yell -#define SAY_AGGRO -1578022 -#define SAY_KILL_1 -1578023 -#define SAY_KILL_2 -1578024 -#define SAY_DEATH -1578025 -#define SAY_STRIKE_1 -1578026 -#define SAY_STRIKE_2 -1578027 -#define SAY_STRIKE_3 -1578028 -#define SAY_SPAWN -1578029 - - -struct TRINITY_DLL_DECL boss_varosAI : public ScriptedAI -{ - boss_varosAI(Creature *c) : ScriptedAI(c) {} - - void Reset() {} - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - void JustDied(Unit* killer) - { - DoScriptText(SAY_DEATH, m_creature); - } - void KilledUnit(Unit *victim) - { - if (victim == m_creature) - return; - switch(rand()%2) - { - case 0: DoScriptText(SAY_KILL_1, m_creature);break; - case 1: DoScriptText(SAY_KILL_2, m_creature);break; - } - } -}; - -CreatureAI* GetAI_boss_varos(Creature* pCreature) -{ - return new boss_varosAI (pCreature); -} - -void AddSC_boss_varos() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_varos"; - newscript->GetAI = &GetAI_boss_varos; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/nexus/oculus/def_oculus.h b/src/bindings/scripts/scripts/zone/nexus/oculus/def_oculus.h deleted file mode 100644 index 0b63a52d866..00000000000 --- a/src/bindings/scripts/scripts/zone/nexus/oculus/def_oculus.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef DEF_OCULUS_H -#define DEF_OCULUS_H - -#endif diff --git a/src/bindings/scripts/scripts/zone/nexus/oculus/instance_oculus.cpp b/src/bindings/scripts/scripts/zone/nexus/oculus/instance_oculus.cpp deleted file mode 100644 index b5ceee9e5ed..00000000000 --- a/src/bindings/scripts/scripts/zone/nexus/oculus/instance_oculus.cpp +++ /dev/null @@ -1,21 +0,0 @@ -#include "precompiled.h" -#include "def_oculus.h" - -struct TRINITY_DLL_DECL instance_oculus : public ScriptedInstance -{ - instance_oculus(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; -}; - -InstanceData* GetInstanceData_instance_oculus(Map* pMap) -{ - return new instance_oculus(pMap); -} - -void AddSC_instance_oculus() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_oculus"; - newscript->GetInstanceData = &GetInstanceData_instance_oculus; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/obsidian_sanctum/boss_sartharion.cpp b/src/bindings/scripts/scripts/zone/obsidian_sanctum/boss_sartharion.cpp deleted file mode 100644 index 01ba351ff99..00000000000 --- a/src/bindings/scripts/scripts/zone/obsidian_sanctum/boss_sartharion.cpp +++ /dev/null @@ -1,1153 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss Sartharion -SD%Complete: 70% -SDComment: Flame wave, achievement and portal events need to be implemented -SDCategory: Obsidian Sanctum -EndScriptData */ - -#include "precompiled.h" -#include "def_obsidian_sanctum.h" - -enum -{ - //Sartharion Yell - SAY_SARTHARION_AGGRO = -1615018, - SAY_SARTHARION_BERSERK = -1615019, - SAY_SARTHARION_BREATH = -1615020, - SAY_SARTHARION_CALL_SHADRON = -1615021, - SAY_SARTHARION_CALL_TENEBRON = -1615022, - SAY_SARTHARION_CALL_VESPERON = -1615023, - SAY_SARTHARION_DEATH = -1615024, - SAY_SARTHARION_SPECIAL_1 = -1615025, - SAY_SARTHARION_SPECIAL_2 = -1615026, - SAY_SARTHARION_SPECIAL_3 = -1615027, - SAY_SARTHARION_SPECIAL_4 = -1615028, - SAY_SARTHARION_SLAY_1 = -1615029, - SAY_SARTHARION_SLAY_2 = -1615030, - SAY_SARTHARION_SLAY_3 = -1615031, - - WHISPER_LAVA_CHURN = -1615032, - - WHISPER_SHADRON_DICIPLE = -1615008, - WHISPER_VESPERON_DICIPLE = -1615041, - WHISPER_HATCH_EGGS = -1615017, - WHISPER_OPEN_PORTAL = -1615042, // whisper, shared by two dragons - - //Sartharion Spells - SPELL_BERSERK = 61632, // Increases the caster's attack speed by 150% and all damage it deals by 500% for 5 min. - SPELL_CLEAVE = 56909, // Inflicts 35% weapon damage to an enemy and its nearest allies, affecting up to 10 targets. - SPELL_FLAME_BREATH = 56908, // Inflicts 8750 to 11250 Fire damage to enemies in a cone in front of the caster. - SPELL_FLAME_BREATH_H = 58956, // Inflicts 10938 to 14062 Fire damage to enemies in a cone in front of the caster. - SPELL_TAIL_LASH = 56910, // A sweeping tail strike hits all enemies behind the caster, inflicting 3063 to 3937 damage and stunning them for 2 sec. - SPELL_TAIL_LASH_H = 58957, // A sweeping tail strike hits all enemies behind the caster, inflicting 4375 to 5625 damage and stunning them for 2 sec. - SPELL_WILL_OF_SARTHARION = 61254, // Sartharion's presence bolsters the resolve of the Twilight Drakes, increasing their total health by 25%. This effect also increases Sartharion's health by 25%. - SPELL_LAVA_STRIKE = 57571, // (Real spell casted should be 57578) 57571 then trigger visual missile, then summon Lava Blaze on impact(spell 57572) - SPELL_TWILIGHT_REVENGE = 60639, - - SPELL_PYROBUFFET = 56916, // currently used for hard enrage after 15 minutes - SPELL_PYROBUFFET_RANGE = 58907, // possibly used when player get too far away from dummy creatures (2x Creature entry 30494) - - SPELL_TWILIGHT_SHIFT_ENTER = 57620, // enter phase. Player get this when click GO - SPELL_TWILIGHT_SHIFT_REMOVAL = 61187, // leave phase - SPELL_TWILIGHT_SHIFT_REMOVAL_ALL = 61190, // leave phase (probably version to make all leave) - - //Mini bosses common spells - SPELL_TWILIGHT_RESIDUE = 61885, // makes immune to shadow damage, applied when leave phase - - //Miniboses (Vesperon, Shadron, Tenebron) - SPELL_SHADOW_BREATH_H = 59126, // Inflicts 8788 to 10212 Fire damage to enemies in a cone in front of the caster. - SPELL_SHADOW_BREATH = 57570, // Inflicts 6938 to 8062 Fire damage to enemies in a cone in front of the caster. - - SPELL_SHADOW_FISSURE_H = 59127, // Deals 9488 to 13512 Shadow damage to any enemy within the Shadow fissure after 5 sec. - SPELL_SHADOW_FISSURE = 57579, // Deals 6188 to 8812 Shadow damage to any enemy within the Shadow fissure after 5 sec. - - //Vesperon - //In portal is a disciple, when disciple killed remove Power_of_vesperon, portal open multiple times - NPC_ACOLYTE_OF_VESPERON = 31219, // Acolyte of Vesperon - SPELL_POWER_OF_VESPERON = 61251, // Vesperon's presence decreases the maximum health of all enemies by 25%. - SPELL_TWILIGHT_TORMENT_VESP = 57948, // (Shadow only) trigger 57935 then 57988 - SPELL_TWILIGHT_TORMENT_VESP_ACO = 58853, // (Fire and Shadow) trigger 58835 then 57988 - - //Shadron - //In portal is a disciple, when disciple killed remove Power_of_vesperon, portal open multiple times - NPC_ACOLYTE_OF_SHADRON = 31218, // Acolyte of Shadron - SPELL_POWER_OF_SHADRON = 58105, // Shadron's presence increases Fire damage taken by all enemies by 100%. - SPELL_GIFT_OF_TWILIGTH_SHA = 57835, // TARGET_SCRIPT shadron - SPELL_GIFT_OF_TWILIGTH_SAR = 58766, // TARGET_SCRIPT sartharion - - //Tenebron - //in the portal spawns 6 eggs, if not killed in time (approx. 20s) they will hatch, whelps can cast 60708 - SPELL_POWER_OF_TENEBRON = 61248, // Tenebron's presence increases Shadow damage taken by all enemies by 100%. - //Tenebron, dummy spell - SPELL_SUMMON_TWILIGHT_WHELP = 58035, // doesn't work, will spawn NPC_TWILIGHT_WHELP - SPELL_SUMMON_SARTHARION_TWILIGHT_WHELP = 58826, // doesn't work, will spawn NPC_SHARTHARION_TWILIGHT_WHELP - - SPELL_HATCH_EGGS_H = 59189, - SPELL_HATCH_EGGS = 58542, - SPELL_HATCH_EGGS_EFFECT_H = 59190, - SPELL_HATCH_EGGS_EFFECT = 58685, - - //Whelps - NPC_TWILIGHT_WHELP = 30890, - NPC_SHARTHARION_TWILIGHT_WHELP = 31214, - SPELL_FADE_ARMOR = 60708, // Reduces the armor of an enemy by 1500 for 15s - - //flame tsunami - SPELL_FLAME_TSUNAMI = 57494, // the visual dummy - SPELL_FLAME_TSUNAMI_LEAP = 60241, // SPELL_EFFECT_138 some leap effect, causing caster to move in direction - SPELL_FLAME_TSUNAMI_DMG_AURA = 57492, // periodic damage, npc has this aura - - NPC_FLAME_TSUNAMI = 30616, // for the flame waves - NPC_LAVA_BLAZE = 30643, // adds spawning from flame strike - - //using these custom points for dragons start and end - POINT_ID_INIT = 100, - POINT_ID_LAND = 200 -}; - -struct Waypoint -{ - float m_fX, m_fY, m_fZ; -}; - -//each dragons special points. First where fly to before connect to connon, second where land point is. -Waypoint m_aTene[]= -{ - {3212.854, 575.597, 109.856}, //init - {3246.425, 565.367, 61.249} //end -}; - -Waypoint m_aShad[]= -{ - {3293.238, 472.223, 106.968}, - {3271.669, 526.907, 61.931} -}; - -Waypoint m_aVesp[]= -{ - {3193.310, 472.861, 102.697}, - {3227.268, 533.238, 59.995} -}; - -//points around raid "isle", counter clockwise. should probably be adjusted to be more alike -Waypoint m_aDragonCommon[]= -{ - {3214.012, 468.932, 98.652}, - {3244.950, 468.427, 98.652}, - {3283.520, 496.869, 98.652}, - {3287.316, 555.875, 98.652}, - {3250.479, 585.827, 98.652}, - {3209.969, 566.523, 98.652} -}; - -/*###### -## Boss Sartharion -######*/ - -struct TRINITY_DLL_DECL boss_sartharionAI : public ScriptedAI -{ - boss_sartharionAI(Creature* pCreature) : ScriptedAI(pCreature) - { - m_pInstance = pCreature->GetInstanceData(); - m_bIsHeroic = pCreature->GetMap()->IsHeroic(); - } - - ScriptedInstance* m_pInstance; - bool m_bIsHeroic; - - bool m_bIsBerserk; - bool m_bIsSoftEnraged; - - uint32 m_uiEnrageTimer; - bool m_bIsHardEnraged; - - uint32 m_uiTenebronTimer; - uint32 m_uiShadronTimer; - uint32 m_uiVesperonTimer; - - uint32 m_uiFlameTsunamiTimer; - uint32 m_uiFlameBreathTimer; - uint32 m_uiTailSweepTimer; - uint32 m_uiCleaveTimer; - uint32 m_uiLavaStrikeTimer; - - bool m_bHasCalledTenebron; - bool m_bHasCalledShadron; - bool m_bHasCalledVesperon; - - void Reset() - { - m_bIsBerserk = false; - m_bIsSoftEnraged = false; - - m_uiEnrageTimer = MINUTE*15*IN_MILISECONDS; - m_bIsHardEnraged = false; - - m_uiTenebronTimer = 30000; - m_uiShadronTimer = 75000; - m_uiVesperonTimer = 120000; - - m_uiFlameTsunamiTimer = 30000; - m_uiFlameBreathTimer = 20000; - m_uiTailSweepTimer = 20000; - m_uiCleaveTimer = 7000; - m_uiLavaStrikeTimer = 5000; - - m_bHasCalledTenebron = false; - m_bHasCalledShadron = false; - m_bHasCalledVesperon = false; - - if (m_creature->HasAura(SPELL_TWILIGHT_REVENGE)) - m_creature->RemoveAurasDueToSpell(SPELL_TWILIGHT_REVENGE); - } - - void JustReachedHome() - { - if (m_pInstance) - m_pInstance->SetData(TYPE_SARTHARION_EVENT, NOT_STARTED); - } - - void Aggro(Unit* pWho) - { - DoScriptText(SAY_SARTHARION_AGGRO,m_creature); - DoZoneInCombat(); - - if (m_pInstance) - { - m_pInstance->SetData(TYPE_SARTHARION_EVENT, IN_PROGRESS); - FetchDragons(); - } - } - - void JustDied(Unit* pKiller) - { - DoScriptText(SAY_SARTHARION_DEATH,m_creature); - - if (m_pInstance) - m_pInstance->SetData(TYPE_SARTHARION_EVENT, DONE); - } - - void KilledUnit(Unit* pVictim) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_SARTHARION_SLAY_1, m_creature); break; - case 1: DoScriptText(SAY_SARTHARION_SLAY_2, m_creature); break; - case 2: DoScriptText(SAY_SARTHARION_SLAY_3, m_creature); break; - } - } - - void FetchDragons() - { - Unit* pTene = Unit::GetUnit(*m_creature,m_pInstance->GetData64(DATA_TENEBRON)); - Unit* pShad = Unit::GetUnit(*m_creature,m_pInstance->GetData64(DATA_SHADRON)); - Unit* pVesp = Unit::GetUnit(*m_creature,m_pInstance->GetData64(DATA_VESPERON)); - - //if at least one of the dragons are alive and are being called - bool bCanUseWill = false; - - if (pTene && pTene->isAlive() && !pTene->getVictim()) - { - bCanUseWill = true; - pTene->GetMotionMaster()->MovePoint(POINT_ID_INIT, m_aTene[0].m_fX, m_aTene[0].m_fY, m_aTene[0].m_fZ); - - if (!pTene->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) - pTene->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - } - - if (pShad && pShad->isAlive() && !pShad->getVictim()) - { - bCanUseWill = true; - pShad->GetMotionMaster()->MovePoint(POINT_ID_INIT, m_aShad[0].m_fX, m_aShad[0].m_fY, m_aShad[0].m_fZ); - - if (!pShad->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) - pShad->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - } - - if (pVesp && pVesp->isAlive() && !pVesp->getVictim()) - { - bCanUseWill = true; - pVesp->GetMotionMaster()->MovePoint(POINT_ID_INIT, m_aVesp[0].m_fX, m_aVesp[0].m_fY, m_aVesp[0].m_fZ); - - if (!pVesp->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) - pVesp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - } - - if (bCanUseWill) - DoCast(m_creature, SPELL_WILL_OF_SARTHARION); - } - - void CallDragon(uint32 uiDataId) - { - if (m_pInstance) - { - Creature* pTemp = Unit::GetCreature((*m_creature),m_pInstance->GetData64(uiDataId)); - - if (pTemp && pTemp->isAlive() && !pTemp->getVictim()) - { - if (pTemp->HasUnitMovementFlag(MOVEMENTFLAG_WALK_MODE)) - pTemp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - - if (pTemp->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) - pTemp->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - - int32 iTextId = 0; - - switch(pTemp->GetEntry()) - { - case NPC_TENEBRON: - iTextId = SAY_SARTHARION_CALL_TENEBRON; - pTemp->GetMotionMaster()->MovePoint(POINT_ID_LAND, m_aTene[1].m_fX, m_aTene[1].m_fY, m_aTene[1].m_fZ); - break; - case NPC_SHADRON: - iTextId = SAY_SARTHARION_CALL_SHADRON; - pTemp->GetMotionMaster()->MovePoint(POINT_ID_LAND, m_aShad[1].m_fX, m_aShad[1].m_fY, m_aShad[1].m_fZ); - break; - case NPC_VESPERON: - iTextId = SAY_SARTHARION_CALL_VESPERON; - pTemp->GetMotionMaster()->MovePoint(POINT_ID_LAND, m_aVesp[1].m_fX, m_aVesp[1].m_fY, m_aVesp[1].m_fZ); - break; - } - - DoScriptText(iTextId, m_creature); - } - } - } - - void SendFlameTsunami() - { - Map* pMap = m_creature->GetMap(); - - if (pMap && pMap->IsDungeon()) - { - Map::PlayerList const &PlayerList = pMap->GetPlayers(); - - if (!PlayerList.isEmpty()) - { - for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) - { - if (i->getSource()->isAlive()) - DoScriptText(WHISPER_LAVA_CHURN,m_creature,i->getSource()); - } - } - } - } - - void UpdateAI(const uint32 uiDiff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //spell will target dragons, if they are still alive at 35% - if (!m_bIsBerserk && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) <= 35) - { - DoScriptText(SAY_SARTHARION_BERSERK,m_creature); - DoCast(m_creature,SPELL_BERSERK); - m_bIsBerserk = true; - } - - //soft enrage - if (!m_bIsSoftEnraged && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) <= 10) - { - // TODO - m_bIsSoftEnraged = true; - } - - // hard enrage - if (!m_bIsHardEnraged) - { - if (m_uiEnrageTimer < uiDiff) - { - DoCast(m_creature, SPELL_PYROBUFFET, true); - m_bIsHardEnraged = true; - } - else - m_uiEnrageTimer -= uiDiff; - } - - // flame tsunami - if (m_uiFlameTsunamiTimer < uiDiff) - { - SendFlameTsunami(); - m_uiFlameTsunamiTimer = 30000; - } - else - m_uiFlameTsunamiTimer -= uiDiff; - - // flame breath - if (m_uiFlameBreathTimer < uiDiff) - { - DoScriptText(SAY_SARTHARION_BREATH, m_creature); - DoCast(m_creature->getVictim(), m_bIsHeroic ? SPELL_FLAME_BREATH_H : SPELL_FLAME_BREATH); - m_uiFlameBreathTimer = 25000 + rand()%10000; - } - else - m_uiFlameBreathTimer -= uiDiff; - - // Tail Sweep - if (m_uiTailSweepTimer < uiDiff) - { - DoCast(m_creature->getVictim(), m_bIsHeroic ? SPELL_TAIL_LASH_H : SPELL_TAIL_LASH); - m_uiTailSweepTimer = 15000 + rand()%5000; - } - else - m_uiTailSweepTimer -= uiDiff; - - // Cleave - if (m_uiCleaveTimer < uiDiff) - { - DoCast(m_creature->getVictim(), SPELL_CLEAVE); - m_uiCleaveTimer = 7000 + rand()%3000; - } - else - m_uiCleaveTimer -= uiDiff; - - // Lavas Strike - if (m_uiLavaStrikeTimer < uiDiff) - { - if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) - { - DoCast(pTarget, SPELL_LAVA_STRIKE); - - switch(rand()%15) - { - case 0: DoScriptText(SAY_SARTHARION_SPECIAL_1, m_creature); break; - case 1: DoScriptText(SAY_SARTHARION_SPECIAL_2, m_creature); break; - case 2: DoScriptText(SAY_SARTHARION_SPECIAL_3, m_creature); break; - } - } - m_uiLavaStrikeTimer = 5000 + rand()%15000; - } - else - m_uiLavaStrikeTimer -= uiDiff; - - // call tenebron - if (!m_bHasCalledTenebron && m_uiTenebronTimer < uiDiff) - { - CallDragon(DATA_TENEBRON); - m_bHasCalledTenebron = true; - } - else - m_uiTenebronTimer -= uiDiff; - - // call shadron - if (!m_bHasCalledShadron && m_uiShadronTimer < uiDiff) - { - CallDragon(DATA_SHADRON); - m_bHasCalledShadron = true; - } - else - m_uiShadronTimer -= uiDiff; - - // call vesperon - if (!m_bHasCalledVesperon && m_uiVesperonTimer < uiDiff) - { - CallDragon(DATA_VESPERON); - m_bHasCalledVesperon = true; - } - else - m_uiVesperonTimer -= uiDiff; - - DoMeleeAttackIfReady(); - - EnterEvadeIfOutOfCombatArea(uiDiff); - } -}; - -CreatureAI* GetAI_boss_sartharion(Creature* pCreature) -{ - return new boss_sartharionAI(pCreature); -} - -enum TeneText -{ - SAY_TENEBRON_AGGRO = -1615009, - SAY_TENEBRON_SLAY_1 = -1615010, - SAY_TENEBRON_SLAY_2 = -1615011, - SAY_TENEBRON_DEATH = -1615012, - SAY_TENEBRON_BREATH = -1615013, - SAY_TENEBRON_RESPOND = -1615014, - SAY_TENEBRON_SPECIAL_1 = -1615015, - SAY_TENEBRON_SPECIAL_2 = -1615016 -}; - -enum ShadText -{ - SAY_SHADRON_AGGRO = -1615000, - SAY_SHADRON_SLAY_1 = -1615001, - SAY_SHADRON_SLAY_2 = -1615002, - SAY_SHADRON_DEATH = -1615003, - SAY_SHADRON_BREATH = -1615004, - SAY_SHADRON_RESPOND = -1615005, - SAY_SHADRON_SPECIAL_1 = -1615006, - SAY_SHADRON_SPECIAL_2 = -1615007 -}; - -enum VespText -{ - SAY_VESPERON_AGGRO = -1615033, - SAY_VESPERON_SLAY_1 = -1615034, - SAY_VESPERON_SLAY_2 = -1615035, - SAY_VESPERON_DEATH = -1615036, - SAY_VESPERON_BREATH = -1615037, - SAY_VESPERON_RESPOND = -1615038, - SAY_VESPERON_SPECIAL_1 = -1615039, - SAY_VESPERON_SPECIAL_2 = -1615040 -}; - -//to control each dragons common abilities -struct TRINITY_DLL_DECL dummy_dragonAI : public ScriptedAI -{ - dummy_dragonAI(Creature* pCreature) : ScriptedAI(pCreature) - { - m_pInstance = pCreature->GetInstanceData(); - m_bIsHeroic = pCreature->GetMap()->IsHeroic(); - } - - ScriptedInstance* m_pInstance; - bool m_bIsHeroic; - - uint32 m_uiWaypointId; - uint32 m_uiMoveNextTimer; - int32 m_iPortalRespawnTime; - bool m_bCanMoveFree; - - void Reset() - { - if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - - m_uiWaypointId = 0; - m_uiMoveNextTimer = 500; - m_iPortalRespawnTime = 30000; - m_bCanMoveFree = false; - } - - void MovementInform(uint32 uiType, uint32 uiPointId) - { - if (!m_pInstance || uiType != POINT_MOTION_TYPE) - return; - - debug_log("dummy_dragonAI: %s reached point %u", m_creature->GetName(), uiPointId); - - //if healers messed up the raid and we was already initialized - if (m_pInstance->GetData(TYPE_SARTHARION_EVENT) != IN_PROGRESS) - { - EnterEvadeMode(); - return; - } - - //this is end, if we reach this, don't do much - if (uiPointId == POINT_ID_LAND) - { - m_creature->GetMotionMaster()->Clear(); - m_bCanMoveFree = false; - return; - } - - //get amount of common points - uint32 uiCommonWPCount = sizeof(m_aDragonCommon)/sizeof(Waypoint); - - //increase - m_uiWaypointId = uiPointId+1; - - //if we have reached a point bigger or equal to count, it mean we must reset to point 0 - if (m_uiWaypointId >= uiCommonWPCount) - { - if (!m_bCanMoveFree) - m_bCanMoveFree = true; - - m_uiWaypointId = 0; - } - - m_uiMoveNextTimer = 500; - } - - //used when open portal and spawn mobs in phase - void DoRaidWhisper(int32 iTextId) - { - Map* pMap = m_creature->GetMap(); - - if (pMap && pMap->IsDungeon()) - { - Map::PlayerList const &PlayerList = pMap->GetPlayers(); - - if (!PlayerList.isEmpty()) - { - for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) - DoScriptText(iTextId, m_creature, i->getSource()); - } - } - } - - //"opens" the portal and does the "opening" whisper - void OpenPortal() - { - int32 iTextId = 0; - - //there are 4 portal spawn locations, each are expected to be spawned with negative spawntimesecs in database - - //using a grid search here seem to be more efficient than caching all four guids - //in instance script and calculate range to each. - GameObject* pPortal = m_creature->FindNearestGameObject(GO_TWILIGHT_PORTAL,50.0f); - - switch(m_creature->GetEntry()) - { - case NPC_TENEBRON: - iTextId = WHISPER_HATCH_EGGS; - break; - case NPC_SHADRON: - case NPC_VESPERON: - iTextId = WHISPER_OPEN_PORTAL; - break; - } - - DoRaidWhisper(iTextId); - - //By using SetRespawnTime() we will actually "spawn" the object with our defined time. - //Once time is up, portal will disappear again. - if (pPortal && !pPortal->isSpawned()) - pPortal->SetRespawnTime(m_iPortalRespawnTime); - - //Unclear what are expected to happen if one drake has a portal open already - //Refresh respawnTime so time again are set to 30secs? - } - - //Removes each drakes unique debuff from players - void RemoveDebuff(uint32 uiSpellId) - { - Map* pMap = m_creature->GetMap(); - - if (pMap && pMap->IsDungeon()) - { - Map::PlayerList const &PlayerList = pMap->GetPlayers(); - - if (PlayerList.isEmpty()) - return; - - for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) - { - if (i->getSource()->isAlive() && i->getSource()->HasAura(uiSpellId)) - i->getSource()->RemoveAurasDueToSpell(uiSpellId); - } - } - } - - void JustDied(Unit* pKiller) - { - int32 iTextId = 0; - uint32 uiSpellId = 0; - - switch(m_creature->GetEntry()) - { - case NPC_TENEBRON: - iTextId = SAY_TENEBRON_DEATH; - uiSpellId = SPELL_POWER_OF_TENEBRON; - break; - case NPC_SHADRON: - iTextId = SAY_SHADRON_DEATH; - uiSpellId = SPELL_POWER_OF_SHADRON; - break; - case NPC_VESPERON: - iTextId = SAY_VESPERON_DEATH; - uiSpellId = SPELL_POWER_OF_VESPERON; - break; - } - - DoScriptText(iTextId, m_creature); - - RemoveDebuff(uiSpellId); - - if (m_pInstance) - { - // not if solo mini-boss fight - if (m_pInstance->GetData(TYPE_SARTHARION_EVENT) != IN_PROGRESS) - return; - - // Twilight Revenge to main boss - if (Unit* pSartharion = Unit::GetUnit((*m_creature), m_pInstance->GetData64(DATA_SARTHARION))) - { - if (pSartharion->isAlive()) - m_creature->CastSpell(pSartharion,SPELL_TWILIGHT_REVENGE,true); - } - } - } - - void UpdateAI(const uint32 uiDiff) - { - if (m_bCanMoveFree && m_uiMoveNextTimer) - { - if (m_uiMoveNextTimer < uiDiff) - { - m_creature->GetMotionMaster()->MovePoint(m_uiWaypointId, - m_aDragonCommon[m_uiWaypointId].m_fX, m_aDragonCommon[m_uiWaypointId].m_fY, m_aDragonCommon[m_uiWaypointId].m_fZ); - - debug_log("dummy_dragonAI: %s moving to point %u", m_creature->GetName(), m_uiWaypointId); - m_uiMoveNextTimer = 0; - } - else - m_uiMoveNextTimer -= uiDiff; - } - } -}; - -/*###### -## Mob Tenebron -######*/ - -struct TRINITY_DLL_DECL mob_tenebronAI : public dummy_dragonAI -{ - mob_tenebronAI(Creature* pCreature) : dummy_dragonAI(pCreature) { } - - uint32 m_uiShadowBreathTimer; - uint32 m_uiShadowFissureTimer; - uint32 m_uiHatchEggTimer; - - void Reset() - { - m_uiShadowBreathTimer = 20000; - m_uiShadowFissureTimer = 5000; - m_uiHatchEggTimer = 30000; - } - - void Aggro(Unit* pWho) - { - DoScriptText(SAY_TENEBRON_AGGRO, m_creature); - DoZoneInCombat(); - DoCast(m_creature, SPELL_POWER_OF_TENEBRON); - } - - void KilledUnit(Unit* pVictim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_TENEBRON_SLAY_1, m_creature); break; - case 1: DoScriptText(SAY_TENEBRON_SLAY_2, m_creature); break; - } - } - - void UpdateAI(const uint32 uiDiff) - { - //if no target, update dummy and return - if (!UpdateVictim()) - { - dummy_dragonAI::UpdateAI(uiDiff); - return; - } - - // shadow fissure - if (m_uiShadowFissureTimer < uiDiff) - { - if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) - DoCast(pTarget, m_bIsHeroic ? SPELL_SHADOW_FISSURE_H : SPELL_SHADOW_FISSURE); - - m_uiShadowFissureTimer = 15000 + rand()%5000; - } - else - m_uiShadowFissureTimer -= uiDiff; - - // shadow breath - if (m_uiShadowBreathTimer < uiDiff) - { - DoScriptText(SAY_TENEBRON_BREATH, m_creature); - DoCast(m_creature->getVictim(), m_bIsHeroic ? SPELL_SHADOW_BREATH_H : SPELL_SHADOW_BREATH); - m_uiShadowBreathTimer = 20000 + rand()%5000; - } - else - m_uiShadowBreathTimer -= uiDiff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_tenebron(Creature* pCreature) -{ - return new mob_tenebronAI(pCreature); -} - -/*###### -## Mob Shadron -######*/ - -struct TRINITY_DLL_DECL mob_shadronAI : public dummy_dragonAI -{ - mob_shadronAI(Creature* pCreature) : dummy_dragonAI(pCreature) { } - - uint32 m_uiShadowBreathTimer; - uint32 m_uiShadowFissureTimer; - uint32 m_uiAcolyteShadronTimer; - - void Reset() - { - m_uiShadowBreathTimer = 20000; - m_uiShadowFissureTimer = 5000; - m_uiAcolyteShadronTimer = 60000; - - if (m_creature->HasAura(SPELL_TWILIGHT_TORMENT_VESP)) - m_creature->RemoveAurasDueToSpell(SPELL_TWILIGHT_TORMENT_VESP); - - if (m_creature->HasAura(SPELL_GIFT_OF_TWILIGTH_SHA)) - m_creature->RemoveAurasDueToSpell(SPELL_GIFT_OF_TWILIGTH_SHA); - } - - void Aggro(Unit* pWho) - { - DoScriptText(SAY_SHADRON_AGGRO,m_creature); - DoZoneInCombat(); - DoCast(m_creature, SPELL_POWER_OF_SHADRON); - } - - void KilledUnit(Unit* pVictim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_SHADRON_SLAY_1, m_creature); break; - case 1: DoScriptText(SAY_SHADRON_SLAY_2, m_creature); break; - } - } - - void UpdateAI(const uint32 uiDiff) - { - //if no target, update dummy and return - if (!UpdateVictim()) - { - dummy_dragonAI::UpdateAI(uiDiff); - return; - } - - // shadow fissure - if (m_uiShadowFissureTimer < uiDiff) - { - if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) - DoCast(pTarget, m_bIsHeroic ? SPELL_SHADOW_FISSURE_H : SPELL_SHADOW_FISSURE); - - m_uiShadowFissureTimer = 15000 + rand()%5000; - } - else - m_uiShadowFissureTimer -= uiDiff; - - // shadow breath - if (m_uiShadowBreathTimer < uiDiff) - { - DoScriptText(SAY_SHADRON_BREATH, m_creature); - DoCast(m_creature->getVictim(), m_bIsHeroic ? SPELL_SHADOW_BREATH_H : SPELL_SHADOW_BREATH); - m_uiShadowBreathTimer = 20000 + rand()%5000; - } - else - m_uiShadowBreathTimer -= uiDiff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_shadron(Creature* pCreature) -{ - return new mob_shadronAI(pCreature); -} - -/*###### -## Mob Vesperon -######*/ - -struct TRINITY_DLL_DECL mob_vesperonAI : public dummy_dragonAI -{ - mob_vesperonAI(Creature* pCreature) : dummy_dragonAI(pCreature) { } - - uint32 m_uiShadowBreathTimer; - uint32 m_uiShadowFissureTimer; - uint32 m_uiAcolyteVesperonTimer; - - void Reset() - { - m_uiShadowBreathTimer = 20000; - m_uiShadowFissureTimer = 5000; - m_uiAcolyteVesperonTimer = 60000; - } - - void Aggro(Unit* pWho) - { - DoScriptText(SAY_VESPERON_AGGRO,m_creature); - DoZoneInCombat(); - DoCast(m_creature, SPELL_POWER_OF_VESPERON); - } - - void KilledUnit(Unit* pVictim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_VESPERON_SLAY_1, m_creature); break; - case 1: DoScriptText(SAY_VESPERON_SLAY_2, m_creature); break; - } - } - - void UpdateAI(const uint32 uiDiff) - { - //if no target, update dummy and return - if (!UpdateVictim()) - { - dummy_dragonAI::UpdateAI(uiDiff); - return; - } - - // shadow fissure - if (m_uiShadowFissureTimer < uiDiff) - { - if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) - DoCast(pTarget, m_bIsHeroic ? SPELL_SHADOW_FISSURE_H : SPELL_SHADOW_FISSURE); - - m_uiShadowFissureTimer = 15000 + rand()%5000; - } - else - m_uiShadowFissureTimer -= uiDiff; - - // shadow breath - if (m_uiShadowBreathTimer < uiDiff) - { - DoScriptText(SAY_VESPERON_BREATH, m_creature); - DoCast(m_creature->getVictim(), m_bIsHeroic ? SPELL_SHADOW_BREATH_H : SPELL_SHADOW_BREATH); - m_uiShadowBreathTimer = 20000 + rand()%5000; - } - else - m_uiShadowBreathTimer -= uiDiff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_vesperon(Creature* pCreature) -{ - return new mob_vesperonAI(pCreature); -} - -/*###### -## Mob Acolyte of Shadron -######*/ - -struct TRINITY_DLL_DECL mob_acolyte_of_shadronAI : public ScriptedAI -{ - mob_acolyte_of_shadronAI(Creature* pCreature) : ScriptedAI(pCreature) - { - m_pInstance = pCreature->GetInstanceData(); - } - - ScriptedInstance* m_pInstance; - - void Reset() - { - if (m_pInstance) - { - //if not solo figth, buff main boss, else place debuff on mini-boss. both spells TARGET_SCRIPT - if (m_pInstance->GetData(TYPE_SARTHARION_EVENT) == IN_PROGRESS) - DoCast(m_creature, SPELL_GIFT_OF_TWILIGTH_SAR); - else - DoCast(m_creature, SPELL_GIFT_OF_TWILIGTH_SHA); - } - } - - void JustDied(Unit* killer) - { - if (m_pInstance) - { - Creature* pDebuffTarget = NULL; - - if (m_pInstance->GetData(TYPE_SARTHARION_EVENT) == IN_PROGRESS) - { - //not solo fight, so main boss has deduff - pDebuffTarget = m_pInstance->instance->GetCreature(m_pInstance->GetData64(DATA_SARTHARION)); - - if (pDebuffTarget && pDebuffTarget->isAlive() && pDebuffTarget->HasAura(SPELL_GIFT_OF_TWILIGTH_SAR)) - pDebuffTarget->RemoveAurasDueToSpell(SPELL_GIFT_OF_TWILIGTH_SAR); - } - else - { - //event not in progress, then solo fight and must remove debuff mini-boss - pDebuffTarget = m_pInstance->instance->GetCreature(m_pInstance->GetData64(DATA_SHADRON)); - - if (pDebuffTarget && pDebuffTarget->isAlive() && pDebuffTarget->HasAura(SPELL_GIFT_OF_TWILIGTH_SHA)) - pDebuffTarget->RemoveAurasDueToSpell(SPELL_GIFT_OF_TWILIGTH_SHA); - } - } - } - - void UpdateAI(const uint32 uiDiff) - { - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_acolyte_of_shadron(Creature* pCreature) -{ - return new mob_acolyte_of_shadronAI(pCreature); -} - -/*###### -## Mob Acolyte of Vesperon -######*/ - -struct TRINITY_DLL_DECL mob_acolyte_of_vesperonAI : public ScriptedAI -{ - mob_acolyte_of_vesperonAI(Creature* pCreature) : ScriptedAI(pCreature) - { - m_pInstance = pCreature->GetInstanceData(); - } - - ScriptedInstance* m_pInstance; - - void Reset() - { - DoCast(m_creature, SPELL_TWILIGHT_TORMENT_VESP_ACO); - } - - void JustDied(Unit* pKiller) - { - // remove twilight torment on Vesperon - if (m_pInstance) - { - Creature* pVesperon = m_pInstance->instance->GetCreature(m_pInstance->GetData64(DATA_VESPERON)); - - if (pVesperon && pVesperon->isAlive() && pVesperon->HasAura(SPELL_TWILIGHT_TORMENT_VESP)) - pVesperon->RemoveAurasDueToSpell(SPELL_TWILIGHT_TORMENT_VESP); - } - } - - void UpdateAI(const uint32 uiDiff) - { - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_acolyte_of_vesperon(Creature* pCreature) -{ - return new mob_acolyte_of_vesperonAI(pCreature); -} - -/*###### -## Mob Twilight Eggs -######*/ - -struct TRINITY_DLL_DECL mob_twilight_eggsAI : public ScriptedAI -{ - mob_twilight_eggsAI(Creature* pCreature) : ScriptedAI(pCreature) { } - - uint32 m_uiFadeArmorTimer; - - void Reset() - { - m_uiFadeArmorTimer = 1000; - } - - void AttackStart(Unit* pWho) { } - void MoveInLineOfSight(Unit* pWho) { } -}; - -CreatureAI* GetAI_mob_twilight_eggs(Creature* pCreature) -{ - return new mob_twilight_eggsAI(pCreature); -} - -/*###### -## Mob Twilight Whelps -######*/ - -struct TRINITY_DLL_DECL mob_twilight_whelpAI : public ScriptedAI -{ - mob_twilight_whelpAI(Creature* pCreature) : ScriptedAI(pCreature) { } - - uint32 m_uiFadeArmorTimer; - - void Reset() - { - m_uiFadeArmorTimer = 1000; - } - - void UpdateAI(const uint32 uiDiff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - // twilight torment - if (m_uiFadeArmorTimer < uiDiff) - { - DoCast(m_creature->getVictim(), SPELL_FADE_ARMOR); - m_uiFadeArmorTimer = 5000 + rand()%5000; - } - else - m_uiFadeArmorTimer -= uiDiff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_twilight_whelp(Creature* pCreature) -{ - return new mob_twilight_whelpAI(pCreature); -} - -void AddSC_boss_sartharion() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_sartharion"; - newscript->GetAI = &GetAI_boss_sartharion; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_vesperon"; - newscript->GetAI = &GetAI_mob_vesperon; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_shadron"; - newscript->GetAI = &GetAI_mob_shadron; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_tenebron"; - newscript->GetAI = &GetAI_mob_tenebron; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_acolyte_of_shadron"; - newscript->GetAI = &GetAI_mob_acolyte_of_shadron; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_acolyte_of_vesperon"; - newscript->GetAI = &GetAI_mob_acolyte_of_vesperon; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_twilight_eggs"; - newscript->GetAI = &GetAI_mob_twilight_eggs; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_twilight_whelp"; - newscript->GetAI = &GetAI_mob_twilight_whelp; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/obsidian_sanctum/def_obsidian_sanctum.h b/src/bindings/scripts/scripts/zone/obsidian_sanctum/def_obsidian_sanctum.h deleted file mode 100644 index 461834a2386..00000000000 --- a/src/bindings/scripts/scripts/zone/obsidian_sanctum/def_obsidian_sanctum.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef DEF_OBSIDIAN_SANCTUM_H -#define DEF_OBSIDIAN_SANCTUM_H - -enum -{ - TYPE_SARTHARION_EVENT = 1, - - DATA_SARTHARION = 10, - DATA_TENEBRON = 11, - DATA_SHADRON = 12, - DATA_VESPERON = 13, - - NPC_SARTHARION = 28860, - NPC_TENEBRON = 30452, - NPC_SHADRON = 30451, - NPC_VESPERON = 30449, - GO_TWILIGHT_PORTAL = 193988 -}; - -#endif diff --git a/src/bindings/scripts/scripts/zone/obsidian_sanctum/instance_obsidian_sanctum.cpp b/src/bindings/scripts/scripts/zone/obsidian_sanctum/instance_obsidian_sanctum.cpp deleted file mode 100644 index 5dd3e06e585..00000000000 --- a/src/bindings/scripts/scripts/zone/obsidian_sanctum/instance_obsidian_sanctum.cpp +++ /dev/null @@ -1,97 +0,0 @@ -#include "precompiled.h" -#include "def_obsidian_sanctum.h" - -#define MAX_ENCOUNTER 1 - -/* Obsidian Sanctum encounters: -0 - Sartharion -*/ - -struct TRINITY_DLL_DECL instance_obsidian_sanctum : public ScriptedInstance -{ - instance_obsidian_sanctum(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; - - uint32 m_auiEncounter[MAX_ENCOUNTER]; - uint64 m_uiSartharionGUID; - uint64 m_uiTenebronGUID; - uint64 m_uiShadronGUID; - uint64 m_uiVesperonGUID; - - void Initialize() - { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - - m_uiSartharionGUID = 0; - m_uiTenebronGUID = 0; - m_uiShadronGUID = 0; - m_uiVesperonGUID = 0; - } - - void OnCreatureCreate(Creature* pCreature, bool add) - { - switch(pCreature->GetEntry()) - { - case NPC_SARTHARION: - m_uiSartharionGUID = pCreature->GetGUID(); - break; - //three dragons below set to active state once created. - //we must expect bigger raid to encounter main boss, and then three dragons must be active due to grid differences - case NPC_TENEBRON: - m_uiTenebronGUID = pCreature->GetGUID(); - pCreature->setActive(true); - break; - case NPC_SHADRON: - m_uiShadronGUID = pCreature->GetGUID(); - pCreature->setActive(true); - break; - case NPC_VESPERON: - m_uiVesperonGUID = pCreature->GetGUID(); - pCreature->setActive(true); - break; - } - } - - void SetData(uint32 uiType, uint32 uiData) - { - if (uiType == TYPE_SARTHARION_EVENT) - m_auiEncounter[0] = uiData; - } - - uint32 GetData(uint32 uiType) - { - if (uiType == TYPE_SARTHARION_EVENT) - return m_auiEncounter[0]; - - return 0; - } - - uint64 GetData64(uint32 uiData) - { - switch(uiData) - { - case DATA_SARTHARION: - return m_uiSartharionGUID; - case DATA_TENEBRON: - return m_uiTenebronGUID; - case DATA_SHADRON: - return m_uiShadronGUID; - case DATA_VESPERON: - return m_uiVesperonGUID; - } - return 0; - } -}; - -InstanceData* GetInstanceData_instance_obsidian_sanctum(Map* pMap) -{ - return new instance_obsidian_sanctum(pMap); -} - -void AddSC_instance_obsidian_sanctum() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_obsidian_sanctum"; - newscript->GetInstanceData = &GetInstanceData_instance_obsidian_sanctum; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/arcatraz.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/arcatraz.cpp deleted file mode 100644 index fc855b74bd9..00000000000 --- a/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/arcatraz.cpp +++ /dev/null @@ -1,521 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Arcatraz -SD%Complete: 60 -SDComment: Warden Mellichar, event controller for Skyriss event. Millhouse Manastorm. TODO: make better combatAI for Millhouse. -SDCategory: Tempest Keep, The Arcatraz -EndScriptData */ - -/* ContentData -npc_millhouse_manastorm -npc_warden_mellichar -mob_zerekethvoidzone -EndContentData */ - -#include "precompiled.h" -#include "def_arcatraz.h" - -/*##### -# npc_millhouse_manastorm -#####*/ - -#define SAY_INTRO_1 -1552010 -#define SAY_INTRO_2 -1552011 -#define SAY_WATER -1552012 -#define SAY_BUFFS -1552013 -#define SAY_DRINK -1552014 -#define SAY_READY -1552015 -#define SAY_KILL_1 -1552016 -#define SAY_KILL_2 -1552017 -#define SAY_PYRO -1552018 -#define SAY_ICEBLOCK -1552019 -#define SAY_LOWHP -1552020 -#define SAY_DEATH -1552021 -#define SAY_COMPLETE -1552022 - -#define SPELL_CONJURE_WATER 36879 -#define SPELL_ARCANE_INTELLECT 36880 -#define SPELL_ICE_ARMOR 36881 - -#define SPELL_ARCANE_MISSILES 33833 -#define SPELL_CONE_OF_COLD 12611 -#define SPELL_FIRE_BLAST 13341 -#define SPELL_FIREBALL 14034 -#define SPELL_FROSTBOLT 15497 -#define SPELL_PYROBLAST 33975 - -struct TRINITY_DLL_DECL npc_millhouse_manastormAI : public ScriptedAI -{ - npc_millhouse_manastormAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - uint32 EventProgress_Timer; - uint32 Phase; - bool Init; - bool LowHp; - - uint32 Pyroblast_Timer; - uint32 Fireball_Timer; - - void Reset() - { - EventProgress_Timer = 2000; - LowHp = false; - Init = false; - Phase = 1; - - Pyroblast_Timer = 1000; - Fireball_Timer = 2500; - - if (pInstance) - { - if (pInstance->GetData(TYPE_WARDEN_2) == DONE) - Init = true; - - if (pInstance->GetData(TYPE_HARBINGERSKYRISS) == DONE) - { - DoScriptText(SAY_COMPLETE, m_creature); - } - } - } - - void AttackStart(Unit* pWho) - { - if (m_creature->Attack(pWho, true)) - { - m_creature->AddThreat(pWho, 0.0f); - m_creature->SetInCombatWith(pWho); - pWho->SetInCombatWith(m_creature); - - m_creature->GetMotionMaster()->MoveChase(pWho, 25.0f); - } - } - - void EnterCombat(Unit *who) - { - } - - void KilledUnit(Unit *victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_KILL_1, m_creature); break; - case 1: DoScriptText(SAY_KILL_2, m_creature); break; - } - } - - void JustDied(Unit *victim) - { - DoScriptText(SAY_DEATH, m_creature); - - /*for questId 10886 (heroic mode only) - if (pInstance && pInstance->GetData(TYPE_HARBINGERSKYRISS) != DONE) - ->FailQuest();*/ - } - - void UpdateAI(const uint32 diff) - { - if (!Init) - { - if (EventProgress_Timer < diff) - { - if (Phase < 8) - { - switch(Phase) - { - case 1: - DoScriptText(SAY_INTRO_1, m_creature); - EventProgress_Timer = 18000; - break; - case 2: - DoScriptText(SAY_INTRO_2, m_creature); - EventProgress_Timer = 18000; - break; - case 3: - DoScriptText(SAY_WATER, m_creature); - DoCast(m_creature,SPELL_CONJURE_WATER); - EventProgress_Timer = 7000; - break; - case 4: - DoScriptText(SAY_BUFFS, m_creature); - DoCast(m_creature,SPELL_ICE_ARMOR); - EventProgress_Timer = 7000; - break; - case 5: - DoScriptText(SAY_DRINK, m_creature); - DoCast(m_creature,SPELL_ARCANE_INTELLECT); - EventProgress_Timer = 7000; - break; - case 6: - DoScriptText(SAY_READY, m_creature); - EventProgress_Timer = 6000; - break; - case 7: - if (pInstance) - pInstance->SetData(TYPE_WARDEN_2,DONE); - Init = true; - break; - } - ++Phase; - } - } else EventProgress_Timer -= diff; - } - - if (!UpdateVictim()) - return; - - if (!LowHp && ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 20)) - { - DoScriptText(SAY_LOWHP, m_creature); - LowHp = true; - } - - if (Pyroblast_Timer < diff) - { - if (m_creature->IsNonMeleeSpellCasted(false)) - return; - - DoScriptText(SAY_PYRO, m_creature); - - DoCast(m_creature->getVictim(),SPELL_PYROBLAST); - Pyroblast_Timer = 40000; - }else Pyroblast_Timer -=diff; - - if (Fireball_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_FIREBALL); - Fireball_Timer = 4000; - }else Fireball_Timer -=diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_npc_millhouse_manastorm(Creature* pCreature) -{ - return new npc_millhouse_manastormAI (pCreature); -} - -/*##### -# npc_warden_mellichar -#####*/ - -#define YELL_INTRO1 -1552023 -#define YELL_INTRO2 -1552024 -#define YELL_RELEASE1 -1552025 -#define YELL_RELEASE2A -1552026 -#define YELL_RELEASE2B -1552027 -#define YELL_RELEASE3 -1552028 -#define YELL_RELEASE4 -1552029 -#define YELL_WELCOME -1552030 - -//phase 2(acid mobs) -#define ENTRY_TRICKSTER 20905 -#define ENTRY_PH_HUNTER 20906 -//phase 3 -#define ENTRY_MILLHOUSE 20977 -//phase 4(acid mobs) -#define ENTRY_AKKIRIS 20908 -#define ENTRY_SULFURON 20909 -//phase 5(acid mobs) -#define ENTRY_TW_DRAK 20910 -#define ENTRY_BL_DRAK 20911 -//phase 6 -#define ENTRY_SKYRISS 20912 - -//TARGET_SCRIPT -#define SPELL_TARGET_ALPHA 36856 -#define SPELL_TARGET_BETA 36854 -#define SPELL_TARGET_DELTA 36857 -#define SPELL_TARGET_GAMMA 36858 -#define SPELL_TARGET_OMEGA 36852 -#define SPELL_BUBBLE_VISUAL 36849 - -struct TRINITY_DLL_DECL npc_warden_mellicharAI : public ScriptedAI -{ - npc_warden_mellicharAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - bool IsRunning; - bool CanSpawn; - - uint32 EventProgress_Timer; - uint32 Phase; - - void Reset() - { - IsRunning = false; - CanSpawn = false; - - EventProgress_Timer = 22000; - Phase = 1; - - m_creature->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NON_ATTACKABLE); - DoCast(m_creature,SPELL_TARGET_OMEGA); - - if (pInstance) - pInstance->SetData(TYPE_HARBINGERSKYRISS,NOT_STARTED); - } - - void AttackStart(Unit* who) { } - - void MoveInLineOfSight(Unit *who) - { - if (IsRunning) - return; - - if (!m_creature->getVictim() && who->isTargetableForAttack() && (m_creature->IsHostileTo(who)) && who->isInAccessiblePlaceFor(m_creature)) - { - if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) - return; - if (who->GetTypeId() != TYPEID_PLAYER) - return; - - float attackRadius = m_creature->GetAttackDistance(who)/10; - if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who)) - EnterCombat(who); - } - } - - void EnterCombat(Unit *who) - { - DoScriptText(YELL_INTRO1, m_creature); - DoCast(m_creature,SPELL_BUBBLE_VISUAL); - - if (pInstance) - { - pInstance->SetData(TYPE_HARBINGERSKYRISS,IN_PROGRESS); - pInstance->HandleGameObject(pInstance->GetData64(DATA_SPHERE_SHIELD), false); - IsRunning = true; - } - } - - bool CanProgress() - { - if (pInstance) - { - if (Phase == 7 && pInstance->GetData(TYPE_WARDEN_4) == DONE) - return true; - if (Phase == 6 && pInstance->GetData(TYPE_WARDEN_3) == DONE) - return true; - if (Phase == 5 && pInstance->GetData(TYPE_WARDEN_2) == DONE) - return true; - if (Phase == 4) - return true; - if (Phase == 3 && pInstance->GetData(TYPE_WARDEN_1) == DONE) - return true; - if (Phase == 2 && pInstance->GetData(TYPE_HARBINGERSKYRISS) == IN_PROGRESS) - return true; - if (Phase == 1 && pInstance->GetData(TYPE_HARBINGERSKYRISS) == IN_PROGRESS) - return true; - return false; - } - return false; - } - - void DoPrepareForPhase() - { - if (pInstance) - { - m_creature->InterruptNonMeleeSpells(true); - m_creature->RemoveAurasByType(SPELL_AURA_DUMMY); - - switch(Phase) - { - case 2: - DoCast(m_creature,SPELL_TARGET_ALPHA); - pInstance->SetData(TYPE_WARDEN_1,IN_PROGRESS); - pInstance->HandleGameObject(pInstance->GetData64(DATA_SPHERE_SHIELD), false); - break; - case 3: - DoCast(m_creature,SPELL_TARGET_BETA); - pInstance->SetData(TYPE_WARDEN_2,IN_PROGRESS); - break; - case 5: - DoCast(m_creature,SPELL_TARGET_DELTA); - pInstance->SetData(TYPE_WARDEN_3,IN_PROGRESS); - break; - case 6: - DoCast(m_creature,SPELL_TARGET_GAMMA); - pInstance->SetData(TYPE_WARDEN_4,IN_PROGRESS); - break; - case 7: - pInstance->SetData(TYPE_WARDEN_5,IN_PROGRESS); - break; - } - CanSpawn = true; - } - } - - void UpdateAI(const uint32 diff) - { - if (!IsRunning) - return; - - if (EventProgress_Timer < diff) - { - if (pInstance) - { - if (pInstance->GetData(TYPE_HARBINGERSKYRISS) == FAIL) - Reset(); - } - - if (CanSpawn) - { - //continue beam omega pod, unless we are about to summon skyriss - if (Phase != 7) - DoCast(m_creature,SPELL_TARGET_OMEGA); - - switch(Phase) - { - case 2: - switch(rand()%2) - { - case 0: m_creature->SummonCreature(ENTRY_TRICKSTER,478.326,-148.505,42.56,3.19,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); break; - case 1: m_creature->SummonCreature(ENTRY_PH_HUNTER,478.326,-148.505,42.56,3.19,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); break; - } - break; - case 3: - m_creature->SummonCreature(ENTRY_MILLHOUSE,413.292,-148.378,42.56,6.27,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); - break; - case 4: - DoScriptText(YELL_RELEASE2B, m_creature); - break; - case 5: - switch(rand()%2) - { - case 0: m_creature->SummonCreature(ENTRY_AKKIRIS,420.179,-174.396,42.58,0.02,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); break; - case 1: m_creature->SummonCreature(ENTRY_SULFURON,420.179,-174.396,42.58,0.02,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); break; - } - break; - case 6: - switch(rand()%2) - { - case 0: m_creature->SummonCreature(ENTRY_TW_DRAK,471.795,-174.58,42.58,3.06,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); break; - case 1: m_creature->SummonCreature(ENTRY_BL_DRAK,471.795,-174.58,42.58,3.06,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); break; - } - break; - case 7: - m_creature->SummonCreature(ENTRY_SKYRISS,445.763,-191.639,44.64,1.60,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); - DoScriptText(YELL_WELCOME, m_creature); - break; - } - CanSpawn = false; - ++Phase; - } - if (CanProgress()) - { - switch(Phase) - { - case 1: - DoScriptText(YELL_INTRO2, m_creature); - EventProgress_Timer = 10000; - ++Phase; - break; - case 2: - DoScriptText(YELL_RELEASE1, m_creature); - DoPrepareForPhase(); - EventProgress_Timer = 7000; - break; - case 3: - DoScriptText(YELL_RELEASE2A, m_creature); - DoPrepareForPhase(); - EventProgress_Timer = 10000; - break; - case 4: - DoPrepareForPhase(); - EventProgress_Timer = 15000; - break; - case 5: - DoScriptText(YELL_RELEASE3, m_creature); - DoPrepareForPhase(); - EventProgress_Timer = 15000; - break; - case 6: - DoScriptText(YELL_RELEASE4, m_creature); - DoPrepareForPhase(); - EventProgress_Timer = 15000; - break; - case 7: - DoPrepareForPhase(); - EventProgress_Timer = 15000; - break; - } - } - } else EventProgress_Timer -= diff; - } -}; -CreatureAI* GetAI_npc_warden_mellichar(Creature* pCreature) -{ - return new npc_warden_mellicharAI (pCreature); -} - -/*##### -# mob_zerekethvoidzone (this script probably not needed in future -> `creature_template_addon`.`auras`='36120 0') -#####*/ - -#define SPELL_VOID_ZONE_DAMAGE 36120 - -struct TRINITY_DLL_DECL mob_zerekethvoidzoneAI : public ScriptedAI -{ - mob_zerekethvoidzoneAI(Creature *c) : ScriptedAI(c) {} - - void Reset() - { - m_creature->SetUInt32Value(UNIT_NPC_FLAGS,0); - m_creature->setFaction(16); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - - DoCast(m_creature,SPELL_VOID_ZONE_DAMAGE); - } - - void EnterCombat(Unit* who) {} -}; -CreatureAI* GetAI_mob_zerekethvoidzoneAI(Creature* pCreature) -{ - return new mob_zerekethvoidzoneAI (pCreature); -} - -void AddSC_arcatraz() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="npc_millhouse_manastorm"; - newscript->GetAI = &GetAI_npc_millhouse_manastorm; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_warden_mellichar"; - newscript->GetAI = &GetAI_npc_warden_mellichar; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_zerekethvoidzone"; - newscript->GetAI = &GetAI_mob_zerekethvoidzoneAI; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/boss_harbinger_skyriss.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/boss_harbinger_skyriss.cpp deleted file mode 100644 index bcab1a6257f..00000000000 --- a/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/boss_harbinger_skyriss.cpp +++ /dev/null @@ -1,312 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Harbinger_Skyriss -SD%Complete: 45 -SDComment: CombatAI not fully implemented. Timers will need adjustments. Need more docs on how event fully work. Reset all event and force start over if fail at one point? -SDCategory: Tempest Keep, The Arcatraz -EndScriptData */ - -/* ContentData -boss_harbinger_skyriss -boss_harbinger_skyriss_illusion -EndContentData */ - -#include "precompiled.h" -#include "def_arcatraz.h" - -#define SAY_INTRO -1552000 -#define SAY_AGGRO -1552001 -#define SAY_KILL_1 -1552002 -#define SAY_KILL_2 -1552003 -#define SAY_MIND_1 -1552004 -#define SAY_MIND_2 -1552005 -#define SAY_FEAR_1 -1552006 -#define SAY_FEAR_2 -1552007 -#define SAY_IMAGE -1552008 -#define SAY_DEATH -1552009 - -#define SPELL_FEAR 39415 - -#define SPELL_MIND_REND 36924 -#define H_SPELL_MIND_REND 39017 - -#define SPELL_DOMINATION 37162 -#define H_SPELL_DOMINATION 39019 - -#define H_SPELL_MANA_BURN 39020 - -#define SPELL_66_ILLUSION 36931 //entry 21466 -#define SPELL_33_ILLUSION 36932 //entry 21467 - -struct TRINITY_DLL_DECL boss_harbinger_skyrissAI : public ScriptedAI -{ - boss_harbinger_skyrissAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - HeroicMode = m_creature->GetMap()->IsHeroic(); - Intro = false; - } - - ScriptedInstance *pInstance; - bool HeroicMode; - - bool Intro; - bool IsImage33; - bool IsImage66; - - uint32 Intro_Phase; - uint32 Intro_Timer; - uint32 MindRend_Timer; - uint32 Fear_Timer; - uint32 Domination_Timer; - uint32 ManaBurn_Timer; - - void Reset() - { - if (!Intro) - m_creature->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NOT_ATTACKABLE_2); - - IsImage33 = false; - IsImage66 = false; - - Intro_Phase = 1; - Intro_Timer = 5000; - MindRend_Timer = 3000; - Fear_Timer = 15000; - Domination_Timer = 30000; - ManaBurn_Timer = 25000; - } - - void MoveInLineOfSight(Unit *who) - { - if (!Intro) - { - return; - } - ScriptedAI::MoveInLineOfSight(who); - } - - void EnterCombat(Unit *who) {} - - void JustDied(Unit* Killer) - { - DoScriptText(SAY_DEATH, m_creature); - if (pInstance) - pInstance->SetData(TYPE_HARBINGERSKYRISS,DONE); - } - - void JustSummoned(Creature *summon) - { - if (!summon) - return; - if (IsImage66) - summon->SetHealth((summon->GetMaxHealth()*33)/100); - else - summon->SetHealth((summon->GetMaxHealth()*66)/100); - if (m_creature->getVictim()) - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - summon->AI()->AttackStart(target); - } - - void KilledUnit(Unit* victim) - { - //won't yell killing pet/other unit - if (victim->GetEntry() == 21436) - return; - - switch(rand()%2) - { - case 0: DoScriptText(SAY_KILL_1, m_creature); break; - case 1: DoScriptText(SAY_KILL_2, m_creature); break; - } - } - - void DoSplit(uint32 val) - { - if (m_creature->IsNonMeleeSpellCasted(false)) - m_creature->InterruptNonMeleeSpells(false); - - DoScriptText(SAY_IMAGE, m_creature); - - if (val == 66) - DoCast(m_creature, SPELL_66_ILLUSION); - else - DoCast(m_creature, SPELL_33_ILLUSION); - } - - void UpdateAI(const uint32 diff) - { - if (!Intro) - { - if (!pInstance) - return; - - if (Intro_Timer < diff) - { - switch(Intro_Phase) - { - case 1: - DoScriptText(SAY_INTRO, m_creature); - pInstance->HandleGameObject(pInstance->GetData64(DATA_SPHERE_SHIELD), true); - ++Intro_Phase; - Intro_Timer = 25000; - break; - case 2: - DoScriptText(SAY_AGGRO, m_creature); - if (Unit *mellic = Unit::GetUnit(*m_creature,pInstance->GetData64(DATA_MELLICHAR))) - { - //should have a better way to do this. possibly spell exist. - mellic->setDeathState(JUST_DIED); - mellic->SetHealth(0); - pInstance->SetData(TYPE_SHIELD_OPEN,IN_PROGRESS); - } - ++Intro_Phase; - Intro_Timer = 3000; - break; - case 3: - m_creature->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NOT_ATTACKABLE_2); - Intro = true; - break; - } - }else Intro_Timer -=diff; - } - - if (!UpdateVictim()) - return; - - if (!IsImage66 && ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() <= 66)) - { - DoSplit(66); - IsImage66 = true; - } - if (!IsImage33 && ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() <= 33)) - { - DoSplit(33); - IsImage33 = true; - } - - if (MindRend_Timer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,1)) - DoCast(target,HeroicMode ? H_SPELL_MIND_REND : SPELL_MIND_REND); - else - DoCast(m_creature->getVictim(),HeroicMode ? H_SPELL_MIND_REND : SPELL_MIND_REND); - - MindRend_Timer = 8000; - }else MindRend_Timer -=diff; - - if (Fear_Timer < diff) - { - if (m_creature->IsNonMeleeSpellCasted(false)) - return; - - switch(rand()%2) - { - case 0: DoScriptText(SAY_FEAR_1, m_creature); break; - case 1: DoScriptText(SAY_FEAR_2, m_creature); break; - } - - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,1)) - DoCast(target,SPELL_FEAR); - else - DoCast(m_creature->getVictim(),SPELL_FEAR); - - Fear_Timer = 25000; - }else Fear_Timer -=diff; - - if (Domination_Timer < diff) - { - if (m_creature->IsNonMeleeSpellCasted(false)) - return; - - switch(rand()%2) - { - case 0: DoScriptText(SAY_MIND_1, m_creature); break; - case 1: DoScriptText(SAY_MIND_2, m_creature); break; - } - - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,1)) - DoCast(target,HeroicMode ? H_SPELL_DOMINATION : SPELL_DOMINATION); - else - DoCast(m_creature->getVictim(),HeroicMode ? H_SPELL_DOMINATION : SPELL_DOMINATION); - - Domination_Timer = 16000+rand()%16000; - }else Domination_Timer -=diff; - - if (HeroicMode) - { - if (ManaBurn_Timer < diff) - { - if (m_creature->IsNonMeleeSpellCasted(false)) - return; - - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,1)) - DoCast(target,H_SPELL_MANA_BURN); - - ManaBurn_Timer = 16000+rand()%16000; - }else ManaBurn_Timer -=diff; - } - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_harbinger_skyriss(Creature* pCreature) -{ - return new boss_harbinger_skyrissAI (pCreature); -} - -#define SPELL_MIND_REND_IMAGE 36929 -#define H_SPELL_MIND_REND_IMAGE 39021 - -struct TRINITY_DLL_DECL boss_harbinger_skyriss_illusionAI : public ScriptedAI -{ - boss_harbinger_skyriss_illusionAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - ScriptedInstance *pInstance; - bool HeroicMode; - - void Reset() { } - - void EnterCombat(Unit *who) { } -}; - -CreatureAI* GetAI_boss_harbinger_skyriss_illusion(Creature* pCreature) -{ - return new boss_harbinger_skyriss_illusionAI (pCreature); -} - -void AddSC_boss_harbinger_skyriss() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_harbinger_skyriss"; - newscript->GetAI = &GetAI_boss_harbinger_skyriss; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="boss_harbinger_skyriss_illusion"; - newscript->GetAI = &GetAI_boss_harbinger_skyriss_illusion; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/def_arcatraz.h b/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/def_arcatraz.h deleted file mode 100644 index 3f8dee8bbd0..00000000000 --- a/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/def_arcatraz.h +++ /dev/null @@ -1,21 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ - -#ifndef DEF_ARCATRAZ_H -#define DEF_ARCATRAZ_H - -#define TYPE_ZEREKETH 1 -#define TYPE_DALLIAH 2 -#define TYPE_SOCCOTHRATES 3 -#define TYPE_HARBINGERSKYRISS 4 -#define TYPE_WARDEN_1 5 -#define TYPE_WARDEN_2 6 -#define TYPE_WARDEN_3 7 -#define TYPE_WARDEN_4 8 -#define TYPE_WARDEN_5 9 -#define DATA_MELLICHAR 10 -#define TYPE_SHIELD_OPEN 11 -#define DATA_SPHERE_SHIELD 12 -#endif - diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/instance_arcatraz.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/instance_arcatraz.cpp deleted file mode 100644 index 081c80c56e5..00000000000 --- a/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/instance_arcatraz.cpp +++ /dev/null @@ -1,238 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Instance_Arcatraz -SD%Complete: 80 -SDComment: Mainly Harbringer Skyriss event -SDCategory: Tempest Keep, The Arcatraz -EndScriptData */ - -#include "precompiled.h" -#include "def_arcatraz.h" - -#define MAX_ENCOUNTER 9 - -#define CONTAINMENT_CORE_SECURITY_FIELD_ALPHA 184318 //door opened when Wrath-Scryer Soccothrates dies -#define CONTAINMENT_CORE_SECURITY_FIELD_BETA 184319 //door opened when Dalliah the Doomsayer dies -#define POD_ALPHA 183961 //pod first boss wave -#define POD_BETA 183963 //pod second boss wave -#define POD_DELTA 183964 //pod third boss wave -#define POD_GAMMA 183962 //pod fourth boss wave -#define POD_OMEGA 183965 //pod fifth boss wave -#define WARDENS_SHIELD 184802 // warden shield -#define SEAL_SPHERE 184802 //shield 'protecting' mellichar - -#define MELLICHAR 20904 //skyriss will kill this unit - - -/* Arcatraz encounters: -1 - Zereketh the Unbound event -2 - Dalliah the Doomsayer event -3 - Wrath-Scryer Soccothrates event -4 - Harbinger Skyriss event, 5 sub-events -*/ - -struct TRINITY_DLL_DECL instance_arcatraz : public ScriptedInstance -{ - instance_arcatraz(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; - - uint32 m_auiEncounter[MAX_ENCOUNTER]; - - GameObject *Containment_Core_Security_Field_Alpha; - GameObject *Containment_Core_Security_Field_Beta; - GameObject *Pod_Alpha; - GameObject *Pod_Gamma; - GameObject *Pod_Beta; - GameObject *Pod_Delta; - GameObject *Pod_Omega; - GameObject *Wardens_Shield; - - uint64 GoSphereGUID; - uint64 MellicharGUID; - - void Initialize() - { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - - Containment_Core_Security_Field_Alpha = NULL; - Containment_Core_Security_Field_Beta = NULL; - Pod_Alpha = NULL; - Pod_Beta = NULL; - Pod_Delta = NULL; - Pod_Gamma = NULL; - Pod_Omega = NULL; - Wardens_Shield = NULL; - - GoSphereGUID = 0; - MellicharGUID = 0; - } - - bool IsEncounterInProgress() const - { - for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) - return true; - - return false; - } - - void OnGameObjectCreate(GameObject* pGo, bool add) - { - switch(pGo->GetEntry()) - { - case CONTAINMENT_CORE_SECURITY_FIELD_ALPHA: Containment_Core_Security_Field_Alpha = pGo; break; - case CONTAINMENT_CORE_SECURITY_FIELD_BETA: Containment_Core_Security_Field_Beta = pGo; break; - case SEAL_SPHERE: GoSphereGUID = pGo->GetGUID(); break; - case POD_ALPHA: Pod_Alpha = pGo; break; - case POD_BETA: Pod_Beta = pGo; break; - case POD_DELTA: Pod_Delta = pGo; break; - case POD_GAMMA: Pod_Gamma = pGo; break; - case POD_OMEGA: Pod_Omega = pGo; break; - //case WARDENS_SHIELD: Wardens_Shield = pGo; break; - } - } - - void OnCreatureCreate(Creature* pCreature, bool add) - { - if (pCreature->GetEntry() == MELLICHAR) - MellicharGUID = pCreature->GetGUID(); - } - - void SetData(uint32 type, uint32 data) - { - switch(type) - { - case TYPE_ZEREKETH: - m_auiEncounter[0] = data; - break; - - case TYPE_DALLIAH: - if (data == DONE) - if (Containment_Core_Security_Field_Beta) - Containment_Core_Security_Field_Beta->UseDoorOrButton(); - m_auiEncounter[1] = data; - break; - - case TYPE_SOCCOTHRATES: - if (data == DONE) - if (Containment_Core_Security_Field_Alpha) - Containment_Core_Security_Field_Alpha->UseDoorOrButton(); - m_auiEncounter[2] = data; - break; - - case TYPE_HARBINGERSKYRISS: - if (data == NOT_STARTED || data == FAIL) - { - m_auiEncounter[4] = NOT_STARTED; - m_auiEncounter[5] = NOT_STARTED; - m_auiEncounter[6] = NOT_STARTED; - m_auiEncounter[7] = NOT_STARTED; - m_auiEncounter[8] = NOT_STARTED; - } - m_auiEncounter[3] = data; - break; - - case TYPE_WARDEN_1: - if (data == IN_PROGRESS) - if (Pod_Alpha) - Pod_Alpha->UseDoorOrButton(); - m_auiEncounter[4] = data; - break; - - case TYPE_WARDEN_2: - if (data == IN_PROGRESS) - if (Pod_Beta) - Pod_Beta->UseDoorOrButton(); - m_auiEncounter[5] = data; - break; - - case TYPE_WARDEN_3: - if (data == IN_PROGRESS) - if (Pod_Delta) - Pod_Delta->UseDoorOrButton(); - m_auiEncounter[6] = data; - break; - - case TYPE_WARDEN_4: - if (data == IN_PROGRESS) - if (Pod_Gamma) - Pod_Gamma->UseDoorOrButton(); - m_auiEncounter[7] = data; - break; - - case TYPE_WARDEN_5: - if (data == IN_PROGRESS) - if (Pod_Omega) - Pod_Omega->UseDoorOrButton(); - m_auiEncounter[8] = data; - break; - - case TYPE_SHIELD_OPEN: - if (data == IN_PROGRESS) - if (Wardens_Shield) - Wardens_Shield->UseDoorOrButton(); - break; - } - } - - uint32 GetData(uint32 type) - { - switch(type) - { - case TYPE_HARBINGERSKYRISS: - return m_auiEncounter[3]; - case TYPE_WARDEN_1: - return m_auiEncounter[4]; - case TYPE_WARDEN_2: - return m_auiEncounter[5]; - case TYPE_WARDEN_3: - return m_auiEncounter[6]; - case TYPE_WARDEN_4: - return m_auiEncounter[7]; - case TYPE_WARDEN_5: - return m_auiEncounter[8]; - } - return 0; - } - - uint64 GetData64(uint32 data) - { - switch(data) - { - case DATA_MELLICHAR: - return MellicharGUID; - case DATA_SPHERE_SHIELD: - return GoSphereGUID; - } - return 0; - } -}; - -InstanceData* GetInstanceData_instance_arcatraz(Map* pMap) -{ - return new instance_arcatraz(pMap); -} - -void AddSC_instance_arcatraz() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_arcatraz"; - newscript->GetInstanceData = &GetInstanceData_instance_arcatraz; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/botanica/boss_high_botanist_freywinn.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/botanica/boss_high_botanist_freywinn.cpp deleted file mode 100644 index c63fb1b8d58..00000000000 --- a/src/bindings/scripts/scripts/zone/tempest_keep/botanica/boss_high_botanist_freywinn.cpp +++ /dev/null @@ -1,199 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_High_Botanist_Freywinn -SD%Complete: 90 -SDComment: some strange visual related to tree form(if aura lost before normal duration end). possible make summon&transform -process smoother(transform after delay) -SDCategory: Tempest Keep, The Botanica -EndScriptData */ - -#include "precompiled.h" - -#define SAY_AGGRO -1553000 -#define SAY_KILL_1 -1553001 -#define SAY_KILL_2 -1553002 -#define SAY_TREE_1 -1553003 -#define SAY_TREE_2 -1553004 -#define SAY_DEATH -1553005 - -#define SPELL_TRANQUILITY 34550 -#define SPELL_TREE_FORM 34551 - -#define SPELL_SUMMON_FRAYER 34557 -#define ENTRY_FRAYER 19953 - -#define SPELL_PLANT_WHITE 34759 -#define SPELL_PLANT_GREEN 34761 -#define SPELL_PLANT_BLUE 34762 -#define SPELL_PLANT_RED 34763 - -struct TRINITY_DLL_DECL boss_high_botanist_freywinnAI : public ScriptedAI -{ - boss_high_botanist_freywinnAI(Creature *c) : ScriptedAI(c) {} - - std::list Adds_List; - - uint32 SummonSeedling_Timer; - uint32 TreeForm_Timer; - uint32 MoveCheck_Timer; - uint32 DeadAddsCount; - bool MoveFree; - - void Reset() - { - Adds_List.clear(); - - SummonSeedling_Timer = 6000; - TreeForm_Timer = 30000; - MoveCheck_Timer = 1000; - DeadAddsCount = 0; - MoveFree = true; - } - - void EnterCombat(Unit *who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - - void JustSummoned(Creature *summoned) - { - if (summoned->GetEntry() == ENTRY_FRAYER) - Adds_List.push_back(summoned->GetGUID()); - } - - void DoSummonSeedling() - { - switch(rand()%4) - { - case 0: DoCast(m_creature,SPELL_PLANT_WHITE); break; - case 1: DoCast(m_creature,SPELL_PLANT_GREEN); break; - case 2: DoCast(m_creature,SPELL_PLANT_BLUE); break; - case 3: DoCast(m_creature,SPELL_PLANT_RED); break; - } - } - - void KilledUnit(Unit* victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_KILL_1, m_creature); break; - case 1: DoScriptText(SAY_KILL_2, m_creature); break; - } - } - - void JustDied(Unit* Killer) - { - DoScriptText(SAY_DEATH, m_creature); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (TreeForm_Timer < diff) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_TREE_1, m_creature); break; - case 1: DoScriptText(SAY_TREE_2, m_creature); break; - } - - if (m_creature->IsNonMeleeSpellCasted(false)) - m_creature->InterruptNonMeleeSpells(true); - - m_creature->RemoveAllAuras(); - - DoCast(m_creature,SPELL_SUMMON_FRAYER,true); - DoCast(m_creature,SPELL_TRANQUILITY,true); - DoCast(m_creature,SPELL_TREE_FORM,true); - - m_creature->GetMotionMaster()->MoveIdle(); - MoveFree = false; - - TreeForm_Timer = 75000; - }else TreeForm_Timer -= diff; - - if (!MoveFree) - { - if (MoveCheck_Timer < diff) - { - if (!Adds_List.empty()) - { - for(std::list::iterator itr = Adds_List.begin(); itr != Adds_List.end(); ++itr) - { - if (Unit *temp = Unit::GetUnit(*m_creature,*itr)) - { - if (!temp->isAlive()) - { - Adds_List.erase(itr); - ++DeadAddsCount; - break; - } - } - } - } - - if (DeadAddsCount < 3 && TreeForm_Timer-30000 < diff) - DeadAddsCount = 3; - - if (DeadAddsCount >= 3) - { - Adds_List.clear(); - DeadAddsCount = 0; - - m_creature->InterruptNonMeleeSpells(true); - m_creature->RemoveAllAuras(); - m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); - MoveFree = true; - } - MoveCheck_Timer = 500; - } - else MoveCheck_Timer -= diff; - - return; - } - - /*if (m_creature->HasAura(SPELL_TREE_FORM,0) || m_creature->HasAura(SPELL_TRANQUILITY,0)) - return;*/ - - //one random seedling every 5 secs, but not in tree form - if (SummonSeedling_Timer < diff) - { - DoSummonSeedling(); - SummonSeedling_Timer = 6000; - }else SummonSeedling_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_high_botanist_freywinn(Creature* pCreature) -{ - return new boss_high_botanist_freywinnAI (pCreature); -} - -void AddSC_boss_high_botanist_freywinn() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_high_botanist_freywinn"; - newscript->GetAI = &GetAI_boss_high_botanist_freywinn; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/botanica/boss_laj.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/botanica/boss_laj.cpp deleted file mode 100644 index ddd5745f93c..00000000000 --- a/src/bindings/scripts/scripts/zone/tempest_keep/botanica/boss_laj.cpp +++ /dev/null @@ -1,205 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Laj -SD%Complete: 90 -SDComment: Immunities are wrong, must be adjusted to use resistance from creature_templates. Most spells require database support. -SDCategory: Tempest Keep, The Botanica -EndScriptData */ - -#include "precompiled.h" - -#define EMOTE_SUMMON -1553006 - -#define SPELL_ALLERGIC_REACTION 34697 -#define SPELL_TELEPORT_SELF 34673 - -#define SPELL_SUMMON_LASHER_1 34681 -#define SPELL_SUMMON_FLAYER_1 34682 -#define SPELL_SUMMON_LASHER_2 34684 -#define SPELL_SUMMON_FLAYER_2 34685 -#define SPELL_SUMMON_LASHER_3 34686 -#define SPELL_SUMMON_FLAYER_4 34687 -#define SPELL_SUMMON_LASHER_4 34688 -#define SPELL_SUMMON_FLAYER_3 34690 - -#define MODEL_DEFAULT 13109 -#define MODEL_ARCANE 14213 -#define MODEL_FIRE 13110 -#define MODEL_FROST 14112 -#define MODEL_NATURE 14214 - -struct TRINITY_DLL_DECL boss_lajAI : public ScriptedAI -{ - boss_lajAI(Creature *c) : ScriptedAI(c) {} - - bool CanSummon; - uint32 Teleport_Timer; - uint32 Summon_Timer; - uint32 Transform_Timer; - uint32 Allergic_Timer; - - void Reset() - { - m_creature->SetDisplayId(MODEL_DEFAULT); - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, true); - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, false); - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, false); - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, false); - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false); - - CanSummon = false; - Teleport_Timer = 20000; - Summon_Timer = 2500; - Transform_Timer = 30000; - Allergic_Timer = 5000; - } - - void DoTransform() - { - switch(rand()%5) - { - case 0: - m_creature->SetDisplayId(MODEL_DEFAULT); - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, true); - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, false); - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, false); - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, false); - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false); - break; - case 1: - m_creature->SetDisplayId(MODEL_ARCANE); - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, false); - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, true); - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, false); - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, false); - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false); - break; - case 2: - m_creature->SetDisplayId(MODEL_FIRE); - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, false); - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, false); - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true); - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, false); - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false); - break; - case 3: - m_creature->SetDisplayId(MODEL_FROST); - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, false); - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, false); - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, false); - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true); - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false); - break; - case 4: - m_creature->SetDisplayId(MODEL_NATURE); - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, false); - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, false); - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, false); - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, false); - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, true); - break; - } - } - - void DoSummons() - { - switch(rand()%4) - { - case 0: - DoCast(m_creature,SPELL_SUMMON_LASHER_1,true); - DoCast(m_creature,SPELL_SUMMON_FLAYER_1,true); - break; - case 1: - DoCast(m_creature,SPELL_SUMMON_LASHER_2,true); - DoCast(m_creature,SPELL_SUMMON_FLAYER_2,true); - break; - case 2: - DoCast(m_creature,SPELL_SUMMON_LASHER_3,true); - DoCast(m_creature,SPELL_SUMMON_FLAYER_3,true); - break; - case 3: - DoCast(m_creature,SPELL_SUMMON_LASHER_4,true); - DoCast(m_creature,SPELL_SUMMON_FLAYER_4,true); - break; - } - CanSummon = false; - } - - void EnterCombat(Unit *who) - { - } - - void JustSummoned(Creature *summon) - { - if (summon && m_creature->getVictim()) - summon->AI()->AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 0)); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (CanSummon) - { - if (Summon_Timer < diff) - { - DoScriptText(EMOTE_SUMMON, m_creature); - DoSummons(); - Summon_Timer = 2500; - }else Summon_Timer -= diff; - } - - if (Allergic_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_ALLERGIC_REACTION); - Allergic_Timer = 25000+rand()%15000; - }else Allergic_Timer -= diff; - - if (Teleport_Timer < diff) - { - DoCast(m_creature,SPELL_TELEPORT_SELF); - Teleport_Timer = 30000+rand()%10000; - CanSummon = true; - }else Teleport_Timer -= diff; - - if (Transform_Timer < diff) - { - DoTransform(); - Transform_Timer = 25000+rand()%15000; - }else Transform_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_laj(Creature* pCreature) -{ - return new boss_lajAI (pCreature); -} - -void AddSC_boss_laj() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_laj"; - newscript->GetAI = &GetAI_boss_laj; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/botanica/boss_warp_splinter.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/botanica/boss_warp_splinter.cpp deleted file mode 100644 index a9b111be839..00000000000 --- a/src/bindings/scripts/scripts/zone/tempest_keep/botanica/boss_warp_splinter.cpp +++ /dev/null @@ -1,226 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -/* ScriptData -SDName: Boss_Warp_Splinter -SD%Complete: 80 -SDComment: Includes Sapling (need some better control with these). -SDCategory: Tempest Keep, The Botanica -EndScriptData */ - -#include "precompiled.h" - -/*##### -# mob_treant (Sapling) -#####*/ - -#define SPELL_HEAL_FATHER 6262 - -struct TRINITY_DLL_DECL mob_treantAI : public ScriptedAI -{ - mob_treantAI (Creature *c) : ScriptedAI(c) - { - WarpGuid = 0; - } - - uint64 WarpGuid; - uint32 check_Timer; - - void Reset() - { - check_Timer = 0; - } - - void EnterCombat(Unit *who) {} - - void MoveInLineOfSight(Unit* who) {} - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - { - if (WarpGuid && check_Timer < diff) - { - if (Unit *Warp = Unit::GetUnit(*m_creature, WarpGuid)) - { - if (m_creature->IsWithinMeleeRange(Warp,2.5f)) - { - int32 CurrentHP_Treant = (int32)m_creature->GetHealth(); - Warp->CastCustomSpell(Warp,SPELL_HEAL_FATHER,&CurrentHP_Treant, 0, 0, true,0 ,0, m_creature->GetGUID()); - m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - return; - } - m_creature->GetMotionMaster()->MoveFollow(Warp,0,0); - } - check_Timer = 1000; - }else check_Timer -= diff; - return; - } - - if (m_creature->getVictim()->GetGUID() != WarpGuid) - DoMeleeAttackIfReady(); - } -}; - -/*##### -# boss_warp_splinter -#####*/ - -#define SAY_AGGRO -1553007 -#define SAY_SLAY_1 -1553008 -#define SAY_SLAY_2 -1553009 -#define SAY_SUMMON_1 -1553010 -#define SAY_SUMMON_2 -1553011 -#define SAY_DEATH -1553012 - -#define WAR_STOMP 34716 -#define SUMMON_TREANTS 34727 // DBC: 34727, 34731, 34733, 34734, 34736, 34739, 34741 (with Ancestral Life spell 34742) // won't work (guardian summon) -#define ARCANE_VOLLEY (HeroicMode?39133:36705) - -#define CREATURE_TREANT 19949 - -#define TREANT_SPAWN_DIST 50 //50 yards from Warp Splinter's spawn point - -float treant_pos[6][3] = -{ - {24.301233, 427.221100, -27.060635}, - {16.795492, 359.678802, -27.355425}, - {53.493484, 345.381470, -26.196192}, - {61.867096, 439.362732, -25.921030}, - {109.861877, 423.201630, -27.356019}, - {106.780159, 355.582581, -27.593357} -}; - -struct TRINITY_DLL_DECL boss_warp_splinterAI : public ScriptedAI -{ - boss_warp_splinterAI(Creature *c) : ScriptedAI(c) - { - HeroicMode = c->GetMap()->IsHeroic(); - Treant_Spawn_Pos_X = c->GetPositionX(); - Treant_Spawn_Pos_Y = c->GetPositionY(); - } - - uint32 War_Stomp_Timer; - uint32 Summon_Treants_Timer; - uint32 Arcane_Volley_Timer; - bool HeroicMode; - - float Treant_Spawn_Pos_X; - float Treant_Spawn_Pos_Y; - - void Reset() - { - War_Stomp_Timer = 25000 + rand()%15000; - Summon_Treants_Timer = 45000; - Arcane_Volley_Timer = 8000 + rand()%12000; - - m_creature->SetSpeed(MOVE_RUN, 0.7f, true); - } - - void EnterCombat(Unit *who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - - void KilledUnit(Unit* victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature); break; - case 1: DoScriptText(SAY_SLAY_2, m_creature); break; - } - } - - void JustDied(Unit* Killer) - { - DoScriptText(SAY_DEATH, m_creature); - } - - void SummonTreants() - { - for(uint8 i = 0; i < 6; ++i) - { - float angle = (M_PI / 3) * i; - - float X = Treant_Spawn_Pos_X + TREANT_SPAWN_DIST * cos(angle); - float Y = Treant_Spawn_Pos_Y + TREANT_SPAWN_DIST * sin(angle); - float O = - m_creature->GetAngle(X,Y); - - if (Creature *pTreant = m_creature->SummonCreature(CREATURE_TREANT,treant_pos[i][0],treant_pos[i][1],treant_pos[i][2],O,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,25000)) - CAST_AI(mob_treantAI, pTreant->AI())->WarpGuid = m_creature->GetGUID(); - } - switch(rand()%2) - { - case 0: DoScriptText(SAY_SUMMON_1, m_creature); break; - case 1: DoScriptText(SAY_SUMMON_2, m_creature); break; - } - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //Check for War Stomp - if (War_Stomp_Timer < diff) - { - DoCast(m_creature->getVictim(),WAR_STOMP); - War_Stomp_Timer = 25000 + rand()%15000; - }else War_Stomp_Timer -= diff; - - //Check for Arcane Volley - if (Arcane_Volley_Timer < diff) - { - DoCast(m_creature->getVictim(),ARCANE_VOLLEY); - Arcane_Volley_Timer = 20000 + rand()%15000; - }else Arcane_Volley_Timer -= diff; - - //Check for Summon Treants - if (Summon_Treants_Timer < diff) - { - SummonTreants(); - Summon_Treants_Timer = 45000; - }else Summon_Treants_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_warp_splinter(Creature* pCreature) -{ - return new boss_warp_splinterAI (pCreature); -} - -CreatureAI* GetAI_mob_treant(Creature* pCreature) -{ - return new mob_treantAI (pCreature); -} - -void AddSC_boss_warp_splinter() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_warp_splinter"; - newscript->GetAI = &GetAI_boss_warp_splinter; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_warp_splinter_treant"; - newscript->GetAI = &GetAI_mob_treant; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_alar.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_alar.cpp deleted file mode 100644 index e57f3294a55..00000000000 --- a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_alar.cpp +++ /dev/null @@ -1,525 +0,0 @@ -/* Copyright(C) 2006 - 2008 ScriptDev2 -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -*(at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -/* ScriptData -SDName: boss_alar -SD%Complete: 95 -SDComment: -SDCategory: Tempest Keep, The Eye -EndScriptData */ - -#include "precompiled.h" -#include "def_the_eye.h" - -#define SPELL_FLAME_BUFFET 34121 // Flame Buffet - every 1,5 secs in phase 1 if there is no victim in melee range and after Dive Bomb in phase 2 with same conditions -#define SPELL_FLAME_QUILLS 34229 // Randomly after changing position in phase after watching tonns of movies, set probability 20% -#define SPELL_REBIRTH 34342 // Rebirth - beginning of second phase(after loose all health in phase 1) -#define SPELL_REBIRTH_2 35369 // Rebirth(another, without healing to full HP) - after Dive Bomb in phase 2 -#define SPELL_MELT_ARMOR 35410 // Melt Armor - every 60 sec in phase 2 -#define SPELL_CHARGE 35412 // Charge - 30 sec cooldown -#define SPELL_DIVE_BOMB_VISUAL 35367 // Bosskillers says 30 sec cooldown, wowwiki says 30 sec colldown, DBM and BigWigs addons says ~47 sec -#define SPELL_DIVE_BOMB 35181 // after watching tonns of movies, set cooldown to 40+rand()%5. -#define SPELL_BERSERK 45078 // 10 minutes after phase 2 starts(id is wrong, but proper id is unknown) - -#define CREATURE_EMBER_OF_ALAR 19551 // Al'ar summons one Ember of Al'ar every position change in phase 1 and two after Dive Bomb. Also in phase 2 when Ember of Al'ar dies, boss loose 3% health. -#define SPELL_EMBER_BLAST 34133 // When Ember of Al'ar dies, it casts Ember Blast - -#define CREATURE_FLAME_PATCH_ALAR 20602 // Flame Patch - every 30 sec in phase 2 -#define SPELL_FLAME_PATCH 35380 // - -static float waypoint[6][3] = -{ - {340.15, 58.65, 17.71}, - {388.09, 31.54, 20.18}, - {388.18, -32.85, 20.18}, - {340.29, -60.19, 17.72}, - {332, 0.01, 39}, // better not use the same xy coord - {331, 0.01, -2.39} -}; - -enum WaitEventType -{ - WE_NONE = 0, - WE_DUMMY = 1, - WE_PLATFORM = 2, - WE_QUILL = 3, - WE_DIE = 4, - WE_REVIVE = 5, - WE_CHARGE = 6, - WE_METEOR = 7, - WE_DIVE = 8, - WE_LAND = 9, - WE_SUMMON = 10 -}; - -struct TRINITY_DLL_DECL boss_alarAI : public ScriptedAI -{ - boss_alarAI(Creature *c) : ScriptedAI(c) - { - pInstance =c->GetInstanceData(); - DefaultMoveSpeedRate = m_creature->GetSpeedRate(MOVE_RUN); - } - - ScriptedInstance *pInstance; - - WaitEventType WaitEvent; - uint32 WaitTimer; - - bool AfterMoving; - - uint32 Platforms_Move_Timer; - uint32 DiveBomb_Timer; - uint32 MeltArmor_Timer; - uint32 Charge_Timer; - uint32 FlamePatch_Timer; - uint32 Berserk_Timer; - - float DefaultMoveSpeedRate; - - bool Phase1; - bool ForceMove; - uint32 ForceTimer; - - int8 cur_wp; - - void Reset() - { - if (pInstance) - pInstance->SetData(DATA_ALAREVENT, NOT_STARTED); - - Berserk_Timer = 1200000; - Platforms_Move_Timer = 0; - - Phase1 = true; - WaitEvent = WE_NONE; - WaitTimer = 0; - AfterMoving = false; - ForceMove = false; - ForceTimer = 5000; - - cur_wp = 4; - - m_creature->SetDisplayId(m_creature->GetNativeDisplayId()); - m_creature->SetSpeed(MOVE_RUN, DefaultMoveSpeedRate); - //m_creature->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 10); - //m_creature->SetFloatValue(UNIT_FIELD_COMBATREACH, 10); - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true); - m_creature->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - m_creature->setActive(false); - } - - void EnterCombat(Unit *who) - { - if (pInstance) - pInstance->SetData(DATA_ALAREVENT, IN_PROGRESS); - - m_creature->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); // after enterevademode will be set walk movement - DoZoneInCombat(); - m_creature->setActive(true); - } - - void JustDied(Unit *victim) - { - if (pInstance) - pInstance->SetData(DATA_ALAREVENT, DONE); - } - - void JustSummoned(Creature *summon) - { - if (summon->GetEntry() == CREATURE_EMBER_OF_ALAR) - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - summon->AI()->AttackStart(target); - } - - void MoveInLineOfSight(Unit *who) {} - - void AttackStart(Unit* who) - { - if (Phase1) - AttackStartNoMove(who); - else - ScriptedAI::AttackStart(who); - } - - void DamageTaken(Unit* pKiller, uint32 &damage) - { - if (damage >= m_creature->GetHealth() && Phase1) - { - damage = 0; - if (!WaitEvent) - { - WaitEvent = WE_DIE; - WaitTimer = 0; - m_creature->SetHealth(0); - m_creature->InterruptNonMeleeSpells(true); - m_creature->RemoveAllAuras(); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - m_creature->AttackStop(); - m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0); - m_creature->SetSpeed(MOVE_RUN, 5.0f); - m_creature->GetMotionMaster()->Clear(); - m_creature->GetMotionMaster()->MovePoint(0, waypoint[5][0], waypoint[5][1], waypoint[5][2]); - } - } - } - - void SpellHit(Unit*, const SpellEntry *spell) - { - if (spell->Id == SPELL_DIVE_BOMB_VISUAL) - { - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true); - m_creature->SetDisplayId(11686); - //m_creature->SendUpdateObjectToAllExcept(NULL); - } - } - - void MovementInform(uint32 type, uint32 id) - { - if (type == POINT_MOTION_TYPE) - { - WaitTimer = 1; - AfterMoving = true; - ForceMove = false; - } - } - - void UpdateAI(const uint32 diff) - { - if (!m_creature->isInCombat()) // sometimes isincombat but !incombat, faction bug? - return; - - if (Berserk_Timer < diff) - { - m_creature->CastSpell(m_creature, SPELL_BERSERK, true); - Berserk_Timer = 60000; - }else Berserk_Timer -= diff; - - if (ForceMove) - { - if (ForceTimer < diff) - { - m_creature->GetMotionMaster()->MovePoint(0, waypoint[cur_wp][0], waypoint[cur_wp][1], waypoint[cur_wp][2]); - ForceTimer = 5000; - }else ForceTimer -= diff; - - } - if (WaitEvent) - { - if (WaitTimer) - { - if (WaitTimer <= diff) - { - if (AfterMoving) - { - m_creature->GetMotionMaster()->MoveIdle(); - AfterMoving = false; - } - - switch(WaitEvent) - { - case WE_PLATFORM: - Platforms_Move_Timer = 30000+rand()%5000; - break; - case WE_QUILL: - m_creature->CastSpell(m_creature, SPELL_FLAME_QUILLS, true); - Platforms_Move_Timer = 1; - WaitTimer = 10000; - WaitEvent = WE_DUMMY; - return; - case WE_DIE: - m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_DEAD); - WaitTimer = 5000; - WaitEvent = WE_REVIVE; - return; - case WE_REVIVE: - m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_STAND); - m_creature->SetHealth(m_creature->GetMaxHealth()); - m_creature->SetSpeed(MOVE_RUN, DefaultMoveSpeedRate); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - DoResetThreat(); - DoZoneInCombat(); - m_creature->CastSpell(m_creature, SPELL_REBIRTH, true); - MeltArmor_Timer = 60000; - Charge_Timer = 7000; - DiveBomb_Timer = 40000+rand()%5000; - FlamePatch_Timer = 30000; - Phase1 = false; - break; - case WE_METEOR: - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, false); - m_creature->CastSpell(m_creature, SPELL_DIVE_BOMB_VISUAL, false); - WaitEvent = WE_DIVE; - WaitTimer = 4000; - return; - case WE_DIVE: - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - { - m_creature->RemoveAurasDueToSpell(SPELL_DIVE_BOMB_VISUAL); - m_creature->CastSpell(target, SPELL_DIVE_BOMB, true); - float dist; - if (m_creature->IsWithinDist3d(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 5.0f)) dist = 5.0f; - WaitTimer = 1000 + floor(dist / 80 * 1000.0f); - m_creature->GetMap()->CreatureRelocation(m_creature, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(),0.0f); - m_creature->StopMoving(); - WaitEvent = WE_LAND; - } - else - { - EnterEvadeMode(); - return; - } - case WE_LAND: - WaitEvent = WE_SUMMON; - WaitTimer = 2000; - return; - case WE_SUMMON: - for(uint8 i = 0; i < 2; ++i) - DoSpawnCreature(CREATURE_EMBER_OF_ALAR, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); - m_creature->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 10); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetDisplayId(m_creature->GetNativeDisplayId()); - m_creature->CastSpell(m_creature, SPELL_REBIRTH_2, true); - break; - case WE_DUMMY: - default: - break; - } - - WaitEvent = WE_NONE; - WaitTimer = 0; - }else WaitTimer -= diff; - } - return; - } - - if (Phase1) - { - if (m_creature->getThreatManager().getThreatList().empty()) - { - EnterEvadeMode(); - return; - } - - if (Platforms_Move_Timer < diff) - { - if (cur_wp == 4) - { - cur_wp = 0; - WaitEvent = WE_PLATFORM; - } - else - { - if (rand()%5) // next platform - { - DoSpawnCreature(CREATURE_EMBER_OF_ALAR, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); - if (cur_wp == 3) - cur_wp = 0; - else - cur_wp++; - WaitEvent = WE_PLATFORM; - } - else // flame quill - { - cur_wp = 4; - WaitEvent = WE_QUILL; - } - } - ForceMove = true; - ForceTimer = 5000; - m_creature->GetMotionMaster()->MovePoint(0, waypoint[cur_wp][0], waypoint[cur_wp][1], waypoint[cur_wp][2]); - WaitTimer = 0; - return; - }else Platforms_Move_Timer -= diff; - } - else - { - if (!UpdateVictim()) - return; - - if (Charge_Timer < diff) - { - Unit *target= SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true); - if (target) - DoCast(target, SPELL_CHARGE); - Charge_Timer = 30000; - }else Charge_Timer -= diff; - - if (MeltArmor_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_MELT_ARMOR); - MeltArmor_Timer = 60000; - }else MeltArmor_Timer -= diff; - - if (DiveBomb_Timer < diff) - { - m_creature->AttackStop(); - m_creature->GetMotionMaster()->MovePoint(6, waypoint[4][0], waypoint[4][1], waypoint[4][2]); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 50); - WaitEvent = WE_METEOR; - WaitTimer = 0; - DiveBomb_Timer = 40000+rand()%5000; - return; - }else DiveBomb_Timer -= diff; - - if (FlamePatch_Timer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - { - Creature* Summoned = m_creature->SummonCreature(CREATURE_FLAME_PATCH_ALAR, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 120000); - if (Summoned) - { - Summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - Summoned->SetFloatValue(OBJECT_FIELD_SCALE_X, Summoned->GetFloatValue(OBJECT_FIELD_SCALE_X)*2.5f); - Summoned->SetDisplayId(11686); - Summoned->setFaction(m_creature->getFaction()); - Summoned->SetLevel(m_creature->getLevel()); - Summoned->CastSpell(Summoned, SPELL_FLAME_PATCH, false); - } - } - FlamePatch_Timer = 30000; - }else FlamePatch_Timer -= diff; - } - - DoMeleeAttackIfReady(); - } - - void DoMeleeAttackIfReady() - { - if (m_creature->isAttackReady() && !m_creature->IsNonMeleeSpellCasted(false)) - { - if (m_creature->IsWithinMeleeRange(m_creature->getVictim())) - { - m_creature->AttackerStateUpdate(m_creature->getVictim()); - m_creature->resetAttackTimer(); - } - else - { - Unit *target = NULL; - target = m_creature->SelectNearestTarget(5); - if (Phase1 && target) - m_creature->AI()->AttackStart(target); - else - { - m_creature->CastSpell(m_creature, SPELL_FLAME_BUFFET, true); - m_creature->setAttackTimer(BASE_ATTACK, 1500); - } - } - } - } -}; - -CreatureAI* GetAI_boss_alar(Creature* pCreature) -{ - return new boss_alarAI(pCreature); -} - -struct TRINITY_DLL_DECL mob_ember_of_alarAI : public ScriptedAI -{ - mob_ember_of_alarAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - m_creature->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true); - } - - ScriptedInstance *pInstance; - bool toDie; - - void Reset() {toDie = false;} - void EnterCombat(Unit *who) {DoZoneInCombat();} - void EnterEvadeMode() {m_creature->setDeathState(JUST_DIED);} - - void DamageTaken(Unit* pKiller, uint32 &damage) - { - if (damage >= m_creature->GetHealth() && pKiller != m_creature && !toDie) - { - damage = 0; - m_creature->CastSpell(m_creature, SPELL_EMBER_BLAST, true); - m_creature->SetDisplayId(11686); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - if (pInstance && pInstance->GetData(DATA_ALAREVENT) == 2) - { - if (Unit* Alar = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_ALAR))) - { - int AlarHealth = Alar->GetHealth() - Alar->GetMaxHealth()*0.03; - if (AlarHealth > 0) - Alar->SetHealth(AlarHealth); - else - Alar->SetHealth(1); - } - } - toDie = true; - } - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (toDie) - { - m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - //m_creature->SetVisibility(VISIBILITY_OFF); - } - - DoMeleeAttackIfReady(); - } - -}; - -CreatureAI* GetAI_mob_ember_of_alar(Creature* pCreature) -{ - return new mob_ember_of_alarAI(pCreature); -} - -struct TRINITY_DLL_DECL mob_flame_patch_alarAI : public ScriptedAI -{ - mob_flame_patch_alarAI(Creature *c) : ScriptedAI(c) {} - void Reset() {} - void EnterCombat(Unit *who) {} - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) {} -}; - -CreatureAI* GetAI_mob_flame_patch_alar(Creature* pCreature) -{ - return new mob_flame_patch_alarAI(pCreature); -} - -void AddSC_boss_alar() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_alar"; - newscript->GetAI = &GetAI_boss_alar; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_ember_of_alar"; - newscript->GetAI = &GetAI_mob_ember_of_alar; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_flame_patch_alar"; - newscript->GetAI = &GetAI_mob_flame_patch_alar; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_astromancer.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_astromancer.cpp deleted file mode 100644 index 81f3c619bac..00000000000 --- a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_astromancer.cpp +++ /dev/null @@ -1,474 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Astromancer -SD%Complete: 80 -SDComment: -SDCategory: Tempest Keep, The Eye -EndScriptData */ - -#include "precompiled.h" -#include "def_the_eye.h" - -enum -{ - SAY_AGGRO = -1550007, - SAY_SUMMON1 = -1550008, - SAY_SUMMON2 = -1550009, - SAY_KILL1 = -1550010, - SAY_KILL2 = -1550011, - SAY_KILL3 = -1550012, - SAY_DEATH = -1550013, - SAY_VOIDA = -1550014, - SAY_VOIDB = -1550015, - - SPELL_ARCANE_MISSILES = 33031, - SPELL_WRATH_OF_THE_ASTROMANCER = 42783, - SPELL_BLINDING_LIGHT = 33009, - SPELL_FEAR = 34322, - SPELL_VOID_BOLT = 39329, - - SPELL_SPOTLIGHT = 25824, - NPC_ASTROMANCER_SOLARIAN_SPOTLIGHT = 18928, - - NPC_SOLARIUM_AGENT = 18925, - NPC_SOLARIUM_PRIEST = 18806, - - MODEL_HUMAN = 18239, - MODEL_VOIDWALKER = 18988, - - SPELL_SOLARIUM_GREAT_HEAL = 33387, - SPELL_SOLARIUM_HOLY_SMITE = 25054, - SPELL_SOLARIUM_ARCANE_TORRENT = 33390, - - WV_ARMOR = 31000 -}; - -const float CENTER_X = 432.909f; -const float CENTER_Y = -373.424f; -const float CENTER_Z = 17.9608f; -const float CENTER_O = 1.06421f; -const float SMALL_PORTAL_RADIUS = 12.6f; -const float LARGE_PORTAL_RADIUS = 26.0f; -const float PORTAL_Z = 17.005f; - - // x, y, z, o -static float SolarianPos[4] = {432.909, -373.424, 17.9608, 1.06421}; - -struct TRINITY_DLL_DECL boss_high_astromancer_solarianAI : public ScriptedAI -{ - boss_high_astromancer_solarianAI(Creature *c) : ScriptedAI(c), Summons(m_creature) - { - pInstance = c->GetInstanceData(); - - defaultarmor = m_creature->GetArmor(); - defaultsize = m_creature->GetFloatValue(OBJECT_FIELD_SCALE_X); - } - - ScriptedInstance *pInstance; - SummonList Summons; - - uint8 Phase; - - uint32 ArcaneMissiles_Timer; - uint32 m_uiWrathOfTheAstromancer_Timer; - uint32 BlindingLight_Timer; - uint32 Fear_Timer; - uint32 VoidBolt_Timer; - uint32 Phase1_Timer; - uint32 Phase2_Timer; - uint32 Phase3_Timer; - uint32 AppearDelay_Timer; - uint32 defaultarmor; - uint32 Wrath_Timer; - - float defaultsize; - float Portals[3][3]; - - bool AppearDelay; - bool BlindingLight; - - void Reset() - { - ArcaneMissiles_Timer = 2000; - m_uiWrathOfTheAstromancer_Timer = 15000; - BlindingLight_Timer = 41000; - Fear_Timer = 20000; - VoidBolt_Timer = 10000; - Phase1_Timer = 50000; - Phase2_Timer = 10000; - Phase3_Timer = 15000; - AppearDelay_Timer = 2000; - BlindingLight = false; - AppearDelay = false; - Wrath_Timer = 20000+rand()%5000;//twice in phase one - Phase = 1; - Wrath_Timer = 20000+rand()%5000;//twice in phase one - - if (pInstance) - pInstance->SetData(DATA_HIGHASTROMANCERSOLARIANEVENT, NOT_STARTED); - - m_creature->SetArmor(defaultarmor); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetVisibility(VISIBILITY_ON); - m_creature->SetFloatValue(OBJECT_FIELD_SCALE_X, defaultsize); - m_creature->SetDisplayId(MODEL_HUMAN); - - Summons.DespawnAll(); - } - - void KilledUnit(Unit *victim) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_KILL1, m_creature); break; - case 1: DoScriptText(SAY_KILL2, m_creature); break; - case 2: DoScriptText(SAY_KILL3, m_creature); break; - } - } - - void JustDied(Unit *victim) - { - m_creature->SetFloatValue(OBJECT_FIELD_SCALE_X, defaultsize); - m_creature->SetDisplayId(MODEL_HUMAN); - DoScriptText(SAY_DEATH, m_creature); - - if (pInstance) - pInstance->SetData(DATA_HIGHASTROMANCERSOLARIANEVENT, DONE); - } - - void EnterCombat(Unit *who) - { - DoScriptText(SAY_AGGRO, m_creature); - DoZoneInCombat(); - - if (pInstance) - pInstance->SetData(DATA_HIGHASTROMANCERSOLARIANEVENT, IN_PROGRESS); - } - - void SummonMinion(uint32 entry, float x, float y, float z) - { - Creature* Summoned = m_creature->SummonCreature(entry, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); - if (Summoned) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - Summoned->AI()->AttackStart(target); - - Summons.Summon(Summoned); - } - } - - float Portal_X(float radius) - { - if ((rand()%2)==1) - radius = -radius; - - return (radius * (float)(rand()%100)/100.0f + CENTER_X); - } - - float Portal_Y(float x, float radius) - { - float z = 0.0f; - - switch(rand()%2) - { - case 0: z = 1; break; - case 1: z = -1; break; - } - return (z*sqrt(radius*radius - (x - CENTER_X)*(x - CENTER_X)) + CENTER_Y); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (AppearDelay) - { - m_creature->StopMoving(); - m_creature->AttackStop(); - if (AppearDelay_Timer < diff) - { - AppearDelay = false; - if (Phase == 2) - { - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetVisibility(VISIBILITY_OFF); - } - AppearDelay_Timer = 2000; - }else AppearDelay_Timer -= diff; - } - - if (Phase == 1) - { - if (BlindingLight_Timer < diff){ - BlindingLight = true; - BlindingLight_Timer = 45000; - }else BlindingLight_Timer -= diff; - - if (Wrath_Timer < diff) - { - m_creature->InterruptNonMeleeSpells(false); - DoCast(SelectTarget(SELECT_TARGET_RANDOM,1,100,true), SPELL_WRATH_OF_THE_ASTROMANCER, true); - Wrath_Timer = 20000+rand()%5000; - }else Wrath_Timer -= diff; - - if (ArcaneMissiles_Timer < diff) - { - if (BlindingLight) - { - DoCast(m_creature->getVictim(), SPELL_BLINDING_LIGHT); - BlindingLight = false; - }else{ - Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0); - - if (!m_creature->HasInArc(2.5f, target)) - target = m_creature->getVictim(); - - if (target) - DoCast(target, SPELL_ARCANE_MISSILES); - } - ArcaneMissiles_Timer = 3000; - }else ArcaneMissiles_Timer -= diff; - - if (m_uiWrathOfTheAstromancer_Timer < diff) - { - m_creature->InterruptNonMeleeSpells(false); - - //Target the tank ? - if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1)) - if (pTarget->GetTypeId() == TYPEID_PLAYER) - { - DoCast(pTarget, SPELL_WRATH_OF_THE_ASTROMANCER); - m_uiWrathOfTheAstromancer_Timer = 25000; - } - else - m_uiWrathOfTheAstromancer_Timer = 1000; - }else m_uiWrathOfTheAstromancer_Timer -= diff; - - //Phase1_Timer - if (Phase1_Timer < diff) - { - Phase = 2; - Phase1_Timer = 50000; - //After these 50 seconds she portals to the middle of the room and disappears, leaving 3 light portals behind. - m_creature->GetMotionMaster()->Clear(); - m_creature->GetMap()->CreatureRelocation(m_creature, CENTER_X, CENTER_Y, CENTER_Z, CENTER_O); - for(uint8 i=0; i<=2; ++i) - { - if (!i) - { - Portals[i][0] = Portal_X(SMALL_PORTAL_RADIUS); - Portals[i][1] = Portal_Y(Portals[i][0], SMALL_PORTAL_RADIUS); - Portals[i][2] = CENTER_Z; - } - else - { - Portals[i][0] = Portal_X(LARGE_PORTAL_RADIUS); - Portals[i][1] = Portal_Y(Portals[i][0], LARGE_PORTAL_RADIUS); - Portals[i][2] = PORTAL_Z; - } - } - if ((abs(Portals[2][0] - Portals[1][0]) < 7) && (abs(Portals[2][1] - Portals[1][1]) < 7)) - { - int i=1; - if (abs(CENTER_X + 26.0f - Portals[2][0]) < 7) - i = -1; - Portals[2][0] = Portals[2][0]+7*i; - Portals[2][1] = Portal_Y(Portals[2][0], LARGE_PORTAL_RADIUS); - } - for (int i=0; i<=2; ++i) - { - if (Creature* Summoned = m_creature->SummonCreature(NPC_ASTROMANCER_SOLARIAN_SPOTLIGHT, Portals[i][0], Portals[i][1], Portals[i][2], CENTER_O, TEMPSUMMON_TIMED_DESPAWN, Phase2_Timer+Phase3_Timer+AppearDelay_Timer+1700)) - { - Summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - Summoned->CastSpell(Summoned, SPELL_SPOTLIGHT, false); - } - } - AppearDelay = true; - }else Phase1_Timer-=diff; - } - else if (Phase == 2) - { - //10 seconds after Solarian disappears, 12 mobs spawn out of the three portals. - m_creature->AttackStop(); - m_creature->StopMoving(); - if (Phase2_Timer < diff) - { - Phase = 3; - for (int i=0; i<=2; ++i) - for (int j=1; j<=4; j++) - SummonMinion(NPC_SOLARIUM_AGENT, Portals[i][0], Portals[i][1], Portals[i][2]); - - DoScriptText(SAY_SUMMON1, m_creature); - Phase2_Timer = 10000; - } else Phase2_Timer -= diff; - } - else if (Phase == 3) - { - m_creature->AttackStop(); - m_creature->StopMoving(); - - //Check Phase3_Timer - if (Phase3_Timer < diff) - { - Phase = 1; - - //15 seconds later Solarian reappears out of one of the 3 portals. Simultaneously, 2 healers appear in the two other portals. - int i = rand()%3; - m_creature->GetMotionMaster()->Clear(); - m_creature->GetMap()->CreatureRelocation(m_creature, Portals[i][0], Portals[i][1], Portals[i][2], CENTER_O); - - for (int j=0; j<=2; j++) - if (j!=i) - SummonMinion(NPC_SOLARIUM_PRIEST, Portals[j][0], Portals[j][1], Portals[j][2]); - - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetVisibility(VISIBILITY_ON); - - DoScriptText(SAY_SUMMON2, m_creature); - AppearDelay = true; - Phase3_Timer = 15000; - }else Phase3_Timer -= diff; - } - else if (Phase == 4) - { - //Fear_Timer - if (Fear_Timer < diff) - { - DoCast(m_creature, SPELL_FEAR); - Fear_Timer = 20000; - }else Fear_Timer -= diff; - - //VoidBolt_Timer - if (VoidBolt_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_VOID_BOLT); - VoidBolt_Timer = 10000; - }else VoidBolt_Timer -= diff; - } - - //When Solarian reaches 20% she will transform into a huge void walker. - if (Phase != 4 && ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth())<20)) - { - Phase = 4; - - //To make sure she wont be invisible or not selecatble - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetVisibility(VISIBILITY_ON); - DoScriptText(SAY_VOIDA, m_creature); - DoScriptText(SAY_VOIDB, m_creature); - m_creature->SetArmor(WV_ARMOR); - m_creature->SetDisplayId(MODEL_VOIDWALKER); - m_creature->SetFloatValue(OBJECT_FIELD_SCALE_X, defaultsize*2.5f); - } - - DoMeleeAttackIfReady(); - } -}; - -struct TRINITY_DLL_DECL mob_solarium_priestAI : public ScriptedAI -{ - mob_solarium_priestAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance *pInstance; - - uint32 healTimer; - uint32 holysmiteTimer; - uint32 aoesilenceTimer; - - void Reset() - { - healTimer = 9000; - holysmiteTimer = 1; - aoesilenceTimer = 15000; - } - - void EnterCombat(Unit *who) - { - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (healTimer < diff) - { - Unit* target = NULL; - - switch(rand()%2) - { - case 0: - if (pInstance) - target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_ASTROMANCER)); - break; - case 1: - target = m_creature; - break; - } - - if (target) - { - DoCast(target,SPELL_SOLARIUM_GREAT_HEAL); - healTimer = 9000; - } - } else healTimer -= diff; - - if (holysmiteTimer < diff) - { - DoCast(m_creature->getVictim(), SPELL_SOLARIUM_HOLY_SMITE); - holysmiteTimer = 4000; - } else holysmiteTimer -= diff; - - if (aoesilenceTimer < diff) - { - DoCast(m_creature->getVictim(), SPELL_SOLARIUM_ARCANE_TORRENT); - aoesilenceTimer = 13000; - } else aoesilenceTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_solarium_priest(Creature* pCreature) -{ - return new mob_solarium_priestAI (pCreature); -} - -CreatureAI* GetAI_boss_high_astromancer_solarian(Creature* pCreature) -{ - return new boss_high_astromancer_solarianAI (pCreature); -} - -void AddSC_boss_high_astromancer_solarian() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_high_astromancer_solarian"; - newscript->GetAI = &GetAI_boss_high_astromancer_solarian; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_solarium_priest"; - newscript->GetAI = &GetAI_mob_solarium_priest; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_kaelthas.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_kaelthas.cpp deleted file mode 100644 index d341e52ae06..00000000000 --- a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_kaelthas.cpp +++ /dev/null @@ -1,1515 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Kaelthas -SD%Complete: 60 -SDComment: SQL, weapon scripts, mind control, need correct spells(interruptible/uninterruptible), phoenix spawn location & animation, phoenix behaviour & spawn during gravity lapse -SDCategory: Tempest Keep, The Eye -EndScriptData */ - -#include "precompiled.h" -#include "def_the_eye.h" -#include "WorldPacket.h" - -enum -{ - //kael'thas Speech - SAY_INTRO = -1550016, - SAY_INTRO_CAPERNIAN = -1550017, - SAY_INTRO_TELONICUS = -1550018, - SAY_INTRO_THALADRED = -1550019, - SAY_INTRO_SANGUINAR = -1550020, - SAY_PHASE2_WEAPON = -1550021, - SAY_PHASE3_ADVANCE = -1550022, - SAY_PHASE4_INTRO2 = -1550023, - SAY_PHASE5_NUTS = -1550024, - SAY_SLAY1 = -1550025, - SAY_SLAY2 = -1550026, - SAY_SLAY3 = -1550027, - SAY_MINDCONTROL1 = -1550028, - SAY_MINDCONTROL2 = -1550029, - SAY_GRAVITYLAPSE1 = -1550030, - SAY_GRAVITYLAPSE2 = -1550031, - SAY_SUMMON_PHOENIX1 = -1550032, - SAY_SUMMON_PHOENIX2 = -1550033, - SAY_DEATH = -1550034, - - //Thaladred the Darkener speech - SAY_THALADRED_AGGRO = -1550035, - SAY_THALADRED_DEATH = -1550036, - EMOTE_THALADRED_GAZE = -1550037, - - //Lord Sanguinar speech - SAY_SANGUINAR_AGGRO = -1550038, - SAY_SANGUINAR_DEATH = -1550039, - - //Grand Astromancer Capernian speech - SAY_CAPERNIAN_AGGRO = -1550040, - SAY_CAPERNIAN_DEATH = -1550041, - - //Master Engineer Telonicus speech - SAY_TELONICUS_AGGRO = -1550042, - SAY_TELONICUS_DEATH = -1550043, - - //Phase 2 spells - SPELL_SUMMON_WEAPONS = 36976, - SPELL_SUMMON_WEAPONA = 36958, - SPELL_SUMMON_WEAPONB = 36959, - SPELL_SUMMON_WEAPONC = 36960, - SPELL_SUMMON_WEAPOND = 36961, - SPELL_SUMMON_WEAPONE = 36962, - SPELL_SUMMON_WEAPONF = 36963, - SPELL_SUMMON_WEAPONG = 36964, - SPELL_RES_VISUAL = 24171, - - //Phase 4 spells - SPELL_FIREBALL = 22088, //wrong but works with CastCustomSpell - SPELL_PYROBLAST = 36819, - SPELL_FLAME_STRIKE = 36735, - SPELL_FLAME_STRIKE_VIS = 36730, - SPELL_FLAME_STRIKE_DMG = 36731, - SPELL_ARCANE_DISRUPTION = 36834, - SPELL_SHOCK_BARRIER = 36815, - SPELL_PHOENIX_ANIMATION = 36723, - SPELL_MIND_CONTROL = 32830, - - //Phase 5 spells - SPELL_EXPLODE = 36092, - SPELL_FULLPOWER = 36187, - SPELL_KNOCKBACK = 11027, - SPELL_GRAVITY_LAPSE = 34480, - SPELL_GRAVITY_LAPSE_AURA = 39432, - SPELL_NETHER_BEAM = 35873, - - //Thaladred the Darkener spells - SPELL_PSYCHIC_BLOW = 10689, - SPELL_SILENCE = 30225, - //Lord Sanguinar spells - SPELL_BELLOWING_ROAR = 40636, - //Grand Astromancer Capernian spells - - SPELL_CAPERNIAN_FIREBALL = 36971, - SPELL_CONFLAGRATION = 37018, - SPELL_ARCANE_EXPLOSION = 36970, - //Master Engineer Telonicus spells - SPELL_BOMB = 37036, - SPELL_REMOTE_TOY = 37027, - //Nether Vapor spell - SPELL_NETHER_VAPOR = 35859, - //Phoenix spell - SPELL_BURN = 36720, - SPELL_EMBER_BLAST = 34341, - SPELL_REBIRTH = 41587, - - //Creature IDs - NPC_PHOENIX = 21362, - NPC_PHOENIX_EGG = 21364, - - //Phoenix egg and phoenix model - MODEL_ID_PHOENIX = 19682, - MODEL_ID_PHOENIX_EGG = 20245, - - MAX_ADVISORS = 4 -}; - -uint32 m_auiSpellSummonWeapon[]= -{ - SPELL_SUMMON_WEAPONA, SPELL_SUMMON_WEAPONB, SPELL_SUMMON_WEAPONC, SPELL_SUMMON_WEAPOND, - SPELL_SUMMON_WEAPONE, SPELL_SUMMON_WEAPONF, SPELL_SUMMON_WEAPONG -}; - -const float CAPERNIAN_DISTANCE = 20.0f; //she casts away from the target -const float KAEL_VISIBLE_RANGE = 50.0f; - -const float afGravityPos[3] = {795.0f, 0.0f, 70.0f}; - -#define TIME_PHASE_2_3 120000 -#define TIME_PHASE_3_4 180000 - -//Base AI for Advisors -struct TRINITY_DLL_DECL advisorbase_ai : public ScriptedAI -{ - advisorbase_ai(Creature* pCreature) : ScriptedAI(pCreature) - { - m_pInstance = pCreature->GetInstanceData(); - m_bDoubled_Health = false; - } - - ScriptedInstance* m_pInstance; - bool FakeDeath; - bool m_bDoubled_Health; - uint32 DelayRes_Timer; - uint64 DelayRes_Target; - - void Reset() - { - if (m_bDoubled_Health) - { - m_creature->SetMaxHealth(m_creature->GetMaxHealth() / 2); - m_bDoubled_Health = false; - } - - FakeDeath = false; - DelayRes_Timer = 0; - DelayRes_Target = 0; - - m_creature->SetStandState(UNIT_STAND_STATE_STAND); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - - //reset encounter - if (m_pInstance && (m_pInstance->GetData(DATA_KAELTHASEVENT) == 1 || m_pInstance->GetData(DATA_KAELTHASEVENT) == 3)) - { - if (Creature *Kaelthas = Unit::GetCreature((*m_creature), m_pInstance->GetData64(DATA_KAELTHAS))) - Kaelthas->AI()->EnterEvadeMode(); - } - } - - void MoveInLineOfSight(Unit *who) - { - if (!who || FakeDeath || m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) - return; - - ScriptedAI::MoveInLineOfSight(who); - } - - void AttackStart(Unit* who) - { - if (!who || FakeDeath || m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) - return; - - ScriptedAI::AttackStart(who); - } - - void Revive(Unit* Target) - { - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - // double health for phase 3 - m_creature->SetMaxHealth(m_creature->GetMaxHealth() * 2); - m_bDoubled_Health = true; - m_creature->SetHealth(m_creature->GetMaxHealth()); - m_creature->SetStandState(UNIT_STAND_STATE_STAND); - - DoCast(m_creature, SPELL_RES_VISUAL, false); - DelayRes_Timer = 2000; - } - - void DamageTaken(Unit* pKiller, uint32 &damage) - { - if (damage < m_creature->GetHealth()) - return; - - //Prevent glitch if in fake death - if (FakeDeath && m_pInstance && m_pInstance->GetData(DATA_KAELTHASEVENT) != 0) - { - damage = 0; - return; - } - - //Don't really die in phase 1 & 3, only die after that - if (m_pInstance && m_pInstance->GetData(DATA_KAELTHASEVENT) != 0) - { - //prevent death - damage = 0; - FakeDeath = true; - - m_creature->InterruptNonMeleeSpells(false); - m_creature->SetHealth(0); - m_creature->StopMoving(); - m_creature->ClearComboPointHolders(); - m_creature->RemoveAllAurasOnDeath(); - m_creature->ModifyAuraState(AURA_STATE_HEALTHLESS_20_PERCENT, false); - m_creature->ModifyAuraState(AURA_STATE_HEALTHLESS_35_PERCENT, false); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->ClearAllReactives(); - m_creature->SetUInt64Value(UNIT_FIELD_TARGET,0); - m_creature->GetMotionMaster()->Clear(); - m_creature->GetMotionMaster()->MoveIdle(); - m_creature->SetStandState(UNIT_STAND_STATE_DEAD); - JustDied(pKiller); - } - } - - void UpdateAI(const uint32 diff) - { - if (DelayRes_Timer) - { - if (DelayRes_Timer <= diff) - { - DelayRes_Timer = 0; - FakeDeath = false; - - Unit* Target = Unit::GetUnit((*m_creature), DelayRes_Target); - if (!Target) - Target = m_creature->getVictim(); - - DoResetThreat(); - AttackStart(Target); - m_creature->GetMotionMaster()->Clear(); - m_creature->GetMotionMaster()->MoveChase(Target); - m_creature->AddThreat(Target, 0.0f); - }else DelayRes_Timer -= diff; - } - } - -}; - -//Kael'thas AI -struct TRINITY_DLL_DECL boss_kaelthasAI : public ScriptedAI -{ - boss_kaelthasAI(Creature* pCreature) : ScriptedAI(pCreature), summons(m_creature) - { - m_pInstance = pCreature->GetInstanceData(); - memset(&m_auiAdvisorGuid, 0, sizeof(m_auiAdvisorGuid)); - } - - ScriptedInstance* m_pInstance; - - uint32 Fireball_Timer; - uint32 ArcaneDisruption_Timer; - uint32 Phoenix_Timer; - uint32 ShockBarrier_Timer; - uint32 GravityLapse_Timer; - uint32 GravityLapse_Phase; - uint32 NetherBeam_Timer; - uint32 NetherVapor_Timer; - uint32 FlameStrike_Timer; - uint32 MindControl_Timer; - uint32 Phase; - uint32 PhaseSubphase; //generic - uint32 Phase_Timer; //generic timer - uint32 PyrosCasted; - - bool InGravityLapse; - bool IsCastingFireball; - bool ChainPyros; - - SummonList summons; - - uint64 m_auiAdvisorGuid[MAX_ADVISORS]; - - void Reset() - { - Fireball_Timer = 5000+rand()%10000; - ArcaneDisruption_Timer = 45000; - MindControl_Timer = 40000; - Phoenix_Timer = 50000; - ShockBarrier_Timer = 60000; - FlameStrike_Timer = 30000; - GravityLapse_Timer = 20000; - GravityLapse_Phase = 0; - NetherBeam_Timer = 8000; - NetherVapor_Timer = 10000; - PyrosCasted = 0; - Phase = 0; - InGravityLapse = false; - IsCastingFireball = false; - ChainPyros = false; - - if (m_creature->isInCombat()) - PrepareAdvisors(); - - summons.DespawnAll(); - - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - - if (m_pInstance) - m_pInstance->SetData(DATA_KAELTHASEVENT, 0); - } - - void PrepareAdvisors() - { - for(uint8 i = 0; i < MAX_ADVISORS; ++i) - { - if (Creature *pCreature = Unit::GetCreature((*m_creature), m_auiAdvisorGuid[i])) - { - pCreature->Respawn(); - pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - pCreature->setFaction(m_creature->getFaction()); - pCreature->AI()->EnterEvadeMode(); - } - } - } - - void StartEvent() - { - if (!m_pInstance) - return; - - m_auiAdvisorGuid[0] = m_pInstance->GetData64(DATA_THALADREDTHEDARKENER); - m_auiAdvisorGuid[1] = m_pInstance->GetData64(DATA_LORDSANGUINAR); - m_auiAdvisorGuid[2] = m_pInstance->GetData64(DATA_GRANDASTROMANCERCAPERNIAN); - m_auiAdvisorGuid[3] = m_pInstance->GetData64(DATA_MASTERENGINEERTELONICUS); - - if (!m_auiAdvisorGuid[0] || !m_auiAdvisorGuid[1] || !m_auiAdvisorGuid[2] || !m_auiAdvisorGuid[3]) - { - error_log("TSCR: Kael'Thas One or more advisors missing, Skipping Phases 1-3"); - - DoScriptText(SAY_PHASE4_INTRO2, m_creature); - - Phase = 4; - - m_pInstance->SetData(DATA_KAELTHASEVENT, 4); - - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - AttackStart(target); - - } - else - { - PrepareAdvisors(); - - DoScriptText(SAY_INTRO, m_creature); - - m_pInstance->SetData(DATA_KAELTHASEVENT, 1); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - - PhaseSubphase = 0; - Phase_Timer = 23000; - Phase = 1; - } - } - - void MoveInLineOfSight(Unit *who) - { - if (!m_creature->hasUnitState(UNIT_STAT_STUNNED) && who->isTargetableForAttack() && - m_creature->IsHostileTo(who) && who->isInAccessiblePlaceFor(m_creature)) - { - if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) - return; - - float attackRadius = m_creature->GetAttackDistance(who); - if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who)) - { - if (!m_creature->getVictim() && Phase >= 4) - { - who->RemoveAurasDueToSpell(SPELL_AURA_MOD_STEALTH); - AttackStart(who); - } - else if (m_creature->GetMap()->IsDungeon()) - { - if (m_pInstance && !m_pInstance->GetData(DATA_KAELTHASEVENT) && !Phase) - StartEvent(); - - who->SetInCombatWith(m_creature); - m_creature->AddThreat(who, 0.0f); - } - } - } - } - - void Aggro(Unit *who) - { - if (m_pInstance && !m_pInstance->GetData(DATA_KAELTHASEVENT) && !Phase) - StartEvent(); - } - - void KilledUnit() - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; - case 2: DoScriptText(SAY_SLAY3, m_creature); break; - } - } - - void JustSummoned(Creature* pSummoned) - { - // if not phoenix, then it's one of the 7 weapons - if (pSummoned->GetEntry() != NPC_PHOENIX) - { - if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) - pSummoned->AI()->AttackStart(pTarget); - - summons.Summon(pSummoned); - } - } - - void SummonedCreatureDespawn(Creature *summon) {summons.Despawn(summon);} - - void JustDied(Unit* Killer) - { - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - - DoScriptText(SAY_DEATH, m_creature); - - summons.DespawnAll(); - - if (m_pInstance) - m_pInstance->SetData(DATA_KAELTHASEVENT, 0); - - for(uint8 i = 0; i < MAX_ADVISORS; ++i) - { - if (Unit* pAdvisor = Unit::GetUnit((*m_creature), m_auiAdvisorGuid[i])) - pAdvisor->DealDamage(pAdvisor, pAdvisor->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - } - } - - void UpdateAI(const uint32 diff) - { - //Phase 1 - switch (Phase) - { - case 1: - { - Unit *target = NULL; - Creature* Advisor = NULL; - - //Subphase switch - switch(PhaseSubphase) - { - //Subphase 1 - Start - case 0: - if (Phase_Timer < diff) - { - DoScriptText(SAY_INTRO_THALADRED, m_creature); - - //start advisor within 7 seconds - Phase_Timer = 7000; - PhaseSubphase++; - }else Phase_Timer -= diff; - break; - - //Subphase 1 - Unlock advisor - case 1: - if (Phase_Timer < diff) - { - Advisor = (Unit::GetCreature((*m_creature), m_auiAdvisorGuid[0])); - - if (Advisor) - { - Advisor->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - Advisor->setFaction(m_creature->getFaction()); - - target = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (target) - Advisor->AI()->AttackStart(target); - } - - PhaseSubphase++; - }else Phase_Timer -= diff; - break; - - //Subphase 2 - Start - case 2: - Advisor = (Unit::GetCreature((*m_creature), m_auiAdvisorGuid[0])); - - if (Advisor && (Advisor->getStandState() == UNIT_STAND_STATE_DEAD)) - { - DoScriptText(SAY_INTRO_SANGUINAR, m_creature); - - //start advisor within 12.5 seconds - Phase_Timer = 12500; - PhaseSubphase++; - } - break; - - //Subphase 2 - Unlock advisor - case 3: - if (Phase_Timer < diff) - { - Advisor = (Unit::GetCreature((*m_creature), m_auiAdvisorGuid[1])); - - if (Advisor) - { - Advisor->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - Advisor->setFaction(m_creature->getFaction()); - - target = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (target) - Advisor->AI()->AttackStart(target); - } - - PhaseSubphase++; - }else Phase_Timer -= diff; - break; - - //Subphase 3 - Start - case 4: - Advisor = (Unit::GetCreature((*m_creature), m_auiAdvisorGuid[1])); - - if (Advisor && (Advisor->getStandState() == UNIT_STAND_STATE_DEAD)) - { - DoScriptText(SAY_INTRO_CAPERNIAN, m_creature); - - //start advisor within 7 seconds - Phase_Timer = 7000; - PhaseSubphase++; - } - break; - - //Subphase 3 - Unlock advisor - case 5: - if (Phase_Timer < diff) - { - Advisor = (Unit::GetCreature((*m_creature), m_auiAdvisorGuid[2])); - - if (Advisor) - { - Advisor->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - Advisor->setFaction(m_creature->getFaction()); - - target = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (target) - Advisor->AI()->AttackStart(target); - } - - PhaseSubphase++; - }else Phase_Timer -= diff; - break; - - //Subphase 4 - Start - case 6: - Advisor = (Unit::GetCreature((*m_creature), m_auiAdvisorGuid[2])); - - if (Advisor && (Advisor->getStandState() == UNIT_STAND_STATE_DEAD)) - { - DoScriptText(SAY_INTRO_TELONICUS, m_creature); - - //start advisor within 8.4 seconds - Phase_Timer = 8400; - PhaseSubphase++; - } - break; - - //Subphase 4 - Unlock advisor - case 7: - if (Phase_Timer < diff) - { - Advisor = (Unit::GetCreature((*m_creature), m_auiAdvisorGuid[3])); - - if (Advisor) - { - Advisor->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - Advisor->setFaction(m_creature->getFaction()); - - target = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (target) - Advisor->AI()->AttackStart(target); - } - - Phase_Timer = 3000; - PhaseSubphase++; - }else Phase_Timer -= diff; - break; - - //End of phase 1 - case 8: - Advisor = (Unit::GetCreature((*m_creature), m_auiAdvisorGuid[3])); - - if (Advisor && (Advisor->getStandState() == UNIT_STAND_STATE_DEAD)) - { - Phase = 2; - m_pInstance->SetData(DATA_KAELTHASEVENT, 2); - - DoScriptText(SAY_PHASE2_WEAPON, m_creature); - - PhaseSubphase = 0; - Phase_Timer = 3500; - DoCast(m_creature, SPELL_SUMMON_WEAPONS); - } - break; - } - }break; - - case 2: - { - if (PhaseSubphase == 0) - { - if (Phase_Timer < diff) - { - PhaseSubphase = 1; - }else Phase_Timer -= diff; - } - - //Spawn weapons - if (PhaseSubphase == 1) - { - m_creature->CastSpell(m_creature, SPELL_SUMMON_WEAPONS, false); - - uint8 uiMaxWeapon = sizeof(m_auiSpellSummonWeapon)/sizeof(uint32); - - for (uint32 i = 0; i < uiMaxWeapon; ++i) - m_creature->CastSpell(m_creature,m_auiSpellSummonWeapon[i],true); - - PhaseSubphase = 2; - Phase_Timer = TIME_PHASE_2_3; - } - - if (PhaseSubphase == 2) - { - if (Phase_Timer < diff) - { - DoScriptText(SAY_PHASE3_ADVANCE, m_creature); - m_pInstance->SetData(DATA_KAELTHASEVENT, 3); - Phase = 3; - PhaseSubphase = 0; - }else Phase_Timer -= diff; - } - }break; - - case 3: - { - if (PhaseSubphase == 0) - { - //Respawn advisors - Unit* Target = SelectUnit(SELECT_TARGET_RANDOM, 0); - - Creature* Advisor; - for (uint32 i = 0; i < MAX_ADVISORS; ++i) - { - Advisor = (Unit::GetCreature((*m_creature), m_auiAdvisorGuid[i])); - - if (!Advisor) - error_log("SD2: Kael'Thas Advisor %u does not exist. Possibly despawned? Incorrectly Killed?", i); - else - CAST_AI(advisorbase_ai, Advisor->AI())->Revive(Target); - } - - PhaseSubphase = 1; - Phase_Timer = TIME_PHASE_3_4; - } - - if (Phase_Timer < diff) - { - DoScriptText(SAY_PHASE4_INTRO2, m_creature); - Phase = 4; - - m_pInstance->SetData(DATA_KAELTHASEVENT, 4); - - // Sometimes people can collect Aggro in Phase 1-3. Reset threat before releasing Kael. - DoResetThreat(); - - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - AttackStart(target); - - Phase_Timer = 30000; - }else Phase_Timer -= diff; - } - break; - - case 4: - case 5: - case 6: - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //Fireball_Timer - if (!InGravityLapse && !ChainPyros && Phase != 5) - { - if (Fireball_Timer < diff) - { - if (!IsCastingFireball) - { - if (!m_creature->IsNonMeleeSpellCasted(false)) - { - //interruptable - m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_INTERRUPT_CAST, false); - int32 dmg = 20000+rand()%5000; - m_creature->CastCustomSpell(m_creature->getVictim(), SPELL_FIREBALL, &dmg, 0, 0, false); - IsCastingFireball = true; - Fireball_Timer = 2500; - } - } - else - { - //apply resistance - m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_INTERRUPT_CAST, true); - IsCastingFireball = false; - Fireball_Timer = 5000+rand()%10000; - } - }else Fireball_Timer -= diff; - - //ArcaneDisruption_Timer - if (ArcaneDisruption_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_ARCANE_DISRUPTION, true); - ArcaneDisruption_Timer = 60000; - }else ArcaneDisruption_Timer -= diff; - - if (FlameStrike_Timer < diff) - { - if (Unit* pUnit = SelectUnit(SELECT_TARGET_RANDOM, 0)) - DoCast(pUnit, SPELL_FLAME_STRIKE); - - FlameStrike_Timer = 30000; - }FlameStrike_Timer -= diff; - - if (MindControl_Timer < diff) - { - if (m_creature->getThreatManager().getThreatList().size() >= 2) - for (uint32 i = 0; i < 3; ++i) - { - debug_log("SD2: Kael'Thas mind control not supported."); - //DoCast(pUnit, SPELL_MIND_CONTROL); - } - - MindControl_Timer = 60000; - }MindControl_Timer -= diff; - } - - //Phoenix_Timer - if (Phoenix_Timer < diff) - { - DoCast(m_creature, SPELL_PHOENIX_ANIMATION); - - if (Creature* pPhoenix = m_creature->SummonCreature(NPC_PHOENIX, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45000)) - { - if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) - pPhoenix->AI()->AttackStart(pTarget); - } - else - error_log("SD2: Kael'Thas Phoenix could not be spawned"); - - switch(rand()%2) - { - case 0: DoScriptText(SAY_SUMMON_PHOENIX1, m_creature); break; - case 1: DoScriptText(SAY_SUMMON_PHOENIX2, m_creature); break; - } - - Phoenix_Timer = 60000; - }else Phoenix_Timer -= diff; - - //Phase 4 specific spells - if (Phase == 4) - { - if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 50) - { - m_pInstance->SetData(DATA_KAELTHASEVENT, 4); - Phase = 5; - Phase_Timer = 10000; - - DoScriptText(SAY_PHASE5_NUTS, m_creature); - - m_creature->StopMoving(); - m_creature->GetMotionMaster()->Clear(); - m_creature->GetMotionMaster()->MoveIdle(); - m_creature->GetMap()->CreatureRelocation(m_creature, afGravityPos[0], afGravityPos[1], afGravityPos[2], 0); - m_creature->SendMonsterMove(afGravityPos[0], afGravityPos[1], afGravityPos[2], 0, 0, 0); - - m_creature->InterruptNonMeleeSpells(false); - DoCast(m_creature, SPELL_FULLPOWER); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - } - - //ShockBarrier_Timer - if (ShockBarrier_Timer < diff) - { - DoCast(m_creature, SPELL_SHOCK_BARRIER); - ChainPyros = true; - PyrosCasted = 0; - ShockBarrier_Timer = 60000; - }else ShockBarrier_Timer -= diff; - - //Chain Pyros (3 of them max) - if (ChainPyros && !m_creature->IsNonMeleeSpellCasted(false)) - { - if (PyrosCasted < 3) - { - DoCast(m_creature->getVictim(), SPELL_PYROBLAST); - PyrosCasted++; - - } - else - { - ChainPyros = false; - Fireball_Timer = 2500; - ArcaneDisruption_Timer = 60000; - } - } - } - - if (Phase == 5) - { - if (Phase_Timer < diff) - { - m_creature->InterruptNonMeleeSpells(false); - m_creature->RemoveAurasDueToSpell(SPELL_FULLPOWER); - - DoCast(m_creature, SPELL_EXPLODE); - - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - Phase = 6; - AttackStart(m_creature->getVictim()); - }else Phase_Timer -= diff; - } - - //Phase 5 - if (Phase == 6) - { - - //GravityLapse_Timer - if (GravityLapse_Timer < diff) - { - std::list::iterator i = m_creature->getThreatManager().getThreatList().begin(); - switch(GravityLapse_Phase) - { - case 0: - m_creature->StopMoving(); - m_creature->GetMotionMaster()->Clear(); - m_creature->GetMotionMaster()->MoveIdle(); - m_creature->GetMap()->CreatureRelocation(m_creature, afGravityPos[0], afGravityPos[1], afGravityPos[2], 0); - m_creature->SendMonsterMove(afGravityPos[0], afGravityPos[1], afGravityPos[2], 0, MOVEMENTFLAG_NONE, 0); - - // 1) Kael'thas will portal the whole raid right into his body - for (i = m_creature->getThreatManager().getThreatList().begin(); i!= m_creature->getThreatManager().getThreatList().end(); ++i) - { - Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid()); - if (pUnit && (pUnit->GetTypeId() == TYPEID_PLAYER)) - { - //Use work around packet to prevent player from being dropped from combat - DoTeleportPlayer(pUnit, afGravityPos[0], afGravityPos[1], afGravityPos[2], pUnit->GetOrientation()); - } - } - - GravityLapse_Timer = 500; - ++GravityLapse_Phase; - InGravityLapse = true; - ShockBarrier_Timer = 1000; - NetherBeam_Timer = 5000; - break; - - case 1: - switch(rand()%2) - { - case 0: DoScriptText(SAY_GRAVITYLAPSE1, m_creature); break; - case 1: DoScriptText(SAY_GRAVITYLAPSE2, m_creature); break; - } - - // 2) At that point he will put a Gravity Lapse debuff on everyone - for (i = m_creature->getThreatManager().getThreatList().begin(); i!= m_creature->getThreatManager().getThreatList().end(); ++i) - { - if (Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid())) - { - m_creature->CastSpell(pUnit, SPELL_KNOCKBACK, true); - //Gravity lapse - needs an exception in Spell system to work - - pUnit->CastSpell(pUnit, SPELL_GRAVITY_LAPSE, true, 0, 0, m_creature->GetGUID()); - pUnit->CastSpell(pUnit, SPELL_GRAVITY_LAPSE_AURA, true, 0, 0, m_creature->GetGUID()); - - //Using packet workaround - WorldPacket data(12); - data.SetOpcode(SMSG_MOVE_SET_CAN_FLY); - data.append(pUnit->GetPackGUID()); - data << uint32(0); - pUnit->SendMessageToSet(&data, true); - } - } - GravityLapse_Timer = 10000; - GravityLapse_Phase++; - break; - - case 2: - //Cast nether vapor aura on self - m_creature->InterruptNonMeleeSpells(false); - DoCast(m_creature, SPELL_NETHER_VAPOR); - - GravityLapse_Timer = 20000; - GravityLapse_Phase++; - break; - - case 3: - //Remove flight - for (i = m_creature->getThreatManager().getThreatList().begin(); i!= m_creature->getThreatManager().getThreatList().end(); ++i) - { - if (Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid())) - { - //Using packet workaround - WorldPacket data(12); - data.SetOpcode(SMSG_MOVE_UNSET_CAN_FLY); - data.append(pUnit->GetPackGUID()); - data << uint32(0); - pUnit->SendMessageToSet(&data, true); - } - } - - m_creature->RemoveAurasDueToSpell(SPELL_NETHER_VAPOR); - InGravityLapse = false; - GravityLapse_Timer = 60000; - GravityLapse_Phase = 0; - AttackStart(m_creature->getVictim()); - break; - } - }else GravityLapse_Timer -= diff; - - if (InGravityLapse) - { - //ShockBarrier_Timer - if (ShockBarrier_Timer < diff) - { - DoCast(m_creature, SPELL_SHOCK_BARRIER); - ShockBarrier_Timer = 20000; - }else ShockBarrier_Timer -= diff; - - //NetherBeam_Timer - if (NetherBeam_Timer < diff) - { - if (Unit* pUnit = SelectUnit(SELECT_TARGET_RANDOM, 0)) - DoCast(pUnit, SPELL_NETHER_BEAM); - - NetherBeam_Timer = 4000; - }else NetherBeam_Timer -= diff; - } - } - - if (!InGravityLapse) - DoMeleeAttackIfReady(); - } - } - } -}; - -//Thaladred the Darkener AI -struct TRINITY_DLL_DECL boss_thaladred_the_darkenerAI : public advisorbase_ai -{ - boss_thaladred_the_darkenerAI(Creature* pCreature) : advisorbase_ai(pCreature) {} - - uint32 Gaze_Timer; - uint32 Silence_Timer; - uint32 PsychicBlow_Timer; - - void Reset() - { - Gaze_Timer = 100; - Silence_Timer = 20000; - PsychicBlow_Timer = 10000; - - advisorbase_ai::Reset(); - } - - void Aggro(Unit *who) - { - if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) - return; - - if (!who || FakeDeath) - return; - - DoScriptText(SAY_THALADRED_AGGRO, m_creature); - m_creature->AddThreat(who, 5000000.0f); - } - - void JustDied(Unit* pKiller) - { - if (m_pInstance && m_pInstance->GetData(DATA_KAELTHASEVENT) == 3) - DoScriptText(SAY_THALADRED_DEATH, m_creature); - } - - void UpdateAI(const uint32 diff) - { - advisorbase_ai::UpdateAI(diff); - - //Faking death, don't do anything - if (FakeDeath) - return; - - //Return since we have no target - if (!UpdateVictim()) - return; - - //Gaze_Timer - if (Gaze_Timer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - { - DoResetThreat(); - m_creature->AddThreat(target, 5000000.0f); - DoScriptText(EMOTE_THALADRED_GAZE, m_creature, target); - Gaze_Timer = 8500; - } - }else Gaze_Timer -= diff; - - //Silence_Timer - if (Silence_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_SILENCE); - Silence_Timer = 20000; - }else Silence_Timer -= diff; - - //PsychicBlow_Timer - if (PsychicBlow_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_PSYCHIC_BLOW); - PsychicBlow_Timer = 20000+rand()%5000; - }else PsychicBlow_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -//Lord Sanguinar AI -struct TRINITY_DLL_DECL boss_lord_sanguinarAI : public advisorbase_ai -{ - boss_lord_sanguinarAI(Creature* pCreature) : advisorbase_ai(pCreature) {} - - uint32 Fear_Timer; - - void Reset() - { - Fear_Timer = 20000; - advisorbase_ai::Reset(); - } - - void Aggro(Unit *who) - { - if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) - return; - - if (!who || FakeDeath) - return; - - DoScriptText(SAY_SANGUINAR_AGGRO, m_creature); - } - - void JustDied(Unit* Killer) - { - if (m_pInstance && m_pInstance->GetData(DATA_KAELTHASEVENT) == 3) - DoScriptText(SAY_SANGUINAR_DEATH, m_creature); - } - - void UpdateAI(const uint32 diff) - { - advisorbase_ai::UpdateAI(diff); - - //Faking death, don't do anything - if (FakeDeath) - return; - - //Return since we have no target - if (!UpdateVictim()) - return; - - //Fear_Timer - if (Fear_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_BELLOWING_ROAR); - Fear_Timer = 25000+rand()%10000; //approximately every 30 seconds - }else Fear_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -//Grand Astromancer Capernian AI -struct TRINITY_DLL_DECL boss_grand_astromancer_capernianAI : public advisorbase_ai -{ - boss_grand_astromancer_capernianAI(Creature* pCreature) : advisorbase_ai(pCreature) {} - - uint32 Fireball_Timer; - uint32 Conflagration_Timer; - uint32 ArcaneExplosion_Timer; - uint32 Yell_Timer; - bool Yell; - - void Reset() - { - Fireball_Timer = 2000; - Conflagration_Timer = 20000; - ArcaneExplosion_Timer = 5000; - Yell_Timer = 2000; - Yell = false; - - advisorbase_ai::Reset(); - } - - void JustDied(Unit* pKiller) - { - if (m_pInstance && m_pInstance->GetData(DATA_KAELTHASEVENT) == 3) - DoScriptText(SAY_CAPERNIAN_DEATH, m_creature); - } - - void AttackStart(Unit* who) - { - if (!who || FakeDeath || m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) - return; - - if (m_creature->Attack(who, true)) - { - m_creature->AddThreat(who, 0.0f); - m_creature->SetInCombatWith(who); - who->SetInCombatWith(m_creature); - - m_creature->GetMotionMaster()->MoveChase(who, CAPERNIAN_DISTANCE); - } - } - - void Aggro(Unit *who) - { - if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) - return; - - if (!who || FakeDeath) - return; - } - - void UpdateAI(const uint32 diff) - { - advisorbase_ai::UpdateAI(diff); - - //Faking Death, don't do anything - if (FakeDeath) - return; - - //Return since we have no target - if (!UpdateVictim()) - return; - - //Yell_Timer - if (!Yell) - { - if (Yell_Timer < diff) - { - DoScriptText(SAY_CAPERNIAN_AGGRO, m_creature); - Yell = true; - }else Yell_Timer -= diff; - } - - //Fireball_Timer - if (Fireball_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_CAPERNIAN_FIREBALL); - Fireball_Timer = 4000; - }else Fireball_Timer -= diff; - - //Conflagration_Timer - if (Conflagration_Timer < diff) - { - Unit *target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM, 0); - - if (target && m_creature->IsWithinDistInMap(target, 30)) - DoCast(target, SPELL_CONFLAGRATION); - else - DoCast(m_creature->getVictim(), SPELL_CONFLAGRATION); - - Conflagration_Timer = 10000+rand()%5000; - }else Conflagration_Timer -= diff; - - //ArcaneExplosion_Timer - if (ArcaneExplosion_Timer < diff) - { - bool InMeleeRange = false; - Unit *target = NULL; - std::list& m_threatlist = m_creature->getThreatManager().getThreatList(); - for (std::list::iterator i = m_threatlist.begin(); i!= m_threatlist.end(); ++i) - { - Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid()); - //if in melee range - if (pUnit && pUnit->IsWithinDistInMap(m_creature, 5)) - { - InMeleeRange = true; - target = pUnit; - break; - } - } - - if (InMeleeRange) - DoCast(target, SPELL_ARCANE_EXPLOSION); - - ArcaneExplosion_Timer = 4000+rand()%2000; - }else ArcaneExplosion_Timer -= diff; - - //Do NOT deal any melee damage. - } -}; - -//Master Engineer Telonicus AI -struct TRINITY_DLL_DECL boss_master_engineer_telonicusAI : public advisorbase_ai -{ - boss_master_engineer_telonicusAI(Creature* pCreature) : advisorbase_ai(pCreature) {} - - uint32 Bomb_Timer; - uint32 RemoteToy_Timer; - - void Reset() - { - Bomb_Timer = 10000; - RemoteToy_Timer = 5000; - - advisorbase_ai::Reset(); - } - - void JustDied(Unit* pKiller) - { - if (m_pInstance && m_pInstance->GetData(DATA_KAELTHASEVENT) == 3) - DoScriptText(SAY_TELONICUS_DEATH, m_creature); - } - - void Aggro(Unit *who) - { - if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) - return; - - if (!who || FakeDeath) - return; - - DoScriptText(SAY_TELONICUS_AGGRO, m_creature); - } - - void UpdateAI(const uint32 diff) - { - advisorbase_ai::UpdateAI(diff); - - //Faking Death, do nothing - if (FakeDeath) - return; - - //Return since we have no target - if (!UpdateVictim()) - return; - - //Bomb_Timer - if (Bomb_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_BOMB); - Bomb_Timer = 25000; - }else Bomb_Timer -= diff; - - //RemoteToy_Timer - if (RemoteToy_Timer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - DoCast(target, SPELL_REMOTE_TOY); - - RemoteToy_Timer = 10000+rand()%5000; - }else RemoteToy_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -//Flame Strike AI -struct TRINITY_DLL_DECL mob_kael_flamestrikeAI : public ScriptedAI -{ - mob_kael_flamestrikeAI(Creature* pCreature) : ScriptedAI(pCreature) {} - - uint32 Timer; - bool Casting; - bool KillSelf; - - void Reset() - { - Timer = 5000; - Casting = false; - KillSelf = false; - - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->setFaction(14); - } - - void MoveInLineOfSight(Unit *who) { } - - void UpdateAI(const uint32 diff) - { - if (!Casting) - { - DoCast(m_creature, SPELL_FLAME_STRIKE_VIS); - Casting = true; - } - - //Timer - if (Timer < diff) - { - if (!KillSelf) - { - m_creature->InterruptNonMeleeSpells(false); - DoCast(m_creature, SPELL_FLAME_STRIKE_DMG); - }else m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - - KillSelf = true; - Timer = 1000; - }else Timer -= diff; - } -}; - -//Phoenix AI -struct TRINITY_DLL_DECL mob_phoenix_tkAI : public ScriptedAI -{ - mob_phoenix_tkAI(Creature* pCreature) : ScriptedAI(pCreature) {} - - uint32 Cycle_Timer; - - void Reset() - { - Cycle_Timer = 2000; - m_creature->CastSpell(m_creature,SPELL_BURN,true); - } - - void JustDied(Unit* killer) - { - //is this spell in use anylonger? - //m_creature->CastSpell(m_creature,SPELL_EMBER_BLAST,true); - m_creature->SummonCreature(NPC_PHOENIX_EGG,m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ(),m_creature->GetOrientation(),TEMPSUMMON_TIMED_DESPAWN,16000); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (Cycle_Timer < diff) - { - //spell Burn should possible do this, but it doesn't, so do this for now. - uint32 dmg = urand(4500,5500); - if (m_creature->GetHealth() > dmg) - m_creature->SetHealth(uint32(m_creature->GetHealth()-dmg)); - Cycle_Timer = 2000; - }else Cycle_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -//Phoenix Egg AI -struct TRINITY_DLL_DECL mob_phoenix_egg_tkAI : public ScriptedAI -{ - mob_phoenix_egg_tkAI(Creature* pCreature) : ScriptedAI(pCreature) {} - - uint32 Rebirth_Timer; - - void Reset() - { - Rebirth_Timer = 15000; - } - - //ignore any - void MoveInLineOfSight(Unit* who) { return; } - - void AttackStart(Unit* who) - { - if (m_creature->Attack(who, false)) - { - m_creature->SetInCombatWith(who); - who->SetInCombatWith(m_creature); - - DoStartNoMovement(who); - } - } - - void JustSummoned(Creature* summoned) - { - summoned->AddThreat(m_creature->getVictim(), 0.0f); - summoned->CastSpell(summoned,SPELL_REBIRTH,false); - } - - void UpdateAI(const uint32 diff) - { - if (!Rebirth_Timer) - return; - - if (Rebirth_Timer <= diff) - { - m_creature->SummonCreature(NPC_PHOENIX,m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ(),m_creature->GetOrientation(),TEMPSUMMON_CORPSE_DESPAWN,5000); - Rebirth_Timer = 0; - }else Rebirth_Timer -= diff; - } -}; - -CreatureAI* GetAI_boss_kaelthas(Creature* pCreature) -{ - return new boss_kaelthasAI(pCreature); -} - -CreatureAI* GetAI_boss_thaladred_the_darkener(Creature* pCreature) -{ - return new boss_thaladred_the_darkenerAI(pCreature); -} - -CreatureAI* GetAI_boss_lord_sanguinar(Creature* pCreature) -{ - return new boss_lord_sanguinarAI(pCreature); -} - -CreatureAI* GetAI_boss_grand_astromancer_capernian(Creature* pCreature) -{ - return new boss_grand_astromancer_capernianAI(pCreature); -} - -CreatureAI* GetAI_boss_master_engineer_telonicus(Creature* pCreature) -{ - return new boss_master_engineer_telonicusAI(pCreature); -} - -CreatureAI* GetAI_mob_kael_flamestrike(Creature* pCreature) -{ - return new mob_kael_flamestrikeAI(pCreature); -} - -CreatureAI* GetAI_mob_phoenix_tk(Creature* pCreature) -{ - return new mob_phoenix_tkAI(pCreature); -} - -CreatureAI* GetAI_mob_phoenix_egg_tk(Creature* pCreature) -{ - return new mob_phoenix_egg_tkAI(pCreature); -} - -void AddSC_boss_kaelthas() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_kaelthas"; - newscript->GetAI = &GetAI_boss_kaelthas; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "boss_thaladred_the_darkener"; - newscript->GetAI = &GetAI_boss_thaladred_the_darkener; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "boss_lord_sanguinar"; - newscript->GetAI = &GetAI_boss_lord_sanguinar; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "boss_grand_astromancer_capernian"; - newscript->GetAI = &GetAI_boss_grand_astromancer_capernian; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "boss_master_engineer_telonicus"; - newscript->GetAI = &GetAI_boss_master_engineer_telonicus; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name= "mob_kael_flamestrike"; - newscript->GetAI = &GetAI_mob_kael_flamestrike; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_phoenix_tk"; - newscript->GetAI = &GetAI_mob_phoenix_tk; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_phoenix_egg_tk"; - newscript->GetAI = &GetAI_mob_phoenix_egg_tk; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_void_reaver.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_void_reaver.cpp deleted file mode 100644 index 60cfaf1609d..00000000000 --- a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_void_reaver.cpp +++ /dev/null @@ -1,185 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Void_Reaver -SD%Complete: 90 -SDComment: Should reset if raid are out of room. -SDCategory: Tempest Keep, The Eye -EndScriptData */ - -#include "precompiled.h" -#include "def_the_eye.h" - -enum -{ - SAY_AGGRO = -1550000, - SAY_SLAY1 = -1550001, - SAY_SLAY2 = -1550002, - SAY_SLAY3 = -1550003, - SAY_DEATH = -1550004, - SAY_POUNDING1 = -1550005, - SAY_POUNDING2 = -1550006, - - SPELL_POUNDING = 34162, - SPELL_ARCANE_ORB = 34172, - SPELL_KNOCK_AWAY = 25778, - SPELL_BERSERK = 27680 -}; - -struct TRINITY_DLL_DECL boss_void_reaverAI : public ScriptedAI -{ - boss_void_reaverAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - uint32 Pounding_Timer; - uint32 ArcaneOrb_Timer; - uint32 KnockAway_Timer; - uint32 Berserk_Timer; - - bool Enraged; - - void Reset() - { - Pounding_Timer = 15000; - ArcaneOrb_Timer = 3000; - KnockAway_Timer = 30000; - Berserk_Timer = 600000; - - Enraged = false; - - if (pInstance && m_creature->isAlive()) - pInstance->SetData(DATA_VOIDREAVEREVENT, NOT_STARTED); - } - - void KilledUnit(Unit *victim) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; - case 2: DoScriptText(SAY_SLAY3, m_creature); break; - } - } - - void JustDied(Unit *victim) - { - DoScriptText(SAY_DEATH, m_creature); - DoZoneInCombat(); - - if (pInstance) - pInstance->SetData(DATA_VOIDREAVEREVENT, DONE); - } - - void EnterCombat(Unit *who) - { - DoScriptText(SAY_AGGRO, m_creature); - - if (pInstance) - pInstance->SetData(DATA_VOIDREAVEREVENT, IN_PROGRESS); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - // Pounding - if (Pounding_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_POUNDING); - - switch(rand()%2) - { - case 0: DoScriptText(SAY_POUNDING1, m_creature); break; - case 1: DoScriptText(SAY_POUNDING2, m_creature); break; - } - Pounding_Timer = 15000; //cast time(3000) + cooldown time(12000) - }else Pounding_Timer -= diff; - - // Arcane Orb - if (ArcaneOrb_Timer < diff) - { - Unit *target = NULL; - std::list t_list = m_creature->getThreatManager().getThreatList(); - std::vector target_list; - for(std::list::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr) - { - target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()); - // exclude pets & totems - if (target->GetTypeId() != TYPEID_PLAYER) - continue; - - //18 yard radius minimum - if (target && target->GetTypeId() == TYPEID_PLAYER && target->isAlive() && !target->IsWithinDist(m_creature, 18, false)) - target_list.push_back(target); - target = NULL; - } - - if (target_list.size()) - target = *(target_list.begin()+rand()%target_list.size()); - else - target = m_creature->getVictim(); - - if (target) - m_creature->CastSpell(target->GetPositionX(),target->GetPositionY(),target->GetPositionZ(), SPELL_ARCANE_ORB, false, NULL, NULL, NULL, target); - - ArcaneOrb_Timer = 3000; - }else ArcaneOrb_Timer -= diff; - - // Single Target knock back, reduces aggro - if (KnockAway_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_KNOCK_AWAY); - - //Drop 25% aggro - if (DoGetThreat(m_creature->getVictim())) - DoModifyThreatPercent(m_creature->getVictim(),-25); - - KnockAway_Timer = 30000; - }else KnockAway_Timer -= diff; - - //Berserk - if (Berserk_Timer < diff && !Enraged) - { - DoCast(m_creature,SPELL_BERSERK); - Enraged = true; - }else Berserk_Timer -= diff; - - DoMeleeAttackIfReady(); - - EnterEvadeIfOutOfCombatArea(diff); - } -}; - -CreatureAI* GetAI_boss_void_reaver(Creature* pCreature) -{ - return new boss_void_reaverAI (pCreature); -} - -void AddSC_boss_void_reaver() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_void_reaver"; - newscript->GetAI = &GetAI_boss_void_reaver; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/def_the_eye.h b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/def_the_eye.h deleted file mode 100644 index d0d3ea09061..00000000000 --- a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/def_the_eye.h +++ /dev/null @@ -1,20 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ - -#ifndef DEF_THE_EYE_H -#define DEF_THE_EYE_H - -#define DATA_ALAREVENT 1 -#define DATA_ASTROMANCER 2 -#define DATA_GRANDASTROMANCERCAPERNIAN 3 -#define DATA_HIGHASTROMANCERSOLARIANEVENT 4 -#define DATA_KAELTHAS 5 -#define DATA_KAELTHASEVENT 6 -#define DATA_LORDSANGUINAR 7 -#define DATA_MASTERENGINEERTELONICUS 8 -#define DATA_THALADREDTHEDARKENER 10 -#define DATA_VOIDREAVEREVENT 11 -#define DATA_ALAR 12 -#endif - diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/instance_the_eye.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/instance_the_eye.cpp deleted file mode 100644 index f973f96c1ff..00000000000 --- a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/instance_the_eye.cpp +++ /dev/null @@ -1,176 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Instance_The_Eye -SD%Complete: 100 -SDComment: -SDCategory: Tempest Keep, The Eye -EndScriptData */ - -#include "precompiled.h" -#include "def_the_eye.h" - -#define MAX_ENCOUNTER 5 - -/* The Eye encounters: -0 - Kael'thas event -1 - Al' ar event -2 - Solarian Event -3 - Void Reaver event -*/ - -struct TRINITY_DLL_DECL instance_the_eye : public ScriptedInstance -{ - instance_the_eye(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; - - uint64 ThaladredTheDarkener; - uint64 LordSanguinar; - uint64 GrandAstromancerCapernian; - uint64 MasterEngineerTelonicus; - uint64 Kaelthas; - uint64 Astromancer; - uint64 Alar; - - uint8 KaelthasEventPhase; - uint8 AlarEventPhase; - - uint32 m_auiEncounter[MAX_ENCOUNTER]; - - void Initialize() - { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - - ThaladredTheDarkener = 0; - LordSanguinar = 0; - GrandAstromancerCapernian = 0; - MasterEngineerTelonicus = 0; - Kaelthas = 0; - Astromancer = 0; - Alar = 0; - - KaelthasEventPhase = 0; - AlarEventPhase = 0; - } - - bool IsEncounterInProgress() const - { - for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) return true; - - return false; - } - - void OnCreatureCreate(Creature* pCreature, bool add) - { - switch(pCreature->GetEntry()) - { - case 20064: ThaladredTheDarkener = pCreature->GetGUID(); break; - case 20063: MasterEngineerTelonicus = pCreature->GetGUID(); break; - case 20062: GrandAstromancerCapernian = pCreature->GetGUID(); break; - case 20060: LordSanguinar = pCreature->GetGUID(); break; - case 19622: Kaelthas = pCreature->GetGUID(); break; - case 18805: Astromancer = pCreature->GetGUID(); break; - case 19514: Alar = pCreature->GetGUID(); break; - } - } - - uint64 GetData64(uint32 identifier) - { - switch(identifier) - { - case DATA_THALADREDTHEDARKENER: return ThaladredTheDarkener; - case DATA_LORDSANGUINAR: return LordSanguinar; - case DATA_GRANDASTROMANCERCAPERNIAN: return GrandAstromancerCapernian; - case DATA_MASTERENGINEERTELONICUS: return MasterEngineerTelonicus; - case DATA_KAELTHAS: return Kaelthas; - case DATA_ASTROMANCER: return Astromancer; - case DATA_ALAR: return Alar; - } - return 0; - } - - void SetData(uint32 type, uint32 data) - { - switch(type) - { - case DATA_ALAREVENT: AlarEventPhase = data; m_auiEncounter[0] = data; break; - case DATA_HIGHASTROMANCERSOLARIANEVENT: m_auiEncounter[1] = data; break; - case DATA_VOIDREAVEREVENT: m_auiEncounter[2] = data; break; - case DATA_KAELTHASEVENT: KaelthasEventPhase = data; m_auiEncounter[3] = data; break; - } - if (data == DONE) - SaveToDB(); - } - - uint32 GetData(uint32 type) - { - switch(type) - { - case DATA_ALAREVENT: return AlarEventPhase; - case DATA_HIGHASTROMANCERSOLARIANEVENT: return m_auiEncounter[1]; - case DATA_VOIDREAVEREVENT: return m_auiEncounter[2]; - case DATA_KAELTHASEVENT: return KaelthasEventPhase; - } - return 0; - } - - std::string GetSaveData() - { - OUT_SAVE_INST_DATA; - std::ostringstream stream; - stream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " " << m_auiEncounter[3]; - char* out = new char[stream.str().length() + 1]; - strcpy(out, stream.str().c_str()); - if (out) - { - OUT_SAVE_INST_DATA_COMPLETE; - return out; - } - return NULL; - } - - void Load(const char* in) - { - if (!in) - { - OUT_LOAD_INST_DATA_FAIL; - return; - } - OUT_LOAD_INST_DATA(in); - std::istringstream stream(in); - stream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3]; - for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) // Do not load an encounter as "In Progress" - reset it instead. - m_auiEncounter[i] = NOT_STARTED; - OUT_LOAD_INST_DATA_COMPLETE; - } -}; - -InstanceData* GetInstanceData_instance_the_eye(Map* pMap) -{ - return new instance_the_eye(pMap); -} - -void AddSC_instance_the_eye() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_the_eye"; - newscript->GetInstanceData = &GetInstanceData_instance_the_eye; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/the_eye.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/the_eye.cpp deleted file mode 100644 index 2dfff45796f..00000000000 --- a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/the_eye.cpp +++ /dev/null @@ -1,99 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: The_Eye -SD%Complete: 100 -SDComment: -SDCategory: Tempest Keep, The Eye -EndScriptData */ - -/* ContentData -mob_crystalcore_devastator -EndContentData */ - -#include "precompiled.h" -#include "def_the_eye.h" - -#define SPELL_COUNTERCHARGE 35035 -#define SPELL_KNOCKAWAY 22893 - -struct TRINITY_DLL_DECL mob_crystalcore_devastatorAI : public ScriptedAI -{ - mob_crystalcore_devastatorAI(Creature *c) : ScriptedAI(c) {} - - uint32 Knockaway_Timer; - uint32 Countercharge_Timer; - - void Reset() - { - Countercharge_Timer = 9000; - Knockaway_Timer = 25000; - } - - void EnterCombat(Unit *who) - { - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //Check if we have a current target - //Knockaway_Timer - if (Knockaway_Timer < diff) - { - m_creature->CastSpell(m_creature->getVictim(),SPELL_KNOCKAWAY, true); - - // current aggro target is knocked away pick new target - Unit* Target = SelectUnit(SELECT_TARGET_TOPAGGRO, 0); - - if (!Target || Target == m_creature->getVictim()) - Target = SelectUnit(SELECT_TARGET_TOPAGGRO, 1); - - if (Target) - m_creature->TauntApply(Target); - - Knockaway_Timer = 23000; - } - else Knockaway_Timer -= diff; - - //Countercharge_Timer - if (Countercharge_Timer < diff) - { - DoCast(this->m_creature,SPELL_COUNTERCHARGE); - Countercharge_Timer = 45000; - }else Countercharge_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_crystalcore_devastator(Creature* pCreature) -{ - return new mob_crystalcore_devastatorAI (pCreature); -} - -void AddSC_the_eye() -{ - Script *newscript; - newscript = new Script; - newscript->Name="mob_crystalcore_devastator"; - newscript->GetAI = &GetAI_mob_crystalcore_devastator; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_gatewatcher_gyrokill.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_gatewatcher_gyrokill.cpp deleted file mode 100644 index 268cfeb2918..00000000000 --- a/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_gatewatcher_gyrokill.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Gatewatcher_Gyrokill -SD%Complete: 0 -SDComment: Place Holder -SDCategory: Tempest Keep, The Mechanar -EndScriptData */ - -#include "precompiled.h" - -#define SAY_AGGRO -1554000 -#define SAY_SAW_ATTACK1 -1554001 -#define SAY_SAW_ATTACK2 -1554002 -#define SAY_SLAY1 -1554003 -#define SAY_SLAY2 -1554004 -#define SAY_DEATH -1554005 - -#define SPELL_STREAM_OF_MACHINE_FLUID 35311 -#define SPELL_SAW_BLADE 35318 -#define H_SPELL_SAW_BLADE 39192 -#define SPELL_SHADOW_POWER 35322 -#define H_SPELL_SHADOW_POWER 39193 - diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_gatewatcher_ironhand.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_gatewatcher_ironhand.cpp deleted file mode 100644 index a1ca31c3e5e..00000000000 --- a/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_gatewatcher_ironhand.cpp +++ /dev/null @@ -1,148 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -/* ScriptData -SDName: Boss_Gatewatcher_Ironhand -SD%Complete: 75 -SDComment: -SDCategory: Tempest Keep, The Mechanar -EndScriptData */ - -#include "precompiled.h" - -#define SAY_AGGRO_1 -1554006 -#define SAY_HAMMER_1 -1554007 -#define SAY_HAMMER_2 -1554008 -#define SAY_SLAY_1 -1554009 -#define SAY_SLAY_2 -1554010 -#define SAY_DEATH_1 -1554011 -#define EMOTE_HAMMER -1554012 - -// Spells to be casted -#define SPELL_SHADOW_POWER 35322 -#define H_SPELL_SHADOW_POWER 39193 -#define SPELL_HAMMER_PUNCH 35326 -#define SPELL_JACKHAMMER 35327 -#define H_SPELL_JACKHAMMER 39194 -#define SPELL_STREAM_OF_MACHINE_FLUID 35311 - -// Gatewatcher Iron-Hand AI -struct TRINITY_DLL_DECL boss_gatewatcher_iron_handAI : public ScriptedAI -{ - boss_gatewatcher_iron_handAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - ScriptedInstance *pInstance; - - bool HeroicMode; - - uint32 Shadow_Power_Timer; - uint32 Jackhammer_Timer; - uint32 Stream_of_Machine_Fluid_Timer; - - void Reset() - { - Shadow_Power_Timer = 25000; - Jackhammer_Timer = 45000; - Stream_of_Machine_Fluid_Timer = 55000; - - } - void EnterCombat(Unit *who) - { - DoScriptText(SAY_AGGRO_1, m_creature); - } - - void KilledUnit(Unit* victim) - { - if (rand()%2) - return; - - switch(rand()%2) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature); break; - case 1: DoScriptText(SAY_SLAY_2, m_creature); break; - } - } - - void JustDied(Unit* Killer) - { - DoScriptText(SAY_DEATH_1, m_creature); - - if (!pInstance) - return; - - //TODO: Add door check/open code - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //Shadow Power - if (Shadow_Power_Timer < diff) - { - DoCast(m_creature,HeroicMode ? H_SPELL_SHADOW_POWER : SPELL_SHADOW_POWER); - Shadow_Power_Timer = 20000 + rand()%8000; - }else Shadow_Power_Timer -= diff; - - //Jack Hammer - if (Jackhammer_Timer < diff) - { - //TODO: expect cast this about 5 times in a row (?), announce it by emote only once - DoScriptText(EMOTE_HAMMER, m_creature); - DoCast(m_creature->getVictim(),HeroicMode ? H_SPELL_JACKHAMMER : SPELL_JACKHAMMER); - - //chance to yell, but not same time as emote (after spell in fact casted) - if (rand()%2) - return; - - switch(rand()%2) - { - case 0: DoScriptText(SAY_HAMMER_1, m_creature); break; - case 1: DoScriptText(SAY_HAMMER_2, m_creature); break; - } - Jackhammer_Timer = 30000; - }else Jackhammer_Timer -= diff; - - //Stream of Machine Fluid - if (Stream_of_Machine_Fluid_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_STREAM_OF_MACHINE_FLUID); - Stream_of_Machine_Fluid_Timer = 35000 + rand()%15000; - }else Stream_of_Machine_Fluid_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_gatewatcher_iron_hand(Creature* pCreature) -{ - return new boss_gatewatcher_iron_handAI (pCreature); -} - -void AddSC_boss_gatewatcher_iron_hand() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_gatewatcher_iron_hand"; - newscript->GetAI = &GetAI_boss_gatewatcher_iron_hand; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_nethermancer_sepethrea.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_nethermancer_sepethrea.cpp deleted file mode 100644 index da6c613d794..00000000000 --- a/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_nethermancer_sepethrea.cpp +++ /dev/null @@ -1,258 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -/* ScriptData -SDName: Boss_Nethermancer_Sepethrea -SD%Complete: 90 -SDComment: Need adjustments to initial summons -SDCategory: Tempest Keep, The Mechanar -EndScriptData */ - -#include "precompiled.h" -#include "def_mechanar.h" - -#define SAY_AGGRO -1554013 -#define SAY_SUMMON -1554014 -#define SAY_DRAGONS_BREATH_1 -1554015 -#define SAY_DRAGONS_BREATH_2 -1554016 -#define SAY_SLAY1 -1554017 -#define SAY_SLAY2 -1554018 -#define SAY_DEATH -1554019 - -#define SPELL_SUMMON_RAGIN_FLAMES 35275 -#define H_SPELL_SUMMON_RAGIN_FLAMES 39084 - -#define SPELL_FROST_ATTACK 35263 -#define SPELL_ARCANE_BLAST 35314 -#define SPELL_DRAGONS_BREATH 35250 -#define SPELL_KNOCKBACK 37317 -#define SPELL_SOLARBURN 35267 - -struct TRINITY_DLL_DECL boss_nethermancer_sepethreaAI : public ScriptedAI -{ - boss_nethermancer_sepethreaAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - ScriptedInstance *pInstance; - - bool HeroicMode; - - uint32 frost_attack_Timer; - uint32 arcane_blast_Timer; - uint32 dragons_breath_Timer; - uint32 knockback_Timer; - uint32 solarburn_Timer; - - void Reset() - { - frost_attack_Timer = 7000 + rand()%3000; - arcane_blast_Timer = 12000 + rand()%6000; - dragons_breath_Timer = 18000 + rand()%4000; - knockback_Timer = 22000 + rand()%6000; - solarburn_Timer = 30000; - - if (pInstance) - pInstance->SetData(DATA_NETHERMANCER_EVENT, NOT_STARTED); - } - - void EnterCombat(Unit *who) - { - if (pInstance) - pInstance->SetData(DATA_NETHERMANCER_EVENT, IN_PROGRESS); - - DoScriptText(SAY_AGGRO, m_creature); - DoCast(who, HeroicMode ? H_SPELL_SUMMON_RAGIN_FLAMES : SPELL_SUMMON_RAGIN_FLAMES); - DoScriptText(SAY_SUMMON, m_creature); - } - - void KilledUnit(Unit* victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; - } - } - - void JustDied(Unit* Killer) - { - DoScriptText(SAY_DEATH, m_creature); - - if (pInstance) - pInstance->SetData(DATA_NETHERMANCER_EVENT, DONE); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //Frost Attack - if (frost_attack_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_FROST_ATTACK); - frost_attack_Timer = 7000 + rand()%3000; - }else frost_attack_Timer -= diff; - - //Arcane Blast - if (arcane_blast_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_ARCANE_BLAST); - arcane_blast_Timer = 15000; - }else arcane_blast_Timer -= diff; - - //Dragons Breath - if (dragons_breath_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_DRAGONS_BREATH); - { - if (rand()%2) - return; - - switch(rand()%2) - { - case 0: DoScriptText(SAY_DRAGONS_BREATH_1, m_creature); break; - case 1: DoScriptText(SAY_DRAGONS_BREATH_2, m_creature); break; - } - } - dragons_breath_Timer = 12000 + rand()%10000; - }else dragons_breath_Timer -= diff; - - //Knockback - if (knockback_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_KNOCKBACK); - knockback_Timer = 15000 + rand()%10000; - }else knockback_Timer -= diff; - - //Solarburn - if (solarburn_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_SOLARBURN); - solarburn_Timer = 30000; - }else solarburn_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_nethermancer_sepethrea(Creature* pCreature) -{ - return new boss_nethermancer_sepethreaAI (pCreature); -} - -#define SPELL_INFERNO 35268 -#define H_SPELL_INFERNO 39346 -#define SPELL_FIRE_TAIL 35278 - -struct TRINITY_DLL_DECL mob_ragin_flamesAI : public ScriptedAI -{ - mob_ragin_flamesAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - ScriptedInstance *pInstance; - - bool HeroicMode; - - uint32 inferno_Timer; - uint32 flame_timer; - uint32 Check_Timer; - - bool onlyonce; - - void Reset() - { - inferno_Timer = 10000; - flame_timer = 500; - Check_Timer = 2000; - onlyonce = false; - m_creature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_MAGIC, true); - m_creature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, true); - m_creature->SetSpeed(MOVE_RUN, HeroicMode ? 0.7f : 0.5f); - } - - void EnterCombat(Unit* who) - { - } - - void UpdateAI(const uint32 diff) - { - //Check_Timer - if (Check_Timer < diff) - { - if (pInstance) - { - if (pInstance->GetData(DATA_NETHERMANCER_EVENT) != IN_PROGRESS) - { - //remove - m_creature->setDeathState(JUST_DIED); - m_creature->RemoveCorpse(); - } - } - Check_Timer = 1000; - }else Check_Timer -= diff; - - if (!UpdateVictim()) - return; - - if (!onlyonce) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) - m_creature->GetMotionMaster()->MoveChase(target); - onlyonce = true; - } - - if (inferno_Timer < diff) - { - DoCast(m_creature->getVictim(),HeroicMode ? H_SPELL_INFERNO : SPELL_INFERNO); - m_creature->TauntApply(m_creature->getVictim()); - inferno_Timer = 10000; - }else inferno_Timer -= diff; - - if (flame_timer < diff) - { - DoCast(m_creature,SPELL_FIRE_TAIL); - flame_timer = 500; - }else flame_timer -=diff; - - DoMeleeAttackIfReady(); - } - -}; -CreatureAI* GetAI_mob_ragin_flames(Creature* pCreature) -{ - return new mob_ragin_flamesAI (pCreature); -} -void AddSC_boss_nethermancer_sepethrea() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_nethermancer_sepethrea"; - newscript->GetAI = &GetAI_boss_nethermancer_sepethrea; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_ragin_flames"; - newscript->GetAI = &GetAI_mob_ragin_flames; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_pathaleon_the_calculator.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_pathaleon_the_calculator.cpp deleted file mode 100644 index 1e06232c9b6..00000000000 --- a/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_pathaleon_the_calculator.cpp +++ /dev/null @@ -1,257 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -/* ScriptData -SDName: Boss Pathaleon the Calculator -SD%Complete: 50 -SDComment: Event missing. Script for himself 99% blizzlike. -SDCategory: Tempest Keep, The Mechanar -EndScriptData */ - -#include "precompiled.h" - -#define SAY_AGGRO -1554020 -#define SAY_DOMINATION_1 -1554021 -#define SAY_DOMINATION_2 -1554022 -#define SAY_SUMMON -1554023 -#define SAY_ENRAGE -1554024 -#define SAY_SLAY_1 -1554025 -#define SAY_SLAY_2 -1554026 -#define SAY_DEATH -1554027 - -// Spells to be casted -#define SPELL_MANA_TAP 36021 -#define SPELL_ARCANE_TORRENT 36022 -#define SPELL_DOMINATION 35280 -#define H_SPELL_ARCANE_EXPLOSION 15453 -#define SPELL_FRENZY 36992 - -#define SPELL_SUMMON_NETHER_WRAITH_1 35285 //Spells work, but not implemented -#define SPELL_SUMMON_NETHER_WRAITH_2 35286 -#define SPELL_SUMMON_NETHER_WRAITH_3 35287 -#define SPELL_SUMMON_NETHER_WRAITH_4 35288 - -// Add Spells -#define SPELL_DETONATION 35058 -#define SPELL_ARCANE_MISSILES 35034 - -struct TRINITY_DLL_DECL boss_pathaleon_the_calculatorAI : public ScriptedAI -{ - boss_pathaleon_the_calculatorAI(Creature *c) : ScriptedAI(c), summons(m_creature) - { - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - uint32 Summon_Timer; - SummonList summons; - uint32 ManaTap_Timer; - uint32 ArcaneTorrent_Timer; - uint32 Domination_Timer; - uint32 ArcaneExplosion_Timer; - bool HeroicMode; - bool Enraged; - - uint32 Counter; - - void Reset() - { - Summon_Timer = 30000; - ManaTap_Timer = 12000 + rand()%8000; - ArcaneTorrent_Timer = 16000 + rand()%9000; - Domination_Timer = 25000 + rand()%15000; - ArcaneExplosion_Timer = 8000 + rand()%5000; - - Enraged = false; - - Counter = 0; - summons.DespawnAll(); - } - void EnterCombat(Unit *who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - - void KilledUnit(Unit* victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature); break; - case 1: DoScriptText(SAY_SLAY_2, m_creature); break; - } - } - - void JustDied(Unit* Killer) - { - DoScriptText(SAY_DEATH, m_creature); - - summons.DespawnAll(); - } - - void JustSummoned(Creature *summon) {summons.Summon(summon);} - void SummonedCreatureDespawn(Creature *summon) {summons.Despawn(summon);} - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - if (Summon_Timer < diff) - { - for(uint8 i = 0; i < 3; ++i) - { - Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0); - Creature* Wraith = m_creature->SummonCreature(21062,m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - if (target && Wraith) - Wraith->AI()->AttackStart(target); - } - DoScriptText(SAY_SUMMON, m_creature); - Summon_Timer = 30000 + rand()%15000; - }else Summon_Timer -= diff; - - if (ManaTap_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_MANA_TAP); - ManaTap_Timer = 14000 + rand()%8000; - }else ManaTap_Timer -= diff; - - if (ArcaneTorrent_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_ARCANE_TORRENT); - ArcaneTorrent_Timer = 12000 + rand()%6000; - }else ArcaneTorrent_Timer -= diff; - - if (Domination_Timer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,1)) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_DOMINATION_1, m_creature); break; - case 1: DoScriptText(SAY_DOMINATION_2, m_creature); break; - } - - DoCast(target,SPELL_DOMINATION); - } - Domination_Timer = 25000 + rand()%5000; - }else Domination_Timer -= diff; - - //Only casting if Heroic Mode is used - if (HeroicMode) - { - if (ArcaneExplosion_Timer < diff) - { - DoCast(m_creature->getVictim(),H_SPELL_ARCANE_EXPLOSION); - ArcaneExplosion_Timer = 10000 + rand()%4000; - }else ArcaneExplosion_Timer -= diff; - } - - if (!Enraged && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 21) - { - DoCast(m_creature, SPELL_FRENZY); - DoScriptText(SAY_ENRAGE, m_creature); - Enraged = true; - - } - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_pathaleon_the_calculator(Creature* pCreature) -{ - return new boss_pathaleon_the_calculatorAI (pCreature); -} - -struct TRINITY_DLL_DECL mob_nether_wraithAI : public ScriptedAI -{ - mob_nether_wraithAI(Creature *c) : ScriptedAI(c) {} - - ScriptedInstance *pInstance; - - uint32 ArcaneMissiles_Timer; - uint32 Detonation_Timer; - uint32 Die_Timer; - bool Detonation; - - void Reset() - { - ArcaneMissiles_Timer = 1000 + rand()%3000; - Detonation_Timer = 20000; - Die_Timer = 2200; - Detonation = false; - - } - - void EnterCombat(Unit* who) - { - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (ArcaneMissiles_Timer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,1)) - DoCast(target,SPELL_ARCANE_MISSILES); - else - DoCast(m_creature->getVictim(),SPELL_ARCANE_MISSILES); - - ArcaneMissiles_Timer = 5000 + rand()%5000; - }else ArcaneMissiles_Timer -=diff; - - if (!Detonation) - { - if (Detonation_Timer < diff) - { - DoCast(m_creature,SPELL_DETONATION); - Detonation = true; - }else Detonation_Timer -= diff; - } - - if (Detonation) - { - if (Die_Timer < diff) - { - m_creature->setDeathState(JUST_DIED); - m_creature->RemoveCorpse(); - }else Die_Timer -= diff; - } - - DoMeleeAttackIfReady(); - } - -}; -CreatureAI* GetAI_mob_nether_wraith(Creature* pCreature) -{ - return new mob_nether_wraithAI (pCreature); -} - -void AddSC_boss_pathaleon_the_calculator() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_pathaleon_the_calculator"; - newscript->GetAI = &GetAI_boss_pathaleon_the_calculator; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_nether_wraith"; - newscript->GetAI = &GetAI_mob_nether_wraith; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/def_mechanar.h b/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/def_mechanar.h deleted file mode 100644 index d1b53eebf53..00000000000 --- a/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/def_mechanar.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef DEF_MECHANAR_H -#define DEF_MECHANAR_H - -#define DATA_NETHERMANCER_EVENT 1 -#endif - diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/instance_mechanar.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/instance_mechanar.cpp deleted file mode 100644 index e43190620d9..00000000000 --- a/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/instance_mechanar.cpp +++ /dev/null @@ -1,87 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Instance_Mechanar -SD%Complete: 100 -SDComment: -SDCategory: Mechanar -EndScriptData */ - -#include "precompiled.h" -#include "def_mechanar.h" - -#define MAX_ENCOUNTER 1 - -struct TRINITY_DLL_DECL instance_mechanar : public ScriptedInstance -{ - instance_mechanar(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; - - - uint32 m_auiEncounter[MAX_ENCOUNTER]; - - void Initialize() - { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - } - - bool IsEncounterInProgress() const - { - for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) - return true; - - return false; - } - - uint32 GetData(uint32 type) - { - switch(type) - { - case DATA_NETHERMANCER_EVENT: return m_auiEncounter[0]; - } - - return false; - } - - uint64 GetData64 (uint32 identifier) - { - return 0; - } - - void SetData(uint32 type, uint32 data) - { - switch(type) - { - case DATA_NETHERMANCER_EVENT: m_auiEncounter[0] = data; break; - } - } -}; - -InstanceData* GetInstanceData_instance_mechanar(Map* pMap) -{ - return new instance_mechanar(pMap); -} - -void AddSC_instance_mechanar() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_mechanar"; - newscript->GetInstanceData = &GetInstanceData_instance_mechanar; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/boss_bjarngrim.cpp b/src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/boss_bjarngrim.cpp deleted file mode 100644 index 5b6301019a5..00000000000 --- a/src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/boss_bjarngrim.cpp +++ /dev/null @@ -1,440 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss General Bjarngrim -SD%Complete: 70% -SDComment: Waypoint needed, we expect boss to always have 2x Stormforged Lieutenant following -SDCategory: Halls of Lightning -EndScriptData */ - -#include "precompiled.h" -#include "def_halls_of_lightning.h" - -enum -{ - //Yell - SAY_AGGRO = -1602000, - SAY_SLAY_1 = -1602001, - SAY_SLAY_2 = -1602002, - SAY_SLAY_3 = -1602003, - SAY_DEATH = -1602004, - SAY_BATTLE_STANCE = -1602005, - EMOTE_BATTLE_STANCE = -1602006, - SAY_BERSEKER_STANCE = -1602007, - EMOTE_BERSEKER_STANCE = -1602008, - SAY_DEFENSIVE_STANCE = -1602009, - EMOTE_DEFENSIVE_STANCE = -1602010, - - SPELL_DEFENSIVE_STANCE = 53790, - //SPELL_DEFENSIVE_AURA = 41105, - SPELL_SPELL_REFLECTION = 36096, - SPELL_PUMMEL = 12555, - SPELL_KNOCK_AWAY = 52029, - SPELL_IRONFORM = 52022, - - SPELL_BERSEKER_STANCE = 53791, - //SPELL_BERSEKER_AURA = 41107, - SPELL_INTERCEPT = 58769, - SPELL_WHIRLWIND = 52027, - SPELL_CLEAVE = 15284, - - SPELL_BATTLE_STANCE = 53792, - //SPELL_BATTLE_AURA = 41106, - SPELL_MORTAL_STRIKE = 16856, - SPELL_SLAM = 52026, - - //OTHER SPELLS - //SPELL_CHARGE_UP = 52098, // only used when starting walk from one platform to the other - //SPELL_TEMPORARY_ELECTRICAL_CHARGE = 52092, // triggered part of above - - NPC_STORMFORGED_LIEUTENANT = 29240, - SPELL_ARC_WELD = 59085, - SPELL_RENEW_STEEL_N = 52774, - SPELL_RENEW_STEEL_H = 59160, - - EQUIP_SWORD = 37871, - EQUIP_SHIELD = 35642, - EQUIP_MACE = 43623, - - STANCE_DEFENSIVE = 0, - STANCE_BERSERKER = 1, - STANCE_BATTLE = 2 -}; - -/*###### -## boss_bjarngrim -######*/ - -struct TRINITY_DLL_DECL boss_bjarngrimAI : public ScriptedAI -{ - boss_bjarngrimAI(Creature *pCreature) : ScriptedAI(pCreature) - { - m_pInstance = pCreature->GetInstanceData(); - m_bIsHeroic = pCreature->GetMap()->IsHeroic(); - m_uiStance = STANCE_DEFENSIVE; - } - - ScriptedInstance* m_pInstance; - - bool m_bIsHeroic; - bool m_bIsChangingStance; - - uint8 m_uiChargingStatus; - uint8 m_uiStance; - - uint32 m_uiCharge_Timer; - uint32 m_uiChangeStance_Timer; - - uint32 m_uiReflection_Timer; - uint32 m_uiKnockAway_Timer; - uint32 m_uiPummel_Timer; - uint32 m_uiIronform_Timer; - - uint32 m_uiIntercept_Timer; - uint32 m_uiWhirlwind_Timer; - uint32 m_uiCleave_Timer; - - uint32 m_uiMortalStrike_Timer; - uint32 m_uiSlam_Timer; - - uint64 m_uiStormforgedLieutenantGUID[2]; - - void Reset() - { - m_bIsChangingStance = false; - - m_uiChargingStatus = 0; - m_uiCharge_Timer = 1000; - - m_uiChangeStance_Timer = 20000 + rand()%5000; - - m_uiReflection_Timer = 8000; - m_uiKnockAway_Timer = 20000; - m_uiPummel_Timer = 10000; - m_uiIronform_Timer = 25000; - - m_uiIntercept_Timer = 5000; - m_uiWhirlwind_Timer = 10000; - m_uiCleave_Timer = 8000; - - m_uiMortalStrike_Timer = 8000; - m_uiSlam_Timer = 10000; - - for(uint8 i = 0; i < 2; ++i) - { - if (Creature* pStormforgedLieutenant = (Unit::GetCreature((*m_creature), m_uiStormforgedLieutenantGUID[i]))) - { - if (!pStormforgedLieutenant->isAlive()) - pStormforgedLieutenant->Respawn(); - } - } - - if (m_uiStance != STANCE_DEFENSIVE) - { - DoRemoveStanceAura(m_uiStance); - DoCast(m_creature, SPELL_DEFENSIVE_STANCE); - m_uiStance = STANCE_DEFENSIVE; - } - - SetEquipmentSlots(false, EQUIP_SWORD, EQUIP_SHIELD, EQUIP_NO_CHANGE); - - if (m_pInstance) - m_pInstance->SetData(TYPE_BJARNGRIM, NOT_STARTED); - } - - void EnterCombat(Unit* pWho) - { - DoScriptText(SAY_AGGRO, m_creature); - - //must get both lieutenants here and make sure they are with him - m_creature->CallForHelp(30.0f); - - if (m_pInstance) - m_pInstance->SetData(TYPE_BJARNGRIM, IN_PROGRESS); - } - - void KilledUnit(Unit* pVictim) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature); break; - case 1: DoScriptText(SAY_SLAY_2, m_creature); break; - case 2: DoScriptText(SAY_SLAY_3, m_creature); break; - } - } - - void JustDied(Unit* pKiller) - { - DoScriptText(SAY_DEATH, m_creature); - - if (m_pInstance) - m_pInstance->SetData(TYPE_BJARNGRIM, DONE); - } - - //TODO: remove when removal is done by mangos - void DoRemoveStanceAura(uint8 uiStance) - { - switch(uiStance) - { - case STANCE_DEFENSIVE: - m_creature->RemoveAurasDueToSpell(SPELL_DEFENSIVE_STANCE); - break; - case STANCE_BERSERKER: - m_creature->RemoveAurasDueToSpell(SPELL_BERSEKER_STANCE); - break; - case STANCE_BATTLE: - m_creature->RemoveAurasDueToSpell(SPELL_BATTLE_STANCE); - break; - } - } - - void UpdateAI(const uint32 uiDiff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - // Change stance - if (m_uiChangeStance_Timer < uiDiff) - { - //wait for current spell to finish before change stance - if (m_creature->IsNonMeleeSpellCasted(false)) - return; - - DoRemoveStanceAura(m_uiStance); - - int uiTempStance = rand()%(3-1); - - if (uiTempStance >= m_uiStance) - ++uiTempStance; - - m_uiStance = uiTempStance; - - switch(m_uiStance) - { - case STANCE_DEFENSIVE: - DoScriptText(SAY_DEFENSIVE_STANCE, m_creature); - DoScriptText(EMOTE_DEFENSIVE_STANCE, m_creature); - DoCast(m_creature, SPELL_DEFENSIVE_STANCE); - SetEquipmentSlots(false, EQUIP_SWORD, EQUIP_SHIELD, EQUIP_NO_CHANGE); - break; - case STANCE_BERSERKER: - DoScriptText(SAY_BERSEKER_STANCE, m_creature); - DoScriptText(EMOTE_BERSEKER_STANCE, m_creature); - DoCast(m_creature, SPELL_BERSEKER_STANCE); - SetEquipmentSlots(false, EQUIP_SWORD, EQUIP_SWORD, EQUIP_NO_CHANGE); - break; - case STANCE_BATTLE: - DoScriptText(SAY_BATTLE_STANCE, m_creature); - DoScriptText(EMOTE_BATTLE_STANCE, m_creature); - DoCast(m_creature, SPELL_BATTLE_STANCE); - SetEquipmentSlots(false, EQUIP_MACE, EQUIP_UNEQUIP, EQUIP_NO_CHANGE); - break; - } - - m_uiChangeStance_Timer = 20000 + rand()%5000; - return; - } - else - m_uiChangeStance_Timer -= uiDiff; - - switch(m_uiStance) - { - case STANCE_DEFENSIVE: - { - if (m_uiReflection_Timer < uiDiff) - { - DoCast(m_creature, SPELL_SPELL_REFLECTION); - m_uiReflection_Timer = 8000 + rand()%1000; - } - else - m_uiReflection_Timer -= uiDiff; - - if (m_uiKnockAway_Timer < uiDiff) - { - DoCast(m_creature, SPELL_KNOCK_AWAY); - m_uiKnockAway_Timer = 20000 + rand()%1000; - } - else - m_uiKnockAway_Timer -= uiDiff; - - if (m_uiPummel_Timer < uiDiff) - { - DoCast(m_creature->getVictim(), SPELL_PUMMEL); - m_uiPummel_Timer = 10000 + rand()%1000; - } - else - m_uiPummel_Timer -= uiDiff; - - if (m_uiIronform_Timer < uiDiff) - { - DoCast(m_creature, SPELL_IRONFORM); - m_uiIronform_Timer = 25000 + rand()%1000; - } - else - m_uiIronform_Timer -= uiDiff; - - break; - } - case STANCE_BERSERKER: - { - if (m_uiIntercept_Timer < uiDiff) - { - //not much point is this, better random target and more often? - DoCast(m_creature->getVictim(), SPELL_INTERCEPT); - m_uiIntercept_Timer = 45000 + rand()%1000; - } - else - m_uiIntercept_Timer -= uiDiff; - - if (m_uiWhirlwind_Timer < uiDiff) - { - DoCast(m_creature, SPELL_WHIRLWIND); - m_uiWhirlwind_Timer = 10000 + rand()%1000; - } - else - m_uiWhirlwind_Timer -= uiDiff; - - if (m_uiCleave_Timer < uiDiff) - { - DoCast(m_creature->getVictim(), SPELL_CLEAVE); - m_uiCleave_Timer = 8000 + rand()%1000; - } - else - m_uiCleave_Timer -= uiDiff; - - break; - } - case STANCE_BATTLE: - { - if (m_uiMortalStrike_Timer < uiDiff) - { - DoCast(m_creature->getVictim(), SPELL_MORTAL_STRIKE); - m_uiMortalStrike_Timer = 20000 + rand()%1000; - } - else - m_uiMortalStrike_Timer -= uiDiff; - - if (m_uiSlam_Timer < uiDiff) - { - DoCast(m_creature->getVictim(), SPELL_SLAM); - m_uiSlam_Timer = 15000 + rand()%1000; - } - else - m_uiSlam_Timer -= uiDiff; - - break; - } - } - - DoMeleeAttackIfReady(); - } -}; - -/*###### -## mob_stormforged_lieutenant -######*/ - -struct TRINITY_DLL_DECL mob_stormforged_lieutenantAI : public ScriptedAI -{ - mob_stormforged_lieutenantAI(Creature *pCreature) : ScriptedAI(pCreature) - { - m_pInstance = pCreature->GetInstanceData(); - m_bIsHeroic = pCreature->GetMap()->IsHeroic(); - } - - ScriptedInstance* m_pInstance; - bool m_bIsHeroic; - - uint32 m_uiArcWeld_Timer; - uint32 m_uiRenewSteel_Timer; - - void Reset() - { - m_uiArcWeld_Timer = 20000 + rand()%1000; - m_uiRenewSteel_Timer = 10000 + rand()%1000; - } - - void EnterCombat(Unit* pWho) - { - if (m_pInstance) - { - if (Creature* pBjarngrim = m_pInstance->instance->GetCreature(m_pInstance->GetData64(DATA_BJARNGRIM))) - { - if (pBjarngrim->isAlive() && !pBjarngrim->getVictim()) - pBjarngrim->AI()->AttackStart(pWho); - } - } - } - - void UpdateAI(const uint32 uiDiff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - if (m_uiArcWeld_Timer < uiDiff) - { - DoCast(m_creature->getVictim(), SPELL_ARC_WELD); - m_uiArcWeld_Timer = 20000 + rand()%1000; - } - else - m_uiArcWeld_Timer -= uiDiff; - - if (m_uiRenewSteel_Timer < uiDiff) - { - if (m_pInstance) - { - if (Creature* pBjarngrim = m_pInstance->instance->GetCreature(m_pInstance->GetData64(DATA_BJARNGRIM))) - { - if (pBjarngrim->isAlive()) - DoCast(pBjarngrim, m_bIsHeroic ? SPELL_RENEW_STEEL_H : SPELL_RENEW_STEEL_N); - } - } - m_uiRenewSteel_Timer = 10000 + rand()%4000; - } - else - m_uiRenewSteel_Timer -= uiDiff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_bjarngrim(Creature* pCreature) -{ - return new boss_bjarngrimAI(pCreature); -} - -CreatureAI* GetAI_mob_stormforged_lieutenant(Creature* pCreature) -{ - return new mob_stormforged_lieutenantAI(pCreature); -} - -void AddSC_boss_bjarngrim() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "boss_bjarngrim"; - newscript->GetAI = &GetAI_boss_bjarngrim; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_stormforged_lieutenant"; - newscript->GetAI = &GetAI_mob_stormforged_lieutenant; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/boss_ionar.cpp b/src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/boss_ionar.cpp deleted file mode 100644 index 227d23b154a..00000000000 --- a/src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/boss_ionar.cpp +++ /dev/null @@ -1,399 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss Ionar -SD%Complete: 80% -SDComment: Timer check -SDCategory: Halls of Lightning -EndScriptData */ - -#include "precompiled.h" -#include "def_halls_of_lightning.h" - -enum -{ - SAY_AGGRO = -1602011, - SAY_SLAY_1 = -1602012, - SAY_SLAY_2 = -1602013, - SAY_SLAY_3 = -1602014, - SAY_DEATH = -1602015, - SAY_SPLIT_1 = -1602016, - SAY_SPLIT_2 = -1602017, - - SPELL_BALL_LIGHTNING_N = 52780, - SPELL_BALL_LIGHTNING_H = 59800, - SPELL_STATIC_OVERLOAD_N = 52658, - SPELL_STATIC_OVERLOAD_H = 59795, - - SPELL_DISPERSE = 52770, - SPELL_SUMMON_SPARK = 52746, - SPELL_SPARK_DESPAWN = 52776, - - //Spark of Ionar - SPELL_SPARK_VISUAL_TRIGGER_N = 52667, - SPELL_SPARK_VISUAL_TRIGGER_H = 59833, - - NPC_SPARK_OF_IONAR = 28926, - - MAX_SPARKS = 5, - POINT_CALLBACK = 0 -}; - -/*###### -## Boss Ionar -######*/ - -struct TRINITY_DLL_DECL boss_ionarAI : public ScriptedAI -{ - boss_ionarAI(Creature *pCreature) : ScriptedAI(pCreature) - { - m_pInstance = pCreature->GetInstanceData(); - m_bIsHeroic = pCreature->GetMap()->IsHeroic(); - Reset(); - } - - ScriptedInstance* m_pInstance; - - std::list m_lSparkGUIDList; - - bool m_bIsHeroic; - - bool m_bIsSplitPhase; - uint32 m_uiSplit_Timer; - uint32 m_uiSparkAtHomeCount; - - uint32 m_uiStaticOverload_Timer; - uint32 m_uiBallLightning_Timer; - - uint32 m_uiHealthAmountModifier; - - void Reset() - { - m_lSparkGUIDList.clear(); - - m_bIsSplitPhase = true; - m_uiSplit_Timer = 25000; - m_uiSparkAtHomeCount = 0; - - m_uiStaticOverload_Timer = 5000 + rand()%1000; - m_uiBallLightning_Timer = 10000 + rand()%1000; - - m_uiHealthAmountModifier = 1; - - if (m_creature->GetVisibility() == VISIBILITY_OFF) - m_creature->SetVisibility(VISIBILITY_ON); - } - - void AttackedBy(Unit* pAttacker) - { - if (m_creature->getVictim()) - return; - - if (m_creature->GetVisibility() == VISIBILITY_OFF) - return; - - AttackStart(pAttacker); - } - - void Aggro(Unit* who) - { - DoScriptText(SAY_AGGRO, m_creature); - - if (m_pInstance) - m_pInstance->SetData(TYPE_IONAR, IN_PROGRESS); - } - - void JustReachedHome() - { - if (m_pInstance) - m_pInstance->SetData(TYPE_IONAR, NOT_STARTED); - } - - void AttackStart(Unit* pWho) - { - if (m_creature->Attack(pWho, true)) - { - m_creature->AddThreat(pWho, 0.0f); - m_creature->SetInCombatWith(pWho); - pWho->SetInCombatWith(m_creature); - - if (m_creature->GetVisibility() != VISIBILITY_OFF) - m_creature->GetMotionMaster()->MoveChase(pWho); - } - } - - void JustDied(Unit* killer) - { - DoScriptText(SAY_DEATH, m_creature); - DespawnSpark(); - - if (m_pInstance) - m_pInstance->SetData(TYPE_IONAR, DONE); - } - - void KilledUnit(Unit *victim) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature); break; - case 1: DoScriptText(SAY_SLAY_2, m_creature); break; - case 2: DoScriptText(SAY_SLAY_3, m_creature); break; - } - } - - void DespawnSpark() - { - if (m_lSparkGUIDList.empty()) - return; - - for(std::list::iterator itr = m_lSparkGUIDList.begin(); itr != m_lSparkGUIDList.end(); ++itr) - { - if (Creature* pTemp = Unit::GetCreature(*m_creature, *itr)) - { - if (pTemp->isAlive()) - pTemp->ForcedDespawn(); - } - } - - m_lSparkGUIDList.clear(); - } - - //make sparks come back - void CallBackSparks() - { - //should never be empty here, but check - if (m_lSparkGUIDList.empty()) - return; - - for(std::list::iterator itr = m_lSparkGUIDList.begin(); itr != m_lSparkGUIDList.end(); ++itr) - { - if (Creature* pSpark = Unit::GetCreature(*m_creature, *itr)) - { - if (pSpark->isAlive()) - { - if (pSpark->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE) - pSpark->GetMotionMaster()->MovementExpired(); - - pSpark->SetSpeed(MOVE_RUN, pSpark->GetCreatureInfo()->speed * 2); - pSpark->GetMotionMaster()->MovePoint(POINT_CALLBACK, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ()); - } - } - } - } - - void RegisterSparkAtHome() - { - ++m_uiSparkAtHomeCount; - } - - void JustSummoned(Creature* pSummoned) - { - if (pSummoned->GetEntry() == NPC_SPARK_OF_IONAR) - { - pSummoned->CastSpell(pSummoned, m_bIsHeroic ? SPELL_SPARK_VISUAL_TRIGGER_H : SPELL_SPARK_VISUAL_TRIGGER_N, true); - - Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); - - if (m_creature->getVictim()) - pSummoned->AI()->AttackStart(pTarget ? pTarget : m_creature->getVictim()); - - m_lSparkGUIDList.push_back(pSummoned->GetGUID()); - } - } - - void UpdateAI(const uint32 uiDiff) - { - // Splitted - if (m_creature->GetVisibility() == VISIBILITY_OFF) - { - if (!m_creature->getVictim()) - { - Reset(); - return; - } - - if (m_uiSplit_Timer < uiDiff) - { - m_uiSplit_Timer = 2500; - - // Return sparks to where Ionar splitted - if (m_bIsSplitPhase) - { - CallBackSparks(); - m_bIsSplitPhase = false; - } - // Lightning effect and restore Ionar - else if (m_uiSparkAtHomeCount == MAX_SPARKS) - { - m_creature->SetVisibility(VISIBILITY_ON); - m_creature->CastSpell(m_creature, SPELL_SPARK_DESPAWN, false); - - DespawnSpark(); - - m_uiSparkAtHomeCount = 0; - m_uiSplit_Timer = 25000; - m_bIsSplitPhase = true; - - if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() != TARGETED_MOTION_TYPE) - { - if (m_creature->getVictim()) - m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); - } - } - } - else - m_uiSplit_Timer -= uiDiff; - - return; - } - - //Return since we have no target - if (!UpdateVictim()) - return; - - if (m_uiStaticOverload_Timer < uiDiff) - { - if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) - DoCast(pTarget, m_bIsHeroic ? SPELL_STATIC_OVERLOAD_H : SPELL_STATIC_OVERLOAD_N); - - m_uiStaticOverload_Timer = 5000 + rand()%1000; - } - else - m_uiStaticOverload_Timer -= uiDiff; - - if (m_uiBallLightning_Timer < uiDiff) - { - DoCast(m_creature->getVictim(), m_bIsHeroic ? SPELL_BALL_LIGHTNING_H : SPELL_BALL_LIGHTNING_N); - m_uiBallLightning_Timer = 10000 + rand()%1000; - } - else - m_uiBallLightning_Timer -= uiDiff; - - // Health check - if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < (100-(20*m_uiHealthAmountModifier))) - { - ++m_uiHealthAmountModifier; - - switch(rand()%2) - { - case 0: DoScriptText(SAY_SPLIT_1, m_creature); break; - case 1: DoScriptText(SAY_SPLIT_2, m_creature); break; - } - - if (m_creature->IsNonMeleeSpellCasted(false)) - m_creature->InterruptNonMeleeSpells(false); - - DoCast(m_creature, SPELL_DISPERSE); - } - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_ionar(Creature* pCreature) -{ - return new boss_ionarAI(pCreature); -} - -bool EffectDummyCreature_boss_ionar(Unit* pCaster, uint32 uiSpellId, uint32 uiEffIndex, Creature* pCreatureTarget) -{ - //always check spellid and effectindex - if (uiSpellId == SPELL_DISPERSE && uiEffIndex == 0) - { - if (pCreatureTarget->GetEntry() != NPC_IONAR) - return true; - - for(uint8 i = 0; i < MAX_SPARKS; ++i) - { - pCreatureTarget->CastSpell(pCreatureTarget, SPELL_SUMMON_SPARK, true); - - //TODO: remove this line of hack when summon implemented - pCreatureTarget->SummonCreature(NPC_SPARK_OF_IONAR, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); - } - - pCreatureTarget->AttackStop(); - pCreatureTarget->SetVisibility(VISIBILITY_OFF); - - if (pCreatureTarget->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE) - pCreatureTarget->GetMotionMaster()->MovementExpired(); - - //always return true when we are handling this spell and effect - return true; - } - return false; -} - -/*###### -## mob_spark_of_ionar -######*/ - -struct TRINITY_DLL_DECL mob_spark_of_ionarAI : public ScriptedAI -{ - mob_spark_of_ionarAI(Creature *pCreature) : ScriptedAI(pCreature) - { - m_pInstance = pCreature->GetInstanceData(); - Reset(); - } - - ScriptedInstance* m_pInstance; - - void Reset() { } - - void MovementInform(uint32 uiType, uint32 uiPointId) - { - if (uiType != POINT_MOTION_TYPE || !m_pInstance) - return; - - if (uiPointId == POINT_CALLBACK) - { - if (Creature* pIonar = m_pInstance->instance->GetCreature(m_pInstance->GetData64(DATA_IONAR))) - { - if (!pIonar->isAlive()) - { - m_creature->ForcedDespawn(); - return; - } - - if (boss_ionarAI* pIonarAI = dynamic_cast(pIonar->AI())) - pIonarAI->RegisterSparkAtHome(); - } - else - m_creature->ForcedDespawn(); - } - } -}; - -CreatureAI* GetAI_mob_spark_of_ionar(Creature* pCreature) -{ - return new mob_spark_of_ionarAI(pCreature); -} - -void AddSC_boss_ionar() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "boss_ionar"; - newscript->GetAI = &GetAI_boss_ionar; - newscript->pEffectDummyCreature = &EffectDummyCreature_boss_ionar; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_spark_of_ionar"; - newscript->GetAI = &GetAI_mob_spark_of_ionar; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/boss_loken.cpp b/src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/boss_loken.cpp deleted file mode 100644 index 164b393b6d9..00000000000 --- a/src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/boss_loken.cpp +++ /dev/null @@ -1,253 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss Loken -SD%Complete: 60% -SDComment: Missing intro. Remove hack of Pulsing Shockwave when core supports. Aura is not working (59414) -SDCategory: Halls of Lightning -EndScriptData */ - -#include "precompiled.h" -#include "def_halls_of_lightning.h" - -enum -{ - ACHIEVEMENT_TIMELY_DEATH = 1867, - - SAY_AGGRO = -1602018, - SAY_INTRO_1 = -1602019, - SAY_INTRO_2 = -1602020, - SAY_SLAY_1 = -1602021, - SAY_SLAY_2 = -1602022, - SAY_SLAY_3 = -1602023, - SAY_DEATH = -1602024, - SAY_NOVA_1 = -1602025, - SAY_NOVA_2 = -1602026, - SAY_NOVA_3 = -1602027, - SAY_75HEALTH = -1602028, - SAY_50HEALTH = -1602029, - SAY_25HEALTH = -1602030, - EMOTE_NOVA = -1602031, - - SPELL_ARC_LIGHTNING = 52921, - SPELL_LIGHTNING_NOVA_N = 52960, - SPELL_LIGHTNING_NOVA_H = 59835, - - SPELL_PULSING_SHOCKWAVE_N = 52961, - SPELL_PULSING_SHOCKWAVE_H = 59836, - SPELL_PULSING_SHOCKWAVE_AURA = 59414 -}; - -/*###### -## Boss Loken -######*/ - -struct TRINITY_DLL_DECL boss_lokenAI : public ScriptedAI -{ - boss_lokenAI(Creature* pCreature) : ScriptedAI(pCreature) - { - m_pInstance = pCreature->GetInstanceData(); - m_bIsHeroic = pCreature->GetMap()->IsHeroic(); - } - - ScriptedInstance* m_pInstance; - - bool m_bIsHeroic; - bool m_bIsAura; - - uint32 m_uiArcLightning_Timer; - uint32 m_uiLightningNova_Timer; - uint32 m_uiPulsingShockwave_Timer; - uint32 m_uiResumePulsingShockwave_Timer; - - uint32 m_uiHealthAmountModifier; - - uint32 EncounterTimer; - - void Reset() - { - m_bIsAura = false; - - m_uiArcLightning_Timer = 15000; - m_uiLightningNova_Timer = 20000; - m_uiPulsingShockwave_Timer = 2000; - m_uiResumePulsingShockwave_Timer = 15000; - - m_uiHealthAmountModifier = 1; - - EncounterTimer = 0; - - if (m_pInstance) - m_pInstance->SetData(TYPE_LOKEN, NOT_STARTED); - } - - void EnterCombat(Unit* pWho) - { - DoScriptText(SAY_AGGRO, m_creature); - - EncounterTimer = 1; - - if (m_pInstance) - m_pInstance->SetData(TYPE_LOKEN, IN_PROGRESS); - } - - void JustDied(Unit* pKiller) - { - DoScriptText(SAY_DEATH, m_creature); - - if (m_bIsHeroic && EncounterTimer <= 120000) - { - AchievementEntry const *AchievTimelyDeath = GetAchievementStore()->LookupEntry(ACHIEVEMENT_TIMELY_DEATH); - if (AchievTimelyDeath) - { - Map* pMap = m_creature->GetMap(); - if (pMap && pMap->IsDungeon()) - { - Map::PlayerList const &players = pMap->GetPlayers(); - for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) - itr->getSource()->CompletedAchievement(AchievTimelyDeath); - } - } - } - - if (m_pInstance) - m_pInstance->SetData(TYPE_LOKEN, DONE); - } - - void KilledUnit(Unit* pVictim) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature);break; - case 1: DoScriptText(SAY_SLAY_2, m_creature);break; - case 2: DoScriptText(SAY_SLAY_3, m_creature);break; - } - } - - void UpdateAI(const uint32 uiDiff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - if (EncounterTimer) - EncounterTimer += uiDiff; - - if (m_bIsAura) - { - // workaround for PULSING_SHOCKWAVE - if (m_uiPulsingShockwave_Timer < uiDiff) - { - Map* pMap = m_creature->GetMap(); - if (pMap->IsDungeon()) - { - Map::PlayerList const &PlayerList = pMap->GetPlayers(); - - if (PlayerList.isEmpty()) - return; - - for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) - if (i->getSource()->isAlive() && i->getSource()->isTargetableForAttack()) - { - int32 dmg; - float m_fDist = m_creature->GetDistance(i->getSource()); - - if (m_fDist <= 1.0f) // Less than 1 yard - dmg = (m_bIsHeroic ? 850 : 800); // need to correct damage - else // Further from 1 yard - dmg = ((m_bIsHeroic ? 250 : 200) * m_fDist) + (m_bIsHeroic ? 850 : 800); // need to correct damage - - m_creature->CastCustomSpell(i->getSource(), (m_bIsHeroic ? 59837 : 52942), &dmg, 0, 0, false); - } - } - m_uiPulsingShockwave_Timer = 2000; - }else m_uiPulsingShockwave_Timer -= uiDiff; - } - else - { - if (m_uiResumePulsingShockwave_Timer < uiDiff) - { - //breaks at movement, can we assume when it's time, this spell is casted and also must stop movement? - m_creature->CastSpell(m_creature, SPELL_PULSING_SHOCKWAVE_AURA, true); - - DoCast(m_creature, m_bIsHeroic ? SPELL_PULSING_SHOCKWAVE_H : SPELL_PULSING_SHOCKWAVE_N); // need core support - m_bIsAura = true; - m_uiResumePulsingShockwave_Timer = 0; - } - else - m_uiResumePulsingShockwave_Timer -= uiDiff; - } - - if (m_uiArcLightning_Timer < uiDiff) - { - if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) - DoCast(pTarget, SPELL_ARC_LIGHTNING); - - m_uiArcLightning_Timer = 15000 + rand()%1000; - } - else - m_uiArcLightning_Timer -= uiDiff; - - if (m_uiLightningNova_Timer < uiDiff) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_NOVA_1, m_creature);break; - case 1: DoScriptText(SAY_NOVA_2, m_creature);break; - case 2: DoScriptText(SAY_NOVA_3, m_creature);break; - } - - DoCast(m_creature, m_bIsHeroic ? SPELL_LIGHTNING_NOVA_H : SPELL_LIGHTNING_NOVA_N); - - m_bIsAura = false; - m_uiResumePulsingShockwave_Timer = (m_bIsHeroic ? 4000 : 5000); // Pause Pulsing Shockwave aura - m_uiLightningNova_Timer = 20000 + rand()%1000; - } - else - m_uiLightningNova_Timer -= uiDiff; - - // Health check - if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < (100-(25*m_uiHealthAmountModifier))) - { - switch(m_uiHealthAmountModifier) - { - case 1: DoScriptText(SAY_75HEALTH, m_creature); break; - case 2: DoScriptText(SAY_50HEALTH, m_creature); break; - case 3: DoScriptText(SAY_25HEALTH, m_creature); break; - } - - ++m_uiHealthAmountModifier; - } - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_loken(Creature* pCreature) -{ - return new boss_lokenAI(pCreature); -} - -void AddSC_boss_loken() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "boss_loken"; - newscript->GetAI = &GetAI_boss_loken; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/boss_volkhan.cpp b/src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/boss_volkhan.cpp deleted file mode 100644 index 35eadb9783e..00000000000 --- a/src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/boss_volkhan.cpp +++ /dev/null @@ -1,494 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss Volkhan -SD%Complete: 60% -SDComment: Not considered complete. Some events may fail and need further development -SDCategory: Halls of Lightning -EndScriptData */ - -#include "precompiled.h" -#include "def_halls_of_lightning.h" - -enum -{ - SAY_AGGRO = -1602032, - SAY_SLAY_1 = -1602033, - SAY_SLAY_2 = -1602034, - SAY_SLAY_3 = -1602035, - SAY_DEATH = -1602036, - SAY_STOMP_1 = -1602037, - SAY_STOMP_2 = -1602038, - SAY_FORGE_1 = -1602039, - SAY_FORGE_2 = -1602040, - EMOTE_TO_ANVIL = -1602041, - EMOTE_SHATTER = -1602042, - - SPELL_HEAT_N = 52387, - SPELL_HEAT_H = 59528, - SPELL_SHATTERING_STOMP_N = 52237, - SPELL_SHATTERING_STOMP_H = 59529, - - //unclear how "directions" of spells must be. Last, summoning GO, what is it for? Script depend on: - SPELL_TEMPER = 52238, //TARGET_SCRIPT boss->anvil - SPELL_TEMPER_DUMMY = 52654, //TARGET_SCRIPT anvil->boss - - //SPELL_TEMPER_VISUAL = 52661, //summons GO - - SPELL_SUMMON_MOLTEN_GOLEM = 52405, - - //Molten Golem - SPELL_BLAST_WAVE = 23113, - SPELL_IMMOLATION_STRIKE_N = 52433, - SPELL_IMMOLATION_STRIKE_H = 59530, - SPELL_SHATTER_N = 52429, - SPELL_SHATTER_H = 59527, - - NPC_VOLKHAN_ANVIL = 28823, - NPC_MOLTEN_GOLEM = 28695, - NPC_BRITTLE_GOLEM = 28681, - - POINT_ID_ANVIL = 0, - MAX_GOLEM = 2 -}; - -/*###### -## Boss Volkhan -######*/ - -struct TRINITY_DLL_DECL boss_volkhanAI : public ScriptedAI -{ - boss_volkhanAI(Creature *pCreature) : ScriptedAI(pCreature) - { - m_pInstance = pCreature->GetInstanceData(); - m_bIsHeroic = pCreature->GetMap()->IsHeroic(); - Reset(); - } - - ScriptedInstance* m_pInstance; - - std::list m_lGolemGUIDList; - - bool m_bIsHeroic; - bool m_bHasTemper; - bool m_bIsStriking; - bool m_bCanShatterGolem; - - uint32 m_uiPause_Timer; - uint32 m_uiShatteringStomp_Timer; - uint32 m_uiShatter_Timer; - - uint32 m_uiHealthAmountModifier; - - void Reset() - { - m_bIsStriking = false; - m_bHasTemper = false; - m_bCanShatterGolem = false; - - m_uiPause_Timer = 3500; - m_uiShatteringStomp_Timer = 0; - m_uiShatter_Timer = 5000; - - m_uiHealthAmountModifier = 1; - - DespawnGolem(); - m_lGolemGUIDList.clear(); - - if (m_pInstance) - m_pInstance->SetData(TYPE_VOLKHAN, NOT_STARTED); - } - - void Aggro(Unit* pWho) - { - DoScriptText(SAY_AGGRO, m_creature); - - if (m_pInstance) - m_pInstance->SetData(TYPE_VOLKHAN, IN_PROGRESS); - } - - void AttackStart(Unit* pWho) - { - if (m_creature->Attack(pWho, true)) - { - m_creature->AddThreat(pWho, 0.0f); - m_creature->SetInCombatWith(pWho); - pWho->SetInCombatWith(m_creature); - - if (!m_bHasTemper) - m_creature->GetMotionMaster()->MoveChase(pWho); - } - } - - void JustDied(Unit* pKiller) - { - DoScriptText(SAY_DEATH, m_creature); - DespawnGolem(); - - if (m_pInstance) - m_pInstance->SetData(TYPE_VOLKHAN, DONE); - } - - void KilledUnit(Unit* pVictim) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature); break; - case 1: DoScriptText(SAY_SLAY_2, m_creature); break; - case 2: DoScriptText(SAY_SLAY_3, m_creature); break; - } - } - - void DespawnGolem() - { - if (m_lGolemGUIDList.empty()) - return; - - for(std::list::iterator itr = m_lGolemGUIDList.begin(); itr != m_lGolemGUIDList.end(); ++itr) - { - if (Creature* pTemp = Unit::GetCreature(*m_creature, *itr)) - { - if (pTemp->isAlive()) - pTemp->ForcedDespawn(); - } - } - - m_lGolemGUIDList.clear(); - } - - void ShatterGolem() - { - if (m_lGolemGUIDList.empty()) - return; - - for(std::list::iterator itr = m_lGolemGUIDList.begin(); itr != m_lGolemGUIDList.end(); ++itr) - { - if (Creature* pTemp = Unit::GetCreature(*m_creature, *itr)) - { - // only shatter brittle golems - if (pTemp->isAlive() && pTemp->GetEntry() == NPC_BRITTLE_GOLEM) - pTemp->CastSpell(pTemp, m_bIsHeroic ? SPELL_SHATTER_H : SPELL_SHATTER_N, false); - } - } - } - - void SpellHit(Unit* pCaster, const SpellEntry* pSpell) - { - if (pSpell->Id == SPELL_TEMPER_DUMMY) - m_bIsStriking = true; - } - - void JustSummoned(Creature* pSummoned) - { - if (pSummoned->GetEntry() == NPC_MOLTEN_GOLEM) - { - m_lGolemGUIDList.push_back(pSummoned->GetGUID()); - - if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) - pSummoned->AI()->AttackStart(pTarget); - - //why healing when just summoned? - pSummoned->CastSpell(pSummoned, m_bIsHeroic ? SPELL_HEAT_H : SPELL_HEAT_N, false, NULL, NULL, m_creature->GetGUID()); - } - } - - void UpdateAI(const uint32 uiDiff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - if (m_bIsStriking) - { - if (m_uiPause_Timer < uiDiff) - { - if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() != TARGETED_MOTION_TYPE) - { - if (m_creature->getVictim()) - m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); - } - - m_bHasTemper = false; - m_bIsStriking = false; - m_uiPause_Timer = 3500; - } - else - m_uiPause_Timer -= uiDiff; - - return; - } - - // When to start shatter? After 60, 40 or 20% hp? - if (!m_bHasTemper && m_uiHealthAmountModifier >= 3) - { - if (m_uiShatteringStomp_Timer < uiDiff) - { - //should he stomp even if he has no brittle golem to shatter? - - switch(rand()%2) - { - case 0: DoScriptText(SAY_STOMP_1, m_creature); break; - case 1: DoScriptText(SAY_STOMP_2, m_creature); break; - } - - DoCast(m_creature, m_bIsHeroic ? SPELL_SHATTERING_STOMP_H : SPELL_SHATTERING_STOMP_N); - - DoScriptText(EMOTE_SHATTER, m_creature); - - m_uiShatteringStomp_Timer = 30000; - m_bCanShatterGolem = true; - } - else - m_uiShatteringStomp_Timer -= uiDiff; - } - - // Shatter Golems 3 seconds after Shattering Stomp - if (m_bCanShatterGolem) - { - if (m_uiShatter_Timer < uiDiff) - { - ShatterGolem(); - m_uiShatter_Timer = 3000; - m_bCanShatterGolem = false; - } - else - m_uiShatter_Timer -= uiDiff; - } - - // Health check - if (!m_bCanShatterGolem && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < (100-(20*m_uiHealthAmountModifier))) - { - ++m_uiHealthAmountModifier; - - if (m_creature->IsNonMeleeSpellCasted(false)) - m_creature->InterruptNonMeleeSpells(false); - - switch(rand()%2) - { - case 0: DoScriptText(SAY_FORGE_1, m_creature); break; - case 1: DoScriptText(SAY_FORGE_2, m_creature); break; - } - - m_bHasTemper = true; - - m_creature->CastSpell(m_creature, SPELL_TEMPER, false); - } - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_volkhan(Creature* pCreature) -{ - return new boss_volkhanAI(pCreature); -} - -bool EffectDummyCreature_boss_volkhan(Unit* pCaster, uint32 uiSpellId, uint32 uiEffIndex, Creature* pCreatureTarget) -{ - //always check spellid and effectindex - if (uiSpellId == SPELL_TEMPER_DUMMY && uiEffIndex == 0) - { - if (pCaster->GetEntry() != NPC_VOLKHAN_ANVIL || pCreatureTarget->GetEntry() != NPC_VOLKHAN) - return true; - - for(uint8 i = 0; i < MAX_GOLEM; ++i) - { - pCreatureTarget->CastSpell(pCaster, SPELL_SUMMON_MOLTEN_GOLEM, true); - - //TODO: remove this line of hack when summon effect implemented - pCreatureTarget->SummonCreature(NPC_MOLTEN_GOLEM, - pCaster->GetPositionX(), pCaster->GetPositionY(), pCaster->GetPositionZ(), 0.0f, - TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000); - } - - //always return true when we are handling this spell and effect - return true; - } - - return false; -} - -/*###### -## npc_volkhan_anvil -######*/ - -bool EffectDummyCreature_npc_volkhan_anvil(Unit* pCaster, uint32 uiSpellId, uint32 uiEffIndex, Creature* pCreatureTarget) -{ - //always check spellid and effectindex - if (uiSpellId == SPELL_TEMPER && uiEffIndex == 0) - { - if (pCaster->GetEntry() != NPC_VOLKHAN || pCreatureTarget->GetEntry() != NPC_VOLKHAN_ANVIL) - return true; - - Creature *cre = CAST_CRE(pCaster); - - DoScriptText(EMOTE_TO_ANVIL, pCaster); - - float fX, fY, fZ; - pCreatureTarget->GetContactPoint(pCaster, fX, fY, fZ, INTERACTION_DISTANCE); - - pCaster->AttackStop(); - - if (pCaster->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE) - pCaster->GetMotionMaster()->MovementExpired(); - - cre->GetMap()->CreatureRelocation(cre, fX, fY, fZ, pCreatureTarget->GetOrientation()); - cre->SendMonsterMove(fX, fY, fZ, 0, cre->GetUnitMovementFlags(), 1); - - pCreatureTarget->CastSpell(pCaster, SPELL_TEMPER_DUMMY, false); - - //always return true when we are handling this spell and effect - return true; - } - - return false; -} - -/*###### -## mob_molten_golem -######*/ - -struct TRINITY_DLL_DECL mob_molten_golemAI : public ScriptedAI -{ - mob_molten_golemAI(Creature *pCreature) : ScriptedAI(pCreature) - { - m_pInstance = pCreature->GetInstanceData(); - m_bIsHeroic = pCreature->GetMap()->IsHeroic(); - Reset(); - } - - ScriptedInstance* m_pInstance; - - bool m_bIsHeroic; - bool m_bIsFrozen; - - uint32 m_uiBlast_Timer; - uint32 m_uiDeathDelay_Timer; - uint32 m_uiImmolation_Timer; - - void Reset() - { - m_bIsFrozen = false; - - m_uiBlast_Timer = 20000; - m_uiDeathDelay_Timer = 0; - m_uiImmolation_Timer = 5000; - } - - void AttackStart(Unit* pWho) - { - if (m_creature->Attack(pWho, true)) - { - m_creature->AddThreat(pWho, 0.0f); - m_creature->SetInCombatWith(pWho); - pWho->SetInCombatWith(m_creature); - - if (!m_bIsFrozen) - m_creature->GetMotionMaster()->MoveChase(pWho); - } - } - - void DamageTaken(Unit* pDoneBy, uint32 &uiDamage) - { - if (m_bIsFrozen) - { - //workaround for now, brittled should be immune to any kind of attacks - uiDamage = 0; - return; - } - - if (uiDamage > m_creature->GetHealth()) - { - m_bIsFrozen = true; - - if (m_creature->IsNonMeleeSpellCasted(false)) - m_creature->InterruptNonMeleeSpells(false); - - m_creature->RemoveAllAuras(); - m_creature->AttackStop(); - - if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE) - m_creature->GetMotionMaster()->MovementExpired(); - - uiDamage = m_creature->GetHealth()-1; - - m_creature->UpdateEntry(NPC_BRITTLE_GOLEM); - m_creature->SetHealth(1); - } - } - - void SpellHit(Unit* pCaster, const SpellEntry* pSpell) - { - //this is the dummy effect of the spells - if (pSpell->Id == SPELL_SHATTER_N || pSpell->Id == SPELL_SHATTER_H) - { - if (m_creature->GetEntry() == NPC_BRITTLE_GOLEM) - m_creature->ForcedDespawn(); - } - } - - void UpdateAI(const uint32 uiDiff) - { - //Return since we have no target or if we are frozen - if (!UpdateVictim() || m_bIsFrozen) - return; - - if (m_uiBlast_Timer < uiDiff) - { - DoCast(m_creature, SPELL_BLAST_WAVE); - m_uiBlast_Timer = 20000; - } - else - m_uiBlast_Timer -= uiDiff; - - if (m_uiImmolation_Timer < uiDiff) - { - DoCast(m_creature->getVictim(), m_bIsHeroic ? SPELL_IMMOLATION_STRIKE_H : SPELL_IMMOLATION_STRIKE_N); - m_uiImmolation_Timer = 5000; - } - else - m_uiImmolation_Timer -= uiDiff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_molten_golem(Creature* pCreature) -{ - return new mob_molten_golemAI(pCreature); -} - -void AddSC_boss_volkhan() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "boss_volkhan"; - newscript->GetAI = &GetAI_boss_volkhan; - newscript->pEffectDummyCreature = &EffectDummyCreature_boss_volkhan; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "npc_volkhan_anvil"; - newscript->pEffectDummyCreature = &EffectDummyCreature_npc_volkhan_anvil; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_molten_golem"; - newscript->GetAI = &GetAI_mob_molten_golem; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/def_halls_of_lightning.h b/src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/def_halls_of_lightning.h deleted file mode 100644 index 8790274e599..00000000000 --- a/src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/def_halls_of_lightning.h +++ /dev/null @@ -1,34 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ - -#ifndef DEF_HALLS_OF_LIGHTNING_H -#define DEF_HALLS_OF_LIGHTNING_H - -enum -{ - MAX_ENCOUNTER = 4, - - DATA_BJARNGRIM = 1, - DATA_IONAR = 2, - DATA_LOKEN = 3, - DATA_VOLKHAN = 4, - - TYPE_BJARNGRIM = 10, - TYPE_IONAR = 11, - TYPE_LOKEN = 12, - TYPE_VOLKHAN = 13, - - NPC_BJARNGRIM = 28586, - NPC_VOLKHAN = 28587, - NPC_IONAR = 28546, - NPC_LOKEN = 28923, - - GO_BJARNGRIM_DOOR = 191416, //_doors10 - GO_VOLKHAN_DOOR = 191325, //_doors07 - GO_IONAR_DOOR = 191326, //_doors05 - GO_LOKEN_DOOR = 191324, //_doors02 - GO_LOKEN_THRONE = 192654 -}; - -#endif diff --git a/src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/instance_halls_of_lightning.cpp b/src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/instance_halls_of_lightning.cpp deleted file mode 100644 index e9d75fb8b6f..00000000000 --- a/src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/instance_halls_of_lightning.cpp +++ /dev/null @@ -1,194 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Instance_Halls_of_Lightning -SD%Complete: 90% -SDComment: All ready. -SDCategory: Halls of Lightning -EndScriptData */ - -#include "precompiled.h" -#include "def_halls_of_lightning.h" - -/* Halls of Lightning encounters: -0 - General Bjarngrim -1 - Volkhan -2 - Ionar -3 - Loken -*/ - -struct TRINITY_DLL_DECL instance_halls_of_lightning : public ScriptedInstance -{ - instance_halls_of_lightning(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; - - uint32 m_auiEncounter[MAX_ENCOUNTER]; - - uint64 m_uiGeneralBjarngrimGUID; - uint64 m_uiIonarGUID; - uint64 m_uiLokenGUID; - uint64 m_uiVolkhanGUID; - - uint64 m_uiBjarngrimDoorGUID; - uint64 m_uiVolkhanDoorGUID; - uint64 m_uiIonarDoorGUID; - uint64 m_uiLokenDoorGUID; - uint64 m_uiLokenGlobeGUID; - - void Initialize() - { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - - m_uiGeneralBjarngrimGUID = 0; - m_uiVolkhanGUID = 0; - m_uiIonarGUID = 0; - m_uiLokenGUID = 0; - - m_uiBjarngrimDoorGUID = 0; - m_uiVolkhanDoorGUID = 0; - m_uiIonarDoorGUID = 0; - m_uiLokenDoorGUID = 0; - m_uiLokenGlobeGUID = 0; - } - - void OnCreatureCreate(Creature* pCreature, bool add) - { - switch(pCreature->GetEntry()) - { - case NPC_BJARNGRIM: - m_uiGeneralBjarngrimGUID = pCreature->GetGUID(); - break; - case NPC_VOLKHAN: - m_uiVolkhanGUID = pCreature->GetGUID(); - break; - case NPC_IONAR: - m_uiIonarGUID = pCreature->GetGUID(); - break; - case NPC_LOKEN: - m_uiLokenGUID = pCreature->GetGUID(); - break; - } - } - - void OnGameObjectCreate(GameObject* pGo, bool add) - { - switch(pGo->GetEntry()) - { - case GO_BJARNGRIM_DOOR: - m_uiBjarngrimDoorGUID = pGo->GetGUID(); - if (m_auiEncounter[0] == DONE) - pGo->SetGoState(GO_STATE_ACTIVE); - break; - case GO_VOLKHAN_DOOR: - m_uiVolkhanDoorGUID = pGo->GetGUID(); - if (m_auiEncounter[1] == DONE) - pGo->SetGoState(GO_STATE_ACTIVE); - break; - case GO_IONAR_DOOR: - m_uiIonarDoorGUID = pGo->GetGUID(); - if (m_auiEncounter[2] == DONE) - pGo->SetGoState(GO_STATE_ACTIVE); - break; - case GO_LOKEN_DOOR: - m_uiLokenDoorGUID = pGo->GetGUID(); - if (m_auiEncounter[3] == DONE) - pGo->SetGoState(GO_STATE_ACTIVE); - break; - case GO_LOKEN_THRONE: - m_uiLokenGlobeGUID = pGo->GetGUID(); - break; - } - } - - void SetData(uint32 uiType, uint32 uiData) - { - switch(uiType) - { - case TYPE_BJARNGRIM: - if (uiData == DONE) - DoUseDoorOrButton(m_uiBjarngrimDoorGUID); - m_auiEncounter[0] = uiData; - break; - case TYPE_VOLKHAN: - if (uiData == DONE) - DoUseDoorOrButton(m_uiVolkhanDoorGUID); - m_auiEncounter[1] = uiData; - break; - case TYPE_IONAR: - if (uiData == DONE) - DoUseDoorOrButton(m_uiIonarDoorGUID); - m_auiEncounter[2] = uiData; - break; - case TYPE_LOKEN: - if (uiData == DONE) - { - DoUseDoorOrButton(m_uiLokenDoorGUID); - - //Appears to be type 5 GO with animation. Need to figure out how this work, code below only placeholder - if (GameObject* pGlobe = instance->GetGameObject(m_uiLokenGlobeGUID)) - pGlobe->SetGoState(GO_STATE_ACTIVE); - } - m_auiEncounter[3] = uiData; - break; - } - } - - uint32 GetData(uint32 uiType) - { - switch(uiType) - { - case TYPE_BJARNGRIM: - return m_auiEncounter[0]; - case TYPE_VOLKHAN: - return m_auiEncounter[1]; - case TYPE_IONAR: - return m_auiEncounter[2]; - case TYPE_LOKEN: - return m_auiEncounter[3]; - } - return 0; - } - - uint64 GetData64(uint32 uiData) - { - switch(uiData) - { - case DATA_BJARNGRIM: - return m_uiGeneralBjarngrimGUID; - case DATA_VOLKHAN: - return m_uiVolkhanGUID; - case DATA_IONAR: - return m_uiIonarGUID; - case DATA_LOKEN: - return m_uiLokenGUID; - } - return 0; - } -}; - -InstanceData* GetInstanceData_instance_halls_of_lightning(Map* pMap) -{ - return new instance_halls_of_lightning(pMap); -} - -void AddSC_instance_halls_of_lightning() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_halls_of_lightning"; - newscript->GetInstanceData = &GetInstanceData_instance_halls_of_lightning; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/ulduar/halls_of_stone/boss_krystallus.cpp b/src/bindings/scripts/scripts/zone/ulduar/halls_of_stone/boss_krystallus.cpp deleted file mode 100644 index e7ec03124de..00000000000 --- a/src/bindings/scripts/scripts/zone/ulduar/halls_of_stone/boss_krystallus.cpp +++ /dev/null @@ -1,73 +0,0 @@ -/* Script Data Start -SDName: Boss krystallus -SDAuthor: LordVanMartin -SD%Complete: -SDComment: -SDCategory: -Script Data End */ - -/*** SQL START *** -update creature_template set scriptname = 'boss_krystallus' where entry = ''; -*** SQL END ***/ -#include "precompiled.h" - -//Spells -#define SPELL_BOULDER_TOSS 50843 -#define SPELL_BOULDER_TOSS_2 59742 -#define SPELL_GROUND_SPIKE 59750 -#define SPELL_SHATTER 50810 -#define SPELL_SHATTER_2 61546 -#define SPELL_STOMP 48131 -#define SPELL_STOMP_2 59744 - -//Yell -#define SAY_AGGRO -1599000 -#define SAY_KILL -1599001 -#define SAY_DEATH -1599002 -#define SAY_SHATTER -1599003 - -struct TRINITY_DLL_DECL boss_krystallusAI : public ScriptedAI -{ - boss_krystallusAI(Creature *c) : ScriptedAI(c) {} - - void Reset() {} - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - void JustDied(Unit* killer) - { - DoScriptText(SAY_DEATH, m_creature); - } - void KilledUnit(Unit *victim) - { - if (victim == m_creature) - return; - DoScriptText(SAY_KILL, m_creature); - } -}; - -CreatureAI* GetAI_boss_krystallus(Creature* pCreature) -{ - return new boss_krystallusAI (pCreature); -} - -void AddSC_boss_krystallus() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_krystallus"; - newscript->GetAI = &GetAI_boss_krystallus; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/ulduar/halls_of_stone/boss_maiden_of_grief.cpp b/src/bindings/scripts/scripts/zone/ulduar/halls_of_stone/boss_maiden_of_grief.cpp deleted file mode 100644 index 51e8f26f6a9..00000000000 --- a/src/bindings/scripts/scripts/zone/ulduar/halls_of_stone/boss_maiden_of_grief.cpp +++ /dev/null @@ -1,81 +0,0 @@ -/* Script Data Start -SDName: Boss maiden_of_grief -SDAuthor: LordVanMartin -SD%Complete: -SDComment: -SDCategory: -Script Data End */ - -/*** SQL START *** -update creature_template set scriptname = 'boss_maiden_of_grief' where entry = ''; -*** SQL END ***/ -#include "precompiled.h" - -//Spell -#define SPELL_PARTING_SORROW 59723 -#define SPELL_STORM_OF_GRIEF 50752 -#define SPELL_STORM_OF_GRIEF_2 59772 -#define SPELL_SHOCK_OF_SORROW 50760 -#define SPELL_SHOCK_OF_SORROW_2 59726 -#define SPELL_PILLAR_OF_WOE 50761 -#define SPELL_PILLAR_OF_WOE_2 59727 - -//Yell -#define SAY_AGGRO -1599004 -#define SAY_SLAY_1 -1599005 -#define SAY_SLAY_2 -1599006 -#define SAY_SLAY_3 -1599007 -#define SAY_SLAY_4 -1599008 -#define SAY_DEATH -1599009 -#define SAY_STUN -1599010 - -struct TRINITY_DLL_DECL boss_maiden_of_griefAI : public ScriptedAI -{ - boss_maiden_of_griefAI(Creature *c) : ScriptedAI(c) {} - - void Reset() {} - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - void JustDied(Unit* killer) - { - DoScriptText(SAY_DEATH, m_creature); - } - void KilledUnit(Unit *victim) - { - if (victim == m_creature) - return; - switch(rand()%3) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature);break; - case 1: DoScriptText(SAY_SLAY_2, m_creature);break; - case 2: DoScriptText(SAY_SLAY_3, m_creature);break; - } - } -}; - -CreatureAI* GetAI_boss_maiden_of_grief(Creature* pCreature) -{ - return new boss_maiden_of_griefAI (pCreature); -} - -void AddSC_boss_maiden_of_grief() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_maiden_of_grief"; - newscript->GetAI = &GetAI_boss_maiden_of_grief; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/ulduar/halls_of_stone/boss_sjonnir.cpp b/src/bindings/scripts/scripts/zone/ulduar/halls_of_stone/boss_sjonnir.cpp deleted file mode 100644 index d0b0889ea63..00000000000 --- a/src/bindings/scripts/scripts/zone/ulduar/halls_of_stone/boss_sjonnir.cpp +++ /dev/null @@ -1,83 +0,0 @@ -/* Script Data Start -SDName: Boss sjonnir -SDAuthor: LordVanMartin -SD%Complete: -SDComment: -SDCategory: -Script Data End */ - -/*** SQL START *** -update creature_template set scriptname = 'boss_sjonnir' where entry = ''; -*** SQL END ***/ -#include "precompiled.h" - -//Spells -#define SPELL_LIGHTING_RING_1 50840 //Periodic Trigger (interval 2s) spell = 50841 -#define SPELL_LIGHTING_RING_2 51849 //Periodic Trigger (interval 2s) spell = 50841 -#define SPELL_LIGHTING_RING_2 59848 //Periodic Trigger (interval 2s) spell = 59849 -#define SPELL_LIGHTING_RING_3 59861 //Periodic Trigger (interval 2s) spell = 59849 -#define SPELL_STATIC_CHARGE_1 50834 //Periodic Trigger 2s interval, spell =50835 -#define SPELL_STATIC_CHARGE_2 59846 //Periodic Trigger 2s interval, spell =50847 -#define SPELL_CHAIN_LIGHTING_1 50830 -#define SPELL_CHAIN_LIGHTING_2 59844 -#define SPELL_LIGHTING_SHIELD_1 50831 -#define SPELL_LIGHTING_SHIELD_2 59845 -#define SPELL_FRENZY 28747 - -//Yell -#define SAY_AGGRO -1599011 -#define SAY_SLAY_1 -1599012 -#define SAY_SLAY_2 -1599013 -#define SAY_SLAY_3 -1599014 -#define SAY_DEATH -1599015 - -struct TRINITY_DLL_DECL boss_sjonnirAI : public ScriptedAI -{ - boss_sjonnirAI(Creature *c) : ScriptedAI(c) {} - - void Reset() {} - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - void JustDied(Unit* killer) - { - DoScriptText(SAY_DEATH, m_creature); - } - void KilledUnit(Unit *victim) - { - if (victim == m_creature) - return; - switch(rand()%3) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature);break; - case 1: DoScriptText(SAY_SLAY_2, m_creature);break; - case 2: DoScriptText(SAY_SLAY_3, m_creature);break; - } - } -}; - -CreatureAI* GetAI_boss_sjonnir(Creature* pCreature) -{ - return new boss_sjonnirAI (pCreature); -} - -void AddSC_boss_sjonnir() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_sjonnir"; - newscript->GetAI = &GetAI_boss_sjonnir; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/ulduar/halls_of_stone/def_halls_of_stone.h b/src/bindings/scripts/scripts/zone/ulduar/halls_of_stone/def_halls_of_stone.h deleted file mode 100644 index ade934ad921..00000000000 --- a/src/bindings/scripts/scripts/zone/ulduar/halls_of_stone/def_halls_of_stone.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef DEF_HALLS_OF_STONE_H -#define DEF_HALLS_OF_STONE_H - -#endif diff --git a/src/bindings/scripts/scripts/zone/ulduar/halls_of_stone/instance_halls_of_stone.cpp b/src/bindings/scripts/scripts/zone/ulduar/halls_of_stone/instance_halls_of_stone.cpp deleted file mode 100644 index fa2dd83637f..00000000000 --- a/src/bindings/scripts/scripts/zone/ulduar/halls_of_stone/instance_halls_of_stone.cpp +++ /dev/null @@ -1,21 +0,0 @@ -#include "precompiled.h" -#include "def_halls_of_stone.h" - -struct TRINITY_DLL_DECL instance_halls_of_stone : public ScriptedInstance -{ - instance_halls_of_stone(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; -}; - -InstanceData* GetInstanceData_instance_halls_of_stone(Map* pMap) -{ - return new instance_halls_of_stone(pMap); -} - -void AddSC_instance_halls_of_stone() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_halls_of_stone"; - newscript->GetInstanceData = &GetInstanceData_instance_halls_of_stone; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_algalon.cpp b/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_algalon.cpp deleted file mode 100644 index a736b2db12a..00000000000 --- a/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_algalon.cpp +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (C) 2008 - 2009 Trinity - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include "precompiled.h" -#include "def_ulduar.h" diff --git a/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_assembly_of_iron.cpp b/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_assembly_of_iron.cpp deleted file mode 100644 index a736b2db12a..00000000000 --- a/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_assembly_of_iron.cpp +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (C) 2008 - 2009 Trinity - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include "precompiled.h" -#include "def_ulduar.h" diff --git a/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_auriaya.cpp b/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_auriaya.cpp deleted file mode 100644 index 685e2b506c0..00000000000 --- a/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_auriaya.cpp +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2008 - 2009 Trinity - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include "precompiled.h" -#include "def_ulduar.h" - -//boss_auriaya -#define SPELL_TERRIFYING_SCREECH 64386 -#define SPELL_SONIC_BOOM 38897 -#define SAY_AGGRO -2615016 -#define SAY_SLAY_1 -2615017 - -struct TRINITY_DLL_DECL boss_auriaya_AI : public ScriptedAI -{ - boss_auriaya_AI(Creature *c) : ScriptedAI(c) {} - - uint32 TERRIFYING_SCREECH_Timer; - uint32 SONIC_BOOM_Timer; - - void Reset() - { - TERRIFYING_SCREECH_Timer = 0; - SONIC_BOOM_Timer = 2000; - } - - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO,m_creature); - } - void KilledUnit(Unit* victim) - { - DoScriptText(SAY_SLAY_1, m_creature); - } - - void JustDied(Unit *victim) - { - DoScriptText(SAY_SLAY_1, m_creature); - } - - void MoveInLineOfSight(Unit* who) {} - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (TERRIFYING_SCREECH_Timer < diff) - { - DoCast(m_creature,SPELL_TERRIFYING_SCREECH); - DoScriptText(SAY_SLAY_1, m_creature); - TERRIFYING_SCREECH_Timer = 360000; - } else TERRIFYING_SCREECH_Timer -= diff; - - if (SONIC_BOOM_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_SONIC_BOOM); - SONIC_BOOM_Timer = 20000; - } else SONIC_BOOM_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_auriaya(Creature* pCreature) -{ - return new boss_auriaya_AI (pCreature); -} -void AddSC_boss_auriaya() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "boss_auriaya"; - newscript->GetAI = &GetAI_boss_auriaya; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_flame_leviathan.cpp b/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_flame_leviathan.cpp deleted file mode 100644 index 20ad85351a9..00000000000 --- a/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_flame_leviathan.cpp +++ /dev/null @@ -1,306 +0,0 @@ -/* - * Copyright (C) 2008 - 2009 Trinity - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include "precompiled.h" -#include "def_ulduar.h" -#include "Vehicle.h" - -#define SPELL_PURSUED 62374 -#define SPELL_GATHERING_SPEED 62375 -#define SPELL_BATTERING_RAM 62376 -#define SPELL_FLAME_VENTS 62396 -#define SPELL_MISSILE_BARRAGE 62400 -#define SPELL_SYSTEMS_SHUTDOWN 62475 - -#define SPELL_CANNON 62397 - -#define SPELL_OVERLOAD_CIRCUIT 62399 - -#define SPELL_SEARING_FLAME 62402 - -enum Events -{ - EVENT_PURSUE = 1, - EVENT_MISSILE, - EVENT_VENT, -}; - -struct TRINITY_DLL_DECL boss_flame_leviathanAI : public BossAI -{ - boss_flame_leviathanAI(Creature *c) : BossAI(c, BOSS_LEVIATHAN) - { - assert(c->isVehicle()); - } - - void MoveInLineOfSight(Unit* who) {} - - void EnterCombat(Unit *who) - { - _EnterCombat(); - events.ScheduleEvent(EVENT_PURSUE, 0); - events.ScheduleEvent(EVENT_MISSILE, 1500); - events.ScheduleEvent(EVENT_VENT, 20000); - if (Creature *turret = CAST_CRE(CAST_VEH(me)->GetPassenger(7))) - turret->AI()->DoZoneInCombat(); - } - - // TODO: effect 0 and effect 1 may be on different target - void SpellHitTarget(Unit *target, const SpellEntry *spell) - { - if (spell->Id == SPELL_PURSUED) - AttackStart(target); - } - - void UpdateAI(const uint32 diff) - { - if (!me->isInCombat()) - return; - - if (me->getThreatManager().isThreatListEmpty()) - { - EnterEvadeMode(); - return; - } - - events.Update(diff); - - if (me->hasUnitState(UNIT_STAT_CASTING)) - return; - - uint32 eventId = events.GetEvent(); - if (!me->getVictim()) - eventId = EVENT_PURSUE; - - switch(eventId) - { - case 0: - return; - case EVENT_PURSUE: - DoCastAOE(SPELL_PURSUED); - events.RepeatEvent(35000); - return; - case EVENT_MISSILE: - //TODO: without unittarget no visual effect - //DoCastAOE(SPELL_MISSILE_BARRAGE); - DoCast(me->getVictim(), SPELL_MISSILE_BARRAGE); - events.RepeatEvent(1500); - return; - case EVENT_VENT: - DoCastAOE(SPELL_FLAME_VENTS); - events.RepeatEvent(20000); - return; - default: - events.PopEvent(); - break; - } - - DoSpellAttackIfReady(SPELL_BATTERING_RAM); - } -}; - - -struct TRINITY_DLL_DECL boss_flame_leviathan_turretAI : public ScriptedAI -{ - boss_flame_leviathan_turretAI(Creature *c) : ScriptedAI(c) - { - me->SetReactState(REACT_PASSIVE); - } - - void Reset() - { - events.Reset(); - } - - EventMap events; - - void EnterCombat(Unit *who) - { - events.ScheduleEvent(1, 5000); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateCombatState()) - return; - - events.Update(diff); - - if (me->hasUnitState(UNIT_STAT_CASTING)) - return; - - if (uint32 eventId = events.GetEvent()) - { - switch(eventId) - { - case 1: - DoCast(SelectTarget(SELECT_TARGET_RANDOM), SPELL_CANNON); - events.RepeatEvent(10000); - return; - default: - events.PopEvent(); - break; - } - } - } -}; - - -struct TRINITY_DLL_DECL boss_flame_leviathan_seatAI : public ScriptedAI -{ - boss_flame_leviathan_seatAI(Creature *c) : ScriptedAI(c) - { - assert(c->isVehicle()); - if (const CreatureInfo *cInfo = me->GetCreatureInfo()) - me->SetDisplayId(cInfo->DisplayID_A[0]); // 0 invisible, 1 visible - } - - void Reset() - { - me->SetReactState(REACT_AGGRESSIVE); - } - - void MoveInLineOfSight(Unit *who) // for test - { - if (who->GetTypeId() == TYPEID_PLAYER && !who->m_Vehicle - && !CAST_VEH(me)->GetPassenger(0) && CAST_VEH(me)->GetPassenger(2)) - who->EnterVehicle(CAST_VEH(me), 0); - } - - void UpdateAI(const uint32 diff) - { - if (!CAST_VEH(me)->GetPassenger(2)) - if (Unit *who = CAST_VEH(me)->GetPassenger(0)) - who->ExitVehicle(); - } -}; - -struct TRINITY_DLL_DECL boss_flame_leviathan_defense_turretAI : public ScriptedAI -{ - boss_flame_leviathan_defense_turretAI(Creature *c) : ScriptedAI(c) - { - } - - void Reset() - { - } - - void DamageTaken(Unit *who, uint32 &damage) - { - if (!who->m_Vehicle || who->m_Vehicle->GetEntry() != 33114) - damage = 0; - } - - void MoveInLineOfSight(Unit *who) - { - if (me->getVictim()) - return; - - if (who->GetTypeId() != TYPEID_PLAYER || !who->m_Vehicle || who->m_Vehicle->GetEntry() != 33114) - return; - - AttackStart(who); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (me->hasUnitState(UNIT_STAT_CASTING)) - return; - - DoCast(me->getVictim(), SPELL_SEARING_FLAME); - } -}; - -struct TRINITY_DLL_DECL boss_flame_leviathan_overload_deviceAI : public ScriptedAI -{ - boss_flame_leviathan_overload_deviceAI(Creature *c) : ScriptedAI(c) - { - if (const CreatureInfo *cInfo = me->GetCreatureInfo()) - me->SetDisplayId(cInfo->DisplayID_H[0]); // A0 gm, H0 device - } - - void Reset() - { - } - - void DamageTaken(Unit *who, uint32 &damage) - { - if (damage >= me->GetHealth()) - { - damage = 0; - if (!me->hasUnitState(UNIT_STAT_CASTING)) - DoCastAOE(SPELL_OVERLOAD_CIRCUIT); - } - } -}; - -CreatureAI* GetAI_boss_flame_leviathan(Creature* pCreature) -{ - return new boss_flame_leviathanAI (pCreature); -} - -CreatureAI* GetAI_boss_flame_leviathan_turret(Creature* pCreature) -{ - return new boss_flame_leviathan_turretAI (pCreature); -} - -CreatureAI* GetAI_boss_flame_leviathan_seat(Creature* pCreature) -{ - return new boss_flame_leviathan_seatAI (pCreature); -} - -CreatureAI* GetAI_boss_flame_leviathan_defense_turret(Creature* pCreature) -{ - return new boss_flame_leviathan_defense_turretAI (pCreature); -} - -CreatureAI* GetAI_boss_flame_leviathan_overload_device(Creature* pCreature) -{ - return new boss_flame_leviathan_overload_deviceAI (pCreature); -} - -void AddSC_boss_flame_leviathan() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_flame_leviathan"; - newscript->GetAI = &GetAI_boss_flame_leviathan; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="boss_flame_leviathan_turret"; - newscript->GetAI = &GetAI_boss_flame_leviathan_turret; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="boss_flame_leviathan_seat"; - newscript->GetAI = &GetAI_boss_flame_leviathan_seat; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="boss_flame_leviathan_defense_turret"; - newscript->GetAI = &GetAI_boss_flame_leviathan_defense_turret; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="boss_flame_leviathan_overload_device"; - newscript->GetAI = &GetAI_boss_flame_leviathan_overload_device; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_freya.cpp b/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_freya.cpp deleted file mode 100644 index a736b2db12a..00000000000 --- a/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_freya.cpp +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (C) 2008 - 2009 Trinity - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include "precompiled.h" -#include "def_ulduar.h" diff --git a/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_general_vezax.cpp b/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_general_vezax.cpp deleted file mode 100644 index a736b2db12a..00000000000 --- a/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_general_vezax.cpp +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (C) 2008 - 2009 Trinity - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include "precompiled.h" -#include "def_ulduar.h" diff --git a/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_hodir.cpp b/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_hodir.cpp deleted file mode 100644 index a736b2db12a..00000000000 --- a/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_hodir.cpp +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (C) 2008 - 2009 Trinity - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include "precompiled.h" -#include "def_ulduar.h" diff --git a/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_ignis.cpp b/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_ignis.cpp deleted file mode 100644 index 56405eb13e1..00000000000 --- a/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_ignis.cpp +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright (C) 2008 - 2009 Trinity - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include "precompiled.h" -#include "def_ulduar.h" - -#define SPELL_FLAME_JETS 62680 -#define SPELL_SCORCH 62546 -#define SPELL_SLAG_POT 62717 - -#define SAY_AGGRO -10000002 -#define SAY_SLAY -1000003 - -struct TRINITY_DLL_DECL boss_ignis_AI : public ScriptedAI -{ - boss_ignis_AI(Creature *c) : ScriptedAI(c) {} - - uint32 FLAME_JETS_Timer; - uint32 SCORCH_Timer; - uint32 SLAG_POT_Timer; - - void Reset() - { - FLAME_JETS_Timer = 32000; - SCORCH_Timer = 100; - SLAG_POT_Timer = 100; - } - - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO,m_creature); - } - void KilledUnit(Unit* victim) - { - DoScriptText(SAY_SLAY, m_creature); - } - - void JustDied(Unit *victim) - { - DoScriptText(SAY_SLAY, m_creature); - } - - void MoveInLineOfSight(Unit* who) {} - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (FLAME_JETS_Timer < diff) - { - DoCast(m_creature,SPELL_FLAME_JETS); - DoScriptText(SAY_SLAY, m_creature); - FLAME_JETS_Timer = 25000; - } else FLAME_JETS_Timer -= diff; - - if (SCORCH_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_SCORCH); - SCORCH_Timer = 20000; - } else SCORCH_Timer -= diff; - - if (SLAG_POT_Timer < diff) - { - DoCast(m_creature,SPELL_SLAG_POT); - DoScriptText(SAY_SLAY, m_creature); - SLAG_POT_Timer = 30000; - } else SLAG_POT_Timer -= diff; - - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_ignis(Creature* pCreature) -{ - return new boss_ignis_AI (pCreature); -} -void AddSC_boss_ignis() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "boss_ignis"; - newscript->GetAI = &GetAI_boss_ignis; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_kologarn.cpp b/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_kologarn.cpp deleted file mode 100644 index a736b2db12a..00000000000 --- a/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_kologarn.cpp +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (C) 2008 - 2009 Trinity - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include "precompiled.h" -#include "def_ulduar.h" diff --git a/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_mimiron.cpp b/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_mimiron.cpp deleted file mode 100644 index a736b2db12a..00000000000 --- a/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_mimiron.cpp +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (C) 2008 - 2009 Trinity - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include "precompiled.h" -#include "def_ulduar.h" diff --git a/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_razorscale.cpp b/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_razorscale.cpp deleted file mode 100644 index 59a7b8e6a9a..00000000000 --- a/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_razorscale.cpp +++ /dev/null @@ -1,300 +0,0 @@ -/* - * Copyright (C) 2008 - 2009 Trinity - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -Name: razorscale -%Complete: 90 -Comment: Made by Epsik from WoW Arthas wow.dsl.net.pk -Category: -EndScriptData */ - -#include "precompiled.h" -#include "def_ulduar.h" - -#define SAY_AGGRO -2000000 -#define SAY_KILL -2000001 -#define SAY_PHASE_2_TRANS -2000002 -#define SAY_PHASE_3_TRANS -2000003 -#define EMOTE_BREATH -2000004 - -#define SPELL_FLAMEBUFFET 64016 -#define SPELL_FIREBALL 62796 - -#define SPELL_WINGBUFFET 62666 -#define SPELL_FLAMEBREATH 63317 -#define SPELL_FUSEARMOR 64771 -#define SPELL_DEVOURINGFLAME 63014 -#define SPELL_KNOCK_AWAY 19633 - -#define SPELL_BELLOWINGROAR 18431 -#define SPELL_HEATED_GROUND 22191 - -#define SPELL_SUMMONADDS 17646 - -#define CREATURE_ADDS 33846 - -static float MovementLocations[4][3]= -{ - {607.7, -281.9, 408.6}, - {602.0, -245.5, 424.7}, - {612.3, -230.8, 409.1}, - {624.1, -251.8, 426.1} -}; - -static float SpawnLocations[4][3]= -{ - {602.0, -248.1, 391.2}, - {624.4, -232-4, 391.1}, - {643.3, -256.4, 391.4}, - {626.6, -271.5, 391.4}, -}; - -struct TRINITY_DLL_DECL boss_razorscaleAI : public ScriptedAI -{ - boss_razorscaleAI(Creature* c) : ScriptedAI(c) {} - - uint32 Phase; - - uint32 FlameBreathTimer; - uint32 FUSEARMORTimer; - uint32 DEVOURINGFLAMETimer; - uint32 MovementTimer; - uint32 SummonAddsTimer; - uint32 BellowingRoarTimer; - uint32 WingBuffetTimer; - uint32 KnockAwayTimer; - uint32 FireballTimer; - - bool InitialSpawn; - - void Reset() - { - Phase = 1; - - FlameBreathTimer = 20000; - DEVOURINGFLAMETimer = 2000; - FUSEARMORTimer = 15000; - MovementTimer = 3000; - SummonAddsTimer = 45000; - BellowingRoarTimer = 30000; - WingBuffetTimer = 17000; - KnockAwayTimer = 15000; - FireballTimer = 18000; - - InitialSpawn = true; - - m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true); - m_creature->ApplySpellImmune(1, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true); - } - - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO, m_creature); - DoZoneInCombat(); - } - - void JustDied(Unit* Killer) - { - } - - void KilledUnit(Unit *victim) - { - DoScriptText(SAY_KILL, m_creature); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 99) && (Phase == 1)) - { - Phase = 2; - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - m_creature->SetHover(true); - m_creature->GetMotionMaster()->Clear(false); - m_creature->GetMotionMaster()->MoveIdle(); - DoScriptText(SAY_PHASE_2_TRANS, m_creature); - } - - if (((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 50) && (Phase == 2)) - { - Phase = 3; - m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - m_creature->SetHover(false); - m_creature->GetMotionMaster()->MovePoint(0, 619.6, -261.1, 391.471832); - DoStartMovement(m_creature->getVictim()); - m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - DoScriptText(SAY_PHASE_3_TRANS, m_creature); - m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); - } - - if (Phase == 1 || Phase == 3) - { - if (FlameBreathTimer < diff) - { - DoCast(m_creature->getVictim(), SPELL_FLAMEBREATH); - FlameBreathTimer = 15000; - } else FlameBreathTimer -= diff; - - if (DEVOURINGFLAMETimer < diff) - { - Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1); - if (target && !m_creature->HasInArc(M_PI, target)) - DoCast(target, SPELL_DEVOURINGFLAME); - - DEVOURINGFLAMETimer = 10000; - } else DEVOURINGFLAMETimer -= diff; - - if (FUSEARMORTimer < diff) - { - DoCast(m_creature->getVictim(), SPELL_FUSEARMOR); - FUSEARMORTimer = 10000; - } else FUSEARMORTimer -= diff; - - if (WingBuffetTimer < diff) - { - DoCast(m_creature->getVictim(), SPELL_WINGBUFFET); - WingBuffetTimer = 7000 + ((rand()%8)*1000); - } else WingBuffetTimer -= diff; - - if (KnockAwayTimer < diff) - { - if (rand()%100 <= 30) - { - DoCast(m_creature->getVictim(), SPELL_KNOCK_AWAY); - } - KnockAwayTimer = 15000; - } else KnockAwayTimer -= diff; - - if (Phase == 3) - { - if (BellowingRoarTimer < diff) - { - DoCast(m_creature->getVictim(), SPELL_BELLOWINGROAR); - - BellowingRoarTimer = 30000; - } else BellowingRoarTimer -= diff; - - if (SummonAddsTimer < diff) - { - SummonAdds(Phase); - - SummonAddsTimer = 45000; - } else SummonAddsTimer -= diff; - } - - DoMeleeAttackIfReady(); - } - - if (Phase == 2) - { - if (InitialSpawn) - { - InitialSpawn = false; - - for(uint32 i = 0; i < 4; ++i) - { - uint32 random = rand()%4; - Creature* Add = m_creature->SummonCreature(CREATURE_ADDS, SpawnLocations[random][0], SpawnLocations[random][1], SpawnLocations[random][2], 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000); - if (Add) - Add->AI()->AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 0)); - } - } - - - if (FireballTimer < diff) - { - DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_FIREBALL); - - FireballTimer = 18000; - } else FireballTimer -= diff; - - if (MovementTimer < diff) - { - if (rand()%100 <= 30) - { - DoScriptText(EMOTE_BREATH, m_creature); - DoCast(m_creature->getVictim(), SPELL_FLAMEBUFFET); - } - else ChangePosition(); - - MovementTimer = 25000; - } else MovementTimer -= diff; - - if (SummonAddsTimer < diff) - { - SummonAdds(Phase); - - SummonAddsTimer = 45000; - } else SummonAddsTimer -= diff; - } - } - - void ChangePosition() - { - /* Malfunctioning, Razorscale is flying around randomly, attacking players from hundreds of yards away. - uint32 random = rand() % 4; - if (random<4){ - m_creature->GetMotionMaster()->MovePoint(0, MovementLocations[random][0], MovementLocations[random][1], MovementLocations[random][2]);} */ - } - - void SummonAdds(uint32 Phase) - { - if (Phase == 2) - { - uint32 max = rand()%10; - for(uint32 i = 0; i < 4; ++i) - { - uint32 random = rand()%3; - Creature* Add = m_creature->SummonCreature(CREATURE_ADDS, SpawnLocations[random][0], SpawnLocations[random][1], SpawnLocations[random][2], 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000); - if (Add) - Add->AI()->AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 0)); - } - } - - if (Phase == 3) - { - uint32 max = rand() % 10 +1; - if (max < 1) - { - for(uint32 i = 0; i < max; ++i) - { - uint32 random = rand()%4; - Creature* Add = m_creature->SummonCreature(CREATURE_ADDS, SpawnLocations[random][0], SpawnLocations[random][1], SpawnLocations[random][2], 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000); - if (Add) - Add->AI()->AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 0)); - } - } - } - } -}; - -CreatureAI* GetAI_boss_razorscale(Creature* pCreature) -{ - return new boss_razorscaleAI (pCreature); -} - -void AddSC_boss_razorscale() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_razorscale"; - newscript->GetAI = &GetAI_boss_razorscale; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_thorim.cpp b/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_thorim.cpp deleted file mode 100644 index a736b2db12a..00000000000 --- a/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_thorim.cpp +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (C) 2008 - 2009 Trinity - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include "precompiled.h" -#include "def_ulduar.h" diff --git a/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_xt002.cpp b/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_xt002.cpp deleted file mode 100644 index a0d265f6224..00000000000 --- a/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_xt002.cpp +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (C) 2008 - 2009 Trinity - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include "precompiled.h" -#include "def_ulduar.h" - -#define SPELL_SEARING_LIGHT 63018 -#define SPELL_SONIC_BOOM 38897 - -#define SAY_AGGRO -1000000 -#define SAY_SLAY -1000001 -struct TRINITY_DLL_DECL boss_xt002_AI : public ScriptedAI -{ - boss_xt002_AI(Creature *c) : ScriptedAI(c) {} - - uint32 SEARING_LIGHT_Timer; - uint32 SONIC_BOOM_Timer; - - void Reset() - { - SEARING_LIGHT_Timer = 100; - SONIC_BOOM_Timer = 20; - } - - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO,m_creature); - } - void KilledUnit(Unit* victim) - { - DoScriptText(SAY_SLAY, m_creature); - } - - void JustDied(Unit *victim) - { - DoScriptText(SAY_SLAY, m_creature); - } - - void MoveInLineOfSight(Unit* who) {} - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (SEARING_LIGHT_Timer < diff) - { - DoCast(m_creature,SPELL_SEARING_LIGHT); - DoScriptText(SAY_SLAY, m_creature); - SEARING_LIGHT_Timer = 50000; - } else SEARING_LIGHT_Timer -= diff; - - if (SONIC_BOOM_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_SONIC_BOOM); - SONIC_BOOM_Timer = 20000; - } else SONIC_BOOM_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_xt002(Creature* pCreature) -{ - return new boss_xt002_AI (pCreature); -} -void AddSC_boss_xt002() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "boss_xt002"; - newscript->GetAI = &GetAI_boss_xt002; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_yoggsaron.cpp b/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_yoggsaron.cpp deleted file mode 100644 index a736b2db12a..00000000000 --- a/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_yoggsaron.cpp +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (C) 2008 - 2009 Trinity - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include "precompiled.h" -#include "def_ulduar.h" diff --git a/src/bindings/scripts/scripts/zone/ulduar/ulduar/def_ulduar.h b/src/bindings/scripts/scripts/zone/ulduar/ulduar/def_ulduar.h deleted file mode 100644 index d73e6324fc8..00000000000 --- a/src/bindings/scripts/scripts/zone/ulduar/ulduar/def_ulduar.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (C) 2008 - 2009 Trinity - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef DEF_ULDUAR_H -#define DEF_ULDUAR_H - -enum Encounter -{ - BOSS_LEVIATHAN, - BOSS_IGNIS, - BOSS_RAZORSCALE, - BOSS_XT002, - BOSS_ASSEMBLY, - BOSS_KOLOGARN, - BOSS_AURIAYA, - BOSS_MIMIRON, - BOSS_HODIR, - BOSS_THORIM, - BOSS_FREYA, - BOSS_VEZAX, - BOSS_YOGGSARON, - BOSS_ALGALON, - MAX_BOSS_NUMBER -}; - -#endif diff --git a/src/bindings/scripts/scripts/zone/ulduar/ulduar/instance_ulduar.cpp b/src/bindings/scripts/scripts/zone/ulduar/ulduar/instance_ulduar.cpp deleted file mode 100644 index a736b2db12a..00000000000 --- a/src/bindings/scripts/scripts/zone/ulduar/ulduar/instance_ulduar.cpp +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (C) 2008 - 2009 Trinity - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include "precompiled.h" -#include "def_ulduar.h" diff --git a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/boss_ingvar_the_plunderer.cpp b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/boss_ingvar_the_plunderer.cpp deleted file mode 100644 index a2445a97229..00000000000 --- a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/boss_ingvar_the_plunderer.cpp +++ /dev/null @@ -1,459 +0,0 @@ -/* - * Copyright (C) 2009 Trinity - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Ingvar_The_Plunderer -SD%Complete: 95 -SDComment: Some Problems with Annhylde Movement, Blizzlike Timers -SDCategory: Udgarde Keep -EndScriptData */ - -#include "precompiled.h" -#include "def_utgarde_keep.h" - -enum -{ - //Yells Ingvar - YELL_AGGRO_1 = -1574005, - YELL_AGGRO_2 = -1574006, - - YELL_DEAD_1 = -1574007, - YELL_DEAD_2 = -1574008, - - YELL_KILL_1 = -1574009, - YELL_KILL_2 = -1574010, - -//Ingvar Spells human form - MOB_INGVAR_HUMAN = 23954, - SPELL_CLEAVE = 42724, - SPELL_SMASH = 42669, - H_SPELL_SMASH = 59706, - SPELL_STAGGERING_ROAR = 42708, - H_SPELL_STAGGERING_ROAR = 59708, - SPELL_ENRAGE = 42705, - H_SPELL_ENRAGE = 59707, - - MOB_ANNHYLDE_THE_CALLER = 24068, - SPELL_INGVAR_FEIGN_DEATH = 42795, - SPELL_SUMMON_BANSHEE = 42912, - SPELL_SCOURG_RESURRECTION_EFFEKTSPAWN = 42863, //Spawn resurrecteffekt around Ingvar - - MODEL_INGVAR_UNDEAD = 26351, - MODEL_INGVAR_HUMAN = 21953, - -//Ingvar Spells undead form - MOB_INGVAR_UNDEAD = 23980, - SPELL_DARK_SMASH = 42723, - SPELL_DREADFUL_ROAR = 42729, - H_SPELL_DREADFUL_ROAR = 59734, - SPELL_WOE_STRIKE = 42730, - H_SPELL_WOE_STRIKE = 59735, - - ENTRY_THROW_TARGET = 23996, - SPELL_SHADOW_AXE_SUMMON = 42749 -}; - -struct TRINITY_DLL_DECL boss_ingvar_the_plundererAI : public ScriptedAI -{ - boss_ingvar_the_plundererAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - HeroicMode = c->GetMap()->IsHeroic(); - } - - ScriptedInstance* pInstance; - - bool HeroicMode; - bool undead; - bool event_inProgress; - - uint32 Cleave_Timer; - uint32 Smash_Timer; - uint32 Enrage_Timer; - uint32 Roar_Timer; - uint32 SpawnResTimer; - uint32 wait_Timer; - - void Reset() - { - if (undead) // Visual Hack - m_creature->SetDisplayId(MODEL_INGVAR_HUMAN); - - undead = false; - event_inProgress = false; - - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); - m_creature->SetStandState(UNIT_STAND_STATE_STAND); - - Cleave_Timer = 2000; - Smash_Timer = 5000; - Enrage_Timer = 10000; - Roar_Timer = 15000; - - SpawnResTimer = 3000; - - wait_Timer = 0; - - if (pInstance) - pInstance->SetData(DATA_INGVAR_EVENT, NOT_STARTED); - } - - void DamageTaken(Unit *done_by, uint32 &damage) - { - if (damage >= m_creature->GetHealth() && !undead) - { - //DoCast(m_creature,SPELL_INGVAR_FEIGN_DEATH,true); // Dont work ??? - // visuel hack - m_creature->SetHealth(0); - m_creature->InterruptNonMeleeSpells(true); - m_creature->RemoveAllAuras(); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); - m_creature->GetMotionMaster()->MovementExpired(false); - m_creature->GetMotionMaster()->MoveIdle(); - m_creature->SetStandState(UNIT_STAND_STATE_DEAD); - // visuel hack end - - event_inProgress = true; - undead = true; - - DoScriptText(YELL_DEAD_1,m_creature); - } - - if (event_inProgress) - { - damage = 0; - } - } - - void StartZombiePhase() - { - undead = true; - event_inProgress = false; - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); - m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); - m_creature->AI()->AttackStart(m_creature->getVictim()); - - DoScriptText(YELL_AGGRO_2,m_creature); - } - - void EnterCombat(Unit *who) - { - DoScriptText(YELL_AGGRO_1,m_creature); - - if (pInstance) - pInstance->SetData(DATA_INGVAR_EVENT, IN_PROGRESS); - } - - void JustDied(Unit* killer) - { - DoScriptText(YELL_DEAD_2,m_creature); - - if (pInstance) - pInstance->SetData(DATA_INGVAR_EVENT, DONE); - } - - void KilledUnit(Unit *victim) - { - if (undead) { DoScriptText(YELL_KILL_1,m_creature); } - else { DoScriptText(YELL_KILL_2,m_creature); } - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (event_inProgress) - { - if (SpawnResTimer) - if (SpawnResTimer< diff) - { - DoCast(m_creature,SPELL_SUMMON_BANSHEE); // Summons direktly on caster position - //DoCast(m_creature,SPELL_SCOURG_RESURRECTION_EFFEKTSPAWN); // Dont needet ? - SpawnResTimer = 0; - }else SpawnResTimer -= diff; - - return; - } - - // This is used for a spell queue ... the spells should not castet if one spell is already casting - if (wait_Timer) - if (wait_Timer < diff) - { - wait_Timer = 0; - }else wait_Timer -= diff; - - if (Cleave_Timer < diff) - { - if (!wait_Timer) - { - if (undead) - DoCast(m_creature->getVictim(),HeroicMode ? H_SPELL_WOE_STRIKE : SPELL_WOE_STRIKE); - else - DoCast(m_creature->getVictim(),SPELL_CLEAVE); - Cleave_Timer = rand()%5000 + 2000; - - wait_Timer = 1000; - } - }else Cleave_Timer -= diff; - - if (Smash_Timer < diff) - { - if (!wait_Timer) - { - if (undead) - DoCast(m_creature->getVictim(), SPELL_DARK_SMASH); - else - DoCast(m_creature->getVictim(),HeroicMode ? H_SPELL_SMASH : SPELL_SMASH); - Smash_Timer = 10000; - - wait_Timer = 5000; - } - }else Smash_Timer -= diff; - - if (!undead) - { - if (Enrage_Timer < diff) - { - DoCast(m_creature,HeroicMode ? H_SPELL_ENRAGE : SPELL_ENRAGE); - Enrage_Timer = 10000; - }else Enrage_Timer -= diff; - }else // In Undead form used to summon weapon - { - if (Enrage_Timer < diff) - { - if (!wait_Timer) - { - // Spawn target for Axe - Unit* target = SelectUnit(SELECT_TARGET_TOPAGGRO, 1); - if (target) - { - Creature* temp = m_creature->SummonCreature(ENTRY_THROW_TARGET,target->GetPositionX(),target->GetPositionY(),target->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN,2000); - - DoCast(m_creature,SPELL_SHADOW_AXE_SUMMON); - } - Enrage_Timer = 30000; - } - }else Enrage_Timer -= diff; - } - - - if (Roar_Timer < diff) - { - if (!wait_Timer) - { - if (undead) - DoCast(m_creature,HeroicMode ? H_SPELL_DREADFUL_ROAR : SPELL_DREADFUL_ROAR); - else - DoCast(m_creature,HeroicMode ? H_SPELL_STAGGERING_ROAR : SPELL_STAGGERING_ROAR); - Roar_Timer = 10000; - - wait_Timer = 5000; - } - }else Roar_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_ingvar_the_plunderer(Creature* pCreature) -{ - return new boss_ingvar_the_plundererAI (pCreature); -} - -enum -{ -//we don't have that text in db so comment it until we get this text -// YELL_RESSURECT = -1574025, - -//Spells for Annhylde - SPELL_SCOURG_RESURRECTION_HEAL = 42704, //Heal Max + DummyAura - SPELL_SCOURG_RESURRECTION_BEAM = 42857, //Channeling Beam of Annhylde - SPELL_SCOURG_RESURRECTION_DUMMY = 42862, //Some Emote Dummy? - SPELL_INGVAR_TRANSFORM = 42796 -}; - -struct TRINITY_DLL_DECL mob_annhylde_the_callerAI : public ScriptedAI -{ - mob_annhylde_the_callerAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - float x,y,z; - ScriptedInstance* pInstance; - uint32 Resurect_Timer; - uint32 Resurect_Phase; - - void Reset() - { - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_FLYING + MOVEMENTFLAG_HOVER); - m_creature->SetSpeed(MOVE_SWIM , 1.0f); - m_creature->SetSpeed(MOVE_RUN , 1.0f); - m_creature->SetSpeed(MOVE_WALK , 1.0f); - //m_creature->SetSpeed(MOVE_FLIGHT , 1.0f); - - m_creature->GetPosition(x,y,z); - DoTeleportTo(x+1,y,z+30); - - Unit* ingvar = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_INGVAR)); - if (ingvar) - { - m_creature->GetMotionMaster()->MovePoint(1,x,y,z+15); - -// DoScriptText(YELL_RESSURECT,m_creature); - } - } - - void MovementInform(uint32 type, uint32 id) - { - if (type != POINT_MOTION_TYPE) - return; - Unit* ingvar = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_INGVAR)); - if (ingvar) - { - switch (id) - { - case 1: - ingvar->RemoveAura(SPELL_SUMMON_BANSHEE); - ingvar->CastSpell(ingvar,SPELL_SCOURG_RESURRECTION_DUMMY,true); - DoCast(ingvar,SPELL_SCOURG_RESURRECTION_BEAM); - Resurect_Timer = 8000; - Resurect_Phase = 1; - break; - case 2: - m_creature->DealDamage(m_creature,m_creature->GetHealth()); - m_creature->RemoveCorpse(); - break; - } - } - } - - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void EnterCombat(Unit *who) {} - void UpdateAI(const uint32 diff) - { - if (Resurect_Timer) - if (Resurect_Timer < diff) - { - if (Resurect_Phase == 1) - { - Unit* ingvar = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_INGVAR)); - if (ingvar) - { - ingvar->SetStandState(UNIT_STAND_STATE_STAND); - ingvar->CastSpell(ingvar,SPELL_SCOURG_RESURRECTION_HEAL,false); - } - Resurect_Timer = 3000; - Resurect_Phase = 2; - }else if (Resurect_Phase == 2) - { - Creature* ingvar = Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_INGVAR)); - if (ingvar) - { - ingvar->RemoveAurasDueToSpell(SPELL_SCOURG_RESURRECTION_DUMMY); - //ingvar->CastSpell(ingvar,SPELL_INGVAR_TRANSFORM,false); - ingvar->SetDisplayId(MODEL_INGVAR_UNDEAD); // Visual Hack - when he dies he becomes human model -> wrong - Creature* c_ingvar = ingvar; - - CAST_AI(boss_ingvar_the_plundererAI, (c_ingvar->AI()))->StartZombiePhase(); - - m_creature->GetMotionMaster()->MovePoint(2,x+1,y,z+30); - Resurect_Phase++; - } - } - - }else Resurect_Timer -= diff; - } -}; - -CreatureAI* GetAI_mob_annhylde_the_caller(Creature* pCreature) -{ - return new mob_annhylde_the_callerAI (pCreature); -} - -enum -{ - SPELL_SHADOW_AXE_DAMAGE = 42750, - H_SPELL_SHADOW_AXE_DAMAGE = 59719 -}; - -struct TRINITY_DLL_DECL mob_ingvar_throw_dummyAI : public ScriptedAI -{ - mob_ingvar_throw_dummyAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - HeroicMode = c->GetMap()->IsHeroic(); - } - - bool HeroicMode; - uint32 Despawn_Timer; - - ScriptedInstance* pInstance; - - void Reset() - { - Unit* target = m_creature->FindNearestCreature(ENTRY_THROW_TARGET,50); - if (target) - { - DoCast(m_creature, HeroicMode ? H_SPELL_SHADOW_AXE_DAMAGE : SPELL_SHADOW_AXE_DAMAGE); - float x,y,z; - target->GetPosition(x,y,z); - m_creature->GetMotionMaster()->MovePoint(0,x,y,z); - } - Despawn_Timer = 7000; - } - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void EnterCombat(Unit *who) {} - void UpdateAI(const uint32 diff) - { - if (Despawn_Timer < diff) - { - m_creature->DealDamage(m_creature,m_creature->GetHealth()); - m_creature->RemoveCorpse(); - Despawn_Timer = 0; - }else Despawn_Timer -= diff; - } -}; - -CreatureAI* GetAI_mob_ingvar_throw_dummy(Creature* pCreature) -{ - return new mob_ingvar_throw_dummyAI (pCreature); -} - -void AddSC_boss_ingvar_the_plunderer() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_ingvar_the_plunderer"; - newscript->GetAI = &GetAI_boss_ingvar_the_plunderer; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_annhylde_the_caller"; - newscript->GetAI = &GetAI_mob_annhylde_the_caller; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_ingvar_throw_dummy"; - newscript->GetAI = &GetAI_mob_ingvar_throw_dummy; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/boss_keleseth.cpp b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/boss_keleseth.cpp deleted file mode 100644 index b7701a52472..00000000000 --- a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/boss_keleseth.cpp +++ /dev/null @@ -1,365 +0,0 @@ -/* - * Copyright (C) 2009 Trinity - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Prince_Keleseth -SD%Complete: 90 -SDComment: Needs Prince Movements, Needs adjustments to blizzlike timers, Needs Shadowbolt castbar, Needs right Ressurect Visual, Needs Some Heroic Spells -SDCategory: Utgarde Keep -EndScriptData */ - -#include "precompiled.h" -#include "def_utgarde_keep.h" - -enum -{ - ACHIEVEMENT_ON_THE_ROCKS = 1919, - - SPELL_SHADOWBOLT = 43667, - SPELL_SHADOWBOLT_HEROIC = 59389, - SPELL_FROST_TOMB = 48400, - SPELL_FROST_TOMB_SUMMON = 42714, - SPELL_DECREPIFY = 42702, - SPELL_SCOURGE_RESSURRECTION = 42704, - CREATURE_FROSTTOMB = 23965, - CREATURE_SKELETON = 23970, - - SAY_AGGRO = -1574000, - SAY_FROST_TOMB = -1574001, - SAY_SKELETONS = -1574002, - SAY_KILL = -1574003, - SAY_DEATH = -1574004 -}; - -#define SKELETONSPAWN_Z 42.8668 - -float SkeletonSpawnPoint[5][5]= -{ - {156.2559, 259.2093}, - {156.2559, 259.2093}, - {156.2559, 259.2093}, - {156.2559, 259.2093}, - {156.2559, 259.2093}, -}; - -float AttackLoc[3]={197.636, 194.046, 40.8164}; - -bool ShatterFrostTomb; // needed for achievement: On The Rocks(1919) - -struct TRINITY_DLL_DECL mob_frost_tombAI : public ScriptedAI -{ - mob_frost_tombAI(Creature *c) : ScriptedAI(c) - { - FrostTombGUID = 0; - } - - uint64 FrostTombGUID; - - void SetPrisoner(Unit* uPrisoner) - { - FrostTombGUID = uPrisoner->GetGUID(); - } - - void Reset(){ FrostTombGUID = 0; } - void EnterCombat(Unit* who) {} - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - - void JustDied(Unit *killer) - { - if (killer->GetGUID() != m_creature->GetGUID()) - ShatterFrostTomb = true; - - if (FrostTombGUID) - { - Unit* FrostTomb = Unit::GetUnit((*m_creature),FrostTombGUID); - if (FrostTomb) - FrostTomb->RemoveAurasDueToSpell(SPELL_FROST_TOMB); - } - } - - void UpdateAI(const uint32 diff) - { - Unit* temp = Unit::GetUnit((*m_creature),FrostTombGUID); - if ((temp && temp->isAlive() && !temp->HasAura(SPELL_FROST_TOMB)) || !temp) - m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - } -}; - -struct TRINITY_DLL_DECL boss_kelesethAI : public ScriptedAI -{ - boss_kelesethAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - Heroic = c->GetMap()->IsHeroic(); - } - - ScriptedInstance* pInstance; - - uint32 FrostTombTimer; - uint32 SummonSkeletonsTimer; - uint32 RespawnSkeletonsTimer; - uint32 ShadowboltTimer; - uint64 SkeletonGUID[5]; - bool Skeletons; - bool Heroic; - bool RespawnSkeletons; - - void Reset() - { - ShadowboltTimer = 0; - Skeletons = false; - - ShatterFrostTomb = false; - - ResetTimer(); - - if (pInstance) - pInstance->SetData(DATA_PRINCEKELESETH_EVENT, NOT_STARTED); - } - - void KilledUnit(Unit *victim) - { - if (victim == m_creature) - return; - - DoScriptText(SAY_KILL, m_creature); - } - - void JustDied(Unit* killer) - { - DoScriptText(SAY_DEATH, m_creature); - - if (Heroic && !ShatterFrostTomb) - { - AchievementEntry const *AchievOnTheRocks = GetAchievementStore()->LookupEntry(ACHIEVEMENT_ON_THE_ROCKS); - if (AchievOnTheRocks) - { - Map* pMap = m_creature->GetMap(); - if (pMap && pMap->IsDungeon()) - { - Map::PlayerList const &players = pMap->GetPlayers(); - for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) - itr->getSource()->CompletedAchievement(AchievOnTheRocks); - } - } - } - - if (pInstance) - pInstance->SetData(DATA_PRINCEKELESETH_EVENT, DONE); - } - - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO, m_creature); - DoZoneInCombat(); - - if (pInstance) - pInstance->SetData(DATA_PRINCEKELESETH_EVENT, IN_PROGRESS); - } - - void ResetTimer(uint32 inc = 0) - { - SummonSkeletonsTimer = 5000 + inc; - FrostTombTimer = 28000 + inc; - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (ShadowboltTimer < diff) - { - Unit* target = SelectUnit(SELECT_TARGET_TOPAGGRO, 0); - if (target && target->isAlive() && target->GetTypeId() == TYPEID_PLAYER) - m_creature->CastSpell(target, Heroic ? SPELL_SHADOWBOLT_HEROIC : SPELL_SHADOWBOLT, true); - ShadowboltTimer = 10000; - }else ShadowboltTimer -= diff; - - if (!Skeletons) - if ((SummonSkeletonsTimer < diff)) - { - Creature* Skeleton; - DoScriptText(SAY_SKELETONS, m_creature); - for(uint8 i = 0; i < 5; ++i) - { - Skeleton = m_creature->SummonCreature(CREATURE_SKELETON, SkeletonSpawnPoint[i][0], SkeletonSpawnPoint[i][1] , SKELETONSPAWN_Z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN,20000); - if (Skeleton) - { - Skeleton->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - Skeleton->GetMotionMaster()->MovePoint(0, m_creature->GetPositionX(), m_creature->GetPositionY() , m_creature->GetPositionZ()); - Skeleton->AddThreat(m_creature->getVictim(), 0.0f); - DoZoneInCombat(Skeleton); - } - } - Skeletons = true; - }else SummonSkeletonsTimer -= diff; - - if (FrostTombTimer < diff) - { - Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1); - if (target && target->isAlive() && target->GetTypeId() == TYPEID_PLAYER) - { - //DoCast(target, SPELL_FROST_TOMB_SUMMON, true); - Creature* Chains = m_creature->SummonCreature(CREATURE_FROSTTOMB, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 20000); - if (Chains) - { - CAST_AI(mob_frost_tombAI, Chains->AI())->SetPrisoner(target); - Chains->CastSpell(target, SPELL_FROST_TOMB, true); - - DoScriptText(SAY_FROST_TOMB, m_creature); - } - } - FrostTombTimer = 15000; - }else FrostTombTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -struct TRINITY_DLL_DECL mob_vrykul_skeletonAI : public ScriptedAI -{ - mob_vrykul_skeletonAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance *pInstance; - uint32 Respawn_Time; - uint64 Target_Guid; - uint32 Decrepify_Timer; - - bool isDead; - - void Reset() - { - Respawn_Time = 12000; - Decrepify_Timer = 10000 + rand()%20000; - isDead = false; - } - - void EnterCombat(Unit *who){} - void DamageTaken(Unit *done_by, uint32 &damage) - { - if (done_by->GetGUID() == m_creature->GetGUID()) - return; - - if (damage >= m_creature->GetHealth()) - { - PretendToDie(); - damage = 0; - } - } - - - void PretendToDie() - { - isDead = true; - m_creature->InterruptNonMeleeSpells(true); - m_creature->RemoveAllAuras(); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - m_creature->GetMotionMaster()->MovementExpired(false); - m_creature->GetMotionMaster()->MoveIdle(); - m_creature->SetStandState(UNIT_STAND_STATE_DEAD); - }; - - void Resurrect() - { - isDead = false; - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - m_creature->SetStandState(UNIT_STAND_STATE_STAND); - m_creature->CastSpell(m_creature,SPELL_SCOURGE_RESSURRECTION,true); - - if (m_creature->getVictim()) - { - m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); - m_creature->AI()->AttackStart(m_creature->getVictim()); - } - else - m_creature->GetMotionMaster()->Initialize(); - }; - - void UpdateAI(const uint32 diff) - { - if (pInstance->GetData(DATA_PRINCEKELESETH_EVENT) == IN_PROGRESS) - { - if (isDead) - { - if (Respawn_Time < diff) - { - Resurrect(); - Respawn_Time = 12000; - }else Respawn_Time -= diff; - } - else - { - if (!UpdateVictim()) - return; - - if (Decrepify_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_DECREPIFY); - Decrepify_Timer = 30000; - }else Decrepify_Timer -= diff; - - DoMeleeAttackIfReady(); - } - }else - { - if (m_creature->isAlive()) - m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - } - - } -}; - -CreatureAI* GetAI_mob_frost_tomb(Creature* pCreature) -{ - return new mob_frost_tombAI(pCreature); -} - -CreatureAI* GetAI_boss_keleseth(Creature* pCreature) -{ - return new boss_kelesethAI (pCreature); -} - -CreatureAI* GetAI_mob_vrykul_skeleton(Creature* pCreature) -{ - return new mob_vrykul_skeletonAI (pCreature); -} - -void AddSC_boss_keleseth() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_keleseth"; - newscript->GetAI = &GetAI_boss_keleseth; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_frost_tomb"; - newscript->GetAI = &GetAI_mob_frost_tomb; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_vrykul_skeleton"; - newscript->GetAI = &GetAI_mob_vrykul_skeleton; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/boss_skarvald_dalronn.cpp b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/boss_skarvald_dalronn.cpp deleted file mode 100644 index 49811125594..00000000000 --- a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/boss_skarvald_dalronn.cpp +++ /dev/null @@ -1,397 +0,0 @@ -/* - * Copyright (C) 2009 Trinity - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Skarvald_Dalronn -SD%Complete: 95 -SDComment: Needs adjustments to blizzlike timers, Yell Text + Sound to DB -SDCategory: Utgarde Keep -EndScriptData */ - -#include "precompiled.h" -#include "def_utgarde_keep.h" - -enum -{ - YELL_SKARVALD_AGGRO = -1574011, - YELL_SKARVALD_DAL_DIED = -1574012, - YELL_SKARVALD_SKA_DIEDFIRST = -1574013, - YELL_SKARVALD_KILL = -1574014, - YELL_SKARVALD_DAL_DIEDFIRST = -1574015, - - YELL_DALRONN_AGGRO = -1574016, - YELL_DALRONN_SKA_DIED = -1574017, - YELL_DALRONN_DAL_DIEDFIRST = -1574018, - YELL_DALRONN_KILL = -1574019, - YELL_DALRONN_SKA_DIEDFIRST = -1574020, - -//Spells of Skarvald and his Ghost - MOB_SKARVALD_THE_CONSTRUCTOR = 24200, - SPELL_CHARGE = 43651, - SPELL_STONE_STRIKE = 48583, - SPELL_SUMMON_SKARVALD_GHOST = 48613, - MOB_SKARVALD_GHOST = 27390, -//Spells of Dalronn and his Ghost - MOB_DALRONN_THE_CONTROLLER = 24201, - SPELL_SHADOW_BOLT = 43649, - H_SPELL_SHADOW_BOLT = 59575, - H_SPELL_SUMMON_SKELETONS = 52611, - SPELL_DEBILITATE = 43650, - SPELL_SUMMON_DALRONN_GHOST = 48612, - MOB_DALRONN_GHOST = 27389 -}; - -struct TRINITY_DLL_DECL boss_skarvald_the_constructorAI : public ScriptedAI -{ - boss_skarvald_the_constructorAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - ScriptedInstance* pInstance; - - bool ghost; - bool HeroicMode; - uint32 Charge_Timer; - uint32 StoneStrike_Timer; - uint32 Response_Timer; - uint32 Check_Timer; - bool Dalronn_isDead; - - void Reset() - { - Charge_Timer = 5000; - StoneStrike_Timer = 10000; - Dalronn_isDead = false; - Check_Timer = 5000; - - ghost = (m_creature->GetEntry() == MOB_SKARVALD_GHOST); - if (!ghost) - { - Unit* dalronn = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_DALRONN)); - if (dalronn && dalronn->isDead()) - CAST_CRE(dalronn)->Respawn(); - - if (pInstance) - pInstance->SetData(DATA_SKARVALD_DALRONN_EVENT, NOT_STARTED); - } - } - - void EnterCombat(Unit *who) - { - if (!ghost) - { - DoScriptText(YELL_SKARVALD_AGGRO,m_creature); - - Unit* dalronn = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_DALRONN)); - if (dalronn && dalronn->isAlive() && !dalronn->getVictim()) - dalronn->getThreatManager().addThreat(who,0.0f); - - if (pInstance) - pInstance->SetData(DATA_SKARVALD_DALRONN_EVENT, IN_PROGRESS); - } - } - - void JustDied(Unit* Killer) - { - if (!ghost) - { - Unit* dalronn = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_DALRONN)); - if (dalronn) - { - if (dalronn->isDead()) - { - DoScriptText(YELL_SKARVALD_DAL_DIED,m_creature); - - if (pInstance) - pInstance->SetData(DATA_SKARVALD_DALRONN_EVENT, DONE); - } - else - { - DoScriptText(YELL_SKARVALD_SKA_DIEDFIRST,m_creature); - - m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); - //DoCast(m_creature,SPELL_SUMMON_SKARVALD_GHOST,true); - Creature* temp = m_creature->SummonCreature(MOB_SKARVALD_GHOST,m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ(),0,TEMPSUMMON_CORPSE_DESPAWN,5000); - if (temp) - { - temp->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NON_ATTACKABLE); - temp->AI()->AttackStart(Killer); - } - } - } - } - } - - void KilledUnit(Unit *victim) - { - if (!ghost) - { - DoScriptText(YELL_SKARVALD_KILL,m_creature); - } - } - - void UpdateAI(const uint32 diff) - { - if (ghost) - { - if (pInstance->GetData(DATA_SKARVALD_DALRONN_EVENT) != IN_PROGRESS) - { - m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - } - } - - if (!UpdateVictim()) - return; - - if (!ghost) - { - if (Check_Timer) - if (Check_Timer < diff) - { - Check_Timer = 5000; - Unit* dalronn = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_DALRONN)); - if (dalronn && dalronn->isDead()) - { - Dalronn_isDead = true; - Response_Timer = 2000; - Check_Timer = 0; - } - }else Check_Timer -= diff; - - if (Response_Timer) - if (Dalronn_isDead) - if (Response_Timer < diff) - { - DoScriptText(YELL_SKARVALD_DAL_DIEDFIRST,m_creature); - - Response_Timer = 0; - }else Response_Timer -= diff; - } - - if (Charge_Timer < diff) - { - DoCast(SelectUnit(SELECT_TARGET_RANDOM, 1), SPELL_CHARGE); - Charge_Timer = 5000+rand()%5000; - }else Charge_Timer -= diff; - - if (StoneStrike_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_STONE_STRIKE); - StoneStrike_Timer = 5000+rand()%5000; - }else StoneStrike_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_skarvald_the_constructor(Creature* pCreature) -{ - return new boss_skarvald_the_constructorAI (pCreature); -} - -struct TRINITY_DLL_DECL boss_dalronn_the_controllerAI : public ScriptedAI -{ - boss_dalronn_the_controllerAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - ScriptedInstance* pInstance; - - bool ghost; - bool HeroicMode; - uint32 ShadowBolt_Timer; - uint32 Debilitate_Timer; - uint32 Summon_Timer; - - uint32 Response_Timer; - uint32 Check_Timer; - uint32 AggroYell_Timer; - bool Skarvald_isDead; - - - void Reset() - { - ShadowBolt_Timer = 1000; - Debilitate_Timer = 5000; - Summon_Timer = 10000; - Check_Timer = 5000; - Skarvald_isDead = false; - AggroYell_Timer = 0; - - ghost = m_creature->GetEntry() == MOB_DALRONN_GHOST; - if (!ghost) - { - Unit* skarvald = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_SKARVALD)); - if (skarvald && skarvald->isDead()) - CAST_CRE(skarvald)->Respawn(); - - if (pInstance) - pInstance->SetData(DATA_SKARVALD_DALRONN_EVENT, NOT_STARTED); - } - } - - void EnterCombat(Unit *who) - { - if (!ghost) - { - Unit* skarvald = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_SKARVALD)); - if (skarvald && skarvald->isAlive() && !skarvald->getVictim()) - skarvald->getThreatManager().addThreat(who,0.0f); - - AggroYell_Timer = 5000; - - if (pInstance) - pInstance->SetData(DATA_SKARVALD_DALRONN_EVENT, IN_PROGRESS); - } - } - - void JustDied(Unit* Killer) - { - if (!ghost) - { - Unit* skarvald = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_SKARVALD)); - if (skarvald) - if (skarvald->isDead()) - { - DoScriptText(YELL_DALRONN_SKA_DIED,m_creature); - - if (pInstance) - pInstance->SetData(DATA_SKARVALD_DALRONN_EVENT, DONE); - } - else - { - DoScriptText(YELL_DALRONN_DAL_DIEDFIRST,m_creature); - - m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); - //DoCast(m_creature,SPELL_SUMMON_DALRONN_GHOST,true); - Creature* temp = m_creature->SummonCreature(MOB_DALRONN_GHOST,m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ(),0,TEMPSUMMON_CORPSE_DESPAWN,5000); - if (temp) - { - temp->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NON_ATTACKABLE); - temp->AI()->AttackStart(Killer); - } - } - } - } - - void KilledUnit(Unit *victim) - { - if (!ghost) - { - DoScriptText(YELL_DALRONN_KILL,m_creature); - } - } - - void UpdateAI(const uint32 diff) - { - if (ghost) - { - if (pInstance->GetData(DATA_SKARVALD_DALRONN_EVENT) != IN_PROGRESS) - { - m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - } - } - - if (!UpdateVictim()) - return; - - if (AggroYell_Timer) - if (AggroYell_Timer < diff) - { - DoScriptText(YELL_DALRONN_AGGRO,m_creature); - - AggroYell_Timer = 0; - }else AggroYell_Timer -= diff; - - if (!ghost) - { - if (Check_Timer) - if (Check_Timer < diff) - { - Check_Timer = 5000; - Unit* skarvald = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_SKARVALD)); - if (skarvald && skarvald->isDead()) - { - Skarvald_isDead = true; - Response_Timer = 2000; - Check_Timer = 0; - } - }else Check_Timer -= diff; - - if (Response_Timer) - if (Skarvald_isDead) - if (Response_Timer < diff) - { - DoScriptText(YELL_DALRONN_SKA_DIEDFIRST,m_creature); - - Response_Timer = 0; - }else Response_Timer -= diff; - } - - if (ShadowBolt_Timer < diff) - { - if (!m_creature->IsNonMeleeSpellCasted(false)) - { - DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0),HeroicMode ? H_SPELL_SHADOW_BOLT : SPELL_SHADOW_BOLT); - ShadowBolt_Timer = 1000; - } - }else ShadowBolt_Timer -= diff; - - if (Debilitate_Timer < diff) - { - if (!m_creature->IsNonMeleeSpellCasted(false)) - { - DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0),SPELL_DEBILITATE); - Debilitate_Timer = 5000+rand()%5000; - } - }else Debilitate_Timer -= diff; - - if (HeroicMode) - if (Summon_Timer < diff) - { - DoCast(m_creature,H_SPELL_SUMMON_SKELETONS); - Summon_Timer = (rand()%10000) + 20000; - }else Summon_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_dalronn_the_controller(Creature* pCreature) -{ - return new boss_dalronn_the_controllerAI (pCreature); -} - -void AddSC_boss_skarvald_dalronn() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_skarvald_the_constructor"; - newscript->GetAI = &GetAI_boss_skarvald_the_constructor; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="boss_dalronn_the_controller"; - newscript->GetAI = &GetAI_boss_dalronn_the_controller; - newscript->RegisterSelf(); -} \ No newline at end of file diff --git a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/def_utgarde_keep.h b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/def_utgarde_keep.h deleted file mode 100644 index b630e156564..00000000000 --- a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/def_utgarde_keep.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (C) 2009 Trinity - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef DEF_UTGARDE_KEEP_H -#define DEF_UTGARDE_KEEP_H - -#define DATA_PRINCEKELESETH 1 -#define DATA_SKARVALD 3 -#define DATA_DALRONN 4 -#define DATA_INGVAR 6 - -#define DATA_PRINCEKELESETH_EVENT 2 -#define DATA_SKARVALD_DALRONN_EVENT 5 -#define DATA_INGVAR_EVENT 7 - -#define EVENT_FORGE_1 8 -#define EVENT_FORGE_2 9 -#define EVENT_FORGE_3 10 - -#endif diff --git a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/instance_utgarde_keep.cpp b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/instance_utgarde_keep.cpp deleted file mode 100644 index 4c7668970da..00000000000 --- a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/instance_utgarde_keep.cpp +++ /dev/null @@ -1,291 +0,0 @@ -/* - * Copyright (C) 2009 Trinity - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Instance_Utgarde_Keep -SD%Complete: 90 -SDComment: Instance Data Scripts and functions to acquire mobs and set encounter status for use in various Utgarde Keep Scripts -SDCategory: Utgarde Keep -EndScriptData */ - -#include "precompiled.h" -#include "def_utgarde_keep.h" - -#define MAX_ENCOUNTER 3 - -#define ENTRY_BELLOW_1 186688 -#define ENTRY_BELLOW_2 186689 -#define ENTRY_BELLOW_3 186690 - -#define ENTRY_FORGEFIRE_1 186692 -#define ENTRY_FORGEFIRE_2 186693 -#define ENTRY_FORGEFIRE_3 186691 - -#define ENTRY_GLOWING_ANVIL_1 186609 -#define ENTRY_GLOWING_ANVIL_2 186610 -#define ENTRY_GLOWING_ANVIL_3 186611 - -/* Utgarde Keep encounters: -0 - Prince Keleseth -1 - Skarvald Dalronn -2 - Ingvar the Plunderer -*/ - -struct TRINITY_DLL_DECL instance_utgarde_keep : public ScriptedInstance -{ - instance_utgarde_keep(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; - - uint64 Keleseth; - uint64 Skarvald; - uint64 Dalronn; - uint64 Ingvar; - - uint64 forge_bellow[3]; - uint64 forge_fire[3]; - uint64 forge_anvil[3]; - - uint32 m_auiEncounter[MAX_ENCOUNTER]; - std::string str_data; - - void Initialize() - { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - - Keleseth = 0; - Skarvald = 0; - Dalronn =0; - Ingvar =0; - - for(uint8 i= 0; i < 3; ++i) - { - forge_bellow[i] = 0; - forge_fire[i] = 0; - forge_anvil[i] = 0; - } - } - - bool IsEncounterInProgress() const - { - for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) return true; - - return false; - } - - Player* GetPlayerInMap() - { - Map::PlayerList const& players = instance->GetPlayers(); - - if (!players.isEmpty()) - { - for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) - { - if (Player* plr = itr->getSource()) - return plr; - } - } - - debug_log("TSCR: Instance Utgarde Keep: GetPlayerInMap, but PlayerList is empty!"); - return NULL; - } - - void OnCreatureCreate(Creature* pCreature, bool add) - { - switch(pCreature->GetEntry()) - { - case 23953: Keleseth = pCreature->GetGUID(); break; - case 24201: Dalronn = pCreature->GetGUID(); break; - case 24200: Skarvald = pCreature->GetGUID(); break; - case 23954: Ingvar = pCreature->GetGUID(); break; - } - } - - void OnGameObjectCreate(GameObject* pGo, bool add) - { - switch(pGo->GetEntry()) - { - //door and object id - case ENTRY_BELLOW_1: forge_bellow[0] = pGo->GetGUID(); break; - case ENTRY_BELLOW_2: forge_bellow[1] = pGo->GetGUID(); break; - case ENTRY_BELLOW_3: forge_bellow[2] = pGo->GetGUID(); break; - case ENTRY_FORGEFIRE_1: forge_fire[0] = pGo->GetGUID(); break; - case ENTRY_FORGEFIRE_2: forge_fire[1] = pGo->GetGUID(); break; - case ENTRY_FORGEFIRE_3: forge_fire[2] = pGo->GetGUID(); break; - case ENTRY_GLOWING_ANVIL_1: forge_anvil[0] = pGo->GetGUID(); break; - case ENTRY_GLOWING_ANVIL_2: forge_anvil[1] = pGo->GetGUID(); break; - case ENTRY_GLOWING_ANVIL_3: forge_anvil[2] = pGo->GetGUID(); break; - } - } - - uint64 GetData64(uint32 identifier) - { - switch(identifier) - { - case DATA_PRINCEKELESETH: return Keleseth; - case DATA_DALRONN: return Dalronn; - case DATA_SKARVALD: return Skarvald; - case DATA_INGVAR: return Ingvar; - } - - return 0; - } - - void SetData(uint32 type, uint32 data) - { - switch(type) - { - case DATA_PRINCEKELESETH_EVENT: - if (data == DONE) - { - //HandleGameObject(doorname, 0); - } - m_auiEncounter[0] = data; - break; - case DATA_SKARVALD_DALRONN_EVENT: - if (data == DONE) - { - //HandleGameObject(doorname, 0); - } - m_auiEncounter[1] = data; - break; - case DATA_INGVAR_EVENT: - if (data == DONE) - { - //HandleGameObject(doorname, 0); - } - m_auiEncounter[2] = data; - break; - case EVENT_FORGE_1: - if (data == NOT_STARTED) - { - HandleGameObject(forge_bellow[0],false); - HandleGameObject(forge_fire[0],false); - HandleGameObject(forge_anvil[0],false); - }else - { - HandleGameObject(forge_bellow[0],true); - HandleGameObject(forge_fire[0],true); - HandleGameObject(forge_anvil[0],true); - } - break; - case EVENT_FORGE_2: - if (data == NOT_STARTED) - { - HandleGameObject(forge_bellow[1],false); - HandleGameObject(forge_fire[1],false); - HandleGameObject(forge_anvil[1],false); - }else - { - HandleGameObject(forge_bellow[1],true); - HandleGameObject(forge_fire[1],true); - HandleGameObject(forge_anvil[1],true); - } - break; - case EVENT_FORGE_3: - if (data == NOT_STARTED) - { - HandleGameObject(forge_bellow[2],false); - HandleGameObject(forge_fire[2],false); - HandleGameObject(forge_anvil[2],false); - }else - { - HandleGameObject(forge_bellow[2],true); - HandleGameObject(forge_fire[2],true); - HandleGameObject(forge_anvil[2],true); - } - break; - } - - - if (data == DONE) - { - SaveToDB(); - } - } - - uint32 GetData(uint32 type) - { - switch(type) - { - case DATA_PRINCEKELESETH_EVENT: return m_auiEncounter[0]; - case DATA_SKARVALD_DALRONN_EVENT: return m_auiEncounter[1]; - case DATA_INGVAR_EVENT: return m_auiEncounter[2]; - } - - return 0; - } - - std::string GetSaveData() - { - OUT_SAVE_INST_DATA; - - std::ostringstream saveStream; - saveStream << "U K " << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " - << m_auiEncounter[2]; - - str_data = saveStream.str(); - - OUT_SAVE_INST_DATA_COMPLETE; - return str_data; - } - - void Load(const char* in) - { - if (!in) - { - OUT_LOAD_INST_DATA_FAIL; - return; - } - - OUT_LOAD_INST_DATA(in); - - char dataHead1, dataHead2; - uint16 data0,data1,data2; - - std::istringstream loadStream(in); - loadStream >> dataHead1 >> dataHead2 >> data0 >> data1 >> data2; - - if (dataHead1 == 'U' && dataHead2 == 'K') - { - m_auiEncounter[0] = data0; - m_auiEncounter[1] = data1; - m_auiEncounter[2] = data2; - - for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) - m_auiEncounter[i] = NOT_STARTED; - - }else OUT_LOAD_INST_DATA_FAIL; - - OUT_LOAD_INST_DATA_COMPLETE; - } -}; - -InstanceData* GetInstanceData_instance_utgarde_keep(Map* pMap) -{ - return new instance_utgarde_keep(pMap); -} - -void AddSC_instance_utgarde_keep() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_utgarde_keep"; - newscript->GetInstanceData = &GetInstanceData_instance_utgarde_keep; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/utgarde_keep.cpp b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/utgarde_keep.cpp deleted file mode 100644 index d82e45f28d4..00000000000 --- a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/utgarde_keep.cpp +++ /dev/null @@ -1,160 +0,0 @@ -/* - * Copyright (C) 2009 Trinity - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include "precompiled.h" -#include "def_utgarde_keep.h" - -uint32 entry_search[3] = -{ - 186609, - 186610, - 186611 -}; - -struct TRINITY_DLL_DECL npc_dragonflayer_forge_masterAI : public ScriptedAI -{ - npc_dragonflayer_forge_masterAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - fm_Type = 0; - } - - ScriptedInstance* pInstance; - uint8 fm_Type; - - void Reset() - { - if (fm_Type == 0) fm_Type = GetForgeMasterType(); - CheckForge(); - } - - void CheckForge() - { - if (pInstance) - { - switch(fm_Type) - { - case 1: - pInstance->SetData(EVENT_FORGE_1,m_creature->isAlive() ? NOT_STARTED : DONE); - break; - case 2: - pInstance->SetData(EVENT_FORGE_2,m_creature->isAlive() ? NOT_STARTED : DONE); - break; - case 3: - pInstance->SetData(EVENT_FORGE_3,m_creature->isAlive() ? NOT_STARTED : DONE); - break; - } - } - } - - void JustDied(Unit *killer) - { - if (fm_Type == 0) fm_Type = GetForgeMasterType(); - if (pInstance) - { - switch(fm_Type) - { - case 1: - pInstance->SetData(EVENT_FORGE_1,DONE); - break; - case 2: - pInstance->SetData(EVENT_FORGE_2,DONE); - break; - case 3: - pInstance->SetData(EVENT_FORGE_3,DONE); - break; - } - } - } - - void EnterCombat(Unit *who) - { - if (fm_Type == 0) fm_Type = GetForgeMasterType(); - if (pInstance) - { - switch(fm_Type) - { - case 1: - pInstance->SetData(EVENT_FORGE_1,IN_PROGRESS); - break; - case 2: - pInstance->SetData(EVENT_FORGE_2,IN_PROGRESS); - break; - case 3: - pInstance->SetData(EVENT_FORGE_3,IN_PROGRESS); - break; - } - } - m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE ,EMOTE_ONESHOT_NONE); - } - - uint8 GetForgeMasterType() - { - float diff = 30.0f; - int near_f = 0; - - for(uint8 i = 0; i < 3 ; ++i) - { - GameObject* temp; - temp = m_creature->FindNearestGameObject(entry_search[i],30); - if (temp) - { - if (m_creature->IsWithinDist(temp,diff,false)) - { - near_f = i + 1; - diff = m_creature->GetDistance2d(temp); - - } - } - } - - switch (near_f) - { - case 1: return 1; - case 2: return 2; - case 3: return 3; - default: return 0; - } - } - - void UpdateAI(const uint32 diff) - { - if (fm_Type == 0) - fm_Type = GetForgeMasterType(); - - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_npc_dragonflayer_forge_master(Creature* pCreature) -{ - return new npc_dragonflayer_forge_masterAI(pCreature); -} - -void AddSC_utgarde_keep() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="npc_dragonflayer_forge_master"; - newscript->GetAI = &GetAI_npc_dragonflayer_forge_master; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/boss_palehoof.cpp b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/boss_palehoof.cpp deleted file mode 100644 index 503cae94f4d..00000000000 --- a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/boss_palehoof.cpp +++ /dev/null @@ -1,78 +0,0 @@ -/* Script Data Start -SDName: Boss palehoof -SDAuthor: LordVanMartin -SD%Complete: -SDComment: -SDCategory: -Script Data End */ - -/*** SQL START *** -update creature_template set scriptname = 'boss_palehoof' where entry = ''; -*** SQL END ***/ -#include "precompiled.h" - -//Spells -#define SPELL_ARCING_SMASH 48260 -#define SPELL_IMPALE 48261 -#define SPELL_WITHERING_ROAR 48256 - -//Yell -#define SAY_AGGRO -1575000 -#define SAY_SLAY_1 -1575001 -#define SAY_SLAY_2 -1575002 -#define SAY_DEATH -1575003 - -struct TRINITY_DLL_DECL boss_palehoofAI : public ScriptedAI -{ - boss_palehoofAI(Creature *c) : ScriptedAI(c) {} - - void Reset() {} - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - void JustDied(Unit* killer) - { - DoScriptText(SAY_DEATH, m_creature); - } - void KilledUnit(Unit *victim) - { - if (victim == m_creature) - return; - - switch(rand()%2) - { - case 0: - DoScriptText(SAY_SLAY_1, m_creature); - break; - case 1: - DoScriptText(SAY_SLAY_2, m_creature); - break; - } - } -}; - -CreatureAI* GetAI_boss_palehoof(Creature* pCreature) -{ - return new boss_palehoofAI (pCreature); -} - -void AddSC_boss_palehoof() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_palehoof"; - newscript->GetAI = &GetAI_boss_palehoof; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/boss_skadi.cpp b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/boss_skadi.cpp deleted file mode 100644 index f21ae75318a..00000000000 --- a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/boss_skadi.cpp +++ /dev/null @@ -1,89 +0,0 @@ -/* Script Data Start -SDName: Boss skadi -SDAuthor: LordVanMartin -SD%Complete: -SDComment: -SDCategory: -Script Data End */ - -/*** SQL START *** -update creature_template set scriptname = 'boss_skadi' where entry = ''; -*** SQL END ***/ -#include "precompiled.h" - -//Phase 0 "gauntlet even" Skadi on a flying mount, waves of adds charging to the group periodicaly carrying harpoons -//Phase 1 Kill the Skadi drake mount with harppons launcher -//Phase 2 Kill the Skadi - -//Skadi Spells -#define SPELL_CRUSH 50234 -#define SPELL_POISONED_SPEAR 50225 -#define SPELL_WHIRLWIND 50228 //random target, but not the tank approx. every 20s - -//Yell -#define SAY_AGGRO -1575004 -#define SAY_KILL_1 -1575005 -#define SAY_KILL_2 -1575006 -#define SAY_KILL_3 -1575007 -#define SAY_DEATH -1575008 -#define SAY_DRAKE_DEATH -1575009 -#define SAY_DRAKE_HIT_1 -1575010 -#define SAY_DRAKE_HIT_2 -1575011 -#define SAY_DRAKE_BREATH_1 -1575012 -#define SAY_DRAKE_BREATH_2 -1575013 -#define SAY_DRAKE_BREATH_3 -1575014 - -struct TRINITY_DLL_DECL boss_skadiAI : public ScriptedAI -{ - boss_skadiAI(Creature *c) : ScriptedAI(c) {} - - uint32 phase; - - void Reset() {} - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - phase = 0; - - DoMeleeAttackIfReady(); - } - void JustDied(Unit* killer) - { - DoScriptText(SAY_DEATH, m_creature); - } - void KilledUnit(Unit *victim) - { - if (victim == m_creature) - return; - switch(rand()%3) - { - case 0: DoScriptText(SAY_KILL_1, m_creature);break; - case 1: DoScriptText(SAY_KILL_2, m_creature);break; - case 2: DoScriptText(SAY_KILL_3, m_creature);break; - } - } -}; - -CreatureAI* GetAI_boss_skadi(Creature* pCreature) -{ - return new boss_skadiAI (pCreature); -} - -void AddSC_boss_skadi() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_skadi"; - newscript->GetAI = &GetAI_boss_skadi; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/boss_svala.cpp b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/boss_svala.cpp deleted file mode 100644 index e43d0cd9d4d..00000000000 --- a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/boss_svala.cpp +++ /dev/null @@ -1,83 +0,0 @@ -/* Script Data Start -SDName: Boss svala -SDAuthor: LordVanMartin -SD%Complete: -SDComment: -SDCategory: -Script Data End */ - -/*** SQL START *** -update creature_template set scriptname = 'boss_svala' where entry = ''; -*** SQL END ***/ -#include "precompiled.h" - -//Spells -#define SPELL_CALL_FLAMES 48258 -#define SPELL_RITUAL_OF_THE_SWORD 48276 //Effect #1 Teleport, Effect #2 Dummy -#define SPELL_SINSTER_STRIKE 15667 - -//Yells -#define SAY_DIALOG_WITH_ARTHAS_1 -1575015 -#define SAY_DIALOG_WITH_ARTHAS_2 -1575016 -#define SAY_DIALOG_WITH_ARTHAS_3 -1575017 -#define SAY_AGGRO -1575018 -#define SAY_SLAY_1 -1575019 -#define SAY_SLAY_2 -1575020 -#define SAY_SLAY_3 -1575021 -#define SAY_DEATH -1575022 -#define SAY_SACRIFICE_PLAYER_1 -1575023 -#define SAY_SACRIFICE_PLAYER_2 -1575024 -#define SAY_SACRIFICE_PLAYER_3 -1575025 -#define SAY_SACRIFICE_PLAYER_4 -1575026 -#define SAY_SACRIFICE_PLAYER_5 -1575027 - -struct TRINITY_DLL_DECL boss_svalaAI : public ScriptedAI -{ - boss_svalaAI(Creature *c) : ScriptedAI(c) {} - - void Reset() {} - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - void JustDied(Unit* killer) - { - DoScriptText(SAY_DEATH, m_creature); - } - void KilledUnit(Unit *victim) - { - if (victim == m_creature) - return; - switch(rand()%3) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature);break; - case 1: DoScriptText(SAY_SLAY_2, m_creature);break; - case 2: DoScriptText(SAY_SLAY_3, m_creature);break; - } - } -}; - -CreatureAI* GetAI_boss_svala(Creature* pCreature) -{ - return new boss_svalaAI (pCreature); -} - -void AddSC_boss_svala() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_svala"; - newscript->GetAI = &GetAI_boss_svala; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/boss_ymiron.cpp b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/boss_ymiron.cpp deleted file mode 100644 index 43a16a78db4..00000000000 --- a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/boss_ymiron.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/* Script Data Start -SDName: Boss ymiron -SDAuthor: LordVanMartin -SD%Complete: -SDComment: -SDCategory: -Script Data End */ - -/*** SQL START *** -update creature_template set scriptname = 'boss_ymiron' where entry = ''; -*** SQL END ***/ -#include "precompiled.h" - -//Spells -#define SPELL_BANE 48294 -#define SPELL_DARK_SLASH 48292 -#define SPELL_FETID_ROT 48291 -#define SPELL_SCREAMS_OF_THE_DEAD 51750 -#define SPELL_SPIRIT_BURST 48529 -#define SPELL_SPIRIT_STRIKE 48423 -//every 20% stuns the party and runs to a boat - -//Yell -#define SAY_AGGRO -1575028 -#define SAY_SLAY_1 -1575029 -#define SAY_SLAY_2 -1575030 -#define SAY_SLAY_3 -1575031 -#define SAY_SLAY_4 -1575032 -#define SAY_DEATH -1575033 -#define SAY_SUMMON_BJORN -1575034 -#define SAY_SUMMON_HALDOR -1575035 -#define SAY_SUMMON_RANULF -1575036 -#define SAY_SUMMON_TORGYN -1575037 - -struct TRINITY_DLL_DECL boss_ymironAI : public ScriptedAI -{ - boss_ymironAI(Creature *c) : ScriptedAI(c) {} - - void Reset() {} - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - void JustDied(Unit* killer) - { - DoScriptText(SAY_DEATH, m_creature); - } - void KilledUnit(Unit *victim) - { - if (victim == m_creature) - return; - switch(rand()%4) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature);break; - case 1: DoScriptText(SAY_SLAY_2, m_creature);break; - case 2: DoScriptText(SAY_SLAY_3, m_creature);break; - case 3: DoScriptText(SAY_SLAY_4, m_creature);break; - } - } -}; - -CreatureAI* GetAI_boss_ymiron(Creature* pCreature) -{ - return new boss_ymironAI (pCreature); -} - -void AddSC_boss_ymiron() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_ymiron"; - newscript->GetAI = &GetAI_boss_ymiron; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/def_pinnacle.h b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/def_pinnacle.h deleted file mode 100644 index 82e2173fab5..00000000000 --- a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/def_pinnacle.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef DEF_PINNACLE_H -#define DEF_PINNACLE_H - -#endif diff --git a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/instance_pinnacle.cpp b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/instance_pinnacle.cpp deleted file mode 100644 index e1361c8960e..00000000000 --- a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/instance_pinnacle.cpp +++ /dev/null @@ -1,21 +0,0 @@ -#include "precompiled.h" -#include "def_pinnacle.h" - -struct TRINITY_DLL_DECL instance_pinnacle : public ScriptedInstance -{ - instance_pinnacle(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; -}; - -InstanceData* GetInstanceData_instance_pinnacle(Map* pMap) -{ - return new instance_pinnacle(pMap); -} - -void AddSC_instance_pinnacle() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_pinnacle"; - newscript->GetInstanceData = &GetInstanceData_instance_pinnacle; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/vault_of_archavon/boss_archavon.cpp b/src/bindings/scripts/scripts/zone/vault_of_archavon/boss_archavon.cpp deleted file mode 100644 index 2a0e7fcd007..00000000000 --- a/src/bindings/scripts/scripts/zone/vault_of_archavon/boss_archavon.cpp +++ /dev/null @@ -1,199 +0,0 @@ -/*** SQL START *** -UPDATE `creature_template` SET `ScriptName`='boss_archavon' WHERE `entry`='31125'; -UPDATE `creature_template` SET `ScriptName`='mob_archavon_warder' WHERE `entry`='32353'; -*** SQL END ***/ -#include "precompiled.h" -#include "def_vault_of_archavon.h" - -#define EMOTE_BERSERK -1590002 - -//Spells Archavon -#define SPELL_ROCK_SHARDS 58678 -#define SPELL_CRUSHING_LEAP HEROIC(58960,60894)//Instant (10-80yr range) -- Leaps at an enemy, inflicting 8000 Physical damage, knocking all nearby enemies away, and creating a cloud of choking debris. -#define SPELL_STOMP HEROIC(58663,60880) -#define SPELL_IMPALE HEROIC(58666,60882) //Lifts an enemy off the ground with a spiked fist, inflicting 47125 to 52875 Physical damage and 9425 to 10575 additional damage each second for 8 sec. -#define SPELL_BERSERK 47008 -//Spells Archavon Warders -#define SPELL_ROCK_SHOWER HEROIC(60919,60923) -#define SPELL_SHIELD_CRUSH HEROIC(60897,60899) -#define SPELL_WHIRL HEROIC(60902,60916) - -//4 Warders spawned -#define ARCHAVON_WARDER 32353 //npc 32353 - -//Yell -#define SAY_LEAP "Archavon the Stone Watcher lunges for $N!" //$N should be the target - -#define EVENT_ROCK_SHARDS 1 //15s cd -#define EVENT_CHOKING_CLOUD 2 //30s cd -#define EVENT_STOMP 3 //45s cd -#define EVENT_IMPALE 4 -#define EVENT_BERSERK 5 //300s cd - -//mob -#define EVENT_ROCK_SHOWER 5 //set = 20s cd,unkown cd -#define EVENT_SHIELD_CRUSH 6 //set = 30s cd -#define EVENT_WHIRL 8 //set= 10s cd - -struct TRINITY_DLL_DECL boss_archavonAI : public ScriptedAI -{ - boss_archavonAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - EventMap events; - - void Reset() - { - events.Reset(); - - if (pInstance) - pInstance->SetData(DATA_ARCHAVON_EVENT, NOT_STARTED); - } - - void KilledUnit(Unit* Victim){} - - void JustDied(Unit* Killer) - { - if (pInstance) - pInstance->SetData(DATA_ARCHAVON_EVENT, DONE); - } - - void EnterCombat(Unit *who) - { - DoZoneInCombat(); - events.ScheduleEvent(EVENT_ROCK_SHARDS, 15000); - events.ScheduleEvent(EVENT_CHOKING_CLOUD, 30000); - events.ScheduleEvent(EVENT_STOMP, 45000); - events.ScheduleEvent(EVENT_BERSERK, 300000); - - if (pInstance) - pInstance->SetData(DATA_ARCHAVON_EVENT, IN_PROGRESS); - } - - // Below UpdateAI may need review/debug. - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - events.Update(diff); - - if (me->hasUnitState(UNIT_STAT_CASTING)) - return; - - while(uint32 eventId = events.ExecuteEvent()) - { - switch(eventId) - { - case EVENT_ROCK_SHARDS: - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - DoCast(target, SPELL_ROCK_SHARDS); - events.ScheduleEvent(EVENT_ROCK_SHARDS, 15000); - return; - case EVENT_CHOKING_CLOUD: - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - DoCast(target, SPELL_CRUSHING_LEAP, true); //10y~80y, ignore range - events.ScheduleEvent(EVENT_CHOKING_CLOUD, 30000); - return; - case EVENT_STOMP: - DoCast(me->getVictim(), SPELL_STOMP); - events.ScheduleEvent(EVENT_IMPALE, 3000); - events.ScheduleEvent(EVENT_STOMP, 45000); - return; - case EVENT_IMPALE: - DoCast(me->getVictim(), SPELL_IMPALE); - return; - case EVENT_BERSERK: - DoCast(m_creature, SPELL_BERSERK); - DoScriptText(EMOTE_BERSERK, m_creature); - return; - } - } - - DoMeleeAttackIfReady(); - } -}; - -/*###### -## Mob Archavon Warder -######*/ -struct TRINITY_DLL_DECL mob_warderAI : public ScriptedAI //npc 32353 -{ - mob_warderAI(Creature *c) : ScriptedAI(c) {} - - EventMap events; - - void Reset() - { - events.Reset(); - } - - void EnterCombat(Unit *who) - { - DoZoneInCombat(); - events.ScheduleEvent(EVENT_ROCK_SHOWER, 2000); - events.ScheduleEvent(EVENT_SHIELD_CRUSH, 20000); - events.ScheduleEvent(EVENT_WHIRL, 7500); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - events.Update(diff); - - while(uint32 eventId = events.ExecuteEvent()) - { - switch(eventId) - { - case EVENT_ROCK_SHOWER: - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - DoCast(target, SPELL_ROCK_SHOWER); - events.ScheduleEvent(EVENT_ROCK_SHARDS, 6000); - return; - } - case EVENT_SHIELD_CRUSH: - DoCast(m_creature->getVictim(), SPELL_SHIELD_CRUSH); - events.ScheduleEvent(EVENT_SHIELD_CRUSH, 20000); - return; - case EVENT_WHIRL: - DoCast(m_creature->getVictim(), SPELL_WHIRL); - events.ScheduleEvent(EVENT_WHIRL, 8000); - return; - } - } - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_warder(Creature* pCreature) -{ - return new mob_warderAI (pCreature); -} - -CreatureAI* GetAI_boss_archavon(Creature* pCreature) -{ - return new boss_archavonAI (pCreature); -} - -void AddSC_boss_archavon() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_archavon"; - newscript->GetAI = &GetAI_boss_archavon; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_archavon_warder"; - newscript->GetAI = &GetAI_mob_warder; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/vault_of_archavon/boss_emalon.cpp b/src/bindings/scripts/scripts/zone/vault_of_archavon/boss_emalon.cpp deleted file mode 100644 index 94290a05007..00000000000 --- a/src/bindings/scripts/scripts/zone/vault_of_archavon/boss_emalon.cpp +++ /dev/null @@ -1,275 +0,0 @@ -#include "precompiled.h" -#include "def_vault_of_archavon.h" - -//Emalon spells -#define SPELL_CHAIN_LIGHTNING HEROIC(64213, 64215) -#define SPELL_LIGHTNING_NOVA HEROIC(64216, 65279) -#define SPELL_OVERCHARGE 64218 //Casted every 45 sec on a random Tempest Minion -#define SPELL_BERSERK 26662 - -//Tempest Minion spells -#define SPELL_SHOCK 64363 -#define SPELL_OVERCHARGED 64217 -#define SPELL_OVERCHARGED_BLAST 64219 //Casted when Overcharged reaches 10 stacks. Mob dies after that - -//Emotes -#define EMOTE_OVERCHARGE -1590000 -#define EMOTE_MINION_RESPAWN -1590001 -#define EMOTE_BERSERK -1590002 - -//Events -#define EVENT_CHAIN_LIGHTNING 1 -#define EVENT_LIGHTNING_NOVA 2 -#define EVENT_OVERCHARGE 3 -#define EVENT_BERSERK 4 -#define EVENT_SHOCK 5 - -//Creatures -#define MOB_TEMPEST_MINION 33998 - -float TempestMinions[4][5] = -{ - {33998, -203.980103, -281.287720, 91.650223, 1.598807}, - {33998, -233.489410, -281.139282, 91.652412, 1.598807}, - {33998, -233.267578, -297.104645, 91.681915, 1.598807}, - {33998, -203.842529, -297.097015, 91.745163, 1.598807} -}; - -/*###### -## Emalon the Storm Watcher -######*/ -struct TRINITY_DLL_DECL boss_emalonAI : public ScriptedAI -{ - boss_emalonAI(Creature *c) : ScriptedAI(c), summons(m_creature) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - EventMap events; - std::list MinionList; - SummonList summons; - - void Reset() - { - events.Reset(); - summons.DespawnAll(); - MinionList.clear(); - - Creature* Minion; - for (uint32 i = 0; i < 4; ++i) - { - Minion = m_creature->SummonCreature(((uint32)TempestMinions[i][0]),TempestMinions[i][1],TempestMinions[i][2],TempestMinions[i][3],TempestMinions[i][4],TEMPSUMMON_DEAD_DESPAWN, 0); - MinionList.push_back(Minion->GetGUID()); - if(Unit* target = m_creature->getVictim()) - Minion->AI()->AttackStart(target); - } - - if (pInstance) - pInstance->SetData(DATA_EMALON_EVENT, NOT_STARTED); - } - - void JustSummoned(Creature* summoned) - { - summons.Summon(summoned); - } - - void SummonedCreatureDespawn(Creature *summon) {summons.Despawn(summon);} - - void JustDied(Unit* Killer) - { - summons.DespawnAll(); - - if (pInstance) - pInstance->SetData(DATA_EMALON_EVENT, DONE); - } - - void EnterCombat(Unit *who) - { - if(!MinionList.empty()) - { - for(std::list::const_iterator itr = MinionList.begin(); itr != MinionList.end(); ++itr) - { - Creature* Minion = (Unit::GetCreature(*m_creature, *itr)); - Minion->AI()->AttackStart(who); - } - } - - DoZoneInCombat(); - events.ScheduleEvent(EVENT_CHAIN_LIGHTNING, 5000); - events.ScheduleEvent(EVENT_LIGHTNING_NOVA, 40000); - events.ScheduleEvent(EVENT_BERSERK, 360000); - events.ScheduleEvent(EVENT_OVERCHARGE, 45000); - - if (pInstance) - pInstance->SetData(DATA_EMALON_EVENT, IN_PROGRESS); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if(!UpdateVictim()) - return; - - events.Update(diff); - - if(me->hasUnitState(UNIT_STAT_CASTING)) - return; - - while(uint32 eventId = events.ExecuteEvent()) - { - switch(eventId) - { - case EVENT_CHAIN_LIGHTNING: - if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - DoCast(target, SPELL_CHAIN_LIGHTNING); - events.ScheduleEvent(EVENT_CHAIN_LIGHTNING, 25000); - return; - case EVENT_LIGHTNING_NOVA: - DoCastAOE(SPELL_LIGHTNING_NOVA, false); - events.ScheduleEvent(EVENT_LIGHTNING_NOVA, 40000); - return; - case EVENT_OVERCHARGE: - if(Creature* Minion = GetClosestCreatureWithEntry(me, MOB_TEMPEST_MINION, 1000.0f)) - { - Minion->CastSpell(me, SPELL_OVERCHARGED, true); - Minion->SetHealth(Minion->GetMaxHealth()); - DoScriptText(EMOTE_OVERCHARGE, m_creature); - } - events.ScheduleEvent(EVENT_OVERCHARGE, 45000); - return; - case EVENT_BERSERK: - DoCast(m_creature, SPELL_BERSERK); - DoScriptText(EMOTE_BERSERK, m_creature); - return; - } - } - - DoMeleeAttackIfReady(); - } -}; - -/*###### -## Tempest Minion -######*/ -struct TRINITY_DLL_DECL mob_tempest_minionAI : public ScriptedAI -{ - mob_tempest_minionAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - EmalonGUID = pInstance ? pInstance->GetData64(DATA_EMALON) : 0; - Emalon = Unit::GetCreature(*m_creature, EmalonGUID); - } - - ScriptedInstance* pInstance; - - EventMap events; - - uint64 EmalonGUID; - Creature* Emalon; - - uint32 OverchargedTimer; - - void Reset() - { - events.Reset(); - - OverchargedTimer = 0; - } - - void JustDied(Unit* Killer) - { - Creature* Emalon; - Emalon = Unit::GetCreature(*m_creature, EmalonGUID); - float x,y,z; - Emalon->GetPosition(x,y,z); - Emalon->SummonCreature(MOB_TEMPEST_MINION,x,y,z,m_creature->GetOrientation(),TEMPSUMMON_DEAD_DESPAWN,0); - DoScriptText(EMOTE_MINION_RESPAWN, m_creature); - } - - void EnterCombat(Unit *who) - { - DoZoneInCombat(); - events.ScheduleEvent(EVENT_SHOCK, 20000); - - if(Emalon) - Emalon->AI()->AttackStart(who); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if(!UpdateVictim()) - return; - - events.Update(diff); - - if(me->hasUnitState(UNIT_STAT_CASTING)) - return; - - if(Aura *OverchargedAura = m_creature->GetAura(SPELL_OVERCHARGED)) - { - if(OverchargedAura->GetStackAmount() < 10) - { - if(OverchargedTimer < diff) - { - DoCast(me, SPELL_OVERCHARGED); - OverchargedTimer = 2000; - }else OverchargedTimer -=diff; - } - else - { - if(OverchargedAura->GetStackAmount() == 10) - { - DoCast(me,SPELL_OVERCHARGED_BLAST); - m_creature->setDeathState(JUST_DIED); - Creature* Emalon; - Emalon = Unit::GetCreature(*m_creature, EmalonGUID); - float x,y,z; - Emalon->GetPosition(x,y,z); - Emalon->SummonCreature(MOB_TEMPEST_MINION,x,y,z,m_creature->GetOrientation(),TEMPSUMMON_DEAD_DESPAWN,0); - DoScriptText(EMOTE_MINION_RESPAWN, m_creature); - } - } - } - - while(uint32 eventId = events.ExecuteEvent()) - { - switch(eventId) - { - case EVENT_SHOCK: - DoCast(me->getVictim(), SPELL_SHOCK); - events.ScheduleEvent(EVENT_SHOCK, 20000); - return; - } - } - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_tempest_minion(Creature *_Creature) -{ - return new mob_tempest_minionAI (_Creature); -} - -CreatureAI* GetAI_boss_emalon(Creature *_Creature) -{ - return new boss_emalonAI (_Creature); -} - -void AddSC_boss_emalon() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_emalon"; - newscript->GetAI = &GetAI_boss_emalon; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_tempest_minion"; - newscript->GetAI = &GetAI_mob_tempest_minion; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/vault_of_archavon/def_vault_of_archavon.h b/src/bindings/scripts/scripts/zone/vault_of_archavon/def_vault_of_archavon.h deleted file mode 100644 index 95c44035184..00000000000 --- a/src/bindings/scripts/scripts/zone/vault_of_archavon/def_vault_of_archavon.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef DEF_ARCHAVON_H -#define DEF_ARCHAVON_H - -#define DATA_ARCHAVON_EVENT 1 -#define DATA_EMALON_EVENT 2 -#define DATA_EMALON 3 -#define DATA_ARCHAVON 4 -#endif diff --git a/src/bindings/scripts/scripts/zone/vault_of_archavon/instance_vault_of_archavon.cpp b/src/bindings/scripts/scripts/zone/vault_of_archavon/instance_vault_of_archavon.cpp deleted file mode 100644 index 45d0a4be7ae..00000000000 --- a/src/bindings/scripts/scripts/zone/vault_of_archavon/instance_vault_of_archavon.cpp +++ /dev/null @@ -1,124 +0,0 @@ -#include "precompiled.h" -#include "def_vault_of_archavon.h" - -#define ENCOUNTERS 2 - -/* Vault of Archavon encounters: -1 - Archavon the Stone Watcher event -2 - Emalon the Storm Watcher event -*/ - -struct TRINITY_DLL_DECL instance_archavon : public ScriptedInstance -{ - instance_archavon(Map *Map) : ScriptedInstance(Map) {Initialize();}; - - uint32 Encounters[ENCOUNTERS]; - - uint64 Archavon; - uint64 Emalon; - - void Initialize() - { - Archavon = 0; - Emalon = 0; - - for(uint8 i = 0; i < ENCOUNTERS; i++) - Encounters[i] = NOT_STARTED; - } - - bool IsEncounterInProgress() const - { - for(uint8 i = 0; i < ENCOUNTERS; i++) - if(Encounters[i] == IN_PROGRESS) return true; - - return false; - } - - void OnCreatureCreate(Creature *creature, bool add) - { - switch(creature->GetEntry()) - { - case 31125: Archavon = creature->GetGUID(); break; - case 33993: Emalon = creature->GetGUID(); break; - } - } - - uint32 GetData(uint32 type) - { - switch(type) - { - case DATA_ARCHAVON_EVENT: return Encounters[0]; - case DATA_EMALON_EVENT: return Encounters[1]; - } - return 0; - } - - uint64 GetData64(uint32 identifier) - { - switch(identifier) - { - case DATA_ARCHAVON: return Archavon; - case DATA_EMALON: return Emalon; - } - return 0; - } - - void SetData(uint32 type, uint32 data) - { - switch(type) - { - case DATA_ARCHAVON_EVENT: Encounters[0] = data; break; - case DATA_EMALON_EVENT: Encounters[1] = data; break; - } - - if(data == DONE) - SaveToDB(); - } - - std::string GetSaveData() - { - OUT_SAVE_INST_DATA; - std::ostringstream stream; - stream << Encounters[0] << " " << Encounters[1]; - char* out = new char[stream.str().length() + 1]; - strcpy(out, stream.str().c_str()); - if(out) - { - OUT_SAVE_INST_DATA_COMPLETE; - return out; - } - - return NULL; - } - - void Load(const char* in) - { - if(!in) - { - OUT_LOAD_INST_DATA_FAIL; - return; - } - - OUT_LOAD_INST_DATA(in); - std::istringstream stream(in); - stream >> Encounters[0] >> Encounters[1]; - for(uint8 i = 0; i < ENCOUNTERS; ++i) - if(Encounters[i] == IN_PROGRESS) - Encounters[i] = NOT_STARTED; - OUT_LOAD_INST_DATA_COMPLETE; - } -}; - -InstanceData* GetInstanceData_instance_archavon(Map* map) -{ - return new instance_archavon(map); -} - -void AddSC_instance_archavon() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_archavon"; - newscript->GetInstanceData = &GetInstanceData_instance_archavon; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/violet_hold/boss_cyanigosa.cpp b/src/bindings/scripts/scripts/zone/violet_hold/boss_cyanigosa.cpp deleted file mode 100644 index 13ad8c27a75..00000000000 --- a/src/bindings/scripts/scripts/zone/violet_hold/boss_cyanigosa.cpp +++ /dev/null @@ -1,82 +0,0 @@ -/* Script Data Start -SDName: Boss cyanigosa -SDAuthor: LordVanMartin -SD%Complete: -SDComment: -SDCategory: -Script Data End */ - -/*** SQL START *** -update creature_template set scriptname = '' where entry = ''; -*** SQL END ***/ -#include "precompiled.h" - -//Spells -#define SPELL_ARCANE_VACUM 58694 -#define SPELL_BLIZZARD 58693 -#define SPELL_MANA_DESTRUCTION 59374 -#define SPELL_TAIL_SWEEP 58690 -#define SPELL_UNCONTROLLABLE_ENERGY 58688 - -//Yells -#define SAY_AGGRO -1608000 -#define SAY_SLAY_1 -1608001 -#define SAY_SLAY_2 -1608002 -#define SAY_SLAY_3 -1608003 -#define SAY_DEATH -1608004 -#define SAY_SPAWN -1608005 -#define SAY_DISRUPTION -1608006 -#define SAY_BREATH_ATTACK -1608007 -#define SAY_SPECIAL_ATTACK_1 -1608008 -#define SAY_SPECIAL_ATTACK_2 -1608009 - -struct TRINITY_DLL_DECL boss_cyanigosaAI : public ScriptedAI -{ - boss_cyanigosaAI(Creature *c) : ScriptedAI(c) {} - - void Reset() {} - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - void JustDied(Unit* killer) - { - DoScriptText(SAY_DEATH, m_creature); - } - void KilledUnit(Unit *victim) - { - if (victim == m_creature) - return; - switch(rand()%3) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature);break; - case 1: DoScriptText(SAY_SLAY_2, m_creature);break; - case 2: DoScriptText(SAY_SLAY_3, m_creature);break; - } - } -}; - -CreatureAI* GetAI_boss_cyanigosa(Creature* pCreature) -{ - return new boss_cyanigosaAI (pCreature); -} - -void AddSC_boss_cyanigosa() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_cyanigosa"; - newscript->GetAI = &GetAI_boss_cyanigosa; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/violet_hold/boss_erekem.cpp b/src/bindings/scripts/scripts/zone/violet_hold/boss_erekem.cpp deleted file mode 100644 index d5f18ac806f..00000000000 --- a/src/bindings/scripts/scripts/zone/violet_hold/boss_erekem.cpp +++ /dev/null @@ -1,82 +0,0 @@ -/* Script Data Start -SDName: Boss erekem -SDAuthor: LordVanMartin -SD%Complete: -SDComment: -SDCategory: -Script Data End */ - -/*** SQL START *** -update creature_template set scriptname = '' where entry = ''; -*** SQL END ***/ -#include "precompiled.h" - -//Spells -#define SPELL_BLOODLUST 54516 -#define SPELL_BREAK_BONDS 59463 -#define SPELL_CHAIN_HEAL 54481 -#define SPELL_EARTH_SHIELD 54479 -#define SPELL_EARTH_SHOCK 54511 -#define SPELL_LIGHTNING_BOLT 53044 -#define SPELL_STORMSTRIKE 51876 - -//Yells -#define SAY_AGGRO -1608010 -#define SAY_SLAY_1 -1608011 -#define SAY_SLAY_2 -1608012 -#define SAY_SLAY_3 -1608013 -#define SAY_DEATH -1608014 -#define SAY_SPAWN -1608015 -#define SAY_ADD_KILED -1608016 -#define SAY_BOTH_ADDS_KILED -1608017 - -struct TRINITY_DLL_DECL boss_erekemAI : public ScriptedAI -{ - boss_erekemAI(Creature *c) : ScriptedAI(c) {} - - void Reset() {} - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - void JustDied(Unit* killer) - { - DoScriptText(SAY_DEATH, m_creature); - } - void KilledUnit(Unit *victim) - { - if (victim == m_creature) - return; - switch(rand()%3) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature);break; - case 1: DoScriptText(SAY_SLAY_2, m_creature);break; - case 2: DoScriptText(SAY_SLAY_3, m_creature);break; - } - } -}; - -CreatureAI* GetAI_boss_erekem(Creature* pCreature) -{ - return new boss_erekemAI (pCreature); -} - -void AddSC_boss_erekem() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_erekem"; - newscript->GetAI = &GetAI_boss_erekem; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/violet_hold/boss_ichoron.cpp b/src/bindings/scripts/scripts/zone/violet_hold/boss_ichoron.cpp deleted file mode 100644 index 60b1c656808..00000000000 --- a/src/bindings/scripts/scripts/zone/violet_hold/boss_ichoron.cpp +++ /dev/null @@ -1,81 +0,0 @@ -/* Script Data Start -SDName: Boss ichoron -SDAuthor: LordVanMartin -SD%Complete: -SDComment: -SDCategory: -Script Data End */ - -/*** SQL START *** -update creature_template set scriptname = '' where entry = ''; -*** SQL END ***/ -#include "precompiled.h" - -//Spells -#define SPELL_DRAINED 59820 -#define SPELL_FRENZY 54312 -#define SPELL_PROTECTIVE_BUBBLE 54306 -#define SPELL_WATER_BLAST 54237 -#define SPELL_WATER_BOLT_VOLLEY 54241 - -//Yells -#define SAY_AGGRO -1608018 -#define SAY_SLAY_1 -1608019 -#define SAY_SLAY_2 -1608020 -#define SAY_SLAY_3 -1608021 -#define SAY_DEATH -1608022 -#define SAY_SPAWN -1608023 -#define SAY_ENRAGE -1608024 -#define SAY_SHATTER -1608025 -#define SAY_BUBBLE -1608026 - -struct TRINITY_DLL_DECL boss_ichoronAI : public ScriptedAI -{ - boss_ichoronAI(Creature *c) : ScriptedAI(c) {} - - void Reset() {} - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - void JustDied(Unit* killer) - { - DoScriptText(SAY_DEATH, m_creature); - } - void KilledUnit(Unit *victim) - { - if (victim == m_creature) - return; - switch(rand()%3) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature);break; - case 1: DoScriptText(SAY_SLAY_2, m_creature);break; - case 2: DoScriptText(SAY_SLAY_3, m_creature);break; - } - } -}; - -CreatureAI* GetAI_boss_ichoron(Creature* pCreature) -{ - return new boss_ichoronAI (pCreature); -} - -void AddSC_boss_ichoron() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_ichoron"; - newscript->GetAI = &GetAI_boss_ichoron; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/violet_hold/boss_lavanthor.cpp b/src/bindings/scripts/scripts/zone/violet_hold/boss_lavanthor.cpp deleted file mode 100644 index 430a8acb178..00000000000 --- a/src/bindings/scripts/scripts/zone/violet_hold/boss_lavanthor.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/* Script Data Start -SDName: Boss lavanthor -SDAuthor: LordVanMartin -SD%Complete: -SDComment: -SDCategory: -Script Data End */ - -/*** SQL START *** -update creature_template set scriptname = '' where entry = ''; -*** SQL END ***/ -#include "precompiled.h" - -//Spells -#define SPELL_CAUTERIZING_FLAMES 59466 -#define SPELL_FIREBOLT 54235 -#define SPELL_FLAME_BREATH 54282 -#define SPELL_LAVA_BURN 54249 - -struct TRINITY_DLL_DECL boss_lavanthorAI : public ScriptedAI -{ - boss_lavanthorAI(Creature *c) : ScriptedAI(c) {} - - void Reset() {} - void EnterCombat(Unit* who) {} - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - void JustDied(Unit* killer) {} -}; - -CreatureAI* GetAI_boss_lavanthor(Creature* pCreature) -{ - return new boss_lavanthorAI (pCreature); -} - -void AddSC_boss_lavanthor() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_lavanthor"; - newscript->GetAI = &GetAI_boss_lavanthor; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/violet_hold/boss_moragg.cpp b/src/bindings/scripts/scripts/zone/violet_hold/boss_moragg.cpp deleted file mode 100644 index fdc18a3c549..00000000000 --- a/src/bindings/scripts/scripts/zone/violet_hold/boss_moragg.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/* Script Data Start -SDName: Boss moragg -SDAuthor: LordVanMartin -SD%Complete: -SDComment: -SDCategory: -Script Data End */ - -/*** SQL START *** -update creature_template set scriptname = '' where entry = ''; -*** SQL END ***/ -#include "precompiled.h" - -//Spells -#define SPELL_CORROSICE_SALIVA 54527 -#define SPELL_OPTIC_LINK 54396 - -struct TRINITY_DLL_DECL boss_moraggAI : public ScriptedAI -{ - boss_moraggAI(Creature *c) : ScriptedAI(c) {} - - void Reset() {} - void EnterCombat(Unit* who) {} - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - void JustDied(Unit* killer) {} -}; - -CreatureAI* GetAI_boss_moragg(Creature* pCreature) -{ - return new boss_moraggAI (pCreature); -} - -void AddSC_boss_moragg() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_moragg"; - newscript->GetAI = &GetAI_boss_moragg; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/violet_hold/boss_xevozz.cpp b/src/bindings/scripts/scripts/zone/violet_hold/boss_xevozz.cpp deleted file mode 100644 index b59c4aec4e1..00000000000 --- a/src/bindings/scripts/scripts/zone/violet_hold/boss_xevozz.cpp +++ /dev/null @@ -1,82 +0,0 @@ -/* Script Data Start -SDName: Boss xevozz -SDAuthor: LordVanMartin -SD%Complete: -SDComment: -SDCategory: -Script Data End */ - -/*** SQL START *** -update creature_template set scriptname = '' where entry = ''; -*** SQL END ***/ -#include "precompiled.h" - -//Spells -#define SPELL_ARCANE_BARRAGE_VOLLEY 54202 -#define SPELL_ARCANE_BUFFET 54226 -#define SPELL_SUMMON_ETHEREAL_SPHERE_1 54102 -#define SPELL_SUMMON_ETHEREAL_SPHERE_2 54137 -#define SPELL_SUMMON_ETHEREAL_SPHERE_3 54138 - -//Yells -#define SAY_AGGRO -1608027 -#define SAY_SLAY_1 -1608028 -#define SAY_SLAY_2 -1608029 -#define SAY_SLAY_3 -1608030 -#define SAY_DEATH -1608031 -#define SAY_SPAWN -1608032 -#define SAY_CHARGED -1608033 -#define SAY_REPEAT_SUMMON_1 -1608034 -#define SAY_REPEAT_SUMMON_2 -1608035 -#define SAY_SUMMON_ENERGY -1608036 - -struct TRINITY_DLL_DECL boss_xevozzAI : public ScriptedAI -{ - boss_xevozzAI(Creature *c) : ScriptedAI(c) {} - - void Reset() {} - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - void JustDied(Unit* killer) - { - DoScriptText(SAY_DEATH, m_creature); - } - void KilledUnit(Unit *victim) - { - if (victim == m_creature) - return; - switch(rand()%3) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature);break; - case 1: DoScriptText(SAY_SLAY_2, m_creature);break; - case 2: DoScriptText(SAY_SLAY_3, m_creature);break; - } - } -}; - -CreatureAI* GetAI_boss_xevozz(Creature* pCreature) -{ - return new boss_xevozzAI (pCreature); -} - -void AddSC_boss_xevozz() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_xevozz"; - newscript->GetAI = &GetAI_boss_xevozz; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/violet_hold/boss_zuramat.cpp b/src/bindings/scripts/scripts/zone/violet_hold/boss_zuramat.cpp deleted file mode 100644 index 218b5915bec..00000000000 --- a/src/bindings/scripts/scripts/zone/violet_hold/boss_zuramat.cpp +++ /dev/null @@ -1,82 +0,0 @@ -/* Script Data Start -SDName: Boss zuramat -SDAuthor: LordVanMartin -SD%Complete: -SDComment: -SDCategory: -Script Data End */ - -/*** SQL START *** -update creature_template set scriptname = '' where entry = ''; -*** SQL END ***/ -#include "precompiled.h" - -//Spells -#define SPELL_SHROUD_OF_DARKNESS 54524 -#define SPELL_SUMMON_VOID_SENTRY 54524 -#define SPELL_VOID_SHIFT 54524 - -#define NPC_VOID_SENTRY 29364 - -//Yells -#define SAY_AGGRO -1608037 -#define SAY_SLAY_1 -1608038 -#define SAY_SLAY_2 -1608039 -#define SAY_SLAY_3 -1608040 -#define SAY_DEATH -1608041 -#define SAY_SPAWN -1608042 -#define SAY_SHIELD -1608043 -#define SAY_WHISPER -1608044 - -struct TRINITY_DLL_DECL boss_zuramatAI : public ScriptedAI -{ - boss_zuramatAI(Creature *c) : ScriptedAI(c) {} - - uint32 void_shift; - - void Reset() {} - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - void JustDied(Unit* killer) - { - DoScriptText(SAY_DEATH, m_creature); - } - void KilledUnit(Unit *victim) - { - if (victim == m_creature) - return; - switch(rand()%3) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature);break; - case 1: DoScriptText(SAY_SLAY_2, m_creature);break; - case 2: DoScriptText(SAY_SLAY_3, m_creature);break; - } - } -}; - -CreatureAI* GetAI_boss_zuramat(Creature* pCreature) -{ - return new boss_zuramatAI (pCreature); -} - -void AddSC_boss_zuramat() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_zuramat"; - newscript->GetAI = &GetAI_boss_zuramat; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/violet_hold/def_violet_hold.h b/src/bindings/scripts/scripts/zone/violet_hold/def_violet_hold.h deleted file mode 100644 index 71bc0d18d2f..00000000000 --- a/src/bindings/scripts/scripts/zone/violet_hold/def_violet_hold.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef DEF_VIOLET_HOLD_H -#define DEF_VIOLET_HOLD_H - -#endif diff --git a/src/bindings/scripts/scripts/zone/violet_hold/instance_violet_hold.cpp b/src/bindings/scripts/scripts/zone/violet_hold/instance_violet_hold.cpp deleted file mode 100644 index 98962b919e0..00000000000 --- a/src/bindings/scripts/scripts/zone/violet_hold/instance_violet_hold.cpp +++ /dev/null @@ -1,21 +0,0 @@ -#include "precompiled.h" -#include "def_violet_hold.h" - -struct TRINITY_DLL_DECL instance_violet_hold : public ScriptedInstance -{ - instance_violet_hold(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; -}; - -InstanceData* GetInstanceData_instance_violet_hold(Map* pMap) -{ - return new instance_violet_hold(pMap); -} - -void AddSC_instance_violet_hold() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_violet_hold"; - newscript->GetInstanceData = &GetInstanceData_instance_violet_hold; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/wintergrasp/wintergrasp.cpp b/src/bindings/scripts/scripts/zone/wintergrasp/wintergrasp.cpp deleted file mode 100644 index 275043d91e5..00000000000 --- a/src/bindings/scripts/scripts/zone/wintergrasp/wintergrasp.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/* Copyright (C) 2008 - 2009 Trinity - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include "precompiled.h" -#include "Wintergrasp.h" - -bool GossipHello_npc_demolisher_engineerer(Player* pPlayer, Creature* pCreature) -{ - if (pCreature->isQuestGiver()) - pPlayer->PrepareQuestMenu(pCreature->GetGUID()); - - if (pPlayer->HasAura(SPELL_CORPORAL)) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Build catapult.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - else if (pPlayer->HasAura(SPELL_LIEUTENANT)) - { - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Build catapult.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Build demolisher.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Build siege engine.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); - } - - pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); - return true; -} - -bool GossipSelect_npc_demolisher_engineerer(Player* pPlayer, Creature* me, uint32 uiSender, uint32 uiAction) -{ - pPlayer->CLOSE_GOSSIP_MENU(); - switch(uiAction - GOSSIP_ACTION_INFO_DEF) - { - case 0: pPlayer->CastSpell(pPlayer, 56663, false, NULL, NULL, me->GetGUID()); break; - case 1: pPlayer->CastSpell(pPlayer, 56575, false, NULL, NULL, me->GetGUID()); break; - case 2: pPlayer->CastSpell(pPlayer, pPlayer->GetTeamId() ? 61408 : 56661, false, NULL, NULL, me->GetGUID()); break; - } - - return true; -} - -void AddSC_wintergrasp() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "npc_demolisher_engineerer"; - newscript->pGossipHello = &GossipHello_npc_demolisher_engineerer; - newscript->pGossipSelect = &GossipSelect_npc_demolisher_engineerer; - newscript->RegisterSelf(); -} \ No newline at end of file diff --git a/src/bindings/scripts/system/ScriptLoader.cpp b/src/bindings/scripts/system/ScriptLoader.cpp index 6f49b54a515..85221f5cb7e 100644 --- a/src/bindings/scripts/system/ScriptLoader.cpp +++ b/src/bindings/scripts/system/ScriptLoader.cpp @@ -250,58 +250,75 @@ extern void AddSC_teldrassil(); extern void AddSC_the_barrens(); extern void AddSC_thousand_needles(); extern void AddSC_thunder_bluff(); +extern void AddSC_ungoro_crater(); extern void AddSC_winterspring(); //northrend +extern void AddSC_instance_ahnkahet(); //Azjol-Nerub Ahn'kahet +extern void AddSC_boss_elder_nadox(); +extern void AddSC_boss_anubrekhan(); //Naxxramas +extern void AddSC_boss_maexxna(); +extern void AddSC_boss_patchwerk(); +extern void AddSC_boss_grobbulus(); +extern void AddSC_boss_razuvious(); +extern void AddSC_boss_kelthuzad(); +extern void AddSC_boss_loatheb(); +extern void AddSC_boss_noth(); +extern void AddSC_boss_gluth(); +extern void AddSC_boss_sapphiron(); +extern void AddSC_boss_four_horsemen(); +extern void AddSC_boss_faerlina(); +extern void AddSC_boss_heigan(); +extern void AddSC_boss_gothik(); +extern void AddSC_boss_thaddius(); +extern void AddSC_instance_naxxramas(); +extern void AddSC_boss_magus_telestra(); //The Nexus Nexus +extern void AddSC_boss_anomalus(); +extern void AddSC_boss_ormorok(); +extern void AddSC_boss_keristrasza(); +extern void AddSC_instance_nexus(); +extern void AddSC_boss_sartharion(); //Obsidian Sanctum +extern void AddSC_instance_obsidian_sanctum(); +extern void AddSC_boss_bjarngrim(); //Ulduar Halls of Lightning +extern void AddSC_boss_loken(); +extern void AddSC_instance_halls_of_lightning(); +extern void AddSC_boss_auriaya(); //Ulduar Ulduar +extern void AddSC_boss_flame_leviathan(); +extern void AddSC_boss_ignis(); +extern void AddSC_boss_razorscale(); +extern void AddSC_boss_xt002(); +//extern void AddSC_instance_ulduar(); +extern void AddSC_boss_keleseth(); //Utgarde Keep +extern void AddSC_boss_skarvald_dalronn(); +extern void AddSC_boss_ingvar_the_plunderer(); +extern void AddSC_instance_utgarde_keep(); +extern void AddSC_utgarde_keep(); +extern void AddSC_boss_archavon(); //Vault of Archavon +extern void AddSC_boss_emalon(); +extern void AddSC_instance_archavon(); + extern void AddSC_borean_tundra(); extern void AddSC_dragonblight(); extern void AddSC_grizzly_hills(); extern void AddSC_icecrown(); extern void AddSC_sholazar_basin(); +extern void AddSC_wintergrasp(); extern void AddSC_zuldrak(); //outland -extern void AddSC_blades_edge_mountains(); -extern void AddSC_boss_doomlordkazzak(); -extern void AddSC_boss_doomwalker(); -extern void AddSC_hellfire_peninsula(); -extern void AddSC_nagrand(); -extern void AddSC_netherstorm(); -extern void AddSC_shadowmoon_valley(); -extern void AddSC_shattrath_city(); -extern void AddSC_terokkar_forest(); -extern void AddSC_zangarmarsh(); - -//-------------------- -//------ ZONE -------- - -//Aunchindoun -//--Auchenai Crypts -extern void AddSC_boss_exarch_maladaar(); +extern void AddSC_boss_exarch_maladaar(); //Aunchindoun Auchenai Crypts extern void AddSC_boss_shirrak_the_dead_watcher(); -//--Mana Tombs -extern void AddSC_boss_nexusprince_shaffar(); +extern void AddSC_boss_nexusprince_shaffar(); //Aunchindoun Mana Tombs extern void AddSC_boss_pandemonius(); - -//--Sekketh Halls -extern void AddSC_boss_darkweaver_syth(); +extern void AddSC_boss_darkweaver_syth(); //Aunchindoun Sekketh Halls extern void AddSC_boss_talon_king_ikiss(); extern void AddSC_instance_sethekk_halls(); - -//--Shadow Labyrinth -extern void AddSC_instance_shadow_labyrinth(); +extern void AddSC_instance_shadow_labyrinth(); //Aunchindoun Shadow Labyrinth extern void AddSC_boss_ambassador_hellmaw(); extern void AddSC_boss_blackheart_the_inciter(); extern void AddSC_boss_grandmaster_vorpil(); extern void AddSC_boss_murmur(); - -//Azjol-Nerub -//--Ahn'kahet -extern void AddSC_instance_ahnkahet(); -extern void AddSC_boss_elder_nadox(); - -//Black Temple -extern void AddSC_black_temple(); +extern void AddSC_black_temple(); //Black Temple extern void AddSC_boss_illidan(); extern void AddSC_boss_shade_of_akama(); extern void AddSC_boss_supremus(); @@ -312,149 +329,63 @@ extern void AddSC_boss_teron_gorefiend(); extern void AddSC_boss_najentus(); extern void AddSC_boss_illidari_council(); extern void AddSC_instance_black_temple(); - -//Coilfang Resevoir -//--Serpent Shrine Cavern -extern void AddSC_boss_fathomlord_karathress(); +extern void AddSC_boss_fathomlord_karathress(); //CR Serpent Shrine Cavern extern void AddSC_boss_hydross_the_unstable(); extern void AddSC_boss_lady_vashj(); extern void AddSC_boss_leotheras_the_blind(); extern void AddSC_boss_morogrim_tidewalker(); extern void AddSC_instance_serpentshrine_cavern(); extern void AddSC_boss_the_lurker_below(); - -//--Slave Pens - -//--Steam Vault -extern void AddSC_boss_hydromancer_thespia(); +extern void AddSC_boss_hydromancer_thespia(); //CR Steam Vault extern void AddSC_boss_mekgineer_steamrigger(); extern void AddSC_boss_warlord_kalithresh(); extern void AddSC_instance_steam_vault(); - -//--Underbog -extern void AddSC_boss_hungarfen(); +extern void AddSC_boss_hungarfen(); //CR Underbog extern void AddSC_boss_the_black_stalker(); - -//Gruul's Lair -extern void AddSC_boss_gruul(); +extern void AddSC_boss_gruul(); //Gruul's Lair extern void AddSC_boss_high_king_maulgar(); extern void AddSC_instance_gruuls_lair(); - -//Hellfire Citadel -//--Blood Furnace -extern void AddSC_boss_broggok(); +extern void AddSC_boss_broggok(); //HC Blood Furnace extern void AddSC_boss_kelidan_the_breaker(); extern void AddSC_boss_the_maker(); extern void AddSC_instance_blood_furnace(); - -//--Magtheridon's Lair -extern void AddSC_boss_magtheridon(); +extern void AddSC_boss_magtheridon(); //HC Magtheridon's Lair extern void AddSC_instance_magtheridons_lair(); - -//--Shattered Halls -extern void AddSC_boss_grand_warlock_nethekurse(); +extern void AddSC_boss_grand_warlock_nethekurse(); //HC Shattered Halls extern void AddSC_boss_warbringer_omrogg(); extern void AddSC_boss_warchief_kargath_bladefist(); extern void AddSC_instance_shattered_halls(); - -//--Ramparts -extern void AddSC_boss_watchkeeper_gargolmar(); +extern void AddSC_boss_watchkeeper_gargolmar(); //HC Ramparts extern void AddSC_boss_omor_the_unscarred(); extern void AddSC_boss_vazruden_the_herald(); extern void AddSC_instance_ramparts(); - -//Naxxramas -extern void AddSC_boss_anubrekhan(); -extern void AddSC_boss_maexxna(); -extern void AddSC_boss_patchwerk(); -extern void AddSC_boss_grobbulus(); -extern void AddSC_boss_razuvious(); -extern void AddSC_boss_kelthuzad(); -extern void AddSC_boss_loatheb(); -extern void AddSC_boss_noth(); -extern void AddSC_boss_gluth(); -extern void AddSC_boss_sapphiron(); -extern void AddSC_boss_four_horsemen(); -extern void AddSC_boss_faerlina(); -extern void AddSC_boss_heigan(); -extern void AddSC_boss_gothik(); -extern void AddSC_boss_thaddius(); -extern void AddSC_instance_naxxramas(); - -//The Nexus -//Eye of Eternety - -//Nexus -extern void AddSC_boss_magus_telestra(); -extern void AddSC_boss_anomalus(); -extern void AddSC_boss_ormorok(); -extern void AddSC_boss_keristrasza(); -extern void AddSC_instance_nexus(); - -//Oculus - -//Obsidian Sanctum -extern void AddSC_boss_sartharion(); -extern void AddSC_instance_obsidian_sanctum(); - -//Tempest Keep -//--Arcatraz -extern void AddSC_arcatraz(); +extern void AddSC_arcatraz(); //TK Arcatraz extern void AddSC_boss_harbinger_skyriss(); extern void AddSC_instance_arcatraz(); - -//--Botanica -extern void AddSC_boss_high_botanist_freywinn(); +extern void AddSC_boss_high_botanist_freywinn(); //TK Botanica extern void AddSC_boss_laj(); extern void AddSC_boss_warp_splinter(); - -//--The Eye -extern void AddSC_boss_alar(); +extern void AddSC_boss_alar(); //TK The Eye extern void AddSC_boss_kaelthas(); extern void AddSC_boss_void_reaver(); extern void AddSC_boss_high_astromancer_solarian(); extern void AddSC_instance_the_eye(); extern void AddSC_the_eye(); - -//--The Mechanar -extern void AddSC_boss_gatewatcher_iron_hand(); +extern void AddSC_boss_gatewatcher_iron_hand(); //TK The Mechanar extern void AddSC_boss_nethermancer_sepethrea(); extern void AddSC_boss_pathaleon_the_calculator(); extern void AddSC_instance_mechanar(); - -//Ulduar -extern void AddSC_boss_auriaya(); -extern void AddSC_boss_flame_leviathan(); -extern void AddSC_boss_ignis(); -extern void AddSC_boss_razorscale(); -extern void AddSC_boss_xt002(); -//extern void AddSC_instance_ulduar(); - -//Un'Goro Crater -extern void AddSC_ungoro_crater(); - -//Upper blackrock spire - -//Utgarde Keep -extern void AddSC_boss_keleseth(); -extern void AddSC_boss_skarvald_dalronn(); -extern void AddSC_boss_ingvar_the_plunderer(); -extern void AddSC_instance_utgarde_keep(); -extern void AddSC_utgarde_keep(); - -//Vault of Archavon -extern void AddSC_boss_archavon(); -extern void AddSC_boss_emalon(); -extern void AddSC_instance_archavon(); - -//Halls of Lightning -extern void AddSC_boss_bjarngrim(); -extern void AddSC_boss_loken(); -extern void AddSC_instance_halls_of_lightning(); - -//Region -extern void AddSC_wintergrasp(); +extern void AddSC_blades_edge_mountains(); +extern void AddSC_boss_doomlordkazzak(); +extern void AddSC_boss_doomwalker(); +extern void AddSC_hellfire_peninsula(); +extern void AddSC_nagrand(); +extern void AddSC_netherstorm(); +extern void AddSC_shadowmoon_valley(); +extern void AddSC_shattrath_city(); +extern void AddSC_terokkar_forest(); +extern void AddSC_zangarmarsh(); void AddScripts() { @@ -704,58 +635,75 @@ void AddScripts() AddSC_the_barrens(); AddSC_thousand_needles(); AddSC_thunder_bluff(); + AddSC_ungoro_crater(); AddSC_winterspring(); //northrend + AddSC_instance_ahnkahet(); //Azjol-Nerub Ahn'kahet + AddSC_boss_elder_nadox(); + AddSC_boss_anubrekhan(); //Naxxramas + AddSC_boss_maexxna(); + AddSC_boss_patchwerk(); + AddSC_boss_grobbulus(); + AddSC_boss_razuvious(); + AddSC_boss_kelthuzad(); + AddSC_boss_loatheb(); + AddSC_boss_noth(); + AddSC_boss_gluth(); + AddSC_boss_sapphiron(); + AddSC_boss_four_horsemen(); + AddSC_boss_faerlina(); + AddSC_boss_heigan(); + AddSC_boss_gothik(); + AddSC_boss_thaddius(); + AddSC_instance_naxxramas(); + AddSC_boss_magus_telestra(); //The Nexus Nexus + AddSC_boss_anomalus(); + AddSC_boss_ormorok(); + AddSC_boss_keristrasza(); + AddSC_instance_nexus(); + AddSC_boss_sartharion(); //Obsidian Sanctum + AddSC_instance_obsidian_sanctum(); + AddSC_boss_bjarngrim(); //Ulduar Halls of Lightning + AddSC_boss_loken(); + AddSC_instance_halls_of_lightning(); + AddSC_boss_auriaya(); //Ulduar Ulduar + AddSC_boss_flame_leviathan(); + AddSC_boss_ignis(); + AddSC_boss_razorscale(); + AddSC_boss_xt002(); + //AddSC_instance_ulduar(); + AddSC_boss_keleseth(); //Utgarde Keep + AddSC_boss_skarvald_dalronn(); + AddSC_boss_ingvar_the_plunderer(); + AddSC_instance_utgarde_keep(); + AddSC_utgarde_keep(); + AddSC_boss_archavon(); //Vault of Archavon + AddSC_boss_emalon(); + AddSC_instance_archavon(); + AddSC_borean_tundra(); AddSC_dragonblight(); AddSC_grizzly_hills(); AddSC_icecrown(); AddSC_sholazar_basin(); + AddSC_wintergrasp(); AddSC_zuldrak(); //outland - AddSC_blades_edge_mountains(); - AddSC_boss_doomlordkazzak(); - AddSC_boss_doomwalker(); - AddSC_hellfire_peninsula(); - AddSC_nagrand(); - AddSC_netherstorm(); - AddSC_shadowmoon_valley(); - AddSC_shattrath_city(); - AddSC_terokkar_forest(); - AddSC_zangarmarsh(); - - //-------------------- - //------ ZONE -------- - - //Aunchindoun - //--Auchenai Crypts - AddSC_boss_exarch_maladaar(); + AddSC_boss_exarch_maladaar(); //Aunchindoun Auchenai Crypts AddSC_boss_shirrak_the_dead_watcher(); - //--Mana Tombs - AddSC_boss_nexusprince_shaffar(); + AddSC_boss_nexusprince_shaffar(); //Aunchindoun Mana Tombs AddSC_boss_pandemonius(); - - //--Sekketh Halls - AddSC_boss_darkweaver_syth(); + AddSC_boss_darkweaver_syth(); //Aunchindoun Sekketh Halls AddSC_boss_talon_king_ikiss(); AddSC_instance_sethekk_halls(); - - //--Shadow Labyrinth - AddSC_instance_shadow_labyrinth(); + AddSC_instance_shadow_labyrinth(); //Aunchindoun Shadow Labyrinth AddSC_boss_ambassador_hellmaw(); AddSC_boss_blackheart_the_inciter(); AddSC_boss_grandmaster_vorpil(); AddSC_boss_murmur(); - - //Azjol-Nerub - //--Ahn'kahet - AddSC_instance_ahnkahet(); - AddSC_boss_elder_nadox(); - - //Black Temple - AddSC_black_temple(); + AddSC_black_temple(); //Black Temple AddSC_boss_illidan(); AddSC_boss_shade_of_akama(); AddSC_boss_supremus(); @@ -766,147 +714,61 @@ void AddScripts() AddSC_boss_najentus(); AddSC_boss_illidari_council(); AddSC_instance_black_temple(); - - //Coilfang Resevoir - //--Serpent Shrine Cavern - AddSC_boss_fathomlord_karathress(); + AddSC_boss_fathomlord_karathress(); //CR Serpent Shrine Cavern AddSC_boss_hydross_the_unstable(); AddSC_boss_lady_vashj(); AddSC_boss_leotheras_the_blind(); AddSC_boss_morogrim_tidewalker(); AddSC_instance_serpentshrine_cavern(); AddSC_boss_the_lurker_below(); - - //--Slave Pens - - //--Steam Vault - AddSC_boss_hydromancer_thespia(); + AddSC_boss_hydromancer_thespia(); //CR Steam Vault AddSC_boss_mekgineer_steamrigger(); AddSC_boss_warlord_kalithresh(); AddSC_instance_steam_vault(); - - //--Underbog - AddSC_boss_hungarfen(); + AddSC_boss_hungarfen(); //CR Underbog AddSC_boss_the_black_stalker(); - - //Gruul's Lair - AddSC_boss_gruul(); + AddSC_boss_gruul(); //Gruul's Lair AddSC_boss_high_king_maulgar(); AddSC_instance_gruuls_lair(); - - //Hellfire Citadel - //--Blood Furnace - AddSC_boss_broggok(); + AddSC_boss_broggok(); //HC Blood Furnace AddSC_boss_kelidan_the_breaker(); AddSC_boss_the_maker(); AddSC_instance_blood_furnace(); - - //--Magtheridon's Lair - AddSC_boss_magtheridon(); + AddSC_boss_magtheridon(); //HC Magtheridon's Lair AddSC_instance_magtheridons_lair(); - - //--Shattered Halls - AddSC_boss_grand_warlock_nethekurse(); + AddSC_boss_grand_warlock_nethekurse(); //HC Shattered Halls AddSC_boss_warbringer_omrogg(); AddSC_boss_warchief_kargath_bladefist(); AddSC_instance_shattered_halls(); - - //--Ramparts - AddSC_boss_watchkeeper_gargolmar(); + AddSC_boss_watchkeeper_gargolmar(); //HC Ramparts AddSC_boss_omor_the_unscarred(); AddSC_boss_vazruden_the_herald(); AddSC_instance_ramparts(); - - //Naxxramas - AddSC_boss_anubrekhan(); - AddSC_boss_maexxna(); - AddSC_boss_patchwerk(); - AddSC_boss_grobbulus(); - AddSC_boss_razuvious(); - AddSC_boss_kelthuzad(); - AddSC_boss_loatheb(); - AddSC_boss_noth(); - AddSC_boss_gluth(); - AddSC_boss_sapphiron(); - AddSC_boss_four_horsemen(); - AddSC_boss_faerlina(); - AddSC_boss_heigan(); - AddSC_boss_gothik(); - AddSC_boss_thaddius(); - AddSC_instance_naxxramas(); - - //The Nexus - //Eye of Eternety - - //Nexus - AddSC_boss_magus_telestra(); - AddSC_boss_anomalus(); - AddSC_boss_ormorok(); - AddSC_boss_keristrasza(); - AddSC_instance_nexus(); - - //Oculus - - //Obsidian Sanctum - AddSC_boss_sartharion(); - AddSC_instance_obsidian_sanctum(); - - //Tempest Keep - //--Arcatraz - AddSC_arcatraz(); + AddSC_arcatraz(); //TK Arcatraz AddSC_boss_harbinger_skyriss(); AddSC_instance_arcatraz(); - - //--Botanica - AddSC_boss_high_botanist_freywinn(); + AddSC_boss_high_botanist_freywinn(); //TK Botanica AddSC_boss_laj(); AddSC_boss_warp_splinter(); - - //--The Eye - AddSC_boss_alar(); + AddSC_boss_alar(); //TK The Eye AddSC_boss_kaelthas(); AddSC_boss_void_reaver(); AddSC_boss_high_astromancer_solarian(); AddSC_instance_the_eye(); AddSC_the_eye(); - - //--The Mechanar - AddSC_boss_gatewatcher_iron_hand(); + AddSC_boss_gatewatcher_iron_hand(); //TK The Mechanar AddSC_boss_nethermancer_sepethrea(); AddSC_boss_pathaleon_the_calculator(); AddSC_instance_mechanar(); - - //Ulduar - AddSC_boss_auriaya(); - AddSC_boss_flame_leviathan(); - AddSC_boss_ignis(); - AddSC_boss_razorscale(); - AddSC_boss_xt002(); - //AddSC_instance_ulduar(); - - //Un'Goro Crater - AddSC_ungoro_crater(); - - //Upper blackrock spire - - //Utgarde Keep - AddSC_boss_keleseth(); - AddSC_boss_skarvald_dalronn(); - AddSC_boss_ingvar_the_plunderer(); - AddSC_instance_utgarde_keep(); - AddSC_utgarde_keep(); - - //Vault of Archavon - AddSC_boss_archavon(); - AddSC_boss_emalon(); - AddSC_instance_archavon(); - - //Halls of Lightning - AddSC_boss_bjarngrim(); - AddSC_boss_loken(); - AddSC_instance_halls_of_lightning(); - - //Region - AddSC_wintergrasp(); + AddSC_blades_edge_mountains(); + AddSC_boss_doomlordkazzak(); + AddSC_boss_doomwalker(); + AddSC_hellfire_peninsula(); + AddSC_nagrand(); + AddSC_netherstorm(); + AddSC_shadowmoon_valley(); + AddSC_shattrath_city(); + AddSC_terokkar_forest(); + AddSC_zangarmarsh(); } -- cgit v1.2.3 From 91f3d69edf754c4e62d973cf1ae81e9a2e36d7bc Mon Sep 17 00:00:00 2001 From: Kudlaty Date: Sun, 16 Aug 2009 21:46:31 +0200 Subject: Merge [SD2] r1314 Correct some spellId's and apply SD2 code style r1315 Correct more spells and apply SD2 code style r1316 Replace magic number with enum type name UNIT_DYNFLAG_DEAD r1317 Add support for quest 1249. Patch by jotapdiez r1318 Move AI's implementation from headers. Original patch/idea by DasBlub r1319 Convert script related to quest 938 to use followerAI r1320 Add new virtual function WaypointStart() to escortAI. --HG-- branch : trunk --- sql/FULL/world_script_waypoints.sql | 10 ++ sql/FULL/world_scripts_full.sql | 2 + sql/updates/5096_world_scripts.sql | 12 ++ src/bindings/scripts/CMakeLists.txt | 1 + src/bindings/scripts/VC80/80ScriptDev2.vcproj | 4 + src/bindings/scripts/VC90/90ScriptDev2.vcproj | 4 + src/bindings/scripts/base/escort_ai.cpp | 24 ++- src/bindings/scripts/base/escort_ai.h | 6 +- src/bindings/scripts/base/guard_ai.cpp | 5 + src/bindings/scripts/base/guard_ai.h | 4 +- src/bindings/scripts/include/sc_creature.cpp | 6 +- src/bindings/scripts/include/sc_creature.h | 2 +- .../scripts/eastern_kingdoms/dun_morogh.cpp | 2 +- .../scripts/eastern_kingdoms/elwynn_forest.cpp | 2 +- .../scholomance/boss_doctor_theolen_krastinov.cpp | 64 ++++---- .../eastern_kingdoms/scholomance/boss_vectus.cpp | 59 ++++---- .../scripts/scripts/eastern_kingdoms/wetlands.cpp | 167 +++++++++++++++++++++ .../scripts/scripts/kalimdor/teldrassil.cpp | 107 +++---------- src/bindings/scripts/scripts/outland/nagrand.cpp | 2 +- src/bindings/scripts/system/ScriptLoader.cpp | 2 + 20 files changed, 332 insertions(+), 153 deletions(-) create mode 100644 sql/updates/5096_world_scripts.sql create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/wetlands.cpp (limited to 'src/bindings/scripts/system/ScriptLoader.cpp') diff --git a/sql/FULL/world_script_waypoints.sql b/sql/FULL/world_script_waypoints.sql index e6884155154..9dfa805c30f 100644 --- a/sql/FULL/world_script_waypoints.sql +++ b/sql/FULL/world_script_waypoints.sql @@ -13,6 +13,16 @@ CREATE TABLE script_waypoint ( PRIMARY KEY (entry, pointid) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Script Creature waypoints'; +DELETE FROM script_waypoint WHERE entry=4962; +INSERT INTO script_waypoint VALUES +(4962, 0, -3804.438965, -828.048035, 10.093068, 0, ''), +(4962, 1, -3803.934326, -835.772400, 10.077722, 0, ''), +(4962, 2, -3792.629150, -835.670898, 9.655657, 0, ''), +(4962, 3, -3772.433838, -835.345947, 10.868981, 0, ''), +(4962, 4, -3765.937256, -840.128601, 10.885593, 0, ''), +(4962, 5, -3738.633789, -830.997498, 11.057384, 0, ''), +(4962, 6, -3690.224121, -862.261597, 9.960449, 0, ''); + DELETE FROM script_waypoint WHERE entry=10638; INSERT INTO script_waypoint VALUES (10638, 0, -4903.521973, -1368.339844, -52.611, 5000, 'SAY_KAN_START'), diff --git a/sql/FULL/world_scripts_full.sql b/sql/FULL/world_scripts_full.sql index af5e9af4800..88f51044f53 100644 --- a/sql/FULL/world_scripts_full.sql +++ b/sql/FULL/world_scripts_full.sql @@ -1086,6 +1086,8 @@ UPDATE `creature_template` SET `ScriptName`='npc_defias_traitor' WHERE `entry`=4 UPDATE `creature_template` SET `ScriptName`='npc_daphne_stilwell' WHERE `entry`=6182; /* WETLANDS */ +UPDATE creature_template SET ScriptName='npc_tapoke_slim_jahn' WHERE entry=4962; +UPDATE creature_template SET ScriptName='npc_mikhail' WHERE entry=4963; /* WINTERSPRING */ UPDATE `creature_template` SET `ScriptName`='npc_lorax' WHERE `entry`=10918; diff --git a/sql/updates/5096_world_scripts.sql b/sql/updates/5096_world_scripts.sql new file mode 100644 index 00000000000..37bf49f3d7d --- /dev/null +++ b/sql/updates/5096_world_scripts.sql @@ -0,0 +1,12 @@ +UPDATE creature_template SET ScriptName='npc_tapoke_slim_jahn' WHERE entry=4962; +UPDATE creature_template SET ScriptName='npc_mikhail' WHERE entry=4963; + +DELETE FROM script_waypoint WHERE entry=4962; +INSERT INTO script_waypoint VALUES +(4962, 0, -3804.438965, -828.048035, 10.093068, 0, ''), +(4962, 1, -3803.934326, -835.772400, 10.077722, 0, ''), +(4962, 2, -3792.629150, -835.670898, 9.655657, 0, ''), +(4962, 3, -3772.433838, -835.345947, 10.868981, 0, ''), +(4962, 4, -3765.937256, -840.128601, 10.885593, 0, ''), +(4962, 5, -3738.633789, -830.997498, 11.057384, 0, ''), +(4962, 6, -3690.224121, -862.261597, 9.960449, 0, ''); diff --git a/src/bindings/scripts/CMakeLists.txt b/src/bindings/scripts/CMakeLists.txt index 571dbc1b2a9..285fb004c59 100644 --- a/src/bindings/scripts/CMakeLists.txt +++ b/src/bindings/scripts/CMakeLists.txt @@ -192,6 +192,7 @@ SET(trinityscript_LIB_SRCS scripts/eastern_kingdoms/undercity.cpp scripts/eastern_kingdoms/western_plaguelands.cpp scripts/eastern_kingdoms/westfall.cpp + scripts/eastern_kingdoms/wetlands.cpp scripts/examples/example_creature.cpp scripts/examples/example_escort.cpp scripts/examples/example_gossip_codebox.cpp diff --git a/src/bindings/scripts/VC80/80ScriptDev2.vcproj b/src/bindings/scripts/VC80/80ScriptDev2.vcproj index ee1a8c87592..635f9356908 100644 --- a/src/bindings/scripts/VC80/80ScriptDev2.vcproj +++ b/src/bindings/scripts/VC80/80ScriptDev2.vcproj @@ -1162,6 +1162,10 @@ RelativePath="..\scripts\eastern_kingdoms\westfall.cpp" > + + + + GetMotionMaster()->MovePoint(CurrentWP->id, CurrentWP->x, CurrentWP->y, CurrentWP->z); - debug_log("TSCR: EscortAI Next WP is: %u, %f, %f, %f", CurrentWP->id, CurrentWP->x, CurrentWP->y, CurrentWP->z); + debug_log("TSCR: EscortAI start waypoint %u (%f, %f, %f).", CurrentWP->id, CurrentWP->x, CurrentWP->y, CurrentWP->z); + + WaypointStart(CurrentWP->id); + m_uiWPWaitTimer = 0; } } diff --git a/src/bindings/scripts/base/escort_ai.h b/src/bindings/scripts/base/escort_ai.h index 5d27aebfec6..663e11d79f6 100644 --- a/src/bindings/scripts/base/escort_ai.h +++ b/src/bindings/scripts/base/escort_ai.h @@ -28,12 +28,12 @@ struct Escort_Waypoint struct TRINITY_DLL_DECL npc_escortAI : public ScriptedAI { public: - explicit npc_escortAI(Creature* pCreature) : ScriptedAI(pCreature), - IsBeingEscorted(false), IsOnHold(false), PlayerGUID(0), MaxPlayerDistance(DEFAULT_MAX_PLAYER_DISTANCE), CanMelee(true), m_uiPlayerCheckTimer(1000), m_uiWPWaitTimer(2500), m_bIsReturning(false), m_bIsActiveAttacker(true), m_bIsRunning(false), DespawnAtEnd(true), DespawnAtFar(true), m_pQuestForEscort(NULL), m_bCanInstantRespawn(false), m_bCanReturnToStart(false), ScriptWP(false) {} + explicit npc_escortAI(Creature* pCreature); ~npc_escortAI() {} // Pure Virtual Functions - virtual void WaypointReached(uint32) = 0; + virtual void WaypointReached(uint32 uiPointId) = 0; + virtual void WaypointStart(uint32 uiPointId) {} // CreatureAI functions void AttackStart(Unit* who); diff --git a/src/bindings/scripts/base/guard_ai.cpp b/src/bindings/scripts/base/guard_ai.cpp index 7f1daa1e2df..b55eae2dbad 100644 --- a/src/bindings/scripts/base/guard_ai.cpp +++ b/src/bindings/scripts/base/guard_ai.cpp @@ -32,6 +32,11 @@ EndScriptData */ #define SAY_GUARD_SIL_AGGRO2 -1070002 #define SAY_GUARD_SIL_AGGRO3 -1070003 +guardAI::guardAI(Creature* pCreature) : ScriptedAI(pCreature), + GlobalCooldown(0), + BuffTimer(0) +{} + void guardAI::Reset() { GlobalCooldown = 0; diff --git a/src/bindings/scripts/base/guard_ai.h b/src/bindings/scripts/base/guard_ai.h index 85baa30fb9d..a7fff32e3ab 100644 --- a/src/bindings/scripts/base/guard_ai.h +++ b/src/bindings/scripts/base/guard_ai.h @@ -9,7 +9,9 @@ struct TRINITY_DLL_DECL guardAI : public ScriptedAI { - guardAI(Creature *c) : ScriptedAI(c) {} + public: + explicit guardAI(Creature* pCreature); + ~guardAI() {} uint32 GlobalCooldown; //This variable acts like the global cooldown that players have (1.5 seconds) uint32 BuffTimer; //This variable keeps track of buffs diff --git a/src/bindings/scripts/include/sc_creature.cpp b/src/bindings/scripts/include/sc_creature.cpp index 1d423574f42..aa64a6fcbf1 100644 --- a/src/bindings/scripts/include/sc_creature.cpp +++ b/src/bindings/scripts/include/sc_creature.cpp @@ -80,7 +80,11 @@ void SummonList::DespawnAll() } } -ScriptedAI::ScriptedAI(Creature* creature) : CreatureAI(creature), m_creature(creature), IsFleeing(false), m_bCombatMovement(true), m_uiEvadeCheckCooldown(2500) +ScriptedAI::ScriptedAI(Creature* pCreature) : CreatureAI(pCreature), + m_creature(pCreature), + IsFleeing(false), + m_bCombatMovement(true), + m_uiEvadeCheckCooldown(2500) { HeroicMode = m_creature->GetMap()->IsHeroic(); } diff --git a/src/bindings/scripts/include/sc_creature.h b/src/bindings/scripts/include/sc_creature.h index 6baac76a8dd..74eea9ad599 100644 --- a/src/bindings/scripts/include/sc_creature.h +++ b/src/bindings/scripts/include/sc_creature.h @@ -43,7 +43,7 @@ class SummonList : private std::list struct TRINITY_DLL_DECL ScriptedAI : public CreatureAI { - explicit ScriptedAI(Creature* creature); + explicit ScriptedAI(Creature* pCreature); ~ScriptedAI() {} //************* diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/dun_morogh.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/dun_morogh.cpp index 7e61df13575..29731ca83e3 100644 --- a/src/bindings/scripts/scripts/eastern_kingdoms/dun_morogh.cpp +++ b/src/bindings/scripts/scripts/eastern_kingdoms/dun_morogh.cpp @@ -43,7 +43,7 @@ struct TRINITY_DLL_DECL npc_narm_faulkAI : public ScriptedAI void Reset() { lifeTimer = 120000; - m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 32); + m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD); m_creature->SetStandState(UNIT_STAND_STATE_DEAD); spellHit = false; } diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/elwynn_forest.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/elwynn_forest.cpp index 67456755cd2..e44081d72ba 100644 --- a/src/bindings/scripts/scripts/eastern_kingdoms/elwynn_forest.cpp +++ b/src/bindings/scripts/scripts/eastern_kingdoms/elwynn_forest.cpp @@ -43,7 +43,7 @@ struct TRINITY_DLL_DECL npc_henze_faulkAI : public ScriptedAI void Reset() { lifeTimer = 120000; - m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 32); + m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD); m_creature->SetStandState(UNIT_STAND_STATE_DEAD); // lay down spellHit = false; } diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/scholomance/boss_doctor_theolen_krastinov.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/scholomance/boss_doctor_theolen_krastinov.cpp index badea0761e4..c4590243571 100644 --- a/src/bindings/scripts/scripts/eastern_kingdoms/scholomance/boss_doctor_theolen_krastinov.cpp +++ b/src/bindings/scripts/scripts/eastern_kingdoms/scholomance/boss_doctor_theolen_krastinov.cpp @@ -24,30 +24,33 @@ EndScriptData */ #include "precompiled.h" #include "def_scholomance.h" -#define EMOTE_GENERIC_FRENZY_KILL -1000001 +enum +{ + EMOTE_GENERIC_FRENZY_KILL = -1000001, -#define SPELL_REND 18106 -#define SPELL_CLEAVE 15584 -#define SPELL_FRENZY 28371 + SPELL_REND = 16509, + SPELL_BACKHAND = 18103, + SPELL_FRENZY = 8269 +}; struct TRINITY_DLL_DECL boss_theolenkrastinovAI : public ScriptedAI { boss_theolenkrastinovAI(Creature *c) : ScriptedAI(c) {} - uint32 Rend_Timer; - uint32 Cleave_Timer; - uint32 Frenzy_Timer; + uint32 m_uiRend_Timer; + uint32 m_uiBackhand_Timer; + uint32 m_uiFrenzy_Timer; void Reset() { - Rend_Timer = 8000; - Cleave_Timer = 9000; - Frenzy_Timer =0; + m_uiRend_Timer = 8000; + m_uiBackhand_Timer = 9000; + m_uiFrenzy_Timer = 1000; } - void JustDied(Unit *killer) + void JustDied(Unit* pKiller) { - ScriptedInstance *pInstance = (m_creature->GetInstanceData()) ? (m_creature->GetInstanceData()) : NULL; + ScriptedInstance* pInstance = (m_creature->GetInstanceData()) ? (m_creature->GetInstanceData()) : NULL; if (pInstance) { pInstance->SetData(DATA_DOCTORTHEOLENKRASTINOV_DEATH, 0); @@ -57,44 +60,47 @@ struct TRINITY_DLL_DECL boss_theolenkrastinovAI : public ScriptedAI } } - void EnterCombat(Unit *who) - { - } - - void UpdateAI(const uint32 diff) + void UpdateAI(const uint32 uiDiff) { if (!UpdateVictim()) return; //Rend_Timer - if (Rend_Timer < diff) + if (m_uiRend_Timer < uiDiff) { - DoCast(m_creature->getVictim(),SPELL_REND); - Rend_Timer = 10000; - }else Rend_Timer -= diff; + DoCast(m_creature->getVictim(), SPELL_REND); + m_uiRend_Timer = 10000; + } + else + m_uiRend_Timer -= uiDiff; - //Cleave_Timer - if (Cleave_Timer < diff) + //Backhand_Timer + if (m_uiBackhand_Timer < uiDiff) { - DoCast(m_creature->getVictim(),SPELL_CLEAVE); - Cleave_Timer = 10000; - }else Cleave_Timer -= diff; + DoCast(m_creature->getVictim(), SPELL_BACKHAND); + m_uiBackhand_Timer = 10000; + } + else + m_uiBackhand_Timer -= uiDiff; //Frenzy_Timer if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 26) { - if (Frenzy_Timer < diff) + if (m_uiFrenzy_Timer < uiDiff) { DoCast(m_creature,SPELL_FRENZY); DoScriptText(EMOTE_GENERIC_FRENZY_KILL, m_creature); - Frenzy_Timer = 8000; - }else Frenzy_Timer -= diff; + m_uiFrenzy_Timer = 120000; + } + else + m_uiFrenzy_Timer -= uiDiff; } DoMeleeAttackIfReady(); } }; + CreatureAI* GetAI_boss_theolenkrastinov(Creature* pCreature) { return new boss_theolenkrastinovAI (pCreature); diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/scholomance/boss_vectus.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/scholomance/boss_vectus.cpp index 9d343d26a7e..f12b5473abf 100644 --- a/src/bindings/scripts/scripts/eastern_kingdoms/scholomance/boss_vectus.cpp +++ b/src/bindings/scripts/scripts/eastern_kingdoms/scholomance/boss_vectus.cpp @@ -23,65 +23,72 @@ EndScriptData */ #include "precompiled.h" -#define EMOTE_GENERIC_FRENZY_KILL -1000001 +enum +{ + EMOTE_GENERIC_FRENZY_KILL = -1000001, -#define SPELL_FIRESHIELD 19626 -#define SPELL_BLASTWAVE 13021 -#define SPELL_FRENZY 28371 + SPELL_FLAMESTRIKE = 18399, + SPELL_BLAST_WAVE = 16046, + SPELL_FIRESHIELD = 19626, + SPELL_FRENZY = 8269 //28371, +}; struct TRINITY_DLL_DECL boss_vectusAI : public ScriptedAI { boss_vectusAI(Creature *c) : ScriptedAI(c) {} - uint32 FireShield_Timer; - uint32 BlastWave_Timer; - uint32 Frenzy_Timer; + uint32 m_uiFireShield_Timer; + uint32 m_uiBlastWave_Timer; + uint32 m_uiFrenzy_Timer; void Reset() { - FireShield_Timer = 2000; - BlastWave_Timer = 14000; - Frenzy_Timer = 0; - } - - void EnterCombat(Unit *who) - { + m_uiFireShield_Timer = 2000; + m_uiBlastWave_Timer = 14000; + m_uiFrenzy_Timer = 0; } - void UpdateAI(const uint32 diff) + void UpdateAI(const uint32 uiDiff) { if (!UpdateVictim()) return; //FireShield_Timer - if (FireShield_Timer < diff) + if (m_uiFireShield_Timer < uiDiff) { DoCast(m_creature, SPELL_FIRESHIELD); - FireShield_Timer = 90000; - }else FireShield_Timer -= diff; + m_uiFireShield_Timer = 90000; + } + else + m_uiFireShield_Timer -= uiDiff; //BlastWave_Timer - if (BlastWave_Timer < diff) + if (m_uiBlastWave_Timer < uiDiff) { - DoCast(m_creature->getVictim(),SPELL_BLASTWAVE); - BlastWave_Timer = 12000; - }else BlastWave_Timer -= diff; + DoCast(m_creature->getVictim(), SPELL_BLAST_WAVE); + m_uiBlastWave_Timer = 12000; + } + else + m_uiBlastWave_Timer -= uiDiff; //Frenzy_Timer if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 25) { - if (Frenzy_Timer < diff) + if (m_uiFrenzy_Timer < uiDiff) { - DoCast(m_creature,SPELL_FRENZY); + DoCast(m_creature, SPELL_FRENZY); DoScriptText(EMOTE_GENERIC_FRENZY_KILL, m_creature); - Frenzy_Timer = 24000; - }else Frenzy_Timer -= diff; + m_uiFrenzy_Timer = 24000; + } + else + m_uiFrenzy_Timer -= uiDiff; } DoMeleeAttackIfReady(); } }; + CreatureAI* GetAI_boss_vectus(Creature* pCreature) { return new boss_vectusAI (pCreature); diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/wetlands.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/wetlands.cpp new file mode 100644 index 00000000000..4a9d944cb3e --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/wetlands.cpp @@ -0,0 +1,167 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Wetlands +SD%Complete: 80 +SDComment: Quest support: 1249 +SDCategory: Wetlands +EndScriptData */ + +/* ContentData +npc_mikhail +npc_tapoke_slim_jahn +EndContentData */ + +#include "precompiled.h" +#include "escort_ai.h" + +/*###### +## npc_tapoke_slim_jahn +######*/ + +enum +{ + QUEST_MISSING_DIPLO_PT11 = 1249, + FACTION_ENEMY = 168, + SPELL_STEALTH = 1785, + NPC_SLIMS_FRIEND = 4971, + NPC_TAPOKE_SLIM_JAHN = 4962 +}; + +struct TRINITY_DLL_DECL npc_tapoke_slim_jahnAI : public npc_escortAI +{ + npc_tapoke_slim_jahnAI(Creature* pCreature) : npc_escortAI(pCreature) { } + + bool m_bFriendSummoned; + + void Reset() + { + if (!IsBeingEscorted) + m_bFriendSummoned = false; + } + + void WaypointReached(uint32 uiPointId) + { + switch(uiPointId) + { + case 2: + if (m_creature->HasStealthAura()) + m_creature->RemoveAurasDueToSpell(SPELL_AURA_MOD_STEALTH); + + SetRun(); + m_creature->setFaction(FACTION_ENEMY); + break; + } + } + + void Aggro(Unit* pWho) + { + Unit* pPlayer = Unit::GetUnit(*m_creature, PlayerGUID); + + if (IsBeingEscorted && !m_bFriendSummoned && pPlayer) + { + m_creature->SummonCreature(NPC_SLIMS_FRIEND, 0.0f, 0.0f, 0.0f, 3.10f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30000); + m_creature->SummonCreature(NPC_SLIMS_FRIEND, 0.0f, 0.0f, 0.0f, 2.35f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30000); + m_creature->SummonCreature(NPC_SLIMS_FRIEND, 0.0f, 0.0f, 0.0f, 2.02f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30000); + m_bFriendSummoned = true; + } + } + + void JustSummoned(Creature* pSummoned) + { + if (Unit* pPlayer = Unit::GetPlayer(PlayerGUID)) + pSummoned->AI()->AttackStart(pPlayer); + } + + void AttackedBy(Unit* pAttacker) + { + if (m_creature->getVictim()) + return; + + if (m_creature->IsFriendlyTo(pAttacker)) + return; + + AttackStart(pAttacker); + } + + void DamageTaken(Unit* pDoneBy, uint32& uiDamage) + { + if (m_creature->GetHealth()*100 < m_creature->GetMaxHealth()*20) + { + if (Unit* pPlayer = Unit::GetUnit(*m_creature, PlayerGUID)) + { + if (pPlayer->GetTypeId() == TYPEID_PLAYER) + CAST_PLR(pPlayer)->GroupEventHappens(QUEST_MISSING_DIPLO_PT11, m_creature); + + uiDamage = 0; + + me->RestoreFaction(); + m_creature->RemoveAllAuras(); + m_creature->DeleteThreatList(); + m_creature->CombatStop(true); + + SetRun(false); + } + } + } +}; + +CreatureAI* GetAI_npc_tapoke_slim_jahn(Creature* pCreature) +{ + return new npc_tapoke_slim_jahnAI(pCreature); +} + +/*###### +## npc_mikhail +######*/ + +bool QuestAccept_npc_mikhail(Player* pPlayer, Creature* pCreature, const Quest* pQuest) +{ + if (pQuest->GetQuestId() == QUEST_MISSING_DIPLO_PT11) + { + Creature* pSlim = pCreature->FindNearestCreature(NPC_TAPOKE_SLIM_JAHN, 25.0f); + + if (!pSlim) + return false; + + if (!pSlim->HasStealthAura()) + pSlim->CastSpell(pSlim, SPELL_STEALTH, true); + + if (npc_tapoke_slim_jahnAI* pEscortAI = CAST_AI(npc_tapoke_slim_jahnAI, pSlim->AI())) + pEscortAI->Start(false, false, pPlayer->GetGUID(), pQuest); + } + return false; +} + +/*###### +## AddSC +######*/ + +void AddSC_wetlands() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "npc_tapoke_slim_jahn"; + newscript->GetAI = &GetAI_npc_tapoke_slim_jahn; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_mikhail"; + newscript->pQuestAccept = &QuestAccept_npc_mikhail; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/kalimdor/teldrassil.cpp b/src/bindings/scripts/scripts/kalimdor/teldrassil.cpp index 58cb2a55b2f..40e849fbbe6 100644 --- a/src/bindings/scripts/scripts/kalimdor/teldrassil.cpp +++ b/src/bindings/scripts/scripts/kalimdor/teldrassil.cpp @@ -26,6 +26,7 @@ npc_mist EndContentData */ #include "precompiled.h" +#include "follower_ai.h" /*#### # npc_mist @@ -37,31 +38,20 @@ enum EMOTE_AT_HOME = -1000412, QUEST_MIST = 938, NPC_ARYNIA = 3519, + FACTION_DARNASSUS = 79 }; -struct TRINITY_DLL_DECL npc_mistAI : public ScriptedAI +struct TRINITY_DLL_DECL npc_mistAI : public FollowerAI { - npc_mistAI(Creature *c) : ScriptedAI(c) - { - uiNpcFlags = c->GetUInt32Value(UNIT_NPC_FLAGS); - uiPlayerGUID = 0; - } - - uint64 uiPlayerGUID; - uint32 uiNpcFlags; - uint32 uiCheckPlayerTimer; - - void Reset() - { - uiCheckPlayerTimer = 2500; + npc_mistAI(Creature* pCreature) : FollowerAI(pCreature) { } - if (!uiPlayerGUID) - m_creature->SetUInt32Value(UNIT_NPC_FLAGS, uiNpcFlags); - } + void Reset() { } void MoveInLineOfSight(Unit *pWho) { - if (pWho->GetEntry() == NPC_ARYNIA) + FollowerAI::MoveInLineOfSight(pWho); + + if (!m_creature->getVictim() && !IsFollowComplete() && pWho->GetEntry() == NPC_ARYNIA) { if (m_creature->IsWithinDistInMap(pWho, 10.0f)) { @@ -71,43 +61,11 @@ struct TRINITY_DLL_DECL npc_mistAI : public ScriptedAI } } - void EnterEvadeMode() - { - m_creature->RemoveAllAuras(); - m_creature->DeleteThreatList(); - m_creature->CombatStop(true); - m_creature->LoadCreaturesAddon(); - - if (m_creature->isAlive()) - { - if (Player* pPlayer = Unit::GetPlayer(uiPlayerGUID)) - m_creature->GetMotionMaster()->MoveFollow(pPlayer, PET_FOLLOW_DIST, m_creature->GetFollowAngle()); - else - { - m_creature->GetMotionMaster()->MovementExpired(); - m_creature->GetMotionMaster()->MoveTargetedHome(); - } - } - - m_creature->SetLootRecipient(NULL); - - Reset(); - } - - void DoStart(uint64 uiPlayer) - { - uiPlayerGUID = uiPlayer; - m_creature->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE); - - if (Player* pPlayer = Unit::GetPlayer(uiPlayer)) - m_creature->GetMotionMaster()->MoveFollow(pPlayer, PET_FOLLOW_DIST, m_creature->GetFollowAngle()); - } - void DoComplete() { DoScriptText(EMOTE_AT_HOME, m_creature); - if (Player* pPlayer = Unit::GetPlayer(uiPlayerGUID)) + if (Player* pPlayer = GetLeaderForFollower()) { if (pPlayer->GetQuestStatus(QUEST_MIST) == QUEST_STATUS_INCOMPLETE) { @@ -115,55 +73,25 @@ struct TRINITY_DLL_DECL npc_mistAI : public ScriptedAI if (uiQuestLogSlot < MAX_QUEST_LOG_SIZE) { + //This will be wrong, need to check all group members (if any) for state before event if (pPlayer->GetQuestSlotState(uiQuestLogSlot) != QUEST_STATE_FAIL) pPlayer->AreaExploredOrEventHappens(QUEST_MIST); } } } - uiPlayerGUID = 0; - EnterEvadeMode(); - } - - void EnterCombat(Unit* who) { } - - void JustDied(Unit* pKiller) - { - if (Player* pPlayer = Unit::GetPlayer(uiPlayerGUID)) - pPlayer->FailQuest(QUEST_MIST); - - uiPlayerGUID = 0; - m_creature->GetMotionMaster()->MovementExpired(); + //The follow is over (and for later development to indicate a post event can now run) + SetFollowComplete(); } - void UpdateAI(const uint32 diff) + //call not needed here, no known abilities + /*void UpdateFollowerAI(const uint32 uiDiff) { - if (uiPlayerGUID) - { - if (!m_creature->isInCombat()) - { - if (uiCheckPlayerTimer < diff) - { - uiCheckPlayerTimer = 5000; - - Player* pPlayer = Unit::GetPlayer(uiPlayerGUID); - - if (pPlayer && !pPlayer->isAlive()) - { - uiPlayerGUID = 0; - EnterEvadeMode(); - } - } - else - uiCheckPlayerTimer -= diff; - } - } - if (!UpdateVictim()) return; DoMeleeAttackIfReady(); - } + }*/ }; CreatureAI* GetAI_npc_mist(Creature* pCreature) @@ -174,7 +102,10 @@ CreatureAI* GetAI_npc_mist(Creature* pCreature) bool QuestAccept_npc_mist(Player* pPlayer, Creature* pCreature, Quest const* pQuest) { if (pQuest->GetQuestId() == QUEST_MIST) - CAST_AI(npc_mistAI, (pCreature->AI()))->DoStart(pPlayer->GetGUID()); + { + if (npc_mistAI* pMistAI = CAST_AI(npc_mistAI, pCreature->AI())) + pMistAI->StartFollow(pPlayer, FACTION_DARNASSUS, pQuest); + } return true; } diff --git a/src/bindings/scripts/scripts/outland/nagrand.cpp b/src/bindings/scripts/scripts/outland/nagrand.cpp index 09435b91efe..865fc24f922 100644 --- a/src/bindings/scripts/scripts/outland/nagrand.cpp +++ b/src/bindings/scripts/scripts/outland/nagrand.cpp @@ -237,7 +237,7 @@ struct TRINITY_DLL_DECL mob_sunspring_villagerAI : public ScriptedAI void Reset() { - m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 32); + m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD); m_creature->SetStandState(UNIT_STAND_STATE_DEAD); } diff --git a/src/bindings/scripts/system/ScriptLoader.cpp b/src/bindings/scripts/system/ScriptLoader.cpp index 85221f5cb7e..024fbe7b7a1 100644 --- a/src/bindings/scripts/system/ScriptLoader.cpp +++ b/src/bindings/scripts/system/ScriptLoader.cpp @@ -188,6 +188,7 @@ extern void AddSC_tirisfal_glades(); extern void AddSC_undercity(); extern void AddSC_western_plaguelands(); extern void AddSC_westfall(); +extern void AddSC_wetlands(); //kalimdor extern void AddSC_instance_blackfathom_deeps(); //Blackfathom Depths @@ -573,6 +574,7 @@ void AddScripts() AddSC_undercity(); AddSC_western_plaguelands(); AddSC_westfall(); + AddSC_wetlands(); //kalimdor AddSC_instance_blackfathom_deeps(); //Blackfathom Depths -- cgit v1.2.3 From 5d2d8d8074eb7f845627fcc97645c8d0081be2ba Mon Sep 17 00:00:00 2001 From: Kudlaty Date: Sun, 16 Aug 2009 22:21:57 +0200 Subject: Merge [SD2] r1321 Add support for quest 863. Some cleanup in existing script. r1322 Correct database info for current supported Mangos revision (8273+) (Windows may use from 8190+) - skip r1323 Make escortAI function IsPlayerOrGroupInRange and move existing code to this. r1324 Fixed IsEncounterInProgress for Arcatraz, The Eye and Shadow Labyrinth r1325 Renamed aunchindoun to auchindoun. Fixed comment typos. --HG-- branch : trunk --- sql/FULL/world_script_waypoints.sql | 68 ++++ sql/FULL/world_scripts_full.sql | 1 + sql/updates/5097_world_scripts.sql | 69 ++++ src/bindings/scripts/CMakeLists.txt | 28 +- src/bindings/scripts/VC80/80ScriptDev2.vcproj | 28 +- src/bindings/scripts/VC90/90ScriptDev2.vcproj | 28 +- src/bindings/scripts/base/escort_ai.cpp | 52 +-- src/bindings/scripts/base/escort_ai.h | 2 + .../scripts/eastern_kingdoms/hinterlands.cpp | 168 ++++++-- .../auchenai_crypts/boss_exarch_maladaar.cpp | 358 +++++++++++++++++ .../boss_shirrak_the_dead_watcher.cpp | 212 ++++++++++ .../mana_tombs/boss_nexusprince_shaffar.cpp | 369 +++++++++++++++++ .../auchindoun/mana_tombs/boss_pandemonius.cpp | 138 +++++++ .../sethekk_halls/boss_darkweaver_syth.cpp | 438 +++++++++++++++++++++ .../sethekk_halls/boss_tailonking_ikiss.cpp | 221 +++++++++++ .../auchindoun/sethekk_halls/def_sethekk_halls.h | 14 + .../sethekk_halls/instance_sethekk_halls.cpp | 91 +++++ .../shadow_labyrinth/boss_ambassador_hellmaw.cpp | 217 ++++++++++ .../boss_blackheart_the_inciter.cpp | 177 +++++++++ .../shadow_labyrinth/boss_grandmaster_vorpil.cpp | 321 +++++++++++++++ .../auchindoun/shadow_labyrinth/boss_murmur.cpp | 207 ++++++++++ .../shadow_labyrinth/def_shadow_labyrinth.h | 15 + .../shadow_labyrinth/instance_shadow_labyrinth.cpp | 227 +++++++++++ .../auchenai_crypts/boss_exarch_maladaar.cpp | 358 ----------------- .../boss_shirrak_the_dead_watcher.cpp | 212 ---------- .../mana_tombs/boss_nexusprince_shaffar.cpp | 369 ----------------- .../aunchindoun/mana_tombs/boss_pandemonius.cpp | 138 ------- .../sethekk_halls/boss_darkweaver_syth.cpp | 438 --------------------- .../sethekk_halls/boss_tailonking_ikiss.cpp | 221 ----------- .../aunchindoun/sethekk_halls/def_sethekk_halls.h | 14 - .../sethekk_halls/instance_sethekk_halls.cpp | 91 ----- .../shadow_labyrinth/boss_ambassador_hellmaw.cpp | 217 ---------- .../boss_blackheart_the_inciter.cpp | 177 --------- .../shadow_labyrinth/boss_grandmaster_vorpil.cpp | 321 --------------- .../aunchindoun/shadow_labyrinth/boss_murmur.cpp | 207 ---------- .../shadow_labyrinth/def_shadow_labyrinth.h | 15 - .../shadow_labyrinth/instance_shadow_labyrinth.cpp | 227 ----------- .../tempest_keep/arcatraz/instance_arcatraz.cpp | 3 +- src/bindings/scripts/system/ScriptLoader.cpp | 16 +- 39 files changed, 3367 insertions(+), 3106 deletions(-) create mode 100644 sql/updates/5097_world_scripts.sql create mode 100644 src/bindings/scripts/scripts/outland/auchindoun/auchenai_crypts/boss_exarch_maladaar.cpp create mode 100644 src/bindings/scripts/scripts/outland/auchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp create mode 100644 src/bindings/scripts/scripts/outland/auchindoun/mana_tombs/boss_nexusprince_shaffar.cpp create mode 100644 src/bindings/scripts/scripts/outland/auchindoun/mana_tombs/boss_pandemonius.cpp create mode 100644 src/bindings/scripts/scripts/outland/auchindoun/sethekk_halls/boss_darkweaver_syth.cpp create mode 100644 src/bindings/scripts/scripts/outland/auchindoun/sethekk_halls/boss_tailonking_ikiss.cpp create mode 100644 src/bindings/scripts/scripts/outland/auchindoun/sethekk_halls/def_sethekk_halls.h create mode 100644 src/bindings/scripts/scripts/outland/auchindoun/sethekk_halls/instance_sethekk_halls.cpp create mode 100644 src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp create mode 100644 src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp create mode 100644 src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp create mode 100644 src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/boss_murmur.cpp create mode 100644 src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/def_shadow_labyrinth.h create mode 100644 src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp delete mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/auchenai_crypts/boss_exarch_maladaar.cpp delete mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp delete mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp delete mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/mana_tombs/boss_pandemonius.cpp delete mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/boss_darkweaver_syth.cpp delete mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/boss_tailonking_ikiss.cpp delete mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/def_sethekk_halls.h delete mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/instance_sethekk_halls.cpp delete mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp delete mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp delete mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp delete mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_murmur.cpp delete mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/def_shadow_labyrinth.h delete mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp (limited to 'src/bindings/scripts/system/ScriptLoader.cpp') diff --git a/sql/FULL/world_script_waypoints.sql b/sql/FULL/world_script_waypoints.sql index 9dfa805c30f..86aee4a71ac 100644 --- a/sql/FULL/world_script_waypoints.sql +++ b/sql/FULL/world_script_waypoints.sql @@ -13,6 +13,74 @@ CREATE TABLE script_waypoint ( PRIMARY KEY (entry, pointid) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Script Creature waypoints'; +DELETE FROM script_waypoint WHERE entry=7806; +INSERT INTO script_waypoint VALUES +(7806, 0, 495.404358, -3478.350830, 114.837, 0, ''), +(7806, 1, 492.704742, -3486.112549, 108.627, 0, ''), +(7806, 2, 487.249756, -3485.764404, 107.890, 0, ''), +(7806, 3, 476.851959, -3489.875977, 99.985, 0, ''), +(7806, 4, 467.212402, -3493.355469, 99.819, 0, ''), +(7806, 5, 460.017029, -3496.984375, 104.481, 0, ''), +(7806, 6, 439.619446, -3500.730225, 110.534, 0, ''), +(7806, 7, 428.326385, -3495.874756, 118.662, 0, ''), +(7806, 8, 424.664032, -3489.381592, 121.999, 0, ''), +(7806, 9, 424.137299, -3470.952637, 124.333, 0, ''), +(7806, 10, 421.791107, -3449.242676, 119.126, 0, ''), +(7806, 11, 404.247070, -3429.376953, 117.644, 0, ''), +(7806, 12, 335.465271, -3430.717773, 116.456, 0, ''), +(7806, 13, 317.160126, -3426.708984, 116.226, 0, ''), +(7806, 14, 331.180115, -3464.002197, 117.143, 0, ''), +(7806, 15, 336.393616, -3501.877441, 118.201, 0, ''), +(7806, 16, 337.251312, -3544.764648, 117.284, 0, ''), +(7806, 17, 337.748932, -3565.415527, 116.797, 0, ''), +(7806, 18, 336.010925, -3597.363037, 118.225, 0, ''), +(7806, 19, 324.619141, -3622.884033, 119.811, 0, ''), +(7806, 20, 308.027466, -3648.600098, 123.047, 0, ''), +(7806, 21, 276.325409, -3685.738525, 128.356, 0, ''), +(7806, 22, 239.981064, -3717.330811, 131.874, 0, ''), +(7806, 23, 224.950974, -3730.169678, 132.125, 0, ''), +(7806, 24, 198.707870, -3768.292725, 129.420, 0, ''), +(7806, 25, 183.758316, -3791.068848, 128.045, 0, ''), +(7806, 26, 178.110657, -3801.575439, 128.370, 3000, 'SAY_OOX_DANGER'), +(7806, 27, 162.215225, -3827.014160, 129.424, 0, ''), +(7806, 28, 141.664734, -3864.519287, 131.419, 0, ''), +(7806, 29, 135.301697, -3880.089111, 132.120, 0, ''), +(7806, 30, 122.461151, -3910.071533, 135.605, 0, ''), +(7806, 31, 103.376175, -3937.725098, 137.342, 0, ''), +(7806, 32, 81.414474, -3958.614258, 138.469, 0, ''), +(7806, 33, 55.378139, -3982.004639, 136.520, 0, ''), +(7806, 34, 13.983131, -4013.952881, 126.903, 0, ''), +(7806, 35, -21.658007, -4048.713623, 118.068, 0, ''), +(7806, 36, -52.443058, -4081.209717, 117.477, 0, ''), +(7806, 37, -102.710854, -4116.760742, 118.666, 0, ''), +(7806, 38, -92.996193, -4135.847168, 119.310, 0, ''), +(7806, 39, -86.391273, -4153.331055, 122.502, 0, ''), +(7806, 40, -85.746086, -4163.600586, 121.892, 0, ''), +(7806, 41, -90.544006, -4183.577637, 117.587, 0, ''), +(7806, 42, -110.223564, -4205.861328, 121.878, 0, ''), +(7806, 43, -115.257607, -4211.962402, 121.878, 3000, 'SAY_OOX_DANGER'), +(7806, 44, -128.594650, -4233.343750, 117.766, 0, ''), +(7806, 45, -135.358917, -4258.120117, 117.562, 0, ''), +(7806, 46, -156.832428, -4258.961914, 120.059, 0, ''), +(7806, 47, -167.119873, -4274.102539, 117.062, 0, ''), +(7806, 48, -176.291016, -4287.594727, 118.721, 0, ''), +(7806, 49, -196.992981, -4315.815430, 117.588, 0, ''), +(7806, 50, -209.329300, -4331.671387, 115.142, 0, ''), +(7806, 51, -232.292236, -4356.015625, 108.543, 0, ''), +(7806, 52, -232.159683, -4370.904297, 102.815, 0, ''), +(7806, 53, -210.271133, -4389.896973, 84.167, 0, ''), +(7806, 54, -187.940186, -4407.532715, 70.987, 0, ''), +(7806, 55, -181.353577, -4418.771973, 64.778, 0, ''), +(7806, 56, -170.529861, -4440.438965, 58.943, 0, ''), +(7806, 57, -141.428543, -4465.323242, 45.963, 0, ''), +(7806, 58, -120.993629, -4487.088379, 32.075, 0, ''), +(7806, 59, -104.134621, -4501.837402, 25.051, 0, ''), +(7806, 60, -84.154663, -4529.436523, 11.952, 0, ''), +(7806, 61, -88.698898, -4544.626465, 9.055, 0, ''), +(7806, 62, -100.603447, -4575.034180, 11.388, 0, ''), +(7806, 63, -106.908669, -4600.407715, 11.046, 0, ''), +(7806, 64, -106.831703, -4620.503418, 11.057, 3000, 'SAY_OOX_COMPLETE'); + DELETE FROM script_waypoint WHERE entry=4962; INSERT INTO script_waypoint VALUES (4962, 0, -3804.438965, -828.048035, 10.093068, 0, ''), diff --git a/sql/FULL/world_scripts_full.sql b/sql/FULL/world_scripts_full.sql index 88f51044f53..ae503cd4e47 100644 --- a/sql/FULL/world_scripts_full.sql +++ b/sql/FULL/world_scripts_full.sql @@ -555,6 +555,7 @@ UPDATE `creature_template` SET `ScriptName`='npc_tracy_proudwell' WHERE `entry`= /* HILLSBRAD FOOTHILLS */ /* HINTERLANDS */ +UPDATE `creature_template` SET `ScriptName`='npc_00x09hl' WHERE `entry`=7806; UPDATE `creature_template` SET `ScriptName`='npc_rinji' WHERE `entry`=7780; /* ICECROWN */ diff --git a/sql/updates/5097_world_scripts.sql b/sql/updates/5097_world_scripts.sql new file mode 100644 index 00000000000..6a4f6f8cd61 --- /dev/null +++ b/sql/updates/5097_world_scripts.sql @@ -0,0 +1,69 @@ +UPDATE creature_template SET ScriptName='npc_00x09hl' WHERE entry=7806; + +DELETE FROM script_waypoint WHERE entry=7806; +INSERT INTO script_waypoint VALUES +(7806, 0, 495.404358, -3478.350830, 114.837, 0, ''), +(7806, 1, 492.704742, -3486.112549, 108.627, 0, ''), +(7806, 2, 487.249756, -3485.764404, 107.890, 0, ''), +(7806, 3, 476.851959, -3489.875977, 99.985, 0, ''), +(7806, 4, 467.212402, -3493.355469, 99.819, 0, ''), +(7806, 5, 460.017029, -3496.984375, 104.481, 0, ''), +(7806, 6, 439.619446, -3500.730225, 110.534, 0, ''), +(7806, 7, 428.326385, -3495.874756, 118.662, 0, ''), +(7806, 8, 424.664032, -3489.381592, 121.999, 0, ''), +(7806, 9, 424.137299, -3470.952637, 124.333, 0, ''), +(7806, 10, 421.791107, -3449.242676, 119.126, 0, ''), +(7806, 11, 404.247070, -3429.376953, 117.644, 0, ''), +(7806, 12, 335.465271, -3430.717773, 116.456, 0, ''), +(7806, 13, 317.160126, -3426.708984, 116.226, 0, ''), +(7806, 14, 331.180115, -3464.002197, 117.143, 0, ''), +(7806, 15, 336.393616, -3501.877441, 118.201, 0, ''), +(7806, 16, 337.251312, -3544.764648, 117.284, 0, ''), +(7806, 17, 337.748932, -3565.415527, 116.797, 0, ''), +(7806, 18, 336.010925, -3597.363037, 118.225, 0, ''), +(7806, 19, 324.619141, -3622.884033, 119.811, 0, ''), +(7806, 20, 308.027466, -3648.600098, 123.047, 0, ''), +(7806, 21, 276.325409, -3685.738525, 128.356, 0, ''), +(7806, 22, 239.981064, -3717.330811, 131.874, 0, ''), +(7806, 23, 224.950974, -3730.169678, 132.125, 0, ''), +(7806, 24, 198.707870, -3768.292725, 129.420, 0, ''), +(7806, 25, 183.758316, -3791.068848, 128.045, 0, ''), +(7806, 26, 178.110657, -3801.575439, 128.370, 3000, 'SAY_OOX_DANGER'), +(7806, 27, 162.215225, -3827.014160, 129.424, 0, ''), +(7806, 28, 141.664734, -3864.519287, 131.419, 0, ''), +(7806, 29, 135.301697, -3880.089111, 132.120, 0, ''), +(7806, 30, 122.461151, -3910.071533, 135.605, 0, ''), +(7806, 31, 103.376175, -3937.725098, 137.342, 0, ''), +(7806, 32, 81.414474, -3958.614258, 138.469, 0, ''), +(7806, 33, 55.378139, -3982.004639, 136.520, 0, ''), +(7806, 34, 13.983131, -4013.952881, 126.903, 0, ''), +(7806, 35, -21.658007, -4048.713623, 118.068, 0, ''), +(7806, 36, -52.443058, -4081.209717, 117.477, 0, ''), +(7806, 37, -102.710854, -4116.760742, 118.666, 0, ''), +(7806, 38, -92.996193, -4135.847168, 119.310, 0, ''), +(7806, 39, -86.391273, -4153.331055, 122.502, 0, ''), +(7806, 40, -85.746086, -4163.600586, 121.892, 0, ''), +(7806, 41, -90.544006, -4183.577637, 117.587, 0, ''), +(7806, 42, -110.223564, -4205.861328, 121.878, 0, ''), +(7806, 43, -115.257607, -4211.962402, 121.878, 3000, 'SAY_OOX_DANGER'), +(7806, 44, -128.594650, -4233.343750, 117.766, 0, ''), +(7806, 45, -135.358917, -4258.120117, 117.562, 0, ''), +(7806, 46, -156.832428, -4258.961914, 120.059, 0, ''), +(7806, 47, -167.119873, -4274.102539, 117.062, 0, ''), +(7806, 48, -176.291016, -4287.594727, 118.721, 0, ''), +(7806, 49, -196.992981, -4315.815430, 117.588, 0, ''), +(7806, 50, -209.329300, -4331.671387, 115.142, 0, ''), +(7806, 51, -232.292236, -4356.015625, 108.543, 0, ''), +(7806, 52, -232.159683, -4370.904297, 102.815, 0, ''), +(7806, 53, -210.271133, -4389.896973, 84.167, 0, ''), +(7806, 54, -187.940186, -4407.532715, 70.987, 0, ''), +(7806, 55, -181.353577, -4418.771973, 64.778, 0, ''), +(7806, 56, -170.529861, -4440.438965, 58.943, 0, ''), +(7806, 57, -141.428543, -4465.323242, 45.963, 0, ''), +(7806, 58, -120.993629, -4487.088379, 32.075, 0, ''), +(7806, 59, -104.134621, -4501.837402, 25.051, 0, ''), +(7806, 60, -84.154663, -4529.436523, 11.952, 0, ''), +(7806, 61, -88.698898, -4544.626465, 9.055, 0, ''), +(7806, 62, -100.603447, -4575.034180, 11.388, 0, ''), +(7806, 63, -106.908669, -4600.407715, 11.046, 0, ''), +(7806, 64, -106.831703, -4620.503418, 11.057, 3000, 'SAY_OOX_COMPLETE'); diff --git a/src/bindings/scripts/CMakeLists.txt b/src/bindings/scripts/CMakeLists.txt index 285fb004c59..58b91096c18 100644 --- a/src/bindings/scripts/CMakeLists.txt +++ b/src/bindings/scripts/CMakeLists.txt @@ -405,20 +405,20 @@ SET(trinityscript_LIB_SRCS scripts/northrend/sholazar_basin.cpp scripts/northrend/wintergrasp.cpp scripts/northrend/zuldrak.cpp - scripts/outland/aunchindoun/auchenai_crypts/boss_exarch_maladaar.cpp - scripts/outland/aunchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp - scripts/outland/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp - scripts/outland/aunchindoun/mana_tombs/boss_pandemonius.cpp - scripts/outland/aunchindoun/sethekk_halls/boss_darkweaver_syth.cpp - scripts/outland/aunchindoun/sethekk_halls/boss_tailonking_ikiss.cpp - scripts/outland/aunchindoun/sethekk_halls/def_sethekk_halls.h - scripts/outland/aunchindoun/sethekk_halls/instance_sethekk_halls.cpp - scripts/outland/aunchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp - scripts/outland/aunchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp - scripts/outland/aunchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp - scripts/outland/aunchindoun/shadow_labyrinth/boss_murmur.cpp - scripts/outland/aunchindoun/shadow_labyrinth/def_shadow_labyrinth.h - scripts/outland/aunchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp + scripts/outland/auchindoun/auchenai_crypts/boss_exarch_maladaar.cpp + scripts/outland/auchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp + scripts/outland/auchindoun/mana_tombs/boss_nexusprince_shaffar.cpp + scripts/outland/auchindoun/mana_tombs/boss_pandemonius.cpp + scripts/outland/auchindoun/sethekk_halls/boss_darkweaver_syth.cpp + scripts/outland/auchindoun/sethekk_halls/boss_tailonking_ikiss.cpp + scripts/outland/auchindoun/sethekk_halls/def_sethekk_halls.h + scripts/outland/auchindoun/sethekk_halls/instance_sethekk_halls.cpp + scripts/outland/auchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp + scripts/outland/auchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp + scripts/outland/auchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp + scripts/outland/auchindoun/shadow_labyrinth/boss_murmur.cpp + scripts/outland/auchindoun/shadow_labyrinth/def_shadow_labyrinth.h + scripts/outland/auchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp scripts/outland/black_temple/black_temple.cpp scripts/outland/black_temple/boss_bloodboil.cpp scripts/outland/black_temple/boss_illidan.cpp diff --git a/src/bindings/scripts/VC80/80ScriptDev2.vcproj b/src/bindings/scripts/VC80/80ScriptDev2.vcproj index 635f9356908..4c98db9abb2 100644 --- a/src/bindings/scripts/VC80/80ScriptDev2.vcproj +++ b/src/bindings/scripts/VC80/80ScriptDev2.vcproj @@ -2172,11 +2172,11 @@ Name="Auchenai Crypts" > @@ -2184,11 +2184,11 @@ Name="Mana Tombs" > @@ -2196,19 +2196,19 @@ Name="Sethekk Halls" > @@ -2216,27 +2216,27 @@ Name="Shadow Labyrinth" > diff --git a/src/bindings/scripts/VC90/90ScriptDev2.vcproj b/src/bindings/scripts/VC90/90ScriptDev2.vcproj index c6f403470cb..ee30f353115 100644 --- a/src/bindings/scripts/VC90/90ScriptDev2.vcproj +++ b/src/bindings/scripts/VC90/90ScriptDev2.vcproj @@ -2169,11 +2169,11 @@ Name="Auchenai Crypts" > @@ -2181,11 +2181,11 @@ Name="Mana Tombs" > @@ -2193,19 +2193,19 @@ Name="Sethekk Halls" > @@ -2213,27 +2213,27 @@ Name="Shadow Labyrinth" > diff --git a/src/bindings/scripts/base/escort_ai.cpp b/src/bindings/scripts/base/escort_ai.cpp index 2c28aa6b9a6..37c8c31981b 100644 --- a/src/bindings/scripts/base/escort_ai.cpp +++ b/src/bindings/scripts/base/escort_ai.cpp @@ -130,6 +130,32 @@ void npc_escortAI::EnterEvadeMode() Reset(); } +bool npc_escortAI::IsPlayerOrGroupInRange() +{ + if (Player* pPlayer = Unit::GetPlayer(PlayerGUID)) + { + if (Group* pGroup = pPlayer->GetGroup()) + { + for(GroupReference* pRef = pGroup->GetFirstMember(); pRef != NULL; pRef = pRef->next()) + { + Player* pMember = pRef->getSource(); + + if (pMember && m_creature->IsWithinDistInMap(pMember, GetMaxPlayerDistance())) + { + return true; + break; + } + } + } + else + { + if (m_creature->IsWithinDistInMap(pPlayer, GetMaxPlayerDistance())) + return true; + } + } + return false; +} + void npc_escortAI::UpdateAI(const uint32 uiDiff) { //Waypoint Updating @@ -194,31 +220,7 @@ void npc_escortAI::UpdateAI(const uint32 uiDiff) { if (m_uiPlayerCheckTimer < uiDiff) { - bool bIsMaxRangeExceeded = true; - - if (Player* pPlayer = Unit::GetPlayer(PlayerGUID)) - { - if (Group* pGroup = pPlayer->GetGroup()) - { - for(GroupReference* pRef = pGroup->GetFirstMember(); pRef != NULL; pRef = pRef->next()) - { - Player* pMember = pRef->getSource(); - - if (pMember && m_creature->IsWithinDistInMap(pMember, GetMaxPlayerDistance())) - { - bIsMaxRangeExceeded = false; - break; - } - } - } - else - { - if (m_creature->IsWithinDistInMap(pPlayer, GetMaxPlayerDistance())) - bIsMaxRangeExceeded = false; - } - } - - if (DespawnAtFar && bIsMaxRangeExceeded) + if (DespawnAtFar && !IsPlayerOrGroupInRange()) { debug_log("TSCR: EscortAI failed because player/group was to far away or not found"); diff --git a/src/bindings/scripts/base/escort_ai.h b/src/bindings/scripts/base/escort_ai.h index 663e11d79f6..243e64d6d21 100644 --- a/src/bindings/scripts/base/escort_ai.h +++ b/src/bindings/scripts/base/escort_ai.h @@ -56,6 +56,8 @@ struct TRINITY_DLL_DECL npc_escortAI : public ScriptedAI // EscortAI functions void AddWaypoint(uint32 id, float x, float y, float z, uint32 WaitTimeMs = 0); + bool IsPlayerOrGroupInRange(); + void FillPointMovementListForCreature(); void Start(bool bIsActiveAttacker = true, bool bRun = false, uint64 uiPlayerGUID = 0, const Quest* pQuest = NULL, bool bInstantRespawn = false, bool bCanLoopPath = false); diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/hinterlands.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/hinterlands.cpp index b02d3fb918b..6b661dad5ef 100644 --- a/src/bindings/scripts/scripts/eastern_kingdoms/hinterlands.cpp +++ b/src/bindings/scripts/scripts/eastern_kingdoms/hinterlands.cpp @@ -17,17 +17,125 @@ /* ScriptData SDName: Hinterlands SD%Complete: 100 -SDComment: Quest support: 2742 +SDComment: Quest support: 863, 2742 SDCategory: The Hinterlands EndScriptData */ /* ContentData +npc_00x09hl npc_rinji EndContentData */ #include "precompiled.h" #include "escort_ai.h" +/*###### +## npc_00x09hl +######*/ + +enum +{ + SAY_OOX_START = -1000416, + SAY_OOX_AGGRO = -1000417, + SAY_OOX_DANGER = -1000418, + SAY_OOX_COMPLETE = -1000419, + + QUEST_RESQUE_OOX_09 = 836, + + NPC_MARAUDING_OWL = 7808, + NPC_VILE_AMBUSHER = 7809, + + FACTION_ESCORTEE_A = 774, + FACTION_ESCORTEE_H = 775 +}; + +struct MANGOS_DLL_DECL npc_00x09hlAI : public npc_escortAI +{ + npc_00x09hlAI(Creature* pCreature) : npc_escortAI(pCreature) { } + + void Reset() { } + + void WaypointReached(uint32 uiPointId) + { + switch(uiPointId) + { + case 26: + DoScriptText(SAY_OOX_DANGER, m_creature); + break; + case 43: + DoScriptText(SAY_OOX_DANGER, m_creature); + break; + case 64: + DoScriptText(SAY_OOX_COMPLETE, m_creature); + if (Player* pPlayer = Unit::GetPlayer(PlayerGUID)) + pPlayer->GroupEventHappens(QUEST_RESQUE_OOX_09, m_creature); + break; + } + } + + void WaypointStart(uint32 uiPointId) + { + switch(uiPointId) + { + case 27: + for(int i = 0; i < 3; ++i) + { + float fX, fY, fZ; + m_creature->GetRandomPoint(147.927444, -3851.513428, 130.893, 7.0f, fX, fY, fZ); + + m_creature->SummonCreature(NPC_MARAUDING_OWL, fX, fY, fZ, 0.0f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 25000); + } + break; + case 44: + for(int i = 0; i < 3; ++i) + { + float fX, fY, fZ; + m_creature->GetRandomPoint(-141.151581, -4291.213867, 120.130, 7.0f, fX, fY, fZ); + + m_creature->SummonCreature(NPC_VILE_AMBUSHER, fX, fY, fZ, 0.0f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 25000); + } + break; + } + } + + void Aggro(Unit* pWho) + { + if (pWho->GetEntry() == NPC_MARAUDING_OWL || pWho->GetEntry() == NPC_VILE_AMBUSHER) + return; + + DoScriptText(SAY_OOX_AGGRO, m_creature); + } + + void JustSummoned(Creature* pSummoned) + { + pSummoned->GetMotionMaster()->MovePoint(0, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ()); + } +}; + +bool QuestAccept_npc_00x09hl(Player* pPlayer, Creature* pCreature, const Quest* pQuest) +{ + if (pQuest->GetQuestId() == QUEST_RESQUE_OOX_09) + { + pCreature->SetStandState(UNIT_STAND_STATE_STAND); + + if (pPlayer->GetTeam() == ALLIANCE) + pCreature->setFaction(FACTION_ESCORTEE_A); + else if (pPlayer->GetTeam() == HORDE) + pCreature->setFaction(FACTION_ESCORTEE_H); + + DoScriptText(SAY_OOX_START, pCreature, pPlayer); + + if (npc_00x09hlAI* pEscortAI = CAST_AI(npc_00x09hlAI, pCreature->AI())) + pEscortAI->Start(false, false, pPlayer->GetGUID(), pQuest); + } + return true; +} + +CreatureAI* GetAI_npc_00x09hl(Creature* pCreature) +{ + return new npc_00x09hlAI(pCreature); +} + /*###### ## npc_rinji ######*/ @@ -164,39 +272,45 @@ struct TRINITY_DLL_DECL npc_rinjiAI : public npc_escortAI } } - void UpdateAI(const uint32 uiDiff) + void UpdateEscortAI(const uint32 uiDiff) { - npc_escortAI::UpdateAI(uiDiff); - - if (IsBeingEscorted && m_uiPostEventCount && !m_creature->getVictim()) + //Check if we have a current target + if (!UpdateVictim()) { - if (m_uiPostEventTimer < uiDiff) + if (IsBeingEscorted && m_uiPostEventCount) { - m_uiPostEventTimer = 3000; - - if (Unit* pPlayer = Unit::GetUnit(*m_creature, PlayerGUID)) + if (m_uiPostEventTimer < uiDiff) { - switch(m_uiPostEventCount) + m_uiPostEventTimer = 3000; + + if (Unit* pPlayer = Unit::GetUnit(*m_creature, PlayerGUID)) + { + switch(m_uiPostEventCount) + { + case 1: + DoScriptText(SAY_RIN_PROGRESS_1, m_creature, pPlayer); + ++m_uiPostEventCount; + break; + case 2: + DoScriptText(SAY_RIN_PROGRESS_2, m_creature, pPlayer); + m_uiPostEventCount = 0; + break; + } + } + else { - case 1: - DoScriptText(SAY_RIN_PROGRESS_1, m_creature, pPlayer); - ++m_uiPostEventCount; - break; - case 2: - DoScriptText(SAY_RIN_PROGRESS_2, m_creature, pPlayer); - m_uiPostEventCount = 0; - break; + m_creature->ForcedDespawn(); + return; } } else - { - m_creature->ForcedDespawn(); - return; - } + m_uiPostEventTimer -= uiDiff; } - else - m_uiPostEventTimer -= uiDiff; + + return; } + + DoMeleeAttackIfReady(); } }; @@ -222,6 +336,12 @@ void AddSC_hinterlands() { Script* newscript; + newscript = new Script; + newscript->Name = "npc_00x09hl"; + newscript->GetAI = &GetAI_npc_00x09hl; + newscript->pQuestAccept = &QuestAccept_npc_00x09hl; + newscript->RegisterSelf(); + newscript = new Script; newscript->Name = "npc_rinji"; newscript->GetAI = &GetAI_npc_rinji; diff --git a/src/bindings/scripts/scripts/outland/auchindoun/auchenai_crypts/boss_exarch_maladaar.cpp b/src/bindings/scripts/scripts/outland/auchindoun/auchenai_crypts/boss_exarch_maladaar.cpp new file mode 100644 index 00000000000..414804a6576 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/auchindoun/auchenai_crypts/boss_exarch_maladaar.cpp @@ -0,0 +1,358 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Exarch_Maladaar +SD%Complete: 95 +SDComment: Most of event implemented, some adjustments to timers remain and possibly make some better code for switching his dark side in to better "images" of player. +SDCategory: Auchindoun, Auchenai Crypts +EndScriptData */ + +/* ContentData +mob_stolen_soul +boss_exarch_maladaar +mob_avatar_of_martyred +EndContentData */ + +#include "precompiled.h" + +#define SPELL_MOONFIRE 37328 +#define SPELL_FIREBALL 37329 +#define SPELL_MIND_FLAY 37330 +#define SPELL_HEMORRHAGE 37331 +#define SPELL_FROSTSHOCK 37332 +#define SPELL_CURSE_OF_AGONY 37334 +#define SPELL_MORTAL_STRIKE 37335 +#define SPELL_FREEZING_TRAP 37368 +#define SPELL_HAMMER_OF_JUSTICE 37369 + +struct TRINITY_DLL_DECL mob_stolen_soulAI : public ScriptedAI +{ + mob_stolen_soulAI(Creature *c) : ScriptedAI(c) {} + + uint8 myClass; + uint32 Class_Timer; + + void Reset() + { + Class_Timer = 1000; + } + + void EnterCombat(Unit *who) + { } + + void SetMyClass(uint8 myclass) + { + myClass = myclass; + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (Class_Timer < diff) + { + switch (myClass) + { + case CLASS_WARRIOR: + DoCast(m_creature->getVictim(), SPELL_MORTAL_STRIKE); + Class_Timer = 6000; + break; + case CLASS_PALADIN: + DoCast(m_creature->getVictim(), SPELL_HAMMER_OF_JUSTICE); + Class_Timer = 6000; + break; + case CLASS_HUNTER: + DoCast(m_creature->getVictim(), SPELL_FREEZING_TRAP); + Class_Timer = 20000; + break; + case CLASS_ROGUE: + DoCast(m_creature->getVictim(), SPELL_HEMORRHAGE); + Class_Timer = 10000; + break; + case CLASS_PRIEST: + DoCast(m_creature->getVictim(), SPELL_MIND_FLAY); + Class_Timer = 5000; + break; + case CLASS_SHAMAN: + DoCast(m_creature->getVictim(), SPELL_FROSTSHOCK); + Class_Timer = 8000; + break; + case CLASS_MAGE: + DoCast(m_creature->getVictim(), SPELL_FIREBALL); + Class_Timer = 5000; + break; + case CLASS_WARLOCK: + DoCast(m_creature->getVictim(), SPELL_CURSE_OF_AGONY); + Class_Timer = 20000; + break; + case CLASS_DRUID: + DoCast(m_creature->getVictim(), SPELL_MOONFIRE); + Class_Timer = 10000; + break; + } + } else Class_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_stolen_soul(Creature* pCreature) +{ + return new mob_stolen_soulAI (pCreature); +} + +#define SAY_INTRO -1558000 +#define SAY_SUMMON -1558001 + +#define SAY_AGGRO_1 -1558002 +#define SAY_AGGRO_2 -1558003 +#define SAY_AGGRO_3 -1558004 + +#define SAY_ROAR -1558005 +#define SAY_SOUL_CLEAVE -1558006 + +#define SAY_SLAY_1 -1558007 +#define SAY_SLAY_2 -1558008 + +#define SAY_DEATH -1558009 + +#define SPELL_RIBBON_OF_SOULS 32422 +#define SPELL_SOUL_SCREAM 32421 + +#define SPELL_STOLEN_SOUL 32346 +#define SPELL_STOLEN_SOUL_VISUAL 32395 + +#define SPELL_SUMMON_AVATAR 32424 + +#define ENTRY_STOLEN_SOUL 18441 + +struct TRINITY_DLL_DECL boss_exarch_maladaarAI : public ScriptedAI +{ + boss_exarch_maladaarAI(Creature *c) : ScriptedAI(c) + { + HasTaunted = false; + } + + uint32 soulmodel; + uint64 soulholder; + uint8 soulclass; + + uint32 Fear_timer; + uint32 Ribbon_of_Souls_timer; + uint32 StolenSoul_Timer; + + bool HasTaunted; + bool Avatar_summoned; + + void Reset() + { + soulmodel = 0; + soulholder = 0; + soulclass = 0; + + Fear_timer = 15000 + rand()% 5000; + Ribbon_of_Souls_timer = 5000; + StolenSoul_Timer = 25000 + rand()% 10000; + + Avatar_summoned = false; + } + + void MoveInLineOfSight(Unit *who) + { + if (!HasTaunted && m_creature->IsWithinDistInMap(who, 150.0)) + { + DoScriptText(SAY_INTRO, m_creature); + HasTaunted = true; + } + + ScriptedAI::MoveInLineOfSight(who); + } + + + void EnterCombat(Unit *who) + { + switch (rand()%3) + { + case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; + } + } + + void JustSummoned(Creature *summoned) + { + if (summoned->GetEntry() == ENTRY_STOLEN_SOUL) + { + //SPELL_STOLEN_SOUL_VISUAL has shapeshift effect, but not implemented feature in Trinity for this spell. + summoned->CastSpell(summoned,SPELL_STOLEN_SOUL_VISUAL,false); + summoned->SetDisplayId(soulmodel); + summoned->setFaction(m_creature->getFaction()); + + if (Unit *target = Unit::GetUnit(*m_creature,soulholder)) + { + + CAST_AI(mob_stolen_soulAI, summoned->AI())->SetMyClass(soulclass); + summoned->AI()->AttackStart(target); + } + } + } + + void KilledUnit(Unit* victim) + { + if (rand()%2) + return; + + switch (rand()%2) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature); break; + case 1: DoScriptText(SAY_SLAY_2, m_creature); break; + } + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEATH, m_creature); + //When Exarch Maladar is defeated D'ore appear. + m_creature->SummonCreature(19412, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 600000); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (!Avatar_summoned && ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 25)) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(true); + + DoScriptText(SAY_SUMMON, m_creature); + + DoCast(m_creature, SPELL_SUMMON_AVATAR); + Avatar_summoned = true; + StolenSoul_Timer = 15000 + rand()% 15000; + } + + if (StolenSoul_Timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + { + if (target->GetTypeId() == TYPEID_PLAYER) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(true); + + uint32 i = urand(1,2); + if (i == 1) + DoScriptText(SAY_ROAR, m_creature); + else + DoScriptText(SAY_SOUL_CLEAVE, m_creature); + + soulmodel = target->GetDisplayId(); + soulholder = target->GetGUID(); + soulclass = target->getClass(); + + DoCast(target,SPELL_STOLEN_SOUL); + m_creature->SummonCreature(ENTRY_STOLEN_SOUL, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000); + + StolenSoul_Timer = 20000 + rand()% 10000; + } else StolenSoul_Timer = 1000; + } + }else StolenSoul_Timer -= diff; + + if (Ribbon_of_Souls_timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_RIBBON_OF_SOULS); + + Ribbon_of_Souls_timer = 5000 + (rand()%20 * 1000); + }else Ribbon_of_Souls_timer -= diff; + + if (Fear_timer < diff) + { + DoCast(m_creature,SPELL_SOUL_SCREAM); + Fear_timer = 15000 + rand()% 15000; + }else Fear_timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_exarch_maladaar(Creature* pCreature) +{ + return new boss_exarch_maladaarAI (pCreature); +} + +#define SPELL_AV_MORTAL_STRIKE 16856 +#define SPELL_AV_SUNDER_ARMOR 16145 + +struct TRINITY_DLL_DECL mob_avatar_of_martyredAI : public ScriptedAI +{ + mob_avatar_of_martyredAI(Creature *c) : ScriptedAI(c) {} + + uint32 Mortal_Strike_timer; + + void Reset() + { + Mortal_Strike_timer = 10000; + } + + void EnterCombat(Unit *who) + { + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (Mortal_Strike_timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_AV_MORTAL_STRIKE); + Mortal_Strike_timer = 10000 + rand()%20 * 1000; + } else Mortal_Strike_timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_avatar_of_martyred(Creature* pCreature) +{ + return new mob_avatar_of_martyredAI (pCreature); +} + +void AddSC_boss_exarch_maladaar() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_exarch_maladaar"; + newscript->GetAI = &GetAI_boss_exarch_maladaar; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_avatar_of_martyred"; + newscript->GetAI = &GetAI_mob_avatar_of_martyred; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_stolen_soul"; + newscript->GetAI = &GetAI_mob_stolen_soul; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/auchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp b/src/bindings/scripts/scripts/outland/auchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp new file mode 100644 index 00000000000..4dfdd407731 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/auchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp @@ -0,0 +1,212 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +Name: Boss_Shirrak_the_dead_watcher +%Complete: 80 +Comment: InhibitMagic should stack slower far from the boss, proper Visual for Focus Fire, heroic implemented +Category: Auchindoun, Auchenai Crypts +EndScriptData */ + +#include "precompiled.h" + +#define SPELL_INHIBITMAGIC 32264 +#define SPELL_ATTRACTMAGIC 32265 +#define N_SPELL_CARNIVOROUSBITE 36383 +#define H_SPELL_CARNIVOROUSBITE 39382 +#define SPELL_CARNIVOROUSBITE (HeroicMode?H_SPELL_CARNIVOROUSBITE:N_SPELL_CARNIVOROUSBITE) + +#define ENTRY_FOCUS_FIRE 18374 + +#define N_SPELL_FIERY_BLAST 32302 +#define H_SPELL_FIERY_BLAST 38382 +#define SPELL_FIERY_BLAST (HeroicMode?H_SPELL_FIERY_BLAST:N_SPELL_FIERY_BLAST) +#define SPELL_FOCUS_FIRE_VISUAL 42075 //need to find better visual + +struct TRINITY_DLL_DECL boss_shirrak_the_dead_watcherAI : public ScriptedAI +{ + boss_shirrak_the_dead_watcherAI(Creature *c) : ScriptedAI(c) + { + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + uint32 Inhibitmagic_Timer; + uint32 Attractmagic_Timer; + uint32 Carnivorousbite_Timer; + uint32 FocusFire_Timer; + bool HeroicMode; + Unit *focusedTarget; + + void Reset() + { + Inhibitmagic_Timer = 0; + Attractmagic_Timer = 28000; + Carnivorousbite_Timer = 10000; + FocusFire_Timer = 17000; + focusedTarget = NULL; + } + + void EnterCombat(Unit *who) + { } + + void JustSummoned(Creature *summoned) + { + if (summoned && summoned->GetEntry() == ENTRY_FOCUS_FIRE) + { + summoned->CastSpell(summoned,SPELL_FOCUS_FIRE_VISUAL,false); + summoned->setFaction(m_creature->getFaction()); + summoned->SetLevel(m_creature->getLevel()); + summoned->addUnitState(UNIT_STAT_ROOT); + + if (focusedTarget) + summoned->AI()->AttackStart(focusedTarget); + } + } + + void UpdateAI(const uint32 diff) + { + //Inhibitmagic_Timer + if (Inhibitmagic_Timer < diff) + { + float dist; + Map* pMap = m_creature->GetMap(); + Map::PlayerList const &PlayerList = pMap->GetPlayers(); + for(Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) + if (Player* i_pl = i->getSource()) + if (i_pl->isAlive() && (dist = i_pl->IsWithinDist(m_creature, 45))) + { + i_pl->RemoveAurasDueToSpell(SPELL_INHIBITMAGIC); + m_creature->AddAura(SPELL_INHIBITMAGIC, i_pl); + if (dist < 35) + m_creature->AddAura(SPELL_INHIBITMAGIC, i_pl); + if (dist < 25) + m_creature->AddAura(SPELL_INHIBITMAGIC, i_pl); + if (dist < 15) + m_creature->AddAura(SPELL_INHIBITMAGIC, i_pl); + } + Inhibitmagic_Timer = 3000+(rand()%1000); + }else Inhibitmagic_Timer -= diff; + + //Return since we have no target + if (!UpdateVictim()) + return; + + //Attractmagic_Timer + if (Attractmagic_Timer < diff) + { + DoCast(m_creature,SPELL_ATTRACTMAGIC); + Attractmagic_Timer = 30000; + Carnivorousbite_Timer = 1500; + }else Attractmagic_Timer -= diff; + + //Carnivorousbite_Timer + if (Carnivorousbite_Timer < diff) + { + DoCast(m_creature,SPELL_CARNIVOROUSBITE); + Carnivorousbite_Timer = 10000; + }else Carnivorousbite_Timer -= diff; + + //FocusFire_Timer + if (FocusFire_Timer < diff) + { + // Summon Focus Fire & Emote + Unit *target = SelectUnit(SELECT_TARGET_RANDOM,1); + if (target && target->GetTypeId() == TYPEID_PLAYER && target->isAlive()) + { + focusedTarget = target; + m_creature->SummonCreature(ENTRY_FOCUS_FIRE,target->GetPositionX(),target->GetPositionY(),target->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN,5500); + + // TODO: Find better way to handle emote + // Emote + std::string *emote = new std::string("focuses on "); + emote->append(target->GetName()); + emote->append("!"); + const char* text = emote->c_str(); + m_creature->MonsterTextEmote(text, 0, true); + delete emote; + } + FocusFire_Timer = 15000+(rand()%5000); + }else FocusFire_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_shirrak_the_dead_watcher(Creature* pCreature) +{ + return new boss_shirrak_the_dead_watcherAI (pCreature); +} + +struct TRINITY_DLL_DECL mob_focus_fireAI : public ScriptedAI +{ + mob_focus_fireAI(Creature *c) : ScriptedAI(c) + { + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + bool HeroicMode; + uint32 FieryBlast_Timer; + bool fiery1, fiery2; + + void Reset() + { + FieryBlast_Timer = 3000+(rand()%1000); + fiery1 = fiery2 = true; + } + + void EnterCombat(Unit *who) + { } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + //FieryBlast_Timer + if (fiery2 && FieryBlast_Timer < diff) + { + DoCast(m_creature,SPELL_FIERY_BLAST); + + if (fiery1) fiery1 = false; + else if (fiery2) fiery2 = false; + + FieryBlast_Timer = 1000; + }else FieryBlast_Timer -= diff; + + //DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_focus_fire(Creature* pCreature) +{ + return new mob_focus_fireAI (pCreature); +} + +void AddSC_boss_shirrak_the_dead_watcher() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_shirrak_the_dead_watcher"; + newscript->GetAI = &GetAI_boss_shirrak_the_dead_watcher; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_focus_fire"; + newscript->GetAI = &GetAI_mob_focus_fire; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/auchindoun/mana_tombs/boss_nexusprince_shaffar.cpp b/src/bindings/scripts/scripts/outland/auchindoun/mana_tombs/boss_nexusprince_shaffar.cpp new file mode 100644 index 00000000000..dcaaefee8c2 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/auchindoun/mana_tombs/boss_nexusprince_shaffar.cpp @@ -0,0 +1,369 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_NexusPrince_Shaffar +SD%Complete: 80 +SDComment: Need more tuning of spell timers, it should not be as linear fight as current. Also should possibly find a better way to deal with his three initial beacons to make sure all aggro. +SDCategory: Auchindoun, Mana Tombs +EndScriptData */ + +/* ContentData +boss_nexusprince_shaffar +mob_ethereal_beacon +EndContentData */ + +#include "precompiled.h" + +enum +{ + SAY_INTRO = -1557000, + SAY_AGGRO_1 = -1557001, + SAY_AGGRO_2 = -1557002, + SAY_AGGRO_3 = -1557003, + SAY_SLAY_1 = -1557004, + SAY_SLAY_2 = -1557005, + SAY_SUMMON = -1557006, + SAY_DEAD = -1557007, + + SPELL_BLINK = 34605, + SPELL_FROSTBOLT = 32364, + SPELL_FIREBALL = 32363, + SPELL_FROSTNOVA = 32365, + + SPELL_ETHEREAL_BEACON = 32371, // Summons NPC_BEACON + SPELL_ETHEREAL_BEACON_VISUAL = 32368, + + NPC_BEACON = 18431, + NPC_SHAFFAR = 18344, + + NR_INITIAL_BEACONS = 3 +}; + +struct TRINITY_DLL_DECL boss_nexusprince_shaffarAI : public ScriptedAI +{ + boss_nexusprince_shaffarAI(Creature *c) : ScriptedAI(c), summons(me) { HasTaunted = false; } + + uint32 Blink_Timer; + uint32 Beacon_Timer; + uint32 FireBall_Timer; + uint32 Frostbolt_Timer; + uint32 FrostNova_Timer; + + SummonList summons; + + bool HasTaunted; + bool CanBlink; + + void Reset() + { + Blink_Timer = 1500; + Beacon_Timer = 10000; + FireBall_Timer = 8000; + Frostbolt_Timer = 4000; + FrostNova_Timer = 15000; + + CanBlink = false; + + float dist = 8.0f; + float posX, posY, posZ, angle; + m_creature->GetHomePosition(posX, posY, posZ, angle); + + m_creature->SummonCreature(NPC_BEACON, posX - dist, posY - dist, posZ, angle, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 7200000); + m_creature->SummonCreature(NPC_BEACON, posX - dist, posY + dist, posZ, angle, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 7200000); + m_creature->SummonCreature(NPC_BEACON, posX + dist, posY, posZ, angle, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 7200000); + } + + void EnterEvadeMode() + { + summons.DespawnAll(); + ScriptedAI::EnterEvadeMode(); + } + + void MoveInLineOfSight(Unit *who) + { + if (!HasTaunted && who->GetTypeId() == TYPEID_PLAYER && m_creature->IsWithinDistInMap(who, 100.0f)) + { + DoScriptText(SAY_INTRO, m_creature); + HasTaunted = true; + } + } + + void EnterCombat(Unit *who) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; + } + + DoZoneInCombat(); + summons.DoZoneInCombat(); + } + + void JustSummoned(Creature *summoned) + { + if (summoned->GetEntry() == NPC_BEACON) + { + summoned->CastSpell(summoned,SPELL_ETHEREAL_BEACON_VISUAL,false); + + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + summoned->AI()->AttackStart(target); + } + + summons.Summon(summoned); + } + + void SummonedCreatureDespawn(Creature *summon) + { + summons.Despawn(summon); + } + + void KilledUnit(Unit* victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature); break; + case 1: DoScriptText(SAY_SLAY_2, m_creature); break; + } + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEAD, m_creature); + summons.DespawnAll(); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (FrostNova_Timer < diff) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(true); + + DoCast(m_creature,SPELL_FROSTNOVA); + FrostNova_Timer = 17500 + rand()%7500; + CanBlink = true; + }else FrostNova_Timer -= diff; + + if (Frostbolt_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_FROSTBOLT); + Frostbolt_Timer = 4500 + rand()%1500; + }else Frostbolt_Timer -= diff; + + if (FireBall_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_FIREBALL); + FireBall_Timer = 4500 + rand()%1500; + }else FireBall_Timer -= diff; + + if (CanBlink) + { + if (Blink_Timer < diff) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(true); + + //expire movement, will prevent from running right back to victim after cast + //(but should MoveChase be used again at a certain time or should he not move?) + if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE) + m_creature->GetMotionMaster()->MovementExpired(); + + DoCast(m_creature,SPELL_BLINK); + Blink_Timer = 1000 + rand()%1500; + CanBlink = false; + }else Blink_Timer -= diff; + } + + if (Beacon_Timer < diff) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(true); + + if (!urand(0,3)) + DoScriptText(SAY_SUMMON, m_creature); + + DoCast(m_creature,SPELL_ETHEREAL_BEACON, true); + + Beacon_Timer = 10000; + }else Beacon_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_nexusprince_shaffar(Creature* pCreature) +{ + return new boss_nexusprince_shaffarAI (pCreature); +} + +enum +{ + SPELL_ARCANE_BOLT = 15254, + SPELL_ETHEREAL_APPRENTICE = 32372 // Summon 18430 +}; + +struct TRINITY_DLL_DECL mob_ethereal_beaconAI : public ScriptedAI +{ + mob_ethereal_beaconAI(Creature *c) : ScriptedAI(c) + { + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + bool HeroicMode; + uint32 Apprentice_Timer; + uint32 ArcaneBolt_Timer; + uint32 Check_Timer; + + void KillSelf() + { + m_creature->Kill(m_creature); + } + + void Reset() + { + Apprentice_Timer = (HeroicMode ? 10000 : 20000); + ArcaneBolt_Timer = 1000; + Check_Timer = 1000; + } + + void EnterCombat(Unit *who) + { + // Send Shaffar to fight + Creature* Shaffar = me->FindNearestCreature(NPC_SHAFFAR, 100); + if (!Shaffar || Shaffar->isDead()) + { + KillSelf(); + return; + } + if (!Shaffar->isInCombat()) + Shaffar->AI()->AttackStart(who); + } + + void JustSummoned(Creature *summoned) + { + summoned->AI()->AttackStart(m_creature->getVictim()); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (Check_Timer < diff) + { + Creature *Shaffar = me->FindNearestCreature(NPC_SHAFFAR, 100); + if (!Shaffar || Shaffar->isDead() || !Shaffar->isInCombat()) + { + KillSelf(); + return; + } + Check_Timer = 1000; + }else Check_Timer -= diff; + + if (ArcaneBolt_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_ARCANE_BOLT); + ArcaneBolt_Timer = 2000 + rand()%2500; + }else ArcaneBolt_Timer -= diff; + + if (Apprentice_Timer < diff) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(true); + + m_creature->CastSpell(m_creature,SPELL_ETHEREAL_APPRENTICE,true); + m_creature->ForcedDespawn(); + return; + }else Apprentice_Timer -= diff; + } +}; + +CreatureAI* GetAI_mob_ethereal_beacon(Creature* pCreature) +{ + return new mob_ethereal_beaconAI (pCreature); +} + +enum +{ + SPELL_ETHEREAL_APPRENTICE_FIREBOLT = 32369, + SPELL_ETHEREAL_APPRENTICE_FROSTBOLT = 32370 +}; + +struct TRINITY_DLL_DECL mob_ethereal_apprenticeAI : public ScriptedAI +{ + mob_ethereal_apprenticeAI(Creature *c) : ScriptedAI(c) {} + + uint32 Cast_Timer; + + bool isFireboltTurn; + + void Reset() + { + Cast_Timer = 3000; + isFireboltTurn = true; + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (Cast_Timer < diff) + { + if (isFireboltTurn) + { + m_creature->CastSpell(m_creature->getVictim(), SPELL_ETHEREAL_APPRENTICE_FIREBOLT, true); + isFireboltTurn = false; + }else{ + m_creature->CastSpell(m_creature->getVictim(), SPELL_ETHEREAL_APPRENTICE_FROSTBOLT, true); + isFireboltTurn = true; + } + Cast_Timer = 3000; + }else Cast_Timer -= diff; + } +}; + +CreatureAI* GetAI_mob_ethereal_apprentice(Creature* pCreature) +{ + return new mob_ethereal_apprenticeAI (pCreature); +} + +void AddSC_boss_nexusprince_shaffar() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_nexusprince_shaffar"; + newscript->GetAI = &GetAI_boss_nexusprince_shaffar; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_ethereal_beacon"; + newscript->GetAI = &GetAI_mob_ethereal_beacon; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_ethereal_apprentice"; + newscript->GetAI = &GetAI_mob_ethereal_apprentice; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/auchindoun/mana_tombs/boss_pandemonius.cpp b/src/bindings/scripts/scripts/outland/auchindoun/mana_tombs/boss_pandemonius.cpp new file mode 100644 index 00000000000..77e1c535340 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/auchindoun/mana_tombs/boss_pandemonius.cpp @@ -0,0 +1,138 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Pandemonius +SD%Complete: 75 +SDComment: Not known how void blast is done (amount of rapid cast seems to be related to players in party). All mobs remaining in surrounding area should aggro when engaged. +SDCategory: Auchindoun, Mana Tombs +EndScriptData */ + +#include "precompiled.h" + +#define SAY_AGGRO_1 -1557008 +#define SAY_AGGRO_2 -1557009 +#define SAY_AGGRO_3 -1557010 + +#define SAY_KILL_1 -1557011 +#define SAY_KILL_2 -1557012 + +#define SAY_DEATH -1557013 + +#define EMOTE_DARK_SHELL -1557014 + +#define SPELL_VOID_BLAST 32325 +#define H_SPELL_VOID_BLAST 38760 +#define SPELL_DARK_SHELL 32358 +#define H_SPELL_DARK_SHELL 38759 + +struct TRINITY_DLL_DECL boss_pandemoniusAI : public ScriptedAI +{ + boss_pandemoniusAI(Creature *c) : ScriptedAI(c) + { + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + bool HeroicMode; + uint32 VoidBlast_Timer; + uint32 DarkShell_Timer; + uint32 VoidBlast_Counter; + + void Reset() + { + VoidBlast_Timer = 8000+rand()%15000; + DarkShell_Timer = 20000; + VoidBlast_Counter = 0; + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + + void KilledUnit(Unit* victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_KILL_1, m_creature); break; + case 1: DoScriptText(SAY_KILL_2, m_creature); break; + } + } + + void EnterCombat(Unit *who) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; + } + + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (VoidBlast_Timer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + { + DoCast(target,HeroicMode ? H_SPELL_VOID_BLAST : SPELL_VOID_BLAST); + VoidBlast_Timer = 500; + ++VoidBlast_Counter; + } + + if (VoidBlast_Counter == 5) + { + VoidBlast_Timer = 15000+rand()%10000; + VoidBlast_Counter = 0; + } + }else VoidBlast_Timer -= diff; + + if (!VoidBlast_Counter) + { + if (DarkShell_Timer < diff) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(true); + + DoScriptText(EMOTE_DARK_SHELL, m_creature); + + DoCast(m_creature,HeroicMode ? H_SPELL_DARK_SHELL : SPELL_DARK_SHELL); + DarkShell_Timer = 20000; + }else DarkShell_Timer -= diff; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_pandemonius(Creature* pCreature) +{ + return new boss_pandemoniusAI (pCreature); +} + +void AddSC_boss_pandemonius() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_pandemonius"; + newscript->GetAI = &GetAI_boss_pandemonius; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/auchindoun/sethekk_halls/boss_darkweaver_syth.cpp b/src/bindings/scripts/scripts/outland/auchindoun/sethekk_halls/boss_darkweaver_syth.cpp new file mode 100644 index 00000000000..00e43fa257d --- /dev/null +++ b/src/bindings/scripts/scripts/outland/auchindoun/sethekk_halls/boss_darkweaver_syth.cpp @@ -0,0 +1,438 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Darkweaver_Syth +SD%Complete: 85 +SDComment: Shock spells/times need more work. Heroic partly implemented. +SDCategory: Auchindoun, Sethekk Halls +EndScriptData */ + +#include "precompiled.h" + +#define SAY_SUMMON -1556000 + +#define SAY_AGGRO_1 -1556001 +#define SAY_AGGRO_2 -1556002 +#define SAY_AGGRO_3 -1556003 + +#define SAY_SLAY_1 -1556004 +#define SAY_SLAY_2 -1556005 + +#define SAY_DEATH -1556006 + +#define SPELL_FROST_SHOCK 21401 //37865 +#define SPELL_FLAME_SHOCK 34354 +#define SPELL_SHADOW_SHOCK 30138 +#define SPELL_ARCANE_SHOCK 37132 + +#define SPELL_CHAIN_LIGHTNING 15659 //15305 + +#define SPELL_SUMMON_SYTH_FIRE 33537 // Spawns 19203 +#define SPELL_SUMMON_SYTH_ARCANE 33538 // Spawns 19205 +#define SPELL_SUMMON_SYTH_FROST 33539 // Spawns 19204 +#define SPELL_SUMMON_SYTH_SHADOW 33540 // Spawns 19206 + +#define SPELL_FLAME_BUFFET (HeroicMode?38141:33526) +#define SPELL_ARCANE_BUFFET (HeroicMode?38138:33527) +#define SPELL_FROST_BUFFET (HeroicMode?38142:33528) +#define SPELL_SHADOW_BUFFET (HeroicMode?38143:33529) + +struct TRINITY_DLL_DECL boss_darkweaver_sythAI : public ScriptedAI +{ + boss_darkweaver_sythAI(Creature *c) : ScriptedAI(c) + + { + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + uint32 flameshock_timer; + uint32 arcaneshock_timer; + uint32 frostshock_timer; + uint32 shadowshock_timer; + uint32 chainlightning_timer; + + bool summon90; + bool summon50; + bool summon10; + bool HeroicMode; + + void Reset() + { + flameshock_timer = 2000; + arcaneshock_timer = 4000; + frostshock_timer = 6000; + shadowshock_timer = 8000; + chainlightning_timer = 15000; + + summon90 = false; + summon50 = false; + summon10 = false; + } + + void EnterCombat(Unit *who) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; + } + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + + void KilledUnit(Unit* victim) + { + if (rand()%2) + return; + + switch(rand()%2) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature); break; + case 1: DoScriptText(SAY_SLAY_2, m_creature); break; + } + } + + void JustSummoned(Creature *summoned) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + summoned->AI()->AttackStart(target); + } + + void SythSummoning() + { + DoScriptText(SAY_SUMMON, m_creature); + + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(false); + + DoCast(m_creature,SPELL_SUMMON_SYTH_ARCANE,true); //front + DoCast(m_creature,SPELL_SUMMON_SYTH_FIRE,true); //back + DoCast(m_creature,SPELL_SUMMON_SYTH_FROST,true); //left + DoCast(m_creature,SPELL_SUMMON_SYTH_SHADOW,true); //right + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 90) && !summon90) + { + SythSummoning(); + summon90 = true; + } + + if (((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 50) && !summon50) + { + SythSummoning(); + summon50 = true; + } + + if (((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 10) && !summon10) + { + SythSummoning(); + summon10 = true; + } + + if (flameshock_timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_FLAME_SHOCK); + + flameshock_timer = 10000 + rand()%5000; + } else flameshock_timer -= diff; + + if (arcaneshock_timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_ARCANE_SHOCK); + + arcaneshock_timer = 10000 + rand()%5000; + } else arcaneshock_timer -= diff; + + if (frostshock_timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_FROST_SHOCK); + + frostshock_timer = 10000 + rand()%5000; + } else frostshock_timer -= diff; + + if (shadowshock_timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_SHADOW_SHOCK); + + shadowshock_timer = 10000 + rand()%5000; + } else shadowshock_timer -= diff; + + if (chainlightning_timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_CHAIN_LIGHTNING); + + chainlightning_timer = 25000; + } else chainlightning_timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_darkweaver_syth(Creature* pCreature) +{ + return new boss_darkweaver_sythAI (pCreature); +} + +/* ELEMENTALS */ + +struct TRINITY_DLL_DECL mob_syth_fireAI : public ScriptedAI +{ + mob_syth_fireAI(Creature *c) : ScriptedAI(c) + + { + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + uint32 flameshock_timer; + uint32 flamebuffet_timer; + bool HeroicMode; + + void Reset() + { + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true); + flameshock_timer = 2500; + flamebuffet_timer = 5000; + } + + void EnterCombat(Unit *who) { } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (flameshock_timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_FLAME_SHOCK); + + flameshock_timer = 5000; + }else flameshock_timer -= diff; + + if (flamebuffet_timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_FLAME_BUFFET); + + flamebuffet_timer = 5000; + }else flamebuffet_timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_syth_fire(Creature* pCreature) +{ + return new mob_syth_fireAI (pCreature); +} + +struct TRINITY_DLL_DECL mob_syth_arcaneAI : public ScriptedAI +{ + mob_syth_arcaneAI(Creature *c) : ScriptedAI(c) + + { + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + uint32 arcaneshock_timer; + uint32 arcanebuffet_timer; + bool HeroicMode; + + void Reset() + { + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, true); + arcaneshock_timer = 2500; + arcanebuffet_timer = 5000; + } + + void EnterCombat(Unit *who) { } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (arcaneshock_timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_ARCANE_SHOCK); + + arcaneshock_timer = 5000; + }else arcaneshock_timer -= diff; + + if (arcanebuffet_timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_ARCANE_BUFFET); + + arcanebuffet_timer = 5000; + }else arcanebuffet_timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_syth_arcane(Creature* pCreature) +{ + return new mob_syth_arcaneAI (pCreature); +} + +struct TRINITY_DLL_DECL mob_syth_frostAI : public ScriptedAI +{ + mob_syth_frostAI(Creature *c) : ScriptedAI(c) + + { + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + uint32 frostshock_timer; + uint32 frostbuffet_timer; + bool HeroicMode; + + void Reset() + { + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true); + frostshock_timer = 2500; + frostbuffet_timer = 5000; + } + + void EnterCombat(Unit *who) { } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (frostshock_timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_FROST_SHOCK); + + frostshock_timer = 5000; + }else frostshock_timer -= diff; + + if (frostbuffet_timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_FROST_BUFFET); + + frostbuffet_timer = 5000; + }else frostbuffet_timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_syth_frost(Creature* pCreature) +{ + return new mob_syth_frostAI (pCreature); +} + +struct TRINITY_DLL_DECL mob_syth_shadowAI : public ScriptedAI +{ + mob_syth_shadowAI(Creature *c) : ScriptedAI(c) + + { + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + uint32 shadowshock_timer; + uint32 shadowbuffet_timer; + bool HeroicMode; + + void Reset() + { + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, true); + shadowshock_timer = 2500; + shadowbuffet_timer = 5000; + } + + void EnterCombat(Unit *who) { } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (shadowshock_timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_SHADOW_SHOCK); + + shadowshock_timer = 5000; + }else shadowshock_timer -= diff; + + if (shadowbuffet_timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_SHADOW_BUFFET); + + shadowbuffet_timer = 5000; + }else shadowbuffet_timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_syth_shadow(Creature* pCreature) +{ + return new mob_syth_shadowAI (pCreature); +} + +void AddSC_boss_darkweaver_syth() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_darkweaver_syth"; + newscript->GetAI = &GetAI_boss_darkweaver_syth; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_syth_fire"; + newscript->GetAI = &GetAI_mob_syth_arcane; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_syth_arcane"; + newscript->GetAI = &GetAI_mob_syth_arcane; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_syth_frost"; + newscript->GetAI = &GetAI_mob_syth_frost; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_syth_shadow"; + newscript->GetAI = &GetAI_mob_syth_shadow; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/auchindoun/sethekk_halls/boss_tailonking_ikiss.cpp b/src/bindings/scripts/scripts/outland/auchindoun/sethekk_halls/boss_tailonking_ikiss.cpp new file mode 100644 index 00000000000..7830fc10645 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/auchindoun/sethekk_halls/boss_tailonking_ikiss.cpp @@ -0,0 +1,221 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Talon_King_Ikiss +SD%Complete: 80 +SDComment: Heroic supported. Some details missing, but most are spell related. +SDCategory: Auchindoun, Sethekk Halls +EndScriptData */ + +#include "precompiled.h" +#include "def_sethekk_halls.h" + +#define SAY_INTRO -1556007 + +#define SAY_AGGRO_1 -1556008 +#define SAY_AGGRO_2 -1556009 +#define SAY_AGGRO_3 -1556010 + +#define SAY_SLAY_1 -1556011 +#define SAY_SLAY_2 -1556012 +#define SAY_DEATH -1556013 +#define EMOTE_ARCANE_EXP -1556015 + +#define SPELL_BLINK 38194 +#define SPELL_BLINK_TELEPORT 38203 +#define SPELL_MANA_SHIELD 38151 +#define SPELL_ARCANE_BUBBLE 9438 +#define H_SPELL_SLOW 35032 + +#define SPELL_POLYMORPH 38245 +#define H_SPELL_POLYMORPH 43309 + +#define SPELL_ARCANE_VOLLEY 35059 +#define H_SPELL_ARCANE_VOLLEY 40424 + +#define SPELL_ARCANE_EXPLOSION 38197 +#define H_SPELL_ARCANE_EXPLOSION 40425 + +struct TRINITY_DLL_DECL boss_talon_king_ikissAI : public ScriptedAI +{ + boss_talon_king_ikissAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + bool HeroicMode; + + uint32 ArcaneVolley_Timer; + uint32 Sheep_Timer; + uint32 Blink_Timer; + uint32 Slow_Timer; + + bool ManaShield; + bool Blink; + bool Intro; + + void Reset() + { + HeroicMode = m_creature->GetMap()->IsHeroic(); + + ArcaneVolley_Timer = 5000; + Sheep_Timer = 8000; + Blink_Timer = 35000; + Slow_Timer = 15000+rand()%15000; + Blink = false; + Intro = false; + ManaShield = false; + } + + void MoveInLineOfSight(Unit *who) + { + if (!m_creature->getVictim() && who->isTargetableForAttack() && (m_creature->IsHostileTo(who)) && who->isInAccessiblePlaceFor(m_creature)) + { + if (!Intro && m_creature->IsWithinDistInMap(who, 100)) + { + Intro = true; + DoScriptText(SAY_INTRO, m_creature); + } + + if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) + return; + + float attackRadius = m_creature->GetAttackDistance(who); + if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who)) + { + //who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); + AttackStart(who); + } + } + } + + void EnterCombat(Unit *who) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; + } + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEATH, m_creature); + + if (pInstance) + pInstance->SetData(DATA_IKISSDOOREVENT, DONE); + } + + void KilledUnit(Unit* victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature); break; + case 1: DoScriptText(SAY_SLAY_2, m_creature); break; + } + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (Blink) + { + DoCast(m_creature,HeroicMode ? H_SPELL_ARCANE_EXPLOSION : SPELL_ARCANE_EXPLOSION); + m_creature->CastSpell(m_creature,SPELL_ARCANE_BUBBLE,true); + Blink = false; + } + + if (ArcaneVolley_Timer < diff) + { + DoCast(m_creature,HeroicMode ? H_SPELL_ARCANE_VOLLEY : SPELL_ARCANE_VOLLEY); + ArcaneVolley_Timer = 7000+rand()%5000; + }else ArcaneVolley_Timer -= diff; + + if (Sheep_Timer < diff) + { + //second top aggro target in normal, random target in heroic correct? + Unit *target = NULL; + target = HeroicMode ? SelectUnit(SELECT_TARGET_RANDOM,0) : SelectUnit(SELECT_TARGET_TOPAGGRO,1); + if (target) + DoCast(target,HeroicMode ? H_SPELL_POLYMORPH : SPELL_POLYMORPH); + Sheep_Timer = 15000+rand()%2500; + }else Sheep_Timer -= diff; + + //may not be correct time to cast + if (!ManaShield && ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 20)) + { + DoCast(m_creature,SPELL_MANA_SHIELD); + ManaShield = true; + } + + if (HeroicMode) + { + if (Slow_Timer < diff) + { + DoCast(m_creature,H_SPELL_SLOW); + Slow_Timer = 15000+rand()%25000; + }else Slow_Timer -= diff; + } + + if (Blink_Timer < diff) + { + DoScriptText(EMOTE_ARCANE_EXP, m_creature); + + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(false); + + //Spell doesn't work, but we use for visual effect at least + DoCast(target,SPELL_BLINK); + + float X = target->GetPositionX(); + float Y = target->GetPositionY(); + float Z = target->GetPositionZ(); + + DoTeleportTo(X,Y,Z); + + DoCast(target,SPELL_BLINK_TELEPORT); + Blink = true; + } + Blink_Timer = 35000+rand()%5000; + }else Blink_Timer -= diff; + + if (!Blink) + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_talon_king_ikiss(Creature* pCreature) +{ + return new boss_talon_king_ikissAI (pCreature); +} + +void AddSC_boss_talon_king_ikiss() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_talon_king_ikiss"; + newscript->GetAI = &GetAI_boss_talon_king_ikiss; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/auchindoun/sethekk_halls/def_sethekk_halls.h b/src/bindings/scripts/scripts/outland/auchindoun/sethekk_halls/def_sethekk_halls.h new file mode 100644 index 00000000000..6156f354d84 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/auchindoun/sethekk_halls/def_sethekk_halls.h @@ -0,0 +1,14 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_SETHEKK_HALLS_H +#define DEF_SETHEKK_HALLS_H + +enum +{ + DATA_IKISSDOOREVENT = 1, + TYPE_ANZU_ENCOUNTER = 2, +}; +#endif + diff --git a/src/bindings/scripts/scripts/outland/auchindoun/sethekk_halls/instance_sethekk_halls.cpp b/src/bindings/scripts/scripts/outland/auchindoun/sethekk_halls/instance_sethekk_halls.cpp new file mode 100644 index 00000000000..060e09a1325 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/auchindoun/sethekk_halls/instance_sethekk_halls.cpp @@ -0,0 +1,91 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance - Sethekk Halls +SD%Complete: 50 +SDComment: Instance Data for Sethekk Halls instance +SDCategory: Auchindoun, Sethekk Halls +EndScriptData */ + +#include "precompiled.h" +#include "def_sethekk_halls.h" + +enum +{ + NPC_ANZU = 23035, + IKISS_DOOR = 177203, +}; + +struct TRINITY_DLL_DECL instance_sethekk_halls : public ScriptedInstance +{ + instance_sethekk_halls(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint32 AnzuEncounter; + uint64 m_uiIkissDoorGUID; + + void Initialize() + { + AnzuEncounter = NOT_STARTED; + m_uiIkissDoorGUID = 0; + } + + void OnCreatureCreate(Creature* pCreature, bool add) + { + if (pCreature->GetEntry() == NPC_ANZU && AnzuEncounter >= IN_PROGRESS) + { + pCreature->DealDamage(pCreature, pCreature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + pCreature->RemoveCorpse(); + } else { + AnzuEncounter = IN_PROGRESS; + } + } + + void OnGameObjectCreate(GameObject* pGo, bool add) + { + if (pGo->GetEntry() == IKISS_DOOR) + m_uiIkissDoorGUID = pGo->GetGUID(); + } + + void SetData(uint32 type, uint32 data) + { + switch(type) + { + case DATA_IKISSDOOREVENT: + if (data == DONE) + DoUseDoorOrButton(m_uiIkissDoorGUID,DAY*IN_MILISECONDS); + break; + case TYPE_ANZU_ENCOUNTER: + AnzuEncounter = data; + break; + } + } +}; + +InstanceData* GetInstanceData_instance_sethekk_halls(Map* pMap) +{ + return new instance_sethekk_halls(pMap); +} + +void AddSC_instance_sethekk_halls() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_sethekk_halls"; + newscript->GetInstanceData = &GetInstanceData_instance_sethekk_halls; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp b/src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp new file mode 100644 index 00000000000..66e6b3a108d --- /dev/null +++ b/src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp @@ -0,0 +1,217 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Ambassador_Hellmaw +SD%Complete: 80 +SDComment: Enrage spell missing/not known +SDCategory: Auchindoun, Shadow Labyrinth +EndScriptData */ + +#include "precompiled.h" +#include "escort_ai.h" +#include "def_shadow_labyrinth.h" + +enum +{ + SAY_INTRO = -1555000, + SAY_AGGRO1 = -1555001, + SAY_AGGRO2 = -1555002, + SAY_AGGRO3 = -1555003, + SAY_HELP = -1555004, + SAY_SLAY1 = -1555005, + SAY_SLAY2 = -1555006, + SAY_DEATH = -1555007, + + SPELL_BANISH = 30231, + SPELL_CORROSIVE_ACID = 33551, + SPELL_FEAR = 33547, + SPELL_ENRAGE = 34970 +}; + +struct TRINITY_DLL_DECL boss_ambassador_hellmawAI : public npc_escortAI +{ + boss_ambassador_hellmawAI(Creature* pCreature) : npc_escortAI(pCreature) + { + m_pInstance = pCreature->GetInstanceData(); + HeroicMode = pCreature->GetMap()->IsHeroic(); + } + + ScriptedInstance* m_pInstance; + bool HeroicMode; + + uint32 EventCheck_Timer; + uint32 CorrosiveAcid_Timer; + uint32 Fear_Timer; + uint32 Enrage_Timer; + bool Intro; + bool IsBanished; + bool Enraged; + + void Reset() + { + EventCheck_Timer = 5000; + CorrosiveAcid_Timer = 5000 + rand()%5000; + Fear_Timer = 25000 + rand()%5000; + Enrage_Timer = 180000; + Intro = false; + IsBanished = true; + Enraged = false; + + if (m_pInstance && m_creature->isAlive()) + { + if (m_pInstance->GetData(TYPE_OVERSEER) != DONE) + m_creature->CastSpell(m_creature, SPELL_BANISH, true); + } + } + + void JustReachedHome() + { + if (m_pInstance) + m_pInstance->SetData(TYPE_HELLMAW, FAIL); + } + + void MoveInLineOfSight(Unit* pWho) + { + if (m_creature->HasAura(SPELL_BANISH)) + return; + + npc_escortAI::MoveInLineOfSight(pWho); + } + + void WaypointReached(uint32 i) + { + } + + void DoIntro() + { + if (m_creature->HasAura(SPELL_BANISH)) + m_creature->RemoveAurasDueToSpell(SPELL_BANISH); + + IsBanished = false; + Intro = true; + + if (m_pInstance) + { + if (m_pInstance->GetData(TYPE_HELLMAW) != FAIL) + { + DoScriptText(SAY_INTRO, m_creature); + Start(true, false, 0, NULL, false, true); + } + + m_pInstance->SetData(TYPE_HELLMAW, IN_PROGRESS); + } + } + + void EnterCombat(Unit *who) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_AGGRO1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO3, m_creature); break; + } + } + + void KilledUnit(Unit *victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + } + } + + void JustDied(Unit *victim) + { + DoScriptText(SAY_DEATH, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_HELLMAW, DONE); + } + + void UpdateAI(const uint32 diff) + { + if (!Intro && !IsBeingEscorted) + { + if (EventCheck_Timer < diff) + { + if (m_pInstance) + { + if (m_pInstance->GetData(TYPE_OVERSEER) == DONE) + { + DoIntro(); + return; + } + } + EventCheck_Timer = 5000; + return; + } + else + { + EventCheck_Timer -= diff; + return; + } + } + + npc_escortAI::UpdateAI(diff); + + if (!UpdateVictim()) + return; + + if (m_creature->HasAura(SPELL_BANISH, 0)) + { + EnterEvadeMode(); + return; + } + + if (CorrosiveAcid_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_CORROSIVE_ACID); + CorrosiveAcid_Timer = 15000 + rand()%10000; + }else CorrosiveAcid_Timer -= diff; + + if (Fear_Timer < diff) + { + DoCast(m_creature,SPELL_FEAR); + Fear_Timer = 20000 + rand()%15000; + }else Fear_Timer -= diff; + + if (HeroicMode) + { + if (!Enraged && Enrage_Timer < diff) + { + DoCast(m_creature,SPELL_ENRAGE); + Enraged = true; + }else Enrage_Timer -= diff; + } + } +}; + +CreatureAI* GetAI_boss_ambassador_hellmaw(Creature* pCreature) +{ + return new boss_ambassador_hellmawAI(pCreature); +} + +void AddSC_boss_ambassador_hellmaw() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_ambassador_hellmaw"; + newscript->GetAI = &GetAI_boss_ambassador_hellmaw; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp b/src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp new file mode 100644 index 00000000000..73374c08f8c --- /dev/null +++ b/src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp @@ -0,0 +1,177 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Blackheart_the_Inciter +SD%Complete: 75 +SDComment: Incite Chaos not functional since core lacks Mind Control support +SDCategory: Auchindoun, Shadow Labyrinth +EndScriptData */ + +#include "precompiled.h" +#include "def_shadow_labyrinth.h" + +#define SPELL_INCITE_CHAOS 33676 +#define SPELL_INCITE_CHAOS_B 33684 //debuff applied to each member of party +#define SPELL_CHARGE 33709 +#define SPELL_WAR_STOMP 33707 + +#define SAY_INTRO1 -1555008 +#define SAY_INTRO2 -1555009 +#define SAY_INTRO3 -1555010 +#define SAY_AGGRO1 -1555011 +#define SAY_AGGRO2 -1555012 +#define SAY_AGGRO3 -1555013 +#define SAY_SLAY1 -1555014 +#define SAY_SLAY2 -1555015 +#define SAY_HELP -1555016 +#define SAY_DEATH -1555017 + +#define SAY2_INTRO1 -1555018 +#define SAY2_INTRO2 -1555019 +#define SAY2_INTRO3 -1555020 +#define SAY2_AGGRO1 -1555021 +#define SAY2_AGGRO2 -1555022 +#define SAY2_AGGRO3 -1555023 +#define SAY2_SLAY1 -1555024 +#define SAY2_SLAY2 -1555025 +#define SAY2_HELP -1555026 +#define SAY2_DEATH -1555027 + +struct TRINITY_DLL_DECL boss_blackheart_the_inciterAI : public ScriptedAI +{ + boss_blackheart_the_inciterAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance *pInstance; + + bool InciteChaos; + uint32 InciteChaos_Timer; + uint32 InciteChaosWait_Timer; + uint32 Charge_Timer; + uint32 Knockback_Timer; + + void Reset() + { + InciteChaos = false; + InciteChaos_Timer = 20000; + InciteChaosWait_Timer = 15000; + Charge_Timer = 5000; + Knockback_Timer = 15000; + + if (pInstance) + pInstance->SetData(DATA_BLACKHEARTTHEINCITEREVENT, NOT_STARTED); + } + + void KilledUnit(Unit *victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + } + } + + void JustDied(Unit *victim) + { + DoScriptText(SAY_DEATH, m_creature); + + if (pInstance) + pInstance->SetData(DATA_BLACKHEARTTHEINCITEREVENT, DONE); + } + + void EnterCombat(Unit *who) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_AGGRO1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO3, m_creature); break; + } + + if (pInstance) + pInstance->SetData(DATA_BLACKHEARTTHEINCITEREVENT, IN_PROGRESS); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + if (InciteChaos) + { + if (InciteChaosWait_Timer < diff) + { + InciteChaos = false; + InciteChaosWait_Timer = 15000; + }else InciteChaosWait_Timer -= diff; + + return; + } + + if (InciteChaos_Timer < diff) + { + DoCast(m_creature, SPELL_INCITE_CHAOS); + + std::list t_list = m_creature->getThreatManager().getThreatList(); + for(std::list::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr) + { + Unit* target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()); + if (target && target->GetTypeId() == TYPEID_PLAYER) + target->CastSpell(target,SPELL_INCITE_CHAOS_B,true); + } + + DoResetThreat(); + InciteChaos = true; + InciteChaos_Timer = 40000; + return; + }else InciteChaos_Timer -= diff; + + //Charge_Timer + if (Charge_Timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + DoCast(target, SPELL_CHARGE); + Charge_Timer = 15000 + rand()%10000; + }else Charge_Timer -= diff; + + //Knockback_Timer + if (Knockback_Timer < diff) + { + DoCast(m_creature, SPELL_WAR_STOMP); + Knockback_Timer = 18000 + rand()%6000; + }else Knockback_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_blackheart_the_inciter(Creature* pCreature) +{ + return new boss_blackheart_the_inciterAI (pCreature); +} + +void AddSC_boss_blackheart_the_inciter() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_blackheart_the_inciter"; + newscript->GetAI = &GetAI_boss_blackheart_the_inciter; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp b/src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp new file mode 100644 index 00000000000..0cc6255f3cf --- /dev/null +++ b/src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp @@ -0,0 +1,321 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Grandmaster_Vorpil +SD%Complete: 100 +SDComment: +SDCategory: Auchindoun, Shadow Labyrinth +EndScriptData */ + +#include "precompiled.h" +#include "def_shadow_labyrinth.h" + +#define SAY_INTRO -1555028 +#define SAY_AGGRO1 -1555029 +#define SAY_AGGRO2 -1555030 +#define SAY_AGGRO3 -1555031 +#define SAY_HELP -1555032 +#define SAY_SLAY1 -1555033 +#define SAY_SLAY2 -1555034 +#define SAY_DEATH -1555035 + +#define SPELL_RAIN_OF_FIRE 33617 +#define H_SPELL_RAIN_OF_FIRE 39363 + +#define SPELL_DRAW_SHADOWS 33563 +#define SPELL_SHADOWBOLT_VOLLEY 33841 +#define SPELL_BANISH 38791 + +#define MOB_VOID_TRAVELER 19226 +#define SPELL_SACRIFICE 33587 +#define SPELL_SHADOW_NOVA 33846 +#define SPELL_EMPOWERING_SHADOWS 33783 +#define H_SPELL_EMPOWERING_SHADOWS 39364 + +#define MOB_VOID_PORTAL 19224 +#define SPELL_VOID_PORTAL_VISUAL 33569 + +float VorpilPosition[3] = {-252.8820,-264.3030,17.1}; + +float VoidPortalCoords[5][3] = +{ + {-283.5894, -239.5718, 12.7}, + {-306.5853, -258.4539, 12.7}, + {-295.8789, -269.0899, 12.7}, + {-209.3401, -262.7564, 17.1}, + {-261.4533, -297.3298, 17.1} +}; + +struct TRINITY_DLL_DECL mob_voidtravelerAI : public ScriptedAI +{ + mob_voidtravelerAI(Creature *c) : ScriptedAI(c) + { + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + bool HeroicMode; + Unit *Vorpil; + uint32 move; + bool sacrificed; + + void Reset() + { + Vorpil = NULL; + move = 0; + sacrificed = false; + } + + void EnterCombat(Unit *who){} + + void UpdateAI(const uint32 diff) + { + if (!Vorpil) + { + m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + return; + } + if (move < diff) + { + if (sacrificed) + { + SpellEntry *spell = GET_SPELL(HeroicMode?H_SPELL_EMPOWERING_SHADOWS:SPELL_EMPOWERING_SHADOWS); + if (spell) + Vorpil->AddAura(new Aura(spell, 1, NULL, Vorpil, m_creature)); + Vorpil->SetHealth(Vorpil->GetHealth()+Vorpil->GetMaxHealth()/25); + DoCast(m_creature, SPELL_SHADOW_NOVA, true); + m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + return; + } + m_creature->GetMotionMaster()->MoveFollow(Vorpil,0,0); + if (m_creature->IsWithinDist(Vorpil, 3)) + { + DoCast(m_creature, SPELL_SACRIFICE, false); + sacrificed = true; + move = 500; + return; + } + if (!Vorpil->isInCombat() || Vorpil->isDead()) + { + m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + return; + } + move = 1000; + }else move -= diff; + } +}; +CreatureAI* GetAI_mob_voidtraveler(Creature* pCreature) +{ + return new mob_voidtravelerAI (pCreature); +} + +struct TRINITY_DLL_DECL boss_grandmaster_vorpilAI : public ScriptedAI +{ + boss_grandmaster_vorpilAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + HeroicMode = m_creature->GetMap()->IsHeroic(); + Intro = false; + } + + ScriptedInstance *pInstance; + bool Intro, HelpYell; + bool sumportals; + bool HeroicMode; + + uint32 ShadowBoltVolley_Timer; + uint32 DrawShadows_Timer; + uint32 summonTraveler_Timer; + uint32 banish_Timer; + uint64 PortalsGuid[5]; + + void Reset() + { + ShadowBoltVolley_Timer = 7000 + rand()%7000; + DrawShadows_Timer = 45000; + summonTraveler_Timer = 90000; + banish_Timer = 17000; + HelpYell = false; + destroyPortals(); + + if (pInstance) + pInstance->SetData(DATA_GRANDMASTERVORPILEVENT, NOT_STARTED); + } + + void summonPortals() + { + if (!sumportals) + { + for (int i = 0;i<5; ++i) + { + Creature *Portal = NULL; + Portal = m_creature->SummonCreature(MOB_VOID_PORTAL,VoidPortalCoords[i][0],VoidPortalCoords[i][1],VoidPortalCoords[i][2],0,TEMPSUMMON_CORPSE_DESPAWN,3000000); + if (Portal) + { + PortalsGuid[i] = Portal->GetGUID(); + Portal->CastSpell(Portal,SPELL_VOID_PORTAL_VISUAL,false); + } + } + sumportals = true; + summonTraveler_Timer = 5000; + } + } + + void destroyPortals() + { + if (sumportals) + { + for (int i = 0;i < 5; i ++) + { + Unit *Portal = Unit::GetUnit((*m_creature), PortalsGuid[i]); + if (Portal && Portal->isAlive()) + Portal->DealDamage(Portal, Portal->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + PortalsGuid[i] = 0; + } + sumportals = false; + } + } + + void spawnVoidTraveler() + { + int pos = rand()%5; + m_creature->SummonCreature(MOB_VOID_TRAVELER,VoidPortalCoords[pos][0],VoidPortalCoords[pos][1],VoidPortalCoords[pos][2],0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,5000); + if (!HelpYell) + { + DoScriptText(SAY_HELP, m_creature); + HelpYell = true; + } + } + + void JustSummoned(Creature *summoned) + { + if (summoned && summoned->GetEntry() == MOB_VOID_TRAVELER) + CAST_AI(mob_voidtravelerAI, summoned->AI())->Vorpil = m_creature; + } + + void KilledUnit(Unit *victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + } + } + + void JustDied(Unit *victim) + { + DoScriptText(SAY_DEATH, m_creature); + destroyPortals(); + + if (pInstance) + pInstance->SetData(DATA_GRANDMASTERVORPILEVENT, DONE); + } + + void EnterCombat(Unit *who) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_AGGRO1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO3, m_creature); break; + } + summonPortals(); + + if (pInstance) + pInstance->SetData(DATA_GRANDMASTERVORPILEVENT, IN_PROGRESS); + } + + void MoveInLineOfSight(Unit *who) + { + ScriptedAI::MoveInLineOfSight(who); + + if (!Intro && m_creature->IsWithinLOSInMap(who)&& m_creature->IsWithinDistInMap(who, 100) && m_creature->IsHostileTo(who)) + { + DoScriptText(SAY_INTRO, m_creature); + Intro = true; + } + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (ShadowBoltVolley_Timer < diff) + { + DoCast(m_creature,SPELL_SHADOWBOLT_VOLLEY); + ShadowBoltVolley_Timer = 15000 + rand()%15000;; + }else ShadowBoltVolley_Timer -= diff; + + if (HeroicMode && banish_Timer < diff) + { + Unit *target = SelectTarget(SELECT_TARGET_RANDOM,0,30,false); + if (target) + { + DoCast(target,SPELL_BANISH); + banish_Timer = 16000; + } + }else banish_Timer -= diff; + + if (DrawShadows_Timer < diff) + { + Map* pMap = m_creature->GetMap(); + Map::PlayerList const &PlayerList = pMap->GetPlayers(); + for(Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) + if (Player* i_pl = i->getSource()) + if (i_pl->isAlive() && !i_pl->HasAura(SPELL_BANISH)) + i_pl->TeleportTo(m_creature->GetMapId(), VorpilPosition[0],VorpilPosition[1],VorpilPosition[2], 0, TELE_TO_NOT_LEAVE_COMBAT); + + m_creature->GetMap()->CreatureRelocation(m_creature, VorpilPosition[0],VorpilPosition[1],VorpilPosition[2],0.0f); + DoCast(m_creature,SPELL_DRAW_SHADOWS,true); + + DoCast(m_creature,HeroicMode?H_SPELL_RAIN_OF_FIRE:SPELL_RAIN_OF_FIRE); + + ShadowBoltVolley_Timer = 6000; + DrawShadows_Timer = 30000; + }else DrawShadows_Timer -= diff; + + if (summonTraveler_Timer < diff) + { + spawnVoidTraveler(); + summonTraveler_Timer = 10000; + //enrage at 20% + if ((m_creature->GetHealth()*5) < m_creature->GetMaxHealth()) + summonTraveler_Timer = 5000; + }else summonTraveler_Timer -=diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_grandmaster_vorpil(Creature* pCreature) +{ + return new boss_grandmaster_vorpilAI (pCreature); +} + +void AddSC_boss_grandmaster_vorpil() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_grandmaster_vorpil"; + newscript->GetAI = &GetAI_boss_grandmaster_vorpil; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_voidtraveler"; + newscript->GetAI = &GetAI_mob_voidtraveler; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/boss_murmur.cpp b/src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/boss_murmur.cpp new file mode 100644 index 00000000000..259f6091af6 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/boss_murmur.cpp @@ -0,0 +1,207 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Murmur +SD%Complete: 90 +SDComment: Timers may be incorrect +SDCategory: Auchindoun, Shadow Labyrinth +EndScriptData */ + +#include "precompiled.h" +#include "def_shadow_labyrinth.h" + +#define EMOTE_SONIC_BOOM -1555036 + +#define SPELL_SONIC_BOOM_CAST (HeroicMode?38796:33923) +#define SPELL_SONIC_BOOM_EFFECT (HeroicMode?38795:33666) +#define SPELL_RESONANCE 33657 +#define SPELL_MURMURS_TOUCH (HeroicMode?38794:33711) +#define SPELL_MAGNETIC_PULL 33689 +#define SPELL_SONIC_SHOCK 38797 +#define SPELL_THUNDERING_STORM 39365 + +struct TRINITY_DLL_DECL boss_murmurAI : public ScriptedAI +{ + boss_murmurAI(Creature *c) : ScriptedAI(c) + { + SetCombatMovement(false); + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + uint32 SonicBoom_Timer; + uint32 MurmursTouch_Timer; + uint32 Resonance_Timer; + uint32 MagneticPull_Timer; + uint32 SonicShock_Timer; + uint32 ThunderingStorm_Timer; + bool HeroicMode; + bool SonicBoom; + + void Reset() + { + SonicBoom_Timer = 30000; + MurmursTouch_Timer = 8000 + rand()%12000; + Resonance_Timer = 5000; + MagneticPull_Timer = 15000 + rand()%15000; + ThunderingStorm_Timer = 15000; + SonicShock_Timer = 10000; + SonicBoom = false; + + //database should have `RegenHealth`=0 to prevent regen + uint32 hp = (m_creature->GetMaxHealth()*40)/100; + if (hp) m_creature->SetHealth(hp); + m_creature->ResetPlayerDamageReq(); + } + + void SonicBoomEffect() + { + std::list t_list = m_creature->getThreatManager().getThreatList(); + for(std::list::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr) + { + Unit* target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()); + if (target && target->GetTypeId() == TYPEID_PLAYER) + { + //Not do anything without aura, spell can be resisted! + if (target->HasAura(SPELL_SONIC_BOOM_CAST) && m_creature->IsWithinDistInMap(target, 34.0f)) + { + //This will be wrong calculation. Also, comments suggest it must deal damage + target->SetHealth(uint32(target->GetMaxHealth() - target->GetMaxHealth() * 0.8)); + } + } + } + } + + void EnterCombat(Unit *who) { } + + // Sonic Boom instant damage (needs core fix instead of this) + void SpellHitTarget(Unit *target, const SpellEntry *spell) + { + if (target && target->isAlive() && spell && spell->Id == SPELL_SONIC_BOOM_EFFECT) + m_creature->DealDamage(target,(target->GetHealth()*90)/100,NULL,SPELL_DIRECT_DAMAGE,SPELL_SCHOOL_MASK_NATURE,spell); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target or casting + if (!UpdateVictim() || m_creature->IsNonMeleeSpellCasted(false)) + return; + + // Sonic Boom + if (SonicBoom) + { + DoCast(m_creature, SPELL_SONIC_BOOM_EFFECT, true); + SonicBoomEffect(); + + SonicBoom = false; + Resonance_Timer = 1500; + } + if (SonicBoom_Timer < diff) + { + DoScriptText(EMOTE_SONIC_BOOM, m_creature); + DoCast(m_creature, SPELL_SONIC_BOOM_CAST); + SonicBoom_Timer = 30000; + SonicBoom = true; + return; + }else SonicBoom_Timer -= diff; + + // Murmur's Touch + if (MurmursTouch_Timer < diff) + { + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM,0,80,true)) + DoCast(target, SPELL_MURMURS_TOUCH); + MurmursTouch_Timer = 25000 + rand()%10000; + }else MurmursTouch_Timer -= diff; + + // Resonance + if (!SonicBoom && !(m_creature->IsWithinMeleeRange(m_creature->getVictim()))) + { + if (Resonance_Timer < diff) + { + DoCast(m_creature, SPELL_RESONANCE); + Resonance_Timer = 5000; + }else Resonance_Timer -= diff; + } + + // Magnetic Pull + if (MagneticPull_Timer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (target->GetTypeId() == TYPEID_PLAYER && target->isAlive()) + { + DoCast(target, SPELL_MAGNETIC_PULL); + MagneticPull_Timer = 15000+rand()%15000; + return; + } + MagneticPull_Timer = 500; + }else MagneticPull_Timer -= diff; + + if (HeroicMode) + { + // Thundering Storm + if (ThunderingStorm_Timer < diff) + { + std::list& m_threatlist = m_creature->getThreatManager().getThreatList(); + for(std::list::iterator i = m_threatlist.begin(); i != m_threatlist.end(); ++i) + if (Unit* target = Unit::GetUnit((*m_creature),(*i)->getUnitGuid())) + if (target->isAlive() && !m_creature->IsWithinDist(target, 35, false)) + DoCast(target, SPELL_THUNDERING_STORM, true); + ThunderingStorm_Timer = 15000; + }else ThunderingStorm_Timer -= diff; + + // Sonic Shock + if (SonicShock_Timer < diff) + { + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM,0,20,false)) + if (target->isAlive()) + DoCast(target, SPELL_SONIC_SHOCK); + SonicShock_Timer = 10000+rand()%10000; + }else SonicShock_Timer -= diff; + } + + // Select nearest most aggro target if top aggro too far + if (!m_creature->isAttackReady()) + return; + if (!m_creature->IsWithinMeleeRange(m_creature->getVictim())) + { + std::list& m_threatlist = m_creature->getThreatManager().getThreatList(); + for(std::list::iterator i = m_threatlist.begin(); i != m_threatlist.end(); ++i) + if (Unit* target = Unit::GetUnit((*m_creature),(*i)->getUnitGuid())) + if (target->isAlive() && m_creature->IsWithinMeleeRange(target)) + { + m_creature->TauntApply(target); + break; + } + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_murmur(Creature* pCreature) +{ + return new boss_murmurAI (pCreature); +} + +void AddSC_boss_murmur() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_murmur"; + newscript->GetAI = &GetAI_boss_murmur; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/def_shadow_labyrinth.h b/src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/def_shadow_labyrinth.h new file mode 100644 index 00000000000..a78955368bf --- /dev/null +++ b/src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/def_shadow_labyrinth.h @@ -0,0 +1,15 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_SHADOW_LABYRINTH_H +#define DEF_SHADOW_LABYRINTH_H + +#define TYPE_HELLMAW 1 +#define TYPE_OVERSEER 2 +#define DATA_BLACKHEARTTHEINCITEREVENT 3 +#define DATA_GRANDMASTERVORPILEVENT 4 +#define DATA_MURMUREVENT 5 +#define DATA_GRANDMASTERVORPIL 6 +#endif + diff --git a/src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp b/src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp new file mode 100644 index 00000000000..f8f3b73bffa --- /dev/null +++ b/src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp @@ -0,0 +1,227 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Shadow_Labyrinth +SD%Complete: 85 +SDComment: Some cleanup left along with save +SDCategory: Auchindoun, Shadow Labyrinth +EndScriptData */ + +#include "precompiled.h" +#include "def_shadow_labyrinth.h" + +#define MAX_ENCOUNTER 5 + +#define REFECTORY_DOOR 183296 //door opened when blackheart the inciter dies +#define SCREAMING_HALL_DOOR 183295 //door opened when grandmaster vorpil dies + +/* Shadow Labyrinth encounters: +1 - Ambassador Hellmaw event +2 - Blackheart the Inciter event +3 - Grandmaster Vorpil event +4 - Murmur event +*/ + +struct TRINITY_DLL_DECL instance_shadow_labyrinth : public ScriptedInstance +{ + instance_shadow_labyrinth(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + std::string str_data; + + uint64 m_uiRefectoryDoorGUID; + uint64 m_uiScreamingHallDoorGUID; + + uint64 m_uiGrandmasterVorpil; + uint32 m_uiFelOverseerCount; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + m_uiRefectoryDoorGUID = 0; + m_uiScreamingHallDoorGUID = 0; + + m_uiGrandmasterVorpil = 0; + m_uiFelOverseerCount = 0; + } + + bool IsEncounterInProgress() const + { + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) return true; + + return false; + } + + void OnGameObjectCreate(GameObject* pGo, bool add) + { + switch(pGo->GetEntry()) + { + case REFECTORY_DOOR: + m_uiRefectoryDoorGUID = pGo->GetGUID(); + if (m_auiEncounter[2] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + case SCREAMING_HALL_DOOR: + m_uiScreamingHallDoorGUID = pGo->GetGUID(); + if (m_auiEncounter[3] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + } + } + + void OnCreatureCreate(Creature* pCreature, bool add) + { + switch(pCreature->GetEntry()) + { + case 18732: + m_uiGrandmasterVorpil = pCreature->GetGUID(); + break; + case 18796: + if (pCreature->isAlive()) + { + ++m_uiFelOverseerCount; + debug_log("TSCR: Shadow Labyrinth: counting %u Fel Overseers.",m_uiFelOverseerCount); + } + break; + } + } + + void SetData(uint32 type, uint32 uiData) + { + switch(type) + { + case TYPE_HELLMAW: + m_auiEncounter[0] = uiData; + break; + + case TYPE_OVERSEER: + if (uiData != DONE) + { + error_log("TSCR: Shadow Labyrinth: TYPE_OVERSEER did not expect other data than DONE"); + return; + } + if (m_uiFelOverseerCount) + { + --m_uiFelOverseerCount; + + if (m_uiFelOverseerCount) + debug_log("TSCR: Shadow Labyrinth: %u Fel Overseers left to kill.",m_uiFelOverseerCount); + else + { + m_auiEncounter[1] = DONE; + debug_log("TSCR: Shadow Labyrinth: TYPE_OVERSEER == DONE"); + } + } + break; + + case DATA_BLACKHEARTTHEINCITEREVENT: + if (uiData == DONE) + DoUseDoorOrButton(m_uiRefectoryDoorGUID); + m_auiEncounter[2] = uiData; + break; + + case DATA_GRANDMASTERVORPILEVENT: + if (uiData == DONE) + DoUseDoorOrButton(m_uiScreamingHallDoorGUID); + m_auiEncounter[3] = uiData; + break; + + case DATA_MURMUREVENT: + m_auiEncounter[4] = uiData; + break; + } + + if (uiData == DONE) + { + if (type == TYPE_OVERSEER && m_uiFelOverseerCount != 0) + return; + + OUT_SAVE_INST_DATA; + + std::ostringstream saveStream; + saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " + << m_auiEncounter[2] << " " << m_auiEncounter[3] << " " << m_auiEncounter[4]; + + str_data = saveStream.str(); + + SaveToDB(); + OUT_SAVE_INST_DATA_COMPLETE; + } + } + + uint32 GetData(uint32 type) + { + switch(type) + { + case TYPE_HELLMAW: return m_auiEncounter[0]; + case TYPE_OVERSEER: return m_auiEncounter[1]; + case DATA_GRANDMASTERVORPILEVENT: return m_auiEncounter[3]; + case DATA_MURMUREVENT: return m_auiEncounter[4]; + } + return false; + } + + uint64 GetData64(uint32 identifier) + { + if (identifier == DATA_GRANDMASTERVORPIL) + return m_uiGrandmasterVorpil; + + return 0; + } + + std::string GetSaveData() + { + return str_data; + } + + void Load(const char* in) + { + if (!in) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(in); + + std::istringstream loadStream(in); + loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3] >> m_auiEncounter[4]; + + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) + m_auiEncounter[i] = NOT_STARTED; + + OUT_LOAD_INST_DATA_COMPLETE; + } +}; + +InstanceData* GetInstanceData_instance_shadow_labyrinth(Map* pMap) +{ + return new instance_shadow_labyrinth(pMap); +} + +void AddSC_instance_shadow_labyrinth() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_shadow_labyrinth"; + newscript->GetInstanceData = &GetInstanceData_instance_shadow_labyrinth; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/auchenai_crypts/boss_exarch_maladaar.cpp b/src/bindings/scripts/scripts/outland/aunchindoun/auchenai_crypts/boss_exarch_maladaar.cpp deleted file mode 100644 index 414804a6576..00000000000 --- a/src/bindings/scripts/scripts/outland/aunchindoun/auchenai_crypts/boss_exarch_maladaar.cpp +++ /dev/null @@ -1,358 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Exarch_Maladaar -SD%Complete: 95 -SDComment: Most of event implemented, some adjustments to timers remain and possibly make some better code for switching his dark side in to better "images" of player. -SDCategory: Auchindoun, Auchenai Crypts -EndScriptData */ - -/* ContentData -mob_stolen_soul -boss_exarch_maladaar -mob_avatar_of_martyred -EndContentData */ - -#include "precompiled.h" - -#define SPELL_MOONFIRE 37328 -#define SPELL_FIREBALL 37329 -#define SPELL_MIND_FLAY 37330 -#define SPELL_HEMORRHAGE 37331 -#define SPELL_FROSTSHOCK 37332 -#define SPELL_CURSE_OF_AGONY 37334 -#define SPELL_MORTAL_STRIKE 37335 -#define SPELL_FREEZING_TRAP 37368 -#define SPELL_HAMMER_OF_JUSTICE 37369 - -struct TRINITY_DLL_DECL mob_stolen_soulAI : public ScriptedAI -{ - mob_stolen_soulAI(Creature *c) : ScriptedAI(c) {} - - uint8 myClass; - uint32 Class_Timer; - - void Reset() - { - Class_Timer = 1000; - } - - void EnterCombat(Unit *who) - { } - - void SetMyClass(uint8 myclass) - { - myClass = myclass; - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (Class_Timer < diff) - { - switch (myClass) - { - case CLASS_WARRIOR: - DoCast(m_creature->getVictim(), SPELL_MORTAL_STRIKE); - Class_Timer = 6000; - break; - case CLASS_PALADIN: - DoCast(m_creature->getVictim(), SPELL_HAMMER_OF_JUSTICE); - Class_Timer = 6000; - break; - case CLASS_HUNTER: - DoCast(m_creature->getVictim(), SPELL_FREEZING_TRAP); - Class_Timer = 20000; - break; - case CLASS_ROGUE: - DoCast(m_creature->getVictim(), SPELL_HEMORRHAGE); - Class_Timer = 10000; - break; - case CLASS_PRIEST: - DoCast(m_creature->getVictim(), SPELL_MIND_FLAY); - Class_Timer = 5000; - break; - case CLASS_SHAMAN: - DoCast(m_creature->getVictim(), SPELL_FROSTSHOCK); - Class_Timer = 8000; - break; - case CLASS_MAGE: - DoCast(m_creature->getVictim(), SPELL_FIREBALL); - Class_Timer = 5000; - break; - case CLASS_WARLOCK: - DoCast(m_creature->getVictim(), SPELL_CURSE_OF_AGONY); - Class_Timer = 20000; - break; - case CLASS_DRUID: - DoCast(m_creature->getVictim(), SPELL_MOONFIRE); - Class_Timer = 10000; - break; - } - } else Class_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_stolen_soul(Creature* pCreature) -{ - return new mob_stolen_soulAI (pCreature); -} - -#define SAY_INTRO -1558000 -#define SAY_SUMMON -1558001 - -#define SAY_AGGRO_1 -1558002 -#define SAY_AGGRO_2 -1558003 -#define SAY_AGGRO_3 -1558004 - -#define SAY_ROAR -1558005 -#define SAY_SOUL_CLEAVE -1558006 - -#define SAY_SLAY_1 -1558007 -#define SAY_SLAY_2 -1558008 - -#define SAY_DEATH -1558009 - -#define SPELL_RIBBON_OF_SOULS 32422 -#define SPELL_SOUL_SCREAM 32421 - -#define SPELL_STOLEN_SOUL 32346 -#define SPELL_STOLEN_SOUL_VISUAL 32395 - -#define SPELL_SUMMON_AVATAR 32424 - -#define ENTRY_STOLEN_SOUL 18441 - -struct TRINITY_DLL_DECL boss_exarch_maladaarAI : public ScriptedAI -{ - boss_exarch_maladaarAI(Creature *c) : ScriptedAI(c) - { - HasTaunted = false; - } - - uint32 soulmodel; - uint64 soulholder; - uint8 soulclass; - - uint32 Fear_timer; - uint32 Ribbon_of_Souls_timer; - uint32 StolenSoul_Timer; - - bool HasTaunted; - bool Avatar_summoned; - - void Reset() - { - soulmodel = 0; - soulholder = 0; - soulclass = 0; - - Fear_timer = 15000 + rand()% 5000; - Ribbon_of_Souls_timer = 5000; - StolenSoul_Timer = 25000 + rand()% 10000; - - Avatar_summoned = false; - } - - void MoveInLineOfSight(Unit *who) - { - if (!HasTaunted && m_creature->IsWithinDistInMap(who, 150.0)) - { - DoScriptText(SAY_INTRO, m_creature); - HasTaunted = true; - } - - ScriptedAI::MoveInLineOfSight(who); - } - - - void EnterCombat(Unit *who) - { - switch (rand()%3) - { - case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; - case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; - case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; - } - } - - void JustSummoned(Creature *summoned) - { - if (summoned->GetEntry() == ENTRY_STOLEN_SOUL) - { - //SPELL_STOLEN_SOUL_VISUAL has shapeshift effect, but not implemented feature in Trinity for this spell. - summoned->CastSpell(summoned,SPELL_STOLEN_SOUL_VISUAL,false); - summoned->SetDisplayId(soulmodel); - summoned->setFaction(m_creature->getFaction()); - - if (Unit *target = Unit::GetUnit(*m_creature,soulholder)) - { - - CAST_AI(mob_stolen_soulAI, summoned->AI())->SetMyClass(soulclass); - summoned->AI()->AttackStart(target); - } - } - } - - void KilledUnit(Unit* victim) - { - if (rand()%2) - return; - - switch (rand()%2) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature); break; - case 1: DoScriptText(SAY_SLAY_2, m_creature); break; - } - } - - void JustDied(Unit* Killer) - { - DoScriptText(SAY_DEATH, m_creature); - //When Exarch Maladar is defeated D'ore appear. - m_creature->SummonCreature(19412, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 600000); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (!Avatar_summoned && ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 25)) - { - if (m_creature->IsNonMeleeSpellCasted(false)) - m_creature->InterruptNonMeleeSpells(true); - - DoScriptText(SAY_SUMMON, m_creature); - - DoCast(m_creature, SPELL_SUMMON_AVATAR); - Avatar_summoned = true; - StolenSoul_Timer = 15000 + rand()% 15000; - } - - if (StolenSoul_Timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - { - if (target->GetTypeId() == TYPEID_PLAYER) - { - if (m_creature->IsNonMeleeSpellCasted(false)) - m_creature->InterruptNonMeleeSpells(true); - - uint32 i = urand(1,2); - if (i == 1) - DoScriptText(SAY_ROAR, m_creature); - else - DoScriptText(SAY_SOUL_CLEAVE, m_creature); - - soulmodel = target->GetDisplayId(); - soulholder = target->GetGUID(); - soulclass = target->getClass(); - - DoCast(target,SPELL_STOLEN_SOUL); - m_creature->SummonCreature(ENTRY_STOLEN_SOUL, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000); - - StolenSoul_Timer = 20000 + rand()% 10000; - } else StolenSoul_Timer = 1000; - } - }else StolenSoul_Timer -= diff; - - if (Ribbon_of_Souls_timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_RIBBON_OF_SOULS); - - Ribbon_of_Souls_timer = 5000 + (rand()%20 * 1000); - }else Ribbon_of_Souls_timer -= diff; - - if (Fear_timer < diff) - { - DoCast(m_creature,SPELL_SOUL_SCREAM); - Fear_timer = 15000 + rand()% 15000; - }else Fear_timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_exarch_maladaar(Creature* pCreature) -{ - return new boss_exarch_maladaarAI (pCreature); -} - -#define SPELL_AV_MORTAL_STRIKE 16856 -#define SPELL_AV_SUNDER_ARMOR 16145 - -struct TRINITY_DLL_DECL mob_avatar_of_martyredAI : public ScriptedAI -{ - mob_avatar_of_martyredAI(Creature *c) : ScriptedAI(c) {} - - uint32 Mortal_Strike_timer; - - void Reset() - { - Mortal_Strike_timer = 10000; - } - - void EnterCombat(Unit *who) - { - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (Mortal_Strike_timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_AV_MORTAL_STRIKE); - Mortal_Strike_timer = 10000 + rand()%20 * 1000; - } else Mortal_Strike_timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_avatar_of_martyred(Creature* pCreature) -{ - return new mob_avatar_of_martyredAI (pCreature); -} - -void AddSC_boss_exarch_maladaar() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_exarch_maladaar"; - newscript->GetAI = &GetAI_boss_exarch_maladaar; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_avatar_of_martyred"; - newscript->GetAI = &GetAI_mob_avatar_of_martyred; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_stolen_soul"; - newscript->GetAI = &GetAI_mob_stolen_soul; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp b/src/bindings/scripts/scripts/outland/aunchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp deleted file mode 100644 index 4dfdd407731..00000000000 --- a/src/bindings/scripts/scripts/outland/aunchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp +++ /dev/null @@ -1,212 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -Name: Boss_Shirrak_the_dead_watcher -%Complete: 80 -Comment: InhibitMagic should stack slower far from the boss, proper Visual for Focus Fire, heroic implemented -Category: Auchindoun, Auchenai Crypts -EndScriptData */ - -#include "precompiled.h" - -#define SPELL_INHIBITMAGIC 32264 -#define SPELL_ATTRACTMAGIC 32265 -#define N_SPELL_CARNIVOROUSBITE 36383 -#define H_SPELL_CARNIVOROUSBITE 39382 -#define SPELL_CARNIVOROUSBITE (HeroicMode?H_SPELL_CARNIVOROUSBITE:N_SPELL_CARNIVOROUSBITE) - -#define ENTRY_FOCUS_FIRE 18374 - -#define N_SPELL_FIERY_BLAST 32302 -#define H_SPELL_FIERY_BLAST 38382 -#define SPELL_FIERY_BLAST (HeroicMode?H_SPELL_FIERY_BLAST:N_SPELL_FIERY_BLAST) -#define SPELL_FOCUS_FIRE_VISUAL 42075 //need to find better visual - -struct TRINITY_DLL_DECL boss_shirrak_the_dead_watcherAI : public ScriptedAI -{ - boss_shirrak_the_dead_watcherAI(Creature *c) : ScriptedAI(c) - { - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - uint32 Inhibitmagic_Timer; - uint32 Attractmagic_Timer; - uint32 Carnivorousbite_Timer; - uint32 FocusFire_Timer; - bool HeroicMode; - Unit *focusedTarget; - - void Reset() - { - Inhibitmagic_Timer = 0; - Attractmagic_Timer = 28000; - Carnivorousbite_Timer = 10000; - FocusFire_Timer = 17000; - focusedTarget = NULL; - } - - void EnterCombat(Unit *who) - { } - - void JustSummoned(Creature *summoned) - { - if (summoned && summoned->GetEntry() == ENTRY_FOCUS_FIRE) - { - summoned->CastSpell(summoned,SPELL_FOCUS_FIRE_VISUAL,false); - summoned->setFaction(m_creature->getFaction()); - summoned->SetLevel(m_creature->getLevel()); - summoned->addUnitState(UNIT_STAT_ROOT); - - if (focusedTarget) - summoned->AI()->AttackStart(focusedTarget); - } - } - - void UpdateAI(const uint32 diff) - { - //Inhibitmagic_Timer - if (Inhibitmagic_Timer < diff) - { - float dist; - Map* pMap = m_creature->GetMap(); - Map::PlayerList const &PlayerList = pMap->GetPlayers(); - for(Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) - if (Player* i_pl = i->getSource()) - if (i_pl->isAlive() && (dist = i_pl->IsWithinDist(m_creature, 45))) - { - i_pl->RemoveAurasDueToSpell(SPELL_INHIBITMAGIC); - m_creature->AddAura(SPELL_INHIBITMAGIC, i_pl); - if (dist < 35) - m_creature->AddAura(SPELL_INHIBITMAGIC, i_pl); - if (dist < 25) - m_creature->AddAura(SPELL_INHIBITMAGIC, i_pl); - if (dist < 15) - m_creature->AddAura(SPELL_INHIBITMAGIC, i_pl); - } - Inhibitmagic_Timer = 3000+(rand()%1000); - }else Inhibitmagic_Timer -= diff; - - //Return since we have no target - if (!UpdateVictim()) - return; - - //Attractmagic_Timer - if (Attractmagic_Timer < diff) - { - DoCast(m_creature,SPELL_ATTRACTMAGIC); - Attractmagic_Timer = 30000; - Carnivorousbite_Timer = 1500; - }else Attractmagic_Timer -= diff; - - //Carnivorousbite_Timer - if (Carnivorousbite_Timer < diff) - { - DoCast(m_creature,SPELL_CARNIVOROUSBITE); - Carnivorousbite_Timer = 10000; - }else Carnivorousbite_Timer -= diff; - - //FocusFire_Timer - if (FocusFire_Timer < diff) - { - // Summon Focus Fire & Emote - Unit *target = SelectUnit(SELECT_TARGET_RANDOM,1); - if (target && target->GetTypeId() == TYPEID_PLAYER && target->isAlive()) - { - focusedTarget = target; - m_creature->SummonCreature(ENTRY_FOCUS_FIRE,target->GetPositionX(),target->GetPositionY(),target->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN,5500); - - // TODO: Find better way to handle emote - // Emote - std::string *emote = new std::string("focuses on "); - emote->append(target->GetName()); - emote->append("!"); - const char* text = emote->c_str(); - m_creature->MonsterTextEmote(text, 0, true); - delete emote; - } - FocusFire_Timer = 15000+(rand()%5000); - }else FocusFire_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_shirrak_the_dead_watcher(Creature* pCreature) -{ - return new boss_shirrak_the_dead_watcherAI (pCreature); -} - -struct TRINITY_DLL_DECL mob_focus_fireAI : public ScriptedAI -{ - mob_focus_fireAI(Creature *c) : ScriptedAI(c) - { - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - bool HeroicMode; - uint32 FieryBlast_Timer; - bool fiery1, fiery2; - - void Reset() - { - FieryBlast_Timer = 3000+(rand()%1000); - fiery1 = fiery2 = true; - } - - void EnterCombat(Unit *who) - { } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //FieryBlast_Timer - if (fiery2 && FieryBlast_Timer < diff) - { - DoCast(m_creature,SPELL_FIERY_BLAST); - - if (fiery1) fiery1 = false; - else if (fiery2) fiery2 = false; - - FieryBlast_Timer = 1000; - }else FieryBlast_Timer -= diff; - - //DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_focus_fire(Creature* pCreature) -{ - return new mob_focus_fireAI (pCreature); -} - -void AddSC_boss_shirrak_the_dead_watcher() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_shirrak_the_dead_watcher"; - newscript->GetAI = &GetAI_boss_shirrak_the_dead_watcher; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_focus_fire"; - newscript->GetAI = &GetAI_mob_focus_fire; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp b/src/bindings/scripts/scripts/outland/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp deleted file mode 100644 index dcaaefee8c2..00000000000 --- a/src/bindings/scripts/scripts/outland/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp +++ /dev/null @@ -1,369 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_NexusPrince_Shaffar -SD%Complete: 80 -SDComment: Need more tuning of spell timers, it should not be as linear fight as current. Also should possibly find a better way to deal with his three initial beacons to make sure all aggro. -SDCategory: Auchindoun, Mana Tombs -EndScriptData */ - -/* ContentData -boss_nexusprince_shaffar -mob_ethereal_beacon -EndContentData */ - -#include "precompiled.h" - -enum -{ - SAY_INTRO = -1557000, - SAY_AGGRO_1 = -1557001, - SAY_AGGRO_2 = -1557002, - SAY_AGGRO_3 = -1557003, - SAY_SLAY_1 = -1557004, - SAY_SLAY_2 = -1557005, - SAY_SUMMON = -1557006, - SAY_DEAD = -1557007, - - SPELL_BLINK = 34605, - SPELL_FROSTBOLT = 32364, - SPELL_FIREBALL = 32363, - SPELL_FROSTNOVA = 32365, - - SPELL_ETHEREAL_BEACON = 32371, // Summons NPC_BEACON - SPELL_ETHEREAL_BEACON_VISUAL = 32368, - - NPC_BEACON = 18431, - NPC_SHAFFAR = 18344, - - NR_INITIAL_BEACONS = 3 -}; - -struct TRINITY_DLL_DECL boss_nexusprince_shaffarAI : public ScriptedAI -{ - boss_nexusprince_shaffarAI(Creature *c) : ScriptedAI(c), summons(me) { HasTaunted = false; } - - uint32 Blink_Timer; - uint32 Beacon_Timer; - uint32 FireBall_Timer; - uint32 Frostbolt_Timer; - uint32 FrostNova_Timer; - - SummonList summons; - - bool HasTaunted; - bool CanBlink; - - void Reset() - { - Blink_Timer = 1500; - Beacon_Timer = 10000; - FireBall_Timer = 8000; - Frostbolt_Timer = 4000; - FrostNova_Timer = 15000; - - CanBlink = false; - - float dist = 8.0f; - float posX, posY, posZ, angle; - m_creature->GetHomePosition(posX, posY, posZ, angle); - - m_creature->SummonCreature(NPC_BEACON, posX - dist, posY - dist, posZ, angle, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 7200000); - m_creature->SummonCreature(NPC_BEACON, posX - dist, posY + dist, posZ, angle, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 7200000); - m_creature->SummonCreature(NPC_BEACON, posX + dist, posY, posZ, angle, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 7200000); - } - - void EnterEvadeMode() - { - summons.DespawnAll(); - ScriptedAI::EnterEvadeMode(); - } - - void MoveInLineOfSight(Unit *who) - { - if (!HasTaunted && who->GetTypeId() == TYPEID_PLAYER && m_creature->IsWithinDistInMap(who, 100.0f)) - { - DoScriptText(SAY_INTRO, m_creature); - HasTaunted = true; - } - } - - void EnterCombat(Unit *who) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; - case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; - case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; - } - - DoZoneInCombat(); - summons.DoZoneInCombat(); - } - - void JustSummoned(Creature *summoned) - { - if (summoned->GetEntry() == NPC_BEACON) - { - summoned->CastSpell(summoned,SPELL_ETHEREAL_BEACON_VISUAL,false); - - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - summoned->AI()->AttackStart(target); - } - - summons.Summon(summoned); - } - - void SummonedCreatureDespawn(Creature *summon) - { - summons.Despawn(summon); - } - - void KilledUnit(Unit* victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature); break; - case 1: DoScriptText(SAY_SLAY_2, m_creature); break; - } - } - - void JustDied(Unit* Killer) - { - DoScriptText(SAY_DEAD, m_creature); - summons.DespawnAll(); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (FrostNova_Timer < diff) - { - if (m_creature->IsNonMeleeSpellCasted(false)) - m_creature->InterruptNonMeleeSpells(true); - - DoCast(m_creature,SPELL_FROSTNOVA); - FrostNova_Timer = 17500 + rand()%7500; - CanBlink = true; - }else FrostNova_Timer -= diff; - - if (Frostbolt_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_FROSTBOLT); - Frostbolt_Timer = 4500 + rand()%1500; - }else Frostbolt_Timer -= diff; - - if (FireBall_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_FIREBALL); - FireBall_Timer = 4500 + rand()%1500; - }else FireBall_Timer -= diff; - - if (CanBlink) - { - if (Blink_Timer < diff) - { - if (m_creature->IsNonMeleeSpellCasted(false)) - m_creature->InterruptNonMeleeSpells(true); - - //expire movement, will prevent from running right back to victim after cast - //(but should MoveChase be used again at a certain time or should he not move?) - if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE) - m_creature->GetMotionMaster()->MovementExpired(); - - DoCast(m_creature,SPELL_BLINK); - Blink_Timer = 1000 + rand()%1500; - CanBlink = false; - }else Blink_Timer -= diff; - } - - if (Beacon_Timer < diff) - { - if (m_creature->IsNonMeleeSpellCasted(false)) - m_creature->InterruptNonMeleeSpells(true); - - if (!urand(0,3)) - DoScriptText(SAY_SUMMON, m_creature); - - DoCast(m_creature,SPELL_ETHEREAL_BEACON, true); - - Beacon_Timer = 10000; - }else Beacon_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_nexusprince_shaffar(Creature* pCreature) -{ - return new boss_nexusprince_shaffarAI (pCreature); -} - -enum -{ - SPELL_ARCANE_BOLT = 15254, - SPELL_ETHEREAL_APPRENTICE = 32372 // Summon 18430 -}; - -struct TRINITY_DLL_DECL mob_ethereal_beaconAI : public ScriptedAI -{ - mob_ethereal_beaconAI(Creature *c) : ScriptedAI(c) - { - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - bool HeroicMode; - uint32 Apprentice_Timer; - uint32 ArcaneBolt_Timer; - uint32 Check_Timer; - - void KillSelf() - { - m_creature->Kill(m_creature); - } - - void Reset() - { - Apprentice_Timer = (HeroicMode ? 10000 : 20000); - ArcaneBolt_Timer = 1000; - Check_Timer = 1000; - } - - void EnterCombat(Unit *who) - { - // Send Shaffar to fight - Creature* Shaffar = me->FindNearestCreature(NPC_SHAFFAR, 100); - if (!Shaffar || Shaffar->isDead()) - { - KillSelf(); - return; - } - if (!Shaffar->isInCombat()) - Shaffar->AI()->AttackStart(who); - } - - void JustSummoned(Creature *summoned) - { - summoned->AI()->AttackStart(m_creature->getVictim()); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (Check_Timer < diff) - { - Creature *Shaffar = me->FindNearestCreature(NPC_SHAFFAR, 100); - if (!Shaffar || Shaffar->isDead() || !Shaffar->isInCombat()) - { - KillSelf(); - return; - } - Check_Timer = 1000; - }else Check_Timer -= diff; - - if (ArcaneBolt_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_ARCANE_BOLT); - ArcaneBolt_Timer = 2000 + rand()%2500; - }else ArcaneBolt_Timer -= diff; - - if (Apprentice_Timer < diff) - { - if (m_creature->IsNonMeleeSpellCasted(false)) - m_creature->InterruptNonMeleeSpells(true); - - m_creature->CastSpell(m_creature,SPELL_ETHEREAL_APPRENTICE,true); - m_creature->ForcedDespawn(); - return; - }else Apprentice_Timer -= diff; - } -}; - -CreatureAI* GetAI_mob_ethereal_beacon(Creature* pCreature) -{ - return new mob_ethereal_beaconAI (pCreature); -} - -enum -{ - SPELL_ETHEREAL_APPRENTICE_FIREBOLT = 32369, - SPELL_ETHEREAL_APPRENTICE_FROSTBOLT = 32370 -}; - -struct TRINITY_DLL_DECL mob_ethereal_apprenticeAI : public ScriptedAI -{ - mob_ethereal_apprenticeAI(Creature *c) : ScriptedAI(c) {} - - uint32 Cast_Timer; - - bool isFireboltTurn; - - void Reset() - { - Cast_Timer = 3000; - isFireboltTurn = true; - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (Cast_Timer < diff) - { - if (isFireboltTurn) - { - m_creature->CastSpell(m_creature->getVictim(), SPELL_ETHEREAL_APPRENTICE_FIREBOLT, true); - isFireboltTurn = false; - }else{ - m_creature->CastSpell(m_creature->getVictim(), SPELL_ETHEREAL_APPRENTICE_FROSTBOLT, true); - isFireboltTurn = true; - } - Cast_Timer = 3000; - }else Cast_Timer -= diff; - } -}; - -CreatureAI* GetAI_mob_ethereal_apprentice(Creature* pCreature) -{ - return new mob_ethereal_apprenticeAI (pCreature); -} - -void AddSC_boss_nexusprince_shaffar() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_nexusprince_shaffar"; - newscript->GetAI = &GetAI_boss_nexusprince_shaffar; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_ethereal_beacon"; - newscript->GetAI = &GetAI_mob_ethereal_beacon; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_ethereal_apprentice"; - newscript->GetAI = &GetAI_mob_ethereal_apprentice; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/mana_tombs/boss_pandemonius.cpp b/src/bindings/scripts/scripts/outland/aunchindoun/mana_tombs/boss_pandemonius.cpp deleted file mode 100644 index 77e1c535340..00000000000 --- a/src/bindings/scripts/scripts/outland/aunchindoun/mana_tombs/boss_pandemonius.cpp +++ /dev/null @@ -1,138 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Pandemonius -SD%Complete: 75 -SDComment: Not known how void blast is done (amount of rapid cast seems to be related to players in party). All mobs remaining in surrounding area should aggro when engaged. -SDCategory: Auchindoun, Mana Tombs -EndScriptData */ - -#include "precompiled.h" - -#define SAY_AGGRO_1 -1557008 -#define SAY_AGGRO_2 -1557009 -#define SAY_AGGRO_3 -1557010 - -#define SAY_KILL_1 -1557011 -#define SAY_KILL_2 -1557012 - -#define SAY_DEATH -1557013 - -#define EMOTE_DARK_SHELL -1557014 - -#define SPELL_VOID_BLAST 32325 -#define H_SPELL_VOID_BLAST 38760 -#define SPELL_DARK_SHELL 32358 -#define H_SPELL_DARK_SHELL 38759 - -struct TRINITY_DLL_DECL boss_pandemoniusAI : public ScriptedAI -{ - boss_pandemoniusAI(Creature *c) : ScriptedAI(c) - { - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - bool HeroicMode; - uint32 VoidBlast_Timer; - uint32 DarkShell_Timer; - uint32 VoidBlast_Counter; - - void Reset() - { - VoidBlast_Timer = 8000+rand()%15000; - DarkShell_Timer = 20000; - VoidBlast_Counter = 0; - } - - void JustDied(Unit* Killer) - { - DoScriptText(SAY_DEATH, m_creature); - } - - void KilledUnit(Unit* victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_KILL_1, m_creature); break; - case 1: DoScriptText(SAY_KILL_2, m_creature); break; - } - } - - void EnterCombat(Unit *who) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; - case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; - case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; - } - - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (VoidBlast_Timer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - { - DoCast(target,HeroicMode ? H_SPELL_VOID_BLAST : SPELL_VOID_BLAST); - VoidBlast_Timer = 500; - ++VoidBlast_Counter; - } - - if (VoidBlast_Counter == 5) - { - VoidBlast_Timer = 15000+rand()%10000; - VoidBlast_Counter = 0; - } - }else VoidBlast_Timer -= diff; - - if (!VoidBlast_Counter) - { - if (DarkShell_Timer < diff) - { - if (m_creature->IsNonMeleeSpellCasted(false)) - m_creature->InterruptNonMeleeSpells(true); - - DoScriptText(EMOTE_DARK_SHELL, m_creature); - - DoCast(m_creature,HeroicMode ? H_SPELL_DARK_SHELL : SPELL_DARK_SHELL); - DarkShell_Timer = 20000; - }else DarkShell_Timer -= diff; - } - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_pandemonius(Creature* pCreature) -{ - return new boss_pandemoniusAI (pCreature); -} - -void AddSC_boss_pandemonius() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_pandemonius"; - newscript->GetAI = &GetAI_boss_pandemonius; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/boss_darkweaver_syth.cpp b/src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/boss_darkweaver_syth.cpp deleted file mode 100644 index 00e43fa257d..00000000000 --- a/src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/boss_darkweaver_syth.cpp +++ /dev/null @@ -1,438 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Darkweaver_Syth -SD%Complete: 85 -SDComment: Shock spells/times need more work. Heroic partly implemented. -SDCategory: Auchindoun, Sethekk Halls -EndScriptData */ - -#include "precompiled.h" - -#define SAY_SUMMON -1556000 - -#define SAY_AGGRO_1 -1556001 -#define SAY_AGGRO_2 -1556002 -#define SAY_AGGRO_3 -1556003 - -#define SAY_SLAY_1 -1556004 -#define SAY_SLAY_2 -1556005 - -#define SAY_DEATH -1556006 - -#define SPELL_FROST_SHOCK 21401 //37865 -#define SPELL_FLAME_SHOCK 34354 -#define SPELL_SHADOW_SHOCK 30138 -#define SPELL_ARCANE_SHOCK 37132 - -#define SPELL_CHAIN_LIGHTNING 15659 //15305 - -#define SPELL_SUMMON_SYTH_FIRE 33537 // Spawns 19203 -#define SPELL_SUMMON_SYTH_ARCANE 33538 // Spawns 19205 -#define SPELL_SUMMON_SYTH_FROST 33539 // Spawns 19204 -#define SPELL_SUMMON_SYTH_SHADOW 33540 // Spawns 19206 - -#define SPELL_FLAME_BUFFET (HeroicMode?38141:33526) -#define SPELL_ARCANE_BUFFET (HeroicMode?38138:33527) -#define SPELL_FROST_BUFFET (HeroicMode?38142:33528) -#define SPELL_SHADOW_BUFFET (HeroicMode?38143:33529) - -struct TRINITY_DLL_DECL boss_darkweaver_sythAI : public ScriptedAI -{ - boss_darkweaver_sythAI(Creature *c) : ScriptedAI(c) - - { - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - uint32 flameshock_timer; - uint32 arcaneshock_timer; - uint32 frostshock_timer; - uint32 shadowshock_timer; - uint32 chainlightning_timer; - - bool summon90; - bool summon50; - bool summon10; - bool HeroicMode; - - void Reset() - { - flameshock_timer = 2000; - arcaneshock_timer = 4000; - frostshock_timer = 6000; - shadowshock_timer = 8000; - chainlightning_timer = 15000; - - summon90 = false; - summon50 = false; - summon10 = false; - } - - void EnterCombat(Unit *who) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; - case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; - case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; - } - } - - void JustDied(Unit* Killer) - { - DoScriptText(SAY_DEATH, m_creature); - } - - void KilledUnit(Unit* victim) - { - if (rand()%2) - return; - - switch(rand()%2) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature); break; - case 1: DoScriptText(SAY_SLAY_2, m_creature); break; - } - } - - void JustSummoned(Creature *summoned) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - summoned->AI()->AttackStart(target); - } - - void SythSummoning() - { - DoScriptText(SAY_SUMMON, m_creature); - - if (m_creature->IsNonMeleeSpellCasted(false)) - m_creature->InterruptNonMeleeSpells(false); - - DoCast(m_creature,SPELL_SUMMON_SYTH_ARCANE,true); //front - DoCast(m_creature,SPELL_SUMMON_SYTH_FIRE,true); //back - DoCast(m_creature,SPELL_SUMMON_SYTH_FROST,true); //left - DoCast(m_creature,SPELL_SUMMON_SYTH_SHADOW,true); //right - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 90) && !summon90) - { - SythSummoning(); - summon90 = true; - } - - if (((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 50) && !summon50) - { - SythSummoning(); - summon50 = true; - } - - if (((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 10) && !summon10) - { - SythSummoning(); - summon10 = true; - } - - if (flameshock_timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_FLAME_SHOCK); - - flameshock_timer = 10000 + rand()%5000; - } else flameshock_timer -= diff; - - if (arcaneshock_timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_ARCANE_SHOCK); - - arcaneshock_timer = 10000 + rand()%5000; - } else arcaneshock_timer -= diff; - - if (frostshock_timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_FROST_SHOCK); - - frostshock_timer = 10000 + rand()%5000; - } else frostshock_timer -= diff; - - if (shadowshock_timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_SHADOW_SHOCK); - - shadowshock_timer = 10000 + rand()%5000; - } else shadowshock_timer -= diff; - - if (chainlightning_timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_CHAIN_LIGHTNING); - - chainlightning_timer = 25000; - } else chainlightning_timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_darkweaver_syth(Creature* pCreature) -{ - return new boss_darkweaver_sythAI (pCreature); -} - -/* ELEMENTALS */ - -struct TRINITY_DLL_DECL mob_syth_fireAI : public ScriptedAI -{ - mob_syth_fireAI(Creature *c) : ScriptedAI(c) - - { - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - uint32 flameshock_timer; - uint32 flamebuffet_timer; - bool HeroicMode; - - void Reset() - { - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true); - flameshock_timer = 2500; - flamebuffet_timer = 5000; - } - - void EnterCombat(Unit *who) { } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (flameshock_timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_FLAME_SHOCK); - - flameshock_timer = 5000; - }else flameshock_timer -= diff; - - if (flamebuffet_timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_FLAME_BUFFET); - - flamebuffet_timer = 5000; - }else flamebuffet_timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_syth_fire(Creature* pCreature) -{ - return new mob_syth_fireAI (pCreature); -} - -struct TRINITY_DLL_DECL mob_syth_arcaneAI : public ScriptedAI -{ - mob_syth_arcaneAI(Creature *c) : ScriptedAI(c) - - { - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - uint32 arcaneshock_timer; - uint32 arcanebuffet_timer; - bool HeroicMode; - - void Reset() - { - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, true); - arcaneshock_timer = 2500; - arcanebuffet_timer = 5000; - } - - void EnterCombat(Unit *who) { } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (arcaneshock_timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_ARCANE_SHOCK); - - arcaneshock_timer = 5000; - }else arcaneshock_timer -= diff; - - if (arcanebuffet_timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_ARCANE_BUFFET); - - arcanebuffet_timer = 5000; - }else arcanebuffet_timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_syth_arcane(Creature* pCreature) -{ - return new mob_syth_arcaneAI (pCreature); -} - -struct TRINITY_DLL_DECL mob_syth_frostAI : public ScriptedAI -{ - mob_syth_frostAI(Creature *c) : ScriptedAI(c) - - { - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - uint32 frostshock_timer; - uint32 frostbuffet_timer; - bool HeroicMode; - - void Reset() - { - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true); - frostshock_timer = 2500; - frostbuffet_timer = 5000; - } - - void EnterCombat(Unit *who) { } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (frostshock_timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_FROST_SHOCK); - - frostshock_timer = 5000; - }else frostshock_timer -= diff; - - if (frostbuffet_timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_FROST_BUFFET); - - frostbuffet_timer = 5000; - }else frostbuffet_timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_syth_frost(Creature* pCreature) -{ - return new mob_syth_frostAI (pCreature); -} - -struct TRINITY_DLL_DECL mob_syth_shadowAI : public ScriptedAI -{ - mob_syth_shadowAI(Creature *c) : ScriptedAI(c) - - { - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - uint32 shadowshock_timer; - uint32 shadowbuffet_timer; - bool HeroicMode; - - void Reset() - { - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, true); - shadowshock_timer = 2500; - shadowbuffet_timer = 5000; - } - - void EnterCombat(Unit *who) { } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (shadowshock_timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_SHADOW_SHOCK); - - shadowshock_timer = 5000; - }else shadowshock_timer -= diff; - - if (shadowbuffet_timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_SHADOW_BUFFET); - - shadowbuffet_timer = 5000; - }else shadowbuffet_timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_syth_shadow(Creature* pCreature) -{ - return new mob_syth_shadowAI (pCreature); -} - -void AddSC_boss_darkweaver_syth() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_darkweaver_syth"; - newscript->GetAI = &GetAI_boss_darkweaver_syth; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_syth_fire"; - newscript->GetAI = &GetAI_mob_syth_arcane; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_syth_arcane"; - newscript->GetAI = &GetAI_mob_syth_arcane; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_syth_frost"; - newscript->GetAI = &GetAI_mob_syth_frost; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_syth_shadow"; - newscript->GetAI = &GetAI_mob_syth_shadow; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/boss_tailonking_ikiss.cpp b/src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/boss_tailonking_ikiss.cpp deleted file mode 100644 index 7830fc10645..00000000000 --- a/src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/boss_tailonking_ikiss.cpp +++ /dev/null @@ -1,221 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Talon_King_Ikiss -SD%Complete: 80 -SDComment: Heroic supported. Some details missing, but most are spell related. -SDCategory: Auchindoun, Sethekk Halls -EndScriptData */ - -#include "precompiled.h" -#include "def_sethekk_halls.h" - -#define SAY_INTRO -1556007 - -#define SAY_AGGRO_1 -1556008 -#define SAY_AGGRO_2 -1556009 -#define SAY_AGGRO_3 -1556010 - -#define SAY_SLAY_1 -1556011 -#define SAY_SLAY_2 -1556012 -#define SAY_DEATH -1556013 -#define EMOTE_ARCANE_EXP -1556015 - -#define SPELL_BLINK 38194 -#define SPELL_BLINK_TELEPORT 38203 -#define SPELL_MANA_SHIELD 38151 -#define SPELL_ARCANE_BUBBLE 9438 -#define H_SPELL_SLOW 35032 - -#define SPELL_POLYMORPH 38245 -#define H_SPELL_POLYMORPH 43309 - -#define SPELL_ARCANE_VOLLEY 35059 -#define H_SPELL_ARCANE_VOLLEY 40424 - -#define SPELL_ARCANE_EXPLOSION 38197 -#define H_SPELL_ARCANE_EXPLOSION 40425 - -struct TRINITY_DLL_DECL boss_talon_king_ikissAI : public ScriptedAI -{ - boss_talon_king_ikissAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - bool HeroicMode; - - uint32 ArcaneVolley_Timer; - uint32 Sheep_Timer; - uint32 Blink_Timer; - uint32 Slow_Timer; - - bool ManaShield; - bool Blink; - bool Intro; - - void Reset() - { - HeroicMode = m_creature->GetMap()->IsHeroic(); - - ArcaneVolley_Timer = 5000; - Sheep_Timer = 8000; - Blink_Timer = 35000; - Slow_Timer = 15000+rand()%15000; - Blink = false; - Intro = false; - ManaShield = false; - } - - void MoveInLineOfSight(Unit *who) - { - if (!m_creature->getVictim() && who->isTargetableForAttack() && (m_creature->IsHostileTo(who)) && who->isInAccessiblePlaceFor(m_creature)) - { - if (!Intro && m_creature->IsWithinDistInMap(who, 100)) - { - Intro = true; - DoScriptText(SAY_INTRO, m_creature); - } - - if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) - return; - - float attackRadius = m_creature->GetAttackDistance(who); - if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who)) - { - //who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); - AttackStart(who); - } - } - } - - void EnterCombat(Unit *who) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; - case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; - case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; - } - } - - void JustDied(Unit* Killer) - { - DoScriptText(SAY_DEATH, m_creature); - - if (pInstance) - pInstance->SetData(DATA_IKISSDOOREVENT, DONE); - } - - void KilledUnit(Unit* victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature); break; - case 1: DoScriptText(SAY_SLAY_2, m_creature); break; - } - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (Blink) - { - DoCast(m_creature,HeroicMode ? H_SPELL_ARCANE_EXPLOSION : SPELL_ARCANE_EXPLOSION); - m_creature->CastSpell(m_creature,SPELL_ARCANE_BUBBLE,true); - Blink = false; - } - - if (ArcaneVolley_Timer < diff) - { - DoCast(m_creature,HeroicMode ? H_SPELL_ARCANE_VOLLEY : SPELL_ARCANE_VOLLEY); - ArcaneVolley_Timer = 7000+rand()%5000; - }else ArcaneVolley_Timer -= diff; - - if (Sheep_Timer < diff) - { - //second top aggro target in normal, random target in heroic correct? - Unit *target = NULL; - target = HeroicMode ? SelectUnit(SELECT_TARGET_RANDOM,0) : SelectUnit(SELECT_TARGET_TOPAGGRO,1); - if (target) - DoCast(target,HeroicMode ? H_SPELL_POLYMORPH : SPELL_POLYMORPH); - Sheep_Timer = 15000+rand()%2500; - }else Sheep_Timer -= diff; - - //may not be correct time to cast - if (!ManaShield && ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 20)) - { - DoCast(m_creature,SPELL_MANA_SHIELD); - ManaShield = true; - } - - if (HeroicMode) - { - if (Slow_Timer < diff) - { - DoCast(m_creature,H_SPELL_SLOW); - Slow_Timer = 15000+rand()%25000; - }else Slow_Timer -= diff; - } - - if (Blink_Timer < diff) - { - DoScriptText(EMOTE_ARCANE_EXP, m_creature); - - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - { - if (m_creature->IsNonMeleeSpellCasted(false)) - m_creature->InterruptNonMeleeSpells(false); - - //Spell doesn't work, but we use for visual effect at least - DoCast(target,SPELL_BLINK); - - float X = target->GetPositionX(); - float Y = target->GetPositionY(); - float Z = target->GetPositionZ(); - - DoTeleportTo(X,Y,Z); - - DoCast(target,SPELL_BLINK_TELEPORT); - Blink = true; - } - Blink_Timer = 35000+rand()%5000; - }else Blink_Timer -= diff; - - if (!Blink) - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_talon_king_ikiss(Creature* pCreature) -{ - return new boss_talon_king_ikissAI (pCreature); -} - -void AddSC_boss_talon_king_ikiss() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_talon_king_ikiss"; - newscript->GetAI = &GetAI_boss_talon_king_ikiss; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/def_sethekk_halls.h b/src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/def_sethekk_halls.h deleted file mode 100644 index 6156f354d84..00000000000 --- a/src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/def_sethekk_halls.h +++ /dev/null @@ -1,14 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ - -#ifndef DEF_SETHEKK_HALLS_H -#define DEF_SETHEKK_HALLS_H - -enum -{ - DATA_IKISSDOOREVENT = 1, - TYPE_ANZU_ENCOUNTER = 2, -}; -#endif - diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/instance_sethekk_halls.cpp b/src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/instance_sethekk_halls.cpp deleted file mode 100644 index 060e09a1325..00000000000 --- a/src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/instance_sethekk_halls.cpp +++ /dev/null @@ -1,91 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Instance - Sethekk Halls -SD%Complete: 50 -SDComment: Instance Data for Sethekk Halls instance -SDCategory: Auchindoun, Sethekk Halls -EndScriptData */ - -#include "precompiled.h" -#include "def_sethekk_halls.h" - -enum -{ - NPC_ANZU = 23035, - IKISS_DOOR = 177203, -}; - -struct TRINITY_DLL_DECL instance_sethekk_halls : public ScriptedInstance -{ - instance_sethekk_halls(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; - - uint32 AnzuEncounter; - uint64 m_uiIkissDoorGUID; - - void Initialize() - { - AnzuEncounter = NOT_STARTED; - m_uiIkissDoorGUID = 0; - } - - void OnCreatureCreate(Creature* pCreature, bool add) - { - if (pCreature->GetEntry() == NPC_ANZU && AnzuEncounter >= IN_PROGRESS) - { - pCreature->DealDamage(pCreature, pCreature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - pCreature->RemoveCorpse(); - } else { - AnzuEncounter = IN_PROGRESS; - } - } - - void OnGameObjectCreate(GameObject* pGo, bool add) - { - if (pGo->GetEntry() == IKISS_DOOR) - m_uiIkissDoorGUID = pGo->GetGUID(); - } - - void SetData(uint32 type, uint32 data) - { - switch(type) - { - case DATA_IKISSDOOREVENT: - if (data == DONE) - DoUseDoorOrButton(m_uiIkissDoorGUID,DAY*IN_MILISECONDS); - break; - case TYPE_ANZU_ENCOUNTER: - AnzuEncounter = data; - break; - } - } -}; - -InstanceData* GetInstanceData_instance_sethekk_halls(Map* pMap) -{ - return new instance_sethekk_halls(pMap); -} - -void AddSC_instance_sethekk_halls() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_sethekk_halls"; - newscript->GetInstanceData = &GetInstanceData_instance_sethekk_halls; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp b/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp deleted file mode 100644 index 66e6b3a108d..00000000000 --- a/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp +++ /dev/null @@ -1,217 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Ambassador_Hellmaw -SD%Complete: 80 -SDComment: Enrage spell missing/not known -SDCategory: Auchindoun, Shadow Labyrinth -EndScriptData */ - -#include "precompiled.h" -#include "escort_ai.h" -#include "def_shadow_labyrinth.h" - -enum -{ - SAY_INTRO = -1555000, - SAY_AGGRO1 = -1555001, - SAY_AGGRO2 = -1555002, - SAY_AGGRO3 = -1555003, - SAY_HELP = -1555004, - SAY_SLAY1 = -1555005, - SAY_SLAY2 = -1555006, - SAY_DEATH = -1555007, - - SPELL_BANISH = 30231, - SPELL_CORROSIVE_ACID = 33551, - SPELL_FEAR = 33547, - SPELL_ENRAGE = 34970 -}; - -struct TRINITY_DLL_DECL boss_ambassador_hellmawAI : public npc_escortAI -{ - boss_ambassador_hellmawAI(Creature* pCreature) : npc_escortAI(pCreature) - { - m_pInstance = pCreature->GetInstanceData(); - HeroicMode = pCreature->GetMap()->IsHeroic(); - } - - ScriptedInstance* m_pInstance; - bool HeroicMode; - - uint32 EventCheck_Timer; - uint32 CorrosiveAcid_Timer; - uint32 Fear_Timer; - uint32 Enrage_Timer; - bool Intro; - bool IsBanished; - bool Enraged; - - void Reset() - { - EventCheck_Timer = 5000; - CorrosiveAcid_Timer = 5000 + rand()%5000; - Fear_Timer = 25000 + rand()%5000; - Enrage_Timer = 180000; - Intro = false; - IsBanished = true; - Enraged = false; - - if (m_pInstance && m_creature->isAlive()) - { - if (m_pInstance->GetData(TYPE_OVERSEER) != DONE) - m_creature->CastSpell(m_creature, SPELL_BANISH, true); - } - } - - void JustReachedHome() - { - if (m_pInstance) - m_pInstance->SetData(TYPE_HELLMAW, FAIL); - } - - void MoveInLineOfSight(Unit* pWho) - { - if (m_creature->HasAura(SPELL_BANISH)) - return; - - npc_escortAI::MoveInLineOfSight(pWho); - } - - void WaypointReached(uint32 i) - { - } - - void DoIntro() - { - if (m_creature->HasAura(SPELL_BANISH)) - m_creature->RemoveAurasDueToSpell(SPELL_BANISH); - - IsBanished = false; - Intro = true; - - if (m_pInstance) - { - if (m_pInstance->GetData(TYPE_HELLMAW) != FAIL) - { - DoScriptText(SAY_INTRO, m_creature); - Start(true, false, 0, NULL, false, true); - } - - m_pInstance->SetData(TYPE_HELLMAW, IN_PROGRESS); - } - } - - void EnterCombat(Unit *who) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_AGGRO1, m_creature); break; - case 1: DoScriptText(SAY_AGGRO2, m_creature); break; - case 2: DoScriptText(SAY_AGGRO3, m_creature); break; - } - } - - void KilledUnit(Unit *victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; - } - } - - void JustDied(Unit *victim) - { - DoScriptText(SAY_DEATH, m_creature); - - if (m_pInstance) - m_pInstance->SetData(TYPE_HELLMAW, DONE); - } - - void UpdateAI(const uint32 diff) - { - if (!Intro && !IsBeingEscorted) - { - if (EventCheck_Timer < diff) - { - if (m_pInstance) - { - if (m_pInstance->GetData(TYPE_OVERSEER) == DONE) - { - DoIntro(); - return; - } - } - EventCheck_Timer = 5000; - return; - } - else - { - EventCheck_Timer -= diff; - return; - } - } - - npc_escortAI::UpdateAI(diff); - - if (!UpdateVictim()) - return; - - if (m_creature->HasAura(SPELL_BANISH, 0)) - { - EnterEvadeMode(); - return; - } - - if (CorrosiveAcid_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_CORROSIVE_ACID); - CorrosiveAcid_Timer = 15000 + rand()%10000; - }else CorrosiveAcid_Timer -= diff; - - if (Fear_Timer < diff) - { - DoCast(m_creature,SPELL_FEAR); - Fear_Timer = 20000 + rand()%15000; - }else Fear_Timer -= diff; - - if (HeroicMode) - { - if (!Enraged && Enrage_Timer < diff) - { - DoCast(m_creature,SPELL_ENRAGE); - Enraged = true; - }else Enrage_Timer -= diff; - } - } -}; - -CreatureAI* GetAI_boss_ambassador_hellmaw(Creature* pCreature) -{ - return new boss_ambassador_hellmawAI(pCreature); -} - -void AddSC_boss_ambassador_hellmaw() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_ambassador_hellmaw"; - newscript->GetAI = &GetAI_boss_ambassador_hellmaw; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp b/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp deleted file mode 100644 index 73374c08f8c..00000000000 --- a/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp +++ /dev/null @@ -1,177 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Blackheart_the_Inciter -SD%Complete: 75 -SDComment: Incite Chaos not functional since core lacks Mind Control support -SDCategory: Auchindoun, Shadow Labyrinth -EndScriptData */ - -#include "precompiled.h" -#include "def_shadow_labyrinth.h" - -#define SPELL_INCITE_CHAOS 33676 -#define SPELL_INCITE_CHAOS_B 33684 //debuff applied to each member of party -#define SPELL_CHARGE 33709 -#define SPELL_WAR_STOMP 33707 - -#define SAY_INTRO1 -1555008 -#define SAY_INTRO2 -1555009 -#define SAY_INTRO3 -1555010 -#define SAY_AGGRO1 -1555011 -#define SAY_AGGRO2 -1555012 -#define SAY_AGGRO3 -1555013 -#define SAY_SLAY1 -1555014 -#define SAY_SLAY2 -1555015 -#define SAY_HELP -1555016 -#define SAY_DEATH -1555017 - -#define SAY2_INTRO1 -1555018 -#define SAY2_INTRO2 -1555019 -#define SAY2_INTRO3 -1555020 -#define SAY2_AGGRO1 -1555021 -#define SAY2_AGGRO2 -1555022 -#define SAY2_AGGRO3 -1555023 -#define SAY2_SLAY1 -1555024 -#define SAY2_SLAY2 -1555025 -#define SAY2_HELP -1555026 -#define SAY2_DEATH -1555027 - -struct TRINITY_DLL_DECL boss_blackheart_the_inciterAI : public ScriptedAI -{ - boss_blackheart_the_inciterAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance *pInstance; - - bool InciteChaos; - uint32 InciteChaos_Timer; - uint32 InciteChaosWait_Timer; - uint32 Charge_Timer; - uint32 Knockback_Timer; - - void Reset() - { - InciteChaos = false; - InciteChaos_Timer = 20000; - InciteChaosWait_Timer = 15000; - Charge_Timer = 5000; - Knockback_Timer = 15000; - - if (pInstance) - pInstance->SetData(DATA_BLACKHEARTTHEINCITEREVENT, NOT_STARTED); - } - - void KilledUnit(Unit *victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; - } - } - - void JustDied(Unit *victim) - { - DoScriptText(SAY_DEATH, m_creature); - - if (pInstance) - pInstance->SetData(DATA_BLACKHEARTTHEINCITEREVENT, DONE); - } - - void EnterCombat(Unit *who) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_AGGRO1, m_creature); break; - case 1: DoScriptText(SAY_AGGRO2, m_creature); break; - case 2: DoScriptText(SAY_AGGRO3, m_creature); break; - } - - if (pInstance) - pInstance->SetData(DATA_BLACKHEARTTHEINCITEREVENT, IN_PROGRESS); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - if (InciteChaos) - { - if (InciteChaosWait_Timer < diff) - { - InciteChaos = false; - InciteChaosWait_Timer = 15000; - }else InciteChaosWait_Timer -= diff; - - return; - } - - if (InciteChaos_Timer < diff) - { - DoCast(m_creature, SPELL_INCITE_CHAOS); - - std::list t_list = m_creature->getThreatManager().getThreatList(); - for(std::list::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr) - { - Unit* target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()); - if (target && target->GetTypeId() == TYPEID_PLAYER) - target->CastSpell(target,SPELL_INCITE_CHAOS_B,true); - } - - DoResetThreat(); - InciteChaos = true; - InciteChaos_Timer = 40000; - return; - }else InciteChaos_Timer -= diff; - - //Charge_Timer - if (Charge_Timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - DoCast(target, SPELL_CHARGE); - Charge_Timer = 15000 + rand()%10000; - }else Charge_Timer -= diff; - - //Knockback_Timer - if (Knockback_Timer < diff) - { - DoCast(m_creature, SPELL_WAR_STOMP); - Knockback_Timer = 18000 + rand()%6000; - }else Knockback_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_blackheart_the_inciter(Creature* pCreature) -{ - return new boss_blackheart_the_inciterAI (pCreature); -} - -void AddSC_boss_blackheart_the_inciter() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_blackheart_the_inciter"; - newscript->GetAI = &GetAI_boss_blackheart_the_inciter; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp b/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp deleted file mode 100644 index 0cc6255f3cf..00000000000 --- a/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp +++ /dev/null @@ -1,321 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Grandmaster_Vorpil -SD%Complete: 100 -SDComment: -SDCategory: Auchindoun, Shadow Labyrinth -EndScriptData */ - -#include "precompiled.h" -#include "def_shadow_labyrinth.h" - -#define SAY_INTRO -1555028 -#define SAY_AGGRO1 -1555029 -#define SAY_AGGRO2 -1555030 -#define SAY_AGGRO3 -1555031 -#define SAY_HELP -1555032 -#define SAY_SLAY1 -1555033 -#define SAY_SLAY2 -1555034 -#define SAY_DEATH -1555035 - -#define SPELL_RAIN_OF_FIRE 33617 -#define H_SPELL_RAIN_OF_FIRE 39363 - -#define SPELL_DRAW_SHADOWS 33563 -#define SPELL_SHADOWBOLT_VOLLEY 33841 -#define SPELL_BANISH 38791 - -#define MOB_VOID_TRAVELER 19226 -#define SPELL_SACRIFICE 33587 -#define SPELL_SHADOW_NOVA 33846 -#define SPELL_EMPOWERING_SHADOWS 33783 -#define H_SPELL_EMPOWERING_SHADOWS 39364 - -#define MOB_VOID_PORTAL 19224 -#define SPELL_VOID_PORTAL_VISUAL 33569 - -float VorpilPosition[3] = {-252.8820,-264.3030,17.1}; - -float VoidPortalCoords[5][3] = -{ - {-283.5894, -239.5718, 12.7}, - {-306.5853, -258.4539, 12.7}, - {-295.8789, -269.0899, 12.7}, - {-209.3401, -262.7564, 17.1}, - {-261.4533, -297.3298, 17.1} -}; - -struct TRINITY_DLL_DECL mob_voidtravelerAI : public ScriptedAI -{ - mob_voidtravelerAI(Creature *c) : ScriptedAI(c) - { - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - bool HeroicMode; - Unit *Vorpil; - uint32 move; - bool sacrificed; - - void Reset() - { - Vorpil = NULL; - move = 0; - sacrificed = false; - } - - void EnterCombat(Unit *who){} - - void UpdateAI(const uint32 diff) - { - if (!Vorpil) - { - m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - return; - } - if (move < diff) - { - if (sacrificed) - { - SpellEntry *spell = GET_SPELL(HeroicMode?H_SPELL_EMPOWERING_SHADOWS:SPELL_EMPOWERING_SHADOWS); - if (spell) - Vorpil->AddAura(new Aura(spell, 1, NULL, Vorpil, m_creature)); - Vorpil->SetHealth(Vorpil->GetHealth()+Vorpil->GetMaxHealth()/25); - DoCast(m_creature, SPELL_SHADOW_NOVA, true); - m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - return; - } - m_creature->GetMotionMaster()->MoveFollow(Vorpil,0,0); - if (m_creature->IsWithinDist(Vorpil, 3)) - { - DoCast(m_creature, SPELL_SACRIFICE, false); - sacrificed = true; - move = 500; - return; - } - if (!Vorpil->isInCombat() || Vorpil->isDead()) - { - m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - return; - } - move = 1000; - }else move -= diff; - } -}; -CreatureAI* GetAI_mob_voidtraveler(Creature* pCreature) -{ - return new mob_voidtravelerAI (pCreature); -} - -struct TRINITY_DLL_DECL boss_grandmaster_vorpilAI : public ScriptedAI -{ - boss_grandmaster_vorpilAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - HeroicMode = m_creature->GetMap()->IsHeroic(); - Intro = false; - } - - ScriptedInstance *pInstance; - bool Intro, HelpYell; - bool sumportals; - bool HeroicMode; - - uint32 ShadowBoltVolley_Timer; - uint32 DrawShadows_Timer; - uint32 summonTraveler_Timer; - uint32 banish_Timer; - uint64 PortalsGuid[5]; - - void Reset() - { - ShadowBoltVolley_Timer = 7000 + rand()%7000; - DrawShadows_Timer = 45000; - summonTraveler_Timer = 90000; - banish_Timer = 17000; - HelpYell = false; - destroyPortals(); - - if (pInstance) - pInstance->SetData(DATA_GRANDMASTERVORPILEVENT, NOT_STARTED); - } - - void summonPortals() - { - if (!sumportals) - { - for (int i = 0;i<5; ++i) - { - Creature *Portal = NULL; - Portal = m_creature->SummonCreature(MOB_VOID_PORTAL,VoidPortalCoords[i][0],VoidPortalCoords[i][1],VoidPortalCoords[i][2],0,TEMPSUMMON_CORPSE_DESPAWN,3000000); - if (Portal) - { - PortalsGuid[i] = Portal->GetGUID(); - Portal->CastSpell(Portal,SPELL_VOID_PORTAL_VISUAL,false); - } - } - sumportals = true; - summonTraveler_Timer = 5000; - } - } - - void destroyPortals() - { - if (sumportals) - { - for (int i = 0;i < 5; i ++) - { - Unit *Portal = Unit::GetUnit((*m_creature), PortalsGuid[i]); - if (Portal && Portal->isAlive()) - Portal->DealDamage(Portal, Portal->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - PortalsGuid[i] = 0; - } - sumportals = false; - } - } - - void spawnVoidTraveler() - { - int pos = rand()%5; - m_creature->SummonCreature(MOB_VOID_TRAVELER,VoidPortalCoords[pos][0],VoidPortalCoords[pos][1],VoidPortalCoords[pos][2],0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,5000); - if (!HelpYell) - { - DoScriptText(SAY_HELP, m_creature); - HelpYell = true; - } - } - - void JustSummoned(Creature *summoned) - { - if (summoned && summoned->GetEntry() == MOB_VOID_TRAVELER) - CAST_AI(mob_voidtravelerAI, summoned->AI())->Vorpil = m_creature; - } - - void KilledUnit(Unit *victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; - } - } - - void JustDied(Unit *victim) - { - DoScriptText(SAY_DEATH, m_creature); - destroyPortals(); - - if (pInstance) - pInstance->SetData(DATA_GRANDMASTERVORPILEVENT, DONE); - } - - void EnterCombat(Unit *who) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_AGGRO1, m_creature); break; - case 1: DoScriptText(SAY_AGGRO2, m_creature); break; - case 2: DoScriptText(SAY_AGGRO3, m_creature); break; - } - summonPortals(); - - if (pInstance) - pInstance->SetData(DATA_GRANDMASTERVORPILEVENT, IN_PROGRESS); - } - - void MoveInLineOfSight(Unit *who) - { - ScriptedAI::MoveInLineOfSight(who); - - if (!Intro && m_creature->IsWithinLOSInMap(who)&& m_creature->IsWithinDistInMap(who, 100) && m_creature->IsHostileTo(who)) - { - DoScriptText(SAY_INTRO, m_creature); - Intro = true; - } - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (ShadowBoltVolley_Timer < diff) - { - DoCast(m_creature,SPELL_SHADOWBOLT_VOLLEY); - ShadowBoltVolley_Timer = 15000 + rand()%15000;; - }else ShadowBoltVolley_Timer -= diff; - - if (HeroicMode && banish_Timer < diff) - { - Unit *target = SelectTarget(SELECT_TARGET_RANDOM,0,30,false); - if (target) - { - DoCast(target,SPELL_BANISH); - banish_Timer = 16000; - } - }else banish_Timer -= diff; - - if (DrawShadows_Timer < diff) - { - Map* pMap = m_creature->GetMap(); - Map::PlayerList const &PlayerList = pMap->GetPlayers(); - for(Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) - if (Player* i_pl = i->getSource()) - if (i_pl->isAlive() && !i_pl->HasAura(SPELL_BANISH)) - i_pl->TeleportTo(m_creature->GetMapId(), VorpilPosition[0],VorpilPosition[1],VorpilPosition[2], 0, TELE_TO_NOT_LEAVE_COMBAT); - - m_creature->GetMap()->CreatureRelocation(m_creature, VorpilPosition[0],VorpilPosition[1],VorpilPosition[2],0.0f); - DoCast(m_creature,SPELL_DRAW_SHADOWS,true); - - DoCast(m_creature,HeroicMode?H_SPELL_RAIN_OF_FIRE:SPELL_RAIN_OF_FIRE); - - ShadowBoltVolley_Timer = 6000; - DrawShadows_Timer = 30000; - }else DrawShadows_Timer -= diff; - - if (summonTraveler_Timer < diff) - { - spawnVoidTraveler(); - summonTraveler_Timer = 10000; - //enrage at 20% - if ((m_creature->GetHealth()*5) < m_creature->GetMaxHealth()) - summonTraveler_Timer = 5000; - }else summonTraveler_Timer -=diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_grandmaster_vorpil(Creature* pCreature) -{ - return new boss_grandmaster_vorpilAI (pCreature); -} - -void AddSC_boss_grandmaster_vorpil() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_grandmaster_vorpil"; - newscript->GetAI = &GetAI_boss_grandmaster_vorpil; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_voidtraveler"; - newscript->GetAI = &GetAI_mob_voidtraveler; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_murmur.cpp b/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_murmur.cpp deleted file mode 100644 index 259f6091af6..00000000000 --- a/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_murmur.cpp +++ /dev/null @@ -1,207 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Murmur -SD%Complete: 90 -SDComment: Timers may be incorrect -SDCategory: Auchindoun, Shadow Labyrinth -EndScriptData */ - -#include "precompiled.h" -#include "def_shadow_labyrinth.h" - -#define EMOTE_SONIC_BOOM -1555036 - -#define SPELL_SONIC_BOOM_CAST (HeroicMode?38796:33923) -#define SPELL_SONIC_BOOM_EFFECT (HeroicMode?38795:33666) -#define SPELL_RESONANCE 33657 -#define SPELL_MURMURS_TOUCH (HeroicMode?38794:33711) -#define SPELL_MAGNETIC_PULL 33689 -#define SPELL_SONIC_SHOCK 38797 -#define SPELL_THUNDERING_STORM 39365 - -struct TRINITY_DLL_DECL boss_murmurAI : public ScriptedAI -{ - boss_murmurAI(Creature *c) : ScriptedAI(c) - { - SetCombatMovement(false); - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - uint32 SonicBoom_Timer; - uint32 MurmursTouch_Timer; - uint32 Resonance_Timer; - uint32 MagneticPull_Timer; - uint32 SonicShock_Timer; - uint32 ThunderingStorm_Timer; - bool HeroicMode; - bool SonicBoom; - - void Reset() - { - SonicBoom_Timer = 30000; - MurmursTouch_Timer = 8000 + rand()%12000; - Resonance_Timer = 5000; - MagneticPull_Timer = 15000 + rand()%15000; - ThunderingStorm_Timer = 15000; - SonicShock_Timer = 10000; - SonicBoom = false; - - //database should have `RegenHealth`=0 to prevent regen - uint32 hp = (m_creature->GetMaxHealth()*40)/100; - if (hp) m_creature->SetHealth(hp); - m_creature->ResetPlayerDamageReq(); - } - - void SonicBoomEffect() - { - std::list t_list = m_creature->getThreatManager().getThreatList(); - for(std::list::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr) - { - Unit* target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()); - if (target && target->GetTypeId() == TYPEID_PLAYER) - { - //Not do anything without aura, spell can be resisted! - if (target->HasAura(SPELL_SONIC_BOOM_CAST) && m_creature->IsWithinDistInMap(target, 34.0f)) - { - //This will be wrong calculation. Also, comments suggest it must deal damage - target->SetHealth(uint32(target->GetMaxHealth() - target->GetMaxHealth() * 0.8)); - } - } - } - } - - void EnterCombat(Unit *who) { } - - // Sonic Boom instant damage (needs core fix instead of this) - void SpellHitTarget(Unit *target, const SpellEntry *spell) - { - if (target && target->isAlive() && spell && spell->Id == SPELL_SONIC_BOOM_EFFECT) - m_creature->DealDamage(target,(target->GetHealth()*90)/100,NULL,SPELL_DIRECT_DAMAGE,SPELL_SCHOOL_MASK_NATURE,spell); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target or casting - if (!UpdateVictim() || m_creature->IsNonMeleeSpellCasted(false)) - return; - - // Sonic Boom - if (SonicBoom) - { - DoCast(m_creature, SPELL_SONIC_BOOM_EFFECT, true); - SonicBoomEffect(); - - SonicBoom = false; - Resonance_Timer = 1500; - } - if (SonicBoom_Timer < diff) - { - DoScriptText(EMOTE_SONIC_BOOM, m_creature); - DoCast(m_creature, SPELL_SONIC_BOOM_CAST); - SonicBoom_Timer = 30000; - SonicBoom = true; - return; - }else SonicBoom_Timer -= diff; - - // Murmur's Touch - if (MurmursTouch_Timer < diff) - { - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM,0,80,true)) - DoCast(target, SPELL_MURMURS_TOUCH); - MurmursTouch_Timer = 25000 + rand()%10000; - }else MurmursTouch_Timer -= diff; - - // Resonance - if (!SonicBoom && !(m_creature->IsWithinMeleeRange(m_creature->getVictim()))) - { - if (Resonance_Timer < diff) - { - DoCast(m_creature, SPELL_RESONANCE); - Resonance_Timer = 5000; - }else Resonance_Timer -= diff; - } - - // Magnetic Pull - if (MagneticPull_Timer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) - if (target->GetTypeId() == TYPEID_PLAYER && target->isAlive()) - { - DoCast(target, SPELL_MAGNETIC_PULL); - MagneticPull_Timer = 15000+rand()%15000; - return; - } - MagneticPull_Timer = 500; - }else MagneticPull_Timer -= diff; - - if (HeroicMode) - { - // Thundering Storm - if (ThunderingStorm_Timer < diff) - { - std::list& m_threatlist = m_creature->getThreatManager().getThreatList(); - for(std::list::iterator i = m_threatlist.begin(); i != m_threatlist.end(); ++i) - if (Unit* target = Unit::GetUnit((*m_creature),(*i)->getUnitGuid())) - if (target->isAlive() && !m_creature->IsWithinDist(target, 35, false)) - DoCast(target, SPELL_THUNDERING_STORM, true); - ThunderingStorm_Timer = 15000; - }else ThunderingStorm_Timer -= diff; - - // Sonic Shock - if (SonicShock_Timer < diff) - { - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM,0,20,false)) - if (target->isAlive()) - DoCast(target, SPELL_SONIC_SHOCK); - SonicShock_Timer = 10000+rand()%10000; - }else SonicShock_Timer -= diff; - } - - // Select nearest most aggro target if top aggro too far - if (!m_creature->isAttackReady()) - return; - if (!m_creature->IsWithinMeleeRange(m_creature->getVictim())) - { - std::list& m_threatlist = m_creature->getThreatManager().getThreatList(); - for(std::list::iterator i = m_threatlist.begin(); i != m_threatlist.end(); ++i) - if (Unit* target = Unit::GetUnit((*m_creature),(*i)->getUnitGuid())) - if (target->isAlive() && m_creature->IsWithinMeleeRange(target)) - { - m_creature->TauntApply(target); - break; - } - } - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_murmur(Creature* pCreature) -{ - return new boss_murmurAI (pCreature); -} - -void AddSC_boss_murmur() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_murmur"; - newscript->GetAI = &GetAI_boss_murmur; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/def_shadow_labyrinth.h b/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/def_shadow_labyrinth.h deleted file mode 100644 index a78955368bf..00000000000 --- a/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/def_shadow_labyrinth.h +++ /dev/null @@ -1,15 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ - -#ifndef DEF_SHADOW_LABYRINTH_H -#define DEF_SHADOW_LABYRINTH_H - -#define TYPE_HELLMAW 1 -#define TYPE_OVERSEER 2 -#define DATA_BLACKHEARTTHEINCITEREVENT 3 -#define DATA_GRANDMASTERVORPILEVENT 4 -#define DATA_MURMUREVENT 5 -#define DATA_GRANDMASTERVORPIL 6 -#endif - diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp b/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp deleted file mode 100644 index f8f3b73bffa..00000000000 --- a/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp +++ /dev/null @@ -1,227 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Instance_Shadow_Labyrinth -SD%Complete: 85 -SDComment: Some cleanup left along with save -SDCategory: Auchindoun, Shadow Labyrinth -EndScriptData */ - -#include "precompiled.h" -#include "def_shadow_labyrinth.h" - -#define MAX_ENCOUNTER 5 - -#define REFECTORY_DOOR 183296 //door opened when blackheart the inciter dies -#define SCREAMING_HALL_DOOR 183295 //door opened when grandmaster vorpil dies - -/* Shadow Labyrinth encounters: -1 - Ambassador Hellmaw event -2 - Blackheart the Inciter event -3 - Grandmaster Vorpil event -4 - Murmur event -*/ - -struct TRINITY_DLL_DECL instance_shadow_labyrinth : public ScriptedInstance -{ - instance_shadow_labyrinth(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; - - uint32 m_auiEncounter[MAX_ENCOUNTER]; - std::string str_data; - - uint64 m_uiRefectoryDoorGUID; - uint64 m_uiScreamingHallDoorGUID; - - uint64 m_uiGrandmasterVorpil; - uint32 m_uiFelOverseerCount; - - void Initialize() - { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - - m_uiRefectoryDoorGUID = 0; - m_uiScreamingHallDoorGUID = 0; - - m_uiGrandmasterVorpil = 0; - m_uiFelOverseerCount = 0; - } - - bool IsEncounterInProgress() const - { - for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) return true; - - return false; - } - - void OnGameObjectCreate(GameObject* pGo, bool add) - { - switch(pGo->GetEntry()) - { - case REFECTORY_DOOR: - m_uiRefectoryDoorGUID = pGo->GetGUID(); - if (m_auiEncounter[2] == DONE) - pGo->SetGoState(GO_STATE_ACTIVE); - break; - case SCREAMING_HALL_DOOR: - m_uiScreamingHallDoorGUID = pGo->GetGUID(); - if (m_auiEncounter[3] == DONE) - pGo->SetGoState(GO_STATE_ACTIVE); - break; - } - } - - void OnCreatureCreate(Creature* pCreature, bool add) - { - switch(pCreature->GetEntry()) - { - case 18732: - m_uiGrandmasterVorpil = pCreature->GetGUID(); - break; - case 18796: - if (pCreature->isAlive()) - { - ++m_uiFelOverseerCount; - debug_log("TSCR: Shadow Labyrinth: counting %u Fel Overseers.",m_uiFelOverseerCount); - } - break; - } - } - - void SetData(uint32 type, uint32 uiData) - { - switch(type) - { - case TYPE_HELLMAW: - m_auiEncounter[0] = uiData; - break; - - case TYPE_OVERSEER: - if (uiData != DONE) - { - error_log("TSCR: Shadow Labyrinth: TYPE_OVERSEER did not expect other data than DONE"); - return; - } - if (m_uiFelOverseerCount) - { - --m_uiFelOverseerCount; - - if (m_uiFelOverseerCount) - debug_log("TSCR: Shadow Labyrinth: %u Fel Overseers left to kill.",m_uiFelOverseerCount); - else - { - m_auiEncounter[1] = DONE; - debug_log("TSCR: Shadow Labyrinth: TYPE_OVERSEER == DONE"); - } - } - break; - - case DATA_BLACKHEARTTHEINCITEREVENT: - if (uiData == DONE) - DoUseDoorOrButton(m_uiRefectoryDoorGUID); - m_auiEncounter[2] = uiData; - break; - - case DATA_GRANDMASTERVORPILEVENT: - if (uiData == DONE) - DoUseDoorOrButton(m_uiScreamingHallDoorGUID); - m_auiEncounter[3] = uiData; - break; - - case DATA_MURMUREVENT: - m_auiEncounter[4] = uiData; - break; - } - - if (uiData == DONE) - { - if (type == TYPE_OVERSEER && m_uiFelOverseerCount != 0) - return; - - OUT_SAVE_INST_DATA; - - std::ostringstream saveStream; - saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " - << m_auiEncounter[2] << " " << m_auiEncounter[3] << " " << m_auiEncounter[4]; - - str_data = saveStream.str(); - - SaveToDB(); - OUT_SAVE_INST_DATA_COMPLETE; - } - } - - uint32 GetData(uint32 type) - { - switch(type) - { - case TYPE_HELLMAW: return m_auiEncounter[0]; - case TYPE_OVERSEER: return m_auiEncounter[1]; - case DATA_GRANDMASTERVORPILEVENT: return m_auiEncounter[3]; - case DATA_MURMUREVENT: return m_auiEncounter[4]; - } - return false; - } - - uint64 GetData64(uint32 identifier) - { - if (identifier == DATA_GRANDMASTERVORPIL) - return m_uiGrandmasterVorpil; - - return 0; - } - - std::string GetSaveData() - { - return str_data; - } - - void Load(const char* in) - { - if (!in) - { - OUT_LOAD_INST_DATA_FAIL; - return; - } - - OUT_LOAD_INST_DATA(in); - - std::istringstream loadStream(in); - loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3] >> m_auiEncounter[4]; - - for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) - m_auiEncounter[i] = NOT_STARTED; - - OUT_LOAD_INST_DATA_COMPLETE; - } -}; - -InstanceData* GetInstanceData_instance_shadow_labyrinth(Map* pMap) -{ - return new instance_shadow_labyrinth(pMap); -} - -void AddSC_instance_shadow_labyrinth() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_shadow_labyrinth"; - newscript->GetInstanceData = &GetInstanceData_instance_shadow_labyrinth; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/outland/tempest_keep/arcatraz/instance_arcatraz.cpp b/src/bindings/scripts/scripts/outland/tempest_keep/arcatraz/instance_arcatraz.cpp index 081c80c56e5..ebf5484671c 100644 --- a/src/bindings/scripts/scripts/outland/tempest_keep/arcatraz/instance_arcatraz.cpp +++ b/src/bindings/scripts/scripts/outland/tempest_keep/arcatraz/instance_arcatraz.cpp @@ -84,8 +84,7 @@ struct TRINITY_DLL_DECL instance_arcatraz : public ScriptedInstance bool IsEncounterInProgress() const { for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) - return true; + if (m_auiEncounter[i] == IN_PROGRESS) return true; return false; } diff --git a/src/bindings/scripts/system/ScriptLoader.cpp b/src/bindings/scripts/system/ScriptLoader.cpp index 024fbe7b7a1..236dab3bfcc 100644 --- a/src/bindings/scripts/system/ScriptLoader.cpp +++ b/src/bindings/scripts/system/ScriptLoader.cpp @@ -307,14 +307,14 @@ extern void AddSC_wintergrasp(); extern void AddSC_zuldrak(); //outland -extern void AddSC_boss_exarch_maladaar(); //Aunchindoun Auchenai Crypts +extern void AddSC_boss_exarch_maladaar(); //Auchindoun Auchenai Crypts extern void AddSC_boss_shirrak_the_dead_watcher(); -extern void AddSC_boss_nexusprince_shaffar(); //Aunchindoun Mana Tombs +extern void AddSC_boss_nexusprince_shaffar(); //Auchindoun Mana Tombs extern void AddSC_boss_pandemonius(); -extern void AddSC_boss_darkweaver_syth(); //Aunchindoun Sekketh Halls +extern void AddSC_boss_darkweaver_syth(); //Auchindoun Sekketh Halls extern void AddSC_boss_talon_king_ikiss(); extern void AddSC_instance_sethekk_halls(); -extern void AddSC_instance_shadow_labyrinth(); //Aunchindoun Shadow Labyrinth +extern void AddSC_instance_shadow_labyrinth(); //Auchindoun Shadow Labyrinth extern void AddSC_boss_ambassador_hellmaw(); extern void AddSC_boss_blackheart_the_inciter(); extern void AddSC_boss_grandmaster_vorpil(); @@ -693,14 +693,14 @@ void AddScripts() AddSC_zuldrak(); //outland - AddSC_boss_exarch_maladaar(); //Aunchindoun Auchenai Crypts + AddSC_boss_exarch_maladaar(); //Auchindoun Auchenai Crypts AddSC_boss_shirrak_the_dead_watcher(); - AddSC_boss_nexusprince_shaffar(); //Aunchindoun Mana Tombs + AddSC_boss_nexusprince_shaffar(); //Auchindoun Mana Tombs AddSC_boss_pandemonius(); - AddSC_boss_darkweaver_syth(); //Aunchindoun Sekketh Halls + AddSC_boss_darkweaver_syth(); //Auchindoun Sekketh Halls AddSC_boss_talon_king_ikiss(); AddSC_instance_sethekk_halls(); - AddSC_instance_shadow_labyrinth(); //Aunchindoun Shadow Labyrinth + AddSC_instance_shadow_labyrinth(); //Auchindoun Shadow Labyrinth AddSC_boss_ambassador_hellmaw(); AddSC_boss_blackheart_the_inciter(); AddSC_boss_grandmaster_vorpil(); -- cgit v1.2.3 From 0bf3aa109f061409e96930a4becd2f86ba608da1 Mon Sep 17 00:00:00 2001 From: megamage Date: Sun, 16 Aug 2009 16:20:31 -0500 Subject: *Some quest fixes for some dk quests. Not enabled for now. By Azrael and ckegg. sql will be added later so you may get some console error during start up. --HG-- branch : trunk --- src/bindings/scripts/CMakeLists.txt | 2 + src/bindings/scripts/VC80/80ScriptDev2.vcproj | 8 + src/bindings/scripts/VC90/90ScriptDev2.vcproj | 8 + .../scarlet_enclave/the_scarlet_enclave.cpp | 1135 +------------------- src/bindings/scripts/system/ScriptLoader.cpp | 4 + src/game/SpellEffects.cpp | 3 +- 6 files changed, 25 insertions(+), 1135 deletions(-) (limited to 'src/bindings/scripts/system/ScriptLoader.cpp') diff --git a/src/bindings/scripts/CMakeLists.txt b/src/bindings/scripts/CMakeLists.txt index 58b91096c18..1cd3212f00b 100644 --- a/src/bindings/scripts/CMakeLists.txt +++ b/src/bindings/scripts/CMakeLists.txt @@ -89,6 +89,8 @@ SET(trinityscript_LIB_SRCS scripts/eastern_kingdoms/molten_core/instance_molten_core.cpp scripts/eastern_kingdoms/molten_core/molten_core.cpp scripts/eastern_kingdoms/scarlet_enclave/the_scarlet_enclave.cpp + scripts/eastern_kingdoms/scarlet_enclave/chapter1.cpp + scripts/eastern_kingdoms/scarlet_enclave/chapter2.cpp scripts/eastern_kingdoms/scarlet_monastery/boss_arcanist_doan.cpp scripts/eastern_kingdoms/scarlet_monastery/boss_azshir_the_sleepless.cpp scripts/eastern_kingdoms/scarlet_monastery/boss_bloodmage_thalnos.cpp diff --git a/src/bindings/scripts/VC80/80ScriptDev2.vcproj b/src/bindings/scripts/VC80/80ScriptDev2.vcproj index 4c98db9abb2..1e6121cada4 100644 --- a/src/bindings/scripts/VC80/80ScriptDev2.vcproj +++ b/src/bindings/scripts/VC80/80ScriptDev2.vcproj @@ -717,6 +717,14 @@ RelativePath="..\scripts\eastern_kingdoms\scarlet_enclave\the_scarlet_enclave.cpp" > + + + + + + + + SetStandState(UNIT_STAND_STATE_KNEEL); - break; - case 2: - m_creature->SetStandState(UNIT_STAND_STATE_STAND); - //m_creature->UpdateEntry(NPC_KOLTIRA_ALT); //unclear if we must update or not - DoCast(m_creature, SPELL_KOLTIRA_TRANSFORM); - break; - case 3: - IsOnHold = true; - m_creature->SetStandState(UNIT_STAND_STATE_KNEEL); - DoScriptText(SAY_BREAKOUT2, m_creature); - DoCast(m_creature, SPELL_ANTI_MAGIC_ZONE); // cast again that makes bubble up - break; - case 4: - SetRun(true); - break; - case 9: - m_creature->Mount(MODEL_DEATH_KNIGHT_MOUNT); - break; - case 10: - m_creature->Unmount(); - break; - } - } - - void JustSummoned(Creature* pSummoned) - { - if (Unit* pPlayer = Unit::GetUnit(*m_creature, PlayerGUID)) - { - pSummoned->AI()->AttackStart(pPlayer); - pSummoned->AddThreat(m_creature, 0.0f); - } - - if (pSummoned->GetEntry() == NPC_HIGH_INQUISITOR_VALROTH) - m_uiValrothGUID = pSummoned->GetGUID(); - } - - void SummonAcolyte(uint32 uiAmount) - { - for(uint32 i = 0; i < uiAmount; ++i) - m_creature->SummonCreature(NPC_CRIMSON_ACOLYTE, 1642.329, -6045.818, 127.583, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); - } - - void UpdateAI(const uint32 uiDiff) - { - npc_escortAI::UpdateAI(uiDiff); - - if (IsOnHold) - { - if (m_uiWave_Timer < uiDiff) - { - switch(m_uiWave) - { - case 0: - DoScriptText(SAY_BREAKOUT3, m_creature); - SummonAcolyte(3); - m_uiWave_Timer = 20000; - break; - case 1: - DoScriptText(SAY_BREAKOUT4, m_creature); - SummonAcolyte(3); - m_uiWave_Timer = 20000; - break; - case 2: - DoScriptText(SAY_BREAKOUT5, m_creature); - SummonAcolyte(4); - m_uiWave_Timer = 20000; - break; - case 3: - DoScriptText(SAY_BREAKOUT6, m_creature); - m_creature->SummonCreature(NPC_HIGH_INQUISITOR_VALROTH, 1642.329, -6045.818, 127.583, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000); - m_uiWave_Timer = 1000; - break; - case 4: - { - Unit* pTemp = Unit::GetUnit(*m_creature, m_uiValrothGUID); - - if (!pTemp || !pTemp->isAlive()) - { - DoScriptText(SAY_BREAKOUT8, m_creature); - m_uiWave_Timer = 5000; - } - else - { - m_uiWave_Timer = 2500; - return; //return, we don't want m_uiWave to increment now - } - break; - } - case 5: - DoScriptText(SAY_BREAKOUT9, m_creature); - m_creature->RemoveAurasDueToSpell(SPELL_ANTI_MAGIC_ZONE); - m_uiWave_Timer = 2500; - break; - case 6: - DoScriptText(SAY_BREAKOUT10, m_creature); - IsOnHold = false; - break; - } - - ++m_uiWave; - } - else - m_uiWave_Timer -= uiDiff; - } - } -}; - -CreatureAI* GetAI_npc_koltira_deathweaver(Creature* pCreature) -{ - return new npc_koltira_deathweaverAI(pCreature); -} - -bool QuestAccept_npc_koltira_deathweaver(Player* pPlayer, Creature* pCreature, const Quest* pQuest) -{ - if (pQuest->GetQuestId() == QUEST_BREAKOUT) - { - pCreature->SetStandState(UNIT_STAND_STATE_STAND); - - if (npc_escortAI* pEscortAI = CAST_AI(npc_koltira_deathweaverAI,pCreature->AI())) - pEscortAI->Start(false, false, pPlayer->GetGUID()); - } - return true; -} - -/*###### -##Quest 12848 -######*/ - -enum -{ - SPELL_SOUL_PRISON_CHAIN_SELF = 54612, - SPELL_SOUL_PRISON_CHAIN = 54613, - SPELL_DK_INITIATE_VISUAL = 51519, - - SPELL_ICY_TOUCH = 52372, - SPELL_PLAGUE_STRIKE = 52373, - SPELL_BLOOD_STRIKE = 52374, - SPELL_DEATH_COIL = 52375 -}; - -#define EVENT_ICY_TOUCH 1 -#define EVENT_PLAGUE_STRIKE 2 -#define EVENT_BLOOD_STRIKE 3 -#define EVENT_DEATH_COIL 4 - -int32 say_event_start[8] = -{ - -1609000,-1609001,-1609002,-1609003, - -1609004,-1609005,-1609006,-1609007 -}; - -int32 say_event_attack[9] = -{ - -1609008,-1609009,-1609010,-1609011,-1609012, - -1609013,-1609014,-1609015,-1609016 -}; - -uint32 acherus_soul_prison[12] = -{ - 191577, - 191580, - 191581, - 191582, - 191583, - 191584, - 191585, - 191586, - 191587, - 191588, - 191589, - 191590 -}; - -uint32 acherus_unworthy_initiate[5] = -{ - 29519, - 29520, - 29565, - 29566, - 29567 -}; - -enum UnworthyInitiatePhase -{ - PHASE_CHAINED, - PHASE_TO_EQUIP, - PHASE_EQUIPING, - PHASE_TO_ATTACK, - PHASE_ATTACKING, -}; - -struct TRINITY_DLL_DECL npc_unworthy_initiateAI : public ScriptedAI -{ - npc_unworthy_initiateAI(Creature *c) : ScriptedAI(c) - { - me->SetReactState(REACT_PASSIVE); - if (!me->GetEquipmentId()) - if (const CreatureInfo *info = GetCreatureInfo(28406)) - if (info->equipmentId) - const_cast(me->GetCreatureInfo())->equipmentId = info->equipmentId; - } - - bool event_startet; - uint64 event_starter; - UnworthyInitiatePhase phase; - uint32 wait_timer; - float targ_x,targ_y,targ_z; - uint64 anchorGUID; - - EventMap events; - - void Reset() - { - anchorGUID = 0; - phase = PHASE_CHAINED; - events.Reset(); - m_creature->setFaction(7); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); - m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 8); - me->LoadEquipment(0, true); - event_startet = false; - } - - void EnterCombat(Unit *who) - { - events.ScheduleEvent(EVENT_ICY_TOUCH, 1000, GCD_CAST); - events.ScheduleEvent(EVENT_PLAGUE_STRIKE, 3000, GCD_CAST); - events.ScheduleEvent(EVENT_BLOOD_STRIKE, 2000, GCD_CAST); - events.ScheduleEvent(EVENT_DEATH_COIL, 5000, GCD_CAST); - } - - void MovementInform(uint32 type, uint32 id) - { - if (type != POINT_MOTION_TYPE) - return; - - if (id == 1) - { - wait_timer = 5000; - m_creature->CastSpell(m_creature,SPELL_DK_INITIATE_VISUAL,true); - - if (Unit* starter = Unit::GetUnit((*m_creature),event_starter)) - DoScriptText(say_event_attack[rand()%9],m_creature,starter); - - phase = PHASE_TO_ATTACK; - } - } - - void EventStart(Creature* anchor, Player* target) - { - wait_timer = 5000; - phase = PHASE_TO_EQUIP; - - m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); - m_creature->RemoveAurasDueToSpell(SPELL_SOUL_PRISON_CHAIN_SELF); - m_creature->RemoveAurasDueToSpell(SPELL_SOUL_PRISON_CHAIN); - - float z; - anchor->GetContactPoint(me, targ_x, targ_y, z, 1.0f); - - event_starter = target->GetGUID(); - DoScriptText(say_event_start[rand()%8], m_creature, target); - } - - void UpdateAI(const uint32 diff); -}; - -CreatureAI* GetAI_npc_unworthy_initiate(Creature* pCreature) -{ - return new npc_unworthy_initiateAI(pCreature); -} - -struct TRINITY_DLL_DECL npc_unworthy_initiate_anchorAI : public PassiveAI -{ - npc_unworthy_initiate_anchorAI(Creature *c) : PassiveAI(c), prisonerGUID(0) {} - - uint64 prisonerGUID; - - void SetGUID(const uint64 &guid, int32 id) - { - if (!prisonerGUID) - prisonerGUID = guid; - } - - uint64 GetGUID(int32 id) { return prisonerGUID; } -}; - -void npc_unworthy_initiateAI::UpdateAI(const uint32 diff) -{ - switch(phase) - { - case PHASE_CHAINED: - if (!anchorGUID) - { - float x, y, z; - float dist = 99.0f; - GameObject *prison = NULL; - - for(uint8 i = 0; i < 12; ++i) - { - if (GameObject* temp_prison = m_creature->FindNearestGameObject(acherus_soul_prison[i],30)) - { - if (dist == 99.0f || m_creature->IsWithinDist(temp_prison, dist, false)) - { - temp_prison->GetPosition(x, y, z); - dist = m_creature->GetDistance2d(temp_prison); - prison = temp_prison; - } - } - } - - if (!prison) - return; - - if (Creature* trigger = me->FindNearestCreature(29521, 30)) - { - prison->ResetDoorOrButton(); - trigger->AI()->SetGUID(m_creature->GetGUID()); - trigger->CastSpell(me, SPELL_SOUL_PRISON_CHAIN, true); - anchorGUID = trigger->GetGUID(); - } - } - return; - case PHASE_TO_EQUIP: - if (wait_timer) - { - if (wait_timer < diff) - { - m_creature->GetMotionMaster()->MovePoint(1,targ_x,targ_y,m_creature->GetPositionZ()); - phase = PHASE_EQUIPING; - wait_timer = 0; - }else wait_timer -= diff; - } - return; - case PHASE_TO_ATTACK: - if (wait_timer) - { - if (wait_timer < diff) - { - m_creature->setFaction(14); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); - phase = PHASE_ATTACKING; - - if (Unit* target = Unit::GetUnit((*m_creature),event_starter)) - m_creature->AI()->AttackStart(target); - wait_timer = 0; - }else wait_timer -= diff; - } - return; - case PHASE_ATTACKING: - if (!UpdateVictim()) - return; - - events.Update(diff); - - while(uint32 eventId = events.ExecuteEvent()) - { - switch(eventId) - { - case EVENT_ICY_TOUCH: - DoCast(m_creature->getVictim(), SPELL_ICY_TOUCH); - events.DelayEvents(1000, GCD_CAST); - events.ScheduleEvent(EVENT_ICY_TOUCH, 5000, GCD_CAST); - break; - case EVENT_PLAGUE_STRIKE: - DoCast(m_creature->getVictim(), SPELL_PLAGUE_STRIKE); - events.DelayEvents(1000, GCD_CAST); - events.ScheduleEvent(SPELL_PLAGUE_STRIKE, 5000, GCD_CAST); - break; - case EVENT_BLOOD_STRIKE: - DoCast(m_creature->getVictim(), SPELL_BLOOD_STRIKE); - events.DelayEvents(1000, GCD_CAST); - events.ScheduleEvent(EVENT_BLOOD_STRIKE, 5000, GCD_CAST); - break; - case EVENT_DEATH_COIL: - DoCast(m_creature->getVictim(), SPELL_DEATH_COIL); - events.DelayEvents(1000, GCD_CAST); - events.ScheduleEvent(EVENT_DEATH_COIL, 5000, GCD_CAST); - break; - } - } - - DoMeleeAttackIfReady(); - return; - } -} - -CreatureAI* GetAI_npc_unworthy_initiate_anchor(Creature* pCreature) -{ - return new npc_unworthy_initiate_anchorAI(pCreature); -} - -bool GOHello_go_acherus_soul_prison(Player* pPlayer, GameObject* pGo) -{ - if (Creature *anchor = pGo->FindNearestCreature(29521, 15)) - if (uint64 prisonerGUID = anchor->AI()->GetGUID()) - if (Creature* prisoner = Creature::GetCreature(*pPlayer, prisonerGUID)) - CAST_AI(npc_unworthy_initiateAI, (prisoner->AI()))->EventStart(anchor, pPlayer); - - return false; -} - -/*###### -## npc_death_knight_initiate -######*/ - -#define GOSSIP_ACCEPT_DUEL "I challenge you, death knight!" - -enum -{ - SAY_DUEL_A = -1609080, - SAY_DUEL_B = -1609081, - SAY_DUEL_C = -1609082, - SAY_DUEL_D = -1609083, - SAY_DUEL_E = -1609084, - SAY_DUEL_F = -1609085, - SAY_DUEL_G = -1609086, - SAY_DUEL_H = -1609087, - SAY_DUEL_I = -1609088, - - SPELL_DUEL = 52996, - SPELL_DUEL_TRIGGERED = 52990, - SPELL_DUEL_VICTORY = 52994, - SPELL_DUEL_FLAG = 52991, - - QUEST_DEATH_CHALLENGE = 12733, - FACTION_HOSTILE = 2068 -}; - -int32 m_auiRandomSay[] = -{ - SAY_DUEL_A, SAY_DUEL_B, SAY_DUEL_C, SAY_DUEL_D, SAY_DUEL_E, SAY_DUEL_F, SAY_DUEL_G, SAY_DUEL_H, SAY_DUEL_I -}; - -struct TRINITY_DLL_DECL npc_death_knight_initiateAI : public SpellAI -{ - npc_death_knight_initiateAI(Creature* pCreature) : SpellAI(pCreature) - { - m_bIsDuelInProgress = false; - } - - bool lose; - uint64 m_uiDuelerGUID; - uint32 m_uiDuelTimer; - bool m_bIsDuelInProgress; - - void Reset() - { - lose = false; - me->RestoreFaction(); - SpellAI::Reset(); - - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_15); - - m_uiDuelerGUID = 0; - m_uiDuelTimer = 5000; - m_bIsDuelInProgress = false; - } - - void SpellHit(Unit* pCaster, const SpellEntry* pSpell) - { - if (!m_bIsDuelInProgress && pSpell->Id == SPELL_DUEL_TRIGGERED) - { - m_uiDuelerGUID = pCaster->GetGUID(); - m_bIsDuelInProgress = true; - } - } - - void DamageTaken(Unit* pDoneBy, uint32 &uiDamage) - { - if (m_bIsDuelInProgress && pDoneBy->IsControlledByPlayer()) - { - if (pDoneBy->GetGUID() != m_uiDuelerGUID && pDoneBy->GetOwnerGUID() != m_uiDuelerGUID) // other players cannot help - uiDamage = 0; - else if (uiDamage >= m_creature->GetHealth()) - { - uiDamage = 0; - - if (!lose) - { - pDoneBy->RemoveGameObject(SPELL_DUEL_FLAG, true); - pDoneBy->AttackStop(); - me->CastSpell(pDoneBy, SPELL_DUEL_VICTORY, true); - lose = true; - me->CastSpell(me, 7267, true); - me->RestoreFaction(); - } - } - } - } - - void UpdateAI(const uint32 uiDiff) - { - if (!UpdateVictim()) - { - if (m_bIsDuelInProgress) - { - if (m_uiDuelTimer < uiDiff) - { - m_creature->setFaction(FACTION_HOSTILE); - - if (Unit* pUnit = Unit::GetUnit(*m_creature, m_uiDuelerGUID)) - AttackStart(pUnit); - } - else - m_uiDuelTimer -= uiDiff; - } - return; - } - - if (m_bIsDuelInProgress) - { - if (lose) - { - if (!me->HasAura(7267)) - EnterEvadeMode(); - return; - } - else if (me->getVictim()->GetTypeId() == TYPEID_PLAYER - && me->getVictim()->GetHealth() * 10 < me->getVictim()->GetMaxHealth()) - { - me->getVictim()->CastSpell(me->getVictim(), 7267, true); // beg - me->getVictim()->RemoveGameObject(SPELL_DUEL_FLAG, true); - EnterEvadeMode(); - return; - } - } - - // TODO: spells - - SpellAI::UpdateAI(uiDiff); - } -}; - -CreatureAI* GetAI_npc_death_knight_initiate(Creature* pCreature) -{ - return new npc_death_knight_initiateAI(pCreature); -} - -bool GossipHello_npc_death_knight_initiate(Player* pPlayer, Creature* pCreature) -{ - if (pPlayer->GetQuestStatus(QUEST_DEATH_CHALLENGE) == QUEST_STATUS_INCOMPLETE && pCreature->GetHealth() == pCreature->GetMaxHealth()) - { - if (pPlayer->GetHealth() * 10 < pPlayer->GetMaxHealth()) - return true; - - if (pPlayer->isInCombat() || pCreature->isInCombat()) - return true; - - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ACCEPT_DUEL, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(),pCreature->GetGUID()); - } - return true; -} - -bool GossipSelect_npc_death_knight_initiate(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - if (uiAction == GOSSIP_ACTION_INFO_DEF) - { - pPlayer->CLOSE_GOSSIP_MENU(); - - if (pPlayer->isInCombat() || pCreature->isInCombat()) - return true; - - if (npc_death_knight_initiateAI* pInitiateAI = CAST_AI(npc_death_knight_initiateAI, pCreature->AI())) - { - if (pInitiateAI->m_bIsDuelInProgress) - return true; - } - - pCreature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_15); - - int32 uiSayId = rand()% (sizeof(m_auiRandomSay)/sizeof(int32)); - DoScriptText(m_auiRandomSay[uiSayId], pCreature, pPlayer); - - pCreature->CastSpell(pPlayer, SPELL_DUEL, false); - pPlayer->CastSpell(pPlayer, SPELL_DUEL_FLAG, true); - } - return true; -} - -/*###### -## npc_dark_rider_of_acherus -######*/ - -#define DESPAWN_HORSE 52267 - -struct TRINITY_DLL_DECL npc_dark_rider_of_acherusAI : public ScriptedAI -{ - npc_dark_rider_of_acherusAI(Creature *c) : ScriptedAI(c) {} - - uint32 PhaseTimer; - uint32 Phase; - bool Intro; - Unit *Target; - - void Reset() - { - PhaseTimer = 4000; - Phase = 0; - Intro = false; - Target = NULL; - } - - void UpdateAI(const uint32 diff) - { - if (!Intro) - return; - - if (PhaseTimer < diff) - { - switch(Phase) - { - case 0: - m_creature->MonsterSay("The realm of shadows awaits...", LANG_UNIVERSAL, 0); - PhaseTimer = 5000; - Phase = 1; - break; - case 1: - DoCast(Target, DESPAWN_HORSE, true); - PhaseTimer = 3000; - Phase = 2; - break; - case 2: - m_creature->SetVisibility(VISIBILITY_OFF); - PhaseTimer = 2000; - Phase = 3; - break; - case 3: - m_creature->ForcedDespawn(); - break; - default: - break; - } - }else PhaseTimer -= diff; - - } - - void InitDespawnHorse(Unit *who) - { - if (!who) - return; - - Target = who; - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - m_creature->SetSpeed(MOVE_RUN, 0.4f); - m_creature->GetMotionMaster()->MoveChase(Target); - m_creature->SetUInt64Value(UNIT_FIELD_TARGET, Target->GetGUID()); - Intro = true; - } - -}; - -CreatureAI* GetAI_npc_dark_rider_of_acherus(Creature* pCreature) -{ - return new npc_dark_rider_of_acherusAI(pCreature); -} - -/*###### -## npc_salanar_the_horseman -######*/ - -enum -{ - REALM_OF_SHADOWS = 52693, - DELIVER_STOLEN_HORSE = 52264, - CALL_DARK_RIDER = 52266 -}; - -struct TRINITY_DLL_DECL npc_salanar_the_horsemanAI : public ScriptedAI -{ - npc_salanar_the_horsemanAI(Creature *c) : ScriptedAI(c) {} - - void SpellHit(Unit *caster, const SpellEntry *spell) - { - if (spell->Id == DELIVER_STOLEN_HORSE) - { - if (caster->GetTypeId() == TYPEID_UNIT && CAST_CRE(caster)->isVehicle()) - { - if (Unit *charmer = caster->GetCharmer()) - { - charmer->ExitVehicle(); - caster->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK); - caster->setFaction(35); - DoCast(caster, CALL_DARK_RIDER, true); - if (Creature* Dark_Rider = m_creature->FindNearestCreature(28654, 15)) - CAST_AI(npc_dark_rider_of_acherusAI, Dark_Rider->AI())->InitDespawnHorse(caster); - } - } - } - } - - void MoveInLineOfSight(Unit *who) - { - ScriptedAI::MoveInLineOfSight(who); - - if (who->GetTypeId() == TYPEID_UNIT && CAST_CRE(who)->isVehicle() && me->IsWithinDistInMap(who, 10.0f)) - { - if (Unit *charmer = who->GetCharmer()) - { - if (charmer->GetTypeId() == TYPEID_PLAYER) - { - switch(me->GetEntry()) - { - // for quest Into the Realm of Shadows(12687) - case 28788: - if (CAST_PLR(charmer)->GetQuestStatus(12687) == QUEST_STATUS_INCOMPLETE) - { - if (CAST_PLR(charmer)->HasAura(REALM_OF_SHADOWS)) - charmer->RemoveAurasDueToSpell(REALM_OF_SHADOWS); - CAST_PLR(charmer)->GroupEventHappens(12687, me); - } - break; - default: - return; - } - CAST_PLR(charmer)->ExitVehicle(); - CAST_CRE(who)->Respawn(true); - } - } - } - } -}; - -CreatureAI* GetAI_npc_salanar_the_horseman(Creature* pCreature) -{ - return new npc_salanar_the_horsemanAI(pCreature); -} - -/*###### -## npc_ros_dark_rider -######*/ - -struct TRINITY_DLL_DECL npc_ros_dark_riderAI : public ScriptedAI -{ - npc_ros_dark_riderAI(Creature *c) : ScriptedAI(c) {} - - void EnterCombat(Unit *who) - { - me->ExitVehicle(); - } - - void Reset() - { - Creature* deathcharger = me->FindNearestCreature(28782, 30); - if (!deathcharger) return; - deathcharger->RestoreFaction(); - deathcharger->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK); - deathcharger->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - if (!me->m_Vehicle && deathcharger->isVehicle() && CAST_VEH(deathcharger)->HasEmptySeat(0)) - me->EnterVehicle(CAST_VEH(deathcharger)); - } - - void JustDied(Unit *killer) - { - Creature* deathcharger = me->FindNearestCreature(28782, 30); - if (!deathcharger) return; - if (killer->GetTypeId() == TYPEID_PLAYER && deathcharger->GetTypeId() == TYPEID_UNIT && deathcharger->isVehicle()) - { - deathcharger->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK); - deathcharger->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - deathcharger->setFaction(2096); - } - } -}; - -CreatureAI* GetAI_npc_ros_dark_rider(Creature* pCreature) -{ - return new npc_ros_dark_riderAI(pCreature); -} - -// correct way: 52312 52314 52555 ... -struct TRINITY_DLL_DECL npc_dkc1_gothikAI : public ScriptedAI -{ - npc_dkc1_gothikAI(Creature *c) : ScriptedAI(c) {} - - void MoveInLineOfSight(Unit *who) - { - ScriptedAI::MoveInLineOfSight(who); - - if (who->GetEntry() == 28845 && me->IsWithinDistInMap(who, 10.0f)) - { - if (Unit *owner = who->GetOwner()) - { - if (owner->GetTypeId() == TYPEID_PLAYER) - { - if (CAST_PLR(owner)->GetQuestStatus(12698) == QUEST_STATUS_INCOMPLETE) - { - CAST_CRE(who)->CastSpell(owner, 52517, true); - CAST_CRE(who)->ForcedDespawn(); - } - } - } - } - } -}; - -CreatureAI* GetAI_npc_dkc1_gothik(Creature* pCreature) -{ - return new npc_dkc1_gothikAI(pCreature); -} - - -/*#### -## npc_scarlet_miner_cart -####*/ - -#define SPELL_CART_CHECK 54173 -#define SPELL_CART_DRAG 52465 - -struct TRINITY_DLL_DECL npc_scarlet_miner_cartAI : public PassiveAI -{ - npc_scarlet_miner_cartAI(Creature *c) : PassiveAI(c), minerGUID(0) - { - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); - me->SetDisplayId(me->GetCreatureInfo()->DisplayID_A[0]); // H0 is horse - } - - uint64 minerGUID; - - void SetGUID(const uint64 &guid, int32 id) - { - minerGUID = guid; - } - - void DoAction(const int32 param) - { - if(Creature *miner = Unit::GetCreature(*me, minerGUID)) - { - // very bad visual effect - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - //me->SetSpeed(MOVE_WALK, miner->GetSpeed(MOVE_WALK)); - me->SetSpeed(MOVE_RUN, miner->GetSpeed(MOVE_RUN)); - me->GetMotionMaster()->MoveFollow(miner, 1.0f, 0); - } - } - - void PassengerLeft(Unit *who, int8 seatId) - { - if(Creature *miner = Unit::GetCreature(*me, minerGUID)) - miner->DisappearAndDie(); - } -}; - -CreatureAI* GetAI_npc_scarlet_miner_cart(Creature *_Creature) -{ - return new npc_scarlet_miner_cartAI(_Creature); -} - -/*#### -## npc_scarlet_miner -####*/ - -struct TRINITY_DLL_DECL npc_scarlet_minerAI : public npc_escortAI -{ - npc_scarlet_minerAI(Creature *c) : npc_escortAI(c) - { - me->SetReactState(REACT_PASSIVE); - } - - uint32 IntroTimer; - uint32 IntroPhase; - uint64 carGUID; - - void Reset() - { - carGUID = 0; - IntroTimer = 0; - IntroPhase = 0; - } - - void InitWaypoint() - { - AddWaypoint(1, 2389.03, -5902.74, 109.014, 5000); - AddWaypoint(2, 2341.812012, -5900.484863, 102.619743); - AddWaypoint(3, 2306.561279, -5901.738281, 91.792419 ); - AddWaypoint(4, 2300.098389, -5912.618652, 86.014885 ); - AddWaypoint(5, 2294.142090, -5927.274414, 75.316849 ); - AddWaypoint(6, 2286.984375, -5944.955566, 63.714966 ); - AddWaypoint(7, 2280.001709, -5961.186035, 54.228283 ); - AddWaypoint(8, 2259.389648, -5974.197754, 42.359348 ); - AddWaypoint(9, 2242.882812, -5984.642578, 32.827850 ); - AddWaypoint(10, 2217.265625, -6028.959473, 7.675705 ); - AddWaypoint(11, 2202.595947, -6061.325684, 5.882018 ); - AddWaypoint(12, 2188.974609, -6080.866699, 3.370027 ); - - if(rand()%2) - { - AddWaypoint(13, 2176.483887, -6110.407227, 1.855181 ); - AddWaypoint(14, 2172.516602, -6146.752441, 1.074235 ); - AddWaypoint(15, 2138.918457, -6158.920898, 1.342926 ); - AddWaypoint(16, 2129.866699, -6174.107910, 4.380779 ); - AddWaypoint(17, 2117.709473, -6193.830078, 13.3542, 10000); - } - else - { - AddWaypoint(13, 2184.190186, -6166.447266, 0.968877 ); - AddWaypoint(14, 2234.265625, -6163.741211, 0.916021 ); - AddWaypoint(15, 2268.071777, -6158.750977, 1.822252 ); - AddWaypoint(16, 2270.028320, -6176.505859, 6.340538 ); - AddWaypoint(17, 2271.739014, -6195.401855, 13.3542, 10000); - } - } - - void InitCartQuest(Player *who) - { - carGUID = who->m_Vehicle->GetGUID(); - InitWaypoint(); - Start(false, false, who->GetGUID()); - SetDespawnAtFar(false); - } - - void WaypointReached(uint32 i) - { - switch (i) - { - case 1: - if(Unit *car = Unit::GetCreature(*me, carGUID)) - { - me->SetInFront(car); - me->SendMovementFlagUpdate(); - } - me->MonsterSay("Where'd this come from? I better get this down to the ships before the foreman sees it!",LANG_UNIVERSAL,NULL); - SetRun(true); - IntroTimer = 4000; - IntroPhase = 1; - break; - case 17: - if(Unit *car = Unit::GetCreature(*me, carGUID)) - { - me->SetInFront(car); - me->SendMovementFlagUpdate(); - car->Relocate(car->GetPositionX(), car->GetPositionY(), me->GetPositionZ()); - car->SendMonsterStop(); - //this make player fall under ground, dunno why - //car->GetMotionMaster()->MovePoint(0, car->GetPositionX(), car->GetPositionY(), me->GetPositionZ()); - car->RemoveAura(SPELL_CART_DRAG); - } - me->MonsterSay("Now I can have a rest!",LANG_UNIVERSAL,NULL); - break; - default: - break; - } - } - - void UpdateAI(const uint32 diff) - { - if (IntroPhase) - { - if (IntroTimer < diff) - { - if (IntroPhase == 1) - { - if(Creature *car = Unit::GetCreature(*me, carGUID)) - DoCast(car, SPELL_CART_DRAG); - IntroTimer = 800; - IntroPhase = 2; - } - else - { - if(Creature *car = Unit::GetCreature(*me, carGUID)) - car->AI()->DoAction(); - IntroPhase = 0; - } - }else IntroTimer-=diff; - } - npc_escortAI::UpdateAI(diff); - } -}; - -CreatureAI* GetAI_npc_scarlet_miner(Creature *_Creature) -{ - return new npc_scarlet_minerAI(_Creature); -} - -/*###### -## go_inconspicuous_mine_car -######*/ - -#define SPELL_CART_SUMM 52463 - -bool GOHello_go_inconspicuous_mine_car(Player* pPlayer, GameObject* pGO) -{ - if (pPlayer->GetQuestStatus(12701) == QUEST_STATUS_INCOMPLETE) - { - // Hack Why Trinity Dont Support Custom Summon Location - if(Creature *miner = pPlayer->SummonCreature(28841, 2383.869629, -5900.312500, 107.996086, pPlayer->GetOrientation(),TEMPSUMMON_DEAD_DESPAWN, 1)) - { - pPlayer->CastSpell(pPlayer, SPELL_CART_SUMM, true); - if(Vehicle *car = pPlayer->m_Vehicle) - { - if(car->GetEntry() == 28817) - { - car->AI()->SetGUID(miner->GetGUID()); - CAST_AI(npc_scarlet_minerAI, miner->AI())->InitCartQuest(pPlayer); - }else error_log("TSCR: GOHello_go_inconspicuous_mine_car vehicle entry is not correct."); - }else error_log("TSCR: GOHello_go_inconspicuous_mine_car player is not on the vehicle."); - }else error_log("TSCR: GOHello_go_inconspicuous_mine_car Scarlet Miner cant be found by script."); - } - return true; -} - -// npc 28912 quest 17217 boss 29001 mob 29007 go 191092 /*#### ## npc_valkyr_battle_maiden @@ -1624,6 +560,7 @@ CreatureAI* GetAI_npc_valkyr_battle_maiden(Creature* pCreature) return new npc_valkyr_battle_maidenAI (pCreature); } + void AddSC_the_scarlet_enclave() { Script *newscript; @@ -1633,76 +570,6 @@ void AddSC_the_scarlet_enclave() newscript->GetAI = &GetAI_npc_valkyr_battle_maiden; newscript->RegisterSelf(); - // 12848 The Endless Hunger - newscript = new Script; - newscript->Name="npc_unworthy_initiate"; - newscript->GetAI = &GetAI_npc_unworthy_initiate; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_unworthy_initiate_anchor"; - newscript->GetAI = &GetAI_npc_unworthy_initiate_anchor; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="go_acherus_soul_prison"; - newscript->pGOHello = &GOHello_go_acherus_soul_prison; - newscript->RegisterSelf(); - - // Death's Challenge - newscript = new Script; - newscript->Name="npc_death_knight_initiate"; - newscript->GetAI = &GetAI_npc_death_knight_initiate; - newscript->pGossipHello = &GossipHello_npc_death_knight_initiate; - newscript->pGossipSelect = &GossipSelect_npc_death_knight_initiate; - newscript->RegisterSelf(); - - // 12680 Grand Theft Palomino - newscript = new Script; - newscript->Name="npc_salanar_the_horseman"; - newscript->GetAI = &GetAI_npc_salanar_the_horseman; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_dark_rider_of_acherus"; - newscript->GetAI = &GetAI_npc_dark_rider_of_acherus; - newscript->RegisterSelf(); - - // 12687 Into the Realm of Shadows - newscript = new Script; - newscript->Name="npc_ros_dark_rider"; - newscript->GetAI = &GetAI_npc_ros_dark_rider; - newscript->RegisterSelf(); - - // 12698 The Gift That Keeps On Giving - newscript = new Script; - newscript->Name="npc_dkc1_gothik"; - newscript->GetAI = &GetAI_npc_dkc1_gothik; - newscript->RegisterSelf(); - - // Massacre At Light's Point - newscript = new Script; - newscript->Name="npc_scarlet_miner"; - newscript->GetAI = &GetAI_npc_scarlet_miner; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_scarlet_miner_cart"; - newscript->GetAI = &GetAI_npc_scarlet_miner_cart; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="go_inconspicuous_mine_car"; - newscript->pGOHello = &GOHello_go_inconspicuous_mine_car; - newscript->RegisterSelf(); - - // 12727 Bloody Breakout - newscript = new Script; - newscript->Name = "npc_koltira_deathweaver"; - newscript->GetAI = &GetAI_npc_koltira_deathweaver; - newscript->pQuestAccept = &QuestAccept_npc_koltira_deathweaver; - newscript->RegisterSelf(); - // A Special Suprise newscript = new Script; newscript->Name = "npc_a_special_surprise"; diff --git a/src/bindings/scripts/system/ScriptLoader.cpp b/src/bindings/scripts/system/ScriptLoader.cpp index 236dab3bfcc..06997e985af 100644 --- a/src/bindings/scripts/system/ScriptLoader.cpp +++ b/src/bindings/scripts/system/ScriptLoader.cpp @@ -91,6 +91,8 @@ extern void AddSC_boss_ragnaros(); extern void AddSC_instance_molten_core(); extern void AddSC_molten_core(); extern void AddSC_the_scarlet_enclave(); //Scarlet Enclave +extern void AddSC_the_scarlet_enclave_c1(); +extern void AddSC_the_scarlet_enclave_c2(); extern void AddSC_boss_arcanist_doan(); //Scarlet Monastery extern void AddSC_boss_azshir_the_sleepless(); extern void AddSC_boss_bloodmage_thalnos(); @@ -477,6 +479,8 @@ void AddScripts() AddSC_instance_molten_core(); AddSC_molten_core(); AddSC_the_scarlet_enclave(); //Scarlet Enclave + AddSC_the_scarlet_enclave_c1(); + AddSC_the_scarlet_enclave_c2(); AddSC_boss_arcanist_doan(); //Scarlet Monastery AddSC_boss_azshir_the_sleepless(); AddSC_boss_bloodmage_thalnos(); diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 4824b260334..39eb470bc9c 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -2014,10 +2014,11 @@ void Spell::EffectForceCast(uint32 i) { switch(m_spellInfo->Id) { + // 52463 also use custom damage and the summon veh spell use that damamge and cast mount aura? case 52588: unitTarget->RemoveAura(damage); break; } } - else + else // this was for 52463, need further study { unitTarget->CastCustomSpell(unitTarget, spellInfo->Id, &damage, NULL, NULL, true, NULL, NULL, m_originalCasterGUID); return; -- cgit v1.2.3