From a30cc63d2775bbf6930afe04838a51e14da26e04 Mon Sep 17 00:00:00 2001 From: Kudlaty Date: Sat, 15 Aug 2009 02:34:43 +0200 Subject: Merge [SD2] r1287 Move all non-instance scripts that are not related to any special continent to new world folder. Windows users pls wait until vcproj will be fixed --HG-- branch : trunk --- src/bindings/scripts/CMakeLists.txt | 120 +- .../scripts/eastern_kingdoms/alterac_mountains.cpp | 33 + .../scripts/eastern_kingdoms/arathi_highlands.cpp | 134 ++ .../scripts/eastern_kingdoms/blasted_lands.cpp | 162 ++ .../scripts/eastern_kingdoms/boss_kruul.cpp | 183 ++ .../scripts/eastern_kingdoms/burning_steppes.cpp | 154 ++ .../scripts/eastern_kingdoms/dun_morogh.cpp | 102 ++ .../eastern_kingdoms/eastern_plaguelands.cpp | 180 ++ .../scripts/eastern_kingdoms/elwynn_forest.cpp | 102 ++ .../scripts/eastern_kingdoms/eversong_woods.cpp | 742 ++++++++ .../scripts/eastern_kingdoms/ghostlands.cpp | 277 +++ .../scripts/eastern_kingdoms/hinterlands.cpp | 234 +++ .../scripts/scripts/eastern_kingdoms/ironforge.cpp | 94 + .../scripts/eastern_kingdoms/loch_modan.cpp | 101 ++ .../scripts/eastern_kingdoms/searing_gorge.cpp | 160 ++ .../scripts/eastern_kingdoms/silvermoon_city.cpp | 104 ++ .../scripts/eastern_kingdoms/silverpine_forest.cpp | 233 +++ .../scripts/eastern_kingdoms/stormwind_city.cpp | 267 +++ .../eastern_kingdoms/stranglethorn_vale.cpp | 123 ++ .../scripts/eastern_kingdoms/tirisfal_glades.cpp | 209 +++ .../scripts/scripts/eastern_kingdoms/undercity.cpp | 266 +++ .../eastern_kingdoms/western_plaguelands.cpp | 232 +++ .../scripts/scripts/eastern_kingdoms/westfall.cpp | 276 +++ .../scripts/scripts/kalimdor/ashenvale.cpp | 256 +++ src/bindings/scripts/scripts/kalimdor/azshara.cpp | 508 ++++++ .../scripts/scripts/kalimdor/azuremyst_isle.cpp | 630 +++++++ .../scripts/scripts/kalimdor/bloodmyst_isle.cpp | 142 ++ .../scripts/scripts/kalimdor/boss_azuregos.cpp | 155 ++ .../scripts/scripts/kalimdor/darkshore.cpp | 347 ++++ src/bindings/scripts/scripts/kalimdor/desolace.cpp | 174 ++ .../scripts/scripts/kalimdor/dustwallow_marsh.cpp | 337 ++++ src/bindings/scripts/scripts/kalimdor/felwood.cpp | 90 + src/bindings/scripts/scripts/kalimdor/feralas.cpp | 212 +++ .../scripts/scripts/kalimdor/moonglade.cpp | 570 ++++++ src/bindings/scripts/scripts/kalimdor/mulgore.cpp | 315 ++++ .../scripts/scripts/kalimdor/orgrimmar.cpp | 286 +++ src/bindings/scripts/scripts/kalimdor/silithus.cpp | 223 +++ .../scripts/kalimdor/stonetalon_mountains.cpp | 176 ++ src/bindings/scripts/scripts/kalimdor/tanaris.cpp | 815 +++++++++ .../scripts/scripts/kalimdor/teldrassil.cpp | 192 ++ .../scripts/scripts/kalimdor/the_barrens.cpp | 674 +++++++ .../scripts/scripts/kalimdor/thousand_needles.cpp | 413 +++++ .../scripts/scripts/kalimdor/thunder_bluff.cpp | 138 ++ .../scripts/scripts/kalimdor/winterspring.cpp | 168 ++ .../scripts/scripts/northrend/borean_tundra.cpp | 356 ++++ .../scripts/scripts/northrend/dragonblight.cpp | 71 + .../scripts/scripts/northrend/grizzly_hills.cpp | 126 ++ .../scripts/scripts/northrend/icecrown.cpp | 117 ++ .../scripts/scripts/northrend/sholazar_basin.cpp | 180 ++ src/bindings/scripts/scripts/northrend/zuldrak.cpp | 184 ++ .../scripts/outland/blades_edge_mountains.cpp | 416 +++++ .../scripts/outland/boss_doomlord_kazzak.cpp | 183 ++ .../scripts/scripts/outland/boss_doomwalker.cpp | 191 ++ .../scripts/scripts/outland/hellfire_peninsula.cpp | 245 +++ .../scripts/scripts/outland/isle_of_queldanas.cpp | 154 ++ src/bindings/scripts/scripts/outland/nagrand.cpp | 718 ++++++++ .../scripts/scripts/outland/netherstorm.cpp | 952 ++++++++++ .../scripts/scripts/outland/shadowmoon_valley.cpp | 1841 ++++++++++++++++++++ .../scripts/scripts/outland/shattrath_city.cpp | 692 ++++++++ .../scripts/scripts/outland/terokkar_forest.cpp | 745 ++++++++ .../scripts/scripts/outland/zangarmarsh.cpp | 379 ++++ .../zone/alterac_mountains/alterac_mountains.cpp | 33 - .../zone/arathi_highlands/arathi_highlands.cpp | 134 -- .../scripts/zone/ashenvale_forest/ashenvale.cpp | 256 --- .../scripts/scripts/zone/azshara/azshara.cpp | 508 ------ .../scripts/scripts/zone/azshara/boss_azuregos.cpp | 155 -- .../scripts/zone/azuremyst_isle/azuremyst_isle.cpp | 630 ------- .../scripts/scripts/zone/barrens/the_barrens.cpp | 674 ------- .../blades_edge_mountains.cpp | 416 ----- .../scripts/zone/blasted_lands/blasted_lands.cpp | 162 -- .../scripts/zone/blasted_lands/boss_kruul.cpp | 183 -- .../scripts/zone/bloodmyst_isle/bloodmyst_isle.cpp | 142 -- .../scripts/zone/borean_tundra/borean_tundra.cpp | 356 ---- .../zone/burning_steppes/burning_steppes.cpp | 154 -- .../scripts/scripts/zone/darkshore/darkshore.cpp | 347 ---- .../scripts/scripts/zone/desolace/desolace.cpp | 174 -- .../scripts/zone/dragonblight/dragonblight.cpp | 71 - .../scripts/scripts/zone/dun_morogh/dun_morogh.cpp | 102 -- .../zone/dustwallow_marsh/dustwallow_marsh.cpp | 337 ---- .../eastern_plaguelands/eastern_plaguelands.cpp | 180 -- .../scripts/zone/elwynn_forest/elwynn_forest.cpp | 102 -- .../scripts/zone/eversong_woods/eversong_woods.cpp | 742 -------- .../scripts/scripts/zone/felwood/felwood.cpp | 90 - .../scripts/scripts/zone/feralas/feralas.cpp | 212 --- .../scripts/scripts/zone/ghostlands/ghostlands.cpp | 277 --- .../scripts/zone/grizzly_hills/grizzly_hills.cpp | 126 -- .../hellfire_peninsula/boss_doomlord_kazzak.cpp | 183 -- .../zone/hellfire_peninsula/hellfire_peninsula.cpp | 245 --- .../scripts/zone/hinterlands/hinterlands.cpp | 234 --- .../scripts/scripts/zone/icecrown/icecrown.cpp | 117 -- .../scripts/scripts/zone/ironforge/ironforge.cpp | 94 - .../zone/isle_of_queldanas/isle_of_queldanas.cpp | 154 -- .../scripts/scripts/zone/loch_modan/loch_modan.cpp | 101 -- .../scripts/scripts/zone/moonglade/moonglade.cpp | 570 ------ .../scripts/scripts/zone/mulgore/mulgore.cpp | 315 ---- .../scripts/scripts/zone/nagrand/nagrand.cpp | 718 -------- .../scripts/zone/netherstorm/netherstorm.cpp | 952 ---------- .../scripts/scripts/zone/orgrimmar/orgrimmar.cpp | 286 --- .../scripts/zone/searing_gorge/searing_gorge.cpp | 160 -- .../zone/shadowmoon_valley/boss_doomwalker.cpp | 191 -- .../zone/shadowmoon_valley/shadowmoon_valley.cpp | 1841 -------------------- .../scripts/zone/shattrath/shattrath_city.cpp | 692 -------- .../scripts/zone/sholazar_basin/sholazar_basin.cpp | 180 -- .../scripts/scripts/zone/silithus/silithus.cpp | 223 --- .../scripts/zone/silvermoon/silvermoon_city.cpp | 104 -- .../zone/silverpine_forest/silverpine_forest.cpp | 233 --- .../stonetalon_mountains/stonetalon_mountains.cpp | 176 -- .../scripts/zone/stormwind/stormwind_city.cpp | 267 --- .../zone/stranglethorn_vale/stranglethorn_vale.cpp | 123 -- .../scripts/scripts/zone/tanaris/tanaris.cpp | 815 --------- .../scripts/scripts/zone/teldrassil/teldrassil.cpp | 192 -- .../zone/terokkar_forest/terokkar_forest.cpp | 745 -------- .../zone/thousand_needles/thousand_needles.cpp | 413 ----- .../scripts/zone/thunder_bluff/thunder_bluff.cpp | 138 -- .../zone/tirisfal_glades/tirisfal_glades.cpp | 209 --- .../scripts/scripts/zone/undercity/undercity.cpp | 266 --- .../western_plaguelands/western_plaguelands.cpp | 232 --- .../scripts/scripts/zone/westfall/westfall.cpp | 276 --- .../scripts/zone/winterspring/winterspring.cpp | 168 -- .../scripts/zone/zangarmarsh/zangarmarsh.cpp | 379 ---- .../scripts/scripts/zone/zuldrak/zuldrak.cpp | 184 -- 121 files changed, 18799 insertions(+), 18799 deletions(-) create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/alterac_mountains.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/arathi_highlands.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/blasted_lands.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/boss_kruul.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/burning_steppes.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/dun_morogh.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/eastern_plaguelands.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/elwynn_forest.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/eversong_woods.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/ghostlands.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/hinterlands.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/ironforge.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/loch_modan.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/searing_gorge.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/silvermoon_city.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/silverpine_forest.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/stormwind_city.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/stranglethorn_vale.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/tirisfal_glades.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/undercity.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/western_plaguelands.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/westfall.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/ashenvale.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/azshara.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/azuremyst_isle.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/bloodmyst_isle.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/boss_azuregos.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/darkshore.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/desolace.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/dustwallow_marsh.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/felwood.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/feralas.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/moonglade.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/mulgore.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/orgrimmar.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/silithus.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/stonetalon_mountains.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/tanaris.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/teldrassil.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/the_barrens.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/thousand_needles.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/thunder_bluff.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/winterspring.cpp create mode 100644 src/bindings/scripts/scripts/northrend/borean_tundra.cpp create mode 100644 src/bindings/scripts/scripts/northrend/dragonblight.cpp create mode 100644 src/bindings/scripts/scripts/northrend/grizzly_hills.cpp create mode 100644 src/bindings/scripts/scripts/northrend/icecrown.cpp create mode 100644 src/bindings/scripts/scripts/northrend/sholazar_basin.cpp create mode 100644 src/bindings/scripts/scripts/northrend/zuldrak.cpp create mode 100644 src/bindings/scripts/scripts/outland/blades_edge_mountains.cpp create mode 100644 src/bindings/scripts/scripts/outland/boss_doomlord_kazzak.cpp create mode 100644 src/bindings/scripts/scripts/outland/boss_doomwalker.cpp create mode 100644 src/bindings/scripts/scripts/outland/hellfire_peninsula.cpp create mode 100644 src/bindings/scripts/scripts/outland/isle_of_queldanas.cpp create mode 100644 src/bindings/scripts/scripts/outland/nagrand.cpp create mode 100644 src/bindings/scripts/scripts/outland/netherstorm.cpp create mode 100644 src/bindings/scripts/scripts/outland/shadowmoon_valley.cpp create mode 100644 src/bindings/scripts/scripts/outland/shattrath_city.cpp create mode 100644 src/bindings/scripts/scripts/outland/terokkar_forest.cpp create mode 100644 src/bindings/scripts/scripts/outland/zangarmarsh.cpp delete mode 100644 src/bindings/scripts/scripts/zone/alterac_mountains/alterac_mountains.cpp delete mode 100644 src/bindings/scripts/scripts/zone/arathi_highlands/arathi_highlands.cpp delete mode 100644 src/bindings/scripts/scripts/zone/ashenvale_forest/ashenvale.cpp delete mode 100644 src/bindings/scripts/scripts/zone/azshara/azshara.cpp delete mode 100644 src/bindings/scripts/scripts/zone/azshara/boss_azuregos.cpp delete mode 100644 src/bindings/scripts/scripts/zone/azuremyst_isle/azuremyst_isle.cpp delete mode 100644 src/bindings/scripts/scripts/zone/barrens/the_barrens.cpp delete mode 100644 src/bindings/scripts/scripts/zone/blades_edge_mountains/blades_edge_mountains.cpp delete mode 100644 src/bindings/scripts/scripts/zone/blasted_lands/blasted_lands.cpp delete mode 100644 src/bindings/scripts/scripts/zone/blasted_lands/boss_kruul.cpp delete mode 100644 src/bindings/scripts/scripts/zone/bloodmyst_isle/bloodmyst_isle.cpp delete mode 100644 src/bindings/scripts/scripts/zone/borean_tundra/borean_tundra.cpp delete mode 100644 src/bindings/scripts/scripts/zone/burning_steppes/burning_steppes.cpp delete mode 100644 src/bindings/scripts/scripts/zone/darkshore/darkshore.cpp delete mode 100644 src/bindings/scripts/scripts/zone/desolace/desolace.cpp delete mode 100644 src/bindings/scripts/scripts/zone/dragonblight/dragonblight.cpp delete mode 100644 src/bindings/scripts/scripts/zone/dun_morogh/dun_morogh.cpp delete mode 100644 src/bindings/scripts/scripts/zone/dustwallow_marsh/dustwallow_marsh.cpp delete mode 100644 src/bindings/scripts/scripts/zone/eastern_plaguelands/eastern_plaguelands.cpp delete mode 100644 src/bindings/scripts/scripts/zone/elwynn_forest/elwynn_forest.cpp delete mode 100644 src/bindings/scripts/scripts/zone/eversong_woods/eversong_woods.cpp delete mode 100644 src/bindings/scripts/scripts/zone/felwood/felwood.cpp delete mode 100644 src/bindings/scripts/scripts/zone/feralas/feralas.cpp delete mode 100644 src/bindings/scripts/scripts/zone/ghostlands/ghostlands.cpp delete mode 100644 src/bindings/scripts/scripts/zone/grizzly_hills/grizzly_hills.cpp delete mode 100644 src/bindings/scripts/scripts/zone/hellfire_peninsula/boss_doomlord_kazzak.cpp delete mode 100644 src/bindings/scripts/scripts/zone/hellfire_peninsula/hellfire_peninsula.cpp delete mode 100644 src/bindings/scripts/scripts/zone/hinterlands/hinterlands.cpp delete mode 100644 src/bindings/scripts/scripts/zone/icecrown/icecrown.cpp delete mode 100644 src/bindings/scripts/scripts/zone/ironforge/ironforge.cpp delete mode 100644 src/bindings/scripts/scripts/zone/isle_of_queldanas/isle_of_queldanas.cpp delete mode 100644 src/bindings/scripts/scripts/zone/loch_modan/loch_modan.cpp delete mode 100644 src/bindings/scripts/scripts/zone/moonglade/moonglade.cpp delete mode 100644 src/bindings/scripts/scripts/zone/mulgore/mulgore.cpp delete mode 100644 src/bindings/scripts/scripts/zone/nagrand/nagrand.cpp delete mode 100644 src/bindings/scripts/scripts/zone/netherstorm/netherstorm.cpp delete mode 100644 src/bindings/scripts/scripts/zone/orgrimmar/orgrimmar.cpp delete mode 100644 src/bindings/scripts/scripts/zone/searing_gorge/searing_gorge.cpp delete mode 100644 src/bindings/scripts/scripts/zone/shadowmoon_valley/boss_doomwalker.cpp delete mode 100644 src/bindings/scripts/scripts/zone/shadowmoon_valley/shadowmoon_valley.cpp delete mode 100644 src/bindings/scripts/scripts/zone/shattrath/shattrath_city.cpp delete mode 100644 src/bindings/scripts/scripts/zone/sholazar_basin/sholazar_basin.cpp delete mode 100644 src/bindings/scripts/scripts/zone/silithus/silithus.cpp delete mode 100644 src/bindings/scripts/scripts/zone/silvermoon/silvermoon_city.cpp delete mode 100644 src/bindings/scripts/scripts/zone/silverpine_forest/silverpine_forest.cpp delete mode 100644 src/bindings/scripts/scripts/zone/stonetalon_mountains/stonetalon_mountains.cpp delete mode 100644 src/bindings/scripts/scripts/zone/stormwind/stormwind_city.cpp delete mode 100644 src/bindings/scripts/scripts/zone/stranglethorn_vale/stranglethorn_vale.cpp delete mode 100644 src/bindings/scripts/scripts/zone/tanaris/tanaris.cpp delete mode 100644 src/bindings/scripts/scripts/zone/teldrassil/teldrassil.cpp delete mode 100644 src/bindings/scripts/scripts/zone/terokkar_forest/terokkar_forest.cpp delete mode 100644 src/bindings/scripts/scripts/zone/thousand_needles/thousand_needles.cpp delete mode 100644 src/bindings/scripts/scripts/zone/thunder_bluff/thunder_bluff.cpp delete mode 100644 src/bindings/scripts/scripts/zone/tirisfal_glades/tirisfal_glades.cpp delete mode 100644 src/bindings/scripts/scripts/zone/undercity/undercity.cpp delete mode 100644 src/bindings/scripts/scripts/zone/western_plaguelands/western_plaguelands.cpp delete mode 100644 src/bindings/scripts/scripts/zone/westfall/westfall.cpp delete mode 100644 src/bindings/scripts/scripts/zone/winterspring/winterspring.cpp delete mode 100644 src/bindings/scripts/scripts/zone/zangarmarsh/zangarmarsh.cpp delete mode 100644 src/bindings/scripts/scripts/zone/zuldrak/zuldrak.cpp (limited to 'src') diff --git a/src/bindings/scripts/CMakeLists.txt b/src/bindings/scripts/CMakeLists.txt index 1099628a7d9..bdb9291e4fd 100644 --- a/src/bindings/scripts/CMakeLists.txt +++ b/src/bindings/scripts/CMakeLists.txt @@ -18,6 +18,28 @@ SET(trinityscript_LIB_SRCS scripts/creature/mob_generic_creature.cpp scripts/creature/simple_ai.cpp scripts/creature/simple_ai.h + scripts/eastern_kingdoms/alterac_mountains.cpp + scripts/eastern_kingdoms/arathi_highlands.cpp + scripts/eastern_kingdoms/blasted_lands.cpp + scripts/eastern_kingdoms/boss_kruul.cpp + scripts/eastern_kingdoms/burning_steppes.cpp + scripts/eastern_kingdoms/dun_morogh.cpp + scripts/eastern_kingdoms/eastern_plaguelands.cpp + scripts/eastern_kingdoms/elwynn_forest.cpp + scripts/eastern_kingdoms/eversong_woods.cpp + scripts/eastern_kingdoms/ghostlands.cpp + scripts/eastern_kingdoms/hinterlands.cpp + scripts/eastern_kingdoms/ironforge.cpp + scripts/eastern_kingdoms/loch_modan.cpp + scripts/eastern_kingdoms/searing_gorge.cpp + scripts/eastern_kingdoms/silvermoon_city.cpp + scripts/eastern_kingdoms/silverpine_forest.cpp + scripts/eastern_kingdoms/stormwind_city.cpp + scripts/eastern_kingdoms/stranglethorn_vale.cpp + scripts/eastern_kingdoms/tirisfal_glades.cpp + scripts/eastern_kingdoms/undercity.cpp + scripts/eastern_kingdoms/western_plaguelands.cpp + scripts/eastern_kingdoms/westfall.cpp scripts/examples/example_creature.cpp scripts/examples/example_escort.cpp scripts/examples/example_gossip_codebox.cpp @@ -27,15 +49,50 @@ SET(trinityscript_LIB_SRCS scripts/guard/guard_ai.h scripts/guard/guards.cpp scripts/item/item_scripts.cpp + scripts/kalimdor/ashenvale.cpp + scripts/kalimdor/azshara.cpp + scripts/kalimdor/azuremyst_isle.cpp + scripts/kalimdor/bloodmyst_isle.cpp + scripts/kalimdor/boss_azuregos.cpp + scripts/kalimdor/darkshore.cpp + scripts/kalimdor/desolace.cpp + scripts/kalimdor/dustwallow_marsh.cpp + scripts/kalimdor/felwood.cpp + scripts/kalimdor/feralas.cpp + scripts/kalimdor/moonglade.cpp + scripts/kalimdor/mulgore.cpp + scripts/kalimdor/orgrimmar.cpp + scripts/kalimdor/silithus.cpp + scripts/kalimdor/stonetalon_mountains.cpp + scripts/kalimdor/tanaris.cpp + scripts/kalimdor/teldrassil.cpp + scripts/kalimdor/the_barrens.cpp + scripts/kalimdor/thousand_needles.cpp + scripts/kalimdor/thunder_bluff.cpp + scripts/kalimdor/winterspring.cpp + 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/zuldrak.cpp scripts/npc/npc_escortAI.cpp scripts/npc/npc_escortAI.h scripts/npc/npc_innkeeper.cpp scripts/npc/npc_professions.cpp scripts/npc/npcs_special.cpp scripts/npc/npc_taxi.cpp - scripts/zone/arathi_highlands/arathi_highlands.cpp - scripts/zone/alterac_mountains/alterac_mountains.cpp - scripts/zone/ashenvale_forest/ashenvale.cpp + scripts/outland/blades_edge_mountains.cpp + scripts/outland/boss_doomlord_kazzak.cpp + scripts/outland/boss_doomwalker.cpp + scripts/outland/hellfire_peninsula.cpp + scripts/outland/isle_of_queldanas.cpp + scripts/outland/nagrand.cpp + scripts/outland/netherstorm.cpp + scripts/outland/shadowmoon_valley.cpp + 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 @@ -50,10 +107,6 @@ SET(trinityscript_LIB_SRCS 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/azshara/azshara.cpp - scripts/zone/azshara/boss_azuregos.cpp - scripts/zone/azuremyst_isle/azuremyst_isle.cpp - scripts/zone/barrens/the_barrens.cpp scripts/zone/black_temple/black_temple.cpp scripts/zone/black_temple/boss_bloodboil.cpp scripts/zone/black_temple/boss_illidan.cpp @@ -103,12 +156,6 @@ SET(trinityscript_LIB_SRCS scripts/zone/blackwing_lair/boss_vaelastrasz.cpp scripts/zone/blackwing_lair/boss_victor_nefarius.cpp scripts/zone/blackwing_lair/instance_blackwing_lair.cpp - scripts/zone/blades_edge_mountains/blades_edge_mountains.cpp - scripts/zone/blasted_lands/blasted_lands.cpp - scripts/zone/blasted_lands/boss_kruul.cpp - scripts/zone/bloodmyst_isle/bloodmyst_isle.cpp - scripts/zone/borean_tundra/borean_tundra.cpp - scripts/zone/burning_steppes/burning_steppes.cpp scripts/zone/caverns_of_time/dark_portal/def_dark_portal.h scripts/zone/caverns_of_time/dark_portal/instance_dark_portal.cpp scripts/zone/caverns_of_time/dark_portal/dark_portal.cpp @@ -148,21 +195,9 @@ SET(trinityscript_LIB_SRCS scripts/zone/coilfang_resevoir/steam_vault/instance_steam_vault.cpp scripts/zone/coilfang_resevoir/underbog/boss_hungarfen.cpp scripts/zone/coilfang_resevoir/underbog/boss_the_black_stalker.cpp - scripts/zone/darkshore/darkshore.cpp scripts/zone/deadmines/def_deadmines.h scripts/zone/deadmines/deadmines.cpp - scripts/zone/desolace/desolace.cpp - scripts/zone/dragonblight/dragonblight.cpp - scripts/zone/dun_morogh/dun_morogh.cpp - scripts/zone/dustwallow_marsh/dustwallow_marsh.cpp - scripts/zone/eastern_plaguelands/eastern_plaguelands.cpp scripts/zone/eastern_plaguelands/the_scarlet_enclave.cpp - scripts/zone/elwynn_forest/elwynn_forest.cpp - scripts/zone/eversong_woods/eversong_woods.cpp - scripts/zone/felwood/felwood.cpp - scripts/zone/feralas/feralas.cpp - scripts/zone/ghostlands/ghostlands.cpp - scripts/zone/grizzly_hills/grizzly_hills.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 @@ -185,12 +220,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/hellfire_peninsula/boss_doomlord_kazzak.cpp - scripts/zone/hellfire_peninsula/hellfire_peninsula.cpp - scripts/zone/hinterlands/hinterlands.cpp - scripts/zone/icecrown/icecrown.cpp - scripts/zone/ironforge/ironforge.cpp - scripts/zone/isle_of_queldanas/isle_of_queldanas.cpp scripts/zone/karazhan/boss_curator.cpp scripts/zone/karazhan/boss_maiden_of_virtue.cpp scripts/zone/karazhan/boss_midnight.cpp @@ -204,7 +233,6 @@ SET(trinityscript_LIB_SRCS scripts/zone/karazhan/def_karazhan.h scripts/zone/karazhan/instance_karazhan.cpp scripts/zone/karazhan/karazhan.cpp - scripts/zone/loch_modan/loch_modan.cpp scripts/zone/magisters_terrace/boss_felblood_kaelthas.cpp scripts/zone/magisters_terrace/boss_priestess_delrissa.cpp scripts/zone/magisters_terrace/boss_selin_fireheart.cpp @@ -229,9 +257,6 @@ SET(trinityscript_LIB_SRCS scripts/zone/molten_core/def_molten_core.h scripts/zone/molten_core/instance_molten_core.cpp scripts/zone/molten_core/molten_core.cpp - scripts/zone/moonglade/moonglade.cpp - scripts/zone/mulgore/mulgore.cpp - scripts/zone/nagrand/nagrand.cpp scripts/zone/naxxramas/boss_anubrekhan.cpp scripts/zone/naxxramas/boss_faerlina.cpp scripts/zone/naxxramas/boss_gluth.cpp @@ -249,9 +274,7 @@ SET(trinityscript_LIB_SRCS scripts/zone/naxxramas/boss_thaddius.cpp scripts/zone/naxxramas/def_naxxramas.h scripts/zone/naxxramas/instance_naxxramas.cpp - scripts/zone/netherstorm/netherstorm.cpp scripts/zone/onyxias_lair/boss_onyxia.cpp - scripts/zone/orgrimmar/orgrimmar.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 @@ -290,20 +313,9 @@ SET(trinityscript_LIB_SRCS scripts/zone/scholomance/boss_vectus.cpp scripts/zone/scholomance/def_scholomance.h scripts/zone/scholomance/instance_scholomance.cpp - scripts/zone/searing_gorge/searing_gorge.cpp scripts/zone/shadowfang_keep/def_shadowfang_keep.h scripts/zone/shadowfang_keep/instance_shadowfang_keep.cpp scripts/zone/shadowfang_keep/shadowfang_keep.cpp - scripts/zone/shadowmoon_valley/boss_doomwalker.cpp - scripts/zone/shadowmoon_valley/shadowmoon_valley.cpp - scripts/zone/shattrath/shattrath_city.cpp - scripts/zone/sholazar_basin/sholazar_basin.cpp - scripts/zone/silithus/silithus.cpp - scripts/zone/silvermoon/silvermoon_city.cpp - scripts/zone/silverpine_forest/silverpine_forest.cpp - scripts/zone/stonetalon_mountains/stonetalon_mountains.cpp - scripts/zone/stormwind/stormwind_city.cpp - scripts/zone/stranglethorn_vale/stranglethorn_vale.cpp scripts/zone/stratholme/boss_baron_rivendare.cpp scripts/zone/stratholme/boss_baroness_anastari.cpp scripts/zone/stratholme/boss_cannon_master_willey.cpp @@ -327,8 +339,6 @@ SET(trinityscript_LIB_SRCS scripts/zone/sunwell_plateau/sunwell_plateau.cpp scripts/zone/sunwell_plateau/def_sunwell_plateau.h scripts/zone/sunwell_plateau/instance_sunwell_plateau.cpp - scripts/zone/tanaris/tanaris.cpp - scripts/zone/teldrassil/teldrassil.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 @@ -361,23 +371,14 @@ SET(trinityscript_LIB_SRCS scripts/zone/temple_of_ahnqiraj/def_temple_of_ahnqiraj.h scripts/zone/temple_of_ahnqiraj/instance_temple_of_ahnqiraj.cpp scripts/zone/temple_of_ahnqiraj/mob_anubisath_sentinel.cpp - scripts/zone/terokkar_forest/terokkar_forest.cpp - scripts/zone/thunder_bluff/thunder_bluff.cpp - scripts/zone/tirisfal_glades/tirisfal_glades.cpp - scripts/zone/thousand_needles/thousand_needles.cpp scripts/zone/uldaman/boss_archaedas.cpp scripts/zone/uldaman/instance_uldaman.cpp scripts/zone/uldaman/boss_ironaya.cpp scripts/zone/uldaman/uldaman.cpp - scripts/zone/undercity/undercity.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/western_plaguelands/western_plaguelands.cpp - scripts/zone/westfall/westfall.cpp - scripts/zone/winterspring/winterspring.cpp - scripts/zone/zangarmarsh/zangarmarsh.cpp scripts/zone/zulaman/boss_akilzon.cpp scripts/zone/zulaman/boss_halazzi.cpp scripts/zone/zulaman/boss_hexlord.cpp @@ -387,7 +388,6 @@ SET(trinityscript_LIB_SRCS scripts/zone/zulaman/def_zulaman.h scripts/zone/zulaman/instance_zulaman.cpp scripts/zone/zulaman/zulaman.cpp - scripts/zone/zuldrak/zuldrak.cpp scripts/zone/zulfarrak/zulfarrak.cpp scripts/zone/zulgurub/boss_arlokk.cpp scripts/zone/zulgurub/boss_gahzranka.cpp diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/alterac_mountains.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/alterac_mountains.cpp new file mode 100644 index 00000000000..8b4c360a886 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/alterac_mountains.cpp @@ -0,0 +1,33 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Alterac_Mountains +SD%Complete: 0 +SDComment: Placeholder +SDCategory: Alterac Mountains +EndScriptData */ + +/* ContentData +EndContentData */ + +#include "precompiled.h" + +/*void AddSC_alterac_mountains() +{ + Script *newscript; +}*/ + diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/arathi_highlands.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/arathi_highlands.cpp new file mode 100644 index 00000000000..0a4b6839011 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/arathi_highlands.cpp @@ -0,0 +1,134 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Arathi Highlands +SD%Complete: 100 +SDComment: Quest support: 665 +SDCategory: Arathi Highlands +EndScriptData */ + +/* ContentData +npc_professor_phizzlethorpe +EndContentData */ + +#include "precompiled.h" +#include "../../npc/npc_escortAI.h" + +/*###### +## npc_professor_phizzlethorpe +######*/ + +enum +{ + SAY_PROGRESS_1 = -1000235, + SAY_PROGRESS_2 = -1000236, + SAY_PROGRESS_3 = -1000237, + EMOTE_PROGRESS_4 = -1000238, + SAY_AGGRO = -1000239, + SAY_PROGRESS_5 = -1000240, + SAY_PROGRESS_6 = -1000241, + SAY_PROGRESS_7 = -1000242, + EMOTE_PROGRESS_8 = -1000243, + SAY_PROGRESS_9 = -1000244, + + QUEST_SUNKEN_TREASURE = 665, + MOB_VENGEFUL_SURGE = 2776 +}; + +struct TRINITY_DLL_DECL npc_professor_phizzlethorpeAI : public npc_escortAI +{ + npc_professor_phizzlethorpeAI(Creature *c) : npc_escortAI(c) {} + + void WaypointReached(uint32 uiPointId) + { + Player* pPlayer = Unit::GetPlayer(PlayerGUID); + + switch(uiPointId) + { + case 4:DoScriptText(SAY_PROGRESS_2, m_creature, pPlayer);break; + case 5:DoScriptText(SAY_PROGRESS_3, m_creature, pPlayer);break; + case 8:DoScriptText(EMOTE_PROGRESS_4, m_creature);break; + case 9: + { + m_creature->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96, -2142.49, 20.15, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0); + m_creature->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96, -2142.49, 20.15, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0); + break; + } + case 10:DoScriptText(SAY_PROGRESS_5, m_creature, pPlayer);break; + case 11: + DoScriptText(SAY_PROGRESS_6, m_creature, pPlayer); + SetRun(); + break; + case 19:DoScriptText(SAY_PROGRESS_7, m_creature, pPlayer); break; + case 20: + DoScriptText(EMOTE_PROGRESS_8, m_creature); + DoScriptText(SAY_PROGRESS_9, m_creature, pPlayer); + if (pPlayer) + CAST_PLR(pPlayer)->GroupEventHappens(QUEST_SUNKEN_TREASURE, m_creature); + break; + } + } + + void JustSummoned(Creature* pSummoned) + { + pSummoned->AI()->AttackStart(m_creature); + } + + void EnterCombat(Unit* pWho) + { + DoScriptText(SAY_AGGRO, m_creature); + } + + void UpdateAI(const uint32 diff) + { + npc_escortAI::UpdateAI(diff); + } +}; + +bool QuestAccept_npc_professor_phizzlethorpe(Player* pPlayer, Creature* pCreature, Quest const* pQuest) +{ + if (pQuest->GetQuestId() == QUEST_SUNKEN_TREASURE) + { + DoScriptText(SAY_PROGRESS_1, pCreature, pPlayer); + if (npc_escortAI* pEscortAI = CAST_AI(npc_professor_phizzlethorpeAI, (pCreature->AI()))) + pEscortAI->Start(false, false, pPlayer->GetGUID(), pQuest); + + pCreature->setFaction(113); + } + return true; +} + +CreatureAI* GetAI_npc_professor_phizzlethorpeAI(Creature* pCreature) +{ + npc_professor_phizzlethorpeAI* professor_phizzlethorpeAI = new npc_professor_phizzlethorpeAI(pCreature); + + professor_phizzlethorpeAI->FillPointMovementListForCreature(); + + return professor_phizzlethorpeAI; +} + +void AddSC_arathi_highlands() +{ + Script * newscript; + + newscript = new Script; + newscript->Name = "npc_professor_phizzlethorpe"; + newscript->GetAI = &GetAI_npc_professor_phizzlethorpeAI; + newscript->pQuestAccept = &QuestAccept_npc_professor_phizzlethorpe; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/blasted_lands.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/blasted_lands.cpp new file mode 100644 index 00000000000..37c04639278 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/blasted_lands.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: Blasted_Lands +SD%Complete: 90 +SDComment: Quest support: 2784, 2801, 3628. Missing some texts for Fallen Hero. Teleporter to Rise of the Defiler missing group support. +SDCategory: Blasted Lands +EndScriptData */ + +/* ContentData +npc_deathly_usher +npc_fallen_hero_of_horde +EndContentData */ + +#include "precompiled.h" + +/*###### +## npc_deathly_usher +######*/ + +#define GOSSIP_ITEM_USHER "I wish to to visit the Rise of the Defiler." + +#define SPELL_TELEPORT_SINGLE 12885 +#define SPELL_TELEPORT_SINGLE_IN_GROUP 13142 +#define SPELL_TELEPORT_GROUP 27686 + +bool GossipHello_npc_deathly_usher(Player* pPlayer, Creature* pCreature) +{ + if (pPlayer->GetQuestStatus(3628) == QUEST_STATUS_INCOMPLETE && pPlayer->HasItemCount(10757, 1)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_USHER, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + + pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_deathly_usher(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF) + { + pPlayer->CLOSE_GOSSIP_MENU(); + pCreature->CastSpell(pPlayer, SPELL_TELEPORT_SINGLE, true); + } + + return true; +} + +/*###### +## npc_fallen_hero_of_horde +######*/ +#define GOSSIP_H_F1 "Why are you here?" +#define GOSSIP_H_F2 "Continue story..." + +#define GOSSIP_ITEM_FALLEN "Continue..." + +#define GOSSIP_ITEM_FALLEN1 "What could be worse than death?" +#define GOSSIP_ITEM_FALLEN2 "Subordinates?" +#define GOSSIP_ITEM_FALLEN3 "What are the stones of binding?" +#define GOSSIP_ITEM_FALLEN4 "You can count on me, Hero" +#define GOSSIP_ITEM_FALLEN5 "I shall" + +bool GossipHello_npc_fallen_hero_of_horde(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->GetQuestStatus(2784) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_H_F1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + if (pPlayer->GetQuestStatus(2801) == QUEST_STATUS_INCOMPLETE && pPlayer->GetTeam() == HORDE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_H_F2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + + if (pPlayer->GetQuestStatus(2801) == QUEST_STATUS_INCOMPLETE && pPlayer->GetTeam() == ALLIANCE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_H_F1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_fallen_hero_of_horde(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch (uiAction) + { + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_FALLEN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11); + pPlayer->SEND_GOSSIP_MENU(1392, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+11: + pPlayer->SEND_GOSSIP_MENU(1411, pCreature->GetGUID()); + if (pPlayer->GetQuestStatus(2784) == QUEST_STATUS_INCOMPLETE) + pPlayer->AreaExploredOrEventHappens(2784); + if (pPlayer->GetTeam() == ALLIANCE) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_FALLEN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + pPlayer->SEND_GOSSIP_MENU(1411, pCreature->GetGUID()); + } + break; + + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_FALLEN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 21); + pPlayer->SEND_GOSSIP_MENU(1451, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+21: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_FALLEN1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 22); + pPlayer->SEND_GOSSIP_MENU(1452, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+22: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_FALLEN2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 23); + pPlayer->SEND_GOSSIP_MENU(1453, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+23: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_FALLEN3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 24); + pPlayer->SEND_GOSSIP_MENU(1454, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+24: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_FALLEN4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 25); + pPlayer->SEND_GOSSIP_MENU(1455, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+25: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_FALLEN5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 26); + pPlayer->SEND_GOSSIP_MENU(1456, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+26: + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->AreaExploredOrEventHappens(2801); + break; + } + return true; +} + +void AddSC_blasted_lands() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="npc_deathly_usher"; + newscript->pGossipHello = &GossipHello_npc_deathly_usher; + newscript->pGossipSelect = &GossipSelect_npc_deathly_usher; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_fallen_hero_of_horde"; + newscript->pGossipHello = &GossipHello_npc_fallen_hero_of_horde; + newscript->pGossipSelect = &GossipSelect_npc_fallen_hero_of_horde; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/boss_kruul.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/boss_kruul.cpp new file mode 100644 index 00000000000..0452a5763dd --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/boss_kruul.cpp @@ -0,0 +1,183 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Kruul +SD%Complete: 100 +SDComment: Highlord Kruul are presumably no longer in-game on regular bases, however future events could bring him back. +SDCategory: Bosses +EndScriptData */ + +#include "precompiled.h" + +#define SPELL_SHADOWVOLLEY 21341 +#define SPELL_CLEAVE 20677 +#define SPELL_THUNDERCLAP 23931 +#define SPELL_TWISTEDREFLECTION 21063 +#define SPELL_VOIDBOLT 21066 +#define SPELL_RAGE 21340 +#define SPELL_CAPTURESOUL 21054 + +struct TRINITY_DLL_DECL boss_kruulAI : public ScriptedAI +{ + boss_kruulAI(Creature *c) : ScriptedAI(c) {} + + uint32 ShadowVolley_Timer; + uint32 Cleave_Timer; + uint32 ThunderClap_Timer; + uint32 TwistedReflection_Timer; + uint32 VoidBolt_Timer; + uint32 Rage_Timer; + uint32 Hound_Timer; + int Rand; + int RandX; + int RandY; + Creature* Summoned; + + void Reset() + { + ShadowVolley_Timer = 10000; + Cleave_Timer = 14000; + ThunderClap_Timer = 20000; + TwistedReflection_Timer = 25000; + VoidBolt_Timer = 30000; + Rage_Timer = 60000; //Cast rage after 1 minute + Hound_Timer = 8000; + } + + void EnterCombat(Unit *who) + { + } + + void KilledUnit() + { + // When a player, pet or totem gets killed, Lord Kazzak casts this spell to instantly regenerate 70,000 health. + DoCast(m_creature,SPELL_CAPTURESOUL); + + } + + void SummonHounds(Unit* victim) + { + Rand = rand()%10; + switch (rand()%2) + { + case 0: RandX = 0 - Rand; break; + case 1: RandX = 0 + Rand; break; + } + Rand = 0; + Rand = rand()%10; + switch (rand()%2) + { + case 0: RandY = 0 - Rand; break; + case 1: RandY = 0 + Rand; break; + } + Rand = 0; + Summoned = DoSpawnCreature(19207, RandX, RandY, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); + if (Summoned) + (Summoned->AI())->AttackStart(victim); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + //ShadowVolley_Timer + if (ShadowVolley_Timer < diff) + { + if (rand()%100 < 46) + { + DoCast(m_creature->getVictim(),SPELL_SHADOWVOLLEY); + } + + ShadowVolley_Timer = 5000; + }else ShadowVolley_Timer -= diff; + + //Cleave_Timer + if (Cleave_Timer < diff) + { + if (rand()%100 < 50) + { + DoCast(m_creature->getVictim(),SPELL_CLEAVE); + } + + Cleave_Timer = 10000; + }else Cleave_Timer -= diff; + + //ThunderClap_Timer + if (ThunderClap_Timer < diff) + { + if (rand()%100 < 20) + { + DoCast(m_creature->getVictim(),SPELL_THUNDERCLAP); + } + + ThunderClap_Timer = 12000; + }else ThunderClap_Timer -= diff; + + //TwistedReflection_Timer + if (TwistedReflection_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_TWISTEDREFLECTION); + TwistedReflection_Timer = 30000; + }else TwistedReflection_Timer -= diff; + + //VoidBolt_Timer + if (VoidBolt_Timer < diff) + { + if (rand()%100 < 40) + { + DoCast(m_creature->getVictim(),SPELL_VOIDBOLT); + } + + VoidBolt_Timer = 18000; + }else VoidBolt_Timer -= diff; + + //Rage_Timer + if (Rage_Timer < diff) + { + DoCast(m_creature,SPELL_RAGE); + Rage_Timer = 70000; + }else Rage_Timer -= diff; + + //Hound_Timer + if (Hound_Timer < diff) + { + SummonHounds(m_creature->getVictim()); + SummonHounds(m_creature->getVictim()); + SummonHounds(m_creature->getVictim()); + + Hound_Timer = 45000; + }else Hound_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_kruul(Creature* pCreature) +{ + return new boss_kruulAI (pCreature); +} + +void AddSC_boss_kruul() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_kruul"; + newscript->GetAI = &GetAI_boss_kruul; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/burning_steppes.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/burning_steppes.cpp new file mode 100644 index 00000000000..2d6aa006a90 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/burning_steppes.cpp @@ -0,0 +1,154 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Burning_Steppes +SD%Complete: 100 +SDComment: Quest support: 4224, 4866 +SDCategory: Burning Steppes +EndScriptData */ + +/* ContentData +npc_ragged_john +EndContentData */ + +#include "precompiled.h" + +/*###### +## npc_ragged_john +######*/ + +#define GOSSIP_HELLO "Official buisness, John. I need some information about Marsha Windsor. Tell me about the last time you saw him." +#define GOSSIP_SELECT1 "So what did you do?" +#define GOSSIP_SELECT2 "Start making sense, dwarf. I don't want to have anything to do with your cracker, your pappy, or any sort of 'discreditin'." +#define GOSSIP_SELECT3 "Ironfoe?" +#define GOSSIP_SELECT4 "Interesting... continue John." +#define GOSSIP_SELECT5 "So that's how Windsor died..." +#define GOSSIP_SELECT6 "So how did he die?" +#define GOSSIP_SELECT7 "Ok so where the hell is he? Wait a minute! Are you drunk?" +#define GOSSIP_SELECT8 "WHY is he in Blackrock Depths?" +#define GOSSIP_SELECT9 "300? So the Dark Irons killed him and dragged him into the Depths?" +#define GOSSIP_SELECT10 "Ahh... Ironfoe" +#define GOSSIP_SELECT11 "Thanks, Ragged John. Your story was very uplifting and informative" + +struct TRINITY_DLL_DECL npc_ragged_johnAI : public ScriptedAI +{ + npc_ragged_johnAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + + void MoveInLineOfSight(Unit *who) + { + if (who->HasAura(16468)) + { + if (who->GetTypeId() == TYPEID_PLAYER && m_creature->IsWithinDistInMap(who, 15) && who->isInAccessiblePlaceFor(m_creature)) + { + DoCast(who,16472); + CAST_PLR(who)->AreaExploredOrEventHappens(4866); + } + } + + ScriptedAI::MoveInLineOfSight(who); + } + + void EnterCombat(Unit *who) {} +}; + +CreatureAI* GetAI_npc_ragged_john(Creature* pCreature) +{ + return new npc_ragged_johnAI (pCreature); +} + +bool GossipHello_npc_ragged_john(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->GetQuestStatus(4224) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + + pPlayer->SEND_GOSSIP_MENU(2713, pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_ragged_john(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch (uiAction) + { + case GOSSIP_ACTION_INFO_DEF: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + pPlayer->SEND_GOSSIP_MENU(2714, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + pPlayer->SEND_GOSSIP_MENU(2715, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + pPlayer->SEND_GOSSIP_MENU(2716, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+3: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4); + pPlayer->SEND_GOSSIP_MENU(2717, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+4: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5); + pPlayer->SEND_GOSSIP_MENU(2718, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+5: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6); + pPlayer->SEND_GOSSIP_MENU(2719, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+6: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT7, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7); + pPlayer->SEND_GOSSIP_MENU(2720, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+7: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT8, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8); + pPlayer->SEND_GOSSIP_MENU(2721, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+8: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT9, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9); + pPlayer->SEND_GOSSIP_MENU(2722, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+9: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT10, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10); + pPlayer->SEND_GOSSIP_MENU(2723, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+10: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT11, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11); + pPlayer->SEND_GOSSIP_MENU(2725, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+11: + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->AreaExploredOrEventHappens(4224); + break; + } + return true; +} + +void AddSC_burning_steppes() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="npc_ragged_john"; + newscript->GetAI = &GetAI_npc_ragged_john; + newscript->pGossipHello = &GossipHello_npc_ragged_john; + newscript->pGossipSelect = &GossipSelect_npc_ragged_john; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/dun_morogh.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/dun_morogh.cpp new file mode 100644 index 00000000000..7e61df13575 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/dun_morogh.cpp @@ -0,0 +1,102 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 .sourceforge.net/> + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Dun_Morogh +SD%Complete: 50 +SDComment: Quest support: 1783 +SDCategory: Dun Morogh +EndScriptData */ + +/* ContentData +npc_narm_faulk +EndContentData */ + +#include "precompiled.h" + +/*###### +## npc_narm_faulk +######*/ + +#define SAY_HEAL -1000280 + +struct TRINITY_DLL_DECL npc_narm_faulkAI : public ScriptedAI +{ + uint32 lifeTimer; + bool spellHit; + + npc_narm_faulkAI(Creature *c) : ScriptedAI(c) {} + + void Reset() + { + lifeTimer = 120000; + m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 32); + m_creature->SetStandState(UNIT_STAND_STATE_DEAD); + spellHit = false; + } + + void EnterCombat(Unit *who) + { + } + + void MoveInLineOfSight(Unit *who) + { + return; + } + + void UpdateAI(const uint32 diff) + { + if (m_creature->IsStandState()) + { + if (lifeTimer < diff) + { + EnterEvadeMode(); + return; + } + else + lifeTimer -= diff; + } + } + + void SpellHit(Unit *Hitter, const SpellEntry *Spellkind) + { + if (Spellkind->Id == 8593 && !spellHit) + { + DoCast(m_creature,32343); + m_creature->SetStandState(UNIT_STAND_STATE_STAND); + m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 0); + //m_creature->RemoveAllAuras(); + DoScriptText(SAY_HEAL, m_creature); + spellHit = true; + } + } + +}; +CreatureAI* GetAI_npc_narm_faulk(Creature* pCreature) +{ + return new npc_narm_faulkAI (pCreature); +} + +void AddSC_dun_morogh() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="npc_narm_faulk"; + newscript->GetAI = &GetAI_npc_narm_faulk; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/eastern_plaguelands.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/eastern_plaguelands.cpp new file mode 100644 index 00000000000..9999f80dc85 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/eastern_plaguelands.cpp @@ -0,0 +1,180 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Eastern_Plaguelands +SD%Complete: 100 +SDComment: Quest support: 5211, 5742. Special vendor Augustus the Touched +SDCategory: Eastern Plaguelands +EndScriptData */ + +/* ContentData +mobs_ghoul_flayer +npc_augustus_the_touched +npc_darrowshire_spirit +npc_tirion_fordring +EndContentData */ + +#include "precompiled.h" + +//id8530 - cannibal ghoul +//id8531 - gibbering ghoul +//id8532 - diseased flayer + +struct TRINITY_DLL_DECL mobs_ghoul_flayerAI : public ScriptedAI +{ + mobs_ghoul_flayerAI(Creature *c) : ScriptedAI(c) {} + + void Reset() { } + + void EnterCombat(Unit* who) { } + + void JustDied(Unit* Killer) + { + if (Killer->GetTypeId() == TYPEID_PLAYER) + m_creature->SummonCreature(11064, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 60000); + } +}; + +CreatureAI* GetAI_mobs_ghoul_flayer(Creature* pCreature) +{ + return new mobs_ghoul_flayerAI (pCreature); +} + +/*###### +## npc_augustus_the_touched +######*/ + +bool GossipHello_npc_augustus_the_touched(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pCreature->isVendor() && pPlayer->GetQuestRewardStatus(6164)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); + + pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_augustus_the_touched(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_TRADE) + pPlayer->SEND_VENDORLIST(pCreature->GetGUID()); + return true; +} + +/*###### +## npc_darrowshire_spirit +######*/ + +#define SPELL_SPIRIT_SPAWNIN 17321 + +struct TRINITY_DLL_DECL npc_darrowshire_spiritAI : public ScriptedAI +{ + npc_darrowshire_spiritAI(Creature *c) : ScriptedAI(c) {} + + void Reset() + { + DoCast(m_creature,SPELL_SPIRIT_SPAWNIN); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + } + + void EnterCombat(Unit *who) { } + +}; +CreatureAI* GetAI_npc_darrowshire_spirit(Creature* pCreature) +{ + return new npc_darrowshire_spiritAI (pCreature); +} + +bool GossipHello_npc_darrowshire_spirit(Player* pPlayer, Creature* pCreature) +{ + pPlayer->SEND_GOSSIP_MENU(3873, pCreature->GetGUID()); + pPlayer->TalkedToCreature(pCreature->GetEntry(), pCreature->GetGUID()); + pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + return true; +} + +/*###### +## npc_tirion_fordring +######*/ + +bool GossipHello_npc_tirion_fordring(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->GetQuestStatus(5742) == QUEST_STATUS_INCOMPLETE && pPlayer->getStandState() == UNIT_STAND_STATE_SIT) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "I am ready to hear your tale, Tirion.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_tirion_fordring(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch (uiAction) + { + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Thank you, Tirion. What of your identity?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + pPlayer->SEND_GOSSIP_MENU(4493, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "That is terrible.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + pPlayer->SEND_GOSSIP_MENU(4494, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+3: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "I will, Tirion.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4); + pPlayer->SEND_GOSSIP_MENU(4495, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+4: + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->AreaExploredOrEventHappens(5742); + break; + } + return true; +} + +void AddSC_eastern_plaguelands() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="mobs_ghoul_flayer"; + newscript->GetAI = &GetAI_mobs_ghoul_flayer; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_augustus_the_touched"; + newscript->pGossipHello = &GossipHello_npc_augustus_the_touched; + newscript->pGossipSelect = &GossipSelect_npc_augustus_the_touched; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_darrowshire_spirit"; + newscript->GetAI = &GetAI_npc_darrowshire_spirit; + newscript->pGossipHello = &GossipHello_npc_darrowshire_spirit; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_tirion_fordring"; + newscript->pGossipHello = &GossipHello_npc_tirion_fordring; + newscript->pGossipSelect = &GossipSelect_npc_tirion_fordring; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/elwynn_forest.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/elwynn_forest.cpp new file mode 100644 index 00000000000..67456755cd2 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/elwynn_forest.cpp @@ -0,0 +1,102 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 .sourceforge.net/> + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Elwynn_Forest +SD%Complete: 50 +SDComment: Quest support: 1786 +SDCategory: Elwynn Forest +EndScriptData */ + +/* ContentData +npc_henze_faulk +EndContentData */ + +#include "precompiled.h" + +/*###### +## npc_henze_faulk +######*/ + +#define SAY_HEAL -1000280 + +struct TRINITY_DLL_DECL npc_henze_faulkAI : public ScriptedAI +{ + uint32 lifeTimer; + bool spellHit; + + npc_henze_faulkAI(Creature *c) : ScriptedAI(c) {} + + void Reset() + { + lifeTimer = 120000; + m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 32); + m_creature->SetStandState(UNIT_STAND_STATE_DEAD); // lay down + spellHit = false; + } + + void EnterCombat(Unit *who) + { + } + + void MoveInLineOfSight(Unit *who) + { + return; + } + + void UpdateAI(const uint32 diff) + { + if (m_creature->IsStandState()) + { + if (lifeTimer < diff) + { + EnterEvadeMode(); + return; + } + else + lifeTimer -= diff; + } + } + + void SpellHit(Unit *Hitter, const SpellEntry *Spellkind) + { + if (Spellkind->Id == 8593 && !spellHit) + { + DoCast(m_creature,32343); + m_creature->SetStandState(UNIT_STAND_STATE_STAND); + m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 0); + //m_creature->RemoveAllAuras(); + DoScriptText(SAY_HEAL, m_creature); + spellHit = true; + } + } + +}; +CreatureAI* GetAI_npc_henze_faulk(Creature* pCreature) +{ + return new npc_henze_faulkAI (pCreature); +} + +void AddSC_elwynn_forest() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="npc_henze_faulk"; + newscript->GetAI = &GetAI_npc_henze_faulk; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/eversong_woods.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/eversong_woods.cpp new file mode 100644 index 00000000000..9a0952eb4fb --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/eversong_woods.cpp @@ -0,0 +1,742 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 .sourceforge.net/> + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Eversong_Woods +SD%Complete: 100 +SDComment: Quest support: 8483, 8488, 8490, 9686 +SDCategory: Eversong Woods +EndScriptData */ + +/* ContentData +npc_prospector_anvilward +npc_apprentice_mirveda +npc_infused_crystal +npc_kelerun_bloodmourn +go_harbinger_second_trial +EndContentData */ + +#include "precompiled.h" +#include "../../npc/npc_escortAI.h" + +/*###### +## npc_prospector_anvilward +######*/ + +#define GOSSIP_HELLO "I need a moment of your time, sir." +#define GOSSIP_SELECT "Why... yes, of course. I've something to show you right inside this building, Mr. Anvilward." + +#define SAY_PR_1 -1000281 +#define SAY_PR_2 -1000282 + +#define QUEST_THE_DWARVEN_SPY 8483 + +struct TRINITY_DLL_DECL npc_prospector_anvilwardAI : public npc_escortAI +{ + // CreatureAI functions + npc_prospector_anvilwardAI(Creature *c) : npc_escortAI(c) {} + + // Pure Virtual Functions + void WaypointReached(uint32 i) + { + Player* pPlayer = Unit::GetPlayer(PlayerGUID); + + if (!pPlayer) + return; + + switch (i) + { + case 0: DoScriptText(SAY_PR_1, m_creature, pPlayer); break; + case 5: DoScriptText(SAY_PR_2, m_creature, pPlayer); break; + case 6: m_creature->setFaction(24); break; + } + } + + void EnterCombat(Unit* who) { } + + void Reset() + { + m_creature->setFaction(35); + } + + void JustDied(Unit* killer) + { + m_creature->setFaction(35); + } + + void UpdateAI(const uint32 diff) + { + npc_escortAI::UpdateAI(diff); + } +}; + +CreatureAI* GetAI_npc_prospector_anvilward(Creature* pCreature) +{ + npc_prospector_anvilwardAI* thisAI = new npc_prospector_anvilwardAI(pCreature); + + thisAI->FillPointMovementListForCreature(); + + return thisAI; +} + +bool GossipHello_npc_prospector_anvilward(Player* pPlayer, Creature* pCreature) +{ + if (pPlayer->GetQuestStatus(QUEST_THE_DWARVEN_SPY) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + pPlayer->SEND_GOSSIP_MENU(8239, pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_prospector_anvilward(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch(uiAction) + { + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + pPlayer->SEND_GOSSIP_MENU(8240, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->CLOSE_GOSSIP_MENU(); + if (npc_escortAI* pEscortAI = CAST_AI(npc_prospector_anvilwardAI, pCreature->AI())) + pEscortAI->Start(true, false, pPlayer->GetGUID()); + break; + } + return true; +} + +/*###### +## Quest 9686 Second Trial +######*/ + +#define QUEST_SECOND_TRIAL 9686 + +#define MASTER_KELERUN_BLOODMOURN 17807 + +#define CHAMPION_BLOODWRATH 17809 +#define CHAMPION_LIGHTREND 17810 +#define CHAMPION_SWIFTBLADE 17811 +#define CHAMPION_SUNSTRIKER 17812 + +#define HARBINGER_OF_THE_SECOND_TRIAL 182052 + +#define SPELL_FLASH_OF_LIGHT 19939 +#define TIMER_FLASH_OF_LIGHT 3225 + +#define SPELL_SEAL_OF_JUSTICE 20164 +#define TIMER_SEAL_OF_JUSTICE 10000 + +#define SPELL_JUDGEMENT_OF_LIGHT 20271 +#define TIMER_JUDGEMENT_OF_LIGHT 10000 + +#define SPELL_SEAL_OF_COMMAND 20375 +#define TIMER_SEAL_OF_COMMAND 20000 + +#define OFFSET_NEXT_ATTACK 750 + +#define FACTION_HOSTILE 45 +#define FACTION_FRIENDLY 7 + +#define TEXT_SECOND_TRIAL_1 -1645006 +#define TEXT_SECOND_TRIAL_2 -1645007 +#define TEXT_SECOND_TRIAL_3 -1645008 +#define TEXT_SECOND_TRIAL_4 -1645009 + +struct Locations +{ + float x, y, z, o; +}; + +static Locations SpawnPosition[]= +{ + {5.3, -11.8, 0.361, 4.2}, + {11.2, -29.17, 0.361, 2.7}, + {-5.7, -34.85, 0.361, 1.09}, + {-11.9, -18, 0.361, 5.87} +}; + +static uint32 PaladinEntry[]= {CHAMPION_BLOODWRATH, CHAMPION_LIGHTREND, CHAMPION_SWIFTBLADE, CHAMPION_SUNSTRIKER}; + +/*###### +## npc_second_trial_paladin +######*/ + +struct TRINITY_DLL_DECL npc_secondTrialAI : public ScriptedAI +{ + npc_secondTrialAI(Creature *c) : ScriptedAI(c) {} + + uint32 timer; + uint8 questPhase; + uint64 summonerGuid; + + bool spellFlashLight; + bool spellJustice; + bool spellJudLight; + bool spellCommand; + + uint32 timerFlashLight; + uint32 timerJustice; + uint32 timerJudLight; + uint32 timerCommand; + + + void Reset() { + + timer = 2000; + questPhase = 0; + summonerGuid = 0; + + m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_KNEEL); + m_creature->setFaction(FACTION_FRIENDLY); + + spellFlashLight = false; + spellJustice = false; + spellJudLight = false; + spellCommand = false; + + switch(m_creature->GetEntry()) { + case CHAMPION_BLOODWRATH : + spellFlashLight = true; + timerFlashLight = TIMER_FLASH_OF_LIGHT; + break; + case CHAMPION_LIGHTREND : + spellJustice = true; + timerJustice = 500; + break; + case CHAMPION_SWIFTBLADE : + spellJudLight = false; // Misses Script Effect // http://www.wowhead.com/?spell=20271 + timerJudLight = 500; + break; + case CHAMPION_SUNSTRIKER : + spellFlashLight = true; + spellJudLight = false; // Misses Script Effect // http://www.wowhead.com/?spell=20271 + spellCommand = false; // Misses Dummy // http://www.wowhead.com/?spell=20375 + timerFlashLight = TIMER_FLASH_OF_LIGHT; + timerJudLight = 500; + timerCommand = 1500; + break; + } + } + + void EnterCombat(Unit *who) { } + + void UpdateAI(const uint32 diff) + { + if (questPhase == 1) { + + if (timer < diff) { + m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_STAND); + m_creature->setFaction(FACTION_HOSTILE); + questPhase = 0; + + Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (target && target->GetTypeId() == TYPEID_PLAYER) // only on players. + { + m_creature->AddThreat(target, 5000000.0f); + AttackStart(target); + } + } + else timer -= diff; + } + + if (!UpdateVictim()) + return; + + // healer + if (spellFlashLight) { + if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 70){ + if (timerFlashLight < diff) { + DoCast(m_creature, SPELL_FLASH_OF_LIGHT); + timerFlashLight = TIMER_FLASH_OF_LIGHT + rand()%(TIMER_FLASH_OF_LIGHT); + } + else + timerFlashLight -= diff; + } + } + + if (spellJustice) { + if (timerJustice < diff) + { + DoCast(m_creature, SPELL_SEAL_OF_JUSTICE); + timerJustice = TIMER_SEAL_OF_JUSTICE + rand()%(TIMER_SEAL_OF_JUSTICE); + } + else + timerJustice -= diff; + } + + if (spellJudLight) { + if (timerJudLight < diff) { + DoCast(m_creature, SPELL_JUDGEMENT_OF_LIGHT); + timerJudLight = TIMER_JUDGEMENT_OF_LIGHT + rand()%(TIMER_JUDGEMENT_OF_LIGHT); + } + else + timerJudLight -= diff; + } + + if (spellCommand) { + if (timerCommand < diff) { + DoCast(m_creature, TIMER_SEAL_OF_COMMAND); + timerCommand = TIMER_SEAL_OF_COMMAND + rand()%(TIMER_SEAL_OF_COMMAND); + } + else + timerCommand -= diff; + } + + DoMeleeAttackIfReady(); + } + + void Activate(uint64 summonerguid); + void KilledUnit(Unit* Killed); + void JustDied(Unit* Killer); + +}; + +/*###### +## npc_second_trial_controller +######*/ + +struct TRINITY_DLL_DECL master_kelerun_bloodmournAI : public ScriptedAI +{ + master_kelerun_bloodmournAI(Creature *c) : ScriptedAI(c) {} + + uint8 questPhase; + uint8 paladinPhase; + uint32 timer; + + uint64 paladinGuid[4]; + + void Reset() { + + questPhase = 0; + timer = 60000; + paladinPhase = 0; + uint64 paladinGuid[] = {0,0,0,0}; + + } + + void EnterCombat(Unit *who) {} + + void UpdateAI(const uint32 diff) + { + // Quest accepted but object not activated, object despawned (if in sync 1 minute!) + if (questPhase == 1) { + if (timer < diff) Reset(); + else timer -= diff; + } + // fight the 4 paladin mobs phase + else if (questPhase == 2) { + + if (timer < diff) { + + Creature* paladinSpawn; + paladinSpawn = (Unit::GetCreature((*m_creature), paladinGuid[paladinPhase])); + if (paladinSpawn) { + CAST_AI(npc_secondTrialAI, paladinSpawn->AI())->Activate(m_creature->GetGUID()); + + switch(paladinPhase) { + case 0: + DoScriptText(TEXT_SECOND_TRIAL_1,m_creature); + break; + case 1: + DoScriptText(TEXT_SECOND_TRIAL_2,m_creature); + break; + case 2: + DoScriptText(TEXT_SECOND_TRIAL_3,m_creature); + break; + case 3: + DoScriptText(TEXT_SECOND_TRIAL_4,m_creature); + break; + } + } + else + Reset(); + + questPhase=4; + timer = OFFSET_NEXT_ATTACK; + } + else timer -= diff; + } + + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + + void StartEvent() + { + + if (questPhase == 1) { // no player check, quest can be finished as group, so no complex PlayerGUID/group search code + + for (int i = 0; i<4; ++i) { + Creature* Summoned; + Summoned = DoSpawnCreature(PaladinEntry[i], SpawnPosition[i].x, SpawnPosition[i].y, SpawnPosition[i].z, SpawnPosition[i].o, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 180000); + + if (Summoned) + paladinGuid[i] = Summoned->GetGUID(); + } + + timer = OFFSET_NEXT_ATTACK; + questPhase = 2; + } + } + + void SecondTrialKill(); + void SummonedCreatureDespawn(Creature* c) {} +}; + + +bool GossipHello_master_kelerun_bloodmourn(Player* pPlayer, Creature* pCreature) +{ + // quest only available if not already started + // Quest_template flag is set to : QUEST_FLAGS_EVENT + // Escort quests or any other event-driven quests. If player in party, all players that can accept this quest will receive confirmation box to accept quest. + // !not sure if this really works! + + if (CAST_AI(master_kelerun_bloodmournAI, pCreature->AI())->questPhase == 0) { + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + pPlayer->SendPreparedQuest(pCreature->GetGUID()); + } + + pPlayer->SEND_GOSSIP_MENU(pCreature->GetEntry(), pCreature->GetGUID()); + return true; +} + +bool QuestAccept_master_kelerun_bloodmourn(Player* pPlayer, Creature* pCreature, Quest const *quest) +{ + // One Player exclusive quest, wait for user go activation + if (quest->GetQuestId() == QUEST_SECOND_TRIAL) + CAST_AI(master_kelerun_bloodmournAI, pCreature->AI())->questPhase = 1; + + return true; +} + +void master_kelerun_bloodmournAI::SecondTrialKill() { + + if (questPhase > 0) { + + ++paladinPhase; + + if (paladinPhase < 4) + questPhase=2; + else + Reset(); // Quest Complete, QuestComplete handler is in npc_secondTrialAI::JustDied + } + } + +void npc_secondTrialAI::JustDied(Unit* Killer) { + + if (Killer->GetTypeId() == TYPEID_PLAYER) + { + Creature* Summoner; + Summoner = (Unit::GetCreature((*m_creature), summonerGuid)); + + if (Summoner) + CAST_AI(master_kelerun_bloodmournAI, Summoner->AI())->SecondTrialKill(); + + // last kill quest complete for group + if (m_creature->GetEntry() == CHAMPION_SUNSTRIKER) { + + if (Group *pGroup = CAST_PLR(Killer)->GetGroup()) + { + for(GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next()) + { + Player *pGroupGuy = itr->getSource(); + + // for any leave or dead (with not released body) group member at appropriate distance + if (pGroupGuy && pGroupGuy->IsAtGroupRewardDistance(m_creature) && !pGroupGuy->GetCorpse() && pGroupGuy->GetQuestStatus(QUEST_SECOND_TRIAL) == QUEST_STATUS_INCOMPLETE) + pGroupGuy->CompleteQuest(QUEST_SECOND_TRIAL); + } + } + else { + if (CAST_PLR(Killer)->GetQuestStatus(QUEST_SECOND_TRIAL) == QUEST_STATUS_INCOMPLETE) + CAST_PLR(Killer)->CompleteQuest(QUEST_SECOND_TRIAL); + } + } + } + } + +void npc_secondTrialAI::KilledUnit(Unit* Killed) { + + if (Killed->GetTypeId() == TYPEID_PLAYER) { + + if (CAST_PLR(Killed)->GetQuestStatus(QUEST_SECOND_TRIAL) == QUEST_STATUS_INCOMPLETE) + CAST_PLR(Killed)->FailQuest(QUEST_SECOND_TRIAL); + } +} + +void npc_secondTrialAI::Activate(uint64 summonerguid) { + + questPhase=1; + summonerGuid = summonerguid; + } + +CreatureAI* GetAI_master_kelerun_bloodmourn(Creature* pCreature) +{ + return new master_kelerun_bloodmournAI (pCreature); +} + +CreatureAI* GetAI_npc_secondTrial(Creature* pCreature) +{ + return new npc_secondTrialAI (pCreature); +} + +/*###### +## go_second_trial +######*/ + +bool GOHello_go_second_trial(Player* pPlayer, GameObject* pGO) +{ + // find spawn :: master_kelerun_bloodmourn + if (Creature* pCreature = pGO->FindNearestCreature(MASTER_KELERUN_BLOODMOURN, 30.0f)) + CAST_AI(master_kelerun_bloodmournAI, pCreature->AI())->StartEvent(); + + return true; +} + +/*###### +## npc_apprentice_mirveda +######*/ + +#define QUEST_UNEXPECTED_RESULT 8488 +#define MOB_GHARZUL 15958 +#define MOB_ANGERSHADE 15656 + +struct TRINITY_DLL_DECL npc_apprentice_mirvedaAI : public ScriptedAI +{ + npc_apprentice_mirvedaAI(Creature* c) : ScriptedAI(c), Summons(m_creature) {} + + uint32 KillCount; + uint64 PlayerGUID; + bool Summon; + SummonList Summons; + + void Reset() + { + KillCount = 0; + PlayerGUID = 0; + Summons.DespawnAll(); + Summon = false; + } + + void EnterCombat(Unit* who){} + + void JustSummoned(Creature *summoned) + { + summoned->AI()->AttackStart(m_creature); + Summons.Summon(summoned); + } + + void SummonedCreatureDespawn(Creature* summoned) + { + Summons.Despawn(summoned); + ++KillCount; + } + + void JustDied(Unit* killer) + { + if (PlayerGUID) + { + Player* pPlayer = Unit::GetPlayer(PlayerGUID); + if (pPlayer) + CAST_PLR(pPlayer)->FailQuest(QUEST_UNEXPECTED_RESULT); + } + } + + void UpdateAI(const uint32 diff) + { + if (KillCount >= 3) + { + if (PlayerGUID) + { + Player* pPlayer = Unit::GetPlayer(PlayerGUID); + if (pPlayer) + CAST_PLR(pPlayer)->CompleteQuest(QUEST_UNEXPECTED_RESULT); + } + } + + if (Summon) + { + m_creature->SummonCreature(MOB_GHARZUL, 8745, -7134.32, 35.22, 0, TEMPSUMMON_CORPSE_DESPAWN, 4000); + m_creature->SummonCreature(MOB_ANGERSHADE, 8745, -7134.32, 35.22, 0, TEMPSUMMON_CORPSE_DESPAWN, 4000); + m_creature->SummonCreature(MOB_ANGERSHADE, 8745, -7134.32, 35.22, 0, TEMPSUMMON_CORPSE_DESPAWN, 4000); + Summon = false; + } + } +}; + +bool QuestAccept_npc_apprentice_mirveda(Player* pPlayer, Creature* pCreature, Quest const* quest) +{ + if (quest->GetQuestId() == QUEST_UNEXPECTED_RESULT) + { + CAST_AI(npc_apprentice_mirvedaAI, pCreature->AI())->Summon = true; + CAST_AI(npc_apprentice_mirvedaAI, pCreature->AI())->PlayerGUID = pPlayer->GetGUID(); + } + return true; +} + +CreatureAI* GetAI_npc_apprentice_mirvedaAI(Creature* pCreature) +{ + return new npc_apprentice_mirvedaAI (pCreature); +} + +/*###### +## npc_infused_crystal +######*/ + +#define MOB_ENRAGED_WRAITH 17086 +#define EMOTE -1000283 +#define QUEST_POWERING_OUR_DEFENSES 8490 + +struct Location +{ + float x, y, z; +}; + +static Location SpawnLocations[]= +{ + {8270.68, -7188.53, 139.619}, + {8284.27, -7187.78, 139.603}, + {8297.43, -7193.53, 139.603}, + {8303.5, -7201.96, 139.577}, + {8273.22, -7241.82, 139.382}, + {8254.89, -7222.12, 139.603}, + {8278.51, -7242.13, 139.162}, + {8267.97, -7239.17, 139.517} +}; + +struct TRINITY_DLL_DECL npc_infused_crystalAI : public Scripted_NoMovementAI +{ + npc_infused_crystalAI(Creature* c) : Scripted_NoMovementAI(c) {} + + uint32 EndTimer; + uint32 WaveTimer; + bool Completed; + bool Progress; + uint64 PlayerGUID; + + void Reset() + { + EndTimer = 0; + Completed = false; + Progress = false; + PlayerGUID = 0; + WaveTimer = 0; + } + + void MoveInLineOfSight(Unit* who) + { + if (!Progress && who->GetTypeId() == TYPEID_PLAYER && m_creature->IsWithinDistInMap(who, 10.0f)) + { + if (CAST_PLR(who)->GetQuestStatus(QUEST_POWERING_OUR_DEFENSES) == QUEST_STATUS_INCOMPLETE) + { + PlayerGUID = who->GetGUID(); + WaveTimer = 1000; + EndTimer = 60000; + Progress = true; + } + } + } + + void JustSummoned(Creature *summoned) + { + summoned->AI()->AttackStart(m_creature); + } + + void JustDied(Unit* killer) + { + if (PlayerGUID && !Completed) + { + Player* pPlayer = Unit::GetPlayer(PlayerGUID); + if (pPlayer) + CAST_PLR(pPlayer)->FailQuest(QUEST_POWERING_OUR_DEFENSES); + } + } + + void UpdateAI(const uint32 diff) + { + if (EndTimer < diff && Progress) + { + DoScriptText(EMOTE, m_creature); + Completed = true; + if (PlayerGUID) + { + Player* pPlayer = Unit::GetPlayer(PlayerGUID); + if (pPlayer) + CAST_PLR(pPlayer)->CompleteQuest(QUEST_POWERING_OUR_DEFENSES); + } + m_creature->DealDamage(m_creature,m_creature->GetHealth(),NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + m_creature->RemoveCorpse(); + }else EndTimer -= diff; + + if (WaveTimer < diff && !Completed && Progress) + { + uint32 ran1 = rand()%8; + uint32 ran2 = rand()%8; + uint32 ran3 = rand()%8; + m_creature->SummonCreature(MOB_ENRAGED_WRAITH, SpawnLocations[ran1].x, SpawnLocations[ran1].y, SpawnLocations[ran1].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000); + m_creature->SummonCreature(MOB_ENRAGED_WRAITH, SpawnLocations[ran2].x, SpawnLocations[ran2].y, SpawnLocations[ran2].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000); + m_creature->SummonCreature(MOB_ENRAGED_WRAITH, SpawnLocations[ran3].x, SpawnLocations[ran3].y, SpawnLocations[ran3].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000); + WaveTimer = 30000; + }else WaveTimer -= diff; + } +}; + +CreatureAI* GetAI_npc_infused_crystalAI(Creature* pCreature) +{ + return new npc_infused_crystalAI (pCreature); +} + +void AddSC_eversong_woods() +{ + Script *newscript; + + newscript = new Script; + newscript->Name= "npc_prospector_anvilward"; + newscript->GetAI = &GetAI_npc_prospector_anvilward; + newscript->pGossipHello = &GossipHello_npc_prospector_anvilward; + newscript->pGossipSelect = &GossipSelect_npc_prospector_anvilward; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_second_trial_controller"; + newscript->GetAI = &GetAI_master_kelerun_bloodmourn; + newscript->pGossipHello = &GossipHello_master_kelerun_bloodmourn; + newscript->pQuestAccept = &QuestAccept_master_kelerun_bloodmourn; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_second_trial_paladin"; + newscript->GetAI = &GetAI_npc_secondTrial; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="go_second_trial"; + newscript->pGOHello = &GOHello_go_second_trial; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_apprentice_mirveda"; + newscript->GetAI = &GetAI_npc_apprentice_mirvedaAI; + newscript->pQuestAccept = &QuestAccept_npc_apprentice_mirveda; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_infused_crystal"; + newscript->GetAI = &GetAI_npc_infused_crystalAI; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/ghostlands.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/ghostlands.cpp new file mode 100644 index 00000000000..be04a56c23a --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/ghostlands.cpp @@ -0,0 +1,277 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Ghostlands +SD%Complete: 100 +SDComment: Quest support: 9692, 9212. Obtain Budd's Guise of Zul'aman. Vendor Rathis Tomber +SDCategory: Ghostlands +EndScriptData */ + +/* ContentData +npc_blood_knight_dawnstar +npc_budd_nedreck +npc_rathis_tomber +npc_ranger_lilatha +EndContentData */ + +#include "precompiled.h" +#include "../../npc/npc_escortAI.h" + +/*###### +## npc_blood_knight_dawnstar +######*/ + +#define GOSSIP_H_BKD "Take Blood Knight Insignia" + +bool GossipHello_npc_blood_knight_dawnstar(Player* pPlayer, Creature* pCreature) +{ + if (pPlayer->GetQuestStatus(9692) == QUEST_STATUS_INCOMPLETE && !pPlayer->HasItemCount(24226,1,true)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_H_BKD, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_blood_knight_dawnstar(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, 24226, 1, false); + if (msg == EQUIP_ERR_OK) + { + pPlayer->StoreNewItem(dest, 24226, 1, true); + pPlayer->PlayerTalkClass->ClearMenus(); + } + } + return true; +} + +/*###### +## npc_budd_nedreck +######*/ + +#define GOSSIP_HBN "You gave the crew disguises?" + +bool GossipHello_npc_budd_nedreck(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->GetQuestStatus(11166) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HBN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + + pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_budd_nedreck(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF) + { + pPlayer->CLOSE_GOSSIP_MENU(); + pCreature->CastSpell(pPlayer, 42540, false); + } + return true; +} + +/*###### +## npc_rathis_tomber +######*/ + +bool GossipHello_npc_rathis_tomber(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pCreature->isVendor() && pPlayer->GetQuestRewardStatus(9152)) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); + pPlayer->SEND_GOSSIP_MENU(8432, pCreature->GetGUID()); + }else + pPlayer->SEND_GOSSIP_MENU(8431, pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_rathis_tomber(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_TRADE) + pPlayer->SEND_VENDORLIST(pCreature->GetGUID()); + return true; +} + +/*##### +## go_gilded_brazier (Paladin First Trail quest (9678)) +#####*/ + +bool GOHello_gilded_brazier(Player* pPlayer, GameObject* pGo) +{ + if (pPlayer->GetQuestStatus(9678) == QUEST_STATUS_INCOMPLETE) + { + Creature *Stillblade = pPlayer->SummonCreature(17716, 8106.11, -7542.06, 151.775, 3.02598, TEMPSUMMON_DEAD_DESPAWN, 60000); + if (Stillblade) + (Stillblade->AI())->AttackStart(pPlayer); + } + return true; +}; + +/*###### +## npc_ranger_lilatha +######*/ + +enum +{ + SAY_START = -1000140, + SAY_PROGRESS1 = -1000141, + SAY_PROGRESS2 = -1000142, + SAY_PROGRESS3 = -1000143, + SAY_END1 = -1000144, + SAY_END2 = -1000145, + SAY_CAPTAIN_ANSWER = -1000146, + + QUEST_ESCAPE_FROM_THE_CATACOMBS = 9212, + GO_CAGE = 181152, + NPC_CAPTAIN_HELIOS = 16220, + FACTION_SMOON_E = 1603, +}; + +struct TRINITY_DLL_DECL npc_ranger_lilathaAI : public npc_escortAI +{ + npc_ranger_lilathaAI(Creature *c) : npc_escortAI(c) {} + + std::list CageList; + + void WaypointReached(uint32 i) + { + Player* pPlayer = Unit::GetPlayer(PlayerGUID); + + if (!pPlayer) + return; + + switch(i) + { + case 0: + { + m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); + if (GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 20)) + Cage->SetGoState(GO_STATE_ACTIVE); + DoScriptText(SAY_START, m_creature, pPlayer); + break; + } + case 5: + DoScriptText(SAY_PROGRESS1, m_creature, pPlayer); + case 11: + DoScriptText(SAY_PROGRESS2, m_creature, pPlayer); + m_creature->SetOrientation(4.762841); + break; + case 18: + { + DoScriptText(SAY_PROGRESS3, m_creature, pPlayer); + Creature* Summ1 = m_creature->SummonCreature(16342, 7627.083984, -7532.538086, 152.128616, 1.082733, TEMPSUMMON_DEAD_DESPAWN, 0); + Creature* Summ2 = m_creature->SummonCreature(16343, 7620.432129, -7532.550293, 152.454865, 0.827478, TEMPSUMMON_DEAD_DESPAWN, 0); + if (Summ1 && Summ2) + { + Summ1->Attack(m_creature, true); + Summ2->Attack(pPlayer, true); + } + m_creature->AI()->AttackStart(Summ1); + break; + } + case 19: m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); break; + case 25: m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); break; + case 30: + if (pPlayer && pPlayer->GetTypeId() == TYPEID_PLAYER) + CAST_PLR(pPlayer)->GroupEventHappens(QUEST_ESCAPE_FROM_THE_CATACOMBS,m_creature); + break; + case 32: + m_creature->SetOrientation(2.978281); + DoScriptText(SAY_END1, m_creature, pPlayer); + break; + case 33: + m_creature->SetOrientation(5.858011); + DoScriptText(SAY_END2, m_creature, pPlayer); + Unit* CaptainHelios = me->FindNearestCreature(NPC_CAPTAIN_HELIOS, 50); + if (CaptainHelios) + DoScriptText(SAY_CAPTAIN_ANSWER, CaptainHelios, pPlayer); + break; + } + } + + void Reset() + { + if (GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 20)) + Cage->SetGoState(GO_STATE_READY); + } +}; + +bool QuestAccept_npc_ranger_lilatha(Player* pPlayer, Creature* pCreature, Quest const* quest) +{ + if (quest->GetQuestId() == QUEST_ESCAPE_FROM_THE_CATACOMBS) + { + pCreature->setFaction(113); + + if (npc_escortAI* pEscortAI = CAST_AI(npc_ranger_lilathaAI, pCreature->AI())) + pEscortAI->Start(true, false, pPlayer->GetGUID()); + } + return true; +} + +CreatureAI* GetAI_npc_ranger_lilathaAI(Creature* pCreature) +{ + npc_ranger_lilathaAI* ranger_lilathaAI = new npc_ranger_lilathaAI(pCreature); + + ranger_lilathaAI->FillPointMovementListForCreature(); + + return ranger_lilathaAI; +} + +void AddSC_ghostlands() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="npc_blood_knight_dawnstar"; + newscript->pGossipHello = &GossipHello_npc_blood_knight_dawnstar; + newscript->pGossipSelect = &GossipSelect_npc_blood_knight_dawnstar; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_budd_nedreck"; + newscript->pGossipHello = &GossipHello_npc_budd_nedreck; + newscript->pGossipSelect = &GossipSelect_npc_budd_nedreck; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_rathis_tomber"; + newscript->pGossipHello = &GossipHello_npc_rathis_tomber; + newscript->pGossipSelect = &GossipSelect_npc_rathis_tomber; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "go_gilded_brazier"; + newscript->pGOHello = &GOHello_gilded_brazier; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_ranger_lilatha"; + newscript->GetAI = &GetAI_npc_ranger_lilathaAI; + newscript->pQuestAccept = &QuestAccept_npc_ranger_lilatha; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/hinterlands.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/hinterlands.cpp new file mode 100644 index 00000000000..f5014844809 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/hinterlands.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: Hinterlands +SD%Complete: 100 +SDComment: Quest support: 2742 +SDCategory: The Hinterlands +EndScriptData */ + +/* ContentData +npc_rinji +EndContentData */ + +#include "precompiled.h" +#include "../../npc/npc_escortAI.h" + +/*###### +## npc_rinji +######*/ + +enum +{ + SAY_RIN_FREE = -1000403, + SAY_RIN_BY_OUTRUNNER = -1000404, + SAY_RIN_HELP_1 = -1000405, + SAY_RIN_HELP_2 = -1000406, + SAY_RIN_COMPLETE = -1000407, + SAY_RIN_PROGRESS_1 = -1000408, + SAY_RIN_PROGRESS_2 = -1000409, + + QUEST_RINJI_TRAPPED = 2742, + NPC_RANGER = 2694, + NPC_OUTRUNNER = 2691, + GO_RINJI_CAGE = 142036 +}; + +struct Location +{ + float m_fX, m_fY, m_fZ; +}; + +Location m_afAmbushSpawn[] = +{ + {191.296204, -2839.329346, 107.388}, + {70.972466, -2848.674805, 109.459} +}; + +Location m_afAmbushMoveTo[] = +{ + {166.630386, -2824.780273, 108.153}, + {70.886589, -2874.335449, 116.675} +}; + +struct TRINITY_DLL_DECL npc_rinjiAI : public npc_escortAI +{ + npc_rinjiAI(Creature* pCreature) : npc_escortAI(pCreature) + { + m_bIsByOutrunner = false; + m_iSpawnId = 0; + } + + bool m_bIsByOutrunner; + uint32 m_uiPostEventCount; + uint32 m_uiPostEventTimer; + int m_iSpawnId; + + void Reset() + { + m_uiPostEventCount = 0; + m_uiPostEventTimer = 3000; + } + + void JustRespawned() + { + m_bIsByOutrunner = false; + m_iSpawnId = 0; + + npc_escortAI::JustRespawned(); + } + + void EnterCombat(Unit* pWho) + { + if (IsBeingEscorted) + { + if (pWho->GetEntry() == NPC_OUTRUNNER && !m_bIsByOutrunner) + { + DoScriptText(SAY_RIN_BY_OUTRUNNER, pWho); + m_bIsByOutrunner = true; + } + + if (rand()%4) + return; + + //only if attacked and escorter is not in combat? + switch(rand()%2) + { + case 0: DoScriptText(SAY_RIN_HELP_1, m_creature); break; + case 1: DoScriptText(SAY_RIN_HELP_2, m_creature); break; + } + } + } + + void DoSpawnAmbush(bool bFirst) + { + if (!bFirst) + m_iSpawnId = 1; + + m_creature->SummonCreature(NPC_RANGER, + m_afAmbushSpawn[m_iSpawnId].m_fX, m_afAmbushSpawn[m_iSpawnId].m_fY, m_afAmbushSpawn[m_iSpawnId].m_fZ, 0.0f, + TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000); + + for(int i = 0; i < 2; ++i) + { + m_creature->SummonCreature(NPC_OUTRUNNER, + m_afAmbushSpawn[m_iSpawnId].m_fX, m_afAmbushSpawn[m_iSpawnId].m_fY, m_afAmbushSpawn[m_iSpawnId].m_fZ, 0.0f, + TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000); + } + } + + void JustSummoned(Creature* pSummoned) + { + pSummoned->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + pSummoned->GetMotionMaster()->MovePoint(0, m_afAmbushMoveTo[m_iSpawnId].m_fX, m_afAmbushMoveTo[m_iSpawnId].m_fY, m_afAmbushMoveTo[m_iSpawnId].m_fZ); + } + + void WaypointReached(uint32 uiPointId) + { + Player* pPlayer = (Player*)Unit::GetUnit(*m_creature, PlayerGUID); + + if (!pPlayer) + return; + + switch(uiPointId) + { + case 1: + DoScriptText(SAY_RIN_FREE, m_creature, pPlayer); + break; + case 7: + DoSpawnAmbush(true); + break; + case 13: + DoSpawnAmbush(false); + break; + case 17: + DoScriptText(SAY_RIN_COMPLETE, m_creature, pPlayer); + pPlayer->GroupEventHappens(QUEST_RINJI_TRAPPED, m_creature); + SetRun(); + m_uiPostEventCount = 1; + break; + } + } + + void UpdateAI(const uint32 uiDiff) + { + npc_escortAI::UpdateAI(uiDiff); + + if (IsBeingEscorted && m_uiPostEventCount && !m_creature->getVictim()) + { + if (m_uiPostEventTimer < uiDiff) + { + 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 + { + m_creature->ForcedDespawn(); + return; + } + } + else + m_uiPostEventTimer -= uiDiff; + } + } +}; + +bool QuestAccept_npc_rinji(Player* pPlayer, Creature* pCreature, const Quest* pQuest) +{ + if (pQuest->GetQuestId() == QUEST_RINJI_TRAPPED) + { + if (GameObject* pGo = pCreature->FindNearestGameObject(GO_RINJI_CAGE, INTERACTION_DISTANCE)) + pGo->UseDoorOrButton(); + + if (npc_rinjiAI* pEscortAI = CAST_AI(npc_rinjiAI, pCreature->AI())) + pEscortAI->Start(false, false, pPlayer->GetGUID(), pQuest); + } + return true; +} + +CreatureAI* GetAI_npc_rinji(Creature* pCreature) +{ + npc_rinjiAI* pTempAI = new npc_rinjiAI(pCreature); + + pTempAI->FillPointMovementListForCreature(); + + return (CreatureAI*)pTempAI; +} + +void AddSC_hinterlands() +{ + Script* newscript; + + newscript = new Script; + newscript->Name = "npc_rinji"; + newscript->GetAI = &GetAI_npc_rinji; + newscript->pQuestAccept = &QuestAccept_npc_rinji; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/ironforge.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/ironforge.cpp new file mode 100644 index 00000000000..3903562f23c --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/ironforge.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: Ironforge +SD%Complete: 100 +SDComment: Quest support: 3702 +SDCategory: Ironforge +EndScriptData */ + +/* ContentData +npc_royal_historian_archesonus +EndContentData */ + +#include "precompiled.h" + +/*###### +## npc_royal_historian_archesonus +######*/ + +#define GOSSIP_ITEM_ROYAL "I am ready to listen" +#define GOSSIP_ITEM_ROYAL_1 "That is tragic. How did this happen?" +#define GOSSIP_ITEM_ROYAL_2 "Interesting, continue please." +#define GOSSIP_ITEM_ROYAL_3 "Unbelievable! How dare they??" +#define GOSSIP_ITEM_ROYAL_4 "Of course I will help!" + +bool GossipHello_npc_royal_historian_archesonus(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->GetQuestStatus(3702) == QUEST_STATUS_INCOMPLETE) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ROYAL, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + pPlayer->SEND_GOSSIP_MENU(2235, pCreature->GetGUID()); + } + else + pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_royal_historian_archesonus(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch (uiAction) + { + case GOSSIP_ACTION_INFO_DEF: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ROYAL_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + pPlayer->SEND_GOSSIP_MENU(2236, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ROYAL_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + pPlayer->SEND_GOSSIP_MENU(2237, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ROYAL_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + pPlayer->SEND_GOSSIP_MENU(2238, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+3: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ROYAL_4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4); + pPlayer->SEND_GOSSIP_MENU(2239, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+4: + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->AreaExploredOrEventHappens(3702); + break; + } + return true; +} + +void AddSC_ironforge() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="npc_royal_historian_archesonus"; + newscript->pGossipHello = &GossipHello_npc_royal_historian_archesonus; + newscript->pGossipSelect = &GossipSelect_npc_royal_historian_archesonus; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/loch_modan.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/loch_modan.cpp new file mode 100644 index 00000000000..21a65af5319 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/loch_modan.cpp @@ -0,0 +1,101 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Loch_Modan +SD%Complete: 100 +SDComment: Quest support: 3181 +SDCategory: Loch Modan +EndScriptData */ + +/* ContentData +npc_mountaineer_pebblebitty +EndContentData */ + +#include "precompiled.h" + +/*###### +## npc_mountaineer_pebblebitty +######*/ + +#define GOSSIP_MP "Open the gate please, i need to get to Searing Gorge" + +#define GOSSIP_MP1 "But i need to get there, now open the gate!" +#define GOSSIP_MP2 "Ok, so what is this other way?" +#define GOSSIP_MP3 "Doesn't matter, i'm invulnerable." +#define GOSSIP_MP4 "Yes..." +#define GOSSIP_MP5 "Ok, i'll try to remember that." +#define GOSSIP_MP6 "A key? Ok!" + +bool GossipHello_npc_mountaineer_pebblebitty(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (!pPlayer->GetQuestRewardStatus(3181) == 1) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_MP, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_mountaineer_pebblebitty(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch (uiAction) + { + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_MP1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + pPlayer->SEND_GOSSIP_MENU(1833, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_MP2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + pPlayer->SEND_GOSSIP_MENU(1834, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+3: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_MP3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4); + pPlayer->SEND_GOSSIP_MENU(1835, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+4: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_MP4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5); + pPlayer->SEND_GOSSIP_MENU(1836, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+5: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_MP5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6); + pPlayer->SEND_GOSSIP_MENU(1837, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+6: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_MP6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7); + pPlayer->SEND_GOSSIP_MENU(1838, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+7: + pPlayer->CLOSE_GOSSIP_MENU(); + break; + } + return true; +} + +void AddSC_loch_modan() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="npc_mountaineer_pebblebitty"; + newscript->pGossipHello = &GossipHello_npc_mountaineer_pebblebitty; + newscript->pGossipSelect = &GossipSelect_npc_mountaineer_pebblebitty; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/searing_gorge.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/searing_gorge.cpp new file mode 100644 index 00000000000..a3f8c40acc7 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/searing_gorge.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: Searing_Gorge +SD%Complete: 80 +SDComment: Quest support: 3377, 3441 (More accurate info on Kalaran needed). Lothos Riftwaker teleport to Molten Core. +SDCategory: Searing Gorge +EndScriptData */ + +/* ContentData +npc_kalaran_windblade +npc_lothos_riftwaker +npc_zamael_lunthistle +EndContentData */ + +#include "precompiled.h" + +/*###### +## npc_kalaran_windblade +######*/ + +bool GossipHello_npc_kalaran_windblade(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->GetQuestStatus(3441) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Tell me what drives this vengance?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + + pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_kalaran_windblade(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch (uiAction) + { + case GOSSIP_ACTION_INFO_DEF: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Continue please", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + pPlayer->SEND_GOSSIP_MENU(1954, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Let me confer with my colleagues", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + pPlayer->SEND_GOSSIP_MENU(1955, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->AreaExploredOrEventHappens(3441); + break; + } + return true; +} + +/*###### +## npc_lothos_riftwaker +######*/ + +bool GossipHello_npc_lothos_riftwaker(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->GetQuestRewardStatus(7487) || pPlayer->GetQuestRewardStatus(7848)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Teleport me to the Molten Core", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + + pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_lothos_riftwaker(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) + { + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->TeleportTo(409, 1096, -467, -104.6, 3.64); + } + + return true; +} + +/*###### +## npc_zamael_lunthistle +######*/ + +bool GossipHello_npc_zamael_lunthistle(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->GetQuestStatus(3377) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Tell me your story", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + + pPlayer->SEND_GOSSIP_MENU(1920, pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_zamael_lunthistle(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch (uiAction) + { + case GOSSIP_ACTION_INFO_DEF: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Please continue...", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + pPlayer->SEND_GOSSIP_MENU(1921, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Goodbye", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + pPlayer->SEND_GOSSIP_MENU(1922, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->AreaExploredOrEventHappens(3377); + break; + } + return true; +} + +/*###### +## +######*/ + +void AddSC_searing_gorge() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="npc_kalaran_windblade"; + newscript->pGossipHello = &GossipHello_npc_kalaran_windblade; + newscript->pGossipSelect = &GossipSelect_npc_kalaran_windblade; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_lothos_riftwaker"; + newscript->pGossipHello = &GossipHello_npc_lothos_riftwaker; + newscript->pGossipSelect = &GossipSelect_npc_lothos_riftwaker; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_zamael_lunthistle"; + newscript->pGossipHello = &GossipHello_npc_zamael_lunthistle; + newscript->pGossipSelect = &GossipSelect_npc_zamael_lunthistle; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/silvermoon_city.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/silvermoon_city.cpp new file mode 100644 index 00000000000..ee5533f53f4 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/silvermoon_city.cpp @@ -0,0 +1,104 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 .sourceforge.net/> + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Silvermoon_City +SD%Complete: 100 +SDComment: Quest support: 9685 +SDCategory: Silvermoon City +EndScriptData */ + +/* ContentData +npc_blood_knight_stillblade +EndContentData */ + +#include "precompiled.h" + +/*####### +# npc_blood_knight_stillblade +#######*/ + +#define SAY_HEAL -1000334 + +#define QUEST_REDEEMING_THE_DEAD 9685 +#define SPELL_SHIMMERING_VESSEL 31225 +#define SPELL_REVIVE_SELF 32343 + +struct TRINITY_DLL_DECL npc_blood_knight_stillbladeAI : public ScriptedAI +{ + npc_blood_knight_stillbladeAI(Creature *c) : ScriptedAI(c) {} + + uint32 lifeTimer; + bool spellHit; + + void Reset() + { + lifeTimer = 120000; + m_creature->SetStandState(UNIT_STAND_STATE_DEAD); + m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,7); // lay down + spellHit = false; + } + + void EnterCombat(Unit *who) + { + } + + void MoveInLineOfSight(Unit *who) + { + return; + } + + void UpdateAI(const uint32 diff) + { + if (m_creature->IsStandState()) + { + if (lifeTimer < diff) + m_creature->AI()->EnterEvadeMode(); + else + lifeTimer -= diff; + } + } + + void SpellHit(Unit *Hitter, const SpellEntry *Spellkind) + { + if ((Spellkind->Id == SPELL_SHIMMERING_VESSEL) && !spellHit && + (Hitter->GetTypeId() == TYPEID_PLAYER) && (CAST_PLR(Hitter)->IsActiveQuest(QUEST_REDEEMING_THE_DEAD))) + { + CAST_PLR(Hitter)->AreaExploredOrEventHappens(QUEST_REDEEMING_THE_DEAD); + DoCast(m_creature,SPELL_REVIVE_SELF); + m_creature->SetStandState(UNIT_STAND_STATE_STAND); + m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 0); + //m_creature->RemoveAllAuras(); + DoScriptText(SAY_HEAL, m_creature); + spellHit = true; + } + } +}; + +CreatureAI* GetAI_npc_blood_knight_stillblade(Creature* pCreature) +{ + return new npc_blood_knight_stillbladeAI (pCreature); +} + +void AddSC_silvermoon_city() +{ + Script *newscript; + newscript = new Script; + newscript->Name="npc_blood_knight_stillblade"; + newscript->GetAI = &GetAI_npc_blood_knight_stillblade; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/silverpine_forest.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/silverpine_forest.cpp new file mode 100644 index 00000000000..7daf8a8a50e --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/silverpine_forest.cpp @@ -0,0 +1,233 @@ + /* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Silverpine_Forest +SD%Complete: 100 +SDComment: Quest support: 1886, 435 +SDCategory: Silverpine Forest +EndScriptData */ + +/* ContentData +npc_astor_hadren +npc_deathstalker_erland +EndContentData */ + +#include "precompiled.h" +#include "../../npc/npc_escortAI.h" + +/*###### +## npc_astor_hadren +######*/ + +#define GOSSIP_HAH "You're Astor Hadren, right?" +#define GOSSIP_SAH "You've got something I need, Astor. And I'll be taking it now." +struct TRINITY_DLL_DECL npc_astor_hadrenAI : public ScriptedAI +{ + npc_astor_hadrenAI(Creature *c) : ScriptedAI(c) {} + + void Reset() + { + m_creature->setFaction(68); + } + + void EnterCombat(Unit* who) + { + } + + void JustDied(Unit *who) + { + m_creature->setFaction(68); + } +}; + +CreatureAI* GetAI_npc_astor_hadren(Creature* pCreature) +{ + return new npc_astor_hadrenAI(pCreature); +} + +bool GossipHello_npc_astor_hadren(Player* pPlayer, Creature* pCreature) +{ + if (pPlayer->GetQuestStatus(1886) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HAH, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + + pPlayer->SEND_GOSSIP_MENU(623, pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_astor_hadren(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch (uiAction) + { + case GOSSIP_ACTION_INFO_DEF + 1: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SAH, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + pPlayer->SEND_GOSSIP_MENU(624, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF + 2: + pPlayer->CLOSE_GOSSIP_MENU(); + pCreature->setFaction(21); + if (pPlayer) + CAST_AI(npc_astor_hadrenAI, pCreature->AI())->AttackStart(pPlayer); + break; + } + return true; +} + +/*###### +## npc_deathstalker_erland +######*/ + +enum +{ + SAY_QUESTACCEPT = -1000335, + SAY_START = -1000336, + SAY_AGGRO_1 = -1000337, + SAY_AGGRO_2 = -1000338, + SAY_LAST = -1000339, + + SAY_THANKS = -1000340, + SAY_RANE = -1000341, + SAY_ANSWER = -1000342, + SAY_MOVE_QUINN = -1000343, + + SAY_GREETINGS = -1000344, + SAY_QUINN = -1000345, + SAY_ON_BYE = -1000346, + + QUEST_ESCORTING = 435, + NPC_RANE = 1950, + NPC_QUINN = 1951 +}; + +struct TRINITY_DLL_DECL npc_deathstalker_erlandAI : public npc_escortAI +{ + npc_deathstalker_erlandAI(Creature *c) : npc_escortAI(c) {} + + void WaypointReached(uint32 i) + { + Player* pPlayer = Unit::GetPlayer(PlayerGUID); + + if (!pPlayer) + return; + + switch(i) + { + case 1: DoScriptText(SAY_START, m_creature, pPlayer);break; + case 13: + DoScriptText(SAY_LAST, m_creature, pPlayer); + pPlayer->GroupEventHappens(QUEST_ESCORTING, m_creature);break; + case 14: DoScriptText(SAY_THANKS, m_creature, pPlayer);break; + case 15: { + Unit* Rane = me->FindNearestCreature(NPC_RANE, 20); + if (Rane) + DoScriptText(SAY_RANE, Rane); + break;} + case 16: DoScriptText(SAY_ANSWER, m_creature);break; + case 17: DoScriptText(SAY_MOVE_QUINN, m_creature); break; + case 24: DoScriptText(SAY_GREETINGS, m_creature);break; + case 25: { + Unit* Quinn = me->FindNearestCreature(NPC_QUINN, 20); + if (Quinn) + DoScriptText(SAY_QUINN, Quinn); + break;} + case 26: DoScriptText(SAY_ON_BYE, m_creature, NULL);break; + + } + } + + void Reset() {} + + void EnterCombat(Unit* who) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_AGGRO_1, m_creature, who);break; + case 1: DoScriptText(SAY_AGGRO_2, m_creature, who);break; + } + } +}; + +bool QuestAccept_npc_deathstalker_erland(Player* pPlayer, Creature* pCreature, Quest const* quest) +{ + if (quest->GetQuestId() == QUEST_ESCORTING) + { + DoScriptText(SAY_QUESTACCEPT, pCreature, pPlayer); + + if (npc_escortAI* pEscortAI = CAST_AI(npc_deathstalker_erlandAI, pCreature->AI())) + pEscortAI->Start(true, false, pPlayer->GetGUID()); + } + + return true; +} + +CreatureAI* GetAI_npc_deathstalker_erlandAI(Creature* pCreature) +{ + npc_deathstalker_erlandAI* deathstalker_erlandAI = new npc_deathstalker_erlandAI(pCreature); + + deathstalker_erlandAI->AddWaypoint(0, 1406.32, 1083.10, 52.55); + deathstalker_erlandAI->AddWaypoint(1, 1400.49, 1080.42, 52.50); //first say + deathstalker_erlandAI->AddWaypoint(2, 1388.48, 1083.10, 52.52); + deathstalker_erlandAI->AddWaypoint(3, 1370.16, 1084.02, 52.30); + deathstalker_erlandAI->AddWaypoint(4, 1359.02, 1080.85, 52.46); + deathstalker_erlandAI->AddWaypoint(5, 1341.43, 1087.39, 52.69); + deathstalker_erlandAI->AddWaypoint(6, 1321.93, 1090.51, 50.66); + deathstalker_erlandAI->AddWaypoint(7, 1312.98, 1095.91, 47.49); + deathstalker_erlandAI->AddWaypoint(8, 1301.09, 1102.94, 47.76); + deathstalker_erlandAI->AddWaypoint(9, 1297.73, 1106.35, 50.18); + deathstalker_erlandAI->AddWaypoint(10, 1295.49, 1124.32, 50.49); + deathstalker_erlandAI->AddWaypoint(11, 1294.84, 1137.25, 51.75); + deathstalker_erlandAI->AddWaypoint(12, 1292.89, 1158.99, 52.65); + deathstalker_erlandAI->AddWaypoint(13, 1290.75, 1168.67, 52.56, 1000); //complete quest and say last + deathstalker_erlandAI->AddWaypoint(14, 1287.12, 1203.49, 52.66, 5000); + deathstalker_erlandAI->AddWaypoint(15, 1287.12, 1203.49, 52.66, 4000); + deathstalker_erlandAI->AddWaypoint(16, 1287.12, 1203.49, 52.66, 5000); + deathstalker_erlandAI->AddWaypoint(17, 1287.12, 1203.49, 52.66, 4000); + deathstalker_erlandAI->AddWaypoint(18, 1290.72, 1207.44, 52.69); + deathstalker_erlandAI->AddWaypoint(19, 1297.50, 1207.18, 53.74); + deathstalker_erlandAI->AddWaypoint(20, 1301.32, 1220.90, 53.74); + deathstalker_erlandAI->AddWaypoint(21, 1298.55, 1220.43, 53.74); + deathstalker_erlandAI->AddWaypoint(22, 1297.59, 1211.23, 58.47); + deathstalker_erlandAI->AddWaypoint(23, 1305.01, 1206.10, 58.51); + deathstalker_erlandAI->AddWaypoint(24, 1310.51, 1207.36, 58.51, 5000); + deathstalker_erlandAI->AddWaypoint(25, 1310.51, 1207.36, 58.51, 5000); + deathstalker_erlandAI->AddWaypoint(26, 1310.51, 1207.36, 58.51, 2000); + + return deathstalker_erlandAI; +} + +/*###### +## AddSC +######*/ + +void AddSC_silverpine_forest() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="npc_astor_hadren"; + newscript->pGossipHello = &GossipHello_npc_astor_hadren; + newscript->pGossipSelect = &GossipSelect_npc_astor_hadren; + newscript->GetAI = &GetAI_npc_astor_hadren; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_deathstalker_erland"; + newscript->GetAI = &GetAI_npc_deathstalker_erlandAI; + newscript->pQuestAccept = &QuestAccept_npc_deathstalker_erland; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/stormwind_city.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/stormwind_city.cpp new file mode 100644 index 00000000000..d8cfaebc181 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/stormwind_city.cpp @@ -0,0 +1,267 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Stormwind_City +SD%Complete: 100 +SDComment: Quest support: 1640, 1447, 4185, 11223 +SDCategory: Stormwind City +EndScriptData */ + +/* ContentData +npc_archmage_malin +npc_bartleby +npc_dashel_stonefist +npc_lady_katrana_prestor +EndContentData */ + +#include "precompiled.h" + +/*###### +## npc_archmage_malin +######*/ + +#define GOSSIP_ITEM_MALIN "Can you send me to Theramore? I have an urgent message for Lady Jaina from Highlord Bolvar." + +bool GossipHello_npc_archmage_malin(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->GetQuestStatus(11223) == QUEST_STATUS_COMPLETE && !pPlayer->GetQuestRewardStatus(11223)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_MALIN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + + pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_archmage_malin(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF) + { + pPlayer->CLOSE_GOSSIP_MENU(); + pCreature->CastSpell(pPlayer, 42711, true); + } + + return true; +} + +/*###### +## npc_bartleby +######*/ + +enum +{ + FACTION_ENEMY = 168, + QUEST_BEAT = 1640 +}; + +struct TRINITY_DLL_DECL npc_bartlebyAI : public ScriptedAI +{ + npc_bartlebyAI(Creature *c) : ScriptedAI(c) + { + m_uiNormalFaction = c->getFaction(); + } + + uint32 m_uiNormalFaction; + + void Reset() + { + if (m_creature->getFaction() != m_uiNormalFaction) + m_creature->setFaction(m_uiNormalFaction); + } + + void AttackedBy(Unit* pAttacker) + { + if (m_creature->getVictim()) + return; + + if (m_creature->IsFriendlyTo(pAttacker)) + return; + + AttackStart(pAttacker); + } + + void DamageTaken(Unit* pDoneBy, uint32 &uiDamage) + { + if (uiDamage > m_creature->GetHealth() || ((m_creature->GetHealth() - uiDamage)*100 / m_creature->GetMaxHealth() < 15)) + { + //Take 0 damage + uiDamage = 0; + + if (pDoneBy->GetTypeId() == TYPEID_PLAYER) + CAST_PLR(pDoneBy)->AreaExploredOrEventHappens(QUEST_BEAT); + EnterEvadeMode(); + } + } +}; + +bool QuestAccept_npc_bartleby(Player* pPlayer, Creature* pCreature, Quest const* pQuest) +{ + if (pQuest->GetQuestId() == QUEST_BEAT) + { + pCreature->setFaction(FACTION_ENEMY); + pCreature->AI()->AttackStart(pPlayer); + } + return true; +} + +CreatureAI* GetAI_npc_bartleby(Creature* pCreature) +{ + return new npc_bartlebyAI(pCreature); +} + +/*###### +## npc_dashel_stonefist +######*/ + +enum +{ + QUEST_MISSING_DIPLO_PT8 = 1447, + FACTION_HOSTILE = 168 +}; + +struct TRINITY_DLL_DECL npc_dashel_stonefistAI : public ScriptedAI +{ + npc_dashel_stonefistAI(Creature *c) : ScriptedAI(c) + { + m_uiNormalFaction = c->getFaction(); + } + + uint32 m_uiNormalFaction; + + void Reset() + { + if (m_creature->getFaction() != m_uiNormalFaction) + m_creature->setFaction(m_uiNormalFaction); + } + + void AttackedBy(Unit* pAttacker) + { + if (m_creature->getVictim()) + return; + + if (m_creature->IsFriendlyTo(pAttacker)) + return; + + AttackStart(pAttacker); + } + + void DamageTaken(Unit* pDoneBy, uint32 &uiDamage) + { + if (uiDamage > m_creature->GetHealth() || ((m_creature->GetHealth() - uiDamage)*100 / m_creature->GetMaxHealth() < 15)) + { + uiDamage = 0; + + if (pDoneBy->GetTypeId() == TYPEID_PLAYER) + CAST_PLR(pDoneBy)->AreaExploredOrEventHappens(QUEST_MISSING_DIPLO_PT8); + + EnterEvadeMode(); + } + } +}; + +bool QuestAccept_npc_dashel_stonefist(Player* pPlayer, Creature* pCreature, Quest const* pQuest) +{ + if (pQuest->GetQuestId() == QUEST_MISSING_DIPLO_PT8) + { + pCreature->setFaction(FACTION_HOSTILE); + CAST_AI(npc_dashel_stonefistAI, pCreature->AI())->AttackStart(pPlayer); + } + return true; +} + +CreatureAI* GetAI_npc_dashel_stonefist(Creature* pCreature) +{ + return new npc_dashel_stonefistAI(pCreature); +} + +/*###### +## npc_lady_katrana_prestor +######*/ + +#define GOSSIP_ITEM_KAT_1 "Pardon the intrusion, Lady Prestor, but Highlord Bolvar suggested that I seek your advice." +#define GOSSIP_ITEM_KAT_2 "My apologies, Lady Prestor." +#define GOSSIP_ITEM_KAT_3 "Begging your pardon, Lady Prestor. That was not my intent." +#define GOSSIP_ITEM_KAT_4 "Thank you for your time, Lady Prestor." + +bool GossipHello_npc_lady_katrana_prestor(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->GetQuestStatus(4185) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KAT_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + + pPlayer->SEND_GOSSIP_MENU(2693, pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_lady_katrana_prestor(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch (uiAction) + { + case GOSSIP_ACTION_INFO_DEF: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KAT_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + pPlayer->SEND_GOSSIP_MENU(2694, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KAT_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + pPlayer->SEND_GOSSIP_MENU(2695, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KAT_4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + pPlayer->SEND_GOSSIP_MENU(2696, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+3: + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->AreaExploredOrEventHappens(4185); + break; + } + return true; +} + +void AddSC_stormwind_city() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="npc_archmage_malin"; + newscript->pGossipHello = &GossipHello_npc_archmage_malin; + newscript->pGossipSelect = &GossipSelect_npc_archmage_malin; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_bartleby"; + newscript->GetAI = &GetAI_npc_bartleby; + newscript->pQuestAccept = &QuestAccept_npc_bartleby; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_dashel_stonefist"; + newscript->GetAI = &GetAI_npc_dashel_stonefist; + newscript->pQuestAccept = &QuestAccept_npc_dashel_stonefist; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_lady_katrana_prestor"; + newscript->pGossipHello = &GossipHello_npc_lady_katrana_prestor; + newscript->pGossipSelect = &GossipSelect_npc_lady_katrana_prestor; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/stranglethorn_vale.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/stranglethorn_vale.cpp new file mode 100644 index 00000000000..6f2c787f950 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/stranglethorn_vale.cpp @@ -0,0 +1,123 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Stranglethorn_Vale +SD%Complete: 100 +SDComment: Quest support: 592 +SDCategory: Stranglethorn Vale +EndScriptData */ + +/* ContentData +mob_yenniku +EndContentData */ + +#include "precompiled.h" + +/*###### +## mob_yenniku +######*/ + +struct TRINITY_DLL_DECL mob_yennikuAI : public ScriptedAI +{ + mob_yennikuAI(Creature *c) : ScriptedAI(c) + { + bReset = false; + } + + uint32 Reset_Timer; + bool bReset; + + void Reset() + { + Reset_Timer = 0; + m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_NONE); + } + + void SpellHit(Unit *caster, const SpellEntry *spell) + { + if (caster->GetTypeId() == TYPEID_PLAYER) + { + //Yenniku's Release + if (!bReset && CAST_PLR(caster)->GetQuestStatus(592) == QUEST_STATUS_INCOMPLETE && spell->Id == 3607) + { + m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_STUN); + m_creature->CombatStop(); //stop combat + m_creature->DeleteThreatList(); //unsure of this + m_creature->setFaction(83); //horde generic + + bReset = true; + Reset_Timer = 60000; + } + } + return; + } + + void EnterCombat(Unit *who) {} + + void UpdateAI(const uint32 diff) + { + if (bReset) + { + if (Reset_Timer < diff) + { + EnterEvadeMode(); + bReset = false; + m_creature->setFaction(28); //troll, bloodscalp + return; + } + else Reset_Timer -= diff; + + if (m_creature->isInCombat() && m_creature->getVictim()) + { + if (m_creature->getVictim()->GetTypeId() == TYPEID_PLAYER) + { + Unit *victim = m_creature->getVictim(); + if (CAST_PLR(victim)->GetTeam() == HORDE) + { + m_creature->CombatStop(); + m_creature->DeleteThreatList(); + } + } + } + } + + //Return since we have no target + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_mob_yenniku(Creature* pCreature) +{ + return new mob_yennikuAI (pCreature); +} + +/*###### +## +######*/ + +void AddSC_stranglethorn_vale() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "mob_yenniku"; + newscript->GetAI = &GetAI_mob_yenniku; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/tirisfal_glades.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/tirisfal_glades.cpp new file mode 100644 index 00000000000..baddef00944 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/tirisfal_glades.cpp @@ -0,0 +1,209 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Tirisfal_Glades +SD%Complete: 100 +SDComment: Quest support: 590, 1819 +SDCategory: Tirisfal Glades +EndScriptData */ + +/* ContentData +npc_calvin_montague +go_mausoleum_door +go_mausoleum_trigger +EndContentData */ + +#include "precompiled.h" + +/*###### +## npc_calvin_montague +######*/ + +enum +{ + SAY_COMPLETE = -1000431, + SPELL_DRINK = 2639, // possibly not correct spell (but iconId is correct) + QUEST_590 = 590, + FACTION_HOSTILE = 168 +}; + +struct TRINITY_DLL_DECL npc_calvin_montagueAI : public ScriptedAI +{ + npc_calvin_montagueAI(Creature* pCreature) : ScriptedAI(pCreature) { } + + uint32 m_uiPhase; + uint32 m_uiPhaseTimer; + uint64 m_uiPlayerGUID; + + void Reset() + { + m_uiPhase = 0; + m_uiPhaseTimer = 5000; + m_uiPlayerGUID = 0; + + me->RestoreFaction(); + + if (!m_creature->HasFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NOT_ATTACKABLE_2)) + m_creature->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NOT_ATTACKABLE_2); + } + + void EnterCombat(Unit* who) { } + + void AttackedBy(Unit* pAttacker) + { + if (m_creature->getVictim() || m_creature->IsFriendlyTo(pAttacker)) + return; + + AttackStart(pAttacker); + } + + void DamageTaken(Unit* pDoneBy, uint32 &uiDamage) + { + if (uiDamage > m_creature->GetHealth() || ((m_creature->GetHealth() - uiDamage)*100 / m_creature->GetMaxHealth() < 15)) + { + uiDamage = 0; + + me->RestoreFaction(); + m_creature->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NOT_ATTACKABLE_2); + m_creature->CombatStop(true); + + m_uiPhase = 1; + + if (pDoneBy->GetTypeId() == TYPEID_PLAYER) + m_uiPlayerGUID = pDoneBy->GetGUID(); + } + } + + void UpdateAI(const uint32 uiDiff) + { + if (m_uiPhase) + { + if (m_uiPhaseTimer < uiDiff) + m_uiPhaseTimer = 7500; + else + { + m_uiPhaseTimer -= uiDiff; + return; + } + + switch(m_uiPhase) + { + case 1: + DoScriptText(SAY_COMPLETE, m_creature); + ++m_uiPhase; + break; + case 2: + if (Unit* pUnit = Unit::GetUnit(*m_creature, m_uiPlayerGUID)) + CAST_PLR(pUnit)->AreaExploredOrEventHappens(QUEST_590); + + m_creature->CastSpell(m_creature,SPELL_DRINK,true); + ++m_uiPhase; + break; + case 3: + EnterEvadeMode(); + break; + } + + return; + } + + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_npc_calvin_montague(Creature* pCreature) +{ + return new npc_calvin_montagueAI (pCreature); +} + +bool QuestAccept_npc_calvin_montague(Player* pPlayer, Creature* pCreature, Quest const* quest) +{ + if (quest->GetQuestId() == QUEST_590) + { + pCreature->setFaction(FACTION_HOSTILE); + pCreature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); + CAST_AI(npc_calvin_montagueAI, pCreature->AI())->AttackStart(pPlayer); + } + return true; +} + +/*###### +## go_mausoleum_door +## go_mausoleum_trigger +######*/ + +enum +{ + QUEST_ULAG = 1819, + NPC_ULAG = 6390, + GO_TRIGGER = 104593, + GO_DOOR = 176594 +}; + +bool GOHello_go_mausoleum_door(Player* pPlayer, GameObject* pGo) +{ + if (pPlayer->GetQuestStatus(QUEST_ULAG) != QUEST_STATUS_INCOMPLETE) + return false; + + if (GameObject* pTrigger = pPlayer->FindNearestGameObject(GO_TRIGGER, 30.0f)) + { + pTrigger->SetGoState(GO_STATE_READY); + pPlayer->SummonCreature(NPC_ULAG, 2390.26, 336.47, 40.01, 2.26, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 300000); + return false; + } + + return false; +} + +bool GOHello_go_mausoleum_trigger(Player* pPlayer, GameObject* pGo) +{ + if (pPlayer->GetQuestStatus(QUEST_ULAG) != QUEST_STATUS_INCOMPLETE) + return false; + + if (GameObject* pDoor = pPlayer->FindNearestGameObject(GO_DOOR, 30.0f)) + { + pGo->SetGoState(GO_STATE_ACTIVE); + pDoor->RemoveFlag(GAMEOBJECT_FLAGS,GO_FLAG_INTERACT_COND); + return true; + } + + return false; +} + +void AddSC_tirisfal_glades() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="npc_calvin_montague"; + newscript->GetAI = &GetAI_npc_calvin_montague; + newscript->pQuestAccept = &QuestAccept_npc_calvin_montague; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "go_mausoleum_door"; + newscript->pGOHello = &GOHello_go_mausoleum_door; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "go_mausoleum_trigger"; + newscript->pGOHello = &GOHello_go_mausoleum_trigger; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/undercity.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/undercity.cpp new file mode 100644 index 00000000000..8b27dc1beeb --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/undercity.cpp @@ -0,0 +1,266 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Undercity +SD%Complete: 95 +SDComment: Quest support: 6628, 9180(post-event). +SDCategory: Undercity +EndScriptData */ + +/* ContentData +npc_lady_sylvanas_windrunner +npc_highborne_lamenter +npc_parqual_fintallas +EndContentData */ + +#include "precompiled.h" + +/*###### +## npc_lady_sylvanas_windrunner +######*/ + +#define SAY_LAMENT_END -1000357 +#define EMOTE_LAMENT_END -1000358 + +#define SOUND_CREDIT 10896 +#define ENTRY_HIGHBORNE_LAMENTER 21628 +#define ENTRY_HIGHBORNE_BUNNY 21641 + +#define SPELL_HIGHBORNE_AURA 37090 +#define SPELL_SYLVANAS_CAST 36568 +#define SPELL_RIBBON_OF_SOULS 34432 //the real one to use might be 37099 + +float HighborneLoc[4][3]= +{ + {1285.41, 312.47, 0.51}, + {1286.96, 310.40, 1.00}, + {1289.66, 309.66, 1.52}, + {1292.51, 310.50, 1.99}, +}; + +#define HIGHBORNE_LOC_Y -61.00 +#define HIGHBORNE_LOC_Y_NEW -55.50 + +struct TRINITY_DLL_DECL npc_lady_sylvanas_windrunnerAI : public ScriptedAI +{ + npc_lady_sylvanas_windrunnerAI(Creature *c) : ScriptedAI(c) {} + + uint32 LamentEvent_Timer; + bool LamentEvent; + uint64 targetGUID; + + float myX; + float myY; + float myZ; + + void Reset() + { + myX = m_creature->GetPositionX(); + myY = m_creature->GetPositionY(); + myZ = m_creature->GetPositionZ(); + + LamentEvent_Timer = 5000; + LamentEvent = false; + targetGUID = 0; + } + + void EnterCombat(Unit *who) {} + + void JustSummoned(Creature *summoned) + { + if (summoned->GetEntry() == ENTRY_HIGHBORNE_BUNNY) + { + if (Unit* target = Unit::GetUnit(*summoned,targetGUID)) + { + target->SendMonsterMove(target->GetPositionX(), target->GetPositionY(), myZ+15.0,0); + target->GetMap()->CreatureRelocation(m_creature, target->GetPositionX(), target->GetPositionY(), myZ+15.0, 0.0f); + summoned->CastSpell(target, SPELL_RIBBON_OF_SOULS, false); + } + + summoned->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + targetGUID = summoned->GetGUID(); + } + } + + void UpdateAI(const uint32 diff) + { + if (LamentEvent) + { + if (LamentEvent_Timer < diff) + { + float raX = myX; + float raY = myY; + float raZ = myZ; + + m_creature->GetRandomPoint(myX, myY, myZ, 20.0, raX, raY, raZ); + m_creature->SummonCreature(ENTRY_HIGHBORNE_BUNNY, raX, raY, myZ, 0, TEMPSUMMON_TIMED_DESPAWN, 3000); + + LamentEvent_Timer = 2000; + if (!m_creature->HasAura(SPELL_SYLVANAS_CAST)) + { + DoScriptText(SAY_LAMENT_END, m_creature); + DoScriptText(EMOTE_LAMENT_END, m_creature); + LamentEvent = false; + } + }else LamentEvent_Timer -= diff; + } + + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_npc_lady_sylvanas_windrunner(Creature* pCreature) +{ + return new npc_lady_sylvanas_windrunnerAI (pCreature); +} + +bool ChooseReward_npc_lady_sylvanas_windrunner(Player* pPlayer, Creature* pCreature, const Quest *_Quest, uint32 slot) +{ + if (_Quest->GetQuestId() == 9180) + { + CAST_AI(npc_lady_sylvanas_windrunnerAI, pCreature->AI())->LamentEvent = true; + CAST_AI(npc_lady_sylvanas_windrunnerAI, pCreature->AI())->DoPlaySoundToSet(pCreature,SOUND_CREDIT); + pCreature->CastSpell(pCreature,SPELL_SYLVANAS_CAST,false); + + for(uint8 i = 0; i < 4; ++i) + pCreature->SummonCreature(ENTRY_HIGHBORNE_LAMENTER, HighborneLoc[i][0], HighborneLoc[i][1], HIGHBORNE_LOC_Y, HighborneLoc[i][2], TEMPSUMMON_TIMED_DESPAWN, 160000); + } + + return true; +} + +/*###### +## npc_highborne_lamenter +######*/ + +struct TRINITY_DLL_DECL npc_highborne_lamenterAI : public ScriptedAI +{ + npc_highborne_lamenterAI(Creature *c) : ScriptedAI(c) {} + + uint32 EventMove_Timer; + uint32 EventCast_Timer; + bool EventMove; + bool EventCast; + + void Reset() + { + EventMove_Timer = 10000; + EventCast_Timer = 17500; + EventMove = true; + EventCast = true; + } + + void EnterCombat(Unit *who) {} + + void UpdateAI(const uint32 diff) + { + if (EventMove) + { + if (EventMove_Timer < diff) + { + m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + m_creature->SendMonsterMoveWithSpeed(m_creature->GetPositionX(),m_creature->GetPositionY(),HIGHBORNE_LOC_Y_NEW,5000); + m_creature->GetMap()->CreatureRelocation(m_creature,m_creature->GetPositionX(),m_creature->GetPositionY(),HIGHBORNE_LOC_Y_NEW,m_creature->GetOrientation()); + EventMove = false; + }else EventMove_Timer -= diff; + } + if (EventCast) + { + if (EventCast_Timer < diff) + { + DoCast(m_creature,SPELL_HIGHBORNE_AURA); + EventCast = false; + }else EventCast_Timer -= diff; + } + } +}; +CreatureAI* GetAI_npc_highborne_lamenter(Creature* pCreature) +{ + return new npc_highborne_lamenterAI (pCreature); +} + +/*###### +## npc_parqual_fintallas +######*/ + +#define SPELL_MARK_OF_SHAME 6767 + +#define GOSSIP_HPF1 "Gul'dan" +#define GOSSIP_HPF2 "Kel'Thuzad" +#define GOSSIP_HPF3 "Ner'zhul" + +bool GossipHello_npc_parqual_fintallas(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->GetQuestStatus(6628) == QUEST_STATUS_INCOMPLETE && !pPlayer->HasAura(SPELL_MARK_OF_SHAME)) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HPF1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HPF2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HPF3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + pPlayer->SEND_GOSSIP_MENU(5822, pCreature->GetGUID()); + } + else + pPlayer->SEND_GOSSIP_MENU(5821, pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_parqual_fintallas(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + { + pPlayer->CLOSE_GOSSIP_MENU(); + pCreature->CastSpell(pPlayer,SPELL_MARK_OF_SHAME,false); + } + if (uiAction == GOSSIP_ACTION_INFO_DEF+2) + { + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->AreaExploredOrEventHappens(6628); + } + return true; +} + +/*###### +## AddSC +######*/ + +void AddSC_undercity() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="npc_lady_sylvanas_windrunner"; + newscript->GetAI = &GetAI_npc_lady_sylvanas_windrunner; + newscript->pChooseReward = &ChooseReward_npc_lady_sylvanas_windrunner; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_highborne_lamenter"; + newscript->GetAI = &GetAI_npc_highborne_lamenter; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_parqual_fintallas"; + newscript->pGossipHello = &GossipHello_npc_parqual_fintallas; + newscript->pGossipSelect = &GossipSelect_npc_parqual_fintallas; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/western_plaguelands.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/western_plaguelands.cpp new file mode 100644 index 00000000000..edbc94f55ef --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/western_plaguelands.cpp @@ -0,0 +1,232 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Western_Plaguelands +SD%Complete: 90 +SDComment: Quest support: 5216, 5219, 5222, 5225, 5229, 5231, 5233, 5235. To obtain Vitreous Focuser (could use more spesifics about gossip items) +SDCategory: Western Plaguelands +EndScriptData */ + +/* ContentData +npcs_dithers_and_arbington +npc_myranda_the_hag +npc_the_scourge_cauldron +EndContentData */ + +#include "precompiled.h" + +/*###### +## npcs_dithers_and_arbington +######*/ + +#define GOSSIP_HDA1 "What does the Felstone Field Cauldron need?" +#define GOSSIP_HDA2 "What does the Dalson's Tears Cauldron need?" +#define GOSSIP_HDA3 "What does the Writhing Haunt Cauldron need?" +#define GOSSIP_HDA4 "What does the Gahrron's Withering Cauldron need?" + +#define GOSSIP_SDA1 "Thanks, i need a Vitreous Focuser" + +bool GossipHello_npcs_dithers_and_arbington(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + if (pCreature->isVendor()) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); + + if (pPlayer->GetQuestRewardStatus(5237) || pPlayer->GetQuestRewardStatus(5238)) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HDA1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HDA2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HDA3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HDA4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4); + pPlayer->SEND_GOSSIP_MENU(3985, pCreature->GetGUID()); + }else + pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npcs_dithers_and_arbington(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch(uiAction) + { + case GOSSIP_ACTION_TRADE: + pPlayer->SEND_VENDORLIST(pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SDA1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5); + pPlayer->SEND_GOSSIP_MENU(3980, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SDA1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5); + pPlayer->SEND_GOSSIP_MENU(3981, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+3: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SDA1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5); + pPlayer->SEND_GOSSIP_MENU(3982, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+4: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SDA1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5); + pPlayer->SEND_GOSSIP_MENU(3983, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+5: + pPlayer->CLOSE_GOSSIP_MENU(); + pCreature->CastSpell(pPlayer, 17529, false); + break; + } + return true; +} + +/*###### +## npc_myranda_the_hag +######*/ + +enum +{ + QUEST_SUBTERFUGE = 5862, + QUEST_IN_DREAMS = 5944, + SPELL_SCARLET_ILLUSION = 17961 +}; + +#define GOSSIP_ITEM_ILLUSION "I am ready for the illusion, Myranda." + +bool GossipHello_npc_myranda_the_hag(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->GetQuestStatus(QUEST_SUBTERFUGE) == QUEST_STATUS_COMPLETE && + !pPlayer->GetQuestRewardStatus(QUEST_IN_DREAMS) && !pPlayer->HasAura(SPELL_SCARLET_ILLUSION)) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ILLUSION, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + pPlayer->SEND_GOSSIP_MENU(4773, pCreature->GetGUID()); + return true; + } + else + pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_myranda_the_hag(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) + { + pPlayer->CLOSE_GOSSIP_MENU(); + pCreature->CastSpell(pPlayer, SPELL_SCARLET_ILLUSION, false); + } + return true; +} + +/*###### +## npc_the_scourge_cauldron +######*/ + +struct TRINITY_DLL_DECL npc_the_scourge_cauldronAI : public ScriptedAI +{ + npc_the_scourge_cauldronAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + + void EnterCombat(Unit* who) {} + + void DoDie() + { + //summoner dies here + m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + //override any database `spawntimesecs` to prevent duplicated summons + uint32 rTime = m_creature->GetRespawnDelay(); + if (rTime<600) + m_creature->SetRespawnDelay(600); + } + + void MoveInLineOfSight(Unit *who) + { + if (!who || who->GetTypeId() != TYPEID_PLAYER) + return; + + if (who->GetTypeId() == TYPEID_PLAYER) + { + switch(m_creature->GetAreaId()) + { + case 199: //felstone + if (CAST_PLR(who)->GetQuestStatus(5216) == QUEST_STATUS_INCOMPLETE || + CAST_PLR(who)->GetQuestStatus(5229) == QUEST_STATUS_INCOMPLETE) + { + m_creature->SummonCreature(11075, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000); + DoDie(); + } + break; + case 200: //dalson + if (CAST_PLR(who)->GetQuestStatus(5219) == QUEST_STATUS_INCOMPLETE || + CAST_PLR(who)->GetQuestStatus(5231) == QUEST_STATUS_INCOMPLETE) + { + m_creature->SummonCreature(11077, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000); + DoDie(); + } + break; + case 201: //gahrron + if (CAST_PLR(who)->GetQuestStatus(5225) == QUEST_STATUS_INCOMPLETE || + CAST_PLR(who)->GetQuestStatus(5235) == QUEST_STATUS_INCOMPLETE) + { + m_creature->SummonCreature(11078, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); + DoDie(); + } + break; + case 202: //writhing + if (CAST_PLR(who)->GetQuestStatus(5222) == QUEST_STATUS_INCOMPLETE || + CAST_PLR(who)->GetQuestStatus(5233) == QUEST_STATUS_INCOMPLETE) + { + m_creature->SummonCreature(11076, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); + DoDie(); + } + break; + } + } + } +}; +CreatureAI* GetAI_npc_the_scourge_cauldron(Creature* pCreature) +{ + return new npc_the_scourge_cauldronAI (pCreature); +} + +/*###### +## +######*/ + +void AddSC_western_plaguelands() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="npcs_dithers_and_arbington"; + newscript->pGossipHello = &GossipHello_npcs_dithers_and_arbington; + newscript->pGossipSelect = &GossipSelect_npcs_dithers_and_arbington; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_myranda_the_hag"; + newscript->pGossipHello = &GossipHello_npc_myranda_the_hag; + newscript->pGossipSelect = &GossipSelect_npc_myranda_the_hag; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_the_scourge_cauldron"; + newscript->GetAI = &GetAI_npc_the_scourge_cauldron; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/westfall.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/westfall.cpp new file mode 100644 index 00000000000..50a0a8564e0 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/westfall.cpp @@ -0,0 +1,276 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Westfall +SD%Complete: 90 +SDComment: Quest support: 155, 1651 +SDCategory: Westfall +EndScriptData */ + +/* ContentData +npc_daphne_stilwell +npc_defias_traitor +EndContentData */ + +#include "precompiled.h" +#include "../../npc/npc_escortAI.h" + +/*###### +## npc_daphne_stilwell +######*/ + +enum +{ + SAY_DS_START = -1000402, + SAY_DS_DOWN_1 = -1000403, + SAY_DS_DOWN_2 = -1000404, + SAY_DS_DOWN_3 = -1000405, + SAY_DS_PROLOGUE = -1000406, + + SPELL_SHOOT = 6660, + QUEST_TOME_VALOR = 1651, + NPC_DEFIAS_RAIDER = 6180, + EQUIP_ID_RIFLE = 2511 +}; + +struct TRINITY_DLL_DECL npc_daphne_stilwellAI : public npc_escortAI +{ + npc_daphne_stilwellAI(Creature* pCreature) : npc_escortAI(pCreature) {} + + uint32 uiWPHolder; + uint32 uiShootTimer; + + void Reset() + { + if (IsBeingEscorted) + { + switch(uiWPHolder) + { + case 7: DoScriptText(SAY_DS_DOWN_1, m_creature); break; + case 8: DoScriptText(SAY_DS_DOWN_2, m_creature); break; + case 9: DoScriptText(SAY_DS_DOWN_3, m_creature); break; + } + } + else + uiWPHolder = 0; + + uiShootTimer = 0; + } + + void WaypointReached(uint32 uiPoint) + { + Player* pPlayer = Unit::GetPlayer(PlayerGUID); + + if (!pPlayer) + return; + + uiWPHolder = uiPoint; + + switch(uiPoint) + { + case 4: + SetEquipmentSlots(false, EQUIP_NO_CHANGE, EQUIP_NO_CHANGE, EQUIP_ID_RIFLE); + m_creature->SetSheath(SHEATH_STATE_RANGED); + m_creature->HandleEmoteCommand(EMOTE_STATE_USESTANDING_NOSHEATHE); + break; + case 7: + m_creature->SummonCreature(NPC_DEFIAS_RAIDER, -11450.836, 1569.755, 54.267, 4.230, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + m_creature->SummonCreature(NPC_DEFIAS_RAIDER, -11449.697, 1569.124, 54.421, 4.206, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + m_creature->SummonCreature(NPC_DEFIAS_RAIDER, -11448.237, 1568.307, 54.620, 4.206, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + break; + case 8: + m_creature->SetSheath(SHEATH_STATE_RANGED); + m_creature->SummonCreature(NPC_DEFIAS_RAIDER, -11450.836, 1569.755, 54.267, 4.230, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + m_creature->SummonCreature(NPC_DEFIAS_RAIDER, -11449.697, 1569.124, 54.421, 4.206, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + m_creature->SummonCreature(NPC_DEFIAS_RAIDER, -11448.237, 1568.307, 54.620, 4.206, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + m_creature->SummonCreature(NPC_DEFIAS_RAIDER, -11448.037, 1570.213, 54.961, 4.283, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + break; + case 9: + m_creature->SetSheath(SHEATH_STATE_RANGED); + m_creature->SummonCreature(NPC_DEFIAS_RAIDER, -11450.836, 1569.755, 54.267, 4.230, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + m_creature->SummonCreature(NPC_DEFIAS_RAIDER, -11449.697, 1569.124, 54.421, 4.206, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + m_creature->SummonCreature(NPC_DEFIAS_RAIDER, -11448.237, 1568.307, 54.620, 4.206, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + m_creature->SummonCreature(NPC_DEFIAS_RAIDER, -11448.037, 1570.213, 54.961, 4.283, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + m_creature->SummonCreature(NPC_DEFIAS_RAIDER, -11449.018, 1570.738, 54.828, 4.220, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + break; + case 10: + SetRun(false); + break; + case 11: + DoScriptText(SAY_DS_PROLOGUE, m_creature); + break; + case 13: + SetEquipmentSlots(true); + m_creature->SetSheath(SHEATH_STATE_UNARMED); + m_creature->HandleEmoteCommand(EMOTE_STATE_USESTANDING_NOSHEATHE); + break; + case 17: + pPlayer->GroupEventHappens(QUEST_TOME_VALOR, m_creature); + break; + } + } + + void AttackStart(Unit* pWho) + { + if (!pWho) + return; + + if (m_creature->Attack(pWho, false)) + { + m_creature->AddThreat(pWho, 0.0f); + m_creature->SetInCombatWith(pWho); + pWho->SetInCombatWith(m_creature); + + m_creature->GetMotionMaster()->MoveChase(pWho, 30.0f); + } + } + + void JustSummoned(Creature* pSummoned) + { + pSummoned->AI()->AttackStart(m_creature); + } + + void Update(const uint32 diff) + { + npc_escortAI::UpdateAI(diff); + + if (!UpdateVictim()) + return; + + if (uiShootTimer < diff) + { + uiShootTimer = 1500; + + if (!m_creature->IsWithinDist(m_creature->getVictim(), ATTACK_DISTANCE)) + DoCast(m_creature->getVictim(), SPELL_SHOOT); + }else uiShootTimer -= diff; + } +}; + +bool QuestAccept_npc_daphne_stilwell(Player* pPlayer, Creature* pCreature, const Quest* pQuest) +{ + if (pQuest->GetQuestId() == QUEST_TOME_VALOR) + { + DoScriptText(SAY_DS_START, pCreature); + + if (npc_escortAI* pEscortAI = CAST_AI(npc_daphne_stilwellAI, pCreature->AI())) + pEscortAI->Start(true, true, pPlayer->GetGUID()); + } + + return true; +} + +CreatureAI* GetAI_npc_daphne_stilwell(Creature* pCreature) +{ + npc_daphne_stilwellAI* thisAI = new npc_daphne_stilwellAI(pCreature); + + thisAI->FillPointMovementListForCreature(); + + return thisAI; +} + +/*###### +## npc_defias_traitor +######*/ + +#define SAY_START -1000101 +#define SAY_PROGRESS -1000102 +#define SAY_END -1000103 +#define SAY_AGGRO_1 -1000104 +#define SAY_AGGRO_2 -1000105 + +#define QUEST_DEFIAS_BROTHERHOOD 155 + +struct TRINITY_DLL_DECL npc_defias_traitorAI : public npc_escortAI +{ + npc_defias_traitorAI(Creature *c) : npc_escortAI(c) { Reset(); } + + void WaypointReached(uint32 i) + { + Player* pPlayer = Unit::GetPlayer(PlayerGUID); + + if (!pPlayer) + return; + + switch (i) + { + case 35: + SetRun(false); + break; + case 36: + DoScriptText(SAY_PROGRESS, m_creature, pPlayer); + break; + case 44: + DoScriptText(SAY_END, m_creature, pPlayer); + { + if (pPlayer) + pPlayer->GroupEventHappens(QUEST_DEFIAS_BROTHERHOOD,m_creature); + } + break; + } + } + void EnterCombat(Unit* who) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_AGGRO_1, m_creature, who); break; + case 1: DoScriptText(SAY_AGGRO_2, m_creature, who); break; + } + } + + void Reset() {} +}; + +bool QuestAccept_npc_defias_traitor(Player* pPlayer, Creature* pCreature, Quest const* quest) +{ + if (quest->GetQuestId() == QUEST_DEFIAS_BROTHERHOOD) + { + if (npc_escortAI* pEscortAI = CAST_AI(npc_defias_traitorAI, pCreature->AI())) + pEscortAI->Start(true, true, pPlayer->GetGUID()); + + DoScriptText(SAY_START, pCreature, pPlayer); + } + + return true; +} + +CreatureAI* GetAI_npc_defias_traitor(Creature* pCreature) +{ + npc_defias_traitorAI* thisAI = new npc_defias_traitorAI(pCreature); + + thisAI->FillPointMovementListForCreature(); + + return thisAI; +} + +void AddSC_westfall() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "npc_daphne_stilwell"; + newscript->GetAI = &GetAI_npc_daphne_stilwell; + newscript->pQuestAccept = &QuestAccept_npc_daphne_stilwell; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_defias_traitor"; + newscript->GetAI = &GetAI_npc_defias_traitor; + newscript->pQuestAccept = &QuestAccept_npc_defias_traitor; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/ashenvale.cpp b/src/bindings/scripts/scripts/kalimdor/ashenvale.cpp new file mode 100644 index 00000000000..3fd7d1ef791 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/ashenvale.cpp @@ -0,0 +1,256 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +/* ScriptData +SDName: Ashenvale +SD%Complete: 70 +SDComment: Quest support: 6544, 6482 +SDCategory: Ashenvale Forest +EndScriptData */ + +/* ContentData +npc_torek +npc_ruul_snowhoof +EndContentData */ + +#include "precompiled.h" +#include "../../npc/npc_escortAI.h" + +/*#### +# npc_torek +####*/ + +#define SAY_READY -1000106 +#define SAY_MOVE -1000107 +#define SAY_PREPARE -1000108 +#define SAY_WIN -1000109 +#define SAY_END -1000110 + +#define SPELL_REND 11977 +#define SPELL_THUNDERCLAP 8078 + +#define QUEST_TOREK_ASSULT 6544 + +#define ENTRY_SPLINTERTREE_RAIDER 12859 +#define ENTRY_DURIEL 12860 +#define ENTRY_SILVERWING_SENTINEL 12896 +#define ENTRY_SILVERWING_WARRIOR 12897 + +struct TRINITY_DLL_DECL npc_torekAI : public npc_escortAI +{ + npc_torekAI(Creature *c) : npc_escortAI(c) {} + + uint32 Rend_Timer; + uint32 Thunderclap_Timer; + bool Completed; + + void WaypointReached(uint32 i) + { + Player* pPlayer = Unit::GetPlayer(PlayerGUID); + + if (!pPlayer) + return; + + switch (i) + { + case 1: + DoScriptText(SAY_MOVE, m_creature, pPlayer); + break; + case 8: + DoScriptText(SAY_PREPARE, m_creature, pPlayer); + break; + case 19: + //TODO: verify location and creatures amount. + m_creature->SummonCreature(ENTRY_DURIEL,1776.73,-2049.06,109.83,1.54,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,25000); + m_creature->SummonCreature(ENTRY_SILVERWING_SENTINEL,1774.64,-2049.41,109.83,1.40,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,25000); + m_creature->SummonCreature(ENTRY_SILVERWING_WARRIOR,1778.73,-2049.50,109.83,1.67,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,25000); + break; + case 20: + DoScriptText(SAY_WIN, m_creature, pPlayer); + Completed = true; + if (pPlayer && pPlayer->GetTypeId() == TYPEID_PLAYER) + CAST_PLR(pPlayer)->GroupEventHappens(QUEST_TOREK_ASSULT,m_creature); + break; + case 21: + DoScriptText(SAY_END, m_creature, pPlayer); + break; + } + } + + void Reset() + { + Rend_Timer = 5000; + Thunderclap_Timer = 8000; + Completed = false; + } + + void EnterCombat(Unit* who) + { + } + + void JustSummoned(Creature* summoned) + { + summoned->AI()->AttackStart(m_creature); + } + + void UpdateAI(const uint32 diff) + { + npc_escortAI::UpdateAI(diff); + + if (!UpdateVictim()) + return; + + if (Rend_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_REND); + Rend_Timer = 20000; + }else Rend_Timer -= diff; + + if (Thunderclap_Timer < diff) + { + DoCast(m_creature,SPELL_THUNDERCLAP); + Thunderclap_Timer = 30000; + }else Thunderclap_Timer -= diff; + } +}; + +bool QuestAccept_npc_torek(Player* pPlayer, Creature* pCreature, Quest const* quest) +{ + if (quest->GetQuestId() == QUEST_TOREK_ASSULT) + { + //TODO: find companions, make them follow Torek, at any time (possibly done by mangos/database in future?) + DoScriptText(SAY_READY, pCreature, pPlayer); + pCreature->setFaction(113); + + if (npc_escortAI* pEscortAI = CAST_AI(npc_torekAI, pCreature->AI())) + pEscortAI->Start(true, true, pPlayer->GetGUID()); + } + + return true; +} + +CreatureAI* GetAI_npc_torek(Creature* pCreature) +{ + npc_torekAI* thisAI = new npc_torekAI(pCreature); + + thisAI->FillPointMovementListForCreature(); + + return thisAI; +} + +/*#### +# npc_ruul_snowhoof +####*/ + +#define QUEST_FREEDOM_TO_RUUL 6482 +#define GO_CAGE 178147 + +struct TRINITY_DLL_DECL npc_ruul_snowhoofAI : public npc_escortAI +{ + npc_ruul_snowhoofAI(Creature *c) : npc_escortAI(c) {} + + void WaypointReached(uint32 i) + { + Player* pPlayer = Unit::GetPlayer(PlayerGUID); + + if (!pPlayer) + return; + + switch(i) + { + case 0: { + m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); + GameObject* Cage = m_creature->FindNearestGameObject(GO_CAGE, 20); + if (Cage) + Cage->SetGoState(GO_STATE_ACTIVE); + break;} + case 13: + m_creature->SummonCreature(3922, 3449.218018, -587.825073, 174.978867, 4.714445, TEMPSUMMON_DEAD_DESPAWN, 60000); + m_creature->SummonCreature(3921, 3446.384521, -587.830872, 175.186279, 4.714445, TEMPSUMMON_DEAD_DESPAWN, 60000); + m_creature->SummonCreature(3926, 3444.218994, -587.835327, 175.380600, 4.714445, TEMPSUMMON_DEAD_DESPAWN, 60000); + break; + case 19: + m_creature->SummonCreature(3922, 3508.344482, -492.024261, 186.929031, 4.145029, TEMPSUMMON_DEAD_DESPAWN, 60000); + m_creature->SummonCreature(3921, 3506.265625, -490.531006, 186.740128, 4.239277, TEMPSUMMON_DEAD_DESPAWN, 60000); + m_creature->SummonCreature(3926, 3503.682373, -489.393799, 186.629684, 4.349232, TEMPSUMMON_DEAD_DESPAWN, 60000); + break; + + case 21:{ + if (pPlayer && pPlayer->GetTypeId() == TYPEID_PLAYER) + CAST_PLR(pPlayer)->GroupEventHappens(QUEST_FREEDOM_TO_RUUL,m_creature); + + break; } + } + } + + void EnterCombat(Unit* who) {} + + void Reset() + { + GameObject* Cage = m_creature->FindNearestGameObject(GO_CAGE, 20); + if (Cage) + Cage->SetGoState(GO_STATE_READY); + } + + void JustSummoned(Creature* summoned) + { + summoned->AI()->AttackStart(m_creature); + } + + void UpdateAI(const uint32 diff) + { + npc_escortAI::UpdateAI(diff); + } +}; + +bool QuestAccept_npc_ruul_snowhoof(Player* pPlayer, Creature* pCreature, Quest const* quest) +{ + if (quest->GetQuestId() == QUEST_FREEDOM_TO_RUUL) + { + pCreature->setFaction(113); + + if (npc_escortAI* pEscortAI = CAST_AI(npc_ruul_snowhoofAI, (pCreature->AI()))) + pEscortAI->Start(true, false, pPlayer->GetGUID()); + } + return true; +} + +CreatureAI* GetAI_npc_ruul_snowhoofAI(Creature* pCreature) +{ + npc_ruul_snowhoofAI* ruul_snowhoofAI = new npc_ruul_snowhoofAI(pCreature); + + ruul_snowhoofAI->FillPointMovementListForCreature(); + + return ruul_snowhoofAI; +} + +void AddSC_ashenvale() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "npc_torek"; + newscript->GetAI = &GetAI_npc_torek; + newscript->pQuestAccept = &QuestAccept_npc_torek; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_ruul_snowhoof"; + newscript->GetAI = &GetAI_npc_ruul_snowhoofAI; + newscript->pQuestAccept = &QuestAccept_npc_ruul_snowhoof; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/azshara.cpp b/src/bindings/scripts/scripts/kalimdor/azshara.cpp new file mode 100644 index 00000000000..4a3d736d7e7 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/azshara.cpp @@ -0,0 +1,508 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Azshara +SD%Complete: 90 +SDComment: Quest support: 2744, 3141, 9364, 10994 +SDCategory: Azshara +EndScriptData */ + +/* ContentData +mobs_spitelashes +npc_loramus_thalipedes +mob_rizzle_sprysprocket +mob_depth_charge +EndContentData */ + +#include "precompiled.h" +#include "World.h" +#include "WorldPacket.h" + +/*###### +## mobs_spitelashes +######*/ + +struct TRINITY_DLL_DECL mobs_spitelashesAI : public ScriptedAI +{ + mobs_spitelashesAI(Creature *c) : ScriptedAI(c) {} + + uint32 morphtimer; + bool spellhit; + + void Reset() + { + morphtimer = 0; + spellhit = false; + } + + void EnterCombat(Unit *who) { } + + void SpellHit(Unit *Hitter, const SpellEntry *Spellkind) + { + if (!spellhit && + Hitter->GetTypeId() == TYPEID_PLAYER && + CAST_PLR(Hitter)->GetQuestStatus(9364) == QUEST_STATUS_INCOMPLETE && + (Spellkind->Id==118 || Spellkind->Id== 12824 || Spellkind->Id== 12825 || Spellkind->Id== 12826)) + { + spellhit=true; + DoCast(m_creature,29124); //become a sheep + } + } + + void UpdateAI(const uint32 diff) + { + // we mustn't remove the Creature in the same round in which we cast the summon spell, otherwise there will be no summons + if (spellhit && morphtimer>=5000) + { + m_creature->ForcedDespawn(); + return; + } + // walk 5 seconds before summoning + if (spellhit && morphtimer<5000) + { + morphtimer+=diff; + if (morphtimer>=5000) + { + DoCast(m_creature,28406); //summon copies + DoCast(m_creature,6924); //visual explosion + } + } + if (!UpdateVictim()) + return; + + //TODO: add abilities for the different creatures + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_mobs_spitelashes(Creature* pCreature) +{ + return new mobs_spitelashesAI (pCreature); +} + +/*###### +## npc_loramus_thalipedes +######*/ + +bool GossipHello_npc_loramus_thalipedes(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->GetQuestStatus(2744) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Can you help me?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + if (pPlayer->GetQuestStatus(3141) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Tell me your story", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + + pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_loramus_thalipedes(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch (uiAction) + { + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->AreaExploredOrEventHappens(2744); + break; + + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Please continue", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 21); + pPlayer->SEND_GOSSIP_MENU(1813, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+21: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "I do not understand", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 22); + pPlayer->SEND_GOSSIP_MENU(1814, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+22: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Indeed", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 23); + pPlayer->SEND_GOSSIP_MENU(1815, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+23: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "I will do this with or your help, Loramus", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 24); + pPlayer->SEND_GOSSIP_MENU(1816, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+24: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Yes", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 25); + pPlayer->SEND_GOSSIP_MENU(1817, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+25: + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->AreaExploredOrEventHappens(3141); + break; + } + return true; +} + +/*#### +# mob_rizzle_sprysprocket +####*/ + +#define MOB_DEPTH_CHARGE 23025 +#define SPELL_RIZZLE_BLACKJACK 39865 +#define SPELL_RIZZLE_ESCAPE 39871 +#define SPELL_RIZZLE_FROST_GRENADE 40525 +#define SPELL_DEPTH_CHARGE_TRAP 38576 +#define SPELL_PERIODIC_DEPTH_CHARGE 39912 +#define SPELL_GIVE_SOUTHFURY_MOONSTONE 39886 + +#define SAY_RIZZLE_START -1000245 +#define SAY_RIZZLE_GRENADE -1000246 +#define SAY_RIZZLE_FINAL -1000247 + +#define GOSSIP_GET_MOONSTONE "Hand over the Southfury moonstone and I'll let you go." + +//next message must be send to player when Rizzle jump into river, not implemented +#define MSG_ESCAPE_NOTICE "Rizzle Sprysprocket takes the Southfury moonstone and escapes into the river. Follow her!" + +float WPs[58][4] = +{ +//pos_x pos_y pos_z orien +{3691.97, -3962.41, 35.9118, 3.67}, +{3675.02, -3960.49, 35.9118, 3.67}, +{3653.19, -3958.33, 33.9118, 3.59}, +{3621.12, -3958.51, 29.9118, 3.48}, +{3604.86, -3963, 29.9118, 3.48}, +{3569.94, -3970.25, 29.9118, 3.44}, +{3541.03, -3975.64, 29.9118, 3.41}, +{3510.84, -3978.71, 29.9118, 3.41}, +{3472.7, -3997.07, 29.9118, 3.35}, +{3439.15, -4014.55, 29.9118, 3.29}, +{3412.8, -4025.87, 29.9118, 3.25}, +{3384.95, -4038.04, 29.9118, 3.24}, +{3346.77, -4052.93, 29.9118, 3.22}, +{3299.56, -4071.59, 29.9118, 3.20}, +{3261.22, -4080.38, 30.9118, 3.19}, +{3220.68, -4083.09, 31.9118, 3.18}, +{3187.11, -4070.45, 33.9118, 3.16}, +{3162.78, -4062.75, 33.9118, 3.15}, +{3136.09, -4050.32, 33.9118, 3.07}, +{3119.47, -4044.51, 36.0363, 3.07}, +{3098.95, -4019.8, 33.9118, 3.07}, +{3073.07, -4011.42, 33.9118, 3.07}, +{3051.71, -3993.37, 33.9118, 3.02}, +{3027.52, -3978.6, 33.9118, 3.00}, +{3003.78, -3960.14, 33.9118, 2.98}, +{2977.99, -3941.98, 31.9118, 2.96}, +{2964.57, -3932.07, 30.9118, 2.96}, +{2947.9, -3921.31, 29.9118, 2.96}, +{2924.91, -3910.8, 29.9118, 2.94}, +{2903.04, -3896.42, 29.9118, 2.93}, +{2884.75, -3874.03, 29.9118, 2.90}, +{2868.19, -3851.48, 29.9118, 2.82}, +{2854.62, -3819.72, 29.9118, 2.80}, +{2825.53, -3790.4, 29.9118, 2.744}, +{2804.31, -3773.05, 29.9118, 2.71}, +{2769.78, -3763.57, 29.9118, 2.70}, +{2727.23, -3745.92, 30.9118, 2.69}, +{2680.12, -3737.49, 30.9118, 2.67}, +{2647.62, -3739.94, 30.9118, 2.66}, +{2616.6, -3745.75, 30.9118, 2.64}, +{2589.38, -3731.97, 30.9118, 2.61}, +{2562.94, -3722.35, 31.9118, 2.56}, +{2521.05, -3716.6, 31.9118, 2.55}, +{2485.26, -3706.67, 31.9118, 2.51}, +{2458.93, -3696.67, 31.9118, 2.51}, +{2432, -3692.03, 31.9118, 2.46}, +{2399.59, -3681.97, 31.9118, 2.45}, +{2357.75, -3666.6, 31.9118, 2.44}, +{2311.99, -3656.88, 31.9118, 2.94}, +{2263.41, -3649.55, 31.9118, 3.02}, +{2209.05, -3641.76, 31.9118, 2.99}, +{2164.83, -3637.64, 31.9118, 3.15}, +{2122.42, -3639, 31.9118, 3.21}, +{2075.73, -3643.59, 31.9118, 3.22}, +{2033.59, -3649.52, 31.9118, 3.42}, +{1985.22, -3662.99, 31.9118, 3.42}, +{1927.09, -3679.56, 33.9118, 3.42}, +{1873.57, -3695.32, 33.9118, 3.44} +}; + +struct TRINITY_DLL_DECL mob_rizzle_sprysprocketAI : public ScriptedAI +{ + mob_rizzle_sprysprocketAI(Creature *c) : ScriptedAI(c) {} + + uint32 spellEscape_Timer; + uint32 Teleport_Timer; + uint32 Check_Timer; + uint32 Grenade_Timer; + uint32 Must_Die_Timer; + uint32 CurrWP; + + uint64 PlayerGUID; + + bool Must_Die; + bool Escape; + bool ContinueWP; + bool Reached; + + void Reset() + { + spellEscape_Timer = 1300; + Teleport_Timer = 3500; + Check_Timer = 10000; + Grenade_Timer = 30000; + Must_Die_Timer = 3000; + CurrWP = 0; + + PlayerGUID = 0; + + Must_Die = false; + Escape = false; + ContinueWP = false; + Reached = false; + } + + void UpdateAI(const uint32 diff) + { + if (Must_Die) + if (Must_Die_Timer < diff) + { + m_creature->ForcedDespawn(); + return; + } else Must_Die_Timer -= diff; + + if (!Escape) + { + if (!PlayerGUID) + return; + + if (spellEscape_Timer < diff) + { + DoCast(m_creature, SPELL_RIZZLE_ESCAPE, false); + spellEscape_Timer = 10000; + } else spellEscape_Timer -= diff; + + if (Teleport_Timer < diff) + { + //temp solution - unit can't be teleported by core using spelleffect 5, only players + Map* pMap = m_creature->GetMap(); + if (pMap) + { + pMap->CreatureRelocation(m_creature, 3706.39, -3969.15, 35.9118, 0); + m_creature->AI_SendMoveToPacket(3706.39, -3969.15, 35.9118, 0, 0, 0); + } + //begin swimming and summon depth charges + Player* pPlayer = Unit::GetPlayer(PlayerGUID); + SendText(MSG_ESCAPE_NOTICE, pPlayer); + DoCast(m_creature, SPELL_PERIODIC_DEPTH_CHARGE); + m_creature->SetUnitMovementFlags(MOVEMENTFLAG_HOVER | MOVEMENTFLAG_SWIMMING); + m_creature->SetSpeed(MOVE_RUN, 0.85f, true); + m_creature->GetMotionMaster()->MovementExpired(); + m_creature->GetMotionMaster()->MovePoint(CurrWP, WPs[CurrWP][0], WPs[CurrWP][1], WPs[CurrWP][2]); + Escape = true; + } else Teleport_Timer -= diff; + + return; + } + + if (ContinueWP) + { + m_creature->GetMotionMaster()->MovePoint(CurrWP, WPs[CurrWP][0], WPs[CurrWP][1], WPs[CurrWP][2]); + ContinueWP = false; + } + + if (Grenade_Timer < diff) + { + Player* pPlayer = Unit::GetPlayer(PlayerGUID); + if (pPlayer) + { + DoScriptText(SAY_RIZZLE_GRENADE, m_creature, pPlayer); + DoCast(pPlayer, SPELL_RIZZLE_FROST_GRENADE, true); + } + Grenade_Timer = 30000; + } else Grenade_Timer -= diff; + + if (Check_Timer < diff) + { + Player* pPlayer = Unit::GetPlayer(PlayerGUID); + if (!pPlayer) + { + m_creature->ForcedDespawn(); + return; + } + + if (m_creature->IsWithinDist(pPlayer, 10) && m_creature->GetPositionX() > pPlayer->GetPositionX() && !Reached) + { + DoScriptText(SAY_RIZZLE_FINAL, m_creature); + m_creature->SetUInt32Value(UNIT_NPC_FLAGS, 1); + m_creature->setFaction(35); + m_creature->GetMotionMaster()->MoveIdle(); + m_creature->RemoveAurasDueToSpell(SPELL_PERIODIC_DEPTH_CHARGE); + Reached = true; + } + + Check_Timer = 1000; + } else Check_Timer -= diff; + + } + + void SendText(const char *text, Player* pPlayer) + { + WorldPacket data(SMSG_SERVER_MESSAGE, 0); // guess size + data << text; + if (pPlayer) + pPlayer->GetSession()->SendPacket(&data); + } + + void AttackStart(Unit *who) + { + if (!who || PlayerGUID) + return; + + if (who->GetTypeId() == TYPEID_PLAYER && CAST_PLR(who)->GetQuestStatus(10994) == QUEST_STATUS_INCOMPLETE) + { + PlayerGUID = who->GetGUID(); + DoScriptText(SAY_RIZZLE_START, m_creature); + DoCast(who, SPELL_RIZZLE_BLACKJACK, false); + return; + } + } + + void EnterCombat(Unit* who) {} + + void MovementInform(uint32 type, uint32 id) + { + if (type != POINT_MOTION_TYPE) + return; + + if (id == 57) + { + m_creature->ForcedDespawn(); + return; + } + + ++CurrWP; + ContinueWP = true; + } + +}; + +bool GossipHello_mob_rizzle_sprysprocket(Player* pPlayer, Creature* pCreature) +{ + if (pPlayer->GetQuestStatus(10994) != QUEST_STATUS_INCOMPLETE) + return true; + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_GET_MOONSTONE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + pPlayer->SEND_GOSSIP_MENU(10811, pCreature->GetGUID()); + return true; +} + +bool GossipSelect_mob_rizzle_sprysprocket(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF + 1 && pPlayer->GetQuestStatus(10994) == QUEST_STATUS_INCOMPLETE) + { + pPlayer->CLOSE_GOSSIP_MENU(); + pCreature->CastSpell(pPlayer, SPELL_GIVE_SOUTHFURY_MOONSTONE, true); + CAST_AI(mob_rizzle_sprysprocketAI, pCreature->AI())->Must_Die_Timer = 3000; + CAST_AI(mob_rizzle_sprysprocketAI, pCreature->AI())->Must_Die = true; + } + return true; +} + +CreatureAI* GetAI_mob_rizzle_sprysprocket(Creature* pCreature) +{ + return new mob_rizzle_sprysprocketAI (pCreature); +} + +/*#### +# mob_depth_charge +####*/ + +struct TRINITY_DLL_DECL mob_depth_chargeAI : public ScriptedAI +{ + mob_depth_chargeAI(Creature *c) : ScriptedAI(c) {} + + bool we_must_die; + uint32 must_die_timer; + + void Reset() + { + m_creature->SetUnitMovementFlags(MOVEMENTFLAG_HOVER | MOVEMENTFLAG_SWIMMING); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + we_must_die = false; + must_die_timer = 1000; + } + + void UpdateAI(const uint32 diff) + { + if (we_must_die) + if (must_die_timer < diff) + { + m_creature->ForcedDespawn(); + } else must_die_timer -= diff; + return; + } + + void MoveInLineOfSight(Unit *who) + { + if (!who) + return; + + if (who->GetTypeId() == TYPEID_PLAYER && m_creature->IsWithinDistInMap(who, 5)) + { + DoCast(who, SPELL_DEPTH_CHARGE_TRAP); + we_must_die = true; + return; + } + } + + void AttackStart(Unit *who) + { + return; + } + + void EnterCombat(Unit* who) + { + return; + } +}; + +CreatureAI* GetAI_mob_depth_charge(Creature* pCreature) +{ + return new mob_depth_chargeAI (pCreature); +} + +void AddSC_azshara() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="mobs_spitelashes"; + newscript->GetAI = &GetAI_mobs_spitelashes; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_loramus_thalipedes"; + newscript->pGossipHello = &GossipHello_npc_loramus_thalipedes; + newscript->pGossipSelect = &GossipSelect_npc_loramus_thalipedes; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_rizzle_sprysprocket"; + newscript->GetAI = &GetAI_mob_rizzle_sprysprocket; + newscript->pGossipHello = &GossipHello_mob_rizzle_sprysprocket; + newscript->pGossipSelect = &GossipSelect_mob_rizzle_sprysprocket; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_depth_charge"; + newscript->GetAI = &GetAI_mob_depth_charge; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/azuremyst_isle.cpp b/src/bindings/scripts/scripts/kalimdor/azuremyst_isle.cpp new file mode 100644 index 00000000000..75c37fa5689 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/azuremyst_isle.cpp @@ -0,0 +1,630 @@ + /* Copyright (C) 2006 - 2009 ScriptDev2 .sourceforge.net/> + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Azuremyst_Isle +SD%Complete: 75 +SDComment: Quest support: 9283, 9537, 9582, 9554, 9531, 9303(special flight path, proper model for mount missing). Injured Draenei cosmetic only +SDCategory: Azuremyst Isle +EndScriptData */ + +/* ContentData +npc_draenei_survivor +npc_engineer_spark_overgrind +npc_injured_draenei +npc_magwin +npc_geezle +mob_nestlewood_owlkin +EndContentData */ + +#include "precompiled.h" +#include "../../npc/npc_escortAI.h" +#include + +/*###### +## npc_draenei_survivor +######*/ + +enum +{ + SAY_HEAL1 = -1000248, + SAY_HEAL2 = -1000249, + SAY_HEAL3 = -1000250, + SAY_HEAL4 = -1000251, + + SAY_HELP1 = -1000252, + SAY_HELP2 = -1000253, + SAY_HELP3 = -1000254, + SAY_HELP4 = -1000255, + + SPELL_IRRIDATION = 35046, + SPELL_STUNNED = 28630 +}; + +struct TRINITY_DLL_DECL npc_draenei_survivorAI : public ScriptedAI +{ + npc_draenei_survivorAI(Creature *c) : ScriptedAI(c) {} + + uint64 pCaster; + + uint32 SayThanksTimer; + uint32 RunAwayTimer; + uint32 SayHelpTimer; + + bool CanSayHelp; + + void Reset() + { + pCaster = 0; + + SayThanksTimer = 0; + RunAwayTimer = 0; + SayHelpTimer = 10000; + + CanSayHelp = true; + + m_creature->CastSpell(m_creature, SPELL_IRRIDATION, true); + + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT); + m_creature->SetHealth(int(m_creature->GetMaxHealth()*.1)); + m_creature->SetStandState(UNIT_STAND_STATE_SLEEP); + } + + void EnterCombat(Unit *who) {} + + void MoveInLineOfSight(Unit *who) + { + if (CanSayHelp && who->GetTypeId() == TYPEID_PLAYER && m_creature->IsFriendlyTo(who) && m_creature->IsWithinDistInMap(who, 25.0f)) + { + //Random switch between 4 texts + switch (rand()%4) + { + case 0: DoScriptText(SAY_HELP1, m_creature, who); break; + case 1: DoScriptText(SAY_HELP2, m_creature, who); break; + case 2: DoScriptText(SAY_HELP3, m_creature, who); break; + case 3: DoScriptText(SAY_HELP4, m_creature, who); break; + } + + SayHelpTimer = 20000; + CanSayHelp = false; + } + } + + void SpellHit(Unit *Caster, const SpellEntry *Spell) + { + if (Spell->SpellFamilyFlags[2] & 0x080000000) + { + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE); + m_creature->SetStandState(UNIT_STAND_STATE_STAND); + + m_creature->CastSpell(m_creature, SPELL_STUNNED, true); + + pCaster = Caster->GetGUID(); + + SayThanksTimer = 5000; + } + } + + void UpdateAI(const uint32 diff) + { + if (SayThanksTimer) + { + if (SayThanksTimer <= diff) + { + m_creature->RemoveAurasDueToSpell(SPELL_IRRIDATION); + + if (Player* pPlayer = Unit::GetPlayer(pCaster)) + { + switch (rand()%4) + { + case 0: DoScriptText(SAY_HEAL1, m_creature, pPlayer); break; + case 1: DoScriptText(SAY_HEAL2, m_creature, pPlayer); break; + case 2: DoScriptText(SAY_HEAL3, m_creature, pPlayer); break; + case 3: DoScriptText(SAY_HEAL4, m_creature, pPlayer); break; + } + + pPlayer->TalkedToCreature(m_creature->GetEntry(),m_creature->GetGUID()); + } + + m_creature->GetMotionMaster()->Clear(); + m_creature->GetMotionMaster()->MovePoint(0, -4115.053711f, -13754.831055f, 73.508949f); + + RunAwayTimer = 10000; + SayThanksTimer = 0; + }else SayThanksTimer -= diff; + + return; + } + + if (RunAwayTimer) + { + if (RunAwayTimer <= diff) + m_creature->ForcedDespawn(); + else + RunAwayTimer -= diff; + + return; + } + + if (SayHelpTimer < diff) + { + CanSayHelp = true; + SayHelpTimer = 20000; + }else SayHelpTimer -= diff; + } +}; +CreatureAI* GetAI_npc_draenei_survivor(Creature* pCreature) +{ + return new npc_draenei_survivorAI (pCreature); +} + +/*###### +## npc_engineer_spark_overgrind +######*/ + +enum +{ + SAY_TEXT = -1000256, + SAY_EMOTE = -1000257, + ATTACK_YELL = -1000258, + + AREA_COVE = 3579, + AREA_ISLE = 3639, + QUEST_GNOMERCY = 9537, + FACTION_HOSTILE = 14, + SPELL_DYNAMITE = 7978 +}; + +#define GOSSIP_FIGHT "Traitor! You will be brought to justice!" + +struct TRINITY_DLL_DECL npc_engineer_spark_overgrindAI : public ScriptedAI +{ + npc_engineer_spark_overgrindAI(Creature *c) : ScriptedAI(c) + { + NormFaction = c->getFaction(); + NpcFlags = c->GetUInt32Value(UNIT_NPC_FLAGS); + + if (c->GetAreaId() == AREA_COVE || c->GetAreaId() == AREA_ISLE) + IsTreeEvent = true; + } + + uint32 NormFaction; + uint32 NpcFlags; + + uint32 Dynamite_Timer; + uint32 Emote_Timer; + + bool IsTreeEvent; + + void Reset() + { + Dynamite_Timer = 8000; + Emote_Timer = 120000 + rand()%30000; + + m_creature->setFaction(NormFaction); + m_creature->SetUInt32Value(UNIT_NPC_FLAGS, NpcFlags); + + IsTreeEvent = false; + } + + void EnterCombat(Unit* who) + { + DoScriptText(ATTACK_YELL, m_creature, who); + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->isInCombat() && !IsTreeEvent) + { + if (Emote_Timer < diff) + { + DoScriptText(SAY_TEXT, m_creature); + DoScriptText(SAY_EMOTE, m_creature); + Emote_Timer = 120000 + rand()%30000; + }else Emote_Timer -= diff; + } + else if (IsTreeEvent) + return; + + if (!UpdateVictim()) + return; + + if (Dynamite_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_DYNAMITE); + Dynamite_Timer = 8000; + } else Dynamite_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_npc_engineer_spark_overgrind(Creature* pCreature) +{ + return new npc_engineer_spark_overgrindAI (pCreature); +} + +bool GossipHello_npc_engineer_spark_overgrind(Player* pPlayer, Creature* pCreature) +{ + if (pPlayer->GetQuestStatus(QUEST_GNOMERCY) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_FIGHT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + + pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_engineer_spark_overgrind(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF) + { + pPlayer->CLOSE_GOSSIP_MENU(); + pCreature->setFaction(FACTION_HOSTILE); + CAST_AI(npc_engineer_spark_overgrindAI, pCreature->AI())->AttackStart(pPlayer); + } + return true; +} + +/*###### +## npc_injured_draenei +######*/ + +struct TRINITY_DLL_DECL npc_injured_draeneiAI : public ScriptedAI +{ + npc_injured_draeneiAI(Creature *c) : ScriptedAI(c) {} + + void Reset() + { + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT); + m_creature->SetHealth(int(m_creature->GetMaxHealth()*.15)); + switch (rand()%2) + { + case 0: m_creature->SetStandState(UNIT_STAND_STATE_SIT); break; + case 1: m_creature->SetStandState(UNIT_STAND_STATE_SLEEP); break; + } + } + + void EnterCombat(Unit *who) {} + + void MoveInLineOfSight(Unit *who) + { + return; //ignore everyone around them (won't aggro anything) + } + + void UpdateAI(const uint32 diff) + { + return; + } + +}; +CreatureAI* GetAI_npc_injured_draenei(Creature* pCreature) +{ + return new npc_injured_draeneiAI (pCreature); +} + +/*###### +## npc_magwin +######*/ + +enum +{ + SAY_START = -1000111, + SAY_AGGRO = -1000112, + SAY_PROGRESS = -1000113, + SAY_END1 = -1000114, + SAY_END2 = -1000115, + EMOTE_HUG = -1000116, + + QUEST_A_CRY_FOR_SAY_HELP = 9528 +}; + +struct TRINITY_DLL_DECL npc_magwinAI : public npc_escortAI +{ + npc_magwinAI(Creature *c) : npc_escortAI(c) {} + + + void WaypointReached(uint32 i) + { + Player* pPlayer = Unit::GetPlayer(PlayerGUID); + + if (!pPlayer) + return; + + switch(i) + { + case 0: + DoScriptText(SAY_START, m_creature, pPlayer); + break; + case 17: + DoScriptText(SAY_PROGRESS, m_creature, pPlayer); + break; + case 28: + DoScriptText(SAY_END1, m_creature, pPlayer); + break; + case 29: + DoScriptText(EMOTE_HUG, m_creature, pPlayer); + DoScriptText(SAY_END2, m_creature, pPlayer); + pPlayer->GroupEventHappens(QUEST_A_CRY_FOR_SAY_HELP,m_creature); + break; + } + } + + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature, who); + } + + void Reset() { } +}; + +bool QuestAccept_npc_magwin(Player* pPlayer, Creature* pCreature, Quest const* quest) +{ + if (quest->GetQuestId() == QUEST_A_CRY_FOR_SAY_HELP) + { + pCreature->setFaction(113); + if (npc_escortAI* pEscortAI = CAST_AI(npc_escortAI, pCreature->AI())) + pEscortAI->Start(true, false, pPlayer->GetGUID()); + } + return true; +} + +CreatureAI* GetAI_npc_magwinAI(Creature* pCreature) +{ + npc_magwinAI* magwinAI = new npc_magwinAI(pCreature); + + magwinAI->FillPointMovementListForCreature(); + + return magwinAI; +} + +/*###### +## npc_geezle +######*/ + +enum +{ + GEEZLE_SAY_1 = -1000259, + SPARK_SAY_2 = -1000260, + SPARK_SAY_3 = -1000261, + GEEZLE_SAY_4 = -1000262, + SPARK_SAY_5 = -1000263, + SPARK_SAY_6 = -1000264, + GEEZLE_SAY_7 = -1000265, + + EMOTE_SPARK = -1000266, + + MOB_SPARK = 17243, + GO_NAGA_FLAG = 181694 +}; + +static float SparkPos[3] = {-5030.95, -11291.99, 7.97}; + +struct TRINITY_DLL_DECL npc_geezleAI : public ScriptedAI +{ + npc_geezleAI(Creature *c) : ScriptedAI(c) {} + + uint64 SparkGUID; + + uint32 Step; + uint32 SayTimer; + + bool EventStarted; + + void Reset() + { + SparkGUID = 0; + Step = 0; + StartEvent(); + } + + void EnterCombat(Unit* who){} + + void StartEvent() + { + Step = 1; + EventStarted = true; + Creature* Spark = m_creature->SummonCreature(MOB_SPARK, SparkPos[0], SparkPos[1], SparkPos[2], 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1000); + if (Spark) + { + SparkGUID = Spark->GetGUID(); + Spark->setActive(true); + Spark->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + Spark->GetMotionMaster()->MovePoint(0, -5080.70, -11253.61, 0.56); + } + m_creature->GetMotionMaster()->MovePoint(0, -5092.26, -11252, 0.71); + SayTimer = 23000; + } + + uint32 NextStep(uint32 Step) + { + Unit* Spark = Unit::GetUnit((*m_creature), SparkGUID); + + switch(Step) + { + case 0: return 99999; + case 1: + //DespawnNagaFlag(true); + DoScriptText(EMOTE_SPARK, Spark); + return 1000; + case 2: + DoScriptText(GEEZLE_SAY_1, m_creature, Spark); + if (Spark) + { + Spark->SetInFront(m_creature); + m_creature->SetInFront(Spark); + } + return 5000; + case 3: DoScriptText(SPARK_SAY_2, Spark); return 7000; + case 4: DoScriptText(SPARK_SAY_3, Spark); return 8000; + case 5: DoScriptText(GEEZLE_SAY_4, m_creature, Spark); return 8000; + case 6: DoScriptText(SPARK_SAY_5, Spark); return 9000; + case 7: DoScriptText(SPARK_SAY_6, Spark); return 8000; + case 8: DoScriptText(GEEZLE_SAY_7, m_creature, Spark); return 2000; + case 9: + m_creature->GetMotionMaster()->MoveTargetedHome(); + if (Spark) + Spark->GetMotionMaster()->MovePoint(0, -5030.95, -11291.99, 7.97); + return 20000; + case 10: + if (Spark) + Spark->DealDamage(Spark,Spark->GetHealth(),NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + //DespawnNagaFlag(false); + m_creature->SetVisibility(VISIBILITY_OFF); + default: return 99999999; + } + } + + void DespawnNagaFlag(bool despawn) + { + std::list FlagList; + m_creature->GetGameObjectListWithEntryInGrid(FlagList,GO_NAGA_FLAG, 50.0f); + + Player* pPlayer = NULL; + if (!FlagList.empty()) + { + for(std::list::iterator itr = FlagList.begin(); itr != FlagList.end(); ++itr) + { + //TODO: Found how to despawn and respawn + if (despawn) + (*itr)->Delete(); + else + (*itr)->Respawn(); + } + } else error_log("SD2 ERROR: FlagList is empty!"); + } + + void UpdateAI(const uint32 diff) + { + if (SayTimer < diff) + { + if (EventStarted) + { + SayTimer = NextStep(++Step); + } + }else SayTimer -= diff; + } +}; + +CreatureAI* GetAI_npc_geezleAI(Creature* pCreature) +{ + return new npc_geezleAI(pCreature); +} + +/*###### +## mob_nestlewood_owlkin +######*/ + +enum +{ + SPELL_INOCULATE_OWLKIN = 29528, + ENTRY_OWLKIN = 16518, + ENTRY_OWLKIN_INOC = 16534 +}; + +struct TRINITY_DLL_DECL npc_nestlewood_owlkinAI : public ScriptedAI +{ + npc_nestlewood_owlkinAI(Creature *c) : ScriptedAI(c) {} + + uint32 DespawnTimer; + + void Reset() + { + DespawnTimer = 0; + } + + void UpdateAI(const uint32 diff) + { + //timer gets adjusted by the triggered aura effect + if (DespawnTimer) + { + if (DespawnTimer <= diff) + { + //once we are able to, despawn us + m_creature->ForcedDespawn(); + return; + }else DespawnTimer -= diff; + } + + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_npc_nestlewood_owlkinAI(Creature* pCreature) +{ + return new npc_nestlewood_owlkinAI (pCreature); +} + +bool EffectDummyCreature_npc_nestlewood_owlkin(Unit *pCaster, uint32 spellId, uint32 effIndex, Creature *pCreatureTarget) +{ + //always check spellid and effectindex + if (spellId == SPELL_INOCULATE_OWLKIN && effIndex == 0) + { + if (pCreatureTarget->GetEntry() != ENTRY_OWLKIN) + return true; + + pCreatureTarget->UpdateEntry(ENTRY_OWLKIN_INOC); + + //set despawn timer, since we want to remove Creature after a short time + CAST_AI(npc_nestlewood_owlkinAI, pCreatureTarget->AI())->DespawnTimer = 15000; + + //always return true when we are handling this spell and effect + return true; + } + return false; +} + +void AddSC_azuremyst_isle() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="npc_draenei_survivor"; + newscript->GetAI = &GetAI_npc_draenei_survivor; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_engineer_spark_overgrind"; + newscript->GetAI = &GetAI_npc_engineer_spark_overgrind; + newscript->pGossipHello = &GossipHello_npc_engineer_spark_overgrind; + newscript->pGossipSelect = &GossipSelect_npc_engineer_spark_overgrind; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_injured_draenei"; + newscript->GetAI = &GetAI_npc_injured_draenei; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_magwin"; + newscript->GetAI = &GetAI_npc_magwinAI; + newscript->pQuestAccept = &QuestAccept_npc_magwin; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_geezle"; + newscript->GetAI = &GetAI_npc_geezleAI; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_nestlewood_owlkin"; + newscript->GetAI = &GetAI_npc_nestlewood_owlkinAI; + newscript->pEffectDummyCreature = &EffectDummyCreature_npc_nestlewood_owlkin; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/bloodmyst_isle.cpp b/src/bindings/scripts/scripts/kalimdor/bloodmyst_isle.cpp new file mode 100644 index 00000000000..f033cba93b8 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/bloodmyst_isle.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: Bloodmyst_Isle +SD%Complete: 80 +SDComment: Quest support: 9670, 9756(gossip items text needed). +SDCategory: Bloodmyst Isle +EndScriptData */ + +/* ContentData +mob_webbed_creature +npc_captured_sunhawk_agent +EndContentData */ + +#include "precompiled.h" + +/*###### +## mob_webbed_creature +######*/ + +//possible creatures to be spawned +const uint32 possibleSpawns[32] = {17322, 17661, 17496, 17522, 17340, 17352, 17333, 17524, 17654, 17348, 17339, 17345, 17359, 17353, 17336, 17550, 17330, 17701, 17321, 17680, 17325, 17320, 17683, 17342, 17715, 17334, 17341, 17338, 17337, 17346, 17344, 17327}; + +struct TRINITY_DLL_DECL mob_webbed_creatureAI : public ScriptedAI +{ + mob_webbed_creatureAI(Creature *c) : ScriptedAI(c) {} + + void Reset() + { + } + + void EnterCombat(Unit* who) + { + } + + void JustDied(Unit* Killer) + { + uint32 spawnCreatureID = 0; + + switch(rand()%3) + { + case 0: + spawnCreatureID = 17681; + if (Killer->GetTypeId() == TYPEID_PLAYER) + CAST_PLR(Killer)->KilledMonsterCredit(spawnCreatureID, m_creature->GetGUID()); + break; + case 1: + case 2: + spawnCreatureID = possibleSpawns[rand()%31]; + break; + } + + if (spawnCreatureID) + m_creature->SummonCreature(spawnCreatureID, 0.0f, 0.0f, 0.0f, m_creature->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); + } +}; +CreatureAI* GetAI_mob_webbed_creature(Creature* pCreature) +{ + return new mob_webbed_creatureAI (pCreature); +} + +/*###### +## npc_captured_sunhawk_agent +######*/ + +#define C_SUNHAWK_TRIGGER 17974 + +bool GossipHello_npc_captured_sunhawk_agent(Player* pPlayer, Creature* pCreature) +{ + if (pPlayer->HasAura(31609) && pPlayer->GetQuestStatus(9756) == QUEST_STATUS_INCOMPLETE) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "[PH] ", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + pPlayer->SEND_GOSSIP_MENU(9136, pCreature->GetGUID()); + } + else + pPlayer->SEND_GOSSIP_MENU(9134, pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_captured_sunhawk_agent(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch (uiAction) + { + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "[PH] ", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + pPlayer->SEND_GOSSIP_MENU(9137, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "[PH] ", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); + pPlayer->SEND_GOSSIP_MENU(9138, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+3: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "[PH] ", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4); + pPlayer->SEND_GOSSIP_MENU(9139, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+4: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "[PH] ", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5); + pPlayer->SEND_GOSSIP_MENU(9140, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+5: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "[PH] ", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6); + pPlayer->SEND_GOSSIP_MENU(9141, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+6: + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->TalkedToCreature(C_SUNHAWK_TRIGGER, pCreature->GetGUID()); + break; + } + return true; +} + +void AddSC_bloodmyst_isle() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="mob_webbed_creature"; + newscript->GetAI = &GetAI_mob_webbed_creature; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_captured_sunhawk_agent"; + newscript->pGossipHello = &GossipHello_npc_captured_sunhawk_agent; + newscript->pGossipSelect = &GossipSelect_npc_captured_sunhawk_agent; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/boss_azuregos.cpp b/src/bindings/scripts/scripts/kalimdor/boss_azuregos.cpp new file mode 100644 index 00000000000..c44772fd87e --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/boss_azuregos.cpp @@ -0,0 +1,155 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Azuregos +SD%Complete: 90 +SDComment: Teleport not included, spell reflect not effecting dots (Core problem) +SDCategory: Azshara +EndScriptData */ + +#include "precompiled.h" + +#define SAY_TELEPORT -1000100 + +#define SPELL_MARKOFFROST 23182 +#define SPELL_MANASTORM 21097 +#define SPELL_CHILL 21098 +#define SPELL_FROSTBREATH 21099 +#define SPELL_REFLECT 22067 +#define SPELL_CLEAVE 8255 //Perhaps not right ID +#define SPELL_ENRAGE 23537 + +struct TRINITY_DLL_DECL boss_azuregosAI : public ScriptedAI +{ + boss_azuregosAI(Creature *c) : ScriptedAI(c) {} + + uint32 MarkOfFrost_Timer; + uint32 ManaStorm_Timer; + uint32 Chill_Timer; + uint32 Breath_Timer; + uint32 Teleport_Timer; + uint32 Reflect_Timer; + uint32 Cleave_Timer; + uint32 Enrage_Timer; + bool Enraged; + + void Reset() + { + MarkOfFrost_Timer = 35000; + ManaStorm_Timer = 5000 + rand()%12000; + Chill_Timer = 10000 + rand()%20000; + Breath_Timer = 2000 + rand()%6000; + Teleport_Timer = 30000; + Reflect_Timer = 15000 + rand()%15000; + Cleave_Timer = 7000; + Enrage_Timer = 0; + Enraged = false; + } + + void EnterCombat(Unit *who) {} + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + if (Teleport_Timer < diff) + { + DoScriptText(SAY_TELEPORT, m_creature); + 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->GetTypeId() == TYPEID_PLAYER)) + { + DoTeleportPlayer(pUnit, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ()+3, pUnit->GetOrientation()); + } + } + + DoResetThreat(); + Teleport_Timer = 30000; + }else Teleport_Timer -= diff; + + // //MarkOfFrost_Timer + // if (MarkOfFrost_Timer < diff) + // { + // DoCast(m_creature->getVictim(),SPELL_MARKOFFROST); + // MarkOfFrost_Timer = 25000; + // }else MarkOfFrost_Timer -= diff; + + //Chill_Timer + if (Chill_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_CHILL); + Chill_Timer = 13000 + rand()%12000; + }else Chill_Timer -= diff; + + //Breath_Timer + if (Breath_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_FROSTBREATH); + Breath_Timer = 10000 + rand()%5000; + }else Breath_Timer -= diff; + + //ManaStorm_Timer + if (ManaStorm_Timer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_MANASTORM); + ManaStorm_Timer = 7500 + rand()%5000; + }else ManaStorm_Timer -= diff; + + //Reflect_Timer + if (Reflect_Timer < diff) + { + DoCast(m_creature,SPELL_REFLECT); + Reflect_Timer = 20000 + rand()%15000; + }else Reflect_Timer -= diff; + + //Cleave_Timer + if (Cleave_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_CLEAVE); + Cleave_Timer = 7000; + }else Cleave_Timer -= diff; + + //Enrage_Timer + if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 26 && !Enraged) + { + DoCast(m_creature, SPELL_ENRAGE); + Enraged = true; + } + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_azuregos(Creature* pCreature) +{ + return new boss_azuregosAI (pCreature); +} + +void AddSC_boss_azuregos() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_azuregos"; + newscript->GetAI = &GetAI_boss_azuregos; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/darkshore.cpp b/src/bindings/scripts/scripts/kalimdor/darkshore.cpp new file mode 100644 index 00000000000..4d968e58011 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/darkshore.cpp @@ -0,0 +1,347 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Darkshore +SD%Complete: 100 +SDComment: Quest support: 731, 2078 +SDCategory: Darkshore +EndScriptData */ + +/* ContentData +npc_prospector_remtravel +npc_threshwackonator +EndContentData */ + +#include "precompiled.h" +#include "../../npc/npc_escortAI.h" + +/*#### +# npc_prospector_remtravel +####*/ + +enum +{ + SAY_REM_START = -1000415, + SAY_REM_AGGRO = -1000427, + SAY_REM_RAMP1_1 = -1000416, + SAY_REM_RAMP1_2 = -1000417, + SAY_REM_BOOK = -1000418, + SAY_REM_TENT1_1 = -1000419, + SAY_REM_TENT1_2 = -1000420, + SAY_REM_MOSS = -1000421, + EMOTE_REM_MOSS = -1000422, + SAY_REM_MOSS_PROGRESS = -1000423, + SAY_REM_PROGRESS = -1000424, + SAY_REM_REMEMBER = -1000425, + EMOTE_REM_END = -1000426, + + FACTION_ESCORTEE = 10, + QUEST_ABSENT_MINDED_PT2 = 731, + NPC_GRAVEL_SCOUT = 2158, + NPC_GRAVEL_BONE = 2159, + NPC_GRAVEL_GEO = 2160 +}; + +struct TRINITY_DLL_DECL npc_prospector_remtravelAI : public npc_escortAI +{ + npc_prospector_remtravelAI(Creature* pCreature) : npc_escortAI(pCreature) {} + + void WaypointReached(uint32 i) + { + Player* pPlayer = Unit::GetPlayer(PlayerGUID); + + if (!pPlayer) + return; + + switch(i) + { + case 0: + DoScriptText(SAY_REM_START, me, pPlayer); + break; + case 5: + DoScriptText(SAY_REM_RAMP1_1, me, pPlayer); + break; + case 6: + DoSpawnCreature(NPC_GRAVEL_SCOUT, -10.0f, 5.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + DoSpawnCreature(NPC_GRAVEL_BONE, -10.0f, 7.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + break; + case 9: + DoScriptText(SAY_REM_RAMP1_2, me, pPlayer); + break; + case 14: + //depend quest rewarded? + DoScriptText(SAY_REM_BOOK, me, pPlayer); + break; + case 15: + DoScriptText(SAY_REM_TENT1_1, me, pPlayer); + break; + case 16: + DoSpawnCreature(NPC_GRAVEL_SCOUT, -10.0f, 5.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + DoSpawnCreature(NPC_GRAVEL_BONE, -10.0f, 7.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + break; + case 17: + DoScriptText(SAY_REM_TENT1_2, me, pPlayer); + break; + case 26: + DoScriptText(SAY_REM_MOSS, me, pPlayer); + break; + case 27: + DoScriptText(EMOTE_REM_MOSS, me, pPlayer); + break; + case 28: + DoScriptText(SAY_REM_MOSS_PROGRESS, me, pPlayer); + break; + case 29: + DoSpawnCreature(NPC_GRAVEL_SCOUT, -15.0f, 3.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + DoSpawnCreature(NPC_GRAVEL_BONE, -15.0f, 5.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + DoSpawnCreature(NPC_GRAVEL_GEO, -15.0f, 7.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + break; + case 31: + DoScriptText(SAY_REM_PROGRESS, me, pPlayer); + break; + case 41: + DoScriptText(SAY_REM_REMEMBER, me, pPlayer); + break; + case 42: + DoScriptText(EMOTE_REM_END, me, pPlayer); + pPlayer->GroupEventHappens(QUEST_ABSENT_MINDED_PT2, me); + break; + } + } + + void Reset() {} + + void EnterCombat(Unit* who) + { + if (rand()%2) + DoScriptText(SAY_REM_AGGRO, me, who); + } + + void JustSummoned(Creature* pSummoned) + { + //unsure if it should be any + //pSummoned->AI()->AttackStart(m_creature); + } + + void UpdateAI(const uint32 diff) + { + npc_escortAI::UpdateAI(diff); + } +}; + +CreatureAI* GetAI_npc_prospector_remtravel(Creature* pCreature) +{ + npc_prospector_remtravelAI* tempAI = new npc_prospector_remtravelAI(pCreature); + + tempAI->FillPointMovementListForCreature(); + + return tempAI; +} + +bool QuestAccept_npc_prospector_remtravel(Player* pPlayer, Creature* pCreature, const Quest* pQuest) +{ + if (pQuest->GetQuestId() == QUEST_ABSENT_MINDED_PT2) + { + if (npc_escortAI* pEscortAI = CAST_AI(npc_prospector_remtravelAI, pCreature->AI())) + pEscortAI->Start(false, false, pPlayer->GetGUID()); + + pCreature->setFaction(FACTION_ESCORTEE); + } + + return true; +} + +/*#### +# npc_threshwackonator +####*/ + +enum +{ + EMOTE_START = -1000413, + SAY_AT_CLOSE = -1000414, + QUEST_GYROMAST_REV = 2078, + NPC_GELKAK = 6667, + FACTION_HOSTILE = 14 +}; + +#define GOSSIP_ITEM_INSERT_KEY "[PH] Insert key" + +struct TRINITY_DLL_DECL npc_threshwackonatorAI : public ScriptedAI +{ + npc_threshwackonatorAI(Creature* pCreature) : ScriptedAI(pCreature) + { + Faction = pCreature->getFaction(); + NpcFlags = pCreature->GetUInt32Value(UNIT_NPC_FLAGS); + PlayerGUID = 0; + } + + uint64 PlayerGUID; + uint32 Faction; + uint32 NpcFlags; + uint32 CheckPlayerTimer; + + void Reset() + { + CheckPlayerTimer = 2500; + + if (!PlayerGUID) + { + me->setFaction(Faction); + me->SetUInt32Value(UNIT_NPC_FLAGS, NpcFlags); + } + } + + void MoveInLineOfSight(Unit* who) + { + if (who->GetEntry() == NPC_GELKAK) + { + if (PlayerGUID && me->IsWithinDistInMap(who, 10.0f)) + { + DoScriptText(SAY_AT_CLOSE, who); + DoAtEnd(); + } + } + + ScriptedAI::MoveInLineOfSight(who); + } + + void EnterEvadeMode() + { + me->RemoveAllAuras(); + me->DeleteThreatList(); + me->CombatStop(true); + me->LoadCreaturesAddon(); + + if (me->isAlive()) + { + if (Player* pPlayer = Unit::GetPlayer(PlayerGUID)) + me->GetMotionMaster()->MoveFollow(pPlayer, PET_FOLLOW_DIST, m_creature->GetFollowAngle()); + else + { + me->GetMotionMaster()->MovementExpired(); + me->GetMotionMaster()->MoveTargetedHome(); + } + } + + me->SetLootRecipient(NULL); + + Reset(); + } + + void DoStart(uint64 Starter) + { + PlayerGUID = Starter; + me->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE); + + if (Player* pPlayer = Unit::GetPlayer(PlayerGUID)) + me->GetMotionMaster()->MoveFollow(pPlayer, PET_FOLLOW_DIST, m_creature->GetFollowAngle()); + + DoScriptText(EMOTE_START, me); + } + + void DoAtEnd() + { + me->setFaction(FACTION_HOSTILE); + + if (Player* pHolder = Unit::GetPlayer(PlayerGUID)) + me->AI()->AttackStart(pHolder); + + PlayerGUID = 0; + } + + void JustDied(Unit* pKiller) + { + if (PlayerGUID) + { + PlayerGUID = 0; + me->GetMotionMaster()->MovementExpired(); + } + } + + void UpdateAI(const uint32 diff) + { + if (PlayerGUID) + { + if (!me->isInCombat()) + { + if (CheckPlayerTimer < diff) + { + CheckPlayerTimer = 5000; + + Player* pPlayer = Unit::GetPlayer(PlayerGUID); + + if (pPlayer && !pPlayer->isAlive()) + { + PlayerGUID = 0; + EnterEvadeMode(); + return; + } + }else CheckPlayerTimer -= diff; + } + } + + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_npc_threshwackonator(Creature* pCreature) +{ + return new npc_threshwackonatorAI(pCreature); +} + +bool GossipHello_npc_threshwackonator(Player* pPlayer, Creature* pCreature) +{ + if (pPlayer->GetQuestStatus(QUEST_GYROMAST_REV) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_INSERT_KEY, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_threshwackonator(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + { + CAST_AI(npc_threshwackonatorAI, pCreature->AI())->DoStart(pPlayer->GetGUID()); + pPlayer->CLOSE_GOSSIP_MENU(); + } + + return true; +} + +void AddSC_darkshore() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "npc_prospector_remtravel"; + newscript->GetAI = &GetAI_npc_prospector_remtravel; + newscript->pQuestAccept = &QuestAccept_npc_prospector_remtravel; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_threshwackonator"; + newscript->GetAI = &GetAI_npc_threshwackonator; + newscript->pGossipHello = &GossipHello_npc_threshwackonator; + newscript->pGossipSelect = &GossipSelect_npc_threshwackonator; + newscript->pGossipSelect = &GossipSelect_npc_threshwackonator; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/desolace.cpp b/src/bindings/scripts/scripts/kalimdor/desolace.cpp new file mode 100644 index 00000000000..6423fc08018 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/desolace.cpp @@ -0,0 +1,174 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Desolace +SD%Complete: 100 +SDComment: Quest support: 5561 +SDCategory: Desolace +EndScriptData */ + +/* ContentData +npc_aged_dying_ancient_kodo +EndContentData */ + +#include "precompiled.h" + +enum +{ + SAY_SMEED_HOME_1 = -1000428, + SAY_SMEED_HOME_2 = -1000429, + SAY_SMEED_HOME_3 = -1000430, + + QUEST_KODO = 5561, + + NPC_SMEED = 11596, + NPC_AGED_KODO = 4700, + NPC_DYING_KODO = 4701, + NPC_ANCIENT_KODO = 4702, + NPC_TAMED_KODO = 11627, + + SPELL_KODO_KOMBO_ITEM = 18153, + SPELL_KODO_KOMBO_PLAYER_BUFF = 18172, //spells here have unclear function, but using them at least for visual parts and checks + SPELL_KODO_KOMBO_DESPAWN_BUFF = 18377, + SPELL_KODO_KOMBO_GOSSIP = 18362 + +}; + +struct TRINITY_DLL_DECL npc_aged_dying_ancient_kodoAI : public ScriptedAI +{ + npc_aged_dying_ancient_kodoAI(Creature* pCreature) : ScriptedAI(pCreature) { Reset(); } + + uint32 m_uiDespawnTimer; + + void Reset() + { + m_uiDespawnTimer = 0; + } + + void MoveInLineOfSight(Unit* pWho) + { + if (pWho->GetEntry() == NPC_SMEED) + { + if (m_creature->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP)) + return; + + if (m_creature->IsWithinDistInMap(pWho, 10.0f)) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_SMEED_HOME_1, pWho); break; + case 1: DoScriptText(SAY_SMEED_HOME_2, pWho); break; + case 2: DoScriptText(SAY_SMEED_HOME_3, pWho); break; + } + + //spell have no implemented effect (dummy), so useful to notify spellHit + m_creature->CastSpell(m_creature,SPELL_KODO_KOMBO_GOSSIP,true); + } + } + } + + void SpellHit(Unit* pCaster, SpellEntry const* pSpell) + { + if (pSpell->Id == SPELL_KODO_KOMBO_GOSSIP) + { + m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + m_uiDespawnTimer = 60000; + } + } + + void UpdateAI(const uint32 diff) + { + //timer should always be == 0 unless we already updated entry of creature. Then not expect this updated to ever be in combat. + if (m_uiDespawnTimer && m_uiDespawnTimer <= diff) + { + if (!m_creature->getVictim() && m_creature->isAlive()) + { + Reset(); + m_creature->setDeathState(JUST_DIED); + m_creature->Respawn(); + return; + } + } else m_uiDespawnTimer -= diff; + + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_npc_aged_dying_ancient_kodo(Creature* pCreature) +{ + return new npc_aged_dying_ancient_kodoAI(pCreature); +} + +bool EffectDummyCreature_npc_aged_dying_ancient_kodo(Unit *pCaster, uint32 spellId, uint32 effIndex, Creature *pCreatureTarget) +{ + //always check spellid and effectindex + if (spellId == SPELL_KODO_KOMBO_ITEM && effIndex == 0) + { + //no effect if player/creature already have aura from spells + if (pCaster->HasAura(SPELL_KODO_KOMBO_PLAYER_BUFF) || pCreatureTarget->HasAura(SPELL_KODO_KOMBO_DESPAWN_BUFF)) + return true; + + if (pCreatureTarget->GetEntry() == NPC_AGED_KODO || + pCreatureTarget->GetEntry() == NPC_DYING_KODO || + pCreatureTarget->GetEntry() == NPC_ANCIENT_KODO) + { + pCaster->CastSpell(pCaster,SPELL_KODO_KOMBO_PLAYER_BUFF,true); + + pCreatureTarget->UpdateEntry(NPC_TAMED_KODO); + pCreatureTarget->CastSpell(pCreatureTarget,SPELL_KODO_KOMBO_DESPAWN_BUFF,false); + + if (pCreatureTarget->GetMotionMaster()->GetCurrentMovementGeneratorType() == WAYPOINT_MOTION_TYPE) + pCreatureTarget->GetMotionMaster()->MoveIdle(); + + pCreatureTarget->GetMotionMaster()->MoveFollow(pCaster, PET_FOLLOW_DIST, pCreatureTarget->GetFollowAngle()); + } + + //always return true when we are handling this spell and effect + return true; + } + return false; +} + +bool GossipHello_npc_aged_dying_ancient_kodo(Player* pPlayer, Creature* pCreature) +{ + if (pPlayer->HasAura(SPELL_KODO_KOMBO_PLAYER_BUFF) && pCreature->HasAura(SPELL_KODO_KOMBO_DESPAWN_BUFF)) + { + //the expected quest objective + pPlayer->TalkedToCreature(pCreature->GetEntry(), pCreature->GetGUID()); + + pPlayer->RemoveAurasDueToSpell(SPELL_KODO_KOMBO_PLAYER_BUFF); + pCreature->GetMotionMaster()->MoveIdle(); + } + + pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); + return true; +} + +void AddSC_desolace() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "npc_aged_dying_ancient_kodo"; + newscript->GetAI = &GetAI_npc_aged_dying_ancient_kodo; + newscript->pEffectDummyCreature = &EffectDummyCreature_npc_aged_dying_ancient_kodo; + newscript->pGossipHello = &GossipHello_npc_aged_dying_ancient_kodo; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/kalimdor/dustwallow_marsh.cpp b/src/bindings/scripts/scripts/kalimdor/dustwallow_marsh.cpp new file mode 100644 index 00000000000..d8648d605b0 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/dustwallow_marsh.cpp @@ -0,0 +1,337 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Dustwallow_Marsh +SD%Complete: 95 +SDComment: Quest support: 11180, 558, 11126, 11142, 11180. Vendor Nat Pagle +SDCategory: Dustwallow Marsh +EndScriptData */ + +/* ContentData +mobs_risen_husk_spirit +npc_restless_apparition +npc_deserter_agitator +npc_lady_jaina_proudmoore +npc_nat_pagle +npc_private_hendel +npc_cassa_crimsonwing - handled by npc_taxi +EndContentData */ + +#include "precompiled.h" + +/*###### +## mobs_risen_husk_spirit +######*/ + +enum +{ + QUEST_WHATS_HAUNTING_WITCH_HILL = 11180, + SPELL_SUMMON_RESTLESS_APPARITION = 42511, + SPELL_CONSUME_FLESH = 37933, //Risen Husk + SPELL_INTANGIBLE_PRESENCE = 43127, //Risen Spirit + NPC_RISEN_HUSK = 23555, + NPC_RISEN_SPIRIT = 23554 +}; + +struct TRINITY_DLL_DECL mobs_risen_husk_spiritAI : public ScriptedAI +{ + mobs_risen_husk_spiritAI(Creature *c) : ScriptedAI(c) {} + + uint32 m_uiConsumeFlesh_Timer; + uint32 m_uiIntangiblePresence_Timer; + + void Reset() + { + m_uiConsumeFlesh_Timer = 10000; + m_uiIntangiblePresence_Timer = 5000; + } + + void DamageTaken(Unit* pDoneBy, uint32 &damage) + { + if (pDoneBy->GetTypeId() == TYPEID_PLAYER) + { + if (damage >= m_creature->GetHealth() && CAST_PLR(pDoneBy)->GetQuestStatus(QUEST_WHATS_HAUNTING_WITCH_HILL) == QUEST_STATUS_INCOMPLETE) + m_creature->CastSpell(pDoneBy, SPELL_SUMMON_RESTLESS_APPARITION, false); + } + } + + void UpdateAI(const uint32 uiDiff) + { + if (!UpdateVictim()) + return; + + if (m_uiConsumeFlesh_Timer < uiDiff) + { + if (m_creature->GetEntry() == NPC_RISEN_HUSK) + DoCast(m_creature->getVictim(), SPELL_CONSUME_FLESH); + + m_uiConsumeFlesh_Timer = 15000; + } + else + m_uiConsumeFlesh_Timer -= uiDiff; + + if (m_uiIntangiblePresence_Timer < uiDiff) + { + if (m_creature->GetEntry() == NPC_RISEN_SPIRIT) + DoCast(m_creature->getVictim(), SPELL_INTANGIBLE_PRESENCE); + + m_uiIntangiblePresence_Timer = 20000; + } + else + m_uiIntangiblePresence_Timer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mobs_risen_husk_spirit(Creature* pCreature) +{ + return new mobs_risen_husk_spiritAI (pCreature); +} + +/*###### +## npc_restless_apparition +######*/ + +bool GossipHello_npc_restless_apparition(Player* pPlayer, Creature* pCreature) +{ + pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); + + pPlayer->TalkedToCreature(pCreature->GetEntry(), pCreature->GetGUID()); + pCreature->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + + return true; +} + +/*###### +## npc_deserter_agitator +######*/ + +enum +{ + QUEST_TRAITORS_AMONG_US = 11126, + FACTION_THER_DESERTER = 1883 +}; + +struct TRINITY_DLL_DECL npc_deserter_agitatorAI : public ScriptedAI +{ + npc_deserter_agitatorAI(Creature* pCreature) : ScriptedAI(pCreature) { } + + void Reset() + { + me->RestoreFaction(); + } +}; + +CreatureAI* GetAI_npc_deserter_agitator(Creature* pCreature) +{ + return new npc_deserter_agitatorAI (pCreature); +} + +bool GossipHello_npc_deserter_agitator(Player* pPlayer, Creature* pCreature) +{ + if (pPlayer->GetQuestStatus(QUEST_TRAITORS_AMONG_US) == QUEST_STATUS_INCOMPLETE) + { + pCreature->setFaction(FACTION_THER_DESERTER); + pPlayer->TalkedToCreature(pCreature->GetEntry(), pCreature->GetGUID()); + } + else + pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); + + return true; +} + +/*###### +## npc_lady_jaina_proudmoore +######*/ + +enum +{ + QUEST_JAINAS_AUTOGRAPH = 558, + SPELL_JAINAS_AUTOGRAPH = 23122 +}; + +#define GOSSIP_ITEM_JAINA "I know this is rather silly but i have a young ward who is a bit shy and would like your autograph." + +bool GossipHello_npc_lady_jaina_proudmoore(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->GetQuestStatus(QUEST_JAINAS_AUTOGRAPH) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_JAINA, GOSSIP_SENDER_MAIN, GOSSIP_SENDER_INFO); + + pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_lady_jaina_proudmoore(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_SENDER_INFO) + { + pPlayer->SEND_GOSSIP_MENU(7012, pCreature->GetGUID()); + pPlayer->CastSpell(pPlayer, SPELL_JAINAS_AUTOGRAPH, false); + } + return true; +} + +/*###### +## npc_nat_pagle +######*/ + +enum +{ + QUEST_NATS_MEASURING_TAPE = 8227 +}; + +bool GossipHello_npc_nat_pagle(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pCreature->isVendor() && pPlayer->GetQuestRewardStatus(QUEST_NATS_MEASURING_TAPE)) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); + pPlayer->SEND_GOSSIP_MENU(7640, pCreature->GetGUID()); + } + else + pPlayer->SEND_GOSSIP_MENU(7638, pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_nat_pagle(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_TRADE) + pPlayer->SEND_VENDORLIST(pCreature->GetGUID()); + + return true; +} + +/*###### +## npc_private_hendel +######*/ + +enum +{ + SAY_PROGRESS_1_TER = -1000411, + SAY_PROGRESS_2_HEN = -1000412, + SAY_PROGRESS_3_TER = -1000413, + SAY_PROGRESS_4_TER = -1000414, + EMOTE_SURRENDER = -1000415, + + QUEST_MISSING_DIPLO_PT16 = 1324, + FACTION_HOSTILE = 168, //guessed, may be different + + NPC_SENTRY = 5184, //helps hendel + NPC_JAINA = 4968, //appears once hendel gives up + NPC_TERVOSH = 4967 +}; + +//TODO: develop this further, end event not created +struct TRINITY_DLL_DECL npc_private_hendelAI : public ScriptedAI +{ + npc_private_hendelAI(Creature* pCreature) : ScriptedAI(pCreature) { } + + void Reset() + { + me->RestoreFaction(); + } + + void AttackedBy(Unit* pAttacker) + { + if (m_creature->getVictim()) + return; + + if (m_creature->IsFriendlyTo(pAttacker)) + return; + + AttackStart(pAttacker); + } + + void DamageTaken(Unit* pDoneBy, uint32 &uiDamage) + { + if (uiDamage > m_creature->GetHealth() || ((m_creature->GetHealth() - uiDamage)*100 / m_creature->GetMaxHealth() < 20)) + { + uiDamage = 0; + + if (Player* pPlayer = pDoneBy->GetCharmerOrOwnerPlayerOrPlayerItself()) + pPlayer->GroupEventHappens(QUEST_MISSING_DIPLO_PT16, m_creature); + + DoScriptText(EMOTE_SURRENDER, m_creature); + EnterEvadeMode(); + } + } +}; + +bool QuestAccept_npc_private_hendel(Player* pPlayer, Creature* pCreature, const Quest* pQuest) +{ + if (pQuest->GetQuestId() == QUEST_MISSING_DIPLO_PT16) + pCreature->setFaction(FACTION_HOSTILE); + + return true; +} + +CreatureAI* GetAI_npc_private_hendel(Creature* pCreature) +{ + return new npc_private_hendelAI(pCreature); +} + +/*###### +## +######*/ + +void AddSC_dustwallow_marsh() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="mobs_risen_husk_spirit"; + newscript->GetAI = &GetAI_mobs_risen_husk_spirit; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_restless_apparition"; + newscript->pGossipHello = &GossipHello_npc_restless_apparition; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_deserter_agitator"; + newscript->GetAI = &GetAI_npc_deserter_agitator; + newscript->pGossipHello = &GossipHello_npc_deserter_agitator; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_lady_jaina_proudmoore"; + newscript->pGossipHello = &GossipHello_npc_lady_jaina_proudmoore; + newscript->pGossipSelect = &GossipSelect_npc_lady_jaina_proudmoore; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_nat_pagle"; + newscript->pGossipHello = &GossipHello_npc_nat_pagle; + newscript->pGossipSelect = &GossipSelect_npc_nat_pagle; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_private_hendel"; + newscript->GetAI = &GetAI_npc_private_hendel; + newscript->pQuestAccept = &QuestAccept_npc_private_hendel; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/felwood.cpp b/src/bindings/scripts/scripts/kalimdor/felwood.cpp new file mode 100644 index 00000000000..29c25afd821 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/felwood.cpp @@ -0,0 +1,90 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Felwood +SD%Complete: 95 +SDComment: Quest support: 4101, 4102 +SDCategory: Felwood +EndScriptData */ + +/* ContentData +npcs_riverbreeze_and_silversky +EndContentData */ + +#include "precompiled.h" + +/*###### +## npcs_riverbreeze_and_silversky +######*/ + +#define GOSSIP_ITEM_BEACON "Please make me a Cenarion Beacon" + +bool GossipHello_npcs_riverbreeze_and_silversky(Player* pPlayer, Creature* pCreature) +{ + uint32 eCreature = pCreature->GetEntry(); + + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (eCreature==9528) + { + if (pPlayer->GetQuestRewardStatus(4101)) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BEACON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + pPlayer->SEND_GOSSIP_MENU(2848, pCreature->GetGUID()); + }else if (pPlayer->GetTeam()==HORDE) + pPlayer->SEND_GOSSIP_MENU(2845, pCreature->GetGUID()); + else + pPlayer->SEND_GOSSIP_MENU(2844, pCreature->GetGUID()); + } + + if (eCreature==9529) + { + if (pPlayer->GetQuestRewardStatus(4102)) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BEACON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + pPlayer->SEND_GOSSIP_MENU(2849, pCreature->GetGUID()); + }else if (pPlayer->GetTeam() == ALLIANCE) + pPlayer->SEND_GOSSIP_MENU(2843, pCreature->GetGUID()); + else + pPlayer->SEND_GOSSIP_MENU(2842, pCreature->GetGUID()); + } + + return true; +} + +bool GossipSelect_npcs_riverbreeze_and_silversky(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction ==GOSSIP_ACTION_INFO_DEF+1) + { + pPlayer->CLOSE_GOSSIP_MENU(); + pCreature->CastSpell(pPlayer, 15120, false); + } + return true; +} + +void AddSC_felwood() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="npcs_riverbreeze_and_silversky"; + newscript->pGossipHello = &GossipHello_npcs_riverbreeze_and_silversky; + newscript->pGossipSelect = &GossipSelect_npcs_riverbreeze_and_silversky; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/feralas.cpp b/src/bindings/scripts/scripts/kalimdor/feralas.cpp new file mode 100644 index 00000000000..83c9516d738 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/feralas.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 +SDName: Feralas +SD%Complete: 100 +SDComment: Quest support: 3520, 2767, Special vendor Gregan Brewspewer +SDCategory: Feralas +EndScriptData */ + +#include "precompiled.h" +#include "../../npc/npc_escortAI.h" + +/*###### +## npc_gregan_brewspewer +######*/ + +#define GOSSIP_HELLO "Buy somethin', will ya?" + +bool GossipHello_npc_gregan_brewspewer(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pCreature->isVendor() && pPlayer->GetQuestStatus(3909) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + pPlayer->SEND_GOSSIP_MENU(2433, pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_gregan_brewspewer(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); + pPlayer->SEND_GOSSIP_MENU(2434, pCreature->GetGUID()); + } + if (uiAction == GOSSIP_ACTION_TRADE) + pPlayer->SEND_VENDORLIST(pCreature->GetGUID()); + return true; +} + +/*###### +## npc_oox22fe +######*/ + +enum +{ + SAY_START = -1060000, + SAY_AGGRO = -1060001, + SAY_AGGRO2 = -1060002, + SAY_AMBUSH = -1060003, + SAY_END = -1060005, + + NPC_YETI = 7848, + NPC_GORILLA = 5260, + NPC_WOODPAW_REAVER = 5255, + NPC_WOODPAW_BRUTE = 5253, + NPC_WOODPAW_ALPHA = 5258, + NPC_WOODPAW_MYSTIC = 5254, + + QUEST_RESCUE_OOX22FE = 2767, + FACTION_ESCORTEE_A = 774, + FACTION_ESCORTEE_H = 775 +}; + +struct TRINITY_DLL_DECL npc_oox22feAI : public npc_escortAI +{ + npc_oox22feAI(Creature* pCreature) : npc_escortAI(pCreature) { } + + void WaypointReached(uint32 i) + { + switch (i) + { + // First Ambush(3 Yetis) + case 11: + DoScriptText(SAY_AMBUSH,m_creature); + m_creature->SummonCreature(NPC_YETI, -4841.01, 1593.91, 73.42, 3.98, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); + m_creature->SummonCreature(NPC_YETI, -4837.61, 1568.58, 78.21, 3.13, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); + m_creature->SummonCreature(NPC_YETI, -4841.89, 1569.95, 76.53, 0.68, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); + break; + //Second Ambush(3 Gorillas) + case 21: + DoScriptText(SAY_AMBUSH,m_creature); + m_creature->SummonCreature(NPC_GORILLA, -4595.81, 2005.99, 53.08, 3.74, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); + m_creature->SummonCreature(NPC_GORILLA, -4597.53, 2008.31, 52.70, 3.78, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); + m_creature->SummonCreature(NPC_GORILLA, -4599.37, 2010.59, 52.77, 3.84, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); + break; + //Third Ambush(4 Gnolls) + case 30: + DoScriptText(SAY_AMBUSH,m_creature); + m_creature->SummonCreature(NPC_WOODPAW_REAVER, -4425.14, 2075.87, 47.77, 3.77, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); + m_creature->SummonCreature(NPC_WOODPAW_BRUTE , -4426.68, 2077.98, 47.57, 3.77, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); + m_creature->SummonCreature(NPC_WOODPAW_MYSTIC, -4428.33, 2080.24, 47.43, 3.87, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); + m_creature->SummonCreature(NPC_WOODPAW_ALPHA , -4430.04, 2075.54, 46.83, 3.81, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); + break; + case 37: + DoScriptText(SAY_END,m_creature); + // Award quest credit + if (Player* pPlayer = Unit::GetPlayer(PlayerGUID)) + { + pPlayer->GroupEventHappens(QUEST_RESCUE_OOX22FE, m_creature); + } + break; + } + } + + void Reset() + { + if (!IsBeingEscorted) + m_creature->SetStandState(UNIT_STAND_STATE_DEAD); + } + + void EnterCombat(Unit* who) + { + //For an small probability the npc says something when he get aggro + switch(rand()%10) + { + case 0: DoScriptText(SAY_AGGRO,m_creature); break; + case 1: DoScriptText(SAY_AGGRO2,m_creature); break; + } + } + + void JustSummoned(Creature* summoned) + { + summoned->AI()->AttackStart(m_creature); + } +}; + +CreatureAI* GetAI_npc_oox22fe(Creature* pCreature) +{ + npc_oox22feAI* oox22AI = new npc_oox22feAI(pCreature); + + oox22AI->FillPointMovementListForCreature(); + + return oox22AI; +} + +bool QuestAccept_npc_oox22fe(Player* pPlayer, Creature* pCreature, const Quest* pQuest) +{ + if (pQuest->GetQuestId() == QUEST_RESCUE_OOX22FE) + { + DoScriptText(SAY_START, pCreature); + //change that the npc is not lying dead on the ground + pCreature->SetStandState(UNIT_STAND_STATE_STAND); + + if (pPlayer->GetTeam() == ALLIANCE) + pCreature->setFaction(FACTION_ESCORTEE_A); + + if (pPlayer->GetTeam() == HORDE) + pCreature->setFaction(FACTION_ESCORTEE_H); + + if (npc_escortAI* pEscortAI = CAST_AI(npc_oox22feAI, pCreature->AI())) + pEscortAI->Start(true, false, pPlayer->GetGUID()); + + } + return true; +} + +/*###### +## npc_screecher_spirit +######*/ + +bool GossipHello_npc_screecher_spirit(Player* pPlayer, Creature* pCreature) +{ + pPlayer->SEND_GOSSIP_MENU(2039, pCreature->GetGUID()); + pPlayer->TalkedToCreature(pCreature->GetEntry(), pCreature->GetGUID()); + pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + + return true; +} + +/*###### +## AddSC +######*/ + +void AddSC_feralas() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="npc_gregan_brewspewer"; + newscript->pGossipHello = &GossipHello_npc_gregan_brewspewer; + newscript->pGossipSelect = &GossipSelect_npc_gregan_brewspewer; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_oox22fe"; + newscript->GetAI = &GetAI_npc_oox22fe; + newscript->pQuestAccept = &QuestAccept_npc_oox22fe; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_screecher_spirit"; + newscript->pGossipHello = &GossipHello_npc_screecher_spirit; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/moonglade.cpp b/src/bindings/scripts/scripts/kalimdor/moonglade.cpp new file mode 100644 index 00000000000..b31047cccd2 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/moonglade.cpp @@ -0,0 +1,570 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Moonglade +SD%Complete: 100 +SDComment: Quest support: 30, 272, 5929, 5930, 10965. Special Flight Paths for Druid class. +SDCategory: Moonglade +EndScriptData */ + +/* ContentData +npc_bunthen_plainswind +npc_great_bear_spirit +npc_silva_filnaveth +npc_clintar_spirit +npc_clintar_dreamwalker +EndContentData */ + +#include "precompiled.h" +#include "../../npc/npc_escortAI.h" + +/*###### +## npc_bunthen_plainswind +######*/ + +enum +{ + QUEST_SEA_LION_HORDE = 30, + QUEST_SEA_LION_ALLY = 272, + TAXI_PATH_ID_ALLY = 315, + TAXI_PATH_ID_HORDE = 316 +}; + +#define GOSSIP_ITEM_THUNDER "I'd like to fly to Thunder Bluff." +#define GOSSIP_ITEM_AQ_END "Do you know where I can find Half Pendant of Aquatic Endurance?" + +bool GossipHello_npc_bunthen_plainswind(Player* pPlayer, Creature* pCreature) +{ + if (pPlayer->getClass() != CLASS_DRUID) + pPlayer->SEND_GOSSIP_MENU(4916, pCreature->GetGUID()); + else if (pPlayer->GetTeam() != HORDE) + { + if (pPlayer->GetQuestStatus(QUEST_SEA_LION_ALLY) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_AQ_END, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + + pPlayer->SEND_GOSSIP_MENU(4917, pCreature->GetGUID()); + } + else if (pPlayer->getClass() == CLASS_DRUID && pPlayer->GetTeam() == HORDE) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_THUNDER, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + + if (pPlayer->GetQuestStatus(QUEST_SEA_LION_HORDE) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_AQ_END, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + + pPlayer->SEND_GOSSIP_MENU(4918, pCreature->GetGUID()); + } + return true; +} + +bool GossipSelect_npc_bunthen_plainswind(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch(uiAction) + { + case GOSSIP_ACTION_INFO_DEF + 1: + pPlayer->CLOSE_GOSSIP_MENU(); + if (pPlayer->getClass() == CLASS_DRUID && pPlayer->GetTeam() == HORDE) + pPlayer->ActivateTaxiPathTo(TAXI_PATH_ID_HORDE); + break; + case GOSSIP_ACTION_INFO_DEF + 2: + pPlayer->SEND_GOSSIP_MENU(5373, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF + 3: + pPlayer->SEND_GOSSIP_MENU(5376, pCreature->GetGUID()); + break; + } + return true; +} + +/*###### +## npc_great_bear_spirit +######*/ + +#define GOSSIP_BEAR1 "What do you represent, spirit?" +#define GOSSIP_BEAR2 "I seek to understand the importance of strength of the body." +#define GOSSIP_BEAR3 "I seek to understand the importance of strength of the heart." +#define GOSSIP_BEAR4 "I have heard your words, Great Bear Spirit, and I understand. I now seek your blessings to fully learn the way of the Claw." + +bool GossipHello_npc_great_bear_spirit(Player* pPlayer, Creature* pCreature) +{ + //ally or horde quest + if (pPlayer->GetQuestStatus(5929) == QUEST_STATUS_INCOMPLETE || pPlayer->GetQuestStatus(5930) == QUEST_STATUS_INCOMPLETE) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BEAR1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + pPlayer->SEND_GOSSIP_MENU(4719, pCreature->GetGUID()); + } + else + pPlayer->SEND_GOSSIP_MENU(4718, pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_great_bear_spirit(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch (uiAction) + { + case GOSSIP_ACTION_INFO_DEF: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BEAR2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + pPlayer->SEND_GOSSIP_MENU(4721, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF + 1: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BEAR3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + pPlayer->SEND_GOSSIP_MENU(4733, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF + 2: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BEAR4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + pPlayer->SEND_GOSSIP_MENU(4734, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF + 3: + pPlayer->SEND_GOSSIP_MENU(4735, pCreature->GetGUID()); + if (pPlayer->GetQuestStatus(5929)==QUEST_STATUS_INCOMPLETE) + pPlayer->AreaExploredOrEventHappens(5929); + if (pPlayer->GetQuestStatus(5930)==QUEST_STATUS_INCOMPLETE) + pPlayer->AreaExploredOrEventHappens(5930); + break; + } + return true; +} + +/*###### +## npc_silva_filnaveth +######*/ + +#define GOSSIP_ITEM_RUTHERAN "I'd like to fly to Rut'theran Village." +#define GOSSIP_ITEM_AQ_AGI "Do you know where I can find Half Pendant of Aquatic Agility?" + +bool GossipHello_npc_silva_filnaveth(Player* pPlayer, Creature* pCreature) +{ + if (pPlayer->getClass() != CLASS_DRUID) + pPlayer->SEND_GOSSIP_MENU(4913, pCreature->GetGUID()); + else if (pPlayer->GetTeam() != ALLIANCE) + { + if (pPlayer->GetQuestStatus(QUEST_SEA_LION_HORDE) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_AQ_AGI, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + + pPlayer->SEND_GOSSIP_MENU(4915, pCreature->GetGUID()); + } + else if (pPlayer->getClass() == CLASS_DRUID && pPlayer->GetTeam() == ALLIANCE) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_RUTHERAN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + + if (pPlayer->GetQuestStatus(QUEST_SEA_LION_ALLY) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_AQ_AGI, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + + pPlayer->SEND_GOSSIP_MENU(4914, pCreature->GetGUID()); + } + return true; +} + +bool GossipSelect_npc_silva_filnaveth(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch(uiAction) + { + case GOSSIP_ACTION_INFO_DEF + 1: + pPlayer->CLOSE_GOSSIP_MENU(); + if (pPlayer->getClass() == CLASS_DRUID && pPlayer->GetTeam() == ALLIANCE) + pPlayer->ActivateTaxiPathTo(TAXI_PATH_ID_ALLY); + break; + case GOSSIP_ACTION_INFO_DEF + 2: + pPlayer->SEND_GOSSIP_MENU(5374, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF + 3: + pPlayer->SEND_GOSSIP_MENU(5375, pCreature->GetGUID()); + break; + } + return true; +} + +/*###### +## npc_clintar_spirit +######*/ + +float Clintar_spirit_WP[41][5] = +{ + //pos_x pos_y pos_z orien waitTime +{7465.28, -3115.46, 439.327, 0.83, 4000}, +{7476.49, -3101, 443.457, 0.89, 0}, +{7486.57, -3085.59, 439.478, 1.07, 0}, +{7472.19, -3085.06, 443.142, 3.07, 0}, +{7456.92, -3085.91, 438.862, 3.24, 0}, +{7446.68, -3083.43, 438.245, 2.40, 0}, +{7446.17, -3080.21, 439.826, 1.10, 6000}, +{7452.41, -3085.8, 438.984, 5.78, 0}, +{7469.11, -3084.94, 443.048, 6.25, 0}, +{7483.79, -3085.44, 439.607, 6.25, 0}, +{7491.14, -3090.96, 439.983, 5.44, 0}, +{7497.62, -3098.22, 436.854, 5.44, 0}, +{7498.72, -3113.41, 434.596, 4.84, 0}, +{7500.06, -3122.51, 434.749, 5.17, 0}, +{7504.96, -3131.53, 434.475, 4.74, 0}, +{7504.31, -3133.53, 435.693, 3.84, 6000}, +{7504.55, -3133.27, 435.476, 0.68, 15000}, +{7501.99, -3126.01, 434.93, 1.83, 0}, +{7490.76, -3114.97, 434.431, 2.51, 0}, +{7479.64, -3105.51, 431.123, 1.83, 0}, +{7474.63, -3086.59, 428.994, 1.83, 2000}, +{7472.96, -3074.18, 427.566, 1.57, 0}, +{7472.25, -3063, 428.268, 1.55, 0}, +{7473.46, -3054.22, 427.588, 0.36, 0}, +{7475.08, -3053.6, 428.653, 0.36, 6000}, +{7474.66, -3053.56, 428.433, 3.19, 4000}, +{7471.81, -3058.84, 427.073, 4.29, 0}, +{7472.16, -3064.91, 427.772, 4.95, 0}, +{7471.56, -3085.36, 428.924, 4.72, 0}, +{7473.56, -3093.48, 429.294, 5.04, 0}, +{7478.94, -3104.29, 430.638, 5.23, 0}, +{7484.46, -3109.61, 432.769, 5.79, 0}, +{7490.23, -3111.08, 434.431, 0.02, 0}, +{7496.29, -3108, 434.783, 1.15, 0}, +{7497.46, -3100.66, 436.191, 1.50, 0}, +{7495.64, -3093.39, 438.349, 2.10, 0}, +{7492.44, -3086.01, 440.267, 1.38, 0}, +{7498.26, -3076.44, 440.808, 0.71, 0}, +{7506.4, -3067.35, 443.64, 0.77, 0}, +{7518.37, -3057.42, 445.584, 0.74, 0}, +{7517.51, -3056.3, 444.568, 2.49, 4500} +}; + +#define ASPECT_RAVEN 22915 + +#define ASPECT_RAVEN_SUMMON_X 7472.96 +#define ASPECT_RAVEN_SUMMON_Y -3074.18 +#define ASPECT_RAVEN_SUMMON_Z 427.566 +#define CLINTAR_SPIRIT_SUMMON_X 7459.2275 +#define CLINTAR_SPIRIT_SUMMON_Y -3122.5632 +#define CLINTAR_SPIRIT_SUMMON_Z 438.9842 +#define CLINTAR_SPIRIT_SUMMON_O 0.8594 + +#define CLINTAR_SPIRIT_SAY_START -1000286 +#define CLINTAR_SPIRIT_SAY_UNDER_ATTACK_1 -1000287 +#define CLINTAR_SPIRIT_SAY_UNDER_ATTACK_2 -1000288 +#define CLINTAR_SPIRIT_SAY_GET_ONE -1000289 +#define CLINTAR_SPIRIT_SAY_GET_TWO -1000290 +#define CLINTAR_SPIRIT_SAY_GET_THREE -1000291 +#define CLINTAR_SPIRIT_SAY_GET_FINAL -1000292 + +struct TRINITY_DLL_DECL npc_clintar_spiritAI : public npc_escortAI +{ +public: + npc_clintar_spiritAI(Creature *c) : npc_escortAI(c) {} + + uint32 Step; + uint32 CurrWP; + uint32 Event_Timer; + uint32 checkPlayer_Timer; + + uint64 PlayerGUID; + + bool Event_onWait; + + void Reset() + { + if (!PlayerGUID) + { + Step = 0; + CurrWP = 0; + Event_Timer = 0; + PlayerGUID = 0; + checkPlayer_Timer = 1000; + Event_onWait = false; + } + } + + void JustDied(Unit *killer) + { + if (!PlayerGUID) + return; + + Player* pPlayer = Unit::GetPlayer(PlayerGUID); + if (pPlayer && pPlayer->GetQuestStatus(10965) == QUEST_STATUS_INCOMPLETE) + { + pPlayer->FailQuest(10965); + PlayerGUID = 0; + Reset(); + } + } + + void EnterEvadeMode() + { + Player* pPlayer = Unit::GetPlayer(PlayerGUID); + if (pPlayer && pPlayer->isInCombat() && pPlayer->getAttackerForHelper()) + { + AttackStart(pPlayer->getAttackerForHelper()); + return; + } + npc_escortAI::EnterEvadeMode(); + } + + void EnterCombat(Unit* who) + { + uint32 rnd = rand()%2; + switch(rnd) + { + case 0: DoScriptText(CLINTAR_SPIRIT_SAY_UNDER_ATTACK_1, m_creature, who); break; + case 1: DoScriptText(CLINTAR_SPIRIT_SAY_UNDER_ATTACK_2, m_creature, who); break; + } + } + + void StartEvent(Player* pPlayer) + { + if (!pPlayer) + return; + if (pPlayer->GetQuestStatus(10965) == QUEST_STATUS_INCOMPLETE) + { + for(uint8 i = 0; i < 41; ++i) + { + AddWaypoint(i, Clintar_spirit_WP[i][0], Clintar_spirit_WP[i][1], Clintar_spirit_WP[i][2], (uint32)Clintar_spirit_WP[i][4]); + } + PlayerGUID = pPlayer->GetGUID(); + Start(true,false,PlayerGUID); + } + return; + } + + void UpdateAI(const uint32 diff) + { + npc_escortAI::UpdateAI(diff); + + if (!PlayerGUID) + { + m_creature->setDeathState(JUST_DIED); + return; + } + + if (!m_creature->isInCombat() && !Event_onWait) + { + if (checkPlayer_Timer < diff) + { + Player* pPlayer = Unit::GetPlayer(PlayerGUID); + if (pPlayer && pPlayer->isInCombat() && pPlayer->getAttackerForHelper()) + AttackStart(pPlayer->getAttackerForHelper()); + checkPlayer_Timer = 1000; + }else checkPlayer_Timer -= diff; + } + + if (Event_onWait && Event_Timer < diff) + { + + Player* pPlayer = Unit::GetPlayer(PlayerGUID); + if (!pPlayer || (pPlayer && pPlayer->GetQuestStatus(10965) == QUEST_STATUS_NONE)) + { + m_creature->setDeathState(JUST_DIED); + return; + } + + switch(CurrWP) + { + case 0: + switch(Step) + { + case 0: + m_creature->Say(CLINTAR_SPIRIT_SAY_START,0,PlayerGUID); + Event_Timer = 8000; + Step = 1; + break; + case 1: + Event_onWait = false; + break; + } + break; + case 6: + switch(Step) + { + case 0: + m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, 133); + Event_Timer = 5000; + Step = 1; + break; + case 1: + m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0); + DoScriptText(CLINTAR_SPIRIT_SAY_GET_ONE, m_creature, pPlayer); + Event_onWait = false; + break; + } + break; + case 15: + switch(Step) + { + case 0: + m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, 133); + Event_Timer = 5000; + Step = 1; + break; + case 1: + m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0); + Event_onWait = false; + break; + } + break; + case 16: + switch(Step) + { + case 0: + DoScriptText(CLINTAR_SPIRIT_SAY_GET_TWO, m_creature, pPlayer); + Event_Timer = 15000; + Step = 1; + break; + case 1: + Event_onWait = false; + break; + } + break; + case 20: + switch(Step) + { + case 0: + { + Creature *mob = m_creature->SummonCreature(ASPECT_RAVEN, ASPECT_RAVEN_SUMMON_X, ASPECT_RAVEN_SUMMON_Y, ASPECT_RAVEN_SUMMON_Z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 2000); + if (mob) + { + mob->AddThreat(m_creature,10000.0f); + mob->AI()->AttackStart(m_creature); + } + Event_Timer = 2000; + Step = 1; + break; + } + case 1: + Event_onWait = false; + break; + } + break; + case 24: + switch(Step) + { + case 0: + m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, 133); + Event_Timer = 5000; + Step = 1; + break; + case 1: + m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0); + Event_onWait = false; + break; + } + break; + case 25: + switch(Step) + { + case 0: + DoScriptText(CLINTAR_SPIRIT_SAY_GET_THREE, m_creature, pPlayer); + Event_Timer = 4000; + Step = 1; + break; + case 1: + Event_onWait = false; + break; + } + break; + case 40: + switch(Step) + { + case 0: + m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, 2); + DoScriptText(CLINTAR_SPIRIT_SAY_GET_FINAL, m_creature, pPlayer); + pPlayer->CompleteQuest(10965); + Event_Timer = 1500; + Step = 1; + break; + case 1: + m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0); + Event_Timer = 3000; + Step = 2; + break; + case 2: + pPlayer->TalkedToCreature(m_creature->GetEntry(), m_creature->GetGUID()); + PlayerGUID = 0; + Reset(); + m_creature->setDeathState(JUST_DIED); + break; + } + break; + default: + Event_onWait = false; + break; + } + + } else if (Event_onWait) Event_Timer -= diff; + } + + void WaypointReached(uint32 id) + { + CurrWP = id; + Event_Timer = 0; + Step = 0; + Event_onWait = true; + } +}; + +CreatureAI* GetAI_npc_clintar_spirit(Creature* pCreature) +{ + return new npc_clintar_spiritAI (pCreature); +} + +/*#### +# npc_clintar_dreamwalker +####*/ + +#define CLINTAR_SPIRIT 22916 + +bool QuestAccept_npc_clintar_dreamwalker(Player* pPlayer, Creature* pCreature, Quest const *quest) +{ + if (quest->GetQuestId() == 10965) + { + Creature *clintar_spirit = pCreature->SummonCreature(CLINTAR_SPIRIT, CLINTAR_SPIRIT_SUMMON_X, CLINTAR_SPIRIT_SUMMON_Y, CLINTAR_SPIRIT_SUMMON_Z, CLINTAR_SPIRIT_SUMMON_O, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 100000); + if (clintar_spirit) + CAST_AI(npc_clintar_spiritAI, clintar_spirit->AI())->StartEvent(pPlayer); + } + return true; +} + +/*#### +# +####*/ + +void AddSC_moonglade() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="npc_bunthen_plainswind"; + newscript->pGossipHello = &GossipHello_npc_bunthen_plainswind; + newscript->pGossipSelect = &GossipSelect_npc_bunthen_plainswind; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_great_bear_spirit"; + newscript->pGossipHello = &GossipHello_npc_great_bear_spirit; + newscript->pGossipSelect = &GossipSelect_npc_great_bear_spirit; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_silva_filnaveth"; + newscript->pGossipHello = &GossipHello_npc_silva_filnaveth; + newscript->pGossipSelect = &GossipSelect_npc_silva_filnaveth; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_clintar_dreamwalker"; + newscript->pQuestAccept = &QuestAccept_npc_clintar_dreamwalker; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_clintar_spirit"; + newscript->GetAI = &GetAI_npc_clintar_spirit; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/mulgore.cpp b/src/bindings/scripts/scripts/kalimdor/mulgore.cpp new file mode 100644 index 00000000000..b1e17fc8ea5 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/mulgore.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: Mulgore +SD%Complete: 100 +SDComment: Support for quest: 11129, 772 +SDCategory: Mulgore +EndScriptData */ + +/* ContentData +npc_skorn_whitecloud +npc_kyle_frenzied +npc_plains_vision +EndContentData */ + +#include "precompiled.h" +#include "../../npc/npc_escortAI.h" + +/*###### +# npc_skorn_whitecloud +######*/ + +#define GOSSIP_SW "Tell me a story, Skorn." + +bool GossipHello_npc_skorn_whitecloud(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (!pPlayer->GetQuestRewardStatus(770)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SW, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + + pPlayer->SEND_GOSSIP_MENU(522, pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_skorn_whitecloud(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF) + pPlayer->SEND_GOSSIP_MENU(523, pCreature->GetGUID()); + + return true; +} + +/*##### +# npc_kyle_frenzied +######*/ + +enum +{ + EMOTE_SEE_LUNCH = -1000407, + EMOTE_EAT_LUNCH = -1000408, + EMOTE_DANCE = -1000409, + + SPELL_LUNCH = 42222, + NPC_KYLE_FRENZIED = 23616, + NPC_KYLE_FRIENDLY = 23622, + POINT_ID = 1 +}; + +struct TRINITY_DLL_DECL npc_kyle_frenziedAI : public ScriptedAI +{ + npc_kyle_frenziedAI(Creature *c) : ScriptedAI(c) {} + + bool bEvent; + bool m_bIsMovingToLunch; + uint64 uiPlayerGUID; + uint32 uiEventTimer; + uint8 uiEventPhase; + + void Reset() + { + bEvent = false; + m_bIsMovingToLunch = false; + uiPlayerGUID = 0; + uiEventTimer = 5000; + uiEventPhase = 0; + + if (m_creature->GetEntry() == NPC_KYLE_FRIENDLY) + m_creature->UpdateEntry(NPC_KYLE_FRENZIED); + } + + void SpellHit(Unit* pCaster, SpellEntry const* pSpell) + { + if (!m_creature->getVictim() && !bEvent && pSpell->Id == SPELL_LUNCH) + { + if (pCaster->GetTypeId() == TYPEID_PLAYER) + uiPlayerGUID = pCaster->GetGUID(); + + if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == WAYPOINT_MOTION_TYPE) + { + m_creature->GetMotionMaster()->MovementExpired(); + m_creature->GetMotionMaster()->MoveIdle(); + m_creature->StopMoving(); + } + + bEvent = true; + DoScriptText(EMOTE_SEE_LUNCH, m_creature); + m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_CREATURE_SPECIAL); + } + } + + void MovementInform(uint32 uiType, uint32 uiPointId) + { + if (uiType != POINT_MOTION_TYPE || !bEvent) + return; + + if (uiPointId == POINT_ID) + m_bIsMovingToLunch = false; + } + + void UpdateAI(const uint32 diff) + { + if (bEvent) + { + if (m_bIsMovingToLunch) + return; + + if (uiEventTimer < diff) + { + uiEventTimer = 5000; + ++uiEventPhase; + + switch(uiEventPhase) + { + case 1: + if (Unit* pUnit = Unit::GetUnit(*m_creature,uiPlayerGUID)) + { + if (GameObject* pGo = pUnit->GetGameObject(SPELL_LUNCH)) + { + m_bIsMovingToLunch = true; + m_creature->GetMotionMaster()->MovePoint(POINT_ID, pGo->GetPositionX(), pGo->GetPositionY(), pGo->GetPositionZ()); + } + } + break; + case 2: + DoScriptText(EMOTE_EAT_LUNCH, m_creature); + m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_USESTANDING); + break; + case 3: + if (Player* pUnit = Unit::GetPlayer(uiPlayerGUID)) + pUnit->TalkedToCreature(m_creature->GetEntry(), m_creature->GetGUID()); + + m_creature->UpdateEntry(NPC_KYLE_FRIENDLY); + break; + case 4: + uiEventTimer = 30000; + DoScriptText(EMOTE_DANCE, m_creature); + m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_DANCESPECIAL); + break; + case 5: + m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_NONE); + Reset(); + m_creature->GetMotionMaster()->Clear(); + break; + } + } + else + uiEventTimer -= diff; + } + } +}; + +CreatureAI* GetAI_npc_kyle_frenzied(Creature* pCreature) +{ + return new npc_kyle_frenziedAI (pCreature); +} + +/*##### +# npc_plains_vision +######*/ + +float wp_plain_vision[50][3] = +{ + {-2226.32, -408.095, -9.36235}, + {-2203.04, -437.212, -5.72498}, + {-2163.91, -457.851, -7.09049}, + {-2123.87, -448.137, -9.29591}, + {-2104.66, -427.166, -6.49513}, + {-2101.48, -422.826, -5.3567}, + {-2097.56, -417.083, -7.16716}, + {-2084.87, -398.626, -9.88973}, + {-2072.71, -382.324, -10.2488}, + {-2054.05, -356.728, -6.22468}, + {-2051.8, -353.645, -5.35791}, + {-2049.08, -349.912, -6.15723}, + {-2030.6, -310.724, -9.59302}, + {-2002.15, -249.308, -10.8124}, + {-1972.85, -195.811, -10.6316}, + {-1940.93, -147.652, -11.7055}, + {-1888.06, -81.943, -11.4404}, + {-1837.05, -34.0109, -12.258}, + {-1796.12, -14.6462, -10.3581}, + {-1732.61, -4.27746, -10.0213}, + {-1688.94, -0.829945, -11.7103}, + {-1681.32, 13.0313, -9.48056}, + {-1677.04, 36.8349, -7.10318}, + {-1675.2, 68.559, -8.95384}, + {-1676.57, 89.023, -9.65104}, + {-1678.16, 110.939, -10.1782}, + {-1677.86, 128.681, -5.73869}, + {-1675.27, 144.324, -3.47916}, + {-1671.7, 163.169, -1.23098}, + {-1666.61, 181.584, 5.26145}, + {-1661.51, 196.154, 8.95252}, + {-1655.47, 210.811, 8.38727}, + {-1647.07, 226.947, 5.27755}, + {-1621.65, 232.91, 2.69579}, + {-1600.23, 237.641, 2.98539}, + {-1576.07, 242.546, 4.66541}, + {-1554.57, 248.494, 6.60377}, + {-1547.53, 259.302, 10.6741}, + {-1541.7, 269.847, 16.4418}, + {-1539.83, 278.989, 21.0597}, + {-1540.16, 290.219, 27.8247}, + {-1538.99, 298.983, 34.0032}, + {-1540.38, 307.337, 41.3557}, + {-1536.61, 314.884, 48.0179}, + {-1532.42, 323.277, 55.6667}, + {-1528.77, 329.774, 61.1525}, + {-1525.65, 333.18, 63.2161}, + {-1517.01, 350.713, 62.4286}, + {-1511.39, 362.537, 62.4539}, + {-1508.68, 366.822, 62.733} +}; + +struct TRINITY_DLL_DECL npc_plains_visionAI : public ScriptedAI +{ + npc_plains_visionAI(Creature *c) : ScriptedAI(c) {} + + bool newWaypoint; + uint8 WayPointId; + uint8 amountWP; + + void Reset() + { + WayPointId = 0; + newWaypoint = true; + amountWP = 49; + } + + void EnterCombat(Unit* who){} + + void MovementInform(uint32 type, uint32 id) + { + if (type != POINT_MOTION_TYPE) + return; + + if (id < amountWP) + { + ++WayPointId; + newWaypoint = true; + } + else + { + m_creature->setDeathState(JUST_DIED); + m_creature->RemoveCorpse(); + } + } + + void UpdateAI(const uint32 diff) + { + if (newWaypoint) + { + m_creature->GetMotionMaster()->MovePoint(WayPointId, wp_plain_vision[WayPointId][0], wp_plain_vision[WayPointId][1], wp_plain_vision[WayPointId][2]); + newWaypoint = false; + } + } +}; + +CreatureAI* GetAI_npc_plains_vision(Creature* pCreature) +{ + return new npc_plains_visionAI (pCreature); +} + +/*##### +# +######*/ + +void AddSC_mulgore() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="npc_skorn_whitecloud"; + newscript->pGossipHello = &GossipHello_npc_skorn_whitecloud; + newscript->pGossipSelect = &GossipSelect_npc_skorn_whitecloud; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_kyle_frenzied"; + newscript->GetAI = &GetAI_npc_kyle_frenzied; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_plains_vision"; + newscript->GetAI = &GetAI_npc_plains_vision; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/orgrimmar.cpp b/src/bindings/scripts/scripts/kalimdor/orgrimmar.cpp new file mode 100644 index 00000000000..aa0ddef0581 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/orgrimmar.cpp @@ -0,0 +1,286 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Orgrimmar +SD%Complete: 100 +SDComment: Quest support: 2460, 5727, 6566 +SDCategory: Orgrimmar +EndScriptData */ + +/* ContentData +npc_neeru_fireblade npc_text + gossip options text missing +npc_shenthul +npc_thrall_warchief +EndContentData */ + +#include "precompiled.h" + +/*###### +## npc_neeru_fireblade +######*/ + +#define QUEST_5727 5727 + +#define GOSSIP_HNF "You may speak frankly, Neeru..." +#define GOSSIP_SNF "[PH] ..." +bool GossipHello_npc_neeru_fireblade(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->GetQuestStatus(QUEST_5727) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HNF, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + pPlayer->SEND_GOSSIP_MENU(4513, pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_neeru_fireblade(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch (uiAction) + { + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SNF, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + pPlayer->SEND_GOSSIP_MENU(4513, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->AreaExploredOrEventHappens(QUEST_5727); + break; + } + return true; +} + +/*###### +## npc_shenthul +######*/ + +enum +{ + QUEST_SHATTERED_SALUTE = 2460 +}; + +struct TRINITY_DLL_DECL npc_shenthulAI : public ScriptedAI +{ + npc_shenthulAI(Creature* c) : ScriptedAI(c) {} + + bool CanTalk; + bool CanEmote; + uint32 Salute_Timer; + uint32 Reset_Timer; + uint64 PlayerGUID; + + void Reset() + { + CanTalk = false; + CanEmote = false; + Salute_Timer = 6000; + Reset_Timer = 0; + PlayerGUID = 0; + } + + void EnterCombat(Unit* who) { } + + void UpdateAI(const uint32 diff) + { + if (CanEmote) + { + if (Reset_Timer < diff) + { + if (Player* pPlayer = Unit::GetPlayer(PlayerGUID)) + { + if (pPlayer->GetTypeId() == TYPEID_PLAYER && pPlayer->GetQuestStatus(QUEST_SHATTERED_SALUTE) == QUEST_STATUS_INCOMPLETE) + pPlayer->FailQuest(QUEST_SHATTERED_SALUTE); + } + Reset(); + } else Reset_Timer -= diff; + } + + if (CanTalk && !CanEmote) + { + if (Salute_Timer < diff) + { + m_creature->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE); + CanEmote = true; + Reset_Timer = 60000; + } else Salute_Timer -= diff; + } + + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + + void ReceiveEmote(Player* pPlayer, uint32 emote) + { + if (emote == TEXTEMOTE_SALUTE && pPlayer->GetQuestStatus(QUEST_SHATTERED_SALUTE) == QUEST_STATUS_INCOMPLETE) + { + if (CanEmote) + { + pPlayer->AreaExploredOrEventHappens(QUEST_SHATTERED_SALUTE); + Reset(); + } + } + } +}; + +CreatureAI* GetAI_npc_shenthul(Creature* pCreature) +{ + return new npc_shenthulAI (pCreature); +} + +bool QuestAccept_npc_shenthul(Player* pPlayer, Creature* pCreature, Quest const* quest) +{ + if (quest->GetQuestId() == QUEST_SHATTERED_SALUTE) + { + CAST_AI(npc_shenthulAI, pCreature->AI())->CanTalk = true; + CAST_AI(npc_shenthulAI, pCreature->AI())->PlayerGUID = pPlayer->GetGUID(); + } + return true; +} + +/*###### +## npc_thrall_warchief +######*/ + +#define QUEST_6566 6566 + +#define SPELL_CHAIN_LIGHTNING 16033 +#define SPELL_SHOCK 16034 + +#define GOSSIP_HTW "Please share your wisdom with me, Warchief." +#define GOSSIP_STW1 "What discoveries?" +#define GOSSIP_STW2 "Usurper?" +#define GOSSIP_STW3 "With all due respect, Warchief - why not allow them to be destroyed? Does this not strengthen our position?" +#define GOSSIP_STW4 "I... I did not think of it that way, Warchief." +#define GOSSIP_STW5 "I live only to serve, Warchief! My life is empty and meaningless without your guidance." +#define GOSSIP_STW6 "Of course, Warchief!" + +//TODO: verify abilities/timers +struct TRINITY_DLL_DECL npc_thrall_warchiefAI : public ScriptedAI +{ + npc_thrall_warchiefAI(Creature* c) : ScriptedAI(c) {} + + uint32 ChainLightning_Timer; + uint32 Shock_Timer; + + void Reset() + { + ChainLightning_Timer = 2000; + Shock_Timer = 8000; + } + + void EnterCombat(Unit *who) {} + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (ChainLightning_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_CHAIN_LIGHTNING); + ChainLightning_Timer = 9000; + }else ChainLightning_Timer -= diff; + + if (Shock_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_SHOCK); + Shock_Timer = 15000; + }else Shock_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_npc_thrall_warchief(Creature* pCreature) +{ + return new npc_thrall_warchiefAI (pCreature); +} + +bool GossipHello_npc_thrall_warchief(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->GetQuestStatus(QUEST_6566) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HTW, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_thrall_warchief(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch (uiAction) + { + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_STW1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + pPlayer->SEND_GOSSIP_MENU(5733, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_STW2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); + pPlayer->SEND_GOSSIP_MENU(5734, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+3: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_STW3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4); + pPlayer->SEND_GOSSIP_MENU(5735, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+4: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_STW4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5); + pPlayer->SEND_GOSSIP_MENU(5736, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+5: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_STW5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6); + pPlayer->SEND_GOSSIP_MENU(5737, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+6: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_STW6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+7); + pPlayer->SEND_GOSSIP_MENU(5738, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+7: + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->AreaExploredOrEventHappens(QUEST_6566); + break; + } + return true; +} + +void AddSC_orgrimmar() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="npc_neeru_fireblade"; + newscript->pGossipHello = &GossipHello_npc_neeru_fireblade; + newscript->pGossipSelect = &GossipSelect_npc_neeru_fireblade; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_shenthul"; + newscript->GetAI = &GetAI_npc_shenthul; + newscript->pQuestAccept = &QuestAccept_npc_shenthul; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_thrall_warchief"; + newscript->GetAI = &GetAI_npc_thrall_warchief; + newscript->pGossipHello = &GossipHello_npc_thrall_warchief; + newscript->pGossipSelect = &GossipSelect_npc_thrall_warchief; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/silithus.cpp b/src/bindings/scripts/scripts/kalimdor/silithus.cpp new file mode 100644 index 00000000000..fce271a351d --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/silithus.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: Silithus +SD%Complete: 100 +SDComment: Quest support: 7785, 8304. +SDCategory: Silithus +EndScriptData */ + +/* ContentData +npc_highlord_demitrian +npcs_rutgar_and_frankal +EndContentData */ + +#include "precompiled.h" + +/*### +## npc_highlord_demitrian +###*/ + +#define GOSSIP_DEMITRIAN1 "What do you know of it?" +#define GOSSIP_DEMITRIAN2 "I am listening , Demitrian." +#define GOSSIP_DEMITRIAN3 "Continue, please." +#define GOSSIP_DEMITRIAN4 "A battle?" +#define GOSSIP_DEMITRIAN5 "" +#define GOSSIP_DEMITRIAN6 "Caught unaware? How?" +#define GOSSIP_DEMITRIAN7 "So what did Ragnaros do next?" + +bool GossipHello_npc_highlord_demitrian(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->GetQuestStatus(7785) == QUEST_STATUS_NONE && + (pPlayer->HasItemCount(18563,1,false) || pPlayer->HasItemCount(18564,1,false))) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DEMITRIAN1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + + pPlayer->SEND_GOSSIP_MENU(6812, pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_highlord_demitrian(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch (uiAction) + { + case GOSSIP_ACTION_INFO_DEF: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DEMITRIAN2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + pPlayer->SEND_GOSSIP_MENU(6842, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DEMITRIAN3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + pPlayer->SEND_GOSSIP_MENU(6843, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DEMITRIAN4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); + pPlayer->SEND_GOSSIP_MENU(6844, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+3: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DEMITRIAN5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4); + pPlayer->SEND_GOSSIP_MENU(6867, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+4: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DEMITRIAN6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5); + pPlayer->SEND_GOSSIP_MENU(6868, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+5: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DEMITRIAN7, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6); + pPlayer->SEND_GOSSIP_MENU(6869, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+6: + pPlayer->SEND_GOSSIP_MENU(6870, pCreature->GetGUID()); + + ItemPosCountVec dest; + uint8 msg = pPlayer->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, 19016, 1); + if (msg == EQUIP_ERR_OK) + pPlayer->StoreNewItem(dest, 19016, true); + break; + } + return true; +} + +/*### +## npcs_rutgar_and_frankal +###*/ + +//gossip item text best guess +#define GOSSIP_ITEM1 "I seek information about Natalia" + +#define GOSSIP_ITEM2 "That sounds dangerous!" +#define GOSSIP_ITEM3 "What did you do?" +#define GOSSIP_ITEM4 "Who?" +#define GOSSIP_ITEM5 "Women do that. What did she demand?" +#define GOSSIP_ITEM6 "What do you mean?" +#define GOSSIP_ITEM7 "What happened next?" + +#define GOSSIP_ITEM11 "Yes, please continue" +#define GOSSIP_ITEM12 "What language?" +#define GOSSIP_ITEM13 "The Priestess attacked you?!" +#define GOSSIP_ITEM14 "I should ask the monkey about this" +#define GOSSIP_ITEM15 "Then what..." + +//trigger creatures to kill +#define TRIGGER_RUTGAR 15222 +#define TRIGGER_FRANKAL 15221 + +bool GossipHello_npcs_rutgar_and_frankal(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->GetQuestStatus(8304) == QUEST_STATUS_INCOMPLETE && + pCreature->GetEntry() == 15170 && + !pPlayer->GetReqKillOrCastCurrentCount(8304, TRIGGER_RUTGAR)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + + if (pPlayer->GetQuestStatus(8304) == QUEST_STATUS_INCOMPLETE && + pCreature->GetEntry() == 15171 && + pPlayer->GetReqKillOrCastCurrentCount(8304, TRIGGER_RUTGAR)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+9); + + pPlayer->SEND_GOSSIP_MENU(7754, pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npcs_rutgar_and_frankal(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch (uiAction) + { + case GOSSIP_ACTION_INFO_DEF: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + pPlayer->SEND_GOSSIP_MENU(7755, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF + 1: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + pPlayer->SEND_GOSSIP_MENU(7756, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF + 2: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + pPlayer->SEND_GOSSIP_MENU(7757, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF + 3: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4); + pPlayer->SEND_GOSSIP_MENU(7758, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF + 4: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5); + pPlayer->SEND_GOSSIP_MENU(7759, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF + 5: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM7, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6); + pPlayer->SEND_GOSSIP_MENU(7760, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF + 6: + pPlayer->SEND_GOSSIP_MENU(7761, pCreature->GetGUID()); + //'kill' our trigger to update quest status + pPlayer->KilledMonsterCredit(TRIGGER_RUTGAR, pCreature->GetGUID()); + break; + + case GOSSIP_ACTION_INFO_DEF + 9: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM11, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11); + pPlayer->SEND_GOSSIP_MENU(7762, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF + 10: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM12, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11); + pPlayer->SEND_GOSSIP_MENU(7763, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF + 11: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM13, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 12); + pPlayer->SEND_GOSSIP_MENU(7764, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF + 12: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM14, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 13); + pPlayer->SEND_GOSSIP_MENU(7765, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF + 13: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM15, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 14); + pPlayer->SEND_GOSSIP_MENU(7766, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF + 14: + pPlayer->SEND_GOSSIP_MENU(7767, pCreature->GetGUID()); + //'kill' our trigger to update quest status + pPlayer->KilledMonsterCredit(TRIGGER_FRANKAL, pCreature->GetGUID()); + break; + } + return true; +} + +/*### +## +####*/ + +void AddSC_silithus() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "npc_highlord_demitrian"; + newscript->pGossipHello = &GossipHello_npc_highlord_demitrian; + newscript->pGossipSelect = &GossipSelect_npc_highlord_demitrian; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npcs_rutgar_and_frankal"; + newscript->pGossipHello = &GossipHello_npcs_rutgar_and_frankal; + newscript->pGossipSelect = &GossipSelect_npcs_rutgar_and_frankal; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/stonetalon_mountains.cpp b/src/bindings/scripts/scripts/kalimdor/stonetalon_mountains.cpp new file mode 100644 index 00000000000..78181b0ae3d --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/stonetalon_mountains.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: Stonetalon_Mountains +SD%Complete: 95 +SDComment: Quest support: 6627, 6523 +SDCategory: Stonetalon Mountains +EndScriptData */ + +/* ContentData +npc_braug_dimspirit +npc_kaya_flathoof +EndContentData */ + +#include "precompiled.h" +#include "../../npc/npc_escortAI.h" + +/*###### +## npc_braug_dimspirit +######*/ + +#define GOSSIP_HBD1 "Ysera" +#define GOSSIP_HBD2 "Neltharion" +#define GOSSIP_HBD3 "Nozdormu" +#define GOSSIP_HBD4 "Alexstrasza" +#define GOSSIP_HBD5 "Malygos" + +bool GossipHello_npc_braug_dimspirit(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->GetQuestStatus(6627) == QUEST_STATUS_INCOMPLETE) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HBD1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HBD2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HBD3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HBD4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HBD5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + pPlayer->SEND_GOSSIP_MENU(5820, pCreature->GetGUID()); + } + else + pPlayer->SEND_GOSSIP_MENU(5819, pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_braug_dimspirit(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + { + pPlayer->CLOSE_GOSSIP_MENU(); + pCreature->CastSpell(pPlayer,6766,false); + + } + if (uiAction == GOSSIP_ACTION_INFO_DEF+2) + { + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->AreaExploredOrEventHappens(6627); + } + return true; +} + +/*###### +## npc_kaya_flathoof +######*/ + +enum +{ + FACTION_ESCORTEE_H = 775, + + NPC_GRIMTOTEM_RUFFIAN = 11910, + NPC_GRIMTOTEM_BRUTE = 11912, + NPC_GRIMTOTEM_SORCERER = 11913, + + SAY_START = -1000347, + SAY_AMBUSH = -1000348, + SAY_END = -1000349, + + QUEST_PROTECT_KAYA = 6523 +}; + +struct TRINITY_DLL_DECL npc_kaya_flathoofAI : public npc_escortAI +{ + npc_kaya_flathoofAI(Creature* c) : npc_escortAI(c) {} + + void WaypointReached(uint32 i) + { + Player* pPlayer = Unit::GetPlayer(PlayerGUID); + + if (!pPlayer) + return; + + switch(i) + { + case 16: + DoScriptText(SAY_AMBUSH, m_creature); + m_creature->SummonCreature(NPC_GRIMTOTEM_BRUTE, -48.53, -503.34, -46.31, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + m_creature->SummonCreature(NPC_GRIMTOTEM_RUFFIAN, -38.85, -503.77, -45.90, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + m_creature->SummonCreature(NPC_GRIMTOTEM_SORCERER, -36.37, -496.23, -45.71, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + break; + case 18: m_creature->SetInFront(pPlayer); + DoScriptText(SAY_END, m_creature, pPlayer); + if (pPlayer && pPlayer->GetTypeId() == TYPEID_PLAYER) + CAST_PLR(pPlayer)->GroupEventHappens(QUEST_PROTECT_KAYA, m_creature); + break; + } + } + + void JustSummoned(Creature* summoned) + { + summoned->AI()->AttackStart(m_creature); + } + + void Reset(){} +}; + +bool QuestAccept_npc_kaya_flathoof(Player* pPlayer, Creature* pCreature, Quest const* quest) +{ + if (quest->GetQuestId() == QUEST_PROTECT_KAYA) + { + if (npc_escortAI* pEscortAI = CAST_AI(npc_kaya_flathoofAI, pCreature->AI())) + pEscortAI->Start(true, false, pPlayer->GetGUID()); + + DoScriptText(SAY_START, pCreature); + pCreature->setFaction(113); + pCreature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); + } + return true; +} + +CreatureAI* GetAI_npc_kaya_flathoofAI(Creature* pCreature) +{ + npc_kaya_flathoofAI* kayaAI = new npc_kaya_flathoofAI(pCreature); + + kayaAI->FillPointMovementListForCreature(); + + return kayaAI; +} + +/*###### +## AddSC +######*/ + +void AddSC_stonetalon_mountains() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="npc_braug_dimspirit"; + newscript->pGossipHello = &GossipHello_npc_braug_dimspirit; + newscript->pGossipSelect = &GossipSelect_npc_braug_dimspirit; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_kaya_flathoof"; + newscript->GetAI = &GetAI_npc_kaya_flathoofAI; + newscript->pQuestAccept = &QuestAccept_npc_kaya_flathoof; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/tanaris.cpp b/src/bindings/scripts/scripts/kalimdor/tanaris.cpp new file mode 100644 index 00000000000..08359819d5b --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/tanaris.cpp @@ -0,0 +1,815 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 .sourceforge.net/> + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Tanaris +SD%Complete: 80 +SDComment: Quest support: 648, 1560, 2954, 4005, 10277, 10279(Special flight path). Noggenfogger vendor +SDCategory: Tanaris +EndScriptData */ + +/* ContentData +mob_aquementas +npc_custodian_of_time +npc_marin_noggenfogger +npc_steward_of_time +npc_stone_watcher_of_norgannon +npc_OOX17 +npc_tooga +EndContentData */ + +#include "precompiled.h" +#include "../../npc/npc_escortAI.h" + +/*###### +## mob_aquementas +######*/ + +#define AGGRO_YELL_AQUE -1000350 + +#define SPELL_AQUA_JET 13586 +#define SPELL_FROST_SHOCK 15089 + +struct TRINITY_DLL_DECL mob_aquementasAI : public ScriptedAI +{ + mob_aquementasAI(Creature *c) : ScriptedAI(c) {} + + uint32 SendItem_Timer; + uint32 SwitchFaction_Timer; + bool isFriendly; + + uint32 FrostShock_Timer; + uint32 AquaJet_Timer; + + void Reset() + { + SendItem_Timer = 0; + SwitchFaction_Timer = 10000; + m_creature->setFaction(35); + isFriendly = true; + + AquaJet_Timer = 5000; + FrostShock_Timer = 1000; + } + + void SendItem(Unit* receiver) + { + if (CAST_PLR(receiver)->HasItemCount(11169,1,false) && + CAST_PLR(receiver)->HasItemCount(11172,11,false) && + CAST_PLR(receiver)->HasItemCount(11173,1,false) && + !CAST_PLR(receiver)->HasItemCount(11522,1,true)) + { + ItemPosCountVec dest; + uint8 msg = CAST_PLR(receiver)->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, 11522, 1, false); + if (msg == EQUIP_ERR_OK) + CAST_PLR(receiver)->StoreNewItem(dest, 11522, 1, true); + } + } + + void EnterCombat(Unit* who) + { + DoScriptText(AGGRO_YELL_AQUE, m_creature, who); + } + + void UpdateAI(const uint32 diff) + { + if (isFriendly) + { + if (SwitchFaction_Timer < diff) + { + m_creature->setFaction(91); + isFriendly = false; + }else SwitchFaction_Timer -= diff; + } + + if (!UpdateVictim()) + return; + + if (!isFriendly) + { + if (SendItem_Timer < diff) + { + if (m_creature->getVictim()->GetTypeId() == TYPEID_PLAYER) + SendItem(m_creature->getVictim()); + SendItem_Timer = 5000; + }else SendItem_Timer -= diff; + } + + if (FrostShock_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_FROST_SHOCK); + FrostShock_Timer = 15000; + }else FrostShock_Timer -= diff; + + if (AquaJet_Timer < diff) + { + DoCast(m_creature,SPELL_AQUA_JET); + AquaJet_Timer = 15000; + }else AquaJet_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_mob_aquementas(Creature* pCreature) +{ + return new mob_aquementasAI (pCreature); +} + +/*###### +## npc_custodian_of_time +######*/ + +#define WHISPER_CUSTODIAN_1 -1000150 +#define WHISPER_CUSTODIAN_2 -1000151 +#define WHISPER_CUSTODIAN_3 -1000152 +#define WHISPER_CUSTODIAN_4 -1000153 +#define WHISPER_CUSTODIAN_5 -1000154 +#define WHISPER_CUSTODIAN_6 -1000155 +#define WHISPER_CUSTODIAN_7 -1000156 +#define WHISPER_CUSTODIAN_8 -1000157 +#define WHISPER_CUSTODIAN_9 -1000158 +#define WHISPER_CUSTODIAN_10 -1000159 +#define WHISPER_CUSTODIAN_11 -1000160 +#define WHISPER_CUSTODIAN_12 -1000161 +#define WHISPER_CUSTODIAN_13 -1000162 +#define WHISPER_CUSTODIAN_14 -1000163 + +struct TRINITY_DLL_DECL npc_custodian_of_timeAI : public npc_escortAI +{ + npc_custodian_of_timeAI(Creature *c) : npc_escortAI(c) {} + + void WaypointReached(uint32 i) + { + Player *pPlayer = Unit::GetPlayer(PlayerGUID); + if (!pPlayer) + return; + + switch(i) + { + case 0: DoScriptText(WHISPER_CUSTODIAN_1, m_creature, pPlayer); break; + case 1: DoScriptText(WHISPER_CUSTODIAN_2, m_creature, pPlayer); break; + case 2: DoScriptText(WHISPER_CUSTODIAN_3, m_creature, pPlayer); break; + case 3: DoScriptText(WHISPER_CUSTODIAN_4, m_creature, pPlayer); break; + case 5: DoScriptText(WHISPER_CUSTODIAN_5, m_creature, pPlayer); break; + case 6: DoScriptText(WHISPER_CUSTODIAN_6, m_creature, pPlayer); break; + case 7: DoScriptText(WHISPER_CUSTODIAN_7, m_creature, pPlayer); break; + case 8: DoScriptText(WHISPER_CUSTODIAN_8, m_creature, pPlayer); break; + case 9: DoScriptText(WHISPER_CUSTODIAN_9, m_creature, pPlayer); break; + case 10: DoScriptText(WHISPER_CUSTODIAN_4, m_creature, pPlayer); break; + case 13: DoScriptText(WHISPER_CUSTODIAN_10, m_creature, pPlayer); break; + case 14: DoScriptText(WHISPER_CUSTODIAN_4, m_creature, pPlayer); break; + case 16: DoScriptText(WHISPER_CUSTODIAN_11, m_creature, pPlayer); break; + case 17: DoScriptText(WHISPER_CUSTODIAN_12, m_creature, pPlayer); break; + case 18: DoScriptText(WHISPER_CUSTODIAN_4, m_creature, pPlayer); break; + case 22: DoScriptText(WHISPER_CUSTODIAN_13, m_creature, pPlayer); break; + case 23: DoScriptText(WHISPER_CUSTODIAN_4, m_creature, pPlayer); break; + case 24: + DoScriptText(WHISPER_CUSTODIAN_14, m_creature, pPlayer); + DoCast(pPlayer, 34883); + // below here is temporary workaround, to be removed when spell works properly + pPlayer->AreaExploredOrEventHappens(10277); + break; + } + } + + void MoveInLineOfSight(Unit *who) + { + if (IsBeingEscorted) + return; + + if (who->GetTypeId() == TYPEID_PLAYER) + { + if (who->HasAura(34877) && CAST_PLR(who)->GetQuestStatus(10277) == QUEST_STATUS_INCOMPLETE) + { + float Radius = 10.0; + if (m_creature->IsWithinDistInMap(who, Radius)) + { + Start(false, false, who->GetGUID()); + } + } + } + } + + void EnterCombat(Unit* who) { } + void Reset() { } + + void UpdateAI(const uint32 diff) + { + npc_escortAI::UpdateAI(diff); + } +}; + +CreatureAI* GetAI_npc_custodian_of_time(Creature* pCreature) +{ + npc_custodian_of_timeAI* custodian_of_timeAI = new npc_custodian_of_timeAI(pCreature); + + custodian_of_timeAI->FillPointMovementListForCreature(); + + return custodian_of_timeAI; +} + +/*###### +## npc_marin_noggenfogger +######*/ + +bool GossipHello_npc_marin_noggenfogger(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pCreature->isVendor() && pPlayer->GetQuestRewardStatus(2662)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); + + pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_marin_noggenfogger(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_TRADE) + pPlayer->SEND_VENDORLIST(pCreature->GetGUID()); + + return true; +} + +/*###### +## npc_steward_of_time +######*/ + +#define GOSSIP_ITEM_FLIGHT "Please take me to the master's lair." + +bool GossipHello_npc_steward_of_time(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->GetQuestStatus(10279) == QUEST_STATUS_INCOMPLETE || pPlayer->GetQuestRewardStatus(10279)) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_FLIGHT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + pPlayer->SEND_GOSSIP_MENU(9978, pCreature->GetGUID()); + } + else + pPlayer->SEND_GOSSIP_MENU(9977, pCreature->GetGUID()); + + return true; +} + +bool QuestAccept_npc_steward_of_time(Player* pPlayer, Creature* pCreature, Quest const *quest) +{ + if (quest->GetQuestId() == 10279) //Quest: To The Master's Lair + pPlayer->CastSpell(pPlayer,34891,true); //(Flight through Caverns) + + return false; +} + +bool GossipSelect_npc_steward_of_time(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) + pPlayer->CastSpell(pPlayer,34891,true); //(Flight through Caverns) + + return true; +} + +/*###### +## npc_stone_watcher_of_norgannon +######*/ + +#define GOSSIP_ITEM_NORGANNON_1 "What function do you serve?" +#define GOSSIP_ITEM_NORGANNON_2 "What are the Plates of Uldum?" +#define GOSSIP_ITEM_NORGANNON_3 "Where are the Plates of Uldum?" +#define GOSSIP_ITEM_NORGANNON_4 "Excuse me? We've been \"reschedueled for visitations\"? What does that mean?!" +#define GOSSIP_ITEM_NORGANNON_5 "So, what's inside Uldum?" +#define GOSSIP_ITEM_NORGANNON_6 "I will return when i have the Plates of Uldum." + +bool GossipHello_npc_stone_watcher_of_norgannon(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->GetQuestStatus(2954) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_NORGANNON_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + + pPlayer->SEND_GOSSIP_MENU(1674, pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_stone_watcher_of_norgannon(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch (uiAction) + { + case GOSSIP_ACTION_INFO_DEF: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_NORGANNON_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + pPlayer->SEND_GOSSIP_MENU(1675, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_NORGANNON_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + pPlayer->SEND_GOSSIP_MENU(1676, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_NORGANNON_4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); + pPlayer->SEND_GOSSIP_MENU(1677, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+3: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_NORGANNON_5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4); + pPlayer->SEND_GOSSIP_MENU(1678, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+4: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_NORGANNON_6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5); + pPlayer->SEND_GOSSIP_MENU(1679, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+5: + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->AreaExploredOrEventHappens(2954); + break; + } + return true; +} + +/*###### +## npc_OOX17 +######*/ + +#define Q_OOX17 648 +#define SPAWN_FIRST 7803 +#define SPAWN_SECOND_1 5617 +#define SPAWN_SECOND_2 7805 +#define SAY_SCOFF -1060004 +#define SAY_CHICKEN_ACC -1060000 +#define SAY_CHICKEN_AGGRO_1 -1060001 +#define SAY_CHICKEN_AGGRO_2 -1060002 +#define SAY_CHICKEN_AMB -1060003 +#define SAY_CHICKEN_COMP -1060005 + +struct TRINITY_DLL_DECL npc_OOX17AI : public npc_escortAI +{ + npc_OOX17AI(Creature *c) : npc_escortAI(c) {} + + void WaypointReached(uint32 i) + { + Player* pPlayer = Unit::GetPlayer(PlayerGUID); + + if (!pPlayer) + return; + + switch(i) { + case 23: + m_creature->SummonCreature(SPAWN_FIRST, -8350.96, -4445.79, 10.10, 6.20, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + m_creature->SummonCreature(SPAWN_FIRST, -8355.96, -4447.79, 10.10, 6.27, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + m_creature->SummonCreature(SPAWN_FIRST, -8353.96, -4442.79, 10.10, 6.08, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + DoScriptText(SAY_CHICKEN_AMB, m_creature); + break; + + case 56: + m_creature->SummonCreature(SPAWN_SECOND_1, -7510.07, -4795.50, 9.35, 6.06, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + m_creature->SummonCreature(SPAWN_SECOND_2, -7515.07, -4797.50, 9.35, 6.22, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + m_creature->SummonCreature(SPAWN_SECOND_2, -7518.07, -4792.50, 9.35, 6.22, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + DoScriptText(SAY_CHICKEN_AMB, m_creature); + if (Unit* scoff = me->FindNearestCreature(SPAWN_SECOND_2, 30)) + DoScriptText(SAY_SCOFF, scoff); + break; + + case 86: + if (pPlayer) + { + DoScriptText(SAY_CHICKEN_COMP, m_creature); + pPlayer->GroupEventHappens(Q_OOX17, m_creature); + } + break; + } + } + + void Reset(){} + + void EnterCombat(Unit* who) + { + switch (rand()%2) + { + case 0: DoScriptText(SAY_CHICKEN_AGGRO_1, m_creature); break; + case 1: DoScriptText(SAY_CHICKEN_AGGRO_2, m_creature); break; + } + } + + void JustSummoned(Creature* summoned) + { + summoned->AI()->AttackStart(m_creature); + } +}; + +bool QuestAccept_npc_OOX17(Player* pPlayer, Creature* pCreature, Quest const* quest) +{ + if (quest->GetQuestId() == Q_OOX17) + { + pCreature->setFaction(113); + pCreature->SetHealth(pCreature->GetMaxHealth()); + pCreature->SetUInt32Value(UNIT_FIELD_BYTES_1,0); + pCreature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); + DoScriptText(SAY_CHICKEN_ACC, pCreature); + + if (npc_escortAI* pEscortAI = CAST_AI(npc_OOX17AI, pCreature->AI())) + pEscortAI->Start(true, false, pPlayer->GetGUID()); + } + return true; +} + +CreatureAI* GetAI_npc_OOX17(Creature* pCreature) +{ + npc_OOX17AI* OOX17AI = new npc_OOX17AI(pCreature); + + OOX17AI->AddWaypoint(0, -8843.73, -4374.44, 43.71); + OOX17AI->AddWaypoint(1, -8834.68, -4373.88, 45.71); + OOX17AI->AddWaypoint(2, -8832.93, -4373.85, 45.67); + OOX17AI->AddWaypoint(3, -8829.21, -4373.72, 44.14); + OOX17AI->AddWaypoint(4, -8825.10, -4373.56, 41.44); + OOX17AI->AddWaypoint(5, -8818.88, -4372.75, 36.43); + OOX17AI->AddWaypoint(6, -8803.37, -4369.68, 30.06); + OOX17AI->AddWaypoint(7, -8786.68, -4366.18, 23.91); + OOX17AI->AddWaypoint(8, -8764.97, -4366.94, 25.23); + OOX17AI->AddWaypoint(9, -8745.49, -4363.16, 22.80); + OOX17AI->AddWaypoint(10, -8724.13, -4353.55, 20.72); + OOX17AI->AddWaypoint(11, -8706.77, -4346.14, 16.12); + OOX17AI->AddWaypoint(12, -8688.27, -4372.85, 13.64); + OOX17AI->AddWaypoint(13, -8668.76, -4380.38, 11.69); + OOX17AI->AddWaypoint(14, -8645.19, -4388.62, 12.56); + OOX17AI->AddWaypoint(15, -8614.73, -4398.60, 9.86); + OOX17AI->AddWaypoint(16, -8560.33, -4411.27, 13.17); + OOX17AI->AddWaypoint(17, -8536.45, -4416.49, 11.84); + OOX17AI->AddWaypoint(18, -8503.48, -4423.70, 13.59); + OOX17AI->AddWaypoint(19, -8471.91, -4430.60, 9.56); + OOX17AI->AddWaypoint(20, -8441.36, -4435.31, 9.40); + OOX17AI->AddWaypoint(21, -8403.41, -4441.16, 11.83); + OOX17AI->AddWaypoint(22, -8371.24, -4446.13, 9.47); + OOX17AI->AddWaypoint(23, -8353.96, -4448.79, 10.10); //Scorpid + OOX17AI->AddWaypoint(24, -8336.40, -4446.39, 8.98); + OOX17AI->AddWaypoint(25, -8303.78, -4441.96, 11.89); + OOX17AI->AddWaypoint(26, -8272.20, -4433.31, 9.60); + OOX17AI->AddWaypoint(27, -8224.76, -4419.39, 13.03); + OOX17AI->AddWaypoint(28, -8193.31, -4406.04, 10.17); + OOX17AI->AddWaypoint(29, -8155.65, -4397.74, 8.99); + OOX17AI->AddWaypoint(30, -8129.25, -4394.57, 10.92); + OOX17AI->AddWaypoint(31, -8104.86, -4399.03, 8.93); + OOX17AI->AddWaypoint(32, -8063.15, -4423.40, 10.07); + OOX17AI->AddWaypoint(33, -8032.15, -4443.47, 9.97); + OOX17AI->AddWaypoint(34, -8015.39, -4454.33, 9.39); + OOX17AI->AddWaypoint(35, -7981.64, -4482.44, 10.32); + OOX17AI->AddWaypoint(36, -7958.83, -4503.98, 9.69); + OOX17AI->AddWaypoint(37, -7932.45, -4528.91, 10.08); + OOX17AI->AddWaypoint(38, -7904.09, -4566.67, 12.59); + OOX17AI->AddWaypoint(39, -7883.33, -4593.91, 12.15); + OOX17AI->AddWaypoint(40, -7862.83, -4624.53, 10.21); + OOX17AI->AddWaypoint(41, -7840.79, -4654.26, 9.45); + OOX17AI->AddWaypoint(42, -7826.17, -4673.99, 10.61); + OOX17AI->AddWaypoint(43, -7807.86, -4698.69, 11.24); + OOX17AI->AddWaypoint(44, -7793.88, -4717.55, 10.48); + OOX17AI->AddWaypoint(45, -7778.68, -4738.05, 8.89); + OOX17AI->AddWaypoint(46, -7746.42, -4780.39, 9.84); + OOX17AI->AddWaypoint(47, -7724.11, -4772.75, 10.28); + OOX17AI->AddWaypoint(48, -7697.98, -4763.80, 9.52); + OOX17AI->AddWaypoint(49, -7665.33, -4752.62, 10.56); + OOX17AI->AddWaypoint(50, -7641.47, -4750.33, 8.94); + OOX17AI->AddWaypoint(51, -7620.08, -4753.96, 8.93); + OOX17AI->AddWaypoint(52, -7603.15, -4757.53, 9.06); + OOX17AI->AddWaypoint(53, -7579.43, -4767.07, 8.93); + OOX17AI->AddWaypoint(54, -7558.51, -4779.01, 9.64); + OOX17AI->AddWaypoint(55, -7536.40, -4789.32, 8.92); + OOX17AI->AddWaypoint(56, -7512.07, -4793.50, 9.35); //Wastewander + OOX17AI->AddWaypoint(57, -7490.79, -4788.80, 10.53); + OOX17AI->AddWaypoint(58, -7469.10, -4785.11, 10.42); + OOX17AI->AddWaypoint(59, -7453.18, -4782.41, 9.15); + OOX17AI->AddWaypoint(60, -7426.27, -4777.83, 9.54); + OOX17AI->AddWaypoint(61, -7393.84, -4770.19, 12.57); + OOX17AI->AddWaypoint(62, -7367.25, -4764.17, 11.92); + OOX17AI->AddWaypoint(63, -7341.00, -4752.11, 10.17); + OOX17AI->AddWaypoint(64, -7321.62, -4744.97, 11.58); + OOX17AI->AddWaypoint(65, -7302.35, -4744.35, 11.97); + OOX17AI->AddWaypoint(66, -7281.00, -4743.66, 11.21); + OOX17AI->AddWaypoint(67, -7258.33, -4742.93, 9.64); + OOX17AI->AddWaypoint(68, -7236.70, -4742.24, 10.16); + OOX17AI->AddWaypoint(69, -7217.52, -4743.87, 10.79); + OOX17AI->AddWaypoint(70, -7201.86, -4746.32, 9.58); + OOX17AI->AddWaypoint(71, -7182.01, -4749.41, 9.09); + OOX17AI->AddWaypoint(72, -7159.61, -4752.90, 9.52); + OOX17AI->AddWaypoint(73, -7139.58, -4756.02, 9.53); + OOX17AI->AddWaypoint(74, -7122.60, -4754.91, 9.66); + OOX17AI->AddWaypoint(75, -7101.06, -4753.87, 8.92); + OOX17AI->AddWaypoint(76, -7082.79, -4752.99, 9.97); + OOX17AI->AddWaypoint(77, -7061.81, -4751.98, 9.26); + OOX17AI->AddWaypoint(78, -7035.12, -4754.39, 9.19); + OOX17AI->AddWaypoint(79, -7013.90, -4758.64, 10.28); + OOX17AI->AddWaypoint(80, -7001.71, -4769.73, 10.59); + OOX17AI->AddWaypoint(81, -6984.95, -4788.61, 9.30); + OOX17AI->AddWaypoint(82, -6970.41, -4788.77, 9.42); + OOX17AI->AddWaypoint(83, -6957.16, -4788.92, 6.26); + OOX17AI->AddWaypoint(84, -6951.29, -4802.73, 4.45); + OOX17AI->AddWaypoint(85, -6944.81, -4816.58, 1.60); + OOX17AI->AddWaypoint(86, -6942.06, -4839.40, 0.66,5000); + + return OOX17AI; +} + +/*#### +# npc_tooga +####*/ + +enum +{ + SAY_TOOG_THIRST = -1000391, + SAY_TOOG_WORRIED = -1000392, + SAY_TOOG_POST_1 = -1000393, + SAY_TORT_POST_2 = -1000394, + SAY_TOOG_POST_3 = -1000395, + SAY_TORT_POST_4 = -1000396, + SAY_TOOG_POST_5 = -1000397, + SAY_TORT_POST_6 = -1000398, + + QUEST_TOOGA = 1560, + NPC_TORTA = 6015, + + POINT_ID_TO_WATER = 1, + FACTION_TOOG_ESCORTEE = 113 +}; + +const float m_afToWaterLoc[] = {-7032.664551, -4906.199219, -1.606446}; + +//Script not fully complete, need to change faction. +struct MANGOS_DLL_DECL npc_toogaAI : public ScriptedAI +{ + npc_toogaAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_uiNpcFlags = pCreature->GetUInt32Value(UNIT_NPC_FLAGS); + m_uiPlayerGUID = 0; + } + + uint64 m_uiPlayerGUID; + uint32 m_uiNpcFlags; + uint32 m_uiCheckPlayerTimer; + uint32 m_uiPostEventTimer; + uint32 m_uiPhasePostEvent; + + Unit* pTorta; + + void Reset() + { + m_uiCheckPlayerTimer = 2500; + m_uiPostEventTimer = 5000; + m_uiPhasePostEvent = 0; + + pTorta = NULL; + } + + void MoveInLineOfSight(Unit *pWho) + { + if (pWho->GetEntry() == NPC_TORTA) + { + if (m_creature->IsWithinDistInMap(pWho, INTERACTION_DISTANCE)) + { + if (!pTorta && CanDoComplete()) + { + pTorta = pWho; + m_uiPhasePostEvent = 1; + } + } + } + } + + void EnterEvadeMode() + { + m_creature->RemoveAllAuras(); + m_creature->DeleteThreatList(); + m_creature->CombatStop(true); + m_creature->LoadCreaturesAddon(); + + if (m_creature->isAlive()) + { + if (Unit* pUnit = Unit::GetUnit(*m_creature, m_uiPlayerGUID)) + { + //for later development, it appear this kind return to combatStart, then resume to MoveFollow + m_creature->GetMotionMaster()->MoveFollow(pUnit, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE); + } + else + { + m_creature->GetMotionMaster()->MoveTargetedHome(); + } + } + + m_creature->SetLootRecipient(NULL); + + Reset(); + } + + void JustRespawned() + { + if (m_creature->getFaction() != m_creature->GetCreatureInfo()->faction_A) + m_creature->setFaction(m_creature->GetCreatureInfo()->faction_A); + + m_creature->SetUInt32Value(UNIT_NPC_FLAGS, m_creature->GetCreatureInfo()->npcflag); + + Reset(); + } + + void DoStart(Player* pPlayer) + { + m_uiPlayerGUID = pPlayer->GetGUID(); + m_creature->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE); + + //m_creature->setFaction(FACTION_TOOG_ESCORTEE); + + m_creature->GetMotionMaster()->MoveFollow(pPlayer, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE); + } + + bool CanDoComplete() + { + if (Player* pPlayer = (Player*)Unit::GetUnit(*m_creature, m_uiPlayerGUID)) + { + if (pPlayer->GetQuestStatus(QUEST_TOOGA) == QUEST_STATUS_INCOMPLETE) + { + uint16 uiQuestLogSlot = pPlayer->FindQuestSlot(QUEST_TOOGA); + + if (uiQuestLogSlot < MAX_QUEST_LOG_SIZE) + { + if (pPlayer->GetQuestSlotState(uiQuestLogSlot) != QUEST_STATE_FAIL) + { + pPlayer->GroupEventHappens(QUEST_TOOGA, m_creature); + m_creature->GetMotionMaster()->MovementExpired(); + return true; + } + } + } + } + + return false; + } + + void MovementInform(uint32 uiMoveType, uint32 uiPointId) + { + if (uiMoveType != POINT_MOTION_TYPE || !m_uiPlayerGUID) + return; + + if (uiPointId == POINT_ID_TO_WATER) + m_creature->ForcedDespawn(); + } + + void JustDied(Unit* pKiller) + { + if (Player* pPlayer = Unit::GetPlayer(m_uiPlayerGUID)) + pPlayer->FailQuest(QUEST_TOOGA); + + m_uiPlayerGUID = 0; + m_creature->GetMotionMaster()->MovementExpired(); + } + + void UpdateAI(const uint32 uiDiff) + { + if (!UpdateVictim()) + { + //we are doing the post-event, or... + if (m_uiPhasePostEvent) + { + if (m_uiPostEventTimer < uiDiff) + { + m_uiPostEventTimer = 5000; + + if (!pTorta || !pTorta->isAlive()) + { + //something happened, so just despawn (what can go wrong?) + m_creature->ForcedDespawn(); + return; + } + + switch(m_uiPhasePostEvent) + { + case 1: + DoScriptText(SAY_TOOG_POST_1, m_creature); + break; + case 2: + DoScriptText(SAY_TORT_POST_2, pTorta); + break; + case 3: + DoScriptText(SAY_TOOG_POST_3, m_creature); + break; + case 4: + DoScriptText(SAY_TORT_POST_4, pTorta); + break; + case 5: + DoScriptText(SAY_TOOG_POST_5, m_creature); + break; + case 6: + DoScriptText(SAY_TORT_POST_6, pTorta); + m_creature->GetMotionMaster()->MovementExpired(); + m_creature->GetMotionMaster()->MovePoint(POINT_ID_TO_WATER, m_afToWaterLoc[0], m_afToWaterLoc[1], m_afToWaterLoc[2]); + break; + } + + ++m_uiPhasePostEvent; + } + else + m_uiPostEventTimer -= uiDiff; + } + //...we are doing regular player check + else if (m_uiPlayerGUID) + { + if (m_uiCheckPlayerTimer < uiDiff) + { + m_uiCheckPlayerTimer = 5000; + + switch(rand()%50) + { + case 10: DoScriptText(SAY_TOOG_THIRST, m_creature); break; + case 25: DoScriptText(SAY_TOOG_WORRIED, m_creature); break; + } + + Unit* pUnit = Unit::GetUnit(*m_creature, m_uiPlayerGUID); + + if (pUnit && !pUnit->isAlive()) + { + m_uiPlayerGUID = 0; + m_creature->ForcedDespawn(); + } + } + else + m_uiCheckPlayerTimer -= uiDiff; + } + + return; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_npc_tooga(Creature* pCreature) +{ + return new npc_toogaAI(pCreature); +} + +bool QuestAccept_npc_tooga(Player* pPlayer, Creature* pCreature, const Quest* pQuest) +{ + if (pQuest->GetQuestId() == QUEST_TOOGA) + { + if (npc_toogaAI* pToogaAI = CAST_AI(npc_toogaAI, pCreature->AI())) + pToogaAI->DoStart(pPlayer); + } + + return true; +} + +void AddSC_tanaris() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="mob_aquementas"; + newscript->GetAI = &GetAI_mob_aquementas; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_custodian_of_time"; + newscript->GetAI = &GetAI_npc_custodian_of_time; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_marin_noggenfogger"; + newscript->pGossipHello = &GossipHello_npc_marin_noggenfogger; + newscript->pGossipSelect = &GossipSelect_npc_marin_noggenfogger; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_steward_of_time"; + newscript->pGossipHello = &GossipHello_npc_steward_of_time; + newscript->pGossipSelect = &GossipSelect_npc_steward_of_time; + newscript->pQuestAccept = &QuestAccept_npc_steward_of_time; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_stone_watcher_of_norgannon"; + newscript->pGossipHello = &GossipHello_npc_stone_watcher_of_norgannon; + newscript->pGossipSelect = &GossipSelect_npc_stone_watcher_of_norgannon; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_OOX17"; + newscript->GetAI = &GetAI_npc_OOX17; + newscript->pQuestAccept = &QuestAccept_npc_OOX17; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_tooga"; + newscript->GetAI = &GetAI_npc_tooga; + newscript->pQuestAccept = &QuestAccept_npc_tooga; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/teldrassil.cpp b/src/bindings/scripts/scripts/kalimdor/teldrassil.cpp new file mode 100644 index 00000000000..58cb2a55b2f --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/teldrassil.cpp @@ -0,0 +1,192 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Teldrassil +SD%Complete: 100 +SDComment: Quest support: 938 +SDCategory: Teldrassil +EndScriptData */ + +/* ContentData +npc_mist +EndContentData */ + +#include "precompiled.h" + +/*#### +# npc_mist +####*/ + +enum +{ + SAY_AT_HOME = -1000411, + EMOTE_AT_HOME = -1000412, + QUEST_MIST = 938, + NPC_ARYNIA = 3519, +}; + +struct TRINITY_DLL_DECL npc_mistAI : public ScriptedAI +{ + npc_mistAI(Creature *c) : ScriptedAI(c) + { + uiNpcFlags = c->GetUInt32Value(UNIT_NPC_FLAGS); + uiPlayerGUID = 0; + } + + uint64 uiPlayerGUID; + uint32 uiNpcFlags; + uint32 uiCheckPlayerTimer; + + void Reset() + { + uiCheckPlayerTimer = 2500; + + if (!uiPlayerGUID) + m_creature->SetUInt32Value(UNIT_NPC_FLAGS, uiNpcFlags); + } + + void MoveInLineOfSight(Unit *pWho) + { + if (pWho->GetEntry() == NPC_ARYNIA) + { + if (m_creature->IsWithinDistInMap(pWho, 10.0f)) + { + DoScriptText(SAY_AT_HOME, pWho); + DoComplete(); + } + } + } + + 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 (pPlayer->GetQuestStatus(QUEST_MIST) == QUEST_STATUS_INCOMPLETE) + { + uint16 uiQuestLogSlot = pPlayer->FindQuestSlot(QUEST_MIST); + + if (uiQuestLogSlot < MAX_QUEST_LOG_SIZE) + { + 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(); + } + + void UpdateAI(const uint32 diff) + { + 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) +{ + return new npc_mistAI(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()); + + return true; +} + +void AddSC_teldrassil() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "npc_mist"; + newscript->GetAI = &GetAI_npc_mist; + newscript->pQuestAccept = &QuestAccept_npc_mist; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/the_barrens.cpp b/src/bindings/scripts/scripts/kalimdor/the_barrens.cpp new file mode 100644 index 00000000000..75208c02837 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/the_barrens.cpp @@ -0,0 +1,674 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along 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_Barrens +SD%Complete: 90 +SDComment: Quest support: 863, 898, 1719, 2458, 4921, 6981, +SDCategory: Barrens +EndScriptData */ + +/* ContentData +npc_beaten_corpse +npc_gilthares +npc_sputtervalve +npc_taskmaster_fizzule +npc_twiggy_flathead +npc_wizzlecrank_shredder +EndContentData */ + +#include "precompiled.h" +#include "../../npc/npc_escortAI.h" + +/*###### +## npc_beaten_corpse +######*/ + +#define GOSSIP_CORPSE "Examine corpse in detail..." + +enum +{ + QUEST_LOST_IN_BATTLE = 4921 +}; + +bool GossipHello_npc_beaten_corpse(Player* pPlayer, Creature* pCreature) +{ + if (pPlayer->GetQuestStatus(QUEST_LOST_IN_BATTLE) == QUEST_STATUS_INCOMPLETE || pPlayer->GetQuestStatus(QUEST_LOST_IN_BATTLE) == QUEST_STATUS_COMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_CORPSE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + pPlayer->SEND_GOSSIP_MENU(3557, pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_beaten_corpse(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF +1) + { + pPlayer->SEND_GOSSIP_MENU(3558, pCreature->GetGUID()); + pPlayer->TalkedToCreature(pCreature->GetEntry(), pCreature->GetGUID()); + } + return true; +} + +/*###### +# npc_gilthares +######*/ + +enum +{ + SAY_GIL_START = -1000370, + SAY_GIL_AT_LAST = -1000371, + SAY_GIL_PROCEED = -1000372, + SAY_GIL_FREEBOOTERS = -1000373, + SAY_GIL_AGGRO_1 = -1000374, + SAY_GIL_AGGRO_2 = -1000375, + SAY_GIL_AGGRO_3 = -1000376, + SAY_GIL_AGGRO_4 = -1000377, + SAY_GIL_ALMOST = -1000378, + SAY_GIL_SWEET = -1000379, + SAY_GIL_FREED = -1000380, + + QUEST_FREE_FROM_HOLD = 898, + AREA_MERCHANT_COAST = 391, + FACTION_ESCORTEE = 232 //guessed, possible not needed for this quest +}; + +struct TRINITY_DLL_DECL npc_giltharesAI : public npc_escortAI +{ + npc_giltharesAI(Creature* pCreature) : npc_escortAI(pCreature) { } + + void Reset() { } + + void WaypointReached(uint32 uiPointId) + { + Player* pPlayer = (Player*)Unit::GetUnit(*m_creature, PlayerGUID); + + if (!pPlayer) + return; + + switch(uiPointId) + { + case 16: + DoScriptText(SAY_GIL_AT_LAST, m_creature, pPlayer); + break; + case 17: + DoScriptText(SAY_GIL_PROCEED, m_creature, pPlayer); + break; + case 18: + DoScriptText(SAY_GIL_FREEBOOTERS, m_creature, pPlayer); + break; + case 37: + DoScriptText(SAY_GIL_ALMOST, m_creature, pPlayer); + break; + case 47: + DoScriptText(SAY_GIL_SWEET, m_creature, pPlayer); + break; + case 53: + DoScriptText(SAY_GIL_FREED, m_creature, pPlayer); + pPlayer->GroupEventHappens(QUEST_FREE_FROM_HOLD, m_creature); + break; + } + } + + void Aggro(Unit* pWho) + { + //not always use + if (rand()%4) + return; + + //only aggro text if not player and only in this area + if (pWho->GetTypeId() != TYPEID_PLAYER && m_creature->GetAreaId() == AREA_MERCHANT_COAST) + { + //appears to be pretty much random (possible only if escorter not in combat with pWho yet?) + switch(rand()%4) + { + case 0: DoScriptText(SAY_GIL_AGGRO_1, m_creature, pWho); break; + case 1: DoScriptText(SAY_GIL_AGGRO_2, m_creature, pWho); break; + case 2: DoScriptText(SAY_GIL_AGGRO_3, m_creature, pWho); break; + case 3: DoScriptText(SAY_GIL_AGGRO_4, m_creature, pWho); break; + } + } + } +}; + +CreatureAI* GetAI_npc_gilthares(Creature* pCreature) +{ + npc_giltharesAI* pTempAI = new npc_giltharesAI(pCreature); + + pTempAI->FillPointMovementListForCreature(); + + return (CreatureAI*)pTempAI; +} + +bool QuestAccept_npc_gilthares(Player* pPlayer, Creature* pCreature, const Quest* pQuest) +{ + if (pQuest->GetQuestId() == QUEST_FREE_FROM_HOLD) + { + pCreature->setFaction(FACTION_ESCORTEE); + pCreature->SetStandState(UNIT_STAND_STATE_STAND); + + DoScriptText(SAY_GIL_START, pCreature, pPlayer); + + if (npc_giltharesAI* pEscortAI = CAST_AI(npc_giltharesAI, pCreature->AI())) + pEscortAI->Start(false, false, pPlayer->GetGUID(), pQuest); + } + return true; +} + +/*###### +## npc_sputtervalve +######*/ + +#define GOSSIP_SPUTTERVALVE "Can you tell me about this shard?" + +bool GossipHello_npc_sputtervalve(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->GetQuestStatus(6981) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SPUTTERVALVE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + + pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_sputtervalve(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF) + { + pPlayer->SEND_GOSSIP_MENU(2013, pCreature->GetGUID()); + pPlayer->AreaExploredOrEventHappens(6981); + } + return true; +} + +/*###### +## npc_taskmaster_fizzule +######*/ + +enum +{ + FACTION_FRIENDLY_F = 35, + SPELL_FLARE = 10113, + SPELL_FOLLY = 10137, +}; + +struct TRINITY_DLL_DECL npc_taskmaster_fizzuleAI : public ScriptedAI +{ + npc_taskmaster_fizzuleAI(Creature* c) : ScriptedAI(c) + { + factionNorm = c->getFaction(); + } + + uint32 factionNorm; + bool IsFriend; + uint32 Reset_Timer; + uint8 FlareCount; + + void Reset() + { + IsFriend = false; + Reset_Timer = 120000; + FlareCount = 0; + m_creature->setFaction(factionNorm); + } + + void DoFriend() + { + m_creature->RemoveAllAuras(); + m_creature->DeleteThreatList(); + m_creature->CombatStop(true); + + m_creature->StopMoving(); + m_creature->GetMotionMaster()->MoveIdle(); + + m_creature->setFaction(FACTION_FRIENDLY_F); + m_creature->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE); + } + + void SpellHit(Unit *caster, const SpellEntry *spell) + { + if (spell->Id == SPELL_FLARE || spell->Id == SPELL_FOLLY) + { + ++FlareCount; + + if (FlareCount >= 2) + IsFriend = true; + } + } + + void EnterCombat(Unit* who) { } + + void UpdateAI(const uint32 diff) + { + if (IsFriend) + { + if (Reset_Timer < diff) + { + EnterEvadeMode(); + return; + } else Reset_Timer -= diff; + } + + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + + void ReceiveEmote(Player* pPlayer, uint32 emote) + { + if (emote == TEXTEMOTE_SALUTE) + { + if (FlareCount >= 2) + { + if (m_creature->getFaction() == FACTION_FRIENDLY_F) + return; + + DoFriend(); + } + } + } +}; + +CreatureAI* GetAI_npc_taskmaster_fizzule(Creature* pCreature) +{ + return new npc_taskmaster_fizzuleAI(pCreature); +} + +/*##### +## npc_twiggy_flathead +#####*/ + +#define BIG_WILL 6238 +#define AFFRAY_CHALLENGER 6240 +#define SAY_BIG_WILL_READY -1000267 +#define SAY_TWIGGY_FLATHEAD_BEGIN -1000268 +#define SAY_TWIGGY_FLATHEAD_FRAY -1000269 +#define SAY_TWIGGY_FLATHEAD_DOWN -1000270 +#define SAY_TWIGGY_FLATHEAD_OVER -1000271 + +float AffrayChallengerLoc[6][4]= +{ + {-1683, -4326, 2.79, 0}, + {-1682, -4329, 2.79, 0}, + {-1683, -4330, 2.79, 0}, + {-1680, -4334, 2.79, 1.49}, + {-1674, -4326, 2.79, 3.49}, + {-1677, -4334, 2.79, 1.66} +}; + +struct TRINITY_DLL_DECL npc_twiggy_flatheadAI : public ScriptedAI +{ + npc_twiggy_flatheadAI(Creature *c) : ScriptedAI(c) {} + + bool EventInProgress; + bool EventGrate; + bool EventBigWill; + bool Challenger_down[6]; + uint32 Wave; + uint32 Wave_Timer; + uint32 Challenger_checker; + uint64 PlayerGUID; + uint64 AffrayChallenger[6]; + uint64 BigWill; + + void Reset() + { + EventInProgress = false; + EventGrate = false; + EventBigWill = false; + Wave_Timer = 600000; + Challenger_checker = 0; + Wave = 0; + PlayerGUID = 0; + + for(uint8 i = 0; i < 6; ++i) + { + AffrayChallenger[i] = 0; + Challenger_down[i] = false; + } + BigWill = 0; + } + + void EnterCombat(Unit *who) { } + + void MoveInLineOfSight(Unit *who) + { + if (!who || (!who->isAlive())) return; + + if (m_creature->IsWithinDistInMap(who, 10.0f) && (who->GetTypeId() == TYPEID_PLAYER) && CAST_PLR(who)->GetQuestStatus(1719) == QUEST_STATUS_INCOMPLETE && !EventInProgress) + { + PlayerGUID = who->GetGUID(); + EventInProgress = true; + } + } + + void KilledUnit(Unit *victim) { } + + void UpdateAI(const uint32 diff) + { + if (EventInProgress) { + Player* pWarrior = NULL; + + if (PlayerGUID) + pWarrior = Unit::GetPlayer(PlayerGUID); + + if (!pWarrior) + return; + + if (!pWarrior->isAlive() && pWarrior->GetQuestStatus(1719) == QUEST_STATUS_INCOMPLETE) { + EventInProgress = false; + DoScriptText(SAY_TWIGGY_FLATHEAD_DOWN, m_creature); + pWarrior->FailQuest(1719); + + for(uint8 i = 0; i < 6; ++i) + { + if (AffrayChallenger[i]) + { + Creature* pCreature = Unit::GetCreature((*m_creature), AffrayChallenger[i]); + if (pCreature) { + if (pCreature->isAlive()) + { + pCreature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT); + pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + pCreature->setDeathState(JUST_DIED); + } + } + } + AffrayChallenger[i] = 0; + Challenger_down[i] = false; + } + + if (BigWill) + { + Creature* pCreature = Unit::GetCreature((*m_creature), BigWill); + if (pCreature) { + if (pCreature->isAlive()) { + pCreature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT); + pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + pCreature->setDeathState(JUST_DIED); + } + } + } + BigWill = 0; + } + + if (!EventGrate && EventInProgress) + { + float x,y,z; + pWarrior->GetPosition(x, y, z); + + if (x >= -1684 && x <= -1674 && y >= -4334 && y <= -4324) { + pWarrior->AreaExploredOrEventHappens(1719); + DoScriptText(SAY_TWIGGY_FLATHEAD_BEGIN, m_creature); + + for(uint8 i = 0; i < 6; ++i) + { + Creature* pCreature = m_creature->SummonCreature(AFFRAY_CHALLENGER, AffrayChallengerLoc[i][0], AffrayChallengerLoc[i][1], AffrayChallengerLoc[i][2], AffrayChallengerLoc[i][3], TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000); + if (!pCreature) + continue; + pCreature->setFaction(35); + pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + pCreature->HandleEmoteCommand(EMOTE_ONESHOT_ROAR); + AffrayChallenger[i] = pCreature->GetGUID(); + } + Wave_Timer = 5000; + Challenger_checker = 1000; + EventGrate = true; + } + } + else if (EventInProgress) + { + if (Challenger_checker < diff) + { + for(uint8 i = 0; i < 6; ++i) + { + if (AffrayChallenger[i]) + { + Creature* pCreature = Unit::GetCreature((*m_creature), AffrayChallenger[i]); + if ((!pCreature || (!pCreature->isAlive())) && !Challenger_down[i]) + { + DoScriptText(SAY_TWIGGY_FLATHEAD_DOWN, m_creature); + Challenger_down[i] = true; + } + } + } + Challenger_checker = 1000; + } else Challenger_checker -= diff; + + if (Wave_Timer < diff) + { + if (AffrayChallenger[Wave] && Wave < 6 && !EventBigWill) + { + DoScriptText(SAY_TWIGGY_FLATHEAD_FRAY, m_creature); + Creature* pCreature = Unit::GetCreature((*m_creature), AffrayChallenger[Wave]); + if (pCreature && (pCreature->isAlive())) + { + pCreature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + pCreature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + pCreature->HandleEmoteCommand(EMOTE_ONESHOT_ROAR); + pCreature->setFaction(14); + (pCreature->AI())->AttackStart(pWarrior); + ++Wave; + Wave_Timer = 20000; + } + } + else if (Wave >= 6 && !EventBigWill) { + if (Creature* pCreature = m_creature->SummonCreature(BIG_WILL, -1722, -4341, 6.12, 6.26, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 480000)) + { + BigWill = pCreature->GetGUID(); + //pCreature->GetMotionMaster()->MovePoint(0, -1693, -4343, 4.32); + //pCreature->GetMotionMaster()->MovePoint(1, -1684, -4333, 2.78); + pCreature->GetMotionMaster()->MovePoint(2, -1682, -4329, 2.79); + pCreature->HandleEmoteCommand(EMOTE_STATE_READYUNARMED); + EventBigWill = true; + Wave_Timer = 1000; + } + } + else if (Wave >= 6 && EventBigWill && BigWill) + { + Creature* pCreature = Unit::GetCreature((*m_creature), BigWill); + if (!pCreature || !pCreature->isAlive()) + { + DoScriptText(SAY_TWIGGY_FLATHEAD_OVER, m_creature); + EventInProgress = false; + EventBigWill = false; + EventGrate = false; + PlayerGUID = 0; + Wave = 0; + } + } + } else Wave_Timer -= diff; + } + } + } +}; + +CreatureAI* GetAI_npc_twiggy_flathead(Creature* pCreature) +{ + return new npc_twiggy_flatheadAI (pCreature); +} + +/*##### +## npc_wizzlecrank_shredder +#####*/ + +enum +{ + SAY_PROGRESS_1 = -1000272, + SAY_PROGRESS_2 = -1000273, + SAY_PROGRESS_3 = -1000274, + + SAY_MERCENARY_4 = -1000275, + + SAY_PROGRESS_5 = -1000276, + SAY_PROGRESS_6 = -1000277, + SAY_PROGRESS_7 = -1000278, + SAY_PROGRESS_8 = -1000279, + + QUEST_ESCAPE = 863, + FACTION_RATCHET = 637, + NPC_PILOT = 3451, + MOB_MERCENARY = 3282, +}; + +struct TRINITY_DLL_DECL npc_wizzlecrank_shredderAI : public npc_escortAI +{ + npc_wizzlecrank_shredderAI(Creature* c) : npc_escortAI(c) { } + + bool Completed; + + void WaypointReached(uint32 i) + { + Player* pPlayer = Unit::GetPlayer(PlayerGUID); + + if (!pPlayer) + return; + + switch(i) + { + case 0: DoScriptText(SAY_PROGRESS_1, m_creature); + m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); break; + case 1: DoScriptText(SAY_PROGRESS_2, m_creature); break; + case 10: DoScriptText(SAY_PROGRESS_3, m_creature, pPlayer); + m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); break; + case 20:{ + Unit* Mercenary = m_creature->FindNearestCreature(MOB_MERCENARY, 99); + if (Mercenary) + { + DoScriptText(SAY_MERCENARY_4, Mercenary); + CAST_CRE(Mercenary)->AI()->AttackStart(m_creature); + AttackStart(Mercenary); + } + }break; + case 21: DoScriptText(SAY_PROGRESS_5, m_creature); + m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); break; + case 28: DoScriptText(SAY_PROGRESS_6, m_creature); break; + case 29: DoScriptText(SAY_PROGRESS_7, m_creature); break; + case 30: DoScriptText(SAY_PROGRESS_8, m_creature); break; + case 31: m_creature->SummonCreature(NPC_PILOT, 1088.77, -2985.39, 91.84, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 300000); + m_creature->setDeathState(JUST_DIED); + Completed = true; + pPlayer->GroupEventHappens(QUEST_ESCAPE, m_creature); + break; + } + } + + void Reset() + { + m_creature->setDeathState(ALIVE); + Completed = false; + if (!IsBeingEscorted) + { + if (m_creature->getStandState() == UNIT_STAND_STATE_DEAD) + m_creature->SetStandState(UNIT_STAND_STATE_STAND); + } + } +}; + +bool QuestAccept_npc_wizzlecrank_shredder(Player* pPlayer, Creature* pCreature, Quest const* quest) +{ + if (quest->GetQuestId() == QUEST_ESCAPE) + { + pCreature->setFaction(FACTION_RATCHET); + if (npc_escortAI* pEscortAI = CAST_AI(npc_wizzlecrank_shredderAI, pCreature->AI())) + pEscortAI->Start(true, false, pPlayer->GetGUID()); + } + return true; +} + +CreatureAI* GetAI_npc_wizzlecrank_shredderAI(Creature* pCreature) +{ + npc_wizzlecrank_shredderAI* thisAI = new npc_wizzlecrank_shredderAI(pCreature); + + thisAI->AddWaypoint(0, 1109.15, -3104.11, 82.41, 6000); + thisAI->AddWaypoint(1, 1105.39, -3102.86, 82.74, 2000); + thisAI->AddWaypoint(2, 1104.97, -3108.52, 83.10, 1000); + thisAI->AddWaypoint(3, 1110.01, -3110.48, 82.81, 1000); + thisAI->AddWaypoint(4, 1111.72, -3103.03, 82.21, 1000); + thisAI->AddWaypoint(5, 1106.98, -3099.44, 82.18, 1000); + thisAI->AddWaypoint(6, 1103.74, -3103.29, 83.05, 1000); + thisAI->AddWaypoint(7, 1112.55, -3106.56, 82.31, 1000); + thisAI->AddWaypoint(8, 1108.12, -3111.04, 82.99, 1000); + thisAI->AddWaypoint(9, 1109.32, -3100.39, 82.08, 1000); + thisAI->AddWaypoint(10, 1109.32, -3100.39, 82.08, 6000); + thisAI->AddWaypoint(11, 1098.92, -3095.14, 82.97); + thisAI->AddWaypoint(12, 1100.94, -3082.60, 82.83); + thisAI->AddWaypoint(13, 1101.12, -3068.83, 82.53); + thisAI->AddWaypoint(14, 1096.97, -3051.99, 82.50); + thisAI->AddWaypoint(15, 1094.06, -3036.79, 82.70); + thisAI->AddWaypoint(16, 1098.22, -3027.84, 83.79); + thisAI->AddWaypoint(17, 1109.51, -3015.92, 85.73); + thisAI->AddWaypoint(18, 1119.87, -3007.21, 87.08); + thisAI->AddWaypoint(19, 1130.23, -3002.49, 91.27, 5000); + thisAI->AddWaypoint(20, 1130.23, -3002.49, 91.27, 3000); + thisAI->AddWaypoint(21, 1130.23, -3002.49, 91.27, 4000); + thisAI->AddWaypoint(22, 1129.73, -2985.89, 92.46); + thisAI->AddWaypoint(23, 1124.10, -2983.29, 92.81); + thisAI->AddWaypoint(24, 1111.74, -2992.38, 91.59); + thisAI->AddWaypoint(25, 1111.06, -2976.54, 91.81); + thisAI->AddWaypoint(26, 1099.91, -2991.17, 91.67); + thisAI->AddWaypoint(27, 1096.32, -2981.55, 91.73); + thisAI->AddWaypoint(28, 1091.28, -2985.82, 91.74, 4000); + thisAI->AddWaypoint(29, 1091.28, -2985.82, 91.74, 3000); + thisAI->AddWaypoint(30, 1091.28, -2985.82, 91.74, 7000); + thisAI->AddWaypoint(31, 1091.28, -2985.82, 91.74, 3000); + + return thisAI; +} + +void AddSC_the_barrens() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="npc_beaten_corpse"; + newscript->pGossipHello = &GossipHello_npc_beaten_corpse; + newscript->pGossipSelect = &GossipSelect_npc_beaten_corpse; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_gilthares"; + newscript->GetAI = &GetAI_npc_gilthares; + newscript->pQuestAccept = &QuestAccept_npc_gilthares; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_sputtervalve"; + newscript->pGossipHello = &GossipHello_npc_sputtervalve; + newscript->pGossipSelect = &GossipSelect_npc_sputtervalve; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_taskmaster_fizzule"; + newscript->GetAI = &GetAI_npc_taskmaster_fizzule; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_twiggy_flathead"; + newscript->GetAI = &GetAI_npc_twiggy_flathead; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_wizzlecrank_shredder"; + newscript->GetAI = &GetAI_npc_wizzlecrank_shredderAI; + newscript->pQuestAccept = &QuestAccept_npc_wizzlecrank_shredder; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/thousand_needles.cpp b/src/bindings/scripts/scripts/kalimdor/thousand_needles.cpp new file mode 100644 index 00000000000..bb3bcc8ba5b --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/thousand_needles.cpp @@ -0,0 +1,413 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Thousand Needles +SD%Complete: 100 +SDComment: Support for Quest: 1950, 4770, 4904, 4966 +SDCategory: Thousand Needles +EndScriptData */ + +/* ContentData +npc_kanati +npc_lakota_windsong +npc_swiftmountain +npc_plucky +EndContentData */ + +#include "precompiled.h" +#include "../../npc/npc_escortAI.h" + +/*##### +# npc_kanati +######*/ + +enum +{ + SAY_KAN_START = -1000410, + + QUEST_PROTECT_KANATI = 4966, + NPC_GALAK_ASS = 10720 +}; + +const float m_afGalakLoc[]= {-4867.387695, -1357.353760, -48.226 }; + +struct TRINITY_DLL_DECL npc_kanatiAI : public npc_escortAI +{ + npc_kanatiAI(Creature* pCreature) : npc_escortAI(pCreature) { } + + void Reset() { } + + void WaypointReached(uint32 uiPointId) + { + switch(uiPointId) + { + case 0: + DoScriptText(SAY_KAN_START, m_creature); + DoSpawnGalak(); + break; + case 1: + if (Player* pPlayer = Unit::GetPlayer(PlayerGUID)) + pPlayer->GroupEventHappens(QUEST_PROTECT_KANATI, m_creature); + break; + } + } + + void DoSpawnGalak() + { + for(int i = 0; i < 3; ++i) + m_creature->SummonCreature(NPC_GALAK_ASS, + m_afGalakLoc[0], m_afGalakLoc[1], m_afGalakLoc[2], 0.0f, + TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + } + + void JustSummoned(Creature* pSummoned) + { + pSummoned->AI()->AttackStart(m_creature); + } +}; + +CreatureAI* GetAI_npc_kanati(Creature* pCreature) +{ + npc_kanatiAI* pTempAI = new npc_kanatiAI(pCreature); + + pTempAI->FillPointMovementListForCreature(); + + return (CreatureAI*)pTempAI; +} + +bool QuestAccept_npc_kanati(Player* pPlayer, Creature* pCreature, const Quest* pQuest) +{ + if (pQuest->GetQuestId() == QUEST_PROTECT_KANATI) + { + if (npc_kanatiAI* pEscortAI = CAST_AI(npc_kanatiAI, pCreature->AI())) + pEscortAI->Start(false, false, pPlayer->GetGUID(), pQuest, true); + } + return true; +} + +/*###### +# npc_lakota_windsong +######*/ + +enum +{ + SAY_LAKO_START = -1000365, + SAY_LAKO_LOOK_OUT = -1000366, + SAY_LAKO_HERE_COME = -1000367, + SAY_LAKO_MORE = -1000368, + SAY_LAKO_END = -1000369, + + QUEST_FREE_AT_LAST = 4904, + NPC_GRIM_BANDIT = 10758, + FACTION_ESCORTEE_LAKO = 232, //guessed + + ID_AMBUSH_1 = 0, + ID_AMBUSH_2 = 2, + ID_AMBUSH_3 = 4 +}; + +float m_afBanditLoc[6][6]= +{ + {-4905.479492, -2062.732666, 84.352}, + {-4915.201172, -2073.528320, 84.733}, + {-4878.883301, -1986.947876, 91.966}, + {-4877.503906, -1966.113403, 91.859}, + {-4767.985352, -1873.169189, 90.192}, + {-4788.861328, -1888.007813, 89.888} +}; + +struct TRINITY_DLL_DECL npc_lakota_windsongAI : public npc_escortAI +{ + npc_lakota_windsongAI(Creature* pCreature) : npc_escortAI(pCreature) { } + + void Reset() { } + + void WaypointReached(uint32 uiPointId) + { + switch(uiPointId) + { + case 8: + DoScriptText(SAY_LAKO_LOOK_OUT, m_creature); + DoSpawnBandits(ID_AMBUSH_1); + break; + case 14: + DoScriptText(SAY_LAKO_HERE_COME, m_creature); + DoSpawnBandits(ID_AMBUSH_2); + break; + case 21: + DoScriptText(SAY_LAKO_MORE, m_creature); + DoSpawnBandits(ID_AMBUSH_3); + break; + case 45: + if (Player* pPlayer = (Player*)Unit::GetUnit(*m_creature, PlayerGUID)) + pPlayer->GroupEventHappens(QUEST_FREE_AT_LAST, m_creature); + break; + } + } + + void DoSpawnBandits(int uiAmbushId) + { + for(int i = 0; i < 2; ++i) + m_creature->SummonCreature(NPC_GRIM_BANDIT, + m_afBanditLoc[i+uiAmbushId][0], m_afBanditLoc[i+uiAmbushId][1], m_afBanditLoc[i+uiAmbushId][2], 0.0f, + TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000); + } +}; + +CreatureAI* GetAI_npc_lakota_windsong(Creature* pCreature) +{ + npc_lakota_windsongAI* pTempAI = new npc_lakota_windsongAI(pCreature); + + pTempAI->FillPointMovementListForCreature(); + + return (CreatureAI*)pTempAI; +} + +bool QuestAccept_npc_lakota_windsong(Player* pPlayer, Creature* pCreature, const Quest* pQuest) +{ + if (pQuest->GetQuestId() == QUEST_FREE_AT_LAST) + { + DoScriptText(SAY_LAKO_START, pCreature, pPlayer); + pCreature->setFaction(FACTION_ESCORTEE_LAKO); + + if (npc_lakota_windsongAI* pEscortAI = CAST_AI(npc_lakota_windsongAI, pCreature->AI())) + pEscortAI->Start(false, false, pPlayer->GetGUID(), pQuest); + } + return true; +} + +/*###### +# npc_paoka_swiftmountain +######*/ + +enum +{ + SAY_START = -1000147, + SAY_WYVERN = -1000148, + SAY_COMPLETE = -1000149, + + QUEST_HOMEWARD = 4770, + NPC_WYVERN = 4107, + FACTION_ESCORTEE = 232 //guessed +}; + +float m_afWyvernLoc[3][3]= +{ + {-4990.606, -906.057, -5.343}, + {-4970.241, -927.378, -4.951}, + {-4985.364, -952.528, -5.199} +}; + +struct TRINITY_DLL_DECL npc_paoka_swiftmountainAI : public npc_escortAI +{ + npc_paoka_swiftmountainAI(Creature* pCreature) : npc_escortAI(pCreature) { } + + void Reset() { } + + void WaypointReached(uint32 uiPointId) + { + switch(uiPointId) + { + case 15: + DoScriptText(SAY_WYVERN, m_creature); + DoSpawnWyvern(); + break; + case 26: + DoScriptText(SAY_COMPLETE, m_creature); + break; + case 27: + if (Player* pPlayer = (Player*)Unit::GetUnit(*m_creature, PlayerGUID)) + pPlayer->GroupEventHappens(QUEST_HOMEWARD, m_creature); + break; + } + } + + void DoSpawnWyvern() + { + for(int i = 0; i < 3; ++i) + m_creature->SummonCreature(NPC_WYVERN, + m_afWyvernLoc[i][0], m_afWyvernLoc[i][1], m_afWyvernLoc[i][2], 0.0f, + TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000); + } +}; + +CreatureAI* GetAI_npc_paoka_swiftmountain(Creature* pCreature) +{ + npc_paoka_swiftmountainAI* pTempAI = new npc_paoka_swiftmountainAI(pCreature); + + pTempAI->FillPointMovementListForCreature(); + + return (CreatureAI*)pTempAI; +} + +bool QuestAccept_npc_paoka_swiftmountain(Player* pPlayer, Creature* pCreature, const Quest* pQuest) +{ + if (pQuest->GetQuestId() == QUEST_HOMEWARD) + { + DoScriptText(SAY_START, pCreature, pPlayer); + pCreature->setFaction(FACTION_ESCORTEE); + + if (npc_paoka_swiftmountainAI* pEscortAI = CAST_AI(npc_paoka_swiftmountainAI,pCreature->AI())) + pEscortAI->Start(false, false, pPlayer->GetGUID(), pQuest); + } + return true; +} + +/*##### +# npc_plucky +######*/ + +#define GOSSIP_P "Please tell me the Phrase.." + +enum +{ + FACTION_FRIENDLY = 35, + QUEST_SCOOP = 1950, + SPELL_PLUCKY_HUMAN = 9192, + SPELL_PLUCKY_CHICKEN = 9220 +}; + +struct TRINITY_DLL_DECL npc_pluckyAI : public ScriptedAI +{ + npc_pluckyAI(Creature *c) : ScriptedAI(c) { m_uiNormFaction = c->getFaction(); } + + uint32 m_uiNormFaction; + uint32 m_uiResetTimer; + + void Reset() + { + m_uiResetTimer = 120000; + + if (m_creature->getFaction() != m_uiNormFaction) + m_creature->setFaction(m_uiNormFaction); + + if (m_creature->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP)) + m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + + m_creature->CastSpell(m_creature, SPELL_PLUCKY_CHICKEN, false); + } + + void ReceiveEmote(Player* pPlayer, uint32 uiTextEmote) + { + if (pPlayer->GetQuestStatus(QUEST_SCOOP) == QUEST_STATUS_INCOMPLETE) + { + if (uiTextEmote == TEXTEMOTE_BECKON) + { + m_creature->setFaction(FACTION_FRIENDLY); + m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + m_creature->CastSpell(m_creature, SPELL_PLUCKY_HUMAN, false); + } + } + + if (uiTextEmote == TEXTEMOTE_CHICKEN) + { + if (m_creature->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP)) + return; + else + { + m_creature->setFaction(FACTION_FRIENDLY); + m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + m_creature->CastSpell(m_creature, SPELL_PLUCKY_HUMAN, false); + m_creature->HandleEmoteCommand(EMOTE_ONESHOT_WAVE); + } + } + } + + void UpdateAI(const uint32 uiDiff) + { + if (m_creature->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP)) + { + if (m_uiResetTimer < uiDiff) + { + if (!m_creature->getVictim()) + EnterEvadeMode(); + else + m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + + return; + } + else + m_uiResetTimer -= uiDiff; + } + + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } +}; + +bool GossipHello_npc_plucky(Player* pPlayer, Creature* pCreature) +{ + if (pPlayer->GetQuestStatus(QUEST_SCOOP) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_P, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + pPlayer->SEND_GOSSIP_MENU(738, pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_plucky(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch(uiAction) + { + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->CompleteQuest(QUEST_SCOOP); + break; + } + return true; +} + +CreatureAI* GetAI_npc_plucky(Creature* pCreature) +{ + return new npc_pluckyAI(pCreature); +} + +/*##### +# +######*/ + +void AddSC_thousand_needles() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "npc_kanati"; + newscript->GetAI = &GetAI_npc_kanati; + newscript->pQuestAccept = &QuestAccept_npc_kanati; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_lakota_windsong"; + newscript->GetAI = &GetAI_npc_lakota_windsong; + newscript->pQuestAccept = &QuestAccept_npc_lakota_windsong; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_paoka_swiftmountain"; + newscript->GetAI = &GetAI_npc_paoka_swiftmountain; + newscript->pQuestAccept = &QuestAccept_npc_paoka_swiftmountain; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_plucky"; + newscript->GetAI = &GetAI_npc_plucky; + newscript->pGossipHello = &GossipHello_npc_plucky; + newscript->pGossipSelect = &GossipSelect_npc_plucky; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/thunder_bluff.cpp b/src/bindings/scripts/scripts/kalimdor/thunder_bluff.cpp new file mode 100644 index 00000000000..f3f21e65440 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/thunder_bluff.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: Thunder_Bluff +SD%Complete: 100 +SDComment: Quest support: 925 +SDCategory: Thunder Bluff +EndScriptData */ + +#include "precompiled.h" + +/*##### +# npc_cairne_bloodhoof +######*/ + +#define SPELL_BERSERKER_CHARGE 16636 +#define SPELL_CLEAVE 16044 +#define SPELL_MORTAL_STRIKE 16856 +#define SPELL_THUNDERCLAP 23931 +#define SPELL_UPPERCUT 22916 + +#define GOSSIP_HCB "I know this is rather silly but a young ward who is a bit shy would like your hoofprint." +//TODO: verify abilities/timers +struct TRINITY_DLL_DECL npc_cairne_bloodhoofAI : public ScriptedAI +{ + npc_cairne_bloodhoofAI(Creature* c) : ScriptedAI(c) {} + + uint32 BerserkerCharge_Timer; + uint32 Cleave_Timer; + uint32 MortalStrike_Timer; + uint32 Thunderclap_Timer; + uint32 Uppercut_Timer; + + void Reset() + { + BerserkerCharge_Timer = 30000; + Cleave_Timer = 5000; + MortalStrike_Timer = 10000; + Thunderclap_Timer = 15000; + Uppercut_Timer = 10000; + } + + void EnterCombat(Unit *who) {} + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (BerserkerCharge_Timer < diff) + { + Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0); + if (target) + DoCast(target,SPELL_BERSERKER_CHARGE); + BerserkerCharge_Timer = 25000; + }else BerserkerCharge_Timer -= diff; + + if (Uppercut_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_UPPERCUT); + Uppercut_Timer = 20000; + }else Uppercut_Timer -= diff; + + if (Thunderclap_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_THUNDERCLAP); + Thunderclap_Timer = 15000; + }else Thunderclap_Timer -= diff; + + if (MortalStrike_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_MORTAL_STRIKE); + MortalStrike_Timer = 15000; + }else MortalStrike_Timer -= diff; + + if (Cleave_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_CLEAVE); + Cleave_Timer = 7000; + }else Cleave_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_npc_cairne_bloodhoof(Creature* pCreature) +{ + return new npc_cairne_bloodhoofAI (pCreature); +} + +bool GossipHello_npc_cairne_bloodhoof(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->GetQuestStatus(925) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HCB, GOSSIP_SENDER_MAIN, GOSSIP_SENDER_INFO); + + pPlayer->SEND_GOSSIP_MENU(7013, pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_cairne_bloodhoof(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_SENDER_INFO) + { + pPlayer->CastSpell(pPlayer, 23123, false); + pPlayer->SEND_GOSSIP_MENU(7014, pCreature->GetGUID()); + } + return true; +} + +void AddSC_thunder_bluff() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="npc_cairne_bloodhoof"; + newscript->GetAI = &GetAI_npc_cairne_bloodhoof; + newscript->pGossipHello = &GossipHello_npc_cairne_bloodhoof; + newscript->pGossipSelect = &GossipSelect_npc_cairne_bloodhoof; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/winterspring.cpp b/src/bindings/scripts/scripts/kalimdor/winterspring.cpp new file mode 100644 index 00000000000..d5743869108 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/winterspring.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: Winterspring +SD%Complete: 90 +SDComment: Quest support: 5126 (Loraxs' tale missing proper gossip items text). Vendor Rivern Frostwind. Obtain Cache of Mau'ari +SDCategory: Winterspring +EndScriptData */ + +/* ContentData +npc_lorax +npc_rivern_frostwind +npc_witch_doctor_mauari +EndContentData */ + +#include "precompiled.h" + +/*###### +## npc_lorax +######*/ + +#define GOSSIP_HL "Talk to me" + +#define GOSSIP_SL1 "What do you do here?" +#define GOSSIP_SL2 "I can help you" +#define GOSSIP_SL3 "What deal?" +#define GOSSIP_SL4 "Then what happened?" +#define GOSSIP_SL5 "He is not safe, i'll make sure of that." + +bool GossipHello_npc_lorax(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->GetQuestStatus(5126) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HL, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + + pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_lorax(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch (uiAction) + { + case GOSSIP_ACTION_INFO_DEF: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SL1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + pPlayer->SEND_GOSSIP_MENU(3759, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SL2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + pPlayer->SEND_GOSSIP_MENU(3760, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SL3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + pPlayer->SEND_GOSSIP_MENU(3761, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+3: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SL4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4); + pPlayer->SEND_GOSSIP_MENU(3762, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+4: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SL5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5); + pPlayer->SEND_GOSSIP_MENU(3763, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+5: + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->AreaExploredOrEventHappens(5126); + break; + } + return true; +} + +/*###### +## npc_rivern_frostwind +######*/ + +bool GossipHello_npc_rivern_frostwind(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pCreature->isVendor() && pPlayer->GetReputationRank(589) == REP_EXALTED) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); + + pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_rivern_frostwind(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_TRADE) + pPlayer->SEND_VENDORLIST(pCreature->GetGUID()); + + return true; +} + +/*###### +## npc_witch_doctor_mauari +######*/ + +#define GOSSIP_HWDM "I'd like you to make me a new Cache of Mau'ari please." + +bool GossipHello_npc_witch_doctor_mauari(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->GetQuestRewardStatus(975)) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HWDM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + pPlayer->SEND_GOSSIP_MENU(3377, pCreature->GetGUID()); + }else + pPlayer->SEND_GOSSIP_MENU(3375, pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_witch_doctor_mauari(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction ==GOSSIP_ACTION_INFO_DEF+1) + { + pPlayer->CLOSE_GOSSIP_MENU(); + pCreature->CastSpell(pPlayer, 16351, false); + } + + return true; +} + +void AddSC_winterspring() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="npc_lorax"; + newscript->pGossipHello = &GossipHello_npc_lorax; + newscript->pGossipSelect = &GossipSelect_npc_lorax; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_rivern_frostwind"; + newscript->pGossipHello = &GossipHello_npc_rivern_frostwind; + newscript->pGossipSelect = &GossipSelect_npc_rivern_frostwind; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_witch_doctor_mauari"; + newscript->pGossipHello = &GossipHello_npc_witch_doctor_mauari; + newscript->pGossipSelect = &GossipSelect_npc_witch_doctor_mauari; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/northrend/borean_tundra.cpp b/src/bindings/scripts/scripts/northrend/borean_tundra.cpp new file mode 100644 index 00000000000..42b8a01009a --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/borean_tundra.cpp @@ -0,0 +1,356 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Borean_Tundra +SD%Complete: 100 +SDComment: Quest support: 11708. Taxi vendors. +SDCategory: Borean Tundra +EndScriptData */ + +/* ContentData +npc_fizzcrank_fullthrottle +npc_surristrasz +npc_tiare +EndContentData */ + +#include "precompiled.h" + +/*###### +## npc_fizzcrank_fullthrottle +######*/ + +#define GOSSIP_ITEM_GO_ON "Go on." +#define GOSSIP_ITEM_TELL_ME "Tell me what's going on out here, Fizzcrank." + +enum +{ + GOSSIP_TEXTID_FIZZCRANK1 = 12456, + GOSSIP_TEXTID_FIZZCRANK2 = 12457, + GOSSIP_TEXTID_FIZZCRANK3 = 12458, + GOSSIP_TEXTID_FIZZCRANK4 = 12459, + GOSSIP_TEXTID_FIZZCRANK5 = 12460, + GOSSIP_TEXTID_FIZZCRANK6 = 12461, + GOSSIP_TEXTID_FIZZCRANK7 = 12462, + GOSSIP_TEXTID_FIZZCRANK8 = 12463, + GOSSIP_TEXTID_FIZZCRANK9 = 12464, + + QUEST_THE_MECHAGNOMES = 11708 +}; + +bool GossipHello_npc_fizzcrank_fullthrottle(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->GetQuestStatus(QUEST_THE_MECHAGNOMES) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_TELL_ME, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_fizzcrank_fullthrottle(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch(uiAction) + { + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_GO_ON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_FIZZCRANK1, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_GO_ON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_FIZZCRANK2, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+3: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_GO_ON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_FIZZCRANK3, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+4: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_GO_ON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_FIZZCRANK4, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+5: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_GO_ON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_FIZZCRANK5, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+6: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_GO_ON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_FIZZCRANK6, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+7: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_GO_ON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_FIZZCRANK7, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+8: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_GO_ON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_FIZZCRANK8, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+9: + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_FIZZCRANK9, pCreature->GetGUID()); + pPlayer->AreaExploredOrEventHappens(QUEST_THE_MECHAGNOMES); + break; + } + return true; +} + +/*###### +## npc_surristrasz +######*/ + +#define GOSSIP_ITEM_FREE_FLIGHT "I'd like passage to the Transitus Shield." +#define GOSSIP_ITEM_FLIGHT "May I use a drake to fly elsewhere?" + +enum +{ + SPELL_ABMER_TO_COLDARRA = 46064 +}; + +bool GossipHello_npc_surristrasz(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pCreature->isTaxi()) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_FREE_FLIGHT, GOSSIP_SENDER_MAIN, GOSSIP_OPTION_GOSSIP); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_TRAINER, GOSSIP_ITEM_FLIGHT, GOSSIP_SENDER_MAIN, GOSSIP_OPTION_TAXIVENDOR); + } + + pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_surristrasz(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_OPTION_GOSSIP) + { + pPlayer->CLOSE_GOSSIP_MENU(); + + //TaxiPath 795 (amber to coldarra) + pPlayer->CastSpell(pPlayer, SPELL_ABMER_TO_COLDARRA, true); + } + + if (uiAction == GOSSIP_OPTION_TAXIVENDOR) + pPlayer->GetSession()->SendTaxiMenu(pCreature); + + return true; +} + +/*###### +## npc_tiare +######*/ + +#define GOSSIP_ITEM_TELEPORT "Teleport me to Amber Ledge, please." + +enum +{ + SPELL_TELEPORT_COLDARRA = 50135 +}; + +bool GossipHello_npc_tiare(Player* pPlayer, Creature* pCreature) +{ + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_TELEPORT, GOSSIP_SENDER_MAIN, GOSSIP_OPTION_GOSSIP); + pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_tiare(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_OPTION_GOSSIP) + { + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->CastSpell(pPlayer, SPELL_TELEPORT_COLDARRA, true); + } + return true; +} + +/*###### +## npc_sinkhole_kill_credit +######*/ + +enum +{ + SPELL_SET_CART = 46797, + SPELL_EXPLODE_CART = 46799, + SPELL_SUMMON_CART = 46798, + SPELL_SUMMON_WORM = 46800, +}; + +struct TRINITY_DLL_DECL npc_sinkhole_kill_creditAI : public ScriptedAI +{ + npc_sinkhole_kill_creditAI(Creature* c) : ScriptedAI(c){} + + uint32 Phase_Timer; + uint8 Phase; + Unit* Caster; + + void Reset() + { + Phase_Timer = 500; + Phase = 0; + Caster = NULL; + } + + void SpellHit(Unit *caster, const SpellEntry *spell) + { + if (Phase) + return; + + if (spell->Id == SPELL_SET_CART && CAST_PLR(caster)->GetQuestStatus(11897) == QUEST_STATUS_INCOMPLETE) + { + Phase = 1; + Caster = caster; + } + } + + void EnterCombat(Unit* who) { } + + void UpdateAI(const uint32 diff) + { + if (!Phase) + return; + + if (Phase_Timer < diff) + { + switch (Phase) + { + case 1: + DoCast(m_creature, SPELL_EXPLODE_CART, true); + DoCast(m_creature, SPELL_SUMMON_CART, true); + if (GameObject* cart = m_creature->FindNearestGameObject(188160,3)) + cart->SetUInt32Value(GAMEOBJECT_FACTION, 14); + Phase_Timer = 3000; + Phase = 2; + break; + case 2: + if (GameObject* cart = m_creature->FindNearestGameObject(188160,3)) + cart->UseDoorOrButton(); + DoCast(m_creature, SPELL_EXPLODE_CART, true); + Phase_Timer = 3000; + Phase = 3; + break; + case 3: + DoCast(m_creature, SPELL_EXPLODE_CART, true); + Phase_Timer = 2000; + Phase = 4; + case 5: + DoCast(m_creature, SPELL_SUMMON_WORM, true); + if (Unit* worm = m_creature->FindNearestCreature(26250, 3)) + { + worm->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + worm->HandleEmoteCommand(EMOTE_ONESHOT_EMERGE); + } + Phase_Timer = 1000; + Phase = 6; + break; + case 6: + DoCast(m_creature, SPELL_EXPLODE_CART, true); + if (Unit* worm = m_creature->FindNearestCreature(26250, 3)) + { + m_creature->DealDamage(worm, worm->GetHealth()); + worm->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); + } + Phase_Timer = 2000; + Phase = 7; + break; + case 7: + DoCast(m_creature, SPELL_EXPLODE_CART, true); + CAST_PLR(Caster)->KilledMonster(m_creature->GetCreatureInfo(),m_creature->GetGUID()); + Phase_Timer = 5000; + Phase = 8; + break; + case 8: + EnterEvadeMode(); + break; + } + } else Phase_Timer -= diff; + + } + +}; + +CreatureAI* GetAI_npc_sinkhole_kill_credit(Creature* pCreature) +{ + return new npc_sinkhole_kill_creditAI(pCreature); +} + +/*###### +## npc_khunok_the_behemoth +######*/ + +struct TRINITY_DLL_DECL npc_khunok_the_behemothAI : public ScriptedAI +{ + npc_khunok_the_behemothAI(Creature *c) : ScriptedAI(c) {} + + void MoveInLineOfSight(Unit *who) + { + ScriptedAI::MoveInLineOfSight(who); + + if (who->GetTypeId() != TYPEID_UNIT) + return; + + if (who->GetEntry() == 25861 && me->IsWithinDistInMap(who, 10.0f)) + { + if (Unit *owner = who->GetOwner()) + { + if (owner->GetTypeId() == TYPEID_PLAYER) + { + DoCast(owner, 46231, true); + CAST_CRE(who)->ForcedDespawn(); + } + } + } + } +}; + +CreatureAI* GetAI_npc_khunok_the_behemoth(Creature* pCreature) +{ + return new npc_khunok_the_behemothAI(pCreature); +} + +void AddSC_borean_tundra() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "npc_fizzcrank_fullthrottle"; + newscript->pGossipHello = &GossipHello_npc_fizzcrank_fullthrottle; + newscript->pGossipSelect = &GossipSelect_npc_fizzcrank_fullthrottle; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_surristrasz"; + newscript->pGossipHello = &GossipHello_npc_surristrasz; + newscript->pGossipSelect = &GossipSelect_npc_surristrasz; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_tiare"; + newscript->pGossipHello = &GossipHello_npc_tiare; + newscript->pGossipSelect = &GossipSelect_npc_tiare; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_sinkhole_kill_credit"; + newscript->GetAI = &GetAI_npc_sinkhole_kill_credit; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_khunok_the_behemoth"; + newscript->GetAI = &GetAI_npc_khunok_the_behemoth; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/dragonblight.cpp b/src/bindings/scripts/scripts/northrend/dragonblight.cpp new file mode 100644 index 00000000000..796d689e4aa --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/dragonblight.cpp @@ -0,0 +1,71 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Dragonblight +SD%Complete: 100 +SDComment: +SDCategory: Dragonblight +EndScriptData */ + +/* ContentData +npc_alexstrasza_wr_gate +EndContentData */ + +#include "precompiled.h" + +enum +{ + QUEST_RETURN_TO_AG_A = 12499, + QUEST_RETURN_TO_AG_H = 12500, + MOVIE_ID_GATES = 14 +}; + +#define GOSSIP_ITEM_WHAT_HAPPENED "Alexstrasza, can you show me what happened here?" + +bool GossipHello_npc_alexstrasza_wr_gate(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->GetQuestRewardStatus(QUEST_RETURN_TO_AG_A) || pPlayer->GetQuestRewardStatus(QUEST_RETURN_TO_AG_H)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_WHAT_HAPPENED, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_alexstrasza_wr_gate(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + { + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->SendMovieStart(MOVIE_ID_GATES); + } + + return true; +} + +void AddSC_dragonblight() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "npc_alexstrasza_wr_gate"; + newscript->pGossipHello = &GossipHello_npc_alexstrasza_wr_gate; + newscript->pGossipSelect = &GossipSelect_npc_alexstrasza_wr_gate; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/grizzly_hills.cpp b/src/bindings/scripts/scripts/northrend/grizzly_hills.cpp new file mode 100644 index 00000000000..976122cd296 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/grizzly_hills.cpp @@ -0,0 +1,126 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Grizzly_Hills +SD%Complete: 80 +SDComment: Quest support: 12247 +SDCategory: Grizzly Hills +EndScriptData */ + +/* ContentData +npc_orsonn_and_kodian +EndContentData */ + +#include "precompiled.h" + +#define GOSSIP_ITEM1 "You're free to go Orsonn, but first tell me what's wrong with the furbolg." +#define GOSSIP_ITEM2 "What happened then?" +#define GOSSIP_ITEM3 "Thank you, Son of Ursoc. I'll see what can be done." +#define GOSSIP_ITEM4 "Who was this stranger?" +#define GOSSIP_ITEM5 "Thank you, Kodian. I'll do what I can." + +enum +{ + GOSSIP_TEXTID_ORSONN1 = 12793, + GOSSIP_TEXTID_ORSONN2 = 12794, + GOSSIP_TEXTID_ORSONN3 = 12796, + + GOSSIP_TEXTID_KODIAN1 = 12797, + GOSSIP_TEXTID_KODIAN2 = 12798, + + NPC_ORSONN = 27274, + NPC_KODIAN = 27275, + + //trigger creatures + NPC_ORSONN_CREDIT = 27322, + NPC_KODIAN_CREDIT = 27321, + + QUEST_CHILDREN_OF_URSOC = 12247 +}; + +bool GossipHello_npc_orsonn_and_kodian(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->GetQuestStatus(QUEST_CHILDREN_OF_URSOC) == QUEST_STATUS_INCOMPLETE) + { + switch(pCreature->GetEntry()) + { + case NPC_ORSONN: + if (!pPlayer->GetReqKillOrCastCurrentCount(QUEST_CHILDREN_OF_URSOC, NPC_ORSONN_CREDIT)) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_ORSONN1, pCreature->GetGUID()); + return true; + } + break; + case NPC_KODIAN: + if (!pPlayer->GetReqKillOrCastCurrentCount(QUEST_CHILDREN_OF_URSOC, NPC_KODIAN_CREDIT)) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_KODIAN1, pCreature->GetGUID()); + return true; + } + break; + } + } + + pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_orsonn_and_kodian(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch(uiAction) + { + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_ORSONN2, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_ORSONN3, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+3: + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->TalkedToCreature(NPC_ORSONN_CREDIT, pCreature->GetGUID()); + break; + + case GOSSIP_ACTION_INFO_DEF+4: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_KODIAN2, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+5: + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->TalkedToCreature(NPC_KODIAN_CREDIT, pCreature->GetGUID()); + break; + } + + return true; +} + +void AddSC_grizzly_hills() +{ + Script* newscript; + + newscript = new Script; + newscript->Name = "npc_orsonn_and_kodian"; + newscript->pGossipHello = &GossipHello_npc_orsonn_and_kodian; + newscript->pGossipSelect = &GossipSelect_npc_orsonn_and_kodian; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/icecrown.cpp b/src/bindings/scripts/scripts/northrend/icecrown.cpp new file mode 100644 index 00000000000..971cb454085 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/icecrown.cpp @@ -0,0 +1,117 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Icecrown +SD%Complete: 100 +SDComment: Quest support: 12807 +SDCategory: Icecrown +EndScriptData */ + +/* ContentData +npc_arete +EndContentData */ + +#include "precompiled.h" + +/*###### +## npc_arete +######*/ + +#define GOSSIP_ARETE_ITEM1 "Lord-Commander, I would hear your tale." +#define GOSSIP_ARETE_ITEM2 "" +#define GOSSIP_ARETE_ITEM3 "I thought that they now called themselves the Scarlet Onslaught?" +#define GOSSIP_ARETE_ITEM4 "Where did the grand admiral go?" +#define GOSSIP_ARETE_ITEM5 "That's fine. When do I start?" +#define GOSSIP_ARETE_ITEM6 "Let's finish this!" +#define GOSSIP_ARETE_ITEM7 "That's quite a tale, Lord-Commander." + +enum +{ + GOSSIP_TEXTID_ARETE1 = 13525, + GOSSIP_TEXTID_ARETE2 = 13526, + GOSSIP_TEXTID_ARETE3 = 13527, + GOSSIP_TEXTID_ARETE4 = 13528, + GOSSIP_TEXTID_ARETE5 = 13529, + GOSSIP_TEXTID_ARETE6 = 13530, + GOSSIP_TEXTID_ARETE7 = 13531, + + QUEST_THE_STORY_THUS_FAR = 12807 +}; + +bool GossipHello_npc_arete(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->GetQuestStatus(QUEST_THE_STORY_THUS_FAR) == QUEST_STATUS_INCOMPLETE) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ARETE_ITEM1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_ARETE1, pCreature->GetGUID()); + return true; + } + + pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_arete(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch(uiAction) + { + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ARETE_ITEM2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_ARETE2, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ARETE_ITEM3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_ARETE3, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+3: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ARETE_ITEM4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_ARETE4, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+4: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ARETE_ITEM5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_ARETE5, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+5: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ARETE_ITEM6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_ARETE6, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+6: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ARETE_ITEM7, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_ARETE7, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+7: + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->AreaExploredOrEventHappens(QUEST_THE_STORY_THUS_FAR); + break; + } + + return true; +} + +void AddSC_icecrown() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "npc_arete"; + newscript->pGossipHello = &GossipHello_npc_arete; + newscript->pGossipSelect = &GossipSelect_npc_arete; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/sholazar_basin.cpp b/src/bindings/scripts/scripts/northrend/sholazar_basin.cpp new file mode 100644 index 00000000000..755cf3aa638 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/sholazar_basin.cpp @@ -0,0 +1,180 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Sholazar_Basin +SD%Complete: 100 +SDComment: Quest support: 12570 +SDCategory: Sholazar_Basin +EndScriptData */ + +/* ContentData +npc_injured_rainspeaker_oracle +EndContentData */ + +#include "precompiled.h" +#include "../../npc/npc_escortAI.h" + +/*###### +## npc_injured_rainspeaker_oracle +######*/ + +#define GOSSIP_ITEM1 "I am ready to travel to your village now." + +enum +{ + SAY_START_IRO = -1571000, + SAY_QUEST_ACCEPT_IRO = -1571001, + SAY_END_IRO = -1571002, + + QUEST_FORTUNATE_MISUNDERSTANDINGS = 12570, + FACTION_ESCORTEE_A = 774, + FACTION_ESCORTEE_H = 775 +}; + +struct TRINITY_DLL_DECL npc_injured_rainspeaker_oracleAI : public npc_escortAI +{ + npc_injured_rainspeaker_oracleAI(Creature* c) : npc_escortAI(c) { c_guid = c->GetGUID(); } + + uint64 c_guid; + + void Reset() + { + me->RestoreFaction(); + // if we will have other way to assign this to only one npc remove this part + if (GUID_LOPART(me->GetGUID()) != 101030) + { + me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER); + me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + } + } + + void WaypointReached(uint32 i) + { + Player* pPlayer = Unit::GetPlayer(PlayerGUID); + + if (!pPlayer) + return; + + switch(i) + { + case 1: SetRun(); break; + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_SWIMMING); + m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_JUMPING); + m_creature->SetSpeed(MOVE_SWIM, 0.85f, true); + m_creature->AddUnitMovementFlag(MOVEMENTFLAG_SWIMMING + MOVEMENTFLAG_LEVITATING); + break; + case 19: + m_creature->SetUnitMovementFlags(MOVEMENTFLAG_JUMPING); + break; + case 28: + if (Player* pPlayer = Unit::GetPlayer(PlayerGUID)) + pPlayer->GroupEventHappens(QUEST_FORTUNATE_MISUNDERSTANDINGS, m_creature); + // me->RestoreFaction(); + DoScriptText(SAY_END_IRO,m_creature); + SetRun(false); + break; + } + } + + void JustDied(Unit* killer) + { + if (!IsBeingEscorted) + return; + + if (Player* pPlayer = Unit::GetPlayer(PlayerGUID)) + { + if (pPlayer->GetQuestStatus(QUEST_FORTUNATE_MISUNDERSTANDINGS) != QUEST_STATUS_COMPLETE) + pPlayer->FailQuest(QUEST_FORTUNATE_MISUNDERSTANDINGS); + } + } + + void UpdateAI(Player* pPlayer, Creature* pCreature,const uint32 diff) + { + npc_escortAI::UpdateAI(diff); + } +}; + + +bool GossipHello_npc_injured_rainspeaker_oracle(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->GetQuestStatus(QUEST_FORTUNATE_MISUNDERSTANDINGS) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_injured_rainspeaker_oracle(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + { + CAST_AI(npc_escortAI, (pCreature->AI()))->Start(true, false, pPlayer->GetGUID()); + CAST_AI(npc_escortAI, (pCreature->AI()))->SetMaxPlayerDistance(35.0f); + pCreature->SetUnitMovementFlags(MOVEMENTFLAG_JUMPING); + DoScriptText(SAY_START_IRO, pCreature); + + switch (pPlayer->GetTeam()){ + case ALLIANCE: + pCreature->setFaction(FACTION_ESCORTEE_A); + break; + case HORDE: + pCreature->setFaction(FACTION_ESCORTEE_H); + break; + } + } + return true; +} + +bool QuestAccept_npc_injured_rainspeaker_oracle(Player* pPlayer, Creature* pCreature, Quest const *_Quest) +{ + DoScriptText(SAY_QUEST_ACCEPT_IRO, pCreature); + return false; +} + +CreatureAI* GetAI_npc_injured_rainspeaker_oracle(Creature* pCreature) +{ + npc_injured_rainspeaker_oracleAI* thisAI = new npc_injured_rainspeaker_oracleAI(pCreature); + + thisAI->FillPointMovementListForCreature(); + + return thisAI; +} + +void AddSC_sholazar_basin() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "npc_injured_rainspeaker_oracle"; + newscript->GetAI = &GetAI_npc_injured_rainspeaker_oracle; + newscript->pGossipHello = &GossipHello_npc_injured_rainspeaker_oracle; + newscript->pGossipSelect = &GossipSelect_npc_injured_rainspeaker_oracle; + newscript->pQuestAccept = &QuestAccept_npc_injured_rainspeaker_oracle; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/zuldrak.cpp b/src/bindings/scripts/scripts/northrend/zuldrak.cpp new file mode 100644 index 00000000000..988c4957a0c --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/zuldrak.cpp @@ -0,0 +1,184 @@ +/* + * 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" + +/*#### +## npc_drakuru_shackles +####*/ + +enum +{ + SPELL_LEFT_CHAIN = 59951, + SPELL_RIGHT_CHAIN = 59952, + SPELL_UNLOCK_SHACKLE = 55083, + SPELL_FREE_RAGECLAW = 55223, + + NPC_RAGECLAW = 29686 +}; + +struct TRINITY_DLL_DECL npc_drakuru_shacklesAI : public ScriptedAI +{ + npc_drakuru_shacklesAI(Creature *c) : ScriptedAI(c) {} + + Unit* Rageclaw; + + void Reset() + { + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + float x, y, z; + Rageclaw = NULL; + m_creature->GetClosePoint(x, y, z, m_creature->GetObjectSize()/3,0.1); + if (Unit* summon = m_creature->SummonCreature(NPC_RAGECLAW,x,y,z,0,TEMPSUMMON_DEAD_DESPAWN,1000)) + DoActionOnRageclaw(true,summon); + } + + void DoActionOnRageclaw(bool locking, Unit *who) + { + if (!who) + return; + + if (locking) + { + if (who) + { + Rageclaw = who; + + m_creature->SetInFront(Rageclaw); + Rageclaw->SetInFront(m_creature); + + m_creature->CastSpell(Rageclaw, SPELL_LEFT_CHAIN, true); + m_creature->CastSpell(Rageclaw, SPELL_RIGHT_CHAIN, true); + } + } + else + { + DoCast(Rageclaw, SPELL_FREE_RAGECLAW, true); + CAST_PLR(who)->KilledMonsterCredit(NPC_RAGECLAW, Rageclaw->GetGUID()); + m_creature->setDeathState(DEAD); + } + } + + void SpellHit(Unit *caster, const SpellEntry *spell) + { + if (spell->Id == SPELL_UNLOCK_SHACKLE) + { + if (Rageclaw) + DoActionOnRageclaw(false,caster); + else + m_creature->setDeathState(JUST_DIED); + + } + } +}; + +CreatureAI* GetAI_npc_drakuru_shackles(Creature* pCreature) +{ + return new npc_drakuru_shacklesAI (pCreature); +} + + +/*#### +## npc_captured_rageclaw +####*/ + +enum +{ + SPELL_UNSHACKLED = 55085, + SPELL_KNEEL = 39656 +}; + +const char * SAY_RAGECLAW_1 = "I poop on you, trollses!"; +const char * SAY_RAGECLAW_2 = "ARRRROOOOGGGGAAAA!"; +const char * SAY_RAGECLAW_3 = "No more mister nice wolvar!"; +#define SAY_RAGECLAW RAND(SAY_RAGECLAW_1,SAY_RAGECLAW_2,SAY_RAGECLAW_3) + +struct TRINITY_DLL_DECL npc_captured_rageclawAI : public ScriptedAI +{ + npc_captured_rageclawAI(Creature *c) : ScriptedAI(c) {} + + uint32 DespawnTimer; + bool Despawn; + + void Reset() + { + Despawn = false; + DespawnTimer = 0; + m_creature->setFaction(35); + m_creature->CastSpell(m_creature, SPELL_KNEEL, true); // Little Hack for kneel - Thanks Illy :P + } + + void MoveInLineOfSight(Unit *who){} + + void SpellHit(Unit *caster, const SpellEntry *spell) + { + if (spell->Id == SPELL_FREE_RAGECLAW) + { + m_creature->RemoveAurasDueToSpell(SPELL_LEFT_CHAIN); + + m_creature->RemoveAurasDueToSpell(SPELL_RIGHT_CHAIN); + + m_creature->RemoveAurasDueToSpell(SPELL_KNEEL); + + m_creature->setFaction(m_creature->GetCreatureInfo()->faction_H); + + DoCast(m_creature, SPELL_UNSHACKLED, true); + m_creature->MonsterSay(SAY_RAGECLAW, LANG_UNIVERSAL, NULL); + m_creature->GetMotionMaster()->MoveRandom(10); + + DespawnTimer = 10000; + Despawn = true; + } + } + + void UpdateAI(const uint32 diff) + { + if (m_creature->getVictim()) + { + DoMeleeAttackIfReady(); + return; + } + + if (!Despawn) + return; + + if (DespawnTimer < diff) + m_creature->setDeathState(JUST_DIED); + else DespawnTimer-=diff; + } +}; + +CreatureAI* GetAI_npc_captured_rageclaw(Creature* pCreature) +{ + return new npc_captured_rageclawAI (pCreature); +} + +void AddSC_zuldrak() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="npc_drakuru_shackles"; + newscript->GetAI = &GetAI_npc_drakuru_shackles; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_captured_rageclaw"; + newscript->GetAI = &GetAI_npc_captured_rageclaw; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/outland/blades_edge_mountains.cpp b/src/bindings/scripts/scripts/outland/blades_edge_mountains.cpp new file mode 100644 index 00000000000..fcb6f4af497 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/blades_edge_mountains.cpp @@ -0,0 +1,416 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 .sourceforge.net/> + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Blades_Edge_Mountains +SD%Complete: 90 +SDComment: Quest support: 10503, 10504, 10556, 10609, 10682, 10821, 10980. Ogri'la->Skettis Flight. (npc_daranelle needs bit more work before consider complete) +SDCategory: Blade's Edge Mountains +EndScriptData */ + +/* ContentData +mobs_bladespire_ogre +mobs_nether_drake +npc_daranelle +npc_overseer_nuaar +npc_saikkal_the_elder +go_legion_obelisk +EndContentData */ + +#include "precompiled.h" + +//Support for quest: You're Fired! (10821) +bool obelisk_one, obelisk_two, obelisk_three, obelisk_four, obelisk_five; + +#define LEGION_OBELISK_ONE 185193 +#define LEGION_OBELISK_TWO 185195 +#define LEGION_OBELISK_THREE 185196 +#define LEGION_OBELISK_FOUR 185197 +#define LEGION_OBELISK_FIVE 185198 + +/*###### +## mobs_bladespire_ogre +######*/ + +//TODO: add support for quest 10512 + Creature abilities +struct TRINITY_DLL_DECL mobs_bladespire_ogreAI : public ScriptedAI +{ + mobs_bladespire_ogreAI(Creature *c) : ScriptedAI(c) {} + + void Reset() { } + + void UpdateAI(const uint32 uiDiff) + { + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_mobs_bladespire_ogre(Creature* pCreature) +{ + return new mobs_bladespire_ogreAI (pCreature); +} + +/*###### +## mobs_nether_drake +######*/ + +enum +{ + SAY_NIHIL_1 = -1000396, + SAY_NIHIL_2 = -1000397, + SAY_NIHIL_3 = -1000398, + SAY_NIHIL_4 = -1000399, + SAY_NIHIL_INTERRUPT = -1000400, + + ENTRY_WHELP = 20021, + ENTRY_PROTO = 21821, + ENTRY_ADOLE = 21817, + ENTRY_MATUR = 21820, + ENTRY_NIHIL = 21823, + + SPELL_T_PHASE_MODULATOR = 37573, + + SPELL_ARCANE_BLAST = 38881, + SPELL_MANA_BURN = 38884, + SPELL_INTANGIBLE_PRESENCE = 36513 +}; + +struct TRINITY_DLL_DECL mobs_nether_drakeAI : public ScriptedAI +{ + mobs_nether_drakeAI(Creature *c) : ScriptedAI(c) {} + + bool IsNihil; + uint32 NihilSpeech_Timer; + uint32 NihilSpeech_Phase; + + uint32 ArcaneBlast_Timer; + uint32 ManaBurn_Timer; + uint32 IntangiblePresence_Timer; + + void Reset() + { + IsNihil = false; + NihilSpeech_Timer = 3000; + NihilSpeech_Phase = 0; + + ArcaneBlast_Timer = 7500; + ManaBurn_Timer = 10000; + IntangiblePresence_Timer = 15000; + } + + void EnterCombat(Unit* who) { } + + void MoveInLineOfSight(Unit *who) + { + if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + return; + + ScriptedAI::MoveInLineOfSight(who); + } + + //in case Creature was not summoned (not expected) + void MovementInform(uint32 type, uint32 id) + { + if (type != POINT_MOTION_TYPE) + return; + + if (id == 0) + { + m_creature->setDeathState(JUST_DIED); + m_creature->RemoveCorpse(); + m_creature->SetHealth(0); + } + } + + void SpellHit(Unit *caster, const SpellEntry *spell) + { + if (spell->Id == SPELL_T_PHASE_MODULATOR && caster->GetTypeId() == TYPEID_PLAYER) + { + const uint32 entry_list[4] = {ENTRY_PROTO, ENTRY_ADOLE, ENTRY_MATUR, ENTRY_NIHIL}; + int cid = rand()%(4-1); + + if (entry_list[cid] == m_creature->GetEntry()) + ++cid; + + //we are nihil, so say before transform + if (m_creature->GetEntry() == ENTRY_NIHIL) + { + DoScriptText(SAY_NIHIL_INTERRUPT, m_creature); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + IsNihil = false; + } + + if (m_creature->UpdateEntry(entry_list[cid])) + { + if (entry_list[cid] == ENTRY_NIHIL) + { + EnterEvadeMode(); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + IsNihil = true; + }else + AttackStart(caster); + } + } + } + + void UpdateAI(const uint32 diff) + { + if (IsNihil) + { + if (NihilSpeech_Timer <= diff) + { + switch(NihilSpeech_Phase) + { + case 0: + DoScriptText(SAY_NIHIL_1, m_creature); + ++NihilSpeech_Phase; + break; + case 1: + DoScriptText(SAY_NIHIL_2, m_creature); + ++NihilSpeech_Phase; + break; + case 2: + DoScriptText(SAY_NIHIL_3, m_creature); + ++NihilSpeech_Phase; + break; + case 3: + DoScriptText(SAY_NIHIL_4, m_creature); + ++NihilSpeech_Phase; + break; + case 4: + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + //take off to location above + m_creature->GetMotionMaster()->MovePoint(0, m_creature->GetPositionX()+50.0f, m_creature->GetPositionY(), m_creature->GetPositionZ()+50.0f); + ++NihilSpeech_Phase; + break; + } + NihilSpeech_Timer = 5000; + }else NihilSpeech_Timer -=diff; + + //anything below here is not interesting for Nihil, so skip it + return; + } + + if (!UpdateVictim()) + return; + + if (IntangiblePresence_Timer <= diff) + { + DoCast(m_creature->getVictim(),SPELL_INTANGIBLE_PRESENCE); + IntangiblePresence_Timer = 15000+rand()%15000; + }else IntangiblePresence_Timer -= diff; + + if (ManaBurn_Timer <= diff) + { + Unit* target = m_creature->getVictim(); + if (target && target->getPowerType() == POWER_MANA) + DoCast(target,SPELL_MANA_BURN); + ManaBurn_Timer = 8000+rand()%8000; + }else ManaBurn_Timer -= diff; + + if (ArcaneBlast_Timer <= diff) + { + DoCast(m_creature->getVictim(),SPELL_ARCANE_BLAST); + ArcaneBlast_Timer = 2500+rand()%5000; + }else ArcaneBlast_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mobs_nether_drake(Creature* pCreature) +{ + return new mobs_nether_drakeAI (pCreature); +} + +/*###### +## npc_daranelle +######*/ + +enum +{ + SAY_SPELL_INFLUENCE = -1000174, + SPELL_LASHHAN_CHANNEL = 36904 +}; + +struct TRINITY_DLL_DECL npc_daranelleAI : public ScriptedAI +{ + npc_daranelleAI(Creature *c) : ScriptedAI(c) {} + + void Reset() { } + + void EnterCombat(Unit* who) { } + + void MoveInLineOfSight(Unit *who) + { + if (who->GetTypeId() == TYPEID_PLAYER) + { + if (who->HasAura(SPELL_LASHHAN_CHANNEL) && m_creature->IsWithinDistInMap(who, 10.0f)) + { + DoScriptText(SAY_SPELL_INFLUENCE, m_creature, who); + //TODO: Move the below to updateAI and run if this statement == true + m_creature->CastSpell(who,37028,true); + } + } + + ScriptedAI::MoveInLineOfSight(who); + } +}; + +CreatureAI* GetAI_npc_daranelle(Creature* pCreature) +{ + return new npc_daranelleAI (pCreature); +} + +/*###### +## npc_overseer_nuaar +######*/ + +bool GossipHello_npc_overseer_nuaar(Player* pPlayer, Creature* pCreature) +{ + if (pPlayer->GetQuestStatus(10682) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Overseer, I am here to negotiate on behalf of the Cenarion Expedition.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + pPlayer->SEND_GOSSIP_MENU(10532, pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_overseer_nuaar(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + { + pPlayer->SEND_GOSSIP_MENU(10533, pCreature->GetGUID()); + pPlayer->AreaExploredOrEventHappens(10682); + } + return true; +} + +/*###### +## npc_saikkal_the_elder +######*/ + +bool GossipHello_npc_saikkal_the_elder(Player* pPlayer, Creature* pCreature) +{ + if (pPlayer->GetQuestStatus(10980) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Yes... yes, it's me.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + pPlayer->SEND_GOSSIP_MENU(10794, pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_saikkal_the_elder(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch (uiAction) + { + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Yes elder. Tell me more of the book.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + pPlayer->SEND_GOSSIP_MENU(10795, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->TalkedToCreature(pCreature->GetEntry(), pCreature->GetGUID()); + pPlayer->SEND_GOSSIP_MENU(10796, pCreature->GetGUID()); + break; + } + return true; +} + +/*###### +## go_legion_obelisk +######*/ + +bool GOHello_go_legion_obelisk(Player* pPlayer, GameObject* pGo) +{ + if (pPlayer->GetQuestStatus(10821) == QUEST_STATUS_INCOMPLETE) + { + switch(pGo->GetEntry()) + { + case LEGION_OBELISK_ONE: + obelisk_one = true; + break; + case LEGION_OBELISK_TWO: + obelisk_two = true; + break; + case LEGION_OBELISK_THREE: + obelisk_three = true; + break; + case LEGION_OBELISK_FOUR: + obelisk_four = true; + break; + case LEGION_OBELISK_FIVE: + obelisk_five = true; + break; + } + + if (obelisk_one == true && obelisk_two == true && obelisk_three == true && obelisk_four == true && obelisk_five == true) + { + pGo->SummonCreature(19963,2943.40f,4778.20f,284.49f,0.94f,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,120000); + //reset global var + obelisk_one = false; + obelisk_two = false; + obelisk_three = false; + obelisk_four = false; + obelisk_five = false; + } + } + + return true; +} + +/*###### +## AddSC +######*/ + +void AddSC_blades_edge_mountains() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="mobs_bladespire_ogre"; + newscript->GetAI = &GetAI_mobs_bladespire_ogre; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mobs_nether_drake"; + newscript->GetAI = &GetAI_mobs_nether_drake; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_daranelle"; + newscript->GetAI = &GetAI_npc_daranelle; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_overseer_nuaar"; + newscript->pGossipHello = &GossipHello_npc_overseer_nuaar; + newscript->pGossipSelect = &GossipSelect_npc_overseer_nuaar; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_saikkal_the_elder"; + newscript->pGossipHello = &GossipHello_npc_saikkal_the_elder; + newscript->pGossipSelect = &GossipSelect_npc_saikkal_the_elder; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="go_legion_obelisk"; + newscript->pGOHello = &GOHello_go_legion_obelisk; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/boss_doomlord_kazzak.cpp b/src/bindings/scripts/scripts/outland/boss_doomlord_kazzak.cpp new file mode 100644 index 00000000000..054f1d41ee0 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/boss_doomlord_kazzak.cpp @@ -0,0 +1,183 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 .sourceforge.net/> + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Doomlord_Kazzak +SD%Complete: 70 +SDComment: Using incorrect spell for Mark of Kazzak +SDCategory: Hellfire Peninsula +EndScriptData */ + +#include "precompiled.h" + +#define SAY_INTRO -1000375 +#define SAY_AGGRO1 -1000376 +#define SAY_AGGRO2 -1000377 +#define SAY_SURPREME1 -1000378 +#define SAY_SURPREME2 -1000379 +#define SAY_KILL1 -1000380 +#define SAY_KILL2 -1000381 +#define SAY_KILL3 -1000382 +#define SAY_DEATH -1000383 +#define EMOTE_FRENZY -1000384 +#define SAY_RAND1 -1000385 +#define SAY_RAND2 -1000386 + +#define SPELL_SHADOWVOLLEY 32963 +#define SPELL_CLEAVE 31779 +#define SPELL_THUNDERCLAP 36706 +#define SPELL_VOIDBOLT 39329 +#define SPELL_MARKOFKAZZAK 32960 +#define SPELL_ENRAGE 32964 +#define SPELL_CAPTURESOUL 32966 +#define SPELL_TWISTEDREFLECTION 21063 + +struct TRINITY_DLL_DECL boss_doomlordkazzakAI : public ScriptedAI +{ + boss_doomlordkazzakAI(Creature *c) : ScriptedAI(c) {} + + uint32 ShadowVolley_Timer; + uint32 Cleave_Timer; + uint32 ThunderClap_Timer; + uint32 VoidBolt_Timer; + uint32 MarkOfKazzak_Timer; + uint32 Enrage_Timer; + uint32 Twisted_Reflection_Timer; + + void Reset() + { + ShadowVolley_Timer = 6000 + rand()%4000; + Cleave_Timer = 7000; + ThunderClap_Timer = 14000 + rand()%4000; + VoidBolt_Timer = 30000; + MarkOfKazzak_Timer = 25000; + Enrage_Timer = 60000; + Twisted_Reflection_Timer = 33000; // Timer may be incorrect + } + + void JustRespawned() + { + DoScriptText(SAY_INTRO, m_creature); + } + + 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) + { + // When Kazzak kills a player (not pets/totems), he regens some health + if (victim->GetTypeId() != TYPEID_PLAYER) + return; + + DoCast(m_creature,SPELL_CAPTURESOUL); + + 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) + { + DoScriptText(SAY_DEATH, m_creature); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + //ShadowVolley_Timer + if (ShadowVolley_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_SHADOWVOLLEY); + ShadowVolley_Timer = 4000 + rand()%2000; + }else ShadowVolley_Timer -= diff; + + //Cleave_Timer + if (Cleave_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_CLEAVE); + Cleave_Timer = 8000 + rand()%4000; + }else Cleave_Timer -= diff; + + //ThunderClap_Timer + if (ThunderClap_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_THUNDERCLAP); + ThunderClap_Timer = 10000 + rand()%4000; + }else ThunderClap_Timer -= diff; + + //VoidBolt_Timer + if (VoidBolt_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_VOIDBOLT); + VoidBolt_Timer = 15000 + rand()%3000; + }else VoidBolt_Timer -= diff; + + //MarkOfKazzak_Timer + if (MarkOfKazzak_Timer < diff) + { + Unit* victim = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (victim->GetPower(POWER_MANA)) + { + DoCast(victim, SPELL_MARKOFKAZZAK); + MarkOfKazzak_Timer = 20000; + } + }else MarkOfKazzak_Timer -= diff; + + //Enrage_Timer + if (Enrage_Timer < diff) + { + DoScriptText(EMOTE_FRENZY, m_creature); + DoCast(m_creature,SPELL_ENRAGE); + Enrage_Timer = 30000; + }else Enrage_Timer -= diff; + + if (Twisted_Reflection_Timer < diff) + { + DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_TWISTEDREFLECTION); + Twisted_Reflection_Timer = 15000; + }else Twisted_Reflection_Timer -= diff; + + DoMeleeAttackIfReady(); + } + +}; + +CreatureAI* GetAI_boss_doomlordkazzak(Creature* pCreature) +{ + return new boss_doomlordkazzakAI (pCreature); +} + +void AddSC_boss_doomlordkazzak() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_doomlord_kazzak"; + newscript->GetAI = &GetAI_boss_doomlordkazzak; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/boss_doomwalker.cpp b/src/bindings/scripts/scripts/outland/boss_doomwalker.cpp new file mode 100644 index 00000000000..089a66fa7d4 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/boss_doomwalker.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_Doomwalker +SD%Complete: 100 +SDComment: +SDCategory: Shadowmoon Valley +EndScriptData */ + +#include "precompiled.h" + +#define SAY_AGGRO -1000387 +#define SAY_EARTHQUAKE_1 -1000388 +#define SAY_EARTHQUAKE_2 -1000389 +#define SAY_OVERRUN_1 -1000390 +#define SAY_OVERRUN_2 -1000391 +#define SAY_SLAY_1 -1000392 +#define SAY_SLAY_2 -1000393 +#define SAY_SLAY_3 -1000394 +#define SAY_DEATH -1000395 + +#define SPELL_EARTHQUAKE 32686 +#define SPELL_SUNDER_ARMOR 33661 +#define SPELL_CHAIN_LIGHTNING 33665 +#define SPELL_OVERRUN 32636 +#define SPELL_ENRAGE 33653 +#define SPELL_MARK_DEATH 37128 +#define SPELL_AURA_DEATH 37131 + +struct TRINITY_DLL_DECL boss_doomwalkerAI : public ScriptedAI +{ + boss_doomwalkerAI(Creature *c) : ScriptedAI(c) {} + + uint32 Chain_Timer; + uint32 Enrage_Timer; + uint32 Overrun_Timer; + uint32 Quake_Timer; + uint32 Armor_Timer; + + bool InEnrage; + + void Reset() + { + Enrage_Timer = 0; + Armor_Timer = 5000 + rand()%8000; + Chain_Timer = 10000 + rand()%20000; + Quake_Timer = 25000 + rand()%10000; + Overrun_Timer = 30000 + rand()%15000; + + InEnrage = false; + } + + void KilledUnit(Unit* Victim) + { + Victim->CastSpell(Victim,SPELL_MARK_DEATH,0); + + if (rand()%5) + 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_DEATH, m_creature); + } + + void EnterCombat(Unit *who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + + void MoveInLineOfSight(Unit *who) + { + if (who && who->GetTypeId() == TYPEID_PLAYER && m_creature->IsHostileTo(who)) + { + if (who->HasAura(SPELL_MARK_DEATH,0)) + { + who->CastSpell(who,SPELL_AURA_DEATH,1); + } + } + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + //Spell Enrage, when hp <= 20% gain enrage + if (((m_creature->GetHealth()*100)/ m_creature->GetMaxHealth()) <= 20) + { + if (Enrage_Timer < diff) + { + DoCast(m_creature,SPELL_ENRAGE); + Enrage_Timer = 6000; + InEnrage = true; + }else Enrage_Timer -= diff; + } + + //Spell Overrun + if (Overrun_Timer < diff) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_OVERRUN_1, m_creature); break; + case 1: DoScriptText(SAY_OVERRUN_2, m_creature); break; + } + + DoCast(m_creature->getVictim(),SPELL_OVERRUN); + Overrun_Timer = 25000 + rand()%15000; + }else Overrun_Timer -= diff; + + //Spell Earthquake + if (Quake_Timer < diff) + { + if (rand()%2) + return; + + switch(rand()%2) + { + case 0: DoScriptText(SAY_EARTHQUAKE_1, m_creature); break; + case 1: DoScriptText(SAY_EARTHQUAKE_2, m_creature); break; + } + + //remove enrage before casting earthquake because enrage + earthquake = 16000dmg over 8sec and all dead + if (InEnrage) + m_creature->RemoveAura(SPELL_ENRAGE); + + DoCast(m_creature,SPELL_EARTHQUAKE); + Quake_Timer = 30000 + rand()%25000; + }else Quake_Timer -= diff; + + //Spell Chain Lightning + if (Chain_Timer < diff) + { + Unit* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM,1); + + if (!target) + target = m_creature->getVictim(); + + if (target) + DoCast(target,SPELL_CHAIN_LIGHTNING); + + Chain_Timer = 7000 + rand()%20000; + }else Chain_Timer -= diff; + + //Spell Sunder Armor + if (Armor_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_SUNDER_ARMOR); + Armor_Timer = 10000 + rand()%15000; + }else Armor_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_doomwalker(Creature* pCreature) +{ + return new boss_doomwalkerAI (pCreature); +} + +void AddSC_boss_doomwalker() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_doomwalker"; + newscript->GetAI = &GetAI_boss_doomwalker; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/hellfire_peninsula.cpp b/src/bindings/scripts/scripts/outland/hellfire_peninsula.cpp new file mode 100644 index 00000000000..a8a8463889f --- /dev/null +++ b/src/bindings/scripts/scripts/outland/hellfire_peninsula.cpp @@ -0,0 +1,245 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Hellfire_Peninsula +SD%Complete: 100 + SDComment: Quest support: 9375, 9418, 10129, 10146, 10162, 10163, 10340, 10346, 10347, 10382 (Special flight paths) +SDCategory: Hellfire Peninsula +EndScriptData */ + +/* ContentData +npc_aeranas +go_haaleshi_altar +npc_wounded_blood_elf +EndContentData */ + +#include "precompiled.h" +#include "../../npc/npc_escortAI.h" + +/*###### +## npc_aeranas +######*/ + +enum +{ + SAY_SUMMON = -1000138, + SAY_FREE = -1000139, + + FACTION_HOSTILE = 16, + FACTION_FRIENDLY = 35, + + SPELL_ENVELOPING_WINDS = 15535, + SPELL_SHOCK = 12553, + + C_AERANAS = 17085 +}; + +struct TRINITY_DLL_DECL npc_aeranasAI : public ScriptedAI +{ + npc_aeranasAI(Creature* c) : ScriptedAI(c) {} + + uint32 Faction_Timer; + uint32 EnvelopingWinds_Timer; + uint32 Shock_Timer; + + void Reset() + { + Faction_Timer = 8000; + EnvelopingWinds_Timer = 9000; + Shock_Timer = 5000; + + m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER); + m_creature->setFaction(FACTION_FRIENDLY); + + DoScriptText(SAY_SUMMON, m_creature); + } + + void EnterCombat(Unit *who) {} + + void UpdateAI(const uint32 diff) + { + if (Faction_Timer) + { + if (Faction_Timer < diff) + { + m_creature->setFaction(FACTION_HOSTILE); + Faction_Timer = 0; + }else Faction_Timer -= diff; + } + + if (!UpdateVictim()) + return; + + if ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 30) + { + m_creature->setFaction(FACTION_FRIENDLY); + m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER); + m_creature->RemoveAllAuras(); + m_creature->DeleteThreatList(); + m_creature->CombatStop(true); + DoScriptText(SAY_FREE, m_creature); + return; + } + + if (Shock_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_SHOCK); + Shock_Timer = 10000; + }else Shock_Timer -= diff; + + if (EnvelopingWinds_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_ENVELOPING_WINDS); + EnvelopingWinds_Timer = 25000; + }else EnvelopingWinds_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_npc_aeranas(Creature* pCreature) +{ + return new npc_aeranasAI (pCreature); +} + +/*###### +## go_haaleshi_altar +######*/ + +bool GOHello_go_haaleshi_altar(Player* pPlayer, GameObject* pGo) +{ + pGo->SummonCreature(C_AERANAS,-1321.79, 4043.80, 116.24, 1.25, TEMPSUMMON_TIMED_DESPAWN, 180000); + return false; +} + +/*###### +## npc_wounded_blood_elf +######*/ + +enum +{ + SAY_ELF_START = -1000117, + SAY_ELF_SUMMON1 = -1000118, + SAY_ELF_RESTING = -1000119, + SAY_ELF_SUMMON2 = -1000120, + SAY_ELF_COMPLETE = -1000121, + SAY_ELF_AGGRO = -1000122, + + QUEST_ROAD_TO_FALCON_WATCH = 9375 +}; + +struct TRINITY_DLL_DECL npc_wounded_blood_elfAI : public npc_escortAI +{ + npc_wounded_blood_elfAI(Creature *c) : npc_escortAI(c) {} + + void WaypointReached(uint32 i) + { + Player* pPlayer = Unit::GetPlayer(PlayerGUID); + + if (!pPlayer || pPlayer->GetTypeId() != TYPEID_PLAYER) + return; + + switch (i) + { + case 0: + DoScriptText(SAY_ELF_START, m_creature, pPlayer); + break; + case 9: + DoScriptText(SAY_ELF_SUMMON1, m_creature, pPlayer); + // Spawn two Haal'eshi Talonguard + DoSpawnCreature(16967, -15, -15, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + DoSpawnCreature(16967, -17, -17, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + break; + case 13: + DoScriptText(SAY_ELF_RESTING, m_creature, pPlayer); + break; + case 14: + DoScriptText(SAY_ELF_SUMMON2, m_creature, pPlayer); + // Spawn two Haal'eshi Windwalker + DoSpawnCreature(16966, -15, -15, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + DoSpawnCreature(16966, -17, -17, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + break; + case 27: + DoScriptText(SAY_ELF_COMPLETE, m_creature, pPlayer); + // Award quest credit + pPlayer->GroupEventHappens(QUEST_ROAD_TO_FALCON_WATCH,m_creature); + break; + } + } + + void Reset() { } + + void EnterCombat(Unit* who) + { + if (IsBeingEscorted) + DoScriptText(SAY_ELF_AGGRO, m_creature); + } + + void JustSummoned(Creature* summoned) + { + summoned->AI()->AttackStart(m_creature); + } +}; + +CreatureAI* GetAI_npc_wounded_blood_elf(Creature* pCreature) +{ + npc_wounded_blood_elfAI* welfAI = new npc_wounded_blood_elfAI(pCreature); + + welfAI->FillPointMovementListForCreature(); + + return welfAI; +} + +bool QuestAccept_npc_wounded_blood_elf(Player* pPlayer, Creature* pCreature, Quest const* quest) +{ + if (quest->GetQuestId() == QUEST_ROAD_TO_FALCON_WATCH) + { + if (npc_escortAI* pEscortAI = CAST_AI(npc_wounded_blood_elfAI, pCreature->AI())) + pEscortAI->Start(true, false, pPlayer->GetGUID()); + + // Change faction so mobs attack + pCreature->setFaction(775); + } + + return true; +} + +/*###### +## +######*/ + +void AddSC_hellfire_peninsula() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "npc_aeranas"; + newscript->GetAI = &GetAI_npc_aeranas; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "go_haaleshi_altar"; + newscript->pGOHello = &GOHello_go_haaleshi_altar; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_wounded_blood_elf"; + newscript->GetAI = &GetAI_npc_wounded_blood_elf; + newscript->pQuestAccept = &QuestAccept_npc_wounded_blood_elf; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/isle_of_queldanas.cpp b/src/bindings/scripts/scripts/outland/isle_of_queldanas.cpp new file mode 100644 index 00000000000..469e2f712f1 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/isle_of_queldanas.cpp @@ -0,0 +1,154 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 .sourceforge.net/> + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Isle_of_Queldanas +SD%Complete: 100 +SDComment: Quest support: 11524, 11525, 11532, 11533, 11542, 11543, 11541 +SDCategory: Isle Of Quel'Danas +EndScriptData */ + +/* ContentData +npc_converted_sentry +npc_greengill_slave +EndContentData */ + +#include "precompiled.h" + +/*###### +## npc_converted_sentry +######*/ + +#define SAY_CONVERTED_1 -1000284 +#define SAY_CONVERTED_2 -1000284 + +#define SPELL_CONVERT_CREDIT 45009 + +struct TRINITY_DLL_DECL npc_converted_sentryAI : public ScriptedAI +{ + npc_converted_sentryAI(Creature *c) : ScriptedAI(c) {} + + bool Credit; + uint32 Timer; + + void Reset() + { + Credit = false; + Timer = 2500; + } + + void MoveInLineOfSight(Unit *who) + { return; } + void EnterCombat(Unit* who) + { } + + void UpdateAI(const uint32 diff) + { + if (!Credit) + { + if (Timer <= diff) + { + uint32 i = urand(1,2); + if (i==1) + DoScriptText(SAY_CONVERTED_1, m_creature); + else + DoScriptText(SAY_CONVERTED_2, m_creature); + + DoCast(m_creature, SPELL_CONVERT_CREDIT); + if (m_creature->isPet()) + CAST_PET(m_creature)->SetDuration(7500); + Credit = true; + }else Timer -= diff; + } + } +}; +CreatureAI* GetAI_npc_converted_sentry(Creature* pCreature) +{ + return new npc_converted_sentryAI (pCreature); +} + +/*###### +## npc_greengill_slave +######*/ + +#define ENRAGE 45111 +#define ORB 45109 +#define QUESTG 11541 +#define DM 25060 + +struct TRINITY_DLL_DECL npc_greengill_slaveAI : public ScriptedAI +{ + npc_greengill_slaveAI(Creature* c) : ScriptedAI(c) {} + + uint64 PlayerGUID; + + void EnterCombat(Unit* who){} + + void Reset() + { + PlayerGUID = 0; + } + + void SpellHit(Unit* caster, const SpellEntry* spell) + { + if (!caster) + return; + + if (caster->GetTypeId() == TYPEID_PLAYER && spell->Id == ORB && !m_creature->HasAura(ENRAGE)) + { + PlayerGUID = caster->GetGUID(); + if (PlayerGUID) + { + Unit* plr = Unit::GetUnit((*m_creature), PlayerGUID); + if (plr && CAST_PLR(plr)->GetQuestStatus(QUESTG) == QUEST_STATUS_INCOMPLETE) + DoCast(plr, 45110, true); + } + DoCast(m_creature, ENRAGE); + Unit* Myrmidon = me->FindNearestCreature(DM, 70); + if (Myrmidon) + { + m_creature->AddThreat(Myrmidon, 100000.0f); + AttackStart(Myrmidon); + } + } + } + + void UpdateAI(const uint32 diff) + { + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_npc_greengill_slaveAI(Creature* pCreature) +{ + return new npc_greengill_slaveAI(pCreature); +} + +void AddSC_isle_of_queldanas() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="npc_converted_sentry"; + newscript->GetAI = &GetAI_npc_converted_sentry; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_greengill_slave"; + newscript->GetAI = &GetAI_npc_greengill_slaveAI; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/nagrand.cpp b/src/bindings/scripts/scripts/outland/nagrand.cpp new file mode 100644 index 00000000000..09435b91efe --- /dev/null +++ b/src/bindings/scripts/scripts/outland/nagrand.cpp @@ -0,0 +1,718 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 .sourceforge.net/> + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Nagrand +SD%Complete: 90 +SDComment: Quest support: 9849, 9918, 9874, 9991, 10107, 10108, 10044, 10172, 10646, 10085, 10987. TextId's unknown for altruis_the_sufferer and greatmother_geyah (npc_text) +SDCategory: Nagrand +EndScriptData */ + +/* ContentData +mob_shattered_rumbler +mob_lump +mob_sunspring_villager +npc_altruis_the_sufferer +npc_greatmother_geyah +npc_lantresor_of_the_blade +npc_creditmarker_visit_with_ancestors +mob_sparrowhawk +EndContentData */ + +#include "precompiled.h" + +/*###### +## mob_shattered_rumbler - this should be done with ACID +######*/ + +struct TRINITY_DLL_DECL mob_shattered_rumblerAI : public ScriptedAI +{ + bool Spawn; + + mob_shattered_rumblerAI(Creature *c) : ScriptedAI(c) {} + + void Reset() + { + Spawn = false; + } + + void EnterCombat(Unit* who) {} + + void SpellHit(Unit *Hitter, const SpellEntry *Spellkind) + { + if (Spellkind->Id == 32001 && !Spawn) + { + float x = m_creature->GetPositionX(); + float y = m_creature->GetPositionY(); + float z = m_creature->GetPositionZ(); + + Hitter->SummonCreature(18181,x+(0.7 * (rand()%30)),y+(rand()%5),z,0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,60000); + Hitter->SummonCreature(18181,x+(rand()%5),y-(rand()%5),z,0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,60000); + Hitter->SummonCreature(18181,x-(rand()%5),y+(0.5 *(rand()%60)),z,0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,60000); + m_creature->setDeathState(CORPSE); + Spawn = true; + } + return; + } +}; +CreatureAI* GetAI_mob_shattered_rumbler(Creature* pCreature) +{ + return new mob_shattered_rumblerAI (pCreature); +} + +/*###### +## mob_lump +######*/ + +#define SPELL_VISUAL_SLEEP 16093 +#define SPELL_SPEAR_THROW 32248 + +#define LUMP_SAY0 -1000293 +#define LUMP_SAY1 -1000294 + +#define LUMP_DEFEAT -1000295 + +#define GOSSIP_HL "I need answers, ogre!" +#define GOSSIP_SL1 "Why are Boulderfist out this far? You know that this is Kurenai territory." +#define GOSSIP_SL2 "And you think you can just eat anything you want? You're obviously trying to eat the Broken of Telaar." +#define GOSSIP_SL3 "This means war, Lump! War I say!" + +struct TRINITY_DLL_DECL mob_lumpAI : public ScriptedAI +{ + mob_lumpAI(Creature *c) : ScriptedAI(c) + { + bReset = false; + } + + uint32 Reset_Timer; + uint32 Spear_Throw_Timer; + bool bReset; + + void Reset() + { + Reset_Timer = 60000; + Spear_Throw_Timer = 2000; + + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + } + + void AttackedBy(Unit* pAttacker) + { + if (m_creature->getVictim()) + return; + + if (m_creature->IsFriendlyTo(pAttacker)) + return; + + AttackStart(pAttacker); + } + + void DamageTaken(Unit *done_by, uint32 & damage) + { + if (done_by->GetTypeId() == TYPEID_PLAYER && (m_creature->GetHealth() - damage)*100 / m_creature->GetMaxHealth() < 30) + { + if (!bReset && CAST_PLR(done_by)->GetQuestStatus(9918) == QUEST_STATUS_INCOMPLETE) + { + //Take 0 damage + damage = 0; + + CAST_PLR(done_by)->AttackStop(); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->RemoveAllAuras(); + m_creature->DeleteThreatList(); + m_creature->CombatStop(true); + m_creature->setFaction(1080); //friendly + m_creature->SetStandState(UNIT_STAND_STATE_SIT); + DoScriptText(LUMP_DEFEAT, m_creature); + + bReset = true; + } + } + } + + void EnterCombat(Unit *who) + { + if (m_creature->HasAura(SPELL_VISUAL_SLEEP)) + m_creature->RemoveAura(SPELL_VISUAL_SLEEP); + + if (!m_creature->IsStandState()) + m_creature->SetStandState(UNIT_STAND_STATE_STAND); + + switch(rand()%2) + { + case 0: DoScriptText(LUMP_SAY0, m_creature); break; + case 1: DoScriptText(LUMP_SAY1, m_creature); break; + } + } + + void UpdateAI(const uint32 diff) + { + //check if we waiting for a reset + if (bReset) + { + if (Reset_Timer < diff) + { + EnterEvadeMode(); + bReset = false; + m_creature->setFaction(1711); //hostile + return; + } + else Reset_Timer -= diff; + } + + //Return since we have no target + if (!UpdateVictim()) + return; + + //Spear_Throw_Timer + if (Spear_Throw_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_SPEAR_THROW); + Spear_Throw_Timer = 20000; + }else Spear_Throw_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_lump(Creature* pCreature) +{ + return new mob_lumpAI(pCreature); +} + +bool GossipHello_mob_lump(Player* pPlayer, Creature* pCreature) +{ + if (pPlayer->GetQuestStatus(9918) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HL, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + + pPlayer->SEND_GOSSIP_MENU(9352, pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_mob_lump(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch (uiAction) + { + case GOSSIP_ACTION_INFO_DEF: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SL1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + pPlayer->SEND_GOSSIP_MENU(9353, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SL2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + pPlayer->SEND_GOSSIP_MENU(9354, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SL3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + pPlayer->SEND_GOSSIP_MENU(9355, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+3: + pPlayer->SEND_GOSSIP_MENU(9356, pCreature->GetGUID()); + pPlayer->TalkedToCreature(18354, pCreature->GetGUID()); + break; + } + return true; +} + +/*#### +# mob_sunspring_villager - should be done with ACID +####*/ + +struct TRINITY_DLL_DECL mob_sunspring_villagerAI : public ScriptedAI +{ + mob_sunspring_villagerAI(Creature *c) : ScriptedAI(c) {} + + void Reset() + { + m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 32); + m_creature->SetStandState(UNIT_STAND_STATE_DEAD); + } + + void EnterCombat(Unit *who) {} + + void SpellHit(Unit *caster, const SpellEntry *spell) + { + if (spell->Id == 32146) + { + m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + m_creature->RemoveCorpse(); + } + } +}; +CreatureAI* GetAI_mob_sunspring_villager(Creature* pCreature) +{ + return new mob_sunspring_villagerAI (pCreature); +} + +/*###### +## npc_altruis_the_sufferer +######*/ + +#define GOSSIP_HATS1 "I see twisted steel and smell sundered earth." +#define GOSSIP_HATS2 "Well...?" +#define GOSSIP_HATS3 "[PH] Story about Illidan's Pupil" + +#define GOSSIP_SATS1 "Legion?" +#define GOSSIP_SATS2 "And now?" +#define GOSSIP_SATS3 "How do you see them now?" +#define GOSSIP_SATS4 "Forge camps?" +#define GOSSIP_SATS5 "Ok." +#define GOSSIP_SATS6 "[PH] Story done" + +bool GossipHello_npc_altruis_the_sufferer(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + //gossip before obtaining Survey the Land + if (pPlayer->GetQuestStatus(9991) == QUEST_STATUS_NONE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HATS1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+10); + + //gossip when Survey the Land is incomplete (technically, after the flight) + if (pPlayer->GetQuestStatus(9991) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HATS2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+20); + + //wowwiki.com/Varedis + if (pPlayer->GetQuestStatus(10646) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HATS3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+30); + + pPlayer->SEND_GOSSIP_MENU(9419, pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_altruis_the_sufferer(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch (uiAction) + { + case GOSSIP_ACTION_INFO_DEF+10: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SATS1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11); + pPlayer->SEND_GOSSIP_MENU(9420, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+11: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SATS2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 12); + pPlayer->SEND_GOSSIP_MENU(9421, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+12: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SATS3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 13); + pPlayer->SEND_GOSSIP_MENU(9422, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+13: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SATS4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 14); + pPlayer->SEND_GOSSIP_MENU(9423, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+14: + pPlayer->SEND_GOSSIP_MENU(9424, pCreature->GetGUID()); + break; + + case GOSSIP_ACTION_INFO_DEF+20: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SATS5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 21); + pPlayer->SEND_GOSSIP_MENU(9427, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+21: + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->AreaExploredOrEventHappens(9991); + break; + + case GOSSIP_ACTION_INFO_DEF+30: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SATS6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 31); + pPlayer->SEND_GOSSIP_MENU(384, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+31: + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->AreaExploredOrEventHappens(10646); + break; + } + return true; +} + +bool QuestAccept_npc_altruis_the_sufferer(Player* pPlayer, Creature* pCreature, Quest const *quest) +{ + if (!pPlayer->GetQuestRewardStatus(9991)) //Survey the Land, q-id 9991 + { + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->ActivateTaxiPathTo(532); //TaxiPath 532 + } + return true; +} + +/*###### +## npc_greatmother_geyah +######*/ + +#define GOSSIP_HGG1 "Hello, Greatmother. Garrosh told me that you wanted to speak with me." +#define GOSSIP_HGG2 "Garrosh is beyond redemption, Greatmother. I fear that in helping the Mag'har, I have convinced Garrosh that he is unfit to lead." + +#define GOSSIP_SGG1 "You raised all of the orcs here, Greatmother?" +#define GOSSIP_SGG2 "Do you believe that?" +#define GOSSIP_SGG3 "What can be done? I have tried many different things. I have done my best to help the people of Nagrand. Each time I have approached Garrosh, he has dismissed me." +#define GOSSIP_SGG4 "Left? How can you choose to leave?" +#define GOSSIP_SGG5 "What is this duty?" +#define GOSSIP_SGG6 "Is there anything I can do for you, Greatmother?" +#define GOSSIP_SGG7 "I have done all that I could, Greatmother. I thank you for your kind words." +#define GOSSIP_SGG8 "Greatmother, you are the mother of Durotan?" +#define GOSSIP_SGG9 "Greatmother, I never had the honor. Durotan died long before my time, but his heroics are known to all on my world. The orcs of Azeroth reside in a place known as Durotar, named after your son. And ... (You take a moment to breathe and think through what you are about to tell the Greatmother.)" +#define GOSSIP_SGG10 "It is my Warchief, Greatmother. The leader of my people. From my world. He ... He is the son of Durotan. He is your grandchild." +#define GOSSIP_SGG11 "I will return to Azeroth at once, Greatmother." + +//all the textId's for the below is unknown, but i do believe the gossip item texts are proper. +bool GossipHello_npc_greatmother_geyah(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->GetQuestStatus(10044) == QUEST_STATUS_INCOMPLETE) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HGG1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); + } + else if (pPlayer->GetQuestStatus(10172) == QUEST_STATUS_INCOMPLETE) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HGG2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10); + pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); + } + else + + pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_greatmother_geyah(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch (uiAction) + { + case GOSSIP_ACTION_INFO_DEF + 1: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SGG1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF + 2: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SGG2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF + 3: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SGG3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4); + pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF + 4: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SGG4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5); + pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF + 5: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SGG5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6); + pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF + 6: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SGG6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7); + pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF + 7: + pPlayer->AreaExploredOrEventHappens(10044); + pPlayer->CLOSE_GOSSIP_MENU(); + break; + + case GOSSIP_ACTION_INFO_DEF + 10: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SGG7, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11); + pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF + 11: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SGG8, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 12); + pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF + 12: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SGG9, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 13); + pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF + 13: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SGG10, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 14); + pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF + 14: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SGG11, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 15); + pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF + 15: + pPlayer->AreaExploredOrEventHappens(10172); + pPlayer->CLOSE_GOSSIP_MENU(); + break; + } + return true; +} + +/*###### +## npc_lantresor_of_the_blade +######*/ + +#define GOSSIP_HLB "I have killed many of your ogres, Lantresor. I have no fear." +#define GOSSIP_SLB1 "Should I know? You look like an orc to me." +#define GOSSIP_SLB2 "And the other half?" +#define GOSSIP_SLB3 "I have heard of your kind, but I never thought to see the day when I would meet a half-breed." +#define GOSSIP_SLB4 "My apologies. I did not mean to offend. I am here on behalf of my people." +#define GOSSIP_SLB5 "My people ask that you pull back your Boulderfist ogres and cease all attacks on our territories. In return, we will also pull back our forces." +#define GOSSIP_SLB6 "We will fight you until the end, then, Lantresor. We will not stand idly by as you pillage our towns and kill our people." +#define GOSSIP_SLB7 "What do I need to do?" + +bool GossipHello_npc_lantresor_of_the_blade(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->GetQuestStatus(10107) == QUEST_STATUS_INCOMPLETE || pPlayer->GetQuestStatus(10108) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HLB, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + + pPlayer->SEND_GOSSIP_MENU(9361, pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_lantresor_of_the_blade(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch (uiAction) + { + case GOSSIP_ACTION_INFO_DEF: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SLB1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + pPlayer->SEND_GOSSIP_MENU(9362, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SLB2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + pPlayer->SEND_GOSSIP_MENU(9363, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SLB3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + pPlayer->SEND_GOSSIP_MENU(9364, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+3: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SLB4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4); + pPlayer->SEND_GOSSIP_MENU(9365, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+4: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SLB5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5); + pPlayer->SEND_GOSSIP_MENU(9366, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+5: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SLB6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6); + pPlayer->SEND_GOSSIP_MENU(9367, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+6: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SLB7, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7); + pPlayer->SEND_GOSSIP_MENU(9368, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+7: + pPlayer->SEND_GOSSIP_MENU(9369, pCreature->GetGUID()); + if (pPlayer->GetQuestStatus(10107) == QUEST_STATUS_INCOMPLETE) + pPlayer->AreaExploredOrEventHappens(10107); + if (pPlayer->GetQuestStatus(10108) == QUEST_STATUS_INCOMPLETE) + pPlayer->AreaExploredOrEventHappens(10108); + break; + } + return true; +} + +/*###### +## npc_creditmarker_visist_with_ancestors +######*/ + +struct TRINITY_DLL_DECL npc_creditmarker_visit_with_ancestorsAI : public ScriptedAI +{ + npc_creditmarker_visit_with_ancestorsAI(Creature* c) : ScriptedAI(c) {} + + void Reset() {} + + void EnterCombat(Unit* who) {} + + void MoveInLineOfSight(Unit *who) + { + if (!who) + return; + + if (who->GetTypeId() == TYPEID_PLAYER) + { + if (CAST_PLR(who)->GetQuestStatus(10085) == QUEST_STATUS_INCOMPLETE) + { + uint32 creditMarkerId = m_creature->GetEntry(); + if ((creditMarkerId >= 18840) && (creditMarkerId <= 18843)) + { + // 18840: Sunspring, 18841: Laughing, 18842: Garadar, 18843: Bleeding + if (!CAST_PLR(who)->GetReqKillOrCastCurrentCount(10085, creditMarkerId)) + CAST_PLR(who)->KilledMonsterCredit(creditMarkerId, m_creature->GetGUID()); + } + } + } + } +}; + +CreatureAI* GetAI_npc_creditmarker_visit_with_ancestors(Creature* pCreature) +{ + return new npc_creditmarker_visit_with_ancestorsAI (pCreature); +} + +/*###### +## mob_sparrowhawk +######*/ + +#define SPELL_SPARROWHAWK_NET 39810 +#define SPELL_ITEM_CAPTIVE_SPARROWHAWK 39812 + +struct TRINITY_DLL_DECL mob_sparrowhawkAI : public ScriptedAI +{ + + mob_sparrowhawkAI(Creature *c) : ScriptedAI(c) {} + + uint32 Check_Timer; + uint64 PlayerGUID; + bool fleeing; + + void Reset() + { + m_creature->RemoveAurasDueToSpell(SPELL_SPARROWHAWK_NET); + Check_Timer = 1000; + PlayerGUID = 0; + fleeing = false; + } + void AttackStart(Unit *who) + { + if (PlayerGUID) + return; + + ScriptedAI::AttackStart(who); + } + + void EnterCombat(Unit* who) {} + + void MoveInLineOfSight(Unit *who) + { + if (!who || PlayerGUID) + return; + + if (!PlayerGUID && who->GetTypeId() == TYPEID_PLAYER && m_creature->IsWithinDistInMap(who, 30) && CAST_PLR(who)->GetQuestStatus(10987) == QUEST_STATUS_INCOMPLETE) + { + PlayerGUID = who->GetGUID(); + return; + } + + ScriptedAI::MoveInLineOfSight(who); + } + + void UpdateAI(const uint32 diff) + { + if (Check_Timer < diff) + { + if (PlayerGUID) + { + if (fleeing && m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() != FLEEING_MOTION_TYPE) + fleeing = false; + + Player* pPlayer = Unit::GetPlayer(PlayerGUID); + if (pPlayer && m_creature->IsWithinDistInMap(pPlayer, 30)) + { + if (!fleeing) + { + m_creature->DeleteThreatList(); + m_creature->GetMotionMaster()->MoveFleeing(pPlayer); + fleeing = true; + } + } + else if (fleeing) + { + m_creature->GetMotionMaster()->MovementExpired(false); + PlayerGUID = 0; + fleeing = false; + } + } + Check_Timer = 1000; + } else Check_Timer -= diff; + + if (PlayerGUID) + return; + + ScriptedAI::UpdateAI(diff); + } + + void SpellHit(Unit *caster, const SpellEntry *spell) + { + if (caster->GetTypeId() == TYPEID_PLAYER) + { + if (spell->Id == SPELL_SPARROWHAWK_NET && CAST_PLR(caster)->GetQuestStatus(10987) == QUEST_STATUS_INCOMPLETE) + { + m_creature->CastSpell(caster, SPELL_ITEM_CAPTIVE_SPARROWHAWK, true); + m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); + } + } + return; + } +}; + +CreatureAI* GetAI_mob_sparrowhawk(Creature* pCreature) +{ + return new mob_sparrowhawkAI (pCreature); +} + +/*#### +# +####*/ + +void AddSC_nagrand() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="mob_shattered_rumbler"; + newscript->GetAI = &GetAI_mob_shattered_rumbler; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_lump"; + newscript->GetAI = &GetAI_mob_lump; + newscript->pGossipHello = &GossipHello_mob_lump; + newscript->pGossipSelect = &GossipSelect_mob_lump; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_sunspring_villager"; + newscript->GetAI = &GetAI_mob_sunspring_villager; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_altruis_the_sufferer"; + newscript->pGossipHello = &GossipHello_npc_altruis_the_sufferer; + newscript->pGossipSelect = &GossipSelect_npc_altruis_the_sufferer; + newscript->pQuestAccept = &QuestAccept_npc_altruis_the_sufferer; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_greatmother_geyah"; + newscript->pGossipHello = &GossipHello_npc_greatmother_geyah; + newscript->pGossipSelect = &GossipSelect_npc_greatmother_geyah; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_lantresor_of_the_blade"; + newscript->pGossipHello = &GossipHello_npc_lantresor_of_the_blade; + newscript->pGossipSelect = &GossipSelect_npc_lantresor_of_the_blade; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_creditmarker_visit_with_ancestors"; + newscript->GetAI = &GetAI_npc_creditmarker_visit_with_ancestors; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_sparrowhawk"; + newscript->GetAI = &GetAI_mob_sparrowhawk; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/netherstorm.cpp b/src/bindings/scripts/scripts/outland/netherstorm.cpp new file mode 100644 index 00000000000..d3d4a771e71 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/netherstorm.cpp @@ -0,0 +1,952 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Netherstorm +SD%Complete: 75 +SDComment: Quest support: 10337, 10438, 10652 (special flight paths), 10299,10321,10322,10323,10329,10330,10338,10365(Shutting Down Manaforge), 10198 +SDCategory: Netherstorm +EndScriptData */ + +/* ContentData +npc_manaforge_control_console +go_manaforge_control_console +npc_commander_dawnforge +npc_bessy +EndContentData */ + +#include "precompiled.h" +#include "../../npc/npc_escortAI.h" + +/*###### +## npc_manaforge_control_console +######*/ + +#define EMOTE_START -1000296 +#define EMOTE_60 -1000297 +#define EMOTE_30 -1000298 +#define EMOTE_10 -1000299 +#define EMOTE_COMPLETE -1000300 +#define EMOTE_ABORT -1000301 + +#define ENTRY_BNAAR_C_CONSOLE 20209 +#define ENTRY_CORUU_C_CONSOLE 20417 +#define ENTRY_DURO_C_CONSOLE 20418 +#define ENTRY_ARA_C_CONSOLE 20440 + +#define ENTRY_SUNFURY_TECH 20218 +#define ENTRY_SUNFURY_PROT 20436 + +#define ENTRY_ARA_TECH 20438 +#define ENTRY_ARA_ENGI 20439 +#define ENTRY_ARA_GORKLONN 20460 + +#define SPELL_DISABLE_VISUAL 35031 +#define SPELL_INTERRUPT_1 35016 //ACID mobs should cast this +#define SPELL_INTERRUPT_2 35176 //ACID mobs should cast this (Manaforge Ara-version) + +struct TRINITY_DLL_DECL npc_manaforge_control_consoleAI : public ScriptedAI +{ + npc_manaforge_control_consoleAI(Creature *c) : ScriptedAI(c) {} + + uint32 Event_Timer; + uint32 Wave_Timer; + uint32 Phase; + bool Wave; + uint64 someplayer; + uint64 goConsole; + Creature* add; + + void Reset() + { + Event_Timer = 3000; + Wave_Timer = 0; + Phase = 1; + Wave = false; + someplayer = 0; + goConsole = 0; + Creature* add = NULL; + } + + void EnterCombat(Unit *who) { return; } + + /*void SpellHit(Unit *caster, const SpellEntry *spell) + { + //we have no way of telling the Creature was hit by spell -> got aura applied after 10-12 seconds + //then no way for the mobs to actually stop the shutdown as intended. + if (spell->Id == SPELL_INTERRUPT_1) + DoSay("Silence! I kill you!",LANG_UNIVERSAL, NULL); + }*/ + + void JustDied(Unit* killer) + { + DoScriptText(EMOTE_ABORT, m_creature); + + if (someplayer) + { + Unit* p = Unit::GetUnit((*m_creature),someplayer); + if (p && p->GetTypeId() == TYPEID_PLAYER) + { + switch(m_creature->GetEntry()) + { + case ENTRY_BNAAR_C_CONSOLE: + CAST_PLR(p)->FailQuest(10299); + CAST_PLR(p)->FailQuest(10329); + break; + case ENTRY_CORUU_C_CONSOLE: + CAST_PLR(p)->FailQuest(10321); + CAST_PLR(p)->FailQuest(10330); + break; + case ENTRY_DURO_C_CONSOLE: + CAST_PLR(p)->FailQuest(10322); + CAST_PLR(p)->FailQuest(10338); + break; + case ENTRY_ARA_C_CONSOLE: + CAST_PLR(p)->FailQuest(10323); + CAST_PLR(p)->FailQuest(10365); + break; + } + } + } + + if (goConsole) + { + if (GameObject* pGo = GameObject::GetGameObject((*m_creature),goConsole)) + pGo->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE); + } + } + + void DoWaveSpawnForCreature(Creature* pCreature) + { + switch(pCreature->GetEntry()) + { + case ENTRY_BNAAR_C_CONSOLE: + if (rand()%2) + { + add = m_creature->SummonCreature(ENTRY_SUNFURY_TECH,2933.68,4162.55,164.00,1.60,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000); + if (add) add->GetMotionMaster()->MovePoint(0,2927.36,4212.97,164.00); + } + else + { + add = m_creature->SummonCreature(ENTRY_SUNFURY_TECH,2927.36,4212.97,164.00,4.94,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000); + if (add) add->GetMotionMaster()->MovePoint(0,2933.68,4162.55,164.00); + } + Wave_Timer = 30000; + break; + case ENTRY_CORUU_C_CONSOLE: + add = m_creature->SummonCreature(ENTRY_SUNFURY_TECH,2445.21,2765.26,134.49,3.93,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000); + if (add) add->GetMotionMaster()->MovePoint(0,2424.21,2740.15,133.81); + add = m_creature->SummonCreature(ENTRY_SUNFURY_TECH,2429.86,2731.85,134.53,1.31,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000); + if (add) add->GetMotionMaster()->MovePoint(0,2435.37,2766.04,133.81); + Wave_Timer = 20000; + break; + case ENTRY_DURO_C_CONSOLE: + add = m_creature->SummonCreature(ENTRY_SUNFURY_TECH,2986.80,2205.36,165.37,3.74,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000); + if (add) add->GetMotionMaster()->MovePoint(0,2985.15,2197.32,164.79); + add = m_creature->SummonCreature(ENTRY_SUNFURY_TECH,2952.91,2191.20,165.32,0.22,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000); + if (add) add->GetMotionMaster()->MovePoint(0,2060.01,2185.27,164.67); + Wave_Timer = 15000; + break; + case ENTRY_ARA_C_CONSOLE: + if (rand()%2) + { + add = m_creature->SummonCreature(ENTRY_ARA_TECH,4035.11,4038.97,194.27,2.57,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000); + if (add) add->GetMotionMaster()->MovePoint(0,4003.42,4040.19,193.49); + add = m_creature->SummonCreature(ENTRY_ARA_TECH,4033.66,4036.79,194.28,2.57,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000); + if (add) add->GetMotionMaster()->MovePoint(0,4003.42,4040.19,193.49); + add = m_creature->SummonCreature(ENTRY_ARA_TECH,4037.13,4037.30,194.23,2.57,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000); + if (add) add->GetMotionMaster()->MovePoint(0,4003.42,4040.19,193.49); + } + else + { + add = m_creature->SummonCreature(ENTRY_ARA_TECH,3099.59,4049.30,194.22,0.05,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000); + if (add) add->GetMotionMaster()->MovePoint(0,4028.01,4035.17,193.59); + add = m_creature->SummonCreature(ENTRY_ARA_TECH,3999.72,4046.75,194.22,0.05,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000); + if (add) add->GetMotionMaster()->MovePoint(0,4028.01,4035.17,193.59); + add = m_creature->SummonCreature(ENTRY_ARA_TECH,3996.81,4048.26,194.22,0.05,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000); + if (add) add->GetMotionMaster()->MovePoint(0,4028.01,4035.17,193.59); + } + Wave_Timer = 15000; + break; + } + } + void DoFinalSpawnForCreature(Creature* pCreature) + { + switch(pCreature->GetEntry()) + { + case ENTRY_BNAAR_C_CONSOLE: + add = m_creature->SummonCreature(ENTRY_SUNFURY_TECH,2946.52,4201.42,163.47,3.54,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000); + if (add) add->GetMotionMaster()->MovePoint(0,2927.49,4192.81,163.00); + break; + case ENTRY_CORUU_C_CONSOLE: + add = m_creature->SummonCreature(ENTRY_SUNFURY_TECH,2453.88,2737.85,133.27,2.59,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000); + if (add) add->GetMotionMaster()->MovePoint(0,2433.96,2751.53,133.85); + add = m_creature->SummonCreature(ENTRY_SUNFURY_TECH,2441.62,2735.32,134.49,1.97,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000); + if (add) add->GetMotionMaster()->MovePoint(0,2433.96,2751.53,133.85); + add = m_creature->SummonCreature(ENTRY_SUNFURY_TECH,2450.73,2754.50,134.49,3.29,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000); + if (add) add->GetMotionMaster()->MovePoint(0,2433.96,2751.53,133.85); + break; + case ENTRY_DURO_C_CONSOLE: + add = m_creature->SummonCreature(ENTRY_SUNFURY_TECH,2956.18,2202.85,165.32,5.45,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000); + if (add) add->GetMotionMaster()->MovePoint(0,2972.27,2193.22,164.48); + add = m_creature->SummonCreature(ENTRY_SUNFURY_TECH,2975.30,2211.50,165.32,4.55,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000); + if (add) add->GetMotionMaster()->MovePoint(0,2972.27,2193.22,164.48); + add = m_creature->SummonCreature(ENTRY_SUNFURY_PROT,2965.02,2217.45,164.16,4.96,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000); + if (add) add->GetMotionMaster()->MovePoint(0,2972.27,2193.22,164.48); + break; + case ENTRY_ARA_C_CONSOLE: + add = m_creature->SummonCreature(ENTRY_ARA_ENGI,3994.51,4020.46,192.18,0.91,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000); + if (add) add->GetMotionMaster()->MovePoint(0,4008.35,4035.04,192.70); + add = m_creature->SummonCreature(ENTRY_ARA_GORKLONN,4021.56,4059.35,193.59,4.44,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000); + if (add) add->GetMotionMaster()->MovePoint(0,4016.62,4039.89,193.46); + break; + } + } + + void UpdateAI(const uint32 diff) + { + if (Event_Timer < diff) + { + switch(Phase) + { + case 1: + if (someplayer) + { + Unit* u = Unit::GetUnit((*m_creature), someplayer); + if (u && u->GetTypeId() == TYPEID_PLAYER) DoScriptText(EMOTE_START, m_creature, u); + } + Event_Timer = 60000; + Wave = true; + ++Phase; + break; + case 2: + DoScriptText(EMOTE_60, m_creature); + Event_Timer = 30000; + ++Phase; + break; + case 3: + DoScriptText(EMOTE_30, m_creature); + Event_Timer = 20000; + DoFinalSpawnForCreature(m_creature); + ++Phase; + break; + case 4: + DoScriptText(EMOTE_10, m_creature); + Event_Timer = 10000; + Wave = false; + ++Phase; + break; + case 5: + DoScriptText(EMOTE_COMPLETE, m_creature); + if (someplayer) + { + Unit* u = Unit::GetUnit((*m_creature),someplayer); + if (u && u->GetTypeId() == TYPEID_PLAYER) + CAST_PLR(u)->KilledMonsterCredit(m_creature->GetEntry(),m_creature->GetGUID()); + DoCast(m_creature,SPELL_DISABLE_VISUAL); + } + if (goConsole) + { + if (GameObject* pGo = GameObject::GetGameObject((*m_creature),goConsole)) + pGo->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE); + } + ++Phase; + break; + } + } else Event_Timer -= diff; + + if (Wave) + { + if (Wave_Timer < diff) + { + DoWaveSpawnForCreature(m_creature); + } else Wave_Timer -= diff; + } + } +}; +CreatureAI* GetAI_npc_manaforge_control_console(Creature* pCreature) +{ + return new npc_manaforge_control_consoleAI (pCreature); +} + +/*###### +## go_manaforge_control_console +######*/ + +//TODO: clean up this workaround when Trinity adds support to do it properly (with gossip selections instead of instant summon) +bool GOHello_go_manaforge_control_console(Player* pPlayer, GameObject* pGo) +{ + if (pGo->GetGoType() == GAMEOBJECT_TYPE_QUESTGIVER) + { + pPlayer->PrepareQuestMenu(pGo->GetGUID()); + pPlayer->SendPreparedQuest(pGo->GetGUID()); + } + + Creature* manaforge; + manaforge = NULL; + + switch(pGo->GetAreaId()) + { + case 3726: //b'naar + if ((pPlayer->GetQuestStatus(10299) == QUEST_STATUS_INCOMPLETE || pPlayer->GetQuestStatus(10329) == QUEST_STATUS_INCOMPLETE) && + pPlayer->HasItemCount(29366,1)) + manaforge = pPlayer->SummonCreature(ENTRY_BNAAR_C_CONSOLE,2918.95,4189.98,161.88,0.34,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,125000); + break; + case 3730: //coruu + if ((pPlayer->GetQuestStatus(10321) == QUEST_STATUS_INCOMPLETE || pPlayer->GetQuestStatus(10330) == QUEST_STATUS_INCOMPLETE) && + pPlayer->HasItemCount(29396,1)) + manaforge = pPlayer->SummonCreature(ENTRY_CORUU_C_CONSOLE,2426.77,2750.38,133.24,2.14,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,125000); + break; + case 3734: //duro + if ((pPlayer->GetQuestStatus(10322) == QUEST_STATUS_INCOMPLETE || pPlayer->GetQuestStatus(10338) == QUEST_STATUS_INCOMPLETE) && + pPlayer->HasItemCount(29397,1)) + manaforge = pPlayer->SummonCreature(ENTRY_DURO_C_CONSOLE,2976.48,2183.29,163.20,1.85,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,125000); + break; + case 3722: //ara + if ((pPlayer->GetQuestStatus(10323) == QUEST_STATUS_INCOMPLETE || pPlayer->GetQuestStatus(10365) == QUEST_STATUS_INCOMPLETE) && + pPlayer->HasItemCount(29411,1)) + manaforge = pPlayer->SummonCreature(ENTRY_ARA_C_CONSOLE,4013.71,4028.76,192.10,1.25,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,125000); + break; + } + + if (manaforge) + { + CAST_AI(npc_manaforge_control_consoleAI, manaforge->AI())->someplayer = pPlayer->GetGUID(); + CAST_AI(npc_manaforge_control_consoleAI, manaforge->AI())->goConsole = pGo->GetGUID(); + pGo->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE); + } + return true; +} + +/*###### +## npc_commander_dawnforge +######*/ + +// The Speech of Dawnforge, Ardonis & Pathaleon +#define SAY_COMMANDER_DAWNFORGE_1 -1000128 +#define SAY_ARCANIST_ARDONIS_1 -1000129 +#define SAY_COMMANDER_DAWNFORGE_2 -1000130 +#define SAY_PATHALEON_CULATOR_IMAGE_1 -1000131 +#define SAY_COMMANDER_DAWNFORGE_3 -1000132 +#define SAY_PATHALEON_CULATOR_IMAGE_2 -1000133 +#define SAY_PATHALEON_CULATOR_IMAGE_2_1 -1000134 +#define SAY_PATHALEON_CULATOR_IMAGE_2_2 -1000135 +#define SAY_COMMANDER_DAWNFORGE_4 -1000136 +#define SAY_ARCANIST_ARDONIS_2 -1000136 +#define SAY_COMMANDER_DAWNFORGE_5 -1000137 + +#define QUEST_INFO_GATHERING 10198 +#define SPELL_SUNFURY_DISGUISE 34603 + +// Entries of Arcanist Ardonis, Commander Dawnforge, Pathaleon the Curators Image +const uint32 CreatureEntry[3] = +{ + 19830, // Ardonis + 19831, // Dawnforge + 21504 // Pathaleon +}; + +struct TRINITY_DLL_DECL npc_commander_dawnforgeAI : public ScriptedAI +{ + npc_commander_dawnforgeAI(Creature *c) : ScriptedAI(c) { Reset (); } + + + uint64 PlayerGUID; + uint64 ardonisGUID; + uint64 pathaleonGUID; + + + uint32 Phase; + uint32 PhaseSubphase; + uint32 Phase_Timer; + bool isEvent; + + float angle_dawnforge; + float angle_ardonis; + + void Reset() + { + PlayerGUID = 0; + ardonisGUID = 0; + pathaleonGUID = 0; + + Phase = 1; + PhaseSubphase = 0; + Phase_Timer = 4000; + isEvent = false; + } + + void EnterCombat(Unit *who) { } + + void JustSummoned(Creature *summoned) + { + pathaleonGUID = summoned->GetGUID(); + } + + // Emote Ardonis and Pathaleon + void Turn_to_Pathaleons_Image() + { + Creature *ardonis = Unit::GetCreature(*m_creature,ardonisGUID); + Creature *pathaleon = Unit::GetCreature(*m_creature,pathaleonGUID); + Player* pPlayer = Unit::GetPlayer(PlayerGUID); + + if (!ardonis || !pathaleon || !pPlayer) + return; + + //Calculate the angle to Pathaleon + angle_dawnforge = m_creature->GetAngle(pathaleon->GetPositionX(), pathaleon->GetPositionY()); + angle_ardonis = ardonis->GetAngle(pathaleon->GetPositionX(), pathaleon->GetPositionY()); + + //Turn Dawnforge and update + m_creature->SetOrientation(angle_dawnforge); + m_creature->SendUpdateToPlayer(pPlayer); + //Turn Ardonis and update + ardonis->SetOrientation(angle_ardonis); + ardonis->SendUpdateToPlayer(pPlayer); + + //Set them to kneel + m_creature->SetStandState(UNIT_STAND_STATE_KNEEL); + ardonis->SetStandState(UNIT_STAND_STATE_KNEEL); + } + + //Set them back to each other + void Turn_to_eachother() + { + if (Unit *ardonis = Unit::GetUnit(*m_creature,ardonisGUID)) + { + Player* pPlayer = Unit::GetPlayer(PlayerGUID); + + if (!pPlayer) + return; + + angle_dawnforge = m_creature->GetAngle(ardonis->GetPositionX(), ardonis->GetPositionY()); + angle_ardonis = ardonis->GetAngle(m_creature->GetPositionX(), m_creature->GetPositionY()); + + //Turn Dawnforge and update + m_creature->SetOrientation(angle_dawnforge); + m_creature->SendUpdateToPlayer(pPlayer); + //Turn Ardonis and update + ardonis->SetOrientation(angle_ardonis); + ardonis->SendUpdateToPlayer(pPlayer); + + //Set state + m_creature->SetStandState(UNIT_STAND_STATE_STAND); + ardonis->SetStandState(UNIT_STAND_STATE_STAND); + } + } + + bool CanStartEvent(Player* pPlayer) + { + if (!isEvent) + { + Creature* ardonis = me->FindNearestCreature(CreatureEntry[0], 10.0f); + if (!ardonis) + return false; + + ardonisGUID = ardonis->GetGUID(); + PlayerGUID = pPlayer->GetGUID(); + + isEvent = true; + + Turn_to_eachother(); + return true; + } + + debug_log("TSCR: npc_commander_dawnforge event already in progress, need to wait."); + return false; + } + + void UpdateAI(const uint32 diff) + { + //Is event even running? + if (!isEvent) + return; + + //Phase timing + if (Phase_Timer >= diff) + { + Phase_Timer -= diff; + return; + } + + Unit *ardonis = Unit::GetUnit(*m_creature,ardonisGUID); + Unit *pathaleon = Unit::GetUnit(*m_creature,pathaleonGUID); + Player* pPlayer = Unit::GetPlayer(PlayerGUID); + + if (!ardonis || !pPlayer) + { + Reset(); + return; + } + + if (Phase > 4 && !pathaleon) + { + Reset(); + return; + } + + //Phase 1 Dawnforge say + switch (Phase) + { + case 1: + DoScriptText(SAY_COMMANDER_DAWNFORGE_1, m_creature); + ++Phase; + Phase_Timer = 16000; + break; + //Phase 2 Ardonis say + case 2: + DoScriptText(SAY_ARCANIST_ARDONIS_1, ardonis); + ++Phase; + Phase_Timer = 16000; + break; + //Phase 3 Dawnforge say + case 3: + DoScriptText(SAY_COMMANDER_DAWNFORGE_2, m_creature); + ++Phase; + Phase_Timer = 16000; + break; + //Phase 4 Pathaleon spawns up to phase 9 + case 4: + //spawn pathaleon's image + m_creature->SummonCreature(CreatureEntry[2], 2325.851563, 2799.534668, 133.084229, 6.038996, TEMPSUMMON_TIMED_DESPAWN, 90000); + ++Phase; + Phase_Timer = 500; + break; + //Phase 5 Pathaleon say + case 5: + DoScriptText(SAY_PATHALEON_CULATOR_IMAGE_1, pathaleon); + ++Phase; + Phase_Timer = 6000; + break; + //Phase 6 + case 6: + switch(PhaseSubphase) + { + //Subphase 1: Turn Dawnforge and Ardonis + case 0: + Turn_to_Pathaleons_Image(); + ++PhaseSubphase; + Phase_Timer = 8000; + break; + //Subphase 2 Dawnforge say + case 1: + DoScriptText(SAY_COMMANDER_DAWNFORGE_3, m_creature); + PhaseSubphase = 0; + ++Phase; + Phase_Timer = 8000; + break; + } + break; + //Phase 7 Pathaleons say 3 Sentence, every sentence need a subphase + case 7: + switch(PhaseSubphase) + { + //Subphase 1 + case 0: + DoScriptText(SAY_PATHALEON_CULATOR_IMAGE_2, pathaleon); + ++PhaseSubphase; + Phase_Timer = 12000; + break; + //Subphase 2 + case 1: + DoScriptText(SAY_PATHALEON_CULATOR_IMAGE_2_1, pathaleon); + ++PhaseSubphase; + Phase_Timer = 16000; + break; + //Subphase 3 + case 2: + DoScriptText(SAY_PATHALEON_CULATOR_IMAGE_2_2, pathaleon); + PhaseSubphase = 0; + ++Phase; + Phase_Timer = 10000; + break; + } + break; + //Phase 8 Dawnforge & Ardonis say + case 8: + DoScriptText(SAY_COMMANDER_DAWNFORGE_4, m_creature); + DoScriptText(SAY_ARCANIST_ARDONIS_2, ardonis); + ++Phase; + Phase_Timer = 4000; + break; + //Phase 9 Pathaleons Despawn, Reset Dawnforge & Ardonis angle + case 9: + Turn_to_eachother(); + //hide pathaleon, unit will despawn shortly + pathaleon->SetVisibility(VISIBILITY_OFF); + PhaseSubphase = 0; + ++Phase; + Phase_Timer = 3000; + break; + //Phase 10 Dawnforge say + case 10: + DoScriptText(SAY_COMMANDER_DAWNFORGE_5, m_creature); + pPlayer->AreaExploredOrEventHappens(QUEST_INFO_GATHERING); + Reset(); + break; + } + } +}; + +CreatureAI* GetAI_npc_commander_dawnforge(Creature* pCreature) +{ + return new npc_commander_dawnforgeAI(pCreature); +} + +bool AreaTrigger_at_commander_dawnforge(Player* pPlayer, AreaTriggerEntry *at) +{ + //if player lost aura or not have at all, we should not try start event. + if (!pPlayer->HasAura(SPELL_SUNFURY_DISGUISE)) + return false; + + if (pPlayer->isAlive() && pPlayer->GetQuestStatus(QUEST_INFO_GATHERING) == QUEST_STATUS_INCOMPLETE) + { + Creature* Dawnforge = pPlayer->FindNearestCreature(CreatureEntry[1], 30.0f); + + if (!Dawnforge) + return false; + + if (CAST_AI(npc_commander_dawnforgeAI, Dawnforge->AI())->CanStartEvent(pPlayer)) + return true; + } + return false; +} + +/*###### +## npc_professor_dabiri +######*/ + +#define SPELL_PHASE_DISTRUPTOR 35780 +#define GOSSIP_ITEM "I need a new phase distruptor, Professor" +#define WHISPER_DABIRI -1000302 + +#define QUEST_DIMENSIUS 10439 +#define QUEST_ON_NETHERY_WINGS 10438 + +bool GossipHello_npc_professor_dabiri(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->GetQuestStatus(QUEST_ON_NETHERY_WINGS) == QUEST_STATUS_INCOMPLETE && !pPlayer->HasItemCount(29778, 1)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_professor_dabiri(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + { + pCreature->CastSpell(pPlayer, SPELL_PHASE_DISTRUPTOR, false); + pPlayer->CLOSE_GOSSIP_MENU(); + } + + return true; +} + +bool QuestAccept_npc_professor_dabiri(Player* pPlayer, Creature* pCreature, Quest const *quest) +{ + if (quest->GetQuestId() == QUEST_DIMENSIUS) + DoScriptText(WHISPER_DABIRI, pCreature, pPlayer); + + return true; +} + +/*###### +## mob_phase_hunter +######*/ + +#define SUMMONED_MOB 19595 +#define EMOTE_WEAK -1000303 + +// Spells +#define SPELL_PHASE_SLIP 36574 +#define SPELL_MANA_BURN 13321 +#define SPELL_MATERIALIZE 34804 +#define SPELL_DE_MATERIALIZE 34804 + +struct TRINITY_DLL_DECL mob_phase_hunterAI : public ScriptedAI +{ + + mob_phase_hunterAI(Creature *c) : ScriptedAI(c) {} + + bool Weak; + bool Materialize; + bool Drained; + + int WeakPercent; + uint64 PlayerGUID; + uint32 Health; + uint32 Level; + uint32 PhaseSlipVulnerabilityTimer; + uint32 ManaBurnTimer; + + void Reset() + { + Weak = false; + Materialize = false; + Drained = false; + + WeakPercent = 25 + (rand()%16); // 25-40 + PlayerGUID = 0; + ManaBurnTimer = 5000 + (rand()%3 * 1000); // 5-8 sec cd + } + + void EnterCombat(Unit *who) + { + if (Player* pPlayer = who->GetCharmerOrOwnerPlayerOrPlayerItself()) + PlayerGUID = pPlayer->GetGUID(); + } + + void SpellHit(Unit *caster, const SpellEntry *spell) + { + DoCast(m_creature, SPELL_DE_MATERIALIZE); + } + + void UpdateAI(const uint32 diff) + { + if (!Materialize) + { + DoCast(m_creature, SPELL_MATERIALIZE); + Materialize = true; + } + + if (m_creature->HasAuraType(SPELL_AURA_MOD_DECREASE_SPEED) || m_creature->hasUnitState(UNIT_STAT_ROOT)) // if the mob is rooted/slowed by spells eg.: Entangling Roots, Frost Nova, Hamstring, Crippling Poison, etc. => remove it + DoCast(m_creature, SPELL_PHASE_SLIP); + + if (!UpdateVictim()) + return; + + if (ManaBurnTimer < diff) // cast Mana Burn + { + if (m_creature->getVictim()->GetCreateMana() > 0) + { + DoCast(m_creature->getVictim(), SPELL_MANA_BURN); + ManaBurnTimer = 8000 + (rand()%10 * 1000); // 8-18 sec cd + } + }else ManaBurnTimer -= diff; + + if (PlayerGUID) // start: support for quest 10190 + { + Unit* target = Unit::GetUnit((*m_creature), PlayerGUID); + + if (target && !Weak && m_creature->GetHealth() < (m_creature->GetMaxHealth() / 100 * WeakPercent) + && CAST_PLR(target)->GetQuestStatus(10190) == QUEST_STATUS_INCOMPLETE) + { + DoScriptText(EMOTE_WEAK, m_creature); + Weak = true; + } + if (Weak && !Drained && m_creature->HasAura(34219)) + { + Drained = true; + + Health = m_creature->GetHealth(); // get the normal mob's data + Level = m_creature->getLevel(); + + m_creature->AttackStop(); // delete the normal mob + m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + m_creature->RemoveCorpse(); + + Creature* DrainedPhaseHunter = NULL; + + if (!DrainedPhaseHunter) + DrainedPhaseHunter = m_creature->SummonCreature(SUMMONED_MOB, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), m_creature->GetOrientation(), TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000); // summon the mob + + if (DrainedPhaseHunter) + { + DrainedPhaseHunter->SetLevel(Level); // set the summoned mob's data + DrainedPhaseHunter->SetHealth(Health); + DrainedPhaseHunter->AddThreat(target, 10000.0f); + DrainedPhaseHunter->AI()->AttackStart(target); + } + } + }// end: support for quest 10190 + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_phase_hunter(Creature* pCreature) +{ + return new mob_phase_hunterAI (pCreature); +} + +/*###### +## npc_bessy +######*/ + +#define Q_ALMABTRIEB 10337 +#define N_THADELL 20464 +#define SPAWN_FIRST 20512 +#define SPAWN_SECOND 19881 +#define SAY_THADELL_1 -1000304 +#define SAY_THADELL_2 -1000305 + +struct TRINITY_DLL_DECL npc_bessyAI : public npc_escortAI +{ + + npc_bessyAI(Creature *c) : npc_escortAI(c) {} + + bool Completed; + + void JustDied(Unit* killer) + { + if (PlayerGUID) + { + if (Player* pPlayer = Unit::GetPlayer(PlayerGUID)) + CAST_PLR(pPlayer)->FailQuest(Q_ALMABTRIEB); + } + } + + void WaypointReached(uint32 i) + { + Player* pPlayer = Unit::GetPlayer(PlayerGUID); + + if (!pPlayer) + return; + + switch(i) + { + case 3: //first spawn + m_creature->SummonCreature(SPAWN_FIRST, 2449.67, 2183.11, 96.85, 6.20, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + m_creature->SummonCreature(SPAWN_FIRST, 2449.53, 2184.43, 96.36, 6.27, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + m_creature->SummonCreature(SPAWN_FIRST, 2449.85, 2186.34, 97.57, 6.08, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + break; + + case 7: + m_creature->SummonCreature(SPAWN_SECOND, 2309.64, 2186.24, 92.25, 6.06, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + m_creature->SummonCreature(SPAWN_SECOND, 2309.25, 2183.46, 91.75, 6.22, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + break; + + case 12: + if (pPlayer) + { + CAST_PLR(pPlayer)->GroupEventHappens(Q_ALMABTRIEB, m_creature); + Completed = true; + } + {Unit* Thadell = me->FindNearestCreature(N_THADELL, 30); + if (Thadell) + DoScriptText(SAY_THADELL_1, m_creature);}break; + case 13: + {Unit* Thadell = me->FindNearestCreature(N_THADELL, 30); + if (Thadell) + DoScriptText(SAY_THADELL_2, m_creature, pPlayer);}break; + } + } + + void JustSummoned(Creature* summoned) + { + summoned->AI()->AttackStart(m_creature); + } + + void EnterCombat(Unit* who){} + + void Reset() + { + Completed = false; + m_creature->setFaction(35); + } + + void UpdateAI(const uint32 diff) + { + npc_escortAI::UpdateAI(diff); + } + +}; + +bool QuestAccept_npc_bessy(Player* pPlayer, Creature* pCreature, Quest const* quest) +{ + if (quest->GetQuestId() == Q_ALMABTRIEB) + { + pCreature->setFaction(113); + pCreature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + CAST_AI(npc_escortAI, (pCreature->AI()))->Start(true, false, pPlayer->GetGUID()); + } + return true; +} + +CreatureAI* GetAI_npc_bessy(Creature* pCreature) +{ + npc_bessyAI* bessyAI = new npc_bessyAI(pCreature); + + bessyAI->AddWaypoint(0, 2488.77, 2184.89, 104.64); + bessyAI->AddWaypoint(1, 2478.72, 2184.77, 98.58); + bessyAI->AddWaypoint(2, 2473.52, 2184.71, 99.00); + bessyAI->AddWaypoint(3, 2453.15, 2184.96, 97.09,4000); + bessyAI->AddWaypoint(4, 2424.18, 2184.15, 94.11); + bessyAI->AddWaypoint(5, 2413.18, 2184.15, 93.42); + bessyAI->AddWaypoint(6, 2402.02, 2183.90, 87.59); + bessyAI->AddWaypoint(7, 2333.31, 2181.63, 90.03,4000); + bessyAI->AddWaypoint(8, 2308.73, 2184.34, 92.04); + bessyAI->AddWaypoint(9, 2303.10, 2196.89, 94.94); + bessyAI->AddWaypoint(10, 2304.58, 2272.23, 96.67); + bessyAI->AddWaypoint(11, 2297.09, 2271.40, 95.16); + bessyAI->AddWaypoint(12, 2297.68, 2266.79, 95.07,4000); + bessyAI->AddWaypoint(13, 2297.67, 2266.76, 95.07,4000); + + return bessyAI; +} + +/*###### +## +######*/ + +void AddSC_netherstorm() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="go_manaforge_control_console"; + newscript->pGOHello = &GOHello_go_manaforge_control_console; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_manaforge_control_console"; + newscript->GetAI = &GetAI_npc_manaforge_control_console; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_commander_dawnforge"; + newscript->GetAI = &GetAI_npc_commander_dawnforge; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "at_commander_dawnforge"; + newscript->pAreaTrigger = &AreaTrigger_at_commander_dawnforge; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_professor_dabiri"; + newscript->pGossipHello = &GossipHello_npc_professor_dabiri; + newscript->pGossipSelect = &GossipSelect_npc_professor_dabiri; + newscript->pQuestAccept = &QuestAccept_npc_professor_dabiri; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_phase_hunter"; + newscript->GetAI = &GetAI_mob_phase_hunter; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_bessy"; + newscript->GetAI = &GetAI_npc_bessy; + newscript->pQuestAccept = &QuestAccept_npc_bessy; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/shadowmoon_valley.cpp b/src/bindings/scripts/scripts/outland/shadowmoon_valley.cpp new file mode 100644 index 00000000000..953675bb28f --- /dev/null +++ b/src/bindings/scripts/scripts/outland/shadowmoon_valley.cpp @@ -0,0 +1,1841 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 .sourceforge.net/> + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Shadowmoon_Valley +SD%Complete: 100 +SDComment: Quest support: 10519, 10583, 10601, 10814, 10804, 10854, 10458, 10481, 10480, 11082, 10781, 10451. Vendor Drake Dealer Hurlunk. +SDCategory: Shadowmoon Valley +EndScriptData */ + +/* ContentData +mob_mature_netherwing_drake +mob_enslaved_netherwing_drake +npc_drake_dealer_hurlunk +npcs_flanis_swiftwing_and_kagrosh +npc_murkblood_overseer +npc_neltharaku +npc_karynaku +npc_oronok_tornheart +npc_overlord_morghor +npc_earthmender_wilda +mob_torloth_the_magnificent +mob_illidari_spawn +npc_lord_illidan_stormrage +go_crystal_prison +npc_enraged_spirit +EndContentData */ + +#include "precompiled.h" +#include "../../npc/npc_escortAI.h" + +/*##### +# mob_mature_netherwing_drake +#####*/ + +enum +{ + SAY_JUST_EATEN = -1000222, + + SPELL_PLACE_CARCASS = 38439, + SPELL_JUST_EATEN = 38502, + SPELL_NETHER_BREATH = 38467, + POINT_ID = 1, + + QUEST_KINDNESS = 10804, + NPC_EVENT_PINGER = 22131 +}; + + +struct TRINITY_DLL_DECL mob_mature_netherwing_drakeAI : public ScriptedAI +{ + mob_mature_netherwing_drakeAI(Creature* c) : ScriptedAI(c) { } + + uint64 uiPlayerGUID; + + bool bCanEat; + bool bIsEating; + + uint32 EatTimer; + uint32 CastTimer; + + void Reset() + { + uiPlayerGUID = 0; + + bCanEat = false; + bIsEating = false; + + EatTimer = 5000; + CastTimer = 5000; + } + + void EnterCombat(Unit* who) { } + + void SpellHit(Unit* pCaster, SpellEntry const* pSpell) + { + if (bCanEat || bIsEating) + return; + + if (pCaster->GetTypeId() == TYPEID_PLAYER && pSpell->Id == SPELL_PLACE_CARCASS && !m_creature->HasAura(SPELL_JUST_EATEN)) + { + uiPlayerGUID = pCaster->GetGUID(); + bCanEat = true; + } + } + + void MovementInform(uint32 type, uint32 id) + { + if (type != POINT_MOTION_TYPE) + return; + + if (id == POINT_ID) + { + bIsEating = true; + EatTimer = 7000; + m_creature->HandleEmoteCommand(EMOTE_ONESHOT_ATTACKUNARMED); + } + } + + void UpdateAI(const uint32 diff) + { + if (bCanEat || bIsEating) + { + if (EatTimer < diff) + { + if (bCanEat && !bIsEating) + { + if (Unit* pUnit = Unit::GetUnit(*m_creature, uiPlayerGUID)) + { + if (GameObject* pGo = pUnit->GetGameObject(SPELL_PLACE_CARCASS)) + { + if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == WAYPOINT_MOTION_TYPE) + m_creature->GetMotionMaster()->MovementExpired(); + + m_creature->GetMotionMaster()->MoveIdle(); + m_creature->StopMoving(); + + m_creature->GetMotionMaster()->MovePoint(POINT_ID, pGo->GetPositionX(), pGo->GetPositionY(), pGo->GetPositionZ()); + } + } + bCanEat = false; + } + else if (bIsEating) + { + DoCast(m_creature, SPELL_JUST_EATEN); + DoScriptText(SAY_JUST_EATEN, m_creature); + + if (Player* pPlr = Unit::GetPlayer(uiPlayerGUID)) + pPlr->KilledMonsterCredit(NPC_EVENT_PINGER, m_creature->GetGUID()); + + Reset(); + m_creature->GetMotionMaster()->Clear(); + } + } + else + EatTimer -= diff; + + return; + } + + if (!UpdateVictim()) + return; + + if (CastTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_NETHER_BREATH); + CastTimer = 5000; + }else CastTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_mature_netherwing_drake(Creature* pCreature) +{ + return new mob_mature_netherwing_drakeAI(pCreature); +} + +/*### +# mob_enslaved_netherwing_drake +####*/ + +#define FACTION_DEFAULT 62 +#define FACTION_FRIENDLY 1840 // Not sure if this is correct, it was taken off of Mordenai. + +#define SPELL_HIT_FORCE_OF_NELTHARAKU 38762 +#define SPELL_FORCE_OF_NELTHARAKU 38775 + +#define CREATURE_DRAGONMAW_SUBJUGATOR 21718 +#define CREATURE_ESCAPE_DUMMY 22317 + +struct TRINITY_DLL_DECL mob_enslaved_netherwing_drakeAI : public ScriptedAI +{ + mob_enslaved_netherwing_drakeAI(Creature* c) : ScriptedAI(c) + { + PlayerGUID = 0; + Tapped = false; + Reset(); + } + + uint64 PlayerGUID; + uint32 FlyTimer; + bool Tapped; + + void Reset() + { + if (!Tapped) + m_creature->setFaction(FACTION_DEFAULT); + + FlyTimer = 10000; + m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + m_creature->SetVisibility(VISIBILITY_ON); + } + + void EnterCombat(Unit* who) { } + + void SpellHit(Unit* caster, const SpellEntry* spell) + { + if (!caster) + return; + + if (caster->GetTypeId() == TYPEID_PLAYER && spell->Id == SPELL_HIT_FORCE_OF_NELTHARAKU && !Tapped) + { + Tapped = true; + PlayerGUID = caster->GetGUID(); + + m_creature->setFaction(FACTION_FRIENDLY); + DoCast(caster, SPELL_FORCE_OF_NELTHARAKU, true); + + Unit* Dragonmaw = me->FindNearestCreature(CREATURE_DRAGONMAW_SUBJUGATOR, 50); + + if (Dragonmaw) + { + m_creature->AddThreat(Dragonmaw, 100000.0f); + AttackStart(Dragonmaw); + } + + HostilReference* ref = m_creature->getThreatManager().getOnlineContainer().getReferenceByTarget(caster); + if (ref) + ref->removeReference(); + } + } + + void MovementInform(uint32 type, uint32 id) + { + if (type != POINT_MOTION_TYPE) + return; + + if (id == 1) + { + if (PlayerGUID) + { + Unit* plr = Unit::GetUnit((*m_creature), PlayerGUID); + if (plr) + DoCast(plr, SPELL_FORCE_OF_NELTHARAKU, true); + + PlayerGUID = 0; + } + m_creature->SetVisibility(VISIBILITY_OFF); + m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + 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 (!UpdateVictim()) + { + if (Tapped) + if (FlyTimer < diff) + { + Tapped = false; + if (PlayerGUID) + { + Player* plr = Unit::GetPlayer(PlayerGUID); + if (plr && plr->GetQuestStatus(10854) == QUEST_STATUS_INCOMPLETE) + { + DoCast(plr, SPELL_FORCE_OF_NELTHARAKU, true); + /* + float x,y,z; + m_creature->GetPosition(x,y,z); + + float dx,dy,dz; + m_creature->GetRandomPoint(x, y, z, 20, dx, dy, dz); + dz += 20; // so it's in the air, not ground*/ + + float dx, dy, dz; + + Unit* EscapeDummy = me->FindNearestCreature(CREATURE_ESCAPE_DUMMY, 30); + if (EscapeDummy) + EscapeDummy->GetPosition(dx, dy, dz); + else + { + m_creature->GetRandomPoint(m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 20, dx, dy, dz); + dz += 25; + } + + m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + m_creature->GetMotionMaster()->MovePoint(1, dx, dy, dz); + } + } + }else FlyTimer -= diff; + return; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_enslaved_netherwing_drake(Creature* pCreature) +{ + return new mob_enslaved_netherwing_drakeAI(pCreature); +} + +/*##### +# mob_dragonmaw_peon +#####*/ + +struct TRINITY_DLL_DECL mob_dragonmaw_peonAI : public ScriptedAI +{ + mob_dragonmaw_peonAI(Creature* c) : ScriptedAI(c) {} + + uint64 PlayerGUID; + bool Tapped; + uint32 PoisonTimer; + + void Reset() + { + PlayerGUID = 0; + Tapped = false; + PoisonTimer = 0; + } + + void EnterCombat(Unit* who) { } + + void SpellHit(Unit* caster, const SpellEntry* spell) + { + if (!caster) + return; + + if (caster->GetTypeId() == TYPEID_PLAYER && spell->Id == 40468 && !Tapped) + { + PlayerGUID = caster->GetGUID(); + + Tapped = true; + float x, y, z; + caster->GetClosePoint(x, y, z, m_creature->GetObjectSize()); + + m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + m_creature->GetMotionMaster()->MovePoint(1, x, y, z); + } + } + + void MovementInform(uint32 type, uint32 id) + { + if (type != POINT_MOTION_TYPE) + return; + + if (id) + { + m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_EAT); + PoisonTimer = 15000; + } + } + + void UpdateAI(const uint32 diff) + { + if (PoisonTimer) + if (PoisonTimer <= diff) + { + if (PlayerGUID) + { + Player* plr = Unit::GetPlayer(PlayerGUID); + if (plr && plr->GetQuestStatus(11020) == QUEST_STATUS_INCOMPLETE) + plr->KilledMonsterCredit(23209, m_creature->GetGUID()); + } + PoisonTimer = 0; + m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + }else PoisonTimer -= diff; + } +}; + +CreatureAI* GetAI_mob_dragonmaw_peon(Creature* pCreature) +{ + return new mob_dragonmaw_peonAI(pCreature); +} + +/*###### +## npc_drake_dealer_hurlunk +######*/ + +bool GossipHello_npc_drake_dealer_hurlunk(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isVendor() && pPlayer->GetReputationRank(1015) == REP_EXALTED) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); + + pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_drake_dealer_hurlunk(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_TRADE) + pPlayer->SEND_VENDORLIST(pCreature->GetGUID()); + + return true; +} + +/*###### +## npc_flanis_swiftwing_and_kagrosh +######*/ + +#define GOSSIP_HSK1 "Take Flanis's Pack" +#define GOSSIP_HSK2 "Take Kagrosh's Pack" + +bool GossipHello_npcs_flanis_swiftwing_and_kagrosh(Player* pPlayer, Creature* pCreature) +{ + if (pPlayer->GetQuestStatus(10583) == QUEST_STATUS_INCOMPLETE && !pPlayer->HasItemCount(30658,1,true)) + pPlayer->ADD_GOSSIP_ITEM(0, GOSSIP_HSK1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + if (pPlayer->GetQuestStatus(10601) == QUEST_STATUS_INCOMPLETE && !pPlayer->HasItemCount(30659,1,true)) + pPlayer->ADD_GOSSIP_ITEM(0, GOSSIP_HSK2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + + pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npcs_flanis_swiftwing_and_kagrosh(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, 30658, 1, false); + if (msg == EQUIP_ERR_OK) + { + pPlayer->StoreNewItem(dest, 30658, 1, true); + pPlayer->PlayerTalkClass->ClearMenus(); + } + } + if (uiAction == GOSSIP_ACTION_INFO_DEF+2) + { + ItemPosCountVec dest; + uint8 msg = pPlayer->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, 30659, 1, false); + if (msg == EQUIP_ERR_OK) + { + pPlayer->StoreNewItem(dest, 30659, 1, true); + pPlayer->PlayerTalkClass->ClearMenus(); + } + } + return true; +} + +/*###### +## npc_murkblood_overseer +######*/ + +#define QUEST_11082 11082 + +#define GOSSIP_HMO "I am here for you, overseer." +#define GOSSIP_SMO1 "How dare you question an overseer of the Dragonmaw!" +#define GOSSIP_SMO2 "Who speaks of me? What are you talking about, broken?" +#define GOSSIP_SMO3 "Continue please." +#define GOSSIP_SMO4 "Who are these bidders?" +#define GOSSIP_SMO5 "Well... yes." + +bool GossipHello_npc_murkblood_overseer(Player* pPlayer, Creature* pCreature) +{ + if (pPlayer->GetQuestStatus(QUEST_11082) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(0, GOSSIP_HMO, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + pPlayer->SEND_GOSSIP_MENU(10940, pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_murkblood_overseer(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch (uiAction) + { + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SMO1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + //correct id not known + pPlayer->SEND_GOSSIP_MENU(10940, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SMO2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); + //correct id not known + pPlayer->SEND_GOSSIP_MENU(10940, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+3: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SMO3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4); + //correct id not known + pPlayer->SEND_GOSSIP_MENU(10940, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+4: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SMO4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5); + //correct id not known + pPlayer->SEND_GOSSIP_MENU(10940, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+5: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SMO5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6); + //correct id not known + pPlayer->SEND_GOSSIP_MENU(10940, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+6: + //correct id not known + pPlayer->SEND_GOSSIP_MENU(10940, pCreature->GetGUID()); + pCreature->CastSpell(pPlayer,41121,false); + pPlayer->AreaExploredOrEventHappens(QUEST_11082); + break; + } + return true; +} + +/*###### +## npc_neltharaku +######*/ + +#define GOSSIP_HN "I am listening, dragon" +#define GOSSIP_SN1 "But you are dragons! How could orcs do this to you?" +#define GOSSIP_SN2 "Your mate?" +#define GOSSIP_SN3 "I have battled many beasts, dragon. I will help you." + +bool GossipHello_npc_neltharaku(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->GetQuestStatus(10814) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(0, GOSSIP_HN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + pPlayer->SEND_GOSSIP_MENU(10613, pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_neltharaku(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch (uiAction) + { + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->ADD_GOSSIP_ITEM(0, GOSSIP_SN1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + pPlayer->SEND_GOSSIP_MENU(10614, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->ADD_GOSSIP_ITEM(0, GOSSIP_SN2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); + pPlayer->SEND_GOSSIP_MENU(10615, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+3: + pPlayer->ADD_GOSSIP_ITEM(0, GOSSIP_SN3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4); + pPlayer->SEND_GOSSIP_MENU(10616, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+4: + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->AreaExploredOrEventHappens(10814); + break; + } + return true; +} + +/*###### +## npc_oronok +######*/ + +#define GOSSIP_ORONOK1 "I am ready to hear your story, Oronok." +#define GOSSIP_ORONOK2 "How do I find the cipher?" +#define GOSSIP_ORONOK3 "How do you know all of this?" +#define GOSSIP_ORONOK4 "Yet what? What is it, Oronok?" +#define GOSSIP_ORONOK5 "Continue, please." +#define GOSSIP_ORONOK6 "So what of the cipher now? And your boys?" +#define GOSSIP_ORONOK7 "I will find your boys and the cipher, Oronok." + +bool GossipHello_npc_oronok_tornheart(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + if (pCreature->isVendor()) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); + + if (pPlayer->GetQuestStatus(10519) == QUEST_STATUS_INCOMPLETE) + { + pPlayer->ADD_GOSSIP_ITEM(0, GOSSIP_ORONOK1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + pPlayer->SEND_GOSSIP_MENU(10312, pCreature->GetGUID()); + }else + pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_oronok_tornheart(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch (uiAction) + { + case GOSSIP_ACTION_TRADE: + pPlayer->SEND_VENDORLIST(pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF: + pPlayer->ADD_GOSSIP_ITEM(0, GOSSIP_ORONOK2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + pPlayer->SEND_GOSSIP_MENU(10313, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->ADD_GOSSIP_ITEM(0, GOSSIP_ORONOK3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + pPlayer->SEND_GOSSIP_MENU(10314, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->ADD_GOSSIP_ITEM(0, GOSSIP_ORONOK4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); + pPlayer->SEND_GOSSIP_MENU(10315, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+3: + pPlayer->ADD_GOSSIP_ITEM(0, GOSSIP_ORONOK5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4); + pPlayer->SEND_GOSSIP_MENU(10316, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+4: + pPlayer->ADD_GOSSIP_ITEM(0, GOSSIP_ORONOK6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5); + pPlayer->SEND_GOSSIP_MENU(10317, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+5: + pPlayer->ADD_GOSSIP_ITEM(0, GOSSIP_ORONOK7, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6); + pPlayer->SEND_GOSSIP_MENU(10318, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+6: + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->AreaExploredOrEventHappens(10519); + break; + } + return true; +} + +/*#### +# npc_karynaku +####*/ + +enum +{ + QUEST_ALLY_OF_NETHER = 10870, + + TAXI_PATH_ID = 649 +}; + +bool QuestAccept_npc_karynaku(Player* pPlayer, Creature* pCreature, Quest const* quest) +{ + if (quest->GetQuestId() == QUEST_ALLY_OF_NETHER) + pPlayer->ActivateTaxiPathTo(TAXI_PATH_ID); //pPlayer->ActivateTaxiPathTo(649); + + return true; +} + +/*#### +# npc_overlord_morghor +####*/ + +#define QUEST_LORD_ILLIDAN_STORMRAGE 11108 + +#define C_ILLIDAN 22083 +#define C_YARZILL 23141 + +#define SPELL_ONE 39990 // Red Lightning Bolt +#define SPELL_TWO 41528 // Mark of Stormrage +#define SPELL_THREE 40216 // Dragonaw Faction +#define SPELL_FOUR 42016 // Dragonaw Trasform + +#define OVERLORD_SAY_1 -1000206 +#define OVERLORD_SAY_2 -1000207 +#define OVERLORD_SAY_3 -1000208 +#define OVERLORD_SAY_4 -1000209 +#define OVERLORD_SAY_5 -1000210 +#define OVERLORD_SAY_6 -1000211 + +#define OVERLORD_YELL_1 -1000212 +#define OVERLORD_YELL_2 -1000213 + +#define LORD_ILLIDAN_SAY_1 -1000214 +#define LORD_ILLIDAN_SAY_2 -1000215 +#define LORD_ILLIDAN_SAY_3 -1000216 +#define LORD_ILLIDAN_SAY_4 -1000217 +#define LORD_ILLIDAN_SAY_5 -1000218 +#define LORD_ILLIDAN_SAY_6 -1000219 +#define LORD_ILLIDAN_SAY_7 -1000220 + +#define YARZILL_THE_MERC_SAY -1000221 + +struct TRINITY_DLL_DECL npc_overlord_morghorAI : public ScriptedAI +{ + npc_overlord_morghorAI(Creature *c) : ScriptedAI(c) {} + + uint64 PlayerGUID; + uint64 IllidanGUID; + + uint32 ConversationTimer; + uint32 Step; + + bool Event; + + void Reset() + { + PlayerGUID = 0; + IllidanGUID = 0; + + ConversationTimer = 0; + Step = 0; + + Event = false; + } + + void EnterCombat(Unit* who){} + + void StartEvent() + { + m_creature->SetUInt32Value(UNIT_NPC_FLAGS, 0); + m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,0); + Unit* Illidan = m_creature->SummonCreature(C_ILLIDAN, -5107.83, 602.584, 85.2393, 4.92598, TEMPSUMMON_CORPSE_DESPAWN, 0); + if (Illidan) + { + IllidanGUID = Illidan->GetGUID(); + Illidan->SetVisibility(VISIBILITY_OFF); + } + if (PlayerGUID) + { + Player* pPlayer = Unit::GetPlayer(PlayerGUID); + if (pPlayer) + DoScriptText(OVERLORD_SAY_1, m_creature, pPlayer); + } + ConversationTimer = 4200; + Step = 0; + Event = true; + } + + uint32 NextStep(uint32 Step) + { + Unit* plr = Unit::GetUnit((*m_creature), PlayerGUID); + + Unit* Illi = Unit::GetUnit((*m_creature), IllidanGUID); + + if (!plr || !Illi) + { + EnterEvadeMode(); + return 0; + } + + switch(Step) + { + case 0: return 0; break; + case 1: m_creature->GetMotionMaster()->MovePoint(0, -5104.41, 595.297, 85.6838); return 9000; break; + case 2: DoScriptText(OVERLORD_YELL_1, m_creature, plr); return 4500; break; + case 3: m_creature->SetInFront(plr); return 3200; break; + case 4: DoScriptText(OVERLORD_SAY_2, m_creature, plr); return 2000; break; + case 5: Illi->SetVisibility(VISIBILITY_ON); + Illi->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); return 350; break; + case 6: + Illi->CastSpell(Illi, SPELL_ONE, true); + Illi->SetUInt64Value(UNIT_FIELD_TARGET, m_creature->GetGUID()); + m_creature->SetUInt64Value(UNIT_FIELD_TARGET, IllidanGUID); + return 2000; break; + case 7: DoScriptText(OVERLORD_YELL_2, m_creature); return 4500; break; + case 8: m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 8); return 2500; break; + case 9: DoScriptText(OVERLORD_SAY_3, m_creature); return 6500; break; + case 10: DoScriptText(LORD_ILLIDAN_SAY_1, Illi); return 5000; break; + case 11: DoScriptText(OVERLORD_SAY_4, m_creature, plr); return 6000; break; + case 12: DoScriptText(LORD_ILLIDAN_SAY_2, Illi); return 5500; break; + case 13: DoScriptText(LORD_ILLIDAN_SAY_3, Illi); return 4000; break; + case 14: Illi->SetUInt64Value(UNIT_FIELD_TARGET, PlayerGUID); return 1500; break; + case 15: DoScriptText(LORD_ILLIDAN_SAY_4, Illi); return 1500; break; + case 16: + if (plr) + { + Illi->CastSpell(plr, SPELL_TWO, true); + plr->RemoveAurasDueToSpell(SPELL_THREE); + plr->RemoveAurasDueToSpell(SPELL_FOUR); + return 5000; + }else{ + CAST_PLR(plr)->FailQuest(QUEST_LORD_ILLIDAN_STORMRAGE); Step = 30; return 100; + }break; + case 17: DoScriptText(LORD_ILLIDAN_SAY_5, Illi); return 5000; break; + case 18: DoScriptText(LORD_ILLIDAN_SAY_6, Illi); return 5000; break; + case 19: DoScriptText(LORD_ILLIDAN_SAY_7, Illi); return 5000; break; + case 20: + Illi->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF); + Illi->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + return 500; break; + case 21: DoScriptText(OVERLORD_SAY_5, m_creature); return 500; break; + case 22: + Illi->SetVisibility(VISIBILITY_OFF); + Illi->setDeathState(JUST_DIED); + return 1000; break; + case 23: m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,0); return 2000; break; + case 24: m_creature->SetUInt64Value(UNIT_FIELD_TARGET, PlayerGUID); return 5000; break; + case 25: DoScriptText(OVERLORD_SAY_6, m_creature); return 2000; break; + case 26: + if (plr) + CAST_PLR(plr)->GroupEventHappens(QUEST_LORD_ILLIDAN_STORMRAGE, m_creature); + return 6000; break; + case 27: + { + Unit* Yarzill = me->FindNearestCreature(C_YARZILL, 50); + if (Yarzill) + Yarzill->SetUInt64Value(UNIT_FIELD_TARGET, PlayerGUID); + return 500; }break; + case 28: + plr->RemoveAurasDueToSpell(SPELL_TWO); + plr->RemoveAurasDueToSpell(41519); + plr->CastSpell(plr, SPELL_THREE, true); + plr->CastSpell(plr, SPELL_FOUR, true); + return 1000; break; + case 29: + { + Unit* Yarzill = me->FindNearestCreature(C_YARZILL, 50); + if (Yarzill) + DoScriptText(YARZILL_THE_MERC_SAY, Yarzill, plr); + return 5000; }break; + case 30: + { + Unit* Yarzill = me->FindNearestCreature(C_YARZILL, 50); + if (Yarzill) + Yarzill->SetUInt64Value(UNIT_FIELD_TARGET, 0); + return 5000; }break; + case 31: + { + Unit* Yarzill = me->FindNearestCreature(C_YARZILL, 50); + if (Yarzill) + Yarzill->CastSpell(plr, 41540, true); + return 1000;}break; + case 32: m_creature->GetMotionMaster()->MovePoint(0, -5085.77, 577.231, 86.6719); return 5000; break; + case 33: Reset(); return 100; break; + + default : return 0; + } + } + + void UpdateAI(const uint32 diff) + { + if (!ConversationTimer) + return; + + if (ConversationTimer <= diff) + { + if (Event && IllidanGUID && PlayerGUID) + { + ConversationTimer = NextStep(++Step); + } + }else ConversationTimer -= diff; + } +}; + +CreatureAI* GetAI_npc_overlord_morghor(Creature* pCreature) +{ +return new npc_overlord_morghorAI(pCreature); +} + +bool QuestAccept_npc_overlord_morghor(Player* pPlayer, Creature* pCreature, const Quest *_Quest) +{ + if (_Quest->GetQuestId() == QUEST_LORD_ILLIDAN_STORMRAGE) + { + CAST_AI(npc_overlord_morghorAI, pCreature->AI())->PlayerGUID = pPlayer->GetGUID(); + CAST_AI(npc_overlord_morghorAI, pCreature->AI())->StartEvent(); + return true; + } + return false; +} + +/*#### +# npc_earthmender_wilda +####*/ + +enum +{ + SAY_WIL_START = -1000381, + SAY_WIL_AGGRO1 = -1000382, + SAY_WIL_AGGRO2 = -1000383, + SAY_WIL_PROGRESS1 = -1000384, + SAY_WIL_PROGRESS2 = -1000385, + SAY_WIL_FIND_EXIT = -1000386, + SAY_WIL_PROGRESS4 = -1000387, + SAY_WIL_PROGRESS5 = -1000388, + SAY_WIL_JUST_AHEAD = -1000389, + SAY_WIL_END = -1000390, + + SPELL_CHAIN_LIGHTNING = 16006, + SPELL_EARTHBING_TOTEM = 15786, + SPELL_FROST_SHOCK = 12548, + SPELL_HEALING_WAVE = 12491, + + QUEST_ESCAPE_COILSCAR = 10451, + NPC_COILSKAR_ASSASSIN = 21044, + FACTION_EARTHEN = 1726 //guessed +}; + +struct TRINITY_DLL_DECL npc_earthmender_wildaAI : public npc_escortAI +{ + npc_earthmender_wildaAI(Creature* pCreature) : npc_escortAI(pCreature) { } + + uint32 m_uiHealingTimer; + + void Reset() + { + m_uiHealingTimer = 0; + } + + void WaypointReached(uint32 uiPointId) + { + Player* pPlayer = (Player*)Unit::GetUnit(*m_creature, PlayerGUID); + + if (!pPlayer) + return; + + switch(uiPointId) + { + case 13: + DoScriptText(SAY_WIL_PROGRESS1, m_creature, pPlayer); + DoSpawnAssassin(); + break; + case 14: + DoSpawnAssassin(); + break; + case 15: + DoScriptText(SAY_WIL_FIND_EXIT, m_creature, pPlayer); + break; + case 19: + DoRandomSay(); + break; + case 20: + DoSpawnAssassin(); + break; + case 26: + DoRandomSay(); + break; + case 27: + DoSpawnAssassin(); + break; + case 33: + DoRandomSay(); + break; + case 34: + DoSpawnAssassin(); + break; + case 37: + DoRandomSay(); + break; + case 38: + DoSpawnAssassin(); + break; + case 39: + DoScriptText(SAY_WIL_JUST_AHEAD, m_creature, pPlayer); + break; + case 43: + DoRandomSay(); + break; + case 44: + DoSpawnAssassin(); + break; + case 50: + DoScriptText(SAY_WIL_END, m_creature, pPlayer); + + if (Player* pPlayer = Unit::GetPlayer(PlayerGUID)) + pPlayer->GroupEventHappens(QUEST_ESCAPE_COILSCAR, m_creature); + break; + } + } + + void JustSummoned(Creature* pSummoned) + { + if (pSummoned->GetEntry() == NPC_COILSKAR_ASSASSIN) + pSummoned->AI()->AttackStart(m_creature); + } + + //this is very unclear, random say without no real relevance to script/event + void DoRandomSay() + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_WIL_PROGRESS2, m_creature); break; + case 1: DoScriptText(SAY_WIL_PROGRESS4, m_creature); break; + case 2: DoScriptText(SAY_WIL_PROGRESS5, m_creature); break; + } + } + + void DoSpawnAssassin() + { + //unknown where they actually appear + float fX, fY, fZ; + m_creature->GetRandomPoint(m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 15.0f, fX, fY, fZ); + + m_creature->SummonCreature(NPC_COILSKAR_ASSASSIN, fX, fY, fZ, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + } + + void Aggro(Unit* pWho) + { + //don't always use + if (rand()%5) + return; + + //only aggro text if not player + if (pWho->GetTypeId() != TYPEID_PLAYER) + { + //appears to be random + switch(rand()%4) + { + case 0: DoScriptText(SAY_WIL_AGGRO1, m_creature, pWho); break; + case 1: DoScriptText(SAY_WIL_AGGRO2, m_creature, pWho); break; + } + } + } + + void UpdateAI(const uint32 uiDiff) + { + npc_escortAI::UpdateAI(uiDiff); + + if (!UpdateVictim()) + return; + + //TODO: add more abilities + if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 30) + { + if (m_uiHealingTimer < uiDiff) + { + DoCast(m_creature, SPELL_HEALING_WAVE); + m_uiHealingTimer = 15000; + } + else + m_uiHealingTimer -= uiDiff; + } + } +}; + +CreatureAI* GetAI_npc_earthmender_wilda(Creature* pCreature) +{ + npc_earthmender_wildaAI* pTempAI = new npc_earthmender_wildaAI(pCreature); + + pTempAI->FillPointMovementListForCreature(); + + return (CreatureAI*)pTempAI; +} + +bool QuestAccept_npc_earthmender_wilda(Player* pPlayer, Creature* pCreature, const Quest* pQuest) +{ + if (pQuest->GetQuestId() == QUEST_ESCAPE_COILSCAR) + { + DoScriptText(SAY_WIL_START, pCreature, pPlayer); + pCreature->setFaction(FACTION_EARTHEN); + + if (npc_earthmender_wildaAI* pEscortAI = CAST_AI(npc_earthmender_wildaAI, pCreature->AI())) + pEscortAI->Start(false, false, pPlayer->GetGUID(), pQuest); + } + return true; +} + +/*##### +# Quest: Battle of the crimson watch +#####*/ + +/* ContentData +Battle of the crimson watch - creatures, gameobjects and defines +mob_illidari_spawn : Adds that are summoned in the Crimson Watch battle. +mob_torloth_the_magnificent : Final Creature that players have to face before quest is completed +npc_lord_illidan_stormrage : Creature that controls the event. +go_crystal_prison : GameObject that begins the event and hands out quest +EndContentData */ + +#define END_TEXT -1000366 + +#define QUEST_BATTLE_OF_THE_CRIMSON_WATCH 10781 +#define EVENT_AREA_RADIUS 65 //65yds +#define EVENT_COOLDOWN 30000 //in ms. appear after event completed or failed (should be = Adds despawn time) + +struct TorlothCinematic +{ + int32 TextId; + uint32 pCreature, Timer; +}; + +// Creature 0 - Torloth, 1 - Illidan +static TorlothCinematic TorlothAnim[]= +{ + {-1000367, 0, 2000}, + {-1000368, 1, 7000}, + {-1000369, 0, 3000}, + {NULL, 0, 2000}, // Torloth stand + {-1000370, 0, 1000}, + {NULL, 0, 3000}, + {NULL, 0, NULL} +}; + +struct Location +{ + float x, y, z, o; +}; + +//Cordinates for Spawns +static Location SpawnLocation[]= +{ + //Cords used for: + {-4615.8556, 1342.2532, 139.9, 1.612},//Illidari Soldier + {-4598.9365, 1377.3182, 139.9, 3.917},//Illidari Soldier + {-4598.4697, 1360.8999, 139.9, 2.427},//Illidari Soldier + {-4589.3599, 1369.1061, 139.9, 3.165},//Illidari Soldier + {-4608.3477, 1386.0076, 139.9, 4.108},//Illidari Soldier + {-4633.1889, 1359.8033, 139.9, 0.949},//Illidari Soldier + {-4623.5791, 1351.4574, 139.9, 0.971},//Illidari Soldier + {-4607.2988, 1351.6099, 139.9, 2.416},//Illidari Soldier + {-4633.7764, 1376.0417, 139.9, 5.608},//Illidari Soldier + {-4600.2461, 1369.1240, 139.9, 3.056},//Illidari Mind Breaker + {-4631.7808, 1367.9459, 139.9, 0.020},//Illidari Mind Breaker + {-4600.2461, 1369.1240, 139.9, 3.056},//Illidari Highlord + {-4631.7808, 1367.9459, 139.9, 0.020},//Illidari Highlord + {-4615.5586, 1353.0031, 139.9, 1.540},//Illidari Highlord + {-4616.4736, 1384.2170, 139.9, 4.971},//Illidari Highlord + {-4627.1240, 1378.8752, 139.9, 2.544} //Torloth The Magnificent +}; + +struct WaveData +{ + uint8 SpawnCount, UsedSpawnPoint; + uint32 CreatureId, SpawnTimer,YellTimer; + int32 WaveTextId; +}; + +static WaveData WavesInfo[]= +{ + {9, 0, 22075, 10000, 7000, -1000371}, //Illidari Soldier + {2, 9, 22074, 10000, 7000, -1000372}, //Illidari Mind Breaker + {4, 11, 19797, 10000, 7000, -1000373}, //Illidari Highlord + {1, 15, 22076, 10000, 7000, -1000374} //Torloth The Magnificent +}; + +struct SpawnSpells +{ + uint32 Timer1, Timer2, SpellId; +}; + +static SpawnSpells SpawnCast[]= +{ + {10000, 15000, 35871}, // Illidari Soldier Cast - Spellbreaker + {10000, 10000, 38985}, // Illidari Mind Breake Cast - Focused Bursts + {35000, 35000, 22884}, // Illidari Mind Breake Cast - Psychic Scream + {20000, 20000, 17194}, // Illidari Mind Breake Cast - Mind Blast + {8000, 15000, 38010}, // Illidari Highlord Cast - Curse of Flames + {12000, 20000, 16102}, // Illidari Highlord Cast - Flamestrike + {10000, 15000, 15284}, // Torloth the Magnificent Cast - Cleave + {18000, 20000, 39082}, // Torloth the Magnificent Cast - Shadowfury + {25000, 28000, 33961} // Torloth the Magnificent Cast - Spell Reflection +}; + +/*###### +# mob_illidari_spawn +######*/ + +struct TRINITY_DLL_DECL mob_illidari_spawnAI : public ScriptedAI +{ + mob_illidari_spawnAI(Creature* c) : ScriptedAI(c) {} + + uint64 LordIllidanGUID; + uint32 SpellTimer1, SpellTimer2, SpellTimer3; + bool Timers; + + void Reset() + { + LordIllidanGUID = 0; + Timers = false; + } + + void EnterCombat(Unit* who) {} + void JustDied(Unit* slayer); + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (!Timers) + { + if (m_creature->GetEntry() == 22075)//Illidari Soldier + { + SpellTimer1 = SpawnCast[0].Timer1 + (rand()%4 * 1000); + } + if (m_creature->GetEntry() == 22074)//Illidari Mind Breaker + { + SpellTimer1 = SpawnCast[1].Timer1 + (rand()%10 * 1000); + SpellTimer2 = SpawnCast[2].Timer1 + (rand()%4 * 1000); + SpellTimer3 = SpawnCast[3].Timer1 + (rand()%4 * 1000); + } + if (m_creature->GetEntry() == 19797)// Illidari Highlord + { + SpellTimer1 = SpawnCast[4].Timer1 + (rand()%4 * 1000); + SpellTimer2 = SpawnCast[5].Timer1 + (rand()%4 * 1000); + } + Timers = true; + } + //Illidari Soldier + if (m_creature->GetEntry() == 22075) + { + if (SpellTimer1 < diff) + { + DoCast(m_creature->getVictim(), SpawnCast[0].SpellId);//Spellbreaker + SpellTimer1 = SpawnCast[0].Timer2 + (rand()%5 * 1000); + }else SpellTimer1 -= diff; + } + //Illidari Mind Breaker + if (m_creature->GetEntry() == 22074) + { + if (SpellTimer1 < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + { + if (target->GetTypeId() == TYPEID_PLAYER) + { + DoCast(target, SpawnCast[1].SpellId); //Focused Bursts + SpellTimer1 = SpawnCast[1].Timer2 + (rand()%5 * 1000); + }else SpellTimer1 = 2000; + } + }else SpellTimer1 -= diff; + + if (SpellTimer2 < diff) + { + DoCast(m_creature->getVictim(), SpawnCast[2].SpellId);//Psychic Scream + SpellTimer2 = SpawnCast[2].Timer2 + (rand()%13 * 1000); + }else SpellTimer2 -= diff; + + if (SpellTimer3 < diff) + { + DoCast(m_creature->getVictim(), SpawnCast[3].SpellId);//Mind Blast + SpellTimer3 = SpawnCast[3].Timer2 + (rand()%8 * 1000); + }else SpellTimer3 -= diff; + } + //Illidari Highlord + if (m_creature->GetEntry() == 19797) + { + if (SpellTimer1 < diff) + { + DoCast(m_creature->getVictim(), SpawnCast[4].SpellId);//Curse Of Flames + SpellTimer1 = SpawnCast[4].Timer2 + (rand()%10 * 1000); + }else SpellTimer1 -= diff; + + if (SpellTimer2 < diff) + { + DoCast(m_creature->getVictim(), SpawnCast[5].SpellId);//Flamestrike + SpellTimer2 = SpawnCast[5].Timer2 + (rand()%7 * 13000); + }else SpellTimer2 -= diff; + } + + DoMeleeAttackIfReady(); + } +}; + +/*###### +# mob_torloth_the_magnificent +#####*/ + +struct TRINITY_DLL_DECL mob_torloth_the_magnificentAI : public ScriptedAI +{ + mob_torloth_the_magnificentAI(Creature* c) : ScriptedAI(c) {} + + uint32 AnimationTimer, SpellTimer1, SpellTimer2, SpellTimer3; + + uint8 AnimationCount; + + uint64 LordIllidanGUID; + uint64 AggroTargetGUID; + + bool Timers; + + void Reset() + { + AnimationTimer = 4000; + AnimationCount = 0; + LordIllidanGUID = 0; + AggroTargetGUID = 0; + Timers = false; + + m_creature->addUnitState(UNIT_STAT_ROOT); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0); + } + + void EnterCombat(Unit* who){} + + void HandleAnimation() + { + Creature* pCreature = m_creature; + + if (TorlothAnim[AnimationCount].pCreature == 1) + { + pCreature = (Unit::GetCreature(*m_creature, LordIllidanGUID)); + + if (!pCreature) + return; + } + + if (TorlothAnim[AnimationCount].TextId) + DoScriptText(TorlothAnim[AnimationCount].TextId, pCreature); + + AnimationTimer = TorlothAnim[AnimationCount].Timer; + + switch(AnimationCount) + { + case 0: + m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,8); + break; + case 3: + m_creature->RemoveFlag(UNIT_FIELD_BYTES_1,8); + break; + case 5: + if (Player* AggroTarget = (Unit::GetPlayer(AggroTargetGUID))) + { + m_creature->SetUInt64Value(UNIT_FIELD_TARGET, AggroTarget->GetGUID()); + m_creature->AddThreat(AggroTarget, 1); + m_creature->HandleEmoteCommand(EMOTE_ONESHOT_POINT); + } + break; + case 6: + if (Player* AggroTarget = (Unit::GetPlayer(AggroTargetGUID))) + { + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->clearUnitState(UNIT_STAT_ROOT); + + float x, y, z; + AggroTarget->GetPosition(x,y,z); + m_creature->GetMotionMaster()->MovePoint(0,x,y,z); + } + break; + } + ++AnimationCount; + } + + void UpdateAI(const uint32 diff) + { + if (AnimationTimer) + { + if (AnimationTimer <= diff) + { + HandleAnimation(); + }else AnimationTimer -= diff; + } + + if (AnimationCount < 6) + { + m_creature->CombatStop(); + }else if (!Timers) + { + + SpellTimer1 = SpawnCast[6].Timer1; + SpellTimer2 = SpawnCast[7].Timer1; + SpellTimer3 = SpawnCast[8].Timer1; + Timers = true; + } + + if (Timers) + { + if (SpellTimer1 < diff) + { + DoCast(m_creature->getVictim(), SpawnCast[6].SpellId);//Cleave + SpellTimer1 = SpawnCast[6].Timer2 + (rand()%10 * 1000); + }else SpellTimer1 -= diff; + + if (SpellTimer2 < diff) + { + DoCast(m_creature->getVictim(), SpawnCast[7].SpellId);//Shadowfury + SpellTimer2 = SpawnCast[7].Timer2 + (rand()%5 * 1000); + }else SpellTimer2 -= diff; + + if (SpellTimer3 < diff) + { + DoCast(m_creature, SpawnCast[8].SpellId); + SpellTimer3 = SpawnCast[8].Timer2 + (rand()%7 * 1000);//Spell Reflection + }else SpellTimer3 -= diff; + } + + DoMeleeAttackIfReady(); + } + + void JustDied(Unit* slayer) + { + if (slayer) + switch(slayer->GetTypeId()) + { + case TYPEID_UNIT: + if (Unit *owner = slayer->GetOwner()) + if (owner->GetTypeId() == TYPEID_PLAYER) + CAST_PLR(owner)->GroupEventHappens(QUEST_BATTLE_OF_THE_CRIMSON_WATCH, m_creature); + break; + + case TYPEID_PLAYER: + CAST_PLR(slayer)->GroupEventHappens(QUEST_BATTLE_OF_THE_CRIMSON_WATCH, m_creature); + break; + } + + if (Creature* LordIllidan = (Unit::GetCreature(*m_creature, LordIllidanGUID))) + { + DoScriptText(END_TEXT, LordIllidan, slayer); + LordIllidan->AI()->EnterEvadeMode(); + } + } +}; + +/*##### +# npc_lord_illidan_stormrage +#####*/ + +struct TRINITY_DLL_DECL npc_lord_illidan_stormrageAI : public ScriptedAI +{ + npc_lord_illidan_stormrageAI(Creature* c) : ScriptedAI(c) {} + + uint64 PlayerGUID; + + uint32 WaveTimer; + uint32 AnnounceTimer; + + int8 LiveCount; + uint8 WaveCount; + + bool EventStarted; + bool Announced; + bool Failed; + + void Reset() + { + PlayerGUID = 0; + + WaveTimer = 10000; + AnnounceTimer = 7000; + LiveCount = 0; + WaveCount = 0; + + EventStarted = false; + Announced = false; + Failed = false; + + m_creature->SetVisibility(VISIBILITY_OFF); + } + + void EnterCombat(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void AttackStart(Unit* who) {} + + void SummonNextWave() + { + uint8 count = WavesInfo[WaveCount].SpawnCount; + uint8 locIndex = WavesInfo[WaveCount].UsedSpawnPoint; + srand(time(NULL));//initializing random seed + uint8 FelguardCount = 0; + uint8 DreadlordCount = 0; + + for(uint8 i = 0; i < count; ++i) + { + Creature* Spawn = NULL; + float X = SpawnLocation[locIndex + i].x; + float Y = SpawnLocation[locIndex + i].y; + float Z = SpawnLocation[locIndex + i].z; + float O = SpawnLocation[locIndex + i].o; + Spawn = m_creature->SummonCreature(WavesInfo[WaveCount].CreatureId, X, Y, Z, O, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000); + ++LiveCount; + + if (Spawn) + { + Spawn->LoadCreaturesAddon(); + + if (WaveCount == 0)//1 Wave + { + if (rand()%3 == 1 && FelguardCount<2) + { + Spawn->SetDisplayId(18654); + ++FelguardCount; + } + else if (DreadlordCount < 3) + { + Spawn->SetDisplayId(19991); + ++DreadlordCount; + } + else if (FelguardCount<2) + { + Spawn->SetDisplayId(18654); + ++FelguardCount; + } + } + + if (WaveCount < 3)//1-3 Wave + { + if (PlayerGUID) + { + if (Player* pTarget = Unit::GetPlayer(PlayerGUID)) + { + float x, y, z; + pTarget->GetPosition(x,y,z); + Spawn->GetMotionMaster()->MovePoint(0,x, y, z); + } + } + CAST_AI(mob_illidari_spawnAI, Spawn->AI())->LordIllidanGUID = m_creature->GetGUID(); + } + + if (WavesInfo[WaveCount].CreatureId == 22076) // Torloth + { + CAST_AI(mob_torloth_the_magnificentAI, Spawn->AI())->LordIllidanGUID = m_creature->GetGUID(); + if (PlayerGUID) + CAST_AI(mob_torloth_the_magnificentAI, Spawn->AI())->AggroTargetGUID = PlayerGUID; + } + } + } + ++WaveCount; + WaveTimer = WavesInfo[WaveCount].SpawnTimer; + AnnounceTimer = WavesInfo[WaveCount].YellTimer; + } + + void CheckEventFail() + { + Player* pPlayer = Unit::GetPlayer(PlayerGUID); + + if (!pPlayer) + return; + + if (Group *EventGroup = pPlayer->GetGroup()) + { + Player* GroupMember; + + uint8 GroupMemberCount = 0; + uint8 DeadMemberCount = 0; + uint8 FailedMemberCount = 0; + + const Group::MemberSlotList members = EventGroup->GetMemberSlots(); + + for(Group::member_citerator itr = members.begin(); itr!= members.end(); itr++) + { + GroupMember = (Unit::GetPlayer(itr->guid)); + if (!GroupMember) + continue; + if (!GroupMember->IsWithinDistInMap(m_creature, EVENT_AREA_RADIUS) && GroupMember->GetQuestStatus(QUEST_BATTLE_OF_THE_CRIMSON_WATCH) == QUEST_STATUS_INCOMPLETE) + { + GroupMember->FailQuest(QUEST_BATTLE_OF_THE_CRIMSON_WATCH); + GroupMember->SetQuestStatus(QUEST_BATTLE_OF_THE_CRIMSON_WATCH, QUEST_STATUS_NONE); + ++FailedMemberCount; + } + ++GroupMemberCount; + + if (GroupMember->isDead()) + { + ++DeadMemberCount; + } + } + + if (GroupMemberCount == FailedMemberCount) + { + Failed = true; + } + + if (GroupMemberCount == DeadMemberCount) + { + for(Group::member_citerator itr = members.begin(); itr!= members.end(); itr++) + { + GroupMember = Unit::GetPlayer(itr->guid); + + if (GroupMember && GroupMember->GetQuestStatus(QUEST_BATTLE_OF_THE_CRIMSON_WATCH) == QUEST_STATUS_INCOMPLETE) + { + GroupMember->FailQuest(QUEST_BATTLE_OF_THE_CRIMSON_WATCH); + GroupMember->SetQuestStatus(QUEST_BATTLE_OF_THE_CRIMSON_WATCH, QUEST_STATUS_NONE); + } + } + Failed = true; + } + }else if (pPlayer->isDead() || !pPlayer->IsWithinDistInMap(m_creature, EVENT_AREA_RADIUS)) + { + pPlayer->FailQuest(QUEST_BATTLE_OF_THE_CRIMSON_WATCH); + Failed = true; + } + } + + void LiveCounter() + { + --LiveCount; + if (!LiveCount) + Announced = false; + } + + void UpdateAI(const uint32 diff) + { + if (!PlayerGUID || !EventStarted) + return; + + if (!LiveCount && WaveCount < 4) + { + if (!Announced && AnnounceTimer < diff) + { + DoScriptText(WavesInfo[WaveCount].WaveTextId, m_creature); + Announced = true; + }else AnnounceTimer -= diff; + + if (WaveTimer < diff) + { + SummonNextWave(); + }else WaveTimer -= diff; + } + CheckEventFail(); + + if (Failed) + EnterEvadeMode(); + } +}; + +void mob_illidari_spawnAI::JustDied(Unit *slayer) +{ + m_creature->RemoveCorpse(); + if (Creature* LordIllidan = (Unit::GetCreature(*m_creature, LordIllidanGUID))) + if (LordIllidan) + CAST_AI(npc_lord_illidan_stormrageAI, LordIllidan->AI())->LiveCounter(); +} + +/*##### +# go_crystal_prison +######*/ + +bool GOQuestAccept_GO_crystal_prison(Player* plr, GameObject* go, Quest const* quest) +{ + if (quest->GetQuestId() == QUEST_BATTLE_OF_THE_CRIMSON_WATCH) + { + Creature* Illidan = plr->FindNearestCreature(22083, 50); + + if (Illidan && !CAST_AI(npc_lord_illidan_stormrageAI, Illidan->AI())->EventStarted) + { + CAST_AI(npc_lord_illidan_stormrageAI, Illidan->AI())->PlayerGUID = plr->GetGUID(); + CAST_AI(npc_lord_illidan_stormrageAI, Illidan->AI())->LiveCount = 0; + CAST_AI(npc_lord_illidan_stormrageAI, Illidan->AI())->EventStarted=true; + } + } + return true; +} + +CreatureAI* GetAI_npc_lord_illidan_stormrage(Creature* c) +{ + return new npc_lord_illidan_stormrageAI(c); +} + +CreatureAI* GetAI_mob_illidari_spawn(Creature* c) +{ + return new mob_illidari_spawnAI(c); +} + +CreatureAI* GetAI_mob_torloth_the_magnificent(Creature* c) +{ + return new mob_torloth_the_magnificentAI(c); +} + +/*#### +# npc_enraged_spirits +####*/ + +/* QUESTS */ +#define QUEST_ENRAGED_SPIRITS_FIRE_EARTH 10458 +#define QUEST_ENRAGED_SPIRITS_AIR 10481 +#define QUEST_ENRAGED_SPIRITS_WATER 10480 + +/* Totem */ +#define ENTRY_TOTEM_OF_SPIRITS 21071 +#define RADIUS_TOTEM_OF_SPIRITS 15 + +/* SPIRITS */ +#define ENTRY_ENRAGED_EARTH_SPIRIT 21050 +#define ENTRY_ENRAGED_FIRE_SPIRIT 21061 +#define ENTRY_ENRAGED_AIR_SPIRIT 21060 +#define ENTRY_ENRAGED_WATER_SPIRIT 21059 + +/* SOULS */ +#define ENTRY_EARTHEN_SOUL 21073 +#define ENTRY_FIERY_SOUL 21097 +#define ENTRY_ENRAGED_AIRY_SOUL 21116 +#define ENTRY_ENRAGED_WATERY_SOUL 21109 // wrong model + +/* SPELL KILLCREDIT - not working!?! - using KilledMonsterCredit */ +#define SPELL_EARTHEN_SOUL_CAPTURED_CREDIT 36108 +#define SPELL_FIERY_SOUL_CAPTURED_CREDIT 36117 +#define SPELL_AIRY_SOUL_CAPTURED_CREDIT 36182 +#define SPELL_WATERY_SOUL_CAPTURED_CREDIT 36171 + +/* KilledMonsterCredit Workaround */ +#define CREDIT_FIRE 21094 +#define CREDIT_WATER 21095 +#define CREDIT_AIR 21096 +#define CREDIT_EARTH 21092 + +/* Captured Spell/Buff */ +#define SPELL_SOUL_CAPTURED 36115 + +/* Factions */ +#define ENRAGED_SOUL_FRIENDLY 35 +#define ENRAGED_SOUL_HOSTILE 14 + +struct TRINITY_DLL_DECL npc_enraged_spiritAI : public ScriptedAI +{ + npc_enraged_spiritAI(Creature *c) : ScriptedAI(c) {} + + void Reset() { } + + void EnterCombat(Unit *who){} + + void JustDied(Unit* killer) + { + // always spawn spirit on death + // if totem around + // move spirit to totem and cast kill count + uint32 entry = 0; + uint32 credit = 0; + + switch(m_creature->GetEntry()) { + case ENTRY_ENRAGED_FIRE_SPIRIT: + entry = ENTRY_FIERY_SOUL; + //credit = SPELL_FIERY_SOUL_CAPTURED_CREDIT; + credit = CREDIT_FIRE; + break; + case ENTRY_ENRAGED_EARTH_SPIRIT: + entry = ENTRY_EARTHEN_SOUL; + //credit = SPELL_EARTHEN_SOUL_CAPTURED_CREDIT; + credit = CREDIT_EARTH; + break; + case ENTRY_ENRAGED_AIR_SPIRIT: + entry = ENTRY_ENRAGED_AIRY_SOUL; + //credit = SPELL_AIRY_SOUL_CAPTURED_CREDIT; + credit = CREDIT_AIR; + break; + case ENTRY_ENRAGED_WATER_SPIRIT: + entry = ENTRY_ENRAGED_WATERY_SOUL; + //credit = SPELL_WATERY_SOUL_CAPTURED_CREDIT; + credit = CREDIT_WATER; + break; + } + + // Spawn Soul on Kill ALWAYS! + Creature* Summoned = NULL; + Unit* totemOspirits = NULL; + + if (entry != 0) + Summoned = DoSpawnCreature(entry, 0, 0, 1, 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 5000); + + // FIND TOTEM, PROCESS QUEST + if (Summoned) + { + totemOspirits = me->FindNearestCreature(ENTRY_TOTEM_OF_SPIRITS, RADIUS_TOTEM_OF_SPIRITS); + if (totemOspirits) + { + Summoned->setFaction(ENRAGED_SOUL_FRIENDLY); + Summoned->GetMotionMaster()->MovePoint(0,totemOspirits->GetPositionX(), totemOspirits->GetPositionY(), Summoned->GetPositionZ()); + + Unit* Owner = totemOspirits->GetOwner(); + if (Owner && Owner->GetTypeId() == TYPEID_PLAYER) + // DoCast(Owner, credit); -- not working! + CAST_PLR(Owner)->KilledMonsterCredit(credit, Summoned->GetGUID()); + DoCast(totemOspirits,SPELL_SOUL_CAPTURED); + } + } + } +}; + +CreatureAI* GetAI_npc_enraged_spirit(Creature* pCreature) +{ +return new npc_enraged_spiritAI(pCreature); +} + +/*##### +# +######*/ + +void AddSC_shadowmoon_valley() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "mob_mature_netherwing_drake"; + newscript->GetAI = &GetAI_mob_mature_netherwing_drake; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_enslaved_netherwing_drake"; + newscript->GetAI = &GetAI_mob_enslaved_netherwing_drake; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_dragonmaw_peon"; + newscript->GetAI = &GetAI_mob_dragonmaw_peon; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_drake_dealer_hurlunk"; + newscript->pGossipHello = &GossipHello_npc_drake_dealer_hurlunk; + newscript->pGossipSelect = &GossipSelect_npc_drake_dealer_hurlunk; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npcs_flanis_swiftwing_and_kagrosh"; + newscript->pGossipHello = &GossipHello_npcs_flanis_swiftwing_and_kagrosh; + newscript->pGossipSelect = &GossipSelect_npcs_flanis_swiftwing_and_kagrosh; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_murkblood_overseer"; + newscript->pGossipHello = &GossipHello_npc_murkblood_overseer; + newscript->pGossipSelect = &GossipSelect_npc_murkblood_overseer; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_neltharaku"; + newscript->pGossipHello = &GossipHello_npc_neltharaku; + newscript->pGossipSelect = &GossipSelect_npc_neltharaku; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_karynaku"; + newscript->pQuestAccept = &QuestAccept_npc_karynaku; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_oronok_tornheart"; + newscript->pGossipHello = &GossipHello_npc_oronok_tornheart; + newscript->pGossipSelect = &GossipSelect_npc_oronok_tornheart; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_overlord_morghor"; + newscript->GetAI = &GetAI_npc_overlord_morghor; + newscript->pQuestAccept = &QuestAccept_npc_overlord_morghor; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_earthmender_wilda"; + newscript->GetAI = &GetAI_npc_earthmender_wilda; + newscript->pQuestAccept = &QuestAccept_npc_earthmender_wilda; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_lord_illidan_stormrage"; + newscript->GetAI = &GetAI_npc_lord_illidan_stormrage; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "go_crystal_prison"; + newscript->pGOQuestAccept = &GOQuestAccept_GO_crystal_prison; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_illidari_spawn"; + newscript->GetAI = &GetAI_mob_illidari_spawn; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_torloth_the_magnificent"; + newscript->GetAI = &GetAI_mob_torloth_the_magnificent; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_enraged_spirit"; + newscript->GetAI = &GetAI_npc_enraged_spirit; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/shattrath_city.cpp b/src/bindings/scripts/scripts/outland/shattrath_city.cpp new file mode 100644 index 00000000000..041e1355325 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/shattrath_city.cpp @@ -0,0 +1,692 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Shattrath_City +SD%Complete: 100 +SDComment: Quest support: 10004, 10009, 10211, 10231. Flask vendors, Teleport to Caverns of Time +SDCategory: Shattrath City +EndScriptData */ + +/* ContentData +npc_raliq_the_drunk +npc_salsalabim +npc_shattrathflaskvendors +npc_zephyr +npc_kservant +npc_dirty_larry +npc_ishanah +npc_khadgar +EndContentData */ + +#include "precompiled.h" +#include "../../npc/npc_escortAI.h" + +/*###### +## npc_raliq_the_drunk +######*/ + +#define GOSSIP_RALIQ "You owe Sim'salabim money. Hand them over or die!" + +enum +{ + SPELL_UPPERCUT = 10966, + QUEST_CRACK_SKULLS = 10009, + FACTION_HOSTILE_RD = 45 +}; + +struct TRINITY_DLL_DECL npc_raliq_the_drunkAI : public ScriptedAI +{ + npc_raliq_the_drunkAI(Creature* c) : ScriptedAI(c) + { + m_uiNormFaction = c->getFaction(); + } + + uint32 m_uiNormFaction; + uint32 Uppercut_Timer; + + void Reset() + { + Uppercut_Timer = 5000; + if (m_creature->getFaction() != m_uiNormFaction) + m_creature->setFaction(m_uiNormFaction); + } + + void EnterCombat(Unit *who) {} + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (Uppercut_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_UPPERCUT); + Uppercut_Timer = 15000; + }else Uppercut_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_npc_raliq_the_drunk(Creature* pCreature) +{ + return new npc_raliq_the_drunkAI (pCreature); +} + +bool GossipHello_npc_raliq_the_drunk(Player* pPlayer, Creature* pCreature) +{ + if (pPlayer->GetQuestStatus(QUEST_CRACK_SKULLS) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_RALIQ, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + pPlayer->SEND_GOSSIP_MENU(9440, pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_raliq_the_drunk(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + { + pPlayer->CLOSE_GOSSIP_MENU(); + pCreature->setFaction(FACTION_HOSTILE_RD); + pCreature->AI()->AttackStart(pPlayer); + } + return true; +} + +/*###### +# npc_salsalabim +######*/ + +#define FACTION_HOSTILE_SA 90 +#define FACTION_FRIENDLY_SA 35 +#define QUEST_10004 10004 + +#define SPELL_MAGNETIC_PULL 31705 + +struct TRINITY_DLL_DECL npc_salsalabimAI : public ScriptedAI +{ + npc_salsalabimAI(Creature* c) : ScriptedAI(c) {} + + uint32 MagneticPull_Timer; + + void Reset() + { + MagneticPull_Timer = 15000; + m_creature->setFaction(FACTION_FRIENDLY_SA); + } + + void EnterCombat(Unit *who) {} + + void DamageTaken(Unit *done_by, uint32 &damage) + { + if (done_by->GetTypeId() == TYPEID_PLAYER) + if ((m_creature->GetHealth()-damage)*100 / m_creature->GetMaxHealth() < 20) + { + CAST_PLR(done_by)->GroupEventHappens(QUEST_10004,m_creature); + damage = 0; + EnterEvadeMode(); + } + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (MagneticPull_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_MAGNETIC_PULL); + MagneticPull_Timer = 15000; + }else MagneticPull_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_npc_salsalabim(Creature* pCreature) +{ + return new npc_salsalabimAI (pCreature); +} + +bool GossipHello_npc_salsalabim(Player* pPlayer, Creature* pCreature) +{ + if (pPlayer->GetQuestStatus(QUEST_10004) == QUEST_STATUS_INCOMPLETE) + { + pCreature->setFaction(FACTION_HOSTILE_SA); + pCreature->AI()->AttackStart(pPlayer); + } + else + { + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); + } + return true; +} + +/* +################################################## +Shattrath City Flask Vendors provides flasks to people exalted with 3 factions: +Haldor the Compulsive +Arcanist Xorith +Both sell special flasks for use in Outlands 25man raids only, +purchasable for one Mark of Illidari each +Purchase requires exalted reputation with Scryers/Aldor, Cenarion Expedition and The Sha'tar +################################################## +*/ + +bool GossipHello_npc_shattrathflaskvendors(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->GetEntry() == 23484) + { + // Aldor vendor + if (pCreature->isVendor() && (pPlayer->GetReputationRank(932) == REP_EXALTED) && (pPlayer->GetReputationRank(935) == REP_EXALTED) && (pPlayer->GetReputationRank(942) == REP_EXALTED)) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); + pPlayer->SEND_GOSSIP_MENU(11085, pCreature->GetGUID()); + } + else + { + pPlayer->SEND_GOSSIP_MENU(11083, pCreature->GetGUID()); + } + } + + if (pCreature->GetEntry() == 23483) + { + // Scryers vendor + if (pCreature->isVendor() && (pPlayer->GetReputationRank(934) == REP_EXALTED) && (pPlayer->GetReputationRank(935) == REP_EXALTED) && (pPlayer->GetReputationRank(942) == REP_EXALTED)) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); + pPlayer->SEND_GOSSIP_MENU(11085, pCreature->GetGUID()); + } + else + { + pPlayer->SEND_GOSSIP_MENU(11084, pCreature->GetGUID()); + } + } + + return true; +} + +bool GossipSelect_npc_shattrathflaskvendors(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_TRADE) + pPlayer->SEND_VENDORLIST(pCreature->GetGUID()); + + return true; +} + +/*###### +# npc_zephyr +######*/ + +#define GOSSIP_HZ "Take me to the Caverns of Time." + +bool GossipHello_npc_zephyr(Player* pPlayer, Creature* pCreature) +{ + if (pPlayer->GetReputationRank(989) >= REP_REVERED) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HZ, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_zephyr(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + pPlayer->CastSpell(pPlayer,37778,false); + + return true; +} + +/*###### +# npc_kservant +######*/ + +#define SAY1 -1000306 +#define WHISP1 -1000307 +#define WHISP2 -1000308 +#define WHISP3 -1000309 +#define WHISP4 -1000310 +#define WHISP5 -1000311 +#define WHISP6 -1000312 +#define WHISP7 -1000313 +#define WHISP8 -1000314 +#define WHISP9 -1000315 +#define WHISP10 -1000316 +#define WHISP11 -1000317 +#define WHISP12 -1000318 +#define WHISP13 -1000319 +#define WHISP14 -1000320 +#define WHISP15 -1000321 +#define WHISP16 -1000322 +#define WHISP17 -1000323 +#define WHISP18 -1000324 +#define WHISP19 -1000325 +#define WHISP20 -1000326 +#define WHISP21 -1000327 + +struct TRINITY_DLL_DECL npc_kservantAI : public npc_escortAI +{ +public: + npc_kservantAI(Creature *c) : npc_escortAI(c) {} + + + void WaypointReached(uint32 i) + { + Unit *pTemp = Unit::GetUnit(*m_creature,PlayerGUID); + + if (!pTemp) + return; + + switch(i) + { + case 0: DoScriptText(SAY1, m_creature, pTemp); break; + case 4: DoScriptText(WHISP1, m_creature, pTemp); break; + case 6: DoScriptText(WHISP2, m_creature, pTemp); break; + case 7: DoScriptText(WHISP3, m_creature, pTemp); break; + case 8: DoScriptText(WHISP4, m_creature, pTemp); break; + case 17: DoScriptText(WHISP5, m_creature, pTemp); break; + case 18: DoScriptText(WHISP6, m_creature, pTemp); break; + case 19: DoScriptText(WHISP7, m_creature, pTemp); break; + case 33: DoScriptText(WHISP8, m_creature, pTemp); break; + case 34: DoScriptText(WHISP9, m_creature, pTemp); break; + case 35: DoScriptText(WHISP10, m_creature, pTemp); break; + case 36: DoScriptText(WHISP11, m_creature, pTemp); break; + case 43: DoScriptText(WHISP12, m_creature, pTemp); break; + case 44: DoScriptText(WHISP13, m_creature, pTemp); break; + case 49: DoScriptText(WHISP14, m_creature, pTemp); break; + case 50: DoScriptText(WHISP15, m_creature, pTemp); break; + case 51: DoScriptText(WHISP16, m_creature, pTemp); break; + case 52: DoScriptText(WHISP17, m_creature, pTemp); break; + case 53: DoScriptText(WHISP18, m_creature, pTemp); break; + case 54: DoScriptText(WHISP19, m_creature, pTemp); break; + case 55: DoScriptText(WHISP20, m_creature, pTemp); break; + case 56: DoScriptText(WHISP21, m_creature, pTemp); + if (PlayerGUID) + { + Player* pPlayer = (Unit::GetPlayer(PlayerGUID)); + if (pPlayer) + pPlayer->GroupEventHappens(10211,m_creature); + } + break; + } + } + + void EnterCombat(Unit* who) {} + + void MoveInLineOfSight(Unit *who) + { + if (IsBeingEscorted) + return; + + if (who->GetTypeId() == TYPEID_PLAYER) + { + if (CAST_PLR(who)->GetQuestStatus(10211) == QUEST_STATUS_INCOMPLETE) + { + float Radius = 10.0; + if (m_creature->IsWithinDistInMap(who, Radius)) + { + Start(false, false, who->GetGUID()); + } + } + } + } + + void Reset() {} + + void UpdateAI(const uint32 diff) + { + npc_escortAI::UpdateAI(diff); + } +}; +CreatureAI* GetAI_npc_kservantAI(Creature* pCreature) +{ + npc_kservantAI* kservantAI = new npc_kservantAI(pCreature); + + kservantAI->FillPointMovementListForCreature(); + + return kservantAI; +} + +/*###### +# npc_dirty_larry +######*/ + +#define GOSSIP_BOOK "Ezekiel said that you might have a certain book..." + +#define SAY_1 -1000328 +#define SAY_2 -1000329 +#define SAY_3 -1000330 +#define SAY_4 -1000331 +#define SAY_5 -1000332 +#define SAY_GIVEUP -1000333 + +#define QUEST_WBI 10231 +#define NPC_CREEPJACK 19726 +#define NPC_MALONE 19725 + +struct TRINITY_DLL_DECL npc_dirty_larryAI : public ScriptedAI +{ + npc_dirty_larryAI(Creature* c) : ScriptedAI(c) {} + + bool Event; + bool Attack; + bool Done; + + uint64 PlayerGUID; + + uint32 SayTimer; + uint32 Step; + + void Reset() + { + Event = false; + Attack = false; + Done = false; + + PlayerGUID = 0; + SayTimer = 0; + Step = 0; + + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->setFaction(1194); + Unit* Creepjack = me->FindNearestCreature(NPC_CREEPJACK, 20); + if (Creepjack) + { + CAST_CRE(Creepjack)->AI()->EnterEvadeMode(); + Creepjack->setFaction(1194); + Creepjack->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + } + Unit* Malone = me->FindNearestCreature(NPC_MALONE, 20); + if (Malone) + { + CAST_CRE(Malone)->AI()->EnterEvadeMode(); + Malone->setFaction(1194); + Malone->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + } + } + + uint32 NextStep(uint32 Step) + { + Player* pPlayer = Unit::GetPlayer(PlayerGUID); + + switch(Step) + { + case 0:{ m_creature->SetInFront(pPlayer); + Unit* Creepjack = me->FindNearestCreature(NPC_CREEPJACK, 20); + if (Creepjack) + Creepjack->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); + Unit* Malone = me->FindNearestCreature(NPC_MALONE, 20); + if (Malone) + Malone->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); + m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); }return 2000; + case 1: DoScriptText(SAY_1, m_creature, pPlayer); return 3000; + case 2: DoScriptText(SAY_2, m_creature, pPlayer); return 5000; + case 3: DoScriptText(SAY_3, m_creature, pPlayer); return 2000; + case 4: DoScriptText(SAY_4, m_creature, pPlayer); return 2000; + case 5: DoScriptText(SAY_5, m_creature, pPlayer); return 2000; + case 6: Attack = true; return 2000; + default: return 0; + } + } + + void EnterCombat(Unit* who){} + + void UpdateAI(const uint32 diff) + { + if (SayTimer < diff) + { + if (Event) + SayTimer = NextStep(++Step); + }else SayTimer -= diff; + + if (Attack) + { + Player* pPlayer = Unit::GetPlayer(PlayerGUID); + m_creature->setFaction(14); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + if (pPlayer) + { + Unit* Creepjack = me->FindNearestCreature(NPC_CREEPJACK, 20); + if (Creepjack) + { + Creepjack->Attack(pPlayer, true); + Creepjack->setFaction(14); + Creepjack->GetMotionMaster()->MoveChase(pPlayer); + Creepjack->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + } + Unit* Malone = me->FindNearestCreature(NPC_MALONE, 20); + if (Malone) + { + Malone->Attack(pPlayer, true); + Malone->setFaction(14); + Malone->GetMotionMaster()->MoveChase(pPlayer); + Malone->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + } + DoStartMovement(pPlayer); + AttackStart(pPlayer); + } + Attack = false; + } + + if ((m_creature->GetHealth()*100)/m_creature->GetMaxHealth() < 1 && !Done) + { + Unit* Creepjack = me->FindNearestCreature(NPC_CREEPJACK, 20); + if (Creepjack) + { + CAST_CRE(Creepjack)->AI()->EnterEvadeMode(); + Creepjack->setFaction(1194); + Creepjack->GetMotionMaster()->MoveTargetedHome(); + Creepjack->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + } + Unit* Malone = me->FindNearestCreature(NPC_MALONE, 20); + if (Malone) + { + CAST_CRE(Malone)->AI()->EnterEvadeMode(); + Malone->setFaction(1194); + Malone->GetMotionMaster()->MoveTargetedHome(); + Malone->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + } + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->setFaction(1194); + Done = true; + DoScriptText(SAY_GIVEUP, m_creature, NULL); + m_creature->DeleteThreatList(); + m_creature->CombatStop(); + m_creature->GetMotionMaster()->MoveTargetedHome(); + Player* pPlayer = Unit::GetPlayer(PlayerGUID); + if (pPlayer) + CAST_PLR(pPlayer)->GroupEventHappens(QUEST_WBI, m_creature); + } + DoMeleeAttackIfReady(); + } +}; + +bool GossipHello_npc_dirty_larry(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->GetQuestStatus(QUEST_WBI) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BOOK, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_dirty_larry(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + { + CAST_AI(npc_dirty_larryAI, pCreature->AI())->Event = true; + CAST_AI(npc_dirty_larryAI, pCreature->AI())->PlayerGUID = pPlayer->GetGUID(); + pPlayer->CLOSE_GOSSIP_MENU(); + } + + return true; +} + +CreatureAI* GetAI_npc_dirty_larryAI(Creature* pCreature) +{ + return new npc_dirty_larryAI (pCreature); +} + +/*###### +# npc_ishanah +######*/ + +#define ISANAH_GOSSIP_1 "Who are the Sha'tar?" +#define ISANAH_GOSSIP_2 "Isn't Shattrath a draenei city? Why do you allow others here?" + +bool GossipHello_npc_ishanah(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, ISANAH_GOSSIP_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, ISANAH_GOSSIP_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + + pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_ishanah(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + pPlayer->SEND_GOSSIP_MENU(9458, pCreature->GetGUID()); + else if (uiAction == GOSSIP_ACTION_INFO_DEF+2) + pPlayer->SEND_GOSSIP_MENU(9459, pCreature->GetGUID()); + + return true; +} + +/*###### +# npc_khadgar +######*/ + +#define KHADGAR_GOSSIP_1 "I've heard your name spoken only in whispers, mage. Who are you?" +#define KHADGAR_GOSSIP_2 "Go on, please." +#define KHADGAR_GOSSIP_3 "I see." //6th too this +#define KHADGAR_GOSSIP_4 "What did you do then?" +#define KHADGAR_GOSSIP_5 "What happened next?" +#define KHADGAR_GOSSIP_7 "There was something else I wanted to ask you." + +bool GossipHello_npc_khadgar(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (!pPlayer->hasQuest(10211)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, KHADGAR_GOSSIP_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + pPlayer->SEND_GOSSIP_MENU(9243, pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_khadgar(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch(uiAction) + { + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, KHADGAR_GOSSIP_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + pPlayer->SEND_GOSSIP_MENU(9876, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, KHADGAR_GOSSIP_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); + pPlayer->SEND_GOSSIP_MENU(9877, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+3: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, KHADGAR_GOSSIP_4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4); + pPlayer->SEND_GOSSIP_MENU(9878, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+4: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, KHADGAR_GOSSIP_5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5); + pPlayer->SEND_GOSSIP_MENU(9879, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+5: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, KHADGAR_GOSSIP_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6); + pPlayer->SEND_GOSSIP_MENU(9880, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+6: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, KHADGAR_GOSSIP_7, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+7); + pPlayer->SEND_GOSSIP_MENU(9881, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+7: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, KHADGAR_GOSSIP_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + pPlayer->SEND_GOSSIP_MENU(9243, pCreature->GetGUID()); + break; + } + return true; +} + +void AddSC_shattrath_city() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="npc_raliq_the_drunk"; + newscript->GetAI = &GetAI_npc_raliq_the_drunk; + newscript->pGossipHello = &GossipHello_npc_raliq_the_drunk; + newscript->pGossipSelect = &GossipSelect_npc_raliq_the_drunk; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_salsalabim"; + newscript->GetAI = &GetAI_npc_salsalabim; + newscript->pGossipHello = &GossipHello_npc_salsalabim; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_shattrathflaskvendors"; + newscript->pGossipHello = &GossipHello_npc_shattrathflaskvendors; + newscript->pGossipSelect = &GossipSelect_npc_shattrathflaskvendors; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_zephyr"; + newscript->pGossipHello = &GossipHello_npc_zephyr; + newscript->pGossipSelect = &GossipSelect_npc_zephyr; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_kservant"; + newscript->GetAI = &GetAI_npc_kservantAI; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_dirty_larry"; + newscript->GetAI = &GetAI_npc_dirty_larryAI; + newscript->pGossipHello = &GossipHello_npc_dirty_larry; + newscript->pGossipSelect = &GossipSelect_npc_dirty_larry; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_ishanah"; + newscript->pGossipHello = &GossipHello_npc_ishanah; + newscript->pGossipSelect = &GossipSelect_npc_ishanah; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_khadgar"; + newscript->pGossipHello = &GossipHello_npc_khadgar; + newscript->pGossipSelect = &GossipSelect_npc_khadgar; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/terokkar_forest.cpp b/src/bindings/scripts/scripts/outland/terokkar_forest.cpp new file mode 100644 index 00000000000..783c7c3e5cb --- /dev/null +++ b/src/bindings/scripts/scripts/outland/terokkar_forest.cpp @@ -0,0 +1,745 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Terokkar_Forest +SD%Complete: 85 +SDComment: Quest support: 9889, 10009, 10873, 10896, 10898, 11096, 10052, 10051. Skettis->Ogri'la Flight +SDCategory: Terokkar Forest +EndScriptData */ + +/* ContentData +mob_unkor_the_ruthless +mob_infested_root_walker +mob_rotting_forest_rager +mob_netherweb_victim +npc_floon +npc_isla_starmane +npc_slim +EndContentData */ + +#include "precompiled.h" +#include "../../npc/npc_escortAI.h" + +/*###### +## mob_unkor_the_ruthless +######*/ + +#define SAY_SUBMIT -1000351 + +#define FACTION_HOSTILE 45 +#define FACTION_FRIENDLY 35 +#define QUEST_DONTKILLTHEFATONE 9889 + +#define SPELL_PULVERIZE 2676 +//#define SPELL_QUID9889 32174 + +struct TRINITY_DLL_DECL mob_unkor_the_ruthlessAI : public ScriptedAI +{ + mob_unkor_the_ruthlessAI(Creature* c) : ScriptedAI(c) {} + + bool CanDoQuest; + uint32 UnkorUnfriendly_Timer; + uint32 Pulverize_Timer; + + void Reset() + { + CanDoQuest = false; + UnkorUnfriendly_Timer = 0; + Pulverize_Timer = 3000; + m_creature->SetStandState(UNIT_STAND_STATE_STAND); + m_creature->setFaction(FACTION_HOSTILE); + } + + void EnterCombat(Unit *who) {} + + void DoNice() + { + DoScriptText(SAY_SUBMIT, m_creature); + m_creature->setFaction(FACTION_FRIENDLY); + m_creature->SetStandState(UNIT_STAND_STATE_SIT); + m_creature->RemoveAllAuras(); + m_creature->DeleteThreatList(); + m_creature->CombatStop(true); + UnkorUnfriendly_Timer = 60000; + } + + void DamageTaken(Unit *done_by, uint32 &damage) + { + if (done_by->GetTypeId() == TYPEID_PLAYER) + if ((m_creature->GetHealth()-damage)*100 / m_creature->GetMaxHealth() < 30) + { + if (Group* pGroup = CAST_PLR(done_by)->GetGroup()) + { + for(GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next()) + { + Player *pGroupie = itr->getSource(); + if (pGroupie && + pGroupie->GetQuestStatus(QUEST_DONTKILLTHEFATONE) == QUEST_STATUS_INCOMPLETE && + pGroupie->GetReqKillOrCastCurrentCount(QUEST_DONTKILLTHEFATONE, 18260) == 10) + { + pGroupie->AreaExploredOrEventHappens(QUEST_DONTKILLTHEFATONE); + if (!CanDoQuest) + CanDoQuest = true; + } + } + } else + if (CAST_PLR(done_by)->GetQuestStatus(QUEST_DONTKILLTHEFATONE) == QUEST_STATUS_INCOMPLETE && + CAST_PLR(done_by)->GetReqKillOrCastCurrentCount(QUEST_DONTKILLTHEFATONE, 18260) == 10) + { + CAST_PLR(done_by)->AreaExploredOrEventHappens(QUEST_DONTKILLTHEFATONE); + CanDoQuest = true; + } + } + } + + void UpdateAI(const uint32 diff) + { + if (CanDoQuest) + { + if (!UnkorUnfriendly_Timer) + { + //DoCast(m_creature,SPELL_QUID9889); //not using spell for now + DoNice(); + } + else + { + if (UnkorUnfriendly_Timer < diff) + { + EnterEvadeMode(); + return; + }else UnkorUnfriendly_Timer -= diff; + } + } + + if (!UpdateVictim()) + return; + + if (Pulverize_Timer < diff) + { + DoCast(m_creature,SPELL_PULVERIZE); + Pulverize_Timer = 9000; + }else Pulverize_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_unkor_the_ruthless(Creature* pCreature) +{ + return new mob_unkor_the_ruthlessAI (pCreature); +} + +/*###### +## mob_infested_root_walker +######*/ + +struct TRINITY_DLL_DECL mob_infested_root_walkerAI : public ScriptedAI +{ + mob_infested_root_walkerAI(Creature *c) : ScriptedAI(c) {} + + void Reset() { } + void EnterCombat(Unit *who) { } + + void DamageTaken(Unit *done_by, uint32 &damage) + { + if (done_by && done_by->GetTypeId() == TYPEID_PLAYER) + if (m_creature->GetHealth() <= damage) + if (rand()%100 < 75) + //Summon Wood Mites + m_creature->CastSpell(m_creature,39130,true); + } +}; +CreatureAI* GetAI_mob_infested_root_walker(Creature* pCreature) +{ + return new mob_infested_root_walkerAI (pCreature); +} + + +/*###### +## mob_skywing +######*/ +struct TRINITY_DLL_DECL npc_skywingAI : public npc_escortAI +{ +public: + npc_skywingAI(Creature *c) : npc_escortAI(c) {} + + void WaypointReached(uint32 i) + { + Player *pPlayer = Unit::GetPlayer(PlayerGUID); + if (!pPlayer) + return; + + switch(i) + { + case 8: + pPlayer->AreaExploredOrEventHappens(10898); + break; + } + } + + void EnterCombat(Unit* who) {} + + void MoveInLineOfSight(Unit *who) + { + if (IsBeingEscorted) + return; + + if (who->GetTypeId() == TYPEID_PLAYER) + { + if (CAST_PLR(who)->GetQuestStatus(10898) == QUEST_STATUS_INCOMPLETE) + { + float Radius = 10.0; + if (m_creature->IsWithinDistInMap(who, Radius)) + { + Start(false, false, who->GetGUID()); + } + } + } + } + + void Reset() {} + + void UpdateAI(const uint32 diff) + { + npc_escortAI::UpdateAI(diff); + } +}; + +CreatureAI* GetAI_npc_skywingAI(Creature* pCreature) +{ + npc_skywingAI* skywingAI = new npc_skywingAI(pCreature); + + skywingAI->FillPointMovementListForCreature(); + + return skywingAI; +} + +/*###### +## mob_rotting_forest_rager +######*/ + +struct TRINITY_DLL_DECL mob_rotting_forest_ragerAI : public ScriptedAI +{ + mob_rotting_forest_ragerAI(Creature *c) : ScriptedAI(c) {} + + void Reset() { } + void EnterCombat(Unit *who) { } + + void DamageTaken(Unit *done_by, uint32 &damage) + { + if (done_by->GetTypeId() == TYPEID_PLAYER) + if (m_creature->GetHealth() <= damage) + if (rand()%100 < 75) + //Summon Lots of Wood Mights + m_creature->CastSpell(m_creature,39134,true); + } +}; +CreatureAI* GetAI_mob_rotting_forest_rager(Creature* pCreature) +{ + return new mob_rotting_forest_ragerAI (pCreature); +} + +/*###### +## mob_netherweb_victim +######*/ + +#define QUEST_TARGET 22459 +//#define SPELL_FREE_WEBBED 38950 + +const uint32 netherwebVictims[6] = +{ + 18470, 16805, 21242, 18452, 22482, 21285 +}; +struct TRINITY_DLL_DECL mob_netherweb_victimAI : public ScriptedAI +{ + mob_netherweb_victimAI(Creature *c) : ScriptedAI(c) {} + + void Reset() { } + void EnterCombat(Unit *who) { } + void MoveInLineOfSight(Unit *who) { } + + void JustDied(Unit* Killer) + { + if (Killer->GetTypeId() == TYPEID_PLAYER) + { + if (CAST_PLR(Killer)->GetQuestStatus(10873) == QUEST_STATUS_INCOMPLETE) + { + if (rand()%100 < 25) + { + m_creature->SummonCreature(QUEST_TARGET, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); + CAST_PLR(Killer)->KilledMonsterCredit(QUEST_TARGET, m_creature->GetGUID()); + } + else + m_creature->SummonCreature(netherwebVictims[rand()%6], 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); + + if (rand()%100 < 75) + m_creature->SummonCreature(netherwebVictims[rand()%6], 0.0f, 0.0f, 0.0f,0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); + m_creature->SummonCreature(netherwebVictims[rand()%6], 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); + } + } + } +}; +CreatureAI* GetAI_mob_netherweb_victim(Creature* pCreature) +{ + return new mob_netherweb_victimAI (pCreature); +} + +/*###### +## npc_floon +######*/ + +#define GOSSIP_FLOON1 "You owe Sim'salabim money. Hand them over or die!" +#define GOSSIP_FLOON2 "Hand over the money or die...again!" + +enum +{ + SAY_FLOON_ATTACK = -1000352, + + SPELL_SILENCE = 6726, + SPELL_FROSTBOLT = 9672, + SPELL_FROST_NOVA = 11831, + + FACTION_HOSTILE_FL = 1738, + QUEST_CRACK_SKULLS = 10009 +}; + +struct TRINITY_DLL_DECL npc_floonAI : public ScriptedAI +{ + npc_floonAI(Creature* c) : ScriptedAI(c) + { + m_uiNormFaction = c->getFaction(); + } + + uint32 m_uiNormFaction; + uint32 Silence_Timer; + uint32 Frostbolt_Timer; + uint32 FrostNova_Timer; + + void Reset() + { + Silence_Timer = 2000; + Frostbolt_Timer = 4000; + FrostNova_Timer = 9000; + if (m_creature->getFaction() != m_uiNormFaction) + m_creature->setFaction(m_uiNormFaction); + } + + void EnterCombat(Unit *who) {} + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (Silence_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_SILENCE); + Silence_Timer = 30000; + }else Silence_Timer -= diff; + + if (FrostNova_Timer < diff) + { + DoCast(m_creature,SPELL_FROST_NOVA); + FrostNova_Timer = 20000; + }else FrostNova_Timer -= diff; + + if (Frostbolt_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_FROSTBOLT); + Frostbolt_Timer = 5000; + }else Frostbolt_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_npc_floon(Creature* pCreature) +{ + return new npc_floonAI (pCreature); +} + +bool GossipHello_npc_floon(Player* pPlayer, Creature* pCreature) +{ + if (pPlayer->GetQuestStatus(QUEST_CRACK_SKULLS) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_FLOON1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + + pPlayer->SEND_GOSSIP_MENU(9442, pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_floon(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_FLOON2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + pPlayer->SEND_GOSSIP_MENU(9443, pCreature->GetGUID()); + } + if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + { + pPlayer->CLOSE_GOSSIP_MENU(); + pCreature->setFaction(FACTION_HOSTILE_FL); + DoScriptText(SAY_FLOON_ATTACK, pCreature, pPlayer); + pCreature->AI()->AttackStart(pPlayer); + } + return true; +} + +/*###### +## npc_isla_starmane +######*/ + +#define SAY_PROGRESS_1 -1000353 +#define SAY_PROGRESS_2 -1000354 +#define SAY_PROGRESS_3 -1000355 +#define SAY_PROGRESS_4 -1000356 + +#define QUEST_EFTW_H 10052 +#define QUEST_EFTW_A 10051 +#define GO_CAGE 182794 +#define SPELL_CAT 32447 + +struct TRINITY_DLL_DECL npc_isla_starmaneAI : public npc_escortAI +{ + npc_isla_starmaneAI(Creature* c) : npc_escortAI(c) {} + + bool Completed; + + void WaypointReached(uint32 i) + { + Player* pPlayer = Unit::GetPlayer(PlayerGUID); + + if (!pPlayer) + return; + + switch(i) + { + case 0: + { + GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 10); + if (Cage) + Cage->SetGoState(GO_STATE_ACTIVE); + }break; + case 2: DoScriptText(SAY_PROGRESS_1, m_creature, pPlayer); break; + case 5: DoScriptText(SAY_PROGRESS_2, m_creature, pPlayer); break; + case 6: DoScriptText(SAY_PROGRESS_3, m_creature, pPlayer); break; + case 29:DoScriptText(SAY_PROGRESS_4, m_creature, pPlayer); + if (pPlayer) + { + if (CAST_PLR(pPlayer)->GetTeam() == ALLIANCE) + CAST_PLR(pPlayer)->GroupEventHappens(QUEST_EFTW_A, m_creature); + else if (CAST_PLR(pPlayer)->GetTeam() == HORDE) + CAST_PLR(pPlayer)->GroupEventHappens(QUEST_EFTW_H, m_creature); + } Completed = true; + m_creature->SetInFront(pPlayer); break; + case 30: m_creature->HandleEmoteCommand(EMOTE_ONESHOT_WAVE); break; + case 31: DoCast(m_creature, SPELL_CAT); + m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); break; + } + } + + void Reset() + { + Completed = false; + m_creature->setFaction(1660); + } + + void EnterCombat(Unit* who){} + + void JustDied(Unit* killer) + { + if (PlayerGUID) + { + Player* pPlayer = Unit::GetPlayer(PlayerGUID); + if (pPlayer && !Completed) + { + if (CAST_PLR(pPlayer)->GetTeam() == ALLIANCE) + CAST_PLR(pPlayer)->FailQuest(QUEST_EFTW_A); + else if (CAST_PLR(pPlayer)->GetTeam() == HORDE) + CAST_PLR(pPlayer)->FailQuest(QUEST_EFTW_H); + } + } + } + + void UpdateAI(const uint32 diff) + { + npc_escortAI::UpdateAI(diff); + } +}; + +bool QuestAccept_npc_isla_starmane(Player* pPlayer, Creature* pCreature, Quest const* quest) +{ + if (quest->GetQuestId() == QUEST_EFTW_H || quest->GetQuestId() == QUEST_EFTW_A) + { + CAST_AI(npc_escortAI, (pCreature->AI()))->Start(true, false, pPlayer->GetGUID()); + pCreature->setFaction(113); + } + return true; +} + +CreatureAI* GetAI_npc_isla_starmaneAI(Creature* pCreature) +{ + npc_isla_starmaneAI* thisAI = new npc_isla_starmaneAI(pCreature); + + thisAI->AddWaypoint(0, -2265.21, 3091.14, 13.91); + thisAI->AddWaypoint(1, -2266.80, 3091.33, 13.82, 1000); + thisAI->AddWaypoint(2, -2268.20, 3091.14, 13.82, 7000);//progress1 + thisAI->AddWaypoint(3, -2278.32, 3098.98, 13.82); + thisAI->AddWaypoint(4, -2294.82, 3110.59, 13.82); + thisAI->AddWaypoint(5, -2300.71, 3114.60, 13.82, 20000);//progress2 + thisAI->AddWaypoint(6, -2300.71, 3114.60, 13.82, 3000);//progress3 + thisAI->AddWaypoint(7, -2307.36, 3122.76, 13.79); + thisAI->AddWaypoint(8, -2312.83, 3130.55, 12.04); + thisAI->AddWaypoint(9, -2345.02, 3151.00, 8.38); + thisAI->AddWaypoint(10, -2351.97, 3157.61, 6.27); + thisAI->AddWaypoint(11, -2360.35, 3171.48, 3.31); + thisAI->AddWaypoint(12, -2371.44, 3185.41, 0.89); + thisAI->AddWaypoint(13, -2371.21, 3197.92, -0.96); + thisAI->AddWaypoint(14, -2380.35, 3210.45, -1.08); + thisAI->AddWaypoint(15, -2384.74, 3221.25, -1.17); + thisAI->AddWaypoint(16, -2386.15, 3233.39, -1.29); + thisAI->AddWaypoint(17, -2383.45, 3247.79, -1.32); + thisAI->AddWaypoint(18, -2367.50, 3265.64, -1.33); + thisAI->AddWaypoint(19, -2354.90, 3273.30, -1.50); + thisAI->AddWaypoint(20, -2348.88, 3280.58, -0.09); + thisAI->AddWaypoint(21, -2349.06, 3295.86, -0.95); + thisAI->AddWaypoint(22, -2350.43, 3328.27, -2.10); + thisAI->AddWaypoint(23, -2346.76, 3356.27, -2.82); + thisAI->AddWaypoint(24, -2340.56, 3370.68, -4.02); + thisAI->AddWaypoint(25, -2318.84, 3384.60, -7.61); + thisAI->AddWaypoint(26, -2313.99, 3398.61, -10.40); + thisAI->AddWaypoint(27, -2320.85, 3414.49, -11.49); + thisAI->AddWaypoint(28, -2338.26, 3426.06, -11.46); + thisAI->AddWaypoint(29, -2342.67, 3439.44, -11.32, 12000);//progress4 + thisAI->AddWaypoint(30, -2342.67, 3439.44, -11.32, 7000);//emote bye + thisAI->AddWaypoint(31, -2342.67, 3439.44, -11.32, 5000);//cat form + thisAI->AddWaypoint(32, -2344.60, 3461.27, -10.44); + thisAI->AddWaypoint(33, -2396.81, 3517.17, -3.55); + thisAI->AddWaypoint(34, -2439.23, 3523.00, -1.05); + + return thisAI; +} + +/*###### +## go_skull_pile +######*/ +#define GOSSIP_S_DARKSCREECHER_AKKARAI "Summon Darkscreecher Akkarai" +#define GOSSIP_S_KARROG "Summon Karrog" +#define GOSSIP_S_GEZZARAK_THE_HUNTRESS "Summon Gezzarak the Huntress" +#define GOSSIP_S_VAKKIZ_THE_WINDRAGER "Summon Vakkiz the Windrager" + +bool GossipHello_go_skull_pile(Player* pPlayer, GameObject* pGo) +{ + if ((pPlayer->GetQuestStatus(11885) == QUEST_STATUS_INCOMPLETE) || pPlayer->GetQuestRewardStatus(11885)) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_S_DARKSCREECHER_AKKARAI, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_S_KARROG, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_S_GEZZARAK_THE_HUNTRESS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_S_VAKKIZ_THE_WINDRAGER, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4); + } + + pPlayer->SEND_GOSSIP_MENU(pGo->GetGOInfo()->questgiver.gossipID, pGo->GetGUID()); + return true; +} + +void SendActionMenu_go_skull_pile(Player* pPlayer, GameObject* pGo, uint32 uiAction) +{ + switch(uiAction) + { + case GOSSIP_ACTION_INFO_DEF + 1: + pPlayer->CastSpell(pPlayer,40642,false); + break; + case GOSSIP_ACTION_INFO_DEF + 2: + pPlayer->CastSpell(pPlayer,40640,false); + break; + case GOSSIP_ACTION_INFO_DEF + 3: + pPlayer->CastSpell(pPlayer,40632,false); + break; + case GOSSIP_ACTION_INFO_DEF + 4: + pPlayer->CastSpell(pPlayer,40644,false); + break; + } +} + +bool GossipSelect_go_skull_pile(Player* pPlayer, GameObject* pGo, uint32 uiSender, uint32 uiAction) +{ + switch(uiSender) + { + case GOSSIP_SENDER_MAIN: SendActionMenu_go_skull_pile(pPlayer, pGo, uiAction); break; + } + return true; +} + +/*###### +## npc_slim +######*/ + +enum +{ + FACTION_CONSORTIUM = 933 +}; + +bool GossipHello_npc_slim(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isVendor() && pPlayer->GetReputationRank(FACTION_CONSORTIUM) >= REP_FRIENDLY) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); + pPlayer->SEND_GOSSIP_MENU(9896, pCreature->GetGUID()); + } + else + pPlayer->SEND_GOSSIP_MENU(9895, pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_slim(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_TRADE) + pPlayer->SEND_VENDORLIST(pCreature->GetGUID()); + + return true; +} + +/*######## +####npc_Akuno +#####*/ + +#define QUEST_NPC_AKUNO 10887 +#define Summon 21661 + +struct TRINITY_DLL_DECL npc_akunoAI : public npc_escortAI +{ + npc_akunoAI(Creature *c) : npc_escortAI(c) {} + + bool IsWalking; + + void WaypointReached(uint32 i) + { + Player* pPlayer = Unit::GetPlayer(PlayerGUID); + + if(!pPlayer) + return; + + if(IsWalking && !m_creature->HasUnitMovementFlag(MOVEMENTFLAG_WALK_MODE)) + m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + + + switch(i) + { + case 0: m_creature->setFaction(5); break; + case 3: + m_creature->SummonCreature(Summon,-2795.99,5420.33,-34.53,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + m_creature->SummonCreature(Summon,-2793.55,5412.79,-34.53,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + break; + case 11: + if(pPlayer && pPlayer->GetTypeId() == TYPEID_PLAYER) + pPlayer->GroupEventHappens(QUEST_NPC_AKUNO,m_creature); + m_creature->setFaction(18); + break; + } + } + + void Reset() + { + if (IsWalking && !m_creature->HasUnitMovementFlag(MOVEMENTFLAG_WALK_MODE)) + { + m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + return; + } + IsWalking=false; + } +}; + +bool QuestAccept_npc_akuno(Player* pPlayer, Creature* pCreature, Quest const* pQuest) +{ + if(pQuest->GetQuestId() == QUEST_NPC_AKUNO) + { + if (npc_akunoAI* pEscortAI = CAST_AI(npc_akunoAI, pCreature->AI())) + pEscortAI->Start(false, true, pPlayer->GetGUID()); + } + return true; +} + +CreatureAI* GetAI_npc_akuno(Creature* pCreature) +{ + npc_akunoAI* thisAI = new npc_akunoAI(pCreature); + + thisAI->FillPointMovementListForCreature(); + + return(CreatureAI*)thisAI; +} + +void AddSC_terokkar_forest() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="mob_unkor_the_ruthless"; + newscript->GetAI = &GetAI_mob_unkor_the_ruthless; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_infested_root_walker"; + newscript->GetAI = &GetAI_mob_infested_root_walker; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_rotting_forest_rager"; + newscript->GetAI = &GetAI_mob_rotting_forest_rager; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_netherweb_victim"; + newscript->GetAI = &GetAI_mob_netherweb_victim; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_floon"; + newscript->GetAI = &GetAI_npc_floon; + newscript->pGossipHello = &GossipHello_npc_floon; + newscript->pGossipSelect = &GossipSelect_npc_floon; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name= "npc_isla_starmane"; + newscript->GetAI = &GetAI_npc_isla_starmaneAI; + newscript->pQuestAccept = &QuestAccept_npc_isla_starmane; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="go_skull_pile"; + newscript->pGOHello = &GossipHello_go_skull_pile; + newscript->pGOSelect = &GossipSelect_go_skull_pile; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_skywing"; + newscript->GetAI = &GetAI_npc_skywingAI; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_slim"; + newscript->pGossipHello = &GossipHello_npc_slim; + newscript->pGossipSelect = &GossipSelect_npc_slim; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_akuno"; + newscript->GetAI = &GetAI_npc_akuno; + newscript->pQuestAccept = &QuestAccept_npc_akuno; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/zangarmarsh.cpp b/src/bindings/scripts/scripts/outland/zangarmarsh.cpp new file mode 100644 index 00000000000..f52e1c4be16 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/zangarmarsh.cpp @@ -0,0 +1,379 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Zangarmarsh +SD%Complete: 100 +SDComment: Quest support: 9752, 9785, 9803, 10009. Mark Of ... buffs. +SDCategory: Zangarmarsh +EndScriptData */ + +/* ContentData +npcs_ashyen_and_keleth +npc_cooshcoosh +npc_elder_kuruti +npc_mortog_steamhead +npc_kayra_longmane +EndContentData */ + +#include "precompiled.h" +#include "../../npc/npc_escortAI.h" + +/*###### +## npcs_ashyen_and_keleth +######*/ + +#define GOSSIP_ITEM_BLESS_ASH "Grant me your mark, wise ancient." +#define GOSSIP_ITEM_BLESS_KEL "Grant me your mark, mighty ancient." +#define GOSSIP_REWARD_BLESS -1000359 +//#define TEXT_BLESSINGS "" + +bool GossipHello_npcs_ashyen_and_keleth(Player* pPlayer, Creature* pCreature) +{ + if (pPlayer->GetReputationRank(942) > REP_NEUTRAL) + { + if (pCreature->GetEntry() == 17900) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BLESS_ASH, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + if (pCreature->GetEntry() == 17901) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BLESS_KEL, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + } + pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npcs_ashyen_and_keleth(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + { + pCreature->setPowerType(POWER_MANA); + pCreature->SetMaxPower(POWER_MANA,200); //set a "fake" mana value, we can't depend on database doing it in this case + pCreature->SetPower(POWER_MANA,200); + + if (pCreature->GetEntry() == 17900) //check which Creature we are dealing with + { + switch (pPlayer->GetReputationRank(942)) + { //mark of lore + case REP_FRIENDLY: + pCreature->CastSpell(pPlayer, 31808, true); + DoScriptText(GOSSIP_REWARD_BLESS, pCreature); + break; + case REP_HONORED: + pCreature->CastSpell(pPlayer, 31810, true); + DoScriptText(GOSSIP_REWARD_BLESS, pCreature); + break; + case REP_REVERED: + pCreature->CastSpell(pPlayer, 31811, true); + DoScriptText(GOSSIP_REWARD_BLESS, pCreature); + break; + case REP_EXALTED: + pCreature->CastSpell(pPlayer, 31815, true); + DoScriptText(GOSSIP_REWARD_BLESS, pCreature); + break; + } + } + + if (pCreature->GetEntry() == 17901) + { + switch (pPlayer->GetReputationRank(942)) //mark of war + { + case REP_FRIENDLY: + pCreature->CastSpell(pPlayer, 31807, true); + DoScriptText(GOSSIP_REWARD_BLESS, pCreature); + break; + case REP_HONORED: + pCreature->CastSpell(pPlayer, 31812, true); + DoScriptText(GOSSIP_REWARD_BLESS, pCreature); + break; + case REP_REVERED: + pCreature->CastSpell(pPlayer, 31813, true); + DoScriptText(GOSSIP_REWARD_BLESS, pCreature); + break; + case REP_EXALTED: + pCreature->CastSpell(pPlayer, 31814, true); + DoScriptText(GOSSIP_REWARD_BLESS, pCreature); + break; + } + } + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->TalkedToCreature(pCreature->GetEntry(), pCreature->GetGUID()); + } + return true; +} + +/*###### +## npc_cooshcoosh +######*/ + +#define GOSSIP_COOSH "You owe Sim'salabim money. Hand them over or die!" + +enum +{ + SPELL_LIGHTNING_BOLT = 9532, + QUEST_CRACK_SKULLS = 10009, + FACTION_HOSTILE_CO = 45 +}; + +struct TRINITY_DLL_DECL npc_cooshcooshAI : public ScriptedAI +{ + npc_cooshcooshAI(Creature* c) : ScriptedAI(c) + { + m_uiNormFaction = c->getFaction(); + } + + uint32 m_uiNormFaction; + uint32 LightningBolt_Timer; + + void Reset() + { + LightningBolt_Timer = 2000; + if (m_creature->getFaction() != m_uiNormFaction) + m_creature->setFaction(m_uiNormFaction); + } + + void EnterCombat(Unit *who) {} + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (LightningBolt_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_LIGHTNING_BOLT); + LightningBolt_Timer = 5000; + }else LightningBolt_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_npc_cooshcoosh(Creature* pCreature) +{ + return new npc_cooshcooshAI (pCreature); +} + +bool GossipHello_npc_cooshcoosh(Player* pPlayer, Creature* pCreature) +{ + if (pPlayer->GetQuestStatus(QUEST_CRACK_SKULLS) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_COOSH, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + + pPlayer->SEND_GOSSIP_MENU(9441, pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_cooshcoosh(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF) + { + pPlayer->CLOSE_GOSSIP_MENU(); + pCreature->setFaction(FACTION_HOSTILE_CO); + pCreature->AI()->AttackStart(pPlayer); + } + return true; +} + +/*###### +## npc_elder_kuruti +######*/ + +#define GOSSIP_ITEM_KUR1 "Offer treat" +#define GOSSIP_ITEM_KUR2 "Im a messenger for Draenei" +#define GOSSIP_ITEM_KUR3 "Get message" + +bool GossipHello_npc_elder_kuruti(Player* pPlayer, Creature* pCreature) +{ + if (pPlayer->GetQuestStatus(9803) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KUR1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + + pPlayer->SEND_GOSSIP_MENU(9226, pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_elder_kuruti(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch (uiAction) + { + case GOSSIP_ACTION_INFO_DEF: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KUR2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + pPlayer->SEND_GOSSIP_MENU(9227, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF + 1: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KUR3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + pPlayer->SEND_GOSSIP_MENU(9229, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF + 2: + { + if (!pPlayer->HasItemCount(24573,1)) + { + ItemPosCountVec dest; + uint8 msg = pPlayer->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, 24573, 1, false); + if (msg == EQUIP_ERR_OK) + { + pPlayer->StoreNewItem(dest, 24573, true); + } + else + pPlayer->SendEquipError(msg,NULL,NULL); + } + pPlayer->SEND_GOSSIP_MENU(9231, pCreature->GetGUID()); + break; + } + } + return true; +} + +/*###### +## npc_mortog_steamhead +######*/ + +bool GossipHello_npc_mortog_steamhead(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isVendor() && pPlayer->GetReputationRank(942) == REP_EXALTED) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); + + pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_mortog_steamhead(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_TRADE) + { + pPlayer->SEND_VENDORLIST(pCreature->GetGUID()); + } + return true; +} + +/*###### +## npc_kayra_longmane +######*/ + +enum +{ + SAY_START = -1000360, + SAY_AMBUSH1 = -1000361, + SAY_PROGRESS = -1000362, + SAY_AMBUSH2 = -1000363, + SAY_NEAR_END = -1000364, + SAY_END = -1000365, + + QUEST_ESCAPE_FROM = 9752, + NPC_SLAVEBINDER = 18042 +}; + +struct TRINITY_DLL_DECL npc_kayra_longmaneAI : public npc_escortAI +{ + npc_kayra_longmaneAI(Creature* c) : npc_escortAI(c) {} + + void Reset() { } + + void WaypointReached(uint32 i) + { + Player* pUnit = Unit::GetPlayer(PlayerGUID); + + if (!pUnit) + return; + + switch(i) + { + case 4: + DoScriptText(SAY_AMBUSH1, m_creature, pUnit); + DoSpawnCreature(NPC_SLAVEBINDER, -10.0f, -5.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + DoSpawnCreature(NPC_SLAVEBINDER, -8.0f, 5.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + break; + case 5: + DoScriptText(SAY_PROGRESS, m_creature, pUnit); + SetRun(); + break; + case 16: + DoScriptText(SAY_AMBUSH2, m_creature, pUnit); + DoSpawnCreature(NPC_SLAVEBINDER, -10.0f, -5.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + DoSpawnCreature(NPC_SLAVEBINDER, -8.0f, 5.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + break; + case 17: + SetRun(false); + DoScriptText(SAY_NEAR_END, m_creature, pUnit); + break; + case 25: + DoScriptText(SAY_END, m_creature, pUnit); + pUnit->GroupEventHappens(QUEST_ESCAPE_FROM, m_creature); + break; + } + } +}; + +bool QuestAccept_npc_kayra_longmane(Player* pPlayer, Creature* pCreature, Quest const* pQuest) +{ + if (pQuest->GetQuestId() == QUEST_ESCAPE_FROM) + { + DoScriptText(SAY_START, pCreature, pPlayer); + + if (npc_escortAI* pEscortAI = CAST_AI(npc_kayra_longmaneAI, pCreature->AI())) + pEscortAI->Start(false, false, pPlayer->GetGUID()); + } + return true; +} + +CreatureAI* GetAI_npc_kayra_longmaneAI(Creature* pCreature) +{ + npc_kayra_longmaneAI* thisAI = new npc_kayra_longmaneAI(pCreature); + + thisAI->FillPointMovementListForCreature(); + + return thisAI; +} +/*###### +## AddSC +######*/ + +void AddSC_zangarmarsh() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="npcs_ashyen_and_keleth"; + newscript->pGossipHello = &GossipHello_npcs_ashyen_and_keleth; + newscript->pGossipSelect = &GossipSelect_npcs_ashyen_and_keleth; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_cooshcoosh"; + newscript->GetAI = &GetAI_npc_cooshcoosh; + newscript->pGossipHello = &GossipHello_npc_cooshcoosh; + newscript->pGossipSelect = &GossipSelect_npc_cooshcoosh; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_elder_kuruti"; + newscript->pGossipHello = &GossipHello_npc_elder_kuruti; + newscript->pGossipSelect = &GossipSelect_npc_elder_kuruti; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_mortog_steamhead"; + newscript->pGossipHello = &GossipHello_npc_mortog_steamhead; + newscript->pGossipSelect = &GossipSelect_npc_mortog_steamhead; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_kayra_longmane"; + newscript->GetAI = &GetAI_npc_kayra_longmaneAI; + newscript->pQuestAccept = &QuestAccept_npc_kayra_longmane; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/zone/alterac_mountains/alterac_mountains.cpp b/src/bindings/scripts/scripts/zone/alterac_mountains/alterac_mountains.cpp deleted file mode 100644 index 8b4c360a886..00000000000 --- a/src/bindings/scripts/scripts/zone/alterac_mountains/alterac_mountains.cpp +++ /dev/null @@ -1,33 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Alterac_Mountains -SD%Complete: 0 -SDComment: Placeholder -SDCategory: Alterac Mountains -EndScriptData */ - -/* ContentData -EndContentData */ - -#include "precompiled.h" - -/*void AddSC_alterac_mountains() -{ - Script *newscript; -}*/ - diff --git a/src/bindings/scripts/scripts/zone/arathi_highlands/arathi_highlands.cpp b/src/bindings/scripts/scripts/zone/arathi_highlands/arathi_highlands.cpp deleted file mode 100644 index 0a4b6839011..00000000000 --- a/src/bindings/scripts/scripts/zone/arathi_highlands/arathi_highlands.cpp +++ /dev/null @@ -1,134 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Arathi Highlands -SD%Complete: 100 -SDComment: Quest support: 665 -SDCategory: Arathi Highlands -EndScriptData */ - -/* ContentData -npc_professor_phizzlethorpe -EndContentData */ - -#include "precompiled.h" -#include "../../npc/npc_escortAI.h" - -/*###### -## npc_professor_phizzlethorpe -######*/ - -enum -{ - SAY_PROGRESS_1 = -1000235, - SAY_PROGRESS_2 = -1000236, - SAY_PROGRESS_3 = -1000237, - EMOTE_PROGRESS_4 = -1000238, - SAY_AGGRO = -1000239, - SAY_PROGRESS_5 = -1000240, - SAY_PROGRESS_6 = -1000241, - SAY_PROGRESS_7 = -1000242, - EMOTE_PROGRESS_8 = -1000243, - SAY_PROGRESS_9 = -1000244, - - QUEST_SUNKEN_TREASURE = 665, - MOB_VENGEFUL_SURGE = 2776 -}; - -struct TRINITY_DLL_DECL npc_professor_phizzlethorpeAI : public npc_escortAI -{ - npc_professor_phizzlethorpeAI(Creature *c) : npc_escortAI(c) {} - - void WaypointReached(uint32 uiPointId) - { - Player* pPlayer = Unit::GetPlayer(PlayerGUID); - - switch(uiPointId) - { - case 4:DoScriptText(SAY_PROGRESS_2, m_creature, pPlayer);break; - case 5:DoScriptText(SAY_PROGRESS_3, m_creature, pPlayer);break; - case 8:DoScriptText(EMOTE_PROGRESS_4, m_creature);break; - case 9: - { - m_creature->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96, -2142.49, 20.15, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0); - m_creature->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96, -2142.49, 20.15, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0); - break; - } - case 10:DoScriptText(SAY_PROGRESS_5, m_creature, pPlayer);break; - case 11: - DoScriptText(SAY_PROGRESS_6, m_creature, pPlayer); - SetRun(); - break; - case 19:DoScriptText(SAY_PROGRESS_7, m_creature, pPlayer); break; - case 20: - DoScriptText(EMOTE_PROGRESS_8, m_creature); - DoScriptText(SAY_PROGRESS_9, m_creature, pPlayer); - if (pPlayer) - CAST_PLR(pPlayer)->GroupEventHappens(QUEST_SUNKEN_TREASURE, m_creature); - break; - } - } - - void JustSummoned(Creature* pSummoned) - { - pSummoned->AI()->AttackStart(m_creature); - } - - void EnterCombat(Unit* pWho) - { - DoScriptText(SAY_AGGRO, m_creature); - } - - void UpdateAI(const uint32 diff) - { - npc_escortAI::UpdateAI(diff); - } -}; - -bool QuestAccept_npc_professor_phizzlethorpe(Player* pPlayer, Creature* pCreature, Quest const* pQuest) -{ - if (pQuest->GetQuestId() == QUEST_SUNKEN_TREASURE) - { - DoScriptText(SAY_PROGRESS_1, pCreature, pPlayer); - if (npc_escortAI* pEscortAI = CAST_AI(npc_professor_phizzlethorpeAI, (pCreature->AI()))) - pEscortAI->Start(false, false, pPlayer->GetGUID(), pQuest); - - pCreature->setFaction(113); - } - return true; -} - -CreatureAI* GetAI_npc_professor_phizzlethorpeAI(Creature* pCreature) -{ - npc_professor_phizzlethorpeAI* professor_phizzlethorpeAI = new npc_professor_phizzlethorpeAI(pCreature); - - professor_phizzlethorpeAI->FillPointMovementListForCreature(); - - return professor_phizzlethorpeAI; -} - -void AddSC_arathi_highlands() -{ - Script * newscript; - - newscript = new Script; - newscript->Name = "npc_professor_phizzlethorpe"; - newscript->GetAI = &GetAI_npc_professor_phizzlethorpeAI; - newscript->pQuestAccept = &QuestAccept_npc_professor_phizzlethorpe; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/ashenvale_forest/ashenvale.cpp b/src/bindings/scripts/scripts/zone/ashenvale_forest/ashenvale.cpp deleted file mode 100644 index 3fd7d1ef791..00000000000 --- a/src/bindings/scripts/scripts/zone/ashenvale_forest/ashenvale.cpp +++ /dev/null @@ -1,256 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -/* ScriptData -SDName: Ashenvale -SD%Complete: 70 -SDComment: Quest support: 6544, 6482 -SDCategory: Ashenvale Forest -EndScriptData */ - -/* ContentData -npc_torek -npc_ruul_snowhoof -EndContentData */ - -#include "precompiled.h" -#include "../../npc/npc_escortAI.h" - -/*#### -# npc_torek -####*/ - -#define SAY_READY -1000106 -#define SAY_MOVE -1000107 -#define SAY_PREPARE -1000108 -#define SAY_WIN -1000109 -#define SAY_END -1000110 - -#define SPELL_REND 11977 -#define SPELL_THUNDERCLAP 8078 - -#define QUEST_TOREK_ASSULT 6544 - -#define ENTRY_SPLINTERTREE_RAIDER 12859 -#define ENTRY_DURIEL 12860 -#define ENTRY_SILVERWING_SENTINEL 12896 -#define ENTRY_SILVERWING_WARRIOR 12897 - -struct TRINITY_DLL_DECL npc_torekAI : public npc_escortAI -{ - npc_torekAI(Creature *c) : npc_escortAI(c) {} - - uint32 Rend_Timer; - uint32 Thunderclap_Timer; - bool Completed; - - void WaypointReached(uint32 i) - { - Player* pPlayer = Unit::GetPlayer(PlayerGUID); - - if (!pPlayer) - return; - - switch (i) - { - case 1: - DoScriptText(SAY_MOVE, m_creature, pPlayer); - break; - case 8: - DoScriptText(SAY_PREPARE, m_creature, pPlayer); - break; - case 19: - //TODO: verify location and creatures amount. - m_creature->SummonCreature(ENTRY_DURIEL,1776.73,-2049.06,109.83,1.54,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,25000); - m_creature->SummonCreature(ENTRY_SILVERWING_SENTINEL,1774.64,-2049.41,109.83,1.40,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,25000); - m_creature->SummonCreature(ENTRY_SILVERWING_WARRIOR,1778.73,-2049.50,109.83,1.67,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,25000); - break; - case 20: - DoScriptText(SAY_WIN, m_creature, pPlayer); - Completed = true; - if (pPlayer && pPlayer->GetTypeId() == TYPEID_PLAYER) - CAST_PLR(pPlayer)->GroupEventHappens(QUEST_TOREK_ASSULT,m_creature); - break; - case 21: - DoScriptText(SAY_END, m_creature, pPlayer); - break; - } - } - - void Reset() - { - Rend_Timer = 5000; - Thunderclap_Timer = 8000; - Completed = false; - } - - void EnterCombat(Unit* who) - { - } - - void JustSummoned(Creature* summoned) - { - summoned->AI()->AttackStart(m_creature); - } - - void UpdateAI(const uint32 diff) - { - npc_escortAI::UpdateAI(diff); - - if (!UpdateVictim()) - return; - - if (Rend_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_REND); - Rend_Timer = 20000; - }else Rend_Timer -= diff; - - if (Thunderclap_Timer < diff) - { - DoCast(m_creature,SPELL_THUNDERCLAP); - Thunderclap_Timer = 30000; - }else Thunderclap_Timer -= diff; - } -}; - -bool QuestAccept_npc_torek(Player* pPlayer, Creature* pCreature, Quest const* quest) -{ - if (quest->GetQuestId() == QUEST_TOREK_ASSULT) - { - //TODO: find companions, make them follow Torek, at any time (possibly done by mangos/database in future?) - DoScriptText(SAY_READY, pCreature, pPlayer); - pCreature->setFaction(113); - - if (npc_escortAI* pEscortAI = CAST_AI(npc_torekAI, pCreature->AI())) - pEscortAI->Start(true, true, pPlayer->GetGUID()); - } - - return true; -} - -CreatureAI* GetAI_npc_torek(Creature* pCreature) -{ - npc_torekAI* thisAI = new npc_torekAI(pCreature); - - thisAI->FillPointMovementListForCreature(); - - return thisAI; -} - -/*#### -# npc_ruul_snowhoof -####*/ - -#define QUEST_FREEDOM_TO_RUUL 6482 -#define GO_CAGE 178147 - -struct TRINITY_DLL_DECL npc_ruul_snowhoofAI : public npc_escortAI -{ - npc_ruul_snowhoofAI(Creature *c) : npc_escortAI(c) {} - - void WaypointReached(uint32 i) - { - Player* pPlayer = Unit::GetPlayer(PlayerGUID); - - if (!pPlayer) - return; - - switch(i) - { - case 0: { - m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); - GameObject* Cage = m_creature->FindNearestGameObject(GO_CAGE, 20); - if (Cage) - Cage->SetGoState(GO_STATE_ACTIVE); - break;} - case 13: - m_creature->SummonCreature(3922, 3449.218018, -587.825073, 174.978867, 4.714445, TEMPSUMMON_DEAD_DESPAWN, 60000); - m_creature->SummonCreature(3921, 3446.384521, -587.830872, 175.186279, 4.714445, TEMPSUMMON_DEAD_DESPAWN, 60000); - m_creature->SummonCreature(3926, 3444.218994, -587.835327, 175.380600, 4.714445, TEMPSUMMON_DEAD_DESPAWN, 60000); - break; - case 19: - m_creature->SummonCreature(3922, 3508.344482, -492.024261, 186.929031, 4.145029, TEMPSUMMON_DEAD_DESPAWN, 60000); - m_creature->SummonCreature(3921, 3506.265625, -490.531006, 186.740128, 4.239277, TEMPSUMMON_DEAD_DESPAWN, 60000); - m_creature->SummonCreature(3926, 3503.682373, -489.393799, 186.629684, 4.349232, TEMPSUMMON_DEAD_DESPAWN, 60000); - break; - - case 21:{ - if (pPlayer && pPlayer->GetTypeId() == TYPEID_PLAYER) - CAST_PLR(pPlayer)->GroupEventHappens(QUEST_FREEDOM_TO_RUUL,m_creature); - - break; } - } - } - - void EnterCombat(Unit* who) {} - - void Reset() - { - GameObject* Cage = m_creature->FindNearestGameObject(GO_CAGE, 20); - if (Cage) - Cage->SetGoState(GO_STATE_READY); - } - - void JustSummoned(Creature* summoned) - { - summoned->AI()->AttackStart(m_creature); - } - - void UpdateAI(const uint32 diff) - { - npc_escortAI::UpdateAI(diff); - } -}; - -bool QuestAccept_npc_ruul_snowhoof(Player* pPlayer, Creature* pCreature, Quest const* quest) -{ - if (quest->GetQuestId() == QUEST_FREEDOM_TO_RUUL) - { - pCreature->setFaction(113); - - if (npc_escortAI* pEscortAI = CAST_AI(npc_ruul_snowhoofAI, (pCreature->AI()))) - pEscortAI->Start(true, false, pPlayer->GetGUID()); - } - return true; -} - -CreatureAI* GetAI_npc_ruul_snowhoofAI(Creature* pCreature) -{ - npc_ruul_snowhoofAI* ruul_snowhoofAI = new npc_ruul_snowhoofAI(pCreature); - - ruul_snowhoofAI->FillPointMovementListForCreature(); - - return ruul_snowhoofAI; -} - -void AddSC_ashenvale() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "npc_torek"; - newscript->GetAI = &GetAI_npc_torek; - newscript->pQuestAccept = &QuestAccept_npc_torek; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "npc_ruul_snowhoof"; - newscript->GetAI = &GetAI_npc_ruul_snowhoofAI; - newscript->pQuestAccept = &QuestAccept_npc_ruul_snowhoof; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/azshara/azshara.cpp b/src/bindings/scripts/scripts/zone/azshara/azshara.cpp deleted file mode 100644 index 4a3d736d7e7..00000000000 --- a/src/bindings/scripts/scripts/zone/azshara/azshara.cpp +++ /dev/null @@ -1,508 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Azshara -SD%Complete: 90 -SDComment: Quest support: 2744, 3141, 9364, 10994 -SDCategory: Azshara -EndScriptData */ - -/* ContentData -mobs_spitelashes -npc_loramus_thalipedes -mob_rizzle_sprysprocket -mob_depth_charge -EndContentData */ - -#include "precompiled.h" -#include "World.h" -#include "WorldPacket.h" - -/*###### -## mobs_spitelashes -######*/ - -struct TRINITY_DLL_DECL mobs_spitelashesAI : public ScriptedAI -{ - mobs_spitelashesAI(Creature *c) : ScriptedAI(c) {} - - uint32 morphtimer; - bool spellhit; - - void Reset() - { - morphtimer = 0; - spellhit = false; - } - - void EnterCombat(Unit *who) { } - - void SpellHit(Unit *Hitter, const SpellEntry *Spellkind) - { - if (!spellhit && - Hitter->GetTypeId() == TYPEID_PLAYER && - CAST_PLR(Hitter)->GetQuestStatus(9364) == QUEST_STATUS_INCOMPLETE && - (Spellkind->Id==118 || Spellkind->Id== 12824 || Spellkind->Id== 12825 || Spellkind->Id== 12826)) - { - spellhit=true; - DoCast(m_creature,29124); //become a sheep - } - } - - void UpdateAI(const uint32 diff) - { - // we mustn't remove the Creature in the same round in which we cast the summon spell, otherwise there will be no summons - if (spellhit && morphtimer>=5000) - { - m_creature->ForcedDespawn(); - return; - } - // walk 5 seconds before summoning - if (spellhit && morphtimer<5000) - { - morphtimer+=diff; - if (morphtimer>=5000) - { - DoCast(m_creature,28406); //summon copies - DoCast(m_creature,6924); //visual explosion - } - } - if (!UpdateVictim()) - return; - - //TODO: add abilities for the different creatures - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_mobs_spitelashes(Creature* pCreature) -{ - return new mobs_spitelashesAI (pCreature); -} - -/*###### -## npc_loramus_thalipedes -######*/ - -bool GossipHello_npc_loramus_thalipedes(Player* pPlayer, Creature* pCreature) -{ - if (pCreature->isQuestGiver()) - pPlayer->PrepareQuestMenu(pCreature->GetGUID()); - - if (pPlayer->GetQuestStatus(2744) == QUEST_STATUS_INCOMPLETE) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Can you help me?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - - if (pPlayer->GetQuestStatus(3141) == QUEST_STATUS_INCOMPLETE) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Tell me your story", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); - - pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); - - return true; -} - -bool GossipSelect_npc_loramus_thalipedes(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - switch (uiAction) - { - case GOSSIP_ACTION_INFO_DEF+1: - pPlayer->CLOSE_GOSSIP_MENU(); - pPlayer->AreaExploredOrEventHappens(2744); - break; - - case GOSSIP_ACTION_INFO_DEF+2: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Please continue", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 21); - pPlayer->SEND_GOSSIP_MENU(1813, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+21: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "I do not understand", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 22); - pPlayer->SEND_GOSSIP_MENU(1814, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+22: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Indeed", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 23); - pPlayer->SEND_GOSSIP_MENU(1815, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+23: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "I will do this with or your help, Loramus", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 24); - pPlayer->SEND_GOSSIP_MENU(1816, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+24: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Yes", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 25); - pPlayer->SEND_GOSSIP_MENU(1817, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+25: - pPlayer->CLOSE_GOSSIP_MENU(); - pPlayer->AreaExploredOrEventHappens(3141); - break; - } - return true; -} - -/*#### -# mob_rizzle_sprysprocket -####*/ - -#define MOB_DEPTH_CHARGE 23025 -#define SPELL_RIZZLE_BLACKJACK 39865 -#define SPELL_RIZZLE_ESCAPE 39871 -#define SPELL_RIZZLE_FROST_GRENADE 40525 -#define SPELL_DEPTH_CHARGE_TRAP 38576 -#define SPELL_PERIODIC_DEPTH_CHARGE 39912 -#define SPELL_GIVE_SOUTHFURY_MOONSTONE 39886 - -#define SAY_RIZZLE_START -1000245 -#define SAY_RIZZLE_GRENADE -1000246 -#define SAY_RIZZLE_FINAL -1000247 - -#define GOSSIP_GET_MOONSTONE "Hand over the Southfury moonstone and I'll let you go." - -//next message must be send to player when Rizzle jump into river, not implemented -#define MSG_ESCAPE_NOTICE "Rizzle Sprysprocket takes the Southfury moonstone and escapes into the river. Follow her!" - -float WPs[58][4] = -{ -//pos_x pos_y pos_z orien -{3691.97, -3962.41, 35.9118, 3.67}, -{3675.02, -3960.49, 35.9118, 3.67}, -{3653.19, -3958.33, 33.9118, 3.59}, -{3621.12, -3958.51, 29.9118, 3.48}, -{3604.86, -3963, 29.9118, 3.48}, -{3569.94, -3970.25, 29.9118, 3.44}, -{3541.03, -3975.64, 29.9118, 3.41}, -{3510.84, -3978.71, 29.9118, 3.41}, -{3472.7, -3997.07, 29.9118, 3.35}, -{3439.15, -4014.55, 29.9118, 3.29}, -{3412.8, -4025.87, 29.9118, 3.25}, -{3384.95, -4038.04, 29.9118, 3.24}, -{3346.77, -4052.93, 29.9118, 3.22}, -{3299.56, -4071.59, 29.9118, 3.20}, -{3261.22, -4080.38, 30.9118, 3.19}, -{3220.68, -4083.09, 31.9118, 3.18}, -{3187.11, -4070.45, 33.9118, 3.16}, -{3162.78, -4062.75, 33.9118, 3.15}, -{3136.09, -4050.32, 33.9118, 3.07}, -{3119.47, -4044.51, 36.0363, 3.07}, -{3098.95, -4019.8, 33.9118, 3.07}, -{3073.07, -4011.42, 33.9118, 3.07}, -{3051.71, -3993.37, 33.9118, 3.02}, -{3027.52, -3978.6, 33.9118, 3.00}, -{3003.78, -3960.14, 33.9118, 2.98}, -{2977.99, -3941.98, 31.9118, 2.96}, -{2964.57, -3932.07, 30.9118, 2.96}, -{2947.9, -3921.31, 29.9118, 2.96}, -{2924.91, -3910.8, 29.9118, 2.94}, -{2903.04, -3896.42, 29.9118, 2.93}, -{2884.75, -3874.03, 29.9118, 2.90}, -{2868.19, -3851.48, 29.9118, 2.82}, -{2854.62, -3819.72, 29.9118, 2.80}, -{2825.53, -3790.4, 29.9118, 2.744}, -{2804.31, -3773.05, 29.9118, 2.71}, -{2769.78, -3763.57, 29.9118, 2.70}, -{2727.23, -3745.92, 30.9118, 2.69}, -{2680.12, -3737.49, 30.9118, 2.67}, -{2647.62, -3739.94, 30.9118, 2.66}, -{2616.6, -3745.75, 30.9118, 2.64}, -{2589.38, -3731.97, 30.9118, 2.61}, -{2562.94, -3722.35, 31.9118, 2.56}, -{2521.05, -3716.6, 31.9118, 2.55}, -{2485.26, -3706.67, 31.9118, 2.51}, -{2458.93, -3696.67, 31.9118, 2.51}, -{2432, -3692.03, 31.9118, 2.46}, -{2399.59, -3681.97, 31.9118, 2.45}, -{2357.75, -3666.6, 31.9118, 2.44}, -{2311.99, -3656.88, 31.9118, 2.94}, -{2263.41, -3649.55, 31.9118, 3.02}, -{2209.05, -3641.76, 31.9118, 2.99}, -{2164.83, -3637.64, 31.9118, 3.15}, -{2122.42, -3639, 31.9118, 3.21}, -{2075.73, -3643.59, 31.9118, 3.22}, -{2033.59, -3649.52, 31.9118, 3.42}, -{1985.22, -3662.99, 31.9118, 3.42}, -{1927.09, -3679.56, 33.9118, 3.42}, -{1873.57, -3695.32, 33.9118, 3.44} -}; - -struct TRINITY_DLL_DECL mob_rizzle_sprysprocketAI : public ScriptedAI -{ - mob_rizzle_sprysprocketAI(Creature *c) : ScriptedAI(c) {} - - uint32 spellEscape_Timer; - uint32 Teleport_Timer; - uint32 Check_Timer; - uint32 Grenade_Timer; - uint32 Must_Die_Timer; - uint32 CurrWP; - - uint64 PlayerGUID; - - bool Must_Die; - bool Escape; - bool ContinueWP; - bool Reached; - - void Reset() - { - spellEscape_Timer = 1300; - Teleport_Timer = 3500; - Check_Timer = 10000; - Grenade_Timer = 30000; - Must_Die_Timer = 3000; - CurrWP = 0; - - PlayerGUID = 0; - - Must_Die = false; - Escape = false; - ContinueWP = false; - Reached = false; - } - - void UpdateAI(const uint32 diff) - { - if (Must_Die) - if (Must_Die_Timer < diff) - { - m_creature->ForcedDespawn(); - return; - } else Must_Die_Timer -= diff; - - if (!Escape) - { - if (!PlayerGUID) - return; - - if (spellEscape_Timer < diff) - { - DoCast(m_creature, SPELL_RIZZLE_ESCAPE, false); - spellEscape_Timer = 10000; - } else spellEscape_Timer -= diff; - - if (Teleport_Timer < diff) - { - //temp solution - unit can't be teleported by core using spelleffect 5, only players - Map* pMap = m_creature->GetMap(); - if (pMap) - { - pMap->CreatureRelocation(m_creature, 3706.39, -3969.15, 35.9118, 0); - m_creature->AI_SendMoveToPacket(3706.39, -3969.15, 35.9118, 0, 0, 0); - } - //begin swimming and summon depth charges - Player* pPlayer = Unit::GetPlayer(PlayerGUID); - SendText(MSG_ESCAPE_NOTICE, pPlayer); - DoCast(m_creature, SPELL_PERIODIC_DEPTH_CHARGE); - m_creature->SetUnitMovementFlags(MOVEMENTFLAG_HOVER | MOVEMENTFLAG_SWIMMING); - m_creature->SetSpeed(MOVE_RUN, 0.85f, true); - m_creature->GetMotionMaster()->MovementExpired(); - m_creature->GetMotionMaster()->MovePoint(CurrWP, WPs[CurrWP][0], WPs[CurrWP][1], WPs[CurrWP][2]); - Escape = true; - } else Teleport_Timer -= diff; - - return; - } - - if (ContinueWP) - { - m_creature->GetMotionMaster()->MovePoint(CurrWP, WPs[CurrWP][0], WPs[CurrWP][1], WPs[CurrWP][2]); - ContinueWP = false; - } - - if (Grenade_Timer < diff) - { - Player* pPlayer = Unit::GetPlayer(PlayerGUID); - if (pPlayer) - { - DoScriptText(SAY_RIZZLE_GRENADE, m_creature, pPlayer); - DoCast(pPlayer, SPELL_RIZZLE_FROST_GRENADE, true); - } - Grenade_Timer = 30000; - } else Grenade_Timer -= diff; - - if (Check_Timer < diff) - { - Player* pPlayer = Unit::GetPlayer(PlayerGUID); - if (!pPlayer) - { - m_creature->ForcedDespawn(); - return; - } - - if (m_creature->IsWithinDist(pPlayer, 10) && m_creature->GetPositionX() > pPlayer->GetPositionX() && !Reached) - { - DoScriptText(SAY_RIZZLE_FINAL, m_creature); - m_creature->SetUInt32Value(UNIT_NPC_FLAGS, 1); - m_creature->setFaction(35); - m_creature->GetMotionMaster()->MoveIdle(); - m_creature->RemoveAurasDueToSpell(SPELL_PERIODIC_DEPTH_CHARGE); - Reached = true; - } - - Check_Timer = 1000; - } else Check_Timer -= diff; - - } - - void SendText(const char *text, Player* pPlayer) - { - WorldPacket data(SMSG_SERVER_MESSAGE, 0); // guess size - data << text; - if (pPlayer) - pPlayer->GetSession()->SendPacket(&data); - } - - void AttackStart(Unit *who) - { - if (!who || PlayerGUID) - return; - - if (who->GetTypeId() == TYPEID_PLAYER && CAST_PLR(who)->GetQuestStatus(10994) == QUEST_STATUS_INCOMPLETE) - { - PlayerGUID = who->GetGUID(); - DoScriptText(SAY_RIZZLE_START, m_creature); - DoCast(who, SPELL_RIZZLE_BLACKJACK, false); - return; - } - } - - void EnterCombat(Unit* who) {} - - void MovementInform(uint32 type, uint32 id) - { - if (type != POINT_MOTION_TYPE) - return; - - if (id == 57) - { - m_creature->ForcedDespawn(); - return; - } - - ++CurrWP; - ContinueWP = true; - } - -}; - -bool GossipHello_mob_rizzle_sprysprocket(Player* pPlayer, Creature* pCreature) -{ - if (pPlayer->GetQuestStatus(10994) != QUEST_STATUS_INCOMPLETE) - return true; - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_GET_MOONSTONE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - pPlayer->SEND_GOSSIP_MENU(10811, pCreature->GetGUID()); - return true; -} - -bool GossipSelect_mob_rizzle_sprysprocket(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - if (uiAction == GOSSIP_ACTION_INFO_DEF + 1 && pPlayer->GetQuestStatus(10994) == QUEST_STATUS_INCOMPLETE) - { - pPlayer->CLOSE_GOSSIP_MENU(); - pCreature->CastSpell(pPlayer, SPELL_GIVE_SOUTHFURY_MOONSTONE, true); - CAST_AI(mob_rizzle_sprysprocketAI, pCreature->AI())->Must_Die_Timer = 3000; - CAST_AI(mob_rizzle_sprysprocketAI, pCreature->AI())->Must_Die = true; - } - return true; -} - -CreatureAI* GetAI_mob_rizzle_sprysprocket(Creature* pCreature) -{ - return new mob_rizzle_sprysprocketAI (pCreature); -} - -/*#### -# mob_depth_charge -####*/ - -struct TRINITY_DLL_DECL mob_depth_chargeAI : public ScriptedAI -{ - mob_depth_chargeAI(Creature *c) : ScriptedAI(c) {} - - bool we_must_die; - uint32 must_die_timer; - - void Reset() - { - m_creature->SetUnitMovementFlags(MOVEMENTFLAG_HOVER | MOVEMENTFLAG_SWIMMING); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - we_must_die = false; - must_die_timer = 1000; - } - - void UpdateAI(const uint32 diff) - { - if (we_must_die) - if (must_die_timer < diff) - { - m_creature->ForcedDespawn(); - } else must_die_timer -= diff; - return; - } - - void MoveInLineOfSight(Unit *who) - { - if (!who) - return; - - if (who->GetTypeId() == TYPEID_PLAYER && m_creature->IsWithinDistInMap(who, 5)) - { - DoCast(who, SPELL_DEPTH_CHARGE_TRAP); - we_must_die = true; - return; - } - } - - void AttackStart(Unit *who) - { - return; - } - - void EnterCombat(Unit* who) - { - return; - } -}; - -CreatureAI* GetAI_mob_depth_charge(Creature* pCreature) -{ - return new mob_depth_chargeAI (pCreature); -} - -void AddSC_azshara() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="mobs_spitelashes"; - newscript->GetAI = &GetAI_mobs_spitelashes; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_loramus_thalipedes"; - newscript->pGossipHello = &GossipHello_npc_loramus_thalipedes; - newscript->pGossipSelect = &GossipSelect_npc_loramus_thalipedes; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_rizzle_sprysprocket"; - newscript->GetAI = &GetAI_mob_rizzle_sprysprocket; - newscript->pGossipHello = &GossipHello_mob_rizzle_sprysprocket; - newscript->pGossipSelect = &GossipSelect_mob_rizzle_sprysprocket; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_depth_charge"; - newscript->GetAI = &GetAI_mob_depth_charge; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/azshara/boss_azuregos.cpp b/src/bindings/scripts/scripts/zone/azshara/boss_azuregos.cpp deleted file mode 100644 index c44772fd87e..00000000000 --- a/src/bindings/scripts/scripts/zone/azshara/boss_azuregos.cpp +++ /dev/null @@ -1,155 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Azuregos -SD%Complete: 90 -SDComment: Teleport not included, spell reflect not effecting dots (Core problem) -SDCategory: Azshara -EndScriptData */ - -#include "precompiled.h" - -#define SAY_TELEPORT -1000100 - -#define SPELL_MARKOFFROST 23182 -#define SPELL_MANASTORM 21097 -#define SPELL_CHILL 21098 -#define SPELL_FROSTBREATH 21099 -#define SPELL_REFLECT 22067 -#define SPELL_CLEAVE 8255 //Perhaps not right ID -#define SPELL_ENRAGE 23537 - -struct TRINITY_DLL_DECL boss_azuregosAI : public ScriptedAI -{ - boss_azuregosAI(Creature *c) : ScriptedAI(c) {} - - uint32 MarkOfFrost_Timer; - uint32 ManaStorm_Timer; - uint32 Chill_Timer; - uint32 Breath_Timer; - uint32 Teleport_Timer; - uint32 Reflect_Timer; - uint32 Cleave_Timer; - uint32 Enrage_Timer; - bool Enraged; - - void Reset() - { - MarkOfFrost_Timer = 35000; - ManaStorm_Timer = 5000 + rand()%12000; - Chill_Timer = 10000 + rand()%20000; - Breath_Timer = 2000 + rand()%6000; - Teleport_Timer = 30000; - Reflect_Timer = 15000 + rand()%15000; - Cleave_Timer = 7000; - Enrage_Timer = 0; - Enraged = false; - } - - void EnterCombat(Unit *who) {} - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - if (Teleport_Timer < diff) - { - DoScriptText(SAY_TELEPORT, m_creature); - 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->GetTypeId() == TYPEID_PLAYER)) - { - DoTeleportPlayer(pUnit, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ()+3, pUnit->GetOrientation()); - } - } - - DoResetThreat(); - Teleport_Timer = 30000; - }else Teleport_Timer -= diff; - - // //MarkOfFrost_Timer - // if (MarkOfFrost_Timer < diff) - // { - // DoCast(m_creature->getVictim(),SPELL_MARKOFFROST); - // MarkOfFrost_Timer = 25000; - // }else MarkOfFrost_Timer -= diff; - - //Chill_Timer - if (Chill_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_CHILL); - Chill_Timer = 13000 + rand()%12000; - }else Chill_Timer -= diff; - - //Breath_Timer - if (Breath_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_FROSTBREATH); - Breath_Timer = 10000 + rand()%5000; - }else Breath_Timer -= diff; - - //ManaStorm_Timer - if (ManaStorm_Timer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_MANASTORM); - ManaStorm_Timer = 7500 + rand()%5000; - }else ManaStorm_Timer -= diff; - - //Reflect_Timer - if (Reflect_Timer < diff) - { - DoCast(m_creature,SPELL_REFLECT); - Reflect_Timer = 20000 + rand()%15000; - }else Reflect_Timer -= diff; - - //Cleave_Timer - if (Cleave_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_CLEAVE); - Cleave_Timer = 7000; - }else Cleave_Timer -= diff; - - //Enrage_Timer - if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 26 && !Enraged) - { - DoCast(m_creature, SPELL_ENRAGE); - Enraged = true; - } - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_azuregos(Creature* pCreature) -{ - return new boss_azuregosAI (pCreature); -} - -void AddSC_boss_azuregos() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_azuregos"; - newscript->GetAI = &GetAI_boss_azuregos; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/azuremyst_isle/azuremyst_isle.cpp b/src/bindings/scripts/scripts/zone/azuremyst_isle/azuremyst_isle.cpp deleted file mode 100644 index 75c37fa5689..00000000000 --- a/src/bindings/scripts/scripts/zone/azuremyst_isle/azuremyst_isle.cpp +++ /dev/null @@ -1,630 +0,0 @@ - /* Copyright (C) 2006 - 2009 ScriptDev2 .sourceforge.net/> - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Azuremyst_Isle -SD%Complete: 75 -SDComment: Quest support: 9283, 9537, 9582, 9554, 9531, 9303(special flight path, proper model for mount missing). Injured Draenei cosmetic only -SDCategory: Azuremyst Isle -EndScriptData */ - -/* ContentData -npc_draenei_survivor -npc_engineer_spark_overgrind -npc_injured_draenei -npc_magwin -npc_geezle -mob_nestlewood_owlkin -EndContentData */ - -#include "precompiled.h" -#include "../../npc/npc_escortAI.h" -#include - -/*###### -## npc_draenei_survivor -######*/ - -enum -{ - SAY_HEAL1 = -1000248, - SAY_HEAL2 = -1000249, - SAY_HEAL3 = -1000250, - SAY_HEAL4 = -1000251, - - SAY_HELP1 = -1000252, - SAY_HELP2 = -1000253, - SAY_HELP3 = -1000254, - SAY_HELP4 = -1000255, - - SPELL_IRRIDATION = 35046, - SPELL_STUNNED = 28630 -}; - -struct TRINITY_DLL_DECL npc_draenei_survivorAI : public ScriptedAI -{ - npc_draenei_survivorAI(Creature *c) : ScriptedAI(c) {} - - uint64 pCaster; - - uint32 SayThanksTimer; - uint32 RunAwayTimer; - uint32 SayHelpTimer; - - bool CanSayHelp; - - void Reset() - { - pCaster = 0; - - SayThanksTimer = 0; - RunAwayTimer = 0; - SayHelpTimer = 10000; - - CanSayHelp = true; - - m_creature->CastSpell(m_creature, SPELL_IRRIDATION, true); - - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT); - m_creature->SetHealth(int(m_creature->GetMaxHealth()*.1)); - m_creature->SetStandState(UNIT_STAND_STATE_SLEEP); - } - - void EnterCombat(Unit *who) {} - - void MoveInLineOfSight(Unit *who) - { - if (CanSayHelp && who->GetTypeId() == TYPEID_PLAYER && m_creature->IsFriendlyTo(who) && m_creature->IsWithinDistInMap(who, 25.0f)) - { - //Random switch between 4 texts - switch (rand()%4) - { - case 0: DoScriptText(SAY_HELP1, m_creature, who); break; - case 1: DoScriptText(SAY_HELP2, m_creature, who); break; - case 2: DoScriptText(SAY_HELP3, m_creature, who); break; - case 3: DoScriptText(SAY_HELP4, m_creature, who); break; - } - - SayHelpTimer = 20000; - CanSayHelp = false; - } - } - - void SpellHit(Unit *Caster, const SpellEntry *Spell) - { - if (Spell->SpellFamilyFlags[2] & 0x080000000) - { - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE); - m_creature->SetStandState(UNIT_STAND_STATE_STAND); - - m_creature->CastSpell(m_creature, SPELL_STUNNED, true); - - pCaster = Caster->GetGUID(); - - SayThanksTimer = 5000; - } - } - - void UpdateAI(const uint32 diff) - { - if (SayThanksTimer) - { - if (SayThanksTimer <= diff) - { - m_creature->RemoveAurasDueToSpell(SPELL_IRRIDATION); - - if (Player* pPlayer = Unit::GetPlayer(pCaster)) - { - switch (rand()%4) - { - case 0: DoScriptText(SAY_HEAL1, m_creature, pPlayer); break; - case 1: DoScriptText(SAY_HEAL2, m_creature, pPlayer); break; - case 2: DoScriptText(SAY_HEAL3, m_creature, pPlayer); break; - case 3: DoScriptText(SAY_HEAL4, m_creature, pPlayer); break; - } - - pPlayer->TalkedToCreature(m_creature->GetEntry(),m_creature->GetGUID()); - } - - m_creature->GetMotionMaster()->Clear(); - m_creature->GetMotionMaster()->MovePoint(0, -4115.053711f, -13754.831055f, 73.508949f); - - RunAwayTimer = 10000; - SayThanksTimer = 0; - }else SayThanksTimer -= diff; - - return; - } - - if (RunAwayTimer) - { - if (RunAwayTimer <= diff) - m_creature->ForcedDespawn(); - else - RunAwayTimer -= diff; - - return; - } - - if (SayHelpTimer < diff) - { - CanSayHelp = true; - SayHelpTimer = 20000; - }else SayHelpTimer -= diff; - } -}; -CreatureAI* GetAI_npc_draenei_survivor(Creature* pCreature) -{ - return new npc_draenei_survivorAI (pCreature); -} - -/*###### -## npc_engineer_spark_overgrind -######*/ - -enum -{ - SAY_TEXT = -1000256, - SAY_EMOTE = -1000257, - ATTACK_YELL = -1000258, - - AREA_COVE = 3579, - AREA_ISLE = 3639, - QUEST_GNOMERCY = 9537, - FACTION_HOSTILE = 14, - SPELL_DYNAMITE = 7978 -}; - -#define GOSSIP_FIGHT "Traitor! You will be brought to justice!" - -struct TRINITY_DLL_DECL npc_engineer_spark_overgrindAI : public ScriptedAI -{ - npc_engineer_spark_overgrindAI(Creature *c) : ScriptedAI(c) - { - NormFaction = c->getFaction(); - NpcFlags = c->GetUInt32Value(UNIT_NPC_FLAGS); - - if (c->GetAreaId() == AREA_COVE || c->GetAreaId() == AREA_ISLE) - IsTreeEvent = true; - } - - uint32 NormFaction; - uint32 NpcFlags; - - uint32 Dynamite_Timer; - uint32 Emote_Timer; - - bool IsTreeEvent; - - void Reset() - { - Dynamite_Timer = 8000; - Emote_Timer = 120000 + rand()%30000; - - m_creature->setFaction(NormFaction); - m_creature->SetUInt32Value(UNIT_NPC_FLAGS, NpcFlags); - - IsTreeEvent = false; - } - - void EnterCombat(Unit* who) - { - DoScriptText(ATTACK_YELL, m_creature, who); - } - - void UpdateAI(const uint32 diff) - { - if (!m_creature->isInCombat() && !IsTreeEvent) - { - if (Emote_Timer < diff) - { - DoScriptText(SAY_TEXT, m_creature); - DoScriptText(SAY_EMOTE, m_creature); - Emote_Timer = 120000 + rand()%30000; - }else Emote_Timer -= diff; - } - else if (IsTreeEvent) - return; - - if (!UpdateVictim()) - return; - - if (Dynamite_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_DYNAMITE); - Dynamite_Timer = 8000; - } else Dynamite_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_npc_engineer_spark_overgrind(Creature* pCreature) -{ - return new npc_engineer_spark_overgrindAI (pCreature); -} - -bool GossipHello_npc_engineer_spark_overgrind(Player* pPlayer, Creature* pCreature) -{ - if (pPlayer->GetQuestStatus(QUEST_GNOMERCY) == QUEST_STATUS_INCOMPLETE) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_FIGHT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - - pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); - return true; -} - -bool GossipSelect_npc_engineer_spark_overgrind(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - if (uiAction == GOSSIP_ACTION_INFO_DEF) - { - pPlayer->CLOSE_GOSSIP_MENU(); - pCreature->setFaction(FACTION_HOSTILE); - CAST_AI(npc_engineer_spark_overgrindAI, pCreature->AI())->AttackStart(pPlayer); - } - return true; -} - -/*###### -## npc_injured_draenei -######*/ - -struct TRINITY_DLL_DECL npc_injured_draeneiAI : public ScriptedAI -{ - npc_injured_draeneiAI(Creature *c) : ScriptedAI(c) {} - - void Reset() - { - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT); - m_creature->SetHealth(int(m_creature->GetMaxHealth()*.15)); - switch (rand()%2) - { - case 0: m_creature->SetStandState(UNIT_STAND_STATE_SIT); break; - case 1: m_creature->SetStandState(UNIT_STAND_STATE_SLEEP); break; - } - } - - void EnterCombat(Unit *who) {} - - void MoveInLineOfSight(Unit *who) - { - return; //ignore everyone around them (won't aggro anything) - } - - void UpdateAI(const uint32 diff) - { - return; - } - -}; -CreatureAI* GetAI_npc_injured_draenei(Creature* pCreature) -{ - return new npc_injured_draeneiAI (pCreature); -} - -/*###### -## npc_magwin -######*/ - -enum -{ - SAY_START = -1000111, - SAY_AGGRO = -1000112, - SAY_PROGRESS = -1000113, - SAY_END1 = -1000114, - SAY_END2 = -1000115, - EMOTE_HUG = -1000116, - - QUEST_A_CRY_FOR_SAY_HELP = 9528 -}; - -struct TRINITY_DLL_DECL npc_magwinAI : public npc_escortAI -{ - npc_magwinAI(Creature *c) : npc_escortAI(c) {} - - - void WaypointReached(uint32 i) - { - Player* pPlayer = Unit::GetPlayer(PlayerGUID); - - if (!pPlayer) - return; - - switch(i) - { - case 0: - DoScriptText(SAY_START, m_creature, pPlayer); - break; - case 17: - DoScriptText(SAY_PROGRESS, m_creature, pPlayer); - break; - case 28: - DoScriptText(SAY_END1, m_creature, pPlayer); - break; - case 29: - DoScriptText(EMOTE_HUG, m_creature, pPlayer); - DoScriptText(SAY_END2, m_creature, pPlayer); - pPlayer->GroupEventHappens(QUEST_A_CRY_FOR_SAY_HELP,m_creature); - break; - } - } - - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO, m_creature, who); - } - - void Reset() { } -}; - -bool QuestAccept_npc_magwin(Player* pPlayer, Creature* pCreature, Quest const* quest) -{ - if (quest->GetQuestId() == QUEST_A_CRY_FOR_SAY_HELP) - { - pCreature->setFaction(113); - if (npc_escortAI* pEscortAI = CAST_AI(npc_escortAI, pCreature->AI())) - pEscortAI->Start(true, false, pPlayer->GetGUID()); - } - return true; -} - -CreatureAI* GetAI_npc_magwinAI(Creature* pCreature) -{ - npc_magwinAI* magwinAI = new npc_magwinAI(pCreature); - - magwinAI->FillPointMovementListForCreature(); - - return magwinAI; -} - -/*###### -## npc_geezle -######*/ - -enum -{ - GEEZLE_SAY_1 = -1000259, - SPARK_SAY_2 = -1000260, - SPARK_SAY_3 = -1000261, - GEEZLE_SAY_4 = -1000262, - SPARK_SAY_5 = -1000263, - SPARK_SAY_6 = -1000264, - GEEZLE_SAY_7 = -1000265, - - EMOTE_SPARK = -1000266, - - MOB_SPARK = 17243, - GO_NAGA_FLAG = 181694 -}; - -static float SparkPos[3] = {-5030.95, -11291.99, 7.97}; - -struct TRINITY_DLL_DECL npc_geezleAI : public ScriptedAI -{ - npc_geezleAI(Creature *c) : ScriptedAI(c) {} - - uint64 SparkGUID; - - uint32 Step; - uint32 SayTimer; - - bool EventStarted; - - void Reset() - { - SparkGUID = 0; - Step = 0; - StartEvent(); - } - - void EnterCombat(Unit* who){} - - void StartEvent() - { - Step = 1; - EventStarted = true; - Creature* Spark = m_creature->SummonCreature(MOB_SPARK, SparkPos[0], SparkPos[1], SparkPos[2], 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1000); - if (Spark) - { - SparkGUID = Spark->GetGUID(); - Spark->setActive(true); - Spark->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - Spark->GetMotionMaster()->MovePoint(0, -5080.70, -11253.61, 0.56); - } - m_creature->GetMotionMaster()->MovePoint(0, -5092.26, -11252, 0.71); - SayTimer = 23000; - } - - uint32 NextStep(uint32 Step) - { - Unit* Spark = Unit::GetUnit((*m_creature), SparkGUID); - - switch(Step) - { - case 0: return 99999; - case 1: - //DespawnNagaFlag(true); - DoScriptText(EMOTE_SPARK, Spark); - return 1000; - case 2: - DoScriptText(GEEZLE_SAY_1, m_creature, Spark); - if (Spark) - { - Spark->SetInFront(m_creature); - m_creature->SetInFront(Spark); - } - return 5000; - case 3: DoScriptText(SPARK_SAY_2, Spark); return 7000; - case 4: DoScriptText(SPARK_SAY_3, Spark); return 8000; - case 5: DoScriptText(GEEZLE_SAY_4, m_creature, Spark); return 8000; - case 6: DoScriptText(SPARK_SAY_5, Spark); return 9000; - case 7: DoScriptText(SPARK_SAY_6, Spark); return 8000; - case 8: DoScriptText(GEEZLE_SAY_7, m_creature, Spark); return 2000; - case 9: - m_creature->GetMotionMaster()->MoveTargetedHome(); - if (Spark) - Spark->GetMotionMaster()->MovePoint(0, -5030.95, -11291.99, 7.97); - return 20000; - case 10: - if (Spark) - Spark->DealDamage(Spark,Spark->GetHealth(),NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - //DespawnNagaFlag(false); - m_creature->SetVisibility(VISIBILITY_OFF); - default: return 99999999; - } - } - - void DespawnNagaFlag(bool despawn) - { - std::list FlagList; - m_creature->GetGameObjectListWithEntryInGrid(FlagList,GO_NAGA_FLAG, 50.0f); - - Player* pPlayer = NULL; - if (!FlagList.empty()) - { - for(std::list::iterator itr = FlagList.begin(); itr != FlagList.end(); ++itr) - { - //TODO: Found how to despawn and respawn - if (despawn) - (*itr)->Delete(); - else - (*itr)->Respawn(); - } - } else error_log("SD2 ERROR: FlagList is empty!"); - } - - void UpdateAI(const uint32 diff) - { - if (SayTimer < diff) - { - if (EventStarted) - { - SayTimer = NextStep(++Step); - } - }else SayTimer -= diff; - } -}; - -CreatureAI* GetAI_npc_geezleAI(Creature* pCreature) -{ - return new npc_geezleAI(pCreature); -} - -/*###### -## mob_nestlewood_owlkin -######*/ - -enum -{ - SPELL_INOCULATE_OWLKIN = 29528, - ENTRY_OWLKIN = 16518, - ENTRY_OWLKIN_INOC = 16534 -}; - -struct TRINITY_DLL_DECL npc_nestlewood_owlkinAI : public ScriptedAI -{ - npc_nestlewood_owlkinAI(Creature *c) : ScriptedAI(c) {} - - uint32 DespawnTimer; - - void Reset() - { - DespawnTimer = 0; - } - - void UpdateAI(const uint32 diff) - { - //timer gets adjusted by the triggered aura effect - if (DespawnTimer) - { - if (DespawnTimer <= diff) - { - //once we are able to, despawn us - m_creature->ForcedDespawn(); - return; - }else DespawnTimer -= diff; - } - - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_npc_nestlewood_owlkinAI(Creature* pCreature) -{ - return new npc_nestlewood_owlkinAI (pCreature); -} - -bool EffectDummyCreature_npc_nestlewood_owlkin(Unit *pCaster, uint32 spellId, uint32 effIndex, Creature *pCreatureTarget) -{ - //always check spellid and effectindex - if (spellId == SPELL_INOCULATE_OWLKIN && effIndex == 0) - { - if (pCreatureTarget->GetEntry() != ENTRY_OWLKIN) - return true; - - pCreatureTarget->UpdateEntry(ENTRY_OWLKIN_INOC); - - //set despawn timer, since we want to remove Creature after a short time - CAST_AI(npc_nestlewood_owlkinAI, pCreatureTarget->AI())->DespawnTimer = 15000; - - //always return true when we are handling this spell and effect - return true; - } - return false; -} - -void AddSC_azuremyst_isle() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="npc_draenei_survivor"; - newscript->GetAI = &GetAI_npc_draenei_survivor; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_engineer_spark_overgrind"; - newscript->GetAI = &GetAI_npc_engineer_spark_overgrind; - newscript->pGossipHello = &GossipHello_npc_engineer_spark_overgrind; - newscript->pGossipSelect = &GossipSelect_npc_engineer_spark_overgrind; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_injured_draenei"; - newscript->GetAI = &GetAI_npc_injured_draenei; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "npc_magwin"; - newscript->GetAI = &GetAI_npc_magwinAI; - newscript->pQuestAccept = &QuestAccept_npc_magwin; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_geezle"; - newscript->GetAI = &GetAI_npc_geezleAI; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_nestlewood_owlkin"; - newscript->GetAI = &GetAI_npc_nestlewood_owlkinAI; - newscript->pEffectDummyCreature = &EffectDummyCreature_npc_nestlewood_owlkin; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/barrens/the_barrens.cpp b/src/bindings/scripts/scripts/zone/barrens/the_barrens.cpp deleted file mode 100644 index 75208c02837..00000000000 --- a/src/bindings/scripts/scripts/zone/barrens/the_barrens.cpp +++ /dev/null @@ -1,674 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along 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_Barrens -SD%Complete: 90 -SDComment: Quest support: 863, 898, 1719, 2458, 4921, 6981, -SDCategory: Barrens -EndScriptData */ - -/* ContentData -npc_beaten_corpse -npc_gilthares -npc_sputtervalve -npc_taskmaster_fizzule -npc_twiggy_flathead -npc_wizzlecrank_shredder -EndContentData */ - -#include "precompiled.h" -#include "../../npc/npc_escortAI.h" - -/*###### -## npc_beaten_corpse -######*/ - -#define GOSSIP_CORPSE "Examine corpse in detail..." - -enum -{ - QUEST_LOST_IN_BATTLE = 4921 -}; - -bool GossipHello_npc_beaten_corpse(Player* pPlayer, Creature* pCreature) -{ - if (pPlayer->GetQuestStatus(QUEST_LOST_IN_BATTLE) == QUEST_STATUS_INCOMPLETE || pPlayer->GetQuestStatus(QUEST_LOST_IN_BATTLE) == QUEST_STATUS_COMPLETE) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_CORPSE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - - pPlayer->SEND_GOSSIP_MENU(3557, pCreature->GetGUID()); - return true; -} - -bool GossipSelect_npc_beaten_corpse(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - if (uiAction == GOSSIP_ACTION_INFO_DEF +1) - { - pPlayer->SEND_GOSSIP_MENU(3558, pCreature->GetGUID()); - pPlayer->TalkedToCreature(pCreature->GetEntry(), pCreature->GetGUID()); - } - return true; -} - -/*###### -# npc_gilthares -######*/ - -enum -{ - SAY_GIL_START = -1000370, - SAY_GIL_AT_LAST = -1000371, - SAY_GIL_PROCEED = -1000372, - SAY_GIL_FREEBOOTERS = -1000373, - SAY_GIL_AGGRO_1 = -1000374, - SAY_GIL_AGGRO_2 = -1000375, - SAY_GIL_AGGRO_3 = -1000376, - SAY_GIL_AGGRO_4 = -1000377, - SAY_GIL_ALMOST = -1000378, - SAY_GIL_SWEET = -1000379, - SAY_GIL_FREED = -1000380, - - QUEST_FREE_FROM_HOLD = 898, - AREA_MERCHANT_COAST = 391, - FACTION_ESCORTEE = 232 //guessed, possible not needed for this quest -}; - -struct TRINITY_DLL_DECL npc_giltharesAI : public npc_escortAI -{ - npc_giltharesAI(Creature* pCreature) : npc_escortAI(pCreature) { } - - void Reset() { } - - void WaypointReached(uint32 uiPointId) - { - Player* pPlayer = (Player*)Unit::GetUnit(*m_creature, PlayerGUID); - - if (!pPlayer) - return; - - switch(uiPointId) - { - case 16: - DoScriptText(SAY_GIL_AT_LAST, m_creature, pPlayer); - break; - case 17: - DoScriptText(SAY_GIL_PROCEED, m_creature, pPlayer); - break; - case 18: - DoScriptText(SAY_GIL_FREEBOOTERS, m_creature, pPlayer); - break; - case 37: - DoScriptText(SAY_GIL_ALMOST, m_creature, pPlayer); - break; - case 47: - DoScriptText(SAY_GIL_SWEET, m_creature, pPlayer); - break; - case 53: - DoScriptText(SAY_GIL_FREED, m_creature, pPlayer); - pPlayer->GroupEventHappens(QUEST_FREE_FROM_HOLD, m_creature); - break; - } - } - - void Aggro(Unit* pWho) - { - //not always use - if (rand()%4) - return; - - //only aggro text if not player and only in this area - if (pWho->GetTypeId() != TYPEID_PLAYER && m_creature->GetAreaId() == AREA_MERCHANT_COAST) - { - //appears to be pretty much random (possible only if escorter not in combat with pWho yet?) - switch(rand()%4) - { - case 0: DoScriptText(SAY_GIL_AGGRO_1, m_creature, pWho); break; - case 1: DoScriptText(SAY_GIL_AGGRO_2, m_creature, pWho); break; - case 2: DoScriptText(SAY_GIL_AGGRO_3, m_creature, pWho); break; - case 3: DoScriptText(SAY_GIL_AGGRO_4, m_creature, pWho); break; - } - } - } -}; - -CreatureAI* GetAI_npc_gilthares(Creature* pCreature) -{ - npc_giltharesAI* pTempAI = new npc_giltharesAI(pCreature); - - pTempAI->FillPointMovementListForCreature(); - - return (CreatureAI*)pTempAI; -} - -bool QuestAccept_npc_gilthares(Player* pPlayer, Creature* pCreature, const Quest* pQuest) -{ - if (pQuest->GetQuestId() == QUEST_FREE_FROM_HOLD) - { - pCreature->setFaction(FACTION_ESCORTEE); - pCreature->SetStandState(UNIT_STAND_STATE_STAND); - - DoScriptText(SAY_GIL_START, pCreature, pPlayer); - - if (npc_giltharesAI* pEscortAI = CAST_AI(npc_giltharesAI, pCreature->AI())) - pEscortAI->Start(false, false, pPlayer->GetGUID(), pQuest); - } - return true; -} - -/*###### -## npc_sputtervalve -######*/ - -#define GOSSIP_SPUTTERVALVE "Can you tell me about this shard?" - -bool GossipHello_npc_sputtervalve(Player* pPlayer, Creature* pCreature) -{ - if (pCreature->isQuestGiver()) - pPlayer->PrepareQuestMenu(pCreature->GetGUID()); - - if (pPlayer->GetQuestStatus(6981) == QUEST_STATUS_INCOMPLETE) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SPUTTERVALVE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - - pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); - return true; -} - -bool GossipSelect_npc_sputtervalve(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - if (uiAction == GOSSIP_ACTION_INFO_DEF) - { - pPlayer->SEND_GOSSIP_MENU(2013, pCreature->GetGUID()); - pPlayer->AreaExploredOrEventHappens(6981); - } - return true; -} - -/*###### -## npc_taskmaster_fizzule -######*/ - -enum -{ - FACTION_FRIENDLY_F = 35, - SPELL_FLARE = 10113, - SPELL_FOLLY = 10137, -}; - -struct TRINITY_DLL_DECL npc_taskmaster_fizzuleAI : public ScriptedAI -{ - npc_taskmaster_fizzuleAI(Creature* c) : ScriptedAI(c) - { - factionNorm = c->getFaction(); - } - - uint32 factionNorm; - bool IsFriend; - uint32 Reset_Timer; - uint8 FlareCount; - - void Reset() - { - IsFriend = false; - Reset_Timer = 120000; - FlareCount = 0; - m_creature->setFaction(factionNorm); - } - - void DoFriend() - { - m_creature->RemoveAllAuras(); - m_creature->DeleteThreatList(); - m_creature->CombatStop(true); - - m_creature->StopMoving(); - m_creature->GetMotionMaster()->MoveIdle(); - - m_creature->setFaction(FACTION_FRIENDLY_F); - m_creature->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE); - } - - void SpellHit(Unit *caster, const SpellEntry *spell) - { - if (spell->Id == SPELL_FLARE || spell->Id == SPELL_FOLLY) - { - ++FlareCount; - - if (FlareCount >= 2) - IsFriend = true; - } - } - - void EnterCombat(Unit* who) { } - - void UpdateAI(const uint32 diff) - { - if (IsFriend) - { - if (Reset_Timer < diff) - { - EnterEvadeMode(); - return; - } else Reset_Timer -= diff; - } - - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - - void ReceiveEmote(Player* pPlayer, uint32 emote) - { - if (emote == TEXTEMOTE_SALUTE) - { - if (FlareCount >= 2) - { - if (m_creature->getFaction() == FACTION_FRIENDLY_F) - return; - - DoFriend(); - } - } - } -}; - -CreatureAI* GetAI_npc_taskmaster_fizzule(Creature* pCreature) -{ - return new npc_taskmaster_fizzuleAI(pCreature); -} - -/*##### -## npc_twiggy_flathead -#####*/ - -#define BIG_WILL 6238 -#define AFFRAY_CHALLENGER 6240 -#define SAY_BIG_WILL_READY -1000267 -#define SAY_TWIGGY_FLATHEAD_BEGIN -1000268 -#define SAY_TWIGGY_FLATHEAD_FRAY -1000269 -#define SAY_TWIGGY_FLATHEAD_DOWN -1000270 -#define SAY_TWIGGY_FLATHEAD_OVER -1000271 - -float AffrayChallengerLoc[6][4]= -{ - {-1683, -4326, 2.79, 0}, - {-1682, -4329, 2.79, 0}, - {-1683, -4330, 2.79, 0}, - {-1680, -4334, 2.79, 1.49}, - {-1674, -4326, 2.79, 3.49}, - {-1677, -4334, 2.79, 1.66} -}; - -struct TRINITY_DLL_DECL npc_twiggy_flatheadAI : public ScriptedAI -{ - npc_twiggy_flatheadAI(Creature *c) : ScriptedAI(c) {} - - bool EventInProgress; - bool EventGrate; - bool EventBigWill; - bool Challenger_down[6]; - uint32 Wave; - uint32 Wave_Timer; - uint32 Challenger_checker; - uint64 PlayerGUID; - uint64 AffrayChallenger[6]; - uint64 BigWill; - - void Reset() - { - EventInProgress = false; - EventGrate = false; - EventBigWill = false; - Wave_Timer = 600000; - Challenger_checker = 0; - Wave = 0; - PlayerGUID = 0; - - for(uint8 i = 0; i < 6; ++i) - { - AffrayChallenger[i] = 0; - Challenger_down[i] = false; - } - BigWill = 0; - } - - void EnterCombat(Unit *who) { } - - void MoveInLineOfSight(Unit *who) - { - if (!who || (!who->isAlive())) return; - - if (m_creature->IsWithinDistInMap(who, 10.0f) && (who->GetTypeId() == TYPEID_PLAYER) && CAST_PLR(who)->GetQuestStatus(1719) == QUEST_STATUS_INCOMPLETE && !EventInProgress) - { - PlayerGUID = who->GetGUID(); - EventInProgress = true; - } - } - - void KilledUnit(Unit *victim) { } - - void UpdateAI(const uint32 diff) - { - if (EventInProgress) { - Player* pWarrior = NULL; - - if (PlayerGUID) - pWarrior = Unit::GetPlayer(PlayerGUID); - - if (!pWarrior) - return; - - if (!pWarrior->isAlive() && pWarrior->GetQuestStatus(1719) == QUEST_STATUS_INCOMPLETE) { - EventInProgress = false; - DoScriptText(SAY_TWIGGY_FLATHEAD_DOWN, m_creature); - pWarrior->FailQuest(1719); - - for(uint8 i = 0; i < 6; ++i) - { - if (AffrayChallenger[i]) - { - Creature* pCreature = Unit::GetCreature((*m_creature), AffrayChallenger[i]); - if (pCreature) { - if (pCreature->isAlive()) - { - pCreature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT); - pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - pCreature->setDeathState(JUST_DIED); - } - } - } - AffrayChallenger[i] = 0; - Challenger_down[i] = false; - } - - if (BigWill) - { - Creature* pCreature = Unit::GetCreature((*m_creature), BigWill); - if (pCreature) { - if (pCreature->isAlive()) { - pCreature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT); - pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - pCreature->setDeathState(JUST_DIED); - } - } - } - BigWill = 0; - } - - if (!EventGrate && EventInProgress) - { - float x,y,z; - pWarrior->GetPosition(x, y, z); - - if (x >= -1684 && x <= -1674 && y >= -4334 && y <= -4324) { - pWarrior->AreaExploredOrEventHappens(1719); - DoScriptText(SAY_TWIGGY_FLATHEAD_BEGIN, m_creature); - - for(uint8 i = 0; i < 6; ++i) - { - Creature* pCreature = m_creature->SummonCreature(AFFRAY_CHALLENGER, AffrayChallengerLoc[i][0], AffrayChallengerLoc[i][1], AffrayChallengerLoc[i][2], AffrayChallengerLoc[i][3], TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000); - if (!pCreature) - continue; - pCreature->setFaction(35); - pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - pCreature->HandleEmoteCommand(EMOTE_ONESHOT_ROAR); - AffrayChallenger[i] = pCreature->GetGUID(); - } - Wave_Timer = 5000; - Challenger_checker = 1000; - EventGrate = true; - } - } - else if (EventInProgress) - { - if (Challenger_checker < diff) - { - for(uint8 i = 0; i < 6; ++i) - { - if (AffrayChallenger[i]) - { - Creature* pCreature = Unit::GetCreature((*m_creature), AffrayChallenger[i]); - if ((!pCreature || (!pCreature->isAlive())) && !Challenger_down[i]) - { - DoScriptText(SAY_TWIGGY_FLATHEAD_DOWN, m_creature); - Challenger_down[i] = true; - } - } - } - Challenger_checker = 1000; - } else Challenger_checker -= diff; - - if (Wave_Timer < diff) - { - if (AffrayChallenger[Wave] && Wave < 6 && !EventBigWill) - { - DoScriptText(SAY_TWIGGY_FLATHEAD_FRAY, m_creature); - Creature* pCreature = Unit::GetCreature((*m_creature), AffrayChallenger[Wave]); - if (pCreature && (pCreature->isAlive())) - { - pCreature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - pCreature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - pCreature->HandleEmoteCommand(EMOTE_ONESHOT_ROAR); - pCreature->setFaction(14); - (pCreature->AI())->AttackStart(pWarrior); - ++Wave; - Wave_Timer = 20000; - } - } - else if (Wave >= 6 && !EventBigWill) { - if (Creature* pCreature = m_creature->SummonCreature(BIG_WILL, -1722, -4341, 6.12, 6.26, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 480000)) - { - BigWill = pCreature->GetGUID(); - //pCreature->GetMotionMaster()->MovePoint(0, -1693, -4343, 4.32); - //pCreature->GetMotionMaster()->MovePoint(1, -1684, -4333, 2.78); - pCreature->GetMotionMaster()->MovePoint(2, -1682, -4329, 2.79); - pCreature->HandleEmoteCommand(EMOTE_STATE_READYUNARMED); - EventBigWill = true; - Wave_Timer = 1000; - } - } - else if (Wave >= 6 && EventBigWill && BigWill) - { - Creature* pCreature = Unit::GetCreature((*m_creature), BigWill); - if (!pCreature || !pCreature->isAlive()) - { - DoScriptText(SAY_TWIGGY_FLATHEAD_OVER, m_creature); - EventInProgress = false; - EventBigWill = false; - EventGrate = false; - PlayerGUID = 0; - Wave = 0; - } - } - } else Wave_Timer -= diff; - } - } - } -}; - -CreatureAI* GetAI_npc_twiggy_flathead(Creature* pCreature) -{ - return new npc_twiggy_flatheadAI (pCreature); -} - -/*##### -## npc_wizzlecrank_shredder -#####*/ - -enum -{ - SAY_PROGRESS_1 = -1000272, - SAY_PROGRESS_2 = -1000273, - SAY_PROGRESS_3 = -1000274, - - SAY_MERCENARY_4 = -1000275, - - SAY_PROGRESS_5 = -1000276, - SAY_PROGRESS_6 = -1000277, - SAY_PROGRESS_7 = -1000278, - SAY_PROGRESS_8 = -1000279, - - QUEST_ESCAPE = 863, - FACTION_RATCHET = 637, - NPC_PILOT = 3451, - MOB_MERCENARY = 3282, -}; - -struct TRINITY_DLL_DECL npc_wizzlecrank_shredderAI : public npc_escortAI -{ - npc_wizzlecrank_shredderAI(Creature* c) : npc_escortAI(c) { } - - bool Completed; - - void WaypointReached(uint32 i) - { - Player* pPlayer = Unit::GetPlayer(PlayerGUID); - - if (!pPlayer) - return; - - switch(i) - { - case 0: DoScriptText(SAY_PROGRESS_1, m_creature); - m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); break; - case 1: DoScriptText(SAY_PROGRESS_2, m_creature); break; - case 10: DoScriptText(SAY_PROGRESS_3, m_creature, pPlayer); - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); break; - case 20:{ - Unit* Mercenary = m_creature->FindNearestCreature(MOB_MERCENARY, 99); - if (Mercenary) - { - DoScriptText(SAY_MERCENARY_4, Mercenary); - CAST_CRE(Mercenary)->AI()->AttackStart(m_creature); - AttackStart(Mercenary); - } - }break; - case 21: DoScriptText(SAY_PROGRESS_5, m_creature); - m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); break; - case 28: DoScriptText(SAY_PROGRESS_6, m_creature); break; - case 29: DoScriptText(SAY_PROGRESS_7, m_creature); break; - case 30: DoScriptText(SAY_PROGRESS_8, m_creature); break; - case 31: m_creature->SummonCreature(NPC_PILOT, 1088.77, -2985.39, 91.84, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 300000); - m_creature->setDeathState(JUST_DIED); - Completed = true; - pPlayer->GroupEventHappens(QUEST_ESCAPE, m_creature); - break; - } - } - - void Reset() - { - m_creature->setDeathState(ALIVE); - Completed = false; - if (!IsBeingEscorted) - { - if (m_creature->getStandState() == UNIT_STAND_STATE_DEAD) - m_creature->SetStandState(UNIT_STAND_STATE_STAND); - } - } -}; - -bool QuestAccept_npc_wizzlecrank_shredder(Player* pPlayer, Creature* pCreature, Quest const* quest) -{ - if (quest->GetQuestId() == QUEST_ESCAPE) - { - pCreature->setFaction(FACTION_RATCHET); - if (npc_escortAI* pEscortAI = CAST_AI(npc_wizzlecrank_shredderAI, pCreature->AI())) - pEscortAI->Start(true, false, pPlayer->GetGUID()); - } - return true; -} - -CreatureAI* GetAI_npc_wizzlecrank_shredderAI(Creature* pCreature) -{ - npc_wizzlecrank_shredderAI* thisAI = new npc_wizzlecrank_shredderAI(pCreature); - - thisAI->AddWaypoint(0, 1109.15, -3104.11, 82.41, 6000); - thisAI->AddWaypoint(1, 1105.39, -3102.86, 82.74, 2000); - thisAI->AddWaypoint(2, 1104.97, -3108.52, 83.10, 1000); - thisAI->AddWaypoint(3, 1110.01, -3110.48, 82.81, 1000); - thisAI->AddWaypoint(4, 1111.72, -3103.03, 82.21, 1000); - thisAI->AddWaypoint(5, 1106.98, -3099.44, 82.18, 1000); - thisAI->AddWaypoint(6, 1103.74, -3103.29, 83.05, 1000); - thisAI->AddWaypoint(7, 1112.55, -3106.56, 82.31, 1000); - thisAI->AddWaypoint(8, 1108.12, -3111.04, 82.99, 1000); - thisAI->AddWaypoint(9, 1109.32, -3100.39, 82.08, 1000); - thisAI->AddWaypoint(10, 1109.32, -3100.39, 82.08, 6000); - thisAI->AddWaypoint(11, 1098.92, -3095.14, 82.97); - thisAI->AddWaypoint(12, 1100.94, -3082.60, 82.83); - thisAI->AddWaypoint(13, 1101.12, -3068.83, 82.53); - thisAI->AddWaypoint(14, 1096.97, -3051.99, 82.50); - thisAI->AddWaypoint(15, 1094.06, -3036.79, 82.70); - thisAI->AddWaypoint(16, 1098.22, -3027.84, 83.79); - thisAI->AddWaypoint(17, 1109.51, -3015.92, 85.73); - thisAI->AddWaypoint(18, 1119.87, -3007.21, 87.08); - thisAI->AddWaypoint(19, 1130.23, -3002.49, 91.27, 5000); - thisAI->AddWaypoint(20, 1130.23, -3002.49, 91.27, 3000); - thisAI->AddWaypoint(21, 1130.23, -3002.49, 91.27, 4000); - thisAI->AddWaypoint(22, 1129.73, -2985.89, 92.46); - thisAI->AddWaypoint(23, 1124.10, -2983.29, 92.81); - thisAI->AddWaypoint(24, 1111.74, -2992.38, 91.59); - thisAI->AddWaypoint(25, 1111.06, -2976.54, 91.81); - thisAI->AddWaypoint(26, 1099.91, -2991.17, 91.67); - thisAI->AddWaypoint(27, 1096.32, -2981.55, 91.73); - thisAI->AddWaypoint(28, 1091.28, -2985.82, 91.74, 4000); - thisAI->AddWaypoint(29, 1091.28, -2985.82, 91.74, 3000); - thisAI->AddWaypoint(30, 1091.28, -2985.82, 91.74, 7000); - thisAI->AddWaypoint(31, 1091.28, -2985.82, 91.74, 3000); - - return thisAI; -} - -void AddSC_the_barrens() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="npc_beaten_corpse"; - newscript->pGossipHello = &GossipHello_npc_beaten_corpse; - newscript->pGossipSelect = &GossipSelect_npc_beaten_corpse; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "npc_gilthares"; - newscript->GetAI = &GetAI_npc_gilthares; - newscript->pQuestAccept = &QuestAccept_npc_gilthares; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_sputtervalve"; - newscript->pGossipHello = &GossipHello_npc_sputtervalve; - newscript->pGossipSelect = &GossipSelect_npc_sputtervalve; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_taskmaster_fizzule"; - newscript->GetAI = &GetAI_npc_taskmaster_fizzule; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_twiggy_flathead"; - newscript->GetAI = &GetAI_npc_twiggy_flathead; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_wizzlecrank_shredder"; - newscript->GetAI = &GetAI_npc_wizzlecrank_shredderAI; - newscript->pQuestAccept = &QuestAccept_npc_wizzlecrank_shredder; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/blades_edge_mountains/blades_edge_mountains.cpp b/src/bindings/scripts/scripts/zone/blades_edge_mountains/blades_edge_mountains.cpp deleted file mode 100644 index fcb6f4af497..00000000000 --- a/src/bindings/scripts/scripts/zone/blades_edge_mountains/blades_edge_mountains.cpp +++ /dev/null @@ -1,416 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 .sourceforge.net/> - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Blades_Edge_Mountains -SD%Complete: 90 -SDComment: Quest support: 10503, 10504, 10556, 10609, 10682, 10821, 10980. Ogri'la->Skettis Flight. (npc_daranelle needs bit more work before consider complete) -SDCategory: Blade's Edge Mountains -EndScriptData */ - -/* ContentData -mobs_bladespire_ogre -mobs_nether_drake -npc_daranelle -npc_overseer_nuaar -npc_saikkal_the_elder -go_legion_obelisk -EndContentData */ - -#include "precompiled.h" - -//Support for quest: You're Fired! (10821) -bool obelisk_one, obelisk_two, obelisk_three, obelisk_four, obelisk_five; - -#define LEGION_OBELISK_ONE 185193 -#define LEGION_OBELISK_TWO 185195 -#define LEGION_OBELISK_THREE 185196 -#define LEGION_OBELISK_FOUR 185197 -#define LEGION_OBELISK_FIVE 185198 - -/*###### -## mobs_bladespire_ogre -######*/ - -//TODO: add support for quest 10512 + Creature abilities -struct TRINITY_DLL_DECL mobs_bladespire_ogreAI : public ScriptedAI -{ - mobs_bladespire_ogreAI(Creature *c) : ScriptedAI(c) {} - - void Reset() { } - - void UpdateAI(const uint32 uiDiff) - { - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_mobs_bladespire_ogre(Creature* pCreature) -{ - return new mobs_bladespire_ogreAI (pCreature); -} - -/*###### -## mobs_nether_drake -######*/ - -enum -{ - SAY_NIHIL_1 = -1000396, - SAY_NIHIL_2 = -1000397, - SAY_NIHIL_3 = -1000398, - SAY_NIHIL_4 = -1000399, - SAY_NIHIL_INTERRUPT = -1000400, - - ENTRY_WHELP = 20021, - ENTRY_PROTO = 21821, - ENTRY_ADOLE = 21817, - ENTRY_MATUR = 21820, - ENTRY_NIHIL = 21823, - - SPELL_T_PHASE_MODULATOR = 37573, - - SPELL_ARCANE_BLAST = 38881, - SPELL_MANA_BURN = 38884, - SPELL_INTANGIBLE_PRESENCE = 36513 -}; - -struct TRINITY_DLL_DECL mobs_nether_drakeAI : public ScriptedAI -{ - mobs_nether_drakeAI(Creature *c) : ScriptedAI(c) {} - - bool IsNihil; - uint32 NihilSpeech_Timer; - uint32 NihilSpeech_Phase; - - uint32 ArcaneBlast_Timer; - uint32 ManaBurn_Timer; - uint32 IntangiblePresence_Timer; - - void Reset() - { - IsNihil = false; - NihilSpeech_Timer = 3000; - NihilSpeech_Phase = 0; - - ArcaneBlast_Timer = 7500; - ManaBurn_Timer = 10000; - IntangiblePresence_Timer = 15000; - } - - void EnterCombat(Unit* who) { } - - void MoveInLineOfSight(Unit *who) - { - if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) - return; - - ScriptedAI::MoveInLineOfSight(who); - } - - //in case Creature was not summoned (not expected) - void MovementInform(uint32 type, uint32 id) - { - if (type != POINT_MOTION_TYPE) - return; - - if (id == 0) - { - m_creature->setDeathState(JUST_DIED); - m_creature->RemoveCorpse(); - m_creature->SetHealth(0); - } - } - - void SpellHit(Unit *caster, const SpellEntry *spell) - { - if (spell->Id == SPELL_T_PHASE_MODULATOR && caster->GetTypeId() == TYPEID_PLAYER) - { - const uint32 entry_list[4] = {ENTRY_PROTO, ENTRY_ADOLE, ENTRY_MATUR, ENTRY_NIHIL}; - int cid = rand()%(4-1); - - if (entry_list[cid] == m_creature->GetEntry()) - ++cid; - - //we are nihil, so say before transform - if (m_creature->GetEntry() == ENTRY_NIHIL) - { - DoScriptText(SAY_NIHIL_INTERRUPT, m_creature); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - IsNihil = false; - } - - if (m_creature->UpdateEntry(entry_list[cid])) - { - if (entry_list[cid] == ENTRY_NIHIL) - { - EnterEvadeMode(); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - IsNihil = true; - }else - AttackStart(caster); - } - } - } - - void UpdateAI(const uint32 diff) - { - if (IsNihil) - { - if (NihilSpeech_Timer <= diff) - { - switch(NihilSpeech_Phase) - { - case 0: - DoScriptText(SAY_NIHIL_1, m_creature); - ++NihilSpeech_Phase; - break; - case 1: - DoScriptText(SAY_NIHIL_2, m_creature); - ++NihilSpeech_Phase; - break; - case 2: - DoScriptText(SAY_NIHIL_3, m_creature); - ++NihilSpeech_Phase; - break; - case 3: - DoScriptText(SAY_NIHIL_4, m_creature); - ++NihilSpeech_Phase; - break; - case 4: - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - //take off to location above - m_creature->GetMotionMaster()->MovePoint(0, m_creature->GetPositionX()+50.0f, m_creature->GetPositionY(), m_creature->GetPositionZ()+50.0f); - ++NihilSpeech_Phase; - break; - } - NihilSpeech_Timer = 5000; - }else NihilSpeech_Timer -=diff; - - //anything below here is not interesting for Nihil, so skip it - return; - } - - if (!UpdateVictim()) - return; - - if (IntangiblePresence_Timer <= diff) - { - DoCast(m_creature->getVictim(),SPELL_INTANGIBLE_PRESENCE); - IntangiblePresence_Timer = 15000+rand()%15000; - }else IntangiblePresence_Timer -= diff; - - if (ManaBurn_Timer <= diff) - { - Unit* target = m_creature->getVictim(); - if (target && target->getPowerType() == POWER_MANA) - DoCast(target,SPELL_MANA_BURN); - ManaBurn_Timer = 8000+rand()%8000; - }else ManaBurn_Timer -= diff; - - if (ArcaneBlast_Timer <= diff) - { - DoCast(m_creature->getVictim(),SPELL_ARCANE_BLAST); - ArcaneBlast_Timer = 2500+rand()%5000; - }else ArcaneBlast_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mobs_nether_drake(Creature* pCreature) -{ - return new mobs_nether_drakeAI (pCreature); -} - -/*###### -## npc_daranelle -######*/ - -enum -{ - SAY_SPELL_INFLUENCE = -1000174, - SPELL_LASHHAN_CHANNEL = 36904 -}; - -struct TRINITY_DLL_DECL npc_daranelleAI : public ScriptedAI -{ - npc_daranelleAI(Creature *c) : ScriptedAI(c) {} - - void Reset() { } - - void EnterCombat(Unit* who) { } - - void MoveInLineOfSight(Unit *who) - { - if (who->GetTypeId() == TYPEID_PLAYER) - { - if (who->HasAura(SPELL_LASHHAN_CHANNEL) && m_creature->IsWithinDistInMap(who, 10.0f)) - { - DoScriptText(SAY_SPELL_INFLUENCE, m_creature, who); - //TODO: Move the below to updateAI and run if this statement == true - m_creature->CastSpell(who,37028,true); - } - } - - ScriptedAI::MoveInLineOfSight(who); - } -}; - -CreatureAI* GetAI_npc_daranelle(Creature* pCreature) -{ - return new npc_daranelleAI (pCreature); -} - -/*###### -## npc_overseer_nuaar -######*/ - -bool GossipHello_npc_overseer_nuaar(Player* pPlayer, Creature* pCreature) -{ - if (pPlayer->GetQuestStatus(10682) == QUEST_STATUS_INCOMPLETE) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Overseer, I am here to negotiate on behalf of the Cenarion Expedition.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - - pPlayer->SEND_GOSSIP_MENU(10532, pCreature->GetGUID()); - - return true; -} - -bool GossipSelect_npc_overseer_nuaar(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) - { - pPlayer->SEND_GOSSIP_MENU(10533, pCreature->GetGUID()); - pPlayer->AreaExploredOrEventHappens(10682); - } - return true; -} - -/*###### -## npc_saikkal_the_elder -######*/ - -bool GossipHello_npc_saikkal_the_elder(Player* pPlayer, Creature* pCreature) -{ - if (pPlayer->GetQuestStatus(10980) == QUEST_STATUS_INCOMPLETE) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Yes... yes, it's me.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - - pPlayer->SEND_GOSSIP_MENU(10794, pCreature->GetGUID()); - - return true; -} - -bool GossipSelect_npc_saikkal_the_elder(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - switch (uiAction) - { - case GOSSIP_ACTION_INFO_DEF+1: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Yes elder. Tell me more of the book.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); - pPlayer->SEND_GOSSIP_MENU(10795, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+2: - pPlayer->TalkedToCreature(pCreature->GetEntry(), pCreature->GetGUID()); - pPlayer->SEND_GOSSIP_MENU(10796, pCreature->GetGUID()); - break; - } - return true; -} - -/*###### -## go_legion_obelisk -######*/ - -bool GOHello_go_legion_obelisk(Player* pPlayer, GameObject* pGo) -{ - if (pPlayer->GetQuestStatus(10821) == QUEST_STATUS_INCOMPLETE) - { - switch(pGo->GetEntry()) - { - case LEGION_OBELISK_ONE: - obelisk_one = true; - break; - case LEGION_OBELISK_TWO: - obelisk_two = true; - break; - case LEGION_OBELISK_THREE: - obelisk_three = true; - break; - case LEGION_OBELISK_FOUR: - obelisk_four = true; - break; - case LEGION_OBELISK_FIVE: - obelisk_five = true; - break; - } - - if (obelisk_one == true && obelisk_two == true && obelisk_three == true && obelisk_four == true && obelisk_five == true) - { - pGo->SummonCreature(19963,2943.40f,4778.20f,284.49f,0.94f,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,120000); - //reset global var - obelisk_one = false; - obelisk_two = false; - obelisk_three = false; - obelisk_four = false; - obelisk_five = false; - } - } - - return true; -} - -/*###### -## AddSC -######*/ - -void AddSC_blades_edge_mountains() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="mobs_bladespire_ogre"; - newscript->GetAI = &GetAI_mobs_bladespire_ogre; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mobs_nether_drake"; - newscript->GetAI = &GetAI_mobs_nether_drake; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_daranelle"; - newscript->GetAI = &GetAI_npc_daranelle; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_overseer_nuaar"; - newscript->pGossipHello = &GossipHello_npc_overseer_nuaar; - newscript->pGossipSelect = &GossipSelect_npc_overseer_nuaar; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_saikkal_the_elder"; - newscript->pGossipHello = &GossipHello_npc_saikkal_the_elder; - newscript->pGossipSelect = &GossipSelect_npc_saikkal_the_elder; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="go_legion_obelisk"; - newscript->pGOHello = &GOHello_go_legion_obelisk; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/blasted_lands/blasted_lands.cpp b/src/bindings/scripts/scripts/zone/blasted_lands/blasted_lands.cpp deleted file mode 100644 index 37c04639278..00000000000 --- a/src/bindings/scripts/scripts/zone/blasted_lands/blasted_lands.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: Blasted_Lands -SD%Complete: 90 -SDComment: Quest support: 2784, 2801, 3628. Missing some texts for Fallen Hero. Teleporter to Rise of the Defiler missing group support. -SDCategory: Blasted Lands -EndScriptData */ - -/* ContentData -npc_deathly_usher -npc_fallen_hero_of_horde -EndContentData */ - -#include "precompiled.h" - -/*###### -## npc_deathly_usher -######*/ - -#define GOSSIP_ITEM_USHER "I wish to to visit the Rise of the Defiler." - -#define SPELL_TELEPORT_SINGLE 12885 -#define SPELL_TELEPORT_SINGLE_IN_GROUP 13142 -#define SPELL_TELEPORT_GROUP 27686 - -bool GossipHello_npc_deathly_usher(Player* pPlayer, Creature* pCreature) -{ - if (pPlayer->GetQuestStatus(3628) == QUEST_STATUS_INCOMPLETE && pPlayer->HasItemCount(10757, 1)) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_USHER, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - - pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); - - return true; -} - -bool GossipSelect_npc_deathly_usher(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - if (uiAction == GOSSIP_ACTION_INFO_DEF) - { - pPlayer->CLOSE_GOSSIP_MENU(); - pCreature->CastSpell(pPlayer, SPELL_TELEPORT_SINGLE, true); - } - - return true; -} - -/*###### -## npc_fallen_hero_of_horde -######*/ -#define GOSSIP_H_F1 "Why are you here?" -#define GOSSIP_H_F2 "Continue story..." - -#define GOSSIP_ITEM_FALLEN "Continue..." - -#define GOSSIP_ITEM_FALLEN1 "What could be worse than death?" -#define GOSSIP_ITEM_FALLEN2 "Subordinates?" -#define GOSSIP_ITEM_FALLEN3 "What are the stones of binding?" -#define GOSSIP_ITEM_FALLEN4 "You can count on me, Hero" -#define GOSSIP_ITEM_FALLEN5 "I shall" - -bool GossipHello_npc_fallen_hero_of_horde(Player* pPlayer, Creature* pCreature) -{ - if (pCreature->isQuestGiver()) - pPlayer->PrepareQuestMenu(pCreature->GetGUID()); - - if (pPlayer->GetQuestStatus(2784) == QUEST_STATUS_INCOMPLETE) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_H_F1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - - if (pPlayer->GetQuestStatus(2801) == QUEST_STATUS_INCOMPLETE && pPlayer->GetTeam() == HORDE) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_H_F2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); - - if (pPlayer->GetQuestStatus(2801) == QUEST_STATUS_INCOMPLETE && pPlayer->GetTeam() == ALLIANCE) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_H_F1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - - pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); - - return true; -} - -bool GossipSelect_npc_fallen_hero_of_horde(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - switch (uiAction) - { - case GOSSIP_ACTION_INFO_DEF+1: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_FALLEN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11); - pPlayer->SEND_GOSSIP_MENU(1392, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+11: - pPlayer->SEND_GOSSIP_MENU(1411, pCreature->GetGUID()); - if (pPlayer->GetQuestStatus(2784) == QUEST_STATUS_INCOMPLETE) - pPlayer->AreaExploredOrEventHappens(2784); - if (pPlayer->GetTeam() == ALLIANCE) - { - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_FALLEN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - pPlayer->SEND_GOSSIP_MENU(1411, pCreature->GetGUID()); - } - break; - - case GOSSIP_ACTION_INFO_DEF+2: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_FALLEN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 21); - pPlayer->SEND_GOSSIP_MENU(1451, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+21: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_FALLEN1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 22); - pPlayer->SEND_GOSSIP_MENU(1452, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+22: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_FALLEN2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 23); - pPlayer->SEND_GOSSIP_MENU(1453, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+23: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_FALLEN3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 24); - pPlayer->SEND_GOSSIP_MENU(1454, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+24: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_FALLEN4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 25); - pPlayer->SEND_GOSSIP_MENU(1455, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+25: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_FALLEN5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 26); - pPlayer->SEND_GOSSIP_MENU(1456, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+26: - pPlayer->CLOSE_GOSSIP_MENU(); - pPlayer->AreaExploredOrEventHappens(2801); - break; - } - return true; -} - -void AddSC_blasted_lands() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="npc_deathly_usher"; - newscript->pGossipHello = &GossipHello_npc_deathly_usher; - newscript->pGossipSelect = &GossipSelect_npc_deathly_usher; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_fallen_hero_of_horde"; - newscript->pGossipHello = &GossipHello_npc_fallen_hero_of_horde; - newscript->pGossipSelect = &GossipSelect_npc_fallen_hero_of_horde; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/blasted_lands/boss_kruul.cpp b/src/bindings/scripts/scripts/zone/blasted_lands/boss_kruul.cpp deleted file mode 100644 index 0452a5763dd..00000000000 --- a/src/bindings/scripts/scripts/zone/blasted_lands/boss_kruul.cpp +++ /dev/null @@ -1,183 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Kruul -SD%Complete: 100 -SDComment: Highlord Kruul are presumably no longer in-game on regular bases, however future events could bring him back. -SDCategory: Bosses -EndScriptData */ - -#include "precompiled.h" - -#define SPELL_SHADOWVOLLEY 21341 -#define SPELL_CLEAVE 20677 -#define SPELL_THUNDERCLAP 23931 -#define SPELL_TWISTEDREFLECTION 21063 -#define SPELL_VOIDBOLT 21066 -#define SPELL_RAGE 21340 -#define SPELL_CAPTURESOUL 21054 - -struct TRINITY_DLL_DECL boss_kruulAI : public ScriptedAI -{ - boss_kruulAI(Creature *c) : ScriptedAI(c) {} - - uint32 ShadowVolley_Timer; - uint32 Cleave_Timer; - uint32 ThunderClap_Timer; - uint32 TwistedReflection_Timer; - uint32 VoidBolt_Timer; - uint32 Rage_Timer; - uint32 Hound_Timer; - int Rand; - int RandX; - int RandY; - Creature* Summoned; - - void Reset() - { - ShadowVolley_Timer = 10000; - Cleave_Timer = 14000; - ThunderClap_Timer = 20000; - TwistedReflection_Timer = 25000; - VoidBolt_Timer = 30000; - Rage_Timer = 60000; //Cast rage after 1 minute - Hound_Timer = 8000; - } - - void EnterCombat(Unit *who) - { - } - - void KilledUnit() - { - // When a player, pet or totem gets killed, Lord Kazzak casts this spell to instantly regenerate 70,000 health. - DoCast(m_creature,SPELL_CAPTURESOUL); - - } - - void SummonHounds(Unit* victim) - { - Rand = rand()%10; - switch (rand()%2) - { - case 0: RandX = 0 - Rand; break; - case 1: RandX = 0 + Rand; break; - } - Rand = 0; - Rand = rand()%10; - switch (rand()%2) - { - case 0: RandY = 0 - Rand; break; - case 1: RandY = 0 + Rand; break; - } - Rand = 0; - Summoned = DoSpawnCreature(19207, RandX, RandY, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); - if (Summoned) - (Summoned->AI())->AttackStart(victim); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //ShadowVolley_Timer - if (ShadowVolley_Timer < diff) - { - if (rand()%100 < 46) - { - DoCast(m_creature->getVictim(),SPELL_SHADOWVOLLEY); - } - - ShadowVolley_Timer = 5000; - }else ShadowVolley_Timer -= diff; - - //Cleave_Timer - if (Cleave_Timer < diff) - { - if (rand()%100 < 50) - { - DoCast(m_creature->getVictim(),SPELL_CLEAVE); - } - - Cleave_Timer = 10000; - }else Cleave_Timer -= diff; - - //ThunderClap_Timer - if (ThunderClap_Timer < diff) - { - if (rand()%100 < 20) - { - DoCast(m_creature->getVictim(),SPELL_THUNDERCLAP); - } - - ThunderClap_Timer = 12000; - }else ThunderClap_Timer -= diff; - - //TwistedReflection_Timer - if (TwistedReflection_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_TWISTEDREFLECTION); - TwistedReflection_Timer = 30000; - }else TwistedReflection_Timer -= diff; - - //VoidBolt_Timer - if (VoidBolt_Timer < diff) - { - if (rand()%100 < 40) - { - DoCast(m_creature->getVictim(),SPELL_VOIDBOLT); - } - - VoidBolt_Timer = 18000; - }else VoidBolt_Timer -= diff; - - //Rage_Timer - if (Rage_Timer < diff) - { - DoCast(m_creature,SPELL_RAGE); - Rage_Timer = 70000; - }else Rage_Timer -= diff; - - //Hound_Timer - if (Hound_Timer < diff) - { - SummonHounds(m_creature->getVictim()); - SummonHounds(m_creature->getVictim()); - SummonHounds(m_creature->getVictim()); - - Hound_Timer = 45000; - }else Hound_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_kruul(Creature* pCreature) -{ - return new boss_kruulAI (pCreature); -} - -void AddSC_boss_kruul() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_kruul"; - newscript->GetAI = &GetAI_boss_kruul; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/bloodmyst_isle/bloodmyst_isle.cpp b/src/bindings/scripts/scripts/zone/bloodmyst_isle/bloodmyst_isle.cpp deleted file mode 100644 index f033cba93b8..00000000000 --- a/src/bindings/scripts/scripts/zone/bloodmyst_isle/bloodmyst_isle.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: Bloodmyst_Isle -SD%Complete: 80 -SDComment: Quest support: 9670, 9756(gossip items text needed). -SDCategory: Bloodmyst Isle -EndScriptData */ - -/* ContentData -mob_webbed_creature -npc_captured_sunhawk_agent -EndContentData */ - -#include "precompiled.h" - -/*###### -## mob_webbed_creature -######*/ - -//possible creatures to be spawned -const uint32 possibleSpawns[32] = {17322, 17661, 17496, 17522, 17340, 17352, 17333, 17524, 17654, 17348, 17339, 17345, 17359, 17353, 17336, 17550, 17330, 17701, 17321, 17680, 17325, 17320, 17683, 17342, 17715, 17334, 17341, 17338, 17337, 17346, 17344, 17327}; - -struct TRINITY_DLL_DECL mob_webbed_creatureAI : public ScriptedAI -{ - mob_webbed_creatureAI(Creature *c) : ScriptedAI(c) {} - - void Reset() - { - } - - void EnterCombat(Unit* who) - { - } - - void JustDied(Unit* Killer) - { - uint32 spawnCreatureID = 0; - - switch(rand()%3) - { - case 0: - spawnCreatureID = 17681; - if (Killer->GetTypeId() == TYPEID_PLAYER) - CAST_PLR(Killer)->KilledMonsterCredit(spawnCreatureID, m_creature->GetGUID()); - break; - case 1: - case 2: - spawnCreatureID = possibleSpawns[rand()%31]; - break; - } - - if (spawnCreatureID) - m_creature->SummonCreature(spawnCreatureID, 0.0f, 0.0f, 0.0f, m_creature->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); - } -}; -CreatureAI* GetAI_mob_webbed_creature(Creature* pCreature) -{ - return new mob_webbed_creatureAI (pCreature); -} - -/*###### -## npc_captured_sunhawk_agent -######*/ - -#define C_SUNHAWK_TRIGGER 17974 - -bool GossipHello_npc_captured_sunhawk_agent(Player* pPlayer, Creature* pCreature) -{ - if (pPlayer->HasAura(31609) && pPlayer->GetQuestStatus(9756) == QUEST_STATUS_INCOMPLETE) - { - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "[PH] ", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - pPlayer->SEND_GOSSIP_MENU(9136, pCreature->GetGUID()); - } - else - pPlayer->SEND_GOSSIP_MENU(9134, pCreature->GetGUID()); - - return true; -} - -bool GossipSelect_npc_captured_sunhawk_agent(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - switch (uiAction) - { - case GOSSIP_ACTION_INFO_DEF+1: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "[PH] ", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); - pPlayer->SEND_GOSSIP_MENU(9137, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+2: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "[PH] ", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); - pPlayer->SEND_GOSSIP_MENU(9138, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+3: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "[PH] ", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4); - pPlayer->SEND_GOSSIP_MENU(9139, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+4: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "[PH] ", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5); - pPlayer->SEND_GOSSIP_MENU(9140, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+5: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "[PH] ", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6); - pPlayer->SEND_GOSSIP_MENU(9141, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+6: - pPlayer->CLOSE_GOSSIP_MENU(); - pPlayer->TalkedToCreature(C_SUNHAWK_TRIGGER, pCreature->GetGUID()); - break; - } - return true; -} - -void AddSC_bloodmyst_isle() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="mob_webbed_creature"; - newscript->GetAI = &GetAI_mob_webbed_creature; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_captured_sunhawk_agent"; - newscript->pGossipHello = &GossipHello_npc_captured_sunhawk_agent; - newscript->pGossipSelect = &GossipSelect_npc_captured_sunhawk_agent; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/borean_tundra/borean_tundra.cpp b/src/bindings/scripts/scripts/zone/borean_tundra/borean_tundra.cpp deleted file mode 100644 index 42b8a01009a..00000000000 --- a/src/bindings/scripts/scripts/zone/borean_tundra/borean_tundra.cpp +++ /dev/null @@ -1,356 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Borean_Tundra -SD%Complete: 100 -SDComment: Quest support: 11708. Taxi vendors. -SDCategory: Borean Tundra -EndScriptData */ - -/* ContentData -npc_fizzcrank_fullthrottle -npc_surristrasz -npc_tiare -EndContentData */ - -#include "precompiled.h" - -/*###### -## npc_fizzcrank_fullthrottle -######*/ - -#define GOSSIP_ITEM_GO_ON "Go on." -#define GOSSIP_ITEM_TELL_ME "Tell me what's going on out here, Fizzcrank." - -enum -{ - GOSSIP_TEXTID_FIZZCRANK1 = 12456, - GOSSIP_TEXTID_FIZZCRANK2 = 12457, - GOSSIP_TEXTID_FIZZCRANK3 = 12458, - GOSSIP_TEXTID_FIZZCRANK4 = 12459, - GOSSIP_TEXTID_FIZZCRANK5 = 12460, - GOSSIP_TEXTID_FIZZCRANK6 = 12461, - GOSSIP_TEXTID_FIZZCRANK7 = 12462, - GOSSIP_TEXTID_FIZZCRANK8 = 12463, - GOSSIP_TEXTID_FIZZCRANK9 = 12464, - - QUEST_THE_MECHAGNOMES = 11708 -}; - -bool GossipHello_npc_fizzcrank_fullthrottle(Player* pPlayer, Creature* pCreature) -{ - if (pCreature->isQuestGiver()) - pPlayer->PrepareQuestMenu(pCreature->GetGUID()); - - if (pPlayer->GetQuestStatus(QUEST_THE_MECHAGNOMES) == QUEST_STATUS_INCOMPLETE) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_TELL_ME, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - - pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); - return true; -} - -bool GossipSelect_npc_fizzcrank_fullthrottle(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - switch(uiAction) - { - case GOSSIP_ACTION_INFO_DEF+1: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_GO_ON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_FIZZCRANK1, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+2: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_GO_ON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); - pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_FIZZCRANK2, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+3: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_GO_ON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4); - pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_FIZZCRANK3, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+4: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_GO_ON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5); - pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_FIZZCRANK4, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+5: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_GO_ON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6); - pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_FIZZCRANK5, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+6: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_GO_ON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7); - pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_FIZZCRANK6, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+7: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_GO_ON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8); - pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_FIZZCRANK7, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+8: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_GO_ON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9); - pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_FIZZCRANK8, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+9: - pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_FIZZCRANK9, pCreature->GetGUID()); - pPlayer->AreaExploredOrEventHappens(QUEST_THE_MECHAGNOMES); - break; - } - return true; -} - -/*###### -## npc_surristrasz -######*/ - -#define GOSSIP_ITEM_FREE_FLIGHT "I'd like passage to the Transitus Shield." -#define GOSSIP_ITEM_FLIGHT "May I use a drake to fly elsewhere?" - -enum -{ - SPELL_ABMER_TO_COLDARRA = 46064 -}; - -bool GossipHello_npc_surristrasz(Player* pPlayer, Creature* pCreature) -{ - if (pCreature->isQuestGiver()) - pPlayer->PrepareQuestMenu(pCreature->GetGUID()); - - if (pCreature->isTaxi()) - { - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_FREE_FLIGHT, GOSSIP_SENDER_MAIN, GOSSIP_OPTION_GOSSIP); - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_TRAINER, GOSSIP_ITEM_FLIGHT, GOSSIP_SENDER_MAIN, GOSSIP_OPTION_TAXIVENDOR); - } - - pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); - return true; -} - -bool GossipSelect_npc_surristrasz(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - if (uiAction == GOSSIP_OPTION_GOSSIP) - { - pPlayer->CLOSE_GOSSIP_MENU(); - - //TaxiPath 795 (amber to coldarra) - pPlayer->CastSpell(pPlayer, SPELL_ABMER_TO_COLDARRA, true); - } - - if (uiAction == GOSSIP_OPTION_TAXIVENDOR) - pPlayer->GetSession()->SendTaxiMenu(pCreature); - - return true; -} - -/*###### -## npc_tiare -######*/ - -#define GOSSIP_ITEM_TELEPORT "Teleport me to Amber Ledge, please." - -enum -{ - SPELL_TELEPORT_COLDARRA = 50135 -}; - -bool GossipHello_npc_tiare(Player* pPlayer, Creature* pCreature) -{ - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_TELEPORT, GOSSIP_SENDER_MAIN, GOSSIP_OPTION_GOSSIP); - pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); - return true; -} - -bool GossipSelect_npc_tiare(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - if (uiAction == GOSSIP_OPTION_GOSSIP) - { - pPlayer->CLOSE_GOSSIP_MENU(); - pPlayer->CastSpell(pPlayer, SPELL_TELEPORT_COLDARRA, true); - } - return true; -} - -/*###### -## npc_sinkhole_kill_credit -######*/ - -enum -{ - SPELL_SET_CART = 46797, - SPELL_EXPLODE_CART = 46799, - SPELL_SUMMON_CART = 46798, - SPELL_SUMMON_WORM = 46800, -}; - -struct TRINITY_DLL_DECL npc_sinkhole_kill_creditAI : public ScriptedAI -{ - npc_sinkhole_kill_creditAI(Creature* c) : ScriptedAI(c){} - - uint32 Phase_Timer; - uint8 Phase; - Unit* Caster; - - void Reset() - { - Phase_Timer = 500; - Phase = 0; - Caster = NULL; - } - - void SpellHit(Unit *caster, const SpellEntry *spell) - { - if (Phase) - return; - - if (spell->Id == SPELL_SET_CART && CAST_PLR(caster)->GetQuestStatus(11897) == QUEST_STATUS_INCOMPLETE) - { - Phase = 1; - Caster = caster; - } - } - - void EnterCombat(Unit* who) { } - - void UpdateAI(const uint32 diff) - { - if (!Phase) - return; - - if (Phase_Timer < diff) - { - switch (Phase) - { - case 1: - DoCast(m_creature, SPELL_EXPLODE_CART, true); - DoCast(m_creature, SPELL_SUMMON_CART, true); - if (GameObject* cart = m_creature->FindNearestGameObject(188160,3)) - cart->SetUInt32Value(GAMEOBJECT_FACTION, 14); - Phase_Timer = 3000; - Phase = 2; - break; - case 2: - if (GameObject* cart = m_creature->FindNearestGameObject(188160,3)) - cart->UseDoorOrButton(); - DoCast(m_creature, SPELL_EXPLODE_CART, true); - Phase_Timer = 3000; - Phase = 3; - break; - case 3: - DoCast(m_creature, SPELL_EXPLODE_CART, true); - Phase_Timer = 2000; - Phase = 4; - case 5: - DoCast(m_creature, SPELL_SUMMON_WORM, true); - if (Unit* worm = m_creature->FindNearestCreature(26250, 3)) - { - worm->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - worm->HandleEmoteCommand(EMOTE_ONESHOT_EMERGE); - } - Phase_Timer = 1000; - Phase = 6; - break; - case 6: - DoCast(m_creature, SPELL_EXPLODE_CART, true); - if (Unit* worm = m_creature->FindNearestCreature(26250, 3)) - { - m_creature->DealDamage(worm, worm->GetHealth()); - worm->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); - } - Phase_Timer = 2000; - Phase = 7; - break; - case 7: - DoCast(m_creature, SPELL_EXPLODE_CART, true); - CAST_PLR(Caster)->KilledMonster(m_creature->GetCreatureInfo(),m_creature->GetGUID()); - Phase_Timer = 5000; - Phase = 8; - break; - case 8: - EnterEvadeMode(); - break; - } - } else Phase_Timer -= diff; - - } - -}; - -CreatureAI* GetAI_npc_sinkhole_kill_credit(Creature* pCreature) -{ - return new npc_sinkhole_kill_creditAI(pCreature); -} - -/*###### -## npc_khunok_the_behemoth -######*/ - -struct TRINITY_DLL_DECL npc_khunok_the_behemothAI : public ScriptedAI -{ - npc_khunok_the_behemothAI(Creature *c) : ScriptedAI(c) {} - - void MoveInLineOfSight(Unit *who) - { - ScriptedAI::MoveInLineOfSight(who); - - if (who->GetTypeId() != TYPEID_UNIT) - return; - - if (who->GetEntry() == 25861 && me->IsWithinDistInMap(who, 10.0f)) - { - if (Unit *owner = who->GetOwner()) - { - if (owner->GetTypeId() == TYPEID_PLAYER) - { - DoCast(owner, 46231, true); - CAST_CRE(who)->ForcedDespawn(); - } - } - } - } -}; - -CreatureAI* GetAI_npc_khunok_the_behemoth(Creature* pCreature) -{ - return new npc_khunok_the_behemothAI(pCreature); -} - -void AddSC_borean_tundra() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "npc_fizzcrank_fullthrottle"; - newscript->pGossipHello = &GossipHello_npc_fizzcrank_fullthrottle; - newscript->pGossipSelect = &GossipSelect_npc_fizzcrank_fullthrottle; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "npc_surristrasz"; - newscript->pGossipHello = &GossipHello_npc_surristrasz; - newscript->pGossipSelect = &GossipSelect_npc_surristrasz; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "npc_tiare"; - newscript->pGossipHello = &GossipHello_npc_tiare; - newscript->pGossipSelect = &GossipSelect_npc_tiare; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_sinkhole_kill_credit"; - newscript->GetAI = &GetAI_npc_sinkhole_kill_credit; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_khunok_the_behemoth"; - newscript->GetAI = &GetAI_npc_khunok_the_behemoth; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/burning_steppes/burning_steppes.cpp b/src/bindings/scripts/scripts/zone/burning_steppes/burning_steppes.cpp deleted file mode 100644 index 2d6aa006a90..00000000000 --- a/src/bindings/scripts/scripts/zone/burning_steppes/burning_steppes.cpp +++ /dev/null @@ -1,154 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Burning_Steppes -SD%Complete: 100 -SDComment: Quest support: 4224, 4866 -SDCategory: Burning Steppes -EndScriptData */ - -/* ContentData -npc_ragged_john -EndContentData */ - -#include "precompiled.h" - -/*###### -## npc_ragged_john -######*/ - -#define GOSSIP_HELLO "Official buisness, John. I need some information about Marsha Windsor. Tell me about the last time you saw him." -#define GOSSIP_SELECT1 "So what did you do?" -#define GOSSIP_SELECT2 "Start making sense, dwarf. I don't want to have anything to do with your cracker, your pappy, or any sort of 'discreditin'." -#define GOSSIP_SELECT3 "Ironfoe?" -#define GOSSIP_SELECT4 "Interesting... continue John." -#define GOSSIP_SELECT5 "So that's how Windsor died..." -#define GOSSIP_SELECT6 "So how did he die?" -#define GOSSIP_SELECT7 "Ok so where the hell is he? Wait a minute! Are you drunk?" -#define GOSSIP_SELECT8 "WHY is he in Blackrock Depths?" -#define GOSSIP_SELECT9 "300? So the Dark Irons killed him and dragged him into the Depths?" -#define GOSSIP_SELECT10 "Ahh... Ironfoe" -#define GOSSIP_SELECT11 "Thanks, Ragged John. Your story was very uplifting and informative" - -struct TRINITY_DLL_DECL npc_ragged_johnAI : public ScriptedAI -{ - npc_ragged_johnAI(Creature *c) : ScriptedAI(c) {} - - void Reset() {} - - void MoveInLineOfSight(Unit *who) - { - if (who->HasAura(16468)) - { - if (who->GetTypeId() == TYPEID_PLAYER && m_creature->IsWithinDistInMap(who, 15) && who->isInAccessiblePlaceFor(m_creature)) - { - DoCast(who,16472); - CAST_PLR(who)->AreaExploredOrEventHappens(4866); - } - } - - ScriptedAI::MoveInLineOfSight(who); - } - - void EnterCombat(Unit *who) {} -}; - -CreatureAI* GetAI_npc_ragged_john(Creature* pCreature) -{ - return new npc_ragged_johnAI (pCreature); -} - -bool GossipHello_npc_ragged_john(Player* pPlayer, Creature* pCreature) -{ - if (pCreature->isQuestGiver()) - pPlayer->PrepareQuestMenu(pCreature->GetGUID()); - - if (pPlayer->GetQuestStatus(4224) == QUEST_STATUS_INCOMPLETE) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - - pPlayer->SEND_GOSSIP_MENU(2713, pCreature->GetGUID()); - return true; -} - -bool GossipSelect_npc_ragged_john(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - switch (uiAction) - { - case GOSSIP_ACTION_INFO_DEF: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - pPlayer->SEND_GOSSIP_MENU(2714, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+1: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - pPlayer->SEND_GOSSIP_MENU(2715, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+2: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); - pPlayer->SEND_GOSSIP_MENU(2716, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+3: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4); - pPlayer->SEND_GOSSIP_MENU(2717, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+4: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5); - pPlayer->SEND_GOSSIP_MENU(2718, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+5: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6); - pPlayer->SEND_GOSSIP_MENU(2719, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+6: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT7, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7); - pPlayer->SEND_GOSSIP_MENU(2720, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+7: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT8, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8); - pPlayer->SEND_GOSSIP_MENU(2721, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+8: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT9, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9); - pPlayer->SEND_GOSSIP_MENU(2722, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+9: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT10, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10); - pPlayer->SEND_GOSSIP_MENU(2723, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+10: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT11, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11); - pPlayer->SEND_GOSSIP_MENU(2725, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+11: - pPlayer->CLOSE_GOSSIP_MENU(); - pPlayer->AreaExploredOrEventHappens(4224); - break; - } - return true; -} - -void AddSC_burning_steppes() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="npc_ragged_john"; - newscript->GetAI = &GetAI_npc_ragged_john; - newscript->pGossipHello = &GossipHello_npc_ragged_john; - newscript->pGossipSelect = &GossipSelect_npc_ragged_john; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/darkshore/darkshore.cpp b/src/bindings/scripts/scripts/zone/darkshore/darkshore.cpp deleted file mode 100644 index 4d968e58011..00000000000 --- a/src/bindings/scripts/scripts/zone/darkshore/darkshore.cpp +++ /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: Darkshore -SD%Complete: 100 -SDComment: Quest support: 731, 2078 -SDCategory: Darkshore -EndScriptData */ - -/* ContentData -npc_prospector_remtravel -npc_threshwackonator -EndContentData */ - -#include "precompiled.h" -#include "../../npc/npc_escortAI.h" - -/*#### -# npc_prospector_remtravel -####*/ - -enum -{ - SAY_REM_START = -1000415, - SAY_REM_AGGRO = -1000427, - SAY_REM_RAMP1_1 = -1000416, - SAY_REM_RAMP1_2 = -1000417, - SAY_REM_BOOK = -1000418, - SAY_REM_TENT1_1 = -1000419, - SAY_REM_TENT1_2 = -1000420, - SAY_REM_MOSS = -1000421, - EMOTE_REM_MOSS = -1000422, - SAY_REM_MOSS_PROGRESS = -1000423, - SAY_REM_PROGRESS = -1000424, - SAY_REM_REMEMBER = -1000425, - EMOTE_REM_END = -1000426, - - FACTION_ESCORTEE = 10, - QUEST_ABSENT_MINDED_PT2 = 731, - NPC_GRAVEL_SCOUT = 2158, - NPC_GRAVEL_BONE = 2159, - NPC_GRAVEL_GEO = 2160 -}; - -struct TRINITY_DLL_DECL npc_prospector_remtravelAI : public npc_escortAI -{ - npc_prospector_remtravelAI(Creature* pCreature) : npc_escortAI(pCreature) {} - - void WaypointReached(uint32 i) - { - Player* pPlayer = Unit::GetPlayer(PlayerGUID); - - if (!pPlayer) - return; - - switch(i) - { - case 0: - DoScriptText(SAY_REM_START, me, pPlayer); - break; - case 5: - DoScriptText(SAY_REM_RAMP1_1, me, pPlayer); - break; - case 6: - DoSpawnCreature(NPC_GRAVEL_SCOUT, -10.0f, 5.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - DoSpawnCreature(NPC_GRAVEL_BONE, -10.0f, 7.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - break; - case 9: - DoScriptText(SAY_REM_RAMP1_2, me, pPlayer); - break; - case 14: - //depend quest rewarded? - DoScriptText(SAY_REM_BOOK, me, pPlayer); - break; - case 15: - DoScriptText(SAY_REM_TENT1_1, me, pPlayer); - break; - case 16: - DoSpawnCreature(NPC_GRAVEL_SCOUT, -10.0f, 5.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - DoSpawnCreature(NPC_GRAVEL_BONE, -10.0f, 7.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - break; - case 17: - DoScriptText(SAY_REM_TENT1_2, me, pPlayer); - break; - case 26: - DoScriptText(SAY_REM_MOSS, me, pPlayer); - break; - case 27: - DoScriptText(EMOTE_REM_MOSS, me, pPlayer); - break; - case 28: - DoScriptText(SAY_REM_MOSS_PROGRESS, me, pPlayer); - break; - case 29: - DoSpawnCreature(NPC_GRAVEL_SCOUT, -15.0f, 3.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - DoSpawnCreature(NPC_GRAVEL_BONE, -15.0f, 5.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - DoSpawnCreature(NPC_GRAVEL_GEO, -15.0f, 7.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - break; - case 31: - DoScriptText(SAY_REM_PROGRESS, me, pPlayer); - break; - case 41: - DoScriptText(SAY_REM_REMEMBER, me, pPlayer); - break; - case 42: - DoScriptText(EMOTE_REM_END, me, pPlayer); - pPlayer->GroupEventHappens(QUEST_ABSENT_MINDED_PT2, me); - break; - } - } - - void Reset() {} - - void EnterCombat(Unit* who) - { - if (rand()%2) - DoScriptText(SAY_REM_AGGRO, me, who); - } - - void JustSummoned(Creature* pSummoned) - { - //unsure if it should be any - //pSummoned->AI()->AttackStart(m_creature); - } - - void UpdateAI(const uint32 diff) - { - npc_escortAI::UpdateAI(diff); - } -}; - -CreatureAI* GetAI_npc_prospector_remtravel(Creature* pCreature) -{ - npc_prospector_remtravelAI* tempAI = new npc_prospector_remtravelAI(pCreature); - - tempAI->FillPointMovementListForCreature(); - - return tempAI; -} - -bool QuestAccept_npc_prospector_remtravel(Player* pPlayer, Creature* pCreature, const Quest* pQuest) -{ - if (pQuest->GetQuestId() == QUEST_ABSENT_MINDED_PT2) - { - if (npc_escortAI* pEscortAI = CAST_AI(npc_prospector_remtravelAI, pCreature->AI())) - pEscortAI->Start(false, false, pPlayer->GetGUID()); - - pCreature->setFaction(FACTION_ESCORTEE); - } - - return true; -} - -/*#### -# npc_threshwackonator -####*/ - -enum -{ - EMOTE_START = -1000413, - SAY_AT_CLOSE = -1000414, - QUEST_GYROMAST_REV = 2078, - NPC_GELKAK = 6667, - FACTION_HOSTILE = 14 -}; - -#define GOSSIP_ITEM_INSERT_KEY "[PH] Insert key" - -struct TRINITY_DLL_DECL npc_threshwackonatorAI : public ScriptedAI -{ - npc_threshwackonatorAI(Creature* pCreature) : ScriptedAI(pCreature) - { - Faction = pCreature->getFaction(); - NpcFlags = pCreature->GetUInt32Value(UNIT_NPC_FLAGS); - PlayerGUID = 0; - } - - uint64 PlayerGUID; - uint32 Faction; - uint32 NpcFlags; - uint32 CheckPlayerTimer; - - void Reset() - { - CheckPlayerTimer = 2500; - - if (!PlayerGUID) - { - me->setFaction(Faction); - me->SetUInt32Value(UNIT_NPC_FLAGS, NpcFlags); - } - } - - void MoveInLineOfSight(Unit* who) - { - if (who->GetEntry() == NPC_GELKAK) - { - if (PlayerGUID && me->IsWithinDistInMap(who, 10.0f)) - { - DoScriptText(SAY_AT_CLOSE, who); - DoAtEnd(); - } - } - - ScriptedAI::MoveInLineOfSight(who); - } - - void EnterEvadeMode() - { - me->RemoveAllAuras(); - me->DeleteThreatList(); - me->CombatStop(true); - me->LoadCreaturesAddon(); - - if (me->isAlive()) - { - if (Player* pPlayer = Unit::GetPlayer(PlayerGUID)) - me->GetMotionMaster()->MoveFollow(pPlayer, PET_FOLLOW_DIST, m_creature->GetFollowAngle()); - else - { - me->GetMotionMaster()->MovementExpired(); - me->GetMotionMaster()->MoveTargetedHome(); - } - } - - me->SetLootRecipient(NULL); - - Reset(); - } - - void DoStart(uint64 Starter) - { - PlayerGUID = Starter; - me->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE); - - if (Player* pPlayer = Unit::GetPlayer(PlayerGUID)) - me->GetMotionMaster()->MoveFollow(pPlayer, PET_FOLLOW_DIST, m_creature->GetFollowAngle()); - - DoScriptText(EMOTE_START, me); - } - - void DoAtEnd() - { - me->setFaction(FACTION_HOSTILE); - - if (Player* pHolder = Unit::GetPlayer(PlayerGUID)) - me->AI()->AttackStart(pHolder); - - PlayerGUID = 0; - } - - void JustDied(Unit* pKiller) - { - if (PlayerGUID) - { - PlayerGUID = 0; - me->GetMotionMaster()->MovementExpired(); - } - } - - void UpdateAI(const uint32 diff) - { - if (PlayerGUID) - { - if (!me->isInCombat()) - { - if (CheckPlayerTimer < diff) - { - CheckPlayerTimer = 5000; - - Player* pPlayer = Unit::GetPlayer(PlayerGUID); - - if (pPlayer && !pPlayer->isAlive()) - { - PlayerGUID = 0; - EnterEvadeMode(); - return; - } - }else CheckPlayerTimer -= diff; - } - } - - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_npc_threshwackonator(Creature* pCreature) -{ - return new npc_threshwackonatorAI(pCreature); -} - -bool GossipHello_npc_threshwackonator(Player* pPlayer, Creature* pCreature) -{ - if (pPlayer->GetQuestStatus(QUEST_GYROMAST_REV) == QUEST_STATUS_INCOMPLETE) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_INSERT_KEY, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - - pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); - return true; -} - -bool GossipSelect_npc_threshwackonator(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) - { - CAST_AI(npc_threshwackonatorAI, pCreature->AI())->DoStart(pPlayer->GetGUID()); - pPlayer->CLOSE_GOSSIP_MENU(); - } - - return true; -} - -void AddSC_darkshore() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "npc_prospector_remtravel"; - newscript->GetAI = &GetAI_npc_prospector_remtravel; - newscript->pQuestAccept = &QuestAccept_npc_prospector_remtravel; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "npc_threshwackonator"; - newscript->GetAI = &GetAI_npc_threshwackonator; - newscript->pGossipHello = &GossipHello_npc_threshwackonator; - newscript->pGossipSelect = &GossipSelect_npc_threshwackonator; - newscript->pGossipSelect = &GossipSelect_npc_threshwackonator; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/desolace/desolace.cpp b/src/bindings/scripts/scripts/zone/desolace/desolace.cpp deleted file mode 100644 index 6423fc08018..00000000000 --- a/src/bindings/scripts/scripts/zone/desolace/desolace.cpp +++ /dev/null @@ -1,174 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Desolace -SD%Complete: 100 -SDComment: Quest support: 5561 -SDCategory: Desolace -EndScriptData */ - -/* ContentData -npc_aged_dying_ancient_kodo -EndContentData */ - -#include "precompiled.h" - -enum -{ - SAY_SMEED_HOME_1 = -1000428, - SAY_SMEED_HOME_2 = -1000429, - SAY_SMEED_HOME_3 = -1000430, - - QUEST_KODO = 5561, - - NPC_SMEED = 11596, - NPC_AGED_KODO = 4700, - NPC_DYING_KODO = 4701, - NPC_ANCIENT_KODO = 4702, - NPC_TAMED_KODO = 11627, - - SPELL_KODO_KOMBO_ITEM = 18153, - SPELL_KODO_KOMBO_PLAYER_BUFF = 18172, //spells here have unclear function, but using them at least for visual parts and checks - SPELL_KODO_KOMBO_DESPAWN_BUFF = 18377, - SPELL_KODO_KOMBO_GOSSIP = 18362 - -}; - -struct TRINITY_DLL_DECL npc_aged_dying_ancient_kodoAI : public ScriptedAI -{ - npc_aged_dying_ancient_kodoAI(Creature* pCreature) : ScriptedAI(pCreature) { Reset(); } - - uint32 m_uiDespawnTimer; - - void Reset() - { - m_uiDespawnTimer = 0; - } - - void MoveInLineOfSight(Unit* pWho) - { - if (pWho->GetEntry() == NPC_SMEED) - { - if (m_creature->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP)) - return; - - if (m_creature->IsWithinDistInMap(pWho, 10.0f)) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_SMEED_HOME_1, pWho); break; - case 1: DoScriptText(SAY_SMEED_HOME_2, pWho); break; - case 2: DoScriptText(SAY_SMEED_HOME_3, pWho); break; - } - - //spell have no implemented effect (dummy), so useful to notify spellHit - m_creature->CastSpell(m_creature,SPELL_KODO_KOMBO_GOSSIP,true); - } - } - } - - void SpellHit(Unit* pCaster, SpellEntry const* pSpell) - { - if (pSpell->Id == SPELL_KODO_KOMBO_GOSSIP) - { - m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - m_uiDespawnTimer = 60000; - } - } - - void UpdateAI(const uint32 diff) - { - //timer should always be == 0 unless we already updated entry of creature. Then not expect this updated to ever be in combat. - if (m_uiDespawnTimer && m_uiDespawnTimer <= diff) - { - if (!m_creature->getVictim() && m_creature->isAlive()) - { - Reset(); - m_creature->setDeathState(JUST_DIED); - m_creature->Respawn(); - return; - } - } else m_uiDespawnTimer -= diff; - - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_npc_aged_dying_ancient_kodo(Creature* pCreature) -{ - return new npc_aged_dying_ancient_kodoAI(pCreature); -} - -bool EffectDummyCreature_npc_aged_dying_ancient_kodo(Unit *pCaster, uint32 spellId, uint32 effIndex, Creature *pCreatureTarget) -{ - //always check spellid and effectindex - if (spellId == SPELL_KODO_KOMBO_ITEM && effIndex == 0) - { - //no effect if player/creature already have aura from spells - if (pCaster->HasAura(SPELL_KODO_KOMBO_PLAYER_BUFF) || pCreatureTarget->HasAura(SPELL_KODO_KOMBO_DESPAWN_BUFF)) - return true; - - if (pCreatureTarget->GetEntry() == NPC_AGED_KODO || - pCreatureTarget->GetEntry() == NPC_DYING_KODO || - pCreatureTarget->GetEntry() == NPC_ANCIENT_KODO) - { - pCaster->CastSpell(pCaster,SPELL_KODO_KOMBO_PLAYER_BUFF,true); - - pCreatureTarget->UpdateEntry(NPC_TAMED_KODO); - pCreatureTarget->CastSpell(pCreatureTarget,SPELL_KODO_KOMBO_DESPAWN_BUFF,false); - - if (pCreatureTarget->GetMotionMaster()->GetCurrentMovementGeneratorType() == WAYPOINT_MOTION_TYPE) - pCreatureTarget->GetMotionMaster()->MoveIdle(); - - pCreatureTarget->GetMotionMaster()->MoveFollow(pCaster, PET_FOLLOW_DIST, pCreatureTarget->GetFollowAngle()); - } - - //always return true when we are handling this spell and effect - return true; - } - return false; -} - -bool GossipHello_npc_aged_dying_ancient_kodo(Player* pPlayer, Creature* pCreature) -{ - if (pPlayer->HasAura(SPELL_KODO_KOMBO_PLAYER_BUFF) && pCreature->HasAura(SPELL_KODO_KOMBO_DESPAWN_BUFF)) - { - //the expected quest objective - pPlayer->TalkedToCreature(pCreature->GetEntry(), pCreature->GetGUID()); - - pPlayer->RemoveAurasDueToSpell(SPELL_KODO_KOMBO_PLAYER_BUFF); - pCreature->GetMotionMaster()->MoveIdle(); - } - - pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); - return true; -} - -void AddSC_desolace() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "npc_aged_dying_ancient_kodo"; - newscript->GetAI = &GetAI_npc_aged_dying_ancient_kodo; - newscript->pEffectDummyCreature = &EffectDummyCreature_npc_aged_dying_ancient_kodo; - newscript->pGossipHello = &GossipHello_npc_aged_dying_ancient_kodo; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/dragonblight/dragonblight.cpp b/src/bindings/scripts/scripts/zone/dragonblight/dragonblight.cpp deleted file mode 100644 index 796d689e4aa..00000000000 --- a/src/bindings/scripts/scripts/zone/dragonblight/dragonblight.cpp +++ /dev/null @@ -1,71 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Dragonblight -SD%Complete: 100 -SDComment: -SDCategory: Dragonblight -EndScriptData */ - -/* ContentData -npc_alexstrasza_wr_gate -EndContentData */ - -#include "precompiled.h" - -enum -{ - QUEST_RETURN_TO_AG_A = 12499, - QUEST_RETURN_TO_AG_H = 12500, - MOVIE_ID_GATES = 14 -}; - -#define GOSSIP_ITEM_WHAT_HAPPENED "Alexstrasza, can you show me what happened here?" - -bool GossipHello_npc_alexstrasza_wr_gate(Player* pPlayer, Creature* pCreature) -{ - if (pCreature->isQuestGiver()) - pPlayer->PrepareQuestMenu(pCreature->GetGUID()); - - if (pPlayer->GetQuestRewardStatus(QUEST_RETURN_TO_AG_A) || pPlayer->GetQuestRewardStatus(QUEST_RETURN_TO_AG_H)) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_WHAT_HAPPENED, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - - pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); - return true; -} - -bool GossipSelect_npc_alexstrasza_wr_gate(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) - { - pPlayer->CLOSE_GOSSIP_MENU(); - pPlayer->SendMovieStart(MOVIE_ID_GATES); - } - - return true; -} - -void AddSC_dragonblight() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "npc_alexstrasza_wr_gate"; - newscript->pGossipHello = &GossipHello_npc_alexstrasza_wr_gate; - newscript->pGossipSelect = &GossipSelect_npc_alexstrasza_wr_gate; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/dun_morogh/dun_morogh.cpp b/src/bindings/scripts/scripts/zone/dun_morogh/dun_morogh.cpp deleted file mode 100644 index 7e61df13575..00000000000 --- a/src/bindings/scripts/scripts/zone/dun_morogh/dun_morogh.cpp +++ /dev/null @@ -1,102 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 .sourceforge.net/> - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Dun_Morogh -SD%Complete: 50 -SDComment: Quest support: 1783 -SDCategory: Dun Morogh -EndScriptData */ - -/* ContentData -npc_narm_faulk -EndContentData */ - -#include "precompiled.h" - -/*###### -## npc_narm_faulk -######*/ - -#define SAY_HEAL -1000280 - -struct TRINITY_DLL_DECL npc_narm_faulkAI : public ScriptedAI -{ - uint32 lifeTimer; - bool spellHit; - - npc_narm_faulkAI(Creature *c) : ScriptedAI(c) {} - - void Reset() - { - lifeTimer = 120000; - m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 32); - m_creature->SetStandState(UNIT_STAND_STATE_DEAD); - spellHit = false; - } - - void EnterCombat(Unit *who) - { - } - - void MoveInLineOfSight(Unit *who) - { - return; - } - - void UpdateAI(const uint32 diff) - { - if (m_creature->IsStandState()) - { - if (lifeTimer < diff) - { - EnterEvadeMode(); - return; - } - else - lifeTimer -= diff; - } - } - - void SpellHit(Unit *Hitter, const SpellEntry *Spellkind) - { - if (Spellkind->Id == 8593 && !spellHit) - { - DoCast(m_creature,32343); - m_creature->SetStandState(UNIT_STAND_STATE_STAND); - m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 0); - //m_creature->RemoveAllAuras(); - DoScriptText(SAY_HEAL, m_creature); - spellHit = true; - } - } - -}; -CreatureAI* GetAI_npc_narm_faulk(Creature* pCreature) -{ - return new npc_narm_faulkAI (pCreature); -} - -void AddSC_dun_morogh() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="npc_narm_faulk"; - newscript->GetAI = &GetAI_npc_narm_faulk; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/dustwallow_marsh/dustwallow_marsh.cpp b/src/bindings/scripts/scripts/zone/dustwallow_marsh/dustwallow_marsh.cpp deleted file mode 100644 index d8648d605b0..00000000000 --- a/src/bindings/scripts/scripts/zone/dustwallow_marsh/dustwallow_marsh.cpp +++ /dev/null @@ -1,337 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Dustwallow_Marsh -SD%Complete: 95 -SDComment: Quest support: 11180, 558, 11126, 11142, 11180. Vendor Nat Pagle -SDCategory: Dustwallow Marsh -EndScriptData */ - -/* ContentData -mobs_risen_husk_spirit -npc_restless_apparition -npc_deserter_agitator -npc_lady_jaina_proudmoore -npc_nat_pagle -npc_private_hendel -npc_cassa_crimsonwing - handled by npc_taxi -EndContentData */ - -#include "precompiled.h" - -/*###### -## mobs_risen_husk_spirit -######*/ - -enum -{ - QUEST_WHATS_HAUNTING_WITCH_HILL = 11180, - SPELL_SUMMON_RESTLESS_APPARITION = 42511, - SPELL_CONSUME_FLESH = 37933, //Risen Husk - SPELL_INTANGIBLE_PRESENCE = 43127, //Risen Spirit - NPC_RISEN_HUSK = 23555, - NPC_RISEN_SPIRIT = 23554 -}; - -struct TRINITY_DLL_DECL mobs_risen_husk_spiritAI : public ScriptedAI -{ - mobs_risen_husk_spiritAI(Creature *c) : ScriptedAI(c) {} - - uint32 m_uiConsumeFlesh_Timer; - uint32 m_uiIntangiblePresence_Timer; - - void Reset() - { - m_uiConsumeFlesh_Timer = 10000; - m_uiIntangiblePresence_Timer = 5000; - } - - void DamageTaken(Unit* pDoneBy, uint32 &damage) - { - if (pDoneBy->GetTypeId() == TYPEID_PLAYER) - { - if (damage >= m_creature->GetHealth() && CAST_PLR(pDoneBy)->GetQuestStatus(QUEST_WHATS_HAUNTING_WITCH_HILL) == QUEST_STATUS_INCOMPLETE) - m_creature->CastSpell(pDoneBy, SPELL_SUMMON_RESTLESS_APPARITION, false); - } - } - - void UpdateAI(const uint32 uiDiff) - { - if (!UpdateVictim()) - return; - - if (m_uiConsumeFlesh_Timer < uiDiff) - { - if (m_creature->GetEntry() == NPC_RISEN_HUSK) - DoCast(m_creature->getVictim(), SPELL_CONSUME_FLESH); - - m_uiConsumeFlesh_Timer = 15000; - } - else - m_uiConsumeFlesh_Timer -= uiDiff; - - if (m_uiIntangiblePresence_Timer < uiDiff) - { - if (m_creature->GetEntry() == NPC_RISEN_SPIRIT) - DoCast(m_creature->getVictim(), SPELL_INTANGIBLE_PRESENCE); - - m_uiIntangiblePresence_Timer = 20000; - } - else - m_uiIntangiblePresence_Timer -= uiDiff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mobs_risen_husk_spirit(Creature* pCreature) -{ - return new mobs_risen_husk_spiritAI (pCreature); -} - -/*###### -## npc_restless_apparition -######*/ - -bool GossipHello_npc_restless_apparition(Player* pPlayer, Creature* pCreature) -{ - pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); - - pPlayer->TalkedToCreature(pCreature->GetEntry(), pCreature->GetGUID()); - pCreature->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - - return true; -} - -/*###### -## npc_deserter_agitator -######*/ - -enum -{ - QUEST_TRAITORS_AMONG_US = 11126, - FACTION_THER_DESERTER = 1883 -}; - -struct TRINITY_DLL_DECL npc_deserter_agitatorAI : public ScriptedAI -{ - npc_deserter_agitatorAI(Creature* pCreature) : ScriptedAI(pCreature) { } - - void Reset() - { - me->RestoreFaction(); - } -}; - -CreatureAI* GetAI_npc_deserter_agitator(Creature* pCreature) -{ - return new npc_deserter_agitatorAI (pCreature); -} - -bool GossipHello_npc_deserter_agitator(Player* pPlayer, Creature* pCreature) -{ - if (pPlayer->GetQuestStatus(QUEST_TRAITORS_AMONG_US) == QUEST_STATUS_INCOMPLETE) - { - pCreature->setFaction(FACTION_THER_DESERTER); - pPlayer->TalkedToCreature(pCreature->GetEntry(), pCreature->GetGUID()); - } - else - pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); - - return true; -} - -/*###### -## npc_lady_jaina_proudmoore -######*/ - -enum -{ - QUEST_JAINAS_AUTOGRAPH = 558, - SPELL_JAINAS_AUTOGRAPH = 23122 -}; - -#define GOSSIP_ITEM_JAINA "I know this is rather silly but i have a young ward who is a bit shy and would like your autograph." - -bool GossipHello_npc_lady_jaina_proudmoore(Player* pPlayer, Creature* pCreature) -{ - if (pCreature->isQuestGiver()) - pPlayer->PrepareQuestMenu(pCreature->GetGUID()); - - if (pPlayer->GetQuestStatus(QUEST_JAINAS_AUTOGRAPH) == QUEST_STATUS_INCOMPLETE) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_JAINA, GOSSIP_SENDER_MAIN, GOSSIP_SENDER_INFO); - - pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); - - return true; -} - -bool GossipSelect_npc_lady_jaina_proudmoore(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - if (uiAction == GOSSIP_SENDER_INFO) - { - pPlayer->SEND_GOSSIP_MENU(7012, pCreature->GetGUID()); - pPlayer->CastSpell(pPlayer, SPELL_JAINAS_AUTOGRAPH, false); - } - return true; -} - -/*###### -## npc_nat_pagle -######*/ - -enum -{ - QUEST_NATS_MEASURING_TAPE = 8227 -}; - -bool GossipHello_npc_nat_pagle(Player* pPlayer, Creature* pCreature) -{ - if (pCreature->isQuestGiver()) - pPlayer->PrepareQuestMenu(pCreature->GetGUID()); - - if (pCreature->isVendor() && pPlayer->GetQuestRewardStatus(QUEST_NATS_MEASURING_TAPE)) - { - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); - pPlayer->SEND_GOSSIP_MENU(7640, pCreature->GetGUID()); - } - else - pPlayer->SEND_GOSSIP_MENU(7638, pCreature->GetGUID()); - - return true; -} - -bool GossipSelect_npc_nat_pagle(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - if (uiAction == GOSSIP_ACTION_TRADE) - pPlayer->SEND_VENDORLIST(pCreature->GetGUID()); - - return true; -} - -/*###### -## npc_private_hendel -######*/ - -enum -{ - SAY_PROGRESS_1_TER = -1000411, - SAY_PROGRESS_2_HEN = -1000412, - SAY_PROGRESS_3_TER = -1000413, - SAY_PROGRESS_4_TER = -1000414, - EMOTE_SURRENDER = -1000415, - - QUEST_MISSING_DIPLO_PT16 = 1324, - FACTION_HOSTILE = 168, //guessed, may be different - - NPC_SENTRY = 5184, //helps hendel - NPC_JAINA = 4968, //appears once hendel gives up - NPC_TERVOSH = 4967 -}; - -//TODO: develop this further, end event not created -struct TRINITY_DLL_DECL npc_private_hendelAI : public ScriptedAI -{ - npc_private_hendelAI(Creature* pCreature) : ScriptedAI(pCreature) { } - - void Reset() - { - me->RestoreFaction(); - } - - void AttackedBy(Unit* pAttacker) - { - if (m_creature->getVictim()) - return; - - if (m_creature->IsFriendlyTo(pAttacker)) - return; - - AttackStart(pAttacker); - } - - void DamageTaken(Unit* pDoneBy, uint32 &uiDamage) - { - if (uiDamage > m_creature->GetHealth() || ((m_creature->GetHealth() - uiDamage)*100 / m_creature->GetMaxHealth() < 20)) - { - uiDamage = 0; - - if (Player* pPlayer = pDoneBy->GetCharmerOrOwnerPlayerOrPlayerItself()) - pPlayer->GroupEventHappens(QUEST_MISSING_DIPLO_PT16, m_creature); - - DoScriptText(EMOTE_SURRENDER, m_creature); - EnterEvadeMode(); - } - } -}; - -bool QuestAccept_npc_private_hendel(Player* pPlayer, Creature* pCreature, const Quest* pQuest) -{ - if (pQuest->GetQuestId() == QUEST_MISSING_DIPLO_PT16) - pCreature->setFaction(FACTION_HOSTILE); - - return true; -} - -CreatureAI* GetAI_npc_private_hendel(Creature* pCreature) -{ - return new npc_private_hendelAI(pCreature); -} - -/*###### -## -######*/ - -void AddSC_dustwallow_marsh() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="mobs_risen_husk_spirit"; - newscript->GetAI = &GetAI_mobs_risen_husk_spirit; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_restless_apparition"; - newscript->pGossipHello = &GossipHello_npc_restless_apparition; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_deserter_agitator"; - newscript->GetAI = &GetAI_npc_deserter_agitator; - newscript->pGossipHello = &GossipHello_npc_deserter_agitator; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_lady_jaina_proudmoore"; - newscript->pGossipHello = &GossipHello_npc_lady_jaina_proudmoore; - newscript->pGossipSelect = &GossipSelect_npc_lady_jaina_proudmoore; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_nat_pagle"; - newscript->pGossipHello = &GossipHello_npc_nat_pagle; - newscript->pGossipSelect = &GossipSelect_npc_nat_pagle; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "npc_private_hendel"; - newscript->GetAI = &GetAI_npc_private_hendel; - newscript->pQuestAccept = &QuestAccept_npc_private_hendel; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/eastern_plaguelands/eastern_plaguelands.cpp b/src/bindings/scripts/scripts/zone/eastern_plaguelands/eastern_plaguelands.cpp deleted file mode 100644 index 9999f80dc85..00000000000 --- a/src/bindings/scripts/scripts/zone/eastern_plaguelands/eastern_plaguelands.cpp +++ /dev/null @@ -1,180 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Eastern_Plaguelands -SD%Complete: 100 -SDComment: Quest support: 5211, 5742. Special vendor Augustus the Touched -SDCategory: Eastern Plaguelands -EndScriptData */ - -/* ContentData -mobs_ghoul_flayer -npc_augustus_the_touched -npc_darrowshire_spirit -npc_tirion_fordring -EndContentData */ - -#include "precompiled.h" - -//id8530 - cannibal ghoul -//id8531 - gibbering ghoul -//id8532 - diseased flayer - -struct TRINITY_DLL_DECL mobs_ghoul_flayerAI : public ScriptedAI -{ - mobs_ghoul_flayerAI(Creature *c) : ScriptedAI(c) {} - - void Reset() { } - - void EnterCombat(Unit* who) { } - - void JustDied(Unit* Killer) - { - if (Killer->GetTypeId() == TYPEID_PLAYER) - m_creature->SummonCreature(11064, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 60000); - } -}; - -CreatureAI* GetAI_mobs_ghoul_flayer(Creature* pCreature) -{ - return new mobs_ghoul_flayerAI (pCreature); -} - -/*###### -## npc_augustus_the_touched -######*/ - -bool GossipHello_npc_augustus_the_touched(Player* pPlayer, Creature* pCreature) -{ - if (pCreature->isQuestGiver()) - pPlayer->PrepareQuestMenu(pCreature->GetGUID()); - - if (pCreature->isVendor() && pPlayer->GetQuestRewardStatus(6164)) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); - - pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); - return true; -} - -bool GossipSelect_npc_augustus_the_touched(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - if (uiAction == GOSSIP_ACTION_TRADE) - pPlayer->SEND_VENDORLIST(pCreature->GetGUID()); - return true; -} - -/*###### -## npc_darrowshire_spirit -######*/ - -#define SPELL_SPIRIT_SPAWNIN 17321 - -struct TRINITY_DLL_DECL npc_darrowshire_spiritAI : public ScriptedAI -{ - npc_darrowshire_spiritAI(Creature *c) : ScriptedAI(c) {} - - void Reset() - { - DoCast(m_creature,SPELL_SPIRIT_SPAWNIN); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - } - - void EnterCombat(Unit *who) { } - -}; -CreatureAI* GetAI_npc_darrowshire_spirit(Creature* pCreature) -{ - return new npc_darrowshire_spiritAI (pCreature); -} - -bool GossipHello_npc_darrowshire_spirit(Player* pPlayer, Creature* pCreature) -{ - pPlayer->SEND_GOSSIP_MENU(3873, pCreature->GetGUID()); - pPlayer->TalkedToCreature(pCreature->GetEntry(), pCreature->GetGUID()); - pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - return true; -} - -/*###### -## npc_tirion_fordring -######*/ - -bool GossipHello_npc_tirion_fordring(Player* pPlayer, Creature* pCreature) -{ - if (pCreature->isQuestGiver()) - pPlayer->PrepareQuestMenu(pCreature->GetGUID()); - - if (pPlayer->GetQuestStatus(5742) == QUEST_STATUS_INCOMPLETE && pPlayer->getStandState() == UNIT_STAND_STATE_SIT) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "I am ready to hear your tale, Tirion.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - - pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); - - return true; -} - -bool GossipSelect_npc_tirion_fordring(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - switch (uiAction) - { - case GOSSIP_ACTION_INFO_DEF+1: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Thank you, Tirion. What of your identity?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - pPlayer->SEND_GOSSIP_MENU(4493, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+2: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "That is terrible.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); - pPlayer->SEND_GOSSIP_MENU(4494, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+3: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "I will, Tirion.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4); - pPlayer->SEND_GOSSIP_MENU(4495, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+4: - pPlayer->CLOSE_GOSSIP_MENU(); - pPlayer->AreaExploredOrEventHappens(5742); - break; - } - return true; -} - -void AddSC_eastern_plaguelands() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="mobs_ghoul_flayer"; - newscript->GetAI = &GetAI_mobs_ghoul_flayer; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_augustus_the_touched"; - newscript->pGossipHello = &GossipHello_npc_augustus_the_touched; - newscript->pGossipSelect = &GossipSelect_npc_augustus_the_touched; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_darrowshire_spirit"; - newscript->GetAI = &GetAI_npc_darrowshire_spirit; - newscript->pGossipHello = &GossipHello_npc_darrowshire_spirit; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_tirion_fordring"; - newscript->pGossipHello = &GossipHello_npc_tirion_fordring; - newscript->pGossipSelect = &GossipSelect_npc_tirion_fordring; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/elwynn_forest/elwynn_forest.cpp b/src/bindings/scripts/scripts/zone/elwynn_forest/elwynn_forest.cpp deleted file mode 100644 index 67456755cd2..00000000000 --- a/src/bindings/scripts/scripts/zone/elwynn_forest/elwynn_forest.cpp +++ /dev/null @@ -1,102 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 .sourceforge.net/> - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Elwynn_Forest -SD%Complete: 50 -SDComment: Quest support: 1786 -SDCategory: Elwynn Forest -EndScriptData */ - -/* ContentData -npc_henze_faulk -EndContentData */ - -#include "precompiled.h" - -/*###### -## npc_henze_faulk -######*/ - -#define SAY_HEAL -1000280 - -struct TRINITY_DLL_DECL npc_henze_faulkAI : public ScriptedAI -{ - uint32 lifeTimer; - bool spellHit; - - npc_henze_faulkAI(Creature *c) : ScriptedAI(c) {} - - void Reset() - { - lifeTimer = 120000; - m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 32); - m_creature->SetStandState(UNIT_STAND_STATE_DEAD); // lay down - spellHit = false; - } - - void EnterCombat(Unit *who) - { - } - - void MoveInLineOfSight(Unit *who) - { - return; - } - - void UpdateAI(const uint32 diff) - { - if (m_creature->IsStandState()) - { - if (lifeTimer < diff) - { - EnterEvadeMode(); - return; - } - else - lifeTimer -= diff; - } - } - - void SpellHit(Unit *Hitter, const SpellEntry *Spellkind) - { - if (Spellkind->Id == 8593 && !spellHit) - { - DoCast(m_creature,32343); - m_creature->SetStandState(UNIT_STAND_STATE_STAND); - m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 0); - //m_creature->RemoveAllAuras(); - DoScriptText(SAY_HEAL, m_creature); - spellHit = true; - } - } - -}; -CreatureAI* GetAI_npc_henze_faulk(Creature* pCreature) -{ - return new npc_henze_faulkAI (pCreature); -} - -void AddSC_elwynn_forest() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="npc_henze_faulk"; - newscript->GetAI = &GetAI_npc_henze_faulk; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/eversong_woods/eversong_woods.cpp b/src/bindings/scripts/scripts/zone/eversong_woods/eversong_woods.cpp deleted file mode 100644 index 9a0952eb4fb..00000000000 --- a/src/bindings/scripts/scripts/zone/eversong_woods/eversong_woods.cpp +++ /dev/null @@ -1,742 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 .sourceforge.net/> - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Eversong_Woods -SD%Complete: 100 -SDComment: Quest support: 8483, 8488, 8490, 9686 -SDCategory: Eversong Woods -EndScriptData */ - -/* ContentData -npc_prospector_anvilward -npc_apprentice_mirveda -npc_infused_crystal -npc_kelerun_bloodmourn -go_harbinger_second_trial -EndContentData */ - -#include "precompiled.h" -#include "../../npc/npc_escortAI.h" - -/*###### -## npc_prospector_anvilward -######*/ - -#define GOSSIP_HELLO "I need a moment of your time, sir." -#define GOSSIP_SELECT "Why... yes, of course. I've something to show you right inside this building, Mr. Anvilward." - -#define SAY_PR_1 -1000281 -#define SAY_PR_2 -1000282 - -#define QUEST_THE_DWARVEN_SPY 8483 - -struct TRINITY_DLL_DECL npc_prospector_anvilwardAI : public npc_escortAI -{ - // CreatureAI functions - npc_prospector_anvilwardAI(Creature *c) : npc_escortAI(c) {} - - // Pure Virtual Functions - void WaypointReached(uint32 i) - { - Player* pPlayer = Unit::GetPlayer(PlayerGUID); - - if (!pPlayer) - return; - - switch (i) - { - case 0: DoScriptText(SAY_PR_1, m_creature, pPlayer); break; - case 5: DoScriptText(SAY_PR_2, m_creature, pPlayer); break; - case 6: m_creature->setFaction(24); break; - } - } - - void EnterCombat(Unit* who) { } - - void Reset() - { - m_creature->setFaction(35); - } - - void JustDied(Unit* killer) - { - m_creature->setFaction(35); - } - - void UpdateAI(const uint32 diff) - { - npc_escortAI::UpdateAI(diff); - } -}; - -CreatureAI* GetAI_npc_prospector_anvilward(Creature* pCreature) -{ - npc_prospector_anvilwardAI* thisAI = new npc_prospector_anvilwardAI(pCreature); - - thisAI->FillPointMovementListForCreature(); - - return thisAI; -} - -bool GossipHello_npc_prospector_anvilward(Player* pPlayer, Creature* pCreature) -{ - if (pPlayer->GetQuestStatus(QUEST_THE_DWARVEN_SPY) == QUEST_STATUS_INCOMPLETE) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - - pPlayer->SEND_GOSSIP_MENU(8239, pCreature->GetGUID()); - return true; -} - -bool GossipSelect_npc_prospector_anvilward(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - switch(uiAction) - { - case GOSSIP_ACTION_INFO_DEF+1: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); - pPlayer->SEND_GOSSIP_MENU(8240, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+2: - pPlayer->CLOSE_GOSSIP_MENU(); - if (npc_escortAI* pEscortAI = CAST_AI(npc_prospector_anvilwardAI, pCreature->AI())) - pEscortAI->Start(true, false, pPlayer->GetGUID()); - break; - } - return true; -} - -/*###### -## Quest 9686 Second Trial -######*/ - -#define QUEST_SECOND_TRIAL 9686 - -#define MASTER_KELERUN_BLOODMOURN 17807 - -#define CHAMPION_BLOODWRATH 17809 -#define CHAMPION_LIGHTREND 17810 -#define CHAMPION_SWIFTBLADE 17811 -#define CHAMPION_SUNSTRIKER 17812 - -#define HARBINGER_OF_THE_SECOND_TRIAL 182052 - -#define SPELL_FLASH_OF_LIGHT 19939 -#define TIMER_FLASH_OF_LIGHT 3225 - -#define SPELL_SEAL_OF_JUSTICE 20164 -#define TIMER_SEAL_OF_JUSTICE 10000 - -#define SPELL_JUDGEMENT_OF_LIGHT 20271 -#define TIMER_JUDGEMENT_OF_LIGHT 10000 - -#define SPELL_SEAL_OF_COMMAND 20375 -#define TIMER_SEAL_OF_COMMAND 20000 - -#define OFFSET_NEXT_ATTACK 750 - -#define FACTION_HOSTILE 45 -#define FACTION_FRIENDLY 7 - -#define TEXT_SECOND_TRIAL_1 -1645006 -#define TEXT_SECOND_TRIAL_2 -1645007 -#define TEXT_SECOND_TRIAL_3 -1645008 -#define TEXT_SECOND_TRIAL_4 -1645009 - -struct Locations -{ - float x, y, z, o; -}; - -static Locations SpawnPosition[]= -{ - {5.3, -11.8, 0.361, 4.2}, - {11.2, -29.17, 0.361, 2.7}, - {-5.7, -34.85, 0.361, 1.09}, - {-11.9, -18, 0.361, 5.87} -}; - -static uint32 PaladinEntry[]= {CHAMPION_BLOODWRATH, CHAMPION_LIGHTREND, CHAMPION_SWIFTBLADE, CHAMPION_SUNSTRIKER}; - -/*###### -## npc_second_trial_paladin -######*/ - -struct TRINITY_DLL_DECL npc_secondTrialAI : public ScriptedAI -{ - npc_secondTrialAI(Creature *c) : ScriptedAI(c) {} - - uint32 timer; - uint8 questPhase; - uint64 summonerGuid; - - bool spellFlashLight; - bool spellJustice; - bool spellJudLight; - bool spellCommand; - - uint32 timerFlashLight; - uint32 timerJustice; - uint32 timerJudLight; - uint32 timerCommand; - - - void Reset() { - - timer = 2000; - questPhase = 0; - summonerGuid = 0; - - m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_KNEEL); - m_creature->setFaction(FACTION_FRIENDLY); - - spellFlashLight = false; - spellJustice = false; - spellJudLight = false; - spellCommand = false; - - switch(m_creature->GetEntry()) { - case CHAMPION_BLOODWRATH : - spellFlashLight = true; - timerFlashLight = TIMER_FLASH_OF_LIGHT; - break; - case CHAMPION_LIGHTREND : - spellJustice = true; - timerJustice = 500; - break; - case CHAMPION_SWIFTBLADE : - spellJudLight = false; // Misses Script Effect // http://www.wowhead.com/?spell=20271 - timerJudLight = 500; - break; - case CHAMPION_SUNSTRIKER : - spellFlashLight = true; - spellJudLight = false; // Misses Script Effect // http://www.wowhead.com/?spell=20271 - spellCommand = false; // Misses Dummy // http://www.wowhead.com/?spell=20375 - timerFlashLight = TIMER_FLASH_OF_LIGHT; - timerJudLight = 500; - timerCommand = 1500; - break; - } - } - - void EnterCombat(Unit *who) { } - - void UpdateAI(const uint32 diff) - { - if (questPhase == 1) { - - if (timer < diff) { - m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_STAND); - m_creature->setFaction(FACTION_HOSTILE); - questPhase = 0; - - Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (target && target->GetTypeId() == TYPEID_PLAYER) // only on players. - { - m_creature->AddThreat(target, 5000000.0f); - AttackStart(target); - } - } - else timer -= diff; - } - - if (!UpdateVictim()) - return; - - // healer - if (spellFlashLight) { - if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 70){ - if (timerFlashLight < diff) { - DoCast(m_creature, SPELL_FLASH_OF_LIGHT); - timerFlashLight = TIMER_FLASH_OF_LIGHT + rand()%(TIMER_FLASH_OF_LIGHT); - } - else - timerFlashLight -= diff; - } - } - - if (spellJustice) { - if (timerJustice < diff) - { - DoCast(m_creature, SPELL_SEAL_OF_JUSTICE); - timerJustice = TIMER_SEAL_OF_JUSTICE + rand()%(TIMER_SEAL_OF_JUSTICE); - } - else - timerJustice -= diff; - } - - if (spellJudLight) { - if (timerJudLight < diff) { - DoCast(m_creature, SPELL_JUDGEMENT_OF_LIGHT); - timerJudLight = TIMER_JUDGEMENT_OF_LIGHT + rand()%(TIMER_JUDGEMENT_OF_LIGHT); - } - else - timerJudLight -= diff; - } - - if (spellCommand) { - if (timerCommand < diff) { - DoCast(m_creature, TIMER_SEAL_OF_COMMAND); - timerCommand = TIMER_SEAL_OF_COMMAND + rand()%(TIMER_SEAL_OF_COMMAND); - } - else - timerCommand -= diff; - } - - DoMeleeAttackIfReady(); - } - - void Activate(uint64 summonerguid); - void KilledUnit(Unit* Killed); - void JustDied(Unit* Killer); - -}; - -/*###### -## npc_second_trial_controller -######*/ - -struct TRINITY_DLL_DECL master_kelerun_bloodmournAI : public ScriptedAI -{ - master_kelerun_bloodmournAI(Creature *c) : ScriptedAI(c) {} - - uint8 questPhase; - uint8 paladinPhase; - uint32 timer; - - uint64 paladinGuid[4]; - - void Reset() { - - questPhase = 0; - timer = 60000; - paladinPhase = 0; - uint64 paladinGuid[] = {0,0,0,0}; - - } - - void EnterCombat(Unit *who) {} - - void UpdateAI(const uint32 diff) - { - // Quest accepted but object not activated, object despawned (if in sync 1 minute!) - if (questPhase == 1) { - if (timer < diff) Reset(); - else timer -= diff; - } - // fight the 4 paladin mobs phase - else if (questPhase == 2) { - - if (timer < diff) { - - Creature* paladinSpawn; - paladinSpawn = (Unit::GetCreature((*m_creature), paladinGuid[paladinPhase])); - if (paladinSpawn) { - CAST_AI(npc_secondTrialAI, paladinSpawn->AI())->Activate(m_creature->GetGUID()); - - switch(paladinPhase) { - case 0: - DoScriptText(TEXT_SECOND_TRIAL_1,m_creature); - break; - case 1: - DoScriptText(TEXT_SECOND_TRIAL_2,m_creature); - break; - case 2: - DoScriptText(TEXT_SECOND_TRIAL_3,m_creature); - break; - case 3: - DoScriptText(TEXT_SECOND_TRIAL_4,m_creature); - break; - } - } - else - Reset(); - - questPhase=4; - timer = OFFSET_NEXT_ATTACK; - } - else timer -= diff; - } - - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - - void StartEvent() - { - - if (questPhase == 1) { // no player check, quest can be finished as group, so no complex PlayerGUID/group search code - - for (int i = 0; i<4; ++i) { - Creature* Summoned; - Summoned = DoSpawnCreature(PaladinEntry[i], SpawnPosition[i].x, SpawnPosition[i].y, SpawnPosition[i].z, SpawnPosition[i].o, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 180000); - - if (Summoned) - paladinGuid[i] = Summoned->GetGUID(); - } - - timer = OFFSET_NEXT_ATTACK; - questPhase = 2; - } - } - - void SecondTrialKill(); - void SummonedCreatureDespawn(Creature* c) {} -}; - - -bool GossipHello_master_kelerun_bloodmourn(Player* pPlayer, Creature* pCreature) -{ - // quest only available if not already started - // Quest_template flag is set to : QUEST_FLAGS_EVENT - // Escort quests or any other event-driven quests. If player in party, all players that can accept this quest will receive confirmation box to accept quest. - // !not sure if this really works! - - if (CAST_AI(master_kelerun_bloodmournAI, pCreature->AI())->questPhase == 0) { - pPlayer->PrepareQuestMenu(pCreature->GetGUID()); - pPlayer->SendPreparedQuest(pCreature->GetGUID()); - } - - pPlayer->SEND_GOSSIP_MENU(pCreature->GetEntry(), pCreature->GetGUID()); - return true; -} - -bool QuestAccept_master_kelerun_bloodmourn(Player* pPlayer, Creature* pCreature, Quest const *quest) -{ - // One Player exclusive quest, wait for user go activation - if (quest->GetQuestId() == QUEST_SECOND_TRIAL) - CAST_AI(master_kelerun_bloodmournAI, pCreature->AI())->questPhase = 1; - - return true; -} - -void master_kelerun_bloodmournAI::SecondTrialKill() { - - if (questPhase > 0) { - - ++paladinPhase; - - if (paladinPhase < 4) - questPhase=2; - else - Reset(); // Quest Complete, QuestComplete handler is in npc_secondTrialAI::JustDied - } - } - -void npc_secondTrialAI::JustDied(Unit* Killer) { - - if (Killer->GetTypeId() == TYPEID_PLAYER) - { - Creature* Summoner; - Summoner = (Unit::GetCreature((*m_creature), summonerGuid)); - - if (Summoner) - CAST_AI(master_kelerun_bloodmournAI, Summoner->AI())->SecondTrialKill(); - - // last kill quest complete for group - if (m_creature->GetEntry() == CHAMPION_SUNSTRIKER) { - - if (Group *pGroup = CAST_PLR(Killer)->GetGroup()) - { - for(GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next()) - { - Player *pGroupGuy = itr->getSource(); - - // for any leave or dead (with not released body) group member at appropriate distance - if (pGroupGuy && pGroupGuy->IsAtGroupRewardDistance(m_creature) && !pGroupGuy->GetCorpse() && pGroupGuy->GetQuestStatus(QUEST_SECOND_TRIAL) == QUEST_STATUS_INCOMPLETE) - pGroupGuy->CompleteQuest(QUEST_SECOND_TRIAL); - } - } - else { - if (CAST_PLR(Killer)->GetQuestStatus(QUEST_SECOND_TRIAL) == QUEST_STATUS_INCOMPLETE) - CAST_PLR(Killer)->CompleteQuest(QUEST_SECOND_TRIAL); - } - } - } - } - -void npc_secondTrialAI::KilledUnit(Unit* Killed) { - - if (Killed->GetTypeId() == TYPEID_PLAYER) { - - if (CAST_PLR(Killed)->GetQuestStatus(QUEST_SECOND_TRIAL) == QUEST_STATUS_INCOMPLETE) - CAST_PLR(Killed)->FailQuest(QUEST_SECOND_TRIAL); - } -} - -void npc_secondTrialAI::Activate(uint64 summonerguid) { - - questPhase=1; - summonerGuid = summonerguid; - } - -CreatureAI* GetAI_master_kelerun_bloodmourn(Creature* pCreature) -{ - return new master_kelerun_bloodmournAI (pCreature); -} - -CreatureAI* GetAI_npc_secondTrial(Creature* pCreature) -{ - return new npc_secondTrialAI (pCreature); -} - -/*###### -## go_second_trial -######*/ - -bool GOHello_go_second_trial(Player* pPlayer, GameObject* pGO) -{ - // find spawn :: master_kelerun_bloodmourn - if (Creature* pCreature = pGO->FindNearestCreature(MASTER_KELERUN_BLOODMOURN, 30.0f)) - CAST_AI(master_kelerun_bloodmournAI, pCreature->AI())->StartEvent(); - - return true; -} - -/*###### -## npc_apprentice_mirveda -######*/ - -#define QUEST_UNEXPECTED_RESULT 8488 -#define MOB_GHARZUL 15958 -#define MOB_ANGERSHADE 15656 - -struct TRINITY_DLL_DECL npc_apprentice_mirvedaAI : public ScriptedAI -{ - npc_apprentice_mirvedaAI(Creature* c) : ScriptedAI(c), Summons(m_creature) {} - - uint32 KillCount; - uint64 PlayerGUID; - bool Summon; - SummonList Summons; - - void Reset() - { - KillCount = 0; - PlayerGUID = 0; - Summons.DespawnAll(); - Summon = false; - } - - void EnterCombat(Unit* who){} - - void JustSummoned(Creature *summoned) - { - summoned->AI()->AttackStart(m_creature); - Summons.Summon(summoned); - } - - void SummonedCreatureDespawn(Creature* summoned) - { - Summons.Despawn(summoned); - ++KillCount; - } - - void JustDied(Unit* killer) - { - if (PlayerGUID) - { - Player* pPlayer = Unit::GetPlayer(PlayerGUID); - if (pPlayer) - CAST_PLR(pPlayer)->FailQuest(QUEST_UNEXPECTED_RESULT); - } - } - - void UpdateAI(const uint32 diff) - { - if (KillCount >= 3) - { - if (PlayerGUID) - { - Player* pPlayer = Unit::GetPlayer(PlayerGUID); - if (pPlayer) - CAST_PLR(pPlayer)->CompleteQuest(QUEST_UNEXPECTED_RESULT); - } - } - - if (Summon) - { - m_creature->SummonCreature(MOB_GHARZUL, 8745, -7134.32, 35.22, 0, TEMPSUMMON_CORPSE_DESPAWN, 4000); - m_creature->SummonCreature(MOB_ANGERSHADE, 8745, -7134.32, 35.22, 0, TEMPSUMMON_CORPSE_DESPAWN, 4000); - m_creature->SummonCreature(MOB_ANGERSHADE, 8745, -7134.32, 35.22, 0, TEMPSUMMON_CORPSE_DESPAWN, 4000); - Summon = false; - } - } -}; - -bool QuestAccept_npc_apprentice_mirveda(Player* pPlayer, Creature* pCreature, Quest const* quest) -{ - if (quest->GetQuestId() == QUEST_UNEXPECTED_RESULT) - { - CAST_AI(npc_apprentice_mirvedaAI, pCreature->AI())->Summon = true; - CAST_AI(npc_apprentice_mirvedaAI, pCreature->AI())->PlayerGUID = pPlayer->GetGUID(); - } - return true; -} - -CreatureAI* GetAI_npc_apprentice_mirvedaAI(Creature* pCreature) -{ - return new npc_apprentice_mirvedaAI (pCreature); -} - -/*###### -## npc_infused_crystal -######*/ - -#define MOB_ENRAGED_WRAITH 17086 -#define EMOTE -1000283 -#define QUEST_POWERING_OUR_DEFENSES 8490 - -struct Location -{ - float x, y, z; -}; - -static Location SpawnLocations[]= -{ - {8270.68, -7188.53, 139.619}, - {8284.27, -7187.78, 139.603}, - {8297.43, -7193.53, 139.603}, - {8303.5, -7201.96, 139.577}, - {8273.22, -7241.82, 139.382}, - {8254.89, -7222.12, 139.603}, - {8278.51, -7242.13, 139.162}, - {8267.97, -7239.17, 139.517} -}; - -struct TRINITY_DLL_DECL npc_infused_crystalAI : public Scripted_NoMovementAI -{ - npc_infused_crystalAI(Creature* c) : Scripted_NoMovementAI(c) {} - - uint32 EndTimer; - uint32 WaveTimer; - bool Completed; - bool Progress; - uint64 PlayerGUID; - - void Reset() - { - EndTimer = 0; - Completed = false; - Progress = false; - PlayerGUID = 0; - WaveTimer = 0; - } - - void MoveInLineOfSight(Unit* who) - { - if (!Progress && who->GetTypeId() == TYPEID_PLAYER && m_creature->IsWithinDistInMap(who, 10.0f)) - { - if (CAST_PLR(who)->GetQuestStatus(QUEST_POWERING_OUR_DEFENSES) == QUEST_STATUS_INCOMPLETE) - { - PlayerGUID = who->GetGUID(); - WaveTimer = 1000; - EndTimer = 60000; - Progress = true; - } - } - } - - void JustSummoned(Creature *summoned) - { - summoned->AI()->AttackStart(m_creature); - } - - void JustDied(Unit* killer) - { - if (PlayerGUID && !Completed) - { - Player* pPlayer = Unit::GetPlayer(PlayerGUID); - if (pPlayer) - CAST_PLR(pPlayer)->FailQuest(QUEST_POWERING_OUR_DEFENSES); - } - } - - void UpdateAI(const uint32 diff) - { - if (EndTimer < diff && Progress) - { - DoScriptText(EMOTE, m_creature); - Completed = true; - if (PlayerGUID) - { - Player* pPlayer = Unit::GetPlayer(PlayerGUID); - if (pPlayer) - CAST_PLR(pPlayer)->CompleteQuest(QUEST_POWERING_OUR_DEFENSES); - } - m_creature->DealDamage(m_creature,m_creature->GetHealth(),NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - m_creature->RemoveCorpse(); - }else EndTimer -= diff; - - if (WaveTimer < diff && !Completed && Progress) - { - uint32 ran1 = rand()%8; - uint32 ran2 = rand()%8; - uint32 ran3 = rand()%8; - m_creature->SummonCreature(MOB_ENRAGED_WRAITH, SpawnLocations[ran1].x, SpawnLocations[ran1].y, SpawnLocations[ran1].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000); - m_creature->SummonCreature(MOB_ENRAGED_WRAITH, SpawnLocations[ran2].x, SpawnLocations[ran2].y, SpawnLocations[ran2].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000); - m_creature->SummonCreature(MOB_ENRAGED_WRAITH, SpawnLocations[ran3].x, SpawnLocations[ran3].y, SpawnLocations[ran3].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000); - WaveTimer = 30000; - }else WaveTimer -= diff; - } -}; - -CreatureAI* GetAI_npc_infused_crystalAI(Creature* pCreature) -{ - return new npc_infused_crystalAI (pCreature); -} - -void AddSC_eversong_woods() -{ - Script *newscript; - - newscript = new Script; - newscript->Name= "npc_prospector_anvilward"; - newscript->GetAI = &GetAI_npc_prospector_anvilward; - newscript->pGossipHello = &GossipHello_npc_prospector_anvilward; - newscript->pGossipSelect = &GossipSelect_npc_prospector_anvilward; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_second_trial_controller"; - newscript->GetAI = &GetAI_master_kelerun_bloodmourn; - newscript->pGossipHello = &GossipHello_master_kelerun_bloodmourn; - newscript->pQuestAccept = &QuestAccept_master_kelerun_bloodmourn; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_second_trial_paladin"; - newscript->GetAI = &GetAI_npc_secondTrial; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="go_second_trial"; - newscript->pGOHello = &GOHello_go_second_trial; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "npc_apprentice_mirveda"; - newscript->GetAI = &GetAI_npc_apprentice_mirvedaAI; - newscript->pQuestAccept = &QuestAccept_npc_apprentice_mirveda; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "npc_infused_crystal"; - newscript->GetAI = &GetAI_npc_infused_crystalAI; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/felwood/felwood.cpp b/src/bindings/scripts/scripts/zone/felwood/felwood.cpp deleted file mode 100644 index 29c25afd821..00000000000 --- a/src/bindings/scripts/scripts/zone/felwood/felwood.cpp +++ /dev/null @@ -1,90 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Felwood -SD%Complete: 95 -SDComment: Quest support: 4101, 4102 -SDCategory: Felwood -EndScriptData */ - -/* ContentData -npcs_riverbreeze_and_silversky -EndContentData */ - -#include "precompiled.h" - -/*###### -## npcs_riverbreeze_and_silversky -######*/ - -#define GOSSIP_ITEM_BEACON "Please make me a Cenarion Beacon" - -bool GossipHello_npcs_riverbreeze_and_silversky(Player* pPlayer, Creature* pCreature) -{ - uint32 eCreature = pCreature->GetEntry(); - - if (pCreature->isQuestGiver()) - pPlayer->PrepareQuestMenu(pCreature->GetGUID()); - - if (eCreature==9528) - { - if (pPlayer->GetQuestRewardStatus(4101)) - { - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BEACON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - pPlayer->SEND_GOSSIP_MENU(2848, pCreature->GetGUID()); - }else if (pPlayer->GetTeam()==HORDE) - pPlayer->SEND_GOSSIP_MENU(2845, pCreature->GetGUID()); - else - pPlayer->SEND_GOSSIP_MENU(2844, pCreature->GetGUID()); - } - - if (eCreature==9529) - { - if (pPlayer->GetQuestRewardStatus(4102)) - { - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BEACON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - pPlayer->SEND_GOSSIP_MENU(2849, pCreature->GetGUID()); - }else if (pPlayer->GetTeam() == ALLIANCE) - pPlayer->SEND_GOSSIP_MENU(2843, pCreature->GetGUID()); - else - pPlayer->SEND_GOSSIP_MENU(2842, pCreature->GetGUID()); - } - - return true; -} - -bool GossipSelect_npcs_riverbreeze_and_silversky(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - if (uiAction ==GOSSIP_ACTION_INFO_DEF+1) - { - pPlayer->CLOSE_GOSSIP_MENU(); - pCreature->CastSpell(pPlayer, 15120, false); - } - return true; -} - -void AddSC_felwood() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="npcs_riverbreeze_and_silversky"; - newscript->pGossipHello = &GossipHello_npcs_riverbreeze_and_silversky; - newscript->pGossipSelect = &GossipSelect_npcs_riverbreeze_and_silversky; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/feralas/feralas.cpp b/src/bindings/scripts/scripts/zone/feralas/feralas.cpp deleted file mode 100644 index 83c9516d738..00000000000 --- a/src/bindings/scripts/scripts/zone/feralas/feralas.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 -SDName: Feralas -SD%Complete: 100 -SDComment: Quest support: 3520, 2767, Special vendor Gregan Brewspewer -SDCategory: Feralas -EndScriptData */ - -#include "precompiled.h" -#include "../../npc/npc_escortAI.h" - -/*###### -## npc_gregan_brewspewer -######*/ - -#define GOSSIP_HELLO "Buy somethin', will ya?" - -bool GossipHello_npc_gregan_brewspewer(Player* pPlayer, Creature* pCreature) -{ - if (pCreature->isQuestGiver()) - pPlayer->PrepareQuestMenu(pCreature->GetGUID()); - - if (pCreature->isVendor() && pPlayer->GetQuestStatus(3909) == QUEST_STATUS_INCOMPLETE) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - - pPlayer->SEND_GOSSIP_MENU(2433, pCreature->GetGUID()); - return true; -} - -bool GossipSelect_npc_gregan_brewspewer(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) - { - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); - pPlayer->SEND_GOSSIP_MENU(2434, pCreature->GetGUID()); - } - if (uiAction == GOSSIP_ACTION_TRADE) - pPlayer->SEND_VENDORLIST(pCreature->GetGUID()); - return true; -} - -/*###### -## npc_oox22fe -######*/ - -enum -{ - SAY_START = -1060000, - SAY_AGGRO = -1060001, - SAY_AGGRO2 = -1060002, - SAY_AMBUSH = -1060003, - SAY_END = -1060005, - - NPC_YETI = 7848, - NPC_GORILLA = 5260, - NPC_WOODPAW_REAVER = 5255, - NPC_WOODPAW_BRUTE = 5253, - NPC_WOODPAW_ALPHA = 5258, - NPC_WOODPAW_MYSTIC = 5254, - - QUEST_RESCUE_OOX22FE = 2767, - FACTION_ESCORTEE_A = 774, - FACTION_ESCORTEE_H = 775 -}; - -struct TRINITY_DLL_DECL npc_oox22feAI : public npc_escortAI -{ - npc_oox22feAI(Creature* pCreature) : npc_escortAI(pCreature) { } - - void WaypointReached(uint32 i) - { - switch (i) - { - // First Ambush(3 Yetis) - case 11: - DoScriptText(SAY_AMBUSH,m_creature); - m_creature->SummonCreature(NPC_YETI, -4841.01, 1593.91, 73.42, 3.98, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); - m_creature->SummonCreature(NPC_YETI, -4837.61, 1568.58, 78.21, 3.13, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); - m_creature->SummonCreature(NPC_YETI, -4841.89, 1569.95, 76.53, 0.68, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); - break; - //Second Ambush(3 Gorillas) - case 21: - DoScriptText(SAY_AMBUSH,m_creature); - m_creature->SummonCreature(NPC_GORILLA, -4595.81, 2005.99, 53.08, 3.74, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); - m_creature->SummonCreature(NPC_GORILLA, -4597.53, 2008.31, 52.70, 3.78, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); - m_creature->SummonCreature(NPC_GORILLA, -4599.37, 2010.59, 52.77, 3.84, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); - break; - //Third Ambush(4 Gnolls) - case 30: - DoScriptText(SAY_AMBUSH,m_creature); - m_creature->SummonCreature(NPC_WOODPAW_REAVER, -4425.14, 2075.87, 47.77, 3.77, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); - m_creature->SummonCreature(NPC_WOODPAW_BRUTE , -4426.68, 2077.98, 47.57, 3.77, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); - m_creature->SummonCreature(NPC_WOODPAW_MYSTIC, -4428.33, 2080.24, 47.43, 3.87, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); - m_creature->SummonCreature(NPC_WOODPAW_ALPHA , -4430.04, 2075.54, 46.83, 3.81, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); - break; - case 37: - DoScriptText(SAY_END,m_creature); - // Award quest credit - if (Player* pPlayer = Unit::GetPlayer(PlayerGUID)) - { - pPlayer->GroupEventHappens(QUEST_RESCUE_OOX22FE, m_creature); - } - break; - } - } - - void Reset() - { - if (!IsBeingEscorted) - m_creature->SetStandState(UNIT_STAND_STATE_DEAD); - } - - void EnterCombat(Unit* who) - { - //For an small probability the npc says something when he get aggro - switch(rand()%10) - { - case 0: DoScriptText(SAY_AGGRO,m_creature); break; - case 1: DoScriptText(SAY_AGGRO2,m_creature); break; - } - } - - void JustSummoned(Creature* summoned) - { - summoned->AI()->AttackStart(m_creature); - } -}; - -CreatureAI* GetAI_npc_oox22fe(Creature* pCreature) -{ - npc_oox22feAI* oox22AI = new npc_oox22feAI(pCreature); - - oox22AI->FillPointMovementListForCreature(); - - return oox22AI; -} - -bool QuestAccept_npc_oox22fe(Player* pPlayer, Creature* pCreature, const Quest* pQuest) -{ - if (pQuest->GetQuestId() == QUEST_RESCUE_OOX22FE) - { - DoScriptText(SAY_START, pCreature); - //change that the npc is not lying dead on the ground - pCreature->SetStandState(UNIT_STAND_STATE_STAND); - - if (pPlayer->GetTeam() == ALLIANCE) - pCreature->setFaction(FACTION_ESCORTEE_A); - - if (pPlayer->GetTeam() == HORDE) - pCreature->setFaction(FACTION_ESCORTEE_H); - - if (npc_escortAI* pEscortAI = CAST_AI(npc_oox22feAI, pCreature->AI())) - pEscortAI->Start(true, false, pPlayer->GetGUID()); - - } - return true; -} - -/*###### -## npc_screecher_spirit -######*/ - -bool GossipHello_npc_screecher_spirit(Player* pPlayer, Creature* pCreature) -{ - pPlayer->SEND_GOSSIP_MENU(2039, pCreature->GetGUID()); - pPlayer->TalkedToCreature(pCreature->GetEntry(), pCreature->GetGUID()); - pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - - return true; -} - -/*###### -## AddSC -######*/ - -void AddSC_feralas() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="npc_gregan_brewspewer"; - newscript->pGossipHello = &GossipHello_npc_gregan_brewspewer; - newscript->pGossipSelect = &GossipSelect_npc_gregan_brewspewer; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "npc_oox22fe"; - newscript->GetAI = &GetAI_npc_oox22fe; - newscript->pQuestAccept = &QuestAccept_npc_oox22fe; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_screecher_spirit"; - newscript->pGossipHello = &GossipHello_npc_screecher_spirit; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/ghostlands/ghostlands.cpp b/src/bindings/scripts/scripts/zone/ghostlands/ghostlands.cpp deleted file mode 100644 index be04a56c23a..00000000000 --- a/src/bindings/scripts/scripts/zone/ghostlands/ghostlands.cpp +++ /dev/null @@ -1,277 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Ghostlands -SD%Complete: 100 -SDComment: Quest support: 9692, 9212. Obtain Budd's Guise of Zul'aman. Vendor Rathis Tomber -SDCategory: Ghostlands -EndScriptData */ - -/* ContentData -npc_blood_knight_dawnstar -npc_budd_nedreck -npc_rathis_tomber -npc_ranger_lilatha -EndContentData */ - -#include "precompiled.h" -#include "../../npc/npc_escortAI.h" - -/*###### -## npc_blood_knight_dawnstar -######*/ - -#define GOSSIP_H_BKD "Take Blood Knight Insignia" - -bool GossipHello_npc_blood_knight_dawnstar(Player* pPlayer, Creature* pCreature) -{ - if (pPlayer->GetQuestStatus(9692) == QUEST_STATUS_INCOMPLETE && !pPlayer->HasItemCount(24226,1,true)) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_H_BKD, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - - pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); - - return true; -} - -bool GossipSelect_npc_blood_knight_dawnstar(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, 24226, 1, false); - if (msg == EQUIP_ERR_OK) - { - pPlayer->StoreNewItem(dest, 24226, 1, true); - pPlayer->PlayerTalkClass->ClearMenus(); - } - } - return true; -} - -/*###### -## npc_budd_nedreck -######*/ - -#define GOSSIP_HBN "You gave the crew disguises?" - -bool GossipHello_npc_budd_nedreck(Player* pPlayer, Creature* pCreature) -{ - if (pCreature->isQuestGiver()) - pPlayer->PrepareQuestMenu(pCreature->GetGUID()); - - if (pPlayer->GetQuestStatus(11166) == QUEST_STATUS_INCOMPLETE) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HBN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - - pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); - return true; -} - -bool GossipSelect_npc_budd_nedreck(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - if (uiAction == GOSSIP_ACTION_INFO_DEF) - { - pPlayer->CLOSE_GOSSIP_MENU(); - pCreature->CastSpell(pPlayer, 42540, false); - } - return true; -} - -/*###### -## npc_rathis_tomber -######*/ - -bool GossipHello_npc_rathis_tomber(Player* pPlayer, Creature* pCreature) -{ - if (pCreature->isQuestGiver()) - pPlayer->PrepareQuestMenu(pCreature->GetGUID()); - - if (pCreature->isVendor() && pPlayer->GetQuestRewardStatus(9152)) - { - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); - pPlayer->SEND_GOSSIP_MENU(8432, pCreature->GetGUID()); - }else - pPlayer->SEND_GOSSIP_MENU(8431, pCreature->GetGUID()); - - return true; -} - -bool GossipSelect_npc_rathis_tomber(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - if (uiAction == GOSSIP_ACTION_TRADE) - pPlayer->SEND_VENDORLIST(pCreature->GetGUID()); - return true; -} - -/*##### -## go_gilded_brazier (Paladin First Trail quest (9678)) -#####*/ - -bool GOHello_gilded_brazier(Player* pPlayer, GameObject* pGo) -{ - if (pPlayer->GetQuestStatus(9678) == QUEST_STATUS_INCOMPLETE) - { - Creature *Stillblade = pPlayer->SummonCreature(17716, 8106.11, -7542.06, 151.775, 3.02598, TEMPSUMMON_DEAD_DESPAWN, 60000); - if (Stillblade) - (Stillblade->AI())->AttackStart(pPlayer); - } - return true; -}; - -/*###### -## npc_ranger_lilatha -######*/ - -enum -{ - SAY_START = -1000140, - SAY_PROGRESS1 = -1000141, - SAY_PROGRESS2 = -1000142, - SAY_PROGRESS3 = -1000143, - SAY_END1 = -1000144, - SAY_END2 = -1000145, - SAY_CAPTAIN_ANSWER = -1000146, - - QUEST_ESCAPE_FROM_THE_CATACOMBS = 9212, - GO_CAGE = 181152, - NPC_CAPTAIN_HELIOS = 16220, - FACTION_SMOON_E = 1603, -}; - -struct TRINITY_DLL_DECL npc_ranger_lilathaAI : public npc_escortAI -{ - npc_ranger_lilathaAI(Creature *c) : npc_escortAI(c) {} - - std::list CageList; - - void WaypointReached(uint32 i) - { - Player* pPlayer = Unit::GetPlayer(PlayerGUID); - - if (!pPlayer) - return; - - switch(i) - { - case 0: - { - m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); - if (GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 20)) - Cage->SetGoState(GO_STATE_ACTIVE); - DoScriptText(SAY_START, m_creature, pPlayer); - break; - } - case 5: - DoScriptText(SAY_PROGRESS1, m_creature, pPlayer); - case 11: - DoScriptText(SAY_PROGRESS2, m_creature, pPlayer); - m_creature->SetOrientation(4.762841); - break; - case 18: - { - DoScriptText(SAY_PROGRESS3, m_creature, pPlayer); - Creature* Summ1 = m_creature->SummonCreature(16342, 7627.083984, -7532.538086, 152.128616, 1.082733, TEMPSUMMON_DEAD_DESPAWN, 0); - Creature* Summ2 = m_creature->SummonCreature(16343, 7620.432129, -7532.550293, 152.454865, 0.827478, TEMPSUMMON_DEAD_DESPAWN, 0); - if (Summ1 && Summ2) - { - Summ1->Attack(m_creature, true); - Summ2->Attack(pPlayer, true); - } - m_creature->AI()->AttackStart(Summ1); - break; - } - case 19: m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); break; - case 25: m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); break; - case 30: - if (pPlayer && pPlayer->GetTypeId() == TYPEID_PLAYER) - CAST_PLR(pPlayer)->GroupEventHappens(QUEST_ESCAPE_FROM_THE_CATACOMBS,m_creature); - break; - case 32: - m_creature->SetOrientation(2.978281); - DoScriptText(SAY_END1, m_creature, pPlayer); - break; - case 33: - m_creature->SetOrientation(5.858011); - DoScriptText(SAY_END2, m_creature, pPlayer); - Unit* CaptainHelios = me->FindNearestCreature(NPC_CAPTAIN_HELIOS, 50); - if (CaptainHelios) - DoScriptText(SAY_CAPTAIN_ANSWER, CaptainHelios, pPlayer); - break; - } - } - - void Reset() - { - if (GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 20)) - Cage->SetGoState(GO_STATE_READY); - } -}; - -bool QuestAccept_npc_ranger_lilatha(Player* pPlayer, Creature* pCreature, Quest const* quest) -{ - if (quest->GetQuestId() == QUEST_ESCAPE_FROM_THE_CATACOMBS) - { - pCreature->setFaction(113); - - if (npc_escortAI* pEscortAI = CAST_AI(npc_ranger_lilathaAI, pCreature->AI())) - pEscortAI->Start(true, false, pPlayer->GetGUID()); - } - return true; -} - -CreatureAI* GetAI_npc_ranger_lilathaAI(Creature* pCreature) -{ - npc_ranger_lilathaAI* ranger_lilathaAI = new npc_ranger_lilathaAI(pCreature); - - ranger_lilathaAI->FillPointMovementListForCreature(); - - return ranger_lilathaAI; -} - -void AddSC_ghostlands() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="npc_blood_knight_dawnstar"; - newscript->pGossipHello = &GossipHello_npc_blood_knight_dawnstar; - newscript->pGossipSelect = &GossipSelect_npc_blood_knight_dawnstar; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_budd_nedreck"; - newscript->pGossipHello = &GossipHello_npc_budd_nedreck; - newscript->pGossipSelect = &GossipSelect_npc_budd_nedreck; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_rathis_tomber"; - newscript->pGossipHello = &GossipHello_npc_rathis_tomber; - newscript->pGossipSelect = &GossipSelect_npc_rathis_tomber; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "go_gilded_brazier"; - newscript->pGOHello = &GOHello_gilded_brazier; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "npc_ranger_lilatha"; - newscript->GetAI = &GetAI_npc_ranger_lilathaAI; - newscript->pQuestAccept = &QuestAccept_npc_ranger_lilatha; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/grizzly_hills/grizzly_hills.cpp b/src/bindings/scripts/scripts/zone/grizzly_hills/grizzly_hills.cpp deleted file mode 100644 index 976122cd296..00000000000 --- a/src/bindings/scripts/scripts/zone/grizzly_hills/grizzly_hills.cpp +++ /dev/null @@ -1,126 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Grizzly_Hills -SD%Complete: 80 -SDComment: Quest support: 12247 -SDCategory: Grizzly Hills -EndScriptData */ - -/* ContentData -npc_orsonn_and_kodian -EndContentData */ - -#include "precompiled.h" - -#define GOSSIP_ITEM1 "You're free to go Orsonn, but first tell me what's wrong with the furbolg." -#define GOSSIP_ITEM2 "What happened then?" -#define GOSSIP_ITEM3 "Thank you, Son of Ursoc. I'll see what can be done." -#define GOSSIP_ITEM4 "Who was this stranger?" -#define GOSSIP_ITEM5 "Thank you, Kodian. I'll do what I can." - -enum -{ - GOSSIP_TEXTID_ORSONN1 = 12793, - GOSSIP_TEXTID_ORSONN2 = 12794, - GOSSIP_TEXTID_ORSONN3 = 12796, - - GOSSIP_TEXTID_KODIAN1 = 12797, - GOSSIP_TEXTID_KODIAN2 = 12798, - - NPC_ORSONN = 27274, - NPC_KODIAN = 27275, - - //trigger creatures - NPC_ORSONN_CREDIT = 27322, - NPC_KODIAN_CREDIT = 27321, - - QUEST_CHILDREN_OF_URSOC = 12247 -}; - -bool GossipHello_npc_orsonn_and_kodian(Player* pPlayer, Creature* pCreature) -{ - if (pCreature->isQuestGiver()) - pPlayer->PrepareQuestMenu(pCreature->GetGUID()); - - if (pPlayer->GetQuestStatus(QUEST_CHILDREN_OF_URSOC) == QUEST_STATUS_INCOMPLETE) - { - switch(pCreature->GetEntry()) - { - case NPC_ORSONN: - if (!pPlayer->GetReqKillOrCastCurrentCount(QUEST_CHILDREN_OF_URSOC, NPC_ORSONN_CREDIT)) - { - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_ORSONN1, pCreature->GetGUID()); - return true; - } - break; - case NPC_KODIAN: - if (!pPlayer->GetReqKillOrCastCurrentCount(QUEST_CHILDREN_OF_URSOC, NPC_KODIAN_CREDIT)) - { - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4); - pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_KODIAN1, pCreature->GetGUID()); - return true; - } - break; - } - } - - pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); - return true; -} - -bool GossipSelect_npc_orsonn_and_kodian(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - switch(uiAction) - { - case GOSSIP_ACTION_INFO_DEF+1: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_ORSONN2, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+2: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); - pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_ORSONN3, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+3: - pPlayer->CLOSE_GOSSIP_MENU(); - pPlayer->TalkedToCreature(NPC_ORSONN_CREDIT, pCreature->GetGUID()); - break; - - case GOSSIP_ACTION_INFO_DEF+4: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5); - pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_KODIAN2, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+5: - pPlayer->CLOSE_GOSSIP_MENU(); - pPlayer->TalkedToCreature(NPC_KODIAN_CREDIT, pCreature->GetGUID()); - break; - } - - return true; -} - -void AddSC_grizzly_hills() -{ - Script* newscript; - - newscript = new Script; - newscript->Name = "npc_orsonn_and_kodian"; - newscript->pGossipHello = &GossipHello_npc_orsonn_and_kodian; - newscript->pGossipSelect = &GossipSelect_npc_orsonn_and_kodian; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/hellfire_peninsula/boss_doomlord_kazzak.cpp b/src/bindings/scripts/scripts/zone/hellfire_peninsula/boss_doomlord_kazzak.cpp deleted file mode 100644 index 054f1d41ee0..00000000000 --- a/src/bindings/scripts/scripts/zone/hellfire_peninsula/boss_doomlord_kazzak.cpp +++ /dev/null @@ -1,183 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 .sourceforge.net/> - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Doomlord_Kazzak -SD%Complete: 70 -SDComment: Using incorrect spell for Mark of Kazzak -SDCategory: Hellfire Peninsula -EndScriptData */ - -#include "precompiled.h" - -#define SAY_INTRO -1000375 -#define SAY_AGGRO1 -1000376 -#define SAY_AGGRO2 -1000377 -#define SAY_SURPREME1 -1000378 -#define SAY_SURPREME2 -1000379 -#define SAY_KILL1 -1000380 -#define SAY_KILL2 -1000381 -#define SAY_KILL3 -1000382 -#define SAY_DEATH -1000383 -#define EMOTE_FRENZY -1000384 -#define SAY_RAND1 -1000385 -#define SAY_RAND2 -1000386 - -#define SPELL_SHADOWVOLLEY 32963 -#define SPELL_CLEAVE 31779 -#define SPELL_THUNDERCLAP 36706 -#define SPELL_VOIDBOLT 39329 -#define SPELL_MARKOFKAZZAK 32960 -#define SPELL_ENRAGE 32964 -#define SPELL_CAPTURESOUL 32966 -#define SPELL_TWISTEDREFLECTION 21063 - -struct TRINITY_DLL_DECL boss_doomlordkazzakAI : public ScriptedAI -{ - boss_doomlordkazzakAI(Creature *c) : ScriptedAI(c) {} - - uint32 ShadowVolley_Timer; - uint32 Cleave_Timer; - uint32 ThunderClap_Timer; - uint32 VoidBolt_Timer; - uint32 MarkOfKazzak_Timer; - uint32 Enrage_Timer; - uint32 Twisted_Reflection_Timer; - - void Reset() - { - ShadowVolley_Timer = 6000 + rand()%4000; - Cleave_Timer = 7000; - ThunderClap_Timer = 14000 + rand()%4000; - VoidBolt_Timer = 30000; - MarkOfKazzak_Timer = 25000; - Enrage_Timer = 60000; - Twisted_Reflection_Timer = 33000; // Timer may be incorrect - } - - void JustRespawned() - { - DoScriptText(SAY_INTRO, m_creature); - } - - 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) - { - // When Kazzak kills a player (not pets/totems), he regens some health - if (victim->GetTypeId() != TYPEID_PLAYER) - return; - - DoCast(m_creature,SPELL_CAPTURESOUL); - - 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) - { - DoScriptText(SAY_DEATH, m_creature); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //ShadowVolley_Timer - if (ShadowVolley_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_SHADOWVOLLEY); - ShadowVolley_Timer = 4000 + rand()%2000; - }else ShadowVolley_Timer -= diff; - - //Cleave_Timer - if (Cleave_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_CLEAVE); - Cleave_Timer = 8000 + rand()%4000; - }else Cleave_Timer -= diff; - - //ThunderClap_Timer - if (ThunderClap_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_THUNDERCLAP); - ThunderClap_Timer = 10000 + rand()%4000; - }else ThunderClap_Timer -= diff; - - //VoidBolt_Timer - if (VoidBolt_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_VOIDBOLT); - VoidBolt_Timer = 15000 + rand()%3000; - }else VoidBolt_Timer -= diff; - - //MarkOfKazzak_Timer - if (MarkOfKazzak_Timer < diff) - { - Unit* victim = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (victim->GetPower(POWER_MANA)) - { - DoCast(victim, SPELL_MARKOFKAZZAK); - MarkOfKazzak_Timer = 20000; - } - }else MarkOfKazzak_Timer -= diff; - - //Enrage_Timer - if (Enrage_Timer < diff) - { - DoScriptText(EMOTE_FRENZY, m_creature); - DoCast(m_creature,SPELL_ENRAGE); - Enrage_Timer = 30000; - }else Enrage_Timer -= diff; - - if (Twisted_Reflection_Timer < diff) - { - DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_TWISTEDREFLECTION); - Twisted_Reflection_Timer = 15000; - }else Twisted_Reflection_Timer -= diff; - - DoMeleeAttackIfReady(); - } - -}; - -CreatureAI* GetAI_boss_doomlordkazzak(Creature* pCreature) -{ - return new boss_doomlordkazzakAI (pCreature); -} - -void AddSC_boss_doomlordkazzak() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_doomlord_kazzak"; - newscript->GetAI = &GetAI_boss_doomlordkazzak; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/hellfire_peninsula/hellfire_peninsula.cpp b/src/bindings/scripts/scripts/zone/hellfire_peninsula/hellfire_peninsula.cpp deleted file mode 100644 index a8a8463889f..00000000000 --- a/src/bindings/scripts/scripts/zone/hellfire_peninsula/hellfire_peninsula.cpp +++ /dev/null @@ -1,245 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Hellfire_Peninsula -SD%Complete: 100 - SDComment: Quest support: 9375, 9418, 10129, 10146, 10162, 10163, 10340, 10346, 10347, 10382 (Special flight paths) -SDCategory: Hellfire Peninsula -EndScriptData */ - -/* ContentData -npc_aeranas -go_haaleshi_altar -npc_wounded_blood_elf -EndContentData */ - -#include "precompiled.h" -#include "../../npc/npc_escortAI.h" - -/*###### -## npc_aeranas -######*/ - -enum -{ - SAY_SUMMON = -1000138, - SAY_FREE = -1000139, - - FACTION_HOSTILE = 16, - FACTION_FRIENDLY = 35, - - SPELL_ENVELOPING_WINDS = 15535, - SPELL_SHOCK = 12553, - - C_AERANAS = 17085 -}; - -struct TRINITY_DLL_DECL npc_aeranasAI : public ScriptedAI -{ - npc_aeranasAI(Creature* c) : ScriptedAI(c) {} - - uint32 Faction_Timer; - uint32 EnvelopingWinds_Timer; - uint32 Shock_Timer; - - void Reset() - { - Faction_Timer = 8000; - EnvelopingWinds_Timer = 9000; - Shock_Timer = 5000; - - m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER); - m_creature->setFaction(FACTION_FRIENDLY); - - DoScriptText(SAY_SUMMON, m_creature); - } - - void EnterCombat(Unit *who) {} - - void UpdateAI(const uint32 diff) - { - if (Faction_Timer) - { - if (Faction_Timer < diff) - { - m_creature->setFaction(FACTION_HOSTILE); - Faction_Timer = 0; - }else Faction_Timer -= diff; - } - - if (!UpdateVictim()) - return; - - if ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 30) - { - m_creature->setFaction(FACTION_FRIENDLY); - m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER); - m_creature->RemoveAllAuras(); - m_creature->DeleteThreatList(); - m_creature->CombatStop(true); - DoScriptText(SAY_FREE, m_creature); - return; - } - - if (Shock_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_SHOCK); - Shock_Timer = 10000; - }else Shock_Timer -= diff; - - if (EnvelopingWinds_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_ENVELOPING_WINDS); - EnvelopingWinds_Timer = 25000; - }else EnvelopingWinds_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_npc_aeranas(Creature* pCreature) -{ - return new npc_aeranasAI (pCreature); -} - -/*###### -## go_haaleshi_altar -######*/ - -bool GOHello_go_haaleshi_altar(Player* pPlayer, GameObject* pGo) -{ - pGo->SummonCreature(C_AERANAS,-1321.79, 4043.80, 116.24, 1.25, TEMPSUMMON_TIMED_DESPAWN, 180000); - return false; -} - -/*###### -## npc_wounded_blood_elf -######*/ - -enum -{ - SAY_ELF_START = -1000117, - SAY_ELF_SUMMON1 = -1000118, - SAY_ELF_RESTING = -1000119, - SAY_ELF_SUMMON2 = -1000120, - SAY_ELF_COMPLETE = -1000121, - SAY_ELF_AGGRO = -1000122, - - QUEST_ROAD_TO_FALCON_WATCH = 9375 -}; - -struct TRINITY_DLL_DECL npc_wounded_blood_elfAI : public npc_escortAI -{ - npc_wounded_blood_elfAI(Creature *c) : npc_escortAI(c) {} - - void WaypointReached(uint32 i) - { - Player* pPlayer = Unit::GetPlayer(PlayerGUID); - - if (!pPlayer || pPlayer->GetTypeId() != TYPEID_PLAYER) - return; - - switch (i) - { - case 0: - DoScriptText(SAY_ELF_START, m_creature, pPlayer); - break; - case 9: - DoScriptText(SAY_ELF_SUMMON1, m_creature, pPlayer); - // Spawn two Haal'eshi Talonguard - DoSpawnCreature(16967, -15, -15, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); - DoSpawnCreature(16967, -17, -17, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); - break; - case 13: - DoScriptText(SAY_ELF_RESTING, m_creature, pPlayer); - break; - case 14: - DoScriptText(SAY_ELF_SUMMON2, m_creature, pPlayer); - // Spawn two Haal'eshi Windwalker - DoSpawnCreature(16966, -15, -15, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); - DoSpawnCreature(16966, -17, -17, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); - break; - case 27: - DoScriptText(SAY_ELF_COMPLETE, m_creature, pPlayer); - // Award quest credit - pPlayer->GroupEventHappens(QUEST_ROAD_TO_FALCON_WATCH,m_creature); - break; - } - } - - void Reset() { } - - void EnterCombat(Unit* who) - { - if (IsBeingEscorted) - DoScriptText(SAY_ELF_AGGRO, m_creature); - } - - void JustSummoned(Creature* summoned) - { - summoned->AI()->AttackStart(m_creature); - } -}; - -CreatureAI* GetAI_npc_wounded_blood_elf(Creature* pCreature) -{ - npc_wounded_blood_elfAI* welfAI = new npc_wounded_blood_elfAI(pCreature); - - welfAI->FillPointMovementListForCreature(); - - return welfAI; -} - -bool QuestAccept_npc_wounded_blood_elf(Player* pPlayer, Creature* pCreature, Quest const* quest) -{ - if (quest->GetQuestId() == QUEST_ROAD_TO_FALCON_WATCH) - { - if (npc_escortAI* pEscortAI = CAST_AI(npc_wounded_blood_elfAI, pCreature->AI())) - pEscortAI->Start(true, false, pPlayer->GetGUID()); - - // Change faction so mobs attack - pCreature->setFaction(775); - } - - return true; -} - -/*###### -## -######*/ - -void AddSC_hellfire_peninsula() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "npc_aeranas"; - newscript->GetAI = &GetAI_npc_aeranas; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "go_haaleshi_altar"; - newscript->pGOHello = &GOHello_go_haaleshi_altar; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_wounded_blood_elf"; - newscript->GetAI = &GetAI_npc_wounded_blood_elf; - newscript->pQuestAccept = &QuestAccept_npc_wounded_blood_elf; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/hinterlands/hinterlands.cpp b/src/bindings/scripts/scripts/zone/hinterlands/hinterlands.cpp deleted file mode 100644 index f5014844809..00000000000 --- a/src/bindings/scripts/scripts/zone/hinterlands/hinterlands.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: Hinterlands -SD%Complete: 100 -SDComment: Quest support: 2742 -SDCategory: The Hinterlands -EndScriptData */ - -/* ContentData -npc_rinji -EndContentData */ - -#include "precompiled.h" -#include "../../npc/npc_escortAI.h" - -/*###### -## npc_rinji -######*/ - -enum -{ - SAY_RIN_FREE = -1000403, - SAY_RIN_BY_OUTRUNNER = -1000404, - SAY_RIN_HELP_1 = -1000405, - SAY_RIN_HELP_2 = -1000406, - SAY_RIN_COMPLETE = -1000407, - SAY_RIN_PROGRESS_1 = -1000408, - SAY_RIN_PROGRESS_2 = -1000409, - - QUEST_RINJI_TRAPPED = 2742, - NPC_RANGER = 2694, - NPC_OUTRUNNER = 2691, - GO_RINJI_CAGE = 142036 -}; - -struct Location -{ - float m_fX, m_fY, m_fZ; -}; - -Location m_afAmbushSpawn[] = -{ - {191.296204, -2839.329346, 107.388}, - {70.972466, -2848.674805, 109.459} -}; - -Location m_afAmbushMoveTo[] = -{ - {166.630386, -2824.780273, 108.153}, - {70.886589, -2874.335449, 116.675} -}; - -struct TRINITY_DLL_DECL npc_rinjiAI : public npc_escortAI -{ - npc_rinjiAI(Creature* pCreature) : npc_escortAI(pCreature) - { - m_bIsByOutrunner = false; - m_iSpawnId = 0; - } - - bool m_bIsByOutrunner; - uint32 m_uiPostEventCount; - uint32 m_uiPostEventTimer; - int m_iSpawnId; - - void Reset() - { - m_uiPostEventCount = 0; - m_uiPostEventTimer = 3000; - } - - void JustRespawned() - { - m_bIsByOutrunner = false; - m_iSpawnId = 0; - - npc_escortAI::JustRespawned(); - } - - void EnterCombat(Unit* pWho) - { - if (IsBeingEscorted) - { - if (pWho->GetEntry() == NPC_OUTRUNNER && !m_bIsByOutrunner) - { - DoScriptText(SAY_RIN_BY_OUTRUNNER, pWho); - m_bIsByOutrunner = true; - } - - if (rand()%4) - return; - - //only if attacked and escorter is not in combat? - switch(rand()%2) - { - case 0: DoScriptText(SAY_RIN_HELP_1, m_creature); break; - case 1: DoScriptText(SAY_RIN_HELP_2, m_creature); break; - } - } - } - - void DoSpawnAmbush(bool bFirst) - { - if (!bFirst) - m_iSpawnId = 1; - - m_creature->SummonCreature(NPC_RANGER, - m_afAmbushSpawn[m_iSpawnId].m_fX, m_afAmbushSpawn[m_iSpawnId].m_fY, m_afAmbushSpawn[m_iSpawnId].m_fZ, 0.0f, - TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000); - - for(int i = 0; i < 2; ++i) - { - m_creature->SummonCreature(NPC_OUTRUNNER, - m_afAmbushSpawn[m_iSpawnId].m_fX, m_afAmbushSpawn[m_iSpawnId].m_fY, m_afAmbushSpawn[m_iSpawnId].m_fZ, 0.0f, - TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000); - } - } - - void JustSummoned(Creature* pSummoned) - { - pSummoned->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - pSummoned->GetMotionMaster()->MovePoint(0, m_afAmbushMoveTo[m_iSpawnId].m_fX, m_afAmbushMoveTo[m_iSpawnId].m_fY, m_afAmbushMoveTo[m_iSpawnId].m_fZ); - } - - void WaypointReached(uint32 uiPointId) - { - Player* pPlayer = (Player*)Unit::GetUnit(*m_creature, PlayerGUID); - - if (!pPlayer) - return; - - switch(uiPointId) - { - case 1: - DoScriptText(SAY_RIN_FREE, m_creature, pPlayer); - break; - case 7: - DoSpawnAmbush(true); - break; - case 13: - DoSpawnAmbush(false); - break; - case 17: - DoScriptText(SAY_RIN_COMPLETE, m_creature, pPlayer); - pPlayer->GroupEventHappens(QUEST_RINJI_TRAPPED, m_creature); - SetRun(); - m_uiPostEventCount = 1; - break; - } - } - - void UpdateAI(const uint32 uiDiff) - { - npc_escortAI::UpdateAI(uiDiff); - - if (IsBeingEscorted && m_uiPostEventCount && !m_creature->getVictim()) - { - if (m_uiPostEventTimer < uiDiff) - { - 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 - { - m_creature->ForcedDespawn(); - return; - } - } - else - m_uiPostEventTimer -= uiDiff; - } - } -}; - -bool QuestAccept_npc_rinji(Player* pPlayer, Creature* pCreature, const Quest* pQuest) -{ - if (pQuest->GetQuestId() == QUEST_RINJI_TRAPPED) - { - if (GameObject* pGo = pCreature->FindNearestGameObject(GO_RINJI_CAGE, INTERACTION_DISTANCE)) - pGo->UseDoorOrButton(); - - if (npc_rinjiAI* pEscortAI = CAST_AI(npc_rinjiAI, pCreature->AI())) - pEscortAI->Start(false, false, pPlayer->GetGUID(), pQuest); - } - return true; -} - -CreatureAI* GetAI_npc_rinji(Creature* pCreature) -{ - npc_rinjiAI* pTempAI = new npc_rinjiAI(pCreature); - - pTempAI->FillPointMovementListForCreature(); - - return (CreatureAI*)pTempAI; -} - -void AddSC_hinterlands() -{ - Script* newscript; - - newscript = new Script; - newscript->Name = "npc_rinji"; - newscript->GetAI = &GetAI_npc_rinji; - newscript->pQuestAccept = &QuestAccept_npc_rinji; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/icecrown/icecrown.cpp b/src/bindings/scripts/scripts/zone/icecrown/icecrown.cpp deleted file mode 100644 index 971cb454085..00000000000 --- a/src/bindings/scripts/scripts/zone/icecrown/icecrown.cpp +++ /dev/null @@ -1,117 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Icecrown -SD%Complete: 100 -SDComment: Quest support: 12807 -SDCategory: Icecrown -EndScriptData */ - -/* ContentData -npc_arete -EndContentData */ - -#include "precompiled.h" - -/*###### -## npc_arete -######*/ - -#define GOSSIP_ARETE_ITEM1 "Lord-Commander, I would hear your tale." -#define GOSSIP_ARETE_ITEM2 "" -#define GOSSIP_ARETE_ITEM3 "I thought that they now called themselves the Scarlet Onslaught?" -#define GOSSIP_ARETE_ITEM4 "Where did the grand admiral go?" -#define GOSSIP_ARETE_ITEM5 "That's fine. When do I start?" -#define GOSSIP_ARETE_ITEM6 "Let's finish this!" -#define GOSSIP_ARETE_ITEM7 "That's quite a tale, Lord-Commander." - -enum -{ - GOSSIP_TEXTID_ARETE1 = 13525, - GOSSIP_TEXTID_ARETE2 = 13526, - GOSSIP_TEXTID_ARETE3 = 13527, - GOSSIP_TEXTID_ARETE4 = 13528, - GOSSIP_TEXTID_ARETE5 = 13529, - GOSSIP_TEXTID_ARETE6 = 13530, - GOSSIP_TEXTID_ARETE7 = 13531, - - QUEST_THE_STORY_THUS_FAR = 12807 -}; - -bool GossipHello_npc_arete(Player* pPlayer, Creature* pCreature) -{ - if (pCreature->isQuestGiver()) - pPlayer->PrepareQuestMenu(pCreature->GetGUID()); - - if (pPlayer->GetQuestStatus(QUEST_THE_STORY_THUS_FAR) == QUEST_STATUS_INCOMPLETE) - { - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ARETE_ITEM1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_ARETE1, pCreature->GetGUID()); - return true; - } - - pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); - return true; -} - -bool GossipSelect_npc_arete(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - switch(uiAction) - { - case GOSSIP_ACTION_INFO_DEF+1: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ARETE_ITEM2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_ARETE2, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+2: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ARETE_ITEM3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); - pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_ARETE3, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+3: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ARETE_ITEM4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4); - pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_ARETE4, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+4: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ARETE_ITEM5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5); - pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_ARETE5, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+5: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ARETE_ITEM6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6); - pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_ARETE6, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+6: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ARETE_ITEM7, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7); - pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_ARETE7, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+7: - pPlayer->CLOSE_GOSSIP_MENU(); - pPlayer->AreaExploredOrEventHappens(QUEST_THE_STORY_THUS_FAR); - break; - } - - return true; -} - -void AddSC_icecrown() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "npc_arete"; - newscript->pGossipHello = &GossipHello_npc_arete; - newscript->pGossipSelect = &GossipSelect_npc_arete; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/ironforge/ironforge.cpp b/src/bindings/scripts/scripts/zone/ironforge/ironforge.cpp deleted file mode 100644 index 3903562f23c..00000000000 --- a/src/bindings/scripts/scripts/zone/ironforge/ironforge.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: Ironforge -SD%Complete: 100 -SDComment: Quest support: 3702 -SDCategory: Ironforge -EndScriptData */ - -/* ContentData -npc_royal_historian_archesonus -EndContentData */ - -#include "precompiled.h" - -/*###### -## npc_royal_historian_archesonus -######*/ - -#define GOSSIP_ITEM_ROYAL "I am ready to listen" -#define GOSSIP_ITEM_ROYAL_1 "That is tragic. How did this happen?" -#define GOSSIP_ITEM_ROYAL_2 "Interesting, continue please." -#define GOSSIP_ITEM_ROYAL_3 "Unbelievable! How dare they??" -#define GOSSIP_ITEM_ROYAL_4 "Of course I will help!" - -bool GossipHello_npc_royal_historian_archesonus(Player* pPlayer, Creature* pCreature) -{ - if (pCreature->isQuestGiver()) - pPlayer->PrepareQuestMenu(pCreature->GetGUID()); - - if (pPlayer->GetQuestStatus(3702) == QUEST_STATUS_INCOMPLETE) - { - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ROYAL, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - pPlayer->SEND_GOSSIP_MENU(2235, pCreature->GetGUID()); - } - else - pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); - - return true; -} - -bool GossipSelect_npc_royal_historian_archesonus(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - switch (uiAction) - { - case GOSSIP_ACTION_INFO_DEF: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ROYAL_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - pPlayer->SEND_GOSSIP_MENU(2236, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+1: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ROYAL_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - pPlayer->SEND_GOSSIP_MENU(2237, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+2: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ROYAL_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); - pPlayer->SEND_GOSSIP_MENU(2238, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+3: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ROYAL_4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4); - pPlayer->SEND_GOSSIP_MENU(2239, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+4: - pPlayer->CLOSE_GOSSIP_MENU(); - pPlayer->AreaExploredOrEventHappens(3702); - break; - } - return true; -} - -void AddSC_ironforge() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="npc_royal_historian_archesonus"; - newscript->pGossipHello = &GossipHello_npc_royal_historian_archesonus; - newscript->pGossipSelect = &GossipSelect_npc_royal_historian_archesonus; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/isle_of_queldanas/isle_of_queldanas.cpp b/src/bindings/scripts/scripts/zone/isle_of_queldanas/isle_of_queldanas.cpp deleted file mode 100644 index 469e2f712f1..00000000000 --- a/src/bindings/scripts/scripts/zone/isle_of_queldanas/isle_of_queldanas.cpp +++ /dev/null @@ -1,154 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 .sourceforge.net/> - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Isle_of_Queldanas -SD%Complete: 100 -SDComment: Quest support: 11524, 11525, 11532, 11533, 11542, 11543, 11541 -SDCategory: Isle Of Quel'Danas -EndScriptData */ - -/* ContentData -npc_converted_sentry -npc_greengill_slave -EndContentData */ - -#include "precompiled.h" - -/*###### -## npc_converted_sentry -######*/ - -#define SAY_CONVERTED_1 -1000284 -#define SAY_CONVERTED_2 -1000284 - -#define SPELL_CONVERT_CREDIT 45009 - -struct TRINITY_DLL_DECL npc_converted_sentryAI : public ScriptedAI -{ - npc_converted_sentryAI(Creature *c) : ScriptedAI(c) {} - - bool Credit; - uint32 Timer; - - void Reset() - { - Credit = false; - Timer = 2500; - } - - void MoveInLineOfSight(Unit *who) - { return; } - void EnterCombat(Unit* who) - { } - - void UpdateAI(const uint32 diff) - { - if (!Credit) - { - if (Timer <= diff) - { - uint32 i = urand(1,2); - if (i==1) - DoScriptText(SAY_CONVERTED_1, m_creature); - else - DoScriptText(SAY_CONVERTED_2, m_creature); - - DoCast(m_creature, SPELL_CONVERT_CREDIT); - if (m_creature->isPet()) - CAST_PET(m_creature)->SetDuration(7500); - Credit = true; - }else Timer -= diff; - } - } -}; -CreatureAI* GetAI_npc_converted_sentry(Creature* pCreature) -{ - return new npc_converted_sentryAI (pCreature); -} - -/*###### -## npc_greengill_slave -######*/ - -#define ENRAGE 45111 -#define ORB 45109 -#define QUESTG 11541 -#define DM 25060 - -struct TRINITY_DLL_DECL npc_greengill_slaveAI : public ScriptedAI -{ - npc_greengill_slaveAI(Creature* c) : ScriptedAI(c) {} - - uint64 PlayerGUID; - - void EnterCombat(Unit* who){} - - void Reset() - { - PlayerGUID = 0; - } - - void SpellHit(Unit* caster, const SpellEntry* spell) - { - if (!caster) - return; - - if (caster->GetTypeId() == TYPEID_PLAYER && spell->Id == ORB && !m_creature->HasAura(ENRAGE)) - { - PlayerGUID = caster->GetGUID(); - if (PlayerGUID) - { - Unit* plr = Unit::GetUnit((*m_creature), PlayerGUID); - if (plr && CAST_PLR(plr)->GetQuestStatus(QUESTG) == QUEST_STATUS_INCOMPLETE) - DoCast(plr, 45110, true); - } - DoCast(m_creature, ENRAGE); - Unit* Myrmidon = me->FindNearestCreature(DM, 70); - if (Myrmidon) - { - m_creature->AddThreat(Myrmidon, 100000.0f); - AttackStart(Myrmidon); - } - } - } - - void UpdateAI(const uint32 diff) - { - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_npc_greengill_slaveAI(Creature* pCreature) -{ - return new npc_greengill_slaveAI(pCreature); -} - -void AddSC_isle_of_queldanas() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="npc_converted_sentry"; - newscript->GetAI = &GetAI_npc_converted_sentry; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_greengill_slave"; - newscript->GetAI = &GetAI_npc_greengill_slaveAI; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/loch_modan/loch_modan.cpp b/src/bindings/scripts/scripts/zone/loch_modan/loch_modan.cpp deleted file mode 100644 index 21a65af5319..00000000000 --- a/src/bindings/scripts/scripts/zone/loch_modan/loch_modan.cpp +++ /dev/null @@ -1,101 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Loch_Modan -SD%Complete: 100 -SDComment: Quest support: 3181 -SDCategory: Loch Modan -EndScriptData */ - -/* ContentData -npc_mountaineer_pebblebitty -EndContentData */ - -#include "precompiled.h" - -/*###### -## npc_mountaineer_pebblebitty -######*/ - -#define GOSSIP_MP "Open the gate please, i need to get to Searing Gorge" - -#define GOSSIP_MP1 "But i need to get there, now open the gate!" -#define GOSSIP_MP2 "Ok, so what is this other way?" -#define GOSSIP_MP3 "Doesn't matter, i'm invulnerable." -#define GOSSIP_MP4 "Yes..." -#define GOSSIP_MP5 "Ok, i'll try to remember that." -#define GOSSIP_MP6 "A key? Ok!" - -bool GossipHello_npc_mountaineer_pebblebitty(Player* pPlayer, Creature* pCreature) -{ - if (pCreature->isQuestGiver()) - pPlayer->PrepareQuestMenu(pCreature->GetGUID()); - - if (!pPlayer->GetQuestRewardStatus(3181) == 1) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_MP, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - - pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); - - return true; -} - -bool GossipSelect_npc_mountaineer_pebblebitty(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - switch (uiAction) - { - case GOSSIP_ACTION_INFO_DEF+1: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_MP1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - pPlayer->SEND_GOSSIP_MENU(1833, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+2: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_MP2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); - pPlayer->SEND_GOSSIP_MENU(1834, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+3: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_MP3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4); - pPlayer->SEND_GOSSIP_MENU(1835, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+4: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_MP4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5); - pPlayer->SEND_GOSSIP_MENU(1836, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+5: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_MP5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6); - pPlayer->SEND_GOSSIP_MENU(1837, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+6: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_MP6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7); - pPlayer->SEND_GOSSIP_MENU(1838, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+7: - pPlayer->CLOSE_GOSSIP_MENU(); - break; - } - return true; -} - -void AddSC_loch_modan() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="npc_mountaineer_pebblebitty"; - newscript->pGossipHello = &GossipHello_npc_mountaineer_pebblebitty; - newscript->pGossipSelect = &GossipSelect_npc_mountaineer_pebblebitty; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/moonglade/moonglade.cpp b/src/bindings/scripts/scripts/zone/moonglade/moonglade.cpp deleted file mode 100644 index b31047cccd2..00000000000 --- a/src/bindings/scripts/scripts/zone/moonglade/moonglade.cpp +++ /dev/null @@ -1,570 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Moonglade -SD%Complete: 100 -SDComment: Quest support: 30, 272, 5929, 5930, 10965. Special Flight Paths for Druid class. -SDCategory: Moonglade -EndScriptData */ - -/* ContentData -npc_bunthen_plainswind -npc_great_bear_spirit -npc_silva_filnaveth -npc_clintar_spirit -npc_clintar_dreamwalker -EndContentData */ - -#include "precompiled.h" -#include "../../npc/npc_escortAI.h" - -/*###### -## npc_bunthen_plainswind -######*/ - -enum -{ - QUEST_SEA_LION_HORDE = 30, - QUEST_SEA_LION_ALLY = 272, - TAXI_PATH_ID_ALLY = 315, - TAXI_PATH_ID_HORDE = 316 -}; - -#define GOSSIP_ITEM_THUNDER "I'd like to fly to Thunder Bluff." -#define GOSSIP_ITEM_AQ_END "Do you know where I can find Half Pendant of Aquatic Endurance?" - -bool GossipHello_npc_bunthen_plainswind(Player* pPlayer, Creature* pCreature) -{ - if (pPlayer->getClass() != CLASS_DRUID) - pPlayer->SEND_GOSSIP_MENU(4916, pCreature->GetGUID()); - else if (pPlayer->GetTeam() != HORDE) - { - if (pPlayer->GetQuestStatus(QUEST_SEA_LION_ALLY) == QUEST_STATUS_INCOMPLETE) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_AQ_END, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - - pPlayer->SEND_GOSSIP_MENU(4917, pCreature->GetGUID()); - } - else if (pPlayer->getClass() == CLASS_DRUID && pPlayer->GetTeam() == HORDE) - { - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_THUNDER, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - - if (pPlayer->GetQuestStatus(QUEST_SEA_LION_HORDE) == QUEST_STATUS_INCOMPLETE) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_AQ_END, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); - - pPlayer->SEND_GOSSIP_MENU(4918, pCreature->GetGUID()); - } - return true; -} - -bool GossipSelect_npc_bunthen_plainswind(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - switch(uiAction) - { - case GOSSIP_ACTION_INFO_DEF + 1: - pPlayer->CLOSE_GOSSIP_MENU(); - if (pPlayer->getClass() == CLASS_DRUID && pPlayer->GetTeam() == HORDE) - pPlayer->ActivateTaxiPathTo(TAXI_PATH_ID_HORDE); - break; - case GOSSIP_ACTION_INFO_DEF + 2: - pPlayer->SEND_GOSSIP_MENU(5373, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF + 3: - pPlayer->SEND_GOSSIP_MENU(5376, pCreature->GetGUID()); - break; - } - return true; -} - -/*###### -## npc_great_bear_spirit -######*/ - -#define GOSSIP_BEAR1 "What do you represent, spirit?" -#define GOSSIP_BEAR2 "I seek to understand the importance of strength of the body." -#define GOSSIP_BEAR3 "I seek to understand the importance of strength of the heart." -#define GOSSIP_BEAR4 "I have heard your words, Great Bear Spirit, and I understand. I now seek your blessings to fully learn the way of the Claw." - -bool GossipHello_npc_great_bear_spirit(Player* pPlayer, Creature* pCreature) -{ - //ally or horde quest - if (pPlayer->GetQuestStatus(5929) == QUEST_STATUS_INCOMPLETE || pPlayer->GetQuestStatus(5930) == QUEST_STATUS_INCOMPLETE) - { - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BEAR1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - pPlayer->SEND_GOSSIP_MENU(4719, pCreature->GetGUID()); - } - else - pPlayer->SEND_GOSSIP_MENU(4718, pCreature->GetGUID()); - - return true; -} - -bool GossipSelect_npc_great_bear_spirit(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - switch (uiAction) - { - case GOSSIP_ACTION_INFO_DEF: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BEAR2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - pPlayer->SEND_GOSSIP_MENU(4721, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF + 1: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BEAR3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - pPlayer->SEND_GOSSIP_MENU(4733, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF + 2: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BEAR4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); - pPlayer->SEND_GOSSIP_MENU(4734, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF + 3: - pPlayer->SEND_GOSSIP_MENU(4735, pCreature->GetGUID()); - if (pPlayer->GetQuestStatus(5929)==QUEST_STATUS_INCOMPLETE) - pPlayer->AreaExploredOrEventHappens(5929); - if (pPlayer->GetQuestStatus(5930)==QUEST_STATUS_INCOMPLETE) - pPlayer->AreaExploredOrEventHappens(5930); - break; - } - return true; -} - -/*###### -## npc_silva_filnaveth -######*/ - -#define GOSSIP_ITEM_RUTHERAN "I'd like to fly to Rut'theran Village." -#define GOSSIP_ITEM_AQ_AGI "Do you know where I can find Half Pendant of Aquatic Agility?" - -bool GossipHello_npc_silva_filnaveth(Player* pPlayer, Creature* pCreature) -{ - if (pPlayer->getClass() != CLASS_DRUID) - pPlayer->SEND_GOSSIP_MENU(4913, pCreature->GetGUID()); - else if (pPlayer->GetTeam() != ALLIANCE) - { - if (pPlayer->GetQuestStatus(QUEST_SEA_LION_HORDE) == QUEST_STATUS_INCOMPLETE) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_AQ_AGI, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - - pPlayer->SEND_GOSSIP_MENU(4915, pCreature->GetGUID()); - } - else if (pPlayer->getClass() == CLASS_DRUID && pPlayer->GetTeam() == ALLIANCE) - { - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_RUTHERAN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - - if (pPlayer->GetQuestStatus(QUEST_SEA_LION_ALLY) == QUEST_STATUS_INCOMPLETE) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_AQ_AGI, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); - - pPlayer->SEND_GOSSIP_MENU(4914, pCreature->GetGUID()); - } - return true; -} - -bool GossipSelect_npc_silva_filnaveth(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - switch(uiAction) - { - case GOSSIP_ACTION_INFO_DEF + 1: - pPlayer->CLOSE_GOSSIP_MENU(); - if (pPlayer->getClass() == CLASS_DRUID && pPlayer->GetTeam() == ALLIANCE) - pPlayer->ActivateTaxiPathTo(TAXI_PATH_ID_ALLY); - break; - case GOSSIP_ACTION_INFO_DEF + 2: - pPlayer->SEND_GOSSIP_MENU(5374, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF + 3: - pPlayer->SEND_GOSSIP_MENU(5375, pCreature->GetGUID()); - break; - } - return true; -} - -/*###### -## npc_clintar_spirit -######*/ - -float Clintar_spirit_WP[41][5] = -{ - //pos_x pos_y pos_z orien waitTime -{7465.28, -3115.46, 439.327, 0.83, 4000}, -{7476.49, -3101, 443.457, 0.89, 0}, -{7486.57, -3085.59, 439.478, 1.07, 0}, -{7472.19, -3085.06, 443.142, 3.07, 0}, -{7456.92, -3085.91, 438.862, 3.24, 0}, -{7446.68, -3083.43, 438.245, 2.40, 0}, -{7446.17, -3080.21, 439.826, 1.10, 6000}, -{7452.41, -3085.8, 438.984, 5.78, 0}, -{7469.11, -3084.94, 443.048, 6.25, 0}, -{7483.79, -3085.44, 439.607, 6.25, 0}, -{7491.14, -3090.96, 439.983, 5.44, 0}, -{7497.62, -3098.22, 436.854, 5.44, 0}, -{7498.72, -3113.41, 434.596, 4.84, 0}, -{7500.06, -3122.51, 434.749, 5.17, 0}, -{7504.96, -3131.53, 434.475, 4.74, 0}, -{7504.31, -3133.53, 435.693, 3.84, 6000}, -{7504.55, -3133.27, 435.476, 0.68, 15000}, -{7501.99, -3126.01, 434.93, 1.83, 0}, -{7490.76, -3114.97, 434.431, 2.51, 0}, -{7479.64, -3105.51, 431.123, 1.83, 0}, -{7474.63, -3086.59, 428.994, 1.83, 2000}, -{7472.96, -3074.18, 427.566, 1.57, 0}, -{7472.25, -3063, 428.268, 1.55, 0}, -{7473.46, -3054.22, 427.588, 0.36, 0}, -{7475.08, -3053.6, 428.653, 0.36, 6000}, -{7474.66, -3053.56, 428.433, 3.19, 4000}, -{7471.81, -3058.84, 427.073, 4.29, 0}, -{7472.16, -3064.91, 427.772, 4.95, 0}, -{7471.56, -3085.36, 428.924, 4.72, 0}, -{7473.56, -3093.48, 429.294, 5.04, 0}, -{7478.94, -3104.29, 430.638, 5.23, 0}, -{7484.46, -3109.61, 432.769, 5.79, 0}, -{7490.23, -3111.08, 434.431, 0.02, 0}, -{7496.29, -3108, 434.783, 1.15, 0}, -{7497.46, -3100.66, 436.191, 1.50, 0}, -{7495.64, -3093.39, 438.349, 2.10, 0}, -{7492.44, -3086.01, 440.267, 1.38, 0}, -{7498.26, -3076.44, 440.808, 0.71, 0}, -{7506.4, -3067.35, 443.64, 0.77, 0}, -{7518.37, -3057.42, 445.584, 0.74, 0}, -{7517.51, -3056.3, 444.568, 2.49, 4500} -}; - -#define ASPECT_RAVEN 22915 - -#define ASPECT_RAVEN_SUMMON_X 7472.96 -#define ASPECT_RAVEN_SUMMON_Y -3074.18 -#define ASPECT_RAVEN_SUMMON_Z 427.566 -#define CLINTAR_SPIRIT_SUMMON_X 7459.2275 -#define CLINTAR_SPIRIT_SUMMON_Y -3122.5632 -#define CLINTAR_SPIRIT_SUMMON_Z 438.9842 -#define CLINTAR_SPIRIT_SUMMON_O 0.8594 - -#define CLINTAR_SPIRIT_SAY_START -1000286 -#define CLINTAR_SPIRIT_SAY_UNDER_ATTACK_1 -1000287 -#define CLINTAR_SPIRIT_SAY_UNDER_ATTACK_2 -1000288 -#define CLINTAR_SPIRIT_SAY_GET_ONE -1000289 -#define CLINTAR_SPIRIT_SAY_GET_TWO -1000290 -#define CLINTAR_SPIRIT_SAY_GET_THREE -1000291 -#define CLINTAR_SPIRIT_SAY_GET_FINAL -1000292 - -struct TRINITY_DLL_DECL npc_clintar_spiritAI : public npc_escortAI -{ -public: - npc_clintar_spiritAI(Creature *c) : npc_escortAI(c) {} - - uint32 Step; - uint32 CurrWP; - uint32 Event_Timer; - uint32 checkPlayer_Timer; - - uint64 PlayerGUID; - - bool Event_onWait; - - void Reset() - { - if (!PlayerGUID) - { - Step = 0; - CurrWP = 0; - Event_Timer = 0; - PlayerGUID = 0; - checkPlayer_Timer = 1000; - Event_onWait = false; - } - } - - void JustDied(Unit *killer) - { - if (!PlayerGUID) - return; - - Player* pPlayer = Unit::GetPlayer(PlayerGUID); - if (pPlayer && pPlayer->GetQuestStatus(10965) == QUEST_STATUS_INCOMPLETE) - { - pPlayer->FailQuest(10965); - PlayerGUID = 0; - Reset(); - } - } - - void EnterEvadeMode() - { - Player* pPlayer = Unit::GetPlayer(PlayerGUID); - if (pPlayer && pPlayer->isInCombat() && pPlayer->getAttackerForHelper()) - { - AttackStart(pPlayer->getAttackerForHelper()); - return; - } - npc_escortAI::EnterEvadeMode(); - } - - void EnterCombat(Unit* who) - { - uint32 rnd = rand()%2; - switch(rnd) - { - case 0: DoScriptText(CLINTAR_SPIRIT_SAY_UNDER_ATTACK_1, m_creature, who); break; - case 1: DoScriptText(CLINTAR_SPIRIT_SAY_UNDER_ATTACK_2, m_creature, who); break; - } - } - - void StartEvent(Player* pPlayer) - { - if (!pPlayer) - return; - if (pPlayer->GetQuestStatus(10965) == QUEST_STATUS_INCOMPLETE) - { - for(uint8 i = 0; i < 41; ++i) - { - AddWaypoint(i, Clintar_spirit_WP[i][0], Clintar_spirit_WP[i][1], Clintar_spirit_WP[i][2], (uint32)Clintar_spirit_WP[i][4]); - } - PlayerGUID = pPlayer->GetGUID(); - Start(true,false,PlayerGUID); - } - return; - } - - void UpdateAI(const uint32 diff) - { - npc_escortAI::UpdateAI(diff); - - if (!PlayerGUID) - { - m_creature->setDeathState(JUST_DIED); - return; - } - - if (!m_creature->isInCombat() && !Event_onWait) - { - if (checkPlayer_Timer < diff) - { - Player* pPlayer = Unit::GetPlayer(PlayerGUID); - if (pPlayer && pPlayer->isInCombat() && pPlayer->getAttackerForHelper()) - AttackStart(pPlayer->getAttackerForHelper()); - checkPlayer_Timer = 1000; - }else checkPlayer_Timer -= diff; - } - - if (Event_onWait && Event_Timer < diff) - { - - Player* pPlayer = Unit::GetPlayer(PlayerGUID); - if (!pPlayer || (pPlayer && pPlayer->GetQuestStatus(10965) == QUEST_STATUS_NONE)) - { - m_creature->setDeathState(JUST_DIED); - return; - } - - switch(CurrWP) - { - case 0: - switch(Step) - { - case 0: - m_creature->Say(CLINTAR_SPIRIT_SAY_START,0,PlayerGUID); - Event_Timer = 8000; - Step = 1; - break; - case 1: - Event_onWait = false; - break; - } - break; - case 6: - switch(Step) - { - case 0: - m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, 133); - Event_Timer = 5000; - Step = 1; - break; - case 1: - m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0); - DoScriptText(CLINTAR_SPIRIT_SAY_GET_ONE, m_creature, pPlayer); - Event_onWait = false; - break; - } - break; - case 15: - switch(Step) - { - case 0: - m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, 133); - Event_Timer = 5000; - Step = 1; - break; - case 1: - m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0); - Event_onWait = false; - break; - } - break; - case 16: - switch(Step) - { - case 0: - DoScriptText(CLINTAR_SPIRIT_SAY_GET_TWO, m_creature, pPlayer); - Event_Timer = 15000; - Step = 1; - break; - case 1: - Event_onWait = false; - break; - } - break; - case 20: - switch(Step) - { - case 0: - { - Creature *mob = m_creature->SummonCreature(ASPECT_RAVEN, ASPECT_RAVEN_SUMMON_X, ASPECT_RAVEN_SUMMON_Y, ASPECT_RAVEN_SUMMON_Z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 2000); - if (mob) - { - mob->AddThreat(m_creature,10000.0f); - mob->AI()->AttackStart(m_creature); - } - Event_Timer = 2000; - Step = 1; - break; - } - case 1: - Event_onWait = false; - break; - } - break; - case 24: - switch(Step) - { - case 0: - m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, 133); - Event_Timer = 5000; - Step = 1; - break; - case 1: - m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0); - Event_onWait = false; - break; - } - break; - case 25: - switch(Step) - { - case 0: - DoScriptText(CLINTAR_SPIRIT_SAY_GET_THREE, m_creature, pPlayer); - Event_Timer = 4000; - Step = 1; - break; - case 1: - Event_onWait = false; - break; - } - break; - case 40: - switch(Step) - { - case 0: - m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, 2); - DoScriptText(CLINTAR_SPIRIT_SAY_GET_FINAL, m_creature, pPlayer); - pPlayer->CompleteQuest(10965); - Event_Timer = 1500; - Step = 1; - break; - case 1: - m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0); - Event_Timer = 3000; - Step = 2; - break; - case 2: - pPlayer->TalkedToCreature(m_creature->GetEntry(), m_creature->GetGUID()); - PlayerGUID = 0; - Reset(); - m_creature->setDeathState(JUST_DIED); - break; - } - break; - default: - Event_onWait = false; - break; - } - - } else if (Event_onWait) Event_Timer -= diff; - } - - void WaypointReached(uint32 id) - { - CurrWP = id; - Event_Timer = 0; - Step = 0; - Event_onWait = true; - } -}; - -CreatureAI* GetAI_npc_clintar_spirit(Creature* pCreature) -{ - return new npc_clintar_spiritAI (pCreature); -} - -/*#### -# npc_clintar_dreamwalker -####*/ - -#define CLINTAR_SPIRIT 22916 - -bool QuestAccept_npc_clintar_dreamwalker(Player* pPlayer, Creature* pCreature, Quest const *quest) -{ - if (quest->GetQuestId() == 10965) - { - Creature *clintar_spirit = pCreature->SummonCreature(CLINTAR_SPIRIT, CLINTAR_SPIRIT_SUMMON_X, CLINTAR_SPIRIT_SUMMON_Y, CLINTAR_SPIRIT_SUMMON_Z, CLINTAR_SPIRIT_SUMMON_O, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 100000); - if (clintar_spirit) - CAST_AI(npc_clintar_spiritAI, clintar_spirit->AI())->StartEvent(pPlayer); - } - return true; -} - -/*#### -# -####*/ - -void AddSC_moonglade() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="npc_bunthen_plainswind"; - newscript->pGossipHello = &GossipHello_npc_bunthen_plainswind; - newscript->pGossipSelect = &GossipSelect_npc_bunthen_plainswind; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_great_bear_spirit"; - newscript->pGossipHello = &GossipHello_npc_great_bear_spirit; - newscript->pGossipSelect = &GossipSelect_npc_great_bear_spirit; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_silva_filnaveth"; - newscript->pGossipHello = &GossipHello_npc_silva_filnaveth; - newscript->pGossipSelect = &GossipSelect_npc_silva_filnaveth; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_clintar_dreamwalker"; - newscript->pQuestAccept = &QuestAccept_npc_clintar_dreamwalker; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_clintar_spirit"; - newscript->GetAI = &GetAI_npc_clintar_spirit; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/mulgore/mulgore.cpp b/src/bindings/scripts/scripts/zone/mulgore/mulgore.cpp deleted file mode 100644 index b1e17fc8ea5..00000000000 --- a/src/bindings/scripts/scripts/zone/mulgore/mulgore.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: Mulgore -SD%Complete: 100 -SDComment: Support for quest: 11129, 772 -SDCategory: Mulgore -EndScriptData */ - -/* ContentData -npc_skorn_whitecloud -npc_kyle_frenzied -npc_plains_vision -EndContentData */ - -#include "precompiled.h" -#include "../../npc/npc_escortAI.h" - -/*###### -# npc_skorn_whitecloud -######*/ - -#define GOSSIP_SW "Tell me a story, Skorn." - -bool GossipHello_npc_skorn_whitecloud(Player* pPlayer, Creature* pCreature) -{ - if (pCreature->isQuestGiver()) - pPlayer->PrepareQuestMenu(pCreature->GetGUID()); - - if (!pPlayer->GetQuestRewardStatus(770)) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SW, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - - pPlayer->SEND_GOSSIP_MENU(522, pCreature->GetGUID()); - - return true; -} - -bool GossipSelect_npc_skorn_whitecloud(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - if (uiAction == GOSSIP_ACTION_INFO_DEF) - pPlayer->SEND_GOSSIP_MENU(523, pCreature->GetGUID()); - - return true; -} - -/*##### -# npc_kyle_frenzied -######*/ - -enum -{ - EMOTE_SEE_LUNCH = -1000407, - EMOTE_EAT_LUNCH = -1000408, - EMOTE_DANCE = -1000409, - - SPELL_LUNCH = 42222, - NPC_KYLE_FRENZIED = 23616, - NPC_KYLE_FRIENDLY = 23622, - POINT_ID = 1 -}; - -struct TRINITY_DLL_DECL npc_kyle_frenziedAI : public ScriptedAI -{ - npc_kyle_frenziedAI(Creature *c) : ScriptedAI(c) {} - - bool bEvent; - bool m_bIsMovingToLunch; - uint64 uiPlayerGUID; - uint32 uiEventTimer; - uint8 uiEventPhase; - - void Reset() - { - bEvent = false; - m_bIsMovingToLunch = false; - uiPlayerGUID = 0; - uiEventTimer = 5000; - uiEventPhase = 0; - - if (m_creature->GetEntry() == NPC_KYLE_FRIENDLY) - m_creature->UpdateEntry(NPC_KYLE_FRENZIED); - } - - void SpellHit(Unit* pCaster, SpellEntry const* pSpell) - { - if (!m_creature->getVictim() && !bEvent && pSpell->Id == SPELL_LUNCH) - { - if (pCaster->GetTypeId() == TYPEID_PLAYER) - uiPlayerGUID = pCaster->GetGUID(); - - if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == WAYPOINT_MOTION_TYPE) - { - m_creature->GetMotionMaster()->MovementExpired(); - m_creature->GetMotionMaster()->MoveIdle(); - m_creature->StopMoving(); - } - - bEvent = true; - DoScriptText(EMOTE_SEE_LUNCH, m_creature); - m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_CREATURE_SPECIAL); - } - } - - void MovementInform(uint32 uiType, uint32 uiPointId) - { - if (uiType != POINT_MOTION_TYPE || !bEvent) - return; - - if (uiPointId == POINT_ID) - m_bIsMovingToLunch = false; - } - - void UpdateAI(const uint32 diff) - { - if (bEvent) - { - if (m_bIsMovingToLunch) - return; - - if (uiEventTimer < diff) - { - uiEventTimer = 5000; - ++uiEventPhase; - - switch(uiEventPhase) - { - case 1: - if (Unit* pUnit = Unit::GetUnit(*m_creature,uiPlayerGUID)) - { - if (GameObject* pGo = pUnit->GetGameObject(SPELL_LUNCH)) - { - m_bIsMovingToLunch = true; - m_creature->GetMotionMaster()->MovePoint(POINT_ID, pGo->GetPositionX(), pGo->GetPositionY(), pGo->GetPositionZ()); - } - } - break; - case 2: - DoScriptText(EMOTE_EAT_LUNCH, m_creature); - m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_USESTANDING); - break; - case 3: - if (Player* pUnit = Unit::GetPlayer(uiPlayerGUID)) - pUnit->TalkedToCreature(m_creature->GetEntry(), m_creature->GetGUID()); - - m_creature->UpdateEntry(NPC_KYLE_FRIENDLY); - break; - case 4: - uiEventTimer = 30000; - DoScriptText(EMOTE_DANCE, m_creature); - m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_DANCESPECIAL); - break; - case 5: - m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_NONE); - Reset(); - m_creature->GetMotionMaster()->Clear(); - break; - } - } - else - uiEventTimer -= diff; - } - } -}; - -CreatureAI* GetAI_npc_kyle_frenzied(Creature* pCreature) -{ - return new npc_kyle_frenziedAI (pCreature); -} - -/*##### -# npc_plains_vision -######*/ - -float wp_plain_vision[50][3] = -{ - {-2226.32, -408.095, -9.36235}, - {-2203.04, -437.212, -5.72498}, - {-2163.91, -457.851, -7.09049}, - {-2123.87, -448.137, -9.29591}, - {-2104.66, -427.166, -6.49513}, - {-2101.48, -422.826, -5.3567}, - {-2097.56, -417.083, -7.16716}, - {-2084.87, -398.626, -9.88973}, - {-2072.71, -382.324, -10.2488}, - {-2054.05, -356.728, -6.22468}, - {-2051.8, -353.645, -5.35791}, - {-2049.08, -349.912, -6.15723}, - {-2030.6, -310.724, -9.59302}, - {-2002.15, -249.308, -10.8124}, - {-1972.85, -195.811, -10.6316}, - {-1940.93, -147.652, -11.7055}, - {-1888.06, -81.943, -11.4404}, - {-1837.05, -34.0109, -12.258}, - {-1796.12, -14.6462, -10.3581}, - {-1732.61, -4.27746, -10.0213}, - {-1688.94, -0.829945, -11.7103}, - {-1681.32, 13.0313, -9.48056}, - {-1677.04, 36.8349, -7.10318}, - {-1675.2, 68.559, -8.95384}, - {-1676.57, 89.023, -9.65104}, - {-1678.16, 110.939, -10.1782}, - {-1677.86, 128.681, -5.73869}, - {-1675.27, 144.324, -3.47916}, - {-1671.7, 163.169, -1.23098}, - {-1666.61, 181.584, 5.26145}, - {-1661.51, 196.154, 8.95252}, - {-1655.47, 210.811, 8.38727}, - {-1647.07, 226.947, 5.27755}, - {-1621.65, 232.91, 2.69579}, - {-1600.23, 237.641, 2.98539}, - {-1576.07, 242.546, 4.66541}, - {-1554.57, 248.494, 6.60377}, - {-1547.53, 259.302, 10.6741}, - {-1541.7, 269.847, 16.4418}, - {-1539.83, 278.989, 21.0597}, - {-1540.16, 290.219, 27.8247}, - {-1538.99, 298.983, 34.0032}, - {-1540.38, 307.337, 41.3557}, - {-1536.61, 314.884, 48.0179}, - {-1532.42, 323.277, 55.6667}, - {-1528.77, 329.774, 61.1525}, - {-1525.65, 333.18, 63.2161}, - {-1517.01, 350.713, 62.4286}, - {-1511.39, 362.537, 62.4539}, - {-1508.68, 366.822, 62.733} -}; - -struct TRINITY_DLL_DECL npc_plains_visionAI : public ScriptedAI -{ - npc_plains_visionAI(Creature *c) : ScriptedAI(c) {} - - bool newWaypoint; - uint8 WayPointId; - uint8 amountWP; - - void Reset() - { - WayPointId = 0; - newWaypoint = true; - amountWP = 49; - } - - void EnterCombat(Unit* who){} - - void MovementInform(uint32 type, uint32 id) - { - if (type != POINT_MOTION_TYPE) - return; - - if (id < amountWP) - { - ++WayPointId; - newWaypoint = true; - } - else - { - m_creature->setDeathState(JUST_DIED); - m_creature->RemoveCorpse(); - } - } - - void UpdateAI(const uint32 diff) - { - if (newWaypoint) - { - m_creature->GetMotionMaster()->MovePoint(WayPointId, wp_plain_vision[WayPointId][0], wp_plain_vision[WayPointId][1], wp_plain_vision[WayPointId][2]); - newWaypoint = false; - } - } -}; - -CreatureAI* GetAI_npc_plains_vision(Creature* pCreature) -{ - return new npc_plains_visionAI (pCreature); -} - -/*##### -# -######*/ - -void AddSC_mulgore() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="npc_skorn_whitecloud"; - newscript->pGossipHello = &GossipHello_npc_skorn_whitecloud; - newscript->pGossipSelect = &GossipSelect_npc_skorn_whitecloud; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_kyle_frenzied"; - newscript->GetAI = &GetAI_npc_kyle_frenzied; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "npc_plains_vision"; - newscript->GetAI = &GetAI_npc_plains_vision; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/nagrand/nagrand.cpp b/src/bindings/scripts/scripts/zone/nagrand/nagrand.cpp deleted file mode 100644 index 09435b91efe..00000000000 --- a/src/bindings/scripts/scripts/zone/nagrand/nagrand.cpp +++ /dev/null @@ -1,718 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 .sourceforge.net/> - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Nagrand -SD%Complete: 90 -SDComment: Quest support: 9849, 9918, 9874, 9991, 10107, 10108, 10044, 10172, 10646, 10085, 10987. TextId's unknown for altruis_the_sufferer and greatmother_geyah (npc_text) -SDCategory: Nagrand -EndScriptData */ - -/* ContentData -mob_shattered_rumbler -mob_lump -mob_sunspring_villager -npc_altruis_the_sufferer -npc_greatmother_geyah -npc_lantresor_of_the_blade -npc_creditmarker_visit_with_ancestors -mob_sparrowhawk -EndContentData */ - -#include "precompiled.h" - -/*###### -## mob_shattered_rumbler - this should be done with ACID -######*/ - -struct TRINITY_DLL_DECL mob_shattered_rumblerAI : public ScriptedAI -{ - bool Spawn; - - mob_shattered_rumblerAI(Creature *c) : ScriptedAI(c) {} - - void Reset() - { - Spawn = false; - } - - void EnterCombat(Unit* who) {} - - void SpellHit(Unit *Hitter, const SpellEntry *Spellkind) - { - if (Spellkind->Id == 32001 && !Spawn) - { - float x = m_creature->GetPositionX(); - float y = m_creature->GetPositionY(); - float z = m_creature->GetPositionZ(); - - Hitter->SummonCreature(18181,x+(0.7 * (rand()%30)),y+(rand()%5),z,0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,60000); - Hitter->SummonCreature(18181,x+(rand()%5),y-(rand()%5),z,0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,60000); - Hitter->SummonCreature(18181,x-(rand()%5),y+(0.5 *(rand()%60)),z,0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,60000); - m_creature->setDeathState(CORPSE); - Spawn = true; - } - return; - } -}; -CreatureAI* GetAI_mob_shattered_rumbler(Creature* pCreature) -{ - return new mob_shattered_rumblerAI (pCreature); -} - -/*###### -## mob_lump -######*/ - -#define SPELL_VISUAL_SLEEP 16093 -#define SPELL_SPEAR_THROW 32248 - -#define LUMP_SAY0 -1000293 -#define LUMP_SAY1 -1000294 - -#define LUMP_DEFEAT -1000295 - -#define GOSSIP_HL "I need answers, ogre!" -#define GOSSIP_SL1 "Why are Boulderfist out this far? You know that this is Kurenai territory." -#define GOSSIP_SL2 "And you think you can just eat anything you want? You're obviously trying to eat the Broken of Telaar." -#define GOSSIP_SL3 "This means war, Lump! War I say!" - -struct TRINITY_DLL_DECL mob_lumpAI : public ScriptedAI -{ - mob_lumpAI(Creature *c) : ScriptedAI(c) - { - bReset = false; - } - - uint32 Reset_Timer; - uint32 Spear_Throw_Timer; - bool bReset; - - void Reset() - { - Reset_Timer = 60000; - Spear_Throw_Timer = 2000; - - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - } - - void AttackedBy(Unit* pAttacker) - { - if (m_creature->getVictim()) - return; - - if (m_creature->IsFriendlyTo(pAttacker)) - return; - - AttackStart(pAttacker); - } - - void DamageTaken(Unit *done_by, uint32 & damage) - { - if (done_by->GetTypeId() == TYPEID_PLAYER && (m_creature->GetHealth() - damage)*100 / m_creature->GetMaxHealth() < 30) - { - if (!bReset && CAST_PLR(done_by)->GetQuestStatus(9918) == QUEST_STATUS_INCOMPLETE) - { - //Take 0 damage - damage = 0; - - CAST_PLR(done_by)->AttackStop(); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - m_creature->RemoveAllAuras(); - m_creature->DeleteThreatList(); - m_creature->CombatStop(true); - m_creature->setFaction(1080); //friendly - m_creature->SetStandState(UNIT_STAND_STATE_SIT); - DoScriptText(LUMP_DEFEAT, m_creature); - - bReset = true; - } - } - } - - void EnterCombat(Unit *who) - { - if (m_creature->HasAura(SPELL_VISUAL_SLEEP)) - m_creature->RemoveAura(SPELL_VISUAL_SLEEP); - - if (!m_creature->IsStandState()) - m_creature->SetStandState(UNIT_STAND_STATE_STAND); - - switch(rand()%2) - { - case 0: DoScriptText(LUMP_SAY0, m_creature); break; - case 1: DoScriptText(LUMP_SAY1, m_creature); break; - } - } - - void UpdateAI(const uint32 diff) - { - //check if we waiting for a reset - if (bReset) - { - if (Reset_Timer < diff) - { - EnterEvadeMode(); - bReset = false; - m_creature->setFaction(1711); //hostile - return; - } - else Reset_Timer -= diff; - } - - //Return since we have no target - if (!UpdateVictim()) - return; - - //Spear_Throw_Timer - if (Spear_Throw_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_SPEAR_THROW); - Spear_Throw_Timer = 20000; - }else Spear_Throw_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_lump(Creature* pCreature) -{ - return new mob_lumpAI(pCreature); -} - -bool GossipHello_mob_lump(Player* pPlayer, Creature* pCreature) -{ - if (pPlayer->GetQuestStatus(9918) == QUEST_STATUS_INCOMPLETE) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HL, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - - pPlayer->SEND_GOSSIP_MENU(9352, pCreature->GetGUID()); - - return true; -} - -bool GossipSelect_mob_lump(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - switch (uiAction) - { - case GOSSIP_ACTION_INFO_DEF: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SL1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - pPlayer->SEND_GOSSIP_MENU(9353, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+1: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SL2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - pPlayer->SEND_GOSSIP_MENU(9354, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+2: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SL3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); - pPlayer->SEND_GOSSIP_MENU(9355, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+3: - pPlayer->SEND_GOSSIP_MENU(9356, pCreature->GetGUID()); - pPlayer->TalkedToCreature(18354, pCreature->GetGUID()); - break; - } - return true; -} - -/*#### -# mob_sunspring_villager - should be done with ACID -####*/ - -struct TRINITY_DLL_DECL mob_sunspring_villagerAI : public ScriptedAI -{ - mob_sunspring_villagerAI(Creature *c) : ScriptedAI(c) {} - - void Reset() - { - m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 32); - m_creature->SetStandState(UNIT_STAND_STATE_DEAD); - } - - void EnterCombat(Unit *who) {} - - void SpellHit(Unit *caster, const SpellEntry *spell) - { - if (spell->Id == 32146) - { - m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - m_creature->RemoveCorpse(); - } - } -}; -CreatureAI* GetAI_mob_sunspring_villager(Creature* pCreature) -{ - return new mob_sunspring_villagerAI (pCreature); -} - -/*###### -## npc_altruis_the_sufferer -######*/ - -#define GOSSIP_HATS1 "I see twisted steel and smell sundered earth." -#define GOSSIP_HATS2 "Well...?" -#define GOSSIP_HATS3 "[PH] Story about Illidan's Pupil" - -#define GOSSIP_SATS1 "Legion?" -#define GOSSIP_SATS2 "And now?" -#define GOSSIP_SATS3 "How do you see them now?" -#define GOSSIP_SATS4 "Forge camps?" -#define GOSSIP_SATS5 "Ok." -#define GOSSIP_SATS6 "[PH] Story done" - -bool GossipHello_npc_altruis_the_sufferer(Player* pPlayer, Creature* pCreature) -{ - if (pCreature->isQuestGiver()) - pPlayer->PrepareQuestMenu(pCreature->GetGUID()); - - //gossip before obtaining Survey the Land - if (pPlayer->GetQuestStatus(9991) == QUEST_STATUS_NONE) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HATS1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+10); - - //gossip when Survey the Land is incomplete (technically, after the flight) - if (pPlayer->GetQuestStatus(9991) == QUEST_STATUS_INCOMPLETE) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HATS2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+20); - - //wowwiki.com/Varedis - if (pPlayer->GetQuestStatus(10646) == QUEST_STATUS_INCOMPLETE) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HATS3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+30); - - pPlayer->SEND_GOSSIP_MENU(9419, pCreature->GetGUID()); - - return true; -} - -bool GossipSelect_npc_altruis_the_sufferer(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - switch (uiAction) - { - case GOSSIP_ACTION_INFO_DEF+10: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SATS1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11); - pPlayer->SEND_GOSSIP_MENU(9420, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+11: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SATS2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 12); - pPlayer->SEND_GOSSIP_MENU(9421, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+12: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SATS3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 13); - pPlayer->SEND_GOSSIP_MENU(9422, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+13: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SATS4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 14); - pPlayer->SEND_GOSSIP_MENU(9423, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+14: - pPlayer->SEND_GOSSIP_MENU(9424, pCreature->GetGUID()); - break; - - case GOSSIP_ACTION_INFO_DEF+20: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SATS5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 21); - pPlayer->SEND_GOSSIP_MENU(9427, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+21: - pPlayer->CLOSE_GOSSIP_MENU(); - pPlayer->AreaExploredOrEventHappens(9991); - break; - - case GOSSIP_ACTION_INFO_DEF+30: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SATS6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 31); - pPlayer->SEND_GOSSIP_MENU(384, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+31: - pPlayer->CLOSE_GOSSIP_MENU(); - pPlayer->AreaExploredOrEventHappens(10646); - break; - } - return true; -} - -bool QuestAccept_npc_altruis_the_sufferer(Player* pPlayer, Creature* pCreature, Quest const *quest) -{ - if (!pPlayer->GetQuestRewardStatus(9991)) //Survey the Land, q-id 9991 - { - pPlayer->CLOSE_GOSSIP_MENU(); - pPlayer->ActivateTaxiPathTo(532); //TaxiPath 532 - } - return true; -} - -/*###### -## npc_greatmother_geyah -######*/ - -#define GOSSIP_HGG1 "Hello, Greatmother. Garrosh told me that you wanted to speak with me." -#define GOSSIP_HGG2 "Garrosh is beyond redemption, Greatmother. I fear that in helping the Mag'har, I have convinced Garrosh that he is unfit to lead." - -#define GOSSIP_SGG1 "You raised all of the orcs here, Greatmother?" -#define GOSSIP_SGG2 "Do you believe that?" -#define GOSSIP_SGG3 "What can be done? I have tried many different things. I have done my best to help the people of Nagrand. Each time I have approached Garrosh, he has dismissed me." -#define GOSSIP_SGG4 "Left? How can you choose to leave?" -#define GOSSIP_SGG5 "What is this duty?" -#define GOSSIP_SGG6 "Is there anything I can do for you, Greatmother?" -#define GOSSIP_SGG7 "I have done all that I could, Greatmother. I thank you for your kind words." -#define GOSSIP_SGG8 "Greatmother, you are the mother of Durotan?" -#define GOSSIP_SGG9 "Greatmother, I never had the honor. Durotan died long before my time, but his heroics are known to all on my world. The orcs of Azeroth reside in a place known as Durotar, named after your son. And ... (You take a moment to breathe and think through what you are about to tell the Greatmother.)" -#define GOSSIP_SGG10 "It is my Warchief, Greatmother. The leader of my people. From my world. He ... He is the son of Durotan. He is your grandchild." -#define GOSSIP_SGG11 "I will return to Azeroth at once, Greatmother." - -//all the textId's for the below is unknown, but i do believe the gossip item texts are proper. -bool GossipHello_npc_greatmother_geyah(Player* pPlayer, Creature* pCreature) -{ - if (pCreature->isQuestGiver()) - pPlayer->PrepareQuestMenu(pCreature->GetGUID()); - - if (pPlayer->GetQuestStatus(10044) == QUEST_STATUS_INCOMPLETE) - { - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HGG1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); - } - else if (pPlayer->GetQuestStatus(10172) == QUEST_STATUS_INCOMPLETE) - { - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HGG2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10); - pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); - } - else - - pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); - - return true; -} - -bool GossipSelect_npc_greatmother_geyah(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - switch (uiAction) - { - case GOSSIP_ACTION_INFO_DEF + 1: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SGG1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF + 2: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SGG2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); - pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF + 3: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SGG3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4); - pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF + 4: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SGG4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5); - pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF + 5: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SGG5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6); - pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF + 6: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SGG6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7); - pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF + 7: - pPlayer->AreaExploredOrEventHappens(10044); - pPlayer->CLOSE_GOSSIP_MENU(); - break; - - case GOSSIP_ACTION_INFO_DEF + 10: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SGG7, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11); - pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF + 11: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SGG8, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 12); - pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF + 12: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SGG9, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 13); - pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF + 13: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SGG10, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 14); - pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF + 14: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SGG11, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 15); - pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF + 15: - pPlayer->AreaExploredOrEventHappens(10172); - pPlayer->CLOSE_GOSSIP_MENU(); - break; - } - return true; -} - -/*###### -## npc_lantresor_of_the_blade -######*/ - -#define GOSSIP_HLB "I have killed many of your ogres, Lantresor. I have no fear." -#define GOSSIP_SLB1 "Should I know? You look like an orc to me." -#define GOSSIP_SLB2 "And the other half?" -#define GOSSIP_SLB3 "I have heard of your kind, but I never thought to see the day when I would meet a half-breed." -#define GOSSIP_SLB4 "My apologies. I did not mean to offend. I am here on behalf of my people." -#define GOSSIP_SLB5 "My people ask that you pull back your Boulderfist ogres and cease all attacks on our territories. In return, we will also pull back our forces." -#define GOSSIP_SLB6 "We will fight you until the end, then, Lantresor. We will not stand idly by as you pillage our towns and kill our people." -#define GOSSIP_SLB7 "What do I need to do?" - -bool GossipHello_npc_lantresor_of_the_blade(Player* pPlayer, Creature* pCreature) -{ - if (pCreature->isQuestGiver()) - pPlayer->PrepareQuestMenu(pCreature->GetGUID()); - - if (pPlayer->GetQuestStatus(10107) == QUEST_STATUS_INCOMPLETE || pPlayer->GetQuestStatus(10108) == QUEST_STATUS_INCOMPLETE) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HLB, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - - pPlayer->SEND_GOSSIP_MENU(9361, pCreature->GetGUID()); - - return true; -} - -bool GossipSelect_npc_lantresor_of_the_blade(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - switch (uiAction) - { - case GOSSIP_ACTION_INFO_DEF: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SLB1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - pPlayer->SEND_GOSSIP_MENU(9362, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+1: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SLB2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - pPlayer->SEND_GOSSIP_MENU(9363, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+2: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SLB3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); - pPlayer->SEND_GOSSIP_MENU(9364, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+3: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SLB4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4); - pPlayer->SEND_GOSSIP_MENU(9365, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+4: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SLB5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5); - pPlayer->SEND_GOSSIP_MENU(9366, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+5: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SLB6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6); - pPlayer->SEND_GOSSIP_MENU(9367, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+6: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SLB7, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7); - pPlayer->SEND_GOSSIP_MENU(9368, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+7: - pPlayer->SEND_GOSSIP_MENU(9369, pCreature->GetGUID()); - if (pPlayer->GetQuestStatus(10107) == QUEST_STATUS_INCOMPLETE) - pPlayer->AreaExploredOrEventHappens(10107); - if (pPlayer->GetQuestStatus(10108) == QUEST_STATUS_INCOMPLETE) - pPlayer->AreaExploredOrEventHappens(10108); - break; - } - return true; -} - -/*###### -## npc_creditmarker_visist_with_ancestors -######*/ - -struct TRINITY_DLL_DECL npc_creditmarker_visit_with_ancestorsAI : public ScriptedAI -{ - npc_creditmarker_visit_with_ancestorsAI(Creature* c) : ScriptedAI(c) {} - - void Reset() {} - - void EnterCombat(Unit* who) {} - - void MoveInLineOfSight(Unit *who) - { - if (!who) - return; - - if (who->GetTypeId() == TYPEID_PLAYER) - { - if (CAST_PLR(who)->GetQuestStatus(10085) == QUEST_STATUS_INCOMPLETE) - { - uint32 creditMarkerId = m_creature->GetEntry(); - if ((creditMarkerId >= 18840) && (creditMarkerId <= 18843)) - { - // 18840: Sunspring, 18841: Laughing, 18842: Garadar, 18843: Bleeding - if (!CAST_PLR(who)->GetReqKillOrCastCurrentCount(10085, creditMarkerId)) - CAST_PLR(who)->KilledMonsterCredit(creditMarkerId, m_creature->GetGUID()); - } - } - } - } -}; - -CreatureAI* GetAI_npc_creditmarker_visit_with_ancestors(Creature* pCreature) -{ - return new npc_creditmarker_visit_with_ancestorsAI (pCreature); -} - -/*###### -## mob_sparrowhawk -######*/ - -#define SPELL_SPARROWHAWK_NET 39810 -#define SPELL_ITEM_CAPTIVE_SPARROWHAWK 39812 - -struct TRINITY_DLL_DECL mob_sparrowhawkAI : public ScriptedAI -{ - - mob_sparrowhawkAI(Creature *c) : ScriptedAI(c) {} - - uint32 Check_Timer; - uint64 PlayerGUID; - bool fleeing; - - void Reset() - { - m_creature->RemoveAurasDueToSpell(SPELL_SPARROWHAWK_NET); - Check_Timer = 1000; - PlayerGUID = 0; - fleeing = false; - } - void AttackStart(Unit *who) - { - if (PlayerGUID) - return; - - ScriptedAI::AttackStart(who); - } - - void EnterCombat(Unit* who) {} - - void MoveInLineOfSight(Unit *who) - { - if (!who || PlayerGUID) - return; - - if (!PlayerGUID && who->GetTypeId() == TYPEID_PLAYER && m_creature->IsWithinDistInMap(who, 30) && CAST_PLR(who)->GetQuestStatus(10987) == QUEST_STATUS_INCOMPLETE) - { - PlayerGUID = who->GetGUID(); - return; - } - - ScriptedAI::MoveInLineOfSight(who); - } - - void UpdateAI(const uint32 diff) - { - if (Check_Timer < diff) - { - if (PlayerGUID) - { - if (fleeing && m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() != FLEEING_MOTION_TYPE) - fleeing = false; - - Player* pPlayer = Unit::GetPlayer(PlayerGUID); - if (pPlayer && m_creature->IsWithinDistInMap(pPlayer, 30)) - { - if (!fleeing) - { - m_creature->DeleteThreatList(); - m_creature->GetMotionMaster()->MoveFleeing(pPlayer); - fleeing = true; - } - } - else if (fleeing) - { - m_creature->GetMotionMaster()->MovementExpired(false); - PlayerGUID = 0; - fleeing = false; - } - } - Check_Timer = 1000; - } else Check_Timer -= diff; - - if (PlayerGUID) - return; - - ScriptedAI::UpdateAI(diff); - } - - void SpellHit(Unit *caster, const SpellEntry *spell) - { - if (caster->GetTypeId() == TYPEID_PLAYER) - { - if (spell->Id == SPELL_SPARROWHAWK_NET && CAST_PLR(caster)->GetQuestStatus(10987) == QUEST_STATUS_INCOMPLETE) - { - m_creature->CastSpell(caster, SPELL_ITEM_CAPTIVE_SPARROWHAWK, true); - m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); - } - } - return; - } -}; - -CreatureAI* GetAI_mob_sparrowhawk(Creature* pCreature) -{ - return new mob_sparrowhawkAI (pCreature); -} - -/*#### -# -####*/ - -void AddSC_nagrand() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="mob_shattered_rumbler"; - newscript->GetAI = &GetAI_mob_shattered_rumbler; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_lump"; - newscript->GetAI = &GetAI_mob_lump; - newscript->pGossipHello = &GossipHello_mob_lump; - newscript->pGossipSelect = &GossipSelect_mob_lump; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_sunspring_villager"; - newscript->GetAI = &GetAI_mob_sunspring_villager; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_altruis_the_sufferer"; - newscript->pGossipHello = &GossipHello_npc_altruis_the_sufferer; - newscript->pGossipSelect = &GossipSelect_npc_altruis_the_sufferer; - newscript->pQuestAccept = &QuestAccept_npc_altruis_the_sufferer; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_greatmother_geyah"; - newscript->pGossipHello = &GossipHello_npc_greatmother_geyah; - newscript->pGossipSelect = &GossipSelect_npc_greatmother_geyah; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_lantresor_of_the_blade"; - newscript->pGossipHello = &GossipHello_npc_lantresor_of_the_blade; - newscript->pGossipSelect = &GossipSelect_npc_lantresor_of_the_blade; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_creditmarker_visit_with_ancestors"; - newscript->GetAI = &GetAI_npc_creditmarker_visit_with_ancestors; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_sparrowhawk"; - newscript->GetAI = &GetAI_mob_sparrowhawk; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/netherstorm/netherstorm.cpp b/src/bindings/scripts/scripts/zone/netherstorm/netherstorm.cpp deleted file mode 100644 index d3d4a771e71..00000000000 --- a/src/bindings/scripts/scripts/zone/netherstorm/netherstorm.cpp +++ /dev/null @@ -1,952 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Netherstorm -SD%Complete: 75 -SDComment: Quest support: 10337, 10438, 10652 (special flight paths), 10299,10321,10322,10323,10329,10330,10338,10365(Shutting Down Manaforge), 10198 -SDCategory: Netherstorm -EndScriptData */ - -/* ContentData -npc_manaforge_control_console -go_manaforge_control_console -npc_commander_dawnforge -npc_bessy -EndContentData */ - -#include "precompiled.h" -#include "../../npc/npc_escortAI.h" - -/*###### -## npc_manaforge_control_console -######*/ - -#define EMOTE_START -1000296 -#define EMOTE_60 -1000297 -#define EMOTE_30 -1000298 -#define EMOTE_10 -1000299 -#define EMOTE_COMPLETE -1000300 -#define EMOTE_ABORT -1000301 - -#define ENTRY_BNAAR_C_CONSOLE 20209 -#define ENTRY_CORUU_C_CONSOLE 20417 -#define ENTRY_DURO_C_CONSOLE 20418 -#define ENTRY_ARA_C_CONSOLE 20440 - -#define ENTRY_SUNFURY_TECH 20218 -#define ENTRY_SUNFURY_PROT 20436 - -#define ENTRY_ARA_TECH 20438 -#define ENTRY_ARA_ENGI 20439 -#define ENTRY_ARA_GORKLONN 20460 - -#define SPELL_DISABLE_VISUAL 35031 -#define SPELL_INTERRUPT_1 35016 //ACID mobs should cast this -#define SPELL_INTERRUPT_2 35176 //ACID mobs should cast this (Manaforge Ara-version) - -struct TRINITY_DLL_DECL npc_manaforge_control_consoleAI : public ScriptedAI -{ - npc_manaforge_control_consoleAI(Creature *c) : ScriptedAI(c) {} - - uint32 Event_Timer; - uint32 Wave_Timer; - uint32 Phase; - bool Wave; - uint64 someplayer; - uint64 goConsole; - Creature* add; - - void Reset() - { - Event_Timer = 3000; - Wave_Timer = 0; - Phase = 1; - Wave = false; - someplayer = 0; - goConsole = 0; - Creature* add = NULL; - } - - void EnterCombat(Unit *who) { return; } - - /*void SpellHit(Unit *caster, const SpellEntry *spell) - { - //we have no way of telling the Creature was hit by spell -> got aura applied after 10-12 seconds - //then no way for the mobs to actually stop the shutdown as intended. - if (spell->Id == SPELL_INTERRUPT_1) - DoSay("Silence! I kill you!",LANG_UNIVERSAL, NULL); - }*/ - - void JustDied(Unit* killer) - { - DoScriptText(EMOTE_ABORT, m_creature); - - if (someplayer) - { - Unit* p = Unit::GetUnit((*m_creature),someplayer); - if (p && p->GetTypeId() == TYPEID_PLAYER) - { - switch(m_creature->GetEntry()) - { - case ENTRY_BNAAR_C_CONSOLE: - CAST_PLR(p)->FailQuest(10299); - CAST_PLR(p)->FailQuest(10329); - break; - case ENTRY_CORUU_C_CONSOLE: - CAST_PLR(p)->FailQuest(10321); - CAST_PLR(p)->FailQuest(10330); - break; - case ENTRY_DURO_C_CONSOLE: - CAST_PLR(p)->FailQuest(10322); - CAST_PLR(p)->FailQuest(10338); - break; - case ENTRY_ARA_C_CONSOLE: - CAST_PLR(p)->FailQuest(10323); - CAST_PLR(p)->FailQuest(10365); - break; - } - } - } - - if (goConsole) - { - if (GameObject* pGo = GameObject::GetGameObject((*m_creature),goConsole)) - pGo->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE); - } - } - - void DoWaveSpawnForCreature(Creature* pCreature) - { - switch(pCreature->GetEntry()) - { - case ENTRY_BNAAR_C_CONSOLE: - if (rand()%2) - { - add = m_creature->SummonCreature(ENTRY_SUNFURY_TECH,2933.68,4162.55,164.00,1.60,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000); - if (add) add->GetMotionMaster()->MovePoint(0,2927.36,4212.97,164.00); - } - else - { - add = m_creature->SummonCreature(ENTRY_SUNFURY_TECH,2927.36,4212.97,164.00,4.94,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000); - if (add) add->GetMotionMaster()->MovePoint(0,2933.68,4162.55,164.00); - } - Wave_Timer = 30000; - break; - case ENTRY_CORUU_C_CONSOLE: - add = m_creature->SummonCreature(ENTRY_SUNFURY_TECH,2445.21,2765.26,134.49,3.93,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000); - if (add) add->GetMotionMaster()->MovePoint(0,2424.21,2740.15,133.81); - add = m_creature->SummonCreature(ENTRY_SUNFURY_TECH,2429.86,2731.85,134.53,1.31,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000); - if (add) add->GetMotionMaster()->MovePoint(0,2435.37,2766.04,133.81); - Wave_Timer = 20000; - break; - case ENTRY_DURO_C_CONSOLE: - add = m_creature->SummonCreature(ENTRY_SUNFURY_TECH,2986.80,2205.36,165.37,3.74,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000); - if (add) add->GetMotionMaster()->MovePoint(0,2985.15,2197.32,164.79); - add = m_creature->SummonCreature(ENTRY_SUNFURY_TECH,2952.91,2191.20,165.32,0.22,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000); - if (add) add->GetMotionMaster()->MovePoint(0,2060.01,2185.27,164.67); - Wave_Timer = 15000; - break; - case ENTRY_ARA_C_CONSOLE: - if (rand()%2) - { - add = m_creature->SummonCreature(ENTRY_ARA_TECH,4035.11,4038.97,194.27,2.57,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000); - if (add) add->GetMotionMaster()->MovePoint(0,4003.42,4040.19,193.49); - add = m_creature->SummonCreature(ENTRY_ARA_TECH,4033.66,4036.79,194.28,2.57,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000); - if (add) add->GetMotionMaster()->MovePoint(0,4003.42,4040.19,193.49); - add = m_creature->SummonCreature(ENTRY_ARA_TECH,4037.13,4037.30,194.23,2.57,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000); - if (add) add->GetMotionMaster()->MovePoint(0,4003.42,4040.19,193.49); - } - else - { - add = m_creature->SummonCreature(ENTRY_ARA_TECH,3099.59,4049.30,194.22,0.05,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000); - if (add) add->GetMotionMaster()->MovePoint(0,4028.01,4035.17,193.59); - add = m_creature->SummonCreature(ENTRY_ARA_TECH,3999.72,4046.75,194.22,0.05,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000); - if (add) add->GetMotionMaster()->MovePoint(0,4028.01,4035.17,193.59); - add = m_creature->SummonCreature(ENTRY_ARA_TECH,3996.81,4048.26,194.22,0.05,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000); - if (add) add->GetMotionMaster()->MovePoint(0,4028.01,4035.17,193.59); - } - Wave_Timer = 15000; - break; - } - } - void DoFinalSpawnForCreature(Creature* pCreature) - { - switch(pCreature->GetEntry()) - { - case ENTRY_BNAAR_C_CONSOLE: - add = m_creature->SummonCreature(ENTRY_SUNFURY_TECH,2946.52,4201.42,163.47,3.54,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000); - if (add) add->GetMotionMaster()->MovePoint(0,2927.49,4192.81,163.00); - break; - case ENTRY_CORUU_C_CONSOLE: - add = m_creature->SummonCreature(ENTRY_SUNFURY_TECH,2453.88,2737.85,133.27,2.59,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000); - if (add) add->GetMotionMaster()->MovePoint(0,2433.96,2751.53,133.85); - add = m_creature->SummonCreature(ENTRY_SUNFURY_TECH,2441.62,2735.32,134.49,1.97,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000); - if (add) add->GetMotionMaster()->MovePoint(0,2433.96,2751.53,133.85); - add = m_creature->SummonCreature(ENTRY_SUNFURY_TECH,2450.73,2754.50,134.49,3.29,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000); - if (add) add->GetMotionMaster()->MovePoint(0,2433.96,2751.53,133.85); - break; - case ENTRY_DURO_C_CONSOLE: - add = m_creature->SummonCreature(ENTRY_SUNFURY_TECH,2956.18,2202.85,165.32,5.45,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000); - if (add) add->GetMotionMaster()->MovePoint(0,2972.27,2193.22,164.48); - add = m_creature->SummonCreature(ENTRY_SUNFURY_TECH,2975.30,2211.50,165.32,4.55,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000); - if (add) add->GetMotionMaster()->MovePoint(0,2972.27,2193.22,164.48); - add = m_creature->SummonCreature(ENTRY_SUNFURY_PROT,2965.02,2217.45,164.16,4.96,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000); - if (add) add->GetMotionMaster()->MovePoint(0,2972.27,2193.22,164.48); - break; - case ENTRY_ARA_C_CONSOLE: - add = m_creature->SummonCreature(ENTRY_ARA_ENGI,3994.51,4020.46,192.18,0.91,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000); - if (add) add->GetMotionMaster()->MovePoint(0,4008.35,4035.04,192.70); - add = m_creature->SummonCreature(ENTRY_ARA_GORKLONN,4021.56,4059.35,193.59,4.44,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000); - if (add) add->GetMotionMaster()->MovePoint(0,4016.62,4039.89,193.46); - break; - } - } - - void UpdateAI(const uint32 diff) - { - if (Event_Timer < diff) - { - switch(Phase) - { - case 1: - if (someplayer) - { - Unit* u = Unit::GetUnit((*m_creature), someplayer); - if (u && u->GetTypeId() == TYPEID_PLAYER) DoScriptText(EMOTE_START, m_creature, u); - } - Event_Timer = 60000; - Wave = true; - ++Phase; - break; - case 2: - DoScriptText(EMOTE_60, m_creature); - Event_Timer = 30000; - ++Phase; - break; - case 3: - DoScriptText(EMOTE_30, m_creature); - Event_Timer = 20000; - DoFinalSpawnForCreature(m_creature); - ++Phase; - break; - case 4: - DoScriptText(EMOTE_10, m_creature); - Event_Timer = 10000; - Wave = false; - ++Phase; - break; - case 5: - DoScriptText(EMOTE_COMPLETE, m_creature); - if (someplayer) - { - Unit* u = Unit::GetUnit((*m_creature),someplayer); - if (u && u->GetTypeId() == TYPEID_PLAYER) - CAST_PLR(u)->KilledMonsterCredit(m_creature->GetEntry(),m_creature->GetGUID()); - DoCast(m_creature,SPELL_DISABLE_VISUAL); - } - if (goConsole) - { - if (GameObject* pGo = GameObject::GetGameObject((*m_creature),goConsole)) - pGo->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE); - } - ++Phase; - break; - } - } else Event_Timer -= diff; - - if (Wave) - { - if (Wave_Timer < diff) - { - DoWaveSpawnForCreature(m_creature); - } else Wave_Timer -= diff; - } - } -}; -CreatureAI* GetAI_npc_manaforge_control_console(Creature* pCreature) -{ - return new npc_manaforge_control_consoleAI (pCreature); -} - -/*###### -## go_manaforge_control_console -######*/ - -//TODO: clean up this workaround when Trinity adds support to do it properly (with gossip selections instead of instant summon) -bool GOHello_go_manaforge_control_console(Player* pPlayer, GameObject* pGo) -{ - if (pGo->GetGoType() == GAMEOBJECT_TYPE_QUESTGIVER) - { - pPlayer->PrepareQuestMenu(pGo->GetGUID()); - pPlayer->SendPreparedQuest(pGo->GetGUID()); - } - - Creature* manaforge; - manaforge = NULL; - - switch(pGo->GetAreaId()) - { - case 3726: //b'naar - if ((pPlayer->GetQuestStatus(10299) == QUEST_STATUS_INCOMPLETE || pPlayer->GetQuestStatus(10329) == QUEST_STATUS_INCOMPLETE) && - pPlayer->HasItemCount(29366,1)) - manaforge = pPlayer->SummonCreature(ENTRY_BNAAR_C_CONSOLE,2918.95,4189.98,161.88,0.34,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,125000); - break; - case 3730: //coruu - if ((pPlayer->GetQuestStatus(10321) == QUEST_STATUS_INCOMPLETE || pPlayer->GetQuestStatus(10330) == QUEST_STATUS_INCOMPLETE) && - pPlayer->HasItemCount(29396,1)) - manaforge = pPlayer->SummonCreature(ENTRY_CORUU_C_CONSOLE,2426.77,2750.38,133.24,2.14,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,125000); - break; - case 3734: //duro - if ((pPlayer->GetQuestStatus(10322) == QUEST_STATUS_INCOMPLETE || pPlayer->GetQuestStatus(10338) == QUEST_STATUS_INCOMPLETE) && - pPlayer->HasItemCount(29397,1)) - manaforge = pPlayer->SummonCreature(ENTRY_DURO_C_CONSOLE,2976.48,2183.29,163.20,1.85,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,125000); - break; - case 3722: //ara - if ((pPlayer->GetQuestStatus(10323) == QUEST_STATUS_INCOMPLETE || pPlayer->GetQuestStatus(10365) == QUEST_STATUS_INCOMPLETE) && - pPlayer->HasItemCount(29411,1)) - manaforge = pPlayer->SummonCreature(ENTRY_ARA_C_CONSOLE,4013.71,4028.76,192.10,1.25,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,125000); - break; - } - - if (manaforge) - { - CAST_AI(npc_manaforge_control_consoleAI, manaforge->AI())->someplayer = pPlayer->GetGUID(); - CAST_AI(npc_manaforge_control_consoleAI, manaforge->AI())->goConsole = pGo->GetGUID(); - pGo->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE); - } - return true; -} - -/*###### -## npc_commander_dawnforge -######*/ - -// The Speech of Dawnforge, Ardonis & Pathaleon -#define SAY_COMMANDER_DAWNFORGE_1 -1000128 -#define SAY_ARCANIST_ARDONIS_1 -1000129 -#define SAY_COMMANDER_DAWNFORGE_2 -1000130 -#define SAY_PATHALEON_CULATOR_IMAGE_1 -1000131 -#define SAY_COMMANDER_DAWNFORGE_3 -1000132 -#define SAY_PATHALEON_CULATOR_IMAGE_2 -1000133 -#define SAY_PATHALEON_CULATOR_IMAGE_2_1 -1000134 -#define SAY_PATHALEON_CULATOR_IMAGE_2_2 -1000135 -#define SAY_COMMANDER_DAWNFORGE_4 -1000136 -#define SAY_ARCANIST_ARDONIS_2 -1000136 -#define SAY_COMMANDER_DAWNFORGE_5 -1000137 - -#define QUEST_INFO_GATHERING 10198 -#define SPELL_SUNFURY_DISGUISE 34603 - -// Entries of Arcanist Ardonis, Commander Dawnforge, Pathaleon the Curators Image -const uint32 CreatureEntry[3] = -{ - 19830, // Ardonis - 19831, // Dawnforge - 21504 // Pathaleon -}; - -struct TRINITY_DLL_DECL npc_commander_dawnforgeAI : public ScriptedAI -{ - npc_commander_dawnforgeAI(Creature *c) : ScriptedAI(c) { Reset (); } - - - uint64 PlayerGUID; - uint64 ardonisGUID; - uint64 pathaleonGUID; - - - uint32 Phase; - uint32 PhaseSubphase; - uint32 Phase_Timer; - bool isEvent; - - float angle_dawnforge; - float angle_ardonis; - - void Reset() - { - PlayerGUID = 0; - ardonisGUID = 0; - pathaleonGUID = 0; - - Phase = 1; - PhaseSubphase = 0; - Phase_Timer = 4000; - isEvent = false; - } - - void EnterCombat(Unit *who) { } - - void JustSummoned(Creature *summoned) - { - pathaleonGUID = summoned->GetGUID(); - } - - // Emote Ardonis and Pathaleon - void Turn_to_Pathaleons_Image() - { - Creature *ardonis = Unit::GetCreature(*m_creature,ardonisGUID); - Creature *pathaleon = Unit::GetCreature(*m_creature,pathaleonGUID); - Player* pPlayer = Unit::GetPlayer(PlayerGUID); - - if (!ardonis || !pathaleon || !pPlayer) - return; - - //Calculate the angle to Pathaleon - angle_dawnforge = m_creature->GetAngle(pathaleon->GetPositionX(), pathaleon->GetPositionY()); - angle_ardonis = ardonis->GetAngle(pathaleon->GetPositionX(), pathaleon->GetPositionY()); - - //Turn Dawnforge and update - m_creature->SetOrientation(angle_dawnforge); - m_creature->SendUpdateToPlayer(pPlayer); - //Turn Ardonis and update - ardonis->SetOrientation(angle_ardonis); - ardonis->SendUpdateToPlayer(pPlayer); - - //Set them to kneel - m_creature->SetStandState(UNIT_STAND_STATE_KNEEL); - ardonis->SetStandState(UNIT_STAND_STATE_KNEEL); - } - - //Set them back to each other - void Turn_to_eachother() - { - if (Unit *ardonis = Unit::GetUnit(*m_creature,ardonisGUID)) - { - Player* pPlayer = Unit::GetPlayer(PlayerGUID); - - if (!pPlayer) - return; - - angle_dawnforge = m_creature->GetAngle(ardonis->GetPositionX(), ardonis->GetPositionY()); - angle_ardonis = ardonis->GetAngle(m_creature->GetPositionX(), m_creature->GetPositionY()); - - //Turn Dawnforge and update - m_creature->SetOrientation(angle_dawnforge); - m_creature->SendUpdateToPlayer(pPlayer); - //Turn Ardonis and update - ardonis->SetOrientation(angle_ardonis); - ardonis->SendUpdateToPlayer(pPlayer); - - //Set state - m_creature->SetStandState(UNIT_STAND_STATE_STAND); - ardonis->SetStandState(UNIT_STAND_STATE_STAND); - } - } - - bool CanStartEvent(Player* pPlayer) - { - if (!isEvent) - { - Creature* ardonis = me->FindNearestCreature(CreatureEntry[0], 10.0f); - if (!ardonis) - return false; - - ardonisGUID = ardonis->GetGUID(); - PlayerGUID = pPlayer->GetGUID(); - - isEvent = true; - - Turn_to_eachother(); - return true; - } - - debug_log("TSCR: npc_commander_dawnforge event already in progress, need to wait."); - return false; - } - - void UpdateAI(const uint32 diff) - { - //Is event even running? - if (!isEvent) - return; - - //Phase timing - if (Phase_Timer >= diff) - { - Phase_Timer -= diff; - return; - } - - Unit *ardonis = Unit::GetUnit(*m_creature,ardonisGUID); - Unit *pathaleon = Unit::GetUnit(*m_creature,pathaleonGUID); - Player* pPlayer = Unit::GetPlayer(PlayerGUID); - - if (!ardonis || !pPlayer) - { - Reset(); - return; - } - - if (Phase > 4 && !pathaleon) - { - Reset(); - return; - } - - //Phase 1 Dawnforge say - switch (Phase) - { - case 1: - DoScriptText(SAY_COMMANDER_DAWNFORGE_1, m_creature); - ++Phase; - Phase_Timer = 16000; - break; - //Phase 2 Ardonis say - case 2: - DoScriptText(SAY_ARCANIST_ARDONIS_1, ardonis); - ++Phase; - Phase_Timer = 16000; - break; - //Phase 3 Dawnforge say - case 3: - DoScriptText(SAY_COMMANDER_DAWNFORGE_2, m_creature); - ++Phase; - Phase_Timer = 16000; - break; - //Phase 4 Pathaleon spawns up to phase 9 - case 4: - //spawn pathaleon's image - m_creature->SummonCreature(CreatureEntry[2], 2325.851563, 2799.534668, 133.084229, 6.038996, TEMPSUMMON_TIMED_DESPAWN, 90000); - ++Phase; - Phase_Timer = 500; - break; - //Phase 5 Pathaleon say - case 5: - DoScriptText(SAY_PATHALEON_CULATOR_IMAGE_1, pathaleon); - ++Phase; - Phase_Timer = 6000; - break; - //Phase 6 - case 6: - switch(PhaseSubphase) - { - //Subphase 1: Turn Dawnforge and Ardonis - case 0: - Turn_to_Pathaleons_Image(); - ++PhaseSubphase; - Phase_Timer = 8000; - break; - //Subphase 2 Dawnforge say - case 1: - DoScriptText(SAY_COMMANDER_DAWNFORGE_3, m_creature); - PhaseSubphase = 0; - ++Phase; - Phase_Timer = 8000; - break; - } - break; - //Phase 7 Pathaleons say 3 Sentence, every sentence need a subphase - case 7: - switch(PhaseSubphase) - { - //Subphase 1 - case 0: - DoScriptText(SAY_PATHALEON_CULATOR_IMAGE_2, pathaleon); - ++PhaseSubphase; - Phase_Timer = 12000; - break; - //Subphase 2 - case 1: - DoScriptText(SAY_PATHALEON_CULATOR_IMAGE_2_1, pathaleon); - ++PhaseSubphase; - Phase_Timer = 16000; - break; - //Subphase 3 - case 2: - DoScriptText(SAY_PATHALEON_CULATOR_IMAGE_2_2, pathaleon); - PhaseSubphase = 0; - ++Phase; - Phase_Timer = 10000; - break; - } - break; - //Phase 8 Dawnforge & Ardonis say - case 8: - DoScriptText(SAY_COMMANDER_DAWNFORGE_4, m_creature); - DoScriptText(SAY_ARCANIST_ARDONIS_2, ardonis); - ++Phase; - Phase_Timer = 4000; - break; - //Phase 9 Pathaleons Despawn, Reset Dawnforge & Ardonis angle - case 9: - Turn_to_eachother(); - //hide pathaleon, unit will despawn shortly - pathaleon->SetVisibility(VISIBILITY_OFF); - PhaseSubphase = 0; - ++Phase; - Phase_Timer = 3000; - break; - //Phase 10 Dawnforge say - case 10: - DoScriptText(SAY_COMMANDER_DAWNFORGE_5, m_creature); - pPlayer->AreaExploredOrEventHappens(QUEST_INFO_GATHERING); - Reset(); - break; - } - } -}; - -CreatureAI* GetAI_npc_commander_dawnforge(Creature* pCreature) -{ - return new npc_commander_dawnforgeAI(pCreature); -} - -bool AreaTrigger_at_commander_dawnforge(Player* pPlayer, AreaTriggerEntry *at) -{ - //if player lost aura or not have at all, we should not try start event. - if (!pPlayer->HasAura(SPELL_SUNFURY_DISGUISE)) - return false; - - if (pPlayer->isAlive() && pPlayer->GetQuestStatus(QUEST_INFO_GATHERING) == QUEST_STATUS_INCOMPLETE) - { - Creature* Dawnforge = pPlayer->FindNearestCreature(CreatureEntry[1], 30.0f); - - if (!Dawnforge) - return false; - - if (CAST_AI(npc_commander_dawnforgeAI, Dawnforge->AI())->CanStartEvent(pPlayer)) - return true; - } - return false; -} - -/*###### -## npc_professor_dabiri -######*/ - -#define SPELL_PHASE_DISTRUPTOR 35780 -#define GOSSIP_ITEM "I need a new phase distruptor, Professor" -#define WHISPER_DABIRI -1000302 - -#define QUEST_DIMENSIUS 10439 -#define QUEST_ON_NETHERY_WINGS 10438 - -bool GossipHello_npc_professor_dabiri(Player* pPlayer, Creature* pCreature) -{ - if (pCreature->isQuestGiver()) - pPlayer->PrepareQuestMenu(pCreature->GetGUID()); - - if (pPlayer->GetQuestStatus(QUEST_ON_NETHERY_WINGS) == QUEST_STATUS_INCOMPLETE && !pPlayer->HasItemCount(29778, 1)) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - - pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); - - return true; -} - -bool GossipSelect_npc_professor_dabiri(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) - { - pCreature->CastSpell(pPlayer, SPELL_PHASE_DISTRUPTOR, false); - pPlayer->CLOSE_GOSSIP_MENU(); - } - - return true; -} - -bool QuestAccept_npc_professor_dabiri(Player* pPlayer, Creature* pCreature, Quest const *quest) -{ - if (quest->GetQuestId() == QUEST_DIMENSIUS) - DoScriptText(WHISPER_DABIRI, pCreature, pPlayer); - - return true; -} - -/*###### -## mob_phase_hunter -######*/ - -#define SUMMONED_MOB 19595 -#define EMOTE_WEAK -1000303 - -// Spells -#define SPELL_PHASE_SLIP 36574 -#define SPELL_MANA_BURN 13321 -#define SPELL_MATERIALIZE 34804 -#define SPELL_DE_MATERIALIZE 34804 - -struct TRINITY_DLL_DECL mob_phase_hunterAI : public ScriptedAI -{ - - mob_phase_hunterAI(Creature *c) : ScriptedAI(c) {} - - bool Weak; - bool Materialize; - bool Drained; - - int WeakPercent; - uint64 PlayerGUID; - uint32 Health; - uint32 Level; - uint32 PhaseSlipVulnerabilityTimer; - uint32 ManaBurnTimer; - - void Reset() - { - Weak = false; - Materialize = false; - Drained = false; - - WeakPercent = 25 + (rand()%16); // 25-40 - PlayerGUID = 0; - ManaBurnTimer = 5000 + (rand()%3 * 1000); // 5-8 sec cd - } - - void EnterCombat(Unit *who) - { - if (Player* pPlayer = who->GetCharmerOrOwnerPlayerOrPlayerItself()) - PlayerGUID = pPlayer->GetGUID(); - } - - void SpellHit(Unit *caster, const SpellEntry *spell) - { - DoCast(m_creature, SPELL_DE_MATERIALIZE); - } - - void UpdateAI(const uint32 diff) - { - if (!Materialize) - { - DoCast(m_creature, SPELL_MATERIALIZE); - Materialize = true; - } - - if (m_creature->HasAuraType(SPELL_AURA_MOD_DECREASE_SPEED) || m_creature->hasUnitState(UNIT_STAT_ROOT)) // if the mob is rooted/slowed by spells eg.: Entangling Roots, Frost Nova, Hamstring, Crippling Poison, etc. => remove it - DoCast(m_creature, SPELL_PHASE_SLIP); - - if (!UpdateVictim()) - return; - - if (ManaBurnTimer < diff) // cast Mana Burn - { - if (m_creature->getVictim()->GetCreateMana() > 0) - { - DoCast(m_creature->getVictim(), SPELL_MANA_BURN); - ManaBurnTimer = 8000 + (rand()%10 * 1000); // 8-18 sec cd - } - }else ManaBurnTimer -= diff; - - if (PlayerGUID) // start: support for quest 10190 - { - Unit* target = Unit::GetUnit((*m_creature), PlayerGUID); - - if (target && !Weak && m_creature->GetHealth() < (m_creature->GetMaxHealth() / 100 * WeakPercent) - && CAST_PLR(target)->GetQuestStatus(10190) == QUEST_STATUS_INCOMPLETE) - { - DoScriptText(EMOTE_WEAK, m_creature); - Weak = true; - } - if (Weak && !Drained && m_creature->HasAura(34219)) - { - Drained = true; - - Health = m_creature->GetHealth(); // get the normal mob's data - Level = m_creature->getLevel(); - - m_creature->AttackStop(); // delete the normal mob - m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - m_creature->RemoveCorpse(); - - Creature* DrainedPhaseHunter = NULL; - - if (!DrainedPhaseHunter) - DrainedPhaseHunter = m_creature->SummonCreature(SUMMONED_MOB, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), m_creature->GetOrientation(), TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000); // summon the mob - - if (DrainedPhaseHunter) - { - DrainedPhaseHunter->SetLevel(Level); // set the summoned mob's data - DrainedPhaseHunter->SetHealth(Health); - DrainedPhaseHunter->AddThreat(target, 10000.0f); - DrainedPhaseHunter->AI()->AttackStart(target); - } - } - }// end: support for quest 10190 - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_phase_hunter(Creature* pCreature) -{ - return new mob_phase_hunterAI (pCreature); -} - -/*###### -## npc_bessy -######*/ - -#define Q_ALMABTRIEB 10337 -#define N_THADELL 20464 -#define SPAWN_FIRST 20512 -#define SPAWN_SECOND 19881 -#define SAY_THADELL_1 -1000304 -#define SAY_THADELL_2 -1000305 - -struct TRINITY_DLL_DECL npc_bessyAI : public npc_escortAI -{ - - npc_bessyAI(Creature *c) : npc_escortAI(c) {} - - bool Completed; - - void JustDied(Unit* killer) - { - if (PlayerGUID) - { - if (Player* pPlayer = Unit::GetPlayer(PlayerGUID)) - CAST_PLR(pPlayer)->FailQuest(Q_ALMABTRIEB); - } - } - - void WaypointReached(uint32 i) - { - Player* pPlayer = Unit::GetPlayer(PlayerGUID); - - if (!pPlayer) - return; - - switch(i) - { - case 3: //first spawn - m_creature->SummonCreature(SPAWN_FIRST, 2449.67, 2183.11, 96.85, 6.20, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - m_creature->SummonCreature(SPAWN_FIRST, 2449.53, 2184.43, 96.36, 6.27, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - m_creature->SummonCreature(SPAWN_FIRST, 2449.85, 2186.34, 97.57, 6.08, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - break; - - case 7: - m_creature->SummonCreature(SPAWN_SECOND, 2309.64, 2186.24, 92.25, 6.06, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - m_creature->SummonCreature(SPAWN_SECOND, 2309.25, 2183.46, 91.75, 6.22, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - break; - - case 12: - if (pPlayer) - { - CAST_PLR(pPlayer)->GroupEventHappens(Q_ALMABTRIEB, m_creature); - Completed = true; - } - {Unit* Thadell = me->FindNearestCreature(N_THADELL, 30); - if (Thadell) - DoScriptText(SAY_THADELL_1, m_creature);}break; - case 13: - {Unit* Thadell = me->FindNearestCreature(N_THADELL, 30); - if (Thadell) - DoScriptText(SAY_THADELL_2, m_creature, pPlayer);}break; - } - } - - void JustSummoned(Creature* summoned) - { - summoned->AI()->AttackStart(m_creature); - } - - void EnterCombat(Unit* who){} - - void Reset() - { - Completed = false; - m_creature->setFaction(35); - } - - void UpdateAI(const uint32 diff) - { - npc_escortAI::UpdateAI(diff); - } - -}; - -bool QuestAccept_npc_bessy(Player* pPlayer, Creature* pCreature, Quest const* quest) -{ - if (quest->GetQuestId() == Q_ALMABTRIEB) - { - pCreature->setFaction(113); - pCreature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - CAST_AI(npc_escortAI, (pCreature->AI()))->Start(true, false, pPlayer->GetGUID()); - } - return true; -} - -CreatureAI* GetAI_npc_bessy(Creature* pCreature) -{ - npc_bessyAI* bessyAI = new npc_bessyAI(pCreature); - - bessyAI->AddWaypoint(0, 2488.77, 2184.89, 104.64); - bessyAI->AddWaypoint(1, 2478.72, 2184.77, 98.58); - bessyAI->AddWaypoint(2, 2473.52, 2184.71, 99.00); - bessyAI->AddWaypoint(3, 2453.15, 2184.96, 97.09,4000); - bessyAI->AddWaypoint(4, 2424.18, 2184.15, 94.11); - bessyAI->AddWaypoint(5, 2413.18, 2184.15, 93.42); - bessyAI->AddWaypoint(6, 2402.02, 2183.90, 87.59); - bessyAI->AddWaypoint(7, 2333.31, 2181.63, 90.03,4000); - bessyAI->AddWaypoint(8, 2308.73, 2184.34, 92.04); - bessyAI->AddWaypoint(9, 2303.10, 2196.89, 94.94); - bessyAI->AddWaypoint(10, 2304.58, 2272.23, 96.67); - bessyAI->AddWaypoint(11, 2297.09, 2271.40, 95.16); - bessyAI->AddWaypoint(12, 2297.68, 2266.79, 95.07,4000); - bessyAI->AddWaypoint(13, 2297.67, 2266.76, 95.07,4000); - - return bessyAI; -} - -/*###### -## -######*/ - -void AddSC_netherstorm() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="go_manaforge_control_console"; - newscript->pGOHello = &GOHello_go_manaforge_control_console; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_manaforge_control_console"; - newscript->GetAI = &GetAI_npc_manaforge_control_console; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "npc_commander_dawnforge"; - newscript->GetAI = &GetAI_npc_commander_dawnforge; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "at_commander_dawnforge"; - newscript->pAreaTrigger = &AreaTrigger_at_commander_dawnforge; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "npc_professor_dabiri"; - newscript->pGossipHello = &GossipHello_npc_professor_dabiri; - newscript->pGossipSelect = &GossipSelect_npc_professor_dabiri; - newscript->pQuestAccept = &QuestAccept_npc_professor_dabiri; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_phase_hunter"; - newscript->GetAI = &GetAI_mob_phase_hunter; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "npc_bessy"; - newscript->GetAI = &GetAI_npc_bessy; - newscript->pQuestAccept = &QuestAccept_npc_bessy; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/orgrimmar/orgrimmar.cpp b/src/bindings/scripts/scripts/zone/orgrimmar/orgrimmar.cpp deleted file mode 100644 index aa0ddef0581..00000000000 --- a/src/bindings/scripts/scripts/zone/orgrimmar/orgrimmar.cpp +++ /dev/null @@ -1,286 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Orgrimmar -SD%Complete: 100 -SDComment: Quest support: 2460, 5727, 6566 -SDCategory: Orgrimmar -EndScriptData */ - -/* ContentData -npc_neeru_fireblade npc_text + gossip options text missing -npc_shenthul -npc_thrall_warchief -EndContentData */ - -#include "precompiled.h" - -/*###### -## npc_neeru_fireblade -######*/ - -#define QUEST_5727 5727 - -#define GOSSIP_HNF "You may speak frankly, Neeru..." -#define GOSSIP_SNF "[PH] ..." -bool GossipHello_npc_neeru_fireblade(Player* pPlayer, Creature* pCreature) -{ - if (pCreature->isQuestGiver()) - pPlayer->PrepareQuestMenu(pCreature->GetGUID()); - - if (pPlayer->GetQuestStatus(QUEST_5727) == QUEST_STATUS_INCOMPLETE) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HNF, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - - pPlayer->SEND_GOSSIP_MENU(4513, pCreature->GetGUID()); - return true; -} - -bool GossipSelect_npc_neeru_fireblade(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - switch (uiAction) - { - case GOSSIP_ACTION_INFO_DEF+1: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SNF, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); - pPlayer->SEND_GOSSIP_MENU(4513, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+2: - pPlayer->CLOSE_GOSSIP_MENU(); - pPlayer->AreaExploredOrEventHappens(QUEST_5727); - break; - } - return true; -} - -/*###### -## npc_shenthul -######*/ - -enum -{ - QUEST_SHATTERED_SALUTE = 2460 -}; - -struct TRINITY_DLL_DECL npc_shenthulAI : public ScriptedAI -{ - npc_shenthulAI(Creature* c) : ScriptedAI(c) {} - - bool CanTalk; - bool CanEmote; - uint32 Salute_Timer; - uint32 Reset_Timer; - uint64 PlayerGUID; - - void Reset() - { - CanTalk = false; - CanEmote = false; - Salute_Timer = 6000; - Reset_Timer = 0; - PlayerGUID = 0; - } - - void EnterCombat(Unit* who) { } - - void UpdateAI(const uint32 diff) - { - if (CanEmote) - { - if (Reset_Timer < diff) - { - if (Player* pPlayer = Unit::GetPlayer(PlayerGUID)) - { - if (pPlayer->GetTypeId() == TYPEID_PLAYER && pPlayer->GetQuestStatus(QUEST_SHATTERED_SALUTE) == QUEST_STATUS_INCOMPLETE) - pPlayer->FailQuest(QUEST_SHATTERED_SALUTE); - } - Reset(); - } else Reset_Timer -= diff; - } - - if (CanTalk && !CanEmote) - { - if (Salute_Timer < diff) - { - m_creature->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE); - CanEmote = true; - Reset_Timer = 60000; - } else Salute_Timer -= diff; - } - - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - - void ReceiveEmote(Player* pPlayer, uint32 emote) - { - if (emote == TEXTEMOTE_SALUTE && pPlayer->GetQuestStatus(QUEST_SHATTERED_SALUTE) == QUEST_STATUS_INCOMPLETE) - { - if (CanEmote) - { - pPlayer->AreaExploredOrEventHappens(QUEST_SHATTERED_SALUTE); - Reset(); - } - } - } -}; - -CreatureAI* GetAI_npc_shenthul(Creature* pCreature) -{ - return new npc_shenthulAI (pCreature); -} - -bool QuestAccept_npc_shenthul(Player* pPlayer, Creature* pCreature, Quest const* quest) -{ - if (quest->GetQuestId() == QUEST_SHATTERED_SALUTE) - { - CAST_AI(npc_shenthulAI, pCreature->AI())->CanTalk = true; - CAST_AI(npc_shenthulAI, pCreature->AI())->PlayerGUID = pPlayer->GetGUID(); - } - return true; -} - -/*###### -## npc_thrall_warchief -######*/ - -#define QUEST_6566 6566 - -#define SPELL_CHAIN_LIGHTNING 16033 -#define SPELL_SHOCK 16034 - -#define GOSSIP_HTW "Please share your wisdom with me, Warchief." -#define GOSSIP_STW1 "What discoveries?" -#define GOSSIP_STW2 "Usurper?" -#define GOSSIP_STW3 "With all due respect, Warchief - why not allow them to be destroyed? Does this not strengthen our position?" -#define GOSSIP_STW4 "I... I did not think of it that way, Warchief." -#define GOSSIP_STW5 "I live only to serve, Warchief! My life is empty and meaningless without your guidance." -#define GOSSIP_STW6 "Of course, Warchief!" - -//TODO: verify abilities/timers -struct TRINITY_DLL_DECL npc_thrall_warchiefAI : public ScriptedAI -{ - npc_thrall_warchiefAI(Creature* c) : ScriptedAI(c) {} - - uint32 ChainLightning_Timer; - uint32 Shock_Timer; - - void Reset() - { - ChainLightning_Timer = 2000; - Shock_Timer = 8000; - } - - void EnterCombat(Unit *who) {} - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (ChainLightning_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_CHAIN_LIGHTNING); - ChainLightning_Timer = 9000; - }else ChainLightning_Timer -= diff; - - if (Shock_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_SHOCK); - Shock_Timer = 15000; - }else Shock_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_npc_thrall_warchief(Creature* pCreature) -{ - return new npc_thrall_warchiefAI (pCreature); -} - -bool GossipHello_npc_thrall_warchief(Player* pPlayer, Creature* pCreature) -{ - if (pCreature->isQuestGiver()) - pPlayer->PrepareQuestMenu(pCreature->GetGUID()); - - if (pPlayer->GetQuestStatus(QUEST_6566) == QUEST_STATUS_INCOMPLETE) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HTW, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - - pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); - return true; -} - -bool GossipSelect_npc_thrall_warchief(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - switch (uiAction) - { - case GOSSIP_ACTION_INFO_DEF+1: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_STW1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); - pPlayer->SEND_GOSSIP_MENU(5733, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+2: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_STW2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); - pPlayer->SEND_GOSSIP_MENU(5734, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+3: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_STW3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4); - pPlayer->SEND_GOSSIP_MENU(5735, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+4: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_STW4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5); - pPlayer->SEND_GOSSIP_MENU(5736, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+5: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_STW5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6); - pPlayer->SEND_GOSSIP_MENU(5737, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+6: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_STW6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+7); - pPlayer->SEND_GOSSIP_MENU(5738, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+7: - pPlayer->CLOSE_GOSSIP_MENU(); - pPlayer->AreaExploredOrEventHappens(QUEST_6566); - break; - } - return true; -} - -void AddSC_orgrimmar() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="npc_neeru_fireblade"; - newscript->pGossipHello = &GossipHello_npc_neeru_fireblade; - newscript->pGossipSelect = &GossipSelect_npc_neeru_fireblade; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_shenthul"; - newscript->GetAI = &GetAI_npc_shenthul; - newscript->pQuestAccept = &QuestAccept_npc_shenthul; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_thrall_warchief"; - newscript->GetAI = &GetAI_npc_thrall_warchief; - newscript->pGossipHello = &GossipHello_npc_thrall_warchief; - newscript->pGossipSelect = &GossipSelect_npc_thrall_warchief; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/searing_gorge/searing_gorge.cpp b/src/bindings/scripts/scripts/zone/searing_gorge/searing_gorge.cpp deleted file mode 100644 index a3f8c40acc7..00000000000 --- a/src/bindings/scripts/scripts/zone/searing_gorge/searing_gorge.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: Searing_Gorge -SD%Complete: 80 -SDComment: Quest support: 3377, 3441 (More accurate info on Kalaran needed). Lothos Riftwaker teleport to Molten Core. -SDCategory: Searing Gorge -EndScriptData */ - -/* ContentData -npc_kalaran_windblade -npc_lothos_riftwaker -npc_zamael_lunthistle -EndContentData */ - -#include "precompiled.h" - -/*###### -## npc_kalaran_windblade -######*/ - -bool GossipHello_npc_kalaran_windblade(Player* pPlayer, Creature* pCreature) -{ - if (pCreature->isQuestGiver()) - pPlayer->PrepareQuestMenu(pCreature->GetGUID()); - - if (pPlayer->GetQuestStatus(3441) == QUEST_STATUS_INCOMPLETE) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Tell me what drives this vengance?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - - pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); - - return true; -} - -bool GossipSelect_npc_kalaran_windblade(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - switch (uiAction) - { - case GOSSIP_ACTION_INFO_DEF: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Continue please", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - pPlayer->SEND_GOSSIP_MENU(1954, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+1: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Let me confer with my colleagues", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - pPlayer->SEND_GOSSIP_MENU(1955, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+2: - pPlayer->CLOSE_GOSSIP_MENU(); - pPlayer->AreaExploredOrEventHappens(3441); - break; - } - return true; -} - -/*###### -## npc_lothos_riftwaker -######*/ - -bool GossipHello_npc_lothos_riftwaker(Player* pPlayer, Creature* pCreature) -{ - if (pCreature->isQuestGiver()) - pPlayer->PrepareQuestMenu(pCreature->GetGUID()); - - if (pPlayer->GetQuestRewardStatus(7487) || pPlayer->GetQuestRewardStatus(7848)) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Teleport me to the Molten Core", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - - pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); - - return true; -} - -bool GossipSelect_npc_lothos_riftwaker(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) - { - pPlayer->CLOSE_GOSSIP_MENU(); - pPlayer->TeleportTo(409, 1096, -467, -104.6, 3.64); - } - - return true; -} - -/*###### -## npc_zamael_lunthistle -######*/ - -bool GossipHello_npc_zamael_lunthistle(Player* pPlayer, Creature* pCreature) -{ - if (pCreature->isQuestGiver()) - pPlayer->PrepareQuestMenu(pCreature->GetGUID()); - - if (pPlayer->GetQuestStatus(3377) == QUEST_STATUS_INCOMPLETE) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Tell me your story", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - - pPlayer->SEND_GOSSIP_MENU(1920, pCreature->GetGUID()); - - return true; -} - -bool GossipSelect_npc_zamael_lunthistle(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - switch (uiAction) - { - case GOSSIP_ACTION_INFO_DEF: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Please continue...", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - pPlayer->SEND_GOSSIP_MENU(1921, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+1: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Goodbye", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - pPlayer->SEND_GOSSIP_MENU(1922, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+2: - pPlayer->CLOSE_GOSSIP_MENU(); - pPlayer->AreaExploredOrEventHappens(3377); - break; - } - return true; -} - -/*###### -## -######*/ - -void AddSC_searing_gorge() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="npc_kalaran_windblade"; - newscript->pGossipHello = &GossipHello_npc_kalaran_windblade; - newscript->pGossipSelect = &GossipSelect_npc_kalaran_windblade; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_lothos_riftwaker"; - newscript->pGossipHello = &GossipHello_npc_lothos_riftwaker; - newscript->pGossipSelect = &GossipSelect_npc_lothos_riftwaker; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_zamael_lunthistle"; - newscript->pGossipHello = &GossipHello_npc_zamael_lunthistle; - newscript->pGossipSelect = &GossipSelect_npc_zamael_lunthistle; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/shadowmoon_valley/boss_doomwalker.cpp b/src/bindings/scripts/scripts/zone/shadowmoon_valley/boss_doomwalker.cpp deleted file mode 100644 index 089a66fa7d4..00000000000 --- a/src/bindings/scripts/scripts/zone/shadowmoon_valley/boss_doomwalker.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_Doomwalker -SD%Complete: 100 -SDComment: -SDCategory: Shadowmoon Valley -EndScriptData */ - -#include "precompiled.h" - -#define SAY_AGGRO -1000387 -#define SAY_EARTHQUAKE_1 -1000388 -#define SAY_EARTHQUAKE_2 -1000389 -#define SAY_OVERRUN_1 -1000390 -#define SAY_OVERRUN_2 -1000391 -#define SAY_SLAY_1 -1000392 -#define SAY_SLAY_2 -1000393 -#define SAY_SLAY_3 -1000394 -#define SAY_DEATH -1000395 - -#define SPELL_EARTHQUAKE 32686 -#define SPELL_SUNDER_ARMOR 33661 -#define SPELL_CHAIN_LIGHTNING 33665 -#define SPELL_OVERRUN 32636 -#define SPELL_ENRAGE 33653 -#define SPELL_MARK_DEATH 37128 -#define SPELL_AURA_DEATH 37131 - -struct TRINITY_DLL_DECL boss_doomwalkerAI : public ScriptedAI -{ - boss_doomwalkerAI(Creature *c) : ScriptedAI(c) {} - - uint32 Chain_Timer; - uint32 Enrage_Timer; - uint32 Overrun_Timer; - uint32 Quake_Timer; - uint32 Armor_Timer; - - bool InEnrage; - - void Reset() - { - Enrage_Timer = 0; - Armor_Timer = 5000 + rand()%8000; - Chain_Timer = 10000 + rand()%20000; - Quake_Timer = 25000 + rand()%10000; - Overrun_Timer = 30000 + rand()%15000; - - InEnrage = false; - } - - void KilledUnit(Unit* Victim) - { - Victim->CastSpell(Victim,SPELL_MARK_DEATH,0); - - if (rand()%5) - 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_DEATH, m_creature); - } - - void EnterCombat(Unit *who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - - void MoveInLineOfSight(Unit *who) - { - if (who && who->GetTypeId() == TYPEID_PLAYER && m_creature->IsHostileTo(who)) - { - if (who->HasAura(SPELL_MARK_DEATH,0)) - { - who->CastSpell(who,SPELL_AURA_DEATH,1); - } - } - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //Spell Enrage, when hp <= 20% gain enrage - if (((m_creature->GetHealth()*100)/ m_creature->GetMaxHealth()) <= 20) - { - if (Enrage_Timer < diff) - { - DoCast(m_creature,SPELL_ENRAGE); - Enrage_Timer = 6000; - InEnrage = true; - }else Enrage_Timer -= diff; - } - - //Spell Overrun - if (Overrun_Timer < diff) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_OVERRUN_1, m_creature); break; - case 1: DoScriptText(SAY_OVERRUN_2, m_creature); break; - } - - DoCast(m_creature->getVictim(),SPELL_OVERRUN); - Overrun_Timer = 25000 + rand()%15000; - }else Overrun_Timer -= diff; - - //Spell Earthquake - if (Quake_Timer < diff) - { - if (rand()%2) - return; - - switch(rand()%2) - { - case 0: DoScriptText(SAY_EARTHQUAKE_1, m_creature); break; - case 1: DoScriptText(SAY_EARTHQUAKE_2, m_creature); break; - } - - //remove enrage before casting earthquake because enrage + earthquake = 16000dmg over 8sec and all dead - if (InEnrage) - m_creature->RemoveAura(SPELL_ENRAGE); - - DoCast(m_creature,SPELL_EARTHQUAKE); - Quake_Timer = 30000 + rand()%25000; - }else Quake_Timer -= diff; - - //Spell Chain Lightning - if (Chain_Timer < diff) - { - Unit* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM,1); - - if (!target) - target = m_creature->getVictim(); - - if (target) - DoCast(target,SPELL_CHAIN_LIGHTNING); - - Chain_Timer = 7000 + rand()%20000; - }else Chain_Timer -= diff; - - //Spell Sunder Armor - if (Armor_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_SUNDER_ARMOR); - Armor_Timer = 10000 + rand()%15000; - }else Armor_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_doomwalker(Creature* pCreature) -{ - return new boss_doomwalkerAI (pCreature); -} - -void AddSC_boss_doomwalker() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_doomwalker"; - newscript->GetAI = &GetAI_boss_doomwalker; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/shadowmoon_valley/shadowmoon_valley.cpp b/src/bindings/scripts/scripts/zone/shadowmoon_valley/shadowmoon_valley.cpp deleted file mode 100644 index 953675bb28f..00000000000 --- a/src/bindings/scripts/scripts/zone/shadowmoon_valley/shadowmoon_valley.cpp +++ /dev/null @@ -1,1841 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 .sourceforge.net/> - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Shadowmoon_Valley -SD%Complete: 100 -SDComment: Quest support: 10519, 10583, 10601, 10814, 10804, 10854, 10458, 10481, 10480, 11082, 10781, 10451. Vendor Drake Dealer Hurlunk. -SDCategory: Shadowmoon Valley -EndScriptData */ - -/* ContentData -mob_mature_netherwing_drake -mob_enslaved_netherwing_drake -npc_drake_dealer_hurlunk -npcs_flanis_swiftwing_and_kagrosh -npc_murkblood_overseer -npc_neltharaku -npc_karynaku -npc_oronok_tornheart -npc_overlord_morghor -npc_earthmender_wilda -mob_torloth_the_magnificent -mob_illidari_spawn -npc_lord_illidan_stormrage -go_crystal_prison -npc_enraged_spirit -EndContentData */ - -#include "precompiled.h" -#include "../../npc/npc_escortAI.h" - -/*##### -# mob_mature_netherwing_drake -#####*/ - -enum -{ - SAY_JUST_EATEN = -1000222, - - SPELL_PLACE_CARCASS = 38439, - SPELL_JUST_EATEN = 38502, - SPELL_NETHER_BREATH = 38467, - POINT_ID = 1, - - QUEST_KINDNESS = 10804, - NPC_EVENT_PINGER = 22131 -}; - - -struct TRINITY_DLL_DECL mob_mature_netherwing_drakeAI : public ScriptedAI -{ - mob_mature_netherwing_drakeAI(Creature* c) : ScriptedAI(c) { } - - uint64 uiPlayerGUID; - - bool bCanEat; - bool bIsEating; - - uint32 EatTimer; - uint32 CastTimer; - - void Reset() - { - uiPlayerGUID = 0; - - bCanEat = false; - bIsEating = false; - - EatTimer = 5000; - CastTimer = 5000; - } - - void EnterCombat(Unit* who) { } - - void SpellHit(Unit* pCaster, SpellEntry const* pSpell) - { - if (bCanEat || bIsEating) - return; - - if (pCaster->GetTypeId() == TYPEID_PLAYER && pSpell->Id == SPELL_PLACE_CARCASS && !m_creature->HasAura(SPELL_JUST_EATEN)) - { - uiPlayerGUID = pCaster->GetGUID(); - bCanEat = true; - } - } - - void MovementInform(uint32 type, uint32 id) - { - if (type != POINT_MOTION_TYPE) - return; - - if (id == POINT_ID) - { - bIsEating = true; - EatTimer = 7000; - m_creature->HandleEmoteCommand(EMOTE_ONESHOT_ATTACKUNARMED); - } - } - - void UpdateAI(const uint32 diff) - { - if (bCanEat || bIsEating) - { - if (EatTimer < diff) - { - if (bCanEat && !bIsEating) - { - if (Unit* pUnit = Unit::GetUnit(*m_creature, uiPlayerGUID)) - { - if (GameObject* pGo = pUnit->GetGameObject(SPELL_PLACE_CARCASS)) - { - if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == WAYPOINT_MOTION_TYPE) - m_creature->GetMotionMaster()->MovementExpired(); - - m_creature->GetMotionMaster()->MoveIdle(); - m_creature->StopMoving(); - - m_creature->GetMotionMaster()->MovePoint(POINT_ID, pGo->GetPositionX(), pGo->GetPositionY(), pGo->GetPositionZ()); - } - } - bCanEat = false; - } - else if (bIsEating) - { - DoCast(m_creature, SPELL_JUST_EATEN); - DoScriptText(SAY_JUST_EATEN, m_creature); - - if (Player* pPlr = Unit::GetPlayer(uiPlayerGUID)) - pPlr->KilledMonsterCredit(NPC_EVENT_PINGER, m_creature->GetGUID()); - - Reset(); - m_creature->GetMotionMaster()->Clear(); - } - } - else - EatTimer -= diff; - - return; - } - - if (!UpdateVictim()) - return; - - if (CastTimer < diff) - { - DoCast(m_creature->getVictim(), SPELL_NETHER_BREATH); - CastTimer = 5000; - }else CastTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_mature_netherwing_drake(Creature* pCreature) -{ - return new mob_mature_netherwing_drakeAI(pCreature); -} - -/*### -# mob_enslaved_netherwing_drake -####*/ - -#define FACTION_DEFAULT 62 -#define FACTION_FRIENDLY 1840 // Not sure if this is correct, it was taken off of Mordenai. - -#define SPELL_HIT_FORCE_OF_NELTHARAKU 38762 -#define SPELL_FORCE_OF_NELTHARAKU 38775 - -#define CREATURE_DRAGONMAW_SUBJUGATOR 21718 -#define CREATURE_ESCAPE_DUMMY 22317 - -struct TRINITY_DLL_DECL mob_enslaved_netherwing_drakeAI : public ScriptedAI -{ - mob_enslaved_netherwing_drakeAI(Creature* c) : ScriptedAI(c) - { - PlayerGUID = 0; - Tapped = false; - Reset(); - } - - uint64 PlayerGUID; - uint32 FlyTimer; - bool Tapped; - - void Reset() - { - if (!Tapped) - m_creature->setFaction(FACTION_DEFAULT); - - FlyTimer = 10000; - m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - m_creature->SetVisibility(VISIBILITY_ON); - } - - void EnterCombat(Unit* who) { } - - void SpellHit(Unit* caster, const SpellEntry* spell) - { - if (!caster) - return; - - if (caster->GetTypeId() == TYPEID_PLAYER && spell->Id == SPELL_HIT_FORCE_OF_NELTHARAKU && !Tapped) - { - Tapped = true; - PlayerGUID = caster->GetGUID(); - - m_creature->setFaction(FACTION_FRIENDLY); - DoCast(caster, SPELL_FORCE_OF_NELTHARAKU, true); - - Unit* Dragonmaw = me->FindNearestCreature(CREATURE_DRAGONMAW_SUBJUGATOR, 50); - - if (Dragonmaw) - { - m_creature->AddThreat(Dragonmaw, 100000.0f); - AttackStart(Dragonmaw); - } - - HostilReference* ref = m_creature->getThreatManager().getOnlineContainer().getReferenceByTarget(caster); - if (ref) - ref->removeReference(); - } - } - - void MovementInform(uint32 type, uint32 id) - { - if (type != POINT_MOTION_TYPE) - return; - - if (id == 1) - { - if (PlayerGUID) - { - Unit* plr = Unit::GetUnit((*m_creature), PlayerGUID); - if (plr) - DoCast(plr, SPELL_FORCE_OF_NELTHARAKU, true); - - PlayerGUID = 0; - } - m_creature->SetVisibility(VISIBILITY_OFF); - m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - 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 (!UpdateVictim()) - { - if (Tapped) - if (FlyTimer < diff) - { - Tapped = false; - if (PlayerGUID) - { - Player* plr = Unit::GetPlayer(PlayerGUID); - if (plr && plr->GetQuestStatus(10854) == QUEST_STATUS_INCOMPLETE) - { - DoCast(plr, SPELL_FORCE_OF_NELTHARAKU, true); - /* - float x,y,z; - m_creature->GetPosition(x,y,z); - - float dx,dy,dz; - m_creature->GetRandomPoint(x, y, z, 20, dx, dy, dz); - dz += 20; // so it's in the air, not ground*/ - - float dx, dy, dz; - - Unit* EscapeDummy = me->FindNearestCreature(CREATURE_ESCAPE_DUMMY, 30); - if (EscapeDummy) - EscapeDummy->GetPosition(dx, dy, dz); - else - { - m_creature->GetRandomPoint(m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 20, dx, dy, dz); - dz += 25; - } - - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - m_creature->GetMotionMaster()->MovePoint(1, dx, dy, dz); - } - } - }else FlyTimer -= diff; - return; - } - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_enslaved_netherwing_drake(Creature* pCreature) -{ - return new mob_enslaved_netherwing_drakeAI(pCreature); -} - -/*##### -# mob_dragonmaw_peon -#####*/ - -struct TRINITY_DLL_DECL mob_dragonmaw_peonAI : public ScriptedAI -{ - mob_dragonmaw_peonAI(Creature* c) : ScriptedAI(c) {} - - uint64 PlayerGUID; - bool Tapped; - uint32 PoisonTimer; - - void Reset() - { - PlayerGUID = 0; - Tapped = false; - PoisonTimer = 0; - } - - void EnterCombat(Unit* who) { } - - void SpellHit(Unit* caster, const SpellEntry* spell) - { - if (!caster) - return; - - if (caster->GetTypeId() == TYPEID_PLAYER && spell->Id == 40468 && !Tapped) - { - PlayerGUID = caster->GetGUID(); - - Tapped = true; - float x, y, z; - caster->GetClosePoint(x, y, z, m_creature->GetObjectSize()); - - m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - m_creature->GetMotionMaster()->MovePoint(1, x, y, z); - } - } - - void MovementInform(uint32 type, uint32 id) - { - if (type != POINT_MOTION_TYPE) - return; - - if (id) - { - m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_EAT); - PoisonTimer = 15000; - } - } - - void UpdateAI(const uint32 diff) - { - if (PoisonTimer) - if (PoisonTimer <= diff) - { - if (PlayerGUID) - { - Player* plr = Unit::GetPlayer(PlayerGUID); - if (plr && plr->GetQuestStatus(11020) == QUEST_STATUS_INCOMPLETE) - plr->KilledMonsterCredit(23209, m_creature->GetGUID()); - } - PoisonTimer = 0; - m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - }else PoisonTimer -= diff; - } -}; - -CreatureAI* GetAI_mob_dragonmaw_peon(Creature* pCreature) -{ - return new mob_dragonmaw_peonAI(pCreature); -} - -/*###### -## npc_drake_dealer_hurlunk -######*/ - -bool GossipHello_npc_drake_dealer_hurlunk(Player* pPlayer, Creature* pCreature) -{ - if (pCreature->isVendor() && pPlayer->GetReputationRank(1015) == REP_EXALTED) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); - - pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); - - return true; -} - -bool GossipSelect_npc_drake_dealer_hurlunk(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - if (uiAction == GOSSIP_ACTION_TRADE) - pPlayer->SEND_VENDORLIST(pCreature->GetGUID()); - - return true; -} - -/*###### -## npc_flanis_swiftwing_and_kagrosh -######*/ - -#define GOSSIP_HSK1 "Take Flanis's Pack" -#define GOSSIP_HSK2 "Take Kagrosh's Pack" - -bool GossipHello_npcs_flanis_swiftwing_and_kagrosh(Player* pPlayer, Creature* pCreature) -{ - if (pPlayer->GetQuestStatus(10583) == QUEST_STATUS_INCOMPLETE && !pPlayer->HasItemCount(30658,1,true)) - pPlayer->ADD_GOSSIP_ITEM(0, GOSSIP_HSK1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - if (pPlayer->GetQuestStatus(10601) == QUEST_STATUS_INCOMPLETE && !pPlayer->HasItemCount(30659,1,true)) - pPlayer->ADD_GOSSIP_ITEM(0, GOSSIP_HSK2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); - - pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); - - return true; -} - -bool GossipSelect_npcs_flanis_swiftwing_and_kagrosh(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, 30658, 1, false); - if (msg == EQUIP_ERR_OK) - { - pPlayer->StoreNewItem(dest, 30658, 1, true); - pPlayer->PlayerTalkClass->ClearMenus(); - } - } - if (uiAction == GOSSIP_ACTION_INFO_DEF+2) - { - ItemPosCountVec dest; - uint8 msg = pPlayer->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, 30659, 1, false); - if (msg == EQUIP_ERR_OK) - { - pPlayer->StoreNewItem(dest, 30659, 1, true); - pPlayer->PlayerTalkClass->ClearMenus(); - } - } - return true; -} - -/*###### -## npc_murkblood_overseer -######*/ - -#define QUEST_11082 11082 - -#define GOSSIP_HMO "I am here for you, overseer." -#define GOSSIP_SMO1 "How dare you question an overseer of the Dragonmaw!" -#define GOSSIP_SMO2 "Who speaks of me? What are you talking about, broken?" -#define GOSSIP_SMO3 "Continue please." -#define GOSSIP_SMO4 "Who are these bidders?" -#define GOSSIP_SMO5 "Well... yes." - -bool GossipHello_npc_murkblood_overseer(Player* pPlayer, Creature* pCreature) -{ - if (pPlayer->GetQuestStatus(QUEST_11082) == QUEST_STATUS_INCOMPLETE) - pPlayer->ADD_GOSSIP_ITEM(0, GOSSIP_HMO, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - - pPlayer->SEND_GOSSIP_MENU(10940, pCreature->GetGUID()); - return true; -} - -bool GossipSelect_npc_murkblood_overseer(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - switch (uiAction) - { - case GOSSIP_ACTION_INFO_DEF+1: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SMO1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); - //correct id not known - pPlayer->SEND_GOSSIP_MENU(10940, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+2: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SMO2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); - //correct id not known - pPlayer->SEND_GOSSIP_MENU(10940, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+3: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SMO3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4); - //correct id not known - pPlayer->SEND_GOSSIP_MENU(10940, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+4: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SMO4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5); - //correct id not known - pPlayer->SEND_GOSSIP_MENU(10940, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+5: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SMO5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6); - //correct id not known - pPlayer->SEND_GOSSIP_MENU(10940, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+6: - //correct id not known - pPlayer->SEND_GOSSIP_MENU(10940, pCreature->GetGUID()); - pCreature->CastSpell(pPlayer,41121,false); - pPlayer->AreaExploredOrEventHappens(QUEST_11082); - break; - } - return true; -} - -/*###### -## npc_neltharaku -######*/ - -#define GOSSIP_HN "I am listening, dragon" -#define GOSSIP_SN1 "But you are dragons! How could orcs do this to you?" -#define GOSSIP_SN2 "Your mate?" -#define GOSSIP_SN3 "I have battled many beasts, dragon. I will help you." - -bool GossipHello_npc_neltharaku(Player* pPlayer, Creature* pCreature) -{ - if (pCreature->isQuestGiver()) - pPlayer->PrepareQuestMenu(pCreature->GetGUID()); - - if (pPlayer->GetQuestStatus(10814) == QUEST_STATUS_INCOMPLETE) - pPlayer->ADD_GOSSIP_ITEM(0, GOSSIP_HN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - - pPlayer->SEND_GOSSIP_MENU(10613, pCreature->GetGUID()); - - return true; -} - -bool GossipSelect_npc_neltharaku(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - switch (uiAction) - { - case GOSSIP_ACTION_INFO_DEF+1: - pPlayer->ADD_GOSSIP_ITEM(0, GOSSIP_SN1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); - pPlayer->SEND_GOSSIP_MENU(10614, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+2: - pPlayer->ADD_GOSSIP_ITEM(0, GOSSIP_SN2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); - pPlayer->SEND_GOSSIP_MENU(10615, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+3: - pPlayer->ADD_GOSSIP_ITEM(0, GOSSIP_SN3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4); - pPlayer->SEND_GOSSIP_MENU(10616, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+4: - pPlayer->CLOSE_GOSSIP_MENU(); - pPlayer->AreaExploredOrEventHappens(10814); - break; - } - return true; -} - -/*###### -## npc_oronok -######*/ - -#define GOSSIP_ORONOK1 "I am ready to hear your story, Oronok." -#define GOSSIP_ORONOK2 "How do I find the cipher?" -#define GOSSIP_ORONOK3 "How do you know all of this?" -#define GOSSIP_ORONOK4 "Yet what? What is it, Oronok?" -#define GOSSIP_ORONOK5 "Continue, please." -#define GOSSIP_ORONOK6 "So what of the cipher now? And your boys?" -#define GOSSIP_ORONOK7 "I will find your boys and the cipher, Oronok." - -bool GossipHello_npc_oronok_tornheart(Player* pPlayer, Creature* pCreature) -{ - if (pCreature->isQuestGiver()) - pPlayer->PrepareQuestMenu(pCreature->GetGUID()); - if (pCreature->isVendor()) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); - - if (pPlayer->GetQuestStatus(10519) == QUEST_STATUS_INCOMPLETE) - { - pPlayer->ADD_GOSSIP_ITEM(0, GOSSIP_ORONOK1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - pPlayer->SEND_GOSSIP_MENU(10312, pCreature->GetGUID()); - }else - pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); - - return true; -} - -bool GossipSelect_npc_oronok_tornheart(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - switch (uiAction) - { - case GOSSIP_ACTION_TRADE: - pPlayer->SEND_VENDORLIST(pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF: - pPlayer->ADD_GOSSIP_ITEM(0, GOSSIP_ORONOK2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - pPlayer->SEND_GOSSIP_MENU(10313, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+1: - pPlayer->ADD_GOSSIP_ITEM(0, GOSSIP_ORONOK3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); - pPlayer->SEND_GOSSIP_MENU(10314, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+2: - pPlayer->ADD_GOSSIP_ITEM(0, GOSSIP_ORONOK4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); - pPlayer->SEND_GOSSIP_MENU(10315, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+3: - pPlayer->ADD_GOSSIP_ITEM(0, GOSSIP_ORONOK5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4); - pPlayer->SEND_GOSSIP_MENU(10316, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+4: - pPlayer->ADD_GOSSIP_ITEM(0, GOSSIP_ORONOK6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5); - pPlayer->SEND_GOSSIP_MENU(10317, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+5: - pPlayer->ADD_GOSSIP_ITEM(0, GOSSIP_ORONOK7, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6); - pPlayer->SEND_GOSSIP_MENU(10318, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+6: - pPlayer->CLOSE_GOSSIP_MENU(); - pPlayer->AreaExploredOrEventHappens(10519); - break; - } - return true; -} - -/*#### -# npc_karynaku -####*/ - -enum -{ - QUEST_ALLY_OF_NETHER = 10870, - - TAXI_PATH_ID = 649 -}; - -bool QuestAccept_npc_karynaku(Player* pPlayer, Creature* pCreature, Quest const* quest) -{ - if (quest->GetQuestId() == QUEST_ALLY_OF_NETHER) - pPlayer->ActivateTaxiPathTo(TAXI_PATH_ID); //pPlayer->ActivateTaxiPathTo(649); - - return true; -} - -/*#### -# npc_overlord_morghor -####*/ - -#define QUEST_LORD_ILLIDAN_STORMRAGE 11108 - -#define C_ILLIDAN 22083 -#define C_YARZILL 23141 - -#define SPELL_ONE 39990 // Red Lightning Bolt -#define SPELL_TWO 41528 // Mark of Stormrage -#define SPELL_THREE 40216 // Dragonaw Faction -#define SPELL_FOUR 42016 // Dragonaw Trasform - -#define OVERLORD_SAY_1 -1000206 -#define OVERLORD_SAY_2 -1000207 -#define OVERLORD_SAY_3 -1000208 -#define OVERLORD_SAY_4 -1000209 -#define OVERLORD_SAY_5 -1000210 -#define OVERLORD_SAY_6 -1000211 - -#define OVERLORD_YELL_1 -1000212 -#define OVERLORD_YELL_2 -1000213 - -#define LORD_ILLIDAN_SAY_1 -1000214 -#define LORD_ILLIDAN_SAY_2 -1000215 -#define LORD_ILLIDAN_SAY_3 -1000216 -#define LORD_ILLIDAN_SAY_4 -1000217 -#define LORD_ILLIDAN_SAY_5 -1000218 -#define LORD_ILLIDAN_SAY_6 -1000219 -#define LORD_ILLIDAN_SAY_7 -1000220 - -#define YARZILL_THE_MERC_SAY -1000221 - -struct TRINITY_DLL_DECL npc_overlord_morghorAI : public ScriptedAI -{ - npc_overlord_morghorAI(Creature *c) : ScriptedAI(c) {} - - uint64 PlayerGUID; - uint64 IllidanGUID; - - uint32 ConversationTimer; - uint32 Step; - - bool Event; - - void Reset() - { - PlayerGUID = 0; - IllidanGUID = 0; - - ConversationTimer = 0; - Step = 0; - - Event = false; - } - - void EnterCombat(Unit* who){} - - void StartEvent() - { - m_creature->SetUInt32Value(UNIT_NPC_FLAGS, 0); - m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,0); - Unit* Illidan = m_creature->SummonCreature(C_ILLIDAN, -5107.83, 602.584, 85.2393, 4.92598, TEMPSUMMON_CORPSE_DESPAWN, 0); - if (Illidan) - { - IllidanGUID = Illidan->GetGUID(); - Illidan->SetVisibility(VISIBILITY_OFF); - } - if (PlayerGUID) - { - Player* pPlayer = Unit::GetPlayer(PlayerGUID); - if (pPlayer) - DoScriptText(OVERLORD_SAY_1, m_creature, pPlayer); - } - ConversationTimer = 4200; - Step = 0; - Event = true; - } - - uint32 NextStep(uint32 Step) - { - Unit* plr = Unit::GetUnit((*m_creature), PlayerGUID); - - Unit* Illi = Unit::GetUnit((*m_creature), IllidanGUID); - - if (!plr || !Illi) - { - EnterEvadeMode(); - return 0; - } - - switch(Step) - { - case 0: return 0; break; - case 1: m_creature->GetMotionMaster()->MovePoint(0, -5104.41, 595.297, 85.6838); return 9000; break; - case 2: DoScriptText(OVERLORD_YELL_1, m_creature, plr); return 4500; break; - case 3: m_creature->SetInFront(plr); return 3200; break; - case 4: DoScriptText(OVERLORD_SAY_2, m_creature, plr); return 2000; break; - case 5: Illi->SetVisibility(VISIBILITY_ON); - Illi->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); return 350; break; - case 6: - Illi->CastSpell(Illi, SPELL_ONE, true); - Illi->SetUInt64Value(UNIT_FIELD_TARGET, m_creature->GetGUID()); - m_creature->SetUInt64Value(UNIT_FIELD_TARGET, IllidanGUID); - return 2000; break; - case 7: DoScriptText(OVERLORD_YELL_2, m_creature); return 4500; break; - case 8: m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 8); return 2500; break; - case 9: DoScriptText(OVERLORD_SAY_3, m_creature); return 6500; break; - case 10: DoScriptText(LORD_ILLIDAN_SAY_1, Illi); return 5000; break; - case 11: DoScriptText(OVERLORD_SAY_4, m_creature, plr); return 6000; break; - case 12: DoScriptText(LORD_ILLIDAN_SAY_2, Illi); return 5500; break; - case 13: DoScriptText(LORD_ILLIDAN_SAY_3, Illi); return 4000; break; - case 14: Illi->SetUInt64Value(UNIT_FIELD_TARGET, PlayerGUID); return 1500; break; - case 15: DoScriptText(LORD_ILLIDAN_SAY_4, Illi); return 1500; break; - case 16: - if (plr) - { - Illi->CastSpell(plr, SPELL_TWO, true); - plr->RemoveAurasDueToSpell(SPELL_THREE); - plr->RemoveAurasDueToSpell(SPELL_FOUR); - return 5000; - }else{ - CAST_PLR(plr)->FailQuest(QUEST_LORD_ILLIDAN_STORMRAGE); Step = 30; return 100; - }break; - case 17: DoScriptText(LORD_ILLIDAN_SAY_5, Illi); return 5000; break; - case 18: DoScriptText(LORD_ILLIDAN_SAY_6, Illi); return 5000; break; - case 19: DoScriptText(LORD_ILLIDAN_SAY_7, Illi); return 5000; break; - case 20: - Illi->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF); - Illi->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - return 500; break; - case 21: DoScriptText(OVERLORD_SAY_5, m_creature); return 500; break; - case 22: - Illi->SetVisibility(VISIBILITY_OFF); - Illi->setDeathState(JUST_DIED); - return 1000; break; - case 23: m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,0); return 2000; break; - case 24: m_creature->SetUInt64Value(UNIT_FIELD_TARGET, PlayerGUID); return 5000; break; - case 25: DoScriptText(OVERLORD_SAY_6, m_creature); return 2000; break; - case 26: - if (plr) - CAST_PLR(plr)->GroupEventHappens(QUEST_LORD_ILLIDAN_STORMRAGE, m_creature); - return 6000; break; - case 27: - { - Unit* Yarzill = me->FindNearestCreature(C_YARZILL, 50); - if (Yarzill) - Yarzill->SetUInt64Value(UNIT_FIELD_TARGET, PlayerGUID); - return 500; }break; - case 28: - plr->RemoveAurasDueToSpell(SPELL_TWO); - plr->RemoveAurasDueToSpell(41519); - plr->CastSpell(plr, SPELL_THREE, true); - plr->CastSpell(plr, SPELL_FOUR, true); - return 1000; break; - case 29: - { - Unit* Yarzill = me->FindNearestCreature(C_YARZILL, 50); - if (Yarzill) - DoScriptText(YARZILL_THE_MERC_SAY, Yarzill, plr); - return 5000; }break; - case 30: - { - Unit* Yarzill = me->FindNearestCreature(C_YARZILL, 50); - if (Yarzill) - Yarzill->SetUInt64Value(UNIT_FIELD_TARGET, 0); - return 5000; }break; - case 31: - { - Unit* Yarzill = me->FindNearestCreature(C_YARZILL, 50); - if (Yarzill) - Yarzill->CastSpell(plr, 41540, true); - return 1000;}break; - case 32: m_creature->GetMotionMaster()->MovePoint(0, -5085.77, 577.231, 86.6719); return 5000; break; - case 33: Reset(); return 100; break; - - default : return 0; - } - } - - void UpdateAI(const uint32 diff) - { - if (!ConversationTimer) - return; - - if (ConversationTimer <= diff) - { - if (Event && IllidanGUID && PlayerGUID) - { - ConversationTimer = NextStep(++Step); - } - }else ConversationTimer -= diff; - } -}; - -CreatureAI* GetAI_npc_overlord_morghor(Creature* pCreature) -{ -return new npc_overlord_morghorAI(pCreature); -} - -bool QuestAccept_npc_overlord_morghor(Player* pPlayer, Creature* pCreature, const Quest *_Quest) -{ - if (_Quest->GetQuestId() == QUEST_LORD_ILLIDAN_STORMRAGE) - { - CAST_AI(npc_overlord_morghorAI, pCreature->AI())->PlayerGUID = pPlayer->GetGUID(); - CAST_AI(npc_overlord_morghorAI, pCreature->AI())->StartEvent(); - return true; - } - return false; -} - -/*#### -# npc_earthmender_wilda -####*/ - -enum -{ - SAY_WIL_START = -1000381, - SAY_WIL_AGGRO1 = -1000382, - SAY_WIL_AGGRO2 = -1000383, - SAY_WIL_PROGRESS1 = -1000384, - SAY_WIL_PROGRESS2 = -1000385, - SAY_WIL_FIND_EXIT = -1000386, - SAY_WIL_PROGRESS4 = -1000387, - SAY_WIL_PROGRESS5 = -1000388, - SAY_WIL_JUST_AHEAD = -1000389, - SAY_WIL_END = -1000390, - - SPELL_CHAIN_LIGHTNING = 16006, - SPELL_EARTHBING_TOTEM = 15786, - SPELL_FROST_SHOCK = 12548, - SPELL_HEALING_WAVE = 12491, - - QUEST_ESCAPE_COILSCAR = 10451, - NPC_COILSKAR_ASSASSIN = 21044, - FACTION_EARTHEN = 1726 //guessed -}; - -struct TRINITY_DLL_DECL npc_earthmender_wildaAI : public npc_escortAI -{ - npc_earthmender_wildaAI(Creature* pCreature) : npc_escortAI(pCreature) { } - - uint32 m_uiHealingTimer; - - void Reset() - { - m_uiHealingTimer = 0; - } - - void WaypointReached(uint32 uiPointId) - { - Player* pPlayer = (Player*)Unit::GetUnit(*m_creature, PlayerGUID); - - if (!pPlayer) - return; - - switch(uiPointId) - { - case 13: - DoScriptText(SAY_WIL_PROGRESS1, m_creature, pPlayer); - DoSpawnAssassin(); - break; - case 14: - DoSpawnAssassin(); - break; - case 15: - DoScriptText(SAY_WIL_FIND_EXIT, m_creature, pPlayer); - break; - case 19: - DoRandomSay(); - break; - case 20: - DoSpawnAssassin(); - break; - case 26: - DoRandomSay(); - break; - case 27: - DoSpawnAssassin(); - break; - case 33: - DoRandomSay(); - break; - case 34: - DoSpawnAssassin(); - break; - case 37: - DoRandomSay(); - break; - case 38: - DoSpawnAssassin(); - break; - case 39: - DoScriptText(SAY_WIL_JUST_AHEAD, m_creature, pPlayer); - break; - case 43: - DoRandomSay(); - break; - case 44: - DoSpawnAssassin(); - break; - case 50: - DoScriptText(SAY_WIL_END, m_creature, pPlayer); - - if (Player* pPlayer = Unit::GetPlayer(PlayerGUID)) - pPlayer->GroupEventHappens(QUEST_ESCAPE_COILSCAR, m_creature); - break; - } - } - - void JustSummoned(Creature* pSummoned) - { - if (pSummoned->GetEntry() == NPC_COILSKAR_ASSASSIN) - pSummoned->AI()->AttackStart(m_creature); - } - - //this is very unclear, random say without no real relevance to script/event - void DoRandomSay() - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_WIL_PROGRESS2, m_creature); break; - case 1: DoScriptText(SAY_WIL_PROGRESS4, m_creature); break; - case 2: DoScriptText(SAY_WIL_PROGRESS5, m_creature); break; - } - } - - void DoSpawnAssassin() - { - //unknown where they actually appear - float fX, fY, fZ; - m_creature->GetRandomPoint(m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 15.0f, fX, fY, fZ); - - m_creature->SummonCreature(NPC_COILSKAR_ASSASSIN, fX, fY, fZ, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); - } - - void Aggro(Unit* pWho) - { - //don't always use - if (rand()%5) - return; - - //only aggro text if not player - if (pWho->GetTypeId() != TYPEID_PLAYER) - { - //appears to be random - switch(rand()%4) - { - case 0: DoScriptText(SAY_WIL_AGGRO1, m_creature, pWho); break; - case 1: DoScriptText(SAY_WIL_AGGRO2, m_creature, pWho); break; - } - } - } - - void UpdateAI(const uint32 uiDiff) - { - npc_escortAI::UpdateAI(uiDiff); - - if (!UpdateVictim()) - return; - - //TODO: add more abilities - if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 30) - { - if (m_uiHealingTimer < uiDiff) - { - DoCast(m_creature, SPELL_HEALING_WAVE); - m_uiHealingTimer = 15000; - } - else - m_uiHealingTimer -= uiDiff; - } - } -}; - -CreatureAI* GetAI_npc_earthmender_wilda(Creature* pCreature) -{ - npc_earthmender_wildaAI* pTempAI = new npc_earthmender_wildaAI(pCreature); - - pTempAI->FillPointMovementListForCreature(); - - return (CreatureAI*)pTempAI; -} - -bool QuestAccept_npc_earthmender_wilda(Player* pPlayer, Creature* pCreature, const Quest* pQuest) -{ - if (pQuest->GetQuestId() == QUEST_ESCAPE_COILSCAR) - { - DoScriptText(SAY_WIL_START, pCreature, pPlayer); - pCreature->setFaction(FACTION_EARTHEN); - - if (npc_earthmender_wildaAI* pEscortAI = CAST_AI(npc_earthmender_wildaAI, pCreature->AI())) - pEscortAI->Start(false, false, pPlayer->GetGUID(), pQuest); - } - return true; -} - -/*##### -# Quest: Battle of the crimson watch -#####*/ - -/* ContentData -Battle of the crimson watch - creatures, gameobjects and defines -mob_illidari_spawn : Adds that are summoned in the Crimson Watch battle. -mob_torloth_the_magnificent : Final Creature that players have to face before quest is completed -npc_lord_illidan_stormrage : Creature that controls the event. -go_crystal_prison : GameObject that begins the event and hands out quest -EndContentData */ - -#define END_TEXT -1000366 - -#define QUEST_BATTLE_OF_THE_CRIMSON_WATCH 10781 -#define EVENT_AREA_RADIUS 65 //65yds -#define EVENT_COOLDOWN 30000 //in ms. appear after event completed or failed (should be = Adds despawn time) - -struct TorlothCinematic -{ - int32 TextId; - uint32 pCreature, Timer; -}; - -// Creature 0 - Torloth, 1 - Illidan -static TorlothCinematic TorlothAnim[]= -{ - {-1000367, 0, 2000}, - {-1000368, 1, 7000}, - {-1000369, 0, 3000}, - {NULL, 0, 2000}, // Torloth stand - {-1000370, 0, 1000}, - {NULL, 0, 3000}, - {NULL, 0, NULL} -}; - -struct Location -{ - float x, y, z, o; -}; - -//Cordinates for Spawns -static Location SpawnLocation[]= -{ - //Cords used for: - {-4615.8556, 1342.2532, 139.9, 1.612},//Illidari Soldier - {-4598.9365, 1377.3182, 139.9, 3.917},//Illidari Soldier - {-4598.4697, 1360.8999, 139.9, 2.427},//Illidari Soldier - {-4589.3599, 1369.1061, 139.9, 3.165},//Illidari Soldier - {-4608.3477, 1386.0076, 139.9, 4.108},//Illidari Soldier - {-4633.1889, 1359.8033, 139.9, 0.949},//Illidari Soldier - {-4623.5791, 1351.4574, 139.9, 0.971},//Illidari Soldier - {-4607.2988, 1351.6099, 139.9, 2.416},//Illidari Soldier - {-4633.7764, 1376.0417, 139.9, 5.608},//Illidari Soldier - {-4600.2461, 1369.1240, 139.9, 3.056},//Illidari Mind Breaker - {-4631.7808, 1367.9459, 139.9, 0.020},//Illidari Mind Breaker - {-4600.2461, 1369.1240, 139.9, 3.056},//Illidari Highlord - {-4631.7808, 1367.9459, 139.9, 0.020},//Illidari Highlord - {-4615.5586, 1353.0031, 139.9, 1.540},//Illidari Highlord - {-4616.4736, 1384.2170, 139.9, 4.971},//Illidari Highlord - {-4627.1240, 1378.8752, 139.9, 2.544} //Torloth The Magnificent -}; - -struct WaveData -{ - uint8 SpawnCount, UsedSpawnPoint; - uint32 CreatureId, SpawnTimer,YellTimer; - int32 WaveTextId; -}; - -static WaveData WavesInfo[]= -{ - {9, 0, 22075, 10000, 7000, -1000371}, //Illidari Soldier - {2, 9, 22074, 10000, 7000, -1000372}, //Illidari Mind Breaker - {4, 11, 19797, 10000, 7000, -1000373}, //Illidari Highlord - {1, 15, 22076, 10000, 7000, -1000374} //Torloth The Magnificent -}; - -struct SpawnSpells -{ - uint32 Timer1, Timer2, SpellId; -}; - -static SpawnSpells SpawnCast[]= -{ - {10000, 15000, 35871}, // Illidari Soldier Cast - Spellbreaker - {10000, 10000, 38985}, // Illidari Mind Breake Cast - Focused Bursts - {35000, 35000, 22884}, // Illidari Mind Breake Cast - Psychic Scream - {20000, 20000, 17194}, // Illidari Mind Breake Cast - Mind Blast - {8000, 15000, 38010}, // Illidari Highlord Cast - Curse of Flames - {12000, 20000, 16102}, // Illidari Highlord Cast - Flamestrike - {10000, 15000, 15284}, // Torloth the Magnificent Cast - Cleave - {18000, 20000, 39082}, // Torloth the Magnificent Cast - Shadowfury - {25000, 28000, 33961} // Torloth the Magnificent Cast - Spell Reflection -}; - -/*###### -# mob_illidari_spawn -######*/ - -struct TRINITY_DLL_DECL mob_illidari_spawnAI : public ScriptedAI -{ - mob_illidari_spawnAI(Creature* c) : ScriptedAI(c) {} - - uint64 LordIllidanGUID; - uint32 SpellTimer1, SpellTimer2, SpellTimer3; - bool Timers; - - void Reset() - { - LordIllidanGUID = 0; - Timers = false; - } - - void EnterCombat(Unit* who) {} - void JustDied(Unit* slayer); - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (!Timers) - { - if (m_creature->GetEntry() == 22075)//Illidari Soldier - { - SpellTimer1 = SpawnCast[0].Timer1 + (rand()%4 * 1000); - } - if (m_creature->GetEntry() == 22074)//Illidari Mind Breaker - { - SpellTimer1 = SpawnCast[1].Timer1 + (rand()%10 * 1000); - SpellTimer2 = SpawnCast[2].Timer1 + (rand()%4 * 1000); - SpellTimer3 = SpawnCast[3].Timer1 + (rand()%4 * 1000); - } - if (m_creature->GetEntry() == 19797)// Illidari Highlord - { - SpellTimer1 = SpawnCast[4].Timer1 + (rand()%4 * 1000); - SpellTimer2 = SpawnCast[5].Timer1 + (rand()%4 * 1000); - } - Timers = true; - } - //Illidari Soldier - if (m_creature->GetEntry() == 22075) - { - if (SpellTimer1 < diff) - { - DoCast(m_creature->getVictim(), SpawnCast[0].SpellId);//Spellbreaker - SpellTimer1 = SpawnCast[0].Timer2 + (rand()%5 * 1000); - }else SpellTimer1 -= diff; - } - //Illidari Mind Breaker - if (m_creature->GetEntry() == 22074) - { - if (SpellTimer1 < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - { - if (target->GetTypeId() == TYPEID_PLAYER) - { - DoCast(target, SpawnCast[1].SpellId); //Focused Bursts - SpellTimer1 = SpawnCast[1].Timer2 + (rand()%5 * 1000); - }else SpellTimer1 = 2000; - } - }else SpellTimer1 -= diff; - - if (SpellTimer2 < diff) - { - DoCast(m_creature->getVictim(), SpawnCast[2].SpellId);//Psychic Scream - SpellTimer2 = SpawnCast[2].Timer2 + (rand()%13 * 1000); - }else SpellTimer2 -= diff; - - if (SpellTimer3 < diff) - { - DoCast(m_creature->getVictim(), SpawnCast[3].SpellId);//Mind Blast - SpellTimer3 = SpawnCast[3].Timer2 + (rand()%8 * 1000); - }else SpellTimer3 -= diff; - } - //Illidari Highlord - if (m_creature->GetEntry() == 19797) - { - if (SpellTimer1 < diff) - { - DoCast(m_creature->getVictim(), SpawnCast[4].SpellId);//Curse Of Flames - SpellTimer1 = SpawnCast[4].Timer2 + (rand()%10 * 1000); - }else SpellTimer1 -= diff; - - if (SpellTimer2 < diff) - { - DoCast(m_creature->getVictim(), SpawnCast[5].SpellId);//Flamestrike - SpellTimer2 = SpawnCast[5].Timer2 + (rand()%7 * 13000); - }else SpellTimer2 -= diff; - } - - DoMeleeAttackIfReady(); - } -}; - -/*###### -# mob_torloth_the_magnificent -#####*/ - -struct TRINITY_DLL_DECL mob_torloth_the_magnificentAI : public ScriptedAI -{ - mob_torloth_the_magnificentAI(Creature* c) : ScriptedAI(c) {} - - uint32 AnimationTimer, SpellTimer1, SpellTimer2, SpellTimer3; - - uint8 AnimationCount; - - uint64 LordIllidanGUID; - uint64 AggroTargetGUID; - - bool Timers; - - void Reset() - { - AnimationTimer = 4000; - AnimationCount = 0; - LordIllidanGUID = 0; - AggroTargetGUID = 0; - Timers = false; - - m_creature->addUnitState(UNIT_STAT_ROOT); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0); - } - - void EnterCombat(Unit* who){} - - void HandleAnimation() - { - Creature* pCreature = m_creature; - - if (TorlothAnim[AnimationCount].pCreature == 1) - { - pCreature = (Unit::GetCreature(*m_creature, LordIllidanGUID)); - - if (!pCreature) - return; - } - - if (TorlothAnim[AnimationCount].TextId) - DoScriptText(TorlothAnim[AnimationCount].TextId, pCreature); - - AnimationTimer = TorlothAnim[AnimationCount].Timer; - - switch(AnimationCount) - { - case 0: - m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,8); - break; - case 3: - m_creature->RemoveFlag(UNIT_FIELD_BYTES_1,8); - break; - case 5: - if (Player* AggroTarget = (Unit::GetPlayer(AggroTargetGUID))) - { - m_creature->SetUInt64Value(UNIT_FIELD_TARGET, AggroTarget->GetGUID()); - m_creature->AddThreat(AggroTarget, 1); - m_creature->HandleEmoteCommand(EMOTE_ONESHOT_POINT); - } - break; - case 6: - if (Player* AggroTarget = (Unit::GetPlayer(AggroTargetGUID))) - { - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - m_creature->clearUnitState(UNIT_STAT_ROOT); - - float x, y, z; - AggroTarget->GetPosition(x,y,z); - m_creature->GetMotionMaster()->MovePoint(0,x,y,z); - } - break; - } - ++AnimationCount; - } - - void UpdateAI(const uint32 diff) - { - if (AnimationTimer) - { - if (AnimationTimer <= diff) - { - HandleAnimation(); - }else AnimationTimer -= diff; - } - - if (AnimationCount < 6) - { - m_creature->CombatStop(); - }else if (!Timers) - { - - SpellTimer1 = SpawnCast[6].Timer1; - SpellTimer2 = SpawnCast[7].Timer1; - SpellTimer3 = SpawnCast[8].Timer1; - Timers = true; - } - - if (Timers) - { - if (SpellTimer1 < diff) - { - DoCast(m_creature->getVictim(), SpawnCast[6].SpellId);//Cleave - SpellTimer1 = SpawnCast[6].Timer2 + (rand()%10 * 1000); - }else SpellTimer1 -= diff; - - if (SpellTimer2 < diff) - { - DoCast(m_creature->getVictim(), SpawnCast[7].SpellId);//Shadowfury - SpellTimer2 = SpawnCast[7].Timer2 + (rand()%5 * 1000); - }else SpellTimer2 -= diff; - - if (SpellTimer3 < diff) - { - DoCast(m_creature, SpawnCast[8].SpellId); - SpellTimer3 = SpawnCast[8].Timer2 + (rand()%7 * 1000);//Spell Reflection - }else SpellTimer3 -= diff; - } - - DoMeleeAttackIfReady(); - } - - void JustDied(Unit* slayer) - { - if (slayer) - switch(slayer->GetTypeId()) - { - case TYPEID_UNIT: - if (Unit *owner = slayer->GetOwner()) - if (owner->GetTypeId() == TYPEID_PLAYER) - CAST_PLR(owner)->GroupEventHappens(QUEST_BATTLE_OF_THE_CRIMSON_WATCH, m_creature); - break; - - case TYPEID_PLAYER: - CAST_PLR(slayer)->GroupEventHappens(QUEST_BATTLE_OF_THE_CRIMSON_WATCH, m_creature); - break; - } - - if (Creature* LordIllidan = (Unit::GetCreature(*m_creature, LordIllidanGUID))) - { - DoScriptText(END_TEXT, LordIllidan, slayer); - LordIllidan->AI()->EnterEvadeMode(); - } - } -}; - -/*##### -# npc_lord_illidan_stormrage -#####*/ - -struct TRINITY_DLL_DECL npc_lord_illidan_stormrageAI : public ScriptedAI -{ - npc_lord_illidan_stormrageAI(Creature* c) : ScriptedAI(c) {} - - uint64 PlayerGUID; - - uint32 WaveTimer; - uint32 AnnounceTimer; - - int8 LiveCount; - uint8 WaveCount; - - bool EventStarted; - bool Announced; - bool Failed; - - void Reset() - { - PlayerGUID = 0; - - WaveTimer = 10000; - AnnounceTimer = 7000; - LiveCount = 0; - WaveCount = 0; - - EventStarted = false; - Announced = false; - Failed = false; - - m_creature->SetVisibility(VISIBILITY_OFF); - } - - void EnterCombat(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void AttackStart(Unit* who) {} - - void SummonNextWave() - { - uint8 count = WavesInfo[WaveCount].SpawnCount; - uint8 locIndex = WavesInfo[WaveCount].UsedSpawnPoint; - srand(time(NULL));//initializing random seed - uint8 FelguardCount = 0; - uint8 DreadlordCount = 0; - - for(uint8 i = 0; i < count; ++i) - { - Creature* Spawn = NULL; - float X = SpawnLocation[locIndex + i].x; - float Y = SpawnLocation[locIndex + i].y; - float Z = SpawnLocation[locIndex + i].z; - float O = SpawnLocation[locIndex + i].o; - Spawn = m_creature->SummonCreature(WavesInfo[WaveCount].CreatureId, X, Y, Z, O, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000); - ++LiveCount; - - if (Spawn) - { - Spawn->LoadCreaturesAddon(); - - if (WaveCount == 0)//1 Wave - { - if (rand()%3 == 1 && FelguardCount<2) - { - Spawn->SetDisplayId(18654); - ++FelguardCount; - } - else if (DreadlordCount < 3) - { - Spawn->SetDisplayId(19991); - ++DreadlordCount; - } - else if (FelguardCount<2) - { - Spawn->SetDisplayId(18654); - ++FelguardCount; - } - } - - if (WaveCount < 3)//1-3 Wave - { - if (PlayerGUID) - { - if (Player* pTarget = Unit::GetPlayer(PlayerGUID)) - { - float x, y, z; - pTarget->GetPosition(x,y,z); - Spawn->GetMotionMaster()->MovePoint(0,x, y, z); - } - } - CAST_AI(mob_illidari_spawnAI, Spawn->AI())->LordIllidanGUID = m_creature->GetGUID(); - } - - if (WavesInfo[WaveCount].CreatureId == 22076) // Torloth - { - CAST_AI(mob_torloth_the_magnificentAI, Spawn->AI())->LordIllidanGUID = m_creature->GetGUID(); - if (PlayerGUID) - CAST_AI(mob_torloth_the_magnificentAI, Spawn->AI())->AggroTargetGUID = PlayerGUID; - } - } - } - ++WaveCount; - WaveTimer = WavesInfo[WaveCount].SpawnTimer; - AnnounceTimer = WavesInfo[WaveCount].YellTimer; - } - - void CheckEventFail() - { - Player* pPlayer = Unit::GetPlayer(PlayerGUID); - - if (!pPlayer) - return; - - if (Group *EventGroup = pPlayer->GetGroup()) - { - Player* GroupMember; - - uint8 GroupMemberCount = 0; - uint8 DeadMemberCount = 0; - uint8 FailedMemberCount = 0; - - const Group::MemberSlotList members = EventGroup->GetMemberSlots(); - - for(Group::member_citerator itr = members.begin(); itr!= members.end(); itr++) - { - GroupMember = (Unit::GetPlayer(itr->guid)); - if (!GroupMember) - continue; - if (!GroupMember->IsWithinDistInMap(m_creature, EVENT_AREA_RADIUS) && GroupMember->GetQuestStatus(QUEST_BATTLE_OF_THE_CRIMSON_WATCH) == QUEST_STATUS_INCOMPLETE) - { - GroupMember->FailQuest(QUEST_BATTLE_OF_THE_CRIMSON_WATCH); - GroupMember->SetQuestStatus(QUEST_BATTLE_OF_THE_CRIMSON_WATCH, QUEST_STATUS_NONE); - ++FailedMemberCount; - } - ++GroupMemberCount; - - if (GroupMember->isDead()) - { - ++DeadMemberCount; - } - } - - if (GroupMemberCount == FailedMemberCount) - { - Failed = true; - } - - if (GroupMemberCount == DeadMemberCount) - { - for(Group::member_citerator itr = members.begin(); itr!= members.end(); itr++) - { - GroupMember = Unit::GetPlayer(itr->guid); - - if (GroupMember && GroupMember->GetQuestStatus(QUEST_BATTLE_OF_THE_CRIMSON_WATCH) == QUEST_STATUS_INCOMPLETE) - { - GroupMember->FailQuest(QUEST_BATTLE_OF_THE_CRIMSON_WATCH); - GroupMember->SetQuestStatus(QUEST_BATTLE_OF_THE_CRIMSON_WATCH, QUEST_STATUS_NONE); - } - } - Failed = true; - } - }else if (pPlayer->isDead() || !pPlayer->IsWithinDistInMap(m_creature, EVENT_AREA_RADIUS)) - { - pPlayer->FailQuest(QUEST_BATTLE_OF_THE_CRIMSON_WATCH); - Failed = true; - } - } - - void LiveCounter() - { - --LiveCount; - if (!LiveCount) - Announced = false; - } - - void UpdateAI(const uint32 diff) - { - if (!PlayerGUID || !EventStarted) - return; - - if (!LiveCount && WaveCount < 4) - { - if (!Announced && AnnounceTimer < diff) - { - DoScriptText(WavesInfo[WaveCount].WaveTextId, m_creature); - Announced = true; - }else AnnounceTimer -= diff; - - if (WaveTimer < diff) - { - SummonNextWave(); - }else WaveTimer -= diff; - } - CheckEventFail(); - - if (Failed) - EnterEvadeMode(); - } -}; - -void mob_illidari_spawnAI::JustDied(Unit *slayer) -{ - m_creature->RemoveCorpse(); - if (Creature* LordIllidan = (Unit::GetCreature(*m_creature, LordIllidanGUID))) - if (LordIllidan) - CAST_AI(npc_lord_illidan_stormrageAI, LordIllidan->AI())->LiveCounter(); -} - -/*##### -# go_crystal_prison -######*/ - -bool GOQuestAccept_GO_crystal_prison(Player* plr, GameObject* go, Quest const* quest) -{ - if (quest->GetQuestId() == QUEST_BATTLE_OF_THE_CRIMSON_WATCH) - { - Creature* Illidan = plr->FindNearestCreature(22083, 50); - - if (Illidan && !CAST_AI(npc_lord_illidan_stormrageAI, Illidan->AI())->EventStarted) - { - CAST_AI(npc_lord_illidan_stormrageAI, Illidan->AI())->PlayerGUID = plr->GetGUID(); - CAST_AI(npc_lord_illidan_stormrageAI, Illidan->AI())->LiveCount = 0; - CAST_AI(npc_lord_illidan_stormrageAI, Illidan->AI())->EventStarted=true; - } - } - return true; -} - -CreatureAI* GetAI_npc_lord_illidan_stormrage(Creature* c) -{ - return new npc_lord_illidan_stormrageAI(c); -} - -CreatureAI* GetAI_mob_illidari_spawn(Creature* c) -{ - return new mob_illidari_spawnAI(c); -} - -CreatureAI* GetAI_mob_torloth_the_magnificent(Creature* c) -{ - return new mob_torloth_the_magnificentAI(c); -} - -/*#### -# npc_enraged_spirits -####*/ - -/* QUESTS */ -#define QUEST_ENRAGED_SPIRITS_FIRE_EARTH 10458 -#define QUEST_ENRAGED_SPIRITS_AIR 10481 -#define QUEST_ENRAGED_SPIRITS_WATER 10480 - -/* Totem */ -#define ENTRY_TOTEM_OF_SPIRITS 21071 -#define RADIUS_TOTEM_OF_SPIRITS 15 - -/* SPIRITS */ -#define ENTRY_ENRAGED_EARTH_SPIRIT 21050 -#define ENTRY_ENRAGED_FIRE_SPIRIT 21061 -#define ENTRY_ENRAGED_AIR_SPIRIT 21060 -#define ENTRY_ENRAGED_WATER_SPIRIT 21059 - -/* SOULS */ -#define ENTRY_EARTHEN_SOUL 21073 -#define ENTRY_FIERY_SOUL 21097 -#define ENTRY_ENRAGED_AIRY_SOUL 21116 -#define ENTRY_ENRAGED_WATERY_SOUL 21109 // wrong model - -/* SPELL KILLCREDIT - not working!?! - using KilledMonsterCredit */ -#define SPELL_EARTHEN_SOUL_CAPTURED_CREDIT 36108 -#define SPELL_FIERY_SOUL_CAPTURED_CREDIT 36117 -#define SPELL_AIRY_SOUL_CAPTURED_CREDIT 36182 -#define SPELL_WATERY_SOUL_CAPTURED_CREDIT 36171 - -/* KilledMonsterCredit Workaround */ -#define CREDIT_FIRE 21094 -#define CREDIT_WATER 21095 -#define CREDIT_AIR 21096 -#define CREDIT_EARTH 21092 - -/* Captured Spell/Buff */ -#define SPELL_SOUL_CAPTURED 36115 - -/* Factions */ -#define ENRAGED_SOUL_FRIENDLY 35 -#define ENRAGED_SOUL_HOSTILE 14 - -struct TRINITY_DLL_DECL npc_enraged_spiritAI : public ScriptedAI -{ - npc_enraged_spiritAI(Creature *c) : ScriptedAI(c) {} - - void Reset() { } - - void EnterCombat(Unit *who){} - - void JustDied(Unit* killer) - { - // always spawn spirit on death - // if totem around - // move spirit to totem and cast kill count - uint32 entry = 0; - uint32 credit = 0; - - switch(m_creature->GetEntry()) { - case ENTRY_ENRAGED_FIRE_SPIRIT: - entry = ENTRY_FIERY_SOUL; - //credit = SPELL_FIERY_SOUL_CAPTURED_CREDIT; - credit = CREDIT_FIRE; - break; - case ENTRY_ENRAGED_EARTH_SPIRIT: - entry = ENTRY_EARTHEN_SOUL; - //credit = SPELL_EARTHEN_SOUL_CAPTURED_CREDIT; - credit = CREDIT_EARTH; - break; - case ENTRY_ENRAGED_AIR_SPIRIT: - entry = ENTRY_ENRAGED_AIRY_SOUL; - //credit = SPELL_AIRY_SOUL_CAPTURED_CREDIT; - credit = CREDIT_AIR; - break; - case ENTRY_ENRAGED_WATER_SPIRIT: - entry = ENTRY_ENRAGED_WATERY_SOUL; - //credit = SPELL_WATERY_SOUL_CAPTURED_CREDIT; - credit = CREDIT_WATER; - break; - } - - // Spawn Soul on Kill ALWAYS! - Creature* Summoned = NULL; - Unit* totemOspirits = NULL; - - if (entry != 0) - Summoned = DoSpawnCreature(entry, 0, 0, 1, 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 5000); - - // FIND TOTEM, PROCESS QUEST - if (Summoned) - { - totemOspirits = me->FindNearestCreature(ENTRY_TOTEM_OF_SPIRITS, RADIUS_TOTEM_OF_SPIRITS); - if (totemOspirits) - { - Summoned->setFaction(ENRAGED_SOUL_FRIENDLY); - Summoned->GetMotionMaster()->MovePoint(0,totemOspirits->GetPositionX(), totemOspirits->GetPositionY(), Summoned->GetPositionZ()); - - Unit* Owner = totemOspirits->GetOwner(); - if (Owner && Owner->GetTypeId() == TYPEID_PLAYER) - // DoCast(Owner, credit); -- not working! - CAST_PLR(Owner)->KilledMonsterCredit(credit, Summoned->GetGUID()); - DoCast(totemOspirits,SPELL_SOUL_CAPTURED); - } - } - } -}; - -CreatureAI* GetAI_npc_enraged_spirit(Creature* pCreature) -{ -return new npc_enraged_spiritAI(pCreature); -} - -/*##### -# -######*/ - -void AddSC_shadowmoon_valley() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "mob_mature_netherwing_drake"; - newscript->GetAI = &GetAI_mob_mature_netherwing_drake; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_enslaved_netherwing_drake"; - newscript->GetAI = &GetAI_mob_enslaved_netherwing_drake; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_dragonmaw_peon"; - newscript->GetAI = &GetAI_mob_dragonmaw_peon; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_drake_dealer_hurlunk"; - newscript->pGossipHello = &GossipHello_npc_drake_dealer_hurlunk; - newscript->pGossipSelect = &GossipSelect_npc_drake_dealer_hurlunk; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npcs_flanis_swiftwing_and_kagrosh"; - newscript->pGossipHello = &GossipHello_npcs_flanis_swiftwing_and_kagrosh; - newscript->pGossipSelect = &GossipSelect_npcs_flanis_swiftwing_and_kagrosh; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_murkblood_overseer"; - newscript->pGossipHello = &GossipHello_npc_murkblood_overseer; - newscript->pGossipSelect = &GossipSelect_npc_murkblood_overseer; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_neltharaku"; - newscript->pGossipHello = &GossipHello_npc_neltharaku; - newscript->pGossipSelect = &GossipSelect_npc_neltharaku; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "npc_karynaku"; - newscript->pQuestAccept = &QuestAccept_npc_karynaku; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_oronok_tornheart"; - newscript->pGossipHello = &GossipHello_npc_oronok_tornheart; - newscript->pGossipSelect = &GossipSelect_npc_oronok_tornheart; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "npc_overlord_morghor"; - newscript->GetAI = &GetAI_npc_overlord_morghor; - newscript->pQuestAccept = &QuestAccept_npc_overlord_morghor; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "npc_earthmender_wilda"; - newscript->GetAI = &GetAI_npc_earthmender_wilda; - newscript->pQuestAccept = &QuestAccept_npc_earthmender_wilda; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "npc_lord_illidan_stormrage"; - newscript->GetAI = &GetAI_npc_lord_illidan_stormrage; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "go_crystal_prison"; - newscript->pGOQuestAccept = &GOQuestAccept_GO_crystal_prison; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_illidari_spawn"; - newscript->GetAI = &GetAI_mob_illidari_spawn; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_torloth_the_magnificent"; - newscript->GetAI = &GetAI_mob_torloth_the_magnificent; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "npc_enraged_spirit"; - newscript->GetAI = &GetAI_npc_enraged_spirit; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/shattrath/shattrath_city.cpp b/src/bindings/scripts/scripts/zone/shattrath/shattrath_city.cpp deleted file mode 100644 index 041e1355325..00000000000 --- a/src/bindings/scripts/scripts/zone/shattrath/shattrath_city.cpp +++ /dev/null @@ -1,692 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Shattrath_City -SD%Complete: 100 -SDComment: Quest support: 10004, 10009, 10211, 10231. Flask vendors, Teleport to Caverns of Time -SDCategory: Shattrath City -EndScriptData */ - -/* ContentData -npc_raliq_the_drunk -npc_salsalabim -npc_shattrathflaskvendors -npc_zephyr -npc_kservant -npc_dirty_larry -npc_ishanah -npc_khadgar -EndContentData */ - -#include "precompiled.h" -#include "../../npc/npc_escortAI.h" - -/*###### -## npc_raliq_the_drunk -######*/ - -#define GOSSIP_RALIQ "You owe Sim'salabim money. Hand them over or die!" - -enum -{ - SPELL_UPPERCUT = 10966, - QUEST_CRACK_SKULLS = 10009, - FACTION_HOSTILE_RD = 45 -}; - -struct TRINITY_DLL_DECL npc_raliq_the_drunkAI : public ScriptedAI -{ - npc_raliq_the_drunkAI(Creature* c) : ScriptedAI(c) - { - m_uiNormFaction = c->getFaction(); - } - - uint32 m_uiNormFaction; - uint32 Uppercut_Timer; - - void Reset() - { - Uppercut_Timer = 5000; - if (m_creature->getFaction() != m_uiNormFaction) - m_creature->setFaction(m_uiNormFaction); - } - - void EnterCombat(Unit *who) {} - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (Uppercut_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_UPPERCUT); - Uppercut_Timer = 15000; - }else Uppercut_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_npc_raliq_the_drunk(Creature* pCreature) -{ - return new npc_raliq_the_drunkAI (pCreature); -} - -bool GossipHello_npc_raliq_the_drunk(Player* pPlayer, Creature* pCreature) -{ - if (pPlayer->GetQuestStatus(QUEST_CRACK_SKULLS) == QUEST_STATUS_INCOMPLETE) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_RALIQ, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - - pPlayer->SEND_GOSSIP_MENU(9440, pCreature->GetGUID()); - return true; -} - -bool GossipSelect_npc_raliq_the_drunk(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) - { - pPlayer->CLOSE_GOSSIP_MENU(); - pCreature->setFaction(FACTION_HOSTILE_RD); - pCreature->AI()->AttackStart(pPlayer); - } - return true; -} - -/*###### -# npc_salsalabim -######*/ - -#define FACTION_HOSTILE_SA 90 -#define FACTION_FRIENDLY_SA 35 -#define QUEST_10004 10004 - -#define SPELL_MAGNETIC_PULL 31705 - -struct TRINITY_DLL_DECL npc_salsalabimAI : public ScriptedAI -{ - npc_salsalabimAI(Creature* c) : ScriptedAI(c) {} - - uint32 MagneticPull_Timer; - - void Reset() - { - MagneticPull_Timer = 15000; - m_creature->setFaction(FACTION_FRIENDLY_SA); - } - - void EnterCombat(Unit *who) {} - - void DamageTaken(Unit *done_by, uint32 &damage) - { - if (done_by->GetTypeId() == TYPEID_PLAYER) - if ((m_creature->GetHealth()-damage)*100 / m_creature->GetMaxHealth() < 20) - { - CAST_PLR(done_by)->GroupEventHappens(QUEST_10004,m_creature); - damage = 0; - EnterEvadeMode(); - } - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (MagneticPull_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_MAGNETIC_PULL); - MagneticPull_Timer = 15000; - }else MagneticPull_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_npc_salsalabim(Creature* pCreature) -{ - return new npc_salsalabimAI (pCreature); -} - -bool GossipHello_npc_salsalabim(Player* pPlayer, Creature* pCreature) -{ - if (pPlayer->GetQuestStatus(QUEST_10004) == QUEST_STATUS_INCOMPLETE) - { - pCreature->setFaction(FACTION_HOSTILE_SA); - pCreature->AI()->AttackStart(pPlayer); - } - else - { - if (pCreature->isQuestGiver()) - pPlayer->PrepareQuestMenu(pCreature->GetGUID()); - pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); - } - return true; -} - -/* -################################################## -Shattrath City Flask Vendors provides flasks to people exalted with 3 factions: -Haldor the Compulsive -Arcanist Xorith -Both sell special flasks for use in Outlands 25man raids only, -purchasable for one Mark of Illidari each -Purchase requires exalted reputation with Scryers/Aldor, Cenarion Expedition and The Sha'tar -################################################## -*/ - -bool GossipHello_npc_shattrathflaskvendors(Player* pPlayer, Creature* pCreature) -{ - if (pCreature->GetEntry() == 23484) - { - // Aldor vendor - if (pCreature->isVendor() && (pPlayer->GetReputationRank(932) == REP_EXALTED) && (pPlayer->GetReputationRank(935) == REP_EXALTED) && (pPlayer->GetReputationRank(942) == REP_EXALTED)) - { - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); - pPlayer->SEND_GOSSIP_MENU(11085, pCreature->GetGUID()); - } - else - { - pPlayer->SEND_GOSSIP_MENU(11083, pCreature->GetGUID()); - } - } - - if (pCreature->GetEntry() == 23483) - { - // Scryers vendor - if (pCreature->isVendor() && (pPlayer->GetReputationRank(934) == REP_EXALTED) && (pPlayer->GetReputationRank(935) == REP_EXALTED) && (pPlayer->GetReputationRank(942) == REP_EXALTED)) - { - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); - pPlayer->SEND_GOSSIP_MENU(11085, pCreature->GetGUID()); - } - else - { - pPlayer->SEND_GOSSIP_MENU(11084, pCreature->GetGUID()); - } - } - - return true; -} - -bool GossipSelect_npc_shattrathflaskvendors(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - if (uiAction == GOSSIP_ACTION_TRADE) - pPlayer->SEND_VENDORLIST(pCreature->GetGUID()); - - return true; -} - -/*###### -# npc_zephyr -######*/ - -#define GOSSIP_HZ "Take me to the Caverns of Time." - -bool GossipHello_npc_zephyr(Player* pPlayer, Creature* pCreature) -{ - if (pPlayer->GetReputationRank(989) >= REP_REVERED) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HZ, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - - pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); - - return true; -} - -bool GossipSelect_npc_zephyr(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) - pPlayer->CastSpell(pPlayer,37778,false); - - return true; -} - -/*###### -# npc_kservant -######*/ - -#define SAY1 -1000306 -#define WHISP1 -1000307 -#define WHISP2 -1000308 -#define WHISP3 -1000309 -#define WHISP4 -1000310 -#define WHISP5 -1000311 -#define WHISP6 -1000312 -#define WHISP7 -1000313 -#define WHISP8 -1000314 -#define WHISP9 -1000315 -#define WHISP10 -1000316 -#define WHISP11 -1000317 -#define WHISP12 -1000318 -#define WHISP13 -1000319 -#define WHISP14 -1000320 -#define WHISP15 -1000321 -#define WHISP16 -1000322 -#define WHISP17 -1000323 -#define WHISP18 -1000324 -#define WHISP19 -1000325 -#define WHISP20 -1000326 -#define WHISP21 -1000327 - -struct TRINITY_DLL_DECL npc_kservantAI : public npc_escortAI -{ -public: - npc_kservantAI(Creature *c) : npc_escortAI(c) {} - - - void WaypointReached(uint32 i) - { - Unit *pTemp = Unit::GetUnit(*m_creature,PlayerGUID); - - if (!pTemp) - return; - - switch(i) - { - case 0: DoScriptText(SAY1, m_creature, pTemp); break; - case 4: DoScriptText(WHISP1, m_creature, pTemp); break; - case 6: DoScriptText(WHISP2, m_creature, pTemp); break; - case 7: DoScriptText(WHISP3, m_creature, pTemp); break; - case 8: DoScriptText(WHISP4, m_creature, pTemp); break; - case 17: DoScriptText(WHISP5, m_creature, pTemp); break; - case 18: DoScriptText(WHISP6, m_creature, pTemp); break; - case 19: DoScriptText(WHISP7, m_creature, pTemp); break; - case 33: DoScriptText(WHISP8, m_creature, pTemp); break; - case 34: DoScriptText(WHISP9, m_creature, pTemp); break; - case 35: DoScriptText(WHISP10, m_creature, pTemp); break; - case 36: DoScriptText(WHISP11, m_creature, pTemp); break; - case 43: DoScriptText(WHISP12, m_creature, pTemp); break; - case 44: DoScriptText(WHISP13, m_creature, pTemp); break; - case 49: DoScriptText(WHISP14, m_creature, pTemp); break; - case 50: DoScriptText(WHISP15, m_creature, pTemp); break; - case 51: DoScriptText(WHISP16, m_creature, pTemp); break; - case 52: DoScriptText(WHISP17, m_creature, pTemp); break; - case 53: DoScriptText(WHISP18, m_creature, pTemp); break; - case 54: DoScriptText(WHISP19, m_creature, pTemp); break; - case 55: DoScriptText(WHISP20, m_creature, pTemp); break; - case 56: DoScriptText(WHISP21, m_creature, pTemp); - if (PlayerGUID) - { - Player* pPlayer = (Unit::GetPlayer(PlayerGUID)); - if (pPlayer) - pPlayer->GroupEventHappens(10211,m_creature); - } - break; - } - } - - void EnterCombat(Unit* who) {} - - void MoveInLineOfSight(Unit *who) - { - if (IsBeingEscorted) - return; - - if (who->GetTypeId() == TYPEID_PLAYER) - { - if (CAST_PLR(who)->GetQuestStatus(10211) == QUEST_STATUS_INCOMPLETE) - { - float Radius = 10.0; - if (m_creature->IsWithinDistInMap(who, Radius)) - { - Start(false, false, who->GetGUID()); - } - } - } - } - - void Reset() {} - - void UpdateAI(const uint32 diff) - { - npc_escortAI::UpdateAI(diff); - } -}; -CreatureAI* GetAI_npc_kservantAI(Creature* pCreature) -{ - npc_kservantAI* kservantAI = new npc_kservantAI(pCreature); - - kservantAI->FillPointMovementListForCreature(); - - return kservantAI; -} - -/*###### -# npc_dirty_larry -######*/ - -#define GOSSIP_BOOK "Ezekiel said that you might have a certain book..." - -#define SAY_1 -1000328 -#define SAY_2 -1000329 -#define SAY_3 -1000330 -#define SAY_4 -1000331 -#define SAY_5 -1000332 -#define SAY_GIVEUP -1000333 - -#define QUEST_WBI 10231 -#define NPC_CREEPJACK 19726 -#define NPC_MALONE 19725 - -struct TRINITY_DLL_DECL npc_dirty_larryAI : public ScriptedAI -{ - npc_dirty_larryAI(Creature* c) : ScriptedAI(c) {} - - bool Event; - bool Attack; - bool Done; - - uint64 PlayerGUID; - - uint32 SayTimer; - uint32 Step; - - void Reset() - { - Event = false; - Attack = false; - Done = false; - - PlayerGUID = 0; - SayTimer = 0; - Step = 0; - - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - m_creature->setFaction(1194); - Unit* Creepjack = me->FindNearestCreature(NPC_CREEPJACK, 20); - if (Creepjack) - { - CAST_CRE(Creepjack)->AI()->EnterEvadeMode(); - Creepjack->setFaction(1194); - Creepjack->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - } - Unit* Malone = me->FindNearestCreature(NPC_MALONE, 20); - if (Malone) - { - CAST_CRE(Malone)->AI()->EnterEvadeMode(); - Malone->setFaction(1194); - Malone->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - } - } - - uint32 NextStep(uint32 Step) - { - Player* pPlayer = Unit::GetPlayer(PlayerGUID); - - switch(Step) - { - case 0:{ m_creature->SetInFront(pPlayer); - Unit* Creepjack = me->FindNearestCreature(NPC_CREEPJACK, 20); - if (Creepjack) - Creepjack->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); - Unit* Malone = me->FindNearestCreature(NPC_MALONE, 20); - if (Malone) - Malone->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); - m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); }return 2000; - case 1: DoScriptText(SAY_1, m_creature, pPlayer); return 3000; - case 2: DoScriptText(SAY_2, m_creature, pPlayer); return 5000; - case 3: DoScriptText(SAY_3, m_creature, pPlayer); return 2000; - case 4: DoScriptText(SAY_4, m_creature, pPlayer); return 2000; - case 5: DoScriptText(SAY_5, m_creature, pPlayer); return 2000; - case 6: Attack = true; return 2000; - default: return 0; - } - } - - void EnterCombat(Unit* who){} - - void UpdateAI(const uint32 diff) - { - if (SayTimer < diff) - { - if (Event) - SayTimer = NextStep(++Step); - }else SayTimer -= diff; - - if (Attack) - { - Player* pPlayer = Unit::GetPlayer(PlayerGUID); - m_creature->setFaction(14); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - if (pPlayer) - { - Unit* Creepjack = me->FindNearestCreature(NPC_CREEPJACK, 20); - if (Creepjack) - { - Creepjack->Attack(pPlayer, true); - Creepjack->setFaction(14); - Creepjack->GetMotionMaster()->MoveChase(pPlayer); - Creepjack->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - } - Unit* Malone = me->FindNearestCreature(NPC_MALONE, 20); - if (Malone) - { - Malone->Attack(pPlayer, true); - Malone->setFaction(14); - Malone->GetMotionMaster()->MoveChase(pPlayer); - Malone->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - } - DoStartMovement(pPlayer); - AttackStart(pPlayer); - } - Attack = false; - } - - if ((m_creature->GetHealth()*100)/m_creature->GetMaxHealth() < 1 && !Done) - { - Unit* Creepjack = me->FindNearestCreature(NPC_CREEPJACK, 20); - if (Creepjack) - { - CAST_CRE(Creepjack)->AI()->EnterEvadeMode(); - Creepjack->setFaction(1194); - Creepjack->GetMotionMaster()->MoveTargetedHome(); - Creepjack->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - } - Unit* Malone = me->FindNearestCreature(NPC_MALONE, 20); - if (Malone) - { - CAST_CRE(Malone)->AI()->EnterEvadeMode(); - Malone->setFaction(1194); - Malone->GetMotionMaster()->MoveTargetedHome(); - Malone->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - } - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - m_creature->setFaction(1194); - Done = true; - DoScriptText(SAY_GIVEUP, m_creature, NULL); - m_creature->DeleteThreatList(); - m_creature->CombatStop(); - m_creature->GetMotionMaster()->MoveTargetedHome(); - Player* pPlayer = Unit::GetPlayer(PlayerGUID); - if (pPlayer) - CAST_PLR(pPlayer)->GroupEventHappens(QUEST_WBI, m_creature); - } - DoMeleeAttackIfReady(); - } -}; - -bool GossipHello_npc_dirty_larry(Player* pPlayer, Creature* pCreature) -{ - if (pCreature->isQuestGiver()) - pPlayer->PrepareQuestMenu(pCreature->GetGUID()); - - if (pPlayer->GetQuestStatus(QUEST_WBI) == QUEST_STATUS_INCOMPLETE) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BOOK, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - - pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); - return true; -} - -bool GossipSelect_npc_dirty_larry(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) - { - CAST_AI(npc_dirty_larryAI, pCreature->AI())->Event = true; - CAST_AI(npc_dirty_larryAI, pCreature->AI())->PlayerGUID = pPlayer->GetGUID(); - pPlayer->CLOSE_GOSSIP_MENU(); - } - - return true; -} - -CreatureAI* GetAI_npc_dirty_larryAI(Creature* pCreature) -{ - return new npc_dirty_larryAI (pCreature); -} - -/*###### -# npc_ishanah -######*/ - -#define ISANAH_GOSSIP_1 "Who are the Sha'tar?" -#define ISANAH_GOSSIP_2 "Isn't Shattrath a draenei city? Why do you allow others here?" - -bool GossipHello_npc_ishanah(Player* pPlayer, Creature* pCreature) -{ - if (pCreature->isQuestGiver()) - pPlayer->PrepareQuestMenu(pCreature->GetGUID()); - - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, ISANAH_GOSSIP_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, ISANAH_GOSSIP_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); - - pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); - - return true; -} - -bool GossipSelect_npc_ishanah(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) - pPlayer->SEND_GOSSIP_MENU(9458, pCreature->GetGUID()); - else if (uiAction == GOSSIP_ACTION_INFO_DEF+2) - pPlayer->SEND_GOSSIP_MENU(9459, pCreature->GetGUID()); - - return true; -} - -/*###### -# npc_khadgar -######*/ - -#define KHADGAR_GOSSIP_1 "I've heard your name spoken only in whispers, mage. Who are you?" -#define KHADGAR_GOSSIP_2 "Go on, please." -#define KHADGAR_GOSSIP_3 "I see." //6th too this -#define KHADGAR_GOSSIP_4 "What did you do then?" -#define KHADGAR_GOSSIP_5 "What happened next?" -#define KHADGAR_GOSSIP_7 "There was something else I wanted to ask you." - -bool GossipHello_npc_khadgar(Player* pPlayer, Creature* pCreature) -{ - if (pCreature->isQuestGiver()) - pPlayer->PrepareQuestMenu(pCreature->GetGUID()); - - if (!pPlayer->hasQuest(10211)) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, KHADGAR_GOSSIP_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - - pPlayer->SEND_GOSSIP_MENU(9243, pCreature->GetGUID()); - - return true; -} - -bool GossipSelect_npc_khadgar(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - switch(uiAction) - { - case GOSSIP_ACTION_INFO_DEF+1: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, KHADGAR_GOSSIP_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); - pPlayer->SEND_GOSSIP_MENU(9876, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+2: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, KHADGAR_GOSSIP_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); - pPlayer->SEND_GOSSIP_MENU(9877, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+3: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, KHADGAR_GOSSIP_4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4); - pPlayer->SEND_GOSSIP_MENU(9878, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+4: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, KHADGAR_GOSSIP_5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5); - pPlayer->SEND_GOSSIP_MENU(9879, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+5: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, KHADGAR_GOSSIP_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6); - pPlayer->SEND_GOSSIP_MENU(9880, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+6: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, KHADGAR_GOSSIP_7, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+7); - pPlayer->SEND_GOSSIP_MENU(9881, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+7: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, KHADGAR_GOSSIP_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - pPlayer->SEND_GOSSIP_MENU(9243, pCreature->GetGUID()); - break; - } - return true; -} - -void AddSC_shattrath_city() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="npc_raliq_the_drunk"; - newscript->GetAI = &GetAI_npc_raliq_the_drunk; - newscript->pGossipHello = &GossipHello_npc_raliq_the_drunk; - newscript->pGossipSelect = &GossipSelect_npc_raliq_the_drunk; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_salsalabim"; - newscript->GetAI = &GetAI_npc_salsalabim; - newscript->pGossipHello = &GossipHello_npc_salsalabim; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_shattrathflaskvendors"; - newscript->pGossipHello = &GossipHello_npc_shattrathflaskvendors; - newscript->pGossipSelect = &GossipSelect_npc_shattrathflaskvendors; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_zephyr"; - newscript->pGossipHello = &GossipHello_npc_zephyr; - newscript->pGossipSelect = &GossipSelect_npc_zephyr; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_kservant"; - newscript->GetAI = &GetAI_npc_kservantAI; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_dirty_larry"; - newscript->GetAI = &GetAI_npc_dirty_larryAI; - newscript->pGossipHello = &GossipHello_npc_dirty_larry; - newscript->pGossipSelect = &GossipSelect_npc_dirty_larry; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_ishanah"; - newscript->pGossipHello = &GossipHello_npc_ishanah; - newscript->pGossipSelect = &GossipSelect_npc_ishanah; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_khadgar"; - newscript->pGossipHello = &GossipHello_npc_khadgar; - newscript->pGossipSelect = &GossipSelect_npc_khadgar; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/sholazar_basin/sholazar_basin.cpp b/src/bindings/scripts/scripts/zone/sholazar_basin/sholazar_basin.cpp deleted file mode 100644 index 755cf3aa638..00000000000 --- a/src/bindings/scripts/scripts/zone/sholazar_basin/sholazar_basin.cpp +++ /dev/null @@ -1,180 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Sholazar_Basin -SD%Complete: 100 -SDComment: Quest support: 12570 -SDCategory: Sholazar_Basin -EndScriptData */ - -/* ContentData -npc_injured_rainspeaker_oracle -EndContentData */ - -#include "precompiled.h" -#include "../../npc/npc_escortAI.h" - -/*###### -## npc_injured_rainspeaker_oracle -######*/ - -#define GOSSIP_ITEM1 "I am ready to travel to your village now." - -enum -{ - SAY_START_IRO = -1571000, - SAY_QUEST_ACCEPT_IRO = -1571001, - SAY_END_IRO = -1571002, - - QUEST_FORTUNATE_MISUNDERSTANDINGS = 12570, - FACTION_ESCORTEE_A = 774, - FACTION_ESCORTEE_H = 775 -}; - -struct TRINITY_DLL_DECL npc_injured_rainspeaker_oracleAI : public npc_escortAI -{ - npc_injured_rainspeaker_oracleAI(Creature* c) : npc_escortAI(c) { c_guid = c->GetGUID(); } - - uint64 c_guid; - - void Reset() - { - me->RestoreFaction(); - // if we will have other way to assign this to only one npc remove this part - if (GUID_LOPART(me->GetGUID()) != 101030) - { - me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER); - me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - } - } - - void WaypointReached(uint32 i) - { - Player* pPlayer = Unit::GetPlayer(PlayerGUID); - - if (!pPlayer) - return; - - switch(i) - { - case 1: SetRun(); break; - case 10: - case 11: - case 12: - case 13: - case 14: - case 15: - case 16: - case 17: - case 18: - m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_SWIMMING); - m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_JUMPING); - m_creature->SetSpeed(MOVE_SWIM, 0.85f, true); - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_SWIMMING + MOVEMENTFLAG_LEVITATING); - break; - case 19: - m_creature->SetUnitMovementFlags(MOVEMENTFLAG_JUMPING); - break; - case 28: - if (Player* pPlayer = Unit::GetPlayer(PlayerGUID)) - pPlayer->GroupEventHappens(QUEST_FORTUNATE_MISUNDERSTANDINGS, m_creature); - // me->RestoreFaction(); - DoScriptText(SAY_END_IRO,m_creature); - SetRun(false); - break; - } - } - - void JustDied(Unit* killer) - { - if (!IsBeingEscorted) - return; - - if (Player* pPlayer = Unit::GetPlayer(PlayerGUID)) - { - if (pPlayer->GetQuestStatus(QUEST_FORTUNATE_MISUNDERSTANDINGS) != QUEST_STATUS_COMPLETE) - pPlayer->FailQuest(QUEST_FORTUNATE_MISUNDERSTANDINGS); - } - } - - void UpdateAI(Player* pPlayer, Creature* pCreature,const uint32 diff) - { - npc_escortAI::UpdateAI(diff); - } -}; - - -bool GossipHello_npc_injured_rainspeaker_oracle(Player* pPlayer, Creature* pCreature) -{ - if (pCreature->isQuestGiver()) - pPlayer->PrepareQuestMenu(pCreature->GetGUID()); - - if (pPlayer->GetQuestStatus(QUEST_FORTUNATE_MISUNDERSTANDINGS) == QUEST_STATUS_INCOMPLETE) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - - pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); - - return true; -} - -bool GossipSelect_npc_injured_rainspeaker_oracle(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) - { - CAST_AI(npc_escortAI, (pCreature->AI()))->Start(true, false, pPlayer->GetGUID()); - CAST_AI(npc_escortAI, (pCreature->AI()))->SetMaxPlayerDistance(35.0f); - pCreature->SetUnitMovementFlags(MOVEMENTFLAG_JUMPING); - DoScriptText(SAY_START_IRO, pCreature); - - switch (pPlayer->GetTeam()){ - case ALLIANCE: - pCreature->setFaction(FACTION_ESCORTEE_A); - break; - case HORDE: - pCreature->setFaction(FACTION_ESCORTEE_H); - break; - } - } - return true; -} - -bool QuestAccept_npc_injured_rainspeaker_oracle(Player* pPlayer, Creature* pCreature, Quest const *_Quest) -{ - DoScriptText(SAY_QUEST_ACCEPT_IRO, pCreature); - return false; -} - -CreatureAI* GetAI_npc_injured_rainspeaker_oracle(Creature* pCreature) -{ - npc_injured_rainspeaker_oracleAI* thisAI = new npc_injured_rainspeaker_oracleAI(pCreature); - - thisAI->FillPointMovementListForCreature(); - - return thisAI; -} - -void AddSC_sholazar_basin() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "npc_injured_rainspeaker_oracle"; - newscript->GetAI = &GetAI_npc_injured_rainspeaker_oracle; - newscript->pGossipHello = &GossipHello_npc_injured_rainspeaker_oracle; - newscript->pGossipSelect = &GossipSelect_npc_injured_rainspeaker_oracle; - newscript->pQuestAccept = &QuestAccept_npc_injured_rainspeaker_oracle; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/silithus/silithus.cpp b/src/bindings/scripts/scripts/zone/silithus/silithus.cpp deleted file mode 100644 index fce271a351d..00000000000 --- a/src/bindings/scripts/scripts/zone/silithus/silithus.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: Silithus -SD%Complete: 100 -SDComment: Quest support: 7785, 8304. -SDCategory: Silithus -EndScriptData */ - -/* ContentData -npc_highlord_demitrian -npcs_rutgar_and_frankal -EndContentData */ - -#include "precompiled.h" - -/*### -## npc_highlord_demitrian -###*/ - -#define GOSSIP_DEMITRIAN1 "What do you know of it?" -#define GOSSIP_DEMITRIAN2 "I am listening , Demitrian." -#define GOSSIP_DEMITRIAN3 "Continue, please." -#define GOSSIP_DEMITRIAN4 "A battle?" -#define GOSSIP_DEMITRIAN5 "" -#define GOSSIP_DEMITRIAN6 "Caught unaware? How?" -#define GOSSIP_DEMITRIAN7 "So what did Ragnaros do next?" - -bool GossipHello_npc_highlord_demitrian(Player* pPlayer, Creature* pCreature) -{ - if (pCreature->isQuestGiver()) - pPlayer->PrepareQuestMenu(pCreature->GetGUID()); - - if (pPlayer->GetQuestStatus(7785) == QUEST_STATUS_NONE && - (pPlayer->HasItemCount(18563,1,false) || pPlayer->HasItemCount(18564,1,false))) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DEMITRIAN1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - - pPlayer->SEND_GOSSIP_MENU(6812, pCreature->GetGUID()); - return true; -} - -bool GossipSelect_npc_highlord_demitrian(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - switch (uiAction) - { - case GOSSIP_ACTION_INFO_DEF: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DEMITRIAN2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - pPlayer->SEND_GOSSIP_MENU(6842, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+1: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DEMITRIAN3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); - pPlayer->SEND_GOSSIP_MENU(6843, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+2: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DEMITRIAN4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); - pPlayer->SEND_GOSSIP_MENU(6844, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+3: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DEMITRIAN5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4); - pPlayer->SEND_GOSSIP_MENU(6867, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+4: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DEMITRIAN6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5); - pPlayer->SEND_GOSSIP_MENU(6868, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+5: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DEMITRIAN7, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6); - pPlayer->SEND_GOSSIP_MENU(6869, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+6: - pPlayer->SEND_GOSSIP_MENU(6870, pCreature->GetGUID()); - - ItemPosCountVec dest; - uint8 msg = pPlayer->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, 19016, 1); - if (msg == EQUIP_ERR_OK) - pPlayer->StoreNewItem(dest, 19016, true); - break; - } - return true; -} - -/*### -## npcs_rutgar_and_frankal -###*/ - -//gossip item text best guess -#define GOSSIP_ITEM1 "I seek information about Natalia" - -#define GOSSIP_ITEM2 "That sounds dangerous!" -#define GOSSIP_ITEM3 "What did you do?" -#define GOSSIP_ITEM4 "Who?" -#define GOSSIP_ITEM5 "Women do that. What did she demand?" -#define GOSSIP_ITEM6 "What do you mean?" -#define GOSSIP_ITEM7 "What happened next?" - -#define GOSSIP_ITEM11 "Yes, please continue" -#define GOSSIP_ITEM12 "What language?" -#define GOSSIP_ITEM13 "The Priestess attacked you?!" -#define GOSSIP_ITEM14 "I should ask the monkey about this" -#define GOSSIP_ITEM15 "Then what..." - -//trigger creatures to kill -#define TRIGGER_RUTGAR 15222 -#define TRIGGER_FRANKAL 15221 - -bool GossipHello_npcs_rutgar_and_frankal(Player* pPlayer, Creature* pCreature) -{ - if (pCreature->isQuestGiver()) - pPlayer->PrepareQuestMenu(pCreature->GetGUID()); - - if (pPlayer->GetQuestStatus(8304) == QUEST_STATUS_INCOMPLETE && - pCreature->GetEntry() == 15170 && - !pPlayer->GetReqKillOrCastCurrentCount(8304, TRIGGER_RUTGAR)) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - - if (pPlayer->GetQuestStatus(8304) == QUEST_STATUS_INCOMPLETE && - pCreature->GetEntry() == 15171 && - pPlayer->GetReqKillOrCastCurrentCount(8304, TRIGGER_RUTGAR)) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+9); - - pPlayer->SEND_GOSSIP_MENU(7754, pCreature->GetGUID()); - - return true; -} - -bool GossipSelect_npcs_rutgar_and_frankal(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - switch (uiAction) - { - case GOSSIP_ACTION_INFO_DEF: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - pPlayer->SEND_GOSSIP_MENU(7755, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF + 1: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - pPlayer->SEND_GOSSIP_MENU(7756, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF + 2: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); - pPlayer->SEND_GOSSIP_MENU(7757, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF + 3: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4); - pPlayer->SEND_GOSSIP_MENU(7758, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF + 4: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5); - pPlayer->SEND_GOSSIP_MENU(7759, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF + 5: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM7, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6); - pPlayer->SEND_GOSSIP_MENU(7760, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF + 6: - pPlayer->SEND_GOSSIP_MENU(7761, pCreature->GetGUID()); - //'kill' our trigger to update quest status - pPlayer->KilledMonsterCredit(TRIGGER_RUTGAR, pCreature->GetGUID()); - break; - - case GOSSIP_ACTION_INFO_DEF + 9: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM11, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11); - pPlayer->SEND_GOSSIP_MENU(7762, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF + 10: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM12, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11); - pPlayer->SEND_GOSSIP_MENU(7763, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF + 11: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM13, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 12); - pPlayer->SEND_GOSSIP_MENU(7764, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF + 12: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM14, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 13); - pPlayer->SEND_GOSSIP_MENU(7765, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF + 13: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM15, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 14); - pPlayer->SEND_GOSSIP_MENU(7766, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF + 14: - pPlayer->SEND_GOSSIP_MENU(7767, pCreature->GetGUID()); - //'kill' our trigger to update quest status - pPlayer->KilledMonsterCredit(TRIGGER_FRANKAL, pCreature->GetGUID()); - break; - } - return true; -} - -/*### -## -####*/ - -void AddSC_silithus() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "npc_highlord_demitrian"; - newscript->pGossipHello = &GossipHello_npc_highlord_demitrian; - newscript->pGossipSelect = &GossipSelect_npc_highlord_demitrian; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npcs_rutgar_and_frankal"; - newscript->pGossipHello = &GossipHello_npcs_rutgar_and_frankal; - newscript->pGossipSelect = &GossipSelect_npcs_rutgar_and_frankal; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/silvermoon/silvermoon_city.cpp b/src/bindings/scripts/scripts/zone/silvermoon/silvermoon_city.cpp deleted file mode 100644 index ee5533f53f4..00000000000 --- a/src/bindings/scripts/scripts/zone/silvermoon/silvermoon_city.cpp +++ /dev/null @@ -1,104 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 .sourceforge.net/> - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Silvermoon_City -SD%Complete: 100 -SDComment: Quest support: 9685 -SDCategory: Silvermoon City -EndScriptData */ - -/* ContentData -npc_blood_knight_stillblade -EndContentData */ - -#include "precompiled.h" - -/*####### -# npc_blood_knight_stillblade -#######*/ - -#define SAY_HEAL -1000334 - -#define QUEST_REDEEMING_THE_DEAD 9685 -#define SPELL_SHIMMERING_VESSEL 31225 -#define SPELL_REVIVE_SELF 32343 - -struct TRINITY_DLL_DECL npc_blood_knight_stillbladeAI : public ScriptedAI -{ - npc_blood_knight_stillbladeAI(Creature *c) : ScriptedAI(c) {} - - uint32 lifeTimer; - bool spellHit; - - void Reset() - { - lifeTimer = 120000; - m_creature->SetStandState(UNIT_STAND_STATE_DEAD); - m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,7); // lay down - spellHit = false; - } - - void EnterCombat(Unit *who) - { - } - - void MoveInLineOfSight(Unit *who) - { - return; - } - - void UpdateAI(const uint32 diff) - { - if (m_creature->IsStandState()) - { - if (lifeTimer < diff) - m_creature->AI()->EnterEvadeMode(); - else - lifeTimer -= diff; - } - } - - void SpellHit(Unit *Hitter, const SpellEntry *Spellkind) - { - if ((Spellkind->Id == SPELL_SHIMMERING_VESSEL) && !spellHit && - (Hitter->GetTypeId() == TYPEID_PLAYER) && (CAST_PLR(Hitter)->IsActiveQuest(QUEST_REDEEMING_THE_DEAD))) - { - CAST_PLR(Hitter)->AreaExploredOrEventHappens(QUEST_REDEEMING_THE_DEAD); - DoCast(m_creature,SPELL_REVIVE_SELF); - m_creature->SetStandState(UNIT_STAND_STATE_STAND); - m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 0); - //m_creature->RemoveAllAuras(); - DoScriptText(SAY_HEAL, m_creature); - spellHit = true; - } - } -}; - -CreatureAI* GetAI_npc_blood_knight_stillblade(Creature* pCreature) -{ - return new npc_blood_knight_stillbladeAI (pCreature); -} - -void AddSC_silvermoon_city() -{ - Script *newscript; - newscript = new Script; - newscript->Name="npc_blood_knight_stillblade"; - newscript->GetAI = &GetAI_npc_blood_knight_stillblade; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/silverpine_forest/silverpine_forest.cpp b/src/bindings/scripts/scripts/zone/silverpine_forest/silverpine_forest.cpp deleted file mode 100644 index 7daf8a8a50e..00000000000 --- a/src/bindings/scripts/scripts/zone/silverpine_forest/silverpine_forest.cpp +++ /dev/null @@ -1,233 +0,0 @@ - /* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Silverpine_Forest -SD%Complete: 100 -SDComment: Quest support: 1886, 435 -SDCategory: Silverpine Forest -EndScriptData */ - -/* ContentData -npc_astor_hadren -npc_deathstalker_erland -EndContentData */ - -#include "precompiled.h" -#include "../../npc/npc_escortAI.h" - -/*###### -## npc_astor_hadren -######*/ - -#define GOSSIP_HAH "You're Astor Hadren, right?" -#define GOSSIP_SAH "You've got something I need, Astor. And I'll be taking it now." -struct TRINITY_DLL_DECL npc_astor_hadrenAI : public ScriptedAI -{ - npc_astor_hadrenAI(Creature *c) : ScriptedAI(c) {} - - void Reset() - { - m_creature->setFaction(68); - } - - void EnterCombat(Unit* who) - { - } - - void JustDied(Unit *who) - { - m_creature->setFaction(68); - } -}; - -CreatureAI* GetAI_npc_astor_hadren(Creature* pCreature) -{ - return new npc_astor_hadrenAI(pCreature); -} - -bool GossipHello_npc_astor_hadren(Player* pPlayer, Creature* pCreature) -{ - if (pPlayer->GetQuestStatus(1886) == QUEST_STATUS_INCOMPLETE) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HAH, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - - pPlayer->SEND_GOSSIP_MENU(623, pCreature->GetGUID()); - - return true; -} - -bool GossipSelect_npc_astor_hadren(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - switch (uiAction) - { - case GOSSIP_ACTION_INFO_DEF + 1: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SAH, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - pPlayer->SEND_GOSSIP_MENU(624, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF + 2: - pPlayer->CLOSE_GOSSIP_MENU(); - pCreature->setFaction(21); - if (pPlayer) - CAST_AI(npc_astor_hadrenAI, pCreature->AI())->AttackStart(pPlayer); - break; - } - return true; -} - -/*###### -## npc_deathstalker_erland -######*/ - -enum -{ - SAY_QUESTACCEPT = -1000335, - SAY_START = -1000336, - SAY_AGGRO_1 = -1000337, - SAY_AGGRO_2 = -1000338, - SAY_LAST = -1000339, - - SAY_THANKS = -1000340, - SAY_RANE = -1000341, - SAY_ANSWER = -1000342, - SAY_MOVE_QUINN = -1000343, - - SAY_GREETINGS = -1000344, - SAY_QUINN = -1000345, - SAY_ON_BYE = -1000346, - - QUEST_ESCORTING = 435, - NPC_RANE = 1950, - NPC_QUINN = 1951 -}; - -struct TRINITY_DLL_DECL npc_deathstalker_erlandAI : public npc_escortAI -{ - npc_deathstalker_erlandAI(Creature *c) : npc_escortAI(c) {} - - void WaypointReached(uint32 i) - { - Player* pPlayer = Unit::GetPlayer(PlayerGUID); - - if (!pPlayer) - return; - - switch(i) - { - case 1: DoScriptText(SAY_START, m_creature, pPlayer);break; - case 13: - DoScriptText(SAY_LAST, m_creature, pPlayer); - pPlayer->GroupEventHappens(QUEST_ESCORTING, m_creature);break; - case 14: DoScriptText(SAY_THANKS, m_creature, pPlayer);break; - case 15: { - Unit* Rane = me->FindNearestCreature(NPC_RANE, 20); - if (Rane) - DoScriptText(SAY_RANE, Rane); - break;} - case 16: DoScriptText(SAY_ANSWER, m_creature);break; - case 17: DoScriptText(SAY_MOVE_QUINN, m_creature); break; - case 24: DoScriptText(SAY_GREETINGS, m_creature);break; - case 25: { - Unit* Quinn = me->FindNearestCreature(NPC_QUINN, 20); - if (Quinn) - DoScriptText(SAY_QUINN, Quinn); - break;} - case 26: DoScriptText(SAY_ON_BYE, m_creature, NULL);break; - - } - } - - void Reset() {} - - void EnterCombat(Unit* who) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_AGGRO_1, m_creature, who);break; - case 1: DoScriptText(SAY_AGGRO_2, m_creature, who);break; - } - } -}; - -bool QuestAccept_npc_deathstalker_erland(Player* pPlayer, Creature* pCreature, Quest const* quest) -{ - if (quest->GetQuestId() == QUEST_ESCORTING) - { - DoScriptText(SAY_QUESTACCEPT, pCreature, pPlayer); - - if (npc_escortAI* pEscortAI = CAST_AI(npc_deathstalker_erlandAI, pCreature->AI())) - pEscortAI->Start(true, false, pPlayer->GetGUID()); - } - - return true; -} - -CreatureAI* GetAI_npc_deathstalker_erlandAI(Creature* pCreature) -{ - npc_deathstalker_erlandAI* deathstalker_erlandAI = new npc_deathstalker_erlandAI(pCreature); - - deathstalker_erlandAI->AddWaypoint(0, 1406.32, 1083.10, 52.55); - deathstalker_erlandAI->AddWaypoint(1, 1400.49, 1080.42, 52.50); //first say - deathstalker_erlandAI->AddWaypoint(2, 1388.48, 1083.10, 52.52); - deathstalker_erlandAI->AddWaypoint(3, 1370.16, 1084.02, 52.30); - deathstalker_erlandAI->AddWaypoint(4, 1359.02, 1080.85, 52.46); - deathstalker_erlandAI->AddWaypoint(5, 1341.43, 1087.39, 52.69); - deathstalker_erlandAI->AddWaypoint(6, 1321.93, 1090.51, 50.66); - deathstalker_erlandAI->AddWaypoint(7, 1312.98, 1095.91, 47.49); - deathstalker_erlandAI->AddWaypoint(8, 1301.09, 1102.94, 47.76); - deathstalker_erlandAI->AddWaypoint(9, 1297.73, 1106.35, 50.18); - deathstalker_erlandAI->AddWaypoint(10, 1295.49, 1124.32, 50.49); - deathstalker_erlandAI->AddWaypoint(11, 1294.84, 1137.25, 51.75); - deathstalker_erlandAI->AddWaypoint(12, 1292.89, 1158.99, 52.65); - deathstalker_erlandAI->AddWaypoint(13, 1290.75, 1168.67, 52.56, 1000); //complete quest and say last - deathstalker_erlandAI->AddWaypoint(14, 1287.12, 1203.49, 52.66, 5000); - deathstalker_erlandAI->AddWaypoint(15, 1287.12, 1203.49, 52.66, 4000); - deathstalker_erlandAI->AddWaypoint(16, 1287.12, 1203.49, 52.66, 5000); - deathstalker_erlandAI->AddWaypoint(17, 1287.12, 1203.49, 52.66, 4000); - deathstalker_erlandAI->AddWaypoint(18, 1290.72, 1207.44, 52.69); - deathstalker_erlandAI->AddWaypoint(19, 1297.50, 1207.18, 53.74); - deathstalker_erlandAI->AddWaypoint(20, 1301.32, 1220.90, 53.74); - deathstalker_erlandAI->AddWaypoint(21, 1298.55, 1220.43, 53.74); - deathstalker_erlandAI->AddWaypoint(22, 1297.59, 1211.23, 58.47); - deathstalker_erlandAI->AddWaypoint(23, 1305.01, 1206.10, 58.51); - deathstalker_erlandAI->AddWaypoint(24, 1310.51, 1207.36, 58.51, 5000); - deathstalker_erlandAI->AddWaypoint(25, 1310.51, 1207.36, 58.51, 5000); - deathstalker_erlandAI->AddWaypoint(26, 1310.51, 1207.36, 58.51, 2000); - - return deathstalker_erlandAI; -} - -/*###### -## AddSC -######*/ - -void AddSC_silverpine_forest() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="npc_astor_hadren"; - newscript->pGossipHello = &GossipHello_npc_astor_hadren; - newscript->pGossipSelect = &GossipSelect_npc_astor_hadren; - newscript->GetAI = &GetAI_npc_astor_hadren; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_deathstalker_erland"; - newscript->GetAI = &GetAI_npc_deathstalker_erlandAI; - newscript->pQuestAccept = &QuestAccept_npc_deathstalker_erland; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/stonetalon_mountains/stonetalon_mountains.cpp b/src/bindings/scripts/scripts/zone/stonetalon_mountains/stonetalon_mountains.cpp deleted file mode 100644 index 78181b0ae3d..00000000000 --- a/src/bindings/scripts/scripts/zone/stonetalon_mountains/stonetalon_mountains.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: Stonetalon_Mountains -SD%Complete: 95 -SDComment: Quest support: 6627, 6523 -SDCategory: Stonetalon Mountains -EndScriptData */ - -/* ContentData -npc_braug_dimspirit -npc_kaya_flathoof -EndContentData */ - -#include "precompiled.h" -#include "../../npc/npc_escortAI.h" - -/*###### -## npc_braug_dimspirit -######*/ - -#define GOSSIP_HBD1 "Ysera" -#define GOSSIP_HBD2 "Neltharion" -#define GOSSIP_HBD3 "Nozdormu" -#define GOSSIP_HBD4 "Alexstrasza" -#define GOSSIP_HBD5 "Malygos" - -bool GossipHello_npc_braug_dimspirit(Player* pPlayer, Creature* pCreature) -{ - if (pCreature->isQuestGiver()) - pPlayer->PrepareQuestMenu(pCreature->GetGUID()); - - if (pPlayer->GetQuestStatus(6627) == QUEST_STATUS_INCOMPLETE) - { - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HBD1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HBD2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HBD3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HBD4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HBD5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - - pPlayer->SEND_GOSSIP_MENU(5820, pCreature->GetGUID()); - } - else - pPlayer->SEND_GOSSIP_MENU(5819, pCreature->GetGUID()); - - return true; -} - -bool GossipSelect_npc_braug_dimspirit(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) - { - pPlayer->CLOSE_GOSSIP_MENU(); - pCreature->CastSpell(pPlayer,6766,false); - - } - if (uiAction == GOSSIP_ACTION_INFO_DEF+2) - { - pPlayer->CLOSE_GOSSIP_MENU(); - pPlayer->AreaExploredOrEventHappens(6627); - } - return true; -} - -/*###### -## npc_kaya_flathoof -######*/ - -enum -{ - FACTION_ESCORTEE_H = 775, - - NPC_GRIMTOTEM_RUFFIAN = 11910, - NPC_GRIMTOTEM_BRUTE = 11912, - NPC_GRIMTOTEM_SORCERER = 11913, - - SAY_START = -1000347, - SAY_AMBUSH = -1000348, - SAY_END = -1000349, - - QUEST_PROTECT_KAYA = 6523 -}; - -struct TRINITY_DLL_DECL npc_kaya_flathoofAI : public npc_escortAI -{ - npc_kaya_flathoofAI(Creature* c) : npc_escortAI(c) {} - - void WaypointReached(uint32 i) - { - Player* pPlayer = Unit::GetPlayer(PlayerGUID); - - if (!pPlayer) - return; - - switch(i) - { - case 16: - DoScriptText(SAY_AMBUSH, m_creature); - m_creature->SummonCreature(NPC_GRIMTOTEM_BRUTE, -48.53, -503.34, -46.31, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - m_creature->SummonCreature(NPC_GRIMTOTEM_RUFFIAN, -38.85, -503.77, -45.90, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - m_creature->SummonCreature(NPC_GRIMTOTEM_SORCERER, -36.37, -496.23, -45.71, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - break; - case 18: m_creature->SetInFront(pPlayer); - DoScriptText(SAY_END, m_creature, pPlayer); - if (pPlayer && pPlayer->GetTypeId() == TYPEID_PLAYER) - CAST_PLR(pPlayer)->GroupEventHappens(QUEST_PROTECT_KAYA, m_creature); - break; - } - } - - void JustSummoned(Creature* summoned) - { - summoned->AI()->AttackStart(m_creature); - } - - void Reset(){} -}; - -bool QuestAccept_npc_kaya_flathoof(Player* pPlayer, Creature* pCreature, Quest const* quest) -{ - if (quest->GetQuestId() == QUEST_PROTECT_KAYA) - { - if (npc_escortAI* pEscortAI = CAST_AI(npc_kaya_flathoofAI, pCreature->AI())) - pEscortAI->Start(true, false, pPlayer->GetGUID()); - - DoScriptText(SAY_START, pCreature); - pCreature->setFaction(113); - pCreature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); - } - return true; -} - -CreatureAI* GetAI_npc_kaya_flathoofAI(Creature* pCreature) -{ - npc_kaya_flathoofAI* kayaAI = new npc_kaya_flathoofAI(pCreature); - - kayaAI->FillPointMovementListForCreature(); - - return kayaAI; -} - -/*###### -## AddSC -######*/ - -void AddSC_stonetalon_mountains() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="npc_braug_dimspirit"; - newscript->pGossipHello = &GossipHello_npc_braug_dimspirit; - newscript->pGossipSelect = &GossipSelect_npc_braug_dimspirit; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_kaya_flathoof"; - newscript->GetAI = &GetAI_npc_kaya_flathoofAI; - newscript->pQuestAccept = &QuestAccept_npc_kaya_flathoof; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/stormwind/stormwind_city.cpp b/src/bindings/scripts/scripts/zone/stormwind/stormwind_city.cpp deleted file mode 100644 index d8cfaebc181..00000000000 --- a/src/bindings/scripts/scripts/zone/stormwind/stormwind_city.cpp +++ /dev/null @@ -1,267 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Stormwind_City -SD%Complete: 100 -SDComment: Quest support: 1640, 1447, 4185, 11223 -SDCategory: Stormwind City -EndScriptData */ - -/* ContentData -npc_archmage_malin -npc_bartleby -npc_dashel_stonefist -npc_lady_katrana_prestor -EndContentData */ - -#include "precompiled.h" - -/*###### -## npc_archmage_malin -######*/ - -#define GOSSIP_ITEM_MALIN "Can you send me to Theramore? I have an urgent message for Lady Jaina from Highlord Bolvar." - -bool GossipHello_npc_archmage_malin(Player* pPlayer, Creature* pCreature) -{ - if (pCreature->isQuestGiver()) - pPlayer->PrepareQuestMenu(pCreature->GetGUID()); - - if (pPlayer->GetQuestStatus(11223) == QUEST_STATUS_COMPLETE && !pPlayer->GetQuestRewardStatus(11223)) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_MALIN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - - pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); - - return true; -} - -bool GossipSelect_npc_archmage_malin(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - if (uiAction == GOSSIP_ACTION_INFO_DEF) - { - pPlayer->CLOSE_GOSSIP_MENU(); - pCreature->CastSpell(pPlayer, 42711, true); - } - - return true; -} - -/*###### -## npc_bartleby -######*/ - -enum -{ - FACTION_ENEMY = 168, - QUEST_BEAT = 1640 -}; - -struct TRINITY_DLL_DECL npc_bartlebyAI : public ScriptedAI -{ - npc_bartlebyAI(Creature *c) : ScriptedAI(c) - { - m_uiNormalFaction = c->getFaction(); - } - - uint32 m_uiNormalFaction; - - void Reset() - { - if (m_creature->getFaction() != m_uiNormalFaction) - m_creature->setFaction(m_uiNormalFaction); - } - - void AttackedBy(Unit* pAttacker) - { - if (m_creature->getVictim()) - return; - - if (m_creature->IsFriendlyTo(pAttacker)) - return; - - AttackStart(pAttacker); - } - - void DamageTaken(Unit* pDoneBy, uint32 &uiDamage) - { - if (uiDamage > m_creature->GetHealth() || ((m_creature->GetHealth() - uiDamage)*100 / m_creature->GetMaxHealth() < 15)) - { - //Take 0 damage - uiDamage = 0; - - if (pDoneBy->GetTypeId() == TYPEID_PLAYER) - CAST_PLR(pDoneBy)->AreaExploredOrEventHappens(QUEST_BEAT); - EnterEvadeMode(); - } - } -}; - -bool QuestAccept_npc_bartleby(Player* pPlayer, Creature* pCreature, Quest const* pQuest) -{ - if (pQuest->GetQuestId() == QUEST_BEAT) - { - pCreature->setFaction(FACTION_ENEMY); - pCreature->AI()->AttackStart(pPlayer); - } - return true; -} - -CreatureAI* GetAI_npc_bartleby(Creature* pCreature) -{ - return new npc_bartlebyAI(pCreature); -} - -/*###### -## npc_dashel_stonefist -######*/ - -enum -{ - QUEST_MISSING_DIPLO_PT8 = 1447, - FACTION_HOSTILE = 168 -}; - -struct TRINITY_DLL_DECL npc_dashel_stonefistAI : public ScriptedAI -{ - npc_dashel_stonefistAI(Creature *c) : ScriptedAI(c) - { - m_uiNormalFaction = c->getFaction(); - } - - uint32 m_uiNormalFaction; - - void Reset() - { - if (m_creature->getFaction() != m_uiNormalFaction) - m_creature->setFaction(m_uiNormalFaction); - } - - void AttackedBy(Unit* pAttacker) - { - if (m_creature->getVictim()) - return; - - if (m_creature->IsFriendlyTo(pAttacker)) - return; - - AttackStart(pAttacker); - } - - void DamageTaken(Unit* pDoneBy, uint32 &uiDamage) - { - if (uiDamage > m_creature->GetHealth() || ((m_creature->GetHealth() - uiDamage)*100 / m_creature->GetMaxHealth() < 15)) - { - uiDamage = 0; - - if (pDoneBy->GetTypeId() == TYPEID_PLAYER) - CAST_PLR(pDoneBy)->AreaExploredOrEventHappens(QUEST_MISSING_DIPLO_PT8); - - EnterEvadeMode(); - } - } -}; - -bool QuestAccept_npc_dashel_stonefist(Player* pPlayer, Creature* pCreature, Quest const* pQuest) -{ - if (pQuest->GetQuestId() == QUEST_MISSING_DIPLO_PT8) - { - pCreature->setFaction(FACTION_HOSTILE); - CAST_AI(npc_dashel_stonefistAI, pCreature->AI())->AttackStart(pPlayer); - } - return true; -} - -CreatureAI* GetAI_npc_dashel_stonefist(Creature* pCreature) -{ - return new npc_dashel_stonefistAI(pCreature); -} - -/*###### -## npc_lady_katrana_prestor -######*/ - -#define GOSSIP_ITEM_KAT_1 "Pardon the intrusion, Lady Prestor, but Highlord Bolvar suggested that I seek your advice." -#define GOSSIP_ITEM_KAT_2 "My apologies, Lady Prestor." -#define GOSSIP_ITEM_KAT_3 "Begging your pardon, Lady Prestor. That was not my intent." -#define GOSSIP_ITEM_KAT_4 "Thank you for your time, Lady Prestor." - -bool GossipHello_npc_lady_katrana_prestor(Player* pPlayer, Creature* pCreature) -{ - if (pCreature->isQuestGiver()) - pPlayer->PrepareQuestMenu(pCreature->GetGUID()); - - if (pPlayer->GetQuestStatus(4185) == QUEST_STATUS_INCOMPLETE) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KAT_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - - pPlayer->SEND_GOSSIP_MENU(2693, pCreature->GetGUID()); - - return true; -} - -bool GossipSelect_npc_lady_katrana_prestor(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - switch (uiAction) - { - case GOSSIP_ACTION_INFO_DEF: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KAT_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - pPlayer->SEND_GOSSIP_MENU(2694, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+1: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KAT_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - pPlayer->SEND_GOSSIP_MENU(2695, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+2: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KAT_4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); - pPlayer->SEND_GOSSIP_MENU(2696, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+3: - pPlayer->CLOSE_GOSSIP_MENU(); - pPlayer->AreaExploredOrEventHappens(4185); - break; - } - return true; -} - -void AddSC_stormwind_city() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="npc_archmage_malin"; - newscript->pGossipHello = &GossipHello_npc_archmage_malin; - newscript->pGossipSelect = &GossipSelect_npc_archmage_malin; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "npc_bartleby"; - newscript->GetAI = &GetAI_npc_bartleby; - newscript->pQuestAccept = &QuestAccept_npc_bartleby; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "npc_dashel_stonefist"; - newscript->GetAI = &GetAI_npc_dashel_stonefist; - newscript->pQuestAccept = &QuestAccept_npc_dashel_stonefist; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_lady_katrana_prestor"; - newscript->pGossipHello = &GossipHello_npc_lady_katrana_prestor; - newscript->pGossipSelect = &GossipSelect_npc_lady_katrana_prestor; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/stranglethorn_vale/stranglethorn_vale.cpp b/src/bindings/scripts/scripts/zone/stranglethorn_vale/stranglethorn_vale.cpp deleted file mode 100644 index 6f2c787f950..00000000000 --- a/src/bindings/scripts/scripts/zone/stranglethorn_vale/stranglethorn_vale.cpp +++ /dev/null @@ -1,123 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Stranglethorn_Vale -SD%Complete: 100 -SDComment: Quest support: 592 -SDCategory: Stranglethorn Vale -EndScriptData */ - -/* ContentData -mob_yenniku -EndContentData */ - -#include "precompiled.h" - -/*###### -## mob_yenniku -######*/ - -struct TRINITY_DLL_DECL mob_yennikuAI : public ScriptedAI -{ - mob_yennikuAI(Creature *c) : ScriptedAI(c) - { - bReset = false; - } - - uint32 Reset_Timer; - bool bReset; - - void Reset() - { - Reset_Timer = 0; - m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_NONE); - } - - void SpellHit(Unit *caster, const SpellEntry *spell) - { - if (caster->GetTypeId() == TYPEID_PLAYER) - { - //Yenniku's Release - if (!bReset && CAST_PLR(caster)->GetQuestStatus(592) == QUEST_STATUS_INCOMPLETE && spell->Id == 3607) - { - m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_STUN); - m_creature->CombatStop(); //stop combat - m_creature->DeleteThreatList(); //unsure of this - m_creature->setFaction(83); //horde generic - - bReset = true; - Reset_Timer = 60000; - } - } - return; - } - - void EnterCombat(Unit *who) {} - - void UpdateAI(const uint32 diff) - { - if (bReset) - { - if (Reset_Timer < diff) - { - EnterEvadeMode(); - bReset = false; - m_creature->setFaction(28); //troll, bloodscalp - return; - } - else Reset_Timer -= diff; - - if (m_creature->isInCombat() && m_creature->getVictim()) - { - if (m_creature->getVictim()->GetTypeId() == TYPEID_PLAYER) - { - Unit *victim = m_creature->getVictim(); - if (CAST_PLR(victim)->GetTeam() == HORDE) - { - m_creature->CombatStop(); - m_creature->DeleteThreatList(); - } - } - } - } - - //Return since we have no target - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_mob_yenniku(Creature* pCreature) -{ - return new mob_yennikuAI (pCreature); -} - -/*###### -## -######*/ - -void AddSC_stranglethorn_vale() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "mob_yenniku"; - newscript->GetAI = &GetAI_mob_yenniku; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/tanaris/tanaris.cpp b/src/bindings/scripts/scripts/zone/tanaris/tanaris.cpp deleted file mode 100644 index 08359819d5b..00000000000 --- a/src/bindings/scripts/scripts/zone/tanaris/tanaris.cpp +++ /dev/null @@ -1,815 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 .sourceforge.net/> - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Tanaris -SD%Complete: 80 -SDComment: Quest support: 648, 1560, 2954, 4005, 10277, 10279(Special flight path). Noggenfogger vendor -SDCategory: Tanaris -EndScriptData */ - -/* ContentData -mob_aquementas -npc_custodian_of_time -npc_marin_noggenfogger -npc_steward_of_time -npc_stone_watcher_of_norgannon -npc_OOX17 -npc_tooga -EndContentData */ - -#include "precompiled.h" -#include "../../npc/npc_escortAI.h" - -/*###### -## mob_aquementas -######*/ - -#define AGGRO_YELL_AQUE -1000350 - -#define SPELL_AQUA_JET 13586 -#define SPELL_FROST_SHOCK 15089 - -struct TRINITY_DLL_DECL mob_aquementasAI : public ScriptedAI -{ - mob_aquementasAI(Creature *c) : ScriptedAI(c) {} - - uint32 SendItem_Timer; - uint32 SwitchFaction_Timer; - bool isFriendly; - - uint32 FrostShock_Timer; - uint32 AquaJet_Timer; - - void Reset() - { - SendItem_Timer = 0; - SwitchFaction_Timer = 10000; - m_creature->setFaction(35); - isFriendly = true; - - AquaJet_Timer = 5000; - FrostShock_Timer = 1000; - } - - void SendItem(Unit* receiver) - { - if (CAST_PLR(receiver)->HasItemCount(11169,1,false) && - CAST_PLR(receiver)->HasItemCount(11172,11,false) && - CAST_PLR(receiver)->HasItemCount(11173,1,false) && - !CAST_PLR(receiver)->HasItemCount(11522,1,true)) - { - ItemPosCountVec dest; - uint8 msg = CAST_PLR(receiver)->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, 11522, 1, false); - if (msg == EQUIP_ERR_OK) - CAST_PLR(receiver)->StoreNewItem(dest, 11522, 1, true); - } - } - - void EnterCombat(Unit* who) - { - DoScriptText(AGGRO_YELL_AQUE, m_creature, who); - } - - void UpdateAI(const uint32 diff) - { - if (isFriendly) - { - if (SwitchFaction_Timer < diff) - { - m_creature->setFaction(91); - isFriendly = false; - }else SwitchFaction_Timer -= diff; - } - - if (!UpdateVictim()) - return; - - if (!isFriendly) - { - if (SendItem_Timer < diff) - { - if (m_creature->getVictim()->GetTypeId() == TYPEID_PLAYER) - SendItem(m_creature->getVictim()); - SendItem_Timer = 5000; - }else SendItem_Timer -= diff; - } - - if (FrostShock_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_FROST_SHOCK); - FrostShock_Timer = 15000; - }else FrostShock_Timer -= diff; - - if (AquaJet_Timer < diff) - { - DoCast(m_creature,SPELL_AQUA_JET); - AquaJet_Timer = 15000; - }else AquaJet_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_mob_aquementas(Creature* pCreature) -{ - return new mob_aquementasAI (pCreature); -} - -/*###### -## npc_custodian_of_time -######*/ - -#define WHISPER_CUSTODIAN_1 -1000150 -#define WHISPER_CUSTODIAN_2 -1000151 -#define WHISPER_CUSTODIAN_3 -1000152 -#define WHISPER_CUSTODIAN_4 -1000153 -#define WHISPER_CUSTODIAN_5 -1000154 -#define WHISPER_CUSTODIAN_6 -1000155 -#define WHISPER_CUSTODIAN_7 -1000156 -#define WHISPER_CUSTODIAN_8 -1000157 -#define WHISPER_CUSTODIAN_9 -1000158 -#define WHISPER_CUSTODIAN_10 -1000159 -#define WHISPER_CUSTODIAN_11 -1000160 -#define WHISPER_CUSTODIAN_12 -1000161 -#define WHISPER_CUSTODIAN_13 -1000162 -#define WHISPER_CUSTODIAN_14 -1000163 - -struct TRINITY_DLL_DECL npc_custodian_of_timeAI : public npc_escortAI -{ - npc_custodian_of_timeAI(Creature *c) : npc_escortAI(c) {} - - void WaypointReached(uint32 i) - { - Player *pPlayer = Unit::GetPlayer(PlayerGUID); - if (!pPlayer) - return; - - switch(i) - { - case 0: DoScriptText(WHISPER_CUSTODIAN_1, m_creature, pPlayer); break; - case 1: DoScriptText(WHISPER_CUSTODIAN_2, m_creature, pPlayer); break; - case 2: DoScriptText(WHISPER_CUSTODIAN_3, m_creature, pPlayer); break; - case 3: DoScriptText(WHISPER_CUSTODIAN_4, m_creature, pPlayer); break; - case 5: DoScriptText(WHISPER_CUSTODIAN_5, m_creature, pPlayer); break; - case 6: DoScriptText(WHISPER_CUSTODIAN_6, m_creature, pPlayer); break; - case 7: DoScriptText(WHISPER_CUSTODIAN_7, m_creature, pPlayer); break; - case 8: DoScriptText(WHISPER_CUSTODIAN_8, m_creature, pPlayer); break; - case 9: DoScriptText(WHISPER_CUSTODIAN_9, m_creature, pPlayer); break; - case 10: DoScriptText(WHISPER_CUSTODIAN_4, m_creature, pPlayer); break; - case 13: DoScriptText(WHISPER_CUSTODIAN_10, m_creature, pPlayer); break; - case 14: DoScriptText(WHISPER_CUSTODIAN_4, m_creature, pPlayer); break; - case 16: DoScriptText(WHISPER_CUSTODIAN_11, m_creature, pPlayer); break; - case 17: DoScriptText(WHISPER_CUSTODIAN_12, m_creature, pPlayer); break; - case 18: DoScriptText(WHISPER_CUSTODIAN_4, m_creature, pPlayer); break; - case 22: DoScriptText(WHISPER_CUSTODIAN_13, m_creature, pPlayer); break; - case 23: DoScriptText(WHISPER_CUSTODIAN_4, m_creature, pPlayer); break; - case 24: - DoScriptText(WHISPER_CUSTODIAN_14, m_creature, pPlayer); - DoCast(pPlayer, 34883); - // below here is temporary workaround, to be removed when spell works properly - pPlayer->AreaExploredOrEventHappens(10277); - break; - } - } - - void MoveInLineOfSight(Unit *who) - { - if (IsBeingEscorted) - return; - - if (who->GetTypeId() == TYPEID_PLAYER) - { - if (who->HasAura(34877) && CAST_PLR(who)->GetQuestStatus(10277) == QUEST_STATUS_INCOMPLETE) - { - float Radius = 10.0; - if (m_creature->IsWithinDistInMap(who, Radius)) - { - Start(false, false, who->GetGUID()); - } - } - } - } - - void EnterCombat(Unit* who) { } - void Reset() { } - - void UpdateAI(const uint32 diff) - { - npc_escortAI::UpdateAI(diff); - } -}; - -CreatureAI* GetAI_npc_custodian_of_time(Creature* pCreature) -{ - npc_custodian_of_timeAI* custodian_of_timeAI = new npc_custodian_of_timeAI(pCreature); - - custodian_of_timeAI->FillPointMovementListForCreature(); - - return custodian_of_timeAI; -} - -/*###### -## npc_marin_noggenfogger -######*/ - -bool GossipHello_npc_marin_noggenfogger(Player* pPlayer, Creature* pCreature) -{ - if (pCreature->isQuestGiver()) - pPlayer->PrepareQuestMenu(pCreature->GetGUID()); - - if (pCreature->isVendor() && pPlayer->GetQuestRewardStatus(2662)) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); - - pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); - - return true; -} - -bool GossipSelect_npc_marin_noggenfogger(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - if (uiAction == GOSSIP_ACTION_TRADE) - pPlayer->SEND_VENDORLIST(pCreature->GetGUID()); - - return true; -} - -/*###### -## npc_steward_of_time -######*/ - -#define GOSSIP_ITEM_FLIGHT "Please take me to the master's lair." - -bool GossipHello_npc_steward_of_time(Player* pPlayer, Creature* pCreature) -{ - if (pCreature->isQuestGiver()) - pPlayer->PrepareQuestMenu(pCreature->GetGUID()); - - if (pPlayer->GetQuestStatus(10279) == QUEST_STATUS_INCOMPLETE || pPlayer->GetQuestRewardStatus(10279)) - { - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_FLIGHT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - pPlayer->SEND_GOSSIP_MENU(9978, pCreature->GetGUID()); - } - else - pPlayer->SEND_GOSSIP_MENU(9977, pCreature->GetGUID()); - - return true; -} - -bool QuestAccept_npc_steward_of_time(Player* pPlayer, Creature* pCreature, Quest const *quest) -{ - if (quest->GetQuestId() == 10279) //Quest: To The Master's Lair - pPlayer->CastSpell(pPlayer,34891,true); //(Flight through Caverns) - - return false; -} - -bool GossipSelect_npc_steward_of_time(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) - pPlayer->CastSpell(pPlayer,34891,true); //(Flight through Caverns) - - return true; -} - -/*###### -## npc_stone_watcher_of_norgannon -######*/ - -#define GOSSIP_ITEM_NORGANNON_1 "What function do you serve?" -#define GOSSIP_ITEM_NORGANNON_2 "What are the Plates of Uldum?" -#define GOSSIP_ITEM_NORGANNON_3 "Where are the Plates of Uldum?" -#define GOSSIP_ITEM_NORGANNON_4 "Excuse me? We've been \"reschedueled for visitations\"? What does that mean?!" -#define GOSSIP_ITEM_NORGANNON_5 "So, what's inside Uldum?" -#define GOSSIP_ITEM_NORGANNON_6 "I will return when i have the Plates of Uldum." - -bool GossipHello_npc_stone_watcher_of_norgannon(Player* pPlayer, Creature* pCreature) -{ - if (pCreature->isQuestGiver()) - pPlayer->PrepareQuestMenu(pCreature->GetGUID()); - - if (pPlayer->GetQuestStatus(2954) == QUEST_STATUS_INCOMPLETE) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_NORGANNON_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - - pPlayer->SEND_GOSSIP_MENU(1674, pCreature->GetGUID()); - - return true; -} - -bool GossipSelect_npc_stone_watcher_of_norgannon(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - switch (uiAction) - { - case GOSSIP_ACTION_INFO_DEF: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_NORGANNON_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - pPlayer->SEND_GOSSIP_MENU(1675, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+1: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_NORGANNON_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); - pPlayer->SEND_GOSSIP_MENU(1676, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+2: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_NORGANNON_4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); - pPlayer->SEND_GOSSIP_MENU(1677, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+3: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_NORGANNON_5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4); - pPlayer->SEND_GOSSIP_MENU(1678, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+4: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_NORGANNON_6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5); - pPlayer->SEND_GOSSIP_MENU(1679, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+5: - pPlayer->CLOSE_GOSSIP_MENU(); - pPlayer->AreaExploredOrEventHappens(2954); - break; - } - return true; -} - -/*###### -## npc_OOX17 -######*/ - -#define Q_OOX17 648 -#define SPAWN_FIRST 7803 -#define SPAWN_SECOND_1 5617 -#define SPAWN_SECOND_2 7805 -#define SAY_SCOFF -1060004 -#define SAY_CHICKEN_ACC -1060000 -#define SAY_CHICKEN_AGGRO_1 -1060001 -#define SAY_CHICKEN_AGGRO_2 -1060002 -#define SAY_CHICKEN_AMB -1060003 -#define SAY_CHICKEN_COMP -1060005 - -struct TRINITY_DLL_DECL npc_OOX17AI : public npc_escortAI -{ - npc_OOX17AI(Creature *c) : npc_escortAI(c) {} - - void WaypointReached(uint32 i) - { - Player* pPlayer = Unit::GetPlayer(PlayerGUID); - - if (!pPlayer) - return; - - switch(i) { - case 23: - m_creature->SummonCreature(SPAWN_FIRST, -8350.96, -4445.79, 10.10, 6.20, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - m_creature->SummonCreature(SPAWN_FIRST, -8355.96, -4447.79, 10.10, 6.27, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - m_creature->SummonCreature(SPAWN_FIRST, -8353.96, -4442.79, 10.10, 6.08, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - DoScriptText(SAY_CHICKEN_AMB, m_creature); - break; - - case 56: - m_creature->SummonCreature(SPAWN_SECOND_1, -7510.07, -4795.50, 9.35, 6.06, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - m_creature->SummonCreature(SPAWN_SECOND_2, -7515.07, -4797.50, 9.35, 6.22, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - m_creature->SummonCreature(SPAWN_SECOND_2, -7518.07, -4792.50, 9.35, 6.22, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - DoScriptText(SAY_CHICKEN_AMB, m_creature); - if (Unit* scoff = me->FindNearestCreature(SPAWN_SECOND_2, 30)) - DoScriptText(SAY_SCOFF, scoff); - break; - - case 86: - if (pPlayer) - { - DoScriptText(SAY_CHICKEN_COMP, m_creature); - pPlayer->GroupEventHappens(Q_OOX17, m_creature); - } - break; - } - } - - void Reset(){} - - void EnterCombat(Unit* who) - { - switch (rand()%2) - { - case 0: DoScriptText(SAY_CHICKEN_AGGRO_1, m_creature); break; - case 1: DoScriptText(SAY_CHICKEN_AGGRO_2, m_creature); break; - } - } - - void JustSummoned(Creature* summoned) - { - summoned->AI()->AttackStart(m_creature); - } -}; - -bool QuestAccept_npc_OOX17(Player* pPlayer, Creature* pCreature, Quest const* quest) -{ - if (quest->GetQuestId() == Q_OOX17) - { - pCreature->setFaction(113); - pCreature->SetHealth(pCreature->GetMaxHealth()); - pCreature->SetUInt32Value(UNIT_FIELD_BYTES_1,0); - pCreature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); - DoScriptText(SAY_CHICKEN_ACC, pCreature); - - if (npc_escortAI* pEscortAI = CAST_AI(npc_OOX17AI, pCreature->AI())) - pEscortAI->Start(true, false, pPlayer->GetGUID()); - } - return true; -} - -CreatureAI* GetAI_npc_OOX17(Creature* pCreature) -{ - npc_OOX17AI* OOX17AI = new npc_OOX17AI(pCreature); - - OOX17AI->AddWaypoint(0, -8843.73, -4374.44, 43.71); - OOX17AI->AddWaypoint(1, -8834.68, -4373.88, 45.71); - OOX17AI->AddWaypoint(2, -8832.93, -4373.85, 45.67); - OOX17AI->AddWaypoint(3, -8829.21, -4373.72, 44.14); - OOX17AI->AddWaypoint(4, -8825.10, -4373.56, 41.44); - OOX17AI->AddWaypoint(5, -8818.88, -4372.75, 36.43); - OOX17AI->AddWaypoint(6, -8803.37, -4369.68, 30.06); - OOX17AI->AddWaypoint(7, -8786.68, -4366.18, 23.91); - OOX17AI->AddWaypoint(8, -8764.97, -4366.94, 25.23); - OOX17AI->AddWaypoint(9, -8745.49, -4363.16, 22.80); - OOX17AI->AddWaypoint(10, -8724.13, -4353.55, 20.72); - OOX17AI->AddWaypoint(11, -8706.77, -4346.14, 16.12); - OOX17AI->AddWaypoint(12, -8688.27, -4372.85, 13.64); - OOX17AI->AddWaypoint(13, -8668.76, -4380.38, 11.69); - OOX17AI->AddWaypoint(14, -8645.19, -4388.62, 12.56); - OOX17AI->AddWaypoint(15, -8614.73, -4398.60, 9.86); - OOX17AI->AddWaypoint(16, -8560.33, -4411.27, 13.17); - OOX17AI->AddWaypoint(17, -8536.45, -4416.49, 11.84); - OOX17AI->AddWaypoint(18, -8503.48, -4423.70, 13.59); - OOX17AI->AddWaypoint(19, -8471.91, -4430.60, 9.56); - OOX17AI->AddWaypoint(20, -8441.36, -4435.31, 9.40); - OOX17AI->AddWaypoint(21, -8403.41, -4441.16, 11.83); - OOX17AI->AddWaypoint(22, -8371.24, -4446.13, 9.47); - OOX17AI->AddWaypoint(23, -8353.96, -4448.79, 10.10); //Scorpid - OOX17AI->AddWaypoint(24, -8336.40, -4446.39, 8.98); - OOX17AI->AddWaypoint(25, -8303.78, -4441.96, 11.89); - OOX17AI->AddWaypoint(26, -8272.20, -4433.31, 9.60); - OOX17AI->AddWaypoint(27, -8224.76, -4419.39, 13.03); - OOX17AI->AddWaypoint(28, -8193.31, -4406.04, 10.17); - OOX17AI->AddWaypoint(29, -8155.65, -4397.74, 8.99); - OOX17AI->AddWaypoint(30, -8129.25, -4394.57, 10.92); - OOX17AI->AddWaypoint(31, -8104.86, -4399.03, 8.93); - OOX17AI->AddWaypoint(32, -8063.15, -4423.40, 10.07); - OOX17AI->AddWaypoint(33, -8032.15, -4443.47, 9.97); - OOX17AI->AddWaypoint(34, -8015.39, -4454.33, 9.39); - OOX17AI->AddWaypoint(35, -7981.64, -4482.44, 10.32); - OOX17AI->AddWaypoint(36, -7958.83, -4503.98, 9.69); - OOX17AI->AddWaypoint(37, -7932.45, -4528.91, 10.08); - OOX17AI->AddWaypoint(38, -7904.09, -4566.67, 12.59); - OOX17AI->AddWaypoint(39, -7883.33, -4593.91, 12.15); - OOX17AI->AddWaypoint(40, -7862.83, -4624.53, 10.21); - OOX17AI->AddWaypoint(41, -7840.79, -4654.26, 9.45); - OOX17AI->AddWaypoint(42, -7826.17, -4673.99, 10.61); - OOX17AI->AddWaypoint(43, -7807.86, -4698.69, 11.24); - OOX17AI->AddWaypoint(44, -7793.88, -4717.55, 10.48); - OOX17AI->AddWaypoint(45, -7778.68, -4738.05, 8.89); - OOX17AI->AddWaypoint(46, -7746.42, -4780.39, 9.84); - OOX17AI->AddWaypoint(47, -7724.11, -4772.75, 10.28); - OOX17AI->AddWaypoint(48, -7697.98, -4763.80, 9.52); - OOX17AI->AddWaypoint(49, -7665.33, -4752.62, 10.56); - OOX17AI->AddWaypoint(50, -7641.47, -4750.33, 8.94); - OOX17AI->AddWaypoint(51, -7620.08, -4753.96, 8.93); - OOX17AI->AddWaypoint(52, -7603.15, -4757.53, 9.06); - OOX17AI->AddWaypoint(53, -7579.43, -4767.07, 8.93); - OOX17AI->AddWaypoint(54, -7558.51, -4779.01, 9.64); - OOX17AI->AddWaypoint(55, -7536.40, -4789.32, 8.92); - OOX17AI->AddWaypoint(56, -7512.07, -4793.50, 9.35); //Wastewander - OOX17AI->AddWaypoint(57, -7490.79, -4788.80, 10.53); - OOX17AI->AddWaypoint(58, -7469.10, -4785.11, 10.42); - OOX17AI->AddWaypoint(59, -7453.18, -4782.41, 9.15); - OOX17AI->AddWaypoint(60, -7426.27, -4777.83, 9.54); - OOX17AI->AddWaypoint(61, -7393.84, -4770.19, 12.57); - OOX17AI->AddWaypoint(62, -7367.25, -4764.17, 11.92); - OOX17AI->AddWaypoint(63, -7341.00, -4752.11, 10.17); - OOX17AI->AddWaypoint(64, -7321.62, -4744.97, 11.58); - OOX17AI->AddWaypoint(65, -7302.35, -4744.35, 11.97); - OOX17AI->AddWaypoint(66, -7281.00, -4743.66, 11.21); - OOX17AI->AddWaypoint(67, -7258.33, -4742.93, 9.64); - OOX17AI->AddWaypoint(68, -7236.70, -4742.24, 10.16); - OOX17AI->AddWaypoint(69, -7217.52, -4743.87, 10.79); - OOX17AI->AddWaypoint(70, -7201.86, -4746.32, 9.58); - OOX17AI->AddWaypoint(71, -7182.01, -4749.41, 9.09); - OOX17AI->AddWaypoint(72, -7159.61, -4752.90, 9.52); - OOX17AI->AddWaypoint(73, -7139.58, -4756.02, 9.53); - OOX17AI->AddWaypoint(74, -7122.60, -4754.91, 9.66); - OOX17AI->AddWaypoint(75, -7101.06, -4753.87, 8.92); - OOX17AI->AddWaypoint(76, -7082.79, -4752.99, 9.97); - OOX17AI->AddWaypoint(77, -7061.81, -4751.98, 9.26); - OOX17AI->AddWaypoint(78, -7035.12, -4754.39, 9.19); - OOX17AI->AddWaypoint(79, -7013.90, -4758.64, 10.28); - OOX17AI->AddWaypoint(80, -7001.71, -4769.73, 10.59); - OOX17AI->AddWaypoint(81, -6984.95, -4788.61, 9.30); - OOX17AI->AddWaypoint(82, -6970.41, -4788.77, 9.42); - OOX17AI->AddWaypoint(83, -6957.16, -4788.92, 6.26); - OOX17AI->AddWaypoint(84, -6951.29, -4802.73, 4.45); - OOX17AI->AddWaypoint(85, -6944.81, -4816.58, 1.60); - OOX17AI->AddWaypoint(86, -6942.06, -4839.40, 0.66,5000); - - return OOX17AI; -} - -/*#### -# npc_tooga -####*/ - -enum -{ - SAY_TOOG_THIRST = -1000391, - SAY_TOOG_WORRIED = -1000392, - SAY_TOOG_POST_1 = -1000393, - SAY_TORT_POST_2 = -1000394, - SAY_TOOG_POST_3 = -1000395, - SAY_TORT_POST_4 = -1000396, - SAY_TOOG_POST_5 = -1000397, - SAY_TORT_POST_6 = -1000398, - - QUEST_TOOGA = 1560, - NPC_TORTA = 6015, - - POINT_ID_TO_WATER = 1, - FACTION_TOOG_ESCORTEE = 113 -}; - -const float m_afToWaterLoc[] = {-7032.664551, -4906.199219, -1.606446}; - -//Script not fully complete, need to change faction. -struct MANGOS_DLL_DECL npc_toogaAI : public ScriptedAI -{ - npc_toogaAI(Creature* pCreature) : ScriptedAI(pCreature) - { - m_uiNpcFlags = pCreature->GetUInt32Value(UNIT_NPC_FLAGS); - m_uiPlayerGUID = 0; - } - - uint64 m_uiPlayerGUID; - uint32 m_uiNpcFlags; - uint32 m_uiCheckPlayerTimer; - uint32 m_uiPostEventTimer; - uint32 m_uiPhasePostEvent; - - Unit* pTorta; - - void Reset() - { - m_uiCheckPlayerTimer = 2500; - m_uiPostEventTimer = 5000; - m_uiPhasePostEvent = 0; - - pTorta = NULL; - } - - void MoveInLineOfSight(Unit *pWho) - { - if (pWho->GetEntry() == NPC_TORTA) - { - if (m_creature->IsWithinDistInMap(pWho, INTERACTION_DISTANCE)) - { - if (!pTorta && CanDoComplete()) - { - pTorta = pWho; - m_uiPhasePostEvent = 1; - } - } - } - } - - void EnterEvadeMode() - { - m_creature->RemoveAllAuras(); - m_creature->DeleteThreatList(); - m_creature->CombatStop(true); - m_creature->LoadCreaturesAddon(); - - if (m_creature->isAlive()) - { - if (Unit* pUnit = Unit::GetUnit(*m_creature, m_uiPlayerGUID)) - { - //for later development, it appear this kind return to combatStart, then resume to MoveFollow - m_creature->GetMotionMaster()->MoveFollow(pUnit, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE); - } - else - { - m_creature->GetMotionMaster()->MoveTargetedHome(); - } - } - - m_creature->SetLootRecipient(NULL); - - Reset(); - } - - void JustRespawned() - { - if (m_creature->getFaction() != m_creature->GetCreatureInfo()->faction_A) - m_creature->setFaction(m_creature->GetCreatureInfo()->faction_A); - - m_creature->SetUInt32Value(UNIT_NPC_FLAGS, m_creature->GetCreatureInfo()->npcflag); - - Reset(); - } - - void DoStart(Player* pPlayer) - { - m_uiPlayerGUID = pPlayer->GetGUID(); - m_creature->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE); - - //m_creature->setFaction(FACTION_TOOG_ESCORTEE); - - m_creature->GetMotionMaster()->MoveFollow(pPlayer, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE); - } - - bool CanDoComplete() - { - if (Player* pPlayer = (Player*)Unit::GetUnit(*m_creature, m_uiPlayerGUID)) - { - if (pPlayer->GetQuestStatus(QUEST_TOOGA) == QUEST_STATUS_INCOMPLETE) - { - uint16 uiQuestLogSlot = pPlayer->FindQuestSlot(QUEST_TOOGA); - - if (uiQuestLogSlot < MAX_QUEST_LOG_SIZE) - { - if (pPlayer->GetQuestSlotState(uiQuestLogSlot) != QUEST_STATE_FAIL) - { - pPlayer->GroupEventHappens(QUEST_TOOGA, m_creature); - m_creature->GetMotionMaster()->MovementExpired(); - return true; - } - } - } - } - - return false; - } - - void MovementInform(uint32 uiMoveType, uint32 uiPointId) - { - if (uiMoveType != POINT_MOTION_TYPE || !m_uiPlayerGUID) - return; - - if (uiPointId == POINT_ID_TO_WATER) - m_creature->ForcedDespawn(); - } - - void JustDied(Unit* pKiller) - { - if (Player* pPlayer = Unit::GetPlayer(m_uiPlayerGUID)) - pPlayer->FailQuest(QUEST_TOOGA); - - m_uiPlayerGUID = 0; - m_creature->GetMotionMaster()->MovementExpired(); - } - - void UpdateAI(const uint32 uiDiff) - { - if (!UpdateVictim()) - { - //we are doing the post-event, or... - if (m_uiPhasePostEvent) - { - if (m_uiPostEventTimer < uiDiff) - { - m_uiPostEventTimer = 5000; - - if (!pTorta || !pTorta->isAlive()) - { - //something happened, so just despawn (what can go wrong?) - m_creature->ForcedDespawn(); - return; - } - - switch(m_uiPhasePostEvent) - { - case 1: - DoScriptText(SAY_TOOG_POST_1, m_creature); - break; - case 2: - DoScriptText(SAY_TORT_POST_2, pTorta); - break; - case 3: - DoScriptText(SAY_TOOG_POST_3, m_creature); - break; - case 4: - DoScriptText(SAY_TORT_POST_4, pTorta); - break; - case 5: - DoScriptText(SAY_TOOG_POST_5, m_creature); - break; - case 6: - DoScriptText(SAY_TORT_POST_6, pTorta); - m_creature->GetMotionMaster()->MovementExpired(); - m_creature->GetMotionMaster()->MovePoint(POINT_ID_TO_WATER, m_afToWaterLoc[0], m_afToWaterLoc[1], m_afToWaterLoc[2]); - break; - } - - ++m_uiPhasePostEvent; - } - else - m_uiPostEventTimer -= uiDiff; - } - //...we are doing regular player check - else if (m_uiPlayerGUID) - { - if (m_uiCheckPlayerTimer < uiDiff) - { - m_uiCheckPlayerTimer = 5000; - - switch(rand()%50) - { - case 10: DoScriptText(SAY_TOOG_THIRST, m_creature); break; - case 25: DoScriptText(SAY_TOOG_WORRIED, m_creature); break; - } - - Unit* pUnit = Unit::GetUnit(*m_creature, m_uiPlayerGUID); - - if (pUnit && !pUnit->isAlive()) - { - m_uiPlayerGUID = 0; - m_creature->ForcedDespawn(); - } - } - else - m_uiCheckPlayerTimer -= uiDiff; - } - - return; - } - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_npc_tooga(Creature* pCreature) -{ - return new npc_toogaAI(pCreature); -} - -bool QuestAccept_npc_tooga(Player* pPlayer, Creature* pCreature, const Quest* pQuest) -{ - if (pQuest->GetQuestId() == QUEST_TOOGA) - { - if (npc_toogaAI* pToogaAI = CAST_AI(npc_toogaAI, pCreature->AI())) - pToogaAI->DoStart(pPlayer); - } - - return true; -} - -void AddSC_tanaris() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="mob_aquementas"; - newscript->GetAI = &GetAI_mob_aquementas; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_custodian_of_time"; - newscript->GetAI = &GetAI_npc_custodian_of_time; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_marin_noggenfogger"; - newscript->pGossipHello = &GossipHello_npc_marin_noggenfogger; - newscript->pGossipSelect = &GossipSelect_npc_marin_noggenfogger; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_steward_of_time"; - newscript->pGossipHello = &GossipHello_npc_steward_of_time; - newscript->pGossipSelect = &GossipSelect_npc_steward_of_time; - newscript->pQuestAccept = &QuestAccept_npc_steward_of_time; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_stone_watcher_of_norgannon"; - newscript->pGossipHello = &GossipHello_npc_stone_watcher_of_norgannon; - newscript->pGossipSelect = &GossipSelect_npc_stone_watcher_of_norgannon; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "npc_OOX17"; - newscript->GetAI = &GetAI_npc_OOX17; - newscript->pQuestAccept = &QuestAccept_npc_OOX17; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "npc_tooga"; - newscript->GetAI = &GetAI_npc_tooga; - newscript->pQuestAccept = &QuestAccept_npc_tooga; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/teldrassil/teldrassil.cpp b/src/bindings/scripts/scripts/zone/teldrassil/teldrassil.cpp deleted file mode 100644 index 58cb2a55b2f..00000000000 --- a/src/bindings/scripts/scripts/zone/teldrassil/teldrassil.cpp +++ /dev/null @@ -1,192 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Teldrassil -SD%Complete: 100 -SDComment: Quest support: 938 -SDCategory: Teldrassil -EndScriptData */ - -/* ContentData -npc_mist -EndContentData */ - -#include "precompiled.h" - -/*#### -# npc_mist -####*/ - -enum -{ - SAY_AT_HOME = -1000411, - EMOTE_AT_HOME = -1000412, - QUEST_MIST = 938, - NPC_ARYNIA = 3519, -}; - -struct TRINITY_DLL_DECL npc_mistAI : public ScriptedAI -{ - npc_mistAI(Creature *c) : ScriptedAI(c) - { - uiNpcFlags = c->GetUInt32Value(UNIT_NPC_FLAGS); - uiPlayerGUID = 0; - } - - uint64 uiPlayerGUID; - uint32 uiNpcFlags; - uint32 uiCheckPlayerTimer; - - void Reset() - { - uiCheckPlayerTimer = 2500; - - if (!uiPlayerGUID) - m_creature->SetUInt32Value(UNIT_NPC_FLAGS, uiNpcFlags); - } - - void MoveInLineOfSight(Unit *pWho) - { - if (pWho->GetEntry() == NPC_ARYNIA) - { - if (m_creature->IsWithinDistInMap(pWho, 10.0f)) - { - DoScriptText(SAY_AT_HOME, pWho); - DoComplete(); - } - } - } - - 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 (pPlayer->GetQuestStatus(QUEST_MIST) == QUEST_STATUS_INCOMPLETE) - { - uint16 uiQuestLogSlot = pPlayer->FindQuestSlot(QUEST_MIST); - - if (uiQuestLogSlot < MAX_QUEST_LOG_SIZE) - { - 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(); - } - - void UpdateAI(const uint32 diff) - { - 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) -{ - return new npc_mistAI(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()); - - return true; -} - -void AddSC_teldrassil() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "npc_mist"; - newscript->GetAI = &GetAI_npc_mist; - newscript->pQuestAccept = &QuestAccept_npc_mist; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/terokkar_forest/terokkar_forest.cpp b/src/bindings/scripts/scripts/zone/terokkar_forest/terokkar_forest.cpp deleted file mode 100644 index 783c7c3e5cb..00000000000 --- a/src/bindings/scripts/scripts/zone/terokkar_forest/terokkar_forest.cpp +++ /dev/null @@ -1,745 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Terokkar_Forest -SD%Complete: 85 -SDComment: Quest support: 9889, 10009, 10873, 10896, 10898, 11096, 10052, 10051. Skettis->Ogri'la Flight -SDCategory: Terokkar Forest -EndScriptData */ - -/* ContentData -mob_unkor_the_ruthless -mob_infested_root_walker -mob_rotting_forest_rager -mob_netherweb_victim -npc_floon -npc_isla_starmane -npc_slim -EndContentData */ - -#include "precompiled.h" -#include "../../npc/npc_escortAI.h" - -/*###### -## mob_unkor_the_ruthless -######*/ - -#define SAY_SUBMIT -1000351 - -#define FACTION_HOSTILE 45 -#define FACTION_FRIENDLY 35 -#define QUEST_DONTKILLTHEFATONE 9889 - -#define SPELL_PULVERIZE 2676 -//#define SPELL_QUID9889 32174 - -struct TRINITY_DLL_DECL mob_unkor_the_ruthlessAI : public ScriptedAI -{ - mob_unkor_the_ruthlessAI(Creature* c) : ScriptedAI(c) {} - - bool CanDoQuest; - uint32 UnkorUnfriendly_Timer; - uint32 Pulverize_Timer; - - void Reset() - { - CanDoQuest = false; - UnkorUnfriendly_Timer = 0; - Pulverize_Timer = 3000; - m_creature->SetStandState(UNIT_STAND_STATE_STAND); - m_creature->setFaction(FACTION_HOSTILE); - } - - void EnterCombat(Unit *who) {} - - void DoNice() - { - DoScriptText(SAY_SUBMIT, m_creature); - m_creature->setFaction(FACTION_FRIENDLY); - m_creature->SetStandState(UNIT_STAND_STATE_SIT); - m_creature->RemoveAllAuras(); - m_creature->DeleteThreatList(); - m_creature->CombatStop(true); - UnkorUnfriendly_Timer = 60000; - } - - void DamageTaken(Unit *done_by, uint32 &damage) - { - if (done_by->GetTypeId() == TYPEID_PLAYER) - if ((m_creature->GetHealth()-damage)*100 / m_creature->GetMaxHealth() < 30) - { - if (Group* pGroup = CAST_PLR(done_by)->GetGroup()) - { - for(GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next()) - { - Player *pGroupie = itr->getSource(); - if (pGroupie && - pGroupie->GetQuestStatus(QUEST_DONTKILLTHEFATONE) == QUEST_STATUS_INCOMPLETE && - pGroupie->GetReqKillOrCastCurrentCount(QUEST_DONTKILLTHEFATONE, 18260) == 10) - { - pGroupie->AreaExploredOrEventHappens(QUEST_DONTKILLTHEFATONE); - if (!CanDoQuest) - CanDoQuest = true; - } - } - } else - if (CAST_PLR(done_by)->GetQuestStatus(QUEST_DONTKILLTHEFATONE) == QUEST_STATUS_INCOMPLETE && - CAST_PLR(done_by)->GetReqKillOrCastCurrentCount(QUEST_DONTKILLTHEFATONE, 18260) == 10) - { - CAST_PLR(done_by)->AreaExploredOrEventHappens(QUEST_DONTKILLTHEFATONE); - CanDoQuest = true; - } - } - } - - void UpdateAI(const uint32 diff) - { - if (CanDoQuest) - { - if (!UnkorUnfriendly_Timer) - { - //DoCast(m_creature,SPELL_QUID9889); //not using spell for now - DoNice(); - } - else - { - if (UnkorUnfriendly_Timer < diff) - { - EnterEvadeMode(); - return; - }else UnkorUnfriendly_Timer -= diff; - } - } - - if (!UpdateVictim()) - return; - - if (Pulverize_Timer < diff) - { - DoCast(m_creature,SPELL_PULVERIZE); - Pulverize_Timer = 9000; - }else Pulverize_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_unkor_the_ruthless(Creature* pCreature) -{ - return new mob_unkor_the_ruthlessAI (pCreature); -} - -/*###### -## mob_infested_root_walker -######*/ - -struct TRINITY_DLL_DECL mob_infested_root_walkerAI : public ScriptedAI -{ - mob_infested_root_walkerAI(Creature *c) : ScriptedAI(c) {} - - void Reset() { } - void EnterCombat(Unit *who) { } - - void DamageTaken(Unit *done_by, uint32 &damage) - { - if (done_by && done_by->GetTypeId() == TYPEID_PLAYER) - if (m_creature->GetHealth() <= damage) - if (rand()%100 < 75) - //Summon Wood Mites - m_creature->CastSpell(m_creature,39130,true); - } -}; -CreatureAI* GetAI_mob_infested_root_walker(Creature* pCreature) -{ - return new mob_infested_root_walkerAI (pCreature); -} - - -/*###### -## mob_skywing -######*/ -struct TRINITY_DLL_DECL npc_skywingAI : public npc_escortAI -{ -public: - npc_skywingAI(Creature *c) : npc_escortAI(c) {} - - void WaypointReached(uint32 i) - { - Player *pPlayer = Unit::GetPlayer(PlayerGUID); - if (!pPlayer) - return; - - switch(i) - { - case 8: - pPlayer->AreaExploredOrEventHappens(10898); - break; - } - } - - void EnterCombat(Unit* who) {} - - void MoveInLineOfSight(Unit *who) - { - if (IsBeingEscorted) - return; - - if (who->GetTypeId() == TYPEID_PLAYER) - { - if (CAST_PLR(who)->GetQuestStatus(10898) == QUEST_STATUS_INCOMPLETE) - { - float Radius = 10.0; - if (m_creature->IsWithinDistInMap(who, Radius)) - { - Start(false, false, who->GetGUID()); - } - } - } - } - - void Reset() {} - - void UpdateAI(const uint32 diff) - { - npc_escortAI::UpdateAI(diff); - } -}; - -CreatureAI* GetAI_npc_skywingAI(Creature* pCreature) -{ - npc_skywingAI* skywingAI = new npc_skywingAI(pCreature); - - skywingAI->FillPointMovementListForCreature(); - - return skywingAI; -} - -/*###### -## mob_rotting_forest_rager -######*/ - -struct TRINITY_DLL_DECL mob_rotting_forest_ragerAI : public ScriptedAI -{ - mob_rotting_forest_ragerAI(Creature *c) : ScriptedAI(c) {} - - void Reset() { } - void EnterCombat(Unit *who) { } - - void DamageTaken(Unit *done_by, uint32 &damage) - { - if (done_by->GetTypeId() == TYPEID_PLAYER) - if (m_creature->GetHealth() <= damage) - if (rand()%100 < 75) - //Summon Lots of Wood Mights - m_creature->CastSpell(m_creature,39134,true); - } -}; -CreatureAI* GetAI_mob_rotting_forest_rager(Creature* pCreature) -{ - return new mob_rotting_forest_ragerAI (pCreature); -} - -/*###### -## mob_netherweb_victim -######*/ - -#define QUEST_TARGET 22459 -//#define SPELL_FREE_WEBBED 38950 - -const uint32 netherwebVictims[6] = -{ - 18470, 16805, 21242, 18452, 22482, 21285 -}; -struct TRINITY_DLL_DECL mob_netherweb_victimAI : public ScriptedAI -{ - mob_netherweb_victimAI(Creature *c) : ScriptedAI(c) {} - - void Reset() { } - void EnterCombat(Unit *who) { } - void MoveInLineOfSight(Unit *who) { } - - void JustDied(Unit* Killer) - { - if (Killer->GetTypeId() == TYPEID_PLAYER) - { - if (CAST_PLR(Killer)->GetQuestStatus(10873) == QUEST_STATUS_INCOMPLETE) - { - if (rand()%100 < 25) - { - m_creature->SummonCreature(QUEST_TARGET, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); - CAST_PLR(Killer)->KilledMonsterCredit(QUEST_TARGET, m_creature->GetGUID()); - } - else - m_creature->SummonCreature(netherwebVictims[rand()%6], 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); - - if (rand()%100 < 75) - m_creature->SummonCreature(netherwebVictims[rand()%6], 0.0f, 0.0f, 0.0f,0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); - m_creature->SummonCreature(netherwebVictims[rand()%6], 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); - } - } - } -}; -CreatureAI* GetAI_mob_netherweb_victim(Creature* pCreature) -{ - return new mob_netherweb_victimAI (pCreature); -} - -/*###### -## npc_floon -######*/ - -#define GOSSIP_FLOON1 "You owe Sim'salabim money. Hand them over or die!" -#define GOSSIP_FLOON2 "Hand over the money or die...again!" - -enum -{ - SAY_FLOON_ATTACK = -1000352, - - SPELL_SILENCE = 6726, - SPELL_FROSTBOLT = 9672, - SPELL_FROST_NOVA = 11831, - - FACTION_HOSTILE_FL = 1738, - QUEST_CRACK_SKULLS = 10009 -}; - -struct TRINITY_DLL_DECL npc_floonAI : public ScriptedAI -{ - npc_floonAI(Creature* c) : ScriptedAI(c) - { - m_uiNormFaction = c->getFaction(); - } - - uint32 m_uiNormFaction; - uint32 Silence_Timer; - uint32 Frostbolt_Timer; - uint32 FrostNova_Timer; - - void Reset() - { - Silence_Timer = 2000; - Frostbolt_Timer = 4000; - FrostNova_Timer = 9000; - if (m_creature->getFaction() != m_uiNormFaction) - m_creature->setFaction(m_uiNormFaction); - } - - void EnterCombat(Unit *who) {} - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (Silence_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_SILENCE); - Silence_Timer = 30000; - }else Silence_Timer -= diff; - - if (FrostNova_Timer < diff) - { - DoCast(m_creature,SPELL_FROST_NOVA); - FrostNova_Timer = 20000; - }else FrostNova_Timer -= diff; - - if (Frostbolt_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_FROSTBOLT); - Frostbolt_Timer = 5000; - }else Frostbolt_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_npc_floon(Creature* pCreature) -{ - return new npc_floonAI (pCreature); -} - -bool GossipHello_npc_floon(Player* pPlayer, Creature* pCreature) -{ - if (pPlayer->GetQuestStatus(QUEST_CRACK_SKULLS) == QUEST_STATUS_INCOMPLETE) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_FLOON1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - - pPlayer->SEND_GOSSIP_MENU(9442, pCreature->GetGUID()); - return true; -} - -bool GossipSelect_npc_floon(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - if (uiAction == GOSSIP_ACTION_INFO_DEF) - { - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_FLOON2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - pPlayer->SEND_GOSSIP_MENU(9443, pCreature->GetGUID()); - } - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) - { - pPlayer->CLOSE_GOSSIP_MENU(); - pCreature->setFaction(FACTION_HOSTILE_FL); - DoScriptText(SAY_FLOON_ATTACK, pCreature, pPlayer); - pCreature->AI()->AttackStart(pPlayer); - } - return true; -} - -/*###### -## npc_isla_starmane -######*/ - -#define SAY_PROGRESS_1 -1000353 -#define SAY_PROGRESS_2 -1000354 -#define SAY_PROGRESS_3 -1000355 -#define SAY_PROGRESS_4 -1000356 - -#define QUEST_EFTW_H 10052 -#define QUEST_EFTW_A 10051 -#define GO_CAGE 182794 -#define SPELL_CAT 32447 - -struct TRINITY_DLL_DECL npc_isla_starmaneAI : public npc_escortAI -{ - npc_isla_starmaneAI(Creature* c) : npc_escortAI(c) {} - - bool Completed; - - void WaypointReached(uint32 i) - { - Player* pPlayer = Unit::GetPlayer(PlayerGUID); - - if (!pPlayer) - return; - - switch(i) - { - case 0: - { - GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 10); - if (Cage) - Cage->SetGoState(GO_STATE_ACTIVE); - }break; - case 2: DoScriptText(SAY_PROGRESS_1, m_creature, pPlayer); break; - case 5: DoScriptText(SAY_PROGRESS_2, m_creature, pPlayer); break; - case 6: DoScriptText(SAY_PROGRESS_3, m_creature, pPlayer); break; - case 29:DoScriptText(SAY_PROGRESS_4, m_creature, pPlayer); - if (pPlayer) - { - if (CAST_PLR(pPlayer)->GetTeam() == ALLIANCE) - CAST_PLR(pPlayer)->GroupEventHappens(QUEST_EFTW_A, m_creature); - else if (CAST_PLR(pPlayer)->GetTeam() == HORDE) - CAST_PLR(pPlayer)->GroupEventHappens(QUEST_EFTW_H, m_creature); - } Completed = true; - m_creature->SetInFront(pPlayer); break; - case 30: m_creature->HandleEmoteCommand(EMOTE_ONESHOT_WAVE); break; - case 31: DoCast(m_creature, SPELL_CAT); - m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); break; - } - } - - void Reset() - { - Completed = false; - m_creature->setFaction(1660); - } - - void EnterCombat(Unit* who){} - - void JustDied(Unit* killer) - { - if (PlayerGUID) - { - Player* pPlayer = Unit::GetPlayer(PlayerGUID); - if (pPlayer && !Completed) - { - if (CAST_PLR(pPlayer)->GetTeam() == ALLIANCE) - CAST_PLR(pPlayer)->FailQuest(QUEST_EFTW_A); - else if (CAST_PLR(pPlayer)->GetTeam() == HORDE) - CAST_PLR(pPlayer)->FailQuest(QUEST_EFTW_H); - } - } - } - - void UpdateAI(const uint32 diff) - { - npc_escortAI::UpdateAI(diff); - } -}; - -bool QuestAccept_npc_isla_starmane(Player* pPlayer, Creature* pCreature, Quest const* quest) -{ - if (quest->GetQuestId() == QUEST_EFTW_H || quest->GetQuestId() == QUEST_EFTW_A) - { - CAST_AI(npc_escortAI, (pCreature->AI()))->Start(true, false, pPlayer->GetGUID()); - pCreature->setFaction(113); - } - return true; -} - -CreatureAI* GetAI_npc_isla_starmaneAI(Creature* pCreature) -{ - npc_isla_starmaneAI* thisAI = new npc_isla_starmaneAI(pCreature); - - thisAI->AddWaypoint(0, -2265.21, 3091.14, 13.91); - thisAI->AddWaypoint(1, -2266.80, 3091.33, 13.82, 1000); - thisAI->AddWaypoint(2, -2268.20, 3091.14, 13.82, 7000);//progress1 - thisAI->AddWaypoint(3, -2278.32, 3098.98, 13.82); - thisAI->AddWaypoint(4, -2294.82, 3110.59, 13.82); - thisAI->AddWaypoint(5, -2300.71, 3114.60, 13.82, 20000);//progress2 - thisAI->AddWaypoint(6, -2300.71, 3114.60, 13.82, 3000);//progress3 - thisAI->AddWaypoint(7, -2307.36, 3122.76, 13.79); - thisAI->AddWaypoint(8, -2312.83, 3130.55, 12.04); - thisAI->AddWaypoint(9, -2345.02, 3151.00, 8.38); - thisAI->AddWaypoint(10, -2351.97, 3157.61, 6.27); - thisAI->AddWaypoint(11, -2360.35, 3171.48, 3.31); - thisAI->AddWaypoint(12, -2371.44, 3185.41, 0.89); - thisAI->AddWaypoint(13, -2371.21, 3197.92, -0.96); - thisAI->AddWaypoint(14, -2380.35, 3210.45, -1.08); - thisAI->AddWaypoint(15, -2384.74, 3221.25, -1.17); - thisAI->AddWaypoint(16, -2386.15, 3233.39, -1.29); - thisAI->AddWaypoint(17, -2383.45, 3247.79, -1.32); - thisAI->AddWaypoint(18, -2367.50, 3265.64, -1.33); - thisAI->AddWaypoint(19, -2354.90, 3273.30, -1.50); - thisAI->AddWaypoint(20, -2348.88, 3280.58, -0.09); - thisAI->AddWaypoint(21, -2349.06, 3295.86, -0.95); - thisAI->AddWaypoint(22, -2350.43, 3328.27, -2.10); - thisAI->AddWaypoint(23, -2346.76, 3356.27, -2.82); - thisAI->AddWaypoint(24, -2340.56, 3370.68, -4.02); - thisAI->AddWaypoint(25, -2318.84, 3384.60, -7.61); - thisAI->AddWaypoint(26, -2313.99, 3398.61, -10.40); - thisAI->AddWaypoint(27, -2320.85, 3414.49, -11.49); - thisAI->AddWaypoint(28, -2338.26, 3426.06, -11.46); - thisAI->AddWaypoint(29, -2342.67, 3439.44, -11.32, 12000);//progress4 - thisAI->AddWaypoint(30, -2342.67, 3439.44, -11.32, 7000);//emote bye - thisAI->AddWaypoint(31, -2342.67, 3439.44, -11.32, 5000);//cat form - thisAI->AddWaypoint(32, -2344.60, 3461.27, -10.44); - thisAI->AddWaypoint(33, -2396.81, 3517.17, -3.55); - thisAI->AddWaypoint(34, -2439.23, 3523.00, -1.05); - - return thisAI; -} - -/*###### -## go_skull_pile -######*/ -#define GOSSIP_S_DARKSCREECHER_AKKARAI "Summon Darkscreecher Akkarai" -#define GOSSIP_S_KARROG "Summon Karrog" -#define GOSSIP_S_GEZZARAK_THE_HUNTRESS "Summon Gezzarak the Huntress" -#define GOSSIP_S_VAKKIZ_THE_WINDRAGER "Summon Vakkiz the Windrager" - -bool GossipHello_go_skull_pile(Player* pPlayer, GameObject* pGo) -{ - if ((pPlayer->GetQuestStatus(11885) == QUEST_STATUS_INCOMPLETE) || pPlayer->GetQuestRewardStatus(11885)) - { - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_S_DARKSCREECHER_AKKARAI, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_S_KARROG, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_S_GEZZARAK_THE_HUNTRESS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_S_VAKKIZ_THE_WINDRAGER, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4); - } - - pPlayer->SEND_GOSSIP_MENU(pGo->GetGOInfo()->questgiver.gossipID, pGo->GetGUID()); - return true; -} - -void SendActionMenu_go_skull_pile(Player* pPlayer, GameObject* pGo, uint32 uiAction) -{ - switch(uiAction) - { - case GOSSIP_ACTION_INFO_DEF + 1: - pPlayer->CastSpell(pPlayer,40642,false); - break; - case GOSSIP_ACTION_INFO_DEF + 2: - pPlayer->CastSpell(pPlayer,40640,false); - break; - case GOSSIP_ACTION_INFO_DEF + 3: - pPlayer->CastSpell(pPlayer,40632,false); - break; - case GOSSIP_ACTION_INFO_DEF + 4: - pPlayer->CastSpell(pPlayer,40644,false); - break; - } -} - -bool GossipSelect_go_skull_pile(Player* pPlayer, GameObject* pGo, uint32 uiSender, uint32 uiAction) -{ - switch(uiSender) - { - case GOSSIP_SENDER_MAIN: SendActionMenu_go_skull_pile(pPlayer, pGo, uiAction); break; - } - return true; -} - -/*###### -## npc_slim -######*/ - -enum -{ - FACTION_CONSORTIUM = 933 -}; - -bool GossipHello_npc_slim(Player* pPlayer, Creature* pCreature) -{ - if (pCreature->isVendor() && pPlayer->GetReputationRank(FACTION_CONSORTIUM) >= REP_FRIENDLY) - { - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); - pPlayer->SEND_GOSSIP_MENU(9896, pCreature->GetGUID()); - } - else - pPlayer->SEND_GOSSIP_MENU(9895, pCreature->GetGUID()); - - return true; -} - -bool GossipSelect_npc_slim(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - if (uiAction == GOSSIP_ACTION_TRADE) - pPlayer->SEND_VENDORLIST(pCreature->GetGUID()); - - return true; -} - -/*######## -####npc_Akuno -#####*/ - -#define QUEST_NPC_AKUNO 10887 -#define Summon 21661 - -struct TRINITY_DLL_DECL npc_akunoAI : public npc_escortAI -{ - npc_akunoAI(Creature *c) : npc_escortAI(c) {} - - bool IsWalking; - - void WaypointReached(uint32 i) - { - Player* pPlayer = Unit::GetPlayer(PlayerGUID); - - if(!pPlayer) - return; - - if(IsWalking && !m_creature->HasUnitMovementFlag(MOVEMENTFLAG_WALK_MODE)) - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - - - switch(i) - { - case 0: m_creature->setFaction(5); break; - case 3: - m_creature->SummonCreature(Summon,-2795.99,5420.33,-34.53,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - m_creature->SummonCreature(Summon,-2793.55,5412.79,-34.53,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - break; - case 11: - if(pPlayer && pPlayer->GetTypeId() == TYPEID_PLAYER) - pPlayer->GroupEventHappens(QUEST_NPC_AKUNO,m_creature); - m_creature->setFaction(18); - break; - } - } - - void Reset() - { - if (IsWalking && !m_creature->HasUnitMovementFlag(MOVEMENTFLAG_WALK_MODE)) - { - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - return; - } - IsWalking=false; - } -}; - -bool QuestAccept_npc_akuno(Player* pPlayer, Creature* pCreature, Quest const* pQuest) -{ - if(pQuest->GetQuestId() == QUEST_NPC_AKUNO) - { - if (npc_akunoAI* pEscortAI = CAST_AI(npc_akunoAI, pCreature->AI())) - pEscortAI->Start(false, true, pPlayer->GetGUID()); - } - return true; -} - -CreatureAI* GetAI_npc_akuno(Creature* pCreature) -{ - npc_akunoAI* thisAI = new npc_akunoAI(pCreature); - - thisAI->FillPointMovementListForCreature(); - - return(CreatureAI*)thisAI; -} - -void AddSC_terokkar_forest() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="mob_unkor_the_ruthless"; - newscript->GetAI = &GetAI_mob_unkor_the_ruthless; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_infested_root_walker"; - newscript->GetAI = &GetAI_mob_infested_root_walker; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_rotting_forest_rager"; - newscript->GetAI = &GetAI_mob_rotting_forest_rager; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_netherweb_victim"; - newscript->GetAI = &GetAI_mob_netherweb_victim; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_floon"; - newscript->GetAI = &GetAI_npc_floon; - newscript->pGossipHello = &GossipHello_npc_floon; - newscript->pGossipSelect = &GossipSelect_npc_floon; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name= "npc_isla_starmane"; - newscript->GetAI = &GetAI_npc_isla_starmaneAI; - newscript->pQuestAccept = &QuestAccept_npc_isla_starmane; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="go_skull_pile"; - newscript->pGOHello = &GossipHello_go_skull_pile; - newscript->pGOSelect = &GossipSelect_go_skull_pile; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_skywing"; - newscript->GetAI = &GetAI_npc_skywingAI; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "npc_slim"; - newscript->pGossipHello = &GossipHello_npc_slim; - newscript->pGossipSelect = &GossipSelect_npc_slim; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_akuno"; - newscript->GetAI = &GetAI_npc_akuno; - newscript->pQuestAccept = &QuestAccept_npc_akuno; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/thousand_needles/thousand_needles.cpp b/src/bindings/scripts/scripts/zone/thousand_needles/thousand_needles.cpp deleted file mode 100644 index bb3bcc8ba5b..00000000000 --- a/src/bindings/scripts/scripts/zone/thousand_needles/thousand_needles.cpp +++ /dev/null @@ -1,413 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Thousand Needles -SD%Complete: 100 -SDComment: Support for Quest: 1950, 4770, 4904, 4966 -SDCategory: Thousand Needles -EndScriptData */ - -/* ContentData -npc_kanati -npc_lakota_windsong -npc_swiftmountain -npc_plucky -EndContentData */ - -#include "precompiled.h" -#include "../../npc/npc_escortAI.h" - -/*##### -# npc_kanati -######*/ - -enum -{ - SAY_KAN_START = -1000410, - - QUEST_PROTECT_KANATI = 4966, - NPC_GALAK_ASS = 10720 -}; - -const float m_afGalakLoc[]= {-4867.387695, -1357.353760, -48.226 }; - -struct TRINITY_DLL_DECL npc_kanatiAI : public npc_escortAI -{ - npc_kanatiAI(Creature* pCreature) : npc_escortAI(pCreature) { } - - void Reset() { } - - void WaypointReached(uint32 uiPointId) - { - switch(uiPointId) - { - case 0: - DoScriptText(SAY_KAN_START, m_creature); - DoSpawnGalak(); - break; - case 1: - if (Player* pPlayer = Unit::GetPlayer(PlayerGUID)) - pPlayer->GroupEventHappens(QUEST_PROTECT_KANATI, m_creature); - break; - } - } - - void DoSpawnGalak() - { - for(int i = 0; i < 3; ++i) - m_creature->SummonCreature(NPC_GALAK_ASS, - m_afGalakLoc[0], m_afGalakLoc[1], m_afGalakLoc[2], 0.0f, - TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - } - - void JustSummoned(Creature* pSummoned) - { - pSummoned->AI()->AttackStart(m_creature); - } -}; - -CreatureAI* GetAI_npc_kanati(Creature* pCreature) -{ - npc_kanatiAI* pTempAI = new npc_kanatiAI(pCreature); - - pTempAI->FillPointMovementListForCreature(); - - return (CreatureAI*)pTempAI; -} - -bool QuestAccept_npc_kanati(Player* pPlayer, Creature* pCreature, const Quest* pQuest) -{ - if (pQuest->GetQuestId() == QUEST_PROTECT_KANATI) - { - if (npc_kanatiAI* pEscortAI = CAST_AI(npc_kanatiAI, pCreature->AI())) - pEscortAI->Start(false, false, pPlayer->GetGUID(), pQuest, true); - } - return true; -} - -/*###### -# npc_lakota_windsong -######*/ - -enum -{ - SAY_LAKO_START = -1000365, - SAY_LAKO_LOOK_OUT = -1000366, - SAY_LAKO_HERE_COME = -1000367, - SAY_LAKO_MORE = -1000368, - SAY_LAKO_END = -1000369, - - QUEST_FREE_AT_LAST = 4904, - NPC_GRIM_BANDIT = 10758, - FACTION_ESCORTEE_LAKO = 232, //guessed - - ID_AMBUSH_1 = 0, - ID_AMBUSH_2 = 2, - ID_AMBUSH_3 = 4 -}; - -float m_afBanditLoc[6][6]= -{ - {-4905.479492, -2062.732666, 84.352}, - {-4915.201172, -2073.528320, 84.733}, - {-4878.883301, -1986.947876, 91.966}, - {-4877.503906, -1966.113403, 91.859}, - {-4767.985352, -1873.169189, 90.192}, - {-4788.861328, -1888.007813, 89.888} -}; - -struct TRINITY_DLL_DECL npc_lakota_windsongAI : public npc_escortAI -{ - npc_lakota_windsongAI(Creature* pCreature) : npc_escortAI(pCreature) { } - - void Reset() { } - - void WaypointReached(uint32 uiPointId) - { - switch(uiPointId) - { - case 8: - DoScriptText(SAY_LAKO_LOOK_OUT, m_creature); - DoSpawnBandits(ID_AMBUSH_1); - break; - case 14: - DoScriptText(SAY_LAKO_HERE_COME, m_creature); - DoSpawnBandits(ID_AMBUSH_2); - break; - case 21: - DoScriptText(SAY_LAKO_MORE, m_creature); - DoSpawnBandits(ID_AMBUSH_3); - break; - case 45: - if (Player* pPlayer = (Player*)Unit::GetUnit(*m_creature, PlayerGUID)) - pPlayer->GroupEventHappens(QUEST_FREE_AT_LAST, m_creature); - break; - } - } - - void DoSpawnBandits(int uiAmbushId) - { - for(int i = 0; i < 2; ++i) - m_creature->SummonCreature(NPC_GRIM_BANDIT, - m_afBanditLoc[i+uiAmbushId][0], m_afBanditLoc[i+uiAmbushId][1], m_afBanditLoc[i+uiAmbushId][2], 0.0f, - TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000); - } -}; - -CreatureAI* GetAI_npc_lakota_windsong(Creature* pCreature) -{ - npc_lakota_windsongAI* pTempAI = new npc_lakota_windsongAI(pCreature); - - pTempAI->FillPointMovementListForCreature(); - - return (CreatureAI*)pTempAI; -} - -bool QuestAccept_npc_lakota_windsong(Player* pPlayer, Creature* pCreature, const Quest* pQuest) -{ - if (pQuest->GetQuestId() == QUEST_FREE_AT_LAST) - { - DoScriptText(SAY_LAKO_START, pCreature, pPlayer); - pCreature->setFaction(FACTION_ESCORTEE_LAKO); - - if (npc_lakota_windsongAI* pEscortAI = CAST_AI(npc_lakota_windsongAI, pCreature->AI())) - pEscortAI->Start(false, false, pPlayer->GetGUID(), pQuest); - } - return true; -} - -/*###### -# npc_paoka_swiftmountain -######*/ - -enum -{ - SAY_START = -1000147, - SAY_WYVERN = -1000148, - SAY_COMPLETE = -1000149, - - QUEST_HOMEWARD = 4770, - NPC_WYVERN = 4107, - FACTION_ESCORTEE = 232 //guessed -}; - -float m_afWyvernLoc[3][3]= -{ - {-4990.606, -906.057, -5.343}, - {-4970.241, -927.378, -4.951}, - {-4985.364, -952.528, -5.199} -}; - -struct TRINITY_DLL_DECL npc_paoka_swiftmountainAI : public npc_escortAI -{ - npc_paoka_swiftmountainAI(Creature* pCreature) : npc_escortAI(pCreature) { } - - void Reset() { } - - void WaypointReached(uint32 uiPointId) - { - switch(uiPointId) - { - case 15: - DoScriptText(SAY_WYVERN, m_creature); - DoSpawnWyvern(); - break; - case 26: - DoScriptText(SAY_COMPLETE, m_creature); - break; - case 27: - if (Player* pPlayer = (Player*)Unit::GetUnit(*m_creature, PlayerGUID)) - pPlayer->GroupEventHappens(QUEST_HOMEWARD, m_creature); - break; - } - } - - void DoSpawnWyvern() - { - for(int i = 0; i < 3; ++i) - m_creature->SummonCreature(NPC_WYVERN, - m_afWyvernLoc[i][0], m_afWyvernLoc[i][1], m_afWyvernLoc[i][2], 0.0f, - TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000); - } -}; - -CreatureAI* GetAI_npc_paoka_swiftmountain(Creature* pCreature) -{ - npc_paoka_swiftmountainAI* pTempAI = new npc_paoka_swiftmountainAI(pCreature); - - pTempAI->FillPointMovementListForCreature(); - - return (CreatureAI*)pTempAI; -} - -bool QuestAccept_npc_paoka_swiftmountain(Player* pPlayer, Creature* pCreature, const Quest* pQuest) -{ - if (pQuest->GetQuestId() == QUEST_HOMEWARD) - { - DoScriptText(SAY_START, pCreature, pPlayer); - pCreature->setFaction(FACTION_ESCORTEE); - - if (npc_paoka_swiftmountainAI* pEscortAI = CAST_AI(npc_paoka_swiftmountainAI,pCreature->AI())) - pEscortAI->Start(false, false, pPlayer->GetGUID(), pQuest); - } - return true; -} - -/*##### -# npc_plucky -######*/ - -#define GOSSIP_P "Please tell me the Phrase.." - -enum -{ - FACTION_FRIENDLY = 35, - QUEST_SCOOP = 1950, - SPELL_PLUCKY_HUMAN = 9192, - SPELL_PLUCKY_CHICKEN = 9220 -}; - -struct TRINITY_DLL_DECL npc_pluckyAI : public ScriptedAI -{ - npc_pluckyAI(Creature *c) : ScriptedAI(c) { m_uiNormFaction = c->getFaction(); } - - uint32 m_uiNormFaction; - uint32 m_uiResetTimer; - - void Reset() - { - m_uiResetTimer = 120000; - - if (m_creature->getFaction() != m_uiNormFaction) - m_creature->setFaction(m_uiNormFaction); - - if (m_creature->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP)) - m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - - m_creature->CastSpell(m_creature, SPELL_PLUCKY_CHICKEN, false); - } - - void ReceiveEmote(Player* pPlayer, uint32 uiTextEmote) - { - if (pPlayer->GetQuestStatus(QUEST_SCOOP) == QUEST_STATUS_INCOMPLETE) - { - if (uiTextEmote == TEXTEMOTE_BECKON) - { - m_creature->setFaction(FACTION_FRIENDLY); - m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - m_creature->CastSpell(m_creature, SPELL_PLUCKY_HUMAN, false); - } - } - - if (uiTextEmote == TEXTEMOTE_CHICKEN) - { - if (m_creature->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP)) - return; - else - { - m_creature->setFaction(FACTION_FRIENDLY); - m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - m_creature->CastSpell(m_creature, SPELL_PLUCKY_HUMAN, false); - m_creature->HandleEmoteCommand(EMOTE_ONESHOT_WAVE); - } - } - } - - void UpdateAI(const uint32 uiDiff) - { - if (m_creature->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP)) - { - if (m_uiResetTimer < uiDiff) - { - if (!m_creature->getVictim()) - EnterEvadeMode(); - else - m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - - return; - } - else - m_uiResetTimer -= uiDiff; - } - - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } -}; - -bool GossipHello_npc_plucky(Player* pPlayer, Creature* pCreature) -{ - if (pPlayer->GetQuestStatus(QUEST_SCOOP) == QUEST_STATUS_INCOMPLETE) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_P, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - pPlayer->SEND_GOSSIP_MENU(738, pCreature->GetGUID()); - - return true; -} - -bool GossipSelect_npc_plucky(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - switch(uiAction) - { - case GOSSIP_ACTION_INFO_DEF+1: - pPlayer->CLOSE_GOSSIP_MENU(); - pPlayer->CompleteQuest(QUEST_SCOOP); - break; - } - return true; -} - -CreatureAI* GetAI_npc_plucky(Creature* pCreature) -{ - return new npc_pluckyAI(pCreature); -} - -/*##### -# -######*/ - -void AddSC_thousand_needles() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "npc_kanati"; - newscript->GetAI = &GetAI_npc_kanati; - newscript->pQuestAccept = &QuestAccept_npc_kanati; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "npc_lakota_windsong"; - newscript->GetAI = &GetAI_npc_lakota_windsong; - newscript->pQuestAccept = &QuestAccept_npc_lakota_windsong; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "npc_paoka_swiftmountain"; - newscript->GetAI = &GetAI_npc_paoka_swiftmountain; - newscript->pQuestAccept = &QuestAccept_npc_paoka_swiftmountain; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "npc_plucky"; - newscript->GetAI = &GetAI_npc_plucky; - newscript->pGossipHello = &GossipHello_npc_plucky; - newscript->pGossipSelect = &GossipSelect_npc_plucky; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/thunder_bluff/thunder_bluff.cpp b/src/bindings/scripts/scripts/zone/thunder_bluff/thunder_bluff.cpp deleted file mode 100644 index f3f21e65440..00000000000 --- a/src/bindings/scripts/scripts/zone/thunder_bluff/thunder_bluff.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: Thunder_Bluff -SD%Complete: 100 -SDComment: Quest support: 925 -SDCategory: Thunder Bluff -EndScriptData */ - -#include "precompiled.h" - -/*##### -# npc_cairne_bloodhoof -######*/ - -#define SPELL_BERSERKER_CHARGE 16636 -#define SPELL_CLEAVE 16044 -#define SPELL_MORTAL_STRIKE 16856 -#define SPELL_THUNDERCLAP 23931 -#define SPELL_UPPERCUT 22916 - -#define GOSSIP_HCB "I know this is rather silly but a young ward who is a bit shy would like your hoofprint." -//TODO: verify abilities/timers -struct TRINITY_DLL_DECL npc_cairne_bloodhoofAI : public ScriptedAI -{ - npc_cairne_bloodhoofAI(Creature* c) : ScriptedAI(c) {} - - uint32 BerserkerCharge_Timer; - uint32 Cleave_Timer; - uint32 MortalStrike_Timer; - uint32 Thunderclap_Timer; - uint32 Uppercut_Timer; - - void Reset() - { - BerserkerCharge_Timer = 30000; - Cleave_Timer = 5000; - MortalStrike_Timer = 10000; - Thunderclap_Timer = 15000; - Uppercut_Timer = 10000; - } - - void EnterCombat(Unit *who) {} - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (BerserkerCharge_Timer < diff) - { - Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0); - if (target) - DoCast(target,SPELL_BERSERKER_CHARGE); - BerserkerCharge_Timer = 25000; - }else BerserkerCharge_Timer -= diff; - - if (Uppercut_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_UPPERCUT); - Uppercut_Timer = 20000; - }else Uppercut_Timer -= diff; - - if (Thunderclap_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_THUNDERCLAP); - Thunderclap_Timer = 15000; - }else Thunderclap_Timer -= diff; - - if (MortalStrike_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_MORTAL_STRIKE); - MortalStrike_Timer = 15000; - }else MortalStrike_Timer -= diff; - - if (Cleave_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_CLEAVE); - Cleave_Timer = 7000; - }else Cleave_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_npc_cairne_bloodhoof(Creature* pCreature) -{ - return new npc_cairne_bloodhoofAI (pCreature); -} - -bool GossipHello_npc_cairne_bloodhoof(Player* pPlayer, Creature* pCreature) -{ - if (pCreature->isQuestGiver()) - pPlayer->PrepareQuestMenu(pCreature->GetGUID()); - - if (pPlayer->GetQuestStatus(925) == QUEST_STATUS_INCOMPLETE) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HCB, GOSSIP_SENDER_MAIN, GOSSIP_SENDER_INFO); - - pPlayer->SEND_GOSSIP_MENU(7013, pCreature->GetGUID()); - - return true; -} - -bool GossipSelect_npc_cairne_bloodhoof(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - if (uiAction == GOSSIP_SENDER_INFO) - { - pPlayer->CastSpell(pPlayer, 23123, false); - pPlayer->SEND_GOSSIP_MENU(7014, pCreature->GetGUID()); - } - return true; -} - -void AddSC_thunder_bluff() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="npc_cairne_bloodhoof"; - newscript->GetAI = &GetAI_npc_cairne_bloodhoof; - newscript->pGossipHello = &GossipHello_npc_cairne_bloodhoof; - newscript->pGossipSelect = &GossipSelect_npc_cairne_bloodhoof; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/tirisfal_glades/tirisfal_glades.cpp b/src/bindings/scripts/scripts/zone/tirisfal_glades/tirisfal_glades.cpp deleted file mode 100644 index baddef00944..00000000000 --- a/src/bindings/scripts/scripts/zone/tirisfal_glades/tirisfal_glades.cpp +++ /dev/null @@ -1,209 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Tirisfal_Glades -SD%Complete: 100 -SDComment: Quest support: 590, 1819 -SDCategory: Tirisfal Glades -EndScriptData */ - -/* ContentData -npc_calvin_montague -go_mausoleum_door -go_mausoleum_trigger -EndContentData */ - -#include "precompiled.h" - -/*###### -## npc_calvin_montague -######*/ - -enum -{ - SAY_COMPLETE = -1000431, - SPELL_DRINK = 2639, // possibly not correct spell (but iconId is correct) - QUEST_590 = 590, - FACTION_HOSTILE = 168 -}; - -struct TRINITY_DLL_DECL npc_calvin_montagueAI : public ScriptedAI -{ - npc_calvin_montagueAI(Creature* pCreature) : ScriptedAI(pCreature) { } - - uint32 m_uiPhase; - uint32 m_uiPhaseTimer; - uint64 m_uiPlayerGUID; - - void Reset() - { - m_uiPhase = 0; - m_uiPhaseTimer = 5000; - m_uiPlayerGUID = 0; - - me->RestoreFaction(); - - if (!m_creature->HasFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NOT_ATTACKABLE_2)) - m_creature->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NOT_ATTACKABLE_2); - } - - void EnterCombat(Unit* who) { } - - void AttackedBy(Unit* pAttacker) - { - if (m_creature->getVictim() || m_creature->IsFriendlyTo(pAttacker)) - return; - - AttackStart(pAttacker); - } - - void DamageTaken(Unit* pDoneBy, uint32 &uiDamage) - { - if (uiDamage > m_creature->GetHealth() || ((m_creature->GetHealth() - uiDamage)*100 / m_creature->GetMaxHealth() < 15)) - { - uiDamage = 0; - - me->RestoreFaction(); - m_creature->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NOT_ATTACKABLE_2); - m_creature->CombatStop(true); - - m_uiPhase = 1; - - if (pDoneBy->GetTypeId() == TYPEID_PLAYER) - m_uiPlayerGUID = pDoneBy->GetGUID(); - } - } - - void UpdateAI(const uint32 uiDiff) - { - if (m_uiPhase) - { - if (m_uiPhaseTimer < uiDiff) - m_uiPhaseTimer = 7500; - else - { - m_uiPhaseTimer -= uiDiff; - return; - } - - switch(m_uiPhase) - { - case 1: - DoScriptText(SAY_COMPLETE, m_creature); - ++m_uiPhase; - break; - case 2: - if (Unit* pUnit = Unit::GetUnit(*m_creature, m_uiPlayerGUID)) - CAST_PLR(pUnit)->AreaExploredOrEventHappens(QUEST_590); - - m_creature->CastSpell(m_creature,SPELL_DRINK,true); - ++m_uiPhase; - break; - case 3: - EnterEvadeMode(); - break; - } - - return; - } - - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_npc_calvin_montague(Creature* pCreature) -{ - return new npc_calvin_montagueAI (pCreature); -} - -bool QuestAccept_npc_calvin_montague(Player* pPlayer, Creature* pCreature, Quest const* quest) -{ - if (quest->GetQuestId() == QUEST_590) - { - pCreature->setFaction(FACTION_HOSTILE); - pCreature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); - CAST_AI(npc_calvin_montagueAI, pCreature->AI())->AttackStart(pPlayer); - } - return true; -} - -/*###### -## go_mausoleum_door -## go_mausoleum_trigger -######*/ - -enum -{ - QUEST_ULAG = 1819, - NPC_ULAG = 6390, - GO_TRIGGER = 104593, - GO_DOOR = 176594 -}; - -bool GOHello_go_mausoleum_door(Player* pPlayer, GameObject* pGo) -{ - if (pPlayer->GetQuestStatus(QUEST_ULAG) != QUEST_STATUS_INCOMPLETE) - return false; - - if (GameObject* pTrigger = pPlayer->FindNearestGameObject(GO_TRIGGER, 30.0f)) - { - pTrigger->SetGoState(GO_STATE_READY); - pPlayer->SummonCreature(NPC_ULAG, 2390.26, 336.47, 40.01, 2.26, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 300000); - return false; - } - - return false; -} - -bool GOHello_go_mausoleum_trigger(Player* pPlayer, GameObject* pGo) -{ - if (pPlayer->GetQuestStatus(QUEST_ULAG) != QUEST_STATUS_INCOMPLETE) - return false; - - if (GameObject* pDoor = pPlayer->FindNearestGameObject(GO_DOOR, 30.0f)) - { - pGo->SetGoState(GO_STATE_ACTIVE); - pDoor->RemoveFlag(GAMEOBJECT_FLAGS,GO_FLAG_INTERACT_COND); - return true; - } - - return false; -} - -void AddSC_tirisfal_glades() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="npc_calvin_montague"; - newscript->GetAI = &GetAI_npc_calvin_montague; - newscript->pQuestAccept = &QuestAccept_npc_calvin_montague; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "go_mausoleum_door"; - newscript->pGOHello = &GOHello_go_mausoleum_door; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "go_mausoleum_trigger"; - newscript->pGOHello = &GOHello_go_mausoleum_trigger; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/undercity/undercity.cpp b/src/bindings/scripts/scripts/zone/undercity/undercity.cpp deleted file mode 100644 index 8b27dc1beeb..00000000000 --- a/src/bindings/scripts/scripts/zone/undercity/undercity.cpp +++ /dev/null @@ -1,266 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Undercity -SD%Complete: 95 -SDComment: Quest support: 6628, 9180(post-event). -SDCategory: Undercity -EndScriptData */ - -/* ContentData -npc_lady_sylvanas_windrunner -npc_highborne_lamenter -npc_parqual_fintallas -EndContentData */ - -#include "precompiled.h" - -/*###### -## npc_lady_sylvanas_windrunner -######*/ - -#define SAY_LAMENT_END -1000357 -#define EMOTE_LAMENT_END -1000358 - -#define SOUND_CREDIT 10896 -#define ENTRY_HIGHBORNE_LAMENTER 21628 -#define ENTRY_HIGHBORNE_BUNNY 21641 - -#define SPELL_HIGHBORNE_AURA 37090 -#define SPELL_SYLVANAS_CAST 36568 -#define SPELL_RIBBON_OF_SOULS 34432 //the real one to use might be 37099 - -float HighborneLoc[4][3]= -{ - {1285.41, 312.47, 0.51}, - {1286.96, 310.40, 1.00}, - {1289.66, 309.66, 1.52}, - {1292.51, 310.50, 1.99}, -}; - -#define HIGHBORNE_LOC_Y -61.00 -#define HIGHBORNE_LOC_Y_NEW -55.50 - -struct TRINITY_DLL_DECL npc_lady_sylvanas_windrunnerAI : public ScriptedAI -{ - npc_lady_sylvanas_windrunnerAI(Creature *c) : ScriptedAI(c) {} - - uint32 LamentEvent_Timer; - bool LamentEvent; - uint64 targetGUID; - - float myX; - float myY; - float myZ; - - void Reset() - { - myX = m_creature->GetPositionX(); - myY = m_creature->GetPositionY(); - myZ = m_creature->GetPositionZ(); - - LamentEvent_Timer = 5000; - LamentEvent = false; - targetGUID = 0; - } - - void EnterCombat(Unit *who) {} - - void JustSummoned(Creature *summoned) - { - if (summoned->GetEntry() == ENTRY_HIGHBORNE_BUNNY) - { - if (Unit* target = Unit::GetUnit(*summoned,targetGUID)) - { - target->SendMonsterMove(target->GetPositionX(), target->GetPositionY(), myZ+15.0,0); - target->GetMap()->CreatureRelocation(m_creature, target->GetPositionX(), target->GetPositionY(), myZ+15.0, 0.0f); - summoned->CastSpell(target, SPELL_RIBBON_OF_SOULS, false); - } - - summoned->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - targetGUID = summoned->GetGUID(); - } - } - - void UpdateAI(const uint32 diff) - { - if (LamentEvent) - { - if (LamentEvent_Timer < diff) - { - float raX = myX; - float raY = myY; - float raZ = myZ; - - m_creature->GetRandomPoint(myX, myY, myZ, 20.0, raX, raY, raZ); - m_creature->SummonCreature(ENTRY_HIGHBORNE_BUNNY, raX, raY, myZ, 0, TEMPSUMMON_TIMED_DESPAWN, 3000); - - LamentEvent_Timer = 2000; - if (!m_creature->HasAura(SPELL_SYLVANAS_CAST)) - { - DoScriptText(SAY_LAMENT_END, m_creature); - DoScriptText(EMOTE_LAMENT_END, m_creature); - LamentEvent = false; - } - }else LamentEvent_Timer -= diff; - } - - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_npc_lady_sylvanas_windrunner(Creature* pCreature) -{ - return new npc_lady_sylvanas_windrunnerAI (pCreature); -} - -bool ChooseReward_npc_lady_sylvanas_windrunner(Player* pPlayer, Creature* pCreature, const Quest *_Quest, uint32 slot) -{ - if (_Quest->GetQuestId() == 9180) - { - CAST_AI(npc_lady_sylvanas_windrunnerAI, pCreature->AI())->LamentEvent = true; - CAST_AI(npc_lady_sylvanas_windrunnerAI, pCreature->AI())->DoPlaySoundToSet(pCreature,SOUND_CREDIT); - pCreature->CastSpell(pCreature,SPELL_SYLVANAS_CAST,false); - - for(uint8 i = 0; i < 4; ++i) - pCreature->SummonCreature(ENTRY_HIGHBORNE_LAMENTER, HighborneLoc[i][0], HighborneLoc[i][1], HIGHBORNE_LOC_Y, HighborneLoc[i][2], TEMPSUMMON_TIMED_DESPAWN, 160000); - } - - return true; -} - -/*###### -## npc_highborne_lamenter -######*/ - -struct TRINITY_DLL_DECL npc_highborne_lamenterAI : public ScriptedAI -{ - npc_highborne_lamenterAI(Creature *c) : ScriptedAI(c) {} - - uint32 EventMove_Timer; - uint32 EventCast_Timer; - bool EventMove; - bool EventCast; - - void Reset() - { - EventMove_Timer = 10000; - EventCast_Timer = 17500; - EventMove = true; - EventCast = true; - } - - void EnterCombat(Unit *who) {} - - void UpdateAI(const uint32 diff) - { - if (EventMove) - { - if (EventMove_Timer < diff) - { - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - m_creature->SendMonsterMoveWithSpeed(m_creature->GetPositionX(),m_creature->GetPositionY(),HIGHBORNE_LOC_Y_NEW,5000); - m_creature->GetMap()->CreatureRelocation(m_creature,m_creature->GetPositionX(),m_creature->GetPositionY(),HIGHBORNE_LOC_Y_NEW,m_creature->GetOrientation()); - EventMove = false; - }else EventMove_Timer -= diff; - } - if (EventCast) - { - if (EventCast_Timer < diff) - { - DoCast(m_creature,SPELL_HIGHBORNE_AURA); - EventCast = false; - }else EventCast_Timer -= diff; - } - } -}; -CreatureAI* GetAI_npc_highborne_lamenter(Creature* pCreature) -{ - return new npc_highborne_lamenterAI (pCreature); -} - -/*###### -## npc_parqual_fintallas -######*/ - -#define SPELL_MARK_OF_SHAME 6767 - -#define GOSSIP_HPF1 "Gul'dan" -#define GOSSIP_HPF2 "Kel'Thuzad" -#define GOSSIP_HPF3 "Ner'zhul" - -bool GossipHello_npc_parqual_fintallas(Player* pPlayer, Creature* pCreature) -{ - if (pCreature->isQuestGiver()) - pPlayer->PrepareQuestMenu(pCreature->GetGUID()); - - if (pPlayer->GetQuestStatus(6628) == QUEST_STATUS_INCOMPLETE && !pPlayer->HasAura(SPELL_MARK_OF_SHAME)) - { - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HPF1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HPF2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HPF3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); - pPlayer->SEND_GOSSIP_MENU(5822, pCreature->GetGUID()); - } - else - pPlayer->SEND_GOSSIP_MENU(5821, pCreature->GetGUID()); - - return true; -} - -bool GossipSelect_npc_parqual_fintallas(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) - { - pPlayer->CLOSE_GOSSIP_MENU(); - pCreature->CastSpell(pPlayer,SPELL_MARK_OF_SHAME,false); - } - if (uiAction == GOSSIP_ACTION_INFO_DEF+2) - { - pPlayer->CLOSE_GOSSIP_MENU(); - pPlayer->AreaExploredOrEventHappens(6628); - } - return true; -} - -/*###### -## AddSC -######*/ - -void AddSC_undercity() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="npc_lady_sylvanas_windrunner"; - newscript->GetAI = &GetAI_npc_lady_sylvanas_windrunner; - newscript->pChooseReward = &ChooseReward_npc_lady_sylvanas_windrunner; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_highborne_lamenter"; - newscript->GetAI = &GetAI_npc_highborne_lamenter; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_parqual_fintallas"; - newscript->pGossipHello = &GossipHello_npc_parqual_fintallas; - newscript->pGossipSelect = &GossipSelect_npc_parqual_fintallas; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/western_plaguelands/western_plaguelands.cpp b/src/bindings/scripts/scripts/zone/western_plaguelands/western_plaguelands.cpp deleted file mode 100644 index edbc94f55ef..00000000000 --- a/src/bindings/scripts/scripts/zone/western_plaguelands/western_plaguelands.cpp +++ /dev/null @@ -1,232 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Western_Plaguelands -SD%Complete: 90 -SDComment: Quest support: 5216, 5219, 5222, 5225, 5229, 5231, 5233, 5235. To obtain Vitreous Focuser (could use more spesifics about gossip items) -SDCategory: Western Plaguelands -EndScriptData */ - -/* ContentData -npcs_dithers_and_arbington -npc_myranda_the_hag -npc_the_scourge_cauldron -EndContentData */ - -#include "precompiled.h" - -/*###### -## npcs_dithers_and_arbington -######*/ - -#define GOSSIP_HDA1 "What does the Felstone Field Cauldron need?" -#define GOSSIP_HDA2 "What does the Dalson's Tears Cauldron need?" -#define GOSSIP_HDA3 "What does the Writhing Haunt Cauldron need?" -#define GOSSIP_HDA4 "What does the Gahrron's Withering Cauldron need?" - -#define GOSSIP_SDA1 "Thanks, i need a Vitreous Focuser" - -bool GossipHello_npcs_dithers_and_arbington(Player* pPlayer, Creature* pCreature) -{ - if (pCreature->isQuestGiver()) - pPlayer->PrepareQuestMenu(pCreature->GetGUID()); - if (pCreature->isVendor()) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); - - if (pPlayer->GetQuestRewardStatus(5237) || pPlayer->GetQuestRewardStatus(5238)) - { - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HDA1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HDA2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HDA3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HDA4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4); - pPlayer->SEND_GOSSIP_MENU(3985, pCreature->GetGUID()); - }else - pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); - - return true; -} - -bool GossipSelect_npcs_dithers_and_arbington(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - switch(uiAction) - { - case GOSSIP_ACTION_TRADE: - pPlayer->SEND_VENDORLIST(pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+1: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SDA1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5); - pPlayer->SEND_GOSSIP_MENU(3980, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+2: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SDA1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5); - pPlayer->SEND_GOSSIP_MENU(3981, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+3: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SDA1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5); - pPlayer->SEND_GOSSIP_MENU(3982, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+4: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SDA1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5); - pPlayer->SEND_GOSSIP_MENU(3983, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+5: - pPlayer->CLOSE_GOSSIP_MENU(); - pCreature->CastSpell(pPlayer, 17529, false); - break; - } - return true; -} - -/*###### -## npc_myranda_the_hag -######*/ - -enum -{ - QUEST_SUBTERFUGE = 5862, - QUEST_IN_DREAMS = 5944, - SPELL_SCARLET_ILLUSION = 17961 -}; - -#define GOSSIP_ITEM_ILLUSION "I am ready for the illusion, Myranda." - -bool GossipHello_npc_myranda_the_hag(Player* pPlayer, Creature* pCreature) -{ - if (pCreature->isQuestGiver()) - pPlayer->PrepareQuestMenu(pCreature->GetGUID()); - - if (pPlayer->GetQuestStatus(QUEST_SUBTERFUGE) == QUEST_STATUS_COMPLETE && - !pPlayer->GetQuestRewardStatus(QUEST_IN_DREAMS) && !pPlayer->HasAura(SPELL_SCARLET_ILLUSION)) - { - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ILLUSION, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - pPlayer->SEND_GOSSIP_MENU(4773, pCreature->GetGUID()); - return true; - } - else - pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); - - return true; -} - -bool GossipSelect_npc_myranda_the_hag(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) - { - pPlayer->CLOSE_GOSSIP_MENU(); - pCreature->CastSpell(pPlayer, SPELL_SCARLET_ILLUSION, false); - } - return true; -} - -/*###### -## npc_the_scourge_cauldron -######*/ - -struct TRINITY_DLL_DECL npc_the_scourge_cauldronAI : public ScriptedAI -{ - npc_the_scourge_cauldronAI(Creature *c) : ScriptedAI(c) {} - - void Reset() {} - - void EnterCombat(Unit* who) {} - - void DoDie() - { - //summoner dies here - m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - //override any database `spawntimesecs` to prevent duplicated summons - uint32 rTime = m_creature->GetRespawnDelay(); - if (rTime<600) - m_creature->SetRespawnDelay(600); - } - - void MoveInLineOfSight(Unit *who) - { - if (!who || who->GetTypeId() != TYPEID_PLAYER) - return; - - if (who->GetTypeId() == TYPEID_PLAYER) - { - switch(m_creature->GetAreaId()) - { - case 199: //felstone - if (CAST_PLR(who)->GetQuestStatus(5216) == QUEST_STATUS_INCOMPLETE || - CAST_PLR(who)->GetQuestStatus(5229) == QUEST_STATUS_INCOMPLETE) - { - m_creature->SummonCreature(11075, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000); - DoDie(); - } - break; - case 200: //dalson - if (CAST_PLR(who)->GetQuestStatus(5219) == QUEST_STATUS_INCOMPLETE || - CAST_PLR(who)->GetQuestStatus(5231) == QUEST_STATUS_INCOMPLETE) - { - m_creature->SummonCreature(11077, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000); - DoDie(); - } - break; - case 201: //gahrron - if (CAST_PLR(who)->GetQuestStatus(5225) == QUEST_STATUS_INCOMPLETE || - CAST_PLR(who)->GetQuestStatus(5235) == QUEST_STATUS_INCOMPLETE) - { - m_creature->SummonCreature(11078, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); - DoDie(); - } - break; - case 202: //writhing - if (CAST_PLR(who)->GetQuestStatus(5222) == QUEST_STATUS_INCOMPLETE || - CAST_PLR(who)->GetQuestStatus(5233) == QUEST_STATUS_INCOMPLETE) - { - m_creature->SummonCreature(11076, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); - DoDie(); - } - break; - } - } - } -}; -CreatureAI* GetAI_npc_the_scourge_cauldron(Creature* pCreature) -{ - return new npc_the_scourge_cauldronAI (pCreature); -} - -/*###### -## -######*/ - -void AddSC_western_plaguelands() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="npcs_dithers_and_arbington"; - newscript->pGossipHello = &GossipHello_npcs_dithers_and_arbington; - newscript->pGossipSelect = &GossipSelect_npcs_dithers_and_arbington; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "npc_myranda_the_hag"; - newscript->pGossipHello = &GossipHello_npc_myranda_the_hag; - newscript->pGossipSelect = &GossipSelect_npc_myranda_the_hag; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_the_scourge_cauldron"; - newscript->GetAI = &GetAI_npc_the_scourge_cauldron; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/westfall/westfall.cpp b/src/bindings/scripts/scripts/zone/westfall/westfall.cpp deleted file mode 100644 index 50a0a8564e0..00000000000 --- a/src/bindings/scripts/scripts/zone/westfall/westfall.cpp +++ /dev/null @@ -1,276 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Westfall -SD%Complete: 90 -SDComment: Quest support: 155, 1651 -SDCategory: Westfall -EndScriptData */ - -/* ContentData -npc_daphne_stilwell -npc_defias_traitor -EndContentData */ - -#include "precompiled.h" -#include "../../npc/npc_escortAI.h" - -/*###### -## npc_daphne_stilwell -######*/ - -enum -{ - SAY_DS_START = -1000402, - SAY_DS_DOWN_1 = -1000403, - SAY_DS_DOWN_2 = -1000404, - SAY_DS_DOWN_3 = -1000405, - SAY_DS_PROLOGUE = -1000406, - - SPELL_SHOOT = 6660, - QUEST_TOME_VALOR = 1651, - NPC_DEFIAS_RAIDER = 6180, - EQUIP_ID_RIFLE = 2511 -}; - -struct TRINITY_DLL_DECL npc_daphne_stilwellAI : public npc_escortAI -{ - npc_daphne_stilwellAI(Creature* pCreature) : npc_escortAI(pCreature) {} - - uint32 uiWPHolder; - uint32 uiShootTimer; - - void Reset() - { - if (IsBeingEscorted) - { - switch(uiWPHolder) - { - case 7: DoScriptText(SAY_DS_DOWN_1, m_creature); break; - case 8: DoScriptText(SAY_DS_DOWN_2, m_creature); break; - case 9: DoScriptText(SAY_DS_DOWN_3, m_creature); break; - } - } - else - uiWPHolder = 0; - - uiShootTimer = 0; - } - - void WaypointReached(uint32 uiPoint) - { - Player* pPlayer = Unit::GetPlayer(PlayerGUID); - - if (!pPlayer) - return; - - uiWPHolder = uiPoint; - - switch(uiPoint) - { - case 4: - SetEquipmentSlots(false, EQUIP_NO_CHANGE, EQUIP_NO_CHANGE, EQUIP_ID_RIFLE); - m_creature->SetSheath(SHEATH_STATE_RANGED); - m_creature->HandleEmoteCommand(EMOTE_STATE_USESTANDING_NOSHEATHE); - break; - case 7: - m_creature->SummonCreature(NPC_DEFIAS_RAIDER, -11450.836, 1569.755, 54.267, 4.230, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - m_creature->SummonCreature(NPC_DEFIAS_RAIDER, -11449.697, 1569.124, 54.421, 4.206, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - m_creature->SummonCreature(NPC_DEFIAS_RAIDER, -11448.237, 1568.307, 54.620, 4.206, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - break; - case 8: - m_creature->SetSheath(SHEATH_STATE_RANGED); - m_creature->SummonCreature(NPC_DEFIAS_RAIDER, -11450.836, 1569.755, 54.267, 4.230, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - m_creature->SummonCreature(NPC_DEFIAS_RAIDER, -11449.697, 1569.124, 54.421, 4.206, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - m_creature->SummonCreature(NPC_DEFIAS_RAIDER, -11448.237, 1568.307, 54.620, 4.206, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - m_creature->SummonCreature(NPC_DEFIAS_RAIDER, -11448.037, 1570.213, 54.961, 4.283, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - break; - case 9: - m_creature->SetSheath(SHEATH_STATE_RANGED); - m_creature->SummonCreature(NPC_DEFIAS_RAIDER, -11450.836, 1569.755, 54.267, 4.230, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - m_creature->SummonCreature(NPC_DEFIAS_RAIDER, -11449.697, 1569.124, 54.421, 4.206, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - m_creature->SummonCreature(NPC_DEFIAS_RAIDER, -11448.237, 1568.307, 54.620, 4.206, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - m_creature->SummonCreature(NPC_DEFIAS_RAIDER, -11448.037, 1570.213, 54.961, 4.283, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - m_creature->SummonCreature(NPC_DEFIAS_RAIDER, -11449.018, 1570.738, 54.828, 4.220, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - break; - case 10: - SetRun(false); - break; - case 11: - DoScriptText(SAY_DS_PROLOGUE, m_creature); - break; - case 13: - SetEquipmentSlots(true); - m_creature->SetSheath(SHEATH_STATE_UNARMED); - m_creature->HandleEmoteCommand(EMOTE_STATE_USESTANDING_NOSHEATHE); - break; - case 17: - pPlayer->GroupEventHappens(QUEST_TOME_VALOR, m_creature); - break; - } - } - - void AttackStart(Unit* pWho) - { - if (!pWho) - return; - - if (m_creature->Attack(pWho, false)) - { - m_creature->AddThreat(pWho, 0.0f); - m_creature->SetInCombatWith(pWho); - pWho->SetInCombatWith(m_creature); - - m_creature->GetMotionMaster()->MoveChase(pWho, 30.0f); - } - } - - void JustSummoned(Creature* pSummoned) - { - pSummoned->AI()->AttackStart(m_creature); - } - - void Update(const uint32 diff) - { - npc_escortAI::UpdateAI(diff); - - if (!UpdateVictim()) - return; - - if (uiShootTimer < diff) - { - uiShootTimer = 1500; - - if (!m_creature->IsWithinDist(m_creature->getVictim(), ATTACK_DISTANCE)) - DoCast(m_creature->getVictim(), SPELL_SHOOT); - }else uiShootTimer -= diff; - } -}; - -bool QuestAccept_npc_daphne_stilwell(Player* pPlayer, Creature* pCreature, const Quest* pQuest) -{ - if (pQuest->GetQuestId() == QUEST_TOME_VALOR) - { - DoScriptText(SAY_DS_START, pCreature); - - if (npc_escortAI* pEscortAI = CAST_AI(npc_daphne_stilwellAI, pCreature->AI())) - pEscortAI->Start(true, true, pPlayer->GetGUID()); - } - - return true; -} - -CreatureAI* GetAI_npc_daphne_stilwell(Creature* pCreature) -{ - npc_daphne_stilwellAI* thisAI = new npc_daphne_stilwellAI(pCreature); - - thisAI->FillPointMovementListForCreature(); - - return thisAI; -} - -/*###### -## npc_defias_traitor -######*/ - -#define SAY_START -1000101 -#define SAY_PROGRESS -1000102 -#define SAY_END -1000103 -#define SAY_AGGRO_1 -1000104 -#define SAY_AGGRO_2 -1000105 - -#define QUEST_DEFIAS_BROTHERHOOD 155 - -struct TRINITY_DLL_DECL npc_defias_traitorAI : public npc_escortAI -{ - npc_defias_traitorAI(Creature *c) : npc_escortAI(c) { Reset(); } - - void WaypointReached(uint32 i) - { - Player* pPlayer = Unit::GetPlayer(PlayerGUID); - - if (!pPlayer) - return; - - switch (i) - { - case 35: - SetRun(false); - break; - case 36: - DoScriptText(SAY_PROGRESS, m_creature, pPlayer); - break; - case 44: - DoScriptText(SAY_END, m_creature, pPlayer); - { - if (pPlayer) - pPlayer->GroupEventHappens(QUEST_DEFIAS_BROTHERHOOD,m_creature); - } - break; - } - } - void EnterCombat(Unit* who) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_AGGRO_1, m_creature, who); break; - case 1: DoScriptText(SAY_AGGRO_2, m_creature, who); break; - } - } - - void Reset() {} -}; - -bool QuestAccept_npc_defias_traitor(Player* pPlayer, Creature* pCreature, Quest const* quest) -{ - if (quest->GetQuestId() == QUEST_DEFIAS_BROTHERHOOD) - { - if (npc_escortAI* pEscortAI = CAST_AI(npc_defias_traitorAI, pCreature->AI())) - pEscortAI->Start(true, true, pPlayer->GetGUID()); - - DoScriptText(SAY_START, pCreature, pPlayer); - } - - return true; -} - -CreatureAI* GetAI_npc_defias_traitor(Creature* pCreature) -{ - npc_defias_traitorAI* thisAI = new npc_defias_traitorAI(pCreature); - - thisAI->FillPointMovementListForCreature(); - - return thisAI; -} - -void AddSC_westfall() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "npc_daphne_stilwell"; - newscript->GetAI = &GetAI_npc_daphne_stilwell; - newscript->pQuestAccept = &QuestAccept_npc_daphne_stilwell; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_defias_traitor"; - newscript->GetAI = &GetAI_npc_defias_traitor; - newscript->pQuestAccept = &QuestAccept_npc_defias_traitor; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/winterspring/winterspring.cpp b/src/bindings/scripts/scripts/zone/winterspring/winterspring.cpp deleted file mode 100644 index d5743869108..00000000000 --- a/src/bindings/scripts/scripts/zone/winterspring/winterspring.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: Winterspring -SD%Complete: 90 -SDComment: Quest support: 5126 (Loraxs' tale missing proper gossip items text). Vendor Rivern Frostwind. Obtain Cache of Mau'ari -SDCategory: Winterspring -EndScriptData */ - -/* ContentData -npc_lorax -npc_rivern_frostwind -npc_witch_doctor_mauari -EndContentData */ - -#include "precompiled.h" - -/*###### -## npc_lorax -######*/ - -#define GOSSIP_HL "Talk to me" - -#define GOSSIP_SL1 "What do you do here?" -#define GOSSIP_SL2 "I can help you" -#define GOSSIP_SL3 "What deal?" -#define GOSSIP_SL4 "Then what happened?" -#define GOSSIP_SL5 "He is not safe, i'll make sure of that." - -bool GossipHello_npc_lorax(Player* pPlayer, Creature* pCreature) -{ - if (pCreature->isQuestGiver()) - pPlayer->PrepareQuestMenu(pCreature->GetGUID()); - - if (pPlayer->GetQuestStatus(5126) == QUEST_STATUS_INCOMPLETE) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HL, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - - pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); - - return true; -} - -bool GossipSelect_npc_lorax(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - switch (uiAction) - { - case GOSSIP_ACTION_INFO_DEF: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SL1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - pPlayer->SEND_GOSSIP_MENU(3759, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+1: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SL2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - pPlayer->SEND_GOSSIP_MENU(3760, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+2: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SL3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); - pPlayer->SEND_GOSSIP_MENU(3761, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+3: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SL4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4); - pPlayer->SEND_GOSSIP_MENU(3762, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+4: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SL5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5); - pPlayer->SEND_GOSSIP_MENU(3763, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+5: - pPlayer->CLOSE_GOSSIP_MENU(); - pPlayer->AreaExploredOrEventHappens(5126); - break; - } - return true; -} - -/*###### -## npc_rivern_frostwind -######*/ - -bool GossipHello_npc_rivern_frostwind(Player* pPlayer, Creature* pCreature) -{ - if (pCreature->isQuestGiver()) - pPlayer->PrepareQuestMenu(pCreature->GetGUID()); - - if (pCreature->isVendor() && pPlayer->GetReputationRank(589) == REP_EXALTED) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); - - pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); - - return true; -} - -bool GossipSelect_npc_rivern_frostwind(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - if (uiAction == GOSSIP_ACTION_TRADE) - pPlayer->SEND_VENDORLIST(pCreature->GetGUID()); - - return true; -} - -/*###### -## npc_witch_doctor_mauari -######*/ - -#define GOSSIP_HWDM "I'd like you to make me a new Cache of Mau'ari please." - -bool GossipHello_npc_witch_doctor_mauari(Player* pPlayer, Creature* pCreature) -{ - if (pCreature->isQuestGiver()) - pPlayer->PrepareQuestMenu(pCreature->GetGUID()); - - if (pPlayer->GetQuestRewardStatus(975)) - { - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HWDM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - pPlayer->SEND_GOSSIP_MENU(3377, pCreature->GetGUID()); - }else - pPlayer->SEND_GOSSIP_MENU(3375, pCreature->GetGUID()); - - return true; -} - -bool GossipSelect_npc_witch_doctor_mauari(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - if (uiAction ==GOSSIP_ACTION_INFO_DEF+1) - { - pPlayer->CLOSE_GOSSIP_MENU(); - pCreature->CastSpell(pPlayer, 16351, false); - } - - return true; -} - -void AddSC_winterspring() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="npc_lorax"; - newscript->pGossipHello = &GossipHello_npc_lorax; - newscript->pGossipSelect = &GossipSelect_npc_lorax; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_rivern_frostwind"; - newscript->pGossipHello = &GossipHello_npc_rivern_frostwind; - newscript->pGossipSelect = &GossipSelect_npc_rivern_frostwind; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_witch_doctor_mauari"; - newscript->pGossipHello = &GossipHello_npc_witch_doctor_mauari; - newscript->pGossipSelect = &GossipSelect_npc_witch_doctor_mauari; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/zangarmarsh/zangarmarsh.cpp b/src/bindings/scripts/scripts/zone/zangarmarsh/zangarmarsh.cpp deleted file mode 100644 index f52e1c4be16..00000000000 --- a/src/bindings/scripts/scripts/zone/zangarmarsh/zangarmarsh.cpp +++ /dev/null @@ -1,379 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Zangarmarsh -SD%Complete: 100 -SDComment: Quest support: 9752, 9785, 9803, 10009. Mark Of ... buffs. -SDCategory: Zangarmarsh -EndScriptData */ - -/* ContentData -npcs_ashyen_and_keleth -npc_cooshcoosh -npc_elder_kuruti -npc_mortog_steamhead -npc_kayra_longmane -EndContentData */ - -#include "precompiled.h" -#include "../../npc/npc_escortAI.h" - -/*###### -## npcs_ashyen_and_keleth -######*/ - -#define GOSSIP_ITEM_BLESS_ASH "Grant me your mark, wise ancient." -#define GOSSIP_ITEM_BLESS_KEL "Grant me your mark, mighty ancient." -#define GOSSIP_REWARD_BLESS -1000359 -//#define TEXT_BLESSINGS "" - -bool GossipHello_npcs_ashyen_and_keleth(Player* pPlayer, Creature* pCreature) -{ - if (pPlayer->GetReputationRank(942) > REP_NEUTRAL) - { - if (pCreature->GetEntry() == 17900) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BLESS_ASH, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - if (pCreature->GetEntry() == 17901) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BLESS_KEL, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - } - pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); - - return true; -} - -bool GossipSelect_npcs_ashyen_and_keleth(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) - { - pCreature->setPowerType(POWER_MANA); - pCreature->SetMaxPower(POWER_MANA,200); //set a "fake" mana value, we can't depend on database doing it in this case - pCreature->SetPower(POWER_MANA,200); - - if (pCreature->GetEntry() == 17900) //check which Creature we are dealing with - { - switch (pPlayer->GetReputationRank(942)) - { //mark of lore - case REP_FRIENDLY: - pCreature->CastSpell(pPlayer, 31808, true); - DoScriptText(GOSSIP_REWARD_BLESS, pCreature); - break; - case REP_HONORED: - pCreature->CastSpell(pPlayer, 31810, true); - DoScriptText(GOSSIP_REWARD_BLESS, pCreature); - break; - case REP_REVERED: - pCreature->CastSpell(pPlayer, 31811, true); - DoScriptText(GOSSIP_REWARD_BLESS, pCreature); - break; - case REP_EXALTED: - pCreature->CastSpell(pPlayer, 31815, true); - DoScriptText(GOSSIP_REWARD_BLESS, pCreature); - break; - } - } - - if (pCreature->GetEntry() == 17901) - { - switch (pPlayer->GetReputationRank(942)) //mark of war - { - case REP_FRIENDLY: - pCreature->CastSpell(pPlayer, 31807, true); - DoScriptText(GOSSIP_REWARD_BLESS, pCreature); - break; - case REP_HONORED: - pCreature->CastSpell(pPlayer, 31812, true); - DoScriptText(GOSSIP_REWARD_BLESS, pCreature); - break; - case REP_REVERED: - pCreature->CastSpell(pPlayer, 31813, true); - DoScriptText(GOSSIP_REWARD_BLESS, pCreature); - break; - case REP_EXALTED: - pCreature->CastSpell(pPlayer, 31814, true); - DoScriptText(GOSSIP_REWARD_BLESS, pCreature); - break; - } - } - pPlayer->CLOSE_GOSSIP_MENU(); - pPlayer->TalkedToCreature(pCreature->GetEntry(), pCreature->GetGUID()); - } - return true; -} - -/*###### -## npc_cooshcoosh -######*/ - -#define GOSSIP_COOSH "You owe Sim'salabim money. Hand them over or die!" - -enum -{ - SPELL_LIGHTNING_BOLT = 9532, - QUEST_CRACK_SKULLS = 10009, - FACTION_HOSTILE_CO = 45 -}; - -struct TRINITY_DLL_DECL npc_cooshcooshAI : public ScriptedAI -{ - npc_cooshcooshAI(Creature* c) : ScriptedAI(c) - { - m_uiNormFaction = c->getFaction(); - } - - uint32 m_uiNormFaction; - uint32 LightningBolt_Timer; - - void Reset() - { - LightningBolt_Timer = 2000; - if (m_creature->getFaction() != m_uiNormFaction) - m_creature->setFaction(m_uiNormFaction); - } - - void EnterCombat(Unit *who) {} - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (LightningBolt_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_LIGHTNING_BOLT); - LightningBolt_Timer = 5000; - }else LightningBolt_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_npc_cooshcoosh(Creature* pCreature) -{ - return new npc_cooshcooshAI (pCreature); -} - -bool GossipHello_npc_cooshcoosh(Player* pPlayer, Creature* pCreature) -{ - if (pPlayer->GetQuestStatus(QUEST_CRACK_SKULLS) == QUEST_STATUS_INCOMPLETE) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_COOSH, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - - pPlayer->SEND_GOSSIP_MENU(9441, pCreature->GetGUID()); - return true; -} - -bool GossipSelect_npc_cooshcoosh(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - if (uiAction == GOSSIP_ACTION_INFO_DEF) - { - pPlayer->CLOSE_GOSSIP_MENU(); - pCreature->setFaction(FACTION_HOSTILE_CO); - pCreature->AI()->AttackStart(pPlayer); - } - return true; -} - -/*###### -## npc_elder_kuruti -######*/ - -#define GOSSIP_ITEM_KUR1 "Offer treat" -#define GOSSIP_ITEM_KUR2 "Im a messenger for Draenei" -#define GOSSIP_ITEM_KUR3 "Get message" - -bool GossipHello_npc_elder_kuruti(Player* pPlayer, Creature* pCreature) -{ - if (pPlayer->GetQuestStatus(9803) == QUEST_STATUS_INCOMPLETE) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KUR1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - - pPlayer->SEND_GOSSIP_MENU(9226, pCreature->GetGUID()); - - return true; -} - -bool GossipSelect_npc_elder_kuruti(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - switch (uiAction) - { - case GOSSIP_ACTION_INFO_DEF: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KUR2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - pPlayer->SEND_GOSSIP_MENU(9227, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF + 1: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KUR3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - pPlayer->SEND_GOSSIP_MENU(9229, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF + 2: - { - if (!pPlayer->HasItemCount(24573,1)) - { - ItemPosCountVec dest; - uint8 msg = pPlayer->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, 24573, 1, false); - if (msg == EQUIP_ERR_OK) - { - pPlayer->StoreNewItem(dest, 24573, true); - } - else - pPlayer->SendEquipError(msg,NULL,NULL); - } - pPlayer->SEND_GOSSIP_MENU(9231, pCreature->GetGUID()); - break; - } - } - return true; -} - -/*###### -## npc_mortog_steamhead -######*/ - -bool GossipHello_npc_mortog_steamhead(Player* pPlayer, Creature* pCreature) -{ - if (pCreature->isVendor() && pPlayer->GetReputationRank(942) == REP_EXALTED) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); - - pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); - - return true; -} - -bool GossipSelect_npc_mortog_steamhead(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - if (uiAction == GOSSIP_ACTION_TRADE) - { - pPlayer->SEND_VENDORLIST(pCreature->GetGUID()); - } - return true; -} - -/*###### -## npc_kayra_longmane -######*/ - -enum -{ - SAY_START = -1000360, - SAY_AMBUSH1 = -1000361, - SAY_PROGRESS = -1000362, - SAY_AMBUSH2 = -1000363, - SAY_NEAR_END = -1000364, - SAY_END = -1000365, - - QUEST_ESCAPE_FROM = 9752, - NPC_SLAVEBINDER = 18042 -}; - -struct TRINITY_DLL_DECL npc_kayra_longmaneAI : public npc_escortAI -{ - npc_kayra_longmaneAI(Creature* c) : npc_escortAI(c) {} - - void Reset() { } - - void WaypointReached(uint32 i) - { - Player* pUnit = Unit::GetPlayer(PlayerGUID); - - if (!pUnit) - return; - - switch(i) - { - case 4: - DoScriptText(SAY_AMBUSH1, m_creature, pUnit); - DoSpawnCreature(NPC_SLAVEBINDER, -10.0f, -5.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - DoSpawnCreature(NPC_SLAVEBINDER, -8.0f, 5.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - break; - case 5: - DoScriptText(SAY_PROGRESS, m_creature, pUnit); - SetRun(); - break; - case 16: - DoScriptText(SAY_AMBUSH2, m_creature, pUnit); - DoSpawnCreature(NPC_SLAVEBINDER, -10.0f, -5.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - DoSpawnCreature(NPC_SLAVEBINDER, -8.0f, 5.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - break; - case 17: - SetRun(false); - DoScriptText(SAY_NEAR_END, m_creature, pUnit); - break; - case 25: - DoScriptText(SAY_END, m_creature, pUnit); - pUnit->GroupEventHappens(QUEST_ESCAPE_FROM, m_creature); - break; - } - } -}; - -bool QuestAccept_npc_kayra_longmane(Player* pPlayer, Creature* pCreature, Quest const* pQuest) -{ - if (pQuest->GetQuestId() == QUEST_ESCAPE_FROM) - { - DoScriptText(SAY_START, pCreature, pPlayer); - - if (npc_escortAI* pEscortAI = CAST_AI(npc_kayra_longmaneAI, pCreature->AI())) - pEscortAI->Start(false, false, pPlayer->GetGUID()); - } - return true; -} - -CreatureAI* GetAI_npc_kayra_longmaneAI(Creature* pCreature) -{ - npc_kayra_longmaneAI* thisAI = new npc_kayra_longmaneAI(pCreature); - - thisAI->FillPointMovementListForCreature(); - - return thisAI; -} -/*###### -## AddSC -######*/ - -void AddSC_zangarmarsh() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="npcs_ashyen_and_keleth"; - newscript->pGossipHello = &GossipHello_npcs_ashyen_and_keleth; - newscript->pGossipSelect = &GossipSelect_npcs_ashyen_and_keleth; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_cooshcoosh"; - newscript->GetAI = &GetAI_npc_cooshcoosh; - newscript->pGossipHello = &GossipHello_npc_cooshcoosh; - newscript->pGossipSelect = &GossipSelect_npc_cooshcoosh; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_elder_kuruti"; - newscript->pGossipHello = &GossipHello_npc_elder_kuruti; - newscript->pGossipSelect = &GossipSelect_npc_elder_kuruti; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_mortog_steamhead"; - newscript->pGossipHello = &GossipHello_npc_mortog_steamhead; - newscript->pGossipSelect = &GossipSelect_npc_mortog_steamhead; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_kayra_longmane"; - newscript->GetAI = &GetAI_npc_kayra_longmaneAI; - newscript->pQuestAccept = &QuestAccept_npc_kayra_longmane; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/zuldrak/zuldrak.cpp b/src/bindings/scripts/scripts/zone/zuldrak/zuldrak.cpp deleted file mode 100644 index 988c4957a0c..00000000000 --- a/src/bindings/scripts/scripts/zone/zuldrak/zuldrak.cpp +++ /dev/null @@ -1,184 +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" - -/*#### -## npc_drakuru_shackles -####*/ - -enum -{ - SPELL_LEFT_CHAIN = 59951, - SPELL_RIGHT_CHAIN = 59952, - SPELL_UNLOCK_SHACKLE = 55083, - SPELL_FREE_RAGECLAW = 55223, - - NPC_RAGECLAW = 29686 -}; - -struct TRINITY_DLL_DECL npc_drakuru_shacklesAI : public ScriptedAI -{ - npc_drakuru_shacklesAI(Creature *c) : ScriptedAI(c) {} - - Unit* Rageclaw; - - void Reset() - { - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - float x, y, z; - Rageclaw = NULL; - m_creature->GetClosePoint(x, y, z, m_creature->GetObjectSize()/3,0.1); - if (Unit* summon = m_creature->SummonCreature(NPC_RAGECLAW,x,y,z,0,TEMPSUMMON_DEAD_DESPAWN,1000)) - DoActionOnRageclaw(true,summon); - } - - void DoActionOnRageclaw(bool locking, Unit *who) - { - if (!who) - return; - - if (locking) - { - if (who) - { - Rageclaw = who; - - m_creature->SetInFront(Rageclaw); - Rageclaw->SetInFront(m_creature); - - m_creature->CastSpell(Rageclaw, SPELL_LEFT_CHAIN, true); - m_creature->CastSpell(Rageclaw, SPELL_RIGHT_CHAIN, true); - } - } - else - { - DoCast(Rageclaw, SPELL_FREE_RAGECLAW, true); - CAST_PLR(who)->KilledMonsterCredit(NPC_RAGECLAW, Rageclaw->GetGUID()); - m_creature->setDeathState(DEAD); - } - } - - void SpellHit(Unit *caster, const SpellEntry *spell) - { - if (spell->Id == SPELL_UNLOCK_SHACKLE) - { - if (Rageclaw) - DoActionOnRageclaw(false,caster); - else - m_creature->setDeathState(JUST_DIED); - - } - } -}; - -CreatureAI* GetAI_npc_drakuru_shackles(Creature* pCreature) -{ - return new npc_drakuru_shacklesAI (pCreature); -} - - -/*#### -## npc_captured_rageclaw -####*/ - -enum -{ - SPELL_UNSHACKLED = 55085, - SPELL_KNEEL = 39656 -}; - -const char * SAY_RAGECLAW_1 = "I poop on you, trollses!"; -const char * SAY_RAGECLAW_2 = "ARRRROOOOGGGGAAAA!"; -const char * SAY_RAGECLAW_3 = "No more mister nice wolvar!"; -#define SAY_RAGECLAW RAND(SAY_RAGECLAW_1,SAY_RAGECLAW_2,SAY_RAGECLAW_3) - -struct TRINITY_DLL_DECL npc_captured_rageclawAI : public ScriptedAI -{ - npc_captured_rageclawAI(Creature *c) : ScriptedAI(c) {} - - uint32 DespawnTimer; - bool Despawn; - - void Reset() - { - Despawn = false; - DespawnTimer = 0; - m_creature->setFaction(35); - m_creature->CastSpell(m_creature, SPELL_KNEEL, true); // Little Hack for kneel - Thanks Illy :P - } - - void MoveInLineOfSight(Unit *who){} - - void SpellHit(Unit *caster, const SpellEntry *spell) - { - if (spell->Id == SPELL_FREE_RAGECLAW) - { - m_creature->RemoveAurasDueToSpell(SPELL_LEFT_CHAIN); - - m_creature->RemoveAurasDueToSpell(SPELL_RIGHT_CHAIN); - - m_creature->RemoveAurasDueToSpell(SPELL_KNEEL); - - m_creature->setFaction(m_creature->GetCreatureInfo()->faction_H); - - DoCast(m_creature, SPELL_UNSHACKLED, true); - m_creature->MonsterSay(SAY_RAGECLAW, LANG_UNIVERSAL, NULL); - m_creature->GetMotionMaster()->MoveRandom(10); - - DespawnTimer = 10000; - Despawn = true; - } - } - - void UpdateAI(const uint32 diff) - { - if (m_creature->getVictim()) - { - DoMeleeAttackIfReady(); - return; - } - - if (!Despawn) - return; - - if (DespawnTimer < diff) - m_creature->setDeathState(JUST_DIED); - else DespawnTimer-=diff; - } -}; - -CreatureAI* GetAI_npc_captured_rageclaw(Creature* pCreature) -{ - return new npc_captured_rageclawAI (pCreature); -} - -void AddSC_zuldrak() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="npc_drakuru_shackles"; - newscript->GetAI = &GetAI_npc_drakuru_shackles; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_captured_rageclaw"; - newscript->GetAI = &GetAI_npc_captured_rageclaw; - newscript->RegisterSelf(); -} -- cgit v1.2.3