diff options
Diffstat (limited to 'src/bindings/scripts')
486 files changed, 25930 insertions, 15144 deletions
diff --git a/src/bindings/scripts/CMakeLists.txt b/src/bindings/scripts/CMakeLists.txt index 96e672f376b..b89344f2b9d 100644 --- a/src/bindings/scripts/CMakeLists.txt +++ b/src/bindings/scripts/CMakeLists.txt @@ -15,25 +15,24 @@ SET(trinityscript_LIB_SRCS scripts/boss/boss_lethon.cpp scripts/boss/boss_taerar.cpp scripts/boss/boss_ysondre.cpp - scripts/creature/mob_event_ai.cpp - scripts/creature/mob_event_ai.h scripts/creature/mob_generic_creature.cpp scripts/creature/simple_ai.cpp scripts/creature/simple_ai.h - scripts/custom/custom_example.cpp - scripts/custom/custom_gossip_codebox.cpp - scripts/custom/test.cpp + scripts/examples/example_creature.cpp + scripts/examples/example_escort.cpp + scripts/examples/example_gossip_codebox.cpp + scripts/examples/example_misc.cpp scripts/go/go_scripts.cpp scripts/guard/guard_ai.cpp scripts/guard/guard_ai.h scripts/guard/guards.cpp scripts/item/item_scripts.cpp - scripts/item/item_test.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 @@ -106,6 +105,7 @@ SET(trinityscript_LIB_SRCS 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 @@ -149,9 +149,11 @@ SET(trinityscript_LIB_SRCS scripts/zone/darkshore/darkshore.cpp scripts/zone/deadmines/def_deadmines.h scripts/zone/deadmines/deadmines.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 @@ -169,6 +171,8 @@ SET(trinityscript_LIB_SRCS scripts/zone/hellfire_citadel/hellfire_ramparts/boss_omor_the_unscarred.cpp scripts/zone/hellfire_citadel/hellfire_ramparts/boss_watchkeeper_gargolmar.cpp scripts/zone/hellfire_citadel/hellfire_ramparts/boss_vazruden_the_herald.cpp + scripts/zone/hellfire_citadel/hellfire_ramparts/def_hellfire_ramparts.h + scripts/zone/hellfire_citadel/hellfire_ramparts/instance_hellfire_ramparts.cpp scripts/zone/hellfire_citadel/magtheridons_lair/boss_magtheridon.cpp scripts/zone/hellfire_citadel/magtheridons_lair/def_magtheridons_lair.h scripts/zone/hellfire_citadel/magtheridons_lair/instance_magtheridons_lair.cpp @@ -227,7 +231,6 @@ SET(trinityscript_LIB_SRCS scripts/zone/naxxramas/boss_gothik.cpp scripts/zone/naxxramas/boss_grobbulus.cpp scripts/zone/naxxramas/boss_heigan.cpp - scripts/zone/naxxramas/boss_highlord_mograine.cpp scripts/zone/naxxramas/boss_kelthuzad.cpp scripts/zone/naxxramas/boss_four_horsemen.cpp scripts/zone/naxxramas/boss_loatheb.cpp @@ -237,11 +240,13 @@ SET(trinityscript_LIB_SRCS scripts/zone/naxxramas/boss_razuvious.cpp scripts/zone/naxxramas/boss_sapphiron.cpp scripts/zone/naxxramas/boss_thaddius.cpp + scripts/zone/naxxramas/def_naxxramas.h scripts/zone/naxxramas/instance_naxxramas.cpp scripts/zone/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/razorfen_kraul.cpp scripts/zone/ruins_of_ahnqiraj/boss_ayamiss.cpp scripts/zone/ruins_of_ahnqiraj/boss_buru.cpp @@ -313,6 +318,7 @@ SET(trinityscript_LIB_SRCS 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 @@ -385,6 +391,93 @@ SET(trinityscript_LIB_SRCS scripts/zone/zulgurub/boss_wushoolay.cpp scripts/zone/zulgurub/def_zulgurub.h scripts/zone/zulgurub/instance_zulgurub.cpp + scripts/zone/utgarde_keep/utgarde_keep/instance_utgarde_keep.cpp + scripts/zone/utgarde_keep/utgarde_keep/boss_keleseth.cpp + scripts/zone/utgarde_keep/utgarde_keep/boss_skarvald_dalronn.cpp + scripts/zone/utgarde_keep/utgarde_keep/boss_ingvar_the_plunderer.cpp + scripts/zone/utgarde_keep/utgarde_keep/def_utgarde_keep.h + scripts/zone/utgarde_keep/utgarde_keep/utgarde_keep.cpp + scripts/zone/utgarde_keep/utgarde_pinnacle/instance_pinnacle.cpp + scripts/zone/utgarde_keep/utgarde_pinnacle/boss_skadi.cpp + scripts/zone/utgarde_keep/utgarde_pinnacle/boss_ymiron.cpp + scripts/zone/utgarde_keep/utgarde_pinnacle/boss_palehoof.cpp + scripts/zone/utgarde_keep/utgarde_pinnacle/boss_svala.cpp + scripts/zone/utgarde_keep/utgarde_pinnacle/def_pinnacle.h + scripts/zone/nexus/nexus/instance_nexus.cpp + scripts/zone/nexus/nexus/boss_magus_telestra.cpp + scripts/zone/nexus/nexus/boss_anomalus.cpp + scripts/zone/nexus/nexus/boss_ormorok.cpp + scripts/zone/nexus/nexus/boss_keristrasza.cpp + scripts/zone/nexus/nexus/commander_stoutbeard.cpp + scripts/zone/nexus/nexus/commander_kolurg.cpp + scripts/zone/nexus/nexus/def_nexus.h + scripts/zone/nexus/oculus/instance_oculus.cpp + scripts/zone/nexus/oculus/boss_drakos.cpp + scripts/zone/nexus/oculus/boss_urom.cpp + scripts/zone/nexus/oculus/boss_varos.cpp + scripts/zone/nexus/oculus/boss_eregos.cpp + scripts/zone/nexus/oculus/def_oculus.h + scripts/zone/azjol_nerub/azjol_nerub/instance_azjol_nerub.cpp + scripts/zone/azjol_nerub/azjol_nerub/boss_krikthir_the_gatewatcher.cpp + scripts/zone/azjol_nerub/azjol_nerub/boss_hadronox.cpp + scripts/zone/azjol_nerub/azjol_nerub/boss_anubarak.cpp + scripts/zone/azjol_nerub/azjol_nerub/def_azjol_nerub.h + scripts/zone/azjol_nerub/ahnkahet/instance_ahnkahet.cpp + scripts/zone/azjol_nerub/ahnkahet/boss_prince_taldaram.cpp + scripts/zone/azjol_nerub/ahnkahet/boss_elder_nadox.cpp + scripts/zone/azjol_nerub/ahnkahet/boss_jedoga_shadowseeker.cpp + scripts/zone/azjol_nerub/ahnkahet/boss_herald_volazj.cpp + scripts/zone/azjol_nerub/ahnkahet/boss_amanitar.cpp + scripts/zone/azjol_nerub/ahnkahet/def_ahnkahet.h + scripts/zone/draktharon_keep/instance_drak_tharon_keep.cpp + scripts/zone/draktharon_keep/boss_trollgore.cpp + scripts/zone/draktharon_keep/boss_novos.cpp + scripts/zone/draktharon_keep/boss_dred.cpp + scripts/zone/draktharon_keep/boss_tharon_ja.cpp + scripts/zone/draktharon_keep/def_drak_tharon_keep.h + scripts/zone/violet_hold/instance_violet_hold.cpp + scripts/zone/violet_hold/boss_cyanigosa.cpp + scripts/zone/violet_hold/boss_erekem.cpp + scripts/zone/violet_hold/boss_ichoron.cpp + scripts/zone/violet_hold/boss_lavanthor.cpp + scripts/zone/violet_hold/boss_moragg.cpp + scripts/zone/violet_hold/boss_xevozz.cpp + scripts/zone/violet_hold/boss_zuramat.cpp + scripts/zone/violet_hold/def_violet_hold.h + scripts/zone/gundrak/instance_gundrak.cpp + scripts/zone/gundrak/boss_slad_ran.cpp + scripts/zone/gundrak/boss_moorabi.cpp + scripts/zone/gundrak/boss_drakkari_colossus.cpp + scripts/zone/gundrak/boss_gal_darah.cpp + scripts/zone/gundrak/boss_eck.cpp + scripts/zone/gundrak/def_gundrak.h + scripts/zone/ulduar/halls_of_stone/instance_halls_of_stone.cpp + scripts/zone/ulduar/halls_of_stone/boss_maiden_of_grief.cpp + scripts/zone/ulduar/halls_of_stone/boss_krystallus.cpp + scripts/zone/ulduar/halls_of_stone/boss_sjonnir.cpp + scripts/zone/ulduar/halls_of_stone/def_halls_of_stone.h + scripts/zone/ulduar/halls_of_lightning/instance_halls_of_lightning.cpp + scripts/zone/ulduar/halls_of_lightning/boss_bjarngrim.cpp + scripts/zone/ulduar/halls_of_lightning/boss_ionar.cpp + scripts/zone/ulduar/halls_of_lightning/boss_volkhan.cpp + scripts/zone/ulduar/halls_of_lightning/boss_loken.cpp + scripts/zone/ulduar/halls_of_lightning/def_halls_of_lightning.h + scripts/zone/caverns_of_time/culling_of_stratholme/instance_culling_of_stratholme.cpp + scripts/zone/caverns_of_time/culling_of_stratholme/boss_meathook.cpp + scripts/zone/caverns_of_time/culling_of_stratholme/boss_epoch.cpp + scripts/zone/caverns_of_time/culling_of_stratholme/boss_mal_ganis.cpp + scripts/zone/caverns_of_time/culling_of_stratholme/boss_salramm.cpp + scripts/zone/caverns_of_time/culling_of_stratholme/def_culling_of_stratholme.h + scripts/zone/nexus/eye_of_eternity/instance_eye_of_eternity.cpp + scripts/zone/nexus/eye_of_eternity/boss_malygos.cpp + scripts/zone/nexus/eye_of_eternity/def_eye_of_eternity.h + scripts/zone/obsidian_sanctum/instance_obsidian_sanctum.cpp + scripts/zone/obsidian_sanctum/boss_sartharion.cpp + scripts/zone/obsidian_sanctum/def_obsidian_sanctum.h + scripts/zone/vault_of_archavon/instance_vault_of_archavon.cpp + scripts/zone/vault_of_archavon/boss_archavon.cpp + scripts/zone/vault_of_archavon/def_vault_of_archavon.h + scripts/zone/wintergrasp/wintergrasp.cpp system.cpp ) diff --git a/src/bindings/scripts/Makefile.am b/src/bindings/scripts/Makefile.am new file mode 100644 index 00000000000..8d871dfcf25 --- /dev/null +++ b/src/bindings/scripts/Makefile.am @@ -0,0 +1,450 @@ +# Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/> +# +# Thanks to the original authors: MaNGOS <http://getmangos.com/> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +## Process this file with automake to produce Makefile.in + +## Sub-directories to parse +## SUBDIRS = sql + +# build shared library +lib_LTLIBRARIES = libtrinityscript.la + +libtrinityscript_la_CPPFLAGS = \ +$(MYSQL_INCLUDES) \ +$(POSTGRE_INCLUDES) \ +-I$(top_srcdir)/dep/include \ +-I$(top_srcdir)/src/shared \ +-I$(top_srcdir)/src/framework \ +-I$(top_srcdir)/src/game \ +-I$(srcdir)/include \ +$(TRINI_INCLUDES) \ +-D_TRINITY_SCRIPT_CONFIG='"$(sysconfdir)/trinitycore.conf"' + +libtrinityscript_la_SOURCES = \ +ScriptMgr.cpp \ +ScriptMgr.h \ +include/precompiled.cpp \ +include/precompiled.h \ +include/sc_creature.cpp \ +include/sc_creature.h \ +include/sc_gossip.h \ +include/sc_instance.h \ +scripts/areatrigger/areatrigger_scripts.cpp \ +scripts/boss/boss_emeriss.cpp \ +scripts/boss/boss_lethon.cpp \ +scripts/boss/boss_taerar.cpp \ +scripts/boss/boss_ysondre.cpp \ +scripts/creature/mob_event_ai.cpp \ +scripts/creature/mob_event_ai.h \ +scripts/creature/mob_generic_creature.cpp \ +scripts/creature/simple_ai.cpp \ +scripts/creature/simple_ai.h \ +scripts/examples/example_creature.cpp \ +scripts/examples/example_escort.cpp \ +scripts/examples/example_gossip_codebox.cpp \ +scripts/examples/example_misc.cpp \ +scripts/go/go_scripts.cpp \ +scripts/guard/guard_ai.cpp \ +scripts/guard/guard_ai.h \ +scripts/guard/guards.cpp \ +scripts/item/item_scripts.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/zone/alterac_mountains/alterac_mountains.cpp \ +scripts/zone/arathi_highlands/arathi_highlands.cpp \ +scripts/zone/ashenvale_forest/ashenvale.cpp\ +scripts/zone/aunchindoun/auchenai_crypts/boss_exarch_maladaar.cpp \ +scripts/zone/aunchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp \ +scripts/zone/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp \ +scripts/zone/aunchindoun/mana_tombs/boss_pandemonius.cpp \ +scripts/zone/aunchindoun/sethekk_halls/boss_darkweaver_syth.cpp \ +scripts/zone/aunchindoun/sethekk_halls/boss_tailonking_ikiss.cpp \ +scripts/zone/aunchindoun/sethekk_halls/def_sethekk_halls.h \ +scripts/zone/aunchindoun/sethekk_halls/instance_sethekk_halls.cpp \ +scripts/zone/aunchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp \ +scripts/zone/aunchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp \ +scripts/zone/aunchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp \ +scripts/zone/aunchindoun/shadow_labyrinth/boss_murmur.cpp \ +scripts/zone/aunchindoun/shadow_labyrinth/def_shadow_labyrinth.h \ +scripts/zone/aunchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp \ +scripts/zone/azjol_nerub/ahnkahet/instance_ahnkahet.cpp \ +scripts/zone/azjol_nerub/ahnkahet/boss_elder_nadox.cpp \ +scripts/zone/azjol_nerub/ahnkahet/def_ahnkahet.h \ +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 \ +scripts/zone/black_temple/boss_mother_shahraz.cpp \ +scripts/zone/black_temple/boss_reliquary_of_souls.cpp \ +scripts/zone/black_temple/boss_shade_of_akama.cpp \ +scripts/zone/black_temple/boss_supremus.cpp \ +scripts/zone/black_temple/boss_teron_gorefiend.cpp \ +scripts/zone/black_temple/boss_warlord_najentus.cpp \ +scripts/zone/black_temple/def_black_temple.h \ +scripts/zone/black_temple/illidari_council.cpp \ +scripts/zone/black_temple/instance_black_temple.cpp \ +scripts/zone/blackrock_depths/blackrock_depths.cpp \ +scripts/zone/blackrock_depths/boss_ambassador_flamelash.cpp \ +scripts/zone/blackrock_depths/boss_anubshiah.cpp \ +scripts/zone/blackrock_depths/boss_emperor_dagran_thaurissan.cpp \ +scripts/zone/blackrock_depths/boss_general_angerforge.cpp \ +scripts/zone/blackrock_depths/boss_gorosh_the_dervish.cpp \ +scripts/zone/blackrock_depths/boss_grizzle.cpp \ +scripts/zone/blackrock_depths/boss_high_interrogator_gerstahn.cpp \ +scripts/zone/blackrock_depths/boss_magmus.cpp \ +scripts/zone/blackrock_depths/boss_moira_bronzebeard.cpp \ +scripts/zone/blackrock_depths/boss_tomb_of_seven.cpp \ +scripts/zone/blackrock_depths/def_blackrock_depths.h \ +scripts/zone/blackrock_depths/instance_blackrock_depths.cpp \ +scripts/zone/blackrock_spire/boss_drakkisath.cpp \ +scripts/zone/blackrock_spire/boss_gyth.cpp \ +scripts/zone/blackrock_spire/boss_halycon.cpp \ +scripts/zone/blackrock_spire/boss_highlord_omokk.cpp \ +scripts/zone/blackrock_spire/boss_mother_smolderweb.cpp \ +scripts/zone/blackrock_spire/boss_overlord_wyrmthalak.cpp \ +scripts/zone/blackrock_spire/boss_pyroguard_emberseer.cpp \ +scripts/zone/blackrock_spire/boss_quartermaster_zigris.cpp \ +scripts/zone/blackrock_spire/boss_rend_blackhand.cpp \ +scripts/zone/blackrock_spire/boss_shadow_hunter_voshgajin.cpp \ +scripts/zone/blackrock_spire/boss_the_beast.cpp \ +scripts/zone/blackrock_spire/boss_warmaster_voone.cpp \ +scripts/zone/blackwing_lair/boss_broodlord_lashlayer.cpp \ +scripts/zone/blackwing_lair/boss_chromaggus.cpp \ +scripts/zone/blackwing_lair/boss_ebonroc.cpp \ +scripts/zone/blackwing_lair/boss_firemaw.cpp \ +scripts/zone/blackwing_lair/boss_flamegor.cpp \ +scripts/zone/blackwing_lair/boss_nefarian.cpp \ +scripts/zone/blackwing_lair/boss_razorgore.cpp \ +scripts/zone/blackwing_lair/boss_vaelastrasz.cpp \ +scripts/zone/blackwing_lair/boss_victor_nefarius.cpp \ +scripts/zone/blackwing_lair/instance_blackwing_lair.cpp \ +scripts/zone/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/boss_aeonus.cpp \ +scripts/zone/caverns_of_time/dark_portal/boss_chrono_lord_deja.cpp \ +scripts/zone/caverns_of_time/dark_portal/boss_temporus.cpp \ +scripts/zone/caverns_of_time/dark_portal/dark_portal.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/hyjal/boss_archimonde.cpp \ +scripts/zone/caverns_of_time/hyjal/def_hyjal.h \ +scripts/zone/caverns_of_time/hyjal/hyjal.cpp \ +scripts/zone/caverns_of_time/hyjal/hyjalAI.cpp \ +scripts/zone/caverns_of_time/hyjal/hyjalAI.h \ +scripts/zone/caverns_of_time/hyjal/instance_hyjal.cpp \ +scripts/zone/caverns_of_time/old_hillsbrad/boss_captain_skarloc.cpp \ +scripts/zone/caverns_of_time/old_hillsbrad/boss_epoch_hunter.cpp \ +scripts/zone/caverns_of_time/old_hillsbrad/boss_leutenant_drake.cpp \ +scripts/zone/caverns_of_time/old_hillsbrad/def_old_hillsbrad.h \ +scripts/zone/caverns_of_time/old_hillsbrad/instance_old_hillsbrad.cpp \ +scripts/zone/caverns_of_time/old_hillsbrad/old_hillsbrad.cpp \ +scripts/zone/coilfang_resevoir/serpent_shrine/boss_fathomlord_karathress.cpp \ +scripts/zone/coilfang_resevoir/serpent_shrine/boss_hydross_the_unstable.cpp \ +scripts/zone/coilfang_resevoir/serpent_shrine/boss_lurker_below.cpp \ +scripts/zone/coilfang_resevoir/serpent_shrine/boss_lady_vashj.cpp \ +scripts/zone/coilfang_resevoir/serpent_shrine/boss_leotheras_the_blind.cpp \ +scripts/zone/coilfang_resevoir/serpent_shrine/boss_morogrim_tidewalker.cpp \ +scripts/zone/coilfang_resevoir/serpent_shrine/def_serpent_shrine.h \ +scripts/zone/coilfang_resevoir/serpent_shrine/instance_serpent_shrine.cpp \ +scripts/zone/coilfang_resevoir/steam_vault/boss_hydromancer_thespia.cpp \ +scripts/zone/coilfang_resevoir/steam_vault/boss_mekgineer_steamrigger.cpp \ +scripts/zone/coilfang_resevoir/steam_vault/boss_warlord_kalithresh.cpp \ +scripts/zone/coilfang_resevoir/steam_vault/def_steam_vault.h \ +scripts/zone/coilfang_resevoir/steam_vault/instance_steam_vault.cpp \ +scripts/zone/coilfang_resevoir/underbog/boss_hungarfen.cpp \ +scripts/zone/darkshore/darkshore.cpp \ +scripts/zone/deadmines/deadmines.cpp \ +scripts/zone/deadmines/def_deadmines.h \ +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/gruuls_lair/boss_gruul.cpp \ +scripts/zone/gruuls_lair/boss_high_king_maulgar.cpp \ +scripts/zone/gruuls_lair/def_gruuls_lair.h \ +scripts/zone/gruuls_lair/instance_gruuls_lair.cpp \ +scripts/zone/hellfire_citadel/blood_furnace/boss_broggok.cpp \ +scripts/zone/hellfire_citadel/blood_furnace/boss_kelidan_the_breaker.cpp \ +scripts/zone/hellfire_citadel/blood_furnace/boss_the_maker.cpp \ +scripts/zone/hellfire_citadel/blood_furnace/instance_blood_furnace.cpp \ +scripts/zone/hellfire_citadel/blood_furnace/def_blood_furnace.h \ +scripts/zone/hellfire_citadel/hellfire_ramparts/boss_omor_the_unscarred.cpp \ +scripts/zone/hellfire_citadel/hellfire_ramparts/boss_watchkeeper_gargolmar.cpp \ +scripts/zone/hellfire_citadel/hellfire_ramparts/boss_vazruden_the_herald.cpp \ +scripts/zone/hellfire_citadel/magtheridons_lair/boss_magtheridon.cpp \ +scripts/zone/hellfire_citadel/magtheridons_lair/def_magtheridons_lair.h \ +scripts/zone/hellfire_citadel/magtheridons_lair/instance_magtheridons_lair.cpp \ +scripts/zone/hellfire_citadel/shattered_halls/boss_nethekurse.cpp \ +scripts/zone/hellfire_citadel/shattered_halls/boss_warbringer_omrogg.cpp \ +scripts/zone/hellfire_citadel/shattered_halls/boss_warchief_kargath_bladefist.cpp \ +scripts/zone/hellfire_citadel/shattered_halls/def_shattered_halls.h \ +scripts/zone/hellfire_citadel/shattered_halls/instance_shattered_halls.cpp \ +scripts/zone/hellfire_peninsula/boss_doomlord_kazzak.cpp \ +scripts/zone/hellfire_peninsula/hellfire_peninsula.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 \ +scripts/zone/karazhan/boss_moroes.cpp \ +scripts/zone/karazhan/boss_netherspite.cpp \ +scripts/zone/karazhan/boss_nightbane.cpp \ +scripts/zone/karazhan/boss_prince_malchezaar.cpp \ +scripts/zone/karazhan/boss_shade_of_aran.cpp \ +scripts/zone/karazhan/boss_terestian_illhoof.cpp \ +scripts/zone/karazhan/bosses_opera.cpp \ +scripts/zone/karazhan/def_karazhan.h \ +scripts/zone/karazhan/instance_karazhan.cpp \ +scripts/zone/karazhan/karazhan.cpp \ +scripts/zone/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 \ +scripts/zone/magisters_terrace/boss_vexallus.cpp \ +scripts/zone/magisters_terrace/def_magisters_terrace.h \ +scripts/zone/magisters_terrace/instance_magisters_terrace.cpp \ +scripts/zone/maraudon/boss_celebras_the_cursed.cpp \ +scripts/zone/maraudon/boss_landslide.cpp \ +scripts/zone/maraudon/boss_noxxion.cpp \ +scripts/zone/maraudon/boss_princess_theradras.cpp \ +scripts/zone/molten_core/boss_baron_geddon.cpp \ +scripts/zone/molten_core/boss_garr.cpp \ +scripts/zone/molten_core/boss_gehennas.cpp \ +scripts/zone/molten_core/boss_golemagg.cpp \ +scripts/zone/molten_core/boss_lucifron.cpp \ +scripts/zone/molten_core/boss_magmadar.cpp \ +scripts/zone/molten_core/boss_majordomo_executus.cpp \ +scripts/zone/molten_core/boss_ragnaros.cpp \ +scripts/zone/molten_core/boss_shazzrah.cpp \ +scripts/zone/molten_core/boss_sulfuron_harbinger.cpp \ +scripts/zone/molten_core/def_molten_core.h \ +scripts/zone/molten_core/instance_molten_core.cpp \ +scripts/zone/molten_core/molten_core.cpp \ +scripts/zone/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 \ +scripts/zone/naxxramas/boss_gothik.cpp \ +scripts/zone/naxxramas/boss_grobbulus.cpp \ +scripts/zone/naxxramas/boss_heigan.cpp \ +scripts/zone/naxxramas/boss_kelthuzad.cpp \ +scripts/zone/naxxramas/boss_four_horsemen.cpp \ +scripts/zone/naxxramas/boss_loatheb.cpp \ +scripts/zone/naxxramas/boss_maexxna.cpp \ +scripts/zone/naxxramas/boss_noth.cpp \ +scripts/zone/naxxramas/boss_patchwerk.cpp \ +scripts/zone/naxxramas/boss_razuvious.cpp \ +scripts/zone/naxxramas/boss_sapphiron.cpp \ +scripts/zone/naxxramas/boss_thaddius.cpp \ +scripts/zone/naxxramas/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/razorfen_kraul.cpp \ +scripts/zone/ruins_of_ahnqiraj/boss_ayamiss.cpp \ +scripts/zone/ruins_of_ahnqiraj/boss_buru.cpp \ +scripts/zone/ruins_of_ahnqiraj/boss_kurinnaxx.cpp \ +scripts/zone/ruins_of_ahnqiraj/boss_moam.cpp \ +scripts/zone/ruins_of_ahnqiraj/boss_ossirian.cpp \ +scripts/zone/ruins_of_ahnqiraj/boss_rajaxx.cpp \ +scripts/zone/ruins_of_ahnqiraj/instance_ruins_of_ahnqiraj.cpp \ +scripts/zone/scarlet_monastery/boss_arcanist_doan.cpp \ +scripts/zone/scarlet_monastery/boss_azshir_the_sleepless.cpp \ +scripts/zone/scarlet_monastery/boss_bloodmage_thalnos.cpp \ +scripts/zone/scarlet_monastery/boss_herod.cpp \ +scripts/zone/scarlet_monastery/boss_high_inquisitor_fairbanks.cpp \ +scripts/zone/scarlet_monastery/boss_houndmaster_loksey.cpp \ +scripts/zone/scarlet_monastery/boss_interrogator_vishas.cpp \ +scripts/zone/scarlet_monastery/boss_scorn.cpp \ +scripts/zone/scarlet_monastery/boss_headless_horseman.cpp \ +scripts/zone/scarlet_monastery/boss_mograine_and_whitemane.cpp \ +scripts/zone/scarlet_monastery/instance_scarlet_monastery.cpp \ +scripts/zone/scarlet_monastery/def_scarlet_monastery.h \ +scripts/zone/scholomance/boss_darkmaster_gandling.cpp \ +scripts/zone/scholomance/boss_death_knight_darkreaver.cpp \ +scripts/zone/scholomance/boss_doctor_theolen_krastinov.cpp \ +scripts/zone/scholomance/boss_illucia_barov.cpp \ +scripts/zone/scholomance/boss_instructor_malicia.cpp \ +scripts/zone/scholomance/boss_jandice_barov.cpp \ +scripts/zone/scholomance/boss_kormok.cpp \ +scripts/zone/scholomance/boss_lord_alexei_barov.cpp \ +scripts/zone/scholomance/boss_lorekeeper_polkelt.cpp \ +scripts/zone/scholomance/boss_ras_frostwhisper.cpp \ +scripts/zone/scholomance/boss_the_ravenian.cpp \ +scripts/zone/scholomance/boss_vectus.cpp \ +scripts/zone/scholomance/def_scholomance.h \ +scripts/zone/scholomance/instance_scholomance.cpp \ +scripts/zone/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/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 \ +scripts/zone/stratholme/boss_dathrohan_balnazzar.cpp \ +scripts/zone/stratholme/boss_magistrate_barthilas.cpp \ +scripts/zone/stratholme/boss_maleki_the_pallid.cpp \ +scripts/zone/stratholme/boss_nerubenkan.cpp \ +scripts/zone/stratholme/boss_order_of_silver_hand.cpp \ +scripts/zone/stratholme/boss_postmaster_malown.cpp \ +scripts/zone/stratholme/boss_ramstein_the_gorger.cpp \ +scripts/zone/stratholme/boss_timmy_the_cruel.cpp \ +scripts/zone/stratholme/def_stratholme.h \ +scripts/zone/stratholme/instance_stratholme.cpp \ +scripts/zone/stratholme/stratholme.cpp \ +scripts/zone/sunwell_plateau/boss_eredar_twins.cpp \ +scripts/zone/sunwell_plateau/boss_felmyst.cpp \ +scripts/zone/sunwell_plateau/boss_brutallus.cpp \ +scripts/zone/sunwell_plateau/boss_kalecgos.cpp \ +scripts/zone/sunwell_plateau/def_sunwell_plateau.h \ +scripts/zone/sunwell_plateau/instance_sunwell_plateau.cpp \ +scripts/zone/tanaris/tanaris.cpp \ +scripts/zone/tempest_keep/arcatraz/arcatraz.cpp \ +scripts/zone/tempest_keep/arcatraz/boss_harbinger_skyriss.cpp \ +scripts/zone/tempest_keep/arcatraz/def_arcatraz.h \ +scripts/zone/tempest_keep/arcatraz/instance_arcatraz.cpp \ +scripts/zone/tempest_keep/botanica/boss_high_botanist_freywinn.cpp \ +scripts/zone/tempest_keep/botanica/boss_laj.cpp \ +scripts/zone/tempest_keep/botanica/boss_warp_splinter.cpp \ +scripts/zone/tempest_keep/the_eye/boss_alar.cpp \ +scripts/zone/tempest_keep/the_eye/boss_astromancer.cpp \ +scripts/zone/tempest_keep/the_eye/boss_kaelthas.cpp \ +scripts/zone/tempest_keep/the_eye/boss_void_reaver.cpp \ +scripts/zone/tempest_keep/the_eye/def_the_eye.h \ +scripts/zone/tempest_keep/the_eye/instance_the_eye.cpp \ +scripts/zone/tempest_keep/the_eye/the_eye.cpp \ +scripts/zone/tempest_keep/the_mechanar/boss_gatewatcher_gyrokill.cpp \ +scripts/zone/tempest_keep/the_mechanar/boss_gatewatcher_ironhand.cpp \ +scripts/zone/tempest_keep/the_mechanar/boss_nethermancer_sepethrea.cpp \ +scripts/zone/tempest_keep/the_mechanar/boss_pathaleon_the_calculator.cpp \ +scripts/zone/tempest_keep/the_mechanar/def_mechanar.h \ +scripts/zone/tempest_keep/the_mechanar/instance_mechanar.cpp \ +scripts/zone/temple_of_ahnqiraj/boss_bug_trio.cpp \ +scripts/zone/temple_of_ahnqiraj/boss_cthun.cpp \ +scripts/zone/temple_of_ahnqiraj/boss_fankriss.cpp \ +scripts/zone/temple_of_ahnqiraj/boss_huhuran.cpp \ +scripts/zone/temple_of_ahnqiraj/boss_ouro.cpp \ +scripts/zone/temple_of_ahnqiraj/boss_sartura.cpp \ +scripts/zone/temple_of_ahnqiraj/boss_skeram.cpp \ +scripts/zone/temple_of_ahnqiraj/boss_twinemperors.cpp \ +scripts/zone/temple_of_ahnqiraj/boss_viscidus.cpp \ +scripts/zone/temple_of_ahnqiraj/def_temple_of_ahnqiraj.h \ +scripts/zone/temple_of_ahnqiraj/instance_temple_of_ahnqiraj.cpp \ +scripts/zone/temple_of_ahnqiraj/mob_anubisath_sentinel.cpp \ +scripts/zone/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/utgarde_keep/utgarde_keep/instance_utgarde_keep.cpp \ +scripts/zone/utgarde_keep/utgarde_keep/boss_keleseth.cpp \ +scripts/zone/utgarde_keep/utgarde_keep/boss_skarvald_dalronn.cpp \ +scripts/zone/utgarde_keep/utgarde_keep/boss_ingvar_the_plunderer.cpp \ +scripts/zone/utgarde_keep/utgarde_keep/utgarde_keep.cpp \ +scripts/zone/wailing_caverns/instance_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 \ +scripts/zone/zulaman/boss_janalai.cpp \ +scripts/zone/zulaman/boss_nalorakk.cpp \ +scripts/zone/zulaman/boss_zuljin.cpp \ +scripts/zone/zulaman/def_zulaman.h \ +scripts/zone/zulaman/instance_zulaman.cpp \ +scripts/zone/zulaman/zulaman.cpp \ +scripts/zone/zulfarrak/zulfarrak.cpp \ +scripts/zone/zulgurub/boss_arlokk.cpp \ +scripts/zone/zulgurub/boss_gahzranka.cpp \ +scripts/zone/zulgurub/boss_grilek.cpp \ +scripts/zone/zulgurub/boss_hakkar.cpp \ +scripts/zone/zulgurub/boss_hazzarah.cpp \ +scripts/zone/zulgurub/boss_jeklik.cpp \ +scripts/zone/zulgurub/boss_jindo.cpp \ +scripts/zone/zulgurub/boss_mandokir.cpp \ +scripts/zone/zulgurub/boss_marli.cpp \ +scripts/zone/zulgurub/boss_renataki.cpp \ +scripts/zone/zulgurub/boss_thekal.cpp \ +scripts/zone/zulgurub/boss_venoxis.cpp \ +scripts/zone/zulgurub/boss_wushoolay.cpp \ +scripts/zone/zulgurub/def_zulgurub.h \ +scripts/zone/zulgurub/instance_zulgurub.cpp \ +system.cpp + +## libtool settings +# API versioning +# Increase the last number, if you do bug fixes only, no interface change. +# Increase the middle number when you augmented the interface ( aka add new exported functions ). +# Increase the first number when you break old interface. ( aka remove/change previously exported functions ). +libtrinityscript_la_LIBFLAGS = -version-info 0:0:1 +libtrinityscript_la_LIBADD = $(MYSQL_LIBS) $(POSTGRE_LIBS) + +## Additional files to install +## sysconf_DATA = + +## EXTRA_DIST = + +## Prevend overwrite of the config file, if its already installed +install-data-hook: + @list='$(sysconf_DATA)'; for p in $$list; do \ + dest=`echo $$p | sed -e s/.dist//`; \ + if test -f $(DESTDIR)$(sysconfdir)/$$dest; then \ + echo "$@ will not overwrite existing $(DESTDIR)$(sysconfdir)/$$dest"; \ + else \ + echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(sysconfdir)/$$dest"; \ + $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(sysconfdir)/$$dest; \ + fi; \ + done + + + diff --git a/src/bindings/scripts/ScriptMgr.cpp b/src/bindings/scripts/ScriptMgr.cpp index 6b19bba23a9..e98ea3395cb 100644 --- a/src/bindings/scripts/ScriptMgr.cpp +++ b/src/bindings/scripts/ScriptMgr.cpp @@ -5,10 +5,9 @@ #include "precompiled.h" #include "Config/Config.h" #include "Database/DatabaseEnv.h" -#include "Database/DBCStores.h" +#include "DBCStores.h" #include "ObjectMgr.h" #include "ProgressBar.h" -#include "scripts/creature/mob_event_ai.h" #define _FULLVERSION "TrinityScript" @@ -16,7 +15,6 @@ # define _TRINITY_SCRIPT_CONFIG "trinitycore.conf" #endif _TRINITY_SCRIPT_CONFIG -//*** Global data *** int num_sc_scripts; Script *m_scripts[MAX_SCRIPTS]; @@ -32,36 +30,13 @@ struct StringTextData uint32 Emote; }; -// Enums used by StringTextData::Type -enum ChatType -{ - CHAT_TYPE_SAY = 0, - CHAT_TYPE_YELL = 1, - CHAT_TYPE_TEXT_EMOTE = 2, - CHAT_TYPE_BOSS_EMOTE = 3, - CHAT_TYPE_WHISPER = 4, - CHAT_TYPE_BOSS_WHISPER = 5, -}; - #define TEXT_SOURCE_RANGE -1000000 //the amount of entries each text source has available // Text Maps UNORDERED_MAP<int32, StringTextData> TextMap; -//*** End Global data *** - -//*** EventAI data *** -//Event AI structure. Used exclusivly by mob_event_ai.cpp (60 bytes each) -UNORDERED_MAP<uint32, std::vector<EventAI_Event> > EventAI_Event_Map; - -//Event AI summon structure. Used exclusivly by mob_event_ai.cpp. -UNORDERED_MAP<uint32, EventAI_Summon> EventAI_Summon_Map; - -//Event AI error prevention structure. Used at runtime to prevent error log spam of same creature id. -//UNORDERED_MAP<uint32, EventAI_CreatureError> EventAI_CreatureErrorPreventionList; - -uint32 EAI_ErrorLevel; -//*** End EventAI data *** +// Waypoint map (escorts) +UNORDERED_MAP<uint32, std::vector<PointMovement> > PointMovementMap; void FillSpellSummary(); void LoadOverridenSQLData(); @@ -78,13 +53,15 @@ extern void AddSC_boss_taerar(); extern void AddSC_boss_ysondre(); // -- Creature -- -extern void AddSC_mob_event(); extern void AddSC_generic_creature(); // -- Custom -- -extern void AddSC_custom_example(); -extern void AddSC_custom_gossip_codebox(); -extern void AddSC_test(); + +// -- Examples -- +extern void AddSC_example_creature(); +extern void AddSC_example_escort(); +extern void AddSC_example_gossip_codebox(); +extern void AddSC_example_misc(); // -- GO -- extern void AddSC_go_scripts(); @@ -96,11 +73,11 @@ extern void AddSC_guards(); // -- Item -- extern void AddSC_item_scripts(); -extern void AddSC_item_test(); // -- NPC -- extern void AddSC_npc_professions(); extern void AddSC_npcs_special(); +extern void AddSC_npc_taxi(); // -- Servers -- @@ -137,6 +114,11 @@ extern void AddSC_boss_grandmaster_vorpil(); extern void AddSC_boss_murmur(); extern void AddSC_instance_shadow_labyrinth(); +//Azjol-Nerub +//--Ahn'kahet +extern void AddSC_instance_ahnkahet(); +extern void AddSC_boss_elder_nadox(); + //Azshara extern void AddSC_boss_azuregos(); extern void AddSC_azshara(); @@ -211,6 +193,9 @@ extern void AddSC_blasted_lands(); //Bloodmyst Isle extern void AddSC_bloodmyst_isle(); +//Borean Tundra +extern void AddSC_borean_tundra(); + //Burning steppes extern void AddSC_burning_steppes(); @@ -269,6 +254,9 @@ extern void AddSC_instance_deadmines(); //Deadwind pass //Desolace //Dire Maul + +extern void AddSC_dragonblight(); + //Dun Morogh extern void AddSC_dun_morogh(); @@ -283,6 +271,7 @@ extern void AddSC_eversong_woods(); //Exodar //Eastern Plaguelands extern void AddSC_eastern_plaguelands(); +extern void AddSC_the_scarlet_enclave(); //Elwynn Forest extern void AddSC_elwynn_forest(); @@ -323,6 +312,7 @@ extern void AddSC_instance_shattered_halls(); extern void AddSC_boss_watchkeeper_gargolmar(); extern void AddSC_boss_omor_the_unscarred(); extern void AddSC_boss_vazruden_the_herald(); +extern void AddSC_instance_ramparts(); //Hellfire Peninsula extern void AddSC_boss_doomlordkazzak(); @@ -394,15 +384,19 @@ extern void AddSC_nagrand(); extern void AddSC_boss_anubrekhan(); extern void AddSC_boss_maexxna(); extern void AddSC_boss_patchwerk(); +extern void AddSC_boss_grobbulus(); extern void AddSC_boss_razuvious(); -extern void AddSC_boss_highlord_mograine(); extern void AddSC_boss_kelthuzad(); -extern void AddSC_boss_faerlina(); extern void AddSC_boss_loatheb(); extern void AddSC_boss_noth(); extern void AddSC_boss_gluth(); extern void AddSC_boss_sapphiron(); extern void AddSC_boss_four_horsemen(); +extern void AddSC_boss_faerlina(); +extern void AddSC_boss_heigan(); +extern void AddSC_boss_gothik(); +extern void AddSC_boss_thaddius(); +extern void AddSC_instance_naxxramas(); //Netherstorm extern void AddSC_netherstorm(); @@ -416,6 +410,7 @@ extern void AddSC_orgrimmar(); //Ragefire Chasm //Razorfen Downs extern void AddSC_boss_amnennar_the_coldbringer(); +extern void AddSC_razorfen_downs(); //Razorfen Kraul extern void AddSC_razorfen_kraul(); @@ -513,6 +508,8 @@ extern void AddSC_sunwell_plateau(); extern void AddSC_tanaris(); //Teldrassil + extern void AddSC_teldrassil(); + //Tempest Keep //--Arcatraz extern void AddSC_arcatraz(); @@ -574,6 +571,14 @@ extern void AddSC_undercity(); extern void AddSC_ungoro_crater(); //Upper blackrock spire + +//Utgarde Keep +extern void AddSC_boss_keleseth(); +extern void AddSC_boss_skarvald_dalronn(); +extern void AddSC_boss_ingvar_the_plunderer(); +extern void AddSC_instance_utgarde_keep(); +extern void AddSC_utgarde_keep(); + //Wailing caverns //Western plaguelands @@ -618,21 +623,29 @@ extern void AddSC_boss_zuljin(); extern void AddSC_instance_zulaman(); extern void AddSC_zulaman(); +//Northrend +//Dungeon +//Vault of Archavon +extern void AddSC_boss_archavon(); + +//Region +extern void AddSC_wintergrasp(); + // ------------------- void LoadDatabase() { //Get db string from file - char const* dbstring = NULL; + std::string dbstring = TScriptConfig.GetStringDefault("WorldDatabaseInfo", ""); - if (!TScriptConfig.GetString("WorldDatabaseInfo", &dbstring) ) + if (dbstring.empty() ) { error_log("TSCR: Missing world database info from configuration file. Load database aborted."); return; } //Initialize connection to DB - if (dbstring && TScriptDB.Initialize(dbstring) ) - outstring_log("TSCR: TrinityScript database: %s",dbstring); + if (!dbstring.empty() && TScriptDB.Initialize(dbstring.c_str()) ) + outstring_log("TSCR: TrinityScript database: %s",dbstring.c_str()); else { error_log("TSCR: Unable to connect to Database. Load database aborted."); @@ -661,72 +674,6 @@ void LoadDatabase() // Drop Existing Text Map, only done once and we are ready to add data from multiple sources. TextMap.clear(); - // Load EventAI Text - outstring_log("TSCR: Loading EventAI Texts..."); - LoadTrinityStrings(TScriptDB,"eventai_texts",-1,1+(TEXT_SOURCE_RANGE)); - - // Gather Additional data from EventAI Texts - //result = TScriptDB.PQuery("SELECT entry, sound, type, language, emote FROM eventai_texts"); - result = TScriptDB.PQuery("SELECT entry, sound, type, language FROM eventai_texts"); - - outstring_log("TSCR: Loading EventAI Texts additional data..."); - if (result) - { - barGoLink bar(result->GetRowCount()); - uint32 count = 0; - - do - { - bar.step(); - Field* fields = result->Fetch(); - StringTextData temp; - - int32 i = fields[0].GetInt32(); - temp.SoundId = fields[1].GetInt32(); - temp.Type = fields[2].GetInt32(); - temp.Language = fields[3].GetInt32(); - temp.Emote = 0;//fields[4].GetInt32(); - - if (i >= 0) - { - error_db_log("TSCR: Entry %i in table `eventai_texts` is not a negative value.",i); - continue; - } - - if (i <= TEXT_SOURCE_RANGE) - { - error_db_log("TSCR: Entry %i in table `eventai_texts` is out of accepted entry range for table.",i); - continue; - } - - if (temp.SoundId) - { - if (!GetSoundEntriesStore()->LookupEntry(temp.SoundId)) - error_db_log("TSCR: Entry %i in table `eventai_texts` has soundId %u but sound does not exist.",i,temp.SoundId); - } - - if (!GetLanguageDescByID(temp.Language)) - error_db_log("TSCR: Entry %i in table `eventai_texts` using Language %u but Language does not exist.",i,temp.Language); - - if (temp.Type > CHAT_TYPE_BOSS_WHISPER) - error_db_log("TSCR: Entry %i in table `eventai_texts` has Type %u but this Chat Type does not exist.",i,temp.Type); - - TextMap[i] = temp; - ++count; - } while (result->NextRow()); - - delete result; - - outstring_log(""); - outstring_log(">> TSCR: Loaded %u additional EventAI Texts data.", count); - }else - { - barGoLink bar(1); - bar.step(); - outstring_log(""); - outstring_log(">> Loaded 0 additional EventAI Texts data. DB table `eventai_texts` is empty."); - } - // Load Script Text outstring_log("TSCR: Loading Script Texts..."); LoadTrinityStrings(TScriptDB,"script_texts",TEXT_SOURCE_RANGE,1+(TEXT_SOURCE_RANGE*2)); @@ -773,7 +720,7 @@ void LoadDatabase() if (!GetLanguageDescByID(temp.Language)) error_db_log("TSCR: Entry %i in table `script_texts` using Language %u but Language does not exist.",i,temp.Language); - if (temp.Type > CHAT_TYPE_BOSS_WHISPER) + if (temp.Type > CHAT_TYPE_ZONE_YELL) error_db_log("TSCR: Entry %i in table `script_texts` has Type %u but this Chat Type does not exist.",i,temp.Type); TextMap[i] = temp; @@ -838,7 +785,7 @@ void LoadDatabase() if (!GetLanguageDescByID(temp.Language)) error_db_log("TSCR: Entry %i in table `custom_texts` using Language %u but Language does not exist.",i,temp.Language); - if (temp.Type > CHAT_TYPE_BOSS_WHISPER) + if (temp.Type > CHAT_TYPE_ZONE_YELL) error_db_log("TSCR: Entry %i in table `custom_texts` has Type %u but this Chat Type does not exist.",i,temp.Type); TextMap[i] = temp; @@ -857,455 +804,66 @@ void LoadDatabase() outstring_log(">> Loaded 0 additional Custom Texts data. DB table `custom_texts` is empty."); } - //Gather additional data for EventAI - result = TScriptDB.PQuery("SELECT id, position_x, position_y, position_z, orientation, spawntimesecs FROM eventai_summons"); + // Drop Existing Waypoint list + PointMovementMap.clear(); + uint64 uiCreatureCount = 0; - //Drop Existing EventSummon Map - EventAI_Summon_Map.clear(); - - outstring_log("TSCR: Loading EventAI Summons..."); + // Load Waypoints + result = TScriptDB.PQuery("SELECT COUNT(entry) FROM script_waypoint GROUP BY entry"); if (result) { - barGoLink bar(result->GetRowCount()); - uint32 Count = 0; - - do - { - bar.step(); - Field *fields = result->Fetch(); - - EventAI_Summon temp; - - uint32 i = fields[0].GetUInt32(); - temp.position_x = fields[1].GetFloat(); - temp.position_y = fields[2].GetFloat(); - temp.position_z = fields[3].GetFloat(); - temp.orientation = fields[4].GetFloat(); - temp.SpawnTimeSecs = fields[5].GetUInt32(); - - //Add to map - EventAI_Summon_Map[i] = temp; - ++Count; - }while (result->NextRow()); - + uiCreatureCount = result->GetRowCount(); delete result; - - outstring_log(""); - outstring_log(">> Loaded %u EventAI summon definitions", Count); - }else - { - barGoLink bar(1); - bar.step(); - outstring_log(""); - outstring_log(">> Loaded 0 EventAI Summon definitions. DB table `eventai_summons` is empty."); } - //Gather event data - result = TScriptDB.PQuery("SELECT id, creature_id, event_type, event_inverse_phase_mask, event_chance, event_flags, " - "event_param1, event_param2, event_param3, event_param4, " - "action1_type, action1_param1, action1_param2, action1_param3, " - "action2_type, action2_param1, action2_param2, action2_param3, " - "action3_type, action3_param1, action3_param2, action3_param3 " - "FROM eventai_scripts"); + outstring_log("TSCR: Loading Script Waypoints for %u creature(s)...", uiCreatureCount); - //Drop Existing EventAI List - EventAI_Event_Map.clear(); + result = TScriptDB.PQuery("SELECT entry, pointid, location_x, location_y, location_z, waittime FROM script_waypoint ORDER BY pointid"); - outstring_log("TSCR: Loading EventAI scripts..."); if (result) { barGoLink bar(result->GetRowCount()); - uint32 Count = 0; + uint32 uiNodeCount = 0; do { bar.step(); - Field *fields = result->Fetch(); - - EventAI_Event temp; - - temp.event_id = fields[0].GetUInt32(); - uint32 i = temp.event_id; - temp.creature_id = fields[1].GetUInt32(); - uint32 creature_id = temp.creature_id; - temp.event_type = fields[2].GetUInt16(); - temp.event_inverse_phase_mask = fields[3].GetUInt32(); - temp.event_chance = fields[4].GetUInt8(); - temp.event_flags = fields[5].GetUInt8(); - temp.event_param1 = fields[6].GetUInt32(); - temp.event_param2 = fields[7].GetUInt32(); - temp.event_param3 = fields[8].GetUInt32(); - temp.event_param4 = fields[9].GetUInt32(); - - //Creature does not exist in database - if (!GetCreatureTemplateStore(temp.creature_id)) - error_db_log("TSCR: Event %u has script for non-existing creature.", i); - - //Report any errors in event - if (temp.event_type >= EVENT_T_END) - error_db_log("TSCR: Event %u has incorrect event type. Maybe DB requires updated version of SD2.", i); - - //No chance of this event occuring - if (temp.event_chance == 0) - error_db_log("TSCR: Event %u has 0 percent chance. Event will never trigger!", i); - - //Chance above 100, force it to be 100 - if (temp.event_chance > 100) + Field* pFields = result->Fetch(); + PointMovement pTemp; + + pTemp.m_uiCreatureEntry = pFields[0].GetUInt32(); + uint32 uiCreatureEntry = pTemp.m_uiCreatureEntry; + pTemp.m_uiPointId = pFields[1].GetUInt32(); + pTemp.m_fX = pFields[2].GetFloat(); + pTemp.m_fY = pFields[3].GetFloat(); + pTemp.m_fZ = pFields[4].GetFloat(); + pTemp.m_uiWaitTime = pFields[5].GetUInt32(); + + CreatureInfo const* pCInfo = GetCreatureTemplateStore(pTemp.m_uiCreatureEntry); + if (!pCInfo) { - error_db_log("TSCR: Creature %u are using event %u with more than 100 percent chance. Adjusting to 100 percent.", temp.creature_id, i); - temp.event_chance = 100; - } - - //Individual event checks - switch (temp.event_type) - { - case EVENT_T_HP: - case EVENT_T_MANA: - case EVENT_T_TARGET_HP: - { - if (temp.event_param2 > 100) - error_db_log("TSCR: Creature %u are using percentage event(%u) with param2 (MinPercent) > 100. Event will never trigger! ", temp.creature_id, i); - - if (temp.event_param1 <= temp.event_param2) - error_db_log("TSCR: Creature %u are using percentage event(%u) with param1 <= param2 (MaxPercent <= MinPercent). Event will never trigger! ", temp.creature_id, i); - - if (temp.event_flags & EFLAG_REPEATABLE && !temp.event_param3 && !temp.event_param4) - { - error_db_log("TSCR: Creature %u has param3 and param4=0 (RepeatMin/RepeatMax) but cannot be repeatable without timers. Removing EFLAG_REPEATABLE for event %u.", temp.creature_id, i); - temp.event_flags &= ~EFLAG_REPEATABLE; - } - } - break; - - case EVENT_T_SPELLHIT: - { - if (temp.event_param1) - { - SpellEntry const* pSpell = GetSpellStore()->LookupEntry(temp.event_param1); - if (!pSpell) - { - error_db_log("TSCR: Creature %u has non-existant SpellID(%u) defined in event %u.", temp.creature_id, temp.event_param1, i); - continue; - } - - if (temp.event_param2_s != -1 && temp.event_param2 != pSpell->SchoolMask) - error_db_log("TSCR: Creature %u has param1(spellId %u) but param2 is not -1 and not equal to spell's school mask. Event %u can never trigger.", temp.creature_id, temp.event_param1, i); - } - - //TODO: fix this system with SPELL_SCHOOL_MASK. Current complicate things, using int32(-1) instead of just 0 - //SPELL_SCHOOL_MASK_NONE = 0 and does not exist, thus it can not ever trigger or be used in SpellHit() - if (temp.event_param2_s != -1 && temp.event_param2_s > SPELL_SCHOOL_MASK_ALL) - error_db_log("TSCR: Creature %u is using invalid SpellSchoolMask(%u) defined in event %u.", temp.creature_id, temp.event_param2, i); - - if (temp.event_param4 < temp.event_param3) - error_db_log("TSCR: Creature %u are using repeatable event(%u) with param4 < param3 (RepeatMax < RepeatMin). Event will never repeat.", temp.creature_id, i); - } - break; - - case EVENT_T_RANGE: - case EVENT_T_OOC_LOS: - case EVENT_T_FRIENDLY_HP: - case EVENT_T_FRIENDLY_IS_CC: - case EVENT_T_FRIENDLY_MISSING_BUFF: - { - if (temp.event_param4 < temp.event_param3) - error_db_log("TSCR: Creature %u are using repeatable event(%u) with param4 < param3 (RepeatMax < RepeatMin). Event will never repeat.", temp.creature_id, i); - } - break; - - case EVENT_T_TIMER: - case EVENT_T_TIMER_OOC: - { - if (temp.event_param2 < temp.event_param1) - error_db_log("TSCR: Creature %u are using timed event(%u) with param2 < param1 (InitialMax < InitialMin). Event will never repeat.", temp.creature_id, i); - - if (temp.event_param4 < temp.event_param3) - error_db_log("TSCR: Creature %u are using repeatable event(%u) with param4 < param3 (RepeatMax < RepeatMin). Event will never repeat.", temp.creature_id, i); - } - break; - - case EVENT_T_KILL: - case EVENT_T_TARGET_CASTING: - { - if (temp.event_param2 < temp.event_param1) - error_db_log("TSCR: Creature %u are using event(%u) with param2 < param1 (RepeatMax < RepeatMin). Event will never repeat.", temp.creature_id, i); - } - break; - - case EVENT_T_AGGRO: - case EVENT_T_DEATH: - case EVENT_T_EVADE: - case EVENT_T_SPAWNED: - case EVENT_T_REACHED_HOME: - { - if (temp.event_flags & EFLAG_REPEATABLE) - { - error_db_log("TSCR: Creature %u has EFLAG_REPEATABLE set. Event can never be repeatable. Removing flag for event %u.", temp.creature_id, i); - temp.event_flags &= ~EFLAG_REPEATABLE; - } - } - break; - } - - for (uint32 j = 0; j < MAX_ACTIONS; j++) - { - temp.action[j].type = fields[10+(j*4)].GetUInt16(); - temp.action[j].param1 = fields[11+(j*4)].GetUInt32(); - temp.action[j].param2 = fields[12+(j*4)].GetUInt32(); - temp.action[j].param3 = fields[13+(j*4)].GetUInt32(); - - //Report any errors in actions - switch (temp.action[j].type) - { - case ACTION_T_TEXT: - { - if (temp.action[j].param1_s < 0) - { - if (TextMap.find(temp.action[j].param1_s) == TextMap.end()) - error_db_log("TSCR: Event %u Action %u param1 refrences non-existing entry in texts table.", i, j+1); - } - if (temp.action[j].param2_s < 0) - { - if (TextMap.find(temp.action[j].param2_s) == TextMap.end()) - error_db_log("TSCR: Event %u Action %u param2 refrences non-existing entry in texts table.", i, j+1); - - if (!temp.action[j].param1_s) - error_db_log("TSCR: Event %u Action %u has param2, but param1 is not set. Required for randomized text.", i, j+1); - } - if (temp.action[j].param3_s < 0) - { - if (TextMap.find(temp.action[j].param3_s) == TextMap.end()) - error_db_log("TSCR: Event %u Action %u param3 refrences non-existing entry in texts table.", i, j+1); - - if (!temp.action[j].param1_s || !temp.action[j].param2_s) - error_db_log("TSCR: Event %u Action %u has param3, but param1 and/or param2 is not set. Required for randomized text.", i, j+1); - } - } - break; - case ACTION_T_SET_FACTION: - /*if (temp.action[j].param1 !=0 && !GetFactionStore()->LookupEntry(temp.action[j].param1)) - { - error_db_log("TSCR: Event %u Action %u uses non-existant FactionId %u.", i, j+1, temp.action[j].param1); - temp.action[j].param1 = 0; - }*/ - break; - case ACTION_T_MORPH_TO_ENTRY_OR_MODEL: - if (temp.action[j].param1 !=0 || temp.action[j].param2 !=0) - { - if (temp.action[j].param1 && !GetCreatureTemplateStore(temp.action[j].param1)) - { - error_db_log("TSCR: Event %u Action %u uses non-existant Creature entry %u.", i, j+1, temp.action[j].param1); - temp.action[j].param1 = 0; - } - - /*if (temp.action[j].param2 && !GetCreatureDisplayStore()->LookupEntry(temp.action[j].param2)) - { - error_db_log("TSCR: Event %u Action %u uses non-existant ModelId %u.", i, j+1, temp.action[j].param2); - temp.action[j].param2 = 0; - }*/ - } - break; - case ACTION_T_SOUND: - if (!GetSoundEntriesStore()->LookupEntry(temp.action[j].param1)) - error_db_log("TSCR: Event %u Action %u uses non-existant SoundID %u.", i, j+1, temp.action[j].param1); - break; - - /*case ACTION_T_RANDOM_SOUND: - { - if(!GetSoundEntriesStore()->LookupEntry(temp.action[j].param1)) - error_db_log("TSCR: Event %u Action %u param1 uses non-existant SoundID %u.", i, j+1, temp.action[j].param1); - if(!GetSoundEntriesStore()->LookupEntry(temp.action[j].param2)) - error_db_log("TSCR: Event %u Action %u param2 uses non-existant SoundID %u.", i, j+1, temp.action[j].param2); - if(!GetSoundEntriesStore()->LookupEntry(temp.action[j].param3)) - error_db_log("TSCR: Event %u Action %u param3 uses non-existant SoundID %u.", i, j+1, temp.action[j].param3); - } - break;*/ - - case ACTION_T_CAST: - { - const SpellEntry *spell = GetSpellStore()->LookupEntry(temp.action[j].param1); - if (!spell) - error_db_log("TSCR: Event %u Action %u uses non-existant SpellID %u.", i, j+1, temp.action[j].param1); - else - { - if (spell->RecoveryTime > 0 && temp.event_flags & EFLAG_REPEATABLE) - { - //output as debug for now, also because there's no general rule all spells have RecoveryTime - if (temp.event_param3 < spell->RecoveryTime) - debug_log("TSCR: Event %u Action %u uses SpellID %u but cooldown is longer(%u) than minumum defined in event param3(%u).", i, j+1,temp.action[j].param1, spell->RecoveryTime, temp.event_param3); - } - } - - if (temp.action[j].param2 >= TARGET_T_END) - error_db_log("TSCR: Event %u Action %u uses incorrect Target type", i, j+1); - } - break; - - case ACTION_T_REMOVEAURASFROMSPELL: - { - if (!GetSpellStore()->LookupEntry(temp.action[j].param2)) - error_db_log("TSCR: Event %u Action %u uses non-existant SpellID %u.", i, j+1, temp.action[j].param2); - - if (temp.action[j].param1 >= TARGET_T_END) - error_db_log("TSCR: Event %u Action %u uses incorrect Target type", i, j+1); - } - break; - case ACTION_T_QUEST_EVENT: - { - if (Quest const* qid = GetQuestTemplateStore(temp.action[j].param1)) - { - if (!qid->HasFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT)) - error_db_log("TSCR: Event %u Action %u. SpecialFlags for quest entry %u does not include |2, Action will not have any effect.", i, j+1, temp.action[j].param1); - } - else - error_db_log("TSCR: Event %u Action %u uses non-existant Quest entry %u.", i, j+1, temp.action[j].param1); - - if (temp.action[j].param2 >= TARGET_T_END) - error_db_log("TSCR: Event %u Action %u uses incorrect Target type", i, j+1); - } - break; - case ACTION_T_QUEST_EVENT_ALL: - { - if (Quest const* qid = GetQuestTemplateStore(temp.action[j].param1)) - { - if (!qid->HasFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT)) - error_db_log("TSCR: Event %u Action %u. SpecialFlags for quest entry %u does not include |2, Action will not have any effect.", i, j+1, temp.action[j].param1); - } - else - error_db_log("TSCR: Event %u Action %u uses non-existant Quest entry %u.", i, j+1, temp.action[j].param1); - } - break; - case ACTION_T_CASTCREATUREGO: - { - if (!GetCreatureTemplateStore(temp.action[j].param1)) - error_db_log("TSCR: Event %u Action %u uses non-existant creature entry %u.", i, j+1, temp.action[j].param1); - - if (!GetSpellStore()->LookupEntry(temp.action[j].param2)) - error_db_log("TSCR: Event %u Action %u uses non-existant SpellID %u.", i, j+1, temp.action[j].param2); - - if (temp.action[j].param3 >= TARGET_T_END) - error_db_log("TSCR: Event %u Action %u uses incorrect Target type", i, j+1); - } - break; - case ACTION_T_CASTCREATUREGO_ALL: - { - if (!GetQuestTemplateStore(temp.action[j].param1)) - error_db_log("TSCR: Event %u Action %u uses non-existant Quest entry %u.", i, j+1, temp.action[j].param1); - - if (!GetSpellStore()->LookupEntry(temp.action[j].param2)) - error_db_log("TSCR: Event %u Action %u uses non-existant SpellID %u.", i, j+1, temp.action[j].param2); - } - break; - - //2nd param target - case ACTION_T_SUMMON_ID: - { - if (!GetCreatureTemplateStore(temp.action[j].param1)) - error_db_log("TSCR: Event %u Action %u uses non-existant creature entry %u.", i, j+1, temp.action[j].param1); - - if (EventAI_Summon_Map.find(temp.action[j].param3) == EventAI_Summon_Map.end()) - error_db_log("TSCR: Event %u Action %u summons missing EventAI_Summon %u", i, j+1, temp.action[j].param3); - - if (temp.action[j].param2 >= TARGET_T_END) - error_db_log("TSCR: Event %u Action %u uses incorrect Target type", i, j+1); - } - break; - case ACTION_T_KILLED_MONSTER: - { - if (!GetCreatureTemplateStore(temp.action[j].param1)) - error_db_log("TSCR: Event %u Action %u uses non-existant creature entry %u.", i, j+1, temp.action[j].param1); - - if (temp.action[j].param2 >= TARGET_T_END) - error_db_log("TSCR: Event %u Action %u uses incorrect Target type", i, j+1); - } - break; - case ACTION_T_SUMMON: - { - if (!GetCreatureTemplateStore(temp.action[j].param1)) - error_db_log("TSCR: Event %u Action %u uses non-existant creature entry %u.", i, j+1, temp.action[j].param1); - - if (temp.action[j].param2 >= TARGET_T_END) - error_db_log("TSCR: Event %u Action %u uses incorrect Target type", i, j+1); - } - break; - case ACTION_T_THREAT_SINGLE_PCT: - case ACTION_T_SET_UNIT_FLAG: - case ACTION_T_REMOVE_UNIT_FLAG: - if (temp.action[j].param2 >= TARGET_T_END) - error_db_log("TSCR: Event %u Action %u uses incorrect Target type", i, j+1); - break; - - //3rd param target - case ACTION_T_SET_UNIT_FIELD: - if (temp.action[j].param1 < OBJECT_END || temp.action[j].param1 >= UNIT_END) - error_db_log("TSCR: Event %u Action %u param1 (UNIT_FIELD*). Index out of range for intended use.", i, j+1); - if (temp.action[j].param3 >= TARGET_T_END) - error_db_log("TSCR: Event %u Action %u uses incorrect Target type", i, j+1); - break; - - case ACTION_T_SET_PHASE: - if (temp.action[j].param1 > 31) - error_db_log("TSCR: Event %u Action %u attempts to set phase > 31. Phase mask cannot be used past phase 31.", i, j+1); - break; - - case ACTION_T_INC_PHASE: - if (!temp.action[j].param1) - error_db_log("TSCR: Event %u Action %u is incrementing phase by 0. Was this intended?", i, j+1); - break; - - case ACTION_T_SET_INST_DATA: - { - if (!(temp.event_flags & EFLAG_NORMAL) && !(temp.event_flags & EFLAG_HEROIC)) - error_db_log("TSCR: Event %u Action %u. Cannot set instance data without event flags (normal/heroic).", i, j+1); - - if (temp.action[j].param2 > SPECIAL) - error_db_log("TSCR: Event %u Action %u attempts to set instance data above encounter state 4. Custom case?", i, j+1); - } - break; - case ACTION_T_SET_INST_DATA64: - { - if (!(temp.event_flags & EFLAG_NORMAL) && !(temp.event_flags & EFLAG_HEROIC)) - error_db_log("TSCR: Event %u Action %u. Cannot set instance data without event flags (normal/heroic).", i, j+1); - - if (temp.action[j].param2 >= TARGET_T_END) - error_db_log("TSCR: Event %u Action %u uses incorrect Target type", i, j+1); - } - break; - case ACTION_T_UPDATE_TEMPLATE: - { - if (!GetCreatureTemplateStore(temp.action[j].param1)) - error_db_log("TSCR: Event %u Action %u uses non-existant creature entry %u.", i, j+1, temp.action[j].param1); - } - break; - case ACTION_T_RANDOM_SAY: - case ACTION_T_RANDOM_YELL: - case ACTION_T_RANDOM_TEXTEMOTE: - error_db_log("TSCR: Event %u Action %u currently unused ACTION type. Did you forget to update database?", i, j+1); - break; - - default: - if (temp.action[j].type >= ACTION_T_END) - error_db_log("TSCR: Event %u Action %u has incorrect action type. Maybe DB requires updated version of SD2.", i, j+1); - break; - } + error_db_log("TSCR: DB table script_waypoint has waypoint for non-existant creature entry %u", pTemp.m_uiCreatureEntry); + continue; } - //Add to list - EventAI_Event_Map[creature_id].push_back(temp); + if (!pCInfo->ScriptID) + error_db_log("TSCR: DB table script_waypoint has waypoint for creature entry %u, but creature does not have ScriptName defined and then useless.", pTemp.m_uiCreatureEntry); - ++Count; + PointMovementMap[uiCreatureEntry].push_back(pTemp); + ++uiNodeCount; } while (result->NextRow()); delete result; outstring_log(""); - outstring_log(">> Loaded %u EventAI scripts", Count); - }else + outstring_log(">> Loaded %u Script Waypoint nodes.", uiNodeCount); + } + else { barGoLink bar(1); bar.step(); outstring_log(""); - outstring_log(">> Loaded 0 EventAI scripts. DB table `eventai_scripts` is empty."); + outstring_log(">> Loaded 0 Script Waypoints. DB table `script_waypoint` is empty."); } //Free database thread and resources @@ -1325,7 +883,7 @@ void ScriptsFree() delete []SpellSummary; // Free resources before library unload - for(int i=0;i<num_sc_scripts;i++) + for(int i=0;i<MAX_SCRIPTS;i++) delete m_scripts[i]; num_sc_scripts = 0; @@ -1354,25 +912,6 @@ void ScriptsInit(char const* cfg_file = "trinitycore.conf") } else outstring_log("TSCR: Using configuration file %s",cfg_file); - EAI_ErrorLevel = TScriptConfig.GetIntDefault("EAIErrorLevel", 1); - - switch (EAI_ErrorLevel) - { - case 0: - outstring_log("TSCR: EventAI Error Reporting level set to 0 (Startup Errors only)"); - break; - case 1: - outstring_log("TSCR: EventAI Error Reporting level set to 1 (Startup errors and Runtime event errors)"); - break; - case 2: - outstring_log("TSCR: EventAI Error Reporting level set to 2 (Startup errors, Runtime event errors, and Creation errors)"); - break; - default: - outstring_log("TSCR: Unknown EventAI Error Reporting level. Defaulting to 1 (Startup errors and Runtime event errors)"); - EAI_ErrorLevel = 1; - break; - } - outstring_log(""); //Load database (must be called after TScriptConfig.SetSource). In case it failed, no need to even try load. @@ -1400,13 +939,15 @@ void ScriptsInit(char const* cfg_file = "trinitycore.conf") AddSC_boss_ysondre(); // -- Creature -- - AddSC_mob_event(); AddSC_generic_creature(); // -- Custom -- - AddSC_custom_example(); - AddSC_custom_gossip_codebox(); - AddSC_test(); + + // -- Examples -- + AddSC_example_creature(); + AddSC_example_escort(); + AddSC_example_gossip_codebox(); + AddSC_example_misc(); // -- GO -- AddSC_go_scripts(); @@ -1418,11 +959,11 @@ void ScriptsInit(char const* cfg_file = "trinitycore.conf") // -- Item -- AddSC_item_scripts(); - AddSC_item_test(); // -- NPC -- AddSC_npc_professions(); AddSC_npcs_special(); + AddSC_npc_taxi(); // -- Servers -- @@ -1459,6 +1000,11 @@ void ScriptsInit(char const* cfg_file = "trinitycore.conf") AddSC_boss_murmur(); AddSC_instance_shadow_labyrinth(); + //Azjol-Nerub + //--Ahn'kahet + AddSC_instance_ahnkahet(); + AddSC_boss_elder_nadox(); + //Azshara AddSC_boss_azuregos(); AddSC_azshara(); @@ -1533,6 +1079,9 @@ void ScriptsInit(char const* cfg_file = "trinitycore.conf") //Bloodmyst Isle AddSC_bloodmyst_isle(); + //Borean Tundra + AddSC_borean_tundra(); + //Burning steppes AddSC_burning_steppes(); @@ -1590,6 +1139,9 @@ void ScriptsInit(char const* cfg_file = "trinitycore.conf") //Deadwind pass //Desolace //Dire Maul + + AddSC_dragonblight(); + //Dun Morogh AddSC_dun_morogh(); @@ -1604,6 +1156,7 @@ void ScriptsInit(char const* cfg_file = "trinitycore.conf") //Exodar //Eastern Plaguelands AddSC_eastern_plaguelands(); + AddSC_the_scarlet_enclave(); //Elwynn Forest AddSC_elwynn_forest(); @@ -1644,6 +1197,7 @@ void ScriptsInit(char const* cfg_file = "trinitycore.conf") AddSC_boss_watchkeeper_gargolmar(); AddSC_boss_omor_the_unscarred(); AddSC_boss_vazruden_the_herald(); + AddSC_instance_ramparts(); //Hellfire Peninsula AddSC_boss_doomlordkazzak(); @@ -1713,17 +1267,21 @@ void ScriptsInit(char const* cfg_file = "trinitycore.conf") //Naxxramas AddSC_boss_anubrekhan(); + AddSC_boss_faerlina(); AddSC_boss_maexxna(); AddSC_boss_patchwerk(); + AddSC_boss_grobbulus(); AddSC_boss_razuvious(); - AddSC_boss_highlord_mograine(); AddSC_boss_kelthuzad(); - AddSC_boss_faerlina(); AddSC_boss_loatheb(); AddSC_boss_noth(); AddSC_boss_gluth(); AddSC_boss_sapphiron(); AddSC_boss_four_horsemen(); + AddSC_boss_heigan(); + AddSC_boss_gothik(); + AddSC_boss_thaddius(); + AddSC_instance_naxxramas(); //Netherstorm AddSC_netherstorm(); @@ -1737,6 +1295,7 @@ void ScriptsInit(char const* cfg_file = "trinitycore.conf") //Ragefire Chasm //Razorfen Downs AddSC_boss_amnennar_the_coldbringer(); + AddSC_razorfen_downs(); //Razorfen Kraul AddSC_razorfen_kraul(); @@ -1834,6 +1393,8 @@ void ScriptsInit(char const* cfg_file = "trinitycore.conf") AddSC_tanaris(); //Teldrassil + AddSC_teldrassil(); + //Tempest Keep //--Arcatraz AddSC_arcatraz(); @@ -1895,6 +1456,14 @@ void ScriptsInit(char const* cfg_file = "trinitycore.conf") AddSC_ungoro_crater(); //Upper blackrock spire + + //Utgarde Keep + AddSC_boss_keleseth(); + AddSC_boss_skarvald_dalronn(); + AddSC_boss_ingvar_the_plunderer(); + AddSC_instance_utgarde_keep(); + AddSC_utgarde_keep(); + //Wailing caverns //Western plaguelands @@ -1939,6 +1508,14 @@ void ScriptsInit(char const* cfg_file = "trinitycore.conf") AddSC_instance_zulaman(); AddSC_zulaman(); + //Northrend + //Dungeon + //Vault of Archavon + AddSC_boss_archavon(); + + //Region + AddSC_wintergrasp(); + // ------------------- outstring_log(">> Loaded %i C++ Scripts.", num_sc_scripts); @@ -2022,6 +1599,9 @@ void DoScriptText(int32 textEntry, WorldObject* pSource, Unit* target) pSource->MonsterWhisper(textEntry, target->GetGUID(), true); else error_log("TSCR: DoScriptText entry %i cannot whisper without target unit (TYPEID_PLAYER).", textEntry); }break; + case CHAT_TYPE_ZONE_YELL: + pSource->MonsterYellToZone(textEntry, (*i).second.Language, target ? target->GetGUID() : 0); + break; } } @@ -2036,8 +1616,11 @@ void Script::RegisterSelf() m_scripts[id] = this; ++num_sc_scripts; } - else + else if(Name.find("example") == std::string::npos) + { error_db_log("CRASH ALERT! TrinityScript: RegisterSelf, but script named %s does not have ScriptName assigned in database.",(this)->Name.c_str()); + delete this; + } } //******************************** @@ -2248,12 +1831,34 @@ bool ItemUse( Player *player, Item* _Item, SpellCastTargets const& targets) } TRINITY_DLL_EXPORT -bool ReceiveEmote( Player *player, Creature *_Creature, uint32 emote ) +bool EffectDummyCreature(Unit *caster, uint32 spellId, uint32 effIndex, Creature *crTarget ) { - Script *tmpscript = m_scripts[_Creature->GetScriptId()]; - if (!tmpscript || !tmpscript->pReceiveEmote) return false; + Script *tmpscript = m_scripts[crTarget->GetScriptId()]; + + if (!tmpscript || !tmpscript->pEffectDummyCreature) return false; + + return tmpscript->pEffectDummyCreature(caster, spellId,effIndex,crTarget); +} + +TRINITY_DLL_EXPORT +bool EffectDummyGameObj(Unit *caster, uint32 spellId, uint32 effIndex, GameObject *gameObjTarget ) +{ + Script *tmpscript = m_scripts[gameObjTarget->GetGOInfo()->ScriptId]; + + if (!tmpscript || !tmpscript->pEffectDummyGameObj) return false; + + return tmpscript->pEffectDummyGameObj(caster, spellId,effIndex,gameObjTarget); +} + + +TRINITY_DLL_EXPORT +bool EffectDummyItem(Unit *caster, uint32 spellId, uint32 effIndex, Item *itemTarget ) +{ + Script *tmpscript = m_scripts[itemTarget->GetProto()->ScriptId]; + + if (!tmpscript || !tmpscript->pEffectDummyItem) return false; - return tmpscript->pReceiveEmote(player, _Creature, emote); + return tmpscript->pEffectDummyItem(caster, spellId,effIndex,itemTarget); } TRINITY_DLL_EXPORT diff --git a/src/bindings/scripts/ScriptMgr.h b/src/bindings/scripts/ScriptMgr.h index 87a557779a2..719cf7932e9 100644 --- a/src/bindings/scripts/ScriptMgr.h +++ b/src/bindings/scripts/ScriptMgr.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2008 Trinity <http://www.trinitycore.org/> +/* Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/> * * Thanks to the original authors: ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * @@ -10,7 +10,7 @@ #include "Common.h" #include "Platform/CompilerDefs.h" -#include "Database/DBCStructure.h" +#include "DBCStructure.h" class Player; class Creature; @@ -32,9 +32,11 @@ struct Script { Script() : pGossipHello(NULL), pQuestAccept(NULL), pGossipSelect(NULL), pGossipSelectWithCode(NULL), - pQuestSelect(NULL), pQuestComplete(NULL), pNPCDialogStatus(NULL), pGODialogStatus(NULL), pChooseReward(NULL), - pItemHello(NULL), pGOHello(NULL), pAreaTrigger(NULL), pItemQuestAccept(NULL), pGOQuestAccept(NULL), - pGOChooseReward(NULL),pReceiveEmote(NULL),pItemUse(NULL), GetAI(NULL), GetInstanceData(NULL) + pQuestSelect(NULL), pQuestComplete(NULL), pNPCDialogStatus(NULL), pGODialogStatus(NULL), + pChooseReward(NULL), pItemHello(NULL), pGOHello(NULL), pAreaTrigger(NULL), pItemQuestAccept(NULL), + pGOQuestAccept(NULL), pGOChooseReward(NULL),pItemUse(NULL), + pEffectDummyCreature(NULL), pEffectDummyGameObj(NULL), pEffectDummyItem(NULL), + GetAI(NULL), GetInstanceData(NULL) {} std::string Name; @@ -57,8 +59,10 @@ struct Script bool (*pItemQuestAccept )(Player*, Item *, Quest const* ); bool (*pGOQuestAccept )(Player*, GameObject*, Quest const* ); bool (*pGOChooseReward )(Player*, GameObject*, Quest const*, uint32 ); - bool (*pReceiveEmote )(Player*, Creature*, uint32 ); bool (*pItemUse )(Player*, Item*, SpellCastTargets const& ); + bool (*pEffectDummyCreature )(Unit*, uint32, uint32, Creature* ); + bool (*pEffectDummyGameObj )(Unit*, uint32, uint32, GameObject* ); + bool (*pEffectDummyItem )(Unit*, uint32, uint32, Item* ); CreatureAI* (*GetAI)(Creature*); InstanceData* (*GetInstanceData)(Map*); diff --git a/src/bindings/scripts/VC71/71ScriptDev2.vcproj b/src/bindings/scripts/VC71/71ScriptDev2.vcproj deleted file mode 100644 index e92d43e61c2..00000000000 --- a/src/bindings/scripts/VC71/71ScriptDev2.vcproj +++ /dev/null @@ -1,2274 +0,0 @@ -<?xml version="1.0" encoding="windows-1251"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="7,10" - Name="TrinityScript" - ProjectGUID="{4295C8A9-79B7-4354-8064-F05FB9CA0C96}" - RootNamespace="ScriptDev2" - Keyword="Win32Proj" - TargetFrameworkVersion="131072" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - </ToolFiles> - <Configurations> - <Configuration - Name="Debug|Win32" - OutputDirectory="..\..\..\..\bin\$(PlatformName)_$(ConfigurationName)" - IntermediateDirectory=".\ScriptDev2__$(PlatformName)_$(ConfigurationName)" - ConfigurationType="2" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - AdditionalIncludeDirectories="..\..\..\..\dep\include\;..\..\..\shared\;..\..\..\framework\;..\..\..\game\;..\include\;..\..\..\..\dep\ACE_wrappers" - PreprocessorDefinitions="WIN32;_DEBUG;MANGOS_DEBUG;_WINDOWS;_USRDLL;SCRIPT" - MinimalRebuild="true" - BasicRuntimeChecks="3" - RuntimeLibrary="3" - UsePrecompiledHeader="2" - PrecompiledHeaderThrough="precompiled.h" - WarningLevel="3" - Detect64BitPortabilityProblems="true" - DebugInformationFormat="4" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - AdditionalDependencies="trinitycore.lib zthread.lib" - OutputFile="$(OutDir)/TrinityScript.dll" - LinkIncremental="2" - AdditionalLibraryDirectories="..\..\..\..\win\VC71\zthread__$(PlatformName)_$(ConfigurationName);..\..\..\..\win\VC71\trinitycore__$(PlatformName)_$(ConfigurationName)" - GenerateDebugInformation="true" - ProgramDatabaseFile="$(OutDir)/MaNGOSScript.pdb" - SubSystem="2" - RandomizedBaseAddress="1" - DataExecutionPrevention="0" - ImportLibrary="$(OutDir)/TrinityScript.lib" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Release|Win32" - OutputDirectory="..\..\..\..\bin\$(PlatformName)_$(ConfigurationName)" - IntermediateDirectory=".\ScriptDev2__$(PlatformName)_$(ConfigurationName)" - ConfigurationType="2" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="..\..\..\..\dep\include\;..\..\..\shared\;..\..\..\framework\;..\..\..\game\;..\include\;..\..\..\..\dep\ACE_wrappers" - PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;SCRIPT" - RuntimeLibrary="2" - EnableEnhancedInstructionSet="1" - UsePrecompiledHeader="2" - PrecompiledHeaderThrough="precompiled.h" - WarningLevel="3" - Detect64BitPortabilityProblems="true" - DebugInformationFormat="3" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - AdditionalDependencies="trinitycore.lib zthread.lib" - OutputFile="$(OutDir)/TrinityScript.dll" - LinkIncremental="1" - AdditionalLibraryDirectories="..\..\..\..\win\VC71\zthread__$(PlatformName)_$(ConfigurationName);..\..\..\..\win\VC71\trinitycore__$(PlatformName)_$(ConfigurationName)" - GenerateDebugInformation="false" - SubSystem="2" - OptimizeReferences="2" - EnableCOMDATFolding="2" - RandomizedBaseAddress="1" - DataExecutionPrevention="0" - ImportLibrary="$(OutDir)/TrinityScript.lib" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <Filter - Name="Scripts" - > - <Filter - Name="boss" - > - <File - RelativePath="..\scripts\boss\boss_emeriss.cpp" - > - </File> - <File - RelativePath="..\scripts\boss\boss_lethon.cpp" - > - </File> - <File - RelativePath="..\scripts\boss\boss_taerar.cpp" - > - </File> - <File - RelativePath="..\scripts\boss\boss_ysondre.cpp" - > - </File> - </Filter> - <Filter - Name="creature" - > - <File - RelativePath="..\scripts\creature\mob_event_ai.cpp" - > - </File> - <File - RelativePath="..\scripts\creature\mob_event_ai.h" - > - </File> - <File - RelativePath="..\scripts\creature\mob_generic_creature.cpp" - > - </File> - <File - RelativePath="..\scripts\creature\simple_ai.cpp" - > - </File> - <File - RelativePath="..\scripts\creature\simple_ai.h" - > - </File> - </Filter> - <Filter - Name="guard" - > - <File - RelativePath="..\scripts\guard\guard_ai.cpp" - > - </File> - <File - RelativePath="..\scripts\guard\guard_ai.h" - > - </File> - <File - RelativePath="..\scripts\guard\guards.cpp" - > - </File> - </Filter> - <Filter - Name="honor" - > - </Filter> - <Filter - Name="npc" - > - <File - RelativePath="..\scripts\npc\npc_escortAI.cpp" - > - </File> - <File - RelativePath="..\scripts\npc\npc_escortAI.h" - > - </File> - <File - RelativePath="..\scripts\npc\npc_innkeeper.cpp" - > - </File> - <File - RelativePath="..\scripts\npc\npc_professions.cpp" - > - </File> - <File - RelativePath="..\scripts\npc\npcs_special.cpp" - > - </File> - </Filter> - <Filter - Name="servers" - > - </Filter> - <Filter - Name="custom" - > - <File - RelativePath="..\scripts\custom\custom_example.cpp" - > - </File> - <File - RelativePath="..\scripts\custom\custom_gossip_codebox.cpp" - > - </File> - <File - RelativePath="..\scripts\custom\test.cpp" - > - </File> - </Filter> - <Filter - Name="areatrigger" - > - <File - RelativePath="..\scripts\areatrigger\areatrigger_scripts.cpp" - > - </File> - </Filter> - <Filter - Name="go" - > - <File - RelativePath="..\scripts\go\go_scripts.cpp" - > - </File> - </Filter> - <Filter - Name="item" - > - <File - RelativePath="..\scripts\item\item_scripts.cpp" - > - </File> - <File - RelativePath="..\scripts\item\item_test.cpp" - > - </File> - </Filter> - <Filter - Name="zone" - > - <Filter - Name="Alterac Mountains" - > - <File - RelativePath="..\scripts\zone\alterac_mountains\alterac_mountains.cpp" - > - </File> - </Filter> - <Filter - Name="Ashenvale Forest" - > - <File - RelativePath="..\scripts\zone\ashenvale_forest\ashenvale.cpp" - > - </File> - </Filter> - <Filter - Name="Azshara" - > - <File - RelativePath="..\scripts\zone\azshara\azshara.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\azshara\boss_azuregos.cpp" - > - </File> - </Filter> - <Filter - Name="Badlands" - > - </Filter> - <Filter - Name="Barrens" - > - <File - RelativePath="..\scripts\zone\barrens\the_barrens.cpp" - > - </File> - </Filter> - <Filter - Name="Blackfathom Depths" - > - </Filter> - <Filter - Name="Arathi Highlands" - > - <File - RelativePath="..\scripts\zone\arathi_highlands\arathi_highlands.cpp" - > - </File> - </Filter> - <Filter - Name="Deadmines" - > - <File - RelativePath="..\scripts\zone\deadmines\deadmines.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\deadmines\def_deadmines.h" - > - </File> - </Filter> - <Filter - Name="Deadwind Pass" - > - </Filter> - <Filter - Name="Desolace" - > - </Filter> - <Filter - Name="Dire Maul" - > - </Filter> - <Filter - Name="Dun Morogh" - > - <File - RelativePath="..\scripts\zone\dun_morogh\dun_morogh.cpp" - > - </File> - </Filter> - <Filter - Name="Durotar" - > - </Filter> - <Filter - Name="Duskwood" - > - </Filter> - <Filter - Name="Dustwallow Marsh" - > - <File - RelativePath="..\scripts\zone\dustwallow_marsh\dustwallow_marsh.cpp" - > - </File> - </Filter> - <Filter - Name="Blackwing Lair" - > - <File - RelativePath="..\scripts\zone\blackwing_lair\boss_broodlord_lashlayer.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\blackwing_lair\boss_chromaggus.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\blackwing_lair\boss_ebonroc.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\blackwing_lair\boss_firemaw.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\blackwing_lair\boss_flamegor.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\blackwing_lair\boss_nefarian.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\blackwing_lair\boss_razorgore.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\blackwing_lair\boss_vaelastrasz.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\blackwing_lair\boss_victor_nefarius.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\blackwing_lair\instance_blackwing_lair.cpp" - > - </File> - </Filter> - <Filter - Name="Bloodmyst Isle" - > - <File - RelativePath="..\scripts\zone\bloodmyst_isle\bloodmyst_isle.cpp" - > - </File> - </Filter> - <Filter - Name="Gruul's Lair" - > - <File - RelativePath="..\scripts\zone\gruuls_lair\boss_gruul.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\gruuls_lair\boss_high_king_maulgar.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\gruuls_lair\def_gruuls_lair.h" - > - </File> - <File - RelativePath="..\scripts\zone\gruuls_lair\instance_gruuls_lair.cpp" - > - </File> - </Filter> - <Filter - Name="Burning Steppes" - > - <File - RelativePath="..\scripts\zone\burning_steppes\burning_steppes.cpp" - > - </File> - </Filter> - <Filter - Name="Darkshore" - > - <File - RelativePath="..\scripts\zone\darkshore\darkshore.cpp" - > - </File> - </Filter> - <Filter - Name="Eastern Plaguelands" - > - <File - RelativePath="..\scripts\zone\eastern_plaguelands\eastern_plaguelands.cpp" - > - </File> - </Filter> - <Filter - Name="Moonglade" - > - <File - RelativePath="..\scripts\zone\moonglade\moonglade.cpp" - > - </File> - </Filter> - <Filter - Name="Razorfen Kraul" - > - <File - RelativePath="..\scripts\zone\razorfen_kraul\razorfen_kraul.cpp" - > - </File> - </Filter> - <Filter - Name="Redridge Mountains" - > - </Filter> - <Filter - Name="Ruins of Ahn'Qiraj" - > - <File - RelativePath="..\scripts\zone\ruins_of_ahnqiraj\boss_ayamiss.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\ruins_of_ahnqiraj\boss_buru.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\ruins_of_ahnqiraj\boss_kurinnaxx.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\ruins_of_ahnqiraj\boss_moam.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\ruins_of_ahnqiraj\boss_ossirian.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\ruins_of_ahnqiraj\boss_rajaxx.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\ruins_of_ahnqiraj\instance_ruins_of_ahnqiraj.cpp" - > - </File> - </Filter> - <Filter - Name="Swamp of Sorrows" - > - </Filter> - <Filter - Name="Scarlet Monastery" - > - <File - RelativePath="..\scripts\zone\scarlet_monastery\boss_arcanist_doan.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\scarlet_monastery\boss_azshir_the_sleepless.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\scarlet_monastery\boss_bloodmage_thalnos.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\scarlet_monastery\boss_headless_horseman.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\scarlet_monastery\boss_herod.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\scarlet_monastery\boss_high_inquisitor_fairbanks.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\scarlet_monastery\boss_houndmaster_loksey.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\scarlet_monastery\boss_interrogator_vishas.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\scarlet_monastery\boss_mograine_and_whitemane.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\scarlet_monastery\boss_scorn.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\scarlet_monastery\def_scarlet_monastery.h" - > - </File> - <File - RelativePath="..\scripts\zone\scarlet_monastery\instance_scarlet_monastery.cpp" - > - </File> - </Filter> - <Filter - Name="Scholomance" - > - <File - RelativePath="..\scripts\zone\scholomance\boss_darkmaster_gandling.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\scholomance\boss_death_knight_darkreaver.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\scholomance\boss_doctor_theolen_krastinov.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\scholomance\boss_illucia_barov.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\scholomance\boss_instructor_malicia.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\scholomance\boss_jandice_barov.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\scholomance\boss_kormok.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\scholomance\boss_lord_alexei_barov.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\scholomance\boss_lorekeeper_polkelt.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\scholomance\boss_ras_frostwhisper.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\scholomance\boss_the_ravenian.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\scholomance\boss_vectus.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\scholomance\def_scholomance.h" - > - </File> - <File - RelativePath="..\scripts\zone\scholomance\instance_scholomance.cpp" - > - </File> - </Filter> - <Filter - Name="Searing Gorge" - > - <File - RelativePath="..\scripts\zone\searing_gorge\searing_gorge.cpp" - > - </File> - </Filter> - <Filter - Name="Elwynn Forest" - > - <File - RelativePath="..\scripts\zone\elwynn_forest\elwynn_forest.cpp" - > - </File> - </Filter> - <Filter - Name="Felwood" - > - <File - RelativePath="..\scripts\zone\felwood\felwood.cpp" - > - </File> - </Filter> - <Filter - Name="Feralas" - > - <File - RelativePath="..\scripts\zone\feralas\feralas.cpp" - > - </File> - </Filter> - <Filter - Name="Gnomeregan" - > - </Filter> - <Filter - Name="Hillsbrad Foothills" - > - </Filter> - <Filter - Name="Hinterlands" - > - </Filter> - <Filter - Name="Maraudon" - > - <File - RelativePath="..\scripts\zone\maraudon\boss_celebras_the_cursed.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\maraudon\boss_landslide.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\maraudon\boss_noxxion.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\maraudon\boss_princess_theradras.cpp" - > - </File> - </Filter> - <Filter - Name="Molten Core" - > - <File - RelativePath="..\scripts\zone\molten_core\boss_baron_geddon.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\molten_core\boss_garr.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\molten_core\boss_gehennas.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\molten_core\boss_golemagg.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\molten_core\boss_lucifron.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\molten_core\boss_magmadar.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\molten_core\boss_majordomo_executus.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\molten_core\boss_ragnaros.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\molten_core\boss_shazzrah.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\molten_core\boss_sulfuron_harbinger.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\molten_core\def_molten_core.h" - > - </File> - <File - RelativePath="..\scripts\zone\molten_core\instance_molten_core.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\molten_core\molten_core.cpp" - > - </File> - </Filter> - <Filter - Name="Mulgore" - > - <File - RelativePath="..\scripts\zone\mulgore\mulgore.cpp" - > - </File> - </Filter> - <Filter - Name="Naxxramas" - > - <File - RelativePath="..\scripts\zone\naxxramas\boss_anubrekhan.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\naxxramas\boss_faerlina.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\naxxramas\boss_four_horsemen.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\naxxramas\boss_gluth.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\naxxramas\boss_gothik.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\naxxramas\boss_grobbulus.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\naxxramas\boss_heigan.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\naxxramas\boss_highlord_mograine.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\naxxramas\boss_kelthuzad.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\naxxramas\boss_loatheb.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\naxxramas\boss_maexxna.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\naxxramas\boss_noth.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\naxxramas\boss_patchwerk.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\naxxramas\boss_razuvious.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\naxxramas\boss_sapphiron.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\naxxramas\boss_thaddius.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\naxxramas\instance_naxxramas.cpp" - > - </File> - </Filter> - <Filter - Name="Onyxia's Lair" - > - <File - RelativePath="..\scripts\zone\onyxias_lair\boss_onyxia.cpp" - > - </File> - </Filter> - <Filter - Name="Ragefire Chasm" - > - </Filter> - <Filter - Name="Razorfen Downs" - > - <File - RelativePath="..\scripts\zone\razorfen_downs\boss_amnennar_the_coldbringer.cpp" - > - </File> - </Filter> - <Filter - Name="Shadowfang Keep" - > - <File - RelativePath="..\scripts\zone\shadowfang_keep\def_shadowfang_keep.h" - > - </File> - <File - RelativePath="..\scripts\zone\shadowfang_keep\instance_shadowfang_keep.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\shadowfang_keep\shadowfang_keep.cpp" - > - </File> - </Filter> - <Filter - Name="Stonetalon Mountains" - > - <File - RelativePath="..\scripts\zone\stonetalon_mountains\stonetalon_mountains.cpp" - > - </File> - </Filter> - <Filter - Name="Stranglethorn Vale" - > - <File - RelativePath="..\scripts\zone\stranglethorn_vale\stranglethorn_vale.cpp" - > - </File> - </Filter> - <Filter - Name="Stratholme" - > - <File - RelativePath="..\scripts\zone\stratholme\boss_baron_rivendare.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\stratholme\boss_baroness_anastari.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\stratholme\boss_cannon_master_willey.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\stratholme\boss_dathrohan_balnazzar.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\stratholme\boss_magistrate_barthilas.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\stratholme\boss_maleki_the_pallid.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\stratholme\boss_nerubenkan.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\stratholme\boss_order_of_silver_hand.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\stratholme\boss_postmaster_malown.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\stratholme\boss_ramstein_the_gorger.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\stratholme\boss_timmy_the_cruel.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\stratholme\def_stratholme.h" - > - </File> - <File - RelativePath="..\scripts\zone\stratholme\instance_stratholme.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\stratholme\stratholme.cpp" - > - </File> - </Filter> - <Filter - Name="Sunken Temple" - > - </Filter> - <Filter - Name="Tanaris" - > - <File - RelativePath="..\scripts\zone\tanaris\tanaris.cpp" - > - </File> - </Filter> - <Filter - Name="Teldrassil" - > - </Filter> - <Filter - Name="Temple of Ahn'Qiraj" - > - <File - RelativePath="..\scripts\zone\temple_of_ahnqiraj\boss_bug_trio.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\temple_of_ahnqiraj\boss_cthun.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\temple_of_ahnqiraj\boss_fankriss.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\temple_of_ahnqiraj\boss_huhuran.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\temple_of_ahnqiraj\boss_ouro.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\temple_of_ahnqiraj\boss_sartura.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\temple_of_ahnqiraj\boss_skeram.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\temple_of_ahnqiraj\boss_twinemperors.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\temple_of_ahnqiraj\boss_viscidus.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\temple_of_ahnqiraj\def_temple_of_ahnqiraj.h" - > - </File> - <File - RelativePath="..\scripts\zone\temple_of_ahnqiraj\instance_temple_of_ahnqiraj.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\temple_of_ahnqiraj\mob_anubisath_sentinel.cpp" - > - </File> - </Filter> - <Filter - Name="Thousand Needles" - > - <File - RelativePath="..\scripts\zone\thousand_needles\thousand_needles.cpp" - > - </File> - </Filter> - <Filter - Name="Silithus" - > - <File - RelativePath="..\scripts\zone\silithus\silithus.cpp" - > - </File> - </Filter> - <Filter - Name="Silverpine Forest" - > - <File - RelativePath="..\scripts\zone\silverpine_forest\silverpine_forest.cpp" - > - </File> - </Filter> - <Filter - Name="Stockade" - > - </Filter> - <Filter - Name="Tirisfal Glades" - > - <File - RelativePath="..\scripts\zone\tirisfal_glades\tirisfal_glades.cpp" - > - </File> - </Filter> - <Filter - Name="Wailing Caverns" - > - <File - RelativePath="..\scripts\zone\wailing_caverns\instance_wailing_caverns.cpp" - > - </File> - </Filter> - <Filter - Name="Western Plaguelands" - > - <File - RelativePath="..\scripts\zone\western_plaguelands\western_plaguelands.cpp" - > - </File> - </Filter> - <Filter - Name="Westfall" - > - <File - RelativePath="..\scripts\zone\westfall\westfall.cpp" - > - </File> - </Filter> - <Filter - Name="Wetlands" - > - </Filter> - <Filter - Name="Winterspring" - > - <File - RelativePath="..\scripts\zone\winterspring\winterspring.cpp" - > - </File> - </Filter> - <Filter - Name="Zul'Farrak" - > - <File - RelativePath="..\scripts\zone\zulfarrak\zulfarrak.cpp" - > - </File> - </Filter> - <Filter - Name="Zul'Gurub" - > - <File - RelativePath="..\scripts\zone\zulgurub\boss_arlokk.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\zulgurub\boss_gahzranka.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\zulgurub\boss_grilek.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\zulgurub\boss_hakkar.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\zulgurub\boss_hazzarah.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\zulgurub\boss_jeklik.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\zulgurub\boss_jindo.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\zulgurub\boss_mandokir.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\zulgurub\boss_marli.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\zulgurub\boss_renataki.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\zulgurub\boss_thekal.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\zulgurub\boss_venoxis.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\zulgurub\boss_wushoolay.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\zulgurub\def_zulgurub.h" - > - </File> - <File - RelativePath="..\scripts\zone\zulgurub\instance_zulgurub.cpp" - > - </File> - </Filter> - <Filter - Name="Uldaman" - > - <File - RelativePath="..\scripts\zone\uldaman\boss_archaedas.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\uldaman\boss_ironaya.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\uldaman\instance_uldaman.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\uldaman\uldaman.cpp" - > - </File> - </Filter> - <Filter - Name="Un'Goro Crater" - > - <File - RelativePath="..\scripts\zone\ungoro_crater\ungoro_crater.cpp" - > - </File> - </Filter> - <Filter - Name="Aunchindoun" - > - <Filter - Name="Auchenai Crypts" - > - <File - RelativePath="..\scripts\zone\aunchindoun\auchenai_crypts\boss_exarch_maladaar.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\aunchindoun\auchenai_crypts\boss_shirrak_the_dead_watcher.cpp" - > - </File> - </Filter> - <Filter - Name="Mana Tombs" - > - <File - RelativePath="..\scripts\zone\aunchindoun\mana_tombs\boss_nexusprince_shaffar.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\aunchindoun\mana_tombs\boss_pandemonius.cpp" - > - </File> - </Filter> - <Filter - Name="Sethekk Halls" - > - <File - RelativePath="..\scripts\zone\aunchindoun\sethekk_halls\boss_darkweaver_syth.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\aunchindoun\sethekk_halls\boss_tailonking_ikiss.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\aunchindoun\sethekk_halls\def_sethekk_halls.h" - > - </File> - <File - RelativePath="..\scripts\zone\aunchindoun\sethekk_halls\instance_sethekk_halls.cpp" - > - </File> - </Filter> - <Filter - Name="Shadow Labyrinth" - > - <File - RelativePath="..\scripts\zone\aunchindoun\shadow_labyrinth\boss_ambassador_hellmaw.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\aunchindoun\shadow_labyrinth\boss_blackheart_the_inciter.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\aunchindoun\shadow_labyrinth\boss_grandmaster_vorpil.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\aunchindoun\shadow_labyrinth\boss_murmur.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\aunchindoun\shadow_labyrinth\def_shadow_labyrinth.h" - > - </File> - <File - RelativePath="..\scripts\zone\aunchindoun\shadow_labyrinth\instance_shadow_labyrinth.cpp" - > - </File> - </Filter> - </Filter> - <Filter - Name="Azuremyst Isle" - > - <File - RelativePath="..\scripts\zone\azuremyst_isle\azuremyst_isle.cpp" - > - </File> - </Filter> - <Filter - Name="Black Temple" - > - <File - RelativePath="..\scripts\zone\black_temple\black_temple.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\black_temple\boss_bloodboil.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\black_temple\boss_illidan.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\black_temple\boss_mother_shahraz.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\black_temple\boss_reliquary_of_souls.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\black_temple\boss_shade_of_akama.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\black_temple\boss_supremus.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\black_temple\boss_teron_gorefiend.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\black_temple\boss_warlord_najentus.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\black_temple\def_black_temple.h" - > - </File> - <File - RelativePath="..\scripts\zone\black_temple\illidari_council.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\black_temple\instance_black_temple.cpp" - > - </File> - </Filter> - <Filter - Name="Eversong Woods" - > - <File - RelativePath="..\scripts\zone\eversong_woods\eversong_woods.cpp" - > - </File> - </Filter> - <Filter - Name="Ghostlands" - > - <File - RelativePath="..\scripts\zone\ghostlands\ghostlands.cpp" - > - </File> - </Filter> - <Filter - Name="Blade's Edge Mountains" - > - <File - RelativePath="..\scripts\zone\blades_edge_mountains\blades_edge_mountains.cpp" - > - </File> - </Filter> - <Filter - Name="Blasted Lands" - > - <File - RelativePath="..\scripts\zone\blasted_lands\blasted_lands.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\blasted_lands\boss_kruul.cpp" - > - </File> - </Filter> - <Filter - Name="Hellfire Citadel" - > - <Filter - Name="Blood Furnace" - > - <File - RelativePath="..\scripts\zone\hellfire_citadel\blood_furnace\boss_broggok.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\hellfire_citadel\blood_furnace\boss_kelidan_the_breaker.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\hellfire_citadel\blood_furnace\boss_the_maker.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\hellfire_citadel\blood_furnace\def_blood_furnace.h" - > - </File> - <File - RelativePath="..\scripts\zone\hellfire_citadel\blood_furnace\instance_blood_furnace.cpp" - > - </File> - </Filter> - <Filter - Name="Magtheridon's lair" - > - <File - RelativePath="..\scripts\zone\hellfire_citadel\magtheridons_lair\boss_magtheridon.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\hellfire_citadel\magtheridons_lair\def_magtheridons_lair.h" - > - </File> - <File - RelativePath="..\scripts\zone\hellfire_citadel\magtheridons_lair\instance_magtheridons_lair.cpp" - > - </File> - </Filter> - <Filter - Name="Hellfire Ramparts" - > - <File - RelativePath="..\scripts\zone\hellfire_citadel\hellfire_ramparts\boss_omor_the_unscarred.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\hellfire_citadel\hellfire_ramparts\boss_watchkeeper_gargolmar.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\hellfire_citadel\hellfire_ramparts\boss_vazruden_the_herald.cpp" - > - </File> - </Filter> - <Filter - Name="Shattered Halls" - > - <File - RelativePath="..\scripts\zone\hellfire_citadel\shattered_halls\boss_nethekurse.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\hellfire_citadel\shattered_halls\boss_warbringer_omrogg.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\hellfire_citadel\shattered_halls\boss_warchief_kargath_bladefist.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\hellfire_citadel\shattered_halls\def_shattered_halls.h" - > - </File> - <File - RelativePath="..\scripts\zone\hellfire_citadel\shattered_halls\instance_shattered_halls.cpp" - > - </File> - </Filter> - </Filter> - <Filter - Name="Hellfire Peninsula" - > - <File - RelativePath="..\scripts\zone\hellfire_peninsula\boss_doomlord_kazzak.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\hellfire_peninsula\hellfire_peninsula.cpp" - > - </File> - </Filter> - <Filter - Name="Karazhan" - > - <File - RelativePath="..\scripts\zone\karazhan\boss_curator.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\karazhan\boss_maiden_of_virtue.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\karazhan\boss_midnight.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\karazhan\boss_moroes.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\karazhan\boss_netherspite.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\karazhan\boss_nightbane.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\karazhan\boss_prince_malchezaar.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\karazhan\boss_shade_of_aran.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\karazhan\boss_terestian_illhoof.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\karazhan\bosses_opera.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\karazhan\def_karazhan.h" - > - </File> - <File - RelativePath="..\scripts\zone\karazhan\instance_karazhan.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\karazhan\karazhan.cpp" - > - </File> - </Filter> - <Filter - Name="Nagrand" - > - <File - RelativePath="..\scripts\zone\nagrand\nagrand.cpp" - > - </File> - </Filter> - <Filter - Name="Netherstorm" - > - <File - RelativePath="..\scripts\zone\netherstorm\netherstorm.cpp" - > - </File> - </Filter> - <Filter - Name="Shadowmoon Valley" - > - <File - RelativePath="..\scripts\zone\shadowmoon_valley\boss_doomwalker.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\shadowmoon_valley\shadowmoon_valley.cpp" - > - </File> - </Filter> - <Filter - Name="Tempest Keep" - > - <Filter - Name="Arcatraz" - > - <File - RelativePath="..\scripts\zone\tempest_keep\arcatraz\arcatraz.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\tempest_keep\arcatraz\boss_harbinger_skyriss.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\tempest_keep\arcatraz\def_arcatraz.h" - > - </File> - <File - RelativePath="..\scripts\zone\tempest_keep\arcatraz\instance_arcatraz.cpp" - > - </File> - </Filter> - <Filter - Name="Botanica" - > - <File - RelativePath="..\scripts\zone\tempest_keep\botanica\boss_high_botanist_freywinn.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\tempest_keep\botanica\boss_laj.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\tempest_keep\botanica\boss_warp_splinter.cpp" - > - </File> - </Filter> - <Filter - Name="The Eye" - > - <File - RelativePath="..\scripts\zone\tempest_keep\the_eye\boss_alar.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\tempest_keep\the_eye\boss_astromancer.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\tempest_keep\the_eye\boss_kaelthas.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\tempest_keep\the_eye\boss_void_reaver.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\tempest_keep\the_eye\def_the_eye.h" - > - </File> - <File - RelativePath="..\scripts\zone\tempest_keep\the_eye\instance_the_eye.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\tempest_keep\the_eye\the_eye.cpp" - > - </File> - </Filter> - <Filter - Name="The Mechanar" - > - <File - RelativePath="..\scripts\zone\tempest_keep\the_mechanar\boss_gatewatcher_gyrokill.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\tempest_keep\the_mechanar\boss_gatewatcher_ironhand.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\tempest_keep\the_mechanar\boss_nethermancer_sepethrea.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\tempest_keep\the_mechanar\boss_pathaleon_the_calculator.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\tempest_keep\the_mechanar\def_mechanar.h" - > - </File> - <File - RelativePath="..\scripts\zone\tempest_keep\the_mechanar\instance_mechanar.cpp" - > - </File> - </Filter> - </Filter> - <Filter - Name="Terokkar Forest" - > - <File - RelativePath="..\scripts\zone\terokkar_forest\terokkar_forest.cpp" - > - </File> - </Filter> - <Filter - Name="Zangarmarsh" - > - <File - RelativePath="..\scripts\zone\zangarmarsh\zangarmarsh.cpp" - > - </File> - </Filter> - <Filter - Name="Blackrock Spire" - > - <File - RelativePath="..\scripts\zone\blackrock_spire\boss_drakkisath.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\blackrock_spire\boss_gyth.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\blackrock_spire\boss_halycon.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\blackrock_spire\boss_highlord_omokk.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\blackrock_spire\boss_mother_smolderweb.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\blackrock_spire\boss_overlord_wyrmthalak.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\blackrock_spire\boss_pyroguard_emberseer.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\blackrock_spire\boss_quartermaster_zigris.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\blackrock_spire\boss_rend_blackhand.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\blackrock_spire\boss_shadow_hunter_voshgajin.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\blackrock_spire\boss_the_beast.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\blackrock_spire\boss_warmaster_voone.cpp" - > - </File> - </Filter> - <Filter - Name="Stormwind City" - > - <File - RelativePath="..\scripts\zone\stormwind\stormwind_city.cpp" - > - </File> - </Filter> - <Filter - Name="Coilfang Resevoir" - > - <Filter - Name="Serpent Shrine Cavern" - > - <File - RelativePath="..\scripts\zone\coilfang_resevoir\serpent_shrine\boss_fathomlord_karathress.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\coilfang_resevoir\serpent_shrine\boss_hydross_the_unstable.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\coilfang_resevoir\serpent_shrine\boss_lady_vashj.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\coilfang_resevoir\serpent_shrine\boss_leotheras_the_blind.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\coilfang_resevoir\serpent_shrine\boss_lurker_below.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\coilfang_resevoir\serpent_shrine\boss_morogrim_tidewalker.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\coilfang_resevoir\serpent_shrine\def_serpent_shrine.h" - > - </File> - <File - RelativePath="..\scripts\zone\coilfang_resevoir\serpent_shrine\instance_serpent_shrine.cpp" - > - </File> - </Filter> - <Filter - Name="Slave Pens" - > - </Filter> - <Filter - Name="Steam Vault" - > - <File - RelativePath="..\scripts\zone\coilfang_resevoir\steam_vault\boss_hydromancer_thespia.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\coilfang_resevoir\steam_vault\boss_mekgineer_steamrigger.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\coilfang_resevoir\steam_vault\boss_warlord_kalithresh.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\coilfang_resevoir\steam_vault\def_steam_vault.h" - > - </File> - <File - RelativePath="..\scripts\zone\coilfang_resevoir\steam_vault\instance_steam_vault.cpp" - > - </File> - </Filter> - <Filter - Name="Underbog" - > - <File - RelativePath="..\scripts\zone\coilfang_resevoir\underbog\boss_hungarfen.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\coilfang_resevoir\underbog\boss_the_black_stalker.cpp" - > - </File> - </Filter> - </Filter> - <Filter - Name="Caverns of Time" - > - <Filter - Name="The Dark Portal" - > - <File - RelativePath="..\scripts\zone\caverns_of_time\dark_portal\boss_aeonus.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\caverns_of_time\dark_portal\boss_chrono_lord_deja.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\caverns_of_time\dark_portal\boss_temporus.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\caverns_of_time\dark_portal\dark_portal.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\caverns_of_time\dark_portal\def_dark_portal.h" - > - </File> - <File - RelativePath="..\scripts\zone\caverns_of_time\dark_portal\instance_dark_portal.cpp" - > - </File> - </Filter> - <Filter - Name="Battle for Mt. Hyjal" - > - <File - RelativePath="..\scripts\zone\caverns_of_time\hyjal\boss_anetheron.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\caverns_of_time\hyjal\boss_archimonde.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\caverns_of_time\hyjal\boss_azgalor.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\caverns_of_time\hyjal\boss_kazrogal.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\caverns_of_time\hyjal\boss_rage_winterchill.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\caverns_of_time\hyjal\def_hyjal.h" - > - </File> - <File - RelativePath="..\scripts\zone\caverns_of_time\hyjal\hyjal.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\caverns_of_time\hyjal\hyjal_trash.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\caverns_of_time\hyjal\hyjal_trash.h" - > - </File> - <File - RelativePath="..\scripts\zone\caverns_of_time\hyjal\hyjalAI.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\caverns_of_time\hyjal\hyjalAI.h" - > - </File> - <File - RelativePath="..\scripts\zone\caverns_of_time\hyjal\instance_hyjal.cpp" - > - </File> - </Filter> - - <Filter - Name="Old Hillsbrad" - > - <File - RelativePath="..\scripts\zone\caverns_of_time\old_hillsbrad\boss_captain_skarloc.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\caverns_of_time\old_hillsbrad\boss_epoch_hunter.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\caverns_of_time\old_hillsbrad\boss_leutenant_drake.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\caverns_of_time\old_hillsbrad\def_old_hillsbrad.h" - > - </File> - <File - RelativePath="..\scripts\zone\caverns_of_time\old_hillsbrad\instance_old_hillsbrad.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\caverns_of_time\old_hillsbrad\old_hillsbrad.cpp" - > - </File> - </Filter> - </Filter> - <Filter - Name="Silvermoon City" - > - <File - RelativePath="..\scripts\zone\silvermoon\silvermoon_city.cpp" - > - </File> - </Filter> - <Filter - Name="Darnassus" - > - </Filter> - <Filter - Name="Exodar" - > - </Filter> - <Filter - Name="Iron Forge" - > - <File - RelativePath="..\scripts\zone\ironforge\ironforge.cpp" - > - </File> - </Filter> - <Filter - Name="Orgrimmar" - > - <File - RelativePath="..\scripts\zone\orgrimmar\orgrimmar.cpp" - > - </File> - </Filter> - <Filter - Name="Shattrath City" - > - <File - RelativePath="..\scripts\zone\shattrath\shattrath_city.cpp" - > - </File> - </Filter> - <Filter - Name="Thunder Bluff" - > - <File - RelativePath="..\scripts\zone\thunder_bluff\thunder_bluff.cpp" - > - </File> - </Filter> - <Filter - Name="Undercity" - > - <File - RelativePath="..\scripts\zone\undercity\undercity.cpp" - > - </File> - </Filter> - <Filter - Name="Zul'Aman" - > - <File - RelativePath="..\scripts\zone\zulaman\boss_akilzon.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\zulaman\boss_halazzi.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\zulaman\boss_hexlord.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\zulaman\boss_janalai.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\zulaman\boss_nalorakk.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\zulaman\boss_zuljin.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\zulaman\def_zulaman.h" - > - </File> - <File - RelativePath="..\scripts\zone\zulaman\instance_zulaman.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\zulaman\zulaman.cpp" - > - </File> - </Filter> - <Filter - Name="Isle of Quel'Danas" - > - <File - RelativePath="..\scripts\zone\isle_of_queldanas\isle_of_queldanas.cpp" - > - </File> - </Filter> - <Filter - Name="Magister's Terrace" - > - <File - RelativePath="..\scripts\zone\magisters_terrace\boss_felblood_kaelthas.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\magisters_terrace\boss_priestess_delrissa.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\magisters_terrace\boss_selin_fireheart.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\magisters_terrace\boss_vexallus.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\magisters_terrace\def_magisters_terrace.h" - > - </File> - <File - RelativePath="..\scripts\zone\magisters_terrace\instance_magisters_terrace.cpp" - > - </File> - </Filter> - <Filter - Name="Sunwell Plateau" - > - <File - RelativePath="..\scripts\zone\sunwell_plateau\boss_brutallus.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\sunwell_plateau\boss_eredar_twins.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\sunwell_plateau\boss_felmyst.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\sunwell_plateau\boss_kalecgos.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\sunwell_plateau\boss_muru.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\sunwell_plateau\boss_kiljaeden.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\sunwell_plateau\sunwell_plateau.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\sunwell_plateau\def_sunwell_plateau.h" - > - </File> - <File - RelativePath="..\scripts\zone\sunwell_plateau\instance_sunwell_plateau.cpp" - > - </File> - </Filter> - <Filter - Name="Blackrock Depths" - > - <File - RelativePath="..\scripts\zone\blackrock_depths\blackrock_depths.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\blackrock_depths\def_blackrock_depths.h" - > - </File> - <File - RelativePath="..\scripts\zone\blackrock_depths\instance_blackrock_depths.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\blackrock_depths\boss_ambassador_flamelash.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\blackrock_depths\boss_anubshiah.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\blackrock_depths\boss_emperor_dagran_thaurissan.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\blackrock_depths\boss_general_angerforge.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\blackrock_depths\boss_gorosh_the_dervish.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\blackrock_depths\boss_grizzle.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\blackrock_depths\boss_high_interrogator_gerstahn.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\blackrock_depths\boss_magmus.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\blackrock_depths\boss_moira_bronzebeard.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\blackrock_depths\boss_tomb_of_seven.cpp" - > - </File> - </Filter> - <Filter - Name="Loch Modan" - > - <File - RelativePath="..\scripts\zone\loch_modan\loch_modan.cpp" - > - </File> - </Filter> - </Filter> - </Filter> - <Filter - Name="Include" - > - <File - RelativePath="..\include\precompiled.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - UsePrecompiledHeader="1" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - UsePrecompiledHeader="1" - /> - </FileConfiguration> - </File> - <File - RelativePath="..\include\precompiled.h" - > - </File> - <File - RelativePath="..\include\sc_creature.cpp" - > - </File> - <File - RelativePath="..\include\sc_creature.h" - > - </File> - <File - RelativePath="..\include\sc_gossip.h" - > - </File> - <File - RelativePath="..\include\sc_instance.h" - > - </File> - <File - RelativePath="..\include\sc_item.h" - > - </File> - </Filter> - <File - RelativePath="..\config.h" - > - </File> - <File - RelativePath="..\ScriptMgr.cpp" - > - </File> - <File - RelativePath="..\ScriptMgr.h" - > - </File> - <File - RelativePath="..\svn_revision.h" - > - </File> - <File - RelativePath="..\system.cpp" - > - </File> - </Files> - <Globals> - </Globals> -</VisualStudioProject> diff --git a/src/bindings/scripts/VC80/80ScriptDev2.vcproj b/src/bindings/scripts/VC80/80ScriptDev2.vcproj index fcec093ee91..1a39f5b3947 100644 --- a/src/bindings/scripts/VC80/80ScriptDev2.vcproj +++ b/src/bindings/scripts/VC80/80ScriptDev2.vcproj @@ -47,15 +47,15 @@ Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="..\..\..\..\dep\include\;..\..\..\shared\;..\..\..\framework\;..\..\..\game\;..\include\;..\..\..\..\dep\ACE_wrappers" - PreprocessorDefinitions="WIN32;_DEBUG;MANGOS_DEBUG;_WINDOWS;_USRDLL;SCRIPT" + PreprocessorDefinitions="WIN32;_DEBUG;TRINITY_DEBUG;_WINDOWS;_USRDLL;SCRIPT" MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="3" UsePrecompiledHeader="2" PrecompiledHeaderThrough="precompiled.h" WarningLevel="3" - Detect64BitPortabilityProblems="true" - DebugInformationFormat="4" + Detect64BitPortabilityProblems="false" + DebugInformationFormat="3" /> <Tool Name="VCManagedResourceCompilerTool" @@ -68,12 +68,12 @@ /> <Tool Name="VCLinkerTool" - AdditionalDependencies="TrinityCore.lib zthread.lib" + AdditionalDependencies="TrinityCore.lib aced.lib" OutputFile="$(OutDir)/TrinityScript.dll" LinkIncremental="2" - AdditionalLibraryDirectories="..\..\..\..\win\VC80\zthread__$(PlatformName)_$(ConfigurationName);..\..\..\..\win\VC80\trinitycore__$(PlatformName)_$(ConfigurationName)" + AdditionalLibraryDirectories="..\..\..\..\win\VC80\trinitycore__$(PlatformName)_$(ConfigurationName);..\..\..\..\dep\lib\$(PlatformName)_$(ConfigurationName)" GenerateDebugInformation="true" - ProgramDatabaseFile="$(OutDir)/MaNGOSScript.pdb" + ProgramDatabaseFile="$(OutDir)/TrinityScript.pdb" SubSystem="2" RandomizedBaseAddress="1" DataExecutionPrevention="0" @@ -151,10 +151,10 @@ /> <Tool Name="VCLinkerTool" - AdditionalDependencies="TrinityCore.lib zthread.lib" + AdditionalDependencies="TrinityCore.lib ace.lib" OutputFile="$(OutDir)/TrinityScript.dll" LinkIncremental="1" - AdditionalLibraryDirectories="..\..\..\..\win\VC80\zthread__$(PlatformName)_$(ConfigurationName);..\..\..\..\win\VC80\trinitycore__$(PlatformName)_$(ConfigurationName)" + AdditionalLibraryDirectories="..\..\..\..\win\VC80\trinitycore__$(PlatformName)_$(ConfigurationName);..\..\..\..\dep\lib\$(PlatformName)_$(ConfigurationName)" GenerateDebugInformation="false" SubSystem="2" OptimizeReferences="2" @@ -215,7 +215,7 @@ Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="..\..\..\..\dep\include\;..\..\..\shared\;..\..\..\framework\;..\..\..\game\;..\include\;..\..\..\..\dep\ACE_wrappers" - PreprocessorDefinitions="WIN32;_DEBUG;MANGOS_DEBUG;_WINDOWS;_USRDLL;SCRIPT" + PreprocessorDefinitions="WIN32;_DEBUG;TRINITY_DEBUG;_WINDOWS;_USRDLL;SCRIPT" MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="3" @@ -236,12 +236,12 @@ /> <Tool Name="VCLinkerTool" - AdditionalDependencies="TrinityCore.lib zthread.lib" + AdditionalDependencies="TrinityCore.lib aced.lib" OutputFile="$(OutDir)/TrinityScript.dll" LinkIncremental="2" - AdditionalLibraryDirectories="..\..\..\..\win\VC80\zthread__$(PlatformName)_$(ConfigurationName);..\..\..\..\win\VC80\trinitycore__$(PlatformName)_$(ConfigurationName)" + AdditionalLibraryDirectories="..\..\..\..\win\VC80\trinitycore__$(PlatformName)_$(ConfigurationName);..\..\..\..\dep\lib\$(PlatformName)_$(ConfigurationName)" GenerateDebugInformation="true" - ProgramDatabaseFile="$(OutDir)/MaNGOSScript.pdb" + ProgramDatabaseFile="$(OutDir)/TrinityScript.pdb" SubSystem="2" ImportLibrary="$(OutDir)/TrinityScript.lib" TargetMachine="17" @@ -320,10 +320,10 @@ /> <Tool Name="VCLinkerTool" - AdditionalDependencies="TrinityCore.lib zthread.lib" + AdditionalDependencies="TrinityCore.lib ace.lib" OutputFile="$(OutDir)/TrinityScript.dll" LinkIncremental="1" - AdditionalLibraryDirectories="..\..\..\..\win\VC80\zthread__$(PlatformName)_$(ConfigurationName);..\..\..\..\win\VC80\trinitycore__$(PlatformName)_$(ConfigurationName)" + AdditionalLibraryDirectories="..\..\..\..\win\VC80\trinitycore__$(PlatformName)_$(ConfigurationName);..\..\..\..\dep\lib\$(PlatformName)_$(ConfigurationName)" GenerateDebugInformation="false" SubSystem="2" OptimizeReferences="2" @@ -387,23 +387,35 @@ Name="creature" > <File - RelativePath="..\scripts\creature\mob_event_ai.cpp" + RelativePath="..\scripts\creature\mob_generic_creature.cpp" > </File> <File - RelativePath="..\scripts\creature\mob_event_ai.h" + RelativePath="..\scripts\creature\simple_ai.cpp" > </File> <File - RelativePath="..\scripts\creature\mob_generic_creature.cpp" + RelativePath="..\scripts\creature\simple_ai.h" > </File> + </Filter> + <Filter + Name="examples" + > <File - RelativePath="..\scripts\creature\simple_ai.cpp" + RelativePath="..\scripts\examples\example_creature.cpp" > </File> <File - RelativePath="..\scripts\creature\simple_ai.h" + RelativePath="..\scripts\examples\example_escort.cpp" + > + </File> + <File + RelativePath="..\scripts\examples\example_gossip_codebox.cpp" + > + </File> + <File + RelativePath="..\scripts\examples\example_misc.cpp" > </File> </Filter> @@ -447,6 +459,10 @@ > </File> <File + RelativePath="..\scripts\npc\npc_taxi.cpp" + > + </File> + <File RelativePath="..\scripts\npc\npcs_special.cpp" > </File> @@ -459,15 +475,11 @@ Name="custom" > <File - RelativePath="..\scripts\custom\custom_example.cpp" + RelativePath="..\scripts\custom\npc_acherus_taxi.cpp" > </File> <File - RelativePath="..\scripts\custom\custom_gossip_codebox.cpp" - > - </File> - <File - RelativePath="..\scripts\custom\test.cpp" + RelativePath="..\scripts\custom\npc_wyrmresttempel_taxi.cpp" > </File> </Filter> @@ -494,1886 +506,2401 @@ RelativePath="..\scripts\item\item_scripts.cpp" > </File> - <File - RelativePath="..\scripts\item\item_test.cpp" - > - </File> </Filter> <Filter Name="zone" > <Filter - Name="Alterac Mountains" - > - <File - RelativePath="..\scripts\zone\alterac_mountains\alterac_mountains.cpp" - > - </File> - </Filter> - <Filter - Name="Ashenvale Forest" - > - <File - RelativePath="..\scripts\zone\ashenvale_forest\ashenvale.cpp" - > - </File> - </Filter> - <Filter - Name="Azshara" - > - <File - RelativePath="..\scripts\zone\azshara\azshara.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\azshara\boss_azuregos.cpp" - > - </File> - </Filter> - <Filter - Name="Badlands" - > - </Filter> - <Filter - Name="Barrens" - > - <File - RelativePath="..\scripts\zone\barrens\the_barrens.cpp" - > - </File> - </Filter> - <Filter - Name="Blackfathom Depths" - > - </Filter> - <Filter - Name="Arathi Highlands" - > - <File - RelativePath="..\scripts\zone\arathi_highlands\arathi_highlands.cpp" - > - </File> - </Filter> - <Filter - Name="Deadmines" - > - <File - RelativePath="..\scripts\zone\deadmines\deadmines.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\deadmines\def_deadmines.h" - > - </File> - </Filter> - <Filter - Name="Deadwind Pass" - > - </Filter> - <Filter - Name="Desolace" - > - </Filter> - <Filter - Name="Dire Maul" - > - </Filter> - <Filter - Name="Dun Morogh" - > - <File - RelativePath="..\scripts\zone\dun_morogh\dun_morogh.cpp" - > - </File> - </Filter> - <Filter - Name="Durotar" - > - </Filter> - <Filter - Name="Duskwood" + Name="Kalimdor" > - </Filter> - <Filter - Name="Dustwallow Marsh" - > - <File - RelativePath="..\scripts\zone\dustwallow_marsh\dustwallow_marsh.cpp" - > - </File> - </Filter> - <Filter - Name="Blackwing Lair" - > - <File - RelativePath="..\scripts\zone\blackwing_lair\boss_broodlord_lashlayer.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\blackwing_lair\boss_chromaggus.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\blackwing_lair\boss_ebonroc.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\blackwing_lair\boss_firemaw.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\blackwing_lair\boss_flamegor.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\blackwing_lair\boss_nefarian.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\blackwing_lair\boss_razorgore.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\blackwing_lair\boss_vaelastrasz.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\blackwing_lair\boss_victor_nefarius.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\blackwing_lair\instance_blackwing_lair.cpp" - > - </File> - </Filter> - <Filter - Name="Bloodmyst Isle" - > - <File - RelativePath="..\scripts\zone\bloodmyst_isle\bloodmyst_isle.cpp" - > - </File> - </Filter> - <Filter - Name="Gruul's Lair" - > - <File - RelativePath="..\scripts\zone\gruuls_lair\boss_gruul.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\gruuls_lair\boss_high_king_maulgar.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\gruuls_lair\def_gruuls_lair.h" - > - </File> - <File - RelativePath="..\scripts\zone\gruuls_lair\instance_gruuls_lair.cpp" - > - </File> - </Filter> - <Filter - Name="Burning Steppes" - > - <File - RelativePath="..\scripts\zone\burning_steppes\burning_steppes.cpp" - > - </File> - </Filter> - <Filter - Name="Darkshore" - > - <File - RelativePath="..\scripts\zone\darkshore\darkshore.cpp" - > - </File> - </Filter> - <Filter - Name="Eastern Plaguelands" - > - <File - RelativePath="..\scripts\zone\eastern_plaguelands\eastern_plaguelands.cpp" - > - </File> - </Filter> - <Filter - Name="Moonglade" - > - <File - RelativePath="..\scripts\zone\moonglade\moonglade.cpp" - > - </File> - </Filter> - <Filter - Name="Razorfen Kraul" - > - <File - RelativePath="..\scripts\zone\razorfen_kraul\razorfen_kraul.cpp" - > - </File> - </Filter> - <Filter - Name="Redridge Mountains" - > - </Filter> - <Filter - Name="Ruins of Ahn'Qiraj" - > - <File - RelativePath="..\scripts\zone\ruins_of_ahnqiraj\boss_ayamiss.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\ruins_of_ahnqiraj\boss_buru.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\ruins_of_ahnqiraj\boss_kurinnaxx.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\ruins_of_ahnqiraj\boss_moam.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\ruins_of_ahnqiraj\boss_ossirian.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\ruins_of_ahnqiraj\boss_rajaxx.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\ruins_of_ahnqiraj\instance_ruins_of_ahnqiraj.cpp" - > - </File> - </Filter> - <Filter - Name="Swamp of Sorrows" - > - </Filter> - <Filter - Name="Scarlet Monastery" - > - <File - RelativePath="..\scripts\zone\scarlet_monastery\boss_arcanist_doan.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\scarlet_monastery\boss_azshir_the_sleepless.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\scarlet_monastery\boss_bloodmage_thalnos.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\scarlet_monastery\boss_headless_horseman.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\scarlet_monastery\boss_herod.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\scarlet_monastery\boss_high_inquisitor_fairbanks.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\scarlet_monastery\boss_houndmaster_loksey.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\scarlet_monastery\boss_interrogator_vishas.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\scarlet_monastery\boss_mograine_and_whitemane.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\scarlet_monastery\boss_scorn.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\scarlet_monastery\def_scarlet_monastery.h" - > - </File> - <File - RelativePath="..\scripts\zone\scarlet_monastery\instance_scarlet_monastery.cpp" - > - </File> - </Filter> - <Filter - Name="Scholomance" - > - <File - RelativePath="..\scripts\zone\scholomance\boss_darkmaster_gandling.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\scholomance\boss_death_knight_darkreaver.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\scholomance\boss_doctor_theolen_krastinov.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\scholomance\boss_illucia_barov.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\scholomance\boss_instructor_malicia.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\scholomance\boss_jandice_barov.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\scholomance\boss_kormok.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\scholomance\boss_lord_alexei_barov.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\scholomance\boss_lorekeeper_polkelt.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\scholomance\boss_ras_frostwhisper.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\scholomance\boss_the_ravenian.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\scholomance\boss_vectus.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\scholomance\def_scholomance.h" - > - </File> - <File - RelativePath="..\scripts\zone\scholomance\instance_scholomance.cpp" - > - </File> - </Filter> - <Filter - Name="Searing Gorge" - > - <File - RelativePath="..\scripts\zone\searing_gorge\searing_gorge.cpp" - > - </File> - </Filter> - <Filter - Name="Elwynn Forest" - > - <File - RelativePath="..\scripts\zone\elwynn_forest\elwynn_forest.cpp" - > - </File> - </Filter> - <Filter - Name="Felwood" - > - <File - RelativePath="..\scripts\zone\felwood\felwood.cpp" - > - </File> - </Filter> - <Filter - Name="Feralas" - > - <File - RelativePath="..\scripts\zone\feralas\feralas.cpp" - > - </File> - </Filter> - <Filter - Name="Gnomeregan" - > - </Filter> - <Filter - Name="Hillsbrad Foothills" - > - </Filter> - <Filter - Name="Hinterlands" - > - </Filter> - <Filter - Name="Maraudon" - > - <File - RelativePath="..\scripts\zone\maraudon\boss_celebras_the_cursed.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\maraudon\boss_landslide.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\maraudon\boss_noxxion.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\maraudon\boss_princess_theradras.cpp" - > - </File> - </Filter> - <Filter - Name="Molten Core" - > - <File - RelativePath="..\scripts\zone\molten_core\boss_baron_geddon.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\molten_core\boss_garr.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\molten_core\boss_gehennas.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\molten_core\boss_golemagg.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\molten_core\boss_lucifron.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\molten_core\boss_magmadar.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\molten_core\boss_majordomo_executus.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\molten_core\boss_ragnaros.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\molten_core\boss_shazzrah.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\molten_core\boss_sulfuron_harbinger.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\molten_core\def_molten_core.h" - > - </File> - <File - RelativePath="..\scripts\zone\molten_core\instance_molten_core.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\molten_core\molten_core.cpp" - > - </File> - </Filter> - <Filter - Name="Mulgore" - > - <File - RelativePath="..\scripts\zone\mulgore\mulgore.cpp" - > - </File> - </Filter> - <Filter - Name="Naxxramas" - > - <File - RelativePath="..\scripts\zone\naxxramas\boss_anubrekhan.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\naxxramas\boss_faerlina.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\naxxramas\boss_four_horsemen.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\naxxramas\boss_gluth.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\naxxramas\boss_gothik.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\naxxramas\boss_grobbulus.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\naxxramas\boss_heigan.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\naxxramas\boss_highlord_mograine.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\naxxramas\boss_kelthuzad.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\naxxramas\boss_loatheb.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\naxxramas\boss_maexxna.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\naxxramas\boss_noth.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\naxxramas\boss_patchwerk.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\naxxramas\boss_razuvious.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\naxxramas\boss_sapphiron.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\naxxramas\boss_thaddius.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\naxxramas\instance_naxxramas.cpp" - > - </File> - </Filter> - <Filter - Name="Onyxia's Lair" - > - <File - RelativePath="..\scripts\zone\onyxias_lair\boss_onyxia.cpp" - > - </File> - </Filter> - <Filter - Name="Ragefire Chasm" - > - </Filter> - <Filter - Name="Razorfen Downs" - > - <File - RelativePath="..\scripts\zone\razorfen_downs\boss_amnennar_the_coldbringer.cpp" - > - </File> - </Filter> - <Filter - Name="Shadowfang Keep" - > - <File - RelativePath="..\scripts\zone\shadowfang_keep\def_shadowfang_keep.h" - > - </File> - <File - RelativePath="..\scripts\zone\shadowfang_keep\instance_shadowfang_keep.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\shadowfang_keep\shadowfang_keep.cpp" - > - </File> - </Filter> - <Filter - Name="Stonetalon Mountains" - > - <File - RelativePath="..\scripts\zone\stonetalon_mountains\stonetalon_mountains.cpp" - > - </File> - </Filter> - <Filter - Name="Stranglethorn Vale" - > - <File - RelativePath="..\scripts\zone\stranglethorn_vale\stranglethorn_vale.cpp" - > - </File> - </Filter> - <Filter - Name="Stratholme" - > - <File - RelativePath="..\scripts\zone\stratholme\boss_baron_rivendare.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\stratholme\boss_baroness_anastari.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\stratholme\boss_cannon_master_willey.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\stratholme\boss_dathrohan_balnazzar.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\stratholme\boss_magistrate_barthilas.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\stratholme\boss_maleki_the_pallid.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\stratholme\boss_nerubenkan.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\stratholme\boss_order_of_silver_hand.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\stratholme\boss_postmaster_malown.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\stratholme\boss_ramstein_the_gorger.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\stratholme\boss_timmy_the_cruel.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\stratholme\def_stratholme.h" - > - </File> - <File - RelativePath="..\scripts\zone\stratholme\instance_stratholme.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\stratholme\stratholme.cpp" - > - </File> - </Filter> - <Filter - Name="Sunken Temple" - > - </Filter> - <Filter - Name="Tanaris" - > - <File - RelativePath="..\scripts\zone\tanaris\tanaris.cpp" - > - </File> - </Filter> - <Filter - Name="Teldrassil" - > - </Filter> - <Filter - Name="Temple of Ahn'Qiraj" - > - <File - RelativePath="..\scripts\zone\temple_of_ahnqiraj\boss_bug_trio.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\temple_of_ahnqiraj\boss_cthun.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\temple_of_ahnqiraj\boss_fankriss.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\temple_of_ahnqiraj\boss_huhuran.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\temple_of_ahnqiraj\boss_ouro.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\temple_of_ahnqiraj\boss_sartura.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\temple_of_ahnqiraj\boss_skeram.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\temple_of_ahnqiraj\boss_twinemperors.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\temple_of_ahnqiraj\boss_viscidus.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\temple_of_ahnqiraj\def_temple_of_ahnqiraj.h" - > - </File> - <File - RelativePath="..\scripts\zone\temple_of_ahnqiraj\instance_temple_of_ahnqiraj.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\temple_of_ahnqiraj\mob_anubisath_sentinel.cpp" + <Filter + Name="Ashenvale Forest" > - </File> - </Filter> - <Filter - Name="Thousand Needles" - > - <File - RelativePath="..\scripts\zone\thousand_needles\thousand_needles.cpp" - > - </File> - </Filter> - <Filter - Name="Silithus" - > - <File - RelativePath="..\scripts\zone\silithus\silithus.cpp" + <File + RelativePath="..\scripts\zone\ashenvale_forest\ashenvale.cpp" + > + </File> + </Filter> + <Filter + Name="Azshara" > - </File> - </Filter> - <Filter - Name="Silverpine Forest" - > - <File - RelativePath="..\scripts\zone\silverpine_forest\silverpine_forest.cpp" + <File + RelativePath="..\scripts\zone\azshara\azshara.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\azshara\boss_azuregos.cpp" + > + </File> + </Filter> + <Filter + Name="Azuremyst Isle" > - </File> - </Filter> - <Filter - Name="Stockade" - > - </Filter> - <Filter - Name="Tirisfal Glades" - > - <File - RelativePath="..\scripts\zone\tirisfal_glades\tirisfal_glades.cpp" + <File + RelativePath="..\scripts\zone\azuremyst_isle\azuremyst_isle.cpp" + > + </File> + </Filter> + <Filter + Name="Badlands" > - </File> - </Filter> - <Filter - Name="Wailing Caverns" - > - <File - RelativePath="..\scripts\zone\wailing_caverns\instance_wailing_caverns.cpp" + </Filter> + <Filter + Name="Barrens" > - </File> - </Filter> - <Filter - Name="Western Plaguelands" - > - <File - RelativePath="..\scripts\zone\western_plaguelands\western_plaguelands.cpp" + <File + RelativePath="..\scripts\zone\barrens\the_barrens.cpp" + > + </File> + </Filter> + <Filter + Name="Blackfathom Depths" > - </File> - </Filter> - <Filter - Name="Westfall" - > - <File - RelativePath="..\scripts\zone\westfall\westfall.cpp" + </Filter> + <Filter + Name="Bloodmyst Isle" > - </File> - </Filter> - <Filter - Name="Wetlands" - > - </Filter> - <Filter - Name="Winterspring" - > - <File - RelativePath="..\scripts\zone\winterspring\winterspring.cpp" + <File + RelativePath="..\scripts\zone\bloodmyst_isle\bloodmyst_isle.cpp" + > + </File> + </Filter> + <Filter + Name="Caverns of Time" + > + <Filter + Name="The Dark Portal" + > + <File + RelativePath="..\scripts\zone\caverns_of_time\dark_portal\boss_aeonus.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\caverns_of_time\dark_portal\boss_chrono_lord_deja.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\caverns_of_time\dark_portal\boss_temporus.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\caverns_of_time\dark_portal\dark_portal.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\caverns_of_time\dark_portal\def_dark_portal.h" + > + </File> + <File + RelativePath="..\scripts\zone\caverns_of_time\dark_portal\instance_dark_portal.cpp" + > + </File> + </Filter> + <Filter + Name="Battle for Mt. Hyjal" + > + <File + RelativePath="..\scripts\zone\caverns_of_time\hyjal\boss_anetheron.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\caverns_of_time\hyjal\boss_archimonde.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\caverns_of_time\hyjal\boss_azgalor.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\caverns_of_time\hyjal\boss_kazrogal.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\caverns_of_time\hyjal\boss_rage_winterchill.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\caverns_of_time\hyjal\def_hyjal.h" + > + </File> + <File + RelativePath="..\scripts\zone\caverns_of_time\hyjal\hyjal.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\caverns_of_time\hyjal\hyjal_trash.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\caverns_of_time\hyjal\hyjal_trash.h" + > + </File> + <File + RelativePath="..\scripts\zone\caverns_of_time\hyjal\hyjalAI.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\caverns_of_time\hyjal\hyjalAI.h" + > + </File> + <File + RelativePath="..\scripts\zone\caverns_of_time\hyjal\instance_hyjal.cpp" + > + </File> + </Filter> + <Filter + Name="Culling of Stratholme" + > + <File + RelativePath="..\scripts\zone\caverns_of_time\culling_of_stratholme\boss_epoch.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\caverns_of_time\culling_of_stratholme\boss_mal_ganis.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\caverns_of_time\culling_of_stratholme\boss_meathook.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\caverns_of_time\culling_of_stratholme\boss_salramm.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\caverns_of_time\culling_of_stratholme\def_culling_of_stratholme.h" + > + </File> + <File + RelativePath="..\scripts\zone\caverns_of_time\culling_of_stratholme\instance_culling_of_stratholme.cpp" + > + </File> + </Filter> + <Filter + Name="Old Hillsbrad" + > + <File + RelativePath="..\scripts\zone\caverns_of_time\old_hillsbrad\boss_captain_skarloc.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\caverns_of_time\old_hillsbrad\boss_epoch_hunter.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\caverns_of_time\old_hillsbrad\boss_leutenant_drake.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\caverns_of_time\old_hillsbrad\def_old_hillsbrad.h" + > + </File> + <File + RelativePath="..\scripts\zone\caverns_of_time\old_hillsbrad\instance_old_hillsbrad.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\caverns_of_time\old_hillsbrad\old_hillsbrad.cpp" + > + </File> + </Filter> + </Filter> + <Filter + Name="Darkshore" > - </File> - </Filter> - <Filter - Name="Zul'Farrak" - > - <File - RelativePath="..\scripts\zone\zulfarrak\zulfarrak.cpp" + <File + RelativePath="..\scripts\zone\darkshore\darkshore.cpp" + > + </File> + </Filter> + <Filter + Name="Darnassus" > - </File> - </Filter> - <Filter - Name="Zul'Gurub" - > - <File - RelativePath="..\scripts\zone\zulgurub\boss_arlokk.cpp" + </Filter> + <Filter + Name="Desolace" > - </File> - <File - RelativePath="..\scripts\zone\zulgurub\boss_gahzranka.cpp" + </Filter> + <Filter + Name="Dire Maul" > - </File> - <File - RelativePath="..\scripts\zone\zulgurub\boss_grilek.cpp" + </Filter> + <Filter + Name="Durotar" > - </File> - <File - RelativePath="..\scripts\zone\zulgurub\boss_hakkar.cpp" + </Filter> + <Filter + Name="Dustwallow Marsh" > - </File> - <File - RelativePath="..\scripts\zone\zulgurub\boss_hazzarah.cpp" + <File + RelativePath="..\scripts\zone\dustwallow_marsh\dustwallow_marsh.cpp" + > + </File> + </Filter> + <Filter + Name="Exodar" > - </File> - <File - RelativePath="..\scripts\zone\zulgurub\boss_jeklik.cpp" + </Filter> + <Filter + Name="Felwood" > - </File> - <File - RelativePath="..\scripts\zone\zulgurub\boss_jindo.cpp" + <File + RelativePath="..\scripts\zone\felwood\felwood.cpp" + > + </File> + </Filter> + <Filter + Name="Feralas" > - </File> - <File - RelativePath="..\scripts\zone\zulgurub\boss_mandokir.cpp" + <File + RelativePath="..\scripts\zone\feralas\feralas.cpp" + > + </File> + </Filter> + <Filter + Name="Maraudon" > - </File> - <File - RelativePath="..\scripts\zone\zulgurub\boss_marli.cpp" + <File + RelativePath="..\scripts\zone\maraudon\boss_celebras_the_cursed.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\maraudon\boss_landslide.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\maraudon\boss_noxxion.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\maraudon\boss_princess_theradras.cpp" + > + </File> + </Filter> + <Filter + Name="Moonglade" > - </File> - <File - RelativePath="..\scripts\zone\zulgurub\boss_renataki.cpp" + <File + RelativePath="..\scripts\zone\moonglade\moonglade.cpp" + > + </File> + </Filter> + <Filter + Name="Mulgore" > - </File> - <File - RelativePath="..\scripts\zone\zulgurub\boss_thekal.cpp" + <File + RelativePath="..\scripts\zone\mulgore\mulgore.cpp" + > + </File> + </Filter> + <Filter + Name="Onyxia's Lair" > - </File> - <File - RelativePath="..\scripts\zone\zulgurub\boss_venoxis.cpp" + <File + RelativePath="..\scripts\zone\onyxias_lair\boss_onyxia.cpp" + > + </File> + </Filter> + <Filter + Name="Orgrimmar" > - </File> - <File - RelativePath="..\scripts\zone\zulgurub\boss_wushoolay.cpp" + <File + RelativePath="..\scripts\zone\orgrimmar\orgrimmar.cpp" + > + </File> + </Filter> + <Filter + Name="Ragefire Chasm" > - </File> - <File - RelativePath="..\scripts\zone\zulgurub\def_zulgurub.h" + </Filter> + <Filter + Name="Razorfen Downs" > - </File> - <File - RelativePath="..\scripts\zone\zulgurub\instance_zulgurub.cpp" + <File + RelativePath="..\scripts\zone\razorfen_downs\boss_amnennar_the_coldbringer.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\razorfen_downs\razorfen_downs.cpp" + > + </File> + </Filter> + <Filter + Name="Razorfen Kraul" > - </File> - </Filter> - <Filter - Name="Uldaman" - > - <File - RelativePath="..\scripts\zone\uldaman\boss_archaedas.cpp" + <File + RelativePath="..\scripts\zone\razorfen_kraul\razorfen_kraul.cpp" + > + </File> + </Filter> + <Filter + Name="Ruins of Ahn'Qiraj" > - </File> - <File - RelativePath="..\scripts\zone\uldaman\boss_ironaya.cpp" + <File + RelativePath="..\scripts\zone\ruins_of_ahnqiraj\boss_ayamiss.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\ruins_of_ahnqiraj\boss_buru.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\ruins_of_ahnqiraj\boss_kurinnaxx.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\ruins_of_ahnqiraj\boss_moam.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\ruins_of_ahnqiraj\boss_ossirian.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\ruins_of_ahnqiraj\boss_rajaxx.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\ruins_of_ahnqiraj\instance_ruins_of_ahnqiraj.cpp" + > + </File> + </Filter> + <Filter + Name="Silithus" > - </File> - <File - RelativePath="..\scripts\zone\uldaman\instance_uldaman.cpp" + <File + RelativePath="..\scripts\zone\silithus\silithus.cpp" + > + </File> + </Filter> + <Filter + Name="Zul'Farrak" > - </File> - <File - RelativePath="..\scripts\zone\uldaman\uldaman.cpp" + <File + RelativePath="..\scripts\zone\zulfarrak\zulfarrak.cpp" + > + </File> + </Filter> + <Filter + Name="Winterspring" > - </File> - </Filter> - <Filter - Name="Un'Goro Crater" - > - <File - RelativePath="..\scripts\zone\ungoro_crater\ungoro_crater.cpp" - > - </File> - </Filter> - <Filter - Name="Aunchindoun" - > + <File + RelativePath="..\scripts\zone\winterspring\winterspring.cpp" + > + </File> + </Filter> <Filter - Name="Auchenai Crypts" + Name="Wailing Caverns" > <File - RelativePath="..\scripts\zone\aunchindoun\auchenai_crypts\boss_exarch_maladaar.cpp" + RelativePath="..\scripts\zone\wailing_caverns\instance_wailing_caverns.cpp" > </File> + </Filter> + <Filter + Name="Un'Goro Crater" + > <File - RelativePath="..\scripts\zone\aunchindoun\auchenai_crypts\boss_shirrak_the_dead_watcher.cpp" + RelativePath="..\scripts\zone\ungoro_crater\ungoro_crater.cpp" > </File> </Filter> <Filter - Name="Mana Tombs" + Name="Thunder Bluff" > <File - RelativePath="..\scripts\zone\aunchindoun\mana_tombs\boss_nexusprince_shaffar.cpp" + RelativePath="..\scripts\zone\thunder_bluff\thunder_bluff.cpp" > </File> + </Filter> + <Filter + Name="Thousand Needles" + > <File - RelativePath="..\scripts\zone\aunchindoun\mana_tombs\boss_pandemonius.cpp" + RelativePath="..\scripts\zone\thousand_needles\thousand_needles.cpp" > </File> </Filter> <Filter - Name="Sethekk Halls" + Name="Temple of Ahn'Qiraj" > <File - RelativePath="..\scripts\zone\aunchindoun\sethekk_halls\boss_darkweaver_syth.cpp" + RelativePath="..\scripts\zone\temple_of_ahnqiraj\boss_bug_trio.cpp" > </File> <File - RelativePath="..\scripts\zone\aunchindoun\sethekk_halls\boss_tailonking_ikiss.cpp" + RelativePath="..\scripts\zone\temple_of_ahnqiraj\boss_cthun.cpp" > </File> <File - RelativePath="..\scripts\zone\aunchindoun\sethekk_halls\def_sethekk_halls.h" + RelativePath="..\scripts\zone\temple_of_ahnqiraj\boss_fankriss.cpp" > </File> <File - RelativePath="..\scripts\zone\aunchindoun\sethekk_halls\instance_sethekk_halls.cpp" + RelativePath="..\scripts\zone\temple_of_ahnqiraj\boss_huhuran.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\temple_of_ahnqiraj\boss_ouro.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\temple_of_ahnqiraj\boss_sartura.cpp" > </File> - </Filter> - <Filter - Name="Shadow Labyrinth" - > <File - RelativePath="..\scripts\zone\aunchindoun\shadow_labyrinth\boss_ambassador_hellmaw.cpp" + RelativePath="..\scripts\zone\temple_of_ahnqiraj\boss_skeram.cpp" > </File> <File - RelativePath="..\scripts\zone\aunchindoun\shadow_labyrinth\boss_blackheart_the_inciter.cpp" + RelativePath="..\scripts\zone\temple_of_ahnqiraj\boss_twinemperors.cpp" > </File> <File - RelativePath="..\scripts\zone\aunchindoun\shadow_labyrinth\boss_grandmaster_vorpil.cpp" + RelativePath="..\scripts\zone\temple_of_ahnqiraj\boss_viscidus.cpp" > </File> <File - RelativePath="..\scripts\zone\aunchindoun\shadow_labyrinth\boss_murmur.cpp" + RelativePath="..\scripts\zone\temple_of_ahnqiraj\def_temple_of_ahnqiraj.h" > </File> <File - RelativePath="..\scripts\zone\aunchindoun\shadow_labyrinth\def_shadow_labyrinth.h" + RelativePath="..\scripts\zone\temple_of_ahnqiraj\instance_temple_of_ahnqiraj.cpp" > </File> <File - RelativePath="..\scripts\zone\aunchindoun\shadow_labyrinth\instance_shadow_labyrinth.cpp" + RelativePath="..\scripts\zone\temple_of_ahnqiraj\mob_anubisath_sentinel.cpp" > </File> </Filter> - </Filter> - <Filter - Name="Azuremyst Isle" - > - <File - RelativePath="..\scripts\zone\azuremyst_isle\azuremyst_isle.cpp" - > - </File> - </Filter> - <Filter - Name="Black Temple" - > - <File - RelativePath="..\scripts\zone\black_temple\black_temple.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\black_temple\boss_bloodboil.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\black_temple\boss_illidan.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\black_temple\boss_mother_shahraz.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\black_temple\boss_reliquary_of_souls.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\black_temple\boss_shade_of_akama.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\black_temple\boss_supremus.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\black_temple\boss_teron_gorefiend.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\black_temple\boss_warlord_najentus.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\black_temple\def_black_temple.h" - > - </File> - <File - RelativePath="..\scripts\zone\black_temple\illidari_council.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\black_temple\instance_black_temple.cpp" - > - </File> - </Filter> - <Filter - Name="Eversong Woods" - > - <File - RelativePath="..\scripts\zone\eversong_woods\eversong_woods.cpp" - > - </File> - </Filter> - <Filter - Name="Ghostlands" - > - <File - RelativePath="..\scripts\zone\ghostlands\ghostlands.cpp" - > - </File> - </Filter> - <Filter - Name="Blade's Edge Mountains" - > - <File - RelativePath="..\scripts\zone\blades_edge_mountains\blades_edge_mountains.cpp" + <Filter + Name="Teldrassil" > - </File> - </Filter> - <Filter - Name="Blasted Lands" - > - <File - RelativePath="..\scripts\zone\blasted_lands\blasted_lands.cpp" + <File + RelativePath="..\scripts\zone\teldrassil\teldrassil.cpp" + > + </File> + </Filter> + <Filter + Name="Tanaris" > - </File> - <File - RelativePath="..\scripts\zone\blasted_lands\boss_kruul.cpp" + <File + RelativePath="..\scripts\zone\tanaris\tanaris.cpp" + > + </File> + </Filter> + <Filter + Name="Stonetalon Mountains" > - </File> + <File + RelativePath="..\scripts\zone\stonetalon_mountains\stonetalon_mountains.cpp" + > + </File> + </Filter> </Filter> <Filter - Name="Hellfire Citadel" + Name="Azeroth" > <Filter - Name="Blood Furnace" + Name="Molten Core" > <File - RelativePath="..\scripts\zone\hellfire_citadel\blood_furnace\boss_broggok.cpp" + RelativePath="..\scripts\zone\molten_core\boss_baron_geddon.cpp" > </File> <File - RelativePath="..\scripts\zone\hellfire_citadel\blood_furnace\boss_kelidan_the_breaker.cpp" + RelativePath="..\scripts\zone\molten_core\boss_garr.cpp" > </File> <File - RelativePath="..\scripts\zone\hellfire_citadel\blood_furnace\boss_the_maker.cpp" + RelativePath="..\scripts\zone\molten_core\boss_gehennas.cpp" > </File> <File - RelativePath="..\scripts\zone\hellfire_citadel\blood_furnace\def_blood_furnace.h" + RelativePath="..\scripts\zone\molten_core\boss_golemagg.cpp" > </File> <File - RelativePath="..\scripts\zone\hellfire_citadel\blood_furnace\instance_blood_furnace.cpp" + RelativePath="..\scripts\zone\molten_core\boss_lucifron.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\molten_core\boss_magmadar.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\molten_core\boss_majordomo_executus.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\molten_core\boss_ragnaros.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\molten_core\boss_shazzrah.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\molten_core\boss_sulfuron_harbinger.cpp" > </File> - </Filter> - <Filter - Name="Magtheridon's lair" - > <File - RelativePath="..\scripts\zone\hellfire_citadel\magtheridons_lair\boss_magtheridon.cpp" + RelativePath="..\scripts\zone\molten_core\def_molten_core.h" > </File> <File - RelativePath="..\scripts\zone\hellfire_citadel\magtheridons_lair\def_magtheridons_lair.h" + RelativePath="..\scripts\zone\molten_core\instance_molten_core.cpp" > </File> <File - RelativePath="..\scripts\zone\hellfire_citadel\magtheridons_lair\instance_magtheridons_lair.cpp" + RelativePath="..\scripts\zone\molten_core\molten_core.cpp" > </File> </Filter> <Filter - Name="Hellfire Ramparts" + Name="Magister's Terrace" > <File - RelativePath="..\scripts\zone\hellfire_citadel\hellfire_ramparts\boss_omor_the_unscarred.cpp" + RelativePath="..\scripts\zone\magisters_terrace\boss_felblood_kaelthas.cpp" > </File> <File - RelativePath="..\scripts\zone\hellfire_citadel\hellfire_ramparts\boss_watchkeeper_gargolmar.cpp" + RelativePath="..\scripts\zone\magisters_terrace\boss_priestess_delrissa.cpp" > </File> <File - RelativePath="..\scripts\zone\hellfire_citadel\hellfire_ramparts\boss_vazruden_the_herald.cpp" + RelativePath="..\scripts\zone\magisters_terrace\boss_selin_fireheart.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\magisters_terrace\boss_vexallus.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\magisters_terrace\def_magisters_terrace.h" + > + </File> + <File + RelativePath="..\scripts\zone\magisters_terrace\instance_magisters_terrace.cpp" > </File> </Filter> <Filter - Name="Shattered Halls" + Name="Loch Modan" > <File - RelativePath="..\scripts\zone\hellfire_citadel\shattered_halls\boss_nethekurse.cpp" + RelativePath="..\scripts\zone\loch_modan\loch_modan.cpp" + > + </File> + </Filter> + <Filter + Name="Karazhan" + > + <File + RelativePath="..\scripts\zone\karazhan\boss_curator.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\karazhan\boss_maiden_of_virtue.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\karazhan\boss_midnight.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\karazhan\boss_moroes.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\karazhan\boss_netherspite.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\karazhan\boss_nightbane.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\karazhan\boss_prince_malchezaar.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\karazhan\boss_shade_of_aran.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\karazhan\boss_terestian_illhoof.cpp" > </File> <File - RelativePath="..\scripts\zone\hellfire_citadel\shattered_halls\boss_warbringer_omrogg.cpp" + RelativePath="..\scripts\zone\karazhan\bosses_opera.cpp" > </File> <File - RelativePath="..\scripts\zone\hellfire_citadel\shattered_halls\boss_warchief_kargath_bladefist.cpp" + RelativePath="..\scripts\zone\karazhan\def_karazhan.h" > </File> <File - RelativePath="..\scripts\zone\hellfire_citadel\shattered_halls\def_shattered_halls.h" + RelativePath="..\scripts\zone\karazhan\instance_karazhan.cpp" > </File> <File - RelativePath="..\scripts\zone\hellfire_citadel\shattered_halls\instance_shattered_halls.cpp" + RelativePath="..\scripts\zone\karazhan\karazhan.cpp" > </File> </Filter> - </Filter> - <Filter - Name="Hellfire Peninsula" - > - <File - RelativePath="..\scripts\zone\hellfire_peninsula\boss_doomlord_kazzak.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\hellfire_peninsula\hellfire_peninsula.cpp" - > - </File> - </Filter> - <Filter - Name="Karazhan" - > - <File - RelativePath="..\scripts\zone\karazhan\boss_curator.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\karazhan\boss_maiden_of_virtue.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\karazhan\boss_midnight.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\karazhan\boss_moroes.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\karazhan\boss_netherspite.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\karazhan\boss_nightbane.cpp" + <Filter + Name="Isle of Quel'Danas" > - </File> - <File - RelativePath="..\scripts\zone\karazhan\boss_prince_malchezaar.cpp" + <File + RelativePath="..\scripts\zone\isle_of_queldanas\isle_of_queldanas.cpp" + > + </File> + </Filter> + <Filter + Name="Hinterlands" > - </File> - <File - RelativePath="..\scripts\zone\karazhan\boss_shade_of_aran.cpp" + </Filter> + <Filter + Name="Iron Forge" > - </File> - <File - RelativePath="..\scripts\zone\karazhan\boss_terestian_illhoof.cpp" + <File + RelativePath="..\scripts\zone\ironforge\ironforge.cpp" + > + </File> + </Filter> + <Filter + Name="Hillsbrad Foothills" > - </File> - <File - RelativePath="..\scripts\zone\karazhan\bosses_opera.cpp" + </Filter> + <Filter + Name="Gnomeregan" > - </File> - <File - RelativePath="..\scripts\zone\karazhan\def_karazhan.h" + </Filter> + <Filter + Name="Ghostlands" > - </File> - <File - RelativePath="..\scripts\zone\karazhan\instance_karazhan.cpp" + <File + RelativePath="..\scripts\zone\ghostlands\ghostlands.cpp" + > + </File> + </Filter> + <Filter + Name="Elwynn Forest" > - </File> - <File - RelativePath="..\scripts\zone\karazhan\karazhan.cpp" + <File + RelativePath="..\scripts\zone\elwynn_forest\elwynn_forest.cpp" + > + </File> + </Filter> + <Filter + Name="Deadmines" > - </File> - </Filter> - <Filter - Name="Nagrand" - > - <File - RelativePath="..\scripts\zone\nagrand\nagrand.cpp" + <File + RelativePath="..\scripts\zone\deadmines\deadmines.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\deadmines\def_deadmines.h" + > + </File> + </Filter> + <Filter + Name="Deadwind Pass" > - </File> - </Filter> - <Filter - Name="Netherstorm" - > - <File - RelativePath="..\scripts\zone\netherstorm\netherstorm.cpp" + </Filter> + <Filter + Name="Dun Morogh" > - </File> - </Filter> - <Filter - Name="Shadowmoon Valley" - > - <File - RelativePath="..\scripts\zone\shadowmoon_valley\boss_doomwalker.cpp" + <File + RelativePath="..\scripts\zone\dun_morogh\dun_morogh.cpp" + > + </File> + </Filter> + <Filter + Name="Alterac Mountains" > - </File> - <File - RelativePath="..\scripts\zone\shadowmoon_valley\shadowmoon_valley.cpp" + <File + RelativePath="..\scripts\zone\alterac_mountains\alterac_mountains.cpp" + > + </File> + </Filter> + <Filter + Name="Arathi Highlands" > - </File> - </Filter> - <Filter - Name="Tempest Keep" - > + <File + RelativePath="..\scripts\zone\arathi_highlands\arathi_highlands.cpp" + > + </File> + </Filter> <Filter - Name="Arcatraz" + Name="Blackrock Depths" > <File - RelativePath="..\scripts\zone\tempest_keep\arcatraz\arcatraz.cpp" + RelativePath="..\scripts\zone\blackrock_depths\blackrock_depths.cpp" > </File> <File - RelativePath="..\scripts\zone\tempest_keep\arcatraz\boss_harbinger_skyriss.cpp" + RelativePath="..\scripts\zone\blackrock_depths\boss_ambassador_flamelash.cpp" > </File> <File - RelativePath="..\scripts\zone\tempest_keep\arcatraz\def_arcatraz.h" + RelativePath="..\scripts\zone\blackrock_depths\boss_anubshiah.cpp" > </File> <File - RelativePath="..\scripts\zone\tempest_keep\arcatraz\instance_arcatraz.cpp" + RelativePath="..\scripts\zone\blackrock_depths\boss_emperor_dagran_thaurissan.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\blackrock_depths\boss_general_angerforge.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\blackrock_depths\boss_gorosh_the_dervish.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\blackrock_depths\boss_grizzle.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\blackrock_depths\boss_high_interrogator_gerstahn.cpp" > </File> - </Filter> - <Filter - Name="Botanica" - > <File - RelativePath="..\scripts\zone\tempest_keep\botanica\boss_high_botanist_freywinn.cpp" + RelativePath="..\scripts\zone\blackrock_depths\boss_magmus.cpp" > </File> <File - RelativePath="..\scripts\zone\tempest_keep\botanica\boss_laj.cpp" + RelativePath="..\scripts\zone\blackrock_depths\boss_moira_bronzebeard.cpp" > </File> <File - RelativePath="..\scripts\zone\tempest_keep\botanica\boss_warp_splinter.cpp" + RelativePath="..\scripts\zone\blackrock_depths\boss_tomb_of_seven.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\blackrock_depths\def_blackrock_depths.h" + > + </File> + <File + RelativePath="..\scripts\zone\blackrock_depths\instance_blackrock_depths.cpp" > </File> </Filter> <Filter - Name="The Eye" + Name="Blackrock Spire" > <File - RelativePath="..\scripts\zone\tempest_keep\the_eye\boss_alar.cpp" + RelativePath="..\scripts\zone\blackrock_spire\boss_drakkisath.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\blackrock_spire\boss_gyth.cpp" > </File> <File - RelativePath="..\scripts\zone\tempest_keep\the_eye\boss_astromancer.cpp" + RelativePath="..\scripts\zone\blackrock_spire\boss_halycon.cpp" > </File> <File - RelativePath="..\scripts\zone\tempest_keep\the_eye\boss_kaelthas.cpp" + RelativePath="..\scripts\zone\blackrock_spire\boss_highlord_omokk.cpp" > </File> <File - RelativePath="..\scripts\zone\tempest_keep\the_eye\boss_void_reaver.cpp" + RelativePath="..\scripts\zone\blackrock_spire\boss_mother_smolderweb.cpp" > </File> <File - RelativePath="..\scripts\zone\tempest_keep\the_eye\def_the_eye.h" + RelativePath="..\scripts\zone\blackrock_spire\boss_overlord_wyrmthalak.cpp" > </File> <File - RelativePath="..\scripts\zone\tempest_keep\the_eye\instance_the_eye.cpp" + RelativePath="..\scripts\zone\blackrock_spire\boss_pyroguard_emberseer.cpp" > </File> <File - RelativePath="..\scripts\zone\tempest_keep\the_eye\the_eye.cpp" + RelativePath="..\scripts\zone\blackrock_spire\boss_quartermaster_zigris.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\blackrock_spire\boss_rend_blackhand.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\blackrock_spire\boss_shadow_hunter_voshgajin.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\blackrock_spire\boss_the_beast.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\blackrock_spire\boss_warmaster_voone.cpp" > </File> </Filter> <Filter - Name="The Mechanar" + Name="Blackwing Lair" > <File - RelativePath="..\scripts\zone\tempest_keep\the_mechanar\boss_gatewatcher_gyrokill.cpp" + RelativePath="..\scripts\zone\blackwing_lair\boss_broodlord_lashlayer.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\blackwing_lair\boss_chromaggus.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\blackwing_lair\boss_ebonroc.cpp" > </File> <File - RelativePath="..\scripts\zone\tempest_keep\the_mechanar\boss_gatewatcher_ironhand.cpp" + RelativePath="..\scripts\zone\blackwing_lair\boss_firemaw.cpp" > </File> <File - RelativePath="..\scripts\zone\tempest_keep\the_mechanar\boss_nethermancer_sepethrea.cpp" + RelativePath="..\scripts\zone\blackwing_lair\boss_flamegor.cpp" > </File> <File - RelativePath="..\scripts\zone\tempest_keep\the_mechanar\boss_pathaleon_the_calculator.cpp" + RelativePath="..\scripts\zone\blackwing_lair\boss_nefarian.cpp" > </File> <File - RelativePath="..\scripts\zone\tempest_keep\the_mechanar\def_mechanar.h" + RelativePath="..\scripts\zone\blackwing_lair\boss_razorgore.cpp" > </File> <File - RelativePath="..\scripts\zone\tempest_keep\the_mechanar\instance_mechanar.cpp" + RelativePath="..\scripts\zone\blackwing_lair\boss_vaelastrasz.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\blackwing_lair\boss_victor_nefarius.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\blackwing_lair\instance_blackwing_lair.cpp" > </File> </Filter> - </Filter> - <Filter - Name="Terokkar Forest" - > - <File - RelativePath="..\scripts\zone\terokkar_forest\terokkar_forest.cpp" - > - </File> - </Filter> - <Filter - Name="Zangarmarsh" - > - <File - RelativePath="..\scripts\zone\zangarmarsh\zangarmarsh.cpp" - > - </File> - </Filter> - <Filter - Name="Blackrock Spire" - > - <File - RelativePath="..\scripts\zone\blackrock_spire\boss_drakkisath.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\blackrock_spire\boss_gyth.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\blackrock_spire\boss_halycon.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\blackrock_spire\boss_highlord_omokk.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\blackrock_spire\boss_mother_smolderweb.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\blackrock_spire\boss_overlord_wyrmthalak.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\blackrock_spire\boss_pyroguard_emberseer.cpp" + <Filter + Name="Blasted Lands" > - </File> - <File - RelativePath="..\scripts\zone\blackrock_spire\boss_quartermaster_zigris.cpp" + <File + RelativePath="..\scripts\zone\blasted_lands\blasted_lands.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\blasted_lands\boss_kruul.cpp" + > + </File> + </Filter> + <Filter + Name="Burning Steppes" > - </File> - <File - RelativePath="..\scripts\zone\blackrock_spire\boss_rend_blackhand.cpp" + <File + RelativePath="..\scripts\zone\burning_steppes\burning_steppes.cpp" + > + </File> + </Filter> + <Filter + Name="Duskwood" > - </File> - <File - RelativePath="..\scripts\zone\blackrock_spire\boss_shadow_hunter_voshgajin.cpp" + </Filter> + <Filter + Name="Eastern Plaguelands" > - </File> - <File - RelativePath="..\scripts\zone\blackrock_spire\boss_the_beast.cpp" + <File + RelativePath="..\scripts\zone\eastern_plaguelands\eastern_plaguelands.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\eastern_plaguelands\the_scarlet_enclave.cpp" + > + </File> + </Filter> + <Filter + Name="Eversong Woods" > - </File> - <File - RelativePath="..\scripts\zone\blackrock_spire\boss_warmaster_voone.cpp" + <File + RelativePath="..\scripts\zone\eversong_woods\eversong_woods.cpp" + > + </File> + </Filter> + <Filter + Name="Redridge Mountains" > - </File> - </Filter> - <Filter - Name="Stormwind City" - > - <File - RelativePath="..\scripts\zone\stormwind\stormwind_city.cpp" + </Filter> + <Filter + Name="Scarlet Monastery" > - </File> - </Filter> - <Filter - Name="Coilfang Resevoir" - > + <File + RelativePath="..\scripts\zone\scarlet_monastery\boss_arcanist_doan.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\scarlet_monastery\boss_azshir_the_sleepless.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\scarlet_monastery\boss_bloodmage_thalnos.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\scarlet_monastery\boss_headless_horseman.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\scarlet_monastery\boss_herod.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\scarlet_monastery\boss_high_inquisitor_fairbanks.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\scarlet_monastery\boss_houndmaster_loksey.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\scarlet_monastery\boss_interrogator_vishas.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\scarlet_monastery\boss_mograine_and_whitemane.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\scarlet_monastery\boss_scorn.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\scarlet_monastery\def_scarlet_monastery.h" + > + </File> + <File + RelativePath="..\scripts\zone\scarlet_monastery\instance_scarlet_monastery.cpp" + > + </File> + </Filter> <Filter - Name="Serpent Shrine Cavern" + Name="Scholomance" > <File - RelativePath="..\scripts\zone\coilfang_resevoir\serpent_shrine\boss_fathomlord_karathress.cpp" + RelativePath="..\scripts\zone\scholomance\boss_darkmaster_gandling.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\scholomance\boss_death_knight_darkreaver.cpp" > </File> <File - RelativePath="..\scripts\zone\coilfang_resevoir\serpent_shrine\boss_hydross_the_unstable.cpp" + RelativePath="..\scripts\zone\scholomance\boss_doctor_theolen_krastinov.cpp" > </File> <File - RelativePath="..\scripts\zone\coilfang_resevoir\serpent_shrine\boss_lady_vashj.cpp" + RelativePath="..\scripts\zone\scholomance\boss_illucia_barov.cpp" > </File> <File - RelativePath="..\scripts\zone\coilfang_resevoir\serpent_shrine\boss_leotheras_the_blind.cpp" + RelativePath="..\scripts\zone\scholomance\boss_instructor_malicia.cpp" > </File> <File - RelativePath="..\scripts\zone\coilfang_resevoir\serpent_shrine\boss_lurker_below.cpp" + RelativePath="..\scripts\zone\scholomance\boss_jandice_barov.cpp" > </File> <File - RelativePath="..\scripts\zone\coilfang_resevoir\serpent_shrine\boss_morogrim_tidewalker.cpp" + RelativePath="..\scripts\zone\scholomance\boss_kormok.cpp" > </File> <File - RelativePath="..\scripts\zone\coilfang_resevoir\serpent_shrine\def_serpent_shrine.h" + RelativePath="..\scripts\zone\scholomance\boss_lord_alexei_barov.cpp" > </File> <File - RelativePath="..\scripts\zone\coilfang_resevoir\serpent_shrine\instance_serpent_shrine.cpp" + RelativePath="..\scripts\zone\scholomance\boss_lorekeeper_polkelt.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\scholomance\boss_ras_frostwhisper.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\scholomance\boss_the_ravenian.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\scholomance\boss_vectus.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\scholomance\def_scholomance.h" + > + </File> + <File + RelativePath="..\scripts\zone\scholomance\instance_scholomance.cpp" > </File> </Filter> <Filter - Name="Slave Pens" + Name="Searing Gorge" > + <File + RelativePath="..\scripts\zone\searing_gorge\searing_gorge.cpp" + > + </File> </Filter> <Filter - Name="Steam Vault" + Name="Shadowfang Keep" > <File - RelativePath="..\scripts\zone\coilfang_resevoir\steam_vault\boss_hydromancer_thespia.cpp" + RelativePath="..\scripts\zone\shadowfang_keep\def_shadowfang_keep.h" > </File> <File - RelativePath="..\scripts\zone\coilfang_resevoir\steam_vault\boss_mekgineer_steamrigger.cpp" + RelativePath="..\scripts\zone\shadowfang_keep\instance_shadowfang_keep.cpp" > </File> <File - RelativePath="..\scripts\zone\coilfang_resevoir\steam_vault\boss_warlord_kalithresh.cpp" + RelativePath="..\scripts\zone\shadowfang_keep\shadowfang_keep.cpp" > </File> + </Filter> + <Filter + Name="Silvermoon City" + > <File - RelativePath="..\scripts\zone\coilfang_resevoir\steam_vault\def_steam_vault.h" + RelativePath="..\scripts\zone\silvermoon\silvermoon_city.cpp" > </File> + </Filter> + <Filter + Name="Silverpine Forest" + > <File - RelativePath="..\scripts\zone\coilfang_resevoir\steam_vault\instance_steam_vault.cpp" + RelativePath="..\scripts\zone\silverpine_forest\silverpine_forest.cpp" > </File> </Filter> <Filter - Name="Underbog" + Name="Stockade" + > + </Filter> + <Filter + Name="Stormwind City" > <File - RelativePath="..\scripts\zone\coilfang_resevoir\underbog\boss_hungarfen.cpp" + RelativePath="..\scripts\zone\stormwind\stormwind_city.cpp" > </File> + </Filter> + <Filter + Name="Stranglethorn Vale" + > <File - RelativePath="..\scripts\zone\coilfang_resevoir\underbog\boss_the_black_stalker.cpp" + RelativePath="..\scripts\zone\stranglethorn_vale\stranglethorn_vale.cpp" > </File> </Filter> - </Filter> - <Filter - Name="Caverns of Time" - > <Filter - Name="The Dark Portal" + Name="Stratholme" > <File - RelativePath="..\scripts\zone\caverns_of_time\dark_portal\boss_aeonus.cpp" + RelativePath="..\scripts\zone\stratholme\boss_baron_rivendare.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\stratholme\boss_baroness_anastari.cpp" > </File> <File - RelativePath="..\scripts\zone\caverns_of_time\dark_portal\boss_chrono_lord_deja.cpp" + RelativePath="..\scripts\zone\stratholme\boss_cannon_master_willey.cpp" > </File> <File - RelativePath="..\scripts\zone\caverns_of_time\dark_portal\boss_temporus.cpp" + RelativePath="..\scripts\zone\stratholme\boss_dathrohan_balnazzar.cpp" > </File> <File - RelativePath="..\scripts\zone\caverns_of_time\dark_portal\dark_portal.cpp" + RelativePath="..\scripts\zone\stratholme\boss_magistrate_barthilas.cpp" > </File> <File - RelativePath="..\scripts\zone\caverns_of_time\dark_portal\def_dark_portal.h" + RelativePath="..\scripts\zone\stratholme\boss_maleki_the_pallid.cpp" > </File> <File - RelativePath="..\scripts\zone\caverns_of_time\dark_portal\instance_dark_portal.cpp" + RelativePath="..\scripts\zone\stratholme\boss_nerubenkan.cpp" > </File> + <File + RelativePath="..\scripts\zone\stratholme\boss_order_of_silver_hand.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\stratholme\boss_postmaster_malown.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\stratholme\boss_ramstein_the_gorger.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\stratholme\boss_timmy_the_cruel.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\stratholme\def_stratholme.h" + > + </File> + <File + RelativePath="..\scripts\zone\stratholme\instance_stratholme.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\stratholme\stratholme.cpp" + > + </File> + </Filter> + <Filter + Name="Sunken Temple" + > </Filter> <Filter - Name="Battle for Mt. Hyjal" + Name="Sunwell Plateau" > <File - RelativePath="..\scripts\zone\caverns_of_time\hyjal\boss_anetheron.cpp" + RelativePath="..\scripts\zone\sunwell_plateau\boss_brutallus.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\sunwell_plateau\boss_eredar_twins.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\sunwell_plateau\boss_felmyst.cpp" > </File> <File - RelativePath="..\scripts\zone\caverns_of_time\hyjal\boss_archimonde.cpp" + RelativePath="..\scripts\zone\sunwell_plateau\boss_kalecgos.cpp" > </File> <File - RelativePath="..\scripts\zone\caverns_of_time\hyjal\boss_azgalor.cpp" + RelativePath="..\scripts\zone\sunwell_plateau\boss_kiljaeden.cpp" > </File> <File - RelativePath="..\scripts\zone\caverns_of_time\hyjal\boss_kazrogal.cpp" + RelativePath="..\scripts\zone\sunwell_plateau\boss_muru.cpp" > </File> <File - RelativePath="..\scripts\zone\caverns_of_time\hyjal\boss_rage_winterchill.cpp" + RelativePath="..\scripts\zone\sunwell_plateau\def_sunwell_plateau.h" > </File> <File - RelativePath="..\scripts\zone\caverns_of_time\hyjal\def_hyjal.h" + RelativePath="..\scripts\zone\sunwell_plateau\instance_sunwell_plateau.cpp" > </File> <File - RelativePath="..\scripts\zone\caverns_of_time\hyjal\hyjal.cpp" + RelativePath="..\scripts\zone\sunwell_plateau\sunwell_plateau.cpp" > </File> + </Filter> + <Filter + Name="Swamp of Sorrows" + > + </Filter> + <Filter + Name="Zul'Gurub" + > <File - RelativePath="..\scripts\zone\caverns_of_time\hyjal\hyjal_trash.cpp" + RelativePath="..\scripts\zone\zulgurub\boss_arlokk.cpp" > </File> <File - RelativePath="..\scripts\zone\caverns_of_time\hyjal\hyjal_trash.h" + RelativePath="..\scripts\zone\zulgurub\boss_gahzranka.cpp" > </File> <File - RelativePath="..\scripts\zone\caverns_of_time\hyjal\hyjalAI.cpp" + RelativePath="..\scripts\zone\zulgurub\boss_grilek.cpp" > </File> <File - RelativePath="..\scripts\zone\caverns_of_time\hyjal\hyjalAI.h" + RelativePath="..\scripts\zone\zulgurub\boss_hakkar.cpp" > </File> <File - RelativePath="..\scripts\zone\caverns_of_time\hyjal\instance_hyjal.cpp" + RelativePath="..\scripts\zone\zulgurub\boss_hazzarah.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\zulgurub\boss_jeklik.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\zulgurub\boss_jindo.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\zulgurub\boss_mandokir.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\zulgurub\boss_marli.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\zulgurub\boss_renataki.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\zulgurub\boss_thekal.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\zulgurub\boss_venoxis.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\zulgurub\boss_wushoolay.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\zulgurub\def_zulgurub.h" + > + </File> + <File + RelativePath="..\scripts\zone\zulgurub\instance_zulgurub.cpp" > </File> </Filter> - <Filter - Name="Old Hillsbrad" + Name="Zul'Aman" > <File - RelativePath="..\scripts\zone\caverns_of_time\old_hillsbrad\boss_captain_skarloc.cpp" + RelativePath="..\scripts\zone\zulaman\boss_akilzon.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\zulaman\boss_halazzi.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\zulaman\boss_hexlord.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\zulaman\boss_janalai.cpp" > </File> <File - RelativePath="..\scripts\zone\caverns_of_time\old_hillsbrad\boss_epoch_hunter.cpp" + RelativePath="..\scripts\zone\zulaman\boss_nalorakk.cpp" > </File> <File - RelativePath="..\scripts\zone\caverns_of_time\old_hillsbrad\boss_leutenant_drake.cpp" + RelativePath="..\scripts\zone\zulaman\boss_zuljin.cpp" > </File> <File - RelativePath="..\scripts\zone\caverns_of_time\old_hillsbrad\def_old_hillsbrad.h" + RelativePath="..\scripts\zone\zulaman\def_zulaman.h" > </File> <File - RelativePath="..\scripts\zone\caverns_of_time\old_hillsbrad\instance_old_hillsbrad.cpp" + RelativePath="..\scripts\zone\zulaman\instance_zulaman.cpp" > </File> <File - RelativePath="..\scripts\zone\caverns_of_time\old_hillsbrad\old_hillsbrad.cpp" + RelativePath="..\scripts\zone\zulaman\zulaman.cpp" > </File> </Filter> - </Filter> - <Filter - Name="Silvermoon City" - > - <File - RelativePath="..\scripts\zone\silvermoon\silvermoon_city.cpp" - > - </File> - </Filter> - <Filter - Name="Darnassus" - > - </Filter> - <Filter - Name="Exodar" - > - </Filter> - <Filter - Name="Iron Forge" - > - <File - RelativePath="..\scripts\zone\ironforge\ironforge.cpp" - > - </File> - </Filter> - <Filter - Name="Orgrimmar" - > - <File - RelativePath="..\scripts\zone\orgrimmar\orgrimmar.cpp" - > - </File> - </Filter> - <Filter - Name="Shattrath City" - > - <File - RelativePath="..\scripts\zone\shattrath\shattrath_city.cpp" - > - </File> - </Filter> - <Filter - Name="Thunder Bluff" - > - <File - RelativePath="..\scripts\zone\thunder_bluff\thunder_bluff.cpp" - > - </File> - </Filter> - <Filter - Name="Undercity" - > - <File - RelativePath="..\scripts\zone\undercity\undercity.cpp" - > - </File> - </Filter> - <Filter - Name="Zul'Aman" - > - <File - RelativePath="..\scripts\zone\zulaman\boss_akilzon.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\zulaman\boss_halazzi.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\zulaman\boss_hexlord.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\zulaman\boss_janalai.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\zulaman\boss_nalorakk.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\zulaman\boss_zuljin.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\zulaman\def_zulaman.h" - > - </File> - <File - RelativePath="..\scripts\zone\zulaman\instance_zulaman.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\zulaman\zulaman.cpp" - > - </File> - </Filter> - <Filter - Name="Isle of Quel'Danas" - > - <File - RelativePath="..\scripts\zone\isle_of_queldanas\isle_of_queldanas.cpp" - > - </File> - </Filter> - <Filter - Name="Magister's Terrace" - > - <File - RelativePath="..\scripts\zone\magisters_terrace\boss_felblood_kaelthas.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\magisters_terrace\boss_priestess_delrissa.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\magisters_terrace\boss_selin_fireheart.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\magisters_terrace\boss_vexallus.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\magisters_terrace\def_magisters_terrace.h" - > - </File> - <File - RelativePath="..\scripts\zone\magisters_terrace\instance_magisters_terrace.cpp" - > - </File> - </Filter> - <Filter - Name="Sunwell Plateau" - > - <File - RelativePath="..\scripts\zone\sunwell_plateau\boss_brutallus.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\sunwell_plateau\boss_eredar_twins.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\sunwell_plateau\boss_felmyst.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\sunwell_plateau\boss_kalecgos.cpp" + <Filter + Name="Wetlands" > - </File> - <File - RelativePath="..\scripts\zone\sunwell_plateau\boss_muru.cpp" + </Filter> + <Filter + Name="Westfall" > - </File> - <File - RelativePath="..\scripts\zone\sunwell_plateau\boss_kiljaeden.cpp" + <File + RelativePath="..\scripts\zone\westfall\westfall.cpp" + > + </File> + </Filter> + <Filter + Name="Western Plaguelands" > - </File> - <File - RelativePath="..\scripts\zone\sunwell_plateau\sunwell_plateau.cpp" + <File + RelativePath="..\scripts\zone\western_plaguelands\western_plaguelands.cpp" + > + </File> + </Filter> + <Filter + Name="Undercity" > - </File> - <File - RelativePath="..\scripts\zone\sunwell_plateau\def_sunwell_plateau.h" + <File + RelativePath="..\scripts\zone\undercity\undercity.cpp" + > + </File> + </Filter> + <Filter + Name="Uldaman" > - </File> - <File - RelativePath="..\scripts\zone\sunwell_plateau\instance_sunwell_plateau.cpp" + <File + RelativePath="..\scripts\zone\uldaman\boss_archaedas.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\uldaman\boss_ironaya.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\uldaman\instance_uldaman.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\uldaman\uldaman.cpp" + > + </File> + </Filter> + <Filter + Name="Tirisfal Glades" > - </File> + <File + RelativePath="..\scripts\zone\tirisfal_glades\tirisfal_glades.cpp" + > + </File> + </Filter> </Filter> <Filter - Name="Blackrock Depths" + Name="Outland" > - <File - RelativePath="..\scripts\zone\blackrock_depths\blackrock_depths.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\blackrock_depths\def_blackrock_depths.h" - > - </File> - <File - RelativePath="..\scripts\zone\blackrock_depths\instance_blackrock_depths.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\blackrock_depths\boss_ambassador_flamelash.cpp" + <Filter + Name="Netherstorm" > - </File> - <File - RelativePath="..\scripts\zone\blackrock_depths\boss_anubshiah.cpp" + <File + RelativePath="..\scripts\zone\netherstorm\netherstorm.cpp" + > + </File> + </Filter> + <Filter + Name="Nagrand" > - </File> - <File - RelativePath="..\scripts\zone\blackrock_depths\boss_emperor_dagran_thaurissan.cpp" + <File + RelativePath="..\scripts\zone\nagrand\nagrand.cpp" + > + </File> + </Filter> + <Filter + Name="Gruul's Lair" > - </File> - <File - RelativePath="..\scripts\zone\blackrock_depths\boss_general_angerforge.cpp" + <File + RelativePath="..\scripts\zone\gruuls_lair\boss_gruul.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\gruuls_lair\boss_high_king_maulgar.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\gruuls_lair\def_gruuls_lair.h" + > + </File> + <File + RelativePath="..\scripts\zone\gruuls_lair\instance_gruuls_lair.cpp" + > + </File> + </Filter> + <Filter + Name="Hellfire Citadel" + > + <Filter + Name="Blood Furnace" + > + <File + RelativePath="..\scripts\zone\hellfire_citadel\blood_furnace\boss_broggok.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\hellfire_citadel\blood_furnace\boss_kelidan_the_breaker.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\hellfire_citadel\blood_furnace\boss_the_maker.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\hellfire_citadel\blood_furnace\def_blood_furnace.h" + > + </File> + <File + RelativePath="..\scripts\zone\hellfire_citadel\blood_furnace\instance_blood_furnace.cpp" + > + </File> + </Filter> + <Filter + Name="Magtheridon's lair" + > + <File + RelativePath="..\scripts\zone\hellfire_citadel\magtheridons_lair\boss_magtheridon.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\hellfire_citadel\magtheridons_lair\def_magtheridons_lair.h" + > + </File> + <File + RelativePath="..\scripts\zone\hellfire_citadel\magtheridons_lair\instance_magtheridons_lair.cpp" + > + </File> + </Filter> + <Filter + Name="Hellfire Ramparts" + > + <File + RelativePath="..\scripts\zone\hellfire_citadel\hellfire_ramparts\boss_omor_the_unscarred.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\hellfire_citadel\hellfire_ramparts\boss_vazruden_the_herald.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\hellfire_citadel\hellfire_ramparts\boss_watchkeeper_gargolmar.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\hellfire_citadel\hellfire_ramparts\def_hellfire_ramparts.h" + > + </File> + <File + RelativePath="..\scripts\zone\hellfire_citadel\hellfire_ramparts\instance_hellfire_ramparts.cpp" + > + </File> + </Filter> + <Filter + Name="Shattered Halls" + > + <File + RelativePath="..\scripts\zone\hellfire_citadel\shattered_halls\boss_nethekurse.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\hellfire_citadel\shattered_halls\boss_warbringer_omrogg.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\hellfire_citadel\shattered_halls\boss_warchief_kargath_bladefist.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\hellfire_citadel\shattered_halls\def_shattered_halls.h" + > + </File> + <File + RelativePath="..\scripts\zone\hellfire_citadel\shattered_halls\instance_shattered_halls.cpp" + > + </File> + </Filter> + </Filter> + <Filter + Name="Hellfire Peninsula" > - </File> - <File - RelativePath="..\scripts\zone\blackrock_depths\boss_gorosh_the_dervish.cpp" + <File + RelativePath="..\scripts\zone\hellfire_peninsula\boss_doomlord_kazzak.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\hellfire_peninsula\hellfire_peninsula.cpp" + > + </File> + </Filter> + <Filter + Name="Shadowmoon Valley" > - </File> - <File - RelativePath="..\scripts\zone\blackrock_depths\boss_grizzle.cpp" + <File + RelativePath="..\scripts\zone\shadowmoon_valley\boss_doomwalker.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\shadowmoon_valley\shadowmoon_valley.cpp" + > + </File> + </Filter> + <Filter + Name="Tempest Keep" + > + <Filter + Name="Arcatraz" + > + <File + RelativePath="..\scripts\zone\tempest_keep\arcatraz\arcatraz.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\tempest_keep\arcatraz\boss_harbinger_skyriss.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\tempest_keep\arcatraz\def_arcatraz.h" + > + </File> + <File + RelativePath="..\scripts\zone\tempest_keep\arcatraz\instance_arcatraz.cpp" + > + </File> + </Filter> + <Filter + Name="Botanica" + > + <File + RelativePath="..\scripts\zone\tempest_keep\botanica\boss_high_botanist_freywinn.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\tempest_keep\botanica\boss_laj.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\tempest_keep\botanica\boss_warp_splinter.cpp" + > + </File> + </Filter> + <Filter + Name="The Eye" + > + <File + RelativePath="..\scripts\zone\tempest_keep\the_eye\boss_alar.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\tempest_keep\the_eye\boss_astromancer.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\tempest_keep\the_eye\boss_kaelthas.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\tempest_keep\the_eye\boss_void_reaver.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\tempest_keep\the_eye\def_the_eye.h" + > + </File> + <File + RelativePath="..\scripts\zone\tempest_keep\the_eye\instance_the_eye.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\tempest_keep\the_eye\the_eye.cpp" + > + </File> + </Filter> + <Filter + Name="The Mechanar" + > + <File + RelativePath="..\scripts\zone\tempest_keep\the_mechanar\boss_gatewatcher_gyrokill.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\tempest_keep\the_mechanar\boss_gatewatcher_ironhand.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\tempest_keep\the_mechanar\boss_nethermancer_sepethrea.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\tempest_keep\the_mechanar\boss_pathaleon_the_calculator.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\tempest_keep\the_mechanar\def_mechanar.h" + > + </File> + <File + RelativePath="..\scripts\zone\tempest_keep\the_mechanar\instance_mechanar.cpp" + > + </File> + </Filter> + </Filter> + <Filter + Name="Terokkar Forest" > - </File> - <File - RelativePath="..\scripts\zone\blackrock_depths\boss_high_interrogator_gerstahn.cpp" + <File + RelativePath="..\scripts\zone\terokkar_forest\terokkar_forest.cpp" + > + </File> + </Filter> + <Filter + Name="Coilfang Resevoir" + > + <Filter + Name="Serpent Shrine Cavern" + > + <File + RelativePath="..\scripts\zone\coilfang_resevoir\serpent_shrine\boss_fathomlord_karathress.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\coilfang_resevoir\serpent_shrine\boss_hydross_the_unstable.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\coilfang_resevoir\serpent_shrine\boss_lady_vashj.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\coilfang_resevoir\serpent_shrine\boss_leotheras_the_blind.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\coilfang_resevoir\serpent_shrine\boss_lurker_below.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\coilfang_resevoir\serpent_shrine\boss_morogrim_tidewalker.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\coilfang_resevoir\serpent_shrine\def_serpent_shrine.h" + > + </File> + <File + RelativePath="..\scripts\zone\coilfang_resevoir\serpent_shrine\instance_serpent_shrine.cpp" + > + </File> + </Filter> + <Filter + Name="Slave Pens" + > + </Filter> + <Filter + Name="Steam Vault" + > + <File + RelativePath="..\scripts\zone\coilfang_resevoir\steam_vault\boss_hydromancer_thespia.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\coilfang_resevoir\steam_vault\boss_mekgineer_steamrigger.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\coilfang_resevoir\steam_vault\boss_warlord_kalithresh.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\coilfang_resevoir\steam_vault\def_steam_vault.h" + > + </File> + <File + RelativePath="..\scripts\zone\coilfang_resevoir\steam_vault\instance_steam_vault.cpp" + > + </File> + </Filter> + <Filter + Name="Underbog" + > + <File + RelativePath="..\scripts\zone\coilfang_resevoir\underbog\boss_hungarfen.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\coilfang_resevoir\underbog\boss_the_black_stalker.cpp" + > + </File> + </Filter> + </Filter> + <Filter + Name="Aunchindoun" + > + <Filter + Name="Auchenai Crypts" + > + <File + RelativePath="..\scripts\zone\aunchindoun\auchenai_crypts\boss_exarch_maladaar.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\aunchindoun\auchenai_crypts\boss_shirrak_the_dead_watcher.cpp" + > + </File> + </Filter> + <Filter + Name="Mana Tombs" + > + <File + RelativePath="..\scripts\zone\aunchindoun\mana_tombs\boss_nexusprince_shaffar.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\aunchindoun\mana_tombs\boss_pandemonius.cpp" + > + </File> + </Filter> + <Filter + Name="Sethekk Halls" + > + <File + RelativePath="..\scripts\zone\aunchindoun\sethekk_halls\boss_darkweaver_syth.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\aunchindoun\sethekk_halls\boss_tailonking_ikiss.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\aunchindoun\sethekk_halls\def_sethekk_halls.h" + > + </File> + <File + RelativePath="..\scripts\zone\aunchindoun\sethekk_halls\instance_sethekk_halls.cpp" + > + </File> + </Filter> + <Filter + Name="Shadow Labyrinth" + > + <File + RelativePath="..\scripts\zone\aunchindoun\shadow_labyrinth\boss_ambassador_hellmaw.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\aunchindoun\shadow_labyrinth\boss_blackheart_the_inciter.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\aunchindoun\shadow_labyrinth\boss_grandmaster_vorpil.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\aunchindoun\shadow_labyrinth\boss_murmur.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\aunchindoun\shadow_labyrinth\def_shadow_labyrinth.h" + > + </File> + <File + RelativePath="..\scripts\zone\aunchindoun\shadow_labyrinth\instance_shadow_labyrinth.cpp" + > + </File> + </Filter> + </Filter> + <Filter + Name="Black Temple" > - </File> - <File - RelativePath="..\scripts\zone\blackrock_depths\boss_magmus.cpp" + <File + RelativePath="..\scripts\zone\black_temple\black_temple.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\black_temple\boss_bloodboil.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\black_temple\boss_illidan.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\black_temple\boss_mother_shahraz.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\black_temple\boss_reliquary_of_souls.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\black_temple\boss_shade_of_akama.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\black_temple\boss_supremus.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\black_temple\boss_teron_gorefiend.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\black_temple\boss_warlord_najentus.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\black_temple\def_black_temple.h" + > + </File> + <File + RelativePath="..\scripts\zone\black_temple\illidari_council.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\black_temple\instance_black_temple.cpp" + > + </File> + </Filter> + <Filter + Name="Blade's Edge Mountains" > - </File> - <File - RelativePath="..\scripts\zone\blackrock_depths\boss_moira_bronzebeard.cpp" + <File + RelativePath="..\scripts\zone\blades_edge_mountains\blades_edge_mountains.cpp" + > + </File> + </Filter> + <Filter + Name="Zangarmarsh" > - </File> - <File - RelativePath="..\scripts\zone\blackrock_depths\boss_tomb_of_seven.cpp" + <File + RelativePath="..\scripts\zone\zangarmarsh\zangarmarsh.cpp" + > + </File> + </Filter> + <Filter + Name="Shattrath City" > - </File> + <File + RelativePath="..\scripts\zone\shattrath\shattrath_city.cpp" + > + </File> + </Filter> </Filter> <Filter - Name="Loch Modan" + Name="Northrend" > - <File - RelativePath="..\scripts\zone\loch_modan\loch_modan.cpp" - > - </File> + <Filter + Name="Region" + > + <Filter + Name="Howling Fjord" + > + </Filter> + <Filter + Name="Grizzly Hills" + > + </Filter> + <Filter + Name="Zul'Drak" + > + </Filter> + <Filter + Name="The Storm Peaks" + > + </Filter> + <Filter + Name="Crystalsong Forest" + > + </Filter> + <Filter + Name="Dragonblight" + > + <File + RelativePath="..\scripts\zone\dragonblight\dragonblight.cpp" + > + </File> + </Filter> + <Filter + Name="Borean Tundra" + > + <File + RelativePath="..\scripts\zone\borean_tundra\borean_tundra.cpp" + > + </File> + </Filter> + <Filter + Name="Wintergrasp" + > + <File + RelativePath="..\scripts\zone\wintergrasp\wintergrasp.cpp" + > + </File> + </Filter> + <Filter + Name="Icecrown" + > + </Filter> + <Filter + Name="Sholazar Basin" + > + </Filter> + <Filter + Name="Dalaran" + > + </Filter> + </Filter> + <Filter + Name="Dungeon" + > + <Filter + Name="Naxxramas" + > + <File + RelativePath="..\scripts\zone\naxxramas\boss_anubrekhan.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\naxxramas\boss_faerlina.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\naxxramas\boss_four_horsemen.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\naxxramas\boss_gluth.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\naxxramas\boss_gothik.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\naxxramas\boss_grobbulus.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\naxxramas\boss_heigan.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\naxxramas\boss_kelthuzad.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\naxxramas\boss_loatheb.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\naxxramas\boss_maexxna.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\naxxramas\boss_noth.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\naxxramas\boss_patchwerk.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\naxxramas\boss_razuvious.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\naxxramas\boss_sapphiron.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\naxxramas\boss_thaddius.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\naxxramas\def_naxxramas.h" + > + </File> + <File + RelativePath="..\scripts\zone\naxxramas\instance_naxxramas.cpp" + > + </File> + </Filter> + <Filter + Name="Nexus" + > + <Filter + Name="Nexus" + > + <File + RelativePath="..\scripts\zone\nexus\nexus\boss_anomalus.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\nexus\nexus\boss_keristrasza.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\nexus\nexus\boss_magus_telestra.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\nexus\nexus\boss_ormorok.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\nexus\nexus\commander_kolurg.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\nexus\nexus\commander_stoutbeard.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\nexus\nexus\def_nexus.h" + > + </File> + <File + RelativePath="..\scripts\zone\nexus\nexus\instance_nexus.cpp" + > + </File> + </Filter> + <Filter + Name="Oculus" + > + <File + RelativePath="..\scripts\zone\nexus\oculus\boss_drakos.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\nexus\oculus\boss_eregos.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\nexus\oculus\boss_urom.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\nexus\oculus\boss_varos.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\nexus\oculus\def_oculus.h" + > + </File> + <File + RelativePath="..\scripts\zone\nexus\oculus\instance_oculus.cpp" + > + </File> + </Filter> + <Filter + Name="Eye of Eternity" + > + <File + RelativePath="..\scripts\zone\nexus\eye_of_eternity\boss_malygos.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\nexus\eye_of_eternity\def_eye_of_eternity.h" + > + </File> + <File + RelativePath="..\scripts\zone\nexus\eye_of_eternity\instance_eye_of_eternity.cpp" + > + </File> + </Filter> + </Filter> + <Filter + Name="Obsidian Sanctum" + > + <File + RelativePath="..\scripts\zone\obsidian_sanctum\boss_sartharion.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\obsidian_sanctum\def_obsidian_sanctum.h" + > + </File> + <File + RelativePath="..\scripts\zone\obsidian_sanctum\instance_obsidian_sanctum.cpp" + > + </File> + </Filter> + <Filter + Name="Ulduar" + > + <Filter + Name="Halls of Stone" + > + <File + RelativePath="..\scripts\zone\ulduar\halls_of_stone\boss_krystallus.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\ulduar\halls_of_stone\boss_maiden_of_grief.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\ulduar\halls_of_stone\boss_sjonnir.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\ulduar\halls_of_stone\def_halls_of_stone.h" + > + </File> + <File + RelativePath="..\scripts\zone\ulduar\halls_of_stone\instance_halls_of_stone.cpp" + > + </File> + </Filter> + <Filter + Name="Halls of Lightning" + > + <File + RelativePath="..\scripts\zone\ulduar\halls_of_lightning\boss_bjarngrim.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\ulduar\halls_of_lightning\boss_ionar.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\ulduar\halls_of_lightning\boss_loken.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\ulduar\halls_of_lightning\boss_volkhan.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\ulduar\halls_of_lightning\def_halls_of_lightning.h" + > + </File> + <File + RelativePath="..\scripts\zone\ulduar\halls_of_lightning\instance_halls_of_lightning.cpp" + > + </File> + </Filter> + </Filter> + <Filter + Name="Utgarde Keep" + > + <Filter + Name="Utgarde Keep" + > + <File + RelativePath="..\scripts\zone\utgarde_keep\utgarde_keep\boss_ingvar_the_plunderer.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\utgarde_keep\utgarde_keep\boss_keleseth.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\utgarde_keep\utgarde_keep\boss_skarvald_dalronn.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\utgarde_keep\utgarde_keep\def_utgarde_keep.h" + > + </File> + <File + RelativePath="..\scripts\zone\utgarde_keep\utgarde_keep\instance_utgarde_keep.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\utgarde_keep\utgarde_keep\utgarde_keep.cpp" + > + </File> + </Filter> + <Filter + Name="Utgarde Pinnacle" + > + <File + RelativePath="..\scripts\zone\utgarde_keep\utgarde_pinnacle\boss_palehoof.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\utgarde_keep\utgarde_pinnacle\boss_skadi.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\utgarde_keep\utgarde_pinnacle\boss_svala.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\utgarde_keep\utgarde_pinnacle\boss_ymiron.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\utgarde_keep\utgarde_pinnacle\def_pinnacle.h" + > + </File> + <File + RelativePath="..\scripts\zone\utgarde_keep\utgarde_pinnacle\instance_pinnacle.cpp" + > + </File> + </Filter> + </Filter> + <Filter + Name="Vault of Archavon" + > + <File + RelativePath="..\scripts\zone\vault_of_archavon\boss_archavon.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\vault_of_archavon\def_vault_of_archavon.h" + > + </File> + <File + RelativePath="..\scripts\zone\vault_of_archavon\instance_vault_of_archavon.cpp" + > + </File> + </Filter> + <Filter + Name="Violet Hold" + > + <File + RelativePath="..\scripts\zone\violet_hold\boss_cyanigosa.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\violet_hold\boss_erekem.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\violet_hold\boss_ichoron.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\violet_hold\boss_lavanthor.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\violet_hold\boss_moragg.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\violet_hold\boss_xevozz.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\violet_hold\boss_zuramat.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\violet_hold\def_violet_hold.h" + > + </File> + <File + RelativePath="..\scripts\zone\violet_hold\instance_violet_hold.cpp" + > + </File> + </Filter> + <Filter + Name="Gundrak" + > + <File + RelativePath="..\scripts\zone\gundrak\boss_drakkari_colossus.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\gundrak\boss_eck.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\gundrak\boss_gal_darah.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\gundrak\boss_moorabi.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\gundrak\boss_slad_ran.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\gundrak\def_gundrak.h" + > + </File> + <File + RelativePath="..\scripts\zone\gundrak\instance_gundrak.cpp" + > + </File> + </Filter> + <Filter + Name="Drak'Tharon Keep" + > + <File + RelativePath="..\scripts\zone\draktharon_keep\boss_dred.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\draktharon_keep\boss_novos.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\draktharon_keep\boss_tharon_ja.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\draktharon_keep\boss_trollgore.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\draktharon_keep\def_drak_tharon_keep.h" + > + </File> + <File + RelativePath="..\scripts\zone\draktharon_keep\instance_drak_tharon_keep.cpp" + > + </File> + </Filter> + <Filter + Name="Azjol-Nerub" + > + <Filter + Name="Ahn'kahet" + > + <File + RelativePath="..\scripts\zone\azjol_nerub\ahnkahet\boss_amanitar.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\azjol_nerub\ahnkahet\boss_elder_nadox.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\azjol_nerub\ahnkahet\boss_herald_volazj.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\azjol_nerub\ahnkahet\boss_jedoga_shadowseeker.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\azjol_nerub\ahnkahet\boss_prince_taldaram.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\azjol_nerub\ahnkahet\def_ahnkahet.h" + > + </File> + <File + RelativePath="..\scripts\zone\azjol_nerub\ahnkahet\instance_ahnkahet.cpp" + > + </File> + </Filter> + <Filter + Name="Azjol-Nerub" + > + <File + RelativePath="..\scripts\zone\azjol_nerub\azjol_nerub\boss_anubarak.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\azjol_nerub\azjol_nerub\boss_hadronox.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\azjol_nerub\azjol_nerub\boss_krikthir_the_gatewatcher.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\azjol_nerub\azjol_nerub\def_azjol_nerub.h" + > + </File> + <File + RelativePath="..\scripts\zone\azjol_nerub\azjol_nerub\instance_azjol_nerub.cpp" + > + </File> + </Filter> + </Filter> + </Filter> </Filter> </Filter> </Filter> @@ -2442,10 +2969,6 @@ </File> </Filter> <File - RelativePath="..\config.h" - > - </File> - <File RelativePath="..\ScriptMgr.cpp" > </File> @@ -2454,10 +2977,6 @@ > </File> <File - RelativePath="..\svn_revision.h" - > - </File> - <File RelativePath="..\system.cpp" > </File> diff --git a/src/bindings/scripts/VC90/90ScriptDev2.vcproj b/src/bindings/scripts/VC90/90ScriptDev2.vcproj index 7cf04d191ed..cfcbcc54059 100644 --- a/src/bindings/scripts/VC90/90ScriptDev2.vcproj +++ b/src/bindings/scripts/VC90/90ScriptDev2.vcproj @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="windows-1250"?> <VisualStudioProject ProjectType="Visual C++" - Version="9,00" + Version="9.00" Name="TrinityScript" ProjectGUID="{4295C8A9-79B7-4354-8064-F05FB9CA0C96}" RootNamespace="ScriptDev2" @@ -47,7 +47,7 @@ Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="..\..\..\..\dep\include\;..\..\..\shared\;..\..\..\framework\;..\..\..\game\;..\include\;..\..\..\..\dep\ACE_wrappers" - PreprocessorDefinitions="WIN32;_DEBUG;MANGOS_DEBUG;_WINDOWS;_USRDLL;SCRIPT" + PreprocessorDefinitions="WIN32;_DEBUG;TRINITY_DEBUG;_WINDOWS;_USRDLL;SCRIPT" MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="3" @@ -55,7 +55,7 @@ PrecompiledHeaderThrough="precompiled.h" WarningLevel="3" Detect64BitPortabilityProblems="false" - DebugInformationFormat="4" + DebugInformationFormat="3" /> <Tool Name="VCManagedResourceCompilerTool" @@ -68,12 +68,12 @@ /> <Tool Name="VCLinkerTool" - AdditionalDependencies="trinitycore.lib zthread.lib" + AdditionalDependencies="trinitycore.lib aced.lib" OutputFile="$(OutDir)/TrinityScript.dll" LinkIncremental="2" - AdditionalLibraryDirectories="..\..\..\..\win\VC90\zthread__$(PlatformName)_$(ConfigurationName);..\..\..\..\win\VC90\trinitycore__$(PlatformName)_$(ConfigurationName)" + AdditionalLibraryDirectories="..\..\..\..\win\VC90\trinitycore__$(PlatformName)_$(ConfigurationName);..\..\..\..\dep\lib\$(PlatformName)_$(ConfigurationName)" GenerateDebugInformation="true" - ProgramDatabaseFile="$(OutDir)/MaNGOSScript.pdb" + ProgramDatabaseFile="$(OutDir)/TrinityScript.pdb" SubSystem="2" RandomizedBaseAddress="1" DataExecutionPrevention="0" @@ -152,10 +152,10 @@ /> <Tool Name="VCLinkerTool" - AdditionalDependencies="trinitycore.lib zthread.lib" + AdditionalDependencies="trinitycore.lib ace.lib" OutputFile="$(OutDir)/TrinityScript.dll" LinkIncremental="1" - AdditionalLibraryDirectories="..\..\..\..\win\VC90\zthread__$(PlatformName)_$(ConfigurationName);..\..\..\..\win\VC90\trinitycore__$(PlatformName)_$(ConfigurationName)" + AdditionalLibraryDirectories="..\..\..\..\win\VC90\trinitycore__$(PlatformName)_$(ConfigurationName);..\..\..\..\dep\lib\$(PlatformName)_$(ConfigurationName)" GenerateDebugInformation="false" SubSystem="2" OptimizeReferences="2" @@ -216,7 +216,7 @@ Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="..\..\..\..\dep\include\;..\..\..\shared\;..\..\..\framework\;..\..\..\game\;..\include\;..\..\..\..\dep\ACE_wrappers" - PreprocessorDefinitions="WIN32;_DEBUG;MANGOS_DEBUG;_WINDOWS;_USRDLL;SCRIPT" + PreprocessorDefinitions="WIN32;_DEBUG;TRINITY_DEBUG;_WINDOWS;_USRDLL;SCRIPT" MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="3" @@ -237,12 +237,12 @@ /> <Tool Name="VCLinkerTool" - AdditionalDependencies="trinitycore.lib zthread.lib" + AdditionalDependencies="trinitycore.lib aced.lib" OutputFile="$(OutDir)/TrinityScript.dll" LinkIncremental="2" - AdditionalLibraryDirectories="..\..\..\..\win\VC90\zthread__$(PlatformName)_$(ConfigurationName);..\..\..\..\win\VC90\trinitycore__$(PlatformName)_$(ConfigurationName)" + AdditionalLibraryDirectories="..\..\..\..\win\VC90\trinitycore__$(PlatformName)_$(ConfigurationName);..\..\..\..\dep\lib\$(PlatformName)_$(ConfigurationName)" GenerateDebugInformation="true" - ProgramDatabaseFile="$(OutDir)/MaNGOSScript.pdb" + ProgramDatabaseFile="$(OutDir)/TrinityScript.pdb" SubSystem="2" RandomizedBaseAddress="1" DataExecutionPrevention="0" @@ -267,6 +267,9 @@ <Tool Name="VCAppVerifierTool" /> + <Tool + Name="VCPostBuildEventTool" + /> </Configuration> <Configuration Name="Release|x64" @@ -317,10 +320,10 @@ /> <Tool Name="VCLinkerTool" - AdditionalDependencies="trinitycore.lib zthread.lib" + AdditionalDependencies="trinitycore.lib ace.lib" OutputFile="$(OutDir)/TrinityScript.dll" LinkIncremental="1" - AdditionalLibraryDirectories="..\..\..\..\win\VC90\zthread__$(PlatformName)_$(ConfigurationName);..\..\..\..\win\VC90\trinitycore__$(PlatformName)_$(ConfigurationName)" + AdditionalLibraryDirectories="..\..\..\..\win\VC90\trinitycore__$(PlatformName)_$(ConfigurationName);..\..\..\..\dep\lib\$(PlatformName)_$(ConfigurationName)" GenerateDebugInformation="false" SubSystem="2" OptimizeReferences="2" @@ -348,6 +351,9 @@ <Tool Name="VCAppVerifierTool" /> + <Tool + Name="VCPostBuildEventTool" + /> </Configuration> </Configurations> <References> @@ -380,23 +386,35 @@ Name="creature" > <File - RelativePath="..\scripts\creature\mob_event_ai.cpp" + RelativePath="..\scripts\creature\mob_generic_creature.cpp" > </File> <File - RelativePath="..\scripts\creature\mob_event_ai.h" + RelativePath="..\scripts\creature\simple_ai.cpp" > </File> <File - RelativePath="..\scripts\creature\mob_generic_creature.cpp" + RelativePath="..\scripts\creature\simple_ai.h" > </File> + </Filter> + <Filter + Name="examples" + > <File - RelativePath="..\scripts\creature\simple_ai.cpp" + RelativePath="..\scripts\examples\example_creature.cpp" > </File> <File - RelativePath="..\scripts\creature\simple_ai.h" + RelativePath="..\scripts\examples\example_escort.cpp" + > + </File> + <File + RelativePath="..\scripts\examples\example_gossip_codebox.cpp" + > + </File> + <File + RelativePath="..\scripts\examples\example_misc.cpp" > </File> </Filter> @@ -440,6 +458,10 @@ > </File> <File + RelativePath="..\scripts\npc\npc_taxi.cpp" + > + </File> + <File RelativePath="..\scripts\npc\npcs_special.cpp" > </File> @@ -452,15 +474,11 @@ Name="custom" > <File - RelativePath="..\scripts\custom\custom_example.cpp" - > - </File> - <File - RelativePath="..\scripts\custom\custom_gossip_codebox.cpp" + RelativePath="..\scripts\custom\npc_acherus_taxi.cpp" > </File> <File - RelativePath="..\scripts\custom\test.cpp" + RelativePath="..\scripts\custom\npc_wyrmresttempel_taxi.cpp" > </File> </Filter> @@ -487,1886 +505,2401 @@ RelativePath="..\scripts\item\item_scripts.cpp" > </File> - <File - RelativePath="..\scripts\item\item_test.cpp" - > - </File> </Filter> <Filter Name="zone" > <Filter - Name="Alterac Mountains" - > - <File - RelativePath="..\scripts\zone\alterac_mountains\alterac_mountains.cpp" - > - </File> - </Filter> - <Filter - Name="Ashenvale Forest" - > - <File - RelativePath="..\scripts\zone\ashenvale_forest\ashenvale.cpp" - > - </File> - </Filter> - <Filter - Name="Azshara" - > - <File - RelativePath="..\scripts\zone\azshara\azshara.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\azshara\boss_azuregos.cpp" - > - </File> - </Filter> - <Filter - Name="Badlands" - > - </Filter> - <Filter - Name="Barrens" - > - <File - RelativePath="..\scripts\zone\barrens\the_barrens.cpp" - > - </File> - </Filter> - <Filter - Name="Blackfathom Depths" - > - </Filter> - <Filter - Name="Arathi Highlands" - > - <File - RelativePath="..\scripts\zone\arathi_highlands\arathi_highlands.cpp" - > - </File> - </Filter> - <Filter - Name="Deadmines" - > - <File - RelativePath="..\scripts\zone\deadmines\deadmines.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\deadmines\def_deadmines.h" - > - </File> - </Filter> - <Filter - Name="Deadwind Pass" - > - </Filter> - <Filter - Name="Desolace" - > - </Filter> - <Filter - Name="Dire Maul" - > - </Filter> - <Filter - Name="Dun Morogh" - > - <File - RelativePath="..\scripts\zone\dun_morogh\dun_morogh.cpp" - > - </File> - </Filter> - <Filter - Name="Durotar" - > - </Filter> - <Filter - Name="Duskwood" - > - </Filter> - <Filter - Name="Dustwallow Marsh" - > - <File - RelativePath="..\scripts\zone\dustwallow_marsh\dustwallow_marsh.cpp" - > - </File> - </Filter> - <Filter - Name="Blackwing Lair" - > - <File - RelativePath="..\scripts\zone\blackwing_lair\boss_broodlord_lashlayer.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\blackwing_lair\boss_chromaggus.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\blackwing_lair\boss_ebonroc.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\blackwing_lair\boss_firemaw.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\blackwing_lair\boss_flamegor.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\blackwing_lair\boss_nefarian.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\blackwing_lair\boss_razorgore.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\blackwing_lair\boss_vaelastrasz.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\blackwing_lair\boss_victor_nefarius.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\blackwing_lair\instance_blackwing_lair.cpp" - > - </File> - </Filter> - <Filter - Name="Bloodmyst Isle" - > - <File - RelativePath="..\scripts\zone\bloodmyst_isle\bloodmyst_isle.cpp" - > - </File> - </Filter> - <Filter - Name="Gruul's Lair" - > - <File - RelativePath="..\scripts\zone\gruuls_lair\boss_gruul.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\gruuls_lair\boss_high_king_maulgar.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\gruuls_lair\def_gruuls_lair.h" - > - </File> - <File - RelativePath="..\scripts\zone\gruuls_lair\instance_gruuls_lair.cpp" - > - </File> - </Filter> - <Filter - Name="Burning Steppes" - > - <File - RelativePath="..\scripts\zone\burning_steppes\burning_steppes.cpp" - > - </File> - </Filter> - <Filter - Name="Darkshore" - > - <File - RelativePath="..\scripts\zone\darkshore\darkshore.cpp" - > - </File> - </Filter> - <Filter - Name="Eastern Plaguelands" - > - <File - RelativePath="..\scripts\zone\eastern_plaguelands\eastern_plaguelands.cpp" - > - </File> - </Filter> - <Filter - Name="Moonglade" - > - <File - RelativePath="..\scripts\zone\moonglade\moonglade.cpp" - > - </File> - </Filter> - <Filter - Name="Razorfen Kraul" - > - <File - RelativePath="..\scripts\zone\razorfen_kraul\razorfen_kraul.cpp" - > - </File> - </Filter> - <Filter - Name="Redridge Mountains" - > - </Filter> - <Filter - Name="Ruins of Ahn'Qiraj" - > - <File - RelativePath="..\scripts\zone\ruins_of_ahnqiraj\boss_ayamiss.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\ruins_of_ahnqiraj\boss_buru.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\ruins_of_ahnqiraj\boss_kurinnaxx.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\ruins_of_ahnqiraj\boss_moam.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\ruins_of_ahnqiraj\boss_ossirian.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\ruins_of_ahnqiraj\boss_rajaxx.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\ruins_of_ahnqiraj\instance_ruins_of_ahnqiraj.cpp" - > - </File> - </Filter> - <Filter - Name="Swamp of Sorrows" - > - </Filter> - <Filter - Name="Scarlet Monastery" - > - <File - RelativePath="..\scripts\zone\scarlet_monastery\boss_arcanist_doan.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\scarlet_monastery\boss_azshir_the_sleepless.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\scarlet_monastery\boss_bloodmage_thalnos.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\scarlet_monastery\boss_headless_horseman.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\scarlet_monastery\boss_herod.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\scarlet_monastery\boss_high_inquisitor_fairbanks.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\scarlet_monastery\boss_houndmaster_loksey.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\scarlet_monastery\boss_interrogator_vishas.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\scarlet_monastery\boss_mograine_and_whitemane.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\scarlet_monastery\boss_scorn.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\scarlet_monastery\def_scarlet_monastery.h" - > - </File> - <File - RelativePath="..\scripts\zone\scarlet_monastery\instance_scarlet_monastery.cpp" - > - </File> - </Filter> - <Filter - Name="Scholomance" - > - <File - RelativePath="..\scripts\zone\scholomance\boss_darkmaster_gandling.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\scholomance\boss_death_knight_darkreaver.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\scholomance\boss_doctor_theolen_krastinov.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\scholomance\boss_illucia_barov.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\scholomance\boss_instructor_malicia.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\scholomance\boss_jandice_barov.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\scholomance\boss_kormok.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\scholomance\boss_lord_alexei_barov.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\scholomance\boss_lorekeeper_polkelt.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\scholomance\boss_ras_frostwhisper.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\scholomance\boss_the_ravenian.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\scholomance\boss_vectus.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\scholomance\def_scholomance.h" - > - </File> - <File - RelativePath="..\scripts\zone\scholomance\instance_scholomance.cpp" - > - </File> - </Filter> - <Filter - Name="Searing Gorge" - > - <File - RelativePath="..\scripts\zone\searing_gorge\searing_gorge.cpp" - > - </File> - </Filter> - <Filter - Name="Elwynn Forest" - > - <File - RelativePath="..\scripts\zone\elwynn_forest\elwynn_forest.cpp" - > - </File> - </Filter> - <Filter - Name="Felwood" - > - <File - RelativePath="..\scripts\zone\felwood\felwood.cpp" - > - </File> - </Filter> - <Filter - Name="Feralas" - > - <File - RelativePath="..\scripts\zone\feralas\feralas.cpp" - > - </File> - </Filter> - <Filter - Name="Gnomeregan" - > - </Filter> - <Filter - Name="Hillsbrad Foothills" - > - </Filter> - <Filter - Name="Hinterlands" - > - </Filter> - <Filter - Name="Maraudon" - > - <File - RelativePath="..\scripts\zone\maraudon\boss_celebras_the_cursed.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\maraudon\boss_landslide.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\maraudon\boss_noxxion.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\maraudon\boss_princess_theradras.cpp" - > - </File> - </Filter> - <Filter - Name="Molten Core" - > - <File - RelativePath="..\scripts\zone\molten_core\boss_baron_geddon.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\molten_core\boss_garr.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\molten_core\boss_gehennas.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\molten_core\boss_golemagg.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\molten_core\boss_lucifron.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\molten_core\boss_magmadar.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\molten_core\boss_majordomo_executus.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\molten_core\boss_ragnaros.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\molten_core\boss_shazzrah.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\molten_core\boss_sulfuron_harbinger.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\molten_core\def_molten_core.h" - > - </File> - <File - RelativePath="..\scripts\zone\molten_core\instance_molten_core.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\molten_core\molten_core.cpp" - > - </File> - </Filter> - <Filter - Name="Mulgore" - > - <File - RelativePath="..\scripts\zone\mulgore\mulgore.cpp" - > - </File> - </Filter> - <Filter - Name="Naxxramas" - > - <File - RelativePath="..\scripts\zone\naxxramas\boss_anubrekhan.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\naxxramas\boss_faerlina.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\naxxramas\boss_four_horsemen.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\naxxramas\boss_gluth.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\naxxramas\boss_gothik.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\naxxramas\boss_grobbulus.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\naxxramas\boss_heigan.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\naxxramas\boss_highlord_mograine.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\naxxramas\boss_kelthuzad.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\naxxramas\boss_loatheb.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\naxxramas\boss_maexxna.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\naxxramas\boss_noth.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\naxxramas\boss_patchwerk.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\naxxramas\boss_razuvious.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\naxxramas\boss_sapphiron.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\naxxramas\boss_thaddius.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\naxxramas\instance_naxxramas.cpp" - > - </File> - </Filter> - <Filter - Name="Onyxia's Lair" - > - <File - RelativePath="..\scripts\zone\onyxias_lair\boss_onyxia.cpp" - > - </File> - </Filter> - <Filter - Name="Ragefire Chasm" - > - </Filter> - <Filter - Name="Razorfen Downs" - > - <File - RelativePath="..\scripts\zone\razorfen_downs\boss_amnennar_the_coldbringer.cpp" - > - </File> - </Filter> - <Filter - Name="Shadowfang Keep" - > - <File - RelativePath="..\scripts\zone\shadowfang_keep\def_shadowfang_keep.h" - > - </File> - <File - RelativePath="..\scripts\zone\shadowfang_keep\instance_shadowfang_keep.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\shadowfang_keep\shadowfang_keep.cpp" - > - </File> - </Filter> - <Filter - Name="Stonetalon Mountains" - > - <File - RelativePath="..\scripts\zone\stonetalon_mountains\stonetalon_mountains.cpp" - > - </File> - </Filter> - <Filter - Name="Stranglethorn Vale" - > - <File - RelativePath="..\scripts\zone\stranglethorn_vale\stranglethorn_vale.cpp" - > - </File> - </Filter> - <Filter - Name="Stratholme" - > - <File - RelativePath="..\scripts\zone\stratholme\boss_baron_rivendare.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\stratholme\boss_baroness_anastari.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\stratholme\boss_cannon_master_willey.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\stratholme\boss_dathrohan_balnazzar.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\stratholme\boss_magistrate_barthilas.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\stratholme\boss_maleki_the_pallid.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\stratholme\boss_nerubenkan.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\stratholme\boss_order_of_silver_hand.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\stratholme\boss_postmaster_malown.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\stratholme\boss_ramstein_the_gorger.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\stratholme\boss_timmy_the_cruel.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\stratholme\def_stratholme.h" - > - </File> - <File - RelativePath="..\scripts\zone\stratholme\instance_stratholme.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\stratholme\stratholme.cpp" - > - </File> - </Filter> - <Filter - Name="Sunken Temple" - > - </Filter> - <Filter - Name="Tanaris" + Name="Kalimdor" > - <File - RelativePath="..\scripts\zone\tanaris\tanaris.cpp" - > - </File> - </Filter> - <Filter - Name="Teldrassil" - > - </Filter> - <Filter - Name="Temple of Ahn'Qiraj" - > - <File - RelativePath="..\scripts\zone\temple_of_ahnqiraj\boss_bug_trio.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\temple_of_ahnqiraj\boss_cthun.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\temple_of_ahnqiraj\boss_fankriss.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\temple_of_ahnqiraj\boss_huhuran.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\temple_of_ahnqiraj\boss_ouro.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\temple_of_ahnqiraj\boss_sartura.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\temple_of_ahnqiraj\boss_skeram.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\temple_of_ahnqiraj\boss_twinemperors.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\temple_of_ahnqiraj\boss_viscidus.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\temple_of_ahnqiraj\def_temple_of_ahnqiraj.h" - > - </File> - <File - RelativePath="..\scripts\zone\temple_of_ahnqiraj\instance_temple_of_ahnqiraj.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\temple_of_ahnqiraj\mob_anubisath_sentinel.cpp" - > - </File> - </Filter> - <Filter - Name="Thousand Needles" - > - <File - RelativePath="..\scripts\zone\thousand_needles\thousand_needles.cpp" - > - </File> - </Filter> - <Filter - Name="Silithus" - > - <File - RelativePath="..\scripts\zone\silithus\silithus.cpp" + <Filter + Name="Ashenvale Forest" > - </File> - </Filter> - <Filter - Name="Silverpine Forest" - > - <File - RelativePath="..\scripts\zone\silverpine_forest\silverpine_forest.cpp" + <File + RelativePath="..\scripts\zone\ashenvale_forest\ashenvale.cpp" + > + </File> + </Filter> + <Filter + Name="Azshara" > - </File> - </Filter> - <Filter - Name="Stockade" - > - </Filter> - <Filter - Name="Tirisfal Glades" - > - <File - RelativePath="..\scripts\zone\tirisfal_glades\tirisfal_glades.cpp" + <File + RelativePath="..\scripts\zone\azshara\azshara.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\azshara\boss_azuregos.cpp" + > + </File> + </Filter> + <Filter + Name="Azuremyst Isle" > - </File> - </Filter> - <Filter - Name="Wailing Caverns" - > - <File - RelativePath="..\scripts\zone\wailing_caverns\instance_wailing_caverns.cpp" + <File + RelativePath="..\scripts\zone\azuremyst_isle\azuremyst_isle.cpp" + > + </File> + </Filter> + <Filter + Name="Badlands" > - </File> - </Filter> - <Filter - Name="Western Plaguelands" - > - <File - RelativePath="..\scripts\zone\western_plaguelands\western_plaguelands.cpp" + </Filter> + <Filter + Name="Barrens" > - </File> - </Filter> - <Filter - Name="Westfall" - > - <File - RelativePath="..\scripts\zone\westfall\westfall.cpp" + <File + RelativePath="..\scripts\zone\barrens\the_barrens.cpp" + > + </File> + </Filter> + <Filter + Name="Blackfathom Depths" > - </File> - </Filter> - <Filter - Name="Wetlands" - > - </Filter> - <Filter - Name="Winterspring" - > - <File - RelativePath="..\scripts\zone\winterspring\winterspring.cpp" + </Filter> + <Filter + Name="Bloodmyst Isle" > - </File> - </Filter> - <Filter - Name="Zul'Farrak" - > - <File - RelativePath="..\scripts\zone\zulfarrak\zulfarrak.cpp" + <File + RelativePath="..\scripts\zone\bloodmyst_isle\bloodmyst_isle.cpp" + > + </File> + </Filter> + <Filter + Name="Caverns of Time" + > + <Filter + Name="The Dark Portal" + > + <File + RelativePath="..\scripts\zone\caverns_of_time\dark_portal\boss_aeonus.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\caverns_of_time\dark_portal\boss_chrono_lord_deja.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\caverns_of_time\dark_portal\boss_temporus.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\caverns_of_time\dark_portal\dark_portal.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\caverns_of_time\dark_portal\def_dark_portal.h" + > + </File> + <File + RelativePath="..\scripts\zone\caverns_of_time\dark_portal\instance_dark_portal.cpp" + > + </File> + </Filter> + <Filter + Name="Battle for Mt. Hyjal" + > + <File + RelativePath="..\scripts\zone\caverns_of_time\hyjal\boss_anetheron.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\caverns_of_time\hyjal\boss_archimonde.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\caverns_of_time\hyjal\boss_azgalor.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\caverns_of_time\hyjal\boss_kazrogal.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\caverns_of_time\hyjal\boss_rage_winterchill.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\caverns_of_time\hyjal\def_hyjal.h" + > + </File> + <File + RelativePath="..\scripts\zone\caverns_of_time\hyjal\hyjal.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\caverns_of_time\hyjal\hyjal_trash.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\caverns_of_time\hyjal\hyjal_trash.h" + > + </File> + <File + RelativePath="..\scripts\zone\caverns_of_time\hyjal\hyjalAI.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\caverns_of_time\hyjal\hyjalAI.h" + > + </File> + <File + RelativePath="..\scripts\zone\caverns_of_time\hyjal\instance_hyjal.cpp" + > + </File> + </Filter> + <Filter + Name="Culling of Stratholme" + > + <File + RelativePath="..\scripts\zone\caverns_of_time\culling_of_stratholme\boss_epoch.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\caverns_of_time\culling_of_stratholme\boss_mal_ganis.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\caverns_of_time\culling_of_stratholme\boss_meathook.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\caverns_of_time\culling_of_stratholme\boss_salramm.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\caverns_of_time\culling_of_stratholme\def_culling_of_stratholme.h" + > + </File> + <File + RelativePath="..\scripts\zone\caverns_of_time\culling_of_stratholme\instance_culling_of_stratholme.cpp" + > + </File> + </Filter> + <Filter + Name="Old Hillsbrad" + > + <File + RelativePath="..\scripts\zone\caverns_of_time\old_hillsbrad\boss_captain_skarloc.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\caverns_of_time\old_hillsbrad\boss_epoch_hunter.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\caverns_of_time\old_hillsbrad\boss_leutenant_drake.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\caverns_of_time\old_hillsbrad\def_old_hillsbrad.h" + > + </File> + <File + RelativePath="..\scripts\zone\caverns_of_time\old_hillsbrad\instance_old_hillsbrad.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\caverns_of_time\old_hillsbrad\old_hillsbrad.cpp" + > + </File> + </Filter> + </Filter> + <Filter + Name="Darkshore" > - </File> - </Filter> - <Filter - Name="Zul'Gurub" - > - <File - RelativePath="..\scripts\zone\zulgurub\boss_arlokk.cpp" + <File + RelativePath="..\scripts\zone\darkshore\darkshore.cpp" + > + </File> + </Filter> + <Filter + Name="Darnassus" > - </File> - <File - RelativePath="..\scripts\zone\zulgurub\boss_gahzranka.cpp" + </Filter> + <Filter + Name="Desolace" > - </File> - <File - RelativePath="..\scripts\zone\zulgurub\boss_grilek.cpp" + </Filter> + <Filter + Name="Dire Maul" > - </File> - <File - RelativePath="..\scripts\zone\zulgurub\boss_hakkar.cpp" + </Filter> + <Filter + Name="Durotar" > - </File> - <File - RelativePath="..\scripts\zone\zulgurub\boss_hazzarah.cpp" + </Filter> + <Filter + Name="Dustwallow Marsh" > - </File> - <File - RelativePath="..\scripts\zone\zulgurub\boss_jeklik.cpp" + <File + RelativePath="..\scripts\zone\dustwallow_marsh\dustwallow_marsh.cpp" + > + </File> + </Filter> + <Filter + Name="Exodar" > - </File> - <File - RelativePath="..\scripts\zone\zulgurub\boss_jindo.cpp" + </Filter> + <Filter + Name="Felwood" > - </File> - <File - RelativePath="..\scripts\zone\zulgurub\boss_mandokir.cpp" + <File + RelativePath="..\scripts\zone\felwood\felwood.cpp" + > + </File> + </Filter> + <Filter + Name="Feralas" > - </File> - <File - RelativePath="..\scripts\zone\zulgurub\boss_marli.cpp" + <File + RelativePath="..\scripts\zone\feralas\feralas.cpp" + > + </File> + </Filter> + <Filter + Name="Maraudon" > - </File> - <File - RelativePath="..\scripts\zone\zulgurub\boss_renataki.cpp" + <File + RelativePath="..\scripts\zone\maraudon\boss_celebras_the_cursed.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\maraudon\boss_landslide.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\maraudon\boss_noxxion.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\maraudon\boss_princess_theradras.cpp" + > + </File> + </Filter> + <Filter + Name="Moonglade" > - </File> - <File - RelativePath="..\scripts\zone\zulgurub\boss_thekal.cpp" + <File + RelativePath="..\scripts\zone\moonglade\moonglade.cpp" + > + </File> + </Filter> + <Filter + Name="Mulgore" > - </File> - <File - RelativePath="..\scripts\zone\zulgurub\boss_venoxis.cpp" + <File + RelativePath="..\scripts\zone\mulgore\mulgore.cpp" + > + </File> + </Filter> + <Filter + Name="Onyxia's Lair" > - </File> - <File - RelativePath="..\scripts\zone\zulgurub\boss_wushoolay.cpp" + <File + RelativePath="..\scripts\zone\onyxias_lair\boss_onyxia.cpp" + > + </File> + </Filter> + <Filter + Name="Orgrimmar" > - </File> - <File - RelativePath="..\scripts\zone\zulgurub\def_zulgurub.h" + <File + RelativePath="..\scripts\zone\orgrimmar\orgrimmar.cpp" + > + </File> + </Filter> + <Filter + Name="Ragefire Chasm" > - </File> - <File - RelativePath="..\scripts\zone\zulgurub\instance_zulgurub.cpp" + </Filter> + <Filter + Name="Razorfen Downs" > - </File> - </Filter> - <Filter - Name="Uldaman" - > - <File - RelativePath="..\scripts\zone\uldaman\boss_archaedas.cpp" + <File + RelativePath="..\scripts\zone\razorfen_downs\boss_amnennar_the_coldbringer.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\razorfen_downs\razorfen_downs.cpp" + > + </File> + </Filter> + <Filter + Name="Razorfen Kraul" > - </File> - <File - RelativePath="..\scripts\zone\uldaman\boss_ironaya.cpp" + <File + RelativePath="..\scripts\zone\razorfen_kraul\razorfen_kraul.cpp" + > + </File> + </Filter> + <Filter + Name="Ruins of Ahn'Qiraj" > - </File> - <File - RelativePath="..\scripts\zone\uldaman\instance_uldaman.cpp" + <File + RelativePath="..\scripts\zone\ruins_of_ahnqiraj\boss_ayamiss.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\ruins_of_ahnqiraj\boss_buru.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\ruins_of_ahnqiraj\boss_kurinnaxx.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\ruins_of_ahnqiraj\boss_moam.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\ruins_of_ahnqiraj\boss_ossirian.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\ruins_of_ahnqiraj\boss_rajaxx.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\ruins_of_ahnqiraj\instance_ruins_of_ahnqiraj.cpp" + > + </File> + </Filter> + <Filter + Name="Silithus" > - </File> - <File - RelativePath="..\scripts\zone\uldaman\uldaman.cpp" + <File + RelativePath="..\scripts\zone\silithus\silithus.cpp" + > + </File> + </Filter> + <Filter + Name="Zul'Farrak" > - </File> - </Filter> - <Filter - Name="Un'Goro Crater" - > - <File - RelativePath="..\scripts\zone\ungoro_crater\ungoro_crater.cpp" + <File + RelativePath="..\scripts\zone\zulfarrak\zulfarrak.cpp" + > + </File> + </Filter> + <Filter + Name="Winterspring" > - </File> - </Filter> - <Filter - Name="Aunchindoun" - > + <File + RelativePath="..\scripts\zone\winterspring\winterspring.cpp" + > + </File> + </Filter> <Filter - Name="Auchenai Crypts" + Name="Wailing Caverns" > <File - RelativePath="..\scripts\zone\aunchindoun\auchenai_crypts\boss_exarch_maladaar.cpp" + RelativePath="..\scripts\zone\wailing_caverns\instance_wailing_caverns.cpp" > </File> + </Filter> + <Filter + Name="Un'Goro Crater" + > <File - RelativePath="..\scripts\zone\aunchindoun\auchenai_crypts\boss_shirrak_the_dead_watcher.cpp" + RelativePath="..\scripts\zone\ungoro_crater\ungoro_crater.cpp" > </File> </Filter> <Filter - Name="Mana Tombs" + Name="Thunder Bluff" > <File - RelativePath="..\scripts\zone\aunchindoun\mana_tombs\boss_nexusprince_shaffar.cpp" + RelativePath="..\scripts\zone\thunder_bluff\thunder_bluff.cpp" > </File> + </Filter> + <Filter + Name="Thousand Needles" + > <File - RelativePath="..\scripts\zone\aunchindoun\mana_tombs\boss_pandemonius.cpp" + RelativePath="..\scripts\zone\thousand_needles\thousand_needles.cpp" > </File> </Filter> <Filter - Name="Sethekk Halls" + Name="Temple of Ahn'Qiraj" > <File - RelativePath="..\scripts\zone\aunchindoun\sethekk_halls\boss_darkweaver_syth.cpp" + RelativePath="..\scripts\zone\temple_of_ahnqiraj\boss_bug_trio.cpp" > </File> <File - RelativePath="..\scripts\zone\aunchindoun\sethekk_halls\boss_tailonking_ikiss.cpp" + RelativePath="..\scripts\zone\temple_of_ahnqiraj\boss_cthun.cpp" > </File> <File - RelativePath="..\scripts\zone\aunchindoun\sethekk_halls\def_sethekk_halls.h" + RelativePath="..\scripts\zone\temple_of_ahnqiraj\boss_fankriss.cpp" > </File> <File - RelativePath="..\scripts\zone\aunchindoun\sethekk_halls\instance_sethekk_halls.cpp" + RelativePath="..\scripts\zone\temple_of_ahnqiraj\boss_huhuran.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\temple_of_ahnqiraj\boss_ouro.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\temple_of_ahnqiraj\boss_sartura.cpp" > </File> - </Filter> - <Filter - Name="Shadow Labyrinth" - > <File - RelativePath="..\scripts\zone\aunchindoun\shadow_labyrinth\boss_ambassador_hellmaw.cpp" + RelativePath="..\scripts\zone\temple_of_ahnqiraj\boss_skeram.cpp" > </File> <File - RelativePath="..\scripts\zone\aunchindoun\shadow_labyrinth\boss_blackheart_the_inciter.cpp" + RelativePath="..\scripts\zone\temple_of_ahnqiraj\boss_twinemperors.cpp" > </File> <File - RelativePath="..\scripts\zone\aunchindoun\shadow_labyrinth\boss_grandmaster_vorpil.cpp" + RelativePath="..\scripts\zone\temple_of_ahnqiraj\boss_viscidus.cpp" > </File> <File - RelativePath="..\scripts\zone\aunchindoun\shadow_labyrinth\boss_murmur.cpp" + RelativePath="..\scripts\zone\temple_of_ahnqiraj\def_temple_of_ahnqiraj.h" > </File> <File - RelativePath="..\scripts\zone\aunchindoun\shadow_labyrinth\def_shadow_labyrinth.h" + RelativePath="..\scripts\zone\temple_of_ahnqiraj\instance_temple_of_ahnqiraj.cpp" > </File> <File - RelativePath="..\scripts\zone\aunchindoun\shadow_labyrinth\instance_shadow_labyrinth.cpp" + RelativePath="..\scripts\zone\temple_of_ahnqiraj\mob_anubisath_sentinel.cpp" > </File> </Filter> - </Filter> - <Filter - Name="Azuremyst Isle" - > - <File - RelativePath="..\scripts\zone\azuremyst_isle\azuremyst_isle.cpp" - > - </File> - </Filter> - <Filter - Name="Black Temple" - > - <File - RelativePath="..\scripts\zone\black_temple\black_temple.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\black_temple\boss_bloodboil.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\black_temple\boss_illidan.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\black_temple\boss_mother_shahraz.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\black_temple\boss_reliquary_of_souls.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\black_temple\boss_shade_of_akama.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\black_temple\boss_supremus.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\black_temple\boss_teron_gorefiend.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\black_temple\boss_warlord_najentus.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\black_temple\def_black_temple.h" - > - </File> - <File - RelativePath="..\scripts\zone\black_temple\illidari_council.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\black_temple\instance_black_temple.cpp" - > - </File> - </Filter> - <Filter - Name="Eversong Woods" - > - <File - RelativePath="..\scripts\zone\eversong_woods\eversong_woods.cpp" - > - </File> - </Filter> - <Filter - Name="Ghostlands" - > - <File - RelativePath="..\scripts\zone\ghostlands\ghostlands.cpp" - > - </File> - </Filter> - <Filter - Name="Blade's Edge Mountains" - > - <File - RelativePath="..\scripts\zone\blades_edge_mountains\blades_edge_mountains.cpp" + <Filter + Name="Teldrassil" > - </File> - </Filter> - <Filter - Name="Blasted Lands" - > - <File - RelativePath="..\scripts\zone\blasted_lands\blasted_lands.cpp" + <File + RelativePath="..\scripts\zone\teldrassil\teldrassil.cpp" + > + </File> + </Filter> + <Filter + Name="Tanaris" > - </File> - <File - RelativePath="..\scripts\zone\blasted_lands\boss_kruul.cpp" + <File + RelativePath="..\scripts\zone\tanaris\tanaris.cpp" + > + </File> + </Filter> + <Filter + Name="Stonetalon Mountains" > - </File> + <File + RelativePath="..\scripts\zone\stonetalon_mountains\stonetalon_mountains.cpp" + > + </File> + </Filter> </Filter> <Filter - Name="Hellfire Citadel" + Name="Azeroth" > <Filter - Name="Blood Furnace" + Name="Molten Core" > <File - RelativePath="..\scripts\zone\hellfire_citadel\blood_furnace\boss_broggok.cpp" + RelativePath="..\scripts\zone\molten_core\boss_baron_geddon.cpp" > </File> <File - RelativePath="..\scripts\zone\hellfire_citadel\blood_furnace\boss_kelidan_the_breaker.cpp" + RelativePath="..\scripts\zone\molten_core\boss_garr.cpp" > </File> <File - RelativePath="..\scripts\zone\hellfire_citadel\blood_furnace\boss_the_maker.cpp" + RelativePath="..\scripts\zone\molten_core\boss_gehennas.cpp" > </File> <File - RelativePath="..\scripts\zone\hellfire_citadel\blood_furnace\def_blood_furnace.h" + RelativePath="..\scripts\zone\molten_core\boss_golemagg.cpp" > </File> <File - RelativePath="..\scripts\zone\hellfire_citadel\blood_furnace\instance_blood_furnace.cpp" + RelativePath="..\scripts\zone\molten_core\boss_lucifron.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\molten_core\boss_magmadar.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\molten_core\boss_majordomo_executus.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\molten_core\boss_ragnaros.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\molten_core\boss_shazzrah.cpp" > </File> - </Filter> - <Filter - Name="Magtheridon's lair" - > <File - RelativePath="..\scripts\zone\hellfire_citadel\magtheridons_lair\boss_magtheridon.cpp" + RelativePath="..\scripts\zone\molten_core\boss_sulfuron_harbinger.cpp" > </File> <File - RelativePath="..\scripts\zone\hellfire_citadel\magtheridons_lair\def_magtheridons_lair.h" + RelativePath="..\scripts\zone\molten_core\def_molten_core.h" > </File> <File - RelativePath="..\scripts\zone\hellfire_citadel\magtheridons_lair\instance_magtheridons_lair.cpp" + RelativePath="..\scripts\zone\molten_core\instance_molten_core.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\molten_core\molten_core.cpp" > </File> </Filter> <Filter - Name="Hellfire Ramparts" + Name="Magister's Terrace" > <File - RelativePath="..\scripts\zone\hellfire_citadel\hellfire_ramparts\boss_omor_the_unscarred.cpp" + RelativePath="..\scripts\zone\magisters_terrace\boss_felblood_kaelthas.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\magisters_terrace\boss_priestess_delrissa.cpp" > </File> <File - RelativePath="..\scripts\zone\hellfire_citadel\hellfire_ramparts\boss_vazruden_the_herald.cpp" + RelativePath="..\scripts\zone\magisters_terrace\boss_selin_fireheart.cpp" > </File> <File - RelativePath="..\scripts\zone\hellfire_citadel\hellfire_ramparts\boss_watchkeeper_gargolmar.cpp" + RelativePath="..\scripts\zone\magisters_terrace\boss_vexallus.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\magisters_terrace\def_magisters_terrace.h" + > + </File> + <File + RelativePath="..\scripts\zone\magisters_terrace\instance_magisters_terrace.cpp" > </File> </Filter> <Filter - Name="Shattered Halls" + Name="Loch Modan" > <File - RelativePath="..\scripts\zone\hellfire_citadel\shattered_halls\boss_nethekurse.cpp" + RelativePath="..\scripts\zone\loch_modan\loch_modan.cpp" + > + </File> + </Filter> + <Filter + Name="Karazhan" + > + <File + RelativePath="..\scripts\zone\karazhan\boss_curator.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\karazhan\boss_maiden_of_virtue.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\karazhan\boss_midnight.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\karazhan\boss_moroes.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\karazhan\boss_netherspite.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\karazhan\boss_nightbane.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\karazhan\boss_prince_malchezaar.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\karazhan\boss_shade_of_aran.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\karazhan\boss_terestian_illhoof.cpp" > </File> <File - RelativePath="..\scripts\zone\hellfire_citadel\shattered_halls\boss_warbringer_omrogg.cpp" + RelativePath="..\scripts\zone\karazhan\bosses_opera.cpp" > </File> <File - RelativePath="..\scripts\zone\hellfire_citadel\shattered_halls\boss_warchief_kargath_bladefist.cpp" + RelativePath="..\scripts\zone\karazhan\def_karazhan.h" > </File> <File - RelativePath="..\scripts\zone\hellfire_citadel\shattered_halls\def_shattered_halls.h" + RelativePath="..\scripts\zone\karazhan\instance_karazhan.cpp" > </File> <File - RelativePath="..\scripts\zone\hellfire_citadel\shattered_halls\instance_shattered_halls.cpp" + RelativePath="..\scripts\zone\karazhan\karazhan.cpp" > </File> </Filter> - </Filter> - <Filter - Name="Hellfire Peninsula" - > - <File - RelativePath="..\scripts\zone\hellfire_peninsula\boss_doomlord_kazzak.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\hellfire_peninsula\hellfire_peninsula.cpp" - > - </File> - </Filter> - <Filter - Name="Karazhan" - > - <File - RelativePath="..\scripts\zone\karazhan\boss_curator.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\karazhan\boss_maiden_of_virtue.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\karazhan\boss_midnight.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\karazhan\boss_moroes.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\karazhan\boss_netherspite.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\karazhan\boss_nightbane.cpp" + <Filter + Name="Isle of Quel'Danas" > - </File> - <File - RelativePath="..\scripts\zone\karazhan\boss_prince_malchezaar.cpp" + <File + RelativePath="..\scripts\zone\isle_of_queldanas\isle_of_queldanas.cpp" + > + </File> + </Filter> + <Filter + Name="Hinterlands" > - </File> - <File - RelativePath="..\scripts\zone\karazhan\boss_shade_of_aran.cpp" + </Filter> + <Filter + Name="Iron Forge" > - </File> - <File - RelativePath="..\scripts\zone\karazhan\boss_terestian_illhoof.cpp" + <File + RelativePath="..\scripts\zone\ironforge\ironforge.cpp" + > + </File> + </Filter> + <Filter + Name="Hillsbrad Foothills" > - </File> - <File - RelativePath="..\scripts\zone\karazhan\bosses_opera.cpp" + </Filter> + <Filter + Name="Gnomeregan" > - </File> - <File - RelativePath="..\scripts\zone\karazhan\def_karazhan.h" + </Filter> + <Filter + Name="Ghostlands" > - </File> - <File - RelativePath="..\scripts\zone\karazhan\instance_karazhan.cpp" + <File + RelativePath="..\scripts\zone\ghostlands\ghostlands.cpp" + > + </File> + </Filter> + <Filter + Name="Elwynn Forest" > - </File> - <File - RelativePath="..\scripts\zone\karazhan\karazhan.cpp" + <File + RelativePath="..\scripts\zone\elwynn_forest\elwynn_forest.cpp" + > + </File> + </Filter> + <Filter + Name="Deadmines" > - </File> - </Filter> - <Filter - Name="Nagrand" - > - <File - RelativePath="..\scripts\zone\nagrand\nagrand.cpp" + <File + RelativePath="..\scripts\zone\deadmines\deadmines.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\deadmines\def_deadmines.h" + > + </File> + </Filter> + <Filter + Name="Deadwind Pass" > - </File> - </Filter> - <Filter - Name="Netherstorm" - > - <File - RelativePath="..\scripts\zone\netherstorm\netherstorm.cpp" + </Filter> + <Filter + Name="Dun Morogh" > - </File> - </Filter> - <Filter - Name="Shadowmoon Valley" - > - <File - RelativePath="..\scripts\zone\shadowmoon_valley\boss_doomwalker.cpp" + <File + RelativePath="..\scripts\zone\dun_morogh\dun_morogh.cpp" + > + </File> + </Filter> + <Filter + Name="Alterac Mountains" > - </File> - <File - RelativePath="..\scripts\zone\shadowmoon_valley\shadowmoon_valley.cpp" + <File + RelativePath="..\scripts\zone\alterac_mountains\alterac_mountains.cpp" + > + </File> + </Filter> + <Filter + Name="Arathi Highlands" > - </File> - </Filter> - <Filter - Name="Tempest Keep" - > + <File + RelativePath="..\scripts\zone\arathi_highlands\arathi_highlands.cpp" + > + </File> + </Filter> <Filter - Name="Arcatraz" + Name="Blackrock Depths" > <File - RelativePath="..\scripts\zone\tempest_keep\arcatraz\arcatraz.cpp" + RelativePath="..\scripts\zone\blackrock_depths\blackrock_depths.cpp" > </File> <File - RelativePath="..\scripts\zone\tempest_keep\arcatraz\boss_harbinger_skyriss.cpp" + RelativePath="..\scripts\zone\blackrock_depths\boss_ambassador_flamelash.cpp" > </File> <File - RelativePath="..\scripts\zone\tempest_keep\arcatraz\def_arcatraz.h" + RelativePath="..\scripts\zone\blackrock_depths\boss_anubshiah.cpp" > </File> <File - RelativePath="..\scripts\zone\tempest_keep\arcatraz\instance_arcatraz.cpp" + RelativePath="..\scripts\zone\blackrock_depths\boss_emperor_dagran_thaurissan.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\blackrock_depths\boss_general_angerforge.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\blackrock_depths\boss_gorosh_the_dervish.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\blackrock_depths\boss_grizzle.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\blackrock_depths\boss_high_interrogator_gerstahn.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\blackrock_depths\boss_magmus.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\blackrock_depths\boss_moira_bronzebeard.cpp" > </File> - </Filter> - <Filter - Name="Botanica" - > <File - RelativePath="..\scripts\zone\tempest_keep\botanica\boss_high_botanist_freywinn.cpp" + RelativePath="..\scripts\zone\blackrock_depths\boss_tomb_of_seven.cpp" > </File> <File - RelativePath="..\scripts\zone\tempest_keep\botanica\boss_laj.cpp" + RelativePath="..\scripts\zone\blackrock_depths\def_blackrock_depths.h" > </File> <File - RelativePath="..\scripts\zone\tempest_keep\botanica\boss_warp_splinter.cpp" + RelativePath="..\scripts\zone\blackrock_depths\instance_blackrock_depths.cpp" > </File> </Filter> <Filter - Name="The Eye" + Name="Blackrock Spire" > <File - RelativePath="..\scripts\zone\tempest_keep\the_eye\boss_alar.cpp" + RelativePath="..\scripts\zone\blackrock_spire\boss_drakkisath.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\blackrock_spire\boss_gyth.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\blackrock_spire\boss_halycon.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\blackrock_spire\boss_highlord_omokk.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\blackrock_spire\boss_mother_smolderweb.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\blackrock_spire\boss_overlord_wyrmthalak.cpp" > </File> <File - RelativePath="..\scripts\zone\tempest_keep\the_eye\boss_astromancer.cpp" + RelativePath="..\scripts\zone\blackrock_spire\boss_pyroguard_emberseer.cpp" > </File> <File - RelativePath="..\scripts\zone\tempest_keep\the_eye\boss_kaelthas.cpp" + RelativePath="..\scripts\zone\blackrock_spire\boss_quartermaster_zigris.cpp" > </File> <File - RelativePath="..\scripts\zone\tempest_keep\the_eye\boss_void_reaver.cpp" + RelativePath="..\scripts\zone\blackrock_spire\boss_rend_blackhand.cpp" > </File> <File - RelativePath="..\scripts\zone\tempest_keep\the_eye\def_the_eye.h" + RelativePath="..\scripts\zone\blackrock_spire\boss_shadow_hunter_voshgajin.cpp" > </File> <File - RelativePath="..\scripts\zone\tempest_keep\the_eye\instance_the_eye.cpp" + RelativePath="..\scripts\zone\blackrock_spire\boss_the_beast.cpp" > </File> <File - RelativePath="..\scripts\zone\tempest_keep\the_eye\the_eye.cpp" + RelativePath="..\scripts\zone\blackrock_spire\boss_warmaster_voone.cpp" > </File> </Filter> <Filter - Name="The Mechanar" + Name="Blackwing Lair" > <File - RelativePath="..\scripts\zone\tempest_keep\the_mechanar\boss_gatewatcher_gyrokill.cpp" + RelativePath="..\scripts\zone\blackwing_lair\boss_broodlord_lashlayer.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\blackwing_lair\boss_chromaggus.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\blackwing_lair\boss_ebonroc.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\blackwing_lair\boss_firemaw.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\blackwing_lair\boss_flamegor.cpp" > </File> <File - RelativePath="..\scripts\zone\tempest_keep\the_mechanar\boss_gatewatcher_ironhand.cpp" + RelativePath="..\scripts\zone\blackwing_lair\boss_nefarian.cpp" > </File> <File - RelativePath="..\scripts\zone\tempest_keep\the_mechanar\boss_nethermancer_sepethrea.cpp" + RelativePath="..\scripts\zone\blackwing_lair\boss_razorgore.cpp" > </File> <File - RelativePath="..\scripts\zone\tempest_keep\the_mechanar\boss_pathaleon_the_calculator.cpp" + RelativePath="..\scripts\zone\blackwing_lair\boss_vaelastrasz.cpp" > </File> <File - RelativePath="..\scripts\zone\tempest_keep\the_mechanar\def_mechanar.h" + RelativePath="..\scripts\zone\blackwing_lair\boss_victor_nefarius.cpp" > </File> <File - RelativePath="..\scripts\zone\tempest_keep\the_mechanar\instance_mechanar.cpp" + RelativePath="..\scripts\zone\blackwing_lair\instance_blackwing_lair.cpp" > </File> </Filter> - </Filter> - <Filter - Name="Terokkar Forest" - > - <File - RelativePath="..\scripts\zone\terokkar_forest\terokkar_forest.cpp" - > - </File> - </Filter> - <Filter - Name="Zangarmarsh" - > - <File - RelativePath="..\scripts\zone\zangarmarsh\zangarmarsh.cpp" - > - </File> - </Filter> - <Filter - Name="Blackrock Spire" - > - <File - RelativePath="..\scripts\zone\blackrock_spire\boss_drakkisath.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\blackrock_spire\boss_gyth.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\blackrock_spire\boss_halycon.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\blackrock_spire\boss_highlord_omokk.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\blackrock_spire\boss_mother_smolderweb.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\blackrock_spire\boss_overlord_wyrmthalak.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\blackrock_spire\boss_pyroguard_emberseer.cpp" + <Filter + Name="Blasted Lands" > - </File> - <File - RelativePath="..\scripts\zone\blackrock_spire\boss_quartermaster_zigris.cpp" + <File + RelativePath="..\scripts\zone\blasted_lands\blasted_lands.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\blasted_lands\boss_kruul.cpp" + > + </File> + </Filter> + <Filter + Name="Burning Steppes" > - </File> - <File - RelativePath="..\scripts\zone\blackrock_spire\boss_rend_blackhand.cpp" + <File + RelativePath="..\scripts\zone\burning_steppes\burning_steppes.cpp" + > + </File> + </Filter> + <Filter + Name="Duskwood" > - </File> - <File - RelativePath="..\scripts\zone\blackrock_spire\boss_shadow_hunter_voshgajin.cpp" + </Filter> + <Filter + Name="Eastern Plaguelands" > - </File> - <File - RelativePath="..\scripts\zone\blackrock_spire\boss_the_beast.cpp" + <File + RelativePath="..\scripts\zone\eastern_plaguelands\eastern_plaguelands.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\eastern_plaguelands\the_scarlet_enclave.cpp" + > + </File> + </Filter> + <Filter + Name="Eversong Woods" > - </File> - <File - RelativePath="..\scripts\zone\blackrock_spire\boss_warmaster_voone.cpp" + <File + RelativePath="..\scripts\zone\eversong_woods\eversong_woods.cpp" + > + </File> + </Filter> + <Filter + Name="Redridge Mountains" > - </File> - </Filter> - <Filter - Name="Stormwind City" - > - <File - RelativePath="..\scripts\zone\stormwind\stormwind_city.cpp" + </Filter> + <Filter + Name="Scarlet Monastery" > - </File> - </Filter> - <Filter - Name="Coilfang Resevoir" - > + <File + RelativePath="..\scripts\zone\scarlet_monastery\boss_arcanist_doan.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\scarlet_monastery\boss_azshir_the_sleepless.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\scarlet_monastery\boss_bloodmage_thalnos.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\scarlet_monastery\boss_headless_horseman.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\scarlet_monastery\boss_herod.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\scarlet_monastery\boss_high_inquisitor_fairbanks.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\scarlet_monastery\boss_houndmaster_loksey.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\scarlet_monastery\boss_interrogator_vishas.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\scarlet_monastery\boss_mograine_and_whitemane.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\scarlet_monastery\boss_scorn.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\scarlet_monastery\def_scarlet_monastery.h" + > + </File> + <File + RelativePath="..\scripts\zone\scarlet_monastery\instance_scarlet_monastery.cpp" + > + </File> + </Filter> <Filter - Name="Serpent Shrine Cavern" + Name="Scholomance" > <File - RelativePath="..\scripts\zone\coilfang_resevoir\serpent_shrine\boss_fathomlord_karathress.cpp" + RelativePath="..\scripts\zone\scholomance\boss_darkmaster_gandling.cpp" > </File> <File - RelativePath="..\scripts\zone\coilfang_resevoir\serpent_shrine\boss_hydross_the_unstable.cpp" + RelativePath="..\scripts\zone\scholomance\boss_death_knight_darkreaver.cpp" > </File> <File - RelativePath="..\scripts\zone\coilfang_resevoir\serpent_shrine\boss_lady_vashj.cpp" + RelativePath="..\scripts\zone\scholomance\boss_doctor_theolen_krastinov.cpp" > </File> <File - RelativePath="..\scripts\zone\coilfang_resevoir\serpent_shrine\boss_leotheras_the_blind.cpp" + RelativePath="..\scripts\zone\scholomance\boss_illucia_barov.cpp" > </File> <File - RelativePath="..\scripts\zone\coilfang_resevoir\serpent_shrine\boss_lurker_below.cpp" + RelativePath="..\scripts\zone\scholomance\boss_instructor_malicia.cpp" > </File> <File - RelativePath="..\scripts\zone\coilfang_resevoir\serpent_shrine\boss_morogrim_tidewalker.cpp" + RelativePath="..\scripts\zone\scholomance\boss_jandice_barov.cpp" > </File> <File - RelativePath="..\scripts\zone\coilfang_resevoir\serpent_shrine\def_serpent_shrine.h" + RelativePath="..\scripts\zone\scholomance\boss_kormok.cpp" > </File> <File - RelativePath="..\scripts\zone\coilfang_resevoir\serpent_shrine\instance_serpent_shrine.cpp" + RelativePath="..\scripts\zone\scholomance\boss_lord_alexei_barov.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\scholomance\boss_lorekeeper_polkelt.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\scholomance\boss_ras_frostwhisper.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\scholomance\boss_the_ravenian.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\scholomance\boss_vectus.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\scholomance\def_scholomance.h" + > + </File> + <File + RelativePath="..\scripts\zone\scholomance\instance_scholomance.cpp" > </File> </Filter> <Filter - Name="Slave Pens" + Name="Searing Gorge" > + <File + RelativePath="..\scripts\zone\searing_gorge\searing_gorge.cpp" + > + </File> </Filter> <Filter - Name="Steam Vault" + Name="Shadowfang Keep" > <File - RelativePath="..\scripts\zone\coilfang_resevoir\steam_vault\boss_hydromancer_thespia.cpp" + RelativePath="..\scripts\zone\shadowfang_keep\def_shadowfang_keep.h" > </File> <File - RelativePath="..\scripts\zone\coilfang_resevoir\steam_vault\boss_mekgineer_steamrigger.cpp" + RelativePath="..\scripts\zone\shadowfang_keep\instance_shadowfang_keep.cpp" > </File> <File - RelativePath="..\scripts\zone\coilfang_resevoir\steam_vault\boss_warlord_kalithresh.cpp" + RelativePath="..\scripts\zone\shadowfang_keep\shadowfang_keep.cpp" > </File> + </Filter> + <Filter + Name="Silvermoon City" + > <File - RelativePath="..\scripts\zone\coilfang_resevoir\steam_vault\def_steam_vault.h" + RelativePath="..\scripts\zone\silvermoon\silvermoon_city.cpp" > </File> + </Filter> + <Filter + Name="Silverpine Forest" + > <File - RelativePath="..\scripts\zone\coilfang_resevoir\steam_vault\instance_steam_vault.cpp" + RelativePath="..\scripts\zone\silverpine_forest\silverpine_forest.cpp" > </File> </Filter> <Filter - Name="Underbog" + Name="Stockade" + > + </Filter> + <Filter + Name="Stormwind City" > <File - RelativePath="..\scripts\zone\coilfang_resevoir\underbog\boss_hungarfen.cpp" + RelativePath="..\scripts\zone\stormwind\stormwind_city.cpp" > </File> + </Filter> + <Filter + Name="Stranglethorn Vale" + > <File - RelativePath="..\scripts\zone\coilfang_resevoir\underbog\boss_the_black_stalker.cpp" + RelativePath="..\scripts\zone\stranglethorn_vale\stranglethorn_vale.cpp" > </File> </Filter> - </Filter> - <Filter - Name="Caverns of Time" - > <Filter - Name="The Dark Portal" + Name="Stratholme" + > + <File + RelativePath="..\scripts\zone\stratholme\boss_baron_rivendare.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\stratholme\boss_baroness_anastari.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\stratholme\boss_cannon_master_willey.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\stratholme\boss_dathrohan_balnazzar.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\stratholme\boss_magistrate_barthilas.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\stratholme\boss_maleki_the_pallid.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\stratholme\boss_nerubenkan.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\stratholme\boss_order_of_silver_hand.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\stratholme\boss_postmaster_malown.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\stratholme\boss_ramstein_the_gorger.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\stratholme\boss_timmy_the_cruel.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\stratholme\def_stratholme.h" + > + </File> + <File + RelativePath="..\scripts\zone\stratholme\instance_stratholme.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\stratholme\stratholme.cpp" + > + </File> + </Filter> + <Filter + Name="Sunken Temple" + > + </Filter> + <Filter + Name="Sunwell Plateau" > <File - RelativePath="..\scripts\zone\caverns_of_time\dark_portal\boss_aeonus.cpp" + RelativePath="..\scripts\zone\sunwell_plateau\boss_brutallus.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\sunwell_plateau\boss_eredar_twins.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\sunwell_plateau\boss_felmyst.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\sunwell_plateau\boss_kalecgos.cpp" > </File> <File - RelativePath="..\scripts\zone\caverns_of_time\dark_portal\boss_chrono_lord_deja.cpp" + RelativePath="..\scripts\zone\sunwell_plateau\boss_kiljaeden.cpp" > </File> <File - RelativePath="..\scripts\zone\caverns_of_time\dark_portal\boss_temporus.cpp" + RelativePath="..\scripts\zone\sunwell_plateau\boss_muru.cpp" > </File> <File - RelativePath="..\scripts\zone\caverns_of_time\dark_portal\dark_portal.cpp" + RelativePath="..\scripts\zone\sunwell_plateau\def_sunwell_plateau.h" > </File> <File - RelativePath="..\scripts\zone\caverns_of_time\dark_portal\def_dark_portal.h" + RelativePath="..\scripts\zone\sunwell_plateau\instance_sunwell_plateau.cpp" > </File> <File - RelativePath="..\scripts\zone\caverns_of_time\dark_portal\instance_dark_portal.cpp" + RelativePath="..\scripts\zone\sunwell_plateau\sunwell_plateau.cpp" > </File> </Filter> <Filter - Name="Battle for Mt. Hyjal" + Name="Swamp of Sorrows" > + </Filter> + <Filter + Name="Zul'Gurub" + > + <File + RelativePath="..\scripts\zone\zulgurub\boss_arlokk.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\zulgurub\boss_gahzranka.cpp" + > + </File> <File - RelativePath="..\scripts\zone\caverns_of_time\hyjal\boss_anetheron.cpp" + RelativePath="..\scripts\zone\zulgurub\boss_grilek.cpp" > </File> <File - RelativePath="..\scripts\zone\caverns_of_time\hyjal\boss_archimonde.cpp" + RelativePath="..\scripts\zone\zulgurub\boss_hakkar.cpp" > </File> <File - RelativePath="..\scripts\zone\caverns_of_time\hyjal\boss_azgalor.cpp" + RelativePath="..\scripts\zone\zulgurub\boss_hazzarah.cpp" > </File> <File - RelativePath="..\scripts\zone\caverns_of_time\hyjal\boss_kazrogal.cpp" + RelativePath="..\scripts\zone\zulgurub\boss_jeklik.cpp" > </File> <File - RelativePath="..\scripts\zone\caverns_of_time\hyjal\boss_rage_winterchill.cpp" + RelativePath="..\scripts\zone\zulgurub\boss_jindo.cpp" > </File> <File - RelativePath="..\scripts\zone\caverns_of_time\hyjal\def_hyjal.h" + RelativePath="..\scripts\zone\zulgurub\boss_mandokir.cpp" > </File> <File - RelativePath="..\scripts\zone\caverns_of_time\hyjal\hyjal.cpp" + RelativePath="..\scripts\zone\zulgurub\boss_marli.cpp" > </File> <File - RelativePath="..\scripts\zone\caverns_of_time\hyjal\hyjal_trash.cpp" + RelativePath="..\scripts\zone\zulgurub\boss_renataki.cpp" > </File> <File - RelativePath="..\scripts\zone\caverns_of_time\hyjal\hyjal_trash.h" + RelativePath="..\scripts\zone\zulgurub\boss_thekal.cpp" > </File> <File - RelativePath="..\scripts\zone\caverns_of_time\hyjal\hyjalAI.cpp" + RelativePath="..\scripts\zone\zulgurub\boss_venoxis.cpp" > </File> <File - RelativePath="..\scripts\zone\caverns_of_time\hyjal\hyjalAI.h" + RelativePath="..\scripts\zone\zulgurub\boss_wushoolay.cpp" > </File> <File - RelativePath="..\scripts\zone\caverns_of_time\hyjal\instance_hyjal.cpp" + RelativePath="..\scripts\zone\zulgurub\def_zulgurub.h" + > + </File> + <File + RelativePath="..\scripts\zone\zulgurub\instance_zulgurub.cpp" > </File> </Filter> - <Filter - Name="Old Hillsbrad" + Name="Zul'Aman" > <File - RelativePath="..\scripts\zone\caverns_of_time\old_hillsbrad\boss_captain_skarloc.cpp" + RelativePath="..\scripts\zone\zulaman\boss_akilzon.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\zulaman\boss_halazzi.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\zulaman\boss_hexlord.cpp" > </File> <File - RelativePath="..\scripts\zone\caverns_of_time\old_hillsbrad\boss_epoch_hunter.cpp" + RelativePath="..\scripts\zone\zulaman\boss_janalai.cpp" > </File> <File - RelativePath="..\scripts\zone\caverns_of_time\old_hillsbrad\boss_leutenant_drake.cpp" + RelativePath="..\scripts\zone\zulaman\boss_nalorakk.cpp" > </File> <File - RelativePath="..\scripts\zone\caverns_of_time\old_hillsbrad\def_old_hillsbrad.h" + RelativePath="..\scripts\zone\zulaman\boss_zuljin.cpp" > </File> <File - RelativePath="..\scripts\zone\caverns_of_time\old_hillsbrad\instance_old_hillsbrad.cpp" + RelativePath="..\scripts\zone\zulaman\def_zulaman.h" > </File> <File - RelativePath="..\scripts\zone\caverns_of_time\old_hillsbrad\old_hillsbrad.cpp" + RelativePath="..\scripts\zone\zulaman\instance_zulaman.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\zulaman\zulaman.cpp" > </File> </Filter> - </Filter> - <Filter - Name="Silvermoon City" - > - <File - RelativePath="..\scripts\zone\silvermoon\silvermoon_city.cpp" - > - </File> - </Filter> - <Filter - Name="Darnassus" - > - </Filter> - <Filter - Name="Exodar" - > - </Filter> - <Filter - Name="Iron Forge" - > - <File - RelativePath="..\scripts\zone\ironforge\ironforge.cpp" - > - </File> - </Filter> - <Filter - Name="Orgrimmar" - > - <File - RelativePath="..\scripts\zone\orgrimmar\orgrimmar.cpp" - > - </File> - </Filter> - <Filter - Name="Shattrath City" - > - <File - RelativePath="..\scripts\zone\shattrath\shattrath_city.cpp" - > - </File> - </Filter> - <Filter - Name="Thunder Bluff" - > - <File - RelativePath="..\scripts\zone\thunder_bluff\thunder_bluff.cpp" - > - </File> - </Filter> - <Filter - Name="Undercity" - > - <File - RelativePath="..\scripts\zone\undercity\undercity.cpp" - > - </File> - </Filter> - <Filter - Name="Zul'Aman" - > - <File - RelativePath="..\scripts\zone\zulaman\boss_akilzon.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\zulaman\boss_halazzi.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\zulaman\boss_hexlord.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\zulaman\boss_janalai.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\zulaman\boss_nalorakk.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\zulaman\boss_zuljin.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\zulaman\def_zulaman.h" - > - </File> - <File - RelativePath="..\scripts\zone\zulaman\instance_zulaman.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\zulaman\zulaman.cpp" - > - </File> - </Filter> - <Filter - Name="Isle of Quel'Danas" - > - <File - RelativePath="..\scripts\zone\isle_of_queldanas\isle_of_queldanas.cpp" - > - </File> - </Filter> - <Filter - Name="Magister's Terrace" - > - <File - RelativePath="..\scripts\zone\magisters_terrace\boss_felblood_kaelthas.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\magisters_terrace\boss_priestess_delrissa.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\magisters_terrace\boss_selin_fireheart.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\magisters_terrace\boss_vexallus.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\magisters_terrace\def_magisters_terrace.h" - > - </File> - <File - RelativePath="..\scripts\zone\magisters_terrace\instance_magisters_terrace.cpp" - > - </File> - </Filter> - <Filter - Name="Sunwell Plateau" - > - <File - RelativePath="..\scripts\zone\sunwell_plateau\boss_brutallus.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\sunwell_plateau\boss_eredar_twins.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\sunwell_plateau\boss_felmyst.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\sunwell_plateau\boss_kalecgos.cpp" + <Filter + Name="Wetlands" > - </File> - <File - RelativePath="..\scripts\zone\sunwell_plateau\boss_muru.cpp" + </Filter> + <Filter + Name="Westfall" > - </File> - <File - RelativePath="..\scripts\zone\sunwell_plateau\boss_kiljaeden.cpp" + <File + RelativePath="..\scripts\zone\westfall\westfall.cpp" + > + </File> + </Filter> + <Filter + Name="Western Plaguelands" > - </File> - <File - RelativePath="..\scripts\zone\sunwell_plateau\sunwell_plateau.cpp" + <File + RelativePath="..\scripts\zone\western_plaguelands\western_plaguelands.cpp" + > + </File> + </Filter> + <Filter + Name="Undercity" > - </File> - <File - RelativePath="..\scripts\zone\sunwell_plateau\def_sunwell_plateau.h" + <File + RelativePath="..\scripts\zone\undercity\undercity.cpp" + > + </File> + </Filter> + <Filter + Name="Uldaman" > - </File> - <File - RelativePath="..\scripts\zone\sunwell_plateau\instance_sunwell_plateau.cpp" + <File + RelativePath="..\scripts\zone\uldaman\boss_archaedas.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\uldaman\boss_ironaya.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\uldaman\instance_uldaman.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\uldaman\uldaman.cpp" + > + </File> + </Filter> + <Filter + Name="Tirisfal Glades" > - </File> + <File + RelativePath="..\scripts\zone\tirisfal_glades\tirisfal_glades.cpp" + > + </File> + </Filter> </Filter> <Filter - Name="Blackrock Depths" + Name="Outland" > - <File - RelativePath="..\scripts\zone\blackrock_depths\blackrock_depths.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\blackrock_depths\boss_ambassador_flamelash.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\blackrock_depths\boss_anubshiah.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\blackrock_depths\boss_emperor_dagran_thaurissan.cpp" + <Filter + Name="Netherstorm" > - </File> - <File - RelativePath="..\scripts\zone\blackrock_depths\boss_general_angerforge.cpp" + <File + RelativePath="..\scripts\zone\netherstorm\netherstorm.cpp" + > + </File> + </Filter> + <Filter + Name="Nagrand" > - </File> - <File - RelativePath="..\scripts\zone\blackrock_depths\boss_gorosh_the_dervish.cpp" + <File + RelativePath="..\scripts\zone\nagrand\nagrand.cpp" + > + </File> + </Filter> + <Filter + Name="Gruul's Lair" > - </File> - <File - RelativePath="..\scripts\zone\blackrock_depths\boss_grizzle.cpp" + <File + RelativePath="..\scripts\zone\gruuls_lair\boss_gruul.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\gruuls_lair\boss_high_king_maulgar.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\gruuls_lair\def_gruuls_lair.h" + > + </File> + <File + RelativePath="..\scripts\zone\gruuls_lair\instance_gruuls_lair.cpp" + > + </File> + </Filter> + <Filter + Name="Hellfire Citadel" + > + <Filter + Name="Blood Furnace" + > + <File + RelativePath="..\scripts\zone\hellfire_citadel\blood_furnace\boss_broggok.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\hellfire_citadel\blood_furnace\boss_kelidan_the_breaker.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\hellfire_citadel\blood_furnace\boss_the_maker.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\hellfire_citadel\blood_furnace\def_blood_furnace.h" + > + </File> + <File + RelativePath="..\scripts\zone\hellfire_citadel\blood_furnace\instance_blood_furnace.cpp" + > + </File> + </Filter> + <Filter + Name="Magtheridon's lair" + > + <File + RelativePath="..\scripts\zone\hellfire_citadel\magtheridons_lair\boss_magtheridon.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\hellfire_citadel\magtheridons_lair\def_magtheridons_lair.h" + > + </File> + <File + RelativePath="..\scripts\zone\hellfire_citadel\magtheridons_lair\instance_magtheridons_lair.cpp" + > + </File> + </Filter> + <Filter + Name="Hellfire Ramparts" + > + <File + RelativePath="..\scripts\zone\hellfire_citadel\hellfire_ramparts\boss_omor_the_unscarred.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\hellfire_citadel\hellfire_ramparts\boss_vazruden_the_herald.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\hellfire_citadel\hellfire_ramparts\boss_watchkeeper_gargolmar.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\hellfire_citadel\hellfire_ramparts\def_hellfire_ramparts.h" + > + </File> + <File + RelativePath="..\scripts\zone\hellfire_citadel\hellfire_ramparts\instance_hellfire_ramparts.cpp" + > + </File> + </Filter> + <Filter + Name="Shattered Halls" + > + <File + RelativePath="..\scripts\zone\hellfire_citadel\shattered_halls\boss_nethekurse.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\hellfire_citadel\shattered_halls\boss_warbringer_omrogg.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\hellfire_citadel\shattered_halls\boss_warchief_kargath_bladefist.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\hellfire_citadel\shattered_halls\def_shattered_halls.h" + > + </File> + <File + RelativePath="..\scripts\zone\hellfire_citadel\shattered_halls\instance_shattered_halls.cpp" + > + </File> + </Filter> + </Filter> + <Filter + Name="Hellfire Peninsula" > - </File> - <File - RelativePath="..\scripts\zone\blackrock_depths\boss_high_interrogator_gerstahn.cpp" + <File + RelativePath="..\scripts\zone\hellfire_peninsula\boss_doomlord_kazzak.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\hellfire_peninsula\hellfire_peninsula.cpp" + > + </File> + </Filter> + <Filter + Name="Shadowmoon Valley" > - </File> - <File - RelativePath="..\scripts\zone\blackrock_depths\boss_magmus.cpp" + <File + RelativePath="..\scripts\zone\shadowmoon_valley\boss_doomwalker.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\shadowmoon_valley\shadowmoon_valley.cpp" + > + </File> + </Filter> + <Filter + Name="Tempest Keep" + > + <Filter + Name="Arcatraz" + > + <File + RelativePath="..\scripts\zone\tempest_keep\arcatraz\arcatraz.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\tempest_keep\arcatraz\boss_harbinger_skyriss.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\tempest_keep\arcatraz\def_arcatraz.h" + > + </File> + <File + RelativePath="..\scripts\zone\tempest_keep\arcatraz\instance_arcatraz.cpp" + > + </File> + </Filter> + <Filter + Name="Botanica" + > + <File + RelativePath="..\scripts\zone\tempest_keep\botanica\boss_high_botanist_freywinn.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\tempest_keep\botanica\boss_laj.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\tempest_keep\botanica\boss_warp_splinter.cpp" + > + </File> + </Filter> + <Filter + Name="The Eye" + > + <File + RelativePath="..\scripts\zone\tempest_keep\the_eye\boss_alar.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\tempest_keep\the_eye\boss_astromancer.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\tempest_keep\the_eye\boss_kaelthas.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\tempest_keep\the_eye\boss_void_reaver.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\tempest_keep\the_eye\def_the_eye.h" + > + </File> + <File + RelativePath="..\scripts\zone\tempest_keep\the_eye\instance_the_eye.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\tempest_keep\the_eye\the_eye.cpp" + > + </File> + </Filter> + <Filter + Name="The Mechanar" + > + <File + RelativePath="..\scripts\zone\tempest_keep\the_mechanar\boss_gatewatcher_gyrokill.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\tempest_keep\the_mechanar\boss_gatewatcher_ironhand.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\tempest_keep\the_mechanar\boss_nethermancer_sepethrea.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\tempest_keep\the_mechanar\boss_pathaleon_the_calculator.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\tempest_keep\the_mechanar\def_mechanar.h" + > + </File> + <File + RelativePath="..\scripts\zone\tempest_keep\the_mechanar\instance_mechanar.cpp" + > + </File> + </Filter> + </Filter> + <Filter + Name="Terokkar Forest" > - </File> - <File - RelativePath="..\scripts\zone\blackrock_depths\boss_moira_bronzebeard.cpp" + <File + RelativePath="..\scripts\zone\terokkar_forest\terokkar_forest.cpp" + > + </File> + </Filter> + <Filter + Name="Coilfang Resevoir" + > + <Filter + Name="Serpent Shrine Cavern" + > + <File + RelativePath="..\scripts\zone\coilfang_resevoir\serpent_shrine\boss_fathomlord_karathress.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\coilfang_resevoir\serpent_shrine\boss_hydross_the_unstable.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\coilfang_resevoir\serpent_shrine\boss_lady_vashj.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\coilfang_resevoir\serpent_shrine\boss_leotheras_the_blind.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\coilfang_resevoir\serpent_shrine\boss_lurker_below.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\coilfang_resevoir\serpent_shrine\boss_morogrim_tidewalker.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\coilfang_resevoir\serpent_shrine\def_serpent_shrine.h" + > + </File> + <File + RelativePath="..\scripts\zone\coilfang_resevoir\serpent_shrine\instance_serpent_shrine.cpp" + > + </File> + </Filter> + <Filter + Name="Slave Pens" + > + </Filter> + <Filter + Name="Steam Vault" + > + <File + RelativePath="..\scripts\zone\coilfang_resevoir\steam_vault\boss_hydromancer_thespia.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\coilfang_resevoir\steam_vault\boss_mekgineer_steamrigger.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\coilfang_resevoir\steam_vault\boss_warlord_kalithresh.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\coilfang_resevoir\steam_vault\def_steam_vault.h" + > + </File> + <File + RelativePath="..\scripts\zone\coilfang_resevoir\steam_vault\instance_steam_vault.cpp" + > + </File> + </Filter> + <Filter + Name="Underbog" + > + <File + RelativePath="..\scripts\zone\coilfang_resevoir\underbog\boss_hungarfen.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\coilfang_resevoir\underbog\boss_the_black_stalker.cpp" + > + </File> + </Filter> + </Filter> + <Filter + Name="Aunchindoun" + > + <Filter + Name="Auchenai Crypts" + > + <File + RelativePath="..\scripts\zone\aunchindoun\auchenai_crypts\boss_exarch_maladaar.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\aunchindoun\auchenai_crypts\boss_shirrak_the_dead_watcher.cpp" + > + </File> + </Filter> + <Filter + Name="Mana Tombs" + > + <File + RelativePath="..\scripts\zone\aunchindoun\mana_tombs\boss_nexusprince_shaffar.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\aunchindoun\mana_tombs\boss_pandemonius.cpp" + > + </File> + </Filter> + <Filter + Name="Sethekk Halls" + > + <File + RelativePath="..\scripts\zone\aunchindoun\sethekk_halls\boss_darkweaver_syth.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\aunchindoun\sethekk_halls\boss_tailonking_ikiss.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\aunchindoun\sethekk_halls\def_sethekk_halls.h" + > + </File> + <File + RelativePath="..\scripts\zone\aunchindoun\sethekk_halls\instance_sethekk_halls.cpp" + > + </File> + </Filter> + <Filter + Name="Shadow Labyrinth" + > + <File + RelativePath="..\scripts\zone\aunchindoun\shadow_labyrinth\boss_ambassador_hellmaw.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\aunchindoun\shadow_labyrinth\boss_blackheart_the_inciter.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\aunchindoun\shadow_labyrinth\boss_grandmaster_vorpil.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\aunchindoun\shadow_labyrinth\boss_murmur.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\aunchindoun\shadow_labyrinth\def_shadow_labyrinth.h" + > + </File> + <File + RelativePath="..\scripts\zone\aunchindoun\shadow_labyrinth\instance_shadow_labyrinth.cpp" + > + </File> + </Filter> + </Filter> + <Filter + Name="Black Temple" > - </File> - <File - RelativePath="..\scripts\zone\blackrock_depths\boss_tomb_of_seven.cpp" + <File + RelativePath="..\scripts\zone\black_temple\black_temple.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\black_temple\boss_bloodboil.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\black_temple\boss_illidan.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\black_temple\boss_mother_shahraz.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\black_temple\boss_reliquary_of_souls.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\black_temple\boss_shade_of_akama.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\black_temple\boss_supremus.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\black_temple\boss_teron_gorefiend.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\black_temple\boss_warlord_najentus.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\black_temple\def_black_temple.h" + > + </File> + <File + RelativePath="..\scripts\zone\black_temple\illidari_council.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\black_temple\instance_black_temple.cpp" + > + </File> + </Filter> + <Filter + Name="Blade's Edge Mountains" > - </File> - <File - RelativePath="..\scripts\zone\blackrock_depths\def_blackrock_depths.h" + <File + RelativePath="..\scripts\zone\blades_edge_mountains\blades_edge_mountains.cpp" + > + </File> + </Filter> + <Filter + Name="Zangarmarsh" > - </File> - <File - RelativePath="..\scripts\zone\blackrock_depths\instance_blackrock_depths.cpp" + <File + RelativePath="..\scripts\zone\zangarmarsh\zangarmarsh.cpp" + > + </File> + </Filter> + <Filter + Name="Shattrath City" > - </File> + <File + RelativePath="..\scripts\zone\shattrath\shattrath_city.cpp" + > + </File> + </Filter> </Filter> <Filter - Name="Loch Modan" + Name="Northrend" > - <File - RelativePath="..\scripts\zone\loch_modan\loch_modan.cpp" - > - </File> + <Filter + Name="Region" + > + <Filter + Name="Howling Fjord" + > + </Filter> + <Filter + Name="Grizzly Hills" + > + </Filter> + <Filter + Name="Zul'Drak" + > + </Filter> + <Filter + Name="The Storm Peaks" + > + </Filter> + <Filter + Name="Crystalsong Forest" + > + </Filter> + <Filter + Name="Dragonblight" + > + <File + RelativePath="..\scripts\zone\dragonblight\dragonblight.cpp" + > + </File> + </Filter> + <Filter + Name="Borean Tundra" + > + <File + RelativePath="..\scripts\zone\borean_tundra\borean_tundra.cpp" + > + </File> + </Filter> + <Filter + Name="Wintergrasp" + > + <File + RelativePath="..\scripts\zone\wintergrasp\wintergrasp.cpp" + > + </File> + </Filter> + <Filter + Name="Icecrown" + > + </Filter> + <Filter + Name="Sholazar Basin" + > + </Filter> + <Filter + Name="Dalaran" + > + </Filter> + </Filter> + <Filter + Name="Dungeon" + > + <Filter + Name="Naxxramas" + > + <File + RelativePath="..\scripts\zone\naxxramas\boss_anubrekhan.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\naxxramas\boss_faerlina.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\naxxramas\boss_four_horsemen.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\naxxramas\boss_gluth.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\naxxramas\boss_gothik.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\naxxramas\boss_grobbulus.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\naxxramas\boss_heigan.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\naxxramas\boss_kelthuzad.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\naxxramas\boss_loatheb.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\naxxramas\boss_maexxna.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\naxxramas\boss_noth.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\naxxramas\boss_patchwerk.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\naxxramas\boss_razuvious.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\naxxramas\boss_sapphiron.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\naxxramas\boss_thaddius.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\naxxramas\def_naxxramas.h" + > + </File> + <File + RelativePath="..\scripts\zone\naxxramas\instance_naxxramas.cpp" + > + </File> + </Filter> + <Filter + Name="Nexus" + > + <Filter + Name="Nexus" + > + <File + RelativePath="..\scripts\zone\nexus\nexus\boss_anomalus.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\nexus\nexus\boss_keristrasza.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\nexus\nexus\boss_magus_telestra.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\nexus\nexus\boss_ormorok.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\nexus\nexus\commander_kolurg.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\nexus\nexus\commander_stoutbeard.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\nexus\nexus\def_nexus.h" + > + </File> + <File + RelativePath="..\scripts\zone\nexus\nexus\instance_nexus.cpp" + > + </File> + </Filter> + <Filter + Name="Oculus" + > + <File + RelativePath="..\scripts\zone\nexus\oculus\boss_drakos.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\nexus\oculus\boss_eregos.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\nexus\oculus\boss_urom.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\nexus\oculus\boss_varos.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\nexus\oculus\def_oculus.h" + > + </File> + <File + RelativePath="..\scripts\zone\nexus\oculus\instance_oculus.cpp" + > + </File> + </Filter> + <Filter + Name="Eye of Eternity" + > + <File + RelativePath="..\scripts\zone\nexus\eye_of_eternity\boss_malygos.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\nexus\eye_of_eternity\def_eye_of_eternity.h" + > + </File> + <File + RelativePath="..\scripts\zone\nexus\eye_of_eternity\instance_eye_of_eternity.cpp" + > + </File> + </Filter> + </Filter> + <Filter + Name="Obsidian Sanctum" + > + <File + RelativePath="..\scripts\zone\obsidian_sanctum\boss_sartharion.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\obsidian_sanctum\def_obsidian_sanctum.h" + > + </File> + <File + RelativePath="..\scripts\zone\obsidian_sanctum\instance_obsidian_sanctum.cpp" + > + </File> + </Filter> + <Filter + Name="Ulduar" + > + <Filter + Name="Halls of Stone" + > + <File + RelativePath="..\scripts\zone\ulduar\halls_of_stone\boss_krystallus.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\ulduar\halls_of_stone\boss_maiden_of_grief.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\ulduar\halls_of_stone\boss_sjonnir.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\ulduar\halls_of_stone\def_halls_of_stone.h" + > + </File> + <File + RelativePath="..\scripts\zone\ulduar\halls_of_stone\instance_halls_of_stone.cpp" + > + </File> + </Filter> + <Filter + Name="Halls of Lightning" + > + <File + RelativePath="..\scripts\zone\ulduar\halls_of_lightning\boss_bjarngrim.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\ulduar\halls_of_lightning\boss_ionar.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\ulduar\halls_of_lightning\boss_loken.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\ulduar\halls_of_lightning\boss_volkhan.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\ulduar\halls_of_lightning\def_halls_of_lightning.h" + > + </File> + <File + RelativePath="..\scripts\zone\ulduar\halls_of_lightning\instance_halls_of_lightning.cpp" + > + </File> + </Filter> + </Filter> + <Filter + Name="Utgarde Keep" + > + <Filter + Name="Utgarde Keep" + > + <File + RelativePath="..\scripts\zone\utgarde_keep\utgarde_keep\boss_ingvar_the_plunderer.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\utgarde_keep\utgarde_keep\boss_keleseth.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\utgarde_keep\utgarde_keep\boss_skarvald_dalronn.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\utgarde_keep\utgarde_keep\def_utgarde_keep.h" + > + </File> + <File + RelativePath="..\scripts\zone\utgarde_keep\utgarde_keep\instance_utgarde_keep.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\utgarde_keep\utgarde_keep\utgarde_keep.cpp" + > + </File> + </Filter> + <Filter + Name="Utgarde Pinnacle" + > + <File + RelativePath="..\scripts\zone\utgarde_keep\utgarde_pinnacle\boss_palehoof.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\utgarde_keep\utgarde_pinnacle\boss_skadi.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\utgarde_keep\utgarde_pinnacle\boss_svala.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\utgarde_keep\utgarde_pinnacle\boss_ymiron.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\utgarde_keep\utgarde_pinnacle\def_pinnacle.h" + > + </File> + <File + RelativePath="..\scripts\zone\utgarde_keep\utgarde_pinnacle\instance_pinnacle.cpp" + > + </File> + </Filter> + </Filter> + <Filter + Name="Vault of Archavon" + > + <File + RelativePath="..\scripts\zone\vault_of_archavon\boss_archavon.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\vault_of_archavon\def_vault_of_archavon.h" + > + </File> + <File + RelativePath="..\scripts\zone\vault_of_archavon\instance_vault_of_archavon.cpp" + > + </File> + </Filter> + <Filter + Name="Violet Hold" + > + <File + RelativePath="..\scripts\zone\violet_hold\boss_cyanigosa.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\violet_hold\boss_erekem.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\violet_hold\boss_ichoron.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\violet_hold\boss_lavanthor.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\violet_hold\boss_moragg.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\violet_hold\boss_xevozz.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\violet_hold\boss_zuramat.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\violet_hold\def_violet_hold.h" + > + </File> + <File + RelativePath="..\scripts\zone\violet_hold\instance_violet_hold.cpp" + > + </File> + </Filter> + <Filter + Name="Gundrak" + > + <File + RelativePath="..\scripts\zone\gundrak\boss_drakkari_colossus.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\gundrak\boss_eck.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\gundrak\boss_gal_darah.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\gundrak\boss_moorabi.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\gundrak\boss_slad_ran.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\gundrak\def_gundrak.h" + > + </File> + <File + RelativePath="..\scripts\zone\gundrak\instance_gundrak.cpp" + > + </File> + </Filter> + <Filter + Name="Drak'Tharon Keep" + > + <File + RelativePath="..\scripts\zone\draktharon_keep\boss_dred.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\draktharon_keep\boss_novos.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\draktharon_keep\boss_tharon_ja.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\draktharon_keep\boss_trollgore.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\draktharon_keep\def_drak_tharon_keep.h" + > + </File> + <File + RelativePath="..\scripts\zone\draktharon_keep\instance_drak_tharon_keep.cpp" + > + </File> + </Filter> + <Filter + Name="Azjol-Nerub" + > + <Filter + Name="Ahn'kahet" + > + <File + RelativePath="..\scripts\zone\azjol_nerub\ahnkahet\boss_amanitar.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\azjol_nerub\ahnkahet\boss_elder_nadox.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\azjol_nerub\ahnkahet\boss_herald_volazj.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\azjol_nerub\ahnkahet\boss_jedoga_shadowseeker.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\azjol_nerub\ahnkahet\boss_prince_taldaram.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\azjol_nerub\ahnkahet\def_ahnkahet.h" + > + </File> + <File + RelativePath="..\scripts\zone\azjol_nerub\ahnkahet\instance_ahnkahet.cpp" + > + </File> + </Filter> + <Filter + Name="Azjol-Nerub" + > + <File + RelativePath="..\scripts\zone\azjol_nerub\azjol_nerub\boss_anubarak.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\azjol_nerub\azjol_nerub\boss_hadronox.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\azjol_nerub\azjol_nerub\boss_krikthir_the_gatewatcher.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\azjol_nerub\azjol_nerub\def_azjol_nerub.h" + > + </File> + <File + RelativePath="..\scripts\zone\azjol_nerub\azjol_nerub\instance_azjol_nerub.cpp" + > + </File> + </Filter> + </Filter> + </Filter> </Filter> </Filter> </Filter> @@ -2435,10 +2968,6 @@ </File> </Filter> <File - RelativePath="..\config.h" - > - </File> - <File RelativePath="..\ScriptMgr.cpp" > </File> @@ -2447,10 +2976,6 @@ > </File> <File - RelativePath="..\svn_revision.h" - > - </File> - <File RelativePath="..\system.cpp" > </File> diff --git a/src/bindings/scripts/docs/EventAI.txt b/src/bindings/scripts/docs/EventAI.txt index 37064b63e8b..6bad6050c77 100644 --- a/src/bindings/scripts/docs/EventAI.txt +++ b/src/bindings/scripts/docs/EventAI.txt @@ -42,7 +42,7 @@ action3_param3 All params are signed 32 bit values (+/- 2147483647). If param specifies time then time is in milliseconds. If param specifies percentage then percentages are value/100 (ex: if param = 500 then that means 500%, -50 = -50%) -*Phase mask is a bit mask of which phases this event should not trigger in. Example: Phase mask value of 12 (1100) would mean that this event would trigger 0, 1 and all other phases except for 2 and 3 (0 counts as the first phase). +*Phase mask is a bit mask of which phases this event should not trigger in. Example: Phase mask value of 12 (1100) would mean that this event would trigger 0, 1 and all other phases except for 2 and 3 (0 counts as the first phase). ========================================= Event Types @@ -56,22 +56,24 @@ Events will not repeat until the creature exits combat unless EFLAG_REPEATABLE i ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 0 EVENT_T_TIMER InitialMin, InitialMax, RepeatMin, RepeatMax Expires first between (Param1) and (Param2) and then between every (Param3) and (Param4). but only in combat. 1 EVENT_T_TIMER_OOC InitialMin, InitialMax, RepeatMin, RepeatMax Expires first between (Param1) and (Param2) and then between every (Param3) and (Param4). but only out of combat. -2 EVENT_T_HP HPMax%, HPMin%, RepeatMin, RepeatMax Expires when HP is between (Param1) and (Param2). Will repeat every (Param3) and (Param4). -3 EVENT_T_MANA ManaMax%,ManaMin% RepeatMin, RepeatMax Expires once Mana% is between (Param1) and (Param2). Will repeat every (Param3) and (Param4). -4 EVENT_T_AGGRO NONE Expires upon initial aggro (does not repeat). +2 EVENT_T_HP HPMax%, HPMin%, RepeatMin, RepeatMax Expires when HP is between (Param1) and (Param2). Will repeat every (Param3) and (Param4). +3 EVENT_T_MANA ManaMax%,ManaMin% RepeatMin, RepeatMax Expires once Mana% is between (Param1) and (Param2). Will repeat every (Param3) and (Param4). +4 EVENT_T_AGGRO NONE Expires upon initial aggro (does not repeat). 5 EVENT_T_KILL RepeatMin, RepeatMax Expires upon killing a player. Will repeat between every (Param1) and (Param2). -6 EVENT_T_DEATH NONE Expires upon Death of the Creature. +6 EVENT_T_DEATH NONE Expires upon Death of the Creature. 7 EVENT_T_EVADE NONE Expires upon creature EnterEvadeMode(). 8 EVENT_T_SPELLHIT SpellID, School, RepeatMin, RepeatMax Expires upon Spell hit. If (param1) is set will only expire on that spell. If (param2) will only expire on spells of that school (-1 for all). Will repeat every (Param3) and (Param4) . 9 EVENT_T_RANGE MinDist, MaxDist, RepeatMin, RepeatMax Expires when the highest threat target distance is greater than (Param1) and less than (Param2). Will repeat every (Param3) and (Param4) . -10 EVENT_T_OOC_LOS NoHostile, NoFriendly, RepeatMin, RepeatMax Expires when a Player moves within visible distance to creature. Does not expire for Hostile Players if (Param1) is not 0. Does not expire for Friendly Players if (Param2) is not 0. Will repeat every (Param3) and (Param4) . Does not expire for creatures or pet or when the creature is in combat. +10 EVENT_T_OOC_LOS Hostile-or-Not, MaxAllowedRange, RepeatMin, RepeatMax Expires when a Unit moves within distance(MaxAllowedRange) to creature. If Param1=0 it will expire if Unit are Hostile. If Param1=1 it will only expire if Unit are not Hostile(generally determined by faction). Will repeat every (Param3) and (Param4). Does not expire when the creature is in combat. 11 EVENT_T_SPAWNED NONE Expires at initial spawn and at creature respawn (useful for setting ranged movement type) -12 EVENT_T_TARGET_HP HPMax%, HPMin%, RepeatMin, RepeatMax Expires when Current Target's HP is between (Param1) and (Param2). Will repeat every (Param3) and (Param4) . +12 EVENT_T_TARGET_HP HPMax%, HPMin%, RepeatMin, RepeatMax Expires when Current Target's HP is between (Param1) and (Param2). Will repeat every (Param3) and (Param4) . 13 EVENT_T_TARGET_CASTING RepeatMin, RepeatatMax Expires when the current target is casting a spell. Will repeat every (Param1) and (Param2) . 14 EVENT_T_FRIENDLY_HP HPDeficit, Radius, RepeatMin, RepeatMax Expires when a friendly unit in radius has at least (param1) hp missing. Will repeat every (Param3) and (Param4) . 15 EVENT_T_FRIENDLY_IS_CC DispelType, Radius, RepeatMin, RepeatMax Expires when a friendly unit is Crowd controlled within the given radius (param2). Will repeat every (Param3) and (Param4) . 16 EVENT_T_MISSING_BUFF SpellId, Radius, RepeatMin, RepeatMax Expires when a friendly unit is missing aura's given by spell (param1) within radius (param2). Will repeat every (Param3) and (Param4) . -17 EVENT_T_SUMMONED_UNIT CreatureId, RepeatMin, RepeatMax Expires after creature with entry = (param1) is spawned or for all spawns if param1 = 0. Will repeat every (Param2) and (Param3) . +17 EVENT_T_SUMMONED_UNIT CreatureId, RepeatMin, RepeatMax Expires after creature with entry = (param1) is spawned or for all spawns if param1 = 0. Will repeat every (Param2) and (Param3). +18 EVENT_T_TARGET_MANA ManaMax%, ManaMin%, RepeatMin, RepeatMax +21 EVENT_T_REACHED_HOME NONE Expires when creature reach it's home(spawn) location after Evade. ========================================= Action Types @@ -83,8 +85,8 @@ Params are always read from Param1, then Param2, then Param3. (# Internal Name Param usage Discription) 0 ACTION_T_NONE No Action Does Nothing 1 ACTION_T_TEXT -TextId1, -TextId2, -TextId3 Displays the -TextId as defined. In case -TextId2 and optionally -TextId3, the output will be randomized. Type text are defined in the text table itself(say, yell, whisper, etc) along with other options for the text. All values are required to be negative. -2 ACTION_T_YELL UNUSED -3 ACTION_T_TEXTEMOTE UNUSED +2 ACTION_T_SET_FACTION FactionId Change faction for creature. If param1==0, creature will revert to default faction. +3 ACTION_T_MORPH_TO_ENTRY_OR_MODEL CreatureEntry, ModelId Set model from creature_template.entry(param1) OR set explicit modelId(param2). If param1 AND param2 both 0, demorph and revert to default model for creature. 4 ACTION_T_SOUND SoundId Plays Sound 5 ACTION_T_EMOTE EmoteId Does emote 6 ACTION_T_RANDOM_SAY UNUSED @@ -93,7 +95,7 @@ Params are always read from Param1, then Param2, then Param3. 9 ACTION_T_RANDOM_SOUND SoundId1, SoundId2, SoundId3 Plays random sound between 3 params* 10 ACTION_T_RANDOM_EMOTE EmoteId1, EmoteId2, EmoteId3 Emotes random emote between 3 params 11 ACTION_T_CAST SpellId, Target, CastFlags Casts spell (param1) on target type (param2). Uses Cast Flags (specified below target types) -12 ACTION_T_SUMMON CreatureID, Target, Duration Summons creature (param1) to attack target (param2) for (param3) duration. Spawns on top of current creature. +12 ACTION_T_SUMMON CreatureID, Target, Duration Summons creature (param1) to attack target (param2) for (param3) duration. Spawns on top of current creature. 13 ACTION_T_THREAT_SINGLE_PCT Threat%, Target Modifies threat by (param1) on target type (param2) 14 ACTION_T_THREAT_ALL_PCT Threat% Modifies threat by (param1) on all targets (using -100% on all will result in full aggro dump) 15 ACTION_T_QUEST_EVENT QuestID, Target Calls AreaExploredOrEventHappens with (param1) for target type (Param2) @@ -113,7 +115,7 @@ Params are always read from Param1, then Param2, then Param3. 29 ACTION_T_RANGED_MOVEMENT Distance, Angle Changes the movement generator type to a ranged type. Note: Default melee type can still be done with this. Specify 0 angle and 0 distance. 30 ACTION_T_RANDOM_PHASE PhaseId1, PhaseId2, PhaseId3 Sets the phase to the id between 3 params* 31 ACTION_T_RANDOM_PHASE_RANGE PhaseMin, PhaseMax Sets the phase to a random id (Phase = PhaseMin + rnd % PhaseMin-PhaseMax). PhaseMax must be greater than PhaseMin. -32 ACTION_T_SUMMON CreatureID, Target, SummonID Summons creature (param1) to attack target (param2) at location specified by EventAI_Summons (param3). +32 ACTION_T_SUMMON CreatureID, Target, SummonID Summons creature (param1) to attack target (param2) at location specified by EventAI_Summons (param3). 33 ACTION_T_KILLED_MONSTER CreatureID, Target Calls KilledMonster (param1) for target of type (param2) 34 ACTION_T_SET_INST_DATA Field, Data Calls ScriptedInstance::SetData with field (param1) and data (param2) 35 ACTION_T_SET_INST_DATA64 Field, Target Calls ScriptedInstance::SetData64 with field (param1) and data (param2) target's GUID. @@ -135,7 +137,7 @@ BOTH - This event can trigger both in and out of combat. Events that do not have lables on them are events that are directly involved with the in and out of combat state. ------------------ -0 = EVENT_T_TIMER: +0 = EVENT_T_TIMER: ------------------ Parameter 1: InitialMin - Minumum Time used to calculate Random Initial Expire Parameter 2: InitialMax - Maximum Time used to calculate Random Initial Expire @@ -153,7 +155,7 @@ Parameter 2: InitialMax - Maximum Time used to calculate Random Initial Expire Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire -OUT OF COMBAT ONLY! - Expires first between (Param1) and (Param2) and then between every (Param3) and (Param4) from then on. +OUT OF COMBAT ONLY! - Expires first between (Param1) and (Param2) and then between every (Param3) and (Param4) from then on. This is commonly used for events that occur and repeat outside of combat. --------------- @@ -164,7 +166,7 @@ Parameter 2: HPMin% - Minimum HP% That this Event will Expire Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire -BOTH - Expires when HP is between (Param1) and (Param2). Will repeat every (Param3) and (Param4). +BOTH - Expires when HP is between (Param1) and (Param2). Will repeat every (Param3) and (Param4). This is commonly used for events that trigger at a specific HP% (Such as Heal/Enrage Spells or NPC's that Flee). ----------------- @@ -175,7 +177,7 @@ Parameter 2: ManaMin% - Minimum Mana% That this Event will Expire Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire -BOTH - Expires once Mana% is between (Param1) and (Param2). Will repeat every (Param3) and (Param4). +BOTH - Expires once Mana% is between (Param1) and (Param2). Will repeat every (Param3) and (Param4). This is commonly used for events where an NPC low on Mana will do something (Such as stop casting spells and switch to melee). ------------------ @@ -189,7 +191,7 @@ This Event Expires upon initial aggro (does not repeat). Parameter 1: RepeatMin - Minimum Time used to calculate Random Repeat Expire Parameter 2: RepeatMax - Maximum Time used to calculate Random Repeat Expire -COMBAT ONLY! - Expires upon killing a player. Will repeat every (Param1) and (Param2). +COMBAT ONLY! - Expires upon killing a player. Will repeat every (Param1) and (Param2). This Event Expires upon killing a player. It is commonly used for NPC's who yell or do something after killing a player. ------------------ @@ -201,7 +203,7 @@ This is commonly used for NPC's who have a yell on death or cast some kind if su ------------------ 7 = EVENT_T_EVADE: ------------------ -This Event Expires upon the creature EnterEvadeMode(). +This Event Expires upon the creature EnterEvadeMode(). This is commonly used for NPC's who use phases, allows you to reset their phase to 0 upon evade to prevent possible strange behavior. --------------------- @@ -224,18 +226,18 @@ Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire COMBAT ONLY! - Expires when the highest threat target distance is greater than (Param1) and less than (Param2). Will repeat every (Param3) and (Param4). -This Event is commonly used for NPC's who have Ranged Combat and will Throw/Shoot between a certian distance. +This Event is commonly used for NPC's who have Ranged Combat and will Throw/Shoot between a certian distance. --------------------- 10 = EVENT_T_OOC_LOS: --------------------- -Parameter 1: NoHostile - This Value is to Prevent this Action from Expiring When Caused by a Player/Creature Hostile to them (0 = Prevent Event from Expiring, 1 = Allow Event to Expire) -Parameter 2: NoFriendly - This Value is to Prevent this Action from Expiring When Caused by a Player/Creature Friendly to them (0 = Prevent Event from Expiring, 1 = Allow Event to Expire) +Parameter 1: Hostile-or-Not - This will expire if Unit are hostile. If Param1=1 it will only expire if Unit are not Hostile(generally determined by faction) +Parameter 2: MaxAllowedRange - Expires when a Unit moves within this distance to creature Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire -OUT OF COMBAT ONLY! - Expires when a Player moves within visible distance to the NPC. Does not expire for Hostile Players if (Param1) is not 0. Does not expire for Friendly Players if (Param2) is not 0. Will repeat every (Param3) and (Param4). Does not expire for creatures or pets when they are in combat. -This Event is commonly used for NPC's who Do Something or Say Something when you walk past them Out of Combat. +OUT OF COMBAT! +This Event is commonly used for NPC's who do something or say something to you when you walk past them Out of Comba --------------------- 11 = EVENT_T_SPAWNED: @@ -251,7 +253,7 @@ Parameter 2: HPMin% - Minimum HP% That this Event will Expire Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire -COMBAT ONLY! - Expires when Current NPC's Target's HP is between (Param1) and (Param2). Will repeat every (Param3) and (Param4). +COMBAT ONLY! - Expires when Current NPC's Target's HP is between (Param1) and (Param2). Will repeat every (Param3) and (Param4). This Event is commonly used for NPC's who have a special ability (Like Execute) that only casts when a Player HP is low. ---------------------------- @@ -260,7 +262,7 @@ This Event is commonly used for NPC's who have a special ability (Like Execute) Parameter 1: RepeatMin - Minimum Time used to calculate Random Repeat Expire Parameter 2: RepeatMax - Maximum Time used to calculate Random Repeat Expire -COMBAT ONLY! - Expires when the current target is casting a spell. Will repeat every (Param1) and (Param2). +COMBAT ONLY! - Expires when the current target is casting a spell. Will repeat every (Param1) and (Param2). This event is commonly used for NPC's who will cast a counter spell when their target starts to cast a spell. ------------------------- @@ -282,7 +284,7 @@ Parameter 2: Radius - This is the Range in Yards the NPC will scan for nearby Fr Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire -COMBAT ONLY! - Expires when a friendly unit is Crowd controlled within the given radius (param2). Will repeat every (Param3) and (Param4). +COMBAT ONLY! - Expires when a friendly unit is Crowd controlled within the given radius (param2). Will repeat every (Param3) and (Param4). This is commonly used for NPC's who can come to the resule of other Friendly NPC's if being Crowd Controlled -------------------------- @@ -303,9 +305,15 @@ Parameter 1: CreatureId - The CreatureID that the NPC is watching to spawn to tr Parameter 2: RepeatMin - Minimum Time used to calculate Random Repeat Expire Parameter 3: RepeatMax - Maximum Time used to calculate Random Repeat Expire -BOTH - Expires after creature with entry(Param1) is spawned or for all spawns if param1 = 0. Will repeat every (Param2) and (Param3) . +BOTH - Expires after creature with entry(Param1) is spawned or for all spawns if param1 = 0. Will repeat every (Param2) and (Param3) . This is commonly used for NPC's who will do something special once another NPC is summoned. Usually used is Complex Scripts or Special Events. +--------------------------- +21 = EVENT_T_REACHED_HOME: +--------------------------- +Expires only when creature has returned to it's home location after Evade. Out of combat event. +Most commonly used to cast spells that can not be casted in EVENT_T_EVADE and other effects that does not fit in while still running back to spawn/home location. + ========================================= Action Types @@ -322,15 +330,20 @@ Parameter 1: The entry of the text that the NPC should use from eventai_texts ta Parameter 2: Optional. TextId can be defined in addition. The same apply to this as explained above, however eventAI will randomize between the two. Parameter 3: Optional, if Parameter 2 exist. In this case, eventAI will randomize between three. +See Text-tables.txt for documentation of eventai_texts-table. + ------------------ -2 = ACTION_T_YELL: +2 = ACTION_T_SET_FACTION: ------------------ -UNUSED Can be reused to create new action type +Parameter 1: FactionId from Faction.dbc OR 0. Changes faction for creature. If 0, creature will revert to it's default faction if previously changed. ----------------------- -3 = ACTION_T_TEXTEMOTE: +3 = ACTION_T_MORPH_TO_ENTRY_OR_MODEL: ----------------------- -UNUSED Can be reused to create new action type +Parameter 1: Creature entry from creature_template. Action will then change to the model this creature are using. +Parameter 2: If parameter 1 is 0, then this modelId will be used (in case parameter 1 exist, parameter 2 will not be used) + +If both parameter 1 and 2 is 0, the creature will DeMorph, and use it's default model. ------------------- 4 = ACTION_T_SOUND: @@ -368,16 +381,16 @@ UNUSED Can be reused to create new action type -------------------------- Parameter 1: The Sound ID to be played as Random Choice #1. Parameter 2: The Sound ID to be played as Random Choice #2. -Parameter 3: The Sound ID to be played as Random Choice #3. +Parameter 3: The Sound ID to be played as Random Choice #3. -Similar to the ACTION_T_SOUND action, it will choose at random a sound to play. +Similar to the ACTION_T_SOUND action, it will choose at random a sound to play. --------------------------- 10 = ACTION_T_RANDOM_EMOTE: --------------------------- Parameter 1: The Emote ID to be played as Random Choice #1. Parameter 2: The Emote ID to be played as Random Choice #2. -Parameter 3: The Emote ID to be played as Random Choice #3. +Parameter 3: The Emote ID to be played as Random Choice #3. Similar to the ACTION_T_EMOTE action, it will choose at random an Emote to Visually Perform. @@ -388,26 +401,26 @@ Parameter 1: SpellId - The Spell ID to use for the NPC to cast. The value used i Parameter 2: Target - The Target Type defining who the creature should cast the spell at. The value in this field needs to be a valid Target Type as specified in the reference tables below. Parameter 3: CastFlags - See Table Below for Cast Flag Bitmask Values. If you are unsure what to set this value at leave it at 0. -The creature will cast a spell specified by a spell ID on a target specified by the target type. +The creature will cast a spell specified by a spell ID on a target specified by the target type. This is commonly used for NPC's who cast spells. --------------------- 12 = ACTION_T_SUMMON: --------------------- Parameter 1: CreatureID - The Creature Template ID to be Summoned. The value here needs to be a valid Creature Template ID. -Parameter 2: Target - The Target Type defining who the Summoned creature will attack once spawned. The value in this field needs to be a valid Target Type as specified in the reference tables below. -Parameter 3: Duration - The duration until the summoned creature should be unsummoned AFTER Combat ends. The value in this field is in milliseconds or 0. +Parameter 2: Target - The Target Type defining who the Summoned creature will attack once spawned. The value in this field needs to be a valid Target Type as specified in the reference tables below. +Parameter 3: Duration - The duration until the summoned creature should be unsummoned AFTER Combat ends. The value in this field is in milliseconds or 0. -The NPC will Summon another creature at the same spot as itself that will attack the specified target. +The NPC will Summon another creature at the same spot as itself that will attack the specified target. NOTE: Almost all Creature Summons have proper Summon Spells that should be used when possible. This Action is a powerful last resort option only to be used if nothing else works. NOTE: Using Target Type 0 will cause the Summoned creature to not attack anyone. -NOTE: If Duration is set at 0, then the summoned creature will not despawn until it has died. +NOTE: If Duration is set at 0, then the summoned creature will not despawn until it has died. This is used as a manual way to force an NPC to Summon. -------------------------------- 13 = ACTION_T_THREAT_SINGLE_PCT: -------------------------------- Parameter 1: Threat% - Threat percent that should be modified. The value in this field can range from -100 to +100. If it is negative, threat will be taken away and if positive, threat will be added. -Parameter 2: Target - The Target Type defining on whom the threat change should occur. The value in this field needs to be a valid target type as specified in the reference tables below. +Parameter 2: Target - The Target Type defining on whom the threat change should occur. The value in this field needs to be a valid target type as specified in the reference tables below. This action will modify the threat of a target in the creature's threat list by the specified percent. This is commonly used to allow an NPC to adjust the Threat to a single player. @@ -415,7 +428,7 @@ This is commonly used to allow an NPC to adjust the Threat to a single player. ----------------------------- 14 = ACTION_T_THREAT_ALL_PCT: ----------------------------- -Parameter 1: Threat% - The percent that should be used in modifying everyone's threat in the creature's threat list. The value here can range from -100 to +100. +Parameter 1: Threat% - The percent that should be used in modifying everyone's threat in the creature's threat list. The value here can range from -100 to +100. This action will modify the threat for everyone in the creature's threat list by the specified percent. NOTE: Using -100 will cause the creature to reset everyone's threat to 0 so that everyone has the same amount of threat. It will NOT remove anyone from the threat list. @@ -425,10 +438,10 @@ This is commonly used to allow an NPC to drop threat for all players to zero. 15 = ACTION_T_QUEST_EVENT: -------------------------- Parameter 1: QuestID - The Quest Template ID. The value here must be a valid quest template ID. Furthermore, the quest should have SpecialFlags | 2 as it would need to be completed by an external event which is the activation of this action. -Parameter 2: Target - The Target Type defining whom the quest should be completed for. The value in this field needs to be a valid target type as specified in the reference tables below. +Parameter 2: Target - The Target Type defining whom the quest should be completed for. The value in this field needs to be a valid target type as specified in the reference tables below. -This action will satisfy the external completion requirement for the quest for the specified target defined by the target type. -NOTE: This action can only be used with player targets so it must be ensured that the target type will point to a player. +This action will satisfy the external completion requirement for the quest for the specified target defined by the target type. +NOTE: This action can only be used with player targets so it must be ensured that the target type will point to a player. This is commonly used for Quests where only ONE player will gain credit for the quest. ----------------------------- @@ -436,9 +449,9 @@ This is commonly used for Quests where only ONE player will gain credit for the ----------------------------- Parameter 1: CreatureID - The Creature Template ID to be Summoned. The value here needs to be a valid Creature Template ID. Parameter 2: SpellId - The Spell ID to use to simulate the cast. The value used in this field needs to be a valid Spell ID. -Parameter 3: Target - The Target Type defining whom the quest credit should be given to. The value in this field needs to be a valid target type as specified in the reference tables below. +Parameter 3: Target - The Target Type defining whom the quest credit should be given to. The value in this field needs to be a valid target type as specified in the reference tables below. -This action will call CastedCreatureOrGO() function for the player. It can be used to give quest credit for casting a spell on the creature. +This action will call CastedCreatureOrGO() function for the player. It can be used to give quest credit for casting a spell on the creature. This is commonly used for NPC's who have a special requirement to have a Spell cast on them to complete a quest. ----------------------------- @@ -446,7 +459,7 @@ This is commonly used for NPC's who have a special requirement to have a Spell c ----------------------------- Parameter 1: Field_Number - The index of the Field Number to be changed. Use (http://wiki.udbforums.org/index.php/Character_data) for a list of indeces and what they control. Creatures only contain the OBJECT_FIELD_* and UNIT_FIELD_* fields. They do not contain the PLAYER_FIELD_* fields. Parameter 2: Value - The new value to be put in the field. -Parameter 3: Target - The Target Type defining for whom the unit field should be changed. The value in this field needs to be a valid target type as specified in the reference tables below. +Parameter 3: Target - The Target Type defining for whom the unit field should be changed. The value in this field needs to be a valid target type as specified in the reference tables below. When activated, this action can change the target's unit field values. More information on the field value indeces can be found at (http://wiki.udbforums.org/index.php/Character_data) @@ -454,31 +467,31 @@ When activated, this action can change the target's unit field values. More info 18 = ACTION_T_SET_UNIT_FLAG: ---------------------------- Parameter 1: Flags - The flag(s) to be set. Multiple flags can be set by using bitwise-OR on them (adding them together). -Parameter 2: Target - The Target Type defining for whom the flags should be changed. The value in this field needs to be a valid Target Type as specified in the reference tables below. +Parameter 2: Target - The Target Type defining for whom the flags should be changed. The value in this field needs to be a valid Target Type as specified in the reference tables below. -When activated, this action changes the target's flags by adding (turning on) more flags. For example, this action can make the creature unattackable/unselectable if the right flags are used. +When activated, this action changes the target's flags by adding (turning on) more flags. For example, this action can make the creature unattackable/unselectable if the right flags are used. ------------------------------- 19 = ACTION_T_REMOVE_UNIT_FLAG: ------------------------------- Parameter 1: Flags - The flag(s) to be removed. Multiple flags can be set by using bitwise-OR on them (adding them together). -Parameter 2: Target - The target type defining for whom the flags should be changed. The value in this field needs to be a valid Target Type as specified in the reference tables below. +Parameter 2: Target - The target type defining for whom the flags should be changed. The value in this field needs to be a valid Target Type as specified in the reference tables below. -When activated, this action changes the target's flags by removing (turning off) flags. For example, this action can make the creature normal after it was unattackable/unselectable if the right flags are used. +When activated, this action changes the target's flags by removing (turning off) flags. For example, this action can make the creature normal after it was unattackable/unselectable if the right flags are used. -------------------------- 20 = ACTION_T_AUTO_ATTACK: -------------------------- -Parameter 1: AllowAutoAttack - If zero, then the creature will stop its melee attacks. If non-zero, then the creature will either continue its melee attacks (the action would then have no effect) or it will start its melee attacks on the target with the top threat if its melee attacks were previously stopped. +Parameter 1: AllowAutoAttack - If zero, then the creature will stop its melee attacks. If non-zero, then the creature will either continue its melee attacks (the action would then have no effect) or it will start its melee attacks on the target with the top threat if its melee attacks were previously stopped. -This action controls whether or not the creature should stop or start the auto melee attack. +This action controls whether or not the creature should stop or start the auto melee attack. NOTE: The ACID Dev Team has conformed to using either 0 or 1 for the Param values (0 = Stop Melee, 1 = Start Melee). This is commonly used in combination with EVENT_T_RANGE and ACTION_T_COMBAT_MOVEMENT for Ranged Combat for Mages and Spell Casters. ------------------------------ 21 = ACTION_T_COMBAT_MOVEMENT: ------------------------------ -Parameter 1: If zero, then the creature will stop moving towards its victim (if its victim gets out of melee range) and will be stationary. If non-zero, then the creature will either continue to follow its victim (the action would have no effect) or it will start to follow the target with the top threat if its movement was disabled before. +Parameter 1: If zero, then the creature will stop moving towards its victim (if its victim gets out of melee range) and will be stationary. If non-zero, then the creature will either continue to follow its victim (the action would have no effect) or it will start to follow the target with the top threat if its movement was disabled before. This action controls whether or not the creature will always move towards its target. NOTE: The ACID Dev Team has conformed to using either 0 or 1 for the Param values. (0 = Stop Movement, 1 = Start Movement) @@ -487,7 +500,7 @@ This is commonly used with EVENT_T_RANGE and ACTION_T_AUTO_ATTACK for NPC's who ------------------------ 22 = ACTION_T_SET_PHASE: ------------------------ -Parameter 1: The new phase to set the creature in. This number must be an integer between 0 and 31. Numbers outside of that range will result in an error. +Parameter 1: The new phase to set the creature in. This number must be an integer between 0 and 31. Numbers outside of that range will result in an error. When activated, this action sets the creature's event to the specified value. NOTE: The creature's current Phase is NOT reset at creature evade. You must manually set the phase back to 0 at EVENT_T_RESET. @@ -497,20 +510,20 @@ This is commonly used for complex scripts with several phases and you need to sw ------------------------ 23 = ACTION_T_INC_PHASE: ------------------------ -Parameter 1: Value - The number of phases to increase or decrease. Use negative values to decrease the current phase. +Parameter 1: Value - The number of phases to increase or decrease. Use negative values to decrease the current phase. -When activated, this action will increase (or decrease) the current creature's phase. -NOTE: After increasing or decreasing the phase by this action, the current phase must NOT be lower than 0 or exceed 31. +When activated, this action will increase (or decrease) the current creature's phase. +NOTE: After increasing or decreasing the phase by this action, the current phase must NOT be lower than 0 or exceed 31. This can be used instead of ACTION_T_SET_PHASE to change phases in scripts. Just a user friendly option for changing phases. -------------------- 24 = ACTION_T_EVADE: -------------------- -When activated, the creature will immediately exit out of combat, clear its threat list, and move back to its spawn point. Basically, this action will reset the whole encounter. +When activated, the creature will immediately exit out of combat, clear its threat list, and move back to its spawn point. Basically, this action will reset the whole encounter. NOTE: All Param Values Are 0 for this Action. ------------------- -25 = ACTION_T_FLEE: +25 = ACTION_T_FLEE: ------------------- When activated, the creature will try to flee from combat. Currently this is done by it casting a fear-like spell on itself called "Run Away". A Better Flee system is in Development but will take time before it is implimented. NOTE: All Param Values Are 0 for this Action. @@ -518,47 +531,47 @@ NOTE: All Param Values Are 0 for this Action. ------------------------------ 26 = ACTION_T_QUEST_EVENT_ALL: ------------------------------ -Parameter 1: QuestId - The quest ID to finish for everyone. +Parameter 1: QuestId - The quest ID to finish for everyone. -This action does the same thing as the ACTION_T_QUEST_EVENT does but it does it for all players in the creature's threat list. -NOTE: If a player is not in the NPC's threat list for whatever reason, he/she won't get the quest completed. +This action does the same thing as the ACTION_T_QUEST_EVENT does but it does it for all players in the creature's threat list. +NOTE: If a player is not in the NPC's threat list for whatever reason, he/she won't get the quest completed. --------------------------------- 27 = ACTION_T_CASTCREATUREGO_ALL: --------------------------------- Parameter 1: QuestId - The quest template ID. -Parameter 2: SpellId - The spell ID used to simulate the cast. +Parameter 2: SpellId - The spell ID used to simulate the cast. -This action does the same thing as the ACTION_T_CASTCREATUREGO does but it does it for all players in the creature's threat list. -NOTE: If a player is not in its threat list for whatever reason, he/she won't receive the cast emulation. +This action does the same thing as the ACTION_T_CASTCREATUREGO does but it does it for all players in the creature's threat list. +NOTE: If a player is not in its threat list for whatever reason, he/she won't receive the cast emulation. ----------------------------------- 28 = ACTION_T_REMOVEAURASFROMSPELL: ----------------------------------- Parameter 1: Target - The target type defining for whom the unit field should be changed. The value in this field needs to be a valid target type as specified in the reference tables below. -Parameter 2: SpellId - The spell ID whose auras will be removed. +Parameter 2: SpellId - The spell ID whose auras will be removed. -This action will remove all auras from a specific spell from the target. +This action will remove all auras from a specific spell from the target. This is commonly used for NPC's who have an OOC Aura that is removed at combat start or a similar idea (Like Stealth or Shape Shift) ------------------------------ 29 = ACTION_T_RANGED_MOVEMENT: ------------------------------ Parameter 1: Distance - The distance the mob should keep between it and its target. -Parameter 2: Angle - The angle the mob should use. +Parameter 2: Angle - The angle the mob should use. -This action changes the movement type generator to ranged type using the specified values for angle and distance. -NOTE: Specifying zero angle and distance will make it just melee instead. -This is commonly used for NPC's who always attack at range and you can specify the distance they will maintain from the target. +This action changes the movement type generator to ranged type using the specified values for angle and distance. +NOTE: Specifying zero angle and distance will make it just melee instead. +This is commonly used for NPC's who always attack at range and you can specify the distance they will maintain from the target. --------------------------- 30 = ACTION_T_RANDOM_PHASE: --------------------------- Parameter 1: PhaseId1 - A possible random phase choice. Parameter 2: PhaseId2 - A possible random phase choice. -Parameter 3: PhaseId3 - A possible random phase choice. +Parameter 3: PhaseId3 - A possible random phase choice. -Randomly sets the phase to one from the three parameter choices. +Randomly sets the phase to one from the three parameter choices. NOTE: Use -1 to specify that if this param is picked to do nothing. Random is constant between actions within an event. So if you have a random Yell and a random Sound they will match up (ex: param2 with param2) NOTE 2: PLEASE NOTE THAT EACH OF THE PARAM VALUES ARE ACTUAL PHASE NUMBERS NOT THE INVERSE PHASE MASK VALUE. This is commonly used for Spellcasting NPC's who on Aggro may select at random a school of spells to use for the fight. Use this if you have up to 3 phases used, otherwise use Action 31 for more then 3 phases. @@ -567,9 +580,9 @@ This is commonly used for Spellcasting NPC's who on Aggro may select at random a 31 = ACTION_T_RANDOM_PHASE_RANGE: --------------------------------- Parameter 1: PhaseMin - The minimum of the phase range. -Parameter 2: PhaseMax - The maximum of the phase range. The number here must be greater than PhaseMin. +Parameter 2: PhaseMax - The maximum of the phase range. The number here must be greater than PhaseMin. -Randomly sets the phase between a range of phases controlled by the parameters. Sets the phase to a random id (Phase = PhaseMin + rnd % PhaseMin-PhaseMax). +Randomly sets the phase between a range of phases controlled by the parameters. Sets the phase to a random id (Phase = PhaseMin + rnd % PhaseMin-PhaseMax). NOTE: PhaseMax must be greater than PhaseMin. NOTE 2: PLEASE NOTE THAT EACH OF THE PARAM VALUES ARE ACTUAL PHASE NUMBERS NOT THE INVERSE PHASE MASK VALUE. This is commonly used for Spellcasting NPC's who on Aggro may select at random a school of spells to use for the fight. Use this if you have MORE then 3 phases used, otherwise use Action 30. @@ -579,9 +592,9 @@ This is commonly used for Spellcasting NPC's who on Aggro may select at random a --------------------- Parameter 1: CreatureID - The creature template ID to be summoned. The value here needs to be a valid creature template ID. Parameter 2: Target - The target type defining who the summoned creature will attack. The value in this field needs to be a valid target type as specified in the reference tables below. NOTE: Using target type 0 will cause the summoned creature to not attack anyone. -Parameter 3: SummonID - The summon ID from the eventai_summons table controlling the position (and spawntime) where the summoned mob should be spawned at. +Parameter 3: SummonID - The summon ID from the eventai_summons table controlling the position (and spawntime) where the summoned mob should be spawned at. -Summons creature (param1) to attack target (param2) at location specified by EventAI_Summons (param3). +Summons creature (param1) to attack target (param2) at location specified by EventAI_Summons (param3). NOTE: Param3 Value is the ID Value used for the entry used in EventAI_Summons for this action. You MUST have an EventAI_Summons entry to use this action. This is commonly used for NPC's who need to Summon a creature at a specific location. (Normally used for complex events) @@ -589,9 +602,9 @@ This is commonly used for NPC's who need to Summon a creature at a specific loca 33 = ACTION_T_KILLED_MONSTER: ----------------------------- Parameter 1: CreatureID - The creature template ID. The value here must be a valid creature template ID. -Parameter 2: Target - The target type defining whom the quest kill count should be given to. The value in this field needs to be a valid target type as specified in the reference tables below. +Parameter 2: Target - The target type defining whom the quest kill count should be given to. The value in this field needs to be a valid target type as specified in the reference tables below. -When activated, this action will call KilledMonster() function for the player. It can be used to give creature credit for killing a creature. In general if the quest is set to be accompished on different creatures (e.g. "Credit" templates). +When activated, this action will call KilledMonster() function for the player. It can be used to give creature credit for killing a creature. In general if the quest is set to be accompished on different creatures (e.g. "Credit" templates). NOTE: It can be ANY creature including certain quest specific triggers This is commonly used for giving the player Quest Credits for NPC kills (Many NPC's may use the same CreatureID for the Kill Credit) @@ -601,7 +614,7 @@ This is commonly used for giving the player Quest Credits for NPC kills (Many NP Parameter 1: Field - The field to change in the instance script. Again, this field needs to be a valid field that has been already defined in the instance's script. Parameter 2: Data - The value to put at that field index. -Sets data for the instance. Note that this will only work when the creature is inside an instantiable zone that has a valid script (ScriptedInstance) assigned. +Sets data for the instance. Note that this will only work when the creature is inside an instantiable zone that has a valid script (ScriptedInstance) assigned. NOTE: Param1 Value is located in "def_<instance name>.h" SD2 File and Param2 value is generally found in the "sc_instance.h" file in SD2 This is commonly used to link an ACID script with a SD2 C++ Script. You make make things happen like opening doors on specific events that happen. ACID Just triggers the C++ Script to function. @@ -609,30 +622,30 @@ This is commonly used to link an ACID script with a SD2 C++ Script. You make mak 35 = ACTION_T_SET_INST_DATA64: ------------------------------ Parameter 1: Field - The field to change in the instance script. Again, this field needs to be a valid field that has been already defined in the instance's script. -Parameter 2: Target - The target type to use to get the GUID that will be stored at the field index. The value in this field needs to be a valid target type as specified in the reference tables below. +Parameter 2: Target - The target type to use to get the GUID that will be stored at the field index. The value in this field needs to be a valid target type as specified in the reference tables below. -Sets GUID (64 bits) data for the instance based on the target. Note that this will only work when the creature is inside an instantiable zone that has a valid script (ScriptedInstance) assigned. +Sets GUID (64 bits) data for the instance based on the target. Note that this will only work when the creature is inside an instantiable zone that has a valid script (ScriptedInstance) assigned. Calls ScriptedInstance::SetData64 with field (param1) and data (param2) target's GUID. ------------------------------ 36 = ACTION_T_UPDATE_TEMPLATE: ------------------------------ Parameter 1: TemplateId - The creature template ID. The value here must be a valid creature template ID. -Parameter 2: Team - Use model_id from team : Alliance(0) or Horde (1). +Parameter 2: Team - Use model_id from team : Alliance(0) or Horde (1). -This function temporarily changes creature entry to new entry, display is changed, loot is changed, but AI is not changed. At respawn creature will be reverted to original entry. +This function temporarily changes creature entry to new entry, display is changed, loot is changed, but AI is not changed. At respawn creature will be reverted to original entry. Changes the creature to a new creature template of (param1) with team = Alliance if (param2) = false or Horde if (param2) = true ------------------ 37 = ACTION_T_DIE: ------------------ Kills the creature -This is commonly used if you need to Instakill the creature for one reason or another. +This is commonly used if you need to Instakill the creature for one reason or another. -------------------------------- 38 = ACTION_T_ZONE_COMBAT_PULSE: -------------------------------- -Places all players within the instance into combat with the creature. Only works in combat and only works inside of instances. +Places all players within the instance into combat with the creature. Only works in combat and only works inside of instances. ========================================= @@ -666,7 +679,7 @@ Another example: the number "5" (101 in Binary, selecting first and third option 4 16 CAST_FORCE_TARGET_SELF Forces the target to cast this spell on itself 5 32 CAST_AURA_NOT_PRESENT Only casts the spell on the target if the target does not have the aura from that spell on itself already. -NOTE: You can add the numbers in the decimal column to combine flags. +NOTE: You can add the numbers in the decimal column to combine flags. For example if you wanted to use CAST_NO_MELEE_IF_OOM(8) and CAST_TRIGGERED(2) you would simply use 10 in the cast flags field (8 + 2 = 10). ========================================= @@ -684,4 +697,4 @@ Below is the list of current Event Flags that EventAI can handle. Event flags ar 6 64 7 128 EFLAG_DEBUG_ONLY Prevents events from occuring on Release builds of ScriptDev2. Useful for testing new features. -NOTE: You can add the numbers in the decimal column to combine flags. +NOTE: You can add the numbers in the decimal column to combine flags.
\ No newline at end of file diff --git a/src/bindings/scripts/docs/Text-tables.txt b/src/bindings/scripts/docs/Text-tables.txt index 6db1ce9d852..eac63384785 100644 --- a/src/bindings/scripts/docs/Text-tables.txt +++ b/src/bindings/scripts/docs/Text-tables.txt @@ -3,20 +3,20 @@ Texts Documentation ========================================= Scriptdev2 Revision 695 introduces a new format for using texts in EventAI and SD2 Scripts. -This information relates to the three *_texts tables located in the ScriptDev Database. +This information relates to the *_texts tables located in the ScriptDev Database. Any script can at any time access and use text from any of the three text tables, as long as the entry does in fact exist. Custom scripters are adviced to store their text data in custom_texts. -The three different tables has ranges of entries allowed for that table. -eventai_texts: entry -1 -> -999999 +The different tables has ranges of entries allowed for that table. +Reserved EventAI in Mangos entry -1 -> -999999 script_texts: entry -1000000 -> -1999999 custom_texts: entry -2000000 -> -2999999 Any entry out of range for that table will display a startup error. ========================================= -Basic Structure of eventai_texts, script_texts and custom_texts +Basic Structure of script_texts and custom_texts ========================================= Below is a the list of current fields within the texts tables. @@ -52,10 +52,11 @@ Below is the list of current Text types that texts tables can handle. These were ----------------------------------------------------------- 0 CHAT_TYPE_SAY This type sets the text to be displayed as a Say (Speech Bubble). 1 CHAT_TYPE_YELL This type sets the text to be displayed as a Yell (Red Speech Bubble) and usually has a matching Sound ID. -2 CHAT_TYPE_TEXT_EMOTE This type sets the text to be displayed as a text emote in orange in the chat log. -3 CHAT_TYPE_BOSS_EMOTE This type sets the text to be displayed as a text emote in orange in the chat log (Used only for specific Bosses). +2 CHAT_TYPE_TEXT_EMOTE This type sets the text to be displayed as a text emote in orange in the chat log. +3 CHAT_TYPE_BOSS_EMOTE This type sets the text to be displayed as a text emote in orange in the chat log (Used only for specific Bosses). 4 CHAT_TYPE_WHISPER This type sets the text to be displayed as a whisper to the player in the chat log. 5 CHAT_TYPE_BOSS_WHISPER This type sets the text to be displayed as a whisper to the player in the chat log (Used only for specific Bosses). +6 CHAT_TYPE_ZONE_YELL Same as CHAT_TYPE_YELL but will display to all players in current zone. ========================================= @@ -65,7 +66,7 @@ Below is the list of current Language types that are allowed. This is the Race Language that the text is native to (So it will display properly) # Internal Name Description ------------------------------------------------------------ +----------------------------------------------------------- 0 UNIVERSAL Text in this language is understood by ALL Races. 1 ORCISH Text in this language is understood ONLY by Horde Races. 2 DARNASSIAN Text in this language is understood ONLY by the Night Elf Race. diff --git a/src/bindings/scripts/include/precompiled.cpp b/src/bindings/scripts/include/precompiled.cpp index 9753d023374..75bfae9e1c4 100644 --- a/src/bindings/scripts/include/precompiled.cpp +++ b/src/bindings/scripts/include/precompiled.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * This program is free software licensed under GPL version 2 * Please see the included DOCS/LICENSE.TXT for more information */ diff --git a/src/bindings/scripts/include/precompiled.h b/src/bindings/scripts/include/precompiled.h index cd6d68f9f31..fa676f460ef 100644 --- a/src/bindings/scripts/include/precompiled.h +++ b/src/bindings/scripts/include/precompiled.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * This program is free software licensed under GPL version 2 * Please see the included DOCS/LICENSE.TXT for more information */ @@ -15,6 +15,8 @@ #include "sc_creature.h" #include "sc_gossip.h" #include "sc_instance.h" +#include "AggressorAI.h" +#include "NullCreatureAI.h" #ifdef WIN32 #include <windows.h> diff --git a/src/bindings/scripts/include/sc_creature.cpp b/src/bindings/scripts/include/sc_creature.cpp index 62a6255828f..a1736689522 100644 --- a/src/bindings/scripts/include/sc_creature.cpp +++ b/src/bindings/scripts/include/sc_creature.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2008 Trinity <http://www.trinitycore.org/> +/* Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/> * * Thanks to the original authors: ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * @@ -9,6 +9,7 @@ #include "Item.h" #include "Spell.h" #include "ObjectMgr.h" +#include "TemporarySummon.h" // Spell summary for ScriptedAI::SelectSpell struct TSpellSummary { @@ -16,101 +17,88 @@ struct TSpellSummary { uint8 Effects; // set of enum SelectEffect } *SpellSummary; -void SummonList::Despawn(Creature *summon) +void SummonList::DoZoneInCombat(uint32 entry) { - uint64 guid = summon->GetGUID(); - for(iterator i = begin(); i != end(); ++i) + for(iterator i = begin(); i != end();) { - if(*i == guid) - { - erase(i); - return; - } + Creature *summon = Unit::GetCreature(*m_creature, *i); + ++i; + if(summon && summon->IsAIEnabled + && (!entry || summon->GetEntry() == entry)) + summon->AI()->DoZoneInCombat(); } } -void SummonList::DespawnEntry(uint32 entry) +void SummonList::DoAction(uint32 entry, uint32 info) { - for(iterator i = begin(); i != end(); ++i) + for(iterator i = begin(); i != end();) { - if(Creature *summon = Unit::GetCreature(*m_creature, *i)) - { - if(summon->GetEntry() == entry) - { - summon->setDeathState(JUST_DIED); - summon->RemoveCorpse(); - i = erase(i); - --i; - } - } - else - { - i = erase(i); - --i; - } + Creature *summon = Unit::GetCreature(*m_creature, *i); + ++i; + if(summon && summon->IsAIEnabled + && (!entry || summon->GetEntry() == entry)) + summon->AI()->DoAction(info); } } -void SummonList::DespawnAll() +void SummonList::DespawnEntry(uint32 entry) { - for(iterator i = begin(); i != end(); ++i) + for(iterator i = begin(); i != end();) { - if(Creature *summon = Unit::GetCreature(*m_creature, *i)) + Creature *summon = Unit::GetCreature(*m_creature, *i); + if(!summon) + erase(i++); + else if(summon->GetEntry() == entry) { + erase(i++); summon->setDeathState(JUST_DIED); summon->RemoveCorpse(); } + else + ++i; } - clear(); } -void ScriptedAI::AttackStart(Unit* who, bool melee) +void SummonList::DespawnAll() { - if (!who) - return; - - if (m_creature->Attack(who, melee)) + while(!empty()) { - m_creature->AddThreat(who, 0.0f); - - if (!InCombat) + Creature *summon = Unit::GetCreature(*m_creature, *begin()); + if(!summon) + erase(begin()); + else { - InCombat = true; - Aggro(who); + erase(begin()); + summon->SetVisibility(VISIBILITY_OFF); + if(summon->isSummon() && !summon->isPet()) + ((TempSummon*)summon)->UnSummon(); + else + summon->setDeathState(JUST_DIED); + summon->RemoveCorpse(); } - - if(melee) - DoStartMovement(who); - else - DoStartNoMovement(who); } } -void ScriptedAI::AttackStart(Unit* who) +ScriptedAI::ScriptedAI(Creature* creature) : CreatureAI(creature), m_creature(creature), IsFleeing(false), CombatMovement(true) +{ + HeroicMode = m_creature->GetMap()->IsHeroic(); +} + +void ScriptedAI::AttackStartNoMove(Unit* who) { if (!who) return; - if (m_creature->Attack(who, true)) - { - m_creature->AddThreat(who, 0.0f); - - if (!InCombat) - { - InCombat = true; - Aggro(who); - } - - DoStartMovement(who); - } + if(m_creature->Attack(who, false)) + DoStartNoMovement(who); } void ScriptedAI::UpdateAI(const uint32 diff) { //Check if we have a current target - if (m_creature->isAlive() && UpdateVictim()) + if (UpdateVictim()) { - if (m_creature->isAttackReady() ) + if (m_creature->isAttackReady()) { //If we are within range melee the target if (m_creature->IsWithinMeleeRange(m_creature->getVictim())) @@ -122,36 +110,6 @@ void ScriptedAI::UpdateAI(const uint32 diff) } } -void ScriptedAI::EnterEvadeMode() -{ - //m_creature->InterruptNonMeleeSpells(true); - m_creature->RemoveAllAuras(); - m_creature->DeleteThreatList(); - m_creature->CombatStop(); - m_creature->LoadCreaturesAddon(); - m_creature->SetLootRecipient(NULL); - - if(m_creature->isAlive()) - { - if(Unit* owner = m_creature->GetOwner()) - { - if(owner->isAlive()) - m_creature->GetMotionMaster()->MoveFollow(owner,PET_FOLLOW_DIST,PET_FOLLOW_ANGLE); - } - else - m_creature->GetMotionMaster()->MoveTargetedHome(); - } - - InCombat = false; - Reset(); -} - -void ScriptedAI::JustRespawned() -{ - InCombat = false; - Reset(); -} - void ScriptedAI::DoStartMovement(Unit* victim, float distance, float angle) { if (!victim) @@ -176,23 +134,6 @@ void ScriptedAI::DoStopAttack() } } -void ScriptedAI::DoCast(Unit* victim, uint32 spellId, bool triggered) -{ - if (!victim || m_creature->hasUnitState(UNIT_STAT_CASTING) && !triggered) - return; - - //m_creature->StopMoving(); - m_creature->CastSpell(victim, spellId, triggered); -} - -void ScriptedAI::DoCastAOE(uint32 spellId, bool triggered) -{ - if(!triggered && m_creature->hasUnitState(UNIT_STAT_CASTING)) - return; - - m_creature->CastSpell((Unit*)NULL, spellId, triggered); -} - void ScriptedAI::DoCastSpell(Unit* who,SpellEntry const *spellInfo, bool triggered) { if (!who || m_creature->IsNonMeleeSpellCasted(false)) @@ -206,23 +147,23 @@ void ScriptedAI::DoSay(const char* text, uint32 language, Unit* target, bool Say { if (target) { - m_creature->Say(text, language, target->GetGUID()); + m_creature->MonsterSay(text, language, target->GetGUID()); if(SayEmote) m_creature->HandleEmoteCommand(EMOTE_ONESHOT_TALK); } - else m_creature->Say(text, language, 0); + else m_creature->MonsterSay(text, language, 0); } void ScriptedAI::DoYell(const char* text, uint32 language, Unit* target) { - if (target) m_creature->Yell(text, language, target->GetGUID()); - else m_creature->Yell(text, language, 0); + if (target) m_creature->MonsterYell(text, language, target->GetGUID()); + else m_creature->MonsterYell(text, language, 0); } void ScriptedAI::DoTextEmote(const char* text, Unit* target, bool IsBossEmote) { - if (target) m_creature->TextEmote(text, target->GetGUID(), IsBossEmote); - else m_creature->TextEmote(text, 0, IsBossEmote); + if (target) m_creature->MonsterTextEmote(text, target->GetGUID(), IsBossEmote); + else m_creature->MonsterTextEmote(text, 0, IsBossEmote); } void ScriptedAI::DoWhisper(const char* text, Unit* reciever, bool IsBossWhisper) @@ -230,24 +171,21 @@ void ScriptedAI::DoWhisper(const char* text, Unit* reciever, bool IsBossWhisper) if (!reciever || reciever->GetTypeId() != TYPEID_PLAYER) return; - m_creature->Whisper(text, reciever->GetGUID(), IsBossWhisper); + m_creature->MonsterWhisper(text, reciever->GetGUID(), IsBossWhisper); } -void ScriptedAI::DoPlaySoundToSet(Unit* unit, uint32 sound) +void ScriptedAI::DoPlaySoundToSet(Unit* pSource, uint32 uiSoundId) { - if (!unit) + if (!pSource) return; - if (!GetSoundEntriesStore()->LookupEntry(sound)) + if (!GetSoundEntriesStore()->LookupEntry(uiSoundId)) { - error_log("TSCR: Invalid soundId %u used in DoPlaySoundToSet (by unit TypeId %u, guid %u)", sound, unit->GetTypeId(), unit->GetGUID()); + error_log("TSCR: Invalid soundId %u used in DoPlaySoundToSet (by unit TypeId %u, guid %u)", uiSoundId, pSource->GetTypeId(), pSource->GetGUID()); return; } - WorldPacket data(4); - data.SetOpcode(SMSG_PLAY_SOUND); - data << uint32(sound); - unit->SendMessageToSet(&data,false); + pSource->PlayDirectSound(uiSoundId); } Creature* ScriptedAI::DoSpawnCreature(uint32 id, float x, float y, float z, float angle, uint32 type, uint32 despawntime) @@ -255,6 +193,19 @@ Creature* ScriptedAI::DoSpawnCreature(uint32 id, float x, float y, float z, floa return m_creature->SummonCreature(id,m_creature->GetPositionX() + x,m_creature->GetPositionY() + y,m_creature->GetPositionZ() + z, angle, (TempSummonType)type, despawntime); } +Creature *ScriptedAI::DoSummon(uint32 entry, const float pos[4], uint32 despawntime, TempSummonType type) +{ + return me->SummonCreature(entry, pos[0], pos[1], pos[2], pos[3], type, despawntime); +} + +Creature *ScriptedAI::DoSummon(uint32 entry, WorldObject *obj, float radius, uint32 despawntime, TempSummonType type) +{ + float x, y, z; + obj->GetGroundPointAroundUnit(x, y, z, radius * rand_norm(), rand_norm()*2*M_PI); + return me->SummonCreature(entry, x, y, z, me->GetOrientation(), type, despawntime); +} + + Unit* ScriptedAI::SelectUnit(SelectAggroTarget target, uint32 position) { //ThreatList m_threatlist; @@ -286,147 +237,7 @@ Unit* ScriptedAI::SelectUnit(SelectAggroTarget target, uint32 position) return NULL; } -struct TargetDistanceOrder : public std::binary_function<const Unit, const Unit, bool> -{ - const Unit* me; - TargetDistanceOrder(const Unit* Target) : me(Target) {}; - // functor for operator ">" - bool operator()(const Unit* _Left, const Unit* _Right) const - { - return (me->GetDistance(_Left) < me->GetDistance(_Right)); - } -}; - -Unit* ScriptedAI::SelectUnit(SelectAggroTarget targetType, uint32 position, float dist, bool playerOnly) -{ - if(targetType == SELECT_TARGET_NEAREST || targetType == SELECT_TARGET_FARTHEST) - { - std::list<HostilReference*> &m_threatlist = m_creature->getThreatManager().getThreatList(); - if(m_threatlist.empty()) return NULL; - std::list<Unit*> targetList; - std::list<HostilReference*>::iterator itr = m_threatlist.begin(); - for(; itr!= m_threatlist.end(); ++itr) - { - Unit *target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()); - if(!target - || playerOnly && target->GetTypeId() != TYPEID_PLAYER - || dist && !m_creature->IsWithinCombatRange(target, dist)) - { - continue; - } - targetList.push_back(target); - } - if(position >= targetList.size()) - return NULL; - targetList.sort(TargetDistanceOrder(m_creature)); - if(targetType == SELECT_TARGET_NEAREST) - { - std::list<Unit*>::iterator i = targetList.begin(); - advance(i, position); - return *i; - } - else - { - std::list<Unit*>::reverse_iterator i = targetList.rbegin(); - advance(i, position); - return *i; - } - } - else - { - std::list<HostilReference*> m_threatlist = m_creature->getThreatManager().getThreatList(); - std::list<HostilReference*>::iterator i; - Unit *target; - while(position < m_threatlist.size()) - { - if(targetType == SELECT_TARGET_BOTTOMAGGRO) - { - i = m_threatlist.end(); - advance(i, - (int32)position - 1); - } - else - { - i = m_threatlist.begin(); - if(targetType == SELECT_TARGET_TOPAGGRO) - advance(i, position); - else // random - advance(i, position + rand()%(m_threatlist.size() - position)); - } - - target = Unit::GetUnit(*m_creature,(*i)->getUnitGuid()); - if(!target - || playerOnly && target->GetTypeId() != TYPEID_PLAYER - || dist && !m_creature->IsWithinCombatRange(target, dist)) - { - m_threatlist.erase(i); - } - else - { - return target; - } - } - } - - return NULL; -} - -void ScriptedAI::SelectUnitList(std::list<Unit*> &targetList, uint32 num, SelectAggroTarget targetType, float dist, bool playerOnly) -{ - if(targetType == SELECT_TARGET_NEAREST || targetType == SELECT_TARGET_FARTHEST) - { - std::list<HostilReference*> &m_threatlist = m_creature->getThreatManager().getThreatList(); - if(m_threatlist.empty()) return; - std::list<HostilReference*>::iterator itr = m_threatlist.begin(); - for(; itr!= m_threatlist.end(); ++itr) - { - Unit *target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()); - if(!target - || playerOnly && target->GetTypeId() != TYPEID_PLAYER - || dist && !m_creature->IsWithinCombatRange(target, dist)) - { - continue; - } - targetList.push_back(target); - } - targetList.sort(TargetDistanceOrder(m_creature)); - targetList.resize(num); - if(targetType == SELECT_TARGET_FARTHEST) - targetList.reverse(); - } - else - { - std::list<HostilReference*> m_threatlist = m_creature->getThreatManager().getThreatList(); - std::list<HostilReference*>::iterator i; - Unit *target; - while(m_threatlist.size() && num) - { - if(targetType == SELECT_TARGET_BOTTOMAGGRO) - { - i = m_threatlist.end(); - --i; - } - else - { - i = m_threatlist.begin(); - if(targetType == SELECT_TARGET_RANDOM) - advance(i, rand()%m_threatlist.size()); - } - - target = Unit::GetUnit(*m_creature,(*i)->getUnitGuid()); - m_threatlist.erase(i); - if(!target - || playerOnly && target->GetTypeId() != TYPEID_PLAYER - || dist && !m_creature->IsWithinCombatRange(target, dist)) - { - continue; - } - targetList.push_back(target); - --num; - } - } -} - -SpellEntry const* ScriptedAI::SelectSpell(Unit* Target, int32 School, int32 Mechanic, SelectTarget Targets, uint32 PowerCostMin, uint32 PowerCostMax, float RangeMin, float RangeMax, SelectEffect Effects) +SpellEntry const* ScriptedAI::SelectSpell(Unit* Target, int32 School, int32 Mechanic, SelectTargetType Targets, uint32 PowerCostMin, uint32 PowerCostMax, float RangeMin, float RangeMax, SelectEffect Effects) { //No target so we can't cast if (!Target) @@ -437,11 +248,9 @@ SpellEntry const* ScriptedAI::SelectSpell(Unit* Target, int32 School, int32 Mech return false; //Using the extended script system we first create a list of viable spells - SpellEntry const* Spell[4]; - Spell[0] = 0; - Spell[1] = 0; - Spell[2] = 0; - Spell[3] = 0; + SpellEntry const* Spell[CREATURE_MAX_SPELLS]; + for (uint8 i=0;i<CREATURE_MAX_SPELLS;i++) + Spell[i] = 0; uint32 SpellCount = 0; @@ -449,7 +258,7 @@ SpellEntry const* ScriptedAI::SelectSpell(Unit* Target, int32 School, int32 Mech SpellRangeEntry const* TempRange; //Check if each spell is viable(set it to null if not) - for (uint32 i = 0; i < 4; i++) + for (uint32 i = 0; i < CREATURE_MAX_SPELLS; i++) { TempSpell = GetSpellStore()->LookupEntry(m_creature->m_spells[i]); @@ -493,13 +302,13 @@ SpellEntry const* ScriptedAI::SelectSpell(Unit* Target, int32 School, int32 Mech continue; //Check if the spell meets our range requirements - if (RangeMin && TempRange->maxRange < RangeMin) + if (RangeMin && m_creature->GetSpellMinRangeForTarget(Target, TempRange) < RangeMin) continue; - if (RangeMax && TempRange->maxRange > RangeMax) + if (RangeMax && m_creature->GetSpellMaxRangeForTarget(Target, TempRange) > RangeMax) continue; //Check if our target is in range - if (m_creature->IsWithinDistInMap(Target, TempRange->minRange) || !m_creature->IsWithinDistInMap(Target, TempRange->maxRange)) + if (m_creature->IsWithinDistInMap(Target, m_creature->GetSpellMinRangeForTarget(Target, TempRange)) || !m_creature->IsWithinDistInMap(Target, m_creature->GetSpellMaxRangeForTarget(Target, TempRange))) continue; //All good so lets add it to the spell list @@ -521,11 +330,11 @@ bool ScriptedAI::CanCast(Unit* Target, SpellEntry const *Spell, bool Triggered) return false; //Silenced so we can't cast - if (!Triggered && m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SILENCED)) + if (!Triggered && me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SILENCED)) return false; //Check for power - if (!Triggered && m_creature->GetPower((Powers)Spell->powerType) < Spell->manaCost) + if (!Triggered && me->GetPower((Powers)Spell->powerType) < Spell->manaCost) return false; SpellRangeEntry const *TempRange = NULL; @@ -537,29 +346,20 @@ bool ScriptedAI::CanCast(Unit* Target, SpellEntry const *Spell, bool Triggered) return false; //Unit is out of range of this spell - if (m_creature->GetDistance(Target) > TempRange->maxRange || m_creature->GetDistance(Target) < TempRange->minRange) + if (me->GetDistance(Target) > me->GetSpellMaxRangeForTarget(Target, TempRange) + || me->GetDistance(Target) < me->GetSpellMinRangeForTarget(Target, TempRange)) return false; return true; } - -float GetSpellMaxRange(uint32 id) -{ - SpellEntry const *spellInfo = GetSpellStore()->LookupEntry(id); - if(!spellInfo) return 0; - SpellRangeEntry const *range = GetSpellRangeStore()->LookupEntry(spellInfo->rangeIndex); - if(!range) return 0; - return range->maxRange; -} - void FillSpellSummary() { SpellSummary = new TSpellSummary[GetSpellStore()->GetNumRows()]; SpellEntry const* TempSpell; - for (int i=0; i < GetSpellStore()->GetNumRows(); i++ ) + for(uint32 i = 0; i < GetSpellStore()->GetNumRows(); ++i) { SpellSummary[i].Effects = 0; SpellSummary[i].Targets = 0; @@ -569,7 +369,7 @@ void FillSpellSummary() if (!TempSpell) continue; - for (int j=0; j<3; j++) + for(uint32 j = 0; j < 3; ++j) { //Spell targets self if ( TempSpell->EffectImplicitTargetA[j] == TARGET_UNIT_CASTER ) @@ -638,39 +438,6 @@ void FillSpellSummary() } } -void ScriptedAI::DoZoneInCombat(Unit* pUnit) -{ - if (!pUnit) - pUnit = m_creature; - - Map *map = pUnit->GetMap(); - - if (!map->IsDungeon()) //use IsDungeon instead of Instanceable, in case battlegrounds will be instantiated - { - error_log("TSCR: DoZoneInCombat call for map that isn't an instance (pUnit entry = %d)", pUnit->GetTypeId() == TYPEID_UNIT ? ((Creature*)pUnit)->GetEntry() : 0); - return; - } - - if (!pUnit->CanHaveThreatList() || pUnit->getThreatManager().isThreatListEmpty()) - { - error_log("TSCR: DoZoneInCombat called for creature that either cannot have threat list or has empty threat list (pUnit entry = %d)", pUnit->GetTypeId() == TYPEID_UNIT ? ((Creature*)pUnit)->GetEntry() : 0); - - return; - } - - Map::PlayerList const &PlayerList = map->GetPlayers(); - for(Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) - { - if (Player* i_pl = i->getSource()) - if (i_pl->isAlive()) - { - pUnit->SetInCombatWith(i_pl); - i_pl->SetInCombatWith(pUnit); - pUnit->AddThreat(i_pl, 0.0f); - } - } -} - void ScriptedAI::DoResetThreat() { if (!m_creature->CanHaveThreatList() || m_creature->getThreatManager().isThreatListEmpty()) @@ -710,6 +477,11 @@ void ScriptedAI::DoTeleportTo(float x, float y, float z, uint32 time) m_creature->SendMonsterMove(x, y, z, time); } +void ScriptedAI::DoTeleportTo(const float pos[4]) +{ + me->NearTeleportTo(pos[0], pos[1], pos[2], pos[3]); +} + void ScriptedAI::DoTeleportPlayer(Unit* pUnit, float x, float y, float z, float o) { if(!pUnit || pUnit->GetTypeId() != TYPEID_PLAYER) @@ -719,7 +491,7 @@ void ScriptedAI::DoTeleportPlayer(Unit* pUnit, float x, float y, float z, float return; } - ((Player*)pUnit)->TeleportTo(pUnit->GetMapId(), x, y, z, o, TELE_TO_NOT_LEAVE_COMBAT); + CAST_PLR(pUnit)->TeleportTo(pUnit->GetMapId(), x, y, z, o, TELE_TO_NOT_LEAVE_COMBAT); } void ScriptedAI::DoTeleportAll(float x, float y, float z, float o) @@ -735,33 +507,11 @@ void ScriptedAI::DoTeleportAll(float x, float y, float z, float o) i_pl->TeleportTo(m_creature->GetMapId(), x, y, z, o, TELE_TO_NOT_LEAVE_COMBAT); } -Unit* FindCreature(uint32 entry, float range, Unit* Finder) -{ - if(!Finder) - return NULL; - Creature* target = NULL; - Trinity::AllCreaturesOfEntryInRange check(Finder, entry, range); - Trinity::CreatureSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(target, check); - Finder->VisitNearbyObject(range, searcher); - return target; -} - -GameObject* FindGameObject(uint32 entry, float range, Unit* Finder) -{ - if(!Finder) - return NULL; - GameObject* target = NULL; - Trinity::AllGameObjectsWithEntryInGrid go_check(entry); - Trinity::GameObjectSearcher<Trinity::AllGameObjectsWithEntryInGrid> searcher(target, go_check); - Finder->VisitNearbyGridObject(range, searcher); - return target; -} - Unit* ScriptedAI::DoSelectLowestHpFriendly(float range, uint32 MinHPDiff) { Unit* pUnit = NULL; Trinity::MostHPMissingInRange u_check(m_creature, range, MinHPDiff); - Trinity::UnitLastSearcher<Trinity::MostHPMissingInRange> searcher(pUnit, u_check); + Trinity::UnitLastSearcher<Trinity::MostHPMissingInRange> searcher(m_creature, pUnit, u_check); m_creature->VisitNearbyObject(range, searcher); return pUnit; } @@ -770,7 +520,7 @@ std::list<Creature*> ScriptedAI::DoFindFriendlyCC(float range) { std::list<Creature*> pList; Trinity::FriendlyCCedInRange u_check(m_creature, range); - Trinity::CreatureListSearcher<Trinity::FriendlyCCedInRange> searcher(pList, u_check); + Trinity::CreatureListSearcher<Trinity::FriendlyCCedInRange> searcher(m_creature, pList, u_check); m_creature->VisitNearbyObject(range, searcher); return pList; } @@ -779,11 +529,41 @@ std::list<Creature*> ScriptedAI::DoFindFriendlyMissingBuff(float range, uint32 s { std::list<Creature*> pList; Trinity::FriendlyMissingBuffInRange u_check(m_creature, range, spellid); - Trinity::CreatureListSearcher<Trinity::FriendlyMissingBuffInRange> searcher(pList, u_check); + Trinity::CreatureListSearcher<Trinity::FriendlyMissingBuffInRange> searcher(m_creature, pList, u_check); m_creature->VisitNearbyObject(range, searcher); return pList; } +void ScriptedAI::SetEquipmentSlots(bool bLoadDefault, int32 uiMainHand, int32 uiOffHand, int32 uiRanged) +{ + if (bLoadDefault) + { + if (CreatureInfo const* pInfo = GetCreatureTemplateStore(m_creature->GetEntry())) + m_creature->LoadEquipment(pInfo->equipmentId,true); + + return; + } + + if (uiMainHand >= 0) + m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(uiMainHand)); + + if (uiOffHand >= 0) + m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, uint32(uiOffHand)); + + if (uiRanged >= 0) + m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 2, uint32(uiRanged)); +} + +void ScriptedAI::SetSheathState(SheathState newState) +{ + m_creature->SetByteValue(UNIT_FIELD_BYTES_2, 0, newState); +} + +void ScriptedAI::SetCombatMovement(bool CombatMove) +{ + CombatMovement = CombatMove; +} + /*void Scripted_NoMovementAI::MoveInLineOfSight(Unit *who) { if( !m_creature->getVictim() && m_creature->canAttack(who) && ( m_creature->IsHostileTo( who )) && who->isInAccessiblePlaceFor(m_creature) ) @@ -807,35 +587,156 @@ void Scripted_NoMovementAI::AttackStart(Unit* who) if (m_creature->Attack(who, true)) { - m_creature->AddThreat(who, 0.0f); + DoStartNoMovement(who); + } +} - if (!InCombat) +BossAI::BossAI(Creature *c, uint32 id) : ScriptedAI(c) +, bossId(id), summons(me), instance(c->GetInstanceData()) +, boundary(instance ? instance->GetBossBoundary(id) : NULL) +{ +} + +void BossAI::_Reset() +{ + events.Reset(); + summons.DespawnAll(); + if(instance) + instance->SetBossState(bossId, NOT_STARTED); +} + +void BossAI::_JustDied() +{ + events.Reset(); + summons.DespawnAll(); + if(instance) + instance->SetBossState(bossId, DONE); +} + +void BossAI::_EnterCombat() +{ + me->setActive(true); + DoZoneInCombat(); + if(instance) + instance->SetBossState(bossId, IN_PROGRESS); +} + +void BossAI::TeleportCheaters() +{ + float x, y, z; + me->GetPosition(x, y, z); + std::list<HostilReference*> &m_threatlist = me->getThreatManager().getThreatList(); + for(std::list<HostilReference*>::iterator itr = m_threatlist.begin(); itr!= m_threatlist.end(); ++itr) + if((*itr)->getTarget()->GetTypeId() == TYPEID_PLAYER && !CheckBoundary((*itr)->getTarget())) + (*itr)->getTarget()->NearTeleportTo(x, y, z, 0); +} + +bool BossAI::CheckBoundary(Unit *who) +{ + if(!boundary || !who) + return true; + + for(BossBoundaryMap::const_iterator itr = boundary->begin(); itr != boundary->end(); ++itr) + { + switch(itr->first) { - InCombat = true; - Aggro(who); + case BOUNDARY_N: + if(me->GetPositionX() > itr->second) + return false; + break; + case BOUNDARY_S: + if(me->GetPositionX() < itr->second) + return false; + break; + case BOUNDARY_E: + if(me->GetPositionY() < itr->second) + return false; + break; + case BOUNDARY_W: + if(me->GetPositionY() > itr->second) + return false; + break; + case BOUNDARY_NW: + if(me->GetPositionX() + me->GetPositionY() > itr->second) + return false; + break; + case BOUNDARY_SE: + if(me->GetPositionX() + me->GetPositionY() < itr->second) + return false; + break; + case BOUNDARY_NE: + if(me->GetPositionX() - me->GetPositionY() > itr->second) + return false; + break; + case BOUNDARY_SW: + if(me->GetPositionX() - me->GetPositionY() < itr->second) + return false; + break; } - - DoStartNoMovement(who); } + + return true; +} + +void BossAI::JustSummoned(Creature *summon) +{ + summons.Summon(summon); + if(me->isInCombat()) + DoZoneInCombat(summon); } +void BossAI::SummonedCreatureDespawn(Creature *summon) +{ + summons.Despawn(summon); +} + +#define GOBJECT(x) (const_cast<GameObjectInfo*>(GetGameObjectInfo(x))) + void LoadOverridenSQLData() { GameObjectInfo *goInfo; // Sunwell Plateau : Kalecgos : Spectral Rift - goInfo = const_cast<GameObjectInfo*>(GetGameObjectInfo(187055)); - if(goInfo && goInfo->type == GAMEOBJECT_TYPE_GOOBER) - goInfo->goober.lockId = 57; // need LOCKTYPE_QUICK_OPEN + if(goInfo = GOBJECT(187055)) + if(goInfo->type == GAMEOBJECT_TYPE_GOOBER) + goInfo->goober.lockId = 57; // need LOCKTYPE_QUICK_OPEN + + // Naxxramas : Sapphiron Birth + if(goInfo = GOBJECT(181356)) + if(goInfo->type == GAMEOBJECT_TYPE_TRAP) + goInfo->trap.radius = 50; } void LoadOverridenDBCData() { SpellEntry *spellInfo; + for(uint32 i = 0; i < GetSpellStore()->GetNumRows(); ++i) + { + spellInfo = GET_SPELL(i); + if(!spellInfo) + continue; - // Black Temple : Illidan : Parasitic Shadowfiend Passive - spellInfo = const_cast<SpellEntry*>(GetSpellStore()->LookupEntry(41913)); - if(spellInfo) - spellInfo->EffectApplyAuraName[0] = 4; // proc debuff, and summon infinite fiends + switch(i) + { + // Black Temple : Illidan : Parasitic Shadowfiend Passive + case 41013: + spellInfo->EffectApplyAuraName[0] = 4; // proc debuff, and summon infinite fiends + break; + //temp, not needed in 310 + case 28531: + case 55799: + spellInfo->DurationIndex = 21; + spellInfo->Effect[0] = SPELL_EFFECT_APPLY_AREA_AURA_ENEMY; + break; + // Naxxramas: Gothik : Inform Inf range + case 27892: + case 27928: + case 27935: + case 27915: + case 27931: + case 27937: + spellInfo->rangeIndex = 13; + break; + } + } } - diff --git a/src/bindings/scripts/include/sc_creature.h b/src/bindings/scripts/include/sc_creature.h index 40a331b7d6b..6e6a16a9f13 100644 --- a/src/bindings/scripts/include/sc_creature.h +++ b/src/bindings/scripts/include/sc_creature.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2008 Trinity <http://www.trinitycore.org/> +/* Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/> * * Thanks to the original authors: ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * @@ -8,44 +8,60 @@ #ifndef SC_CREATURE_H #define SC_CREATURE_H -#include "CreatureAI.h" #include "Creature.h" +#include "CreatureAI.h" +#include "CreatureAIImpl.h" +#include "InstanceData.h" + +#define USE_DYNAMIC_CAST +#ifdef USE_DYNAMIC_CAST +#define CAST_PLR(a) (dynamic_cast<Player*>(a)) +#define CAST_CRE(a) (dynamic_cast<Creature*>(a)) +#define CAST_AI(a,b) (dynamic_cast<a*>(b)) +#else +#define CAST_PLR(a) (static_cast<Player*>(a)) +#define CAST_CRE(a) (static_cast<Creature*>(a)) +#define CAST_AI(a,b) (static_cast<a*>(b)) +#endif -float GetSpellMaxRange(uint32 id); +#define GET_SPELL(a) (const_cast<SpellEntry*>(GetSpellStore()->LookupEntry(a))) -class SummonList : std::list<uint64> +class ScriptedInstance; + +class SummonList : private std::list<uint64> { -public: - SummonList(Creature* creature) : m_creature(creature) {} - void Summon(Creature *summon) {push_back(summon->GetGUID());} - void Despawn(Creature *summon); - void DespawnEntry(uint32 entry); - void DespawnAll(); -private: - Creature *m_creature; + public: + explicit SummonList(Creature* creature) : m_creature(creature) {} + void Summon(Creature *summon) { push_back(summon->GetGUID()); } + void Despawn(Creature *summon) { remove(summon->GetGUID()); } + void DespawnEntry(uint32 entry); + void DespawnAll(); + void DoAction(uint32 entry, uint32 info); + void DoZoneInCombat(uint32 entry = 0); + private: + Creature *m_creature; }; -//Get a single creature of given entry -Unit* FindCreature(uint32 entry, float range, Unit* Finder); - -//Get a single gameobject of given entry -GameObject* FindGameObject(uint32 entry, float range, Unit* Finder); +struct PointMovement +{ + uint32 m_uiCreatureEntry; + uint32 m_uiPointId; + float m_fX; + float m_fY; + float m_fZ; + uint32 m_uiWaitTime; +}; struct TRINITY_DLL_DECL ScriptedAI : public CreatureAI { - ScriptedAI(Creature* creature) : CreatureAI(creature), m_creature(creature), InCombat(false), IsFleeing(false) {} + explicit ScriptedAI(Creature* creature); ~ScriptedAI() {} //************* //CreatureAI Functions //************* - //Called at each attack of m_creature by any victim - void AttackStart(Unit *); - void AttackStart(Unit *, bool melee); - - //Called at stoping attack by any attacker - void EnterEvadeMode(); + void AttackStartNoMove(Unit *target); // Called at any Damage from any attacker (before damage apply) void DamageTaken(Unit *done_by, uint32 &damage) {} @@ -54,10 +70,10 @@ struct TRINITY_DLL_DECL ScriptedAI : public CreatureAI void UpdateAI(const uint32); //Called at creature death - void JustDied(Unit*){} + void JustDied(Unit* who){} //Called at creature killing another unit - void KilledUnit(Unit*){} + void KilledUnit(Unit* who){} // Called when the creature summon successfully other creature void JustSummoned(Creature* ) {} @@ -71,11 +87,8 @@ struct TRINITY_DLL_DECL ScriptedAI : public CreatureAI // Called when spell hits a target void SpellHitTarget(Unit* target, const SpellEntry*) {} - // Called when creature is spawned or respawned (for reseting variables) - void JustRespawned(); - //Called at waypoint reached or PointMovement end - void MovementInform(uint32, uint32){} + void MovementInform(uint32 type, uint32 id){} // Called when AI is temporarily replaced or put back when possess is applied or removed void OnPossess(bool apply) {} @@ -87,12 +100,11 @@ struct TRINITY_DLL_DECL ScriptedAI : public CreatureAI //Pointer to creature we are manipulating Creature* m_creature; - //Bool for if we are in combat or not - bool InCombat; - //For fleeing bool IsFleeing; + bool HeroicMode; + //************* //Pure virtual functions //************* @@ -101,7 +113,7 @@ struct TRINITY_DLL_DECL ScriptedAI : public CreatureAI void Reset() {} //Called at creature aggro either by MoveInLOS or Attack Start - virtual void Aggro(Unit*) = 0; + void EnterCombat(Unit* who) {} //************* //AI Helper Functions @@ -116,10 +128,6 @@ struct TRINITY_DLL_DECL ScriptedAI : public CreatureAI //Stop attack of current victim void DoStopAttack(); - //Cast spell by Id - void DoCast(Unit* victim, uint32 spellId, bool triggered = false); - void DoCastAOE(uint32 spellId, bool triggered = false); - //Cast spell by spell info void DoCastSpell(Unit* who,SpellEntry const *spellInfo, bool triggered = false); @@ -138,9 +146,6 @@ struct TRINITY_DLL_DECL ScriptedAI : public CreatureAI //Plays a sound to all nearby players void DoPlaySoundToSet(Unit* unit, uint32 sound); - //Places the entire map into combat with creature - void DoZoneInCombat(Unit* pUnit = 0); - //Drops all threat to 0%. Does not remove players from the threat list void DoResetThreat(); @@ -148,6 +153,7 @@ struct TRINITY_DLL_DECL ScriptedAI : public CreatureAI void DoModifyThreatPercent(Unit *pUnit, int32 pct); void DoTeleportTo(float x, float y, float z, uint32 time = 0); + void DoTeleportTo(const float pos[4]); void DoAction(const int32 param) {} @@ -166,17 +172,28 @@ struct TRINITY_DLL_DECL ScriptedAI : public CreatureAI //Spawns a creature relative to m_creature Creature* DoSpawnCreature(uint32 id, float x, float y, float z, float angle, uint32 type, uint32 despawntime); + Creature *DoSummon(uint32 entry, const float pos[4], uint32 despawntime = 30000, TempSummonType type = TEMPSUMMON_CORPSE_TIMED_DESPAWN); + Creature *DoSummon(uint32 entry, WorldObject *obj, float radius = 5.0f, uint32 despawntime = 30000, TempSummonType type = TEMPSUMMON_CORPSE_TIMED_DESPAWN); //Selects a unit from the creature's current aggro list Unit* SelectUnit(SelectAggroTarget target, uint32 position); - Unit* SelectUnit(SelectAggroTarget target, uint32 position, float dist, bool playerOnly); - void SelectUnitList(std::list<Unit*> &targetList, uint32 num, SelectAggroTarget target, float dist, bool playerOnly); + + bool HealthBelowPct(uint32 pct) const { return me->GetHealth() * 100 < m_creature->GetMaxHealth() * pct; } //Returns spells that meet the specified criteria from the creatures spell list - SpellEntry const* SelectSpell(Unit* Target, int32 School, int32 Mechanic, SelectTarget Targets, uint32 PowerCostMin, uint32 PowerCostMax, float RangeMin, float RangeMax, SelectEffect Effect); + SpellEntry const* SelectSpell(Unit* Target, int32 School, int32 Mechanic, SelectTargetType Targets, uint32 PowerCostMin, uint32 PowerCostMax, float RangeMin, float RangeMax, SelectEffect Effect); //Checks if you can cast the specified spell bool CanCast(Unit* Target, SpellEntry const *Spell, bool Triggered = false); + + void SetEquipmentSlots(bool bLoadDefault, int32 uiMainHand = EQUIP_NO_CHANGE, int32 uiOffHand = EQUIP_NO_CHANGE, int32 uiRanged = EQUIP_NO_CHANGE); + + void SetSheathState(SheathState newState); + + void SetCombatMovement(bool CombatMove); + + protected: + bool CombatMovement; }; struct TRINITY_DLL_DECL Scripted_NoMovementAI : public ScriptedAI @@ -184,25 +201,47 @@ struct TRINITY_DLL_DECL Scripted_NoMovementAI : public ScriptedAI Scripted_NoMovementAI(Creature* creature) : ScriptedAI(creature) {} //Called if IsVisible(Unit *who) is true at each *who move - //void MoveInLineOfSight(Unit *); + //void MoveInLineOfSight(Unit* who); //Called at each attack of m_creature by any victim - void AttackStart(Unit *); + void AttackStart(Unit* who); }; -struct TRINITY_DLL_DECL NullCreatureAI : public ScriptedAI +struct TRINITY_DLL_DECL BossAI : public ScriptedAI { - NullCreatureAI(Creature* c) : ScriptedAI(c) {} - ~NullCreatureAI() {} - - void Reset() {} - void Aggro(Unit*) {} - void MoveInLineOfSight(Unit *) {} - void AttackStart(Unit *) {} - void EnterEvadeMode() {} - bool IsVisible(Unit *) const { return false; } - - void UpdateAI(const uint32) {} + BossAI(Creature *c, uint32 id); + + const uint32 bossId; + EventMap events; + SummonList summons; + InstanceData * const instance; + const BossBoundaryMap * const boundary; + + void JustSummoned(Creature *summon); + void SummonedCreatureDespawn(Creature *summon); + + void UpdateAI(const uint32 diff) = 0; + + void Reset() { _Reset(); } + void EnterCombat(Unit *who) { _EnterCombat(); } + void JustDied(Unit *killer) { _JustDied(); } + void JustReachedHome() { me->setActive(false); } + + protected: + void _Reset(); + void _EnterCombat(); + void _JustDied(); + void _JustReachedHome() { me->setActive(false); } + + bool CheckInRoom() + { + if(CheckBoundary(me)) + return true; + EnterEvadeMode(); + return false; + } + bool CheckBoundary(Unit *who); + void TeleportCheaters(); }; #endif diff --git a/src/bindings/scripts/include/sc_gossip.h b/src/bindings/scripts/include/sc_gossip.h index 74bc93694af..9665a7e1123 100644 --- a/src/bindings/scripts/include/sc_gossip.h +++ b/src/bindings/scripts/include/sc_gossip.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2008 Trinity <http://www.trinitycore.org/> +/* Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/> * * Thanks to the original authors: ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * @@ -16,29 +16,38 @@ #define GOSSIP_TEXT_BROWSE_GOODS "I'd like to browse your goods." #define GOSSIP_TEXT_TRAIN "Train me!" -#define GOSSIP_TEXT_BANK "The Bank" -#define GOSSIP_TEXT_WINDRIDER "Wind rider master" -#define GOSSIP_TEXT_GRYPHON "Gryphon Master" -#define GOSSIP_TEXT_BATHANDLER "Bat Handler" -#define GOSSIP_TEXT_HIPPOGRYPH "Hippogryph Master" -#define GOSSIP_TEXT_FLIGHTMASTER "Flight Master" -#define GOSSIP_TEXT_AUCTIONHOUSE "Auction House" -#define GOSSIP_TEXT_GUILDMASTER "Guild Master" -#define GOSSIP_TEXT_INN "The Inn" -#define GOSSIP_TEXT_MAILBOX "Mailbox" -#define GOSSIP_TEXT_STABLEMASTER "Stable Master" -#define GOSSIP_TEXT_WEAPONMASTER "Weapons Trainer" -#define GOSSIP_TEXT_BATTLEMASTER "Battlemaster" -#define GOSSIP_TEXT_CLASSTRAINER "Class Trainer" -#define GOSSIP_TEXT_PROFTRAINER "Profession Trainer" -#define GOSSIP_TEXT_OFFICERS "The officers` lounge" +#define GOSSIP_TEXT_BANK "The bank" +#define GOSSIP_TEXT_IRONFORGE_BANK "The bank of Ironforge" +#define GOSSIP_TEXT_STORMWIND_BANK "The bank of Stormwind" +#define GOSSIP_TEXT_WINDRIDER "The wind rider master" +#define GOSSIP_TEXT_GRYPHON "The gryphon master" +#define GOSSIP_TEXT_BATHANDLER "The bat handler" +#define GOSSIP_TEXT_HIPPOGRYPH "The hippogryph master" +#define GOSSIP_TEXT_ZEPPLINMASTER "The zeppelin master" +#define GOSSIP_TEXT_DEEPRUNTRAM "The Deeprun Tram" +#define GOSSIP_TEXT_FERRY "The Rut'theran Ferry" +#define GOSSIP_TEXT_FLIGHTMASTER "The flight master" +#define GOSSIP_TEXT_AUCTIONHOUSE "The auction house" +#define GOSSIP_TEXT_GUILDMASTER "The guild master" +#define GOSSIP_TEXT_INN "The inn" +#define GOSSIP_TEXT_MAILBOX "The mailbox" +#define GOSSIP_TEXT_STABLEMASTER "The stable master" +#define GOSSIP_TEXT_WEAPONMASTER "The weapon master" +#define GOSSIP_TEXT_OFFICERS "The officers' lounge" +#define GOSSIP_TEXT_BATTLEMASTER "The battlemaster" +#define GOSSIP_TEXT_BARBER "Barber" +#define GOSSIP_TEXT_CLASSTRAINER "A class trainer" +#define GOSSIP_TEXT_PROFTRAINER "A profession trainer" +#define GOSSIP_TEXT_LEXICON "Lexicon of Power" #define GOSSIP_TEXT_ALTERACVALLEY "Alterac Valley" #define GOSSIP_TEXT_ARATHIBASIN "Arathi Basin" #define GOSSIP_TEXT_WARSONGULCH "Warsong Gulch" #define GOSSIP_TEXT_ARENA "Arena" #define GOSSIP_TEXT_EYEOFTHESTORM "Eye of The Storm" +#define GOSSIP_TEXT_STRANDOFANCIENT "Strand of the Ancients" +#define GOSSIP_TEXT_DEATH_KNIGHT "Death Knight" #define GOSSIP_TEXT_DRUID "Druid" #define GOSSIP_TEXT_HUNTER "Hunter" #define GOSSIP_TEXT_PRIEST "Priest" @@ -57,18 +66,12 @@ #define GOSSIP_TEXT_FIRSTAID "First Aid" #define GOSSIP_TEXT_HERBALISM "Herbalism" #define GOSSIP_TEXT_LEATHERWORKING "Leatherworking" -#define GOSSIP_TEXT_POISONS "Poisons" #define GOSSIP_TEXT_TAILORING "Tailoring" #define GOSSIP_TEXT_MINING "Mining" #define GOSSIP_TEXT_FISHING "Fishing" #define GOSSIP_TEXT_SKINNING "Skinning" #define GOSSIP_TEXT_JEWELCRAFTING "Jewelcrafting" - -#define GOSSIP_TEXT_IRONFORGE_BANK "Bank of Ironforge" -#define GOSSIP_TEXT_STORMWIND_BANK "Bank of Stormwind" -#define GOSSIP_TEXT_DEEPRUNTRAM "Deeprun Tram" -#define GOSSIP_TEXT_ZEPPLINMASTER "Zeppelin master" -#define GOSSIP_TEXT_FERRY "Rut'theran Ferry" +#define GOSSIP_TEXT_INSCRIPTION "Inscription" // Skill defines @@ -86,6 +89,7 @@ #define TRADESKILL_FISHING 12 #define TRADESKILL_SKINNING 13 #define TRADESKILL_JEWLCRAFTING 14 +#define TRADESKILL_INSCRIPTION 15 #define TRADESKILL_LEVEL_NONE 0 #define TRADESKILL_LEVEL_APPRENTICE 1 @@ -93,6 +97,7 @@ #define TRADESKILL_LEVEL_EXPERT 3 #define TRADESKILL_LEVEL_ARTISAN 4 #define TRADESKILL_LEVEL_MASTER 5 +#define TRADESKILL_LEVEL_GRAND_MASTER 6 // Gossip defines diff --git a/src/bindings/scripts/include/sc_instance.h b/src/bindings/scripts/include/sc_instance.h index 8f5d657fbaa..25593e05300 100644 --- a/src/bindings/scripts/include/sc_instance.h +++ b/src/bindings/scripts/include/sc_instance.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * This program is free software licensed under GPL version 2 * Please see the included DOCS/LICENSE.TXT for more information */ @@ -14,24 +14,7 @@ #define OUT_LOAD_INST_DATA_COMPLETE debug_log("TSCR: Instance Data Load for Instance %s (Map %d, Instance Id: %d) is complete.",instance->GetMapName(), instance->GetId(), instance->GetInstanceId()) #define OUT_LOAD_INST_DATA_FAIL error_log("TSCR: Unable to load Instance Data for Instance %s (Map %d, Instance Id: %d).",instance->GetMapName(), instance->GetId(), instance->GetInstanceId()) -class TRINITY_DLL_DECL ScriptedInstance : public InstanceData -{ - public: - - ScriptedInstance(Map *map) : InstanceData(map) {} - ~ScriptedInstance() {} - - //All-purpose data storage 64 bit - virtual uint64 GetData64(uint32 Data) { return 0; } - virtual void SetData64(uint32 Data, uint64 Value) { } - - // Called every instance update - virtual void Update(uint32) {} - - // Save and Load instance data to the database - const char* Save() { return NULL; } - void Load(const char* in) { } -}; +#define ScriptedInstance InstanceData #endif diff --git a/src/bindings/scripts/scripts/areatrigger/areatrigger_scripts.cpp b/src/bindings/scripts/scripts/areatrigger/areatrigger_scripts.cpp index 6767a8fe88b..1c1b7312cb3 100644 --- a/src/bindings/scripts/scripts/areatrigger/areatrigger_scripts.cpp +++ b/src/bindings/scripts/scripts/areatrigger/areatrigger_scripts.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -23,7 +23,6 @@ EndScriptData */ /* ContentData at_legion_teleporter 4560 Teleporter TO Invasion Point: Cataclysm -at_test script test only EndContentData */ #include "precompiled.h" @@ -56,12 +55,6 @@ bool AreaTrigger_at_legion_teleporter(Player *player, AreaTriggerEntry *at) return false; } -bool ATtest(Player *player, AreaTriggerEntry *at) -{ - player->Say("Hi!",LANG_UNIVERSAL); - return true; -} - void AddSC_areatrigger_scripts() { Script *newscript; @@ -70,10 +63,5 @@ void AddSC_areatrigger_scripts() newscript->Name = "at_legion_teleporter"; newscript->pAreaTrigger = &AreaTrigger_at_legion_teleporter; newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="at_test"; - newscript->pAreaTrigger = &ATtest; - newscript->RegisterSelf(); } diff --git a/src/bindings/scripts/scripts/boss/boss_emeriss.cpp b/src/bindings/scripts/scripts/boss/boss_emeriss.cpp index eecd2595a68..f2fc1ab8515 100644 --- a/src/bindings/scripts/scripts/boss/boss_emeriss.cpp +++ b/src/bindings/scripts/scripts/boss/boss_emeriss.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -55,7 +55,7 @@ struct TRINITY_DLL_DECL boss_emerissAI : public ScriptedAI CorruptionofEarth3_Timer = 0; } - void Aggro(Unit *who) {} + void EnterCombat(Unit *who) {} void UpdateAI(const uint32 diff) { diff --git a/src/bindings/scripts/scripts/boss/boss_lethon.cpp b/src/bindings/scripts/scripts/boss/boss_lethon.cpp index 721009ac68c..e387891efed 100644 --- a/src/bindings/scripts/scripts/boss/boss_lethon.cpp +++ b/src/bindings/scripts/scripts/boss/boss_lethon.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 diff --git a/src/bindings/scripts/scripts/boss/boss_taerar.cpp b/src/bindings/scripts/scripts/boss/boss_taerar.cpp index 7e7a2bd1363..d402a274cb6 100644 --- a/src/bindings/scripts/scripts/boss/boss_taerar.cpp +++ b/src/bindings/scripts/scripts/boss/boss_taerar.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -73,7 +73,7 @@ struct TRINITY_DLL_DECL boss_taerarAI : public ScriptedAI Shades = false; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } @@ -98,7 +98,7 @@ struct TRINITY_DLL_DECL boss_taerarAI : public ScriptedAI Rand = 0; Summoned = DoSpawnCreature(15302, RandX, RandY, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); if(Summoned) - ((CreatureAI*)Summoned->AI())->AttackStart(victim); + (Summoned->AI())->AttackStart(victim); } void UpdateAI(const uint32 diff) @@ -256,7 +256,7 @@ struct TRINITY_DLL_DECL boss_shadeoftaerarAI : public ScriptedAI PosionBreath_Timer = 12000; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } diff --git a/src/bindings/scripts/scripts/boss/boss_ysondre.cpp b/src/bindings/scripts/scripts/boss/boss_ysondre.cpp index 8738ce3eb88..baa31bb6a25 100644 --- a/src/bindings/scripts/scripts/boss/boss_ysondre.cpp +++ b/src/bindings/scripts/scripts/boss/boss_ysondre.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -63,7 +63,7 @@ struct TRINITY_DLL_DECL boss_ysondreAI : public ScriptedAI SummonDruids3_Timer = 0; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } @@ -88,7 +88,7 @@ struct TRINITY_DLL_DECL boss_ysondreAI : public ScriptedAI Rand = 0; Summoned = DoSpawnCreature(15260, RandX, RandY, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); if(Summoned) - ((CreatureAI*)Summoned->AI())->AttackStart(victim); + (Summoned->AI())->AttackStart(victim); } void UpdateAI(const uint32 diff) @@ -203,7 +203,7 @@ struct TRINITY_DLL_DECL mob_dementeddruidsAI : public ScriptedAI MoonFire_Timer = 3000; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } diff --git a/src/bindings/scripts/scripts/creature/mob_generic_creature.cpp b/src/bindings/scripts/scripts/creature/mob_generic_creature.cpp index d3395327aa7..2189cf60c6f 100644 --- a/src/bindings/scripts/scripts/creature/mob_generic_creature.cpp +++ b/src/bindings/scripts/scripts/creature/mob_generic_creature.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -40,7 +40,7 @@ struct TRINITY_DLL_DECL generic_creatureAI : public ScriptedAI IsSelfRooted = false; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { if (!m_creature->IsWithinMeleeRange(who)) { @@ -56,7 +56,7 @@ struct TRINITY_DLL_DECL generic_creatureAI : public ScriptedAI else GlobalCooldown = 0; //Buff timer (only buff when we are alive and not in combat - if (!InCombat && m_creature->isAlive()) + if (!m_creature->isInCombat() && m_creature->isAlive()) if (BuffTimer < diff ) { //Find a spell that targets friendly and applies an aura (these are generally buffs) @@ -156,18 +156,105 @@ struct TRINITY_DLL_DECL generic_creatureAI : public ScriptedAI } } }; + CreatureAI* GetAI_generic_creature(Creature *_Creature) { return new generic_creatureAI (_Creature); } +struct TRINITY_DLL_DECL trigger_periodicAI : public NullCreatureAI +{ + trigger_periodicAI(Creature* c) : NullCreatureAI(c) + { + spell = me->m_spells[0] ? GetSpellStore()->LookupEntry(me->m_spells[0]) : NULL; + interval = me->GetAttackTime(BASE_ATTACK); + timer = interval; + } + + uint32 timer, interval; + const SpellEntry * spell; + + void UpdateAI(const uint32 diff) + { + if(timer < diff) + { + if(spell) + me->CastSpell(me, spell, true); + timer = interval; + } + else + timer -= diff; + } +}; + +struct TRINITY_DLL_DECL trigger_deathAI : public NullCreatureAI +{ + trigger_deathAI(Creature* c) : NullCreatureAI(c) {} + void JustDied(Unit *killer) + { + if(me->m_spells[0]) + me->CastSpell(killer, me->m_spells[0], true); + } +}; + +struct TRINITY_DLL_DECL mob_webwrapAI : public NullCreatureAI +{ + mob_webwrapAI(Creature *c) : NullCreatureAI(c), victimGUID(0) {} + + uint64 victimGUID; + + void SetGUID(const uint64 &guid, const int32 param) + { + victimGUID = guid; + if(me->m_spells[0] && victimGUID) + if(Unit *victim = Unit::GetUnit(*me, victimGUID)) + victim->CastSpell(victim, me->m_spells[0], true, NULL, NULL, me->GetGUID()); + } + + void JustDied(Unit *killer) + { + if(me->m_spells[0] && victimGUID) + if(Unit *victim = Unit::GetUnit(*me, victimGUID)) + victim->RemoveAurasDueToSpell(me->m_spells[0], me->GetGUID()); + } +}; + +CreatureAI* GetAI_trigger_periodic(Creature *_Creature) +{ + return new trigger_periodicAI (_Creature); +} + +CreatureAI* GetAI_trigger_death(Creature *_Creature) +{ + return new trigger_deathAI (_Creature); +} + +CreatureAI* GetAI_mob_webwrap(Creature* _Creature) +{ + return new mob_webwrapAI (_Creature); +} void AddSC_generic_creature() { Script *newscript; - newscript = new Script; + /*newscript = new Script; newscript->Name="generic_creature"; newscript->GetAI = &GetAI_generic_creature; + newscript->RegisterSelf();*/ + + newscript = new Script; + newscript->Name="trigger_periodic"; + newscript->GetAI = &GetAI_trigger_periodic; + newscript->RegisterSelf(); + + /*newscript = new Script; + newscript->Name="trigger_death"; + newscript->GetAI = &GetAI_trigger_death; + newscript->RegisterSelf();*/ + + newscript = new Script; + newscript->Name="mob_webwrap"; + newscript->GetAI = &GetAI_mob_webwrap; newscript->RegisterSelf(); } diff --git a/src/bindings/scripts/scripts/creature/simple_ai.cpp b/src/bindings/scripts/scripts/creature/simple_ai.cpp index 96583c4ee39..a33f66fcef0 100644 --- a/src/bindings/scripts/scripts/creature/simple_ai.cpp +++ b/src/bindings/scripts/scripts/creature/simple_ai.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -27,34 +27,25 @@ EndScriptData */ SimpleAI::SimpleAI(Creature *c) : ScriptedAI(c) { //Clear all data - Aggro_Text[0] = NULL; - Aggro_Text[1] = NULL; - Aggro_Text[2] = NULL; - Aggro_Say[0] = false; - Aggro_Say[1] = false; - Aggro_Say[2] = false; + Aggro_TextId[0] = 0; + Aggro_TextId[1] = 0; + Aggro_TextId[2] = 0; Aggro_Sound[0] = 0; Aggro_Sound[1] = 0; Aggro_Sound[2] = 0; - Death_Text[0] = NULL; - Death_Text[1] = NULL; - Death_Text[2] = NULL; - Death_Say[0] = false; - Death_Say[1] = false; - Death_Say[2] = false; + Death_TextId[0] = 0; + Death_TextId[1] = 0; + Death_TextId[2] = 0; Death_Sound[0] = 0; Death_Sound[1] = 0; Death_Sound[2] = 0; Death_Spell = 0; Death_Target_Type = 0; - Kill_Text[0] = NULL; - Kill_Text[1] = NULL; - Kill_Text[2] = NULL; - Kill_Say[0] = false; - Kill_Say[1] = false; - Kill_Say[2] = false; + Kill_TextId[0] = 0; + Kill_TextId[1] = 0; + Kill_TextId[2] = 0; Kill_Sound[0] = 0; Kill_Sound[1] = 0; Kill_Sound[2] = 0; @@ -70,7 +61,7 @@ void SimpleAI::Reset() { } -void SimpleAI::Aggro(Unit *who) +void SimpleAI::EnterCombat(Unit *who) { //Reset cast timers if (Spell[0].First_Cast >= 0) @@ -106,11 +97,9 @@ void SimpleAI::Aggro(Unit *who) uint32 random_text = rand()%3; - //Random yell - if (Aggro_Text[random_text]) - if (Aggro_Say[random_text]) - DoSay(Aggro_Text[random_text], LANG_UNIVERSAL, who); - else DoYell(Aggro_Text[random_text], LANG_UNIVERSAL, who); + //Random text + if (Aggro_TextId[random_text]) + DoScriptText(Aggro_TextId[random_text], m_creature, who); //Random sound if (Aggro_Sound[random_text]) @@ -122,10 +111,8 @@ void SimpleAI::KilledUnit(Unit *victim) uint32 random_text = rand()%3; //Random yell - if (Kill_Text[random_text]) - if (Kill_Say[random_text]) - DoSay(Kill_Text[random_text], LANG_UNIVERSAL, victim); - else DoYell(Kill_Text[random_text], LANG_UNIVERSAL, victim); + if (Kill_TextId[random_text]) + DoScriptText(Kill_TextId[random_text], m_creature, victim); //Random sound if (Kill_Sound[random_text]) @@ -172,10 +159,8 @@ void SimpleAI::DamageTaken(Unit *killer, uint32 &damage) uint32 random_text = rand()%3; //Random yell - if (Death_Text[random_text]) - if (Death_Say[random_text]) - DoSay(Death_Text[random_text], LANG_UNIVERSAL, killer); - else DoYell(Death_Text[random_text], LANG_UNIVERSAL, killer); + if (Death_TextId[random_text]) + DoScriptText(Death_TextId[random_text], m_creature, killer); //Random sound if (Death_Sound[random_text]) @@ -269,10 +254,8 @@ void SimpleAI::UpdateAI(const uint32 diff) uint32 random_text = rand()%3; //Random yell - if (Spell[i].Text[random_text]) - if (Spell[i].Say[random_text]) - DoSay(Spell[i].Text[random_text], LANG_UNIVERSAL, target); - else DoYell(Spell[i].Text[random_text], LANG_UNIVERSAL, target); + if (Spell[i].TextId[random_text]) + DoScriptText(Spell[i].TextId[random_text], m_creature, target); //Random sound if (Spell[i].Text_Sound[random_text]) diff --git a/src/bindings/scripts/scripts/creature/simple_ai.h b/src/bindings/scripts/scripts/creature/simple_ai.h index 8745d78ad41..3a2e8a9341a 100644 --- a/src/bindings/scripts/scripts/creature/simple_ai.h +++ b/src/bindings/scripts/scripts/creature/simple_ai.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * This program is free software licensed under GPL version 2 * Please see the included DOCS/LICENSE.TXT for more information */ @@ -25,7 +25,7 @@ struct TRINITY_DLL_DECL SimpleAI : public ScriptedAI void Reset(); - void Aggro(Unit *who); + void EnterCombat(Unit *who); void KilledUnit(Unit *victim); @@ -35,18 +35,15 @@ struct TRINITY_DLL_DECL SimpleAI : public ScriptedAI public: - char* Aggro_Text[3]; - bool Aggro_Say[3]; + int32 Aggro_TextId[3]; uint32 Aggro_Sound[3]; - char* Death_Text[3]; - bool Death_Say[3]; + int32 Death_TextId[3]; uint32 Death_Sound[3]; uint32 Death_Spell; uint32 Death_Target_Type; - char* Kill_Text[3]; - bool Kill_Say[3]; + int32 Kill_TextId[3]; uint32 Kill_Sound[3]; uint32 Kill_Spell; uint32 Kill_Target_Type; @@ -62,8 +59,7 @@ public: bool Enabled; //Spell enabled or disabled (default: false) //3 texts to many? - char* Text[3]; - bool Say[3]; + int32 TextId[3]; uint32 Text_Sound[3]; }Spell[10]; diff --git a/src/bindings/scripts/scripts/custom/npc_acherus_taxi.cpp b/src/bindings/scripts/scripts/custom/npc_acherus_taxi.cpp new file mode 100644 index 00000000000..3e58efa345b --- /dev/null +++ b/src/bindings/scripts/scripts/custom/npc_acherus_taxi.cpp @@ -0,0 +1,39 @@ +#include "precompiled.h" +#include "WorldPacket.h" + +#define GOSSIP_FLIGHT "I need a ride" + +bool GossipHello_npc_acherus_taxi(Player *player, Creature *_Creature) +{ +player->SetTaxiCheater(true); + +player->ADD_GOSSIP_ITEM(0, GOSSIP_FLIGHT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + player->SEND_GOSSIP_MENU(9978,_Creature->GetGUID()); + return true; +} + +bool GossipSelect_npc_acherus_taxi(Player *player, Creature *_Creature, uint32 sender, uint32 action ) +{ + if (action == GOSSIP_ACTION_INFO_DEF + 1) + { + if (player->GetPositionZ() >=316) + { + player->GetSession()->SendDoFlight(24446, 1053); + }else{ + player->GetSession()->SendDoFlight(24446, 1054); + } + + } + return true; +} + +void AddSC_npc_acherus_taxi() +{ + Script *newscript; + +newscript = new Script; +newscript->Name="npc_acherus_taxi"; +newscript->pGossipHello = &GossipHello_npc_acherus_taxi; +newscript->pGossipSelect = &GossipSelect_npc_acherus_taxi; +newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/custom/npc_wyrmresttempel_taxi.cpp b/src/bindings/scripts/scripts/custom/npc_wyrmresttempel_taxi.cpp new file mode 100644 index 00000000000..2e9ab3f412d --- /dev/null +++ b/src/bindings/scripts/scripts/custom/npc_wyrmresttempel_taxi.cpp @@ -0,0 +1,116 @@ +#include "precompiled.h" +#include "WorldPacket.h" + +#define GOSSIP_UP "My Lord, I must go to the upper floor of the temple." +#define GOSSIP_DOWN "I would like to take a flight to the ground, Lord Afrasastrasz." +#define GOSSIP_MIDDLE "Can you spare a drake to travel to Lord Afrasastrasz, in the middle of the temple?" +#define GOSSIP_TOP "Please, Let me take one of these dragons to the top floor of the temple." +#define GOSSIP_BOTTOM "Yes, Please. I would like to return to the ground floor of the temple." +#define GOSSIP_ONEDOWN "I would like to see Lord Afrasastrasz, in the middle of the temple." + +bool GossipHello_npc_wyrmresttempel_middle_taxi(Player *player, Creature *_Creature) +{ +player->SetTaxiCheater(true); + +player->ADD_GOSSIP_ITEM(0, GOSSIP_UP, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); +player->ADD_GOSSIP_ITEM(0, GOSSIP_DOWN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + player->SEND_GOSSIP_MENU(12887,_Creature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_wyrmresttempel_middle_taxi(Player *player, Creature *_Creature, uint32 sender, uint32 action ) +{ + if (action == GOSSIP_ACTION_INFO_DEF + 1) + { + player->GetSession()->SendDoFlight(6376, 881); + } + + + if (action == GOSSIP_ACTION_INFO_DEF + 2) + { + player->GetSession()->SendDoFlight(6376, 882); + + } +return true; +} + +bool GossipHello_npc_wyrmresttempel_bottom_taxi(Player *player, Creature *_Creature) +{ +player->SetTaxiCheater(true); + +player->ADD_GOSSIP_ITEM(0, GOSSIP_TOP, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4); +player->ADD_GOSSIP_ITEM(0, GOSSIP_MIDDLE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + player->SEND_GOSSIP_MENU(12713,_Creature->GetGUID()); + + return true; +} + + + +bool GossipSelect_npc_wyrmresttempel_bottom_taxi(Player *player, Creature *_Creature, uint32 sender, uint32 action ) +{ + if (action == GOSSIP_ACTION_INFO_DEF + 4) + { + player->GetSession()->SendDoFlight(6376, 878); + } + + + if (action == GOSSIP_ACTION_INFO_DEF + 3) + { + player->GetSession()->SendDoFlight(6376, 883); + + } +return true; +} + +bool GossipHello_npc_wyrmresttempel_top_taxi(Player *player, Creature *_Creature) +{ +player->SetTaxiCheater(true); + +player->ADD_GOSSIP_ITEM(0, GOSSIP_BOTTOM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5); +player->ADD_GOSSIP_ITEM(0, GOSSIP_ONEDOWN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6); + player->SEND_GOSSIP_MENU(12714,_Creature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_wyrmresttempel_top_taxi(Player *player, Creature *_Creature, uint32 sender, uint32 action ) +{ + if (action == GOSSIP_ACTION_INFO_DEF + 5) + { + player->GetSession()->SendDoFlight(6376, 879); + } + + if (action == GOSSIP_ACTION_INFO_DEF + 6) + + { + player->GetSession()->SendDoFlight(6376, 880); + + } +return true; +} + +void AddSC_npc_wyrmresttempel_taxi() +{ + Script *newscript; + +newscript = new Script; +newscript->Name="npc_wyrmresttempelmiddle_taxi"; +newscript->pGossipHello = &GossipHello_npc_wyrmresttempel_middle_taxi; +newscript->pGossipSelect = &GossipSelect_npc_wyrmresttempel_middle_taxi; +newscript->RegisterSelf(); + +newscript = new Script; +newscript->Name="npc_wyrmresttempelbottom_taxi"; +newscript->pGossipHello = &GossipHello_npc_wyrmresttempel_bottom_taxi; +newscript->pGossipSelect = &GossipSelect_npc_wyrmresttempel_bottom_taxi; +newscript->RegisterSelf(); + +newscript = new Script; +newscript->Name="npc_wyrmresttempeltop_taxi"; +newscript->pGossipHello = &GossipHello_npc_wyrmresttempel_top_taxi; +newscript->pGossipSelect = &GossipSelect_npc_wyrmresttempel_top_taxi; +newscript->RegisterSelf(); + +} diff --git a/src/bindings/scripts/scripts/examples/example_creature.cpp b/src/bindings/scripts/scripts/examples/example_creature.cpp new file mode 100644 index 00000000000..cba35d173ca --- /dev/null +++ b/src/bindings/scripts/scripts/examples/example_creature.cpp @@ -0,0 +1,258 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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: Example_Creature +SD%Complete: 100 +SDComment: Short custom scripting example +SDCategory: Script Examples +EndScriptData */ + +#include "precompiled.h" + +// **** This script is designed as an example for others to build on **** +// **** Please modify whatever you'd like to as this script is only for developement **** + +// **** Script Info **** +// This script is written in a way that it can be used for both friendly and hostile monsters +// Its primary purpose is to show just how much you can really do with scripts +// I recommend trying it out on both an agressive NPC and on friendly npc + +// **** Quick Info **** +// Functions with Handled Function marked above them are functions that are called automatically by the core +// Functions that are marked Custom Function are functions I've created to simplify code + +//List of text id's. The text is stored in database, also in a localized version +//(if translation not exist for the textId, default english text will be used) +//Not required to define in this way, but simplify if changes are needed. +#define SAY_AGGRO -1999900 +#define SAY_RANDOM_0 -1999901 +#define SAY_RANDOM_1 -1999902 +#define SAY_RANDOM_2 -1999903 +#define SAY_RANDOM_3 -1999904 +#define SAY_RANDOM_4 -1999905 +#define SAY_BESERK -1999906 +#define SAY_PHASE -1999907 +#define SAY_DANCE -1999908 +#define SAY_SALUTE -1999909 + +//List of gossip item texts. Items will appear in the gossip window. +#define GOSSIP_ITEM "I'm looking for a fight" + +//List of spells. Not required to define them in this way, but will make it easier to maintain in case spellId change +#define SPELL_BUFF 25661 +#define SPELL_ONE 12555 +#define SPELL_ONE_ALT 24099 +#define SPELL_TWO 10017 +#define SPELL_THREE 26027 +#define SPELL_ENRAGE 23537 +#define SPELL_BESERK 32309 + +struct TRINITY_DLL_DECL example_creatureAI : public ScriptedAI +{ + //*** HANDLED FUNCTION *** + //This is the constructor, called only once when the creature is first created + example_creatureAI(Creature *c) : ScriptedAI(c) {Reset();} + + //*** CUSTOM VARIABLES **** + //These variables are for use only by this individual script. + //Nothing else will ever call them but us. + + uint32 Say_Timer; //Timer for random chat + uint32 Rebuff_Timer; //Timer for rebuffing + uint32 Spell_1_Timer; //Timer for spell 1 when in combat + uint32 Spell_2_Timer; //Timer for spell 1 when in combat + uint32 Spell_3_Timer; //Timer for spell 1 when in combat + uint32 Beserk_Timer; //Timer until we go into Beserk (enraged) mode + uint32 Phase; //The current battle phase we are in + uint32 Phase_Timer; //Timer until phase transition + + //*** HANDLED FUNCTION *** + //This is called whenever the core decides we need to evade + void Reset() + { + Phase = 1; //Start in phase 1 + Phase_Timer = 60000; //60 seconds + Spell_1_Timer = 5000; //5 seconds + Spell_2_Timer = 37000; //37 seconds + Spell_3_Timer = 19000; //19 seconds + Beserk_Timer = 120000; //2 minutes + } + + //*** HANDLED FUNCTION *** + //Attack Start is called whenever someone hits us. + void EnterCombat(Unit *who) + { + //Say some stuff + DoScriptText(SAY_AGGRO, m_creature, who); + } + + //*** HANDLED FUNCTION *** + //Update AI is called Every single map update (roughly once every 100ms if a player is within the grid) + void UpdateAI(const uint32 diff) + { + //Out of combat timers + if (!m_creature->getVictim()) + { + //Random Say timer + if (Say_Timer < diff) + { + //Random switch between 5 outcomes + switch (rand()%5) + { + case 0: DoScriptText(SAY_RANDOM_0, m_creature); break; + case 1: DoScriptText(SAY_RANDOM_1, m_creature); break; + case 2: DoScriptText(SAY_RANDOM_2, m_creature); break; + case 3: DoScriptText(SAY_RANDOM_3, m_creature); break; + case 4: DoScriptText(SAY_RANDOM_4, m_creature); break; + } + + Say_Timer = 45000; //Say something agian in 45 seconds + }else Say_Timer -= diff; + + //Rebuff timer + if (Rebuff_Timer < diff) + { + DoCast(m_creature,SPELL_BUFF); + Rebuff_Timer = 900000; //Rebuff agian in 15 minutes + }else Rebuff_Timer -= diff; + } + + //Return since we have no target + if (!UpdateVictim()) + return; + + //Spell 1 timer + if (Spell_1_Timer < diff) + { + //Cast spell one on our current target. + if (rand()%50 > 10) + DoCast(m_creature->getVictim(),SPELL_ONE_ALT); + else if (m_creature->GetDistance(m_creature->getVictim()) < 25) + DoCast(m_creature->getVictim(),SPELL_ONE); + + Spell_1_Timer = 5000; + }else Spell_1_Timer -= diff; + + //Spell 2 timer + if (Spell_2_Timer < diff) + { + //Cast spell one on our current target. + DoCast(m_creature->getVictim(),SPELL_TWO); + + Spell_2_Timer = 37000; + }else Spell_2_Timer -= diff; + + //Spell 3 timer + if (Phase > 1) + if (Spell_3_Timer < diff) + { + //Cast spell one on our current target. + DoCast(m_creature->getVictim(),SPELL_THREE); + + Spell_3_Timer = 19000; + }else Spell_3_Timer -= diff; + + //Beserk timer + if (Phase > 1) + if (Beserk_Timer < diff) + { + //Say our line then cast uber death spell + DoScriptText(SAY_BESERK, m_creature, m_creature->getVictim()); + DoCast(m_creature->getVictim(),SPELL_BESERK); + + //Cast our beserk spell agian in 12 seconds if we didn't kill everyone + Beserk_Timer = 12000; + }else Beserk_Timer -= diff; + + //Phase timer + if (Phase == 1) + if (Phase_Timer < diff) + { + //Go to next phase + Phase++; + DoScriptText(SAY_PHASE, m_creature); + DoCast(m_creature,SPELL_ENRAGE); + }else Phase_Timer -= diff; + + DoMeleeAttackIfReady(); + } + + //Our Recive emote function + void ReceiveEmote(Player *player, uint32 emote) + { + m_creature->HandleEmoteCommand(emote); + + if (emote == TEXTEMOTE_DANCE) + DoScriptText(SAY_DANCE, m_creature); + + if (emote == TEXTEMOTE_SALUTE) + DoScriptText(SAY_SALUTE, m_creature); + } +}; + +//This is the GetAI method used by all scripts that involve AI +//It is called every time a new creature using this script is created +CreatureAI* GetAI_example_creature(Creature *_Creature) +{ + return new example_creatureAI (_Creature); +} + +//This function is called when the player clicks an option on the gossip menu +void SendDefaultMenu_example_creature(Player *player, Creature *_Creature, uint32 action) +{ + if (action == GOSSIP_ACTION_INFO_DEF + 1) //Fight time + { + //Set our faction to hostile twoards all + _Creature->setFaction(24); + _Creature->Attack(player, true); + player->PlayerTalkClass->CloseGossip(); + } +} + +//This function is called when the player clicks an option on the gossip menu +bool GossipSelect_example_creature(Player *player, Creature *_Creature, uint32 sender, uint32 action ) +{ + if (sender == GOSSIP_SENDER_MAIN) + SendDefaultMenu_example_creature(player, _Creature, action); + + return true; +} + +//This function is called when the player opens the gossip menu +bool GossipHello_example_creature(Player *player, Creature *_Creature) +{ + player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + player->PlayerTalkClass->SendGossipMenu(907,_Creature->GetGUID()); + + return true; +} + +//This is the actual function called only once durring InitScripts() +//It must define all handled functions that are to be run in this script +//For example if you want this Script to handle Emotes you must include +//newscript->ReciveEmote = My_Emote_Function; +void AddSC_example_creature() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "example_creature"; + newscript->GetAI = &GetAI_example_creature; + newscript->pGossipHello = &GossipHello_example_creature; + newscript->pGossipSelect = &GossipSelect_example_creature; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/examples/example_escort.cpp b/src/bindings/scripts/scripts/examples/example_escort.cpp new file mode 100644 index 00000000000..334a85be954 --- /dev/null +++ b/src/bindings/scripts/scripts/examples/example_escort.cpp @@ -0,0 +1,221 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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: Example_Escort +SD%Complete: 100 +SDComment: Script used for testing escortAI +SDCategory: Script Examples +EndScriptData */ + +#include "precompiled.h" +#include "../npc/npc_escortAI.h" + +#define SAY_AGGRO1 -1999910 +#define SAY_AGGRO2 -1999911 +#define SAY_WP_1 -1999912 +#define SAY_WP_2 -1999913 +#define SAY_WP_3 -1999914 +#define SAY_WP_4 -1999915 +#define SAY_DEATH_1 -1999916 +#define SAY_DEATH_2 -1999917 +#define SAY_DEATH_3 -1999918 +#define SAY_SPELL -1999919 +#define SAY_RAND_1 -1999920 +#define SAY_RAND_2 -1999921 + +#define GOSSIP_ITEM_1 "Click to Test Escort(Attack, Defend, Run)" +#define GOSSIP_ITEM_2 "Click to Test Escort(NoAttack, NoDefend, Walk)" +#define GOSSIP_ITEM_3 "Click to Test Escort(NoAttack, Defend, Walk)" + +struct TRINITY_DLL_DECL example_escortAI : public npc_escortAI +{ + public: + + // CreatureAI functions + example_escortAI(Creature *c) : npc_escortAI(c) {Reset();} + + uint32 DeathCoilTimer; + uint32 ChatTimer; + + // Pure Virtual Functions + void WaypointReached(uint32 i) + { + switch (i) + { + case 1: + DoScriptText(SAY_WP_1, m_creature); + break; + + case 3: + { + DoScriptText(SAY_WP_2, m_creature); + Creature* temp = m_creature->SummonCreature(21878, m_creature->GetPositionX()+5, m_creature->GetPositionY()+7, m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 3000); + if(temp) + temp->AI()->AttackStart(m_creature); + } + break; + + case 4: + { + Unit* temp = Unit::GetUnit(*m_creature, PlayerGUID); + if (temp) + { + //temp is the target of the text + DoScriptText(SAY_WP_3, m_creature, temp); + //temp is the source of the text + DoScriptText(SAY_WP_4, temp); + } + } + break; + } + } + + void EnterCombat(Unit* who) + { + if (IsBeingEscorted) + { + if (Unit* temp = Unit::GetUnit(*m_creature, PlayerGUID)) + DoScriptText(SAY_AGGRO1, m_creature, temp); + } + else DoScriptText(SAY_AGGRO2, m_creature); + } + + void Reset() + { + DeathCoilTimer = 4000; + ChatTimer = 4000; + } + + void JustDied(Unit* killer) + { + if (IsBeingEscorted) + { + Unit *pTemp = Unit::GetUnit(*m_creature,PlayerGUID); + //killer = m_creature when player got to far from creature + if (killer == m_creature) + { + //This is actually a whisper. You control the text type in database + if (pTemp) + DoScriptText(SAY_DEATH_1, m_creature, pTemp); + } + else if (pTemp) DoScriptText(SAY_DEATH_2, m_creature, pTemp); + } + else DoScriptText(SAY_DEATH_3, m_creature); + } + + void UpdateAI(const uint32 diff) + { + //Must update npc_escortAI + npc_escortAI::UpdateAI(diff); + + //Combat check + if (m_creature->getVictim()) + { + if (DeathCoilTimer < diff) + { + DoScriptText(SAY_SPELL, m_creature); + m_creature->CastSpell(m_creature->getVictim(), 33130, false); + + DeathCoilTimer = 4000; + }else DeathCoilTimer -= diff; + } + else if(!m_creature->isInCombat()) + { + //Out of combat but being escorted + if (IsBeingEscorted) + if (ChatTimer < diff) + { + if (m_creature->HasAura(3593)) + { + DoScriptText(SAY_RAND_1, m_creature); + m_creature->CastSpell(m_creature, 11540, false); + }else + { + DoScriptText(SAY_RAND_2, m_creature); + m_creature->CastSpell(m_creature, 3593, false); + } + + ChatTimer = 12000; + }else ChatTimer -= diff; + } + } +}; + +CreatureAI* GetAI_example_escort(Creature *_Creature) +{ + example_escortAI* testAI = new example_escortAI(_Creature); + + testAI->AddWaypoint(0, 1231, -4419, 23); + testAI->AddWaypoint(1, 1198, -4440, 23, 0); + testAI->AddWaypoint(2, 1208, -4392, 23); + testAI->AddWaypoint(3, 1231, -4419, 23, 5000); + testAI->AddWaypoint(4, 1208, -4392, 23, 5000); + + return testAI; +} + +bool GossipHello_example_escort(Player *player, Creature *_Creature) +{ + player->TalkedToCreature(_Creature->GetEntry(),_Creature->GetGUID()); + _Creature->prepareGossipMenu(player,0); + + player->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + player->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + player->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); + + _Creature->sendPreparedGossip( player ); + return true; +} + +bool GossipSelect_example_escort(Player *player, Creature *_Creature, uint32 sender, uint32 action ) +{ + if (action == GOSSIP_ACTION_INFO_DEF+1) + { + player->CLOSE_GOSSIP_MENU(); + CAST_AI(npc_escortAI, (_Creature->AI()))->Start(true, true, true, player->GetGUID()); + + return true; // prevent mangos core handling + } + + if (action == GOSSIP_ACTION_INFO_DEF+2) + { + player->CLOSE_GOSSIP_MENU(); + CAST_AI(npc_escortAI, (_Creature->AI()))->Start(false, false, false, player->GetGUID()); + + return true; // prevent mangos core handling + } + + if (action == GOSSIP_ACTION_INFO_DEF+3) + { + player->CLOSE_GOSSIP_MENU(); + CAST_AI(npc_escortAI, (_Creature->AI()))->Start(false, true, false, player->GetGUID()); + + return true; // prevent mangos core handling + } + return false; +} + +void AddSC_example_escort() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "example_escort"; + newscript->GetAI = &GetAI_example_escort; + newscript->pGossipHello = &GossipHello_example_escort; + newscript->pGossipSelect = &GossipSelect_example_escort; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/examples/example_gossip_codebox.cpp b/src/bindings/scripts/scripts/examples/example_gossip_codebox.cpp new file mode 100644 index 00000000000..5d05197fd7a --- /dev/null +++ b/src/bindings/scripts/scripts/examples/example_gossip_codebox.cpp @@ -0,0 +1,88 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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: Example_Gossip_Codebox +SD%Complete: 100 +SDComment: Show a codebox in gossip option +SDCategory: Script Examples +EndScriptData */ + +#include "precompiled.h" +#include <cstring> + +#define SAY_NOT_INTERESTED -1999922 +#define SAY_WRONG -1999923 +#define SAY_CORRECT -1999924 + +#define GOSSIP_ITEM_1 "A quiz: what's your name?" +#define GOSSIP_ITEM_2 "I'm not interested" + +//This function is called when the player opens the gossip menubool +bool GossipHello_example_gossip_codebox(Player *player, Creature *_Creature) +{ + player->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_ITEM_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1, "", 0, true); + player->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + + player->PlayerTalkClass->SendGossipMenu(907,_Creature->GetGUID()); + return true; +} + +//This function is called when the player clicks an option on the gossip menubool +bool GossipSelect_example_gossip_codebox(Player *player, Creature *_Creature, uint32 sender, uint32 action ) +{ + if(action == GOSSIP_ACTION_INFO_DEF+2) + { + DoScriptText(SAY_NOT_INTERESTED, _Creature); + player->CLOSE_GOSSIP_MENU(); + } + return true; +} + +bool GossipSelectWithCode_example_gossip_codebox( Player *player, Creature *_Creature, uint32 sender, uint32 action, const char* sCode ) +{ + if(sender == GOSSIP_SENDER_MAIN) + { + if(action == GOSSIP_ACTION_INFO_DEF+1) + { + if(std::strcmp(sCode, player->GetName())!=0) + { + DoScriptText(SAY_WRONG, _Creature); + _Creature->CastSpell(player, 12826, true); + } + else + { + DoScriptText(SAY_CORRECT, _Creature); + _Creature->CastSpell(player, 26990, true); + } + player->CLOSE_GOSSIP_MENU(); + return true; + } + } + return false; +} + +void AddSC_example_gossip_codebox() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "example_gossip_codebox"; + newscript->pGossipHello = &GossipHello_example_gossip_codebox; + newscript->pGossipSelect = &GossipSelect_example_gossip_codebox; + newscript->pGossipSelectWithCode = &GossipSelectWithCode_example_gossip_codebox; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/examples/example_misc.cpp b/src/bindings/scripts/scripts/examples/example_misc.cpp new file mode 100644 index 00000000000..63136c6bc5d --- /dev/null +++ b/src/bindings/scripts/scripts/examples/example_misc.cpp @@ -0,0 +1,65 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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: Example_Misc +SD%Complete: 100 +SDComment: Item, Areatrigger and other small code examples +SDCategory: Script Examples +EndScriptData */ + +#include "precompiled.h" + +#define SAY_HI -1999925 + +bool AT_example_areatrigger(Player *player, AreaTriggerEntry *at) +{ + DoScriptText(SAY_HI, player); + return true; +} + +extern void LoadDatabase(); +bool ItemUse_example_item(Player *player, Item* _Item, SpellCastTargets const& targets) +{ + LoadDatabase(); + return true; +} + +bool GOHello_example_go_teleporter(Player *player, GameObject* _GO) +{ + player->TeleportTo(0, 1807.07f,336.105f,70.3975f,0.0f); + return false; +} + +void AddSC_example_misc() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "example_areatrigger"; + newscript->pAreaTrigger = &AT_example_areatrigger; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "example_item"; + newscript->pItemUse = &ItemUse_example_item; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "example_go_teleporter"; + newscript->pGOHello = &GOHello_example_go_teleporter; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/go/go_scripts.cpp b/src/bindings/scripts/scripts/go/go_scripts.cpp index 0dc6427cc5e..bd0e621c3c4 100644 --- a/src/bindings/scripts/scripts/go/go_scripts.cpp +++ b/src/bindings/scripts/scripts/go/go_scripts.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>.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 @@ -17,25 +17,46 @@ /* ScriptData SDName: GO_Scripts SD%Complete: 100 -SDComment: Quest support: 4285,4287,4288(crystal pylons), 4296. Field_Repair_Bot->Teaches spell 22704. Barov_journal->Teaches spell 26089 +SDComment: Quest support: 4285,4287,4288(crystal pylons), 4296, 10990, 10991, 10992, Field_Repair_Bot->Teaches spell 22704. Barov_journal->Teaches spell 26089 SDCategory: Game Objects EndScriptData */ /* ContentData +go_cat_figurine (the "trap" version of GO, two different exist) go_northern_crystal_pylon go_eastern_crystal_pylon go_western_crystal_pylon go_barov_journal +go_ethereum_prison +go_ethereum_stasis +go_sacred_fire_of_life +go_shrine_of_the_birds go_field_repair_bot_74A go_orb_of_command go_tablet_of_madness go_tablet_of_the_seven -go_teleporter +go_tele_to_dalaran_crystal +go_tele_to_violet_stand EndContentData */ #include "precompiled.h" /*###### +## go_cat_figurine +######*/ + +enum +{ + SPELL_SUMMON_GHOST_SABER = 5968, +}; + +bool GOHello_go_cat_figurine(Player *player, GameObject* _GO) +{ + player->CastSpell(player,SPELL_SUMMON_GHOST_SABER,true); + return false; +} + +/*###### ## go_crystal_pylons (3x) ######*/ @@ -108,6 +129,26 @@ bool GOHello_go_field_repair_bot_74A(Player *player, GameObject* _GO) } /*###### +## go_gilded_brazier +######*/ + +enum +{ + NPC_STILLBLADE = 17716, +}; + +bool GOHello_go_gilded_brazier(Player* pPlayer, GameObject* pGO) +{ + if (pGO->GetGoType() == GAMEOBJECT_TYPE_GOOBER) + { + if (Creature* pCreature = pPlayer->SummonCreature(NPC_STILLBLADE, 8087.632, -7542.740, 151.568, 0.122, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000)) + pCreature->AI()->AttackStart(pPlayer); + } + + return true; +} + +/*###### ## go_orb_of_command ######*/ @@ -148,16 +189,6 @@ bool GOHello_go_tablet_of_the_seven(Player *player, GameObject* _GO) return true; } -/*###### -## go_teleporter -######*/ - -bool GOHello_go_teleporter(Player *player, GameObject* _GO) -{ - player->TeleportTo(0, 1807.07f,336.105f,70.3975f,0.0f); - return false; -} - /*##### ## go_jump_a_tron ######*/ @@ -174,24 +205,73 @@ bool GOHello_go_jump_a_tron(Player *player, GameObject* _GO) ## go_ethereum_prison ######*/ -float ethereum_NPC[2][7] = +enum +{ + SPELL_REP_LC = 39456, + SPELL_REP_SHAT = 39457, + SPELL_REP_CE = 39460, + SPELL_REP_CON = 39474, + SPELL_REP_KT = 39475, + SPELL_REP_SPOR = 39476 +}; + +const uint32 NpcPrisonEntry[] = { - {20785,20790,20789,20784,20786,20783,20788}, // hostile npc - {22810,22811,22812,22813,22814,22815,0} // fiendly npc (need script in acid ? only to cast spell reputation reward) + 22810, 22811, 22812, 22813, 22814, 22815, //good guys + 20783, 20784, 20785, 20786, 20788, 20789, 20790 //bad guys }; -bool GOHello_go_ethereum_prison(Player *player, GameObject* _GO) +bool GOHello_go_ethereum_prison(Player* pPlayer, GameObject* pGo) { - _GO->SetGoState(0); - switch(rand()%2){ - case 0: - _GO->SummonCreature(ethereum_NPC[0][rand()%6],_GO->GetPositionX(),_GO->GetPositionY(),_GO->GetPositionZ()+0.3, 0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,10000); - break; - case 1: - _GO->SummonCreature(ethereum_NPC[1][rand()%5],_GO->GetPositionX(),_GO->GetPositionY(),_GO->GetPositionZ()+0.3, 0,TEMPSUMMON_TIMED_DESPAWN,10000); - break; + int Random = rand() % (sizeof(NpcPrisonEntry) / sizeof(uint32)); + + if(Creature* pCreature = pPlayer->SummonCreature(NpcPrisonEntry[Random], + pGo->GetPositionX(), pGo->GetPositionY(), pGo->GetPositionZ(), pGo->GetAngle(pPlayer), + TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000)) + { + if(!pCreature->IsHostileTo(pPlayer)) + { + uint32 Spell = 0; + FactionTemplateEntry const* pFaction = pCreature->getFactionTemplateEntry(); + + switch(pFaction->faction) + { + case 1011: Spell = SPELL_REP_LC; break; + case 935: Spell = SPELL_REP_SHAT; break; + case 942: Spell = SPELL_REP_CE; break; + case 933: Spell = SPELL_REP_CON; break; + case 989: Spell = SPELL_REP_KT; break; + case 970: Spell = SPELL_REP_SPOR; break; + } + + if(Spell) + pCreature->CastSpell(pPlayer, Spell, false); + else + error_log("TSCR: go_ethereum_prison summoned creature (entry %u) but faction (%u) are not expected by script.", pCreature->GetEntry(), pCreature->getFaction()); + } + } + + return false; } -return true; + +/*###### +## go_ethereum_stasis +######*/ + +const uint32 NpcStasisEntry[] = +{ + 22825, 20888, 22827, 22826, 22828 +}; + +bool GOHello_go_ethereum_stasis(Player* pPlayer, GameObject* pGo) +{ + int Random = rand() % (sizeof(NpcStasisEntry) / sizeof(uint32)); + + pPlayer->SummonCreature(NpcStasisEntry[Random], + pGo->GetPositionX(), pGo->GetPositionY(), pGo->GetPositionZ(), pGo->GetAngle(pPlayer), + TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + + return false; } /*###### @@ -208,11 +288,87 @@ bool GOHello_go_sacred_fire_of_life(Player* pPlayer, GameObject* pGO) return true; } +/*###### +## go_shrine_of_the_birds +######*/ + +enum +{ + NPC_HAWK_GUARD = 22992, + NPC_EAGLE_GUARD = 22993, + NPC_FALCON_GUARD = 22994, + GO_SHRINE_HAWK = 185551, + GO_SHRINE_EAGLE = 185547, + GO_SHRINE_FALCON = 185553 +}; + +bool GOHello_go_shrine_of_the_birds(Player* pPlayer, GameObject* pGo) +{ + uint32 BirdEntry = 0; + + float fX, fY, fZ; + pGo->GetClosePoint(fX, fY, fZ, pGo->GetObjectSize(), INTERACTION_DISTANCE); + + switch(pGo->GetEntry()) + { + case GO_SHRINE_HAWK: + BirdEntry = NPC_HAWK_GUARD; + break; + case GO_SHRINE_EAGLE: + BirdEntry = NPC_EAGLE_GUARD; + break; + case GO_SHRINE_FALCON: + BirdEntry = NPC_FALCON_GUARD; + break; + } + + if(BirdEntry) + pPlayer->SummonCreature(BirdEntry, fX, fY, fZ, pGo->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); + + return false; +} + +/*###### +## go_tele_to_dalaran_crystal +######*/ + +enum +{ + QUEST_LEARN_LEAVE_RETURN = 12790, + QUEST_TELE_CRYSTAL_FLAG = 12845 +}; + +bool GOHello_go_tele_to_dalaran_crystal(Player* pPlayer, GameObject* pGo) +{ + if (pPlayer->GetQuestRewardStatus(QUEST_TELE_CRYSTAL_FLAG)) + return false; + + //TODO: must send error message (what kind of message? On-screen?) + return true; +} + +/*###### +## go_tele_to_violet_stand +######*/ + +bool GOHello_go_tele_to_violet_stand(Player* pPlayer, GameObject* pGo) +{ + if (pPlayer->GetQuestRewardStatus(QUEST_LEARN_LEAVE_RETURN) || pPlayer->GetQuestStatus(QUEST_LEARN_LEAVE_RETURN) == QUEST_STATUS_INCOMPLETE) + return false; + + return true; +} + void AddSC_go_scripts() { Script *newscript; newscript = new Script; + newscript->Name = "go_cat_figurine"; + newscript->pGOHello = &GOHello_go_cat_figurine; + newscript->RegisterSelf(); + + newscript = new Script; newscript->Name="go_northern_crystal_pylon"; newscript->pGOHello = &GOHello_go_northern_crystal_pylon; newscript->RegisterSelf(); @@ -238,11 +394,21 @@ void AddSC_go_scripts() newscript->RegisterSelf(); newscript = new Script; + newscript->Name = "go_gilded_brazier"; + newscript->pGOHello = &GOHello_go_gilded_brazier; + newscript->RegisterSelf(); + + newscript = new Script; newscript->Name="go_orb_of_command"; newscript->pGOHello = &GOHello_go_orb_of_command; newscript->RegisterSelf(); newscript = new Script; + newscript->Name = "go_shrine_of_the_birds"; + newscript->pGOHello = &GOHello_go_shrine_of_the_birds; + newscript->RegisterSelf(); + + newscript = new Script; newscript->Name="go_tablet_of_madness"; newscript->pGOHello = &GOHello_go_tablet_of_madness; newscript->RegisterSelf(); @@ -253,11 +419,6 @@ void AddSC_go_scripts() newscript->RegisterSelf(); newscript = new Script; - newscript->Name="go_teleporter"; - newscript->pGOHello = &GOHello_go_teleporter; - newscript->RegisterSelf(); - - newscript = new Script; newscript->Name="go_jump_a_tron"; newscript->pGOHello = &GOHello_go_jump_a_tron; newscript->RegisterSelf(); @@ -268,9 +429,23 @@ void AddSC_go_scripts() newscript->RegisterSelf(); newscript = new Script; + newscript->Name = "go_ethereum_stasis"; + newscript->pGOHello = &GOHello_go_ethereum_stasis; + newscript->RegisterSelf(); + + newscript = new Script; newscript->Name = "go_sacred_fire_of_life"; newscript->pGOHello = &GOHello_go_sacred_fire_of_life; newscript->RegisterSelf(); + newscript = new Script; + newscript->Name = "go_tele_to_dalaran_crystal"; + newscript->pGOHello = &GOHello_go_tele_to_dalaran_crystal; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "go_tele_to_violet_stand"; + newscript->pGOHello = &GOHello_go_tele_to_violet_stand; + newscript->RegisterSelf(); } diff --git a/src/bindings/scripts/scripts/guard/guard_ai.cpp b/src/bindings/scripts/scripts/guard/guard_ai.cpp index f28820eb7ee..3d7c3f5ba4c 100644 --- a/src/bindings/scripts/scripts/guard/guard_ai.cpp +++ b/src/bindings/scripts/scripts/guard/guard_ai.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>.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 @@ -28,27 +28,25 @@ EndScriptData */ #define GENERIC_CREATURE_COOLDOWN 5000 +#define SAY_GUARD_SIL_AGGRO1 -1070001 +#define SAY_GUARD_SIL_AGGRO2 -1070002 +#define SAY_GUARD_SIL_AGGRO3 -1070003 + void guardAI::Reset() { GlobalCooldown = 0; BuffTimer = 0; //Rebuff as soon as we can } -void guardAI::Aggro(Unit *who) +void guardAI::EnterCombat(Unit *who) { if (m_creature->GetEntry() == 15184) { switch(rand()%3) { - case 0: - DoSay("Taste blade, mongrel!", LANG_UNIVERSAL,NULL); - break; - case 1: - DoSay("Please tell me that you didn't just do what I think you just did. Please tell me that I'm not going to have to hurt you...", LANG_UNIVERSAL,NULL); - break; - case 2: - DoSay("As if we don't have enough problems, you go and create more!", LANG_UNIVERSAL,NULL); - break; + case 0: DoScriptText(SAY_GUARD_SIL_AGGRO1, m_creature, who); break; + case 1: DoScriptText(SAY_GUARD_SIL_AGGRO1, m_creature, who); break; + case 2: DoScriptText(SAY_GUARD_SIL_AGGRO1, m_creature, who); break; } } @@ -71,7 +69,7 @@ void guardAI::UpdateAI(const uint32 diff) else GlobalCooldown = 0; //Buff timer (only buff when we are alive and not in combat - if (m_creature->isAlive() && !InCombat) + if (m_creature->isAlive() && !m_creature->isInCombat()) if (BuffTimer < diff ) { //Find a spell that targets friendly and applies an aura (these are generally buffs) diff --git a/src/bindings/scripts/scripts/guard/guard_ai.h b/src/bindings/scripts/scripts/guard/guard_ai.h index 7952040b5e2..71ded211f6f 100644 --- a/src/bindings/scripts/scripts/guard/guard_ai.h +++ b/src/bindings/scripts/scripts/guard/guard_ai.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * This program is free software licensed under GPL version 2 * Please see the included DOCS/LICENSE.TXT for more information */ @@ -16,7 +16,7 @@ struct TRINITY_DLL_DECL guardAI : public ScriptedAI void Reset(); - void Aggro(Unit *who); + void EnterCombat(Unit *who); void JustDied(Unit *Killer); diff --git a/src/bindings/scripts/scripts/guard/guards.cpp b/src/bindings/scripts/scripts/guard/guards.cpp index ff6ec258b22..fb27c64135d 100644 --- a/src/bindings/scripts/scripts/guard/guards.cpp +++ b/src/bindings/scripts/scripts/guard/guards.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -115,23 +115,23 @@ void SendDefaultMenu_guard_azuremyst(Player *player, Creature *_Creature, uint32 switch (action) { case GOSSIP_ACTION_INFO_DEF + 1: //Bank - player->SEND_POI(-3918.95, -11544.7, 6, 6, 0, "Bank"); + player->SEND_POI(-3918.95, -11544.7, 7, 6, 0, "Bank"); player->SEND_GOSSIP_MENU(10067,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 2: //Hippogryph Master - player->SEND_POI(-4057.15, -11788.6, 6, 6, 0, "Stephanos"); + player->SEND_POI(-4057.15, -11788.6, 7, 6, 0, "Stephanos"); player->SEND_GOSSIP_MENU(10071,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 3: //Guild master - player->SEND_POI(-4092.43, -11626.6, 6, 6, 0, "Funaam"); + player->SEND_POI(-4092.43, -11626.6, 7, 6, 0, "Funaam"); player->SEND_GOSSIP_MENU(10073,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 4: //Inn - player->SEND_POI(-4129.43, -12469, 6, 6, 0, "Caregiver Chellan"); + player->SEND_POI(-4129.43, -12469, 7, 6, 0, "Caregiver Chellan"); player->SEND_GOSSIP_MENU(10074,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 5: //Stable Master - player->SEND_POI(-4146.42, -12492.7, 6, 6, 0, "Esbina"); + player->SEND_POI(-4146.42, -12492.7, 7, 6, 0, "Esbina"); player->SEND_GOSSIP_MENU(10075,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 6: //Class trainer @@ -168,31 +168,31 @@ void SendClassTrainerMenu_guard_azuremyst(Player *player, Creature *_Creature, u switch (action) { case GOSSIP_ACTION_INFO_DEF + 1: //Druid - player->SEND_POI(-4274.81, -11495.3, 6, 6, 0, "Shalannius"); + player->SEND_POI(-4274.81, -11495.3, 7, 6, 0, "Shalannius"); player->SEND_GOSSIP_MENU(10077,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 2: //Hunter - player->SEND_POI(-4203.65, -12526.5, 6, 6, 0, "Acteon"); + player->SEND_POI(-4203.65, -12526.5, 7, 6, 0, "Acteon"); player->SEND_GOSSIP_MENU(10078,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 3: //Mage - player->SEND_POI(-4149.62, -12530.1, 6, 6, 0, "Semid"); + player->SEND_POI(-4149.62, -12530.1, 7, 6, 0, "Semid"); player->SEND_GOSSIP_MENU(10081,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 4: //Paladin - player->SEND_POI(-4138.98, -12468.5, 6, 6, 0, "Tullas"); + player->SEND_POI(-4138.98, -12468.5, 7, 6, 0, "Tullas"); player->SEND_GOSSIP_MENU(10083,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 5: //Priest - player->SEND_POI(-4131.66, -12478.6, 6, 6, 0, "Guvan"); + player->SEND_POI(-4131.66, -12478.6, 7, 6, 0, "Guvan"); player->SEND_GOSSIP_MENU(10084,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 6: //Shaman - player->SEND_POI(-4162.33, -12456.1, 6, 6, 0, "Tuluun"); + player->SEND_POI(-4162.33, -12456.1, 7, 6, 0, "Tuluun"); player->SEND_GOSSIP_MENU(10085,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 7: //Warrior - player->SEND_POI(-4165.05, -12536.4, 6, 6, 0, "Ruada"); + player->SEND_POI(-4165.05, -12536.4, 7, 6, 0, "Ruada"); player->SEND_GOSSIP_MENU(10086,_Creature->GetGUID()); break; } @@ -203,54 +203,54 @@ void SendProfTrainerMenu_guard_azuremyst(Player *player, Creature *_Creature, ui switch (action) { case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy - player->SEND_POI(-4191.15, -12470, 6, 6, 0, "Daedal"); + player->SEND_POI(-4191.15, -12470, 7, 6, 0, "Daedal"); player->SEND_GOSSIP_MENU(10088,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing - player->SEND_POI(-4726.29, -12387, 6, 6, 0, "Blacksmith Calypso"); + player->SEND_POI(-4726.29, -12387, 7, 6, 0, "Blacksmith Calypso"); player->SEND_GOSSIP_MENU(10089,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 3: //Cooking - player->SEND_POI(-4710.87, -12400.6, 6, 6, 0, "'Cookie' McWeaksauce"); + player->SEND_POI(-4710.87, -12400.6, 7, 6, 0, "'Cookie' McWeaksauce"); player->SEND_GOSSIP_MENU(10090,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting - player->SEND_POI(-3882.85, -11496.7, 6, 6, 0, "Nahogg"); + player->SEND_POI(-3882.85, -11496.7, 7, 6, 0, "Nahogg"); player->SEND_GOSSIP_MENU(10091,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 5: //Engineering - player->SEND_POI(-4157.57, -12470.2, 6, 6, 0, "Artificer Daelo"); + player->SEND_POI(-4157.57, -12470.2, 7, 6, 0, "Artificer Daelo"); player->SEND_GOSSIP_MENU(10092,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 6: //First Aid - player->SEND_POI(-4199.11, -12469.9, 6, 6, 0, "Anchorite Fateema"); + player->SEND_POI(-4199.11, -12469.9, 7, 6, 0, "Anchorite Fateema"); player->SEND_GOSSIP_MENU(10093,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 7: //Fishing - player->SEND_POI(-4266.38, -12985.1, 6, 6, 0, "Diktynna"); + player->SEND_POI(-4266.38, -12985.1, 7, 6, 0, "Diktynna"); player->SEND_GOSSIP_MENU(10094,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 8: //Herbalism player->SEND_GOSSIP_MENU(10095,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 9: //Jewelcrafting - player->SEND_POI(-3781.55, -11541.8, 6, 6, 0, "Farii"); + player->SEND_POI(-3781.55, -11541.8, 7, 6, 0, "Farii"); player->SEND_GOSSIP_MENU(10096,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 10: //Leatherworking - player->SEND_POI(-3442.68, -12322.2, 6, 6, 0, "Moordo"); + player->SEND_POI(-3442.68, -12322.2, 7, 6, 0, "Moordo"); player->SEND_GOSSIP_MENU(10098,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 11: //Mining - player->SEND_POI(-4179.89, -12493.1, 6, 6, 0, "Dulvi"); + player->SEND_POI(-4179.89, -12493.1, 7, 6, 0, "Dulvi"); player->SEND_GOSSIP_MENU(10097,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 12: //Skinning - player->SEND_POI(-3431.17, -12316.5, 6, 6, 0, "Gurf"); + player->SEND_POI(-3431.17, -12316.5, 7, 6, 0, "Gurf"); player->SEND_GOSSIP_MENU(10098,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 13: //Tailoring - player->SEND_POI(-4711.54, -12386.7, 6, 6, 0, "Erin Kelly"); + player->SEND_POI(-4711.54, -12386.7, 7, 6, 0, "Erin Kelly"); player->SEND_GOSSIP_MENU(10099,_Creature->GetGUID()); break; } @@ -302,35 +302,35 @@ void SendDefaultMenu_guard_bluffwatcher(Player *player, Creature *_Creature, uin switch (action) { case GOSSIP_ACTION_INFO_DEF + 1: //Bank - player->SEND_POI(-1257.8, 24.14, 6, 6, 0, "Thunder Bluff Bank"); + player->SEND_POI(-1257.8, 24.14, 7, 6, 0, "Thunder Bluff Bank"); player->SEND_GOSSIP_MENU(1292,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 2: //Wind master - player->SEND_POI(-1196.43, 28.26, 6, 6, 0, "Wind Rider Roost"); + player->SEND_POI(-1196.43, 28.26, 7, 6, 0, "Wind Rider Roost"); player->SEND_GOSSIP_MENU(1293,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 3: //Guild master - player->SEND_POI(-1296.5, 127.57, 6, 6, 0, "Thunder Bluff Civic Information"); + player->SEND_POI(-1296.5, 127.57, 7, 6, 0, "Thunder Bluff Civic Information"); player->SEND_GOSSIP_MENU(1291,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 4: //Inn - player->SEND_POI(-1296, 39.7, 6, 6, 0, "Thunder Bluff Inn"); + player->SEND_POI(-1296, 39.7, 7, 6, 0, "Thunder Bluff Inn"); player->SEND_GOSSIP_MENU(3153,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 5: //Mailbox - player->SEND_POI(-1263.59, 44.36, 6, 6, 0, "Thunder Bluff Mailbox"); + player->SEND_POI(-1263.59, 44.36, 7, 6, 0, "Thunder Bluff Mailbox"); player->SEND_GOSSIP_MENU(3154,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 6: //Auction House - player->SEND_POI(1381.77, -4371.16, 6, 6, 0, GOSSIP_TEXT_AUCTIONHOUSE); + player->SEND_POI(1381.77, -4371.16, 7, 6, 0, GOSSIP_TEXT_AUCTIONHOUSE); player->SEND_GOSSIP_MENU(3155,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 7: //Weapon master - player->SEND_POI(-1282.31, 89.56, 6, 6, 0, "Ansekhwa"); + player->SEND_POI(-1282.31, 89.56, 7, 6, 0, "Ansekhwa"); player->SEND_GOSSIP_MENU(4520,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 8: //Stable master - player->SEND_POI(-1270.19, 48.84, 6, 6, 0, "Bulrug"); + player->SEND_POI(-1270.19, 48.84, 7, 6, 0, "Bulrug"); player->SEND_GOSSIP_MENU(5977,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 9: //battlemaster @@ -370,15 +370,15 @@ void SendBattleMasterMenu_guard_bluffwatcher(Player *player, Creature *_Creature switch (action) { case GOSSIP_ACTION_INFO_DEF + 1: //AV - player->SEND_POI(-1387.82, -97.55, 6, 6, 0, "Taim Ragetotem"); + player->SEND_POI(-1387.82, -97.55, 7, 6, 0, "Taim Ragetotem"); player->SEND_GOSSIP_MENU(7522,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 2: //AB - player->SEND_POI(-997, 214.12, 6, 6, 0, "Martin Lindsey"); + player->SEND_POI(-997, 214.12, 7, 6, 0, "Martin Lindsey"); player->SEND_GOSSIP_MENU(7648,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 3: //WSG - player->SEND_POI(-1384.94, -75.91, 6, 6, 0, "Kergul Bloodaxe"); + player->SEND_POI(-1384.94, -75.91, 7, 6, 0, "Kergul Bloodaxe"); player->SEND_GOSSIP_MENU(7523,_Creature->GetGUID()); break; } @@ -389,27 +389,27 @@ void SendClassTrainerMenu_guard_bluffwatcher(Player *player, Creature *_Creature switch (action) { case GOSSIP_ACTION_INFO_DEF + 1: //Druid - player->SEND_POI(-1054.47, -285, 6, 6, 0, "Hall of Elders"); + player->SEND_POI(-1054.47, -285, 7, 6, 0, "Hall of Elders"); player->SEND_GOSSIP_MENU(1294,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 2: //Hunter - player->SEND_POI(-1416.32, -114.28, 6, 6, 0, "Hunter's Hall"); + player->SEND_POI(-1416.32, -114.28, 7, 6, 0, "Hunter's Hall"); player->SEND_GOSSIP_MENU(1295,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 3: //Mage - player->SEND_POI(-1061.2, 195.5, 6, 6, 0, "Pools of Vision"); + player->SEND_POI(-1061.2, 195.5, 7, 6, 0, "Pools of Vision"); player->SEND_GOSSIP_MENU(1296,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 4: //Priest - player->SEND_POI(-1061.2, 195.5, 6, 6, 0, "Pools of Vision"); + player->SEND_POI(-1061.2, 195.5, 7, 6, 0, "Pools of Vision"); player->SEND_GOSSIP_MENU(1297,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 5: //Shaman - player->SEND_POI(-989.54, 278.25, 6, 6, 0, "Hall of Spirits"); + player->SEND_POI(-989.54, 278.25, 7, 6, 0, "Hall of Spirits"); player->SEND_GOSSIP_MENU(1298,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 6: //Warrior - player->SEND_POI(-1416.32, -114.28, 6, 6, 0, "Hunter's Hall"); + player->SEND_POI(-1416.32, -114.28, 7, 6, 0, "Hunter's Hall"); player->SEND_GOSSIP_MENU(1299,_Creature->GetGUID()); break; } @@ -420,47 +420,47 @@ void SendProfTrainerMenu_guard_bluffwatcher(Player *player, Creature *_Creature, switch (action) { case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy - player->SEND_POI(-1085.56, 27.29, 6, 6, 0, "Bena's Alchemy"); + player->SEND_POI(-1085.56, 27.29, 7, 6, 0, "Bena's Alchemy"); player->SEND_GOSSIP_MENU(1332,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing - player->SEND_POI(-1239.75, 104.88, 6, 6, 0, "Karn's Smithy"); + player->SEND_POI(-1239.75, 104.88, 7, 6, 0, "Karn's Smithy"); player->SEND_GOSSIP_MENU(1333,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 3: //Cooking - player->SEND_POI(-1214.5, -21.23, 6, 6, 0, "Aska's Kitchen"); + player->SEND_POI(-1214.5, -21.23, 7, 6, 0, "Aska's Kitchen"); player->SEND_GOSSIP_MENU(1334,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting - player->SEND_POI(-1112.65, 48.26, 6, 6, 0, "Dawnstrider Enchanters"); + player->SEND_POI(-1112.65, 48.26, 7, 6, 0, "Dawnstrider Enchanters"); player->SEND_GOSSIP_MENU(1335,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 5: //First Aid - player->SEND_POI(-996.58, 200.5, 6, 6, 0, "Spiritual Healing"); + player->SEND_POI(-996.58, 200.5, 7, 6, 0, "Spiritual Healing"); player->SEND_GOSSIP_MENU(1336,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 6: //Fishing - player->SEND_POI(-1169.35, -68.87, 6, 6, 0, "Mountaintop Bait & Tackle"); + player->SEND_POI(-1169.35, -68.87, 7, 6, 0, "Mountaintop Bait & Tackle"); player->SEND_GOSSIP_MENU(1337,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 7: //Herbalism - player->SEND_POI(-1137.7, -1.51, 6, 6, 0, "Holistic Herbalism"); + player->SEND_POI(-1137.7, -1.51, 7, 6, 0, "Holistic Herbalism"); player->SEND_GOSSIP_MENU(1338,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 8: //Leatherworking - player->SEND_POI(-1156.22, 66.86, 6, 6, 0, "Thunder Bluff Armorers"); + player->SEND_POI(-1156.22, 66.86, 7, 6, 0, "Thunder Bluff Armorers"); player->SEND_GOSSIP_MENU(1339,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 9: //Mining - player->SEND_POI(-1249.17, 155, 6, 6, 0, "Stonehoof Geology"); + player->SEND_POI(-1249.17, 155, 7, 6, 0, "Stonehoof Geology"); player->SEND_GOSSIP_MENU(1340,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 10: //Skinning - player->SEND_POI(-1148.56, 51.18, 6, 6, 0, "Mooranta"); + player->SEND_POI(-1148.56, 51.18, 7, 6, 0, "Mooranta"); player->SEND_GOSSIP_MENU(1343,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 11: //Tailoring - player->SEND_POI(-1156.22, 66.86, 6, 6, 0, "Thunder Bluff Armorers"); + player->SEND_POI(-1156.22, 66.86, 7, 6, 0, "Thunder Bluff Armorers"); player->SEND_GOSSIP_MENU(1341,_Creature->GetGUID()); break; } @@ -525,35 +525,35 @@ void SendDefaultMenu_guard_darnassus(Player *player, Creature *_Creature, uint32 switch (action) { case GOSSIP_ACTION_INFO_DEF + 1: //Auction house - player->SEND_POI(9861.23, 2334.55, 6, 6, 0, "Darnassus Auction House"); + player->SEND_POI(9861.23, 2334.55, 7, 6, 0, "Darnassus Auction House"); player->SEND_GOSSIP_MENU(3833, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 2: //Bank - player->SEND_POI(9938.45, 2512.35, 6, 6, 0, "Darnassus Bank"); + player->SEND_POI(9938.45, 2512.35, 7, 6, 0, "Darnassus Bank"); player->SEND_GOSSIP_MENU(3017, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 3: //Wind master - player->SEND_POI(9945.65, 2618.94, 6, 6, 0, "Rut'theran Village"); + player->SEND_POI(9945.65, 2618.94, 7, 6, 0, "Rut'theran Village"); player->SEND_GOSSIP_MENU(3018, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 4: //Guild master - player->SEND_POI(10076.40, 2199.59, 6, 6, 0, "Darnassus Guild Master"); + player->SEND_POI(10076.40, 2199.59, 7, 6, 0, "Darnassus Guild Master"); player->SEND_GOSSIP_MENU(3019, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 5: //Inn - player->SEND_POI(10133.29, 2222.52, 6, 6, 0, "Darnassus Inn"); + player->SEND_POI(10133.29, 2222.52, 7, 6, 0, "Darnassus Inn"); player->SEND_GOSSIP_MENU(3020, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 6: //Mailbox - player->SEND_POI(9942.17, 2495.48, 6, 6, 0, "Darnassus Mailbox"); + player->SEND_POI(9942.17, 2495.48, 7, 6, 0, "Darnassus Mailbox"); player->SEND_GOSSIP_MENU(3021, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 7: //Stable master - player->SEND_POI(10167.20, 2522.66, 6, 6, 0, "Alassin"); + player->SEND_POI(10167.20, 2522.66, 7, 6, 0, "Alassin"); player->SEND_GOSSIP_MENU(5980, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 8: //Weapon trainer - player->SEND_POI(9907.11, 2329.70, 6, 6, 0, "Ilyenia Moonfire"); + player->SEND_POI(9907.11, 2329.70, 7, 6, 0, "Ilyenia Moonfire"); player->SEND_GOSSIP_MENU(4517, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 9: //Battlemaster @@ -590,15 +590,15 @@ void SendBattleMasterMenu_guard_darnassus(Player *player, Creature *_Creature, u switch (action) { case GOSSIP_ACTION_INFO_DEF + 1: //AV - player->SEND_POI(9923.61, 2327.43, 6, 6, 0, "Brogun Stoneshield"); + player->SEND_POI(9923.61, 2327.43, 7, 6, 0, "Brogun Stoneshield"); player->SEND_GOSSIP_MENU(7518, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 2: //AB - player->SEND_POI(9977.37, 2324.39, 6, 6, 0, "Keras Wolfheart"); + player->SEND_POI(9977.37, 2324.39, 7, 6, 0, "Keras Wolfheart"); player->SEND_GOSSIP_MENU(7651, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 3: //WSG - player->SEND_POI(9979.84, 2315.79, 6, 6, 0, "Aethalas"); + player->SEND_POI(9979.84, 2315.79, 7, 6, 0, "Aethalas"); player->SEND_GOSSIP_MENU(7482, _Creature->GetGUID()); break; } @@ -609,23 +609,23 @@ void SendClassTrainerMenu_guard_darnassus(Player *player, Creature *_Creature, u switch (action) { case GOSSIP_ACTION_INFO_DEF + 1: //Druid - player->SEND_POI(10186, 2570.46, 6, 6, 0, "Darnassus Druid Trainer"); + player->SEND_POI(10186, 2570.46, 7, 6, 0, "Darnassus Druid Trainer"); player->SEND_GOSSIP_MENU(3024, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 2: //Hunter - player->SEND_POI(10177.29, 2511.10, 6, 6, 0, "Darnassus Hunter Trainer"); + player->SEND_POI(10177.29, 2511.10, 7, 6, 0, "Darnassus Hunter Trainer"); player->SEND_GOSSIP_MENU(3023, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 3: //Priest - player->SEND_POI(9659.12, 2524.88, 6, 6, 0, "Temple of the Moon"); + player->SEND_POI(9659.12, 2524.88, 7, 6, 0, "Temple of the Moon"); player->SEND_GOSSIP_MENU(3025, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 4: //Rogue - player->SEND_POI(10122, 2599.12, 6, 6, 0, "Darnassus Rogue Trainer"); + player->SEND_POI(10122, 2599.12, 7, 6, 0, "Darnassus Rogue Trainer"); player->SEND_GOSSIP_MENU(3026, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 5: //Warrior - player->SEND_POI(9951.91, 2280.38, 6, 6, 0, "Warrior's Terrace"); + player->SEND_POI(9951.91, 2280.38, 7, 6, 0, "Warrior's Terrace"); player->SEND_GOSSIP_MENU(3033, _Creature->GetGUID()); break; } @@ -636,39 +636,39 @@ void SendProfTrainerMenu_guard_darnassus(Player *player, Creature *_Creature, ui switch (action) { case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy - player->SEND_POI(10075.90, 2356.76, 6, 6, 0, "Darnassus Alchemy Trainer"); + player->SEND_POI(10075.90, 2356.76, 7, 6, 0, "Darnassus Alchemy Trainer"); player->SEND_GOSSIP_MENU(3035, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 2: //Cooking - player->SEND_POI(10088.59, 2419.21, 6, 6, 0, "Darnassus Cooking Trainer"); + player->SEND_POI(10088.59, 2419.21, 7, 6, 0, "Darnassus Cooking Trainer"); player->SEND_GOSSIP_MENU(3036, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 3: //Enchanting - player->SEND_POI(10146.09, 2313.42, 6, 6, 0, "Darnassus Enchanting Trainer"); + player->SEND_POI(10146.09, 2313.42, 7, 6, 0, "Darnassus Enchanting Trainer"); player->SEND_GOSSIP_MENU(3337, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 4: //First Aid - player->SEND_POI(10150.09, 2390.43, 6, 6, 0, "Darnassus First Aid Trainer"); + player->SEND_POI(10150.09, 2390.43, 7, 6, 0, "Darnassus First Aid Trainer"); player->SEND_GOSSIP_MENU(3037, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 5: //Fishing - player->SEND_POI(9836.20, 2432.17, 6, 6, 0, "Darnassus Fishing Trainer"); + player->SEND_POI(9836.20, 2432.17, 7, 6, 0, "Darnassus Fishing Trainer"); player->SEND_GOSSIP_MENU(3038, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 6: //Herbalism - player->SEND_POI(9757.17, 2430.16, 6, 6, 0, "Darnassus Herbalism Trainer"); + player->SEND_POI(9757.17, 2430.16, 7, 6, 0, "Darnassus Herbalism Trainer"); player->SEND_GOSSIP_MENU(3039, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 7: //Leatherworking - player->SEND_POI(10086.59, 2255.77, 6, 6, 0, "Darnassus Leatherworking Trainer"); + player->SEND_POI(10086.59, 2255.77, 7, 6, 0, "Darnassus Leatherworking Trainer"); player->SEND_GOSSIP_MENU(3040, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 8: //Skinning - player->SEND_POI(10081.40, 2257.18, 6, 6, 0, "Darnassus Skinning Trainer"); + player->SEND_POI(10081.40, 2257.18, 7, 6, 0, "Darnassus Skinning Trainer"); player->SEND_GOSSIP_MENU(3042, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 9: //Tailoring - player->SEND_POI(10079.70, 2268.19, 6, 6, 0, "Darnassus Tailor"); + player->SEND_POI(10079.70, 2268.19, 7, 6, 0, "Darnassus Tailor"); player->SEND_GOSSIP_MENU(3044, _Creature->GetGUID()); break; } @@ -727,11 +727,11 @@ void SendDefaultMenu_guard_dunmorogh(Player *player, Creature *_Creature, uint32 player->SEND_GOSSIP_MENU(4290,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 4: //Inn - player->SEND_POI(-5582.66, -525.89, 6, 6, 0, "Thunderbrew Distillery"); + player->SEND_POI(-5582.66, -525.89, 7, 6, 0, "Thunderbrew Distillery"); player->SEND_GOSSIP_MENU(4291,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 5: //Stable Master - player->SEND_POI(-5604, -509.58, 6, 6, 0, "Shelby Stoneflint"); + player->SEND_POI(-5604, -509.58, 7, 6, 0, "Shelby Stoneflint"); player->SEND_GOSSIP_MENU(5985,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 6: //Class trainer @@ -767,31 +767,31 @@ void SendClassTrainerMenu_guard_dunmorogh(Player *player, Creature *_Creature, u switch (action) { case GOSSIP_ACTION_INFO_DEF + 1: //Hunter - player->SEND_POI(-5618.29, -454.25, 6, 6, 0, "Grif Wildheart"); + player->SEND_POI(-5618.29, -454.25, 7, 6, 0, "Grif Wildheart"); player->SEND_GOSSIP_MENU(4293,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 2: //Mage - player->SEND_POI(-5585.6, -539.99, 6, 6, 0, "Magis Sparkmantle"); + player->SEND_POI(-5585.6, -539.99, 7, 6, 0, "Magis Sparkmantle"); player->SEND_GOSSIP_MENU(4294,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 3: //Paladin - player->SEND_POI(-5585.6, -539.99, 6, 6, 0, "Azar Stronghammer"); + player->SEND_POI(-5585.6, -539.99, 7, 6, 0, "Azar Stronghammer"); player->SEND_GOSSIP_MENU(4295,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 4: //Priest - player->SEND_POI(-5591.74, -525.61, 6, 6, 0, "Maxan Anvol"); + player->SEND_POI(-5591.74, -525.61, 7, 6, 0, "Maxan Anvol"); player->SEND_GOSSIP_MENU(4296,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 5: //Rogue - player->SEND_POI(-5602.75, -542.4, 6, 6, 0, "Hogral Bakkan"); + player->SEND_POI(-5602.75, -542.4, 7, 6, 0, "Hogral Bakkan"); player->SEND_GOSSIP_MENU(4297,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 6: //Warlock - player->SEND_POI(-5641.97, -523.76, 6, 6, 0, "Gimrizz Shadowcog"); + player->SEND_POI(-5641.97, -523.76, 7, 6, 0, "Gimrizz Shadowcog"); player->SEND_GOSSIP_MENU(4298,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 7: //Warrior - player->SEND_POI(-5604.79, -529.38, 6, 6, 0, "Granis Swiftaxe"); + player->SEND_POI(-5604.79, -529.38, 7, 6, 0, "Granis Swiftaxe"); player->SEND_GOSSIP_MENU(4299,_Creature->GetGUID()); break; } @@ -805,26 +805,26 @@ void SendProfTrainerMenu_guard_dunmorogh(Player *player, Creature *_Creature, ui player->SEND_GOSSIP_MENU(4301,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing - player->SEND_POI(-5584.72, -428.41, 6, 6, 0, "Tognus Flintfire"); + player->SEND_POI(-5584.72, -428.41, 7, 6, 0, "Tognus Flintfire"); player->SEND_GOSSIP_MENU(4302,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 3: //Cooking - player->SEND_POI(-5596.85, -541.43, 6, 6, 0, "Gremlock Pilsnor"); + player->SEND_POI(-5596.85, -541.43, 7, 6, 0, "Gremlock Pilsnor"); player->SEND_GOSSIP_MENU(4303,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting player->SEND_GOSSIP_MENU(4304,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 5: //Engineering - player->SEND_POI(-5531, -666.53, 6, 6, 0, "Bronk Guzzlegear"); + player->SEND_POI(-5531, -666.53, 7, 6, 0, "Bronk Guzzlegear"); player->SEND_GOSSIP_MENU(4305,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 6: //First Aid - player->SEND_POI(-5603.67, -523.57, 6, 6, 0, "Thamner Pol"); + player->SEND_POI(-5603.67, -523.57, 7, 6, 0, "Thamner Pol"); player->SEND_GOSSIP_MENU(4306,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 7: //Fishing - player->SEND_POI(-5199.9, 58.58, 6, 6, 0, "Paxton Ganter"); + player->SEND_POI(-5199.9, 58.58, 7, 6, 0, "Paxton Ganter"); player->SEND_GOSSIP_MENU(4307,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 8: //Herbalism @@ -834,7 +834,7 @@ void SendProfTrainerMenu_guard_dunmorogh(Player *player, Creature *_Creature, ui player->SEND_GOSSIP_MENU(4310,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 10: //Mining - player->SEND_POI(-5531, -666.53, 6, 6, 0, "Yarr Hamerstone"); + player->SEND_POI(-5531, -666.53, 7, 6, 0, "Yarr Hamerstone"); player->SEND_GOSSIP_MENU(4311,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 11: //Skinning @@ -893,11 +893,11 @@ void SendDefaultMenu_guard_durotar(Player *player, Creature *_Creature, uint32 a player->SEND_GOSSIP_MENU(4033,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 3: //Inn - player->SEND_POI(338.7, -4688.87, 6, 6, 0, "Razor Hill Inn"); + player->SEND_POI(338.7, -4688.87, 7, 6, 0, "Razor Hill Inn"); player->SEND_GOSSIP_MENU(4034,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 4: //Stable master - player->SEND_POI(330.31, -4710.66, 6, 6, 0, "Shoja'my"); + player->SEND_POI(330.31, -4710.66, 7, 6, 0, "Shoja'my"); player->SEND_GOSSIP_MENU(5973,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 5: //Class trainer @@ -933,31 +933,31 @@ void SendClassTrainerMenu_guard_durotar(Player *player, Creature *_Creature, uin switch (action) { case GOSSIP_ACTION_INFO_DEF + 1: //Hunter - player->SEND_POI(276, -4706.72, 6, 6, 0, "Thotar"); + player->SEND_POI(276, -4706.72, 7, 6, 0, "Thotar"); player->SEND_GOSSIP_MENU(4013,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 2: //Mage - player->SEND_POI(-839.33, -4935.6, 6, 6, 0, "Un'Thuwa"); + player->SEND_POI(-839.33, -4935.6, 7, 6, 0, "Un'Thuwa"); player->SEND_GOSSIP_MENU(4014,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 3: //Priest - player->SEND_POI(296.22, -4828.1, 6, 6, 0, "Tai'jin"); + player->SEND_POI(296.22, -4828.1, 7, 6, 0, "Tai'jin"); player->SEND_GOSSIP_MENU(4015,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 4: //Rogue - player->SEND_POI(265.76, -4709, 6, 6, 0, "Kaplak"); + player->SEND_POI(265.76, -4709, 7, 6, 0, "Kaplak"); player->SEND_GOSSIP_MENU(4016,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 5: //Shaman - player->SEND_POI(307.79, -4836.97, 6, 6, 0, "Swart"); + player->SEND_POI(307.79, -4836.97, 7, 6, 0, "Swart"); player->SEND_GOSSIP_MENU(4017,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 6: //Warlock - player->SEND_POI(355.88, -4836.45, 6, 6, 0, "Dhugru Gorelust"); + player->SEND_POI(355.88, -4836.45, 7, 6, 0, "Dhugru Gorelust"); player->SEND_GOSSIP_MENU(4018,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 7: //Warrior - player->SEND_POI(312.3, -4824.66, 6, 6, 0, "Tarshaw Jaggedscar"); + player->SEND_POI(312.3, -4824.66, 7, 6, 0, "Tarshaw Jaggedscar"); player->SEND_GOSSIP_MENU(4019,_Creature->GetGUID()); break; } @@ -968,11 +968,11 @@ void SendProfTrainerMenu_guard_durotar(Player *player, Creature *_Creature, uint switch (action) { case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy - player->SEND_POI(-800.25, -4894.33, 6, 6, 0, "Miao'zan"); + player->SEND_POI(-800.25, -4894.33, 7, 6, 0, "Miao'zan"); player->SEND_GOSSIP_MENU(4020,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing - player->SEND_POI(373.24, -4716.45, 6, 6, 0, "Dwukk"); + player->SEND_POI(373.24, -4716.45, 7, 6, 0, "Dwukk"); player->SEND_GOSSIP_MENU(4021,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 3: //Cooking @@ -982,26 +982,26 @@ void SendProfTrainerMenu_guard_durotar(Player *player, Creature *_Creature, uint player->SEND_GOSSIP_MENU(4023,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 5: //Engineering - player->SEND_POI(368.95, -4723.95, 6, 6, 0, "Mukdrak"); + player->SEND_POI(368.95, -4723.95, 7, 6, 0, "Mukdrak"); player->SEND_GOSSIP_MENU(4024,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 6: //First Aid - player->SEND_POI(327.17, -4825.62, 6, 6, 0, "Rawrk"); + player->SEND_POI(327.17, -4825.62, 7, 6, 0, "Rawrk"); player->SEND_GOSSIP_MENU(4025,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 7: //Fishing - player->SEND_POI(-1065.48, -4777.43, 6, 6, 0, "Lau'Tiki"); + player->SEND_POI(-1065.48, -4777.43, 7, 6, 0, "Lau'Tiki"); player->SEND_GOSSIP_MENU(4026,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 8: //Herbalism - player->SEND_POI(-836.25, -4896.89, 6, 6, 0, "Mishiki"); + player->SEND_POI(-836.25, -4896.89, 7, 6, 0, "Mishiki"); player->SEND_GOSSIP_MENU(4027,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 9: //Leatherworking player->SEND_GOSSIP_MENU(4028,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 10: //Mining - player->SEND_POI(366.94, -4705, 6, 6, 0, "Krunn"); + player->SEND_POI(366.94, -4705, 7, 6, 0, "Krunn"); player->SEND_GOSSIP_MENU(4029,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 11: //Skinning @@ -1064,11 +1064,11 @@ void SendDefaultMenu_guard_elwynnforest(Player *player, Creature *_Creature, uin player->SEND_GOSSIP_MENU(4262,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 4: //Inn - player->SEND_POI(-9459.34, 42.08, 6, 6, 0, "Lion's Pride Inn"); + player->SEND_POI(-9459.34, 42.08, 7, 6, 0, "Lion's Pride Inn"); player->SEND_GOSSIP_MENU(4263,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 5: //Stable Master - player->SEND_POI(-9466.62, 45.87, 6, 6, 0, "Erma"); + player->SEND_POI(-9466.62, 45.87, 7, 6, 0, "Erma"); player->SEND_GOSSIP_MENU(5983,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 6: //Class trainer @@ -1111,27 +1111,27 @@ void SendClassTrainerMenu_guard_elwynnforest(Player *player, Creature *_Creature player->SEND_GOSSIP_MENU(4266,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 3: //Mage - player->SEND_POI(-9471.12, 33.44, 6, 6, 0, "Zaldimar Wefhellt"); + player->SEND_POI(-9471.12, 33.44, 7, 6, 0, "Zaldimar Wefhellt"); player->SEND_GOSSIP_MENU(4268,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 4: //Paladin - player->SEND_POI(-9469, 108.05, 6, 6, 0, "Brother Wilhelm"); + player->SEND_POI(-9469, 108.05, 7, 6, 0, "Brother Wilhelm"); player->SEND_GOSSIP_MENU(4269,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 5: //Priest - player->SEND_POI(-9461.07, 32.6, 6, 6, 0, "Priestess Josetta"); + player->SEND_POI(-9461.07, 32.6, 7, 6, 0, "Priestess Josetta"); player->SEND_GOSSIP_MENU(4267,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 6: //Rogue - player->SEND_POI(-9465.13, 13.29, 6, 6, 0, "Keryn Sylvius"); + player->SEND_POI(-9465.13, 13.29, 7, 6, 0, "Keryn Sylvius"); player->SEND_GOSSIP_MENU(4270,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 7: //Warlock - player->SEND_POI(-9473.21, -4.08, 6, 6, 0, "Maximillian Crowe"); + player->SEND_POI(-9473.21, -4.08, 7, 6, 0, "Maximillian Crowe"); player->SEND_GOSSIP_MENU(4272,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 8: //Warrior - player->SEND_POI(-9461.82, 109.50, 6, 6, 0, "Lyria Du Lac"); + player->SEND_POI(-9461.82, 109.50, 7, 6, 0, "Lyria Du Lac"); player->SEND_GOSSIP_MENU(4271,_Creature->GetGUID()); break; } @@ -1142,15 +1142,15 @@ void SendProfTrainerMenu_guard_elwynnforest(Player *player, Creature *_Creature, switch (action) { case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy - player->SEND_POI(-9057.04, 153.63, 6, 6, 0, "Alchemist Mallory"); + player->SEND_POI(-9057.04, 153.63, 7, 6, 0, "Alchemist Mallory"); player->SEND_GOSSIP_MENU(4274,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing - player->SEND_POI(-9456.58, 87.90, 6, 6, 0, "Smith Argus"); + player->SEND_POI(-9456.58, 87.90, 7, 6, 0, "Smith Argus"); player->SEND_GOSSIP_MENU(4275,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 3: //Cooking - player->SEND_POI(-9467.54, -3.16, 6, 6, 0, "Tomas"); + player->SEND_POI(-9467.54, -3.16, 7, 6, 0, "Tomas"); player->SEND_GOSSIP_MENU(4276,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting @@ -1160,30 +1160,30 @@ void SendProfTrainerMenu_guard_elwynnforest(Player *player, Creature *_Creature, player->SEND_GOSSIP_MENU(4278,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 6: //First Aid - player->SEND_POI(-9456.82, 30.49, 6, 6, 0, "Michelle Belle"); + player->SEND_POI(-9456.82, 30.49, 7, 6, 0, "Michelle Belle"); player->SEND_GOSSIP_MENU(4279,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 7: //Fishing - player->SEND_POI(-9386.54, -118.73, 6, 6, 0, "Lee Brown"); + player->SEND_POI(-9386.54, -118.73, 7, 6, 0, "Lee Brown"); player->SEND_GOSSIP_MENU(4280,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 8: //Herbalism - player->SEND_POI(-9060.70, 149.23, 6, 6, 0, "Herbalist Pomeroy"); + player->SEND_POI(-9060.70, 149.23, 7, 6, 0, "Herbalist Pomeroy"); player->SEND_GOSSIP_MENU(4281,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 9: //Leatherworking - player->SEND_POI(-9376.12, -75.23, 6, 6, 0, "Adele Fielder"); + player->SEND_POI(-9376.12, -75.23, 7, 6, 0, "Adele Fielder"); player->SEND_GOSSIP_MENU(4282,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 10: //Mining player->SEND_GOSSIP_MENU(4283,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 11: //Skinning - player->SEND_POI(-9536.91, -1212.76, 6, 6, 0, "Helene Peltskinner"); + player->SEND_POI(-9536.91, -1212.76, 7, 6, 0, "Helene Peltskinner"); player->SEND_GOSSIP_MENU(4284,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 12: //Tailoring - player->SEND_POI(-9376.12, -75.23, 6, 6, 0, "Eldrin"); + player->SEND_POI(-9376.12, -75.23, 7, 6, 0, "Eldrin"); player->SEND_GOSSIP_MENU(4285,_Creature->GetGUID()); break; } @@ -1230,18 +1230,18 @@ void SendDefaultMenu_guard_eversong(Player *player, Creature *_Creature, uint32 switch (action) { case GOSSIP_ACTION_INFO_DEF + 1: //Bat Handler - player->SEND_POI(9371.93, -7164.80, 6, 6, 0, "Skymistress Gloaming"); + player->SEND_POI(9371.93, -7164.80, 7, 6, 0, "Skymistress Gloaming"); player->SEND_GOSSIP_MENU(10181,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 2: //Guild master player->SEND_GOSSIP_MENU(10182,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 3: //Inn - player->SEND_POI(9483.74, -6844.58, 6, 6, 0, "Delaniel's inn"); + player->SEND_POI(9483.74, -6844.58, 7, 6, 0, "Delaniel's inn"); player->SEND_GOSSIP_MENU(10183,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 4: //Stable Master - player->SEND_POI(9489.62, -6829.93, 6, 6, 0, "Anathos"); + player->SEND_POI(9489.62, -6829.93, 7, 6, 0, "Anathos"); player->SEND_GOSSIP_MENU(10184,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 5: //Class trainer @@ -1280,27 +1280,27 @@ void SendClassTrainerMenu_guard_eversong(Player *player, Creature *_Creature, ui player->SEND_GOSSIP_MENU(10185,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 2: //Hunter - player->SEND_POI(9527.44, -6865.25, 6, 6, 0, "Hannovia"); + player->SEND_POI(9527.44, -6865.25, 7, 6, 0, "Hannovia"); player->SEND_GOSSIP_MENU(10186,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 3: //Mage - player->SEND_POI(9464.24, -6855.52, 6, 6, 0, "Garridel"); + player->SEND_POI(9464.24, -6855.52, 7, 6, 0, "Garridel"); player->SEND_GOSSIP_MENU(10187,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 4: //Paladin - player->SEND_POI(9517.61, -6871.04, 6, 6, 0, "Noellene"); + player->SEND_POI(9517.61, -6871.04, 7, 6, 0, "Noellene"); player->SEND_GOSSIP_MENU(10189,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 5: //Priest - player->SEND_POI(9467.39, -6845.72, 6, 6, 0, "Ponaris"); + player->SEND_POI(9467.39, -6845.72, 7, 6, 0, "Ponaris"); player->SEND_GOSSIP_MENU(10190,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 6: //Rogue - player->SEND_POI(9533.67, -6877.39, 6, 6, 0, "Tannaria"); + player->SEND_POI(9533.67, -6877.39, 7, 6, 0, "Tannaria"); player->SEND_GOSSIP_MENU(10191,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 7: //Warlock - player->SEND_POI(9468.99, -6865.60, 6, 6, 0, "Celoenus"); + player->SEND_POI(9468.99, -6865.60, 7, 6, 0, "Celoenus"); player->SEND_GOSSIP_MENU(10192,_Creature->GetGUID()); break; } @@ -1311,48 +1311,48 @@ void SendProfTrainerMenu_guard_eversong(Player *player, Creature *_Creature, uin switch (action) { case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy - player->SEND_POI(8659.90, -6368.12, 6, 6, 0, "Arcanist Sheynathren"); + player->SEND_POI(8659.90, -6368.12, 7, 6, 0, "Arcanist Sheynathren"); player->SEND_GOSSIP_MENU(10193,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing - player->SEND_POI(8984.21, -7419.21, 6, 6, 0, "Arathel Sunforge"); + player->SEND_POI(8984.21, -7419.21, 7, 6, 0, "Arathel Sunforge"); player->SEND_GOSSIP_MENU(10194,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 3: //Cooking - player->SEND_POI(9494.04, -6881.51, 6, 6, 0, "Quarelestra"); + player->SEND_POI(9494.04, -6881.51, 7, 6, 0, "Quarelestra"); player->SEND_GOSSIP_MENU(10195,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 4: //Engineering player->SEND_GOSSIP_MENU(10197,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 5: //First Aid - player->SEND_POI(9479.46, -6879.16, 6, 6, 0, "Kanaria"); + player->SEND_POI(9479.46, -6879.16, 7, 6, 0, "Kanaria"); player->SEND_GOSSIP_MENU(10198,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 6: //Fishing player->SEND_GOSSIP_MENU(10199,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 7: //Herbalism - player->SEND_POI(8678.92, -6329.09, 6, 6, 0, "Botanist Tyniarrel"); + player->SEND_POI(8678.92, -6329.09, 7, 6, 0, "Botanist Tyniarrel"); player->SEND_GOSSIP_MENU(10200,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 8: //Jewelcrafting - player->SEND_POI(9484.32, -6874.98, 6, 6, 0, "Aleinia"); + player->SEND_POI(9484.32, -6874.98, 7, 6, 0, "Aleinia"); player->SEND_GOSSIP_MENU(10203,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 9: //Leatherworking - player->SEND_POI(9362.04, -7130.33, 6, 6, 0, "Sathein"); + player->SEND_POI(9362.04, -7130.33, 7, 6, 0, "Sathein"); player->SEND_GOSSIP_MENU(10204,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 10: //Mining player->SEND_GOSSIP_MENU(10205,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 11: //Skinning - player->SEND_POI(9362.04, -7130.33, 6, 6, 0, "Mathreyn"); + player->SEND_POI(9362.04, -7130.33, 7, 6, 0, "Mathreyn"); player->SEND_GOSSIP_MENU(10206,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 12: //Tailoring - player->SEND_POI(8680.36, -6327.51, 6, 6, 0, "Sempstress Ambershine"); + player->SEND_POI(8680.36, -6327.51, 7, 6, 0, "Sempstress Ambershine"); player->SEND_GOSSIP_MENU(10207,_Creature->GetGUID()); break; } @@ -1404,35 +1404,35 @@ void SendDefaultMenu_guard_exodar(Player *player, Creature *_Creature, uint32 ac switch (action) { case GOSSIP_ACTION_INFO_DEF + 1: //Auction house - player->SEND_POI(-4023.6, -11739.3, 6, 6, 0, "Exodar Auction House"); + player->SEND_POI(-4023.6, -11739.3, 7, 6, 0, "Exodar Auction House"); player->SEND_GOSSIP_MENU(9528, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 2: //Bank - player->SEND_POI(-3923.89, -11544.5, 6, 6, 0, "Exodar Bank"); + player->SEND_POI(-3923.89, -11544.5, 7, 6, 0, "Exodar Bank"); player->SEND_GOSSIP_MENU(9529, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 3: //Guild master - player->SEND_POI(-4092.57, -11626.5, 6, 6, 0, "Exodar Guild Master"); + player->SEND_POI(-4092.57, -11626.5, 7, 6, 0, "Exodar Guild Master"); player->SEND_GOSSIP_MENU(9539, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 4: //Hippogryph master - player->SEND_POI(-4060.46, -11787.1, 6, 6, 0, "Exodar Hippogryph Master"); + player->SEND_POI(-4060.46, -11787.1, 7, 6, 0, "Exodar Hippogryph Master"); player->SEND_GOSSIP_MENU(9530, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 5: //Inn - player->SEND_POI(-3741.87, -11695.1, 6, 6, 0, "Exodar Inn"); + player->SEND_POI(-3741.87, -11695.1, 7, 6, 0, "Exodar Inn"); player->SEND_GOSSIP_MENU(9545, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 6: //Mailbox - player->SEND_POI(-3972.5, -11696.0, 6, 6, 0, "Mailbox"); + player->SEND_POI(-3972.5, -11696.0, 7, 6, 0, "Mailbox"); player->SEND_GOSSIP_MENU(10254, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 7: //Stable master - player->SEND_POI(-3786.5, -11702.5, 6, 6, 0, "Stable Master Arthaid"); + player->SEND_POI(-3786.5, -11702.5, 7, 6, 0, "Stable Master Arthaid"); player->SEND_GOSSIP_MENU(9558, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 8: //Weapon trainer - player->SEND_POI(-4215.68, -11628.9, 6, 6, 0, "Weapon Master Handiir"); + player->SEND_POI(-4215.68, -11628.9, 7, 6, 0, "Weapon Master Handiir"); player->SEND_GOSSIP_MENU(9565, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 9: //Battlemaster @@ -1477,23 +1477,23 @@ void SendBattleMasterMenu_guard_exodar(Player *player, Creature *_Creature, uint switch (action) { case GOSSIP_ACTION_INFO_DEF + 1: //AV - player->SEND_POI(-3978.1, -11357, 6, 6, 0, "Alterac Valley Battlemaster"); + player->SEND_POI(-3978.1, -11357, 7, 6, 0, "Alterac Valley Battlemaster"); player->SEND_GOSSIP_MENU(9531, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 2: //AB - player->SEND_POI(-3998.9, -11345.2, 6, 6, 0, "Arathi Basin Battlemaster"); + player->SEND_POI(-3998.9, -11345.2, 7, 6, 0, "Arathi Basin Battlemaster"); player->SEND_GOSSIP_MENU(9531, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 3: //A - player->SEND_POI(-3759.27, -11695.63, 6, 6, 0, "Miglik Blotstrom"); + player->SEND_POI(-3759.27, -11695.63, 7, 6, 0, "Miglik Blotstrom"); player->SEND_GOSSIP_MENU(10223, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 4: //EOS - player->SEND_POI(-3978.1, -11357, 6, 6, 0, "Eye Of The Storm Battlemaster"); + player->SEND_POI(-3978.1, -11357, 7, 6, 0, "Eye Of The Storm Battlemaster"); player->SEND_GOSSIP_MENU(9531, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 5: //WSG - player->SEND_POI(-3977.5, -11381.2, 6, 6, 0, "Warsong Gulch Battlemaster"); + player->SEND_POI(-3977.5, -11381.2, 7, 6, 0, "Warsong Gulch Battlemaster"); player->SEND_GOSSIP_MENU(9531, _Creature->GetGUID()); break; } @@ -1504,31 +1504,31 @@ void SendClassTrainerMenu_guard_exodar(Player *player, Creature *_Creature, uint switch (action) { case GOSSIP_ACTION_INFO_DEF + 1: //Druid - player->SEND_POI(-4276.0, -11495, 6, 6, 0, "Exodar Druid Trainer"); + player->SEND_POI(-4276.0, -11495, 7, 6, 0, "Exodar Druid Trainer"); player->SEND_GOSSIP_MENU(9534, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 2: //Hunter - player->SEND_POI(-4210.6, -11575.2, 6, 6, 0, "Exodar Hunter Trainer"); + player->SEND_POI(-4210.6, -11575.2, 7, 6, 0, "Exodar Hunter Trainer"); player->SEND_GOSSIP_MENU(9544, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 3: //Mage - player->SEND_POI(-4057.32, -11556.5, 6, 6, 0, "Exodar Mage Trainer"); + player->SEND_POI(-4057.32, -11556.5, 7, 6, 0, "Exodar Mage Trainer"); player->SEND_GOSSIP_MENU(9550, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 4: //Paladin - player->SEND_POI(-4191.2, -11470.4, 6, 6, 0, "Exodar Paladin Trainer"); + player->SEND_POI(-4191.2, -11470.4, 7, 6, 0, "Exodar Paladin Trainer"); player->SEND_GOSSIP_MENU(9553, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 5: //Priest - player->SEND_POI(-3969.63, -11482.8, 6, 6, 0, "Exodar Priest Trainer"); + player->SEND_POI(-3969.63, -11482.8, 7, 6, 0, "Exodar Priest Trainer"); player->SEND_GOSSIP_MENU(9554, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 6: //Shaman - player->SEND_POI(-3805.5, -11380.7, 6, 6, 0, "Exodar Shaman Trainer"); + player->SEND_POI(-3805.5, -11380.7, 7, 6, 0, "Exodar Shaman Trainer"); player->SEND_GOSSIP_MENU(9556, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 7: //Warrior - player->SEND_POI(-4189.43, -11653.7, 6, 6, 0, "Exodar Warrior Trainer"); + player->SEND_POI(-4189.43, -11653.7, 7, 6, 0, "Exodar Warrior Trainer"); player->SEND_GOSSIP_MENU(9562, _Creature->GetGUID()); break; } @@ -1539,55 +1539,55 @@ void SendProfTrainerMenu_guard_exodar(Player *player, Creature *_Creature, uint3 switch (action) { case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy - player->SEND_POI(-4040.6, -11364.5, 6, 6, 0, "Exodar Alchemy Trainer"); + player->SEND_POI(-4040.6, -11364.5, 7, 6, 0, "Exodar Alchemy Trainer"); player->SEND_GOSSIP_MENU(9527, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing - player->SEND_POI(-4229.5, -11706, 6, 6, 0, "Exodar Blacksmithing Trainer"); + player->SEND_POI(-4229.5, -11706, 7, 6, 0, "Exodar Blacksmithing Trainer"); player->SEND_GOSSIP_MENU(9532, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 3: //Cooking - player->SEND_POI(-3798.3, -11651.7, 6, 6, 0, "Exodar Cooking Trainer"); + player->SEND_POI(-3798.3, -11651.7, 7, 6, 0, "Exodar Cooking Trainer"); player->SEND_GOSSIP_MENU(9551, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting - player->SEND_POI(-3889.3, -11495, 6, 6, 0, "Exodar Enchanting Trainer"); + player->SEND_POI(-3889.3, -11495, 7, 6, 0, "Exodar Enchanting Trainer"); player->SEND_GOSSIP_MENU(9535, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 5: //Engineering - player->SEND_POI(-4257.68, -11640.3, 6, 6, 0, "Exodar Engineering Trainer"); + player->SEND_POI(-4257.68, -11640.3, 7, 6, 0, "Exodar Engineering Trainer"); player->SEND_GOSSIP_MENU(9536, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 6: //First Aid - player->SEND_POI(-3769.5, -11479.6, 6, 6, 0, "Exodar First Aid Trainer"); + player->SEND_POI(-3769.5, -11479.6, 7, 6, 0, "Exodar First Aid Trainer"); player->SEND_GOSSIP_MENU(9537, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 7: //Fishing - player->SEND_POI(-3725.5, -11385.2, 6, 6, 0, "Exodar Fishing Trainer"); + player->SEND_POI(-3725.5, -11385.2, 7, 6, 0, "Exodar Fishing Trainer"); player->SEND_GOSSIP_MENU(9538, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 8: //Jewelcrafting - player->SEND_POI(-3783, -11546, 6, 6, 0, "Exodar Jewelcrafting Trainer"); + player->SEND_POI(-3783, -11546, 7, 6, 0, "Exodar Jewelcrafting Trainer"); player->SEND_GOSSIP_MENU(9547, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 9: //Herbalism - player->SEND_POI(-4040.6, -11364.5, 6, 6, 0, "Exodar Herbalist Trainer"); + player->SEND_POI(-4040.6, -11364.5, 7, 6, 0, "Exodar Herbalist Trainer"); player->SEND_GOSSIP_MENU(9543, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 10: //Leatherworking - player->SEND_POI(-4140.6, -11776.7, 6, 6, 0, "Exodar Leatherworking Trainer"); + player->SEND_POI(-4140.6, -11776.7, 7, 6, 0, "Exodar Leatherworking Trainer"); player->SEND_GOSSIP_MENU(9549, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 11: //Mining - player->SEND_POI(-4228, -11697, 6, 6, 0, "Exodar Mining Trainer"); + player->SEND_POI(-4228, -11697, 7, 6, 0, "Exodar Mining Trainer"); player->SEND_GOSSIP_MENU(9552, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 12: //Skinning - player->SEND_POI(-4134.97, -11760.5, 6, 6, 0, "Exodar Skinning Trainer"); + player->SEND_POI(-4134.97, -11760.5, 7, 6, 0, "Exodar Skinning Trainer"); player->SEND_GOSSIP_MENU(9557, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 13: //Tailoring - player->SEND_POI(-4092.5, -11744.5, 6, 6, 0, "Exodar Tailor Trainer"); + player->SEND_POI(-4092.5, -11744.5, 7, 6, 0, "Exodar Tailor Trainer"); player->SEND_GOSSIP_MENU(9559, _Creature->GetGUID()); break; } @@ -1641,39 +1641,39 @@ void SendDefaultMenu_guard_ironforge(Player *player, Creature *_Creature, uint32 switch (action) { case GOSSIP_ACTION_INFO_DEF + 1: //Auction House - player->SEND_POI(-4957.39, -911.6, 6, 6, 0, "Ironforge Auction House"); + player->SEND_POI(-4957.39, -911.6, 7, 6, 0, "Ironforge Auction House"); player->SEND_GOSSIP_MENU(3014, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 2: //Bank - player->SEND_POI(-4891.91, -991.47, 6, 6, 0, "The Vault"); + player->SEND_POI(-4891.91, -991.47, 7, 6, 0, "The Vault"); player->SEND_GOSSIP_MENU(2761, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 3: //Tram - player->SEND_POI(-4835.27, -1294.69, 6, 6, 0, "Deeprun Tram"); + player->SEND_POI(-4835.27, -1294.69, 7, 6, 0, "Deeprun Tram"); player->SEND_GOSSIP_MENU(3814, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 4: //Gryphon Master - player->SEND_POI(-4821.52, -1152.3, 6, 6, 0, "Ironforge Gryphon Master"); + player->SEND_POI(-4821.52, -1152.3, 7, 6, 0, "Ironforge Gryphon Master"); player->SEND_GOSSIP_MENU(2762, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 5: //Guild Master - player->SEND_POI(-5021, -996.45, 6, 6, 0, "Ironforge Visitor's Center"); + player->SEND_POI(-5021, -996.45, 7, 6, 0, "Ironforge Visitor's Center"); player->SEND_GOSSIP_MENU(2764, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 6: //Inn - player->SEND_POI(-4850.47, -872.57, 6, 6, 0, "Stonefire Tavern"); + player->SEND_POI(-4850.47, -872.57, 7, 6, 0, "Stonefire Tavern"); player->SEND_GOSSIP_MENU(2768, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 7: //Mailbox - player->SEND_POI(-4845.7, -880.55, 6, 6, 0, "Ironforge Mailbox"); + player->SEND_POI(-4845.7, -880.55, 7, 6, 0, "Ironforge Mailbox"); player->SEND_GOSSIP_MENU(2769, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 8: //Stable Master - player->SEND_POI(-5010.2, -1262, 6, 6, 0, "Ulbrek Firehand"); + player->SEND_POI(-5010.2, -1262, 7, 6, 0, "Ulbrek Firehand"); player->SEND_GOSSIP_MENU(5986, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 9: //Weapons Trainer - player->SEND_POI(-5040, -1201.88, 6, 6, 0, "Bixi and Buliwyf"); + player->SEND_POI(-5040, -1201.88, 7, 6, 0, "Bixi and Buliwyf"); player->SEND_GOSSIP_MENU(4518, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 10: //Battlemaster @@ -1716,15 +1716,15 @@ void SendBattleMasterMenu_guard_ironforge(Player *player, Creature *_Creature, u switch (action) { case GOSSIP_ACTION_INFO_DEF + 1: //AV - player->SEND_POI(-5047.87, -1263.77, 6, 6, 0, "Glordrum Steelbeard"); + player->SEND_POI(-5047.87, -1263.77, 7, 6, 0, "Glordrum Steelbeard"); player->SEND_GOSSIP_MENU(7483, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 2: //AB - player->SEND_POI(-5038.37, -1266.39, 6, 6, 0, "Donal Osgood"); + player->SEND_POI(-5038.37, -1266.39, 7, 6, 0, "Donal Osgood"); player->SEND_GOSSIP_MENU(7649, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 3: //WSG - player->SEND_POI(-5037.24, -1274.82, 6, 6, 0, "Lylandris"); + player->SEND_POI(-5037.24, -1274.82, 7, 6, 0, "Lylandris"); player->SEND_GOSSIP_MENU(7528, _Creature->GetGUID()); break; } @@ -1735,35 +1735,35 @@ void SendClassTrainerMenu_guard_ironforge(Player *player, Creature *_Creature, u switch (action) { case GOSSIP_ACTION_INFO_DEF + 1: //Hunter - player->SEND_POI(-5023, -1253.68, 6, 6, 0, "Hall of Arms"); + player->SEND_POI(-5023, -1253.68, 7, 6, 0, "Hall of Arms"); player->SEND_GOSSIP_MENU(2770, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 2: //Mage - player->SEND_POI(-4627, -926.45, 6, 6, 0, "Hall of Mysteries"); + player->SEND_POI(-4627, -926.45, 7, 6, 0, "Hall of Mysteries"); player->SEND_GOSSIP_MENU(2771, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 3: //Paladin - player->SEND_POI(-4627.02, -926.45, 6, 6, 0, "Hall of Mysteries"); + player->SEND_POI(-4627.02, -926.45, 7, 6, 0, "Hall of Mysteries"); player->SEND_GOSSIP_MENU(2773, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 4: //Priest - player->SEND_POI(-4627, -926.45, 6, 6, 0, "Hall of Mysteries"); + player->SEND_POI(-4627, -926.45, 7, 6, 0, "Hall of Mysteries"); player->SEND_GOSSIP_MENU(2772, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 5: //Rogue - player->SEND_POI(-4647.83, -1124, 6, 6, 0, "Ironforge Rogue Trainer"); + player->SEND_POI(-4647.83, -1124, 7, 6, 0, "Ironforge Rogue Trainer"); player->SEND_GOSSIP_MENU(2774, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 6: //Warlock - player->SEND_POI(-4605, -1110.45, 6, 6, 0, "Ironforge Warlock Trainer"); + player->SEND_POI(-4605, -1110.45, 7, 6, 0, "Ironforge Warlock Trainer"); player->SEND_GOSSIP_MENU(2775, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 7: //Warrior - player->SEND_POI(-5023.08, -1253.68, 6, 6, 0, "Hall of Arms"); + player->SEND_POI(-5023.08, -1253.68, 7, 6, 0, "Hall of Arms"); player->SEND_GOSSIP_MENU(2776, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 8: //Shaman - player->SEND_POI(-4732, -1147, 6, 6, 0, "Ironforge Shaman Trainer"); + player->SEND_POI(-4732, -1147, 7, 6, 0, "Ironforge Shaman Trainer"); //incorrect id player->SEND_GOSSIP_MENU(2766, _Creature->GetGUID()); break; @@ -1775,51 +1775,51 @@ void SendProfTrainerMenu_guard_ironforge(Player *player, Creature *_Creature, ui switch (action) { case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy - player->SEND_POI(-4858.5, -1241.83, 6, 6, 0, "Berryfizz's Potions and Mixed Drinks"); + player->SEND_POI(-4858.5, -1241.83, 7, 6, 0, "Berryfizz's Potions and Mixed Drinks"); player->SEND_GOSSIP_MENU(2794, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing - player->SEND_POI(-4796.97, -1110.17, 6, 6, 0, "The Great Forge"); + player->SEND_POI(-4796.97, -1110.17, 7, 6, 0, "The Great Forge"); player->SEND_GOSSIP_MENU(2795, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 3: //Cooking - player->SEND_POI(-4767.83, -1184.59, 6, 6, 0, "The Bronze Kettle"); + player->SEND_POI(-4767.83, -1184.59, 7, 6, 0, "The Bronze Kettle"); player->SEND_GOSSIP_MENU(2796, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting - player->SEND_POI(-4803.72, -1196.53, 6, 6, 0, "Thistlefuzz Arcanery"); + player->SEND_POI(-4803.72, -1196.53, 7, 6, 0, "Thistlefuzz Arcanery"); player->SEND_GOSSIP_MENU(2797, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 5: //Engineering - player->SEND_POI(-4799.56, -1250.23, 6, 6, 0, "Springspindle's Gadgets"); + player->SEND_POI(-4799.56, -1250.23, 7, 6, 0, "Springspindle's Gadgets"); player->SEND_GOSSIP_MENU(2798, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 6: //First Aid - player->SEND_POI(-4881.6, -1153.13, 6, 6, 0, "Ironforge Physician"); + player->SEND_POI(-4881.6, -1153.13, 7, 6, 0, "Ironforge Physician"); player->SEND_GOSSIP_MENU(2799, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 7: //Fishing - player->SEND_POI(-4597.91, -1091.93, 6, 6, 0, "Traveling Fisherman"); + player->SEND_POI(-4597.91, -1091.93, 7, 6, 0, "Traveling Fisherman"); player->SEND_GOSSIP_MENU(2800, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 8: //Herbalism - player->SEND_POI(-4876.9, -1151.92, 6, 6, 0, "Ironforge Physician"); + player->SEND_POI(-4876.9, -1151.92, 7, 6, 0, "Ironforge Physician"); player->SEND_GOSSIP_MENU(2801, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 9: //Leatherworking - player->SEND_POI(-4745, -1027.57, 6, 6, 0, "Finespindle's Leather Goods"); + player->SEND_POI(-4745, -1027.57, 7, 6, 0, "Finespindle's Leather Goods"); player->SEND_GOSSIP_MENU(2802, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 10: //Minning - player->SEND_POI(-4705.06, -1116.43, 6, 6, 0, "Deepmountain Mining Guild"); + player->SEND_POI(-4705.06, -1116.43, 7, 6, 0, "Deepmountain Mining Guild"); player->SEND_GOSSIP_MENU(2804, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 11: //Skinning - player->SEND_POI(-4745, -1027.57, 6, 6, 0, "Finespindle's Leather Goods"); + player->SEND_POI(-4745, -1027.57, 7, 6, 0, "Finespindle's Leather Goods"); player->SEND_GOSSIP_MENU(2805, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 12: //Tailoring - player->SEND_POI(-4719.60, -1056.96, 6, 6, 0, "Stonebrow's Clothier"); + player->SEND_POI(-4719.60, -1056.96, 7, 6, 0, "Stonebrow's Clothier"); player->SEND_GOSSIP_MENU(2807, _Creature->GetGUID()); break; } @@ -1873,11 +1873,11 @@ void SendDefaultMenu_guard_mulgore(Player *player, Creature *_Creature, uint32 a player->SEND_GOSSIP_MENU(4052,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 3: //Inn - player->SEND_POI(-2361.38, -349.19, 6, 6, 0, "Bloodhoof Village Inn"); + player->SEND_POI(-2361.38, -349.19, 7, 6, 0, "Bloodhoof Village Inn"); player->SEND_GOSSIP_MENU(4053,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 4: //Stable master - player->SEND_POI(-2338.86, -357.56, 6, 6, 0, "Seikwa"); + player->SEND_POI(-2338.86, -357.56, 7, 6, 0, "Seikwa"); player->SEND_GOSSIP_MENU(5976,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 5: //Class trainer @@ -1909,19 +1909,19 @@ void SendClassTrainerMenu_guard_mulgore(Player *player, Creature *_Creature, uin switch (action) { case GOSSIP_ACTION_INFO_DEF + 1: //Druid - player->SEND_POI(-2312.15, -443.69, 6, 6, 0, "Gennia Runetotem"); + player->SEND_POI(-2312.15, -443.69, 7, 6, 0, "Gennia Runetotem"); player->SEND_GOSSIP_MENU(4054,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 2: //Hunter - player->SEND_POI(-2178.14, -406.14, 6, 6, 0, "Yaw Sharpmane"); + player->SEND_POI(-2178.14, -406.14, 7, 6, 0, "Yaw Sharpmane"); player->SEND_GOSSIP_MENU(4055,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 3: //Shaman - player->SEND_POI(-2301.5, -439.87, 6, 6, 0, "Narm Skychaser"); + player->SEND_POI(-2301.5, -439.87, 7, 6, 0, "Narm Skychaser"); player->SEND_GOSSIP_MENU(4056,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 4: //Warrior - player->SEND_POI(-2345.43, -494.11, 6, 6, 0, "Krang Stonehoof"); + player->SEND_POI(-2345.43, -494.11, 7, 6, 0, "Krang Stonehoof"); player->SEND_GOSSIP_MENU(4057,_Creature->GetGUID()); break; } @@ -1938,32 +1938,32 @@ void SendProfTrainerMenu_guard_mulgore(Player *player, Creature *_Creature, uint player->SEND_GOSSIP_MENU(4059,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 3: //Cooking - player->SEND_POI(-2263.34, -287.91, 6, 6, 0, "Pyall Silentstride"); + player->SEND_POI(-2263.34, -287.91, 7, 6, 0, "Pyall Silentstride"); player->SEND_GOSSIP_MENU(4060,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting player->SEND_GOSSIP_MENU(4061,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 5: //First Aid - player->SEND_POI(-2353.52, -355.82, 6, 6, 0, "Vira Younghoof"); + player->SEND_POI(-2353.52, -355.82, 7, 6, 0, "Vira Younghoof"); player->SEND_GOSSIP_MENU(4062,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 6: //Fishing - player->SEND_POI(-2349.21, -241.37, 6, 6, 0, "Uthan Stillwater"); + player->SEND_POI(-2349.21, -241.37, 7, 6, 0, "Uthan Stillwater"); player->SEND_GOSSIP_MENU(4063,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 7: //Herbalism player->SEND_GOSSIP_MENU(4064,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 8: //Leatherworking - player->SEND_POI(-2257.12, -288.63, 6, 6, 0, "Chaw Stronghide"); + player->SEND_POI(-2257.12, -288.63, 7, 6, 0, "Chaw Stronghide"); player->SEND_GOSSIP_MENU(4065,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 9: //Mining player->SEND_GOSSIP_MENU(4066,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 10: //Skinning - player->SEND_POI(-2252.94, -291.32, 6, 6, 0, "Yonn Deepcut"); + player->SEND_POI(-2252.94, -291.32, 7, 6, 0, "Yonn Deepcut"); player->SEND_GOSSIP_MENU(4067,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 11: //Tailoring @@ -2021,43 +2021,43 @@ void SendDefaultMenu_guard_orgrimmar(Player *player, Creature *_Creature, uint32 switch (action) { case GOSSIP_ACTION_INFO_DEF + 1: //Bank - player->SEND_POI(1631.51, -4375.33, 6, 6, 0, "Bank of Orgrimmar"); + player->SEND_POI(1631.51, -4375.33, 7, 6, 0, "Bank of Orgrimmar"); player->SEND_GOSSIP_MENU(2554,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 2: //wind rider - player->SEND_POI(1676.6, -4332.72, 6, 6, 0, "The Sky Tower"); + player->SEND_POI(1676.6, -4332.72, 7, 6, 0, "The Sky Tower"); player->SEND_GOSSIP_MENU(2555,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 3: //guild master - player->SEND_POI(1576.93, -4294.75, 6, 6, 0, "Horde Embassy"); + player->SEND_POI(1576.93, -4294.75, 7, 6, 0, "Horde Embassy"); player->SEND_GOSSIP_MENU(2556,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 4: //Inn - player->SEND_POI(1644.51, -4447.27, 6, 6, 0, "Orgrimmar Inn"); + player->SEND_POI(1644.51, -4447.27, 7, 6, 0, "Orgrimmar Inn"); player->SEND_GOSSIP_MENU(2557,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 5: //mailbox - player->SEND_POI(1622.53, -4388.79, 6, 6, 0, "Orgrimmar Mailbox"); + player->SEND_POI(1622.53, -4388.79, 7, 6, 0, "Orgrimmar Mailbox"); player->SEND_GOSSIP_MENU(2558,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 6: //auction house - player->SEND_POI(1679.21, -4450.1, 6, 6, 0, "Orgrimmar Auction House"); + player->SEND_POI(1679.21, -4450.1, 7, 6, 0, "Orgrimmar Auction House"); player->SEND_GOSSIP_MENU(3075,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 7: //zeppelin - player->SEND_POI(1337.36, -4632.7, 6, 6, 0, "Orgrimmar Zeppelin Tower"); + player->SEND_POI(1337.36, -4632.7, 7, 6, 0, "Orgrimmar Zeppelin Tower"); player->SEND_GOSSIP_MENU(3173,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 8: //weapon master - player->SEND_POI(2092.56, -4823.95, 6, 6, 0, "Sayoc & Hanashi"); + player->SEND_POI(2092.56, -4823.95, 7, 6, 0, "Sayoc & Hanashi"); player->SEND_GOSSIP_MENU(4519,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 9: //stable master - player->SEND_POI(2133.12, -4663.93, 6, 6, 0, "Xon'cha"); + player->SEND_POI(2133.12, -4663.93, 7, 6, 0, "Xon'cha"); player->SEND_GOSSIP_MENU(5974,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 10: //officers lounge - player->SEND_POI(1633.56, -4249.37, 6, 6, 0, "Hall of Legends"); + player->SEND_POI(1633.56, -4249.37, 7, 6, 0, "Hall of Legends"); player->SEND_GOSSIP_MENU(7046,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 11: //battlemaster @@ -2100,15 +2100,15 @@ void SendBattleMasterMenu_guard_orgrimmar(Player *player, Creature *_Creature, u switch (action) { case GOSSIP_ACTION_INFO_DEF + 1: //AV - player->SEND_POI(1983.92, -4794.2, 6, 6, 0, "Hall of the Brave"); + player->SEND_POI(1983.92, -4794.2, 7, 6, 0, "Hall of the Brave"); player->SEND_GOSSIP_MENU(7484,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 2: //AB - player->SEND_POI(1983.92, -4794.2, 6, 6, 0, "Hall of the Brave"); + player->SEND_POI(1983.92, -4794.2, 7, 6, 0, "Hall of the Brave"); player->SEND_GOSSIP_MENU(7644,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 3: //WSG - player->SEND_POI(1983.92, -4794.2, 6, 6, 0, "Hall of the Brave"); + player->SEND_POI(1983.92, -4794.2, 7, 6, 0, "Hall of the Brave"); player->SEND_GOSSIP_MENU(7520,_Creature->GetGUID()); break; } @@ -2119,35 +2119,35 @@ void SendClassTrainerMenu_guard_orgrimmar(Player *player, Creature *_Creature, u switch (action) { case GOSSIP_ACTION_INFO_DEF + 1: //Hunter - player->SEND_POI(2114.84, -4625.31, 6, 6, 0, "Orgrimmar Hunter's Hall"); + player->SEND_POI(2114.84, -4625.31, 7, 6, 0, "Orgrimmar Hunter's Hall"); player->SEND_GOSSIP_MENU(2559,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 2: //Mage - player->SEND_POI(1451.26, -4223.33, 6, 6, 0, "Darkbriar Lodge"); + player->SEND_POI(1451.26, -4223.33, 7, 6, 0, "Darkbriar Lodge"); player->SEND_GOSSIP_MENU(2560,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 3: //Priest - player->SEND_POI(1442.21, -4183.24, 6, 6, 0, "Spirit Lodge"); + player->SEND_POI(1442.21, -4183.24, 7, 6, 0, "Spirit Lodge"); player->SEND_GOSSIP_MENU(2561,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 4: //Shaman - player->SEND_POI(1925.34, -4181.89, 6, 6, 0, "Thrall's Fortress"); + player->SEND_POI(1925.34, -4181.89, 7, 6, 0, "Thrall's Fortress"); player->SEND_GOSSIP_MENU(2562,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 5: //Rogue - player->SEND_POI(1773.39, -4278.97, 6, 6, 0, "Shadowswift Brotherhood"); + player->SEND_POI(1773.39, -4278.97, 7, 6, 0, "Shadowswift Brotherhood"); player->SEND_GOSSIP_MENU(2563,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 6: //Warlock - player->SEND_POI(1849.57, -4359.68, 6, 6, 0, "Darkfire Enclave"); + player->SEND_POI(1849.57, -4359.68, 7, 6, 0, "Darkfire Enclave"); player->SEND_GOSSIP_MENU(2564,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 7: //Warrior - player->SEND_POI(1983.92, -4794.2, 6, 6, 0, "Hall of the Brave"); + player->SEND_POI(1983.92, -4794.2, 7, 6, 0, "Hall of the Brave"); player->SEND_GOSSIP_MENU(2565,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 8: //Paladin - player->SEND_POI(1906.65, -4134.26, 6, 6, 0, "Valley of Wisdom"); + player->SEND_POI(1906.65, -4134.26, 7, 6, 0, "Valley of Wisdom"); player->SEND_GOSSIP_MENU(10843,_Creature->GetGUID()); break; } @@ -2158,51 +2158,51 @@ void SendProfTrainerMenu_guard_orgrimmar(Player *player, Creature *_Creature, ui switch (action) { case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy - player->SEND_POI(1955.17, -4475.79, 6, 6, 0, "Yelmak's Alchemy and Potions"); + player->SEND_POI(1955.17, -4475.79, 7, 6, 0, "Yelmak's Alchemy and Potions"); player->SEND_GOSSIP_MENU(2497,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing - player->SEND_POI(2054.34, -4831.85, 6, 6, 0, "The Burning Anvil"); + player->SEND_POI(2054.34, -4831.85, 7, 6, 0, "The Burning Anvil"); player->SEND_GOSSIP_MENU(2499,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 3: //Cooking - player->SEND_POI(1780.96, -4481.31, 6, 6, 0, "Borstan's Firepit"); + player->SEND_POI(1780.96, -4481.31, 7, 6, 0, "Borstan's Firepit"); player->SEND_GOSSIP_MENU(2500,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting - player->SEND_POI(1917.5, -4434.95, 6, 6, 0, "Godan's Runeworks"); + player->SEND_POI(1917.5, -4434.95, 7, 6, 0, "Godan's Runeworks"); player->SEND_GOSSIP_MENU(2501,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 5: //Engineering - player->SEND_POI(2038.45, -4744.75, 6, 6, 0, "Nogg's Machine Shop"); + player->SEND_POI(2038.45, -4744.75, 7, 6, 0, "Nogg's Machine Shop"); player->SEND_GOSSIP_MENU(2653,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 6: //First Aid - player->SEND_POI(1485.21, -4160.91, 6, 6, 0, "Survival of the Fittest"); + player->SEND_POI(1485.21, -4160.91, 7, 6, 0, "Survival of the Fittest"); player->SEND_GOSSIP_MENU(2502,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 7: //Fishing - player->SEND_POI(1994.15, -4655.7, 6, 6, 0, "Lumak's Fishing"); + player->SEND_POI(1994.15, -4655.7, 7, 6, 0, "Lumak's Fishing"); player->SEND_GOSSIP_MENU(2503,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 8: //Herbalism - player->SEND_POI(1898.61, -4454.93, 6, 6, 0, "Jandi's Arboretum"); + player->SEND_POI(1898.61, -4454.93, 7, 6, 0, "Jandi's Arboretum"); player->SEND_GOSSIP_MENU(2504,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 9: //Leatherworking - player->SEND_POI(1852.82, -4562.31, 6, 6, 0, "Kodohide Leatherworkers"); + player->SEND_POI(1852.82, -4562.31, 7, 6, 0, "Kodohide Leatherworkers"); player->SEND_GOSSIP_MENU(2513,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 10: //Mining - player->SEND_POI(2029.79, -4704, 6, 6, 0, "Red Canyon Mining"); + player->SEND_POI(2029.79, -4704, 7, 6, 0, "Red Canyon Mining"); player->SEND_GOSSIP_MENU(2515,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 11: //Skinning - player->SEND_POI(1852.82, -4562.31, 6, 6, 0, "Kodohide Leatherworkers"); + player->SEND_POI(1852.82, -4562.31, 7, 6, 0, "Kodohide Leatherworkers"); player->SEND_GOSSIP_MENU(2516,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 12: //Tailoring - player->SEND_POI(1802.66, -4560.66, 6, 6, 0, "Magar's Cloth Goods"); + player->SEND_POI(1802.66, -4560.66, 7, 6, 0, "Magar's Cloth Goods"); player->SEND_GOSSIP_MENU(2518,_Creature->GetGUID()); break; } @@ -2263,7 +2263,7 @@ void SendDefaultMenu_guard_shattrath(Player *player, Creature *_Creature, uint32 switch (action) { case GOSSIP_ACTION_INFO_DEF + 1: //Tavern - player->SEND_POI(-1759.5, 5165, 6, 6, 0, "Worlds End Tavern"); + player->SEND_POI(-1759.5, 5165, 7, 6, 0, "Worlds End Tavern"); player->SEND_GOSSIP_MENU(10394, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 2: //Bank @@ -2277,7 +2277,7 @@ void SendDefaultMenu_guard_shattrath(Player *player, Creature *_Creature, uint32 player->SEND_GOSSIP_MENU(10382, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 4: //Flight master - player->SEND_POI(-1832, 5299, 6, 6, 0, "Flight Master"); + player->SEND_POI(-1832, 5299, 7, 6, 0, "Flight Master"); player->SEND_GOSSIP_MENU(10385, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 5: //Mailbox @@ -2310,11 +2310,11 @@ void SendDefaultMenu_guard_shattrath(Player *player, Creature *_Creature, uint32 player->SEND_GOSSIP_MENU(10391, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 9: //Mana Loom - player->SEND_POI(-2070, 5265.5, 6, 6, 0, "Mana Loom"); + player->SEND_POI(-2070, 5265.5, 7, 6, 0, "Mana Loom"); player->SEND_GOSSIP_MENU(10503, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 10: //Alchemy Lab - player->SEND_POI(-1648.5, 5540, 6, 6, 0, "Alchemy Lab"); + player->SEND_POI(-1648.5, 5540, 7, 6, 0, "Alchemy Lab"); player->SEND_GOSSIP_MENU(10321, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 11: //Gem Merchant @@ -2329,12 +2329,12 @@ void SendBankMenu_guard_shattrath(Player *player, Creature *_Creature, uint32 ac { if (action == GOSSIP_ACTION_INFO_DEF + 1) { - player->SEND_POI(-1730.5, 5496, 6, 6, 0, "Aldor Bank"); + player->SEND_POI(-1730.5, 5496, 7, 6, 0, "Aldor Bank"); player->SEND_GOSSIP_MENU(10380, _Creature->GetGUID()); } if (action == GOSSIP_ACTION_INFO_DEF + 2) { - player->SEND_POI(-1997.7, 5363, 6, 6, 0, "Scyers Bank"); + player->SEND_POI(-1997.7, 5363, 7, 6, 0, "Scyers Bank"); player->SEND_GOSSIP_MENU(10381, _Creature->GetGUID()); } } @@ -2343,12 +2343,12 @@ void SendInnMenu_guard_shattrath(Player *player, Creature *_Creature, uint32 act { if (action == GOSSIP_ACTION_INFO_DEF + 1) { - player->SEND_POI(-1895, 5767, 6, 6, 0, "Aldor Inn"); + player->SEND_POI(-1895, 5767, 7, 6, 0, "Aldor Inn"); player->SEND_GOSSIP_MENU(10383, _Creature->GetGUID()); } if (action == GOSSIP_ACTION_INFO_DEF + 2) { - player->SEND_POI(-2178, 5405, 6, 6, 0, "Scyers Inn"); + player->SEND_POI(-2178, 5405, 7, 6, 0, "Scyers Inn"); player->SEND_GOSSIP_MENU(10384, _Creature->GetGUID()); } } @@ -2358,19 +2358,19 @@ void SendMailboxMenu_guard_shattrath(Player *player, Creature *_Creature, uint32 switch (action) { case GOSSIP_ACTION_INFO_DEF + 1: - player->SEND_POI(-1730.5, 5496, 6, 6, 0, "Aldor Bank"); + player->SEND_POI(-1730.5, 5496, 7, 6, 0, "Aldor Bank"); player->SEND_GOSSIP_MENU(10380, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 2: - player->SEND_POI(-1895, 5767, 6, 6, 0, "Aldor Inn"); + player->SEND_POI(-1895, 5767, 7, 6, 0, "Aldor Inn"); player->SEND_GOSSIP_MENU(10383, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 3: - player->SEND_POI(-1997.7, 5363, 6, 6, 0, "Scyers Bank"); + player->SEND_POI(-1997.7, 5363, 7, 6, 0, "Scyers Bank"); player->SEND_GOSSIP_MENU(10381, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 4: - player->SEND_POI(-2178, 5405, 6, 6, 0, "Scyers Inn"); + player->SEND_POI(-2178, 5405, 7, 6, 0, "Scyers Inn"); player->SEND_GOSSIP_MENU(10384, _Creature->GetGUID()); break; } @@ -2380,12 +2380,12 @@ void SendStableMasterMenu_guard_shattrath(Player *player, Creature *_Creature, u { if (action == GOSSIP_ACTION_INFO_DEF + 1) { - player->SEND_POI(-1888.5, 5761, 6, 6, 0, "Aldor Stable"); + player->SEND_POI(-1888.5, 5761, 7, 6, 0, "Aldor Stable"); player->SEND_GOSSIP_MENU(10321, _Creature->GetGUID()); } if (action == GOSSIP_ACTION_INFO_DEF + 2) { - player->SEND_POI(-2170, 5404, 6, 6, 0, "Scyers Stable"); + player->SEND_POI(-2170, 5404, 7, 6, 0, "Scyers Stable"); player->SEND_GOSSIP_MENU(10321, _Creature->GetGUID()); } } @@ -2395,15 +2395,15 @@ void SendBattleMasterMenu_guard_shattrath(Player *player, Creature *_Creature, u switch (action) { case GOSSIP_ACTION_INFO_DEF + 1: - player->SEND_POI(-1774, 5251, 6, 6, 0, "Alliance Battlemasters"); + player->SEND_POI(-1774, 5251, 7, 6, 0, "Alliance Battlemasters"); player->SEND_GOSSIP_MENU(10389, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 2: - player->SEND_POI(-1963, 5263, 6, 6, 0, "Horde Battlemasters"); + player->SEND_POI(-1963, 5263, 7, 6, 0, "Horde Battlemasters"); player->SEND_GOSSIP_MENU(10390, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 3: - player->SEND_POI(-1960, 5175, 6, 6, 0, "Arena Battlemasters"); + player->SEND_POI(-1960, 5175, 7, 6, 0, "Arena Battlemasters"); player->SEND_GOSSIP_MENU(12510, _Creature->GetGUID()); break; } @@ -2414,35 +2414,35 @@ void SendProfTrainerMenu_guard_shattrath(Player *player, Creature *_Creature, ui switch (action) { case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy - player->SEND_POI(-1648.5, 5534, 6, 6, 0, "Lorokeem"); + player->SEND_POI(-1648.5, 5534, 7, 6, 0, "Lorokeem"); player->SEND_GOSSIP_MENU(10392, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing - player->SEND_POI(-1847, 5222, 6, 6, 0, "Kradu Grimblade and Zula Slagfury"); + player->SEND_POI(-1847, 5222, 7, 6, 0, "Kradu Grimblade and Zula Slagfury"); player->SEND_GOSSIP_MENU(10400, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 3: //Cooking - player->SEND_POI(-2067.4, 5316.5, 6, 6, 0, "Jack Trapper"); + player->SEND_POI(-2067.4, 5316.5, 7, 6, 0, "Jack Trapper"); player->SEND_GOSSIP_MENU(10393, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting - player->SEND_POI(-2263.5, 5563.5, 6, 6, 0, "High Enchanter Bardolan"); + player->SEND_POI(-2263.5, 5563.5, 7, 6, 0, "High Enchanter Bardolan"); player->SEND_GOSSIP_MENU(10395, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 5: //First Aid - player->SEND_POI(-1591, 5265.5, 6, 6, 0, "Mildred Fletcher"); + player->SEND_POI(-1591, 5265.5, 7, 6, 0, "Mildred Fletcher"); player->SEND_GOSSIP_MENU(10396, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 6: //Jewelcrafting - player->SEND_POI(-1654, 5667.5, 6, 6, 0, "Hamanar"); + player->SEND_POI(-1654, 5667.5, 7, 6, 0, "Hamanar"); player->SEND_GOSSIP_MENU(10397, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 7: //Leatherworking - player->SEND_POI(-2060.5, 5256.5, 6, 6, 0, "Darmari"); + player->SEND_POI(-2060.5, 5256.5, 7, 6, 0, "Darmari"); player->SEND_GOSSIP_MENU(10399, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 8: //Skinning - player->SEND_POI(-2048, 5300, 6, 6, 0, "Seymour"); + player->SEND_POI(-2048, 5300, 7, 6, 0, "Seymour"); player->SEND_GOSSIP_MENU(10398, _Creature->GetGUID()); break; } @@ -2452,12 +2452,12 @@ void SendGemMerchantMenu_guard_shattrath(Player *player, Creature *_Creature, ui { if (action == GOSSIP_ACTION_INFO_DEF + 1) { - player->SEND_POI(-1645, 5669.5, 6, 6, 0, "Aldor Gem Merchant"); + player->SEND_POI(-1645, 5669.5, 7, 6, 0, "Aldor Gem Merchant"); player->SEND_GOSSIP_MENU(10698, _Creature->GetGUID()); } if (action == GOSSIP_ACTION_INFO_DEF + 2) { - player->SEND_POI(-2193, 5424.5, 6, 6, 0, "Scyers Gem Merchant"); + player->SEND_POI(-2193, 5424.5, 7, 6, 0, "Scyers Gem Merchant"); player->SEND_GOSSIP_MENU(10699, _Creature->GetGUID()); } } @@ -2513,7 +2513,7 @@ struct TRINITY_DLL_DECL guard_shattrath_aldorAI : public guardAI CanTeleport = false; } - void Aggro(Unit *who) {} + void EnterCombat(Unit *who) {} void UpdateAI(const uint32 diff) { @@ -2573,28 +2573,28 @@ void SendDefaultMenu_guard_shattrath_aldor(Player *player, Creature *_Creature, switch (action) { case GOSSIP_ACTION_INFO_DEF + 1: //Tavern - player->SEND_POI(-1759.5, 5165, 6, 6, 0, "Worlds End Tavern"); + player->SEND_POI(-1759.5, 5165, 7, 6, 0, "Worlds End Tavern"); player->SEND_GOSSIP_MENU(10394, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 2: //Bank - player->SEND_POI(-1730.5, 5496, 6, 6, 0, "Aldor Bank"); + player->SEND_POI(-1730.5, 5496, 7, 6, 0, "Aldor Bank"); player->SEND_GOSSIP_MENU(10380, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 3: //Inn - player->SEND_POI(-1895, 5767, 6, 6, 0, "Aldor Inn"); + player->SEND_POI(-1895, 5767, 7, 6, 0, "Aldor Inn"); player->SEND_GOSSIP_MENU(10525, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 4: //Flight master - player->SEND_POI(-1832, 5299, 6, 6, 0, "Shattrath Flight Master"); + player->SEND_POI(-1832, 5299, 7, 6, 0, "Shattrath Flight Master"); player->SEND_GOSSIP_MENU(10402, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 5: //Mailbox - player->SEND_POI(0, 0, 6, 6, 0, "Aldor Mailbox"); + player->SEND_POI(0, 0, 7, 6, 0, "Aldor Mailbox"); //unknown player->SEND_GOSSIP_MENU(10524, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 6: //Stable master - player->SEND_POI(-1888.5, 5761, 6, 6, 0, "Aldor Stable Master"); + player->SEND_POI(-1888.5, 5761, 7, 6, 0, "Aldor Stable Master"); player->SEND_GOSSIP_MENU(10527, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 7: //Battlemaster @@ -2615,15 +2615,15 @@ void SendDefaultMenu_guard_shattrath_aldor(Player *player, Creature *_Creature, player->SEND_GOSSIP_MENU(10391, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 9: //Mana Loom - player->SEND_POI(-2070, 5265.5, 6, 6, 0, "Mana Loom"); + player->SEND_POI(-2070, 5265.5, 7, 6, 0, "Mana Loom"); player->SEND_GOSSIP_MENU(10522, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 10: //Alchemy Lab - player->SEND_POI(-1648.5, 5540, 6, 6, 0, "Alchemy Lab"); + player->SEND_POI(-1648.5, 5540, 7, 6, 0, "Alchemy Lab"); player->SEND_GOSSIP_MENU(10696, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 11: //Gem Merchant - player->SEND_POI(-1645, 5669.5, 6, 6, 0, "Aldor Gem Merchant"); + player->SEND_POI(-1645, 5669.5, 7, 6, 0, "Aldor Gem Merchant"); player->SEND_GOSSIP_MENU(10411, _Creature->GetGUID()); break; } @@ -2634,35 +2634,35 @@ void SendProfTrainerMenu_guard_shattrath_aldor(Player *player, Creature *_Creatu switch (action) { case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy - player->SEND_POI(-1648.5, 5534, 6, 6, 0, "Lorokeem"); + player->SEND_POI(-1648.5, 5534, 7, 6, 0, "Lorokeem"); player->SEND_GOSSIP_MENU(10392, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing - player->SEND_POI(-1847, 5222, 6, 6, 0, "Kradu Grimblade and Zula Slagfury"); + player->SEND_POI(-1847, 5222, 7, 6, 0, "Kradu Grimblade and Zula Slagfury"); player->SEND_GOSSIP_MENU(10400, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 3: //Cooking - player->SEND_POI(-2067.4, 5316.5, 6, 6, 0, "Jack Trapper"); + player->SEND_POI(-2067.4, 5316.5, 7, 6, 0, "Jack Trapper"); player->SEND_GOSSIP_MENU(10393, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting - player->SEND_POI(-2263.5, 5563.5, 6, 6, 0, "High Enchanter Bardolan"); + player->SEND_POI(-2263.5, 5563.5, 7, 6, 0, "High Enchanter Bardolan"); player->SEND_GOSSIP_MENU(10528, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 5: //First Aid - player->SEND_POI(-1591, 5265.5, 6, 6, 0, "Mildred Fletcher"); + player->SEND_POI(-1591, 5265.5, 7, 6, 0, "Mildred Fletcher"); player->SEND_GOSSIP_MENU(10396, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 6: //Jewelcrafting - player->SEND_POI(-1654, 5667.5, 6, 6, 0, "Hamanar"); + player->SEND_POI(-1654, 5667.5, 7, 6, 0, "Hamanar"); player->SEND_GOSSIP_MENU(10529, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 7: //Leatherworking - player->SEND_POI(-2060.5, 5256.5, 6, 6, 0, "Darmari"); + player->SEND_POI(-2060.5, 5256.5, 7, 6, 0, "Darmari"); player->SEND_GOSSIP_MENU(10399, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 8: //Skinning - player->SEND_POI(-2048, 5300, 6, 6, 0, "Seymour"); + player->SEND_POI(-2048, 5300, 7, 6, 0, "Seymour"); player->SEND_GOSSIP_MENU(10419, _Creature->GetGUID()); break; } @@ -2709,7 +2709,7 @@ struct TRINITY_DLL_DECL guard_shattrath_scryerAI : public guardAI CanTeleport = false; } - void Aggro(Unit *who) {} + void EnterCombat(Unit *who) {} void UpdateAI(const uint32 diff) { @@ -2769,27 +2769,27 @@ void SendDefaultMenu_guard_shattrath_scryer(Player *player, Creature *_Creature, switch (action) { case GOSSIP_ACTION_INFO_DEF + 1: //Tavern - player->SEND_POI(-1759.5, 5165, 6, 6, 0, "Worlds End Tavern"); + player->SEND_POI(-1759.5, 5165, 7, 6, 0, "Worlds End Tavern"); player->SEND_GOSSIP_MENU(10431, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 2: //Bank - player->SEND_POI(-1996.6, 5363.7, 6, 6, 0, "Scryer Bank"); + player->SEND_POI(-1996.6, 5363.7, 7, 6, 0, "Scryer Bank"); player->SEND_GOSSIP_MENU(10432, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 3: //Inn - player->SEND_POI(-2176.6, 5405.8, 6, 6, 0, "Scryer Inn"); + player->SEND_POI(-2176.6, 5405.8, 7, 6, 0, "Scryer Inn"); player->SEND_GOSSIP_MENU(10433, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 4: //Flight master - player->SEND_POI(-1832, 5299, 6, 6, 0, "Shattrath Flight Master"); + player->SEND_POI(-1832, 5299, 7, 6, 0, "Shattrath Flight Master"); player->SEND_GOSSIP_MENU(10435, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 5: //Mailbox - player->SEND_POI(-2174.3, 5411.4, 6, 6, 0, "Scryer Mailbox"); + player->SEND_POI(-2174.3, 5411.4, 7, 6, 0, "Scryer Mailbox"); player->SEND_GOSSIP_MENU(10436, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 6: //Stable master - player->SEND_POI(-2169.9, 5405.1, 6, 6, 0, "Scryer Stable Master"); + player->SEND_POI(-2169.9, 5405.1, 7, 6, 0, "Scryer Stable Master"); player->SEND_GOSSIP_MENU(10437, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 7: //Battlemaster @@ -2810,15 +2810,15 @@ void SendDefaultMenu_guard_shattrath_scryer(Player *player, Creature *_Creature, player->SEND_GOSSIP_MENU(10504, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 9: //Mana Loom - player->SEND_POI(-2070, 5265.5, 6, 6, 0, "Mana Loom"); + player->SEND_POI(-2070, 5265.5, 7, 6, 0, "Mana Loom"); player->SEND_GOSSIP_MENU(10522, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 10: //Alchemy Lab - player->SEND_POI(-1648.5, 5540, 6, 6, 0, "Alchemy Lab"); + player->SEND_POI(-1648.5, 5540, 7, 6, 0, "Alchemy Lab"); player->SEND_GOSSIP_MENU(10701, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 11: //Gem Merchant - player->SEND_POI(-1645, 5669.5, 6, 6, 0, "Scryer Gem Merchant"); + player->SEND_POI(-1645, 5669.5, 7, 6, 0, "Scryer Gem Merchant"); player->SEND_GOSSIP_MENU(10702, _Creature->GetGUID()); break; } @@ -2829,35 +2829,35 @@ void SendProfTrainerMenu_guard_shattrath_scryer(Player *player, Creature *_Creat switch (action) { case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy - player->SEND_POI(-1648.5, 5534, 6, 6, 0, "Lorokeem"); + player->SEND_POI(-1648.5, 5534, 7, 6, 0, "Lorokeem"); player->SEND_GOSSIP_MENU(10516, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing - player->SEND_POI(-1847, 5222, 6, 6, 0, "Kradu Grimblade and Zula Slagfury"); + player->SEND_POI(-1847, 5222, 7, 6, 0, "Kradu Grimblade and Zula Slagfury"); player->SEND_GOSSIP_MENU(10517, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 3: //Cooking - player->SEND_POI(-2067.4, 5316.5, 6, 6, 0, "Jack Trapper"); + player->SEND_POI(-2067.4, 5316.5, 7, 6, 0, "Jack Trapper"); player->SEND_GOSSIP_MENU(10518, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting - player->SEND_POI(-2263.5, 5563.5, 6, 6, 0, "High Enchanter Bardolan"); + player->SEND_POI(-2263.5, 5563.5, 7, 6, 0, "High Enchanter Bardolan"); player->SEND_GOSSIP_MENU(10519, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 5: //First Aid - player->SEND_POI(-1591, 5265.5, 6, 6, 0, "Mildred Fletcher"); + player->SEND_POI(-1591, 5265.5, 7, 6, 0, "Mildred Fletcher"); player->SEND_GOSSIP_MENU(10520, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 6: //Jewelcrafting - player->SEND_POI(-1654, 5667.5, 6, 6, 0, "Hamanar"); + player->SEND_POI(-1654, 5667.5, 7, 6, 0, "Hamanar"); player->SEND_GOSSIP_MENU(10521, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 7: //Leatherworking - player->SEND_POI(-2060.5, 5256.5, 6, 6, 0, "Darmari"); + player->SEND_POI(-2060.5, 5256.5, 7, 6, 0, "Darmari"); player->SEND_GOSSIP_MENU(10523, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 8: //Skinning - player->SEND_POI(-2048, 5300, 6, 6, 0, "Seymour"); + player->SEND_POI(-2048, 5300, 7, 6, 0, "Seymour"); player->SEND_GOSSIP_MENU(10523, _Creature->GetGUID()); break; } @@ -2914,11 +2914,11 @@ void SendDefaultMenu_guard_silvermoon(Player *player, Creature *_Creature, uint3 player->SEND_GOSSIP_MENU(9317, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 2: //Bank - player->SEND_POI(9808.4, -7488.16, 6, 6, 0, "Silvermoon Bank"); + player->SEND_POI(9808.4, -7488.16, 7, 6, 0, "Silvermoon Bank"); player->SEND_GOSSIP_MENU(9322, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 3: //Guild master - player->SEND_POI(9474.97, -7345.21, 6, 6, 0, "Tandrine"); + player->SEND_POI(9474.97, -7345.21, 7, 6, 0, "Tandrine"); player->SEND_GOSSIP_MENU(9324, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 4: //Inn @@ -2927,19 +2927,19 @@ void SendDefaultMenu_guard_silvermoon(Player *player, Creature *_Creature, uint3 player->SEND_GOSSIP_MENU(9602, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 5: //Mailbox - player->SEND_POI(9658.33, -7492.17, 6, 6, 0, "Silvermoon Mailbox"); + player->SEND_POI(9658.33, -7492.17, 7, 6, 0, "Silvermoon Mailbox"); player->SEND_GOSSIP_MENU(9326, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 6: //Stable master - player->SEND_POI(9904.95, -7404.31, 6, 6, 0, "Shalenn"); + player->SEND_POI(9904.95, -7404.31, 7, 6, 0, "Shalenn"); player->SEND_GOSSIP_MENU(9327, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 7: //Weapon trainer - player->SEND_POI(9841.17, -7505.13, 6, 6, 0, "Ileda"); + player->SEND_POI(9841.17, -7505.13, 7, 6, 0, "Ileda"); player->SEND_GOSSIP_MENU(9328, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 8: //Wind master - player->SEND_POI(9378.45, -7163.94, 6, 6, 0, "Silvermoon Wind Master"); + player->SEND_POI(9378.45, -7163.94, 7, 6, 0, "Silvermoon Wind Master"); player->SEND_GOSSIP_MENU(10181, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 9: //Battlemaster @@ -2983,12 +2983,12 @@ void SendAuctionhouseMenu_guard_silvermoon(Player *player, Creature *_Creature, { if (action == GOSSIP_ACTION_INFO_DEF + 1) { - player->SEND_POI(9644.47, -7140.22, 6, 6, 0, "Western Auction House"); + player->SEND_POI(9644.47, -7140.22, 7, 6, 0, "Western Auction House"); player->SEND_GOSSIP_MENU(9318, _Creature->GetGUID()); } if (action == GOSSIP_ACTION_INFO_DEF + 2) { - player->SEND_POI(9683.27, -7521.22, 6, 6, 0, "Royal Exchange Auction House"); + player->SEND_POI(9683.27, -7521.22, 7, 6, 0, "Royal Exchange Auction House"); player->SEND_GOSSIP_MENU(9319, _Creature->GetGUID()); } } @@ -2997,12 +2997,12 @@ void SendInnMenu_guard_silvermoon(Player *player, Creature *_Creature, uint32 ac { if (action == GOSSIP_ACTION_INFO_DEF + 1) { - player->SEND_POI(9677.7, -7368, 6, 6, 0, "Silvermoon City Inn"); + player->SEND_POI(9677.7, -7368, 7, 6, 0, "Silvermoon City Inn"); player->SEND_GOSSIP_MENU(9325, _Creature->GetGUID()); } if (action == GOSSIP_ACTION_INFO_DEF + 2) { - player->SEND_POI(9561.1, -7517.5, 6, 6, 0, "Wayfarer's Rest tavern"); + player->SEND_POI(9561.1, -7517.5, 7, 6, 0, "Wayfarer's Rest tavern"); player->SEND_GOSSIP_MENU(9603, _Creature->GetGUID()); } } @@ -3012,23 +3012,23 @@ void SendBattleMasterMenu_guard_silvermoon(Player *player, Creature *_Creature, switch (action) { case GOSSIP_ACTION_INFO_DEF + 1: //AV - player->SEND_POI(9850.49, -7572.26, 6, 6, 0, "Gurak"); + player->SEND_POI(9850.49, -7572.26, 7, 6, 0, "Gurak"); player->SEND_GOSSIP_MENU(9329, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 2: //AB - player->SEND_POI(9857.18, -7564.36, 6, 6, 0, "Karen Wentworth"); + player->SEND_POI(9857.18, -7564.36, 7, 6, 0, "Karen Wentworth"); player->SEND_GOSSIP_MENU(9329, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 3: //A - player->SEND_POI(9850.6, -7559.25, 6, 6, 0, "Bipp Glizzitor"); + player->SEND_POI(9850.6, -7559.25, 7, 6, 0, "Bipp Glizzitor"); player->SEND_GOSSIP_MENU(9329, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 4: //EOS - player->SEND_POI(9857.18, -7564.36, 6, 6, 0, "Karen Wentworth"); + player->SEND_POI(9857.18, -7564.36, 7, 6, 0, "Karen Wentworth"); player->SEND_GOSSIP_MENU(9329, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 5: //WSG - player->SEND_POI(9845.45, -7562.58, 6, 6, 0, "Krukk"); + player->SEND_POI(9845.45, -7562.58, 7, 6, 0, "Krukk"); player->SEND_GOSSIP_MENU(9329, _Creature->GetGUID()); break; } @@ -3039,31 +3039,31 @@ void SendClassTrainerMenu_guard_silvermoon(Player *player, Creature *_Creature, switch (action) { case GOSSIP_ACTION_INFO_DEF + 1: //Druid - player->SEND_POI(9700.55, -7262.57, 6, 6, 0, "Harene Plainwalker"); + player->SEND_POI(9700.55, -7262.57, 7, 6, 0, "Harene Plainwalker"); player->SEND_GOSSIP_MENU(9330, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 2: //Hunter - player->SEND_POI(9927.48, -7426.14, 6, 6, 0, "Zandine"); + player->SEND_POI(9927.48, -7426.14, 7, 6, 0, "Zandine"); player->SEND_GOSSIP_MENU(9332, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 3: //Mage - player->SEND_POI(9995.07, -7118.17, 6, 6, 0, "Quithas"); + player->SEND_POI(9995.07, -7118.17, 7, 6, 0, "Quithas"); player->SEND_GOSSIP_MENU(9333, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 4: //Paladin - player->SEND_POI(9850.22, -7516.93, 6, 6, 0, "Champion Bachi"); + player->SEND_POI(9850.22, -7516.93, 7, 6, 0, "Champion Bachi"); player->SEND_GOSSIP_MENU(9334, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 5: //Priest - player->SEND_POI(9926.79, -7066.66, 6, 6, 0, "Belestra"); + player->SEND_POI(9926.79, -7066.66, 7, 6, 0, "Belestra"); player->SEND_GOSSIP_MENU(9335, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 6: //Rogue - player->SEND_POI(9739.88, -7374.33, 6, 6, 0, "Zelanis"); + player->SEND_POI(9739.88, -7374.33, 7, 6, 0, "Zelanis"); player->SEND_GOSSIP_MENU(9336, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 7: //Warlock - player->SEND_POI(9787.57, -7284.63, 6, 6, 0, "Alamma"); + player->SEND_POI(9787.57, -7284.63, 7, 6, 0, "Alamma"); player->SEND_GOSSIP_MENU(9337, _Creature->GetGUID()); break; } @@ -3074,55 +3074,55 @@ void SendProfTrainerMenu_guard_silvermoon(Player *player, Creature *_Creature, u switch (action) { case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy - player->SEND_POI(9998.09, -7214.36, 6, 6, 0, "Silvermoon Alchemy Trainer"); + player->SEND_POI(9998.09, -7214.36, 7, 6, 0, "Silvermoon Alchemy Trainer"); player->SEND_GOSSIP_MENU(9316, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing - player->SEND_POI(9841.43, -7361.53, 6, 6, 0, "Silvermoon Blacksmithing Trainer"); + player->SEND_POI(9841.43, -7361.53, 7, 6, 0, "Silvermoon Blacksmithing Trainer"); player->SEND_GOSSIP_MENU(9340, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 3: //Cooking - player->SEND_POI(9577.26, -7243.6, 6, 6, 0, "Silvermoon Cooking Trainer"); + player->SEND_POI(9577.26, -7243.6, 7, 6, 0, "Silvermoon Cooking Trainer"); player->SEND_GOSSIP_MENU(9316, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting - player->SEND_POI(9962.57, -7246.18, 6, 6, 0, "Silvermoon Enchanting Trainer"); + player->SEND_POI(9962.57, -7246.18, 7, 6, 0, "Silvermoon Enchanting Trainer"); player->SEND_GOSSIP_MENU(9341, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 5: //Engineering - player->SEND_POI(9820.18, -7329.56, 6, 6, 0, "Silvermoon Engineering Trainer"); + player->SEND_POI(9820.18, -7329.56, 7, 6, 0, "Silvermoon Engineering Trainer"); player->SEND_GOSSIP_MENU(9316, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 6: //First Aid - player->SEND_POI(9579.8, -7343.71, 6, 6, 0, "Silvermoon First Aid Trainer"); + player->SEND_POI(9579.8, -7343.71, 7, 6, 0, "Silvermoon First Aid Trainer"); player->SEND_GOSSIP_MENU(9316, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 7: //Fishing - player->SEND_POI(9602.73, -7328.3, 6, 6, 0, "Silvermoon Fishing Trainer"); + player->SEND_POI(9602.73, -7328.3, 7, 6, 0, "Silvermoon Fishing Trainer"); player->SEND_GOSSIP_MENU(9316, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 8: //Jewelcrafting - player->SEND_POI(9553.54, -7506.43, 6, 6, 0, "Silvermoon Jewelcrafting Trainer"); + player->SEND_POI(9553.54, -7506.43, 7, 6, 0, "Silvermoon Jewelcrafting Trainer"); player->SEND_GOSSIP_MENU(9346, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 9: //Herbalism - player->SEND_POI(10004.4, -7216.86, 6, 6, 0, "Silvermoon Herbalism Trainer"); + player->SEND_POI(10004.4, -7216.86, 7, 6, 0, "Silvermoon Herbalism Trainer"); player->SEND_GOSSIP_MENU(9316, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 10: //Leatherworking - player->SEND_POI(9503.72, -7430.16, 6, 6, 0, "Silvermoon Leatherworking Trainer"); + player->SEND_POI(9503.72, -7430.16, 7, 6, 0, "Silvermoon Leatherworking Trainer"); player->SEND_GOSSIP_MENU(9347, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 11: //Mining - player->SEND_POI(9805.1, -7355.56, 6, 6, 0, "Silvermoon Mining Trainer"); + player->SEND_POI(9805.1, -7355.56, 7, 6, 0, "Silvermoon Mining Trainer"); player->SEND_GOSSIP_MENU(9348, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 12: //Skinning - player->SEND_POI(9513.37, -7429.4, 6, 6, 0, "Silvermoon Skinning Trainer"); + player->SEND_POI(9513.37, -7429.4, 7, 6, 0, "Silvermoon Skinning Trainer"); player->SEND_GOSSIP_MENU(9316, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 13: //Tailoring - player->SEND_POI(9750.55, -7095.28, 6, 6, 0, "Silvermoon Tailor"); + player->SEND_POI(9750.55, -7095.28, 7, 6, 0, "Silvermoon Tailor"); player->SEND_GOSSIP_MENU(9350, _Creature->GetGUID()); break; } @@ -3179,43 +3179,43 @@ void SendDefaultMenu_guard_stormwind(Player *player, Creature *_Creature, uint32 switch (action) { case GOSSIP_ACTION_INFO_DEF + 1: //Auction House - player->SEND_POI(-8811.46, 667.46, 6, 6, 0, "Stormwind Auction House"); + player->SEND_POI(-8811.46, 667.46, 7, 6, 0, "Stormwind Auction House"); player->SEND_GOSSIP_MENU(3834,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 2: //Bank - player->SEND_POI(-8916.87, 622.87, 6, 6, 0, "Stormwind Bank"); + player->SEND_POI(-8916.87, 622.87, 7, 6, 0, "Stormwind Bank"); player->SEND_GOSSIP_MENU(764,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 3: //Deeprun tram - player->SEND_POI(-8378.88, 554.23, 6, 6, 0, "The Deeprun Tram"); + player->SEND_POI(-8378.88, 554.23, 7, 6, 0, "The Deeprun Tram"); player->SEND_GOSSIP_MENU(3813,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 4: //Inn - player->SEND_POI(-8869.0, 675.4, 6, 6, 0, "The Gilded Rose"); + player->SEND_POI(-8869.0, 675.4, 7, 6, 0, "The Gilded Rose"); player->SEND_GOSSIP_MENU(3860,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 5: //Gryphon Master - player->SEND_POI(-8837.0, 493.5, 6, 6, 0, "Stormwind Gryphon Master"); + player->SEND_POI(-8837.0, 493.5, 7, 6, 0, "Stormwind Gryphon Master"); player->SEND_GOSSIP_MENU(879,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 6: //Guild Master - player->SEND_POI(-8894.0, 611.2, 6, 6, 0, "Stormwind Vistor`s Center"); + player->SEND_POI(-8894.0, 611.2, 7, 6, 0, "Stormwind Vistor`s Center"); player->SEND_GOSSIP_MENU(882,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 7: //Mailbox - player->SEND_POI(-8876.48, 649.18, 6, 6, 0, "Stormwind Mailbox"); + player->SEND_POI(-8876.48, 649.18, 7, 6, 0, "Stormwind Mailbox"); player->SEND_GOSSIP_MENU(3861,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 8: //Stable Master - player->SEND_POI(-8433.0, 554.7, 6, 6, 0, "Jenova Stoneshield"); + player->SEND_POI(-8433.0, 554.7, 7, 6, 0, "Jenova Stoneshield"); player->SEND_GOSSIP_MENU(5984,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 9: //Weapon Trainer - player->SEND_POI(-8797.0, 612.8, 6, 6, 0, "Woo Ping"); + player->SEND_POI(-8797.0, 612.8, 7, 6, 0, "Woo Ping"); player->SEND_GOSSIP_MENU(4516,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 10: //Officers Lounge - player->SEND_POI(-8759.92, 399.69, 6, 6, 0, "Champions` Hall"); + player->SEND_POI(-8759.92, 399.69, 7, 6, 0, "Champions` Hall"); player->SEND_GOSSIP_MENU(7047,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 11: //Battlemasters @@ -3259,15 +3259,15 @@ void SendBattleMasterMenu_guard_stormwind(Player *player, Creature *_Creature, u switch (action) { case GOSSIP_ACTION_INFO_DEF + 1: //AV - player->SEND_POI(-8443.88, 335.99, 6, 6, 0, "Thelman Slatefist"); + player->SEND_POI(-8443.88, 335.99, 7, 6, 0, "Thelman Slatefist"); player->SEND_GOSSIP_MENU(7500, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 2: //AB - player->SEND_POI(-8443.88, 335.99, 6, 6, 0, "Lady Hoteshem"); + player->SEND_POI(-8443.88, 335.99, 7, 6, 0, "Lady Hoteshem"); player->SEND_GOSSIP_MENU(7650, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 3: //WSG - player->SEND_POI(-8443.88, 335.99, 6, 6, 0, "Elfarran"); + player->SEND_POI(-8443.88, 335.99, 7, 6, 0, "Elfarran"); player->SEND_GOSSIP_MENU(7501, _Creature->GetGUID()); break; } @@ -3278,39 +3278,39 @@ void SendClassTrainerMenu_guard_stormwind(Player *player, Creature *_Creature, u switch (action) { case GOSSIP_ACTION_INFO_DEF + 1: //Mage - player->SEND_POI(-9012.0, 867.6, 6, 6, 0, "Wizard`s Sanctum"); + player->SEND_POI(-9012.0, 867.6, 7, 6, 0, "Wizard`s Sanctum"); player->SEND_GOSSIP_MENU(899,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 2: //Rogue - player->SEND_POI(-8753.0, 367.8, 6, 6, 0, "Stormwind - Rogue House"); + player->SEND_POI(-8753.0, 367.8, 7, 6, 0, "Stormwind - Rogue House"); player->SEND_GOSSIP_MENU(900,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 3: //Warrior - player->SEND_POI(-8690.11, 324.85, 6, 6, 0, "Command Center"); + player->SEND_POI(-8690.11, 324.85, 7, 6, 0, "Command Center"); player->SEND_GOSSIP_MENU(901,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 4: //Druid - player->SEND_POI(-8751.0, 1124.5, 6, 6, 0, "The Park"); + player->SEND_POI(-8751.0, 1124.5, 7, 6, 0, "The Park"); player->SEND_GOSSIP_MENU(902,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 5: //Priest - player->SEND_POI(-8512.0, 862.4, 6, 6, 0, "Catedral Of Light"); + player->SEND_POI(-8512.0, 862.4, 7, 6, 0, "Catedral Of Light"); player->SEND_GOSSIP_MENU(903,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 6: //Paladin - player->SEND_POI(-8577.0, 881.7, 6, 6, 0, "Catedral Of Light"); + player->SEND_POI(-8577.0, 881.7, 7, 6, 0, "Catedral Of Light"); player->SEND_GOSSIP_MENU(904,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 7: //Hunter - player->SEND_POI(-8413.0, 541.5, 6, 6, 0, "Hunter Lodge"); + player->SEND_POI(-8413.0, 541.5, 7, 6, 0, "Hunter Lodge"); player->SEND_GOSSIP_MENU(905,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 8: //Warlock - player->SEND_POI(-8948.91, 998.35, 6, 6, 0, "The Slaughtered Lamb"); + player->SEND_POI(-8948.91, 998.35, 7, 6, 0, "The Slaughtered Lamb"); player->SEND_GOSSIP_MENU(906,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 9: //Shaman - player->SEND_POI(-9033, 550, 6, 6, 0, "Valley Of Heroes"); + player->SEND_POI(-9033, 550, 7, 6, 0, "Valley Of Heroes"); //incorrect id player->SEND_GOSSIP_MENU(2593,_Creature->GetGUID()); break; @@ -3322,51 +3322,51 @@ void SendProfTrainerMenu_guard_stormwind(Player *player, Creature *_Creature, ui switch (action) { case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy - player->SEND_POI(-8988.0, 759.60, 6, 6, 0, "Alchemy Needs"); + player->SEND_POI(-8988.0, 759.60, 7, 6, 0, "Alchemy Needs"); player->SEND_GOSSIP_MENU(919,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing - player->SEND_POI(-8424.0, 616.9, 6, 6, 0, "Therum Deepforge"); + player->SEND_POI(-8424.0, 616.9, 7, 6, 0, "Therum Deepforge"); player->SEND_GOSSIP_MENU(920,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 3: //Cooking - player->SEND_POI(-8611.0, 364.6, 6, 6, 0, "Pig and Whistle Tavern"); + player->SEND_POI(-8611.0, 364.6, 7, 6, 0, "Pig and Whistle Tavern"); player->SEND_GOSSIP_MENU(921,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting - player->SEND_POI(-8858.0, 803.7, 6, 6, 0, "Lucan Cordell"); + player->SEND_POI(-8858.0, 803.7, 7, 6, 0, "Lucan Cordell"); player->SEND_GOSSIP_MENU(941,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 5: //Engineering - player->SEND_POI(-8347.0, 644.1, 6, 6, 0, "Lilliam Sparkspindle"); + player->SEND_POI(-8347.0, 644.1, 7, 6, 0, "Lilliam Sparkspindle"); player->SEND_GOSSIP_MENU(922,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 6: //First Aid - player->SEND_POI(-8513.0, 801.8, 6, 6, 0, "Shaina Fuller"); + player->SEND_POI(-8513.0, 801.8, 7, 6, 0, "Shaina Fuller"); player->SEND_GOSSIP_MENU(923,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 7: //Fishing - player->SEND_POI(-8803.0, 767.5, 6, 6, 0, "Arnold Leland"); + player->SEND_POI(-8803.0, 767.5, 7, 6, 0, "Arnold Leland"); player->SEND_GOSSIP_MENU(940,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 8: //Herbalism - player->SEND_POI(-8967.0, 779.5, 6, 6, 0, "Alchemy Needs"); + player->SEND_POI(-8967.0, 779.5, 7, 6, 0, "Alchemy Needs"); player->SEND_GOSSIP_MENU(924,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 9: //Leatherworking - player->SEND_POI(-8726.0, 477.4, 6, 6, 0, "The Protective Hide"); + player->SEND_POI(-8726.0, 477.4, 7, 6, 0, "The Protective Hide"); player->SEND_GOSSIP_MENU(925,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 10: //Mining - player->SEND_POI(-8434.0, 692.8, 6, 6, 0, "Gelman Stonehand"); + player->SEND_POI(-8434.0, 692.8, 7, 6, 0, "Gelman Stonehand"); player->SEND_GOSSIP_MENU(927,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 11: //Skinning - player->SEND_POI(-8716.0, 469.4, 6, 6, 0, "The Protective Hide"); + player->SEND_POI(-8716.0, 469.4, 7, 6, 0, "The Protective Hide"); player->SEND_GOSSIP_MENU(928,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 12: //Tailoring - player->SEND_POI(-8938.0, 800.7, 6, 6, 0, "Duncan`s Textiles"); + player->SEND_POI(-8938.0, 800.7, 7, 6, 0, "Duncan`s Textiles"); player->SEND_GOSSIP_MENU(929,_Creature->GetGUID()); break; } @@ -3431,11 +3431,11 @@ void SendDefaultMenu_guard_teldrassil(Player *player, Creature *_Creature, uint3 player->SEND_GOSSIP_MENU(4319,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 4: //Inn - player->SEND_POI(9821.49, 960.13, 6, 6, 0, "Dolanaar Inn"); + player->SEND_POI(9821.49, 960.13, 7, 6, 0, "Dolanaar Inn"); player->SEND_GOSSIP_MENU(4320,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 5: //stable master - player->SEND_POI(9808.37, 931.1, 6, 6, 0, "Seriadne"); + player->SEND_POI(9808.37, 931.1, 7, 6, 0, "Seriadne"); player->SEND_GOSSIP_MENU(5982,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 6: //class trainer @@ -3466,23 +3466,23 @@ void SendClassTrainerMenu_guard_teldrassil(Player *player, Creature *_Creature, switch (action) { case GOSSIP_ACTION_INFO_DEF + 1: //Druid - player->SEND_POI(9741.58, 963.7, 6, 6, 0, "Kal"); + player->SEND_POI(9741.58, 963.7, 7, 6, 0, "Kal"); player->SEND_GOSSIP_MENU(4323,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 2: //Hunter - player->SEND_POI(9815.12, 926.28, 6, 6, 0, "Dazalar"); + player->SEND_POI(9815.12, 926.28, 7, 6, 0, "Dazalar"); player->SEND_GOSSIP_MENU(4324,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 3: //Priest - player->SEND_POI(9906.16, 986.63, 6, 6, 0, "Laurna Morninglight"); + player->SEND_POI(9906.16, 986.63, 7, 6, 0, "Laurna Morninglight"); player->SEND_GOSSIP_MENU(4325,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 4: //Rogue - player->SEND_POI(9789, 942.86, 6, 6, 0, "Jannok Breezesong"); + player->SEND_POI(9789, 942.86, 7, 6, 0, "Jannok Breezesong"); player->SEND_GOSSIP_MENU(4326,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 5: //Warrior - player->SEND_POI(9821.96, 950.61, 6, 6, 0, "Kyra Windblade"); + player->SEND_POI(9821.96, 950.61, 7, 6, 0, "Kyra Windblade"); player->SEND_GOSSIP_MENU(4327,_Creature->GetGUID()); break; } @@ -3493,34 +3493,34 @@ void SendProfTrainerMenu_guard_teldrassil(Player *player, Creature *_Creature, u switch (action) { case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy - player->SEND_POI(9767.59, 878.81, 6, 6, 0, "Cyndra Kindwhisper"); + player->SEND_POI(9767.59, 878.81, 7, 6, 0, "Cyndra Kindwhisper"); player->SEND_GOSSIP_MENU(4329,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 2: //Cooking - player->SEND_POI(9751.19, 906.13, 6, 6, 0, "Zarrin"); + player->SEND_POI(9751.19, 906.13, 7, 6, 0, "Zarrin"); player->SEND_GOSSIP_MENU(4330,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 3: //Enchanting - player->SEND_POI(10677.59, 1946.56, 6, 6, 0, "Alanna Raveneye"); + player->SEND_POI(10677.59, 1946.56, 7, 6, 0, "Alanna Raveneye"); player->SEND_GOSSIP_MENU(4331,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 4: //First Aid - player->SEND_POI(9903.12, 999, 6, 6, 0, "Byancie"); + player->SEND_POI(9903.12, 999, 7, 6, 0, "Byancie"); player->SEND_GOSSIP_MENU(4332,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 5: //Fishing player->SEND_GOSSIP_MENU(4333,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 6: //Herbalism - player->SEND_POI(9773.78, 875.88, 6, 6, 0, "Malorne Bladeleaf"); + player->SEND_POI(9773.78, 875.88, 7, 6, 0, "Malorne Bladeleaf"); player->SEND_GOSSIP_MENU(4334,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 7: //Leatherworking - player->SEND_POI(10152.59, 1681.46, 6, 6, 0, "Nadyia Maneweaver"); + player->SEND_POI(10152.59, 1681.46, 7, 6, 0, "Nadyia Maneweaver"); player->SEND_GOSSIP_MENU(4335,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 8: //Skinning - player->SEND_POI(10135.59, 1673.18, 6, 6, 0, "Radnaal Maneweaver"); + player->SEND_POI(10135.59, 1673.18, 7, 6, 0, "Radnaal Maneweaver"); player->SEND_GOSSIP_MENU(4336,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 9: //Tailoring @@ -3576,11 +3576,11 @@ void SendDefaultMenu_guard_tirisfal(Player *player, Creature *_Creature, uint32 player->SEND_GOSSIP_MENU(4075,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 3: //Inn - player->SEND_POI(2246.68, 241.89, 6, 6, 0, "Gallows` End Tavern"); + player->SEND_POI(2246.68, 241.89, 7, 6, 0, "Gallows` End Tavern"); player->SEND_GOSSIP_MENU(4076,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 4: //Stable Master - player->SEND_POI(2267.66, 319.32, 6, 6, 0, "Morganus"); + player->SEND_POI(2267.66, 319.32, 7, 6, 0, "Morganus"); player->SEND_GOSSIP_MENU(5978,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 5: //Class trainer @@ -3614,23 +3614,23 @@ void SendClassTrainerMenu_guard_tirisfal(Player *player, Creature *_Creature, ui switch (action) { case GOSSIP_ACTION_INFO_DEF + 1: //Mage - player->SEND_POI(2259.18, 240.93, 6, 6, 0, "Cain Firesong"); + player->SEND_POI(2259.18, 240.93, 7, 6, 0, "Cain Firesong"); player->SEND_GOSSIP_MENU(4077,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 2: //Priest - player->SEND_POI(2259.18, 240.93, 6, 6, 0, "Dark Cleric Beryl"); + player->SEND_POI(2259.18, 240.93, 7, 6, 0, "Dark Cleric Beryl"); player->SEND_GOSSIP_MENU(4078,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 3: //Rogue - player->SEND_POI(2259.18, 240.93, 6, 6, 0, "Marion Call"); + player->SEND_POI(2259.18, 240.93, 7, 6, 0, "Marion Call"); player->SEND_GOSSIP_MENU(4079,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 4: //Warlock - player->SEND_POI(2259.18, 240.93, 6, 6, 0, "Rupert Boch"); + player->SEND_POI(2259.18, 240.93, 7, 6, 0, "Rupert Boch"); player->SEND_GOSSIP_MENU(4080,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 5: //Warrior - player->SEND_POI(2256.48, 240.32, 6, 6, 0, "Austil de Mon"); + player->SEND_POI(2256.48, 240.32, 7, 6, 0, "Austil de Mon"); player->SEND_GOSSIP_MENU(4081,_Creature->GetGUID()); break; } @@ -3641,7 +3641,7 @@ void SendProfTrainerMenu_guard_tirisfal(Player *player, Creature *_Creature, uin switch (action) { case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy - player->SEND_POI(2263.25, 344.23, 6, 6, 0, "Carolai Anise"); + player->SEND_POI(2263.25, 344.23, 7, 6, 0, "Carolai Anise"); player->SEND_GOSSIP_MENU(4082,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing @@ -3651,37 +3651,37 @@ void SendProfTrainerMenu_guard_tirisfal(Player *player, Creature *_Creature, uin player->SEND_GOSSIP_MENU(4084,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting - player->SEND_POI(2250.35, 249.12, 6, 6, 0, "Vance Undergloom"); + player->SEND_POI(2250.35, 249.12, 7, 6, 0, "Vance Undergloom"); player->SEND_GOSSIP_MENU(4085,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 5: //Engineering player->SEND_GOSSIP_MENU(4086,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 6: //First Aid - player->SEND_POI(2246.68, 241.89, 6, 6, 0, "Nurse Neela"); + player->SEND_POI(2246.68, 241.89, 7, 6, 0, "Nurse Neela"); player->SEND_GOSSIP_MENU(4087,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 7: //Fishing - player->SEND_POI(2292.37, -10.72, 6, 6, 0, "Clyde Kellen"); + player->SEND_POI(2292.37, -10.72, 7, 6, 0, "Clyde Kellen"); player->SEND_GOSSIP_MENU(4088,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 8: //Herbalism - player->SEND_POI(2268.21, 331.69, 6, 6, 0, "Faruza"); + player->SEND_POI(2268.21, 331.69, 7, 6, 0, "Faruza"); player->SEND_GOSSIP_MENU(4089,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 9: //Leatherworking - player->SEND_POI(2027, 78.72, 6, 6, 0, "Shelene Rhobart"); + player->SEND_POI(2027, 78.72, 7, 6, 0, "Shelene Rhobart"); player->SEND_GOSSIP_MENU(4090,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 10: //Mining player->SEND_GOSSIP_MENU(4091,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 11: //Skinning - player->SEND_POI(2027, 78.72, 6, 6, 0, "Rand Rhobart"); + player->SEND_POI(2027, 78.72, 7, 6, 0, "Rand Rhobart"); player->SEND_GOSSIP_MENU(4092,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 12: //Tailoring - player->SEND_POI(2160.45, 659.93, 6, 6, 0, "Bowen Brisboise"); + player->SEND_POI(2160.45, 659.93, 7, 6, 0, "Bowen Brisboise"); player->SEND_GOSSIP_MENU(4093,_Creature->GetGUID()); break; } @@ -3734,39 +3734,39 @@ void SendDefaultMenu_guard_undercity(Player *player, Creature *_Creature, uint32 switch (action) { case GOSSIP_ACTION_INFO_DEF + 1: //Bank - player->SEND_POI(1595.64, 232.45, 6, 6, 0, "Undercity Bank"); + player->SEND_POI(1595.64, 232.45, 7, 6, 0, "Undercity Bank"); player->SEND_GOSSIP_MENU(3514,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 2: //Bat handler - player->SEND_POI(1565.9, 271.43, 6, 6, 0, "Undercity Bat Handler"); + player->SEND_POI(1565.9, 271.43, 7, 6, 0, "Undercity Bat Handler"); player->SEND_GOSSIP_MENU(3515,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 3: //Guild master - player->SEND_POI(1594.17, 205.57, 6, 6, 0, "Undercity Guild Master"); + player->SEND_POI(1594.17, 205.57, 7, 6, 0, "Undercity Guild Master"); player->SEND_GOSSIP_MENU(3516,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 4: //Inn - player->SEND_POI(1639.43, 220.99, 6, 6, 0, "Undercity Inn"); + player->SEND_POI(1639.43, 220.99, 7, 6, 0, "Undercity Inn"); player->SEND_GOSSIP_MENU(3517,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 5: //Mailbox - player->SEND_POI(1632.68, 219.4, 6, 6, 0, "Undercity Mailbox"); + player->SEND_POI(1632.68, 219.4, 7, 6, 0, "Undercity Mailbox"); player->SEND_GOSSIP_MENU(3518,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 6: //Auction House - player->SEND_POI(1647.9, 258.49, 6, 6, 0, "Undercity Auction House"); + player->SEND_POI(1647.9, 258.49, 7, 6, 0, "Undercity Auction House"); player->SEND_GOSSIP_MENU(3519,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 7: //Zeppelin - player->SEND_POI(2059, 274.86, 6, 6, 0, "Undercity Zeppelin"); + player->SEND_POI(2059, 274.86, 7, 6, 0, "Undercity Zeppelin"); player->SEND_GOSSIP_MENU(3520,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 8: //Weapon Master - player->SEND_POI(1670.31, 324.66, 6, 6, 0, "Archibald"); + player->SEND_POI(1670.31, 324.66, 7, 6, 0, "Archibald"); player->SEND_GOSSIP_MENU(4521,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 9: //Stable master - player->SEND_POI(1634.18, 226.76, 6, 6, 0, "Anya Maulray"); + player->SEND_POI(1634.18, 226.76, 7, 6, 0, "Anya Maulray"); player->SEND_GOSSIP_MENU(5979,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 10: //Battlemaster @@ -3806,15 +3806,15 @@ void SendBattleMasterMenu_guard_undercity(Player *player, Creature *_Creature, u switch (action) { case GOSSIP_ACTION_INFO_DEF + 1: //AV - player->SEND_POI(1329, 333.92, 6, 6, 0, "Grizzle Halfmane"); + player->SEND_POI(1329, 333.92, 7, 6, 0, "Grizzle Halfmane"); player->SEND_GOSSIP_MENU(7525,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 2: //AB - player->SEND_POI(1283.3, 287.16, 6, 6, 0, "Sir Malory Wheeler"); + player->SEND_POI(1283.3, 287.16, 7, 6, 0, "Sir Malory Wheeler"); player->SEND_GOSSIP_MENU(7646,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 3: //WSG - player->SEND_POI(1265, 351.18, 6, 6, 0, "Kurden Bloodclaw"); + player->SEND_POI(1265, 351.18, 7, 6, 0, "Kurden Bloodclaw"); player->SEND_GOSSIP_MENU(7526,_Creature->GetGUID()); break; } @@ -3825,23 +3825,23 @@ void SendClassTrainerMenu_guard_undercity(Player *player, Creature *_Creature, u switch (action) { case GOSSIP_ACTION_INFO_DEF + 1: //Mage - player->SEND_POI(1781, 53, 6, 6, 0, "Undercity Mage Trainers"); + player->SEND_POI(1781, 53, 7, 6, 0, "Undercity Mage Trainers"); player->SEND_GOSSIP_MENU(3513,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 2: //Priest - player->SEND_POI(1758.33, 401.5, 6, 6, 0, "Undercity Priest Trainers"); + player->SEND_POI(1758.33, 401.5, 7, 6, 0, "Undercity Priest Trainers"); player->SEND_GOSSIP_MENU(3521,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 3: //Rogue - player->SEND_POI(1418.56, 65, 6, 6, 0, "Undercity Rogue Trainers"); + player->SEND_POI(1418.56, 65, 7, 6, 0, "Undercity Rogue Trainers"); player->SEND_GOSSIP_MENU(3524,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 4: //Warlock - player->SEND_POI(1780.92, 53.16, 6, 6, 0, "Undercity Warlock Trainers"); + player->SEND_POI(1780.92, 53.16, 7, 6, 0, "Undercity Warlock Trainers"); player->SEND_GOSSIP_MENU(3526,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 5: //Warrior - player->SEND_POI(1775.59, 418.19, 6, 6, 0, "Undercity Warrior Trainers"); + player->SEND_POI(1775.59, 418.19, 7, 6, 0, "Undercity Warrior Trainers"); player->SEND_GOSSIP_MENU(3527,_Creature->GetGUID()); break; } @@ -3852,51 +3852,51 @@ void SendProfTrainerMenu_guard_undercity(Player *player, Creature *_Creature, ui switch (action) { case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy - player->SEND_POI(1419.82, 417.19, 6, 6, 0, "The Apothecarium"); + player->SEND_POI(1419.82, 417.19, 7, 6, 0, "The Apothecarium"); player->SEND_GOSSIP_MENU(3528,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing - player->SEND_POI(1696, 285, 6, 6, 0, "Undercity Blacksmithing Trainer"); + player->SEND_POI(1696, 285, 7, 6, 0, "Undercity Blacksmithing Trainer"); player->SEND_GOSSIP_MENU(3529,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 3: //Cooking - player->SEND_POI(1596.34, 274.68, 6, 6, 0, "Undercity Cooking Trainer"); + player->SEND_POI(1596.34, 274.68, 7, 6, 0, "Undercity Cooking Trainer"); player->SEND_GOSSIP_MENU(3530,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting - player->SEND_POI(1488.54, 280.19, 6, 6, 0, "Undercity Enchanting Trainer"); + player->SEND_POI(1488.54, 280.19, 7, 6, 0, "Undercity Enchanting Trainer"); player->SEND_GOSSIP_MENU(3531,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 5: //Engineering - player->SEND_POI(1408.58, 143.43, 6, 6, 0, "Undercity Engineering Trainer"); + player->SEND_POI(1408.58, 143.43, 7, 6, 0, "Undercity Engineering Trainer"); player->SEND_GOSSIP_MENU(3532,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 6: //First Aid - player->SEND_POI(1519.65, 167.19, 6, 6, 0, "Undercity First Aid Trainer"); + player->SEND_POI(1519.65, 167.19, 7, 6, 0, "Undercity First Aid Trainer"); player->SEND_GOSSIP_MENU(3533,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 7: //Fishing - player->SEND_POI(1679.9, 89, 6, 6, 0, "Undercity Fishing Trainer"); + player->SEND_POI(1679.9, 89, 7, 6, 0, "Undercity Fishing Trainer"); player->SEND_GOSSIP_MENU(3534,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 8: //Herbalism - player->SEND_POI(1558, 349.36, 6, 6, 0, "Undercity Herbalism Trainer"); + player->SEND_POI(1558, 349.36, 7, 6, 0, "Undercity Herbalism Trainer"); player->SEND_GOSSIP_MENU(3535,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 9: //Leatherworking - player->SEND_POI(1498.76, 196.43, 6, 6, 0, "Undercity Leatherworking Trainer"); + player->SEND_POI(1498.76, 196.43, 7, 6, 0, "Undercity Leatherworking Trainer"); player->SEND_GOSSIP_MENU(3536,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 10: //Mining - player->SEND_POI(1642.88, 335.58, 6, 6, 0, "Undercity Mining Trainer"); + player->SEND_POI(1642.88, 335.58, 7, 6, 0, "Undercity Mining Trainer"); player->SEND_GOSSIP_MENU(3537,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 11: //Skinning - player->SEND_POI(1498.6, 196.46, 6, 6, 0, "Undercity Skinning Trainer"); + player->SEND_POI(1498.6, 196.46, 7, 6, 0, "Undercity Skinning Trainer"); player->SEND_GOSSIP_MENU(3538,_Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 12: //Tailoring - player->SEND_POI(1689.55, 193, 6, 6, 0, "Undercity Tailoring Trainer"); + player->SEND_POI(1689.55, 193, 7, 6, 0, "Undercity Tailoring Trainer"); player->SEND_GOSSIP_MENU(3539,_Creature->GetGUID()); break; } @@ -4010,7 +4010,7 @@ void AddSC_guards() newscript->Name="guard_orgrimmar"; newscript->pGossipHello = &GossipHello_guard_orgrimmar; newscript->pGossipSelect = &GossipSelect_guard_orgrimmar; - newscript->pReceiveEmote = &ReceiveEmote_guard_orgrimmar; + //newscript->pReceiveEmote = &ReceiveEmote_guard_orgrimmar; newscript->GetAI = &GetAI_guard_orgrimmar; newscript->RegisterSelf(); @@ -4046,7 +4046,7 @@ void AddSC_guards() newscript->Name="guard_stormwind"; newscript->pGossipHello = &GossipHello_guard_stormwind; newscript->pGossipSelect = &GossipSelect_guard_stormwind; - newscript->pReceiveEmote = &ReceiveEmote_guard_stormwind; + //newscript->pReceiveEmote = &ReceiveEmote_guard_stormwind; newscript->GetAI = &GetAI_guard_stormwind; newscript->RegisterSelf(); diff --git a/src/bindings/scripts/scripts/item/item_scripts.cpp b/src/bindings/scripts/scripts/item/item_scripts.cpp index b8c79e01ab7..f577d0fed9c 100644 --- a/src/bindings/scripts/scripts/item/item_scripts.cpp +++ b/src/bindings/scripts/scripts/item/item_scripts.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -107,7 +107,7 @@ bool ItemUse_item_attuned_crystal_cores(Player *player, Item* _Item, SpellCastTa targets.getUnitTarget()->GetEntry() == 24972 && targets.getUnitTarget()->isDead() && (player->GetQuestStatus(11524) == QUEST_STATUS_INCOMPLETE || player->GetQuestStatus(11525) == QUEST_STATUS_INCOMPLETE) ) { - ((Creature*)targets.getUnitTarget())->RemoveCorpse(); + CAST_CRE(targets.getUnitTarget())->RemoveCorpse(); return false; } @@ -191,7 +191,7 @@ bool ItemUse_item_nether_wraith_beacon(Player *player, Item* _Item, SpellCastTar Nether = player->SummonCreature(22408,player->GetPositionX() ,player->GetPositionY()+20, player->GetPositionZ(), 0,TEMPSUMMON_TIMED_DESPAWN,180000); Nether = player->SummonCreature(22408,player->GetPositionX() ,player->GetPositionY()-20, player->GetPositionZ(), 0,TEMPSUMMON_TIMED_DESPAWN,180000); if (Nether) - ((CreatureAI*)Nether->AI())->AttackStart(player); + (Nether->AI())->AttackStart(player); } return false; } @@ -223,7 +223,7 @@ bool ItemUse_item_flying_machine(Player *player, Item* _Item, SpellCastTargets c bool ItemUse_item_gor_dreks_ointment(Player *player, Item* _Item, SpellCastTargets const& targets) { if( targets.getUnitTarget() && targets.getUnitTarget()->GetTypeId()==TYPEID_UNIT && - targets.getUnitTarget()->GetEntry() == 20748 && !targets.getUnitTarget()->HasAura(32578,0) ) + targets.getUnitTarget()->GetEntry() == 20748 && !targets.getUnitTarget()->HasAura(32578) ) return false; player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW,_Item,NULL); @@ -276,7 +276,7 @@ bool ItemUse_item_muiseks_vessel(Player *player, Item* _Item, SpellCastTargets c if( uTarget && uTarget->GetTypeId()==TYPEID_UNIT && uTarget->isDead() && (uTarget->GetEntry()==cEntry || uTarget->GetEntry()==cEntry2 || uTarget->GetEntry()==cEntry3 || uTarget->GetEntry()==cEntry4) ) { - ((Creature*)uTarget)->RemoveCorpse(); + CAST_CRE(uTarget)->RemoveCorpse(); return false; } } @@ -463,7 +463,7 @@ bool ItemUse_item_yehkinyas_bramble(Player *player, Item* _Item, SpellCastTarget // cast only on corpse 5307 or 5308 (unit_target->GetEntry()==5307 || unit_target->GetEntry()==5308) ) { - ((Creature*)unit_target)->RemoveCorpse(); // remove corpse for cancelling second use + CAST_CRE(unit_target)->RemoveCorpse(); // remove corpse for cancelling second use return false; // all ok } } diff --git a/src/bindings/scripts/scripts/npc/npc_escortAI.cpp b/src/bindings/scripts/scripts/npc/npc_escortAI.cpp index 3e4d416f44a..d464a369826 100644 --- a/src/bindings/scripts/scripts/npc/npc_escortAI.cpp +++ b/src/bindings/scripts/scripts/npc/npc_escortAI.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * This program is free software licensed under GPL version 2 * Please see the included DOCS/LICENSE.TXT for more information */ @@ -13,14 +13,7 @@ EndScriptData */ #include "npc_escortAI.h" #define WP_LAST_POINT -1 - -bool npc_escortAI::IsVisible(Unit* who) const -{ - if (!who) - return false; - - return (m_creature->GetDistance(who) < VISIBLE_RANGE) && who->isVisibleForOrDetect(m_creature,true); -} +extern std::list<PointMovement> PointMovementList; void npc_escortAI::AttackStart(Unit *who) { @@ -30,28 +23,13 @@ void npc_escortAI::AttackStart(Unit *who) if (IsBeingEscorted && !Defend) return; - - if ( m_creature->Attack(who, true) ) - { - m_creature->AddThreat(who, 0.0f); - - if (!InCombat) + if(m_creature->Attack(who, true) ) + { + if(CombatMovement) { - InCombat = true; - - if (IsBeingEscorted) - { - //Store last position - m_creature->GetPosition(LastPos.x, LastPos.y, LastPos.z); - - debug_log("TSCR: EscortAI has entered combat and stored last location."); - } - - Aggro(who); + m_creature->GetMotionMaster()->MovementExpired(); + m_creature->GetMotionMaster()->MoveChase(who); } - - m_creature->GetMotionMaster()->MovementExpired(); - m_creature->GetMotionMaster()->MoveChase(who); } } @@ -60,17 +38,14 @@ void npc_escortAI::MoveInLineOfSight(Unit *who) if (IsBeingEscorted && !Attack) return; - if(m_creature->getVictim() || !m_creature->canStartAttack(who)) - return; - - AttackStart(who); + ScriptedAI::MoveInLineOfSight(who); } void npc_escortAI::JustRespawned() { - InCombat = false; IsBeingEscorted = false; IsOnHold = false; + CombatMovement = true; //Re-Enable questgiver flag m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER); @@ -80,25 +55,21 @@ void npc_escortAI::JustRespawned() void npc_escortAI::EnterEvadeMode() { - InCombat = false; - m_creature->RemoveAllAuras(); m_creature->DeleteThreatList(); - m_creature->CombatStop(); + m_creature->CombatStop(true); m_creature->SetLootRecipient(NULL); if (IsBeingEscorted) { - debug_log("TSCR: EscortAI has left combat and is now returning to last point."); Returning = true; - m_creature->GetMotionMaster()->MovementExpired(); - m_creature->GetMotionMaster()->MovePoint(WP_LAST_POINT, LastPos.x, LastPos.y, LastPos.z); - - }else - { - m_creature->GetMotionMaster()->MovementExpired(); - m_creature->GetMotionMaster()->MoveTargetedHome(); + float x, y, z, o; + m_creature->GetHomePosition(x, y, z, o); + m_creature->GetMotionMaster()->MovePoint(WP_LAST_POINT, x, y, z); + debug_log("TSCR: EscortAI has left combat and is now returning to last point %f %f %f.", x, y, z); } + else + m_creature->GetMotionMaster()->MoveTargetedHome(); Reset(); } @@ -106,25 +77,32 @@ void npc_escortAI::EnterEvadeMode() void npc_escortAI::UpdateAI(const uint32 diff) { //Waypoint Updating - if (IsBeingEscorted && !InCombat && WaitTimer && !Returning) + if (IsBeingEscorted && !m_creature->isInCombat() && WaitTimer && !Returning) { if (WaitTimer <= diff) { if (ReconnectWP) { //Correct movement speed - if (Run) + if (bIsRunning && m_creature->HasUnitMovementFlag(MOVEMENTFLAG_WALK_MODE)) m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - else m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + else if (!bIsRunning && !m_creature->HasUnitMovementFlag(MOVEMENTFLAG_WALK_MODE)) + m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); //Continue with waypoints if( !IsOnHold ) { - m_creature->GetMotionMaster()->MovePoint(CurrentWP->id, CurrentWP->x, CurrentWP->y, CurrentWP->z ); - debug_log("TSCR: EscortAI Reconnect WP is: %u, %f, %f, %f", CurrentWP->id, CurrentWP->x, CurrentWP->y, CurrentWP->z); - WaitTimer = 0; - ReconnectWP = false; - return; + if (CurrentWP != WaypointList.end()) + { + m_creature->GetMotionMaster()->MovePoint(CurrentWP->id, CurrentWP->x, CurrentWP->y, CurrentWP->z ); + debug_log("TSCR: EscortAI Reconnect WP is: %u, %f, %f, %f", CurrentWP->id, CurrentWP->x, CurrentWP->y, CurrentWP->z); + + WaitTimer = 0; + ReconnectWP = false; + return; + } + else + debug_log("TSCR: EscortAI Reconnected to end of WP list"); } } @@ -142,13 +120,15 @@ void npc_escortAI::UpdateAI(const uint32 diff) m_creature->Respawn(); m_creature->GetMotionMaster()->Clear(true); - //Re-Enable gossip - m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + //Restore original NpcFlags + m_creature->SetUInt32Value(UNIT_NPC_FLAGS, m_uiNpcFlags); IsBeingEscorted = false; WaitTimer = 0; return; - }else{ + } + else + { debug_log("TSCR: EscortAI reached end of waypoints with Despawn off"); IsBeingEscorted = false; WaitTimer = 0; @@ -166,7 +146,7 @@ void npc_escortAI::UpdateAI(const uint32 diff) } //Check if player is within range - if (IsBeingEscorted && !InCombat && PlayerGUID) + if (IsBeingEscorted && !m_creature->isInCombat() && PlayerGUID) { if (PlayerTimer < diff) { @@ -186,30 +166,17 @@ void npc_escortAI::UpdateAI(const uint32 diff) m_creature->Respawn(); m_creature->GetMotionMaster()->Clear(true); - //Re-Enable gossip - m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + //Restore original NpcFlags + m_creature->SetUInt32Value(UNIT_NPC_FLAGS, m_uiNpcFlags); + } PlayerTimer = 1000; }else PlayerTimer -= diff; } - if(CanMelee) - { - //Check if we have a current target - if( m_creature->isAlive() && UpdateVictim()) - { - //If we are within range melee the target - if( m_creature->IsWithinMeleeRange(m_creature->getVictim())) - { - if( m_creature->isAttackReady() ) - { - m_creature->AttackerStateUpdate(m_creature->getVictim()); - m_creature->resetAttackTimer(); - } - } - } - } + if(CanMelee && UpdateVictim()) + DoMeleeAttackIfReady(); } void npc_escortAI::MovementInform(uint32 type, uint32 id) @@ -223,14 +190,16 @@ void npc_escortAI::MovementInform(uint32 type, uint32 id) debug_log("TSCR: EscortAI has returned to original position before combat"); ReconnectWP = true; Returning = false; - WaitTimer = 1; - }else + if(!WaitTimer) + WaitTimer = 1; + } + else { //Make sure that we are still on the right waypoint if (CurrentWP->id != id) { - debug_log("SD2 ERROR: EscortAI reached waypoint out of order %d, expected %d", id, CurrentWP->id); + debug_log("TSCR ERROR: EscortAI reached waypoint out of order %d, expected %d", id, CurrentWP->id); return; } @@ -245,6 +214,7 @@ void npc_escortAI::MovementInform(uint32 type, uint32 id) } } +/* void npc_escortAI::OnPossess(bool apply) { // We got possessed in the middle of being escorted, store the point @@ -261,8 +231,7 @@ void npc_escortAI::OnPossess(bool apply) } } } - - +*/ void npc_escortAI::AddWaypoint(uint32 id, float x, float y, float z, uint32 WaitTimeMs) { @@ -271,33 +240,89 @@ void npc_escortAI::AddWaypoint(uint32 id, float x, float y, float z, uint32 Wait WaypointList.push_back(t); } +void npc_escortAI::FillPointMovementListForCreature() +{ + UNORDERED_MAP<uint32, std::vector<PointMovement> >::iterator pPointsEntries = PointMovementMap.find(m_creature->GetEntry()); + + if (pPointsEntries != PointMovementMap.end()) + { + std::vector<PointMovement>::iterator itr; + + for (itr = pPointsEntries->second.begin(); itr != pPointsEntries->second.end(); ++itr) + { + Escort_Waypoint pPoint(itr->m_uiPointId,itr->m_fX,itr->m_fY,itr->m_fZ,itr->m_uiWaitTime); + WaypointList.push_back(pPoint); + } + } +} + +void npc_escortAI::SetRun(bool bRun) +{ + if (bRun) + { + if (!bIsRunning) + m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + else + debug_log("TSCR: EscortAI attempt to set run mode, but is already running."); + } + else + { + if (bIsRunning) + m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + else + debug_log("TSCR: EscortAI attempt to set walk mode, but is already walking."); + } + bIsRunning = bRun; +} + void npc_escortAI::Start(bool bAttack, bool bDefend, bool bRun, uint64 pGUID) { - if (InCombat) + if (m_creature->isInCombat()) + { + debug_log("TSCR ERROR: EscortAI attempt to Start while in combat"); + return; + } + + if (IsBeingEscorted) { - debug_log("SD2 ERROR: EscortAI attempt to Start while in combat"); + error_log("TSCR: EscortAI attempt to Start while already escorting"); return; } if (WaypointList.empty()) { - debug_log("SD2 ERROR: Call to escortAI::Start with 0 waypoints"); + error_db_log("TSCR: EscortAI Start with 0 waypoints (possible missing entry in script_waypoint)"); return; } + if(m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == WAYPOINT_MOTION_TYPE) + { + m_creature->GetMotionMaster()->MovementExpired(); + m_creature->GetMotionMaster()->MoveIdle(); + debug_log("TSCR: EscortAI start with WAYPOINT_MOTION_TYPE, changed to MoveIdle."); + } + Attack = bAttack; Defend = bDefend; - Run = bRun; + bIsRunning = bRun; PlayerGUID = pGUID; - debug_log("TSCR: EscortAI started with %d waypoints. Attack = %d, Defend = %d, Run = %d, PlayerGUID = %d", WaypointList.size(), Attack, Defend, Run, PlayerGUID); + //store original NpcFlags + m_uiNpcFlags = m_creature->GetUInt32Value(UNIT_NPC_FLAGS); + + //remove them if any + if (m_uiNpcFlags) + m_creature->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE); + + debug_log("TSCR: EscortAI started with %d waypoints. Attack = %d, Defend = %d, Run = %d, PlayerGUID = %d", WaypointList.size(), Attack, Defend, bIsRunning, PlayerGUID); CurrentWP = WaypointList.begin(); //Set initial speed - if (Run) + if (bIsRunning) m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - else m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + else + m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); //Start WP m_creature->GetMotionMaster()->MovePoint(CurrentWP->id, CurrentWP->x, CurrentWP->y, CurrentWP->z ); @@ -306,8 +331,5 @@ void npc_escortAI::Start(bool bAttack, bool bDefend, bool bRun, uint64 pGUID) ReconnectWP = false; Returning = false; IsOnHold = false; - - //Disable questgiver flag - m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER); + CombatMovement = true; } - diff --git a/src/bindings/scripts/scripts/npc/npc_escortAI.h b/src/bindings/scripts/scripts/npc/npc_escortAI.h index a2ec7fc50ed..3431e84c6f8 100644 --- a/src/bindings/scripts/scripts/npc/npc_escortAI.h +++ b/src/bindings/scripts/scripts/npc/npc_escortAI.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * This program is free software licensed under GPL version 2 * Please see the included DOCS/LICENSE.TXT for more information */ @@ -7,6 +7,8 @@ #define DEFAULT_MAX_PLAYER_DISTANCE 50 +extern UNORDERED_MAP<uint32, std::vector<PointMovement> > PointMovementMap; + struct Escort_Waypoint { Escort_Waypoint(uint32 _id, float _x, float _y, float _z, uint32 _w) @@ -32,18 +34,13 @@ struct TRINITY_DLL_DECL npc_escortAI : public ScriptedAI // Pure Virtual Functions virtual void WaypointReached(uint32) = 0; - virtual void Aggro(Unit*) = 0; - - virtual void Reset() = 0; - // CreatureAI functions - npc_escortAI(Creature *c) : ScriptedAI(c), IsBeingEscorted(false), PlayerTimer(1000), MaxPlayerDistance(DEFAULT_MAX_PLAYER_DISTANCE), CanMelee(true), DespawnAtEnd(true), DespawnAtFar(true) {m_creature->GetPosition(LastPos.x, LastPos.y, LastPos.z);} - - bool IsVisible(Unit*) const; + npc_escortAI(Creature *c) : ScriptedAI(c), IsBeingEscorted(false), PlayerTimer(1000), MaxPlayerDistance(DEFAULT_MAX_PLAYER_DISTANCE), CanMelee(true), DespawnAtEnd(true), DespawnAtFar(true) + {} - void AttackStart(Unit*); + void AttackStart(Unit* who); - void MoveInLineOfSight(Unit*); + void MoveInLineOfSight(Unit* who); void JustRespawned(); @@ -53,12 +50,13 @@ struct TRINITY_DLL_DECL npc_escortAI : public ScriptedAI void MovementInform(uint32, uint32); - void OnPossess(bool apply); - // EscortAI functions void AddWaypoint(uint32 id, float x, float y, float z, uint32 WaitTimeMs = 0); + void FillPointMovementListForCreature(); + void Start(bool bAttack, bool bDefend, bool bRun, uint64 pGUID = 0); + void SetRun(bool bRun = true); void SetMaxPlayerDistance(float newMax) { MaxPlayerDistance = newMax; } float GetMaxPlayerDistance() { return MaxPlayerDistance; } @@ -77,15 +75,9 @@ struct TRINITY_DLL_DECL npc_escortAI : public ScriptedAI private: uint32 WaitTimer; uint32 PlayerTimer; + uint32 m_uiNpcFlags; float MaxPlayerDistance; - struct - { - float x; - float y; - float z; - }LastPos; - std::list<Escort_Waypoint> WaypointList; std::list<Escort_Waypoint>::iterator CurrentWP; @@ -93,7 +85,7 @@ struct TRINITY_DLL_DECL npc_escortAI : public ScriptedAI bool Defend; bool Returning; bool ReconnectWP; - bool Run; + bool bIsRunning; bool CanMelee; bool DespawnAtEnd; bool DespawnAtFar; diff --git a/src/bindings/scripts/scripts/npc/npc_innkeeper.cpp b/src/bindings/scripts/scripts/npc/npc_innkeeper.cpp index f96011266b9..ccd2b69f8bf 100644 --- a/src/bindings/scripts/scripts/npc/npc_innkeeper.cpp +++ b/src/bindings/scripts/scripts/npc/npc_innkeeper.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -52,7 +52,7 @@ bool GossipHello_npc_innkeeper(Player *player, Creature *_Creature) if (_Creature->isQuestGiver()) player->PrepareQuestMenu( _Creature->GetGUID() ); - if (isEventActive()&& !player->GetAura(SPELL_TRICK_OR_TREATED,0)) + if (isEventActive()&& !player->GetAura(SPELL_TRICK_OR_TREATED, player->GetGUID())) { char* localizedEntry; switch (player->GetSession()->GetSessionDbLocaleIndex()) @@ -83,7 +83,7 @@ bool GossipHello_npc_innkeeper(Player *player, Creature *_Creature) bool GossipSelect_npc_innkeeper(Player *player, Creature *_Creature, uint32 sender, uint32 action ) { - if (action == GOSSIP_ACTION_INFO_DEF+HALLOWEEN_EVENTID && isEventActive() && !player->GetAura(SPELL_TRICK_OR_TREATED,0)) + if (action == GOSSIP_ACTION_INFO_DEF+HALLOWEEN_EVENTID && isEventActive() && !player->GetAura(SPELL_TRICK_OR_TREATED, player->GetGUID())) { player->CLOSE_GOSSIP_MENU(); player->CastSpell(player, SPELL_TRICK_OR_TREATED, true); diff --git a/src/bindings/scripts/scripts/npc/npc_professions.cpp b/src/bindings/scripts/scripts/npc/npc_professions.cpp index 00c9b602c6e..195e6f4b369 100644 --- a/src/bindings/scripts/scripts/npc/npc_professions.cpp +++ b/src/bindings/scripts/scripts/npc/npc_professions.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>.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 @@ -634,8 +634,6 @@ void SendActionMenu_npc_prof_blacksmith(Player *player, Creature *_Creature, uin { //unknown textID (TALK_MUST_UNLEARN_WEAPON) player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID()); - //Temporary, not offilike - _Creature->MonsterSay(TALK_MUST_UNLEARN_WEAPON,0,player->GetGUID()); } else if( EquippedOk(player,S_UNLEARN_WEAPON) ) { @@ -814,6 +812,138 @@ bool GossipSelect_npc_prof_blacksmith(Player *player, Creature *_Creature, uint3 }*/ /*### +# engineering trinkets +###*/ + +enum +{ + NPC_ZAP = 14742, + NPC_JHORDY = 14743, + NPC_KABLAM = 21493, + NPC_SMILES = 21494, + + SPELL_LEARN_TO_EVERLOOK = 23490, + SPELL_LEARN_TO_GADGET = 23491, + SPELL_LEARN_TO_AREA52 = 36956, + SPELL_LEARN_TO_TOSHLEY = 36957, + + SPELL_TO_EVERLOOK = 23486, + SPELL_TO_GADGET = 23489, + SPELL_TO_AREA52 = 36954, + SPELL_TO_TOSHLEY = 36955, + + ITEM_GNOMISH_CARD = 10790, + ITEM_GOBLIN_CARD = 10791 +}; + +#define GOSSIP_ITEM_ZAP "[PH] Unknown" +#define GOSSIP_ITEM_JHORDY "I must build a beacon for this marvelous device!" +#define GOSSIP_ITEM_KABLAM "[PH] Unknown" +#define GOSSIP_ITEM_SMILES "[PH] Unknown" + +bool GossipHello_npc_engineering_tele_trinket(Player* pPlayer, Creature* pCreature) +{ + uint32 NpcTextId = 0; + std::string GossipItem; + bool CanLearn = false; + + if(pPlayer->HasSkill(SKILL_ENGINERING)) + { + switch(pCreature->GetEntry()) + { + case NPC_ZAP: + NpcTextId = 7249; + if(pPlayer->GetBaseSkillValue(SKILL_ENGINERING) >= 260 && pPlayer->HasSpell(S_GOBLIN)) + { + if(!pPlayer->HasSpell(SPELL_TO_EVERLOOK)) + { + CanLearn = true; + GossipItem = GOSSIP_ITEM_ZAP; + } + else if(pPlayer->HasSpell(SPELL_TO_EVERLOOK)) + NpcTextId = 0; + } + break; + case NPC_JHORDY: + NpcTextId = 7251; + if(pPlayer->GetBaseSkillValue(SKILL_ENGINERING) >= 260 && pPlayer->HasSpell(S_GNOMISH)) + { + if(!pPlayer->HasSpell(SPELL_TO_GADGET)) + { + CanLearn = true; + GossipItem = GOSSIP_ITEM_JHORDY; + } + else if(pPlayer->HasSpell(SPELL_TO_GADGET)) + NpcTextId = 7252; + } + break; + case NPC_KABLAM: + NpcTextId = 10365; + if(pPlayer->GetBaseSkillValue(SKILL_ENGINERING) >= 350 && pPlayer->HasSpell(S_GOBLIN)) + { + if(!pPlayer->HasSpell(SPELL_TO_AREA52)) + { + CanLearn = true; + GossipItem = GOSSIP_ITEM_KABLAM; + } + else if(pPlayer->HasSpell(SPELL_TO_AREA52)) + NpcTextId = 0; + } + break; + case NPC_SMILES: + NpcTextId = 10363; + if(pPlayer->GetBaseSkillValue(SKILL_ENGINERING) >= 350 && pPlayer->HasSpell(S_GNOMISH)) + { + if(!pPlayer->HasSpell(SPELL_TO_TOSHLEY)) + { + CanLearn = true; + GossipItem = GOSSIP_ITEM_SMILES; + } + else if(pPlayer->HasSpell(SPELL_TO_TOSHLEY)) + NpcTextId = 0; + } + break; + } + } + + if(CanLearn) + { + if(pPlayer->HasItemCount(ITEM_GOBLIN_CARD,1) || pPlayer->HasItemCount(ITEM_GNOMISH_CARD,1)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GossipItem, pCreature->GetEntry(), GOSSIP_ACTION_INFO_DEF+1); + } + + pPlayer->SEND_GOSSIP_MENU(NpcTextId ? NpcTextId : pCreature->GetNpcTextId(), pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_engineering_tele_trinket(Player* pPlayer, Creature* pCreature, uint32 Sender, uint32 Action) +{ + if(Action == GOSSIP_ACTION_INFO_DEF+1) + pPlayer->CLOSE_GOSSIP_MENU(); + + if(Sender != pCreature->GetEntry()) + return true; + + switch(Sender) + { + case NPC_ZAP: + pPlayer->CastSpell(pPlayer, SPELL_LEARN_TO_EVERLOOK, false); + break; + case NPC_JHORDY: + pPlayer->CastSpell(pPlayer, SPELL_LEARN_TO_GADGET, false); + break; + case NPC_KABLAM: + pPlayer->CastSpell(pPlayer, SPELL_LEARN_TO_AREA52, false); + break; + case NPC_SMILES: + pPlayer->CastSpell(pPlayer, SPELL_LEARN_TO_TOSHLEY, false); + break; + } + + return true; +} + +/*### # start menues leatherworking ###*/ @@ -1186,6 +1316,12 @@ void AddSC_npc_professions() newscript->RegisterSelf(); newscript = new Script; + newscript->Name = "npc_engineering_tele_trinket"; + newscript->pGossipHello = &GossipHello_npc_engineering_tele_trinket; + newscript->pGossipSelect = &GossipSelect_npc_engineering_tele_trinket; + newscript->RegisterSelf(); + + newscript = new Script; newscript->Name="npc_prof_leather"; newscript->pGossipHello = &GossipHello_npc_prof_leather; newscript->pGossipSelect = &GossipSelect_npc_prof_leather; diff --git a/src/bindings/scripts/scripts/npc/npc_taxi.cpp b/src/bindings/scripts/scripts/npc/npc_taxi.cpp new file mode 100644 index 00000000000..b92f5cf2a61 --- /dev/null +++ b/src/bindings/scripts/scripts/npc/npc_taxi.cpp @@ -0,0 +1,254 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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: Npc_Taxi +SD%Complete: 0% +SDComment: To be used for taxi NPCs that are located globally. +SDCategory: NPCs +EndScriptData +*/ + +#include "precompiled.h" + +bool GossipHello_npc_taxi(Player *player, Creature *_Creature) +{ + if (_Creature->isQuestGiver()) + player->PrepareQuestMenu( _Creature->GetGUID() ); + + switch(_Creature->GetEntry()) { + case 17435: // Azuremyst Isle - Susurrus + if (player->HasItemCount(23843,1,true)) + player->ADD_GOSSIP_ITEM(0, "I am ready.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + break; + case 20903: // Netherstorm - Protectorate Nether Drake + if(player->GetQuestStatus(10438) == QUEST_STATUS_INCOMPLETE && player->HasItemCount(29778,1)) + player->ADD_GOSSIP_ITEM(0, "I'm ready to fly! Take me up, dragon!", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + break; + case 18725: // Old Hillsbrad Foothills - Brazen + player->ADD_GOSSIP_ITEM(0, "I am ready to go to Durnholde Keep.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + break; + case 29154: // Stormwind City - Thargold Ironwing + player->ADD_GOSSIP_ITEM(0, "I'd like to take a flight around Stormwind Harbor.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + break; + case 19409: // Hellfire Peninsula - Wing Commander Dabir'ee + //Mission: The Murketh and Shaadraz Gateways + if (player->GetQuestStatus(10146) == QUEST_STATUS_INCOMPLETE) + player->ADD_GOSSIP_ITEM(0, "Fly me to Murketh and Shaadraz Gateways", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4); + + //Shatter Point + if (!player->GetQuestRewardStatus(10340)) + player->ADD_GOSSIP_ITEM(0, "Fly me to Shatter Point", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5); + break; + case 20235: // Hellfire Peninsula - Gryphoneer Windbellow + //Mission: The Abyssal Shelf || Return to the Abyssal Shelf + if (player->GetQuestStatus(10163) == QUEST_STATUS_INCOMPLETE || player->GetQuestStatus(10346) == QUEST_STATUS_INCOMPLETE) + player->ADD_GOSSIP_ITEM(0, "Fly me to The Abyssal Shelf", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6); + + //Go to the Front + if (player->GetQuestStatus(10382) != QUEST_STATUS_NONE && !player->GetQuestRewardStatus(10382)) + player->ADD_GOSSIP_ITEM(0, "Fly me to Honor Point", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7); + break; + case 19401: // Hellfire Peninsula - Wing Commander Brack + //Mission: The Murketh and Shaadraz Gateways + if (player->GetQuestStatus(10129) == QUEST_STATUS_INCOMPLETE) + player->ADD_GOSSIP_ITEM(0, "Fly me to Murketh and Shaadraz Gateways", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8); + + //Mission: The Abyssal Shelf || Return to the Abyssal Shelf + if (player->GetQuestStatus(10162) == QUEST_STATUS_INCOMPLETE || player->GetQuestStatus(10347) == QUEST_STATUS_INCOMPLETE) + player->ADD_GOSSIP_ITEM(0, "Fly me to The Abyssal Shelf", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9); + + //Spinebreaker Post + if (player->GetQuestStatus(10242) == QUEST_STATUS_COMPLETE && !player->GetQuestRewardStatus(10242)) + player->ADD_GOSSIP_ITEM(0, "Fly me to Spinebreaker Post", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10); + break; + case 23413: // Blade's Edge Mountains - Skyguard Handler Irena + if (player->GetReputationRank(1031) >= REP_HONORED) + player->ADD_GOSSIP_ITEM(0, "Fly me to Skettis please", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11); + break; + case 25059: // Isle of Quel'Danas - Ayren Cloudbreaker + if (player->GetQuestStatus(11532) == QUEST_STATUS_INCOMPLETE || player->GetQuestStatus(11533) == QUEST_STATUS_INCOMPLETE) + player->ADD_GOSSIP_ITEM(0, "Speaking of action, I've been ordered to undertake an air strike.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 12); + + if (player->GetQuestStatus(11542) == QUEST_STATUS_INCOMPLETE || player->GetQuestStatus(11543) == QUEST_STATUS_INCOMPLETE) + player->ADD_GOSSIP_ITEM(0, "I need to intercept the Dawnblade reinforcements.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 13); + break; + case 25236: // Isle of Quel'Danas - Unrestrained Dragonhawk + if (player->GetQuestStatus(11542) == QUEST_STATUS_COMPLETE || player->GetQuestStatus(11543) == QUEST_STATUS_COMPLETE) + player->ADD_GOSSIP_ITEM(0, "<Ride the dragonhawk to Sun's Reach>", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 14); + break; + case 20162: // Netherstorm - Veronia + //Behind Enemy Lines + if (player->GetQuestStatus(10652) && !player->GetQuestRewardStatus(10652)) + player->ADD_GOSSIP_ITEM(0, "Fly me to Manaforge Coruu please", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 15); + break; + case 23415: // Terokkar Forest - Skyguard Handler Deesak + if (player->GetReputationRank(1031) >= REP_HONORED) + player->ADD_GOSSIP_ITEM(0, "Fly me to Ogri'la please", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 16); + break; + case 27575: // Dragonblight - Lord Afrasastrasz + // middle -> ground + player->ADD_GOSSIP_ITEM(0, "I would like to take a flight to the ground, Lord Of Afrasastrasz.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 17); + // middle -> top + player->ADD_GOSSIP_ITEM(0, "My Lord, I must go to the upper floor of the temple.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 18); + break; + case 26443: // Dragonblight - Tariolstrasz //need to check if quests are required before gossip available (12123, 12124) + // ground -> top + player->ADD_GOSSIP_ITEM(0, "My Lord, I must go to the upper floor of the temple.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 19); + // ground -> middle + player->ADD_GOSSIP_ITEM(0, "Can you spare a drake to travel to Lord Of Afrasastrasz, in the middle of the temple?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 20); + break; + case 26949: // Dragonblight - Torastrasza + // top -> middle + player->ADD_GOSSIP_ITEM(0, "I would like to see Lord Of Afrasastrasz, in the middle of the temple.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 21); + // top -> ground + player->ADD_GOSSIP_ITEM(0, "Yes, Please. I would like to return to the ground floor of the temple.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 22); + break; + case 23816: // Howling Fjord - Bat Handler Camille + if (!player->GetQuestRewardStatus(11229)) + player->ADD_GOSSIP_ITEM(0, "I need to fly to the Windrunner Official business!", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 23); + if (player->GetQuestStatus(11170) == QUEST_STATUS_INCOMPLETE) + player->ADD_GOSSIP_ITEM(0, "I need to commandeer a riding bat for special assignment for us.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 24); + break; + } + + player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID()); + return true; +} + +bool GossipSelect_npc_taxi(Player *player, Creature *_Creature, uint32 sender, uint32 action ) +{ + switch(action) { + case GOSSIP_ACTION_INFO_DEF: + //spellId is correct, however it gives flight a somewhat funny effect //TaxiPath 506. + player->CLOSE_GOSSIP_MENU(); + player->CastSpell(player,32474,true); + break; + case GOSSIP_ACTION_INFO_DEF + 1: + player->CLOSE_GOSSIP_MENU(); + player->ActivateTaxiPathTo(627); //TaxiPath 627 (possibly 627+628(152->153->154->155) ) + break; + case GOSSIP_ACTION_INFO_DEF + 2: + if( !player->HasItemCount(25853,1) ) { + player->SEND_GOSSIP_MENU(9780, _Creature->GetGUID()); + } else { + player->CLOSE_GOSSIP_MENU(); + player->ActivateTaxiPathTo(534); //TaxiPath 534 + } + break; + case GOSSIP_ACTION_INFO_DEF + 3: + player->CLOSE_GOSSIP_MENU(); + player->GetSession()->SendDoFlight(1149, 1041); + break; + case GOSSIP_ACTION_INFO_DEF + 4: + player->CLOSE_GOSSIP_MENU(); + player->CastSpell(player,33768,true); //TaxiPath 585 (Gateways Murket and Shaadraz) + break; + case GOSSIP_ACTION_INFO_DEF + 5: + player->CLOSE_GOSSIP_MENU(); + player->CastSpell(player,35069,true); //TaxiPath 612 (Taxi - Hellfire Peninsula - Expedition Point to Shatter Point) + break; + case GOSSIP_ACTION_INFO_DEF + 6: + player->CLOSE_GOSSIP_MENU(); + player->CastSpell(player,33899,true); //TaxiPath 589 (Aerial Assault Flight (Alliance)) + break; + case GOSSIP_ACTION_INFO_DEF + 7: + player->CLOSE_GOSSIP_MENU(); + player->CastSpell(player,35065,true); //TaxiPath 607 (Taxi - Hellfire Peninsula - Shatter Point to Beach Head) + break; + case GOSSIP_ACTION_INFO_DEF + 8: + player->CLOSE_GOSSIP_MENU(); + player->CastSpell(player,33659,true); //TaxiPath 584 (Gateways Murket and Shaadraz) + break; + case GOSSIP_ACTION_INFO_DEF + 9: + player->CLOSE_GOSSIP_MENU(); + player->CastSpell(player,33825,true); //TaxiPath 587 (Aerial Assault Flight (Horde)) + break; + case GOSSIP_ACTION_INFO_DEF + 10: + player->CLOSE_GOSSIP_MENU(); + player->CastSpell(player,34578,true); //TaxiPath 604 (Taxi - Reaver's Fall to Spinebreaker Ridge) + break; + case GOSSIP_ACTION_INFO_DEF + 11: + player->CLOSE_GOSSIP_MENU(); + player->CastSpell(player,41278,true); //TaxiPath 706 + break; + case GOSSIP_ACTION_INFO_DEF + 12: + player->CLOSE_GOSSIP_MENU(); + player->CastSpell(player,45071,true); //TaxiPath 779 + break; + case GOSSIP_ACTION_INFO_DEF + 13: + player->CLOSE_GOSSIP_MENU(); + player->CastSpell(player,45113,true); //TaxiPath 784 + break; + case GOSSIP_ACTION_INFO_DEF + 14: + player->CLOSE_GOSSIP_MENU(); + player->CastSpell(player,45353,true); //TaxiPath 788 + break; + case GOSSIP_ACTION_INFO_DEF + 15: + player->CLOSE_GOSSIP_MENU(); + player->CastSpell(player,34905,true); //TaxiPath 606 + break; + case GOSSIP_ACTION_INFO_DEF + 16: + player->CLOSE_GOSSIP_MENU(); + player->CastSpell(player,41279,true); //TaxiPath 705 (Taxi - Skettis to Skyguard Outpost) + break; + case GOSSIP_ACTION_INFO_DEF + 17: + player->CLOSE_GOSSIP_MENU(); + player->ActivateTaxiPathTo(882); + break; + case GOSSIP_ACTION_INFO_DEF + 18: + player->CLOSE_GOSSIP_MENU(); + player->ActivateTaxiPathTo(881); + break; + case GOSSIP_ACTION_INFO_DEF + 19: + player->CLOSE_GOSSIP_MENU(); + player->ActivateTaxiPathTo(878); + break; + case GOSSIP_ACTION_INFO_DEF + 20: + player->CLOSE_GOSSIP_MENU(); + player->ActivateTaxiPathTo(883); + break; + case GOSSIP_ACTION_INFO_DEF + 21: + player->CLOSE_GOSSIP_MENU(); + player->ActivateTaxiPathTo(880); + break; + case GOSSIP_ACTION_INFO_DEF + 22: + player->CLOSE_GOSSIP_MENU(); + player->ActivateTaxiPathTo(879); + break; + case GOSSIP_ACTION_INFO_DEF + 23: + player->CLOSE_GOSSIP_MENU(); + player->CastSpell(player,43074,true); //TaxiPath 736 + break; + case GOSSIP_ACTION_INFO_DEF + 24: + player->CLOSE_GOSSIP_MENU(); + player->ActivateTaxiPathTo(738); + break; + } + + return true; +} + +void AddSC_npc_taxi() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="npc_taxi"; + newscript->pGossipHello = &GossipHello_npc_taxi; + newscript->pGossipSelect = &GossipSelect_npc_taxi; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/npc/npcs_special.cpp b/src/bindings/scripts/scripts/npc/npcs_special.cpp index c5269eb0973..3c0429ee4f3 100644 --- a/src/bindings/scripts/scripts/npc/npcs_special.cpp +++ b/src/bindings/scripts/scripts/npc/npcs_special.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>.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 @@ -17,7 +17,7 @@ /* ScriptData SDName: Npcs_Special SD%Complete: 100 -SDComment: To be used for special NPCs that are located globally. Support for quest 3861 (Cluck!), 6622 and 6624 (Triage) +SDComment: To be used for special NPCs that are located globally. SDCategory: NPCs EndScriptData */ @@ -26,8 +26,10 @@ EndScriptData npc_chicken_cluck 100% support for quest 3861 (Cluck!) npc_dancing_flames 100% midsummer event NPC npc_guardian 100% guardianAI used to prevent players from accessing off-limits areas. Not in use by SD2 +npc_garments_of_quests 80% NPC's related to all Garments of-quests 5621, 5624, 5625, 5648, 565 npc_injured_patient 100% patients for triage-quests (6622 and 6624) npc_doctor 100% Gustaf Vanhowzen and Gregory Victor, quest 6622 and 6624 (Triage) +npc_kingdom_of_dalaran_quests Misc NPC's gossip option related to quests 12791, 12794 and 12796 npc_mount_vendor 100% Regular mount vendors all over the world. Display gossip if player doesn't meet the requirements to buy npc_rogue_trainer 80% Scripted trainers, so they are able to offer item 17126 for class quest 6681 npc_sayge 100% Darkmoon event fortune teller, buff player based on answers given @@ -35,15 +37,17 @@ npc_snake_trap_serpents 80% AI for snakes that summoned by Snake Trap EndContentData */ #include "precompiled.h" +#include "../npc/npc_escortAI.h" /*######## # npc_chicken_cluck #########*/ +#define EMOTE_A_HELLO -1070004 +#define EMOTE_H_HELLO -1070005 +#define EMOTE_CLUCK_TEXT2 -1070006 + #define QUEST_CLUCK 3861 -#define EMOTE_A_HELLO "looks up at you quizzically. Maybe you should inspect it?" -#define EMOTE_H_HELLO "looks at you unexpectadly." -#define CLUCK_TEXT2 "starts pecking at the feed." #define FACTION_FRIENDLY 84 #define FACTION_CHICKEN 31 @@ -61,7 +65,7 @@ struct TRINITY_DLL_DECL npc_chicken_cluckAI : public ScriptedAI m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER); } - void Aggro(Unit *who) {} + void EnterCombat(Unit *who) {} void UpdateAI(const uint32 diff) { @@ -78,46 +82,43 @@ struct TRINITY_DLL_DECL npc_chicken_cluckAI : public ScriptedAI if(UpdateVictim()) DoMeleeAttackIfReady(); } -}; - -CreatureAI* GetAI_npc_chicken_cluck(Creature *_Creature) -{ - return new npc_chicken_cluckAI(_Creature); -} -bool ReceiveEmote_npc_chicken_cluck( Player *player, Creature *_Creature, uint32 emote ) -{ - if( emote == TEXTEMOTE_CHICKEN ) + void ReceiveEmote( Player *player, uint32 emote ) { - if( player->GetTeam() == ALLIANCE ) + if( emote == TEXTEMOTE_CHICKEN ) { - if( rand()%30 == 1 ) + if( player->GetTeam() == ALLIANCE ) { - if( player->GetQuestStatus(QUEST_CLUCK) == QUEST_STATUS_NONE ) + if( rand()%30 == 1 ) { - _Creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER); - _Creature->setFaction(FACTION_FRIENDLY); - _Creature->MonsterTextEmote(EMOTE_A_HELLO, 0); + if( player->GetQuestStatus(QUEST_CLUCK) == QUEST_STATUS_NONE ) + { + m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER); + m_creature->setFaction(FACTION_FRIENDLY); + DoScriptText(EMOTE_A_HELLO, m_creature); + } } - } - } else - _Creature->MonsterTextEmote(EMOTE_H_HELLO,0); - } - if( emote == TEXTEMOTE_CHEER && player->GetTeam() == ALLIANCE ) - if( player->GetQuestStatus(QUEST_CLUCK) == QUEST_STATUS_COMPLETE ) - { - _Creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER); - _Creature->setFaction(FACTION_FRIENDLY); - _Creature->MonsterTextEmote(CLUCK_TEXT2, 0); + } else DoScriptText(EMOTE_H_HELLO,m_creature); + } + if( emote == TEXTEMOTE_CHEER && player->GetTeam() == ALLIANCE ) + if( player->GetQuestStatus(QUEST_CLUCK) == QUEST_STATUS_COMPLETE ) + { + m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER); + m_creature->setFaction(FACTION_FRIENDLY); + DoScriptText(EMOTE_CLUCK_TEXT2, m_creature); + } } +}; - return true; +CreatureAI* GetAI_npc_chicken_cluck(Creature *_Creature) +{ + return new npc_chicken_cluckAI(_Creature); } bool QuestAccept_npc_chicken_cluck(Player *player, Creature *_Creature, const Quest *_Quest ) { if(_Quest->GetQuestId() == QUEST_CLUCK) - ((npc_chicken_cluckAI*)_Creature->AI())->Reset(); + CAST_AI(npc_chicken_cluckAI, _Creature->AI())->Reset(); return true; } @@ -125,7 +126,7 @@ bool QuestAccept_npc_chicken_cluck(Player *player, Creature *_Creature, const Qu bool QuestComplete_npc_chicken_cluck(Player *player, Creature *_Creature, const Quest *_Quest) { if(_Quest->GetQuestId() == QUEST_CLUCK) - ((npc_chicken_cluckAI*)_Creature->AI())->Reset(); + CAST_AI(npc_chicken_cluckAI, _Creature->AI())->Reset(); return true; } @@ -154,7 +155,7 @@ struct TRINITY_DLL_DECL npc_dancing_flamesAI : public ScriptedAI float x, y, z; m_creature->GetPosition(x,y,z); m_creature->Relocate(x,y,z + 0.94f); - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_LEVITATING); + m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); m_creature->HandleEmoteCommand(EMOTE_ONESHOT_DANCE); WorldPacket data; //send update position to client m_creature->BuildHeartBeatMsg(&data); @@ -173,115 +174,84 @@ struct TRINITY_DLL_DECL npc_dancing_flamesAI : public ScriptedAI } } - void Aggro(Unit* who){} -}; + void EnterCombat(Unit* who){} -CreatureAI* GetAI_npc_dancing_flames(Creature *_Creature) -{ - return new npc_dancing_flamesAI(_Creature); -} - -bool ReceiveEmote_npc_dancing_flames( Player *player, Creature *flame, uint32 emote ) -{ - if ( ((npc_dancing_flamesAI*)flame->AI())->active && - flame->IsWithinLOS(player->GetPositionX(),player->GetPositionY(),player->GetPositionZ()) && flame->IsWithinDistInMap(player,30.0f)) + void ReceiveEmote( Player *player, uint32 emote ) { - flame->SetInFront(player); - ((npc_dancing_flamesAI*)flame->AI())->active = false; - - WorldPacket data; - flame->BuildHeartBeatMsg(&data); - flame->SendMessageToSet(&data,true); - switch(emote) + if (m_creature->IsWithinLOS(player->GetPositionX(),player->GetPositionY(),player->GetPositionZ()) && m_creature->IsWithinDistInMap(player,30.0f)) { - case TEXTEMOTE_KISS: flame->HandleEmoteCommand(EMOTE_ONESHOT_SHY); break; - case TEXTEMOTE_WAVE: flame->HandleEmoteCommand(EMOTE_ONESHOT_WAVE); break; - case TEXTEMOTE_BOW: flame->HandleEmoteCommand(EMOTE_ONESHOT_BOW); break; - case TEXTEMOTE_JOKE: flame->HandleEmoteCommand(EMOTE_ONESHOT_LAUGH); break; - case TEXTEMOTE_DANCE: + m_creature->SetInFront(player); + active = false; + + WorldPacket data; + m_creature->BuildHeartBeatMsg(&data); + m_creature->SendMessageToSet(&data,true); + switch(emote) { - if (!player->HasAura(SPELL_SEDUCTION,0)) - flame->CastSpell(player,SPELL_SEDUCTION,true); + case TEXTEMOTE_KISS: m_creature->HandleEmoteCommand(EMOTE_ONESHOT_SHY); break; + case TEXTEMOTE_WAVE: m_creature->HandleEmoteCommand(EMOTE_ONESHOT_WAVE); break; + case TEXTEMOTE_BOW: m_creature->HandleEmoteCommand(EMOTE_ONESHOT_BOW); break; + case TEXTEMOTE_JOKE: m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LAUGH); break; + case TEXTEMOTE_DANCE: + { + if (!player->HasAura(SPELL_SEDUCTION)) + m_creature->CastSpell(player,SPELL_SEDUCTION,true); + } + break; } - break; } } - return true; +}; + +CreatureAI* GetAI_npc_dancing_flames(Creature *_Creature) +{ + return new npc_dancing_flamesAI(_Creature); } /*###### ## Triage quest ######*/ -#define SAY_DOC1 "I'm saved! Thank you, doctor!" -#define SAY_DOC2 "HOORAY! I AM SAVED!" -#define SAY_DOC3 "Sweet, sweet embrace... take me..." +#define SAY_DOC1 -1000201 +#define SAY_DOC2 -1000202 +#define SAY_DOC3 -1000203 + +#define DOCTOR_ALLIANCE 12939 +#define DOCTOR_HORDE 12920 +#define ALLIANCE_COORDS 7 +#define HORDE_COORDS 6 struct Location { float x, y, z, o; }; -#define DOCTOR_ALLIANCE 12939 - static Location AllianceCoords[]= { - { // Top-far-right bunk as seen from entrance - -3757.38, -4533.05, 14.16, 3.62 - }, - { // Top-far-left bunk - -3754.36, -4539.13, 14.16, 5.13 - }, - { // Far-right bunk - -3749.54, -4540.25, 14.28, 3.34 - }, - { // Right bunk near entrance - -3742.10, -4536.85, 14.28, 3.64 - }, - { // Far-left bunk - -3755.89, -4529.07, 14.05, 0.57 - }, - { // Mid-left bunk - -3749.51, -4527.08, 14.07, 5.26 - }, - { // Left bunk near entrance - -3746.37, -4525.35, 14.16, 5.22 - }, + {-3757.38, -4533.05, 14.16, 3.62}, // Top-far-right bunk as seen from entrance + {-3754.36, -4539.13, 14.16, 5.13}, // Top-far-left bunk + {-3749.54, -4540.25, 14.28, 3.34}, // Far-right bunk + {-3742.10, -4536.85, 14.28, 3.64}, // Right bunk near entrance + {-3755.89, -4529.07, 14.05, 0.57}, // Far-left bunk + {-3749.51, -4527.08, 14.07, 5.26}, // Mid-left bunk + {-3746.37, -4525.35, 14.16, 5.22}, // Left bunk near entrance }; -#define ALLIANCE_COORDS 7 - //alliance run to where #define A_RUNTOX -3742.96 #define A_RUNTOY -4531.52 #define A_RUNTOZ 11.91 -#define DOCTOR_HORDE 12920 - static Location HordeCoords[]= { - { // Left, Behind - -1013.75, -3492.59, 62.62, 4.34 - }, - { // Right, Behind - -1017.72, -3490.92, 62.62, 4.34 - }, - { // Left, Mid - -1015.77, -3497.15, 62.82, 4.34 - }, - { // Right, Mid - -1019.51, -3495.49, 62.82, 4.34 - }, - { // Left, front - -1017.25, -3500.85, 62.98, 4.34 - }, - { // Right, Front - -1020.95, -3499.21, 62.98, 4.34 - } + {-1013.75, -3492.59, 62.62, 4.34}, // Left, Behind + {-1017.72, -3490.92, 62.62, 4.34}, // Right, Behind + {-1015.77, -3497.15, 62.82, 4.34}, // Left, Mid + {-1019.51, -3495.49, 62.82, 4.34}, // Right, Mid + {-1017.25, -3500.85, 62.98, 4.34}, // Left, front + {-1020.95, -3499.21, 62.98, 4.34} // Right, Front }; -#define HORDE_COORDS 6 - //horde run to where #define H_RUNTOX -1016.44 #define H_RUNTOY -3508.48 @@ -307,6 +277,8 @@ const uint32 HordeSoldierId[3] = struct TRINITY_DLL_DECL npc_doctorAI : public ScriptedAI { + npc_doctorAI(Creature *c) : ScriptedAI(c) {} + uint64 Playerguid; uint32 SummonPatient_Timer; @@ -319,16 +291,24 @@ struct TRINITY_DLL_DECL npc_doctorAI : public ScriptedAI std::list<uint64> Patients; std::vector<Location*> Coordinates; - npc_doctorAI(Creature *c) : ScriptedAI(c) {} + void Reset() + { + Playerguid = 0; + + SummonPatient_Timer = 10000; + SummonPatientCount = 0; + PatientDiedCount = 0; + PatientSavedCount = 0; - void Reset(){} + Event = false; + } void BeginEvent(Player* player); void PatientDied(Location* Point); void PatientSaved(Creature* soldier, Player* player, Location* Point); void UpdateAI(const uint32 diff); - void Aggro(Unit* who){} + void EnterCombat(Unit* who){} }; /*##### @@ -340,20 +320,21 @@ struct TRINITY_DLL_DECL npc_injured_patientAI : public ScriptedAI npc_injured_patientAI(Creature *c) : ScriptedAI(c) {} uint64 Doctorguid; - Location* Coord; void Reset() { Doctorguid = 0; - Coord = NULL; - //no select + + //no select m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - //no regen health + + //no regen health m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT); - //to make them lay with face down - m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, PLAYER_STATE_DEAD); + + //to make them lay with face down + m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_DEAD); uint32 mobId = m_creature->GetEntry(); @@ -374,31 +355,40 @@ struct TRINITY_DLL_DECL npc_injured_patientAI : public ScriptedAI } } - void Aggro(Unit* who){} + void EnterCombat(Unit* who){} void SpellHit(Unit *caster, const SpellEntry *spell) { if (caster->GetTypeId() == TYPEID_PLAYER && m_creature->isAlive() && spell->Id == 20804) { - if( (((Player*)caster)->GetQuestStatus(6624) == QUEST_STATUS_INCOMPLETE) || (((Player*)caster)->GetQuestStatus(6622) == QUEST_STATUS_INCOMPLETE)) + if((CAST_PLR(caster)->GetQuestStatus(6624) == QUEST_STATUS_INCOMPLETE) || (CAST_PLR(caster)->GetQuestStatus(6622) == QUEST_STATUS_INCOMPLETE)) { - if(Doctorguid) + if (Doctorguid) { - Creature* Doctor = (Unit::GetCreature((*m_creature), Doctorguid)); - if(Doctor) - ((npc_doctorAI*)Doctor->AI())->PatientSaved(m_creature, ((Player*)caster), Coord); + if(Creature* Doctor = Unit::GetCreature(*m_creature, Doctorguid)) + CAST_AI(npc_doctorAI, Doctor->AI())->PatientSaved(m_creature, CAST_PLR(caster), Coord); } } - //make not selectable + + //make not selectable m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - //regen health + + //regen health m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT); - //stand up - m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, PLAYER_STATE_NONE); - DoSay(SAY_DOC1,LANG_UNIVERSAL,NULL); + + //stand up + m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_STAND); + + switch(rand()%3) + { + case 0: DoScriptText(SAY_DOC1,m_creature); break; + case 1: DoScriptText(SAY_DOC2,m_creature); break; + case 2: DoScriptText(SAY_DOC3,m_creature); break; + } uint32 mobId = m_creature->GetEntry(); m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + switch (mobId) { case 12923: @@ -418,8 +408,9 @@ struct TRINITY_DLL_DECL npc_injured_patientAI : public ScriptedAI void UpdateAI(const uint32 diff) { + //lower HP on every world tick makes it a useful counter, not officlone though if (m_creature->isAlive() && m_creature->GetHealth() > 6) - { //lower HP on every world tick makes it a useful counter, not officlone though + { m_creature->SetHealth(uint32(m_creature->GetHealth()-5) ); } @@ -430,11 +421,10 @@ struct TRINITY_DLL_DECL npc_injured_patientAI : public ScriptedAI m_creature->setDeathState(JUST_DIED); m_creature->SetFlag(UNIT_DYNAMIC_FLAGS, 32); - if(Doctorguid) + if (Doctorguid) { - Creature* Doctor = (Unit::GetCreature((*m_creature), Doctorguid)); - if(Doctor) - ((npc_doctorAI*)Doctor->AI())->PatientDied(Coord); + if(Creature* Doctor = Unit::GetCreature((*m_creature), Doctorguid)) + CAST_AI(npc_doctorAI, Doctor->AI())->PatientDied(Coord); } } } @@ -464,7 +454,6 @@ void npc_doctorAI::BeginEvent(Player* player) for(uint8 i = 0; i < ALLIANCE_COORDS; ++i) Coordinates.push_back(&AllianceCoords[i]); break; - case DOCTOR_HORDE: for(uint8 i = 0; i < HORDE_COORDS; ++i) Coordinates.push_back(&HordeCoords[i]); @@ -472,7 +461,6 @@ void npc_doctorAI::BeginEvent(Player* player) } Event = true; - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); } @@ -491,6 +479,7 @@ void npc_doctorAI::PatientDied(Location* Point) Event = false; m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + Reset(); } Coordinates.push_back(Point); @@ -499,31 +488,31 @@ void npc_doctorAI::PatientDied(Location* Point) void npc_doctorAI::PatientSaved(Creature* soldier, Player* player, Location* Point) { - if(player && Playerguid == player->GetGUID()) + if (player && Playerguid == player->GetGUID()) { - if((player->GetQuestStatus(6624) == QUEST_STATUS_INCOMPLETE) || (player->GetQuestStatus(6622) == QUEST_STATUS_INCOMPLETE)) + if ((player->GetQuestStatus(6624) == QUEST_STATUS_INCOMPLETE) || (player->GetQuestStatus(6622) == QUEST_STATUS_INCOMPLETE)) { PatientSavedCount++; - if(PatientSavedCount == 15) + if (PatientSavedCount == 15) { - if(!Patients.empty()) + if (!Patients.empty()) { std::list<uint64>::iterator itr; for(itr = Patients.begin(); itr != Patients.end(); ++itr) { - Creature* Patient = (Unit::GetCreature((*m_creature), *itr)); - if( Patient ) + if(Creature* Patient = Unit::GetCreature((*m_creature), *itr)) Patient->setDeathState(JUST_DIED); } } - if(player->GetQuestStatus(6624) == QUEST_STATUS_INCOMPLETE) + if (player->GetQuestStatus(6624) == QUEST_STATUS_INCOMPLETE) player->AreaExploredOrEventHappens(6624); - else if(player->GetQuestStatus(6622) == QUEST_STATUS_INCOMPLETE) + else if (player->GetQuestStatus(6622) == QUEST_STATUS_INCOMPLETE) player->AreaExploredOrEventHappens(6622); Event = false; m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + Reset(); } Coordinates.push_back(Point); @@ -533,54 +522,62 @@ void npc_doctorAI::PatientSaved(Creature* soldier, Player* player, Location* Poi void npc_doctorAI::UpdateAI(const uint32 diff) { - if(Event && SummonPatientCount >= 20) + if (Event && SummonPatientCount >= 20) { Event = false; m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + Reset(); } - if(Event) - if(SummonPatient_Timer < diff) + if (Event) { - Creature* Patient = NULL; - Location* Point = NULL; + if (SummonPatient_Timer < diff) + { + Creature* Patient = NULL; + Location* Point = NULL; - if(Coordinates.empty()) - return; + if (Coordinates.empty()) + return; - std::vector<Location*>::iterator itr = Coordinates.begin()+rand()%Coordinates.size(); - uint32 patientEntry = 0; + std::vector<Location*>::iterator itr = Coordinates.begin()+rand()%Coordinates.size(); + uint32 patientEntry = 0; - switch(m_creature->GetEntry()) - { - case DOCTOR_ALLIANCE: patientEntry = AllianceSoldierId[rand()%3]; break; - case DOCTOR_HORDE: patientEntry = HordeSoldierId[rand()%3]; break; - default: - error_log("TSCR: Invalid entry for Triage doctor. Please check your database"); - return; - } + switch(m_creature->GetEntry()) + { + case DOCTOR_ALLIANCE: patientEntry = AllianceSoldierId[rand()%3]; break; + case DOCTOR_HORDE: patientEntry = HordeSoldierId[rand()%3]; break; + default: + error_log("TSCR: Invalid entry for Triage doctor. Please check your database"); + return; + } - Point = *itr; + Point = *itr; - Patient = m_creature->SummonCreature(patientEntry, Point->x, Point->y, Point->z, Point->o, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + Patient = m_creature->SummonCreature(patientEntry, Point->x, Point->y, Point->z, Point->o, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); - if(Patient) - { - Patients.push_back(Patient->GetGUID()); - ((npc_injured_patientAI*)Patient->AI())->Doctorguid = m_creature->GetGUID(); - if(Point) - ((npc_injured_patientAI*)Patient->AI())->Coord = Point; - Coordinates.erase(itr); - } - SummonPatient_Timer = 10000; - SummonPatientCount++; - }else SummonPatient_Timer -= diff; + if (Patient) + { + //303, this flag appear to be required for client side item->spell to work (TARGET_SINGLE_FRIEND) + Patient->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE); + + Patients.push_back(Patient->GetGUID()); + CAST_AI(npc_injured_patientAI, Patient->AI())->Doctorguid = m_creature->GetGUID(); + + if (Point) + CAST_AI(npc_injured_patientAI, Patient->AI())->Coord = Point; + + Coordinates.erase(itr); + } + SummonPatient_Timer = 10000; + SummonPatientCount++; + }else SummonPatient_Timer -= diff; + } } bool QuestAccept_npc_doctor(Player *player, Creature *creature, Quest const *quest ) { - if((quest->GetQuestId() == 6624) || (quest->GetQuestId() == 6622)) - ((npc_doctorAI*)creature->AI())->BeginEvent(player); + if ((quest->GetQuestId() == 6624) || (quest->GetQuestId() == 6622)) + CAST_AI(npc_doctorAI, creature->AI())->BeginEvent(player); return true; } @@ -591,11 +588,226 @@ CreatureAI* GetAI_npc_doctor(Creature *_Creature) } /*###### +## npc_garments_of_quests +######*/ + +//TODO: get text for each NPC + +enum +{ + SPELL_LESSER_HEAL_R2 = 2052, + SPELL_FORTITUDE_R1 = 1243, + + QUEST_MOON = 5621, + QUEST_LIGHT_1 = 5624, + QUEST_LIGHT_2 = 5625, + QUEST_SPIRIT = 5648, + QUEST_DARKNESS = 5650, + + ENTRY_SHAYA = 12429, + ENTRY_ROBERTS = 12423, + ENTRY_DOLF = 12427, + ENTRY_KORJA = 12430, + ENTRY_DG_KEL = 12428, + + SAY_COMMON_HEALED = -1000164, + SAY_DG_KEL_THANKS = -1000165, + SAY_DG_KEL_GOODBYE = -1000166, + SAY_ROBERTS_THANKS = -1000167, + SAY_ROBERTS_GOODBYE = -1000168, + SAY_KORJA_THANKS = -1000169, + SAY_KORJA_GOODBYE = -1000170, + SAY_DOLF_THANKS = -1000171, + SAY_DOLF_GOODBYE = -1000172, + SAY_SHAYA_THANKS = -1000173, + SAY_SHAYA_GOODBYE = -1000174, +}; + +struct TRINITY_DLL_DECL npc_garments_of_questsAI : public npc_escortAI +{ + npc_garments_of_questsAI(Creature *c) : npc_escortAI(c) {Reset();} + + uint64 caster; + + bool bIsHealed; + bool bCanRun; + + uint32 RunAwayTimer; + + void Reset() + { + caster = 0; + + bIsHealed = false; + bCanRun = false; + + RunAwayTimer = 5000; + + m_creature->SetStandState(UNIT_STAND_STATE_KNEEL); + //expect database to have RegenHealth=0 + m_creature->SetHealth(int(m_creature->GetMaxHealth()*0.7)); + } + + void EnterCombat(Unit *who) {} + + void SpellHit(Unit* pCaster, const SpellEntry *Spell) + { + if (Spell->Id == SPELL_LESSER_HEAL_R2 || Spell->Id == SPELL_FORTITUDE_R1) + { + //not while in combat + if (m_creature->isInCombat()) + return; + + //nothing to be done now + if (bIsHealed && bCanRun) + return; + + if (pCaster->GetTypeId() == TYPEID_PLAYER) + { + switch(m_creature->GetEntry()) + { + case ENTRY_SHAYA: + if (CAST_PLR(pCaster)->GetQuestStatus(QUEST_MOON) == QUEST_STATUS_INCOMPLETE) + { + if (bIsHealed && !bCanRun && Spell->Id == SPELL_FORTITUDE_R1) + { + DoScriptText(SAY_SHAYA_THANKS,m_creature,pCaster); + bCanRun = true; + } + else if (!bIsHealed && Spell->Id == SPELL_LESSER_HEAL_R2) + { + caster = pCaster->GetGUID(); + m_creature->SetStandState(UNIT_STAND_STATE_STAND); + DoScriptText(SAY_COMMON_HEALED,m_creature,pCaster); + bIsHealed = true; + } + } + break; + case ENTRY_ROBERTS: + if (CAST_PLR(pCaster)->GetQuestStatus(QUEST_LIGHT_1) == QUEST_STATUS_INCOMPLETE) + { + if (bIsHealed && !bCanRun && Spell->Id == SPELL_FORTITUDE_R1) + { + DoScriptText(SAY_ROBERTS_THANKS,m_creature,pCaster); + bCanRun = true; + } + else if (!bIsHealed && Spell->Id == SPELL_LESSER_HEAL_R2) + { + caster = pCaster->GetGUID(); + m_creature->SetStandState(UNIT_STAND_STATE_STAND); + DoScriptText(SAY_COMMON_HEALED,m_creature,pCaster); + bIsHealed = true; + } + } + break; + case ENTRY_DOLF: + if (CAST_PLR(pCaster)->GetQuestStatus(QUEST_LIGHT_2) == QUEST_STATUS_INCOMPLETE) + { + if (bIsHealed && !bCanRun && Spell->Id == SPELL_FORTITUDE_R1) + { + DoScriptText(SAY_DOLF_THANKS,m_creature,pCaster); + bCanRun = true; + } + else if (!bIsHealed && Spell->Id == SPELL_LESSER_HEAL_R2) + { + caster = pCaster->GetGUID(); + m_creature->SetStandState(UNIT_STAND_STATE_STAND); + DoScriptText(SAY_COMMON_HEALED,m_creature,pCaster); + bIsHealed = true; + } + } + break; + case ENTRY_KORJA: + if (CAST_PLR(pCaster)->GetQuestStatus(QUEST_SPIRIT) == QUEST_STATUS_INCOMPLETE) + { + if (bIsHealed && !bCanRun && Spell->Id == SPELL_FORTITUDE_R1) + { + DoScriptText(SAY_KORJA_THANKS,m_creature,pCaster); + bCanRun = true; + } + else if (!bIsHealed && Spell->Id == SPELL_LESSER_HEAL_R2) + { + caster = pCaster->GetGUID(); + m_creature->SetStandState(UNIT_STAND_STATE_STAND); + DoScriptText(SAY_COMMON_HEALED,m_creature,pCaster); + bIsHealed = true; + } + } + break; + case ENTRY_DG_KEL: + if (CAST_PLR(pCaster)->GetQuestStatus(QUEST_DARKNESS) == QUEST_STATUS_INCOMPLETE) + { + if (bIsHealed && !bCanRun && Spell->Id == SPELL_FORTITUDE_R1) + { + DoScriptText(SAY_DG_KEL_THANKS,m_creature,pCaster); + bCanRun = true; + } + else if (!bIsHealed && Spell->Id == SPELL_LESSER_HEAL_R2) + { + caster = pCaster->GetGUID(); + m_creature->SetStandState(UNIT_STAND_STATE_STAND); + DoScriptText(SAY_COMMON_HEALED,m_creature,pCaster); + bIsHealed = true; + } + } + break; + } + + //give quest credit, not expect any special quest objectives + if (bCanRun) + CAST_PLR(pCaster)->TalkedToCreature(m_creature->GetEntry(),m_creature->GetGUID()); + } + } + } + + void WaypointReached(uint32 uiPoint) + { + } + + void UpdateAI(const uint32 diff) + { + if (bCanRun && !m_creature->isInCombat()) + { + if (RunAwayTimer <= diff) + { + if (Unit *pUnit = Unit::GetUnit(*m_creature,caster)) + { + switch(m_creature->GetEntry()) + { + case ENTRY_SHAYA: DoScriptText(SAY_SHAYA_GOODBYE,m_creature,pUnit); break; + case ENTRY_ROBERTS: DoScriptText(SAY_ROBERTS_GOODBYE,m_creature,pUnit); break; + case ENTRY_DOLF: DoScriptText(SAY_DOLF_GOODBYE,m_creature,pUnit); break; + case ENTRY_KORJA: DoScriptText(SAY_KORJA_GOODBYE,m_creature,pUnit); break; + case ENTRY_DG_KEL: DoScriptText(SAY_DG_KEL_GOODBYE,m_creature,pUnit); break; + } + + Start(false,true,true); + } + else + EnterEvadeMode(); //something went wrong + + RunAwayTimer = 30000; + }else RunAwayTimer -= diff; + } + + npc_escortAI::UpdateAI(diff); + } +}; + +CreatureAI* GetAI_npc_garments_of_quests(Creature* pCreature) +{ + npc_garments_of_questsAI* tempAI = new npc_garments_of_questsAI(pCreature); + + tempAI->FillPointMovementListForCreature(); + + return tempAI; +} + +/*###### ## npc_guardian ######*/ #define SPELL_DEATHTOUCH 5 -#define SAY_AGGRO "This area is closed!" struct TRINITY_DLL_DECL npc_guardianAI : public ScriptedAI { @@ -606,9 +818,8 @@ struct TRINITY_DLL_DECL npc_guardianAI : public ScriptedAI m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { - DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL); } void UpdateAI(const uint32 diff) @@ -630,6 +841,44 @@ CreatureAI* GetAI_npc_guardian(Creature *_Creature) } /*###### +## npc_kingdom_of_dalaran_quests +######*/ + +enum +{ + SPELL_TELEPORT_DALARAN = 53360, + ITEM_KT_SIGNET = 39740, + QUEST_MAGICAL_KINGDOM_A = 12794, + QUEST_MAGICAL_KINGDOM_H = 12791, + QUEST_MAGICAL_KINGDOM_N = 12796 +}; + +#define GOSSIP_ITEM_TELEPORT_TO "I am ready to be teleported to Dalaran." + +bool GossipHello_npc_kingdom_of_dalaran_quests(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->HasItemCount(ITEM_KT_SIGNET,1) && (!pPlayer->GetQuestRewardStatus(QUEST_MAGICAL_KINGDOM_A) || + !pPlayer->GetQuestRewardStatus(QUEST_MAGICAL_KINGDOM_H) || !pPlayer->GetQuestRewardStatus(QUEST_MAGICAL_KINGDOM_N))) + pPlayer->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_TELEPORT_TO, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_kingdom_of_dalaran_quests(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + { + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->CastSpell(pPlayer,SPELL_TELEPORT_DALARAN,false); + } + return true; +} + +/*###### ## npc_mount_vendor ######*/ @@ -900,7 +1149,7 @@ struct TRINITY_DLL_DECL npc_steam_tonkAI : public ScriptedAI npc_steam_tonkAI(Creature *c) : ScriptedAI(c) {} void Reset() {} - void Aggro(Unit *who) {} + void EnterCombat(Unit *who) {} void OnPossess(bool apply) { @@ -939,7 +1188,7 @@ struct TRINITY_DLL_DECL npc_tonk_mineAI : public ScriptedAI ExplosionTimer = 3000; } - void Aggro(Unit *who) {} + void EnterCombat(Unit *who) {} void AttackStart(Unit *who) {} void MoveInLineOfSight(Unit *who) {} @@ -966,7 +1215,7 @@ CreatureAI* GetAI_npc_tonk_mine(Creature *_Creature) bool ReceiveEmote_npc_winter_reveler( Player *player, Creature *_Creature, uint32 emote ) { //TODO: check auralist. - if(player->HasAura(26218, 0)) + if(player->HasAura(26218)) return false; if( emote == TEXTEMOTE_KISS ) @@ -1018,7 +1267,7 @@ struct TRINITY_DLL_DECL npc_snake_trap_serpentsAI : public ScriptedAI Unit *Owner; bool IsViper; - void Aggro(Unit *who) {} + void EnterCombat(Unit *who) {} void Reset() { @@ -1042,9 +1291,6 @@ struct TRINITY_DLL_DECL npc_snake_trap_serpentsAI : public ScriptedAI uint32 delta = (rand() % 7) *100; m_creature->SetStatFloatValue(UNIT_FIELD_BASEATTACKTIME, Info->baseattacktime + delta); m_creature->SetStatFloatValue(UNIT_FIELD_RANGED_ATTACK_POWER , Info->attackpower); - - InCombat = false; - } //Redefined for random target selection: @@ -1066,7 +1312,6 @@ struct TRINITY_DLL_DECL npc_snake_trap_serpentsAI : public ScriptedAI m_creature->setAttackTimer(BASE_ATTACK, (rand() % 10) * 100); SpellTimer = (rand() % 10) * 100; AttackStart(who); - InCombat = true; } } } @@ -1078,7 +1323,7 @@ struct TRINITY_DLL_DECL npc_snake_trap_serpentsAI : public ScriptedAI return; //Follow if not in combat - if (!m_creature->hasUnitState(UNIT_STAT_FOLLOW)&& !InCombat) + if (!m_creature->hasUnitState(UNIT_STAT_FOLLOW)&& !m_creature->isInCombat()) { m_creature->GetMotionMaster()->Clear(); m_creature->GetMotionMaster()->MoveFollow(Owner,PET_FOLLOW_DIST,PET_FOLLOW_ANGLE); @@ -1087,11 +1332,9 @@ struct TRINITY_DLL_DECL npc_snake_trap_serpentsAI : public ScriptedAI //No victim -> get new from owner (need this because MoveInLineOfSight won't work while following -> corebug) if (!m_creature->getVictim()) { - if (InCombat) + if (m_creature->isInCombat()) DoStopAttack(); - InCombat = false; - if(Owner->getAttackerForHelper()) AttackStart(Owner->getAttackerForHelper()); @@ -1138,7 +1381,6 @@ void AddSC_npcs_special() newscript = new Script; newscript->Name="npc_chicken_cluck"; newscript->GetAI = &GetAI_npc_chicken_cluck; - newscript->pReceiveEmote = &ReceiveEmote_npc_chicken_cluck; newscript->pQuestAccept = &QuestAccept_npc_chicken_cluck; newscript->pQuestComplete = &QuestComplete_npc_chicken_cluck; newscript->RegisterSelf(); @@ -1146,7 +1388,6 @@ void AddSC_npcs_special() newscript = new Script; newscript->Name="npc_dancing_flames"; newscript->GetAI = &GetAI_npc_dancing_flames; - newscript->pReceiveEmote = &ReceiveEmote_npc_dancing_flames; newscript->RegisterSelf(); newscript = new Script; @@ -1161,11 +1402,22 @@ void AddSC_npcs_special() newscript->RegisterSelf(); newscript = new Script; + newscript->Name = "npc_garments_of_quests"; + newscript->GetAI = &GetAI_npc_garments_of_quests; + newscript->RegisterSelf(); + + newscript = new Script; newscript->Name="npc_guardian"; newscript->GetAI = &GetAI_npc_guardian; newscript->RegisterSelf(); newscript = new Script; + newscript->Name="npc_kingdom_of_dalaran_quests"; + newscript->pGossipHello = &GossipHello_npc_kingdom_of_dalaran_quests; + newscript->pGossipSelect = &GossipSelect_npc_kingdom_of_dalaran_quests; + newscript->RegisterSelf(); + + newscript = new Script; newscript->Name="npc_mount_vendor"; newscript->pGossipHello = &GossipHello_npc_mount_vendor; newscript->pGossipSelect = &GossipSelect_npc_mount_vendor; @@ -1195,12 +1447,12 @@ void AddSC_npcs_special() newscript = new Script; newscript->Name="npc_winter_reveler"; - newscript->pReceiveEmote = &ReceiveEmote_npc_winter_reveler; + //newscript->pReceiveEmote = &ReceiveEmote_npc_winter_reveler; newscript->RegisterSelf(); newscript = new Script; newscript->Name="npc_brewfest_reveler"; - newscript->pReceiveEmote = &ReceiveEmote_npc_brewfest_reveler; + //newscript->pReceiveEmote = &ReceiveEmote_npc_brewfest_reveler; newscript->RegisterSelf(); newscript = new Script; diff --git a/src/bindings/scripts/scripts/zone/alterac_mountains/alterac_mountains.cpp b/src/bindings/scripts/scripts/zone/alterac_mountains/alterac_mountains.cpp index c095666fb97..128583163ae 100644 --- a/src/bindings/scripts/scripts/zone/alterac_mountains/alterac_mountains.cpp +++ b/src/bindings/scripts/scripts/zone/alterac_mountains/alterac_mountains.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -40,11 +40,11 @@ struct TRINITY_DLL_DECL npc_ravenholdtAI : public ScriptedAI void MoveInLineOfSight(Unit *who) { if( who->GetTypeId() == TYPEID_PLAYER ) - if( ((Player*)who)->GetQuestStatus(6681) == QUEST_STATUS_INCOMPLETE ) - ((Player*)who)->KilledMonster(m_creature->GetEntry(),m_creature->GetGUID() ); + if( CAST_PLR(who)->GetQuestStatus(6681) == QUEST_STATUS_INCOMPLETE ) + CAST_PLR(who)->KilledMonster(m_creature->GetEntry(),m_creature->GetGUID() ); } - void Aggro(Unit* who) { } + void EnterCombat(Unit* who) { } }; CreatureAI* GetAI_npc_ravenholdt(Creature *_Creature) diff --git a/src/bindings/scripts/scripts/zone/arathi_highlands/arathi_highlands.cpp b/src/bindings/scripts/scripts/zone/arathi_highlands/arathi_highlands.cpp index d83cb9b3281..2e80e6e4c6e 100644 --- a/src/bindings/scripts/scripts/zone/arathi_highlands/arathi_highlands.cpp +++ b/src/bindings/scripts/scripts/zone/arathi_highlands/arathi_highlands.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -75,7 +75,7 @@ struct TRINITY_DLL_DECL npc_professor_phizzlethorpeAI : public npc_escortAI DoScriptText(SAY_PROGRESS_9, m_creature, player); Completed = true; if(player) - ((Player*)player)->GroupEventHappens(QUEST_SUNKEN_TREASURE, m_creature); + CAST_PLR(player)->GroupEventHappens(QUEST_SUNKEN_TREASURE, m_creature); break; } } @@ -91,7 +91,7 @@ struct TRINITY_DLL_DECL npc_professor_phizzlethorpeAI : public npc_escortAI m_creature->setFaction(35); } - void Aggro(Unit* who) + void EnterCombat(Unit* who) { DoScriptText(SAY_AGGRO, m_creature, NULL); } @@ -102,7 +102,7 @@ struct TRINITY_DLL_DECL npc_professor_phizzlethorpeAI : public npc_escortAI { Player* player = Unit::GetPlayer(PlayerGUID); if (player) - ((Player*)player)->FailQuest(QUEST_SUNKEN_TREASURE); + CAST_PLR(player)->FailQuest(QUEST_SUNKEN_TREASURE); } } @@ -117,7 +117,7 @@ bool QuestAccept_npc_professor_phizzlethorpe(Player* player, Creature* creature, if (quest->GetQuestId() == QUEST_SUNKEN_TREASURE) { DoScriptText(SAY_PROGRESS_1, creature, player); - ((npc_escortAI*)(creature->AI()))->Start(false, false, false, player->GetGUID()); + CAST_AI(npc_escortAI, (creature->AI()))->Start(false, false, false, player->GetGUID()); creature->setFaction(113); } return true; @@ -127,29 +127,9 @@ CreatureAI* GetAI_npc_professor_phizzlethorpeAI(Creature *_Creature) { npc_professor_phizzlethorpeAI* professor_phizzlethorpeAI = new npc_professor_phizzlethorpeAI(_Creature); - professor_phizzlethorpeAI->AddWaypoint(0, -2066.45, -2085.96, 9.08); - professor_phizzlethorpeAI->AddWaypoint(1, -2077.99, -2105.33, 13.24); - professor_phizzlethorpeAI->AddWaypoint(2, -2074.60, -2109.67, 14.24); - professor_phizzlethorpeAI->AddWaypoint(3, -2076.60, -2117.46, 16.67); - professor_phizzlethorpeAI->AddWaypoint(4, -2073.51, -2123.46, 18.42, 2000); - professor_phizzlethorpeAI->AddWaypoint(5, -2073.51, -2123.46, 18.42, 4000); - professor_phizzlethorpeAI->AddWaypoint(6, -2066.60, -2131.85, 21.56); - professor_phizzlethorpeAI->AddWaypoint(7, -2053.85, -2143.19, 20.31); - professor_phizzlethorpeAI->AddWaypoint(8, -2043.49, -2153.73, 20.20, 12000); - professor_phizzlethorpeAI->AddWaypoint(9, -2043.49, -2153.73, 20.20, 14000); - professor_phizzlethorpeAI->AddWaypoint(10, -2043.49, -2153.73, 20.20, 10000); - professor_phizzlethorpeAI->AddWaypoint(11, -2043.49, -2153.73, 20.20, 2000); - professor_phizzlethorpeAI->AddWaypoint(12, -2053.85, -2143.19, 20.31); - professor_phizzlethorpeAI->AddWaypoint(13, -2066.60, -2131.85, 21.56); - professor_phizzlethorpeAI->AddWaypoint(14, -2073.51, -2123.46, 18.42); - professor_phizzlethorpeAI->AddWaypoint(15, -2076.60, -2117.46, 16.67); - professor_phizzlethorpeAI->AddWaypoint(16, -2074.60, -2109.67, 14.24); - professor_phizzlethorpeAI->AddWaypoint(17, -2077.99, -2105.33, 13.24); - professor_phizzlethorpeAI->AddWaypoint(18, -2066.45, -2085.96, 9.08); - professor_phizzlethorpeAI->AddWaypoint(19, -2066.41, -2086.21, 8.97, 6000); - professor_phizzlethorpeAI->AddWaypoint(20, -2066.41, -2086.21, 8.97, 2000); - - return (CreatureAI*)professor_phizzlethorpeAI; + professor_phizzlethorpeAI->FillPointMovementListForCreature(); + + return professor_phizzlethorpeAI; } void AddSC_arathi_highlands() diff --git a/src/bindings/scripts/scripts/zone/ashenvale_forest/ashenvale.cpp b/src/bindings/scripts/scripts/zone/ashenvale_forest/ashenvale.cpp index 16de0d2a8c3..73e89f8c7ca 100644 --- a/src/bindings/scripts/scripts/zone/ashenvale_forest/ashenvale.cpp +++ b/src/bindings/scripts/scripts/zone/ashenvale_forest/ashenvale.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -82,7 +82,7 @@ struct TRINITY_DLL_DECL npc_torekAI : public npc_escortAI DoScriptText(SAY_WIN, m_creature, player); Completed = true; if (player && player->GetTypeId() == TYPEID_PLAYER) - ((Player*)player)->GroupEventHappens(QUEST_TOREK_ASSULT,m_creature); + CAST_PLR(player)->GroupEventHappens(QUEST_TOREK_ASSULT,m_creature); break; case 21: DoScriptText(SAY_END, m_creature, player); @@ -97,7 +97,7 @@ struct TRINITY_DLL_DECL npc_torekAI : public npc_escortAI Completed = false; } - void Aggro(Unit* who) + void EnterCombat(Unit* who) { } @@ -108,10 +108,13 @@ struct TRINITY_DLL_DECL npc_torekAI : public npc_escortAI void JustDied(Unit* killer) { + if (killer->GetEntry() == m_creature->GetEntry()) + return; + if (PlayerGUID && !Completed) { if (Player* player = Unit::GetPlayer(PlayerGUID)) - ((Player*)player)->FailQuest(QUEST_TOREK_ASSULT); + CAST_PLR(player)->FailQuest(QUEST_TOREK_ASSULT); } } @@ -141,7 +144,7 @@ bool QuestAccept_npc_torek(Player* player, Creature* creature, Quest const* ques if (quest->GetQuestId() == QUEST_TOREK_ASSULT) { //TODO: find companions, make them follow Torek, at any time (possibly done by mangos/database in future?) - ((npc_escortAI*)(creature->AI()))->Start(true, true, true, player->GetGUID()); + CAST_AI(npc_escortAI, (creature->AI()))->Start(true, true, true, player->GetGUID()); DoScriptText(SAY_READY, creature, player); creature->setFaction(113); } @@ -149,35 +152,13 @@ bool QuestAccept_npc_torek(Player* player, Creature* creature, Quest const* ques return true; } -CreatureAI* GetAI_npc_torek(Creature *_Creature) +CreatureAI* GetAI_npc_torek(Creature* pCreature) { - npc_torekAI* thisAI = new npc_torekAI(_Creature); - - thisAI->AddWaypoint(0, 1782.63, -2241.11, 109.73, 5000); - thisAI->AddWaypoint(1, 1788.88, -2240.17, 111.71); - thisAI->AddWaypoint(2, 1797.49, -2238.11, 112.31); - thisAI->AddWaypoint(3, 1803.83, -2232.77, 111.22); - thisAI->AddWaypoint(4, 1806.65, -2217.83, 107.36); - thisAI->AddWaypoint(5, 1811.81, -2208.01, 107.45); - thisAI->AddWaypoint(6, 1820.85, -2190.82, 100.49); - thisAI->AddWaypoint(7, 1829.60, -2177.49, 96.44); - thisAI->AddWaypoint(8, 1837.98, -2164.19, 96.71); //prepare - thisAI->AddWaypoint(9, 1839.99, -2149.29, 96.78); - thisAI->AddWaypoint(10, 1835.14, -2134.98, 96.80); - thisAI->AddWaypoint(11, 1823.57, -2118.27, 97.43); - thisAI->AddWaypoint(12, 1814.99, -2110.35, 98.38); - thisAI->AddWaypoint(13, 1806.60, -2103.09, 99.19); - thisAI->AddWaypoint(14, 1798.27, -2095.77, 100.04); - thisAI->AddWaypoint(15, 1783.59, -2079.92, 100.81); - thisAI->AddWaypoint(16, 1776.79, -2069.48, 101.77); - thisAI->AddWaypoint(17, 1776.82, -2054.59, 109.82); - thisAI->AddWaypoint(18, 1776.88, -2047.56, 109.83); - thisAI->AddWaypoint(19, 1776.86, -2036.55, 109.83); - thisAI->AddWaypoint(20, 1776.90, -2024.56, 109.83); //win - thisAI->AddWaypoint(21, 1776.87, -2028.31, 109.83,60000);//stay - thisAI->AddWaypoint(22, 1776.90, -2028.30, 109.83); - - return (CreatureAI*)thisAI; + npc_torekAI* thisAI = new npc_torekAI(pCreature); + + thisAI->FillPointMovementListForCreature(); + + return thisAI; } /*#### @@ -202,9 +183,9 @@ struct TRINITY_DLL_DECL npc_ruul_snowhoofAI : public npc_escortAI { case 0: { m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); - GameObject* Cage = FindGameObject(GO_CAGE, 20, m_creature); + GameObject* Cage = m_creature->FindNearestGameObject(GO_CAGE, 20); if(Cage) - Cage->SetGoState(0); + Cage->SetGoState(GO_STATE_ACTIVE); break;} case 13: m_creature->SummonCreature(3922, 3449.218018, -587.825073, 174.978867, 4.714445, TEMPSUMMON_DEAD_DESPAWN, 60000); @@ -219,22 +200,22 @@ struct TRINITY_DLL_DECL npc_ruul_snowhoofAI : public npc_escortAI case 21:{ if (player && player->GetTypeId() == TYPEID_PLAYER) - ((Player*)player)->GroupEventHappens(QUEST_FREEDOM_TO_RUUL,m_creature); + CAST_PLR(player)->GroupEventHappens(QUEST_FREEDOM_TO_RUUL,m_creature); break; } } } - void Aggro(Unit* who) {} + void EnterCombat(Unit* who) {} void Reset() { if (!IsBeingEscorted) m_creature->setFaction(1602); - GameObject* Cage = FindGameObject(GO_CAGE, 20, m_creature); + GameObject* Cage = m_creature->FindNearestGameObject(GO_CAGE, 20); if(Cage) - Cage->SetGoState(1); + Cage->SetGoState(GO_STATE_READY); } void JustSummoned(Creature* summoned) @@ -248,7 +229,7 @@ struct TRINITY_DLL_DECL npc_ruul_snowhoofAI : public npc_escortAI { Player* player = Unit::GetPlayer(PlayerGUID); if (player) - ((Player*)player)->FailQuest(QUEST_FREEDOM_TO_RUUL); + CAST_PLR(player)->FailQuest(QUEST_FREEDOM_TO_RUUL); } } @@ -263,7 +244,7 @@ bool QuestAccept_npc_ruul_snowhoof(Player* player, Creature* creature, Quest con if (quest->GetQuestId() == QUEST_FREEDOM_TO_RUUL) { creature->setFaction(113); - ((npc_escortAI*)(creature->AI()))->Start(true, true, false, player->GetGUID()); + CAST_AI(npc_escortAI, (creature->AI()))->Start(true, true, false, player->GetGUID()); } return true; } @@ -272,30 +253,9 @@ CreatureAI* GetAI_npc_ruul_snowhoofAI(Creature *_Creature) { npc_ruul_snowhoofAI* ruul_snowhoofAI = new npc_ruul_snowhoofAI(_Creature); - ruul_snowhoofAI->AddWaypoint(0, 3347.250089, -694.700989, 159.925995); - ruul_snowhoofAI->AddWaypoint(1, 3341.527039, -694.725891, 161.124542, 4000); - ruul_snowhoofAI->AddWaypoint(2, 3338.351074, -686.088138, 163.444000); - ruul_snowhoofAI->AddWaypoint(3, 3352.744873, -677.721741, 162.316269); - ruul_snowhoofAI->AddWaypoint(4, 3370.291016, -669.366943, 160.751358); - ruul_snowhoofAI->AddWaypoint(5, 3381.479492, -659.449097, 162.545303); - ruul_snowhoofAI->AddWaypoint(6, 3389.554199, -648.500000, 163.651825); - ruul_snowhoofAI->AddWaypoint(7, 3396.645020, -641.508911, 164.216019); - ruul_snowhoofAI->AddWaypoint(8, 3410.498535, -634.299622, 165.773453); - ruul_snowhoofAI->AddWaypoint(9, 3418.461426, -631.791992, 166.477615); - ruul_snowhoofAI->AddWaypoint(10, 3429.500000, -631.588745, 166.921265); - ruul_snowhoofAI->AddWaypoint(11,3434.950195, -629.245483, 168.333969); - ruul_snowhoofAI->AddWaypoint(12,3438.927979, -618.503235, 171.503143); - ruul_snowhoofAI->AddWaypoint(13,3444.217529, -609.293640, 173.077972, 1000); // Ambush 1 - ruul_snowhoofAI->AddWaypoint(14,3460.505127, -593.794189, 174.342255); - ruul_snowhoofAI->AddWaypoint(15,3480.283203, -578.210327, 176.652313); - ruul_snowhoofAI->AddWaypoint(16,3492.912842, -562.335449, 181.396301); - ruul_snowhoofAI->AddWaypoint(17,3495.230957, -550.977600, 184.652267); - ruul_snowhoofAI->AddWaypoint(18,3496.247070, -529.194214, 188.172028); - ruul_snowhoofAI->AddWaypoint(19,3497.619385, -510.411499, 188.345322, 1000); // Ambush 2 - ruul_snowhoofAI->AddWaypoint(20,3498.498047, -497.787506, 185.806274); - ruul_snowhoofAI->AddWaypoint(21,3484.218750, -489.717529, 182.389862, 4000); // End - - return (CreatureAI*)ruul_snowhoofAI; + ruul_snowhoofAI->FillPointMovementListForCreature(); + + return ruul_snowhoofAI; } void AddSC_ashenvale() diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/auchenai_crypts/boss_exarch_maladaar.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/auchenai_crypts/boss_exarch_maladaar.cpp index e469dc6f618..68a3f60a197 100644 --- a/src/bindings/scripts/scripts/zone/aunchindoun/auchenai_crypts/boss_exarch_maladaar.cpp +++ b/src/bindings/scripts/scripts/zone/aunchindoun/auchenai_crypts/boss_exarch_maladaar.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -51,7 +51,7 @@ struct TRINITY_DLL_DECL mob_stolen_soulAI : public ScriptedAI Class_Timer = 1000; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } void SetMyClass(uint8 myclass) @@ -184,7 +184,7 @@ struct TRINITY_DLL_DECL boss_exarch_maladaarAI : public ScriptedAI } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { switch (rand()%3) { @@ -206,7 +206,7 @@ struct TRINITY_DLL_DECL boss_exarch_maladaarAI : public ScriptedAI if (Unit *target = Unit::GetUnit(*m_creature,soulholder)) { - ((mob_stolen_soulAI*)summoned->AI())->SetMyClass(soulclass); + CAST_AI(mob_stolen_soulAI, summoned->AI())->SetMyClass(soulclass); summoned->AI()->AttackStart(target); } } @@ -299,7 +299,7 @@ CreatureAI* GetAI_boss_exarch_maladaar(Creature *_Creature) } #define SPELL_AV_MORTAL_STRIKE 16856 -#define SPELL_AV_MORTAL_STRIKE 16856 +#define SPELL_AV_SUNDER_ARMOR 16145 struct TRINITY_DLL_DECL mob_avatar_of_martyredAI : public ScriptedAI { @@ -312,7 +312,7 @@ struct TRINITY_DLL_DECL mob_avatar_of_martyredAI : public ScriptedAI Mortal_Strike_timer = 10000; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp index 86ae13e29c6..586a0f06a8d 100644 --- a/src/bindings/scripts/scripts/zone/aunchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp +++ b/src/bindings/scripts/scripts/zone/aunchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -59,7 +59,7 @@ struct TRINITY_DLL_DECL boss_shirrak_the_dead_watcherAI : public ScriptedAI focusedTarget = NULL; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } void JustSummoned(Creature *summoned) @@ -165,7 +165,7 @@ struct TRINITY_DLL_DECL mob_focus_fireAI : public ScriptedAI fiery1 = fiery2 = true; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } void UpdateAI(const uint32 diff) diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp index 872a8c94637..0869a6e72cd 100644 --- a/src/bindings/scripts/scripts/zone/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp +++ b/src/bindings/scripts/scripts/zone/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -140,7 +140,7 @@ struct TRINITY_DLL_DECL boss_nexusprince_shaffarAI : public ScriptedAI } } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { switch(rand()%3) { @@ -269,17 +269,17 @@ struct TRINITY_DLL_DECL mob_ethereal_beaconAI : public ScriptedAI Check_Timer = 1000; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { // Send Shaffar to fight - Unit* Shaffar = FindCreature(ENTRY_SHAFFAR, 100, m_creature); + Unit* Shaffar = me->FindNearestCreature(ENTRY_SHAFFAR, 100); if(!Shaffar || Shaffar->isDead()) { KillSelf(); return; } if(!Shaffar->isInCombat()) - ((Creature*)Shaffar)->AI()->AttackStart(who); + CAST_CRE(Shaffar)->AI()->AttackStart(who); } void JustSummoned(Creature *summoned) @@ -289,9 +289,9 @@ struct TRINITY_DLL_DECL mob_ethereal_beaconAI : public ScriptedAI void JustDied(Unit* Killer) { - Unit *Shaffar = FindCreature(ENTRY_SHAFFAR, 100, m_creature); + Unit *Shaffar = me->FindNearestCreature(ENTRY_SHAFFAR, 100); if(Shaffar) - ((boss_nexusprince_shaffarAI*)(((Creature*)Shaffar)->AI()))->RemoveBeaconFromList(m_creature); + CAST_AI(boss_nexusprince_shaffarAI, (CAST_CRE(Shaffar)->AI()))->RemoveBeaconFromList(m_creature); } void UpdateAI(const uint32 diff) @@ -301,7 +301,7 @@ struct TRINITY_DLL_DECL mob_ethereal_beaconAI : public ScriptedAI if(Check_Timer < diff) { - Unit *Shaffar = FindCreature(ENTRY_SHAFFAR, 100, m_creature); + Unit *Shaffar = me->FindNearestCreature(ENTRY_SHAFFAR, 100); if(!Shaffar || Shaffar->isDead() || !Shaffar->isInCombat()) { KillSelf(); @@ -322,8 +322,6 @@ struct TRINITY_DLL_DECL mob_ethereal_beaconAI : public ScriptedAI m_creature->InterruptNonMeleeSpells(true); m_creature->CastSpell(m_creature,SPELL_ETHEREAL_APPRENTICE,true); - if( m_creature->isPet() ) - ((Pet*)m_creature)->SetDuration(0); KillSelf(); return; }else Apprentice_Timer -= diff; diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/mana_tombs/boss_pandemonius.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/mana_tombs/boss_pandemonius.cpp index d366400b97d..1aaf53bde7b 100644 --- a/src/bindings/scripts/scripts/zone/aunchindoun/mana_tombs/boss_pandemonius.cpp +++ b/src/bindings/scripts/scripts/zone/aunchindoun/mana_tombs/boss_pandemonius.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -72,7 +72,7 @@ struct TRINITY_DLL_DECL boss_pandemoniusAI : public ScriptedAI } } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { switch(rand()%3) { diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/boss_darkweaver_syth.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/boss_darkweaver_syth.cpp index dbf41ed777d..86727837219 100644 --- a/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/boss_darkweaver_syth.cpp +++ b/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/boss_darkweaver_syth.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -83,7 +83,7 @@ struct TRINITY_DLL_DECL boss_darkweaver_sythAI : public ScriptedAI summon10 = false; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { switch(rand()%3) { @@ -222,7 +222,7 @@ struct TRINITY_DLL_DECL mob_syth_fireAI : public ScriptedAI flamebuffet_timer = 5000; } - void Aggro(Unit *who) { } + void EnterCombat(Unit *who) { } void UpdateAI(const uint32 diff) { @@ -273,7 +273,7 @@ struct TRINITY_DLL_DECL mob_syth_arcaneAI : public ScriptedAI arcanebuffet_timer = 5000; } - void Aggro(Unit *who) { } + void EnterCombat(Unit *who) { } void UpdateAI(const uint32 diff) { @@ -324,7 +324,7 @@ struct TRINITY_DLL_DECL mob_syth_frostAI : public ScriptedAI frostbuffet_timer = 5000; } - void Aggro(Unit *who) { } + void EnterCombat(Unit *who) { } void UpdateAI(const uint32 diff) { @@ -375,7 +375,7 @@ struct TRINITY_DLL_DECL mob_syth_shadowAI : public ScriptedAI shadowbuffet_timer = 5000; } - void Aggro(Unit *who) { } + void EnterCombat(Unit *who) { } void UpdateAI(const uint32 diff) { diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/boss_tailonking_ikiss.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/boss_tailonking_ikiss.cpp index ebf2dd46a44..61758b12e6e 100644 --- a/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/boss_tailonking_ikiss.cpp +++ b/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/boss_tailonking_ikiss.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -54,7 +54,7 @@ struct TRINITY_DLL_DECL boss_talon_king_ikissAI : public ScriptedAI { boss_talon_king_ikissAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } ScriptedInstance* pInstance; @@ -105,7 +105,7 @@ struct TRINITY_DLL_DECL boss_talon_king_ikissAI : public ScriptedAI } } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { switch(rand()%3) { @@ -147,7 +147,7 @@ struct TRINITY_DLL_DECL boss_talon_king_ikissAI : public ScriptedAI if (ArcaneVolley_Timer < diff) { DoCast(m_creature,HeroicMode ? H_SPELL_ARCANE_VOLLEY : SPELL_ARCANE_VOLLEY); - ArcaneVolley_Timer = 10000+rand()%5000; + ArcaneVolley_Timer = 7000+rand()%5000; }else ArcaneVolley_Timer -= diff; if (Sheep_Timer < diff) diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/def_sethekk_halls.h b/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/def_sethekk_halls.h index 52ba2206c21..698571faecc 100644 --- a/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/def_sethekk_halls.h +++ b/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/def_sethekk_halls.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * This program is free software licensed under GPL version 2 * Please see the included DOCS/LICENSE.TXT for more information */ diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/instance_sethekk_halls.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/instance_sethekk_halls.cpp index e22ac68ff02..57584769cfa 100644 --- a/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/instance_sethekk_halls.cpp +++ b/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/instance_sethekk_halls.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -53,7 +53,7 @@ struct TRINITY_DLL_DECL instance_sethekk_halls : public ScriptedInstance { case DATA_IKISSDOOREVENT: if( IkissDoor ) - IkissDoor->SetGoState(0); + IkissDoor->SetGoState(GO_STATE_ACTIVE); break; } } diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp index 8aac9412a79..324524c0b71 100644 --- a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp +++ b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -38,7 +38,7 @@ EndScriptData */ #define SAY_DEATH -1555007 #define SPELL_BANISH 30231 -#define SPELL_CORROSIVE_ACID 23313 +#define SPELL_CORROSIVE_ACID 33551 #define SPELL_FEAR 33547 #define SPELL_ENRAGE 0 //need to find proper spell @@ -46,7 +46,7 @@ struct TRINITY_DLL_DECL boss_ambassador_hellmawAI : public ScriptedAI { boss_ambassador_hellmawAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); HeroicMode = m_creature->GetMap()->IsHeroic(); } @@ -79,7 +79,7 @@ struct TRINITY_DLL_DECL boss_ambassador_hellmawAI : public ScriptedAI else pInstance->SetData(TYPE_HELLMAW,FAIL); if (pInstance->GetData(TYPE_OVERSEER) == DONE) { - if (m_creature->HasAura(SPELL_BANISH,0)) + if (m_creature->HasAura(SPELL_BANISH)) m_creature->RemoveAurasDueToSpell(SPELL_BANISH); Intro = true; } @@ -88,7 +88,7 @@ struct TRINITY_DLL_DECL boss_ambassador_hellmawAI : public ScriptedAI void MoveInLineOfSight(Unit *who) { - if (m_creature->HasAura(SPELL_BANISH,0)) + if (m_creature->HasAura(SPELL_BANISH)) return; ScriptedAI::MoveInLineOfSight(who); @@ -104,7 +104,7 @@ struct TRINITY_DLL_DECL boss_ambassador_hellmawAI : public ScriptedAI { DoScriptText(SAY_INTRO, m_creature); - if (m_creature->HasAura(SPELL_BANISH,0)) + if (m_creature->HasAura(SPELL_BANISH)) m_creature->RemoveAurasDueToSpell(SPELL_BANISH); IsBanished = false; @@ -114,7 +114,7 @@ struct TRINITY_DLL_DECL boss_ambassador_hellmawAI : public ScriptedAI pInstance->SetData(TYPE_HELLMAW, IN_PROGRESS); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { switch(rand()%3) { @@ -156,7 +156,7 @@ struct TRINITY_DLL_DECL boss_ambassador_hellmawAI : public ScriptedAI }else EventCheck_Timer -= diff; } - if (!InCombat && !IsBanished) + if (!m_creature->isInCombat() && !IsBanished) { //this is where we add MovePoint() //DoWhine("I haz no mount!", LANG_UNIVERSAL, NULL); @@ -173,14 +173,14 @@ struct TRINITY_DLL_DECL boss_ambassador_hellmawAI : public ScriptedAI if (CorrosiveAcid_Timer < diff) { - DoCast(m_creature,SPELL_CORROSIVE_ACID); - CorrosiveAcid_Timer = 25000; + DoCast(m_creature->getVictim(),SPELL_CORROSIVE_ACID); + CorrosiveAcid_Timer = 15000 + rand()%10000; }else CorrosiveAcid_Timer -= diff; if (Fear_Timer < diff) { DoCast(m_creature,SPELL_FEAR); - Fear_Timer = 35000; + Fear_Timer = 20000 + rand()%15000; }else Fear_Timer -= diff; /*if (HeroicMode) diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp index 43b01ba752f..ebabd317940 100644 --- a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp +++ b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -55,7 +55,7 @@ struct TRINITY_DLL_DECL boss_blackheart_the_inciterAI : public ScriptedAI { boss_blackheart_the_inciterAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } ScriptedInstance *pInstance; @@ -95,7 +95,7 @@ struct TRINITY_DLL_DECL boss_blackheart_the_inciterAI : public ScriptedAI pInstance->SetData(DATA_BLACKHEARTTHEINCITEREVENT, DONE); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { switch(rand()%3) { @@ -148,14 +148,14 @@ struct TRINITY_DLL_DECL boss_blackheart_the_inciterAI : public ScriptedAI { if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0)) DoCast(target, SPELL_CHARGE); - Charge_Timer = 25000; + Charge_Timer = 15000 + rand()%10000; }else Charge_Timer -= diff; //Knockback_Timer if (Knockback_Timer < diff) { DoCast(m_creature, SPELL_WAR_STOMP); - Knockback_Timer = 20000; + Knockback_Timer = 18000 + rand()%6000; }else Knockback_Timer -= diff; DoMeleeAttackIfReady(); diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp index 2a070f2fc84..f99f9a130aa 100644 --- a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp +++ b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp @@ -60,12 +60,6 @@ float VoidPortalCoords[5][3] = {-261.4533, -297.3298, 17.1} }; -class EmpoweringShadowsAura: public Aura -{ - public: - EmpoweringShadowsAura(SpellEntry *spell, uint32 eff, int32 *bp, Unit *target, Unit *caster) : Aura(spell, eff, bp, target, caster, NULL) {} -}; - struct TRINITY_DLL_DECL mob_voidtravelerAI : public ScriptedAI { mob_voidtravelerAI(Creature *c) : ScriptedAI(c) @@ -85,7 +79,7 @@ struct TRINITY_DLL_DECL mob_voidtravelerAI : public ScriptedAI sacrificed = false; } - void Aggro(Unit *who){} + void EnterCombat(Unit *who){} void UpdateAI(const uint32 diff) { @@ -98,9 +92,9 @@ struct TRINITY_DLL_DECL mob_voidtravelerAI : public ScriptedAI { if(sacrificed) { - SpellEntry *spell = (SpellEntry *)GetSpellStore()->LookupEntry(HeroicMode?H_SPELL_EMPOWERING_SHADOWS:SPELL_EMPOWERING_SHADOWS); + SpellEntry *spell = GET_SPELL(HeroicMode?H_SPELL_EMPOWERING_SHADOWS:SPELL_EMPOWERING_SHADOWS); if( spell ) - Vorpil->AddAura(new EmpoweringShadowsAura(spell, 0, NULL, Vorpil, m_creature)); + Vorpil->AddAura(new Aura(spell, 1, NULL, Vorpil, m_creature)); Vorpil->SetHealth(Vorpil->GetHealth()+Vorpil->GetMaxHealth()/25); DoCast(m_creature, SPELL_SHADOW_NOVA, true); m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); @@ -132,7 +126,7 @@ struct TRINITY_DLL_DECL boss_grandmaster_vorpilAI : public ScriptedAI { boss_grandmaster_vorpilAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); HeroicMode = m_creature->GetMap()->IsHeroic(); Intro = false; } @@ -150,7 +144,7 @@ struct TRINITY_DLL_DECL boss_grandmaster_vorpilAI : public ScriptedAI void Reset() { - ShadowBoltVolley_Timer = 15000; + ShadowBoltVolley_Timer = 7000 + rand()%7000; DrawShadows_Timer = 45000; summonTraveler_Timer = 90000; banish_Timer = 17000; @@ -209,7 +203,7 @@ struct TRINITY_DLL_DECL boss_grandmaster_vorpilAI : public ScriptedAI void JustSummoned(Creature *summoned) { if (summoned && summoned->GetEntry() == MOB_VOID_TRAVELER) - ((mob_voidtravelerAI*)summoned->AI())->Vorpil = m_creature; + CAST_AI(mob_voidtravelerAI, summoned->AI())->Vorpil = m_creature; } void KilledUnit(Unit *victim) @@ -230,7 +224,7 @@ struct TRINITY_DLL_DECL boss_grandmaster_vorpilAI : public ScriptedAI pInstance->SetData(DATA_GRANDMASTERVORPILEVENT, DONE); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { switch(rand()%3) { @@ -263,12 +257,12 @@ struct TRINITY_DLL_DECL boss_grandmaster_vorpilAI : public ScriptedAI if (ShadowBoltVolley_Timer < diff) { DoCast(m_creature,SPELL_SHADOWBOLT_VOLLEY); - ShadowBoltVolley_Timer = 15000; + ShadowBoltVolley_Timer = 15000 + rand()%15000;; }else ShadowBoltVolley_Timer -= diff; if (HeroicMode && banish_Timer < diff) { - Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0,30,false); + Unit *target = SelectTarget(SELECT_TARGET_RANDOM,0,30,false); if (target) { DoCast(target,SPELL_BANISH); @@ -282,7 +276,7 @@ struct TRINITY_DLL_DECL boss_grandmaster_vorpilAI : public ScriptedAI Map::PlayerList const &PlayerList = map->GetPlayers(); for(Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) if (Player* i_pl = i->getSource()) - if (i_pl->isAlive() && !i_pl->HasAura(SPELL_BANISH,0)) + if (i_pl->isAlive() && !i_pl->HasAura(SPELL_BANISH)) i_pl->TeleportTo(m_creature->GetMapId(), VorpilPosition[0],VorpilPosition[1],VorpilPosition[2], 0, TELE_TO_NOT_LEAVE_COMBAT); m_creature->Relocate(VorpilPosition[0],VorpilPosition[1],VorpilPosition[2]); @@ -291,7 +285,7 @@ struct TRINITY_DLL_DECL boss_grandmaster_vorpilAI : public ScriptedAI DoCast(m_creature,HeroicMode?H_SPELL_RAIN_OF_FIRE:SPELL_RAIN_OF_FIRE); ShadowBoltVolley_Timer = 6000; - DrawShadows_Timer = 30000; + DrawShadows_Timer = 3000; }else DrawShadows_Timer -= diff; if ( summonTraveler_Timer < diff) diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_murmur.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_murmur.cpp index 0ac15f31f40..599767b591f 100644 --- a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_murmur.cpp +++ b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_murmur.cpp @@ -52,9 +52,9 @@ struct TRINITY_DLL_DECL boss_murmurAI : public Scripted_NoMovementAI void Reset() { SonicBoom_Timer = 30000; - MurmursTouch_Timer = 20000; - Resonance_Timer = 10000; - MagneticPull_Timer = 20000; + MurmursTouch_Timer = 8000 + rand()%12000; + Resonance_Timer = 5000; + MagneticPull_Timer = 15000 + rand()%15000; ThunderingStorm_Timer = 15000; SonicShock_Timer = 10000; SonicBoom = false; @@ -64,7 +64,25 @@ struct TRINITY_DLL_DECL boss_murmurAI : public Scripted_NoMovementAI if (hp) m_creature->SetHealth(hp); } - void Aggro(Unit *who) { } + void SonicBoomEffect() + { + std::list<HostilReference *> t_list = m_creature->getThreatManager().getThreatList(); + for( std::list<HostilReference *>::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr ) + { + Unit* target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()); + if (target && target->GetTypeId() == TYPEID_PLAYER) + { + //Not do anything without aura, spell can be resisted! + if (target->HasAura(SPELL_SONIC_BOOM_CAST) && m_creature->IsWithinDistInMap(target, 34.0f)) + { + //This will be wrong calculation. Also, comments suggest it must deal damage + target->SetHealth(uint32(target->GetMaxHealth() - target->GetMaxHealth() * 0.8)); + } + } + } + } + + void EnterCombat(Unit *who) { } // Sonic Boom instant damage (needs core fix instead of this) void SpellHitTarget(Unit *target, const SpellEntry *spell) @@ -83,6 +101,8 @@ struct TRINITY_DLL_DECL boss_murmurAI : public Scripted_NoMovementAI if(SonicBoom) { DoCast(m_creature, SPELL_SONIC_BOOM_EFFECT, true); + SonicBoomEffect(); + SonicBoom = false; Resonance_Timer = 1500; } @@ -98,18 +118,20 @@ struct TRINITY_DLL_DECL boss_murmurAI : public Scripted_NoMovementAI // Murmur's Touch if (MurmursTouch_Timer < diff) { - if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0,80,true)) + if(Unit* target = SelectTarget(SELECT_TARGET_RANDOM,0,80,true)) DoCast(target, SPELL_MURMURS_TOUCH); - MurmursTouch_Timer = 30000; + MurmursTouch_Timer = 25000 + rand()%10000; }else MurmursTouch_Timer -= diff; // Resonance - if (Resonance_Timer < diff) + if (!SonicBoom && !(m_creature->IsWithinMeleeRange(m_creature->getVictim()))) { - if (!m_creature->IsWithinMeleeRange(SelectUnit(SELECT_TARGET_NEAREST,0,20,true))) + if (Resonance_Timer < diff) + { DoCast(m_creature, SPELL_RESONANCE); - Resonance_Timer = 5000; - }else Resonance_Timer -= diff; + Resonance_Timer = 5000; + }else Resonance_Timer -= diff; + } // Magnetic Pull if (MagneticPull_Timer < diff) @@ -118,7 +140,7 @@ struct TRINITY_DLL_DECL boss_murmurAI : public Scripted_NoMovementAI if (target->GetTypeId() == TYPEID_PLAYER && target->isAlive()) { DoCast(target, SPELL_MAGNETIC_PULL); - MagneticPull_Timer = 20000+rand()%15000; + MagneticPull_Timer = 15000+rand()%15000; return; } MagneticPull_Timer = 500; @@ -140,7 +162,7 @@ struct TRINITY_DLL_DECL boss_murmurAI : public Scripted_NoMovementAI // Sonic Shock if(SonicShock_Timer < diff) { - if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0,20,false)) + if(Unit* target = SelectTarget(SELECT_TARGET_RANDOM,0,20,false)) if(target->isAlive()) DoCast(target, SPELL_SONIC_SHOCK); SonicShock_Timer = 10000+rand()%10000; diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/def_shadow_labyrinth.h b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/def_shadow_labyrinth.h index d03c9270181..a78955368bf 100644 --- a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/def_shadow_labyrinth.h +++ b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/def_shadow_labyrinth.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * This program is free software licensed under GPL version 2 * Please see the included DOCS/LICENSE.TXT for more information */ diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp index ec0c8a47d7a..37194a89b21 100644 --- a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp +++ b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -80,7 +80,7 @@ struct TRINITY_DLL_DECL instance_shadow_labyrinth : public ScriptedInstance void OnCreatureCreate(Creature *creature, uint32 creature_entry) { - switch(creature_entry) + switch(creature->GetEntry()) { case 18732: GrandmasterVorpil = creature->GetGUID(); @@ -109,20 +109,6 @@ struct TRINITY_DLL_DECL instance_shadow_labyrinth : public ScriptedInstance return NULL; } - void HandleGameObject(uint64 guid, uint32 state) - { - Player *player = GetPlayerInMap(); - - if (!player || !guid) - { - debug_log("TSCR: Shadow Labyrinth: HandleGameObject fail"); - return; - } - - if (GameObject *go = GameObject::GetGameObject(*player,guid)) - go->SetGoState(state); - } - void SetData(uint32 type, uint32 data) { switch(type) @@ -149,7 +135,7 @@ struct TRINITY_DLL_DECL instance_shadow_labyrinth : public ScriptedInstance case DATA_BLACKHEARTTHEINCITEREVENT: if( data == DONE ) { - HandleGameObject(RefectoryDoorGUID,0); + HandleGameObject(RefectoryDoorGUID, true); } Encounter[2] = data; break; @@ -157,7 +143,7 @@ struct TRINITY_DLL_DECL instance_shadow_labyrinth : public ScriptedInstance case DATA_GRANDMASTERVORPILEVENT: if( data == DONE ) { - HandleGameObject(ScreamingHallDoorGUID,0); + HandleGameObject(ScreamingHallDoorGUID, true); } Encounter[3] = data; break; @@ -205,7 +191,7 @@ struct TRINITY_DLL_DECL instance_shadow_labyrinth : public ScriptedInstance return 0; } - const char* Save() + std::string GetSaveData() { return str_data.c_str(); } diff --git a/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/boss_amanitar.cpp b/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/boss_amanitar.cpp new file mode 100644 index 00000000000..0d09c6050f6 --- /dev/null +++ b/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/boss_amanitar.cpp @@ -0,0 +1,79 @@ +/* + * Copyright (C) 2009 Trinity <http://www.trinitycore.org/> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* Script Data Start +SDName: boss_amanitar +SDAuthor: LordVanMartin +SD%Complete: 0 +SDComment: Only appears in heroic mode +SDCategory: Ahn'kahet +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = 'boss_amanitar' where entry = ''; +*** SQL END ***/ + +#include "precompiled.h" +#include "def_ahnkahet.h" + +#define SPELL_BASH 57094 +#define SPELL_ENTANGLING_ROOTS 57095 +#define SPELL_MINI 57055 +#define SPELL_VENOM_BOLT_VOLLEY 57088 + +struct TRINITY_DLL_DECL boss_amanitarAI : public ScriptedAI +{ + boss_amanitarAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + + void EnterCombat(Unit* who) {} + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if(!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + + void JustDied(Unit* killer) {} + + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + } +}; + +CreatureAI* GetAI_boss_amanitar(Creature *_Creature) +{ + return new boss_amanitarAI (_Creature); +} + +void AddSC_boss_amanitar() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_amanitar"; + newscript->GetAI = &GetAI_boss_amanitar; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/boss_elder_nadox.cpp b/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/boss_elder_nadox.cpp new file mode 100644 index 00000000000..5f0d4bf03ff --- /dev/null +++ b/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/boss_elder_nadox.cpp @@ -0,0 +1,244 @@ +/* + * Copyright (C) 2009 Trinity <http://www.trinitycore.org/> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: boss_elder_nadox +SD%Complete: 100 +SDComment: +SDCategory: Ahn'kahet +EndScriptData */ + +#include "precompiled.h" +#include "def_ahnkahet.h" + +#define SAY_AGGRO -1619014 +#define SAY_SLAY_1 -1619015 +#define SAY_SLAY_2 -1619016 +#define SAY_SLAY_3 -1619017 +#define SAY_DEATH -1619018 +#define SAY_EGG_SAC_1 -1619019 +#define SAY_EGG_SAC_2 -1619020 + +#define SPELL_BROOD_PLAGUE 56130 +#define H_SPELL_BROOD_PLAGUE 59467 +#define H_SPELL_BROOD_RAGE 59465 +#define SPELL_ENRAGE 26662// Enraged if too far away from home + +#define MOB_AHNKAHAR_SWARMER 30178 +#define SPELL_SUMMON_SWARMERS 56119//2x 30178 -- 2x every 10secs + +#define MOB_AHNKAHAR_SWARM_GUARD 30176 +#define SPELL_SUMMON_SWARM_GUARD 56120//1x 30176 -- every 25secs +#define SPELL_GUARDIAN_AURA 56151 + +struct TRINITY_DLL_DECL boss_elder_nadoxAI : public ScriptedAI +{ + boss_elder_nadoxAI(Creature *c) : ScriptedAI(c) + { + pInstance = (c->GetInstanceData()); + HeroicMode = c->GetMap()->IsHeroic(); + } + + bool HeroicMode; + uint32 plague_Timer; + uint32 rage_Timer; + + uint32 swarmer_spawn_Timer; + uint32 guard_spawn_Timer; + uint32 enrage_Timer; + + + ScriptedInstance *pInstance; + + void Reset() + { + plague_Timer = 13000; + rage_Timer = 20000; + + swarmer_spawn_Timer = 10000; + guard_spawn_Timer = 25000; + + enrage_Timer = 5000; + + if(pInstance) + pInstance->SetData(DATA_ELDER_NADOX_EVENT, NOT_STARTED); + } + + void EnterCombat(Unit *who) + { + DoScriptText(SAY_DEATH,m_creature); + + if(pInstance) + pInstance->SetData(DATA_ELDER_NADOX_EVENT, IN_PROGRESS); + } + + void KilledUnit(Unit *victim) + { + if(victim == m_creature) + return; + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY_1,m_creature); break; + case 1: DoScriptText(SAY_SLAY_2,m_creature); break; + case 2: DoScriptText(SAY_SLAY_3,m_creature); break; + } + } + + void JustDied(Unit* killer) + { + DoScriptText(SAY_SLAY_3,m_creature); + + if(pInstance) + pInstance->SetData(DATA_ELDER_NADOX_EVENT, DONE); + } + + void UpdateAI(const uint32 diff) + { + if(!UpdateVictim()) + return; + + if(plague_Timer < diff) + { + DoCast(m_creature->getVictim(),HeroicMode ? H_SPELL_BROOD_PLAGUE : SPELL_BROOD_PLAGUE); + plague_Timer = 15000; + }else plague_Timer -= diff; + + if(HeroicMode) + if(rage_Timer < diff) + { + Unit* Swarmer = m_creature->FindNearestCreature(MOB_AHNKAHAR_SWARMER, 35); + + if(Swarmer) + { + DoCast(Swarmer,H_SPELL_BROOD_RAGE,true); + rage_Timer = 15000; + } + }else rage_Timer -= diff; + + if(swarmer_spawn_Timer < diff) + { + DoCast(m_creature,SPELL_SUMMON_SWARMERS,true); + DoCast(m_creature,SPELL_SUMMON_SWARMERS); + if(rand()%3 == 0) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_EGG_SAC_1,m_creature); break; + case 1: DoScriptText(SAY_EGG_SAC_2,m_creature); break; + } + } + swarmer_spawn_Timer = 10000; + }else swarmer_spawn_Timer -= diff; + + if(guard_spawn_Timer < diff) + { + m_creature->MonsterTextEmote("An Ahn'kahar Guardian hatches!",m_creature->GetGUID(),true); + DoCast(m_creature,SPELL_SUMMON_SWARM_GUARD); + guard_spawn_Timer = 25000; + }else guard_spawn_Timer -= diff; + + if(enrage_Timer < diff) + { + if(m_creature->HasAura(SPELL_ENRAGE,0)) + return; + + float x, y, z, o; + m_creature->GetHomePosition(x, y, z, o); + if(z < 24 ) + { + if(!m_creature->IsNonMeleeSpellCasted(false)) + { + DoCast(m_creature,SPELL_ENRAGE,true); + } + } + enrage_Timer = 5000; + }else enrage_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_elder_nadox(Creature *_Creature) +{ + return new boss_elder_nadoxAI(_Creature); +} +#define SPELL_SPRINT 56354 +struct TRINITY_DLL_DECL mob_ahnkahar_nerubianAI : public ScriptedAI +{ + mob_ahnkahar_nerubianAI(Creature *c) : ScriptedAI(c) + { + pInstance = (c->GetInstanceData()); + Reset(); + } + + ScriptedInstance *pInstance; + uint32 sprint_Timer; + + void Reset() + { + if(m_creature->GetEntry() == 30176) + DoCast(m_creature,SPELL_GUARDIAN_AURA,true); + sprint_Timer = 10000; + } + void EnterCombat(Unit *who){} + void UpdateAI(const uint32 diff) + { + if(m_creature->GetEntry() == 30176) + m_creature->RemoveAurasDueToSpell(SPELL_GUARDIAN_AURA); + + if(pInstance) + { + if(pInstance->GetData(DATA_ELDER_NADOX_EVENT) != IN_PROGRESS) + { + m_creature->DealDamage(m_creature,m_creature->GetHealth()); + m_creature->RemoveCorpse(); + } + } + + if(!UpdateVictim()) + return; + + if(sprint_Timer < diff) + { + DoCast(m_creature,SPELL_SPRINT); + sprint_Timer = 25000; + }else sprint_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_ahnkahar_nerubian(Creature *_Creature) +{ + return new mob_ahnkahar_nerubianAI(_Creature); +} + +void AddSC_boss_elder_nadox() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_elder_nadox"; + newscript->GetAI = &GetAI_boss_elder_nadox; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_ahnkahar_nerubian"; + newscript->GetAI = &GetAI_mob_ahnkahar_nerubian; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/boss_herald_volazj.cpp b/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/boss_herald_volazj.cpp new file mode 100644 index 00000000000..506bc969038 --- /dev/null +++ b/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/boss_herald_volazj.cpp @@ -0,0 +1,111 @@ +/* + * Copyright (C) 2009 Trinity <http://www.trinitycore.org/> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: boss_herald_volazj +SDAuthor: LordVanMartin +SD%Complete: 0 +SDComment: +SDCategory: Ahn'kahet +EndScriptData */ + +/*** SQL START *** +update creature_template set scriptname = 'boss_volazj' where entry = ''; +*** SQL END ***/ + +#include "precompiled.h" +#include "def_ahnkahet.h" + +//Spells +#define SPELL_INSANITY 57496 //Dummy +#define INSANITY_VISUAL 57561 +#define SPELL_MIND_FLAY_N 57941 +#define SPELL_MIND_FLAY_H 59974 +#define SPELL_SHADOW_BOLT_VOLLEY_1 57942 +#define SPELL_SHADOW_BOLT_VOLLEY_2 59975 +#define SPELL_SHIVER_N 57949 +#define SPELL_SHIVER_H 59978 + +//Yell +#define SAY_AGGRO -1619030 +#define SAY_SLAY_1 -1619031 +#define SAY_SLAY_2 -1619032 +#define SAY_SLAY_3 -1619033 +#define SAY_DEATH_1 -1619034 +#define SAY_DEATH_2 -1619035 +#define SAY_PHASE -1619036 + +struct TRINITY_DLL_DECL boss_volazjAI : public ScriptedAI +{ + boss_volazjAI(Creature *c) : ScriptedAI(c) {} + + uint32 phase; + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if(!UpdateVictim()) + return; + + phase =1; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + if(phase == 1) + DoScriptText(SAY_DEATH_1, m_creature); + else + DoScriptText(SAY_DEATH_2, m_creature); + } + + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature);break; + case 1: DoScriptText(SAY_SLAY_2, m_creature);break; + case 2: DoScriptText(SAY_SLAY_3, m_creature);break; + } + } +}; + +CreatureAI* GetAI_boss_volazj(Creature *_Creature) +{ + return new boss_volazjAI (_Creature); +} + +void AddSC_boss_volazj() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_volazj"; + newscript->GetAI = &GetAI_boss_volazj; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/boss_jedoga_shadowseeker.cpp b/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/boss_jedoga_shadowseeker.cpp new file mode 100644 index 00000000000..202e9b09944 --- /dev/null +++ b/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/boss_jedoga_shadowseeker.cpp @@ -0,0 +1,109 @@ +/* + * Copyright (C) 2009 Trinity <http://www.trinitycore.org/> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: boss_jedoga_shadowseeker +SDAuthor: LordVanMartin +SD%Complete: 0 +SDComment: +SDCategory: Ahn'kahet +EndScriptData */ + +/*** SQL START *** +update creature_template set scriptname = 'boss_jedoga' where entry = ''; +*** SQL END ***/ + +#include "precompiled.h" +#include "def_ahnkahet.h" + +#define SPELL_CYCLONE_STRIKE 56855 +#define H_SPELL_CYCLONE_STRIKE 60030//kein unterschied zu 56855 außer das 60030 1,5sec cast ist +#define SPELL_LIGHTNING_BOLT 56891 +#define H_SPELL_LIGHTNING_BOLT 60032 +#define SPELL_THUNDERSHOCK 56926//AOE works +#define H_SPELL_THUNDERSHOCK 60029//AOE works +#define SPELL_GIFT_OF_THE_HERALD 56219//triggert if sucessfull sacreficed + +#define SAY_AGGRO -1619000 +#define SAY_C_SACRIFICE_1 -1619001 +#define SAY_C_SACRIFICE_2 -1619002 +#define SAY_SACRIFICE_1 -1619003 +#define SAY_SACRIFICE_2 -1619004 +#define SAY_SLAY_1 -1619005 +#define SAY_SLAY_2 -1619006 +#define SAY_SLAY_3 -1619007 +#define SAY_DEATH -1619008 +#define SAY_PREACHING_1 -1619009 +#define SAY_PREACHING_2 -1619010 +#define SAY_PREACHING_3 -1619011 +#define SAY_PREACHING_4 -1619012 +#define SAY_PREACHING_5 -1619013 + +struct TRINITY_DLL_DECL boss_jedogaAI : public ScriptedAI +{ + boss_jedogaAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if(!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature);break; + case 1: DoScriptText(SAY_SLAY_2, m_creature);break; + case 2: DoScriptText(SAY_SLAY_3, m_creature);break; + } + } +}; + +CreatureAI* GetAI_boss_jedoga(Creature *_Creature) +{ + return new boss_jedogaAI (_Creature); +} + +void AddSC_boss_jedoga() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_jedoga"; + newscript->GetAI = &GetAI_boss_jedoga; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/boss_prince_taldaram.cpp b/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/boss_prince_taldaram.cpp new file mode 100644 index 00000000000..2dbfc865629 --- /dev/null +++ b/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/boss_prince_taldaram.cpp @@ -0,0 +1,109 @@ +/* + * Copyright (C) 2009 Trinity <http://www.trinitycore.org/> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: boss_prince_taldaram +SDAuthor: LordVanMartin +SD%Complete: 0 +SDComment: +SDCategory: Ahn'kahet +EndScriptData */ + +#include "precompiled.h" +#include "def_ahnkahet.h" + +#define SPELL_BLOODTHIRST 55968 //Trigger Spell + add aura +#define SPELL_CONJURE_FLAME_SPHERE 55931 + +#define SPELL_FLAME_SPHERE_SUMMON_1 55895// 1x 30106 +#define H_SPELL_FLAME_SPHERE_SUMMON_1 59511// 1x 31686 +#define H_SPELL_FLAME_SPHERE_SUMMON_2 59512// 1x 31687 +#define SPELL_FLAME_SPHERE_SPAWN_EFFEKT 55891 +#define SPELL_FLAME_SPHERE_VISUAL 55928 +#define SPELL_FLAME_SPHERE_PERIODIC 55926 +#define H_SPELL_FLAME_SPHERE_PERIODIC 59508 +#define SPELL_FLAME_SPHERE_DEATH_EFFEKT 55947 + +#define SPELL_EMBRACE_OF_THE_VAMPYR 55959 +#define H_SPELL_EMBRACE_OF_THE_VAMPYR 59513 + +#define SPELL_VANISH 55964 + +//Yell +#define SAY_AGGRO -1619021 +#define SAY_SLAY_1 -1619022 +#define SAY_SLAY_2 -1619023 +#define SAY_SLAY_3 -1619024 +#define SAY_DEATH -1619025 +#define SAY_FEED_1 -1619026 +#define SAY_FEED_2 -1619027 +#define SAY_VANISH_1 -1619028 +#define SAY_VANISH_2 -1619029 + +struct TRINITY_DLL_DECL boss_taldaramAI : public ScriptedAI +{ + boss_taldaramAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if(!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature);break; + case 1: DoScriptText(SAY_SLAY_2, m_creature);break; + case 2: DoScriptText(SAY_SLAY_3, m_creature);break; + } + } +}; + +CreatureAI* GetAI_boss_taldaram(Creature *_Creature) +{ + return new boss_taldaramAI (_Creature); +} + +void AddSC_boss_taldaram() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_taldaram"; + newscript->GetAI = &GetAI_boss_taldaram; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/def_ahnkahet.h b/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/def_ahnkahet.h new file mode 100644 index 00000000000..97c0db55d72 --- /dev/null +++ b/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/def_ahnkahet.h @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2009 Trinity <http://www.trinitycore.org/> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef DEF_AHNKAHET_H +#define DEF_AHNKAHET_H + +#define DATA_ELDER_NADOX 1 +#define DATA_PRINCE_TALDARAM 2 +#define DATA_JEDOGA_SHADOWSEEKER 3 +#define DATA_HERALD_VOLAZJ 4 +#define DATA_AMANITAR 5 + +#define DATA_ELDER_NADOX_EVENT 6 +#define DATA_PRINCE_TALDARAM_EVENT 7 +#define DATA_JEDOGA_SHADOWSEEKER_EVENT 8 +#define DATA_HERALD_VOLAZJ_EVENT 9 +#define DATA_AMANITAR_EVENT 10 +#endif diff --git a/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/instance_ahnkahet.cpp b/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/instance_ahnkahet.cpp new file mode 100644 index 00000000000..595a05a727f --- /dev/null +++ b/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/instance_ahnkahet.cpp @@ -0,0 +1,194 @@ +/* + * Copyright (C) 2009 Trinity <http://www.trinitycore.org/> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Azjol_Nerub +SD%Complete: 0 +SDComment: +SDCategory: Azjol Nerub +EndScriptData */ + +#include "precompiled.h" +#include "def_ahnkahet.h" + +#define ENCOUNTERS 5 + +/* Ahn'kahet encounters: +0 - Elder Nadox +1 - Prince Taldaram +2 - Jedoga Shadowseeker +3 - Herald Volazj +4 - Amanitar (Heroic only) +*/ + +struct TRINITY_DLL_DECL instance_ahnkahet : public ScriptedInstance +{ + instance_ahnkahet(Map *Map) : ScriptedInstance(Map) {Initialize();}; + + uint64 Elder_Nadox; + uint64 Prince_Taldaram; + uint64 Jedoga_Shadowseeker; + uint64 Herald_Volazj; + uint64 Amanitar; + + uint32 Encounters[ENCOUNTERS]; + + void Initialize() + { + Elder_Nadox =0; + Prince_Taldaram =0; + Jedoga_Shadowseeker =0; + Herald_Volazj =0; + Amanitar =0; + + for(uint8 i = 0; i < ENCOUNTERS; ++i) + Encounters[i] = NOT_STARTED; + } + + bool IsEncounterInProgress() const + { + for(uint8 i = 0; i < ENCOUNTERS; ++i) + if(Encounters[i] == IN_PROGRESS) return true; + + return false; + } + + + void OnCreatureCreate(Creature *creature, uint32 creature_entry) + { + switch(creature_entry) + { + case 29309: Elder_Nadox = creature->GetGUID(); break; + case 29308: Prince_Taldaram = creature->GetGUID(); break; + case 29310: Jedoga_Shadowseeker = creature->GetGUID(); break; + case 29311: Herald_Volazj = creature->GetGUID(); break; + case 30258: Amanitar = creature->GetGUID(); break; + } + } + + uint64 GetData64(uint32 identifier) + { + switch(identifier) + { + case DATA_ELDER_NADOX: return Elder_Nadox; + case DATA_PRINCE_TALDARAM: return Prince_Taldaram; + case DATA_JEDOGA_SHADOWSEEKER: return Jedoga_Shadowseeker; + case DATA_HERALD_VOLAZJ: return Herald_Volazj; + case DATA_AMANITAR: return Amanitar; + } + return 0; + } + + void SetData(uint32 type, uint32 data) + { + switch(type) + { + case DATA_ELDER_NADOX_EVENT: + Encounters[0] = data;break; + case DATA_PRINCE_TALDARAM_EVENT: + Encounters[1] = data; break; + case DATA_JEDOGA_SHADOWSEEKER_EVENT: + Encounters[2] = data; break; + case DATA_HERALD_VOLAZJ: + Encounters[3] = data; break; + case DATA_AMANITAR: + Encounters[4] = data; break; + } + + if (data == DONE) + { + SaveToDB(); + } + } + + uint32 GetData(uint32 type) + { + switch(type) + { + case DATA_ELDER_NADOX_EVENT: return Encounters[0]; + case DATA_PRINCE_TALDARAM_EVENT: return Encounters[1]; + case DATA_JEDOGA_SHADOWSEEKER_EVENT: return Encounters[2]; + case DATA_HERALD_VOLAZJ: return Encounters[3]; + case DATA_AMANITAR: return Encounters[4]; + } + return 0; + } + + std::string GetSaveData() + { + OUT_SAVE_INST_DATA; + + std::string str_data; + + std::ostringstream saveStream; + saveStream << "A K " << Encounters[0] << " " << Encounters[1] << " " + << Encounters[2] << Encounters[3] << Encounters[4]; + + str_data = saveStream.str(); + + OUT_SAVE_INST_DATA_COMPLETE; + return str_data.c_str(); + } + + void Load(const char* in) + { + if (!in) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(in); + + char dataHead1, dataHead2; + uint16 data0,data1,data2,data3,data4; + + std::istringstream loadStream(in); + loadStream >> dataHead1 >> dataHead2 >> data0 >> data1 >> data2 >> data3 >> data4; + + if( dataHead1 == 'A' && dataHead2 == 'K') + { + Encounters[0] = data0; + Encounters[1] = data1; + Encounters[2] = data2; + Encounters[3] = data3; + Encounters[4] = data4; + + for(uint8 i = 0; i < ENCOUNTERS; ++i) + if (Encounters[i] == IN_PROGRESS) + Encounters[i] = NOT_STARTED; + + }else OUT_LOAD_INST_DATA_FAIL; + + OUT_LOAD_INST_DATA_COMPLETE; + } +}; + +InstanceData* GetInstanceData_instance_ahnkahet(Map* map) +{ + return new instance_ahnkahet(map); +} + +void AddSC_instance_ahnkahet() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_ahnkahet"; + newscript->GetInstanceData = &GetInstanceData_instance_ahnkahet; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/zone/azjol_nerub/azjol_nerub/boss_anubarak.cpp b/src/bindings/scripts/scripts/zone/azjol_nerub/azjol_nerub/boss_anubarak.cpp new file mode 100644 index 00000000000..796bc84c7c3 --- /dev/null +++ b/src/bindings/scripts/scripts/zone/azjol_nerub/azjol_nerub/boss_anubarak.cpp @@ -0,0 +1,112 @@ +/* + * Copyright (C) 2009 Trinity <http://www.trinitycore.org/> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: boss_anubarak +SDAuthor: LordVanMartin +SD%Complete: 0 +SDComment: +SDCategory: Azjol Nerub +EndScriptData */ + +/*** SQL START *** +update creature_template set scriptname = 'boss_anub_arak' where entry = ''; +*** SQL END ***/ + +#include "precompiled.h" +#include "def_azjol_nerub.h" + +//Spells +#define SPELL_CARRION_BEETLES 53520 +#define SPELL_LOCUST_SWARM 53467 +#define SPELL_IMPALE 53454 +#define SPELL_POUND 53472 + +//Yell +#define SAY_INTRO -1601010 +#define SAY_AGGRO -1601000 +#define SAY_SLAY_1 -1601001 +#define SAY_SLAY_2 -1601002 +#define SAY_SLAY_3 -1601003 +#define SAY_LOCUST_1 -1601005 +#define SAY_LOCUST_2 -1601006 +#define SAY_LOCUST_3 -1601007 +#define SAY_SUBMERGE_1 -1601008 +#define SAY_SUBMERGE_2 -1601009 +#define SAY_DEATH -1601004 + +struct TRINITY_DLL_DECL boss_anub_arakAI : public ScriptedAI +{ + boss_anub_arakAI(Creature *c) : ScriptedAI(c) {} + + uint32 phase; + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if(!UpdateVictim()) + return; + + phase =1; + + if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) <= 33) + phase = 2; + if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) == 15) + phase = 3; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature);break; + case 1: DoScriptText(SAY_SLAY_2, m_creature);break; + case 2: DoScriptText(SAY_SLAY_3, m_creature);break; + } + } +}; + +CreatureAI* GetAI_boss_anub_arak(Creature *_Creature) +{ + return new boss_anub_arakAI (_Creature); +} + +void AddSC_boss_anub_arak() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_anub_arak"; + newscript->GetAI = &GetAI_boss_anub_arak; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/zone/azjol_nerub/azjol_nerub/boss_hadronox.cpp b/src/bindings/scripts/scripts/zone/azjol_nerub/azjol_nerub/boss_hadronox.cpp new file mode 100644 index 00000000000..65dcef9b061 --- /dev/null +++ b/src/bindings/scripts/scripts/zone/azjol_nerub/azjol_nerub/boss_hadronox.cpp @@ -0,0 +1,114 @@ +/* + * Copyright (C) 2009 Trinity <http://www.trinitycore.org/> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: boss_hadronox +SD%Complete: 0 +SDComment: Placeholder +SDCategory: Azjol Nerub +EndScriptData */ + +#include "precompiled.h" +#include "def_azjol_nerub.h" + +#define SPELL_WEB_FRONT_DOORS 53177//dummy + +#define SPELL_ACID_CLOUD 53400 +#define H_SPELL_ACID_CLOUD 59419 +#define SPELL_LEECH_POISON 53030 +#define H_SPELL_LEECH_POISON 59417 +#define SPELL_LEECH_POISON_DEADTRIGGER 53800//heal 10% heroic und normal +#define SPELL_PIECE_ARMOR 53418 +#define SPELL_WEB_GRAB 53406 +#define H_SPELL_WEB_GRAB 59420 + +/* Script Data Start +SDName: Boss hadronox +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = 'boss_hadronox' where entry = ''; +*** SQL END ***/ + +//Spells +#define SPELL_LEECH_POISON 53030 +#define SPELL_ACID_CLOUD 53400 +#define SPELL_PIERCE_ARMOR 53418 //Source SUN++ +#define SPELL_WEB_GRAB 53406 + +//Phase 0 => Gauntlet Event described below +//Phase 1 => Boss Encounter + +/*When your group enters the main room (the one after the bridge), you will notice a group of 3 Nerubians. +When you engage them, 2 more groups like this one spawn behind the first one - it is important to pull the first group back, +so you don't aggro all 3. Hadronox will be under you, fighting Nerubians. + +This is the timed gauntlet - waves of non-elite spiders + will spawn from the 3 doors located a little above the main room, and will then head down to fight Hadronox. After clearing the + main room, it is recommended to just stay in it, kill the occasional non-elites that will attack you instead of the boss, and wait for + Hadronox to make his way to you. When Hadronox enters the main room, she will web the doors, and no more non-elites will spawn.*/ + +struct TRINITY_DLL_DECL boss_hadronoxAI : public ScriptedAI +{ + boss_hadronoxAI(Creature *c) : ScriptedAI(c) {} + + uint32 phase; + + void Reset() {} + void EnterCombat(Unit* who) {} + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if(!UpdateVictim()) + return; + + phase =1; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) {} + + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + + //when Hadronox kills any enemy (that includes a party member) she will regain 10% of her HP if the target had Leech Poison on + } +}; + +CreatureAI* GetAI_boss_hadronox(Creature *_Creature) +{ + return new boss_hadronoxAI (_Creature); +} + +void AddSC_boss_hadronox() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_hadronox"; + newscript->GetAI = &GetAI_boss_hadronox; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/zone/azjol_nerub/azjol_nerub/boss_krikthir_the_gatewatcher.cpp b/src/bindings/scripts/scripts/zone/azjol_nerub/azjol_nerub/boss_krikthir_the_gatewatcher.cpp new file mode 100644 index 00000000000..e2c51e941cf --- /dev/null +++ b/src/bindings/scripts/scripts/zone/azjol_nerub/azjol_nerub/boss_krikthir_the_gatewatcher.cpp @@ -0,0 +1,116 @@ +/* + * Copyright (C) 2009 Trinity <http://www.trinitycore.org/> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: boss_krikthir_the_gatewatcher +SDAuthor: LordVanMartin +SD%Complete: 0 +SDComment: Placeholder +SDCategory: Azjol Nerub +EndScriptData */ + +/*** SQL START *** +update creature_template set scriptname = 'boss_krik_thir' where entry = ''; +*** SQL END ***/ + +#include "precompiled.h" +#include "def_azjol_nerub.h" + +#define SPELL_MIND_FLAY 52586 +#define H_SPELL_MIND_FLAY 59367 +#define SPELL_CURSE_OF_FATIGUE 52592 +#define H_SPELL_CURSE_OF_FATIGUE 59368 +#define SPELL_FRENZY 28747 // maybe 53361 + +#define MOB_SKITTERING_SWARMER 28735 +#define MOB_SKITTERING_SWARMER_CONTROLLER 32593 + +#define SPELL_SUMMON_SKITTERING_SWARMER 52438//AOE Effekt 140, maybe 52439 +#define SPELL_SUMMON_SKITTERING_SWARMER 52439//Summon 3x 28735 + +//Yell +#define SAY_AGGRO -1601011 +#define SAY_SLAY_1 -1601012 +#define SAY_SLAY_2 -1601013 +#define SAY_SLAY_3 -1601014 +#define SAY_DEATH -1601015 +#define SAY_SEND_GROUP_1 -1601018 +#define SAY_SEND_GROUP_2 -1601019 +#define SAY_SEND_GROUP_3 -1601020 +#define SAY_SWARM_1 -1601016 +#define SAY_SWARM_2 -1601017 +#define SAY_PREFIGHT_1 -1601021 +#define SAY_PREFIGHT_2 -1601022 +#define SAY_PREFIGHT_3 -1601023 + +struct TRINITY_DLL_DECL boss_krik_thirAI : public ScriptedAI +{ + boss_krik_thirAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + + void UpdateAI(const uint32 diff) + { + if(!UpdateVictim()) + return; + + if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) >= 10) + { + //Frenzy + } + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature);break; + case 1: DoScriptText(SAY_SLAY_2, m_creature);break; + case 2: DoScriptText(SAY_SLAY_3, m_creature);break; + } + } +}; + +CreatureAI* GetAI_boss_krik_thir(Creature *_Creature) +{ + return new boss_krik_thirAI (_Creature); +} + +void AddSC_boss_krik_thir() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_krik_thir"; + newscript->GetAI = &GetAI_boss_krik_thir; + newscript->RegisterSelf(); + +} diff --git a/src/bindings/scripts/scripts/zone/azjol_nerub/azjol_nerub/def_azjol_nerub.h b/src/bindings/scripts/scripts/zone/azjol_nerub/azjol_nerub/def_azjol_nerub.h new file mode 100644 index 00000000000..9e319e8fde0 --- /dev/null +++ b/src/bindings/scripts/scripts/zone/azjol_nerub/azjol_nerub/def_azjol_nerub.h @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2009 Trinity <http://www.trinitycore.org/> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef DEF_AZJOL_NERUB_H +#define DEF_AZJOL_NERUB_H + +#define DATA_KRIKTHIR_THE_GATEWATCHER 1 +#define DATA_HADRONOX 2 +#define DATA_ANUBARAK 3 + +#define DATA_KRIKTHIR_THE_GATEWATCHER_EVENT 4 +#define DATA_HADRONOX_EVENT 5 +#define DATA_ANUBARAK_EVENT 6 +#endif diff --git a/src/bindings/scripts/scripts/zone/azjol_nerub/azjol_nerub/instance_azjol_nerub.cpp b/src/bindings/scripts/scripts/zone/azjol_nerub/azjol_nerub/instance_azjol_nerub.cpp new file mode 100644 index 00000000000..7e0252f2009 --- /dev/null +++ b/src/bindings/scripts/scripts/zone/azjol_nerub/azjol_nerub/instance_azjol_nerub.cpp @@ -0,0 +1,180 @@ +/* + * Copyright (C) 2009 Trinity <http://www.trinitycore.org/> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Azjol_Nerub +SD%Complete: 0 +SDComment: Placeholder +SDCategory: Azjol Nerub +EndScriptData */ + +#include "precompiled.h" +#include "def_azjol_nerub.h" + +#define ENCOUNTERS 3 + +/* Azjol Nerub encounters: +0 - Krik'thir the Gatewatcher +1 - Hadronox +2 - Anub'arak +*/ + +struct TRINITY_DLL_DECL instance_azjol_nerub : public ScriptedInstance +{ + instance_azjol_nerub(Map *Map) : ScriptedInstance(Map) {Initialize();}; + + uint64 Krikthir; + uint64 Hadronox; + uint64 Anubarak; + + uint32 Encounters[ENCOUNTERS]; + + void Initialize() + { + Krikthir = 0; + Hadronox = 0; + Anubarak =0; + + + for(uint8 i = 0; i < ENCOUNTERS; ++i) + Encounters[i] = NOT_STARTED; + } + + bool IsEncounterInProgress() const + { + for(uint8 i = 0; i < ENCOUNTERS; ++i) + if(Encounters[i] == IN_PROGRESS) return true; + + return false; + } + + + void OnCreatureCreate(Creature *creature, uint32 creature_entry) + { + switch(creature_entry) + { + case 28684: Krikthir = creature->GetGUID(); break; + case 28921: Hadronox = creature->GetGUID(); break; + case 29120: Anubarak = creature->GetGUID(); break; + + } + } + + uint64 GetData64(uint32 identifier) + { + switch(identifier) + { + case DATA_KRIKTHIR_THE_GATEWATCHER: return Krikthir; + case DATA_HADRONOX: return Hadronox; + case DATA_ANUBARAK: return Anubarak; + } + + return 0; + } + + void SetData(uint32 type, uint32 data) + { + switch(type) + { + case DATA_KRIKTHIR_THE_GATEWATCHER_EVENT: + Encounters[0] = data;break; + case DATA_HADRONOX_EVENT: + Encounters[1] = data; break; + case DATA_ANUBARAK_EVENT: + Encounters[2] = data; break; + } + + if (data == DONE) + { + SaveToDB(); + } + } + + uint32 GetData(uint32 type) + { + switch(type) + { + case DATA_KRIKTHIR_THE_GATEWATCHER_EVENT: return Encounters[0]; + case DATA_HADRONOX_EVENT: return Encounters[1]; + case DATA_ANUBARAK_EVENT: return Encounters[2]; + } + + return 0; + } + + std::string GetSaveData() + { + OUT_SAVE_INST_DATA; + + std::string str_data; + + std::ostringstream saveStream; + saveStream << "A N " << Encounters[0] << " " << Encounters[1] << " " + << Encounters[2]; + + str_data = saveStream.str(); + + OUT_SAVE_INST_DATA_COMPLETE; + return str_data.c_str(); + } + + void Load(const char* in) + { + if (!in) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(in); + + char dataHead1, dataHead2; + uint16 data0,data1,data2; + + std::istringstream loadStream(in); + loadStream >> dataHead1 >> dataHead2 >> data0 >> data1 >> data2; + + if( dataHead1 == 'A' && dataHead2 == 'N') + { + Encounters[0] = data0; + Encounters[1] = data1; + Encounters[2] = data2; + + for(uint8 i = 0; i < ENCOUNTERS; ++i) + if (Encounters[i] == IN_PROGRESS) + Encounters[i] = NOT_STARTED; + + }else OUT_LOAD_INST_DATA_FAIL; + + OUT_LOAD_INST_DATA_COMPLETE; + } +}; + +InstanceData* GetInstanceData_instance_azjol_nerub(Map* map) +{ + return new instance_azjol_nerub(map); +} + +void AddSC_instance_azjol_nerub() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_azjol_nerub"; + newscript->GetInstanceData = &GetInstanceData_instance_azjol_nerub; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/zone/azshara/azshara.cpp b/src/bindings/scripts/scripts/zone/azshara/azshara.cpp index b92017bf394..5223b6d93c3 100644 --- a/src/bindings/scripts/scripts/zone/azshara/azshara.cpp +++ b/src/bindings/scripts/scripts/zone/azshara/azshara.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -49,13 +49,13 @@ struct TRINITY_DLL_DECL mobs_spitelashesAI : public ScriptedAI spellhit = false; } - void Aggro(Unit *who) { } + void EnterCombat(Unit *who) { } void SpellHit(Unit *Hitter, const SpellEntry *Spellkind) { if( !spellhit && Hitter->GetTypeId() == TYPEID_PLAYER && - ((Player*)Hitter)->GetQuestStatus(9364) == QUEST_STATUS_INCOMPLETE && + CAST_PLR(Hitter)->GetQuestStatus(9364) == QUEST_STATUS_INCOMPLETE && (Spellkind->Id==118 || Spellkind->Id== 12824 || Spellkind->Id== 12825 || Spellkind->Id== 12826) ) { spellhit=true; @@ -328,7 +328,7 @@ struct TRINITY_DLL_DECL mob_rizzle_sprysprocketAI : public ScriptedAI if(Grenade_Timer < diff) { - Player *player = (Player *)Unit::GetUnit((*m_creature), PlayerGUID); + Player *player = Unit::GetPlayer(PlayerGUID); if(player) { DoScriptText(SAY_RIZZLE_GRENADE, m_creature, player); @@ -339,7 +339,7 @@ struct TRINITY_DLL_DECL mob_rizzle_sprysprocketAI : public ScriptedAI if(Check_Timer < diff) { - Player *player = (Player *)Unit::GetUnit((*m_creature), PlayerGUID); + Player *player = Unit::GetPlayer(PlayerGUID); if(!player) { Despawn(); @@ -374,7 +374,7 @@ struct TRINITY_DLL_DECL mob_rizzle_sprysprocketAI : public ScriptedAI if (!who || PlayerGUID) return; - if(who->GetTypeId() == TYPEID_PLAYER && ((Player *)who)->GetQuestStatus(10994) == QUEST_STATUS_INCOMPLETE) + if(who->GetTypeId() == TYPEID_PLAYER && CAST_PLR(who)->GetQuestStatus(10994) == QUEST_STATUS_INCOMPLETE) { PlayerGUID = who->GetGUID(); DoScriptText(SAY_RIZZLE_START, m_creature); @@ -383,7 +383,7 @@ struct TRINITY_DLL_DECL mob_rizzle_sprysprocketAI : public ScriptedAI } } - void Aggro(Unit* who) {} + void EnterCombat(Unit* who) {} void MovementInform(uint32 type, uint32 id) { @@ -417,8 +417,8 @@ bool GossipSelect_mob_rizzle_sprysprocket(Player *player, Creature *_Creature, u { player->CLOSE_GOSSIP_MENU(); _Creature->CastSpell(player, SPELL_GIVE_SOUTHFURY_MOONSTONE, true); - ((mob_rizzle_sprysprocketAI*)_Creature->AI())->Must_Die_Timer = 3000; - ((mob_rizzle_sprysprocketAI*)_Creature->AI())->Must_Die = true; + CAST_AI(mob_rizzle_sprysprocketAI, _Creature->AI())->Must_Die_Timer = 3000; + CAST_AI(mob_rizzle_sprysprocketAI, _Creature->AI())->Must_Die = true; } return true; } @@ -476,7 +476,7 @@ struct TRINITY_DLL_DECL mob_depth_chargeAI : public ScriptedAI return; } - void Aggro(Unit* who) + void EnterCombat(Unit* who) { return; } diff --git a/src/bindings/scripts/scripts/zone/azshara/boss_azuregos.cpp b/src/bindings/scripts/scripts/zone/azshara/boss_azuregos.cpp index 97e21ccbe1b..ae5e5db68f6 100644 --- a/src/bindings/scripts/scripts/zone/azshara/boss_azuregos.cpp +++ b/src/bindings/scripts/scripts/zone/azshara/boss_azuregos.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -60,7 +60,7 @@ struct TRINITY_DLL_DECL boss_azuregosAI : public ScriptedAI Enraged = false; } - void Aggro(Unit *who) {} + void EnterCombat(Unit *who) {} void UpdateAI(const uint32 diff) { diff --git a/src/bindings/scripts/scripts/zone/azuremyst_isle/azuremyst_isle.cpp b/src/bindings/scripts/scripts/zone/azuremyst_isle/azuremyst_isle.cpp index 8af01b16c14..320a1610827 100644 --- a/src/bindings/scripts/scripts/zone/azuremyst_isle/azuremyst_isle.cpp +++ b/src/bindings/scripts/scripts/zone/azuremyst_isle/azuremyst_isle.cpp @@ -1,4 +1,4 @@ - /* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> + /* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>.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 @@ -26,7 +26,6 @@ npc_draenei_survivor npc_engineer_spark_overgrind npc_injured_draenei npc_magwin -npc_susurrus npc_geezle mob_nestlewood_owlkin EndContentData */ @@ -39,155 +38,140 @@ EndContentData */ ## npc_draenei_survivor ######*/ -#define HEAL1 -1000248 -#define HEAL2 -1000249 -#define HEAL3 -1000250 -#define HEAL4 -1000251 - -#define HELP1 -1000252 -#define HELP2 -1000253 -#define HELP3 -1000254 -#define HELP4 -1000255 +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) {} - uint32 UnSpawnTimer; - uint32 ResetlifeTimer; - uint32 SayingTimer; - uint32 HealSayTimer; - bool UnSpawn; - bool say; - bool HealSay; - bool isRun; - bool isMove; + uint64 pCaster; + + uint32 SayThanksTimer; + uint32 RunAwayTimer; + uint32 SayHelpTimer; + + bool CanSayHelp; void Reset() { - UnSpawnTimer = 2500; - ResetlifeTimer= 60000; - SayingTimer = 5000; - HealSayTimer = 6000; - say = false; - isRun = false; - isMove = false; - UnSpawn = false; - HealSay = false; + 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); - //cast red shining - m_creature->CastSpell(m_creature, 29152, false, NULL); - //set creature health m_creature->SetHealth(int(m_creature->GetMaxHealth()*.1)); - m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 3); + m_creature->SetStandState(UNIT_STAND_STATE_SLEEP); } - void Aggro(Unit *who) {} + void EnterCombat(Unit *who) {} - void MoveInLineOfSight(Unit *who) //MoveInLineOfSight is called if creature could see you, updated all 100 ms + void MoveInLineOfSight(Unit *who) { - if (!who) - return; - - if(who->GetTypeId() == TYPEID_PLAYER && m_creature->IsFriendlyTo(who) && m_creature->IsWithinDistInMap(who, 15) && say && !isRun) + if (CanSayHelp && who->GetTypeId() == TYPEID_PLAYER && m_creature->IsFriendlyTo(who) && m_creature->IsWithinDistInMap(who, 25.0f)) { - switch (rand()%4) //Random switch between 4 texts + //Random switch between 4 texts + switch (rand()%4) { - case 0: - DoScriptText(HELP1, m_creature); - SayingTimer = 15000; - say = false; - break; - case 1: - DoScriptText(HELP2, m_creature); - SayingTimer = 15000; - say = false; - break; - case 2: - DoScriptText(HELP3, m_creature); - SayingTimer = 15000; - say = false; - break; - case 3: - DoScriptText(HELP4, m_creature); - SayingTimer = 15000; - say = false; - break; - } - } - else - { - isRun = false; + 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 UpdateAI(const uint32 diff) //Is also called each ms for Creature AI Updates... + void SpellHit(Unit *Caster, const SpellEntry *Spell) { - if (m_creature->GetHealth() > 50) + if (Spell->SpellFamilyFlags[2] & 0x080000000) { - if(ResetlifeTimer < diff) - { - ResetlifeTimer = 60000; - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT); - //set creature health - m_creature->SetHealth(int(m_creature->GetMaxHealth()*.1)); - // ley down - m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,3); - } - else ResetlifeTimer -= diff; - } + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE); + m_creature->SetStandState(UNIT_STAND_STATE_STAND); - if(HealSay) - { - if (HealSayTimer < diff) - { - UnSpawn = true; - isRun = true; - isMove = true; - }else HealSayTimer -= diff; + m_creature->CastSpell(m_creature, SPELL_STUNNED, true); + + pCaster = Caster->GetGUID(); + + SayThanksTimer = 5000; } + } - if(UnSpawn) + void UpdateAI(const uint32 diff) + { + if (SayThanksTimer) { - if(isMove) + 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); - isMove = false; - } - if (UnSpawnTimer < diff) - { - m_creature->StopMoving(); - EnterEvadeMode(); - //set creature health - m_creature->SetHealth(int(m_creature->GetMaxHealth()*.1)); - return; - }else UnSpawnTimer -= diff; - } + RunAwayTimer = 10000; + SayThanksTimer = 0; + }else SayThanksTimer -= diff; - if(SayingTimer < diff) - { - say = true; - }else SayingTimer -= diff; - } + return; + } - void SpellHit(Unit *Hitter, const SpellEntry *Spellkind)//Called if you cast a spell and do some things if Specified spell is true! - { - if (Hitter && Spellkind->Id == 28880) + if (RunAwayTimer) { - m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); - m_creature->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_CONFUSED); - m_creature->HandleEmoteCommand(ANIM_RISE); - switch (rand()%4) //This switch doesn't work at all, creature say nothing! + if (RunAwayTimer <= diff) { - case 0: DoScriptText(HEAL1, m_creature, Hitter); break; - case 1: DoScriptText(HEAL2, m_creature, Hitter); break; - case 2: DoScriptText(HEAL3, m_creature, Hitter); break; - case 3: DoScriptText(HEAL4, m_creature, Hitter); break; - } - HealSay = true; + m_creature->RemoveAllAuras(); + m_creature->GetMotionMaster()->Clear(); + m_creature->GetMotionMaster()->MoveIdle(); + m_creature->setDeathState(JUST_DIED); + m_creature->SetHealth(0); + m_creature->CombatStop(); + m_creature->DeleteThreatList(); + m_creature->RemoveCorpse(); + }else RunAwayTimer -= diff; + + return; } + + if (SayHelpTimer < diff) + { + CanSayHelp = true; + SayHelpTimer = 20000; + }else SayHelpTimer -= diff; } }; CreatureAI* GetAI_npc_draenei_survivor(Creature *_Creature) @@ -199,33 +183,59 @@ CreatureAI* GetAI_npc_draenei_survivor(Creature *_Creature) ## npc_engineer_spark_overgrind ######*/ -#define SAY_TEXT -1000256 -#define SAY_EMOTE -1000257 -#define ATTACK_YELL -1000258 - -#define GOSSIP_FIGHT "Traitor! You will be brought to justice!" +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 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) {} + 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(875); + + m_creature->setFaction(NormFaction); + m_creature->SetUInt32Value(UNIT_NPC_FLAGS, NpcFlags); + + IsTreeEvent = false; } - void Aggro(Unit *who) { } + void EnterCombat(Unit* who) + { + DoScriptText(ATTACK_YELL, m_creature, who); + } void UpdateAI(const uint32 diff) { - if( !InCombat ) + if( !m_creature->isInCombat() && !IsTreeEvent ) { if (Emote_Timer < diff) { @@ -234,6 +244,8 @@ struct TRINITY_DLL_DECL npc_engineer_spark_overgrindAI : public ScriptedAI Emote_Timer = 120000 + rand()%30000; }else Emote_Timer -= diff; } + else if(IsTreeEvent) + return; if(!UpdateVictim()) return; @@ -255,7 +267,7 @@ CreatureAI* GetAI_npc_engineer_spark_overgrind(Creature *_Creature) bool GossipHello_npc_engineer_spark_overgrind(Player *player, Creature *_Creature) { - if( player->GetQuestStatus(9537) == QUEST_STATUS_INCOMPLETE ) + if( player->GetQuestStatus(QUEST_GNOMERCY) == QUEST_STATUS_INCOMPLETE ) player->ADD_GOSSIP_ITEM(0, GOSSIP_FIGHT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID()); @@ -267,9 +279,8 @@ bool GossipSelect_npc_engineer_spark_overgrind(Player *player, Creature *_Creatu if( action == GOSSIP_ACTION_INFO_DEF ) { player->CLOSE_GOSSIP_MENU(); - _Creature->setFaction(14); - DoScriptText(ATTACK_YELL, _Creature, player); - ((npc_engineer_spark_overgrindAI*)_Creature->AI())->AttackStart(player); + _Creature->setFaction(FACTION_HOSTILE); + CAST_AI(npc_engineer_spark_overgrindAI, _Creature->AI())->AttackStart(player); } return true; } @@ -288,12 +299,12 @@ struct TRINITY_DLL_DECL npc_injured_draeneiAI : public ScriptedAI m_creature->SetHealth(int(m_creature->GetMaxHealth()*.15)); switch (rand()%2) { - case 0: m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 1); break; - case 1: m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 3); break; + case 0: m_creature->SetStandState(UNIT_STAND_STATE_SIT); break; + case 1: m_creature->SetStandState(UNIT_STAND_STATE_SLEEP); break; } } - void Aggro(Unit *who) {} + void EnterCombat(Unit *who) {} void MoveInLineOfSight(Unit *who) { @@ -315,14 +326,17 @@ CreatureAI* GetAI_npc_injured_draenei(Creature *_Creature) ## npc_magwin ######*/ -#define SAY_START -1000111 -#define SAY_AGGRO -1000112 -#define SAY_PROGRESS -1000113 -#define SAY_END1 -1000114 -#define SAY_END2 -1000115 -#define EMOTE_HUG -1000116 - -#define QUEST_A_CRY_FOR_HELP 9528 +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 { @@ -350,13 +364,12 @@ struct TRINITY_DLL_DECL npc_magwinAI : public npc_escortAI case 29: DoScriptText(EMOTE_HUG, m_creature, player); DoScriptText(SAY_END2, m_creature, player); - if (player && player->GetTypeId() == TYPEID_PLAYER) - ((Player*)player)->GroupEventHappens(QUEST_A_CRY_FOR_HELP,m_creature); + player->GroupEventHappens(QUEST_A_CRY_FOR_SAY_HELP,m_creature); break; } } - void Aggro(Unit* who) + void EnterCombat(Unit* who) { DoScriptText(SAY_AGGRO, m_creature, who); } @@ -373,7 +386,7 @@ struct TRINITY_DLL_DECL npc_magwinAI : public npc_escortAI { Player* player = Unit::GetPlayer(PlayerGUID); if (player) - ((Player*)player)->FailQuest(QUEST_A_CRY_FOR_HELP); + player->FailQuest(QUEST_A_CRY_FOR_SAY_HELP); } } @@ -385,103 +398,42 @@ struct TRINITY_DLL_DECL npc_magwinAI : public npc_escortAI bool QuestAccept_npc_magwin(Player* player, Creature* creature, Quest const* quest) { - if (quest->GetQuestId() == QUEST_A_CRY_FOR_HELP) + if (quest->GetQuestId() == QUEST_A_CRY_FOR_SAY_HELP) { creature->setFaction(113); - ((npc_escortAI*)(creature->AI()))->Start(true, true, false, player->GetGUID()); + CAST_AI(npc_escortAI, (creature->AI()))->Start(true, true, false, player->GetGUID()); } return true; } -CreatureAI* GetAI_npc_magwinAI(Creature *_Creature) +CreatureAI* GetAI_npc_magwinAI(Creature* pCreature) { - npc_magwinAI* magwinAI = new npc_magwinAI(_Creature); - - magwinAI->AddWaypoint(0, -4784.532227, -11051.060547, 3.484263); - magwinAI->AddWaypoint(1, -4805.509277, -11037.293945, 3.043942); - magwinAI->AddWaypoint(2, -4827.826172, -11034.398438, 1.741959); - magwinAI->AddWaypoint(3, -4852.630859, -11033.695313, 2.208656); - magwinAI->AddWaypoint(4, -4876.791992, -11034.517578, 3.175228); - magwinAI->AddWaypoint(5, -4895.486816, -11038.306641, 9.390890); - magwinAI->AddWaypoint(6, -4915.464844, -11048.402344, 12.369793); - magwinAI->AddWaypoint(7, -4937.288086, -11067.041992, 13.857983); - magwinAI->AddWaypoint(8, -4966.577637, -11067.507813, 15.754786); - magwinAI->AddWaypoint(9, -4993.799805, -11056.544922, 19.175295); - magwinAI->AddWaypoint(10, -5017.836426, -11052.569336, 22.476587); - magwinAI->AddWaypoint(11, -5039.706543, -11058.459961, 25.831593); - magwinAI->AddWaypoint(12, -5057.289063, -11045.474609, 26.972496); - magwinAI->AddWaypoint(13, -5078.828125, -11037.601563, 29.053417); - magwinAI->AddWaypoint(14, -5104.158691, -11039.195313, 29.440195); - magwinAI->AddWaypoint(15, -5120.780273, -11039.518555, 30.142139); - magwinAI->AddWaypoint(16, -5140.833008, -11039.810547, 28.788074); - magwinAI->AddWaypoint(17, -5161.201660, -11040.050781, 27.879545, 4000); - magwinAI->AddWaypoint(18, -5171.842285, -11046.803711, 27.183821); - magwinAI->AddWaypoint(19, -5185.995117, -11056.359375, 20.234867); - magwinAI->AddWaypoint(20, -5198.485840, -11065.065430, 18.872593); - magwinAI->AddWaypoint(21, -5214.062500, -11074.653320, 19.215731); - magwinAI->AddWaypoint(22, -5220.157227, -11088.377930, 19.818476); - magwinAI->AddWaypoint(23, -5233.652832, -11098.846680, 18.349432); - magwinAI->AddWaypoint(24, -5250.163086, -11111.653320, 16.438959); - magwinAI->AddWaypoint(25, -5268.194336, -11125.639648, 12.668313); - magwinAI->AddWaypoint(26, -5286.270508, -11130.669922, 6.912246); - magwinAI->AddWaypoint(27, -5317.449707, -11137.392578, 4.963446); - magwinAI->AddWaypoint(28, -5334.854492, -11154.384766, 6.742664); - magwinAI->AddWaypoint(29, -5353.874512, -11171.595703, 6.903912, 20000); - magwinAI->AddWaypoint(30, -5354.240000, -11171.940000, 6.890000); - - return (CreatureAI*)magwinAI; -} + npc_magwinAI* magwinAI = new npc_magwinAI(pCreature); -/*###### -## npc_susurrus -######*/ - -bool GossipHello_npc_susurrus(Player *player, Creature *_Creature) -{ - if (_Creature->isQuestGiver()) - player->PrepareQuestMenu( _Creature->GetGUID() ); + magwinAI->FillPointMovementListForCreature(); - if (player->HasItemCount(23843,1,true)) - player->ADD_GOSSIP_ITEM(0, "I am ready.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - - player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID()); - - return true; -} - -bool GossipSelect_npc_susurrus(Player *player, Creature *_Creature, uint32 sender, uint32 action ) -{ - if (action == GOSSIP_ACTION_INFO_DEF) - { - player->CLOSE_GOSSIP_MENU(); - player->CastSpell(player,32474,true); //apparently correct spell, possible not correct place to cast, or correct caster - - std::vector<uint32> nodes; - - nodes.resize(2); - nodes[0] = 92; //from susurrus - nodes[1] = 91; //end at exodar - player->ActivateTaxiPathTo(nodes,11686); //TaxiPath 506. Using invisible model, possible Trinity must allow 0(from dbc) for cases like this. - } - return true; + return magwinAI; } /*###### ## npc_geezle ######*/ -#define GEEZLE_SAY_1 -1000259 -#define SPARK_SAY_2 -1000260 -#define SPARK_SAY_3 -1000261 -#define GEEZLE_SAY_4 -1000262 -#define SPARK_SAY_5 -1000263 -#define SPARK_SAY_6 -1000264 -#define GEEZLE_SAY_7 -1000265 - -#define EMOTE_SPARK -1000266 - -#define MOB_SPARK 17243 -#define GO_NAGA_FLAG 181694 +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}; @@ -505,7 +457,7 @@ struct TRINITY_DLL_DECL npc_geezleAI : public ScriptedAI StartEvent(); } - void Aggro(Unit* who){} + void EnterCombat(Unit* who){} void StartEvent() { @@ -570,7 +522,7 @@ struct TRINITY_DLL_DECL npc_geezleAI : public ScriptedAI cell.SetNoCreate(); Trinity::AllGameObjectsWithEntryInGrid go_check(GO_NAGA_FLAG); - Trinity::GameObjectListSearcher<Trinity::AllGameObjectsWithEntryInGrid> go_search(FlagList, go_check); + Trinity::GameObjectListSearcher<Trinity::AllGameObjectsWithEntryInGrid> go_search(m_creature, FlagList, go_check); TypeContainerVisitor <Trinity::GameObjectListSearcher<Trinity::AllGameObjectsWithEntryInGrid>, GridTypeMapContainer> go_visit(go_search); CellLock<GridReadGuard> cell_lock(cell, pair); @@ -611,8 +563,11 @@ CreatureAI* GetAI_npc_geezleAI(Creature *_Creature) ## mob_nestlewood_owlkin ######*/ -#define INOCULATION_CHANNEL 29528 -#define INOCULATED_OWLKIN 16534 +enum +{ + INOCULATION_CHANNEL = 29528, + INOCULATED_OWLKIN = 16534 +}; struct TRINITY_DLL_DECL mob_nestlewood_owlkinAI : public ScriptedAI { @@ -629,7 +584,7 @@ struct TRINITY_DLL_DECL mob_nestlewood_owlkinAI : public ScriptedAI Hitted = false; } - void Aggro(Unit *who){} + void EnterCombat(Unit *who){} void SpellHit(Unit* caster, const SpellEntry* spell) { @@ -690,12 +645,6 @@ void AddSC_azuremyst_isle() newscript->RegisterSelf(); newscript = new Script; - newscript->Name="npc_susurrus"; - newscript->pGossipHello = &GossipHello_npc_susurrus; - newscript->pGossipSelect = &GossipSelect_npc_susurrus; - newscript->RegisterSelf(); - - newscript = new Script; newscript->Name="npc_geezle"; newscript->GetAI = &GetAI_npc_geezleAI; newscript->RegisterSelf(); @@ -704,6 +653,5 @@ void AddSC_azuremyst_isle() newscript->Name="mob_nestlewood_owlkin"; newscript->GetAI = &GetAI_mob_nestlewood_owlkinAI; newscript->RegisterSelf(); - } diff --git a/src/bindings/scripts/scripts/zone/barrens/the_barrens.cpp b/src/bindings/scripts/scripts/zone/barrens/the_barrens.cpp index 23b2676314a..f8b92d4f077 100644 --- a/src/bindings/scripts/scripts/zone/barrens/the_barrens.cpp +++ b/src/bindings/scripts/scripts/zone/barrens/the_barrens.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -89,60 +89,64 @@ bool GossipSelect_npc_sputtervalve(Player *player, Creature *_Creature, uint32 s ## npc_taskmaster_fizzule ######*/ -//#define FACTION_HOSTILE_F 430 -#define FACTION_HOSTILE_F 16 -#define FACTION_FRIENDLY_F 35 - -#define SPELL_FLARE 10113 -#define SPELL_FOLLY 10137 +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) {} + npc_taskmaster_fizzuleAI(Creature* c) : ScriptedAI(c) + { + factionNorm = c->getFaction(); + } + uint32 factionNorm; bool IsFriend; uint32 Reset_Timer; - uint32 FlareCount; + uint8 FlareCount; void Reset() { IsFriend = false; Reset_Timer = 120000; FlareCount = 0; - m_creature->setFaction(FACTION_HOSTILE_F); - m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER); + m_creature->setFaction(factionNorm); } - //This is a hack. Spellcast will make creature aggro but that is not - //supposed to happen (Trinity not implemented/not found way to detect this spell kind) - void DoUglyHack() + void DoFriend() { m_creature->RemoveAllAuras(); m_creature->DeleteThreatList(); m_creature->CombatStop(); + + 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 ) + if (spell->Id == SPELL_FLARE || spell->Id == SPELL_FOLLY) { - DoUglyHack(); ++FlareCount; - if( FlareCount >= 2 ) - { - m_creature->setFaction(FACTION_FRIENDLY_F); + + if (FlareCount >= 2) IsFriend = true; - } } } - void Aggro(Unit* who) { } + void EnterCombat(Unit* who) { } void UpdateAI(const uint32 diff) { - if( IsFriend ) + if (IsFriend) { - if( Reset_Timer < diff ) + if (Reset_Timer < diff) { EnterEvadeMode(); return; @@ -154,24 +158,27 @@ struct TRINITY_DLL_DECL npc_taskmaster_fizzuleAI : public ScriptedAI DoMeleeAttackIfReady(); } -}; -CreatureAI* GetAI_npc_taskmaster_fizzule(Creature *_Creature) -{ - return new npc_taskmaster_fizzuleAI (_Creature); -} -bool ReciveEmote_npc_taskmaster_fizzule(Player *player, Creature *_Creature, uint32 emote) -{ - if( emote == TEXTEMOTE_SALUTE ) + void ReciveEmote(Player* pPlayer, uint32 emote) { - if( ((npc_taskmaster_fizzuleAI*)_Creature->AI())->FlareCount >= 2 ) + if (emote == TEXTEMOTE_SALUTE) { - _Creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER); - _Creature->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE); + if (FlareCount >= 2) + { + if (m_creature->getFaction() == FACTION_FRIENDLY_F) + return; + else + DoFriend(); + } } } - return true; +}; + +CreatureAI* GetAI_npc_taskmaster_fizzule(Creature* pCreature) +{ + return new npc_taskmaster_fizzuleAI(pCreature); } + /*##### ## npc_twiggy_flathead #####*/ @@ -227,13 +234,13 @@ struct TRINITY_DLL_DECL npc_twiggy_flatheadAI : public ScriptedAI BigWill = 0; } - void Aggro(Unit *who) { } + void EnterCombat(Unit *who) { } void MoveInLineOfSight(Unit *who) { if(!who || (!who->isAlive())) return; - if (m_creature->IsWithinDistInMap(who, 10.0f) && (who->GetTypeId() == TYPEID_PLAYER) && ((Player*)who)->GetQuestStatus(1719) == QUEST_STATUS_INCOMPLETE && !EventInProgress) + 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; @@ -346,7 +353,7 @@ struct TRINITY_DLL_DECL npc_twiggy_flatheadAI : public ScriptedAI pCreature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); pCreature->HandleEmoteCommand(EMOTE_ONESHOT_ROAR); pCreature->setFaction(14); - ((CreatureAI*)pCreature->AI())->AttackStart(pWarrior); + (pCreature->AI())->AttackStart(pWarrior); ++Wave; Wave_Timer = 20000; } @@ -358,7 +365,6 @@ struct TRINITY_DLL_DECL npc_twiggy_flatheadAI : public ScriptedAI //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_ONESHOT_ROAR); pCreature->HandleEmoteCommand(EMOTE_STATE_READYUNARMED); EventBigWill = true; Wave_Timer = 1000; @@ -392,24 +398,33 @@ CreatureAI* GetAI_npc_twiggy_flathead(Creature *_Creature) ## npc_wizzlecrank_shredder #####*/ -#define SAY_PROGRESS_1 -1000272 -#define SAY_PROGRESS_2 -1000273 -#define SAY_PROGRESS_3 -1000274 +enum +{ + SAY_PROGRESS_1 = -1000272, + SAY_PROGRESS_2 = -1000273, + SAY_PROGRESS_3 = -1000274, -#define SAY_MERCENARY_4 -1000275 + SAY_MERCENARY_4 = -1000275, -#define SAY_PROGRESS_5 -1000276 -#define SAY_PROGRESS_6 -1000277 -#define SAY_PROGRESS_7 -1000278 -#define SAY_PROGRESS_8 -1000279 + SAY_PROGRESS_5 = -1000276, + SAY_PROGRESS_6 = -1000277, + SAY_PROGRESS_7 = -1000278, + SAY_PROGRESS_8 = -1000279, -#define QUEST_ESCAPE 863 -#define NPC_PILOT 3451 -#define MOB_MERCENARY 3282 + 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) {} + npc_wizzlecrank_shredderAI(Creature* c) : npc_escortAI(c) + { + uiNormFaction = c->getFaction(); + } + + uint32 uiNormFaction; bool Completed; @@ -428,11 +443,11 @@ struct TRINITY_DLL_DECL npc_wizzlecrank_shredderAI : public npc_escortAI case 10: DoScriptText(SAY_PROGRESS_3, m_creature, player); m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); break; case 20:{ - Unit* Mercenary = FindCreature(MOB_MERCENARY, 99, m_creature); + Unit* Mercenary = m_creature->FindNearestCreature(MOB_MERCENARY, 99); if(Mercenary) { DoScriptText(SAY_MERCENARY_4, Mercenary); - ((Creature*)Mercenary)->AI()->AttackStart(m_creature); + CAST_CRE(Mercenary)->AI()->AttackStart(m_creature); AttackStart(Mercenary); } }break; @@ -444,8 +459,7 @@ struct TRINITY_DLL_DECL npc_wizzlecrank_shredderAI : public npc_escortAI 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; - if (player && player->GetTypeId() == TYPEID_PLAYER) - ((Player*)player)->GroupEventHappens(QUEST_ESCAPE, m_creature); + player->GroupEventHappens(QUEST_ESCAPE, m_creature); break; } } @@ -454,10 +468,15 @@ struct TRINITY_DLL_DECL npc_wizzlecrank_shredderAI : public npc_escortAI { m_creature->setDeathState(ALIVE); Completed = false; - m_creature->setFaction(69); + if(!IsBeingEscorted) + { + m_creature->setFaction(uiNormFaction); + if (m_creature->getStandState() == UNIT_STAND_STATE_DEAD) + m_creature->SetStandState(UNIT_STAND_STATE_STAND); + } } - void Aggro(Unit* who){} + void EnterCombat(Unit* who){} void JustDied(Unit* killer) { @@ -465,7 +484,7 @@ struct TRINITY_DLL_DECL npc_wizzlecrank_shredderAI : public npc_escortAI { Player* player = Unit::GetPlayer(PlayerGUID); if (player) - ((Player*)player)->FailQuest(QUEST_ESCAPE); + player->FailQuest(QUEST_ESCAPE); } } @@ -479,8 +498,8 @@ bool QuestAccept_npc_wizzlecrank_shredder(Player* player, Creature* creature, Qu { if (quest->GetQuestId() == QUEST_ESCAPE) { - ((npc_escortAI*)(creature->AI()))->Start(true, true, false, player->GetGUID()); - creature->setFaction(113); + creature->setFaction(FACTION_RATCHET); + CAST_AI(npc_escortAI, (creature->AI()))->Start(true, true, false, player->GetGUID()); } return true; } @@ -522,7 +541,7 @@ CreatureAI* GetAI_npc_wizzlecrank_shredderAI(Creature *_Creature) thisAI->AddWaypoint(30, 1091.28, -2985.82, 91.74, 7000); thisAI->AddWaypoint(31, 1091.28, -2985.82, 91.74, 3000); - return (CreatureAI*)thisAI; + return thisAI; } void AddSC_the_barrens() @@ -544,7 +563,6 @@ void AddSC_the_barrens() newscript = new Script; newscript->Name="npc_taskmaster_fizzule"; newscript->GetAI = &GetAI_npc_taskmaster_fizzule; - newscript->pReceiveEmote = &ReciveEmote_npc_taskmaster_fizzule; newscript->RegisterSelf(); newscript = new Script; diff --git a/src/bindings/scripts/scripts/zone/black_temple/.boss_teron_gorefiend.cpp-woains b/src/bindings/scripts/scripts/zone/black_temple/.boss_teron_gorefiend.cpp-woains new file mode 100644 index 00000000000..327b670c6d3 --- /dev/null +++ b/src/bindings/scripts/scripts/zone/black_temple/.boss_teron_gorefiend.cpp-woains @@ -0,0 +1,536 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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_Teron_Gorefiend +SD%Complete: 60 +SDComment: Requires Mind Control support for Ghosts. +SDCategory: Black Temple +EndScriptData */ + +#include "precompiled.h" +#include "def_black_temple.h" + + //Speech'n'sound +#define SAY_INTRO -1564037 +#define SAY_AGGRO -1564038 +#define SAY_SLAY1 -1564039 +#define SAY_SLAY2 -1564040 +#define SAY_SPELL1 -1564041 +#define SAY_SPELL2 -1564042 +#define SAY_SPECIAL1 -1564043 +#define SAY_SPECIAL2 -1564044 +#define SAY_ENRAGE -1564045 +#define SAY_DEATH -1564046 + +//Spells +#define SPELL_INCINERATE 40239 +#define SPELL_CRUSHING_SHADOWS 40243 +#define SPELL_SHADOWBOLT 40185 +#define SPELL_PASSIVE_SHADOWFORM 40326 +#define SPELL_SHADOW_OF_DEATH 40251 +#define SPELL_BERSERK 45078 + +#define SPELL_ATROPHY 40327 // Shadowy Constructs use this when they get within melee range of a player + +#define CREATURE_DOOM_BLOSSOM 23123 +#define CREATURE_SHADOWY_CONSTRUCT 23111 + +struct TRINITY_DLL_DECL mob_doom_blossomAI : public ScriptedAI +{ + mob_doom_blossomAI(Creature *c) : ScriptedAI(c) {} + + uint32 CheckTeronTimer; + uint32 ShadowBoltTimer; + uint64 TeronGUID; + + void Reset() + { + CheckTeronTimer = 5000; + ShadowBoltTimer = 12000; + TeronGUID = 0; + } + + void Aggro(Unit *who) { } + void AttackStart(Unit* who) { } + void MoveInLineOfSight(Unit* who) { } + + void Despawn() + { + m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + m_creature->RemoveCorpse(); + } + + void UpdateAI(const uint32 diff) + { + if(CheckTeronTimer < diff) + { + if(TeronGUID) + { + DoZoneInCombat(); + + Creature* Teron = ((Creature*)Unit::GetUnit((*m_creature), TeronGUID)); + if((Teron) && (!Teron->isAlive() || Teron->IsInEvadeMode())) + Despawn(); + } + else + Despawn(); + + CheckTeronTimer = 5000; + }else CheckTeronTimer -= diff; + + if(ShadowBoltTimer < diff && InCombat) + { + DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_SHADOWBOLT); + ShadowBoltTimer = 10000; + }else ShadowBoltTimer -= diff; + return; + } + + void SetTeronGUID(uint64 guid){ TeronGUID = guid; } +}; + +//This is used to sort the players by distance for Constructs to see who to cast Atrophy on +struct TargetDistanceOrder : public std::binary_function<const Unit, const Unit, bool> +{ + const Unit* MainTarget; + TargetDistanceOrder(const Unit* Target) : MainTarget(Target) {}; + // functor for operator "<" + bool operator()(const Unit* _Left, const Unit* _Right) const + { + return (MainTarget->GetDistance(_Left) < MainTarget->GetDistance(_Right)); + } +}; + +struct TRINITY_DLL_DECL mob_shadowy_constructAI : public ScriptedAI +{ + mob_shadowy_constructAI(Creature* c) : ScriptedAI(c) {} + + uint64 GhostGUID; + uint64 TeronGUID; + + uint32 CheckPlayerTimer; + uint32 CheckTeronTimer; + + void Reset() + { + GhostGUID = 0; + TeronGUID = 0; + + CheckPlayerTimer = 2000; + CheckTeronTimer = 5000; + } + + void Aggro(Unit* who) { } + + void MoveInLineOfSight(Unit *who) + { + if(!who || (!who->isAlive()) || (who->GetGUID() == GhostGUID)) + return; + + ScriptedAI::MoveInLineOfSight(who); + } + +/* Comment it out for now. NOTE TO FUTURE DEV: UNCOMMENT THIS OUT ONLY AFTER MIND CONTROL IS IMPLEMENTED + void DamageTaken(Unit* done_by, uint32 &damage) + { + if(done_by->GetGUID() != GhostGUID) + damage = 0; // Only the ghost can deal damage. + } + */ + + void CheckPlayers() + { + std::list<HostilReference*>& m_threatlist = m_creature->getThreatManager().getThreatList(); + if(m_threatlist.empty()) + return; // No threat list. Don't continue. + std::list<HostilReference*>::iterator itr = m_threatlist.begin(); + std::list<Unit*> targets; + for( ; itr != m_threatlist.end(); ++itr) + { + Unit* pUnit = Unit::GetUnit((*m_creature), (*itr)->getUnitGuid()); + if(pUnit && pUnit->isAlive()) + targets.push_back(pUnit); + } + targets.sort(TargetDistanceOrder(m_creature)); + Unit* target = targets.front(); + if(target && m_creature->IsWithinDistInMap(target, m_creature->GetAttackDistance(target))) + { + DoCast(target, SPELL_ATROPHY); + m_creature->AI()->AttackStart(target); + } + } + + void UpdateAI(const uint32 diff) + { + if(CheckPlayerTimer < diff) + { + CheckPlayers(); + CheckPlayerTimer = 3000; + }else CheckPlayerTimer -= diff; + + if(CheckTeronTimer < diff) + { + Creature* Teron = ((Creature*)Unit::GetUnit((*m_creature), TeronGUID)); + if(!Teron || !Teron->isAlive() || Teron->IsInEvadeMode()) + m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + + CheckTeronTimer = 5000; + }else CheckTeronTimer -= diff; + } +}; + +struct TRINITY_DLL_DECL boss_teron_gorefiendAI : public ScriptedAI +{ + boss_teron_gorefiendAI(Creature *c) : ScriptedAI(c) + { + pInstance = ((ScriptedInstance*)c->GetInstanceData()); + } + + ScriptedInstance* pInstance; + + uint32 IncinerateTimer; + uint32 SummonDoomBlossomTimer; + uint32 EnrageTimer; + uint32 CrushingShadowsTimer; + uint32 ShadowOfDeathTimer; + uint32 SummonShadowsTimer; + uint32 RandomYellTimer; + uint32 AggroTimer; + + uint64 AggroTargetGUID; + uint64 GhostGUID; // Player that gets killed by Shadow of Death and gets turned into a ghost + + bool Intro; + + void Reset() + { + if(pInstance) + pInstance->SetData(DATA_TERONGOREFIENDEVENT, NOT_STARTED); + + IncinerateTimer = 20000 + rand()%11000; + SummonDoomBlossomTimer = 12000; + EnrageTimer = 600000; + CrushingShadowsTimer = 22000; + SummonShadowsTimer = 60000; + RandomYellTimer = 50000; + + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + // Start off unattackable so that the intro is done properly + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + AggroTimer = 20000; + AggroTargetGUID = 0; + Intro = false; + } + + void Aggro(Unit *who) {} + + void MoveInLineOfSight(Unit *who) + { + if(!who || (!who->isAlive())) return; + + if(who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who)) + { + float attackRadius = m_creature->GetAttackDistance(who); + + if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->GetDistanceZ(who) <= CREATURE_Z_ATTACK_RANGE && m_creature->IsWithinLOSInMap(who)) + { + //if(who->HasStealthAura()) + // who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); + + m_creature->AddThreat(who, 1.0f); + } + + if(!InCombat && !Intro && m_creature->IsWithinDistInMap(who, 60.0f) && (who->GetTypeId() == TYPEID_PLAYER)) + { + if(pInstance) + pInstance->SetData(DATA_TERONGOREFIENDEVENT, IN_PROGRESS); + + m_creature->GetMotionMaster()->Clear(false); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + DoScriptText(SAY_INTRO, m_creature); + m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_TALK); + AggroTargetGUID = who->GetGUID(); + Intro = true; + } + } + } + + void KilledUnit(Unit *victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + } + } + + void JustDied(Unit *victim) + { + if(pInstance) + pInstance->SetData(DATA_TERONGOREFIENDEVENT, DONE); + + DoScriptText(SAY_DEATH, m_creature); + } + + float CalculateRandomLocation(float Loc, uint32 radius) + { + float coord = Loc; + switch(rand()%2) + { + case 0: + coord += rand()%radius; + break; + case 1: + coord -= rand()%radius; + break; + } + return coord; + } + + void SetThreatList(Creature* Blossom) + { + if(!Blossom) return; + + std::list<HostilReference*>& m_threatlist = m_creature->getThreatManager().getThreatList(); + std::list<HostilReference*>::iterator i = m_threatlist.begin(); + for(i = m_threatlist.begin(); i != m_threatlist.end(); i++) + { + Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid()); + if(pUnit && pUnit->isAlive()) + { + float threat = DoGetThreat(pUnit); + Blossom->AddThreat(pUnit, threat); + } + } + } + + void MindControlGhost() + { + /************************************************************************/ + /** NOTE FOR FUTURE DEVELOPER: PROPERLY IMPLEMENT THE GHOST PORTION *****/ + /** ONLY AFTER TrinIty FULLY IMPLEMENTS MIND CONTROL ABILITIES *****/ + /** THE CURRENT CODE IN THIS FUNCTION IS ONLY THE BEGINNING OF *****/ + /** WHAT IS FULLY NECESSARY FOR GOREFIEND TO BE 100% COMPLETE *****/ + /************************************************************************/ + + Unit* Ghost = NULL; + if(GhostGUID) + Ghost = Unit::GetUnit((*m_creature), GhostGUID); + if(Ghost && Ghost->isAlive() && Ghost->HasAura(SPELL_SHADOW_OF_DEATH, 0)) + { + /*float x,y,z; + Ghost->GetPosition(x,y,z); + Creature* control = m_creature->SummonCreature(CREATURE_GHOST, x, y, z, 0, TEMPSUMMON_TIMED_DESAWN, 30000); + if(control) + { + ((Player*)Ghost)->Possess(control); + Ghost->DealDamage(Ghost, Ghost->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, + false); + }*/ + for(uint8 i = 0; i < 4; ++i) + { + Creature* Construct = NULL; + float X = CalculateRandomLocation(Ghost->GetPositionX(), 10); + float Y = CalculateRandomLocation(Ghost->GetPositionY(), 10); + Construct = m_creature->SummonCreature(CREATURE_SHADOWY_CONSTRUCT, X, Y, Ghost->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45000); + if(Construct) + { + Construct->CastSpell(Construct, SPELL_PASSIVE_SHADOWFORM, true); + SetThreatList(Construct); // Use same function as Doom Blossom to set Threat List. + ((mob_shadowy_constructAI*)Construct->AI())->GhostGUID = GhostGUID; + Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1); + if(!target) // someone's trying to solo. + target = m_creature->getVictim(); + + if(target) + Construct->GetMotionMaster()->MoveChase(target); + } + } + } + } + + void UpdateAI(const uint32 diff) + { + if(Intro) + { + if(AggroTimer < diff) + { + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + DoScriptText(SAY_AGGRO, m_creature); + m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_NONE); + Intro = false; + if(AggroTargetGUID) + { + Unit* pUnit = Unit::GetUnit((*m_creature), AggroTargetGUID); + if(pUnit) + AttackStart(pUnit); + + DoZoneInCombat(); + }else EnterEvadeMode(); + + }else AggroTimer -= diff; + } + + if(!UpdateVictim() || Intro) + return; + + if(SummonShadowsTimer < diff) + { + //MindControlGhost(); + + for(uint8 i = 0; i < 2; ++i) + { + Creature* Shadow = NULL; + float X = CalculateRandomLocation(m_creature->GetPositionX(), 10); + Shadow = m_creature->SummonCreature(CREATURE_SHADOWY_CONSTRUCT, X, m_creature->GetPositionY(), m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 0); + if(Shadow) + { + Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1); + if(!target) + target = m_creature->getVictim(); + + if(target) + Shadow->AI()->AttackStart(target); + } + } + SummonShadowsTimer = 60000; + }else SummonShadowsTimer -= diff; + + if(SummonDoomBlossomTimer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + { + float X = CalculateRandomLocation(target->GetPositionX(), 20); + float Y = CalculateRandomLocation(target->GetPositionY(), 20); + float Z = target->GetPositionZ(); + Z = m_creature->GetMap()->GetVmapHeight(X, Y, Z, true); + Creature* DoomBlossom = m_creature->SummonCreature(CREATURE_DOOM_BLOSSOM, X, Y, Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 20000); + if(DoomBlossom) + { + DoomBlossom->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + DoomBlossom->setFaction(m_creature->getFaction()); + DoomBlossom->AddThreat(target, 1.0f); + ((mob_doom_blossomAI*)DoomBlossom->AI())->SetTeronGUID(m_creature->GetGUID()); + ((mob_doom_blossomAI*)DoomBlossom->AI())->InCombat = true; + SetThreatList(DoomBlossom); + SummonDoomBlossomTimer = 35000; + } + } + }else SummonDoomBlossomTimer -= diff; + + if(IncinerateTimer < diff) + { + Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1); + if(!target) + target = m_creature->getVictim(); + + if(target) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_SPECIAL1, m_creature); break; + case 1: DoScriptText(SAY_SPECIAL2, m_creature); break; + } + DoCast(target, SPELL_INCINERATE); + IncinerateTimer = 20000 + rand()%31 * 1000; + } + }else IncinerateTimer -= diff; + + if(CrushingShadowsTimer < diff) + { + Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0); + if(target && target->isAlive()) + DoCast(target, SPELL_CRUSHING_SHADOWS); + CrushingShadowsTimer = 10000 + rand()%16 * 1000; + }else CrushingShadowsTimer -= diff; + + /*** NOTE FOR FUTURE DEV: UNCOMMENT BELOW ONLY IF MIND CONTROL IS FULLY IMPLEMENTED **/ + /*if(ShadowOfDeathTimer < diff) + { + Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1); + + if(!target) + target = m_creature->getVictim(); + + if(target && target->isAlive() && target->GetTypeId() == TYPEID_PLAYER) + { + DoCast(target, SPELL_SHADOW_OF_DEATH); + GhostGUID = target->GetGUID(); + ShadowOfDeathTimer = 30000; + SummonShadowsTimer = 53000; // Make it VERY close but slightly less so that we can check if the aura is still on the player + } + }else ShadowOfDeathTimer -= diff;*/ + + if(RandomYellTimer < diff) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_SPELL1, m_creature); break; + case 1: DoScriptText(SAY_SPELL2, m_creature); break; + } + RandomYellTimer = 50000 + rand()%51 * 1000; + }else RandomYellTimer -= diff; + + if(!m_creature->HasAura(SPELL_BERSERK, 0)) + { + if(EnrageTimer < diff) + { + DoCast(m_creature, SPELL_BERSERK); + DoScriptText(SAY_ENRAGE, m_creature); + }else EnrageTimer -= diff; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_doom_blossom(Creature *_Creature) +{ + return new mob_doom_blossomAI(_Creature); +} + +CreatureAI* GetAI_mob_shadowy_construct(Creature *_Creature) +{ + return new mob_shadowy_constructAI(_Creature); +} + +CreatureAI* GetAI_boss_teron_gorefiend(Creature *_Creature) +{ + return new boss_teron_gorefiendAI (_Creature); +} + +void AddSC_boss_teron_gorefiend() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "mob_doom_blossom"; + newscript->GetAI = &GetAI_mob_doom_blossom; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_shadowy_construct"; + newscript->GetAI = &GetAI_mob_shadowy_construct; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="boss_teron_gorefiend"; + newscript->GetAI = &GetAI_boss_teron_gorefiend; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/zone/black_temple/.instance_black_temple.cpp-s8inyu b/src/bindings/scripts/scripts/zone/black_temple/.instance_black_temple.cpp-s8inyu new file mode 100644 index 00000000000..43646746505 --- /dev/null +++ b/src/bindings/scripts/scripts/zone/black_temple/.instance_black_temple.cpp-s8inyu @@ -0,0 +1,347 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +/* ScriptData +SDName: Instance_Black_Temple +SD%Complete: 100 +SDComment: Instance Data Scripts and functions to acquire mobs and set encounter status for use in various Black Temple Scripts +SDCategory: Black Temple +EndScriptData */ + +#include "precompiled.h" +#include "def_black_temple.h" + +#define ENCOUNTERS 9 + +/* Black Temple encounters: +0 - High Warlord Naj'entus event +1 - Supremus Event +2 - Shade of Akama Event +3 - Teron Gorefiend Event +4 - Gurtogg Bloodboil Event +5 - Reliquary Of Souls Event +6 - Mother Shahraz Event +7 - Illidari Council Event +8 - Illidan Stormrage Event +*/ + +struct TRINITY_DLL_DECL instance_black_temple : public ScriptedInstance +{ + instance_black_temple(Map *map) : ScriptedInstance(map) {Initialize();}; + + uint32 Encounters[ENCOUNTERS]; + std::string str_data; + + uint64 Najentus; + uint64 Akama; // This is the Akama that starts the Illidan encounter. + uint64 Akama_Shade; // This is the Akama that starts the Shade of Akama encounter. + uint64 ShadeOfAkama; + uint64 Supremus; + uint64 LadyMalande; + uint64 GathiosTheShatterer; + uint64 HighNethermancerZerevor; + uint64 VerasDarkshadow; + uint64 IllidariCouncil; + uint64 BloodElfCouncilVoice; + uint64 IllidanStormrage; + + uint64 NajentusGate; + uint64 MainTempleDoors; + uint64 ShadeOfAkamaDoor; + uint64 CommonDoor;//Teron + uint64 TeronDoor; + uint64 GuurtogDoor; + uint64 MotherDoor; + uint64 TempleDoor;//Befor mother + uint64 CouncilDoor; + uint64 SimpleDoor;//council + uint64 IllidanGate; + uint64 IllidanDoor[2]; + + void Initialize() + { + Najentus = 0; + Akama = 0; + Akama_Shade = 0; + ShadeOfAkama = 0; + Supremus = 0; + LadyMalande = 0; + GathiosTheShatterer = 0; + HighNethermancerZerevor = 0; + VerasDarkshadow = 0; + IllidariCouncil = 0; + BloodElfCouncilVoice = 0; + IllidanStormrage = 0; + + NajentusGate = 0; + MainTempleDoors = 0; + ShadeOfAkamaDoor= 0; + CommonDoor = 0;//teron + TeronDoor = 0; + GuurtogDoor = 0; + MotherDoor = 0; + TempleDoor = 0; + SimpleDoor = 0;//Bycouncil + CouncilDoor = 0; + IllidanGate = 0; + IllidanDoor[0] = 0; + IllidanDoor[1] = 0; + + for(uint8 i = 0; i < ENCOUNTERS; ++i) + Encounters[i] = NOT_STARTED; + } + + bool IsEncounterInProgress() const + { + for(uint8 i = 0; i < ENCOUNTERS; ++i) + if(Encounters[i] == IN_PROGRESS) return true; + + return false; + } + + Player* GetPlayerInMap() + { + Map::PlayerList const& players = instance->GetPlayers(); + + if (!players.isEmpty()) + { + for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + { + if (Player* plr = itr->getSource()) + return plr; + } + } + + debug_log("TSCR: Instance Black Temple: GetPlayerInMap, but PlayerList is empty!"); + return NULL; + } + + void OnCreatureCreate(Creature *creature, uint32 creature_entry) + { + switch(creature->GetEntry()) + { + case 22887: Najentus = creature->GetGUID(); break; + case 23089: Akama = creature->GetGUID(); break; + case 22990: Akama_Shade = creature->GetGUID(); break; + case 22841: ShadeOfAkama = creature->GetGUID(); break; + case 22898: Supremus = creature->GetGUID(); break; + case 22917: IllidanStormrage = creature->GetGUID(); break; + case 22949: GathiosTheShatterer = creature->GetGUID(); break; + case 22950: HighNethermancerZerevor = creature->GetGUID(); break; + case 22951: LadyMalande = creature->GetGUID(); break; + case 22952: VerasDarkshadow = creature->GetGUID(); break; + case 23426: IllidariCouncil = creature->GetGUID(); break; + case 23499: BloodElfCouncilVoice = creature->GetGUID(); break; + } + } + + void OnObjectCreate(GameObject* go) + { + switch(go->GetEntry()) + { + case 185483: NajentusGate = go->GetGUID();// Gate past Naj'entus (at the entrance to Supermoose's courtyards) + if(Encounters[0] == DONE)HandleGameObject(NULL,true,go);break; + case 185882: MainTempleDoors = go->GetGUID();// Main Temple Doors - right past Supermoose (Supremus) + if(Encounters[1] == DONE)HandleGameObject(NULL,true,go);break; + case 185478: ShadeOfAkamaDoor = go->GetGUID();break; + case 185480: CommonDoor = go->GetGUID(); + if(Encounters[3] == DONE)HandleGameObject(NULL,true,go);;break; + case 186153: TeronDoor = go->GetGUID(); + if(Encounters[3] == DONE)HandleGameObject(NULL,true,go);;break; + case 185892: GuurtogDoor = go->GetGUID(); + if(Encounters[4] == DONE)HandleGameObject(NULL,true,go);break; + case 185479: TempleDoor = go->GetGUID(); + if(Encounters[5] == DONE)HandleGameObject(NULL,true,go);break; + case 185482: MotherDoor = go->GetGUID(); + if(Encounters[6] == DONE)HandleGameObject(NULL,true,go);break; + case 185481: CouncilDoor = go->GetGUID(); + if(Encounters[7] == DONE)HandleGameObject(NULL,true,go);break; + case 186152: SimpleDoor = go->GetGUID(); + if(Encounters[7] == DONE)HandleGameObject(NULL,true,go);break; + case 185905: IllidanGate = go->GetGUID(); break; // Gate leading to Temple Summit + case 186261: IllidanDoor[0] = go->GetGUID(); break; // Right door at Temple Summit + case 186262: IllidanDoor[1] = go->GetGUID(); break; // Left door at Temple Summit + } + } + + uint64 GetData64(uint32 identifier) + { + switch(identifier) + { + case DATA_HIGHWARLORDNAJENTUS: return Najentus; + case DATA_AKAMA: return Akama; + case DATA_AKAMA_SHADE: return Akama_Shade; + case DATA_SHADEOFAKAMA: return ShadeOfAkama; + case DATA_SUPREMUS: return Supremus; + case DATA_ILLIDANSTORMRAGE: return IllidanStormrage; + case DATA_GATHIOSTHESHATTERER: return GathiosTheShatterer; + case DATA_HIGHNETHERMANCERZEREVOR: return HighNethermancerZerevor; + case DATA_LADYMALANDE: return LadyMalande; + case DATA_VERASDARKSHADOW: return VerasDarkshadow; + case DATA_ILLIDARICOUNCIL: return IllidariCouncil; + case DATA_GAMEOBJECT_NAJENTUS_GATE: return NajentusGate; + case DATA_GAMEOBJECT_ILLIDAN_GATE: return IllidanGate; + case DATA_GAMEOBJECT_ILLIDAN_DOOR_R: return IllidanDoor[0]; + case DATA_GAMEOBJECT_ILLIDAN_DOOR_L: return IllidanDoor[1]; + case DATA_GAMEOBJECT_SUPREMUS_DOORS: return MainTempleDoors; + case DATA_BLOOD_ELF_COUNCIL_VOICE: return BloodElfCouncilVoice; + } + + return 0; + } + + void SetData(uint32 type, uint32 data) + { + switch(type) + { + case DATA_HIGHWARLORDNAJENTUSEVENT: + if(data == DONE) + { + HandleGameObject(NajentusGate, true); + } + Encounters[0] = data;break; + case DATA_SUPREMUSEVENT: + if(data == DONE) + { + HandleGameObject(NajentusGate, true); + } + Encounters[1] = data; break; + case DATA_SHADEOFAKAMAEVENT: + if(data == IN_PROGRESS) + { + HandleGameObject(ShadeOfAkamaDoor, false); + }else HandleGameObject(ShadeOfAkamaDoor, true); + Encounters[2] = data; break; + case DATA_TERONGOREFIENDEVENT: + if(data == IN_PROGRESS) + { + HandleGameObject(TeronDoor, false); + HandleGameObject(CommonDoor, false); + }else + { + HandleGameObject(TeronDoor, true); + HandleGameObject(CommonDoor, true); + } + Encounters[3] = data; break; + case DATA_GURTOGGBLOODBOILEVENT: + if(data == DONE) + { + HandleGameObject(GuurtogDoor, true); + } + Encounters[4] = data; break; + case DATA_RELIQUARYOFSOULSEVENT: + if(data == DONE) + { + HandleGameObject(TempleDoor, true); + } + Encounters[5] = data; break; + case DATA_MOTHERSHAHRAZEVENT: + if(data == DONE) + { + HandleGameObject(MotherDoor, true); + } + Encounters[6] = data; break; + case DATA_ILLIDARICOUNCILEVENT: + if(data == IN_PROGRESS) + { + HandleGameObject(CouncilDoor, false); + HandleGameObject(SimpleDoor, false); + }else + { + HandleGameObject(CouncilDoor, true); + HandleGameObject(SimpleDoor, true); + } + Encounters[7] = data; break; + case DATA_ILLIDANSTORMRAGEEVENT: Encounters[8] = data; break; + } + + if (data == DONE) + { + OUT_SAVE_INST_DATA; + + std::ostringstream saveStream; + saveStream << Encounters[0] << " " << Encounters[1] << " " + << Encounters[2] << " " << Encounters[3] << " " << Encounters[4] + << " " << Encounters[5] << " " << Encounters[6] << " " << Encounters[7] + << " " << Encounters[8]; + + str_data = saveStream.str(); + + SaveToDB(); + OUT_SAVE_INST_DATA_COMPLETE; + } + } + + uint32 GetData(uint32 type) + { + switch(type) + { + case DATA_HIGHWARLORDNAJENTUSEVENT: return Encounters[0]; + case DATA_SUPREMUSEVENT: return Encounters[1]; + case DATA_SHADEOFAKAMAEVENT: return Encounters[2]; + case DATA_TERONGOREFIENDEVENT: return Encounters[3]; + case DATA_GURTOGGBLOODBOILEVENT: return Encounters[4]; + case DATA_RELIQUARYOFSOULSEVENT: return Encounters[5]; + case DATA_MOTHERSHAHRAZEVENT: return Encounters[6]; + case DATA_ILLIDARICOUNCILEVENT: return Encounters[7]; + case DATA_ILLIDANSTORMRAGEEVENT: return Encounters[8]; + } + + return 0; + } + + const char* Save() + { + return str_data.c_str(); + } + + void Load(const char* in) + { + if (!in) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(in); + + std::istringstream loadStream(in); + loadStream >> Encounters[0] >> Encounters[1] >> Encounters[2] + >> Encounters[3] >> Encounters[4] >> Encounters[5] >> Encounters[6] + >> Encounters[7] >> Encounters[8]; + + for(uint8 i = 0; i < ENCOUNTERS; ++i) + if (Encounters[i] == IN_PROGRESS) + Encounters[i] = NOT_STARTED; + + OUT_LOAD_INST_DATA_COMPLETE; + } +}; + +InstanceData* GetInstanceData_instance_black_temple(Map* map) +{ + return new instance_black_temple(map); +} + +void AddSC_instance_black_temple() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_black_temple"; + newscript->GetInstanceData = &GetInstanceData_instance_black_temple; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/zone/black_temple/black_temple.cpp b/src/bindings/scripts/scripts/zone/black_temple/black_temple.cpp index da9b20ef63e..aa390a229b1 100644 --- a/src/bindings/scripts/scripts/zone/black_temple/black_temple.cpp +++ b/src/bindings/scripts/scripts/zone/black_temple/black_temple.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -37,7 +37,7 @@ EndContentData */ bool GossipHello_npc_spirit_of_olum(Player* player, Creature* _Creature) { - ScriptedInstance* pInstance = ((ScriptedInstance*)_Creature->GetInstanceData()); + ScriptedInstance* pInstance = (_Creature->GetInstanceData()); if(pInstance && (pInstance->GetData(DATA_SUPREMUSEVENT) >= DONE) && (pInstance->GetData(DATA_HIGHWARLORDNAJENTUSEVENT) >= DONE)) player->ADD_GOSSIP_ITEM(0, GOSSIP_OLUM1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_bloodboil.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_bloodboil.cpp index 656496c268f..48405c1190c 100644 --- a/src/bindings/scripts/scripts/zone/black_temple/boss_bloodboil.cpp +++ b/src/bindings/scripts/scripts/zone/black_temple/boss_bloodboil.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -67,7 +67,7 @@ struct TRINITY_DLL_DECL boss_gurtogg_bloodboilAI : public ScriptedAI { boss_gurtogg_bloodboilAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } ScriptedInstance* pInstance; @@ -115,7 +115,7 @@ struct TRINITY_DLL_DECL boss_gurtogg_bloodboilAI : public ScriptedAI m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, false); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { DoZoneInCombat(); DoScriptText(SAY_AGGRO, m_creature); @@ -215,7 +215,7 @@ struct TRINITY_DLL_DECL boss_gurtogg_bloodboilAI : public ScriptedAI FelAcidTimer = 25000; }else FelAcidTimer -= diff; - if(!m_creature->HasAura(SPELL_BERSERK, 0)) + if(!m_creature->HasAura(SPELL_BERSERK)) { if(EnrageTimer < diff) { diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_illidan.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_illidan.cpp index bd0cb3e2e23..e8b57f78e9c 100644 --- a/src/bindings/scripts/scripts/zone/black_temple/boss_illidan.cpp +++ b/src/bindings/scripts/scripts/zone/black_temple/boss_illidan.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -137,6 +137,9 @@ EndScriptData */ #define FLAME_ENRAGE_DISTANCE 30 #define FLAME_CHARGE_DISTANCE 50 +#define EQUIP_ID_MAIN_HAND 32837 +#define EQUIP_ID_OFF_HAND 32838 + /**** Creature Summon and Recognition IDs ****/ enum CreatureEntry { @@ -363,8 +366,12 @@ struct TRINITY_DLL_DECL boss_illidan_stormrageAI : public ScriptedAI { boss_illidan_stormrageAI(Creature* c) : ScriptedAI(c), Summons(m_creature) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); m_creature->CastSpell(m_creature, SPELL_DUAL_WIELD, true); + + SpellEntry *TempSpell = GET_SPELL(SPELL_SHADOWFIEND_PASSIVE); + if(TempSpell) + TempSpell->EffectApplyAuraName[0] = 4; // proc debuff, and summon infinite fiends } ScriptedInstance* pInstance; @@ -422,7 +429,7 @@ struct TRINITY_DLL_DECL boss_illidan_stormrageAI : public ScriptedAI Timer[EVENT_FLIGHT_SEQUENCE] = 1000; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { m_creature->setActive(true); DoZoneInCombat(); @@ -434,9 +441,9 @@ struct TRINITY_DLL_DECL boss_illidan_stormrageAI : public ScriptedAI return; if(Phase == PHASE_FLIGHT || Phase == PHASE_DEMON) - ScriptedAI::AttackStart(who, false); + AttackStartNoMove(who); else - ScriptedAI::AttackStart(who, true); + ScriptedAI::AttackStart(who); } void MoveInLineOfSight(Unit *who) {} @@ -454,7 +461,7 @@ struct TRINITY_DLL_DECL boss_illidan_stormrageAI : public ScriptedAI { GameObject* Door = GameObject::GetGameObject((*m_creature), pInstance->GetData64(i)); if(Door) - Door->SetUInt32Value(GAMEOBJECT_STATE, 0); // Open Doors + Door->SetGoState(GO_STATE_ACTIVE); // Open Doors } } @@ -487,11 +494,11 @@ struct TRINITY_DLL_DECL boss_illidan_stormrageAI : public ScriptedAI { if(spell->Id == SPELL_GLAIVE_RETURNS) // Re-equip our warblades! { - if(!m_creature->GetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY)) - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, 45479); + if(!m_creature->GetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID)) + SetEquipmentSlots(false, EQUIP_ID_MAIN_HAND, EQUIP_UNEQUIP, EQUIP_NO_CHANGE); else - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY+1, 45481); - m_creature->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE ); + SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_ID_OFF_HAND, EQUIP_NO_CHANGE); + m_creature->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE); } } @@ -524,7 +531,7 @@ struct TRINITY_DLL_DECL boss_illidan_stormrageAI : public ScriptedAI if(Conversation[count].emote) creature->HandleEmoteCommand(Conversation[count].emote); // Make the creature do some animation! if(Conversation[count].text) - creature->Yell(Conversation[count].text, LANG_UNIVERSAL, 0); // Have the creature yell out some text + creature->MonsterYell(Conversation[count].text, LANG_UNIVERSAL, 0); // Have the creature yell out some text if(Conversation[count].sound) DoPlaySoundToSet(creature, Conversation[count].sound); // Play some sound on the creature } @@ -541,7 +548,7 @@ struct TRINITY_DLL_DECL boss_illidan_stormrageAI : public ScriptedAI { case 1://lift off m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF); - m_creature->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING + MOVEMENTFLAG_ONTRANSPORT); + m_creature->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); m_creature->StopMoving(); DoYell(SAY_TAKEOFF, LANG_UNIVERSAL, NULL); DoPlaySoundToSet(m_creature, SOUND_TAKEOFF); @@ -567,8 +574,7 @@ struct TRINITY_DLL_DECL boss_illidan_stormrageAI : public ScriptedAI Timer[EVENT_FLIGHT_SEQUENCE] = 700; break; case 4://throw another - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, 0); - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY+1, 0); + SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_UNEQUIP, EQUIP_NO_CHANGE); { uint8 i=0; Creature* Glaive = m_creature->SummonCreature(BLADE_OF_AZZINOTH, GlaivePosition[i].x, GlaivePosition[i].y, GlaivePosition[i].z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); @@ -611,7 +617,7 @@ struct TRINITY_DLL_DECL boss_illidan_stormrageAI : public ScriptedAI Timer[EVENT_FLIGHT_SEQUENCE] = 2000; break; case 9://land - m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING + MOVEMENTFLAG_ONTRANSPORT); + m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); m_creature->StopMoving(); m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LAND); for(uint8 i = 0; i < 2; i++) @@ -653,14 +659,14 @@ struct TRINITY_DLL_DECL boss_illidan_stormrageAI : public ScriptedAI if(DemonTransformation[TransformCount].equip) { - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, 45479); // Requip warglaives if needed - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY+1, 45481); + // Requip warglaives if needed + SetEquipmentSlots(false, EQUIP_ID_MAIN_HAND, EQUIP_ID_OFF_HAND, EQUIP_NO_CHANGE); m_creature->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE ); } else { - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, 0); // Unequip warglaives if needed - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY+1, 0); + // Unequip warglaives if needed + SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_UNEQUIP, EQUIP_NO_CHANGE); } switch(TransformCount) @@ -741,7 +747,7 @@ struct TRINITY_DLL_DECL boss_illidan_stormrageAI : public ScriptedAI if(m_creature->IsNonMeleeSpellCasted(false)) return; - if(Phase == PHASE_NORMAL || Phase == PHASE_NORMAL_2 || Phase == PHASE_NORMAL_MAIEV && !m_creature->HasAura(SPELL_CAGED, 0)) + if(Phase == PHASE_NORMAL || Phase == PHASE_NORMAL_2 || Phase == PHASE_NORMAL_MAIEV && !m_creature->HasAura(SPELL_CAGED)) { switch(Event) { @@ -778,7 +784,7 @@ struct TRINITY_DLL_DECL boss_illidan_stormrageAI : public ScriptedAI case EVENT_PARASITIC_SHADOWFIEND: { - if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1, 200, true)) + if(Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 200, true)) m_creature->CastSpell(target, SPELL_PARASITIC_SHADOWFIEND, true); Timer[EVENT_PARASITIC_SHADOWFIEND] = 35000 + rand()%10000; }break; @@ -896,11 +902,11 @@ struct TRINITY_DLL_DECL flame_of_azzinothAI : public ScriptedAI GlaiveGUID = 0; } - void Aggro(Unit *who) {DoZoneInCombat();} + void EnterCombat(Unit *who) {DoZoneInCombat();} void ChargeCheck() { - Unit* target = SelectUnit(SELECT_TARGET_FARTHEST, 0, 200, false); + Unit* target = SelectTarget(SELECT_TARGET_FARTHEST, 0, 200, false); if(target && (!m_creature->IsWithinCombatRange(target, FLAME_CHARGE_DISTANCE))) { m_creature->AddThreat(target, 5000000.0f); @@ -926,7 +932,7 @@ struct TRINITY_DLL_DECL flame_of_azzinothAI : public ScriptedAI AttackStart(m_creature->getVictim()); } } - else if(!m_creature->HasAura(SPELL_AZZINOTH_CHANNEL, 0)) + else if(!m_creature->HasAura(SPELL_AZZINOTH_CHANNEL)) { Glaive->CastSpell(m_creature, SPELL_AZZINOTH_CHANNEL, false); m_creature->RemoveAurasDueToSpell(SPELL_FLAME_ENRAGE); @@ -967,7 +973,7 @@ struct TRINITY_DLL_DECL npc_akama_illidanAI : public ScriptedAI { npc_akama_illidanAI(Creature* c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } ScriptedInstance* pInstance; @@ -998,10 +1004,10 @@ struct TRINITY_DLL_DECL npc_akama_illidanAI : public ScriptedAI DoorGUID[1] = pInstance->GetData64(DATA_GAMEOBJECT_ILLIDAN_DOOR_L); if(GETGO(Gate, GateGUID)) - Gate->SetUInt32Value(GAMEOBJECT_STATE, 1); + Gate->SetGoState(GO_STATE_READY); for(uint8 i = 0; i < 2; i++) if(GETGO(Door, DoorGUID[i])) - Door->SetUInt32Value(GAMEOBJECT_STATE, 1); + Door->SetGoState(GO_STATE_READY); } else { @@ -1036,11 +1042,10 @@ struct TRINITY_DLL_DECL npc_akama_illidanAI : public ScriptedAI m_creature->RemoveAllAuras(); m_creature->DeleteThreatList(); m_creature->CombatStop(); - InCombat = false; } - void Aggro(Unit *who) {} - void MoveInLineOfSight(Unit *) {} + void EnterCombat(Unit *who) {} + void MoveInLineOfSight(Unit* who) {} void MovementInform(uint32 MovementType, uint32 Data) {Timer = 1;} @@ -1072,7 +1077,7 @@ struct TRINITY_DLL_DECL npc_akama_illidanAI : public ScriptedAI for(uint8 i = 0; i < 2; i++) if(GETGO(Door, DoorGUID[i])) - Door->SetUInt32Value(GAMEOBJECT_STATE, 1); + Door->SetGoState(GO_STATE_READY); if(GETCRE(Illidan, IllidanGUID)) { @@ -1081,8 +1086,8 @@ struct TRINITY_DLL_DECL npc_akama_illidanAI : public ScriptedAI Illidan->SetInFront(m_creature); m_creature->GetMotionMaster()->MoveIdle(); Illidan->GetMotionMaster()->MoveIdle(); - ((boss_illidan_stormrageAI*)Illidan->AI())->AkamaGUID = m_creature->GetGUID(); - ((boss_illidan_stormrageAI*)Illidan->AI())->EnterPhase(PHASE_TALK_SEQUENCE); + CAST_AI(boss_illidan_stormrageAI, Illidan->AI())->AkamaGUID = m_creature->GetGUID(); + CAST_AI(boss_illidan_stormrageAI, Illidan->AI())->EnterPhase(PHASE_TALK_SEQUENCE); } } @@ -1133,7 +1138,7 @@ struct TRINITY_DLL_DECL npc_akama_illidanAI : public ScriptedAI else if(Phase == PHASE_TALK) { if(GETCRE(Illidan, IllidanGUID)) - ((boss_illidan_stormrageAI*)Illidan->AI())->DeleteFromThreatList(m_creature->GetGUID()); + CAST_AI(boss_illidan_stormrageAI, Illidan->AI())->DeleteFromThreatList(m_creature->GetGUID()); EnterEvadeMode(); m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); WalkCount++; @@ -1186,8 +1191,8 @@ struct TRINITY_DLL_DECL npc_akama_illidanAI : public ScriptedAI case 0: if(GETCRE(Illidan, IllidanGUID)) { - ((boss_illidan_stormrageAI*)Illidan->AI())->Timer[EVENT_TAUNT] += 30000; - Illidan->Yell(SAY_AKAMA_MINION, LANG_UNIVERSAL, 0); + CAST_AI(boss_illidan_stormrageAI, Illidan->AI())->Timer[EVENT_TAUNT] += 30000; + Illidan->MonsterYell(SAY_AKAMA_MINION, LANG_UNIVERSAL, 0); DoPlaySoundToSet(Illidan, SOUND_AKAMA_MINION); } Timer = 8000; @@ -1238,7 +1243,7 @@ struct TRINITY_DLL_DECL npc_akama_illidanAI : public ScriptedAI Spirit[0]->InterruptNonMeleeSpells(true); Spirit[1]->InterruptNonMeleeSpells(true); if(GETGO(Gate, GateGUID)) - Gate->SetUInt32Value(GAMEOBJECT_STATE, 0); + Gate->SetGoState(GO_STATE_ACTIVE); Timer = 2000; break; case 4: @@ -1269,7 +1274,7 @@ struct TRINITY_DLL_DECL npc_akama_illidanAI : public ScriptedAI case 6: for(uint8 i = 0; i < 2; i++) if(GETGO(Door, DoorGUID[i])) - Door->SetUInt32Value(GAMEOBJECT_STATE, 0); + Door->SetGoState(GO_STATE_ACTIVE); break; case 8: if(Phase == PHASE_WALK) @@ -1379,12 +1384,11 @@ struct TRINITY_DLL_DECL boss_maievAI : public ScriptedAI Timer[EVENT_MAIEV_STEALTH] = 0; Timer[EVENT_MAIEV_TAUNT] = 22000 + rand()%21 * 1000; Timer[EVENT_MAIEV_SHADOW_STRIKE] = 30000; - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, 44850); - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY + 1, 0); - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY + 2, 45738); + SetEquipmentSlots(false, 44850, EQUIP_UNEQUIP, EQUIP_NO_CHANGE); + m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 2, 45738); } - void Aggro(Unit *who) {} + void EnterCombat(Unit *who) {} void MoveInLineOfSight(Unit *who) {} void EnterEvadeMode() {} void GetIllidanGUID(uint64 guid) { IllidanGUID = guid; } @@ -1409,16 +1413,16 @@ struct TRINITY_DLL_DECL boss_maievAI : public ScriptedAI return; if(Phase == PHASE_TALK_SEQUENCE) - ScriptedAI::AttackStart(who, false); + AttackStartNoMove(who); else if(Phase == PHASE_DEMON || Phase == PHASE_TRANSFORM_SEQUENCE ) { GETUNIT(Illidan, IllidanGUID); if(Illidan && m_creature->IsWithinDistInMap(Illidan, 25)) BlinkToPlayer();//Do not let dread aura hurt her. - ScriptedAI::AttackStart(who, false); + AttackStartNoMove(who); } else - ScriptedAI::AttackStart(who, true); + ScriptedAI::AttackStart(who); } void DoAction(const int32 param) @@ -1477,7 +1481,7 @@ struct TRINITY_DLL_DECL boss_maievAI : public ScriptedAI { if(GETCRE(Illidan, IllidanGUID)) { - Unit* target = ((boss_illidan_stormrageAI*)Illidan->AI())->SelectUnit(SELECT_TARGET_RANDOM, 0); + Unit* target = CAST_AI(boss_illidan_stormrageAI, Illidan->AI())->SelectUnit(SELECT_TARGET_RANDOM, 0); if(!target || !m_creature->IsWithinDistInMap(target, 80) || Illidan->IsWithinDistInMap(target, 20)) { @@ -1556,7 +1560,7 @@ struct TRINITY_DLL_DECL boss_maievAI : public ScriptedAI m_creature->SetVisibility(VISIBILITY_OFF); m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); if(GETCRE(Illidan, IllidanGUID)) - ((boss_illidan_stormrageAI*)Illidan->AI())->DeleteFromThreatList(m_creature->GetGUID()); + CAST_AI(boss_illidan_stormrageAI, Illidan->AI())->DeleteFromThreatList(m_creature->GetGUID()); m_creature->AttackStop(); Timer[EVENT_MAIEV_STEALTH] = 60000; //reappear after 1 minute MaxTimer = 1; @@ -1573,7 +1577,7 @@ bool GossipSelect_npc_akama_at_illidan(Player *player, Creature *_Creature, uint if(action == GOSSIP_ACTION_INFO_DEF) // Time to begin the Event { player->CLOSE_GOSSIP_MENU(); - ((npc_akama_illidanAI*)_Creature->AI())->EnterPhase(PHASE_CHANNEL); + CAST_AI(npc_akama_illidanAI, _Creature->AI())->EnterPhase(PHASE_CHANNEL); } return true; } @@ -1608,7 +1612,7 @@ struct TRINITY_DLL_DECL cage_trap_triggerAI : public ScriptedAI m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); } - void Aggro(Unit *who){} + void EnterCombat(Unit *who){} void MoveInLineOfSight(Unit *who) { @@ -1619,12 +1623,12 @@ struct TRINITY_DLL_DECL cage_trap_triggerAI : public ScriptedAI { if(who->GetEntry() == ILLIDAN_STORMRAGE) // Check if who is Illidan { - if(!IllidanGUID && m_creature->IsWithinDistInMap(who, 3) && (!who->HasAura(SPELL_CAGED, 0))) + if(!IllidanGUID && m_creature->IsWithinDistInMap(who, 3) && (!who->HasAura(SPELL_CAGED))) { IllidanGUID = who->GetGUID(); who->CastSpell(who, SPELL_CAGED, true); DespawnTimer = 5000; - if(who->HasAura(SPELL_ENRAGE, 0)) + if(who->HasAura(SPELL_ENRAGE)) who->RemoveAurasDueToSpell(SPELL_ENRAGE); // Dispel his enrage //if(GameObject* CageTrap = GameObject::GetGameObject(*m_creature, CageTrapGUID)) // CageTrap->SetLootState(GO_JUST_DEACTIVATED); @@ -1664,7 +1668,7 @@ bool GOHello_cage_trap(Player* plr, GameObject* go) // Grid search for nearest live creature of entry 23304 within 10 yards Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck check(*plr, 23304, true, 10); - Trinity::CreatureLastSearcher<Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck> searcher(trigger, check); + Trinity::CreatureLastSearcher<Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck> searcher(plr, trigger, check); TypeContainerVisitor<Trinity::CreatureLastSearcher<Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck>, GridTypeMapContainer> cSearcher(searcher); @@ -1672,8 +1676,8 @@ bool GOHello_cage_trap(Player* plr, GameObject* go) cell_lock->Visit(cell_lock, cSearcher, *(plr->GetMap())); if(trigger) - ((cage_trap_triggerAI*)trigger->AI())->Active = true; - go->SetUInt32Value(GAMEOBJECT_STATE, 0); + CAST_AI(cage_trap_triggerAI, trigger->AI())->Active = true; + go->SetGoState(GO_STATE_ACTIVE); return true; } @@ -1683,7 +1687,7 @@ struct TRINITY_DLL_DECL shadow_demonAI : public ScriptedAI uint64 TargetGUID; - void Aggro(Unit *who) {DoZoneInCombat();} + void EnterCombat(Unit *who) {DoZoneInCombat();} void Reset() { @@ -1703,7 +1707,7 @@ struct TRINITY_DLL_DECL shadow_demonAI : public ScriptedAI if(m_creature->getVictim()->GetTypeId() != TYPEID_PLAYER) return; // Only cast the below on players. - if(!m_creature->getVictim()->HasAura(SPELL_PARALYZE, 0)) + if(!m_creature->getVictim()->HasAura(SPELL_PARALYZE)) { TargetGUID = m_creature->getVictim()->GetGUID(); m_creature->AddThreat(m_creature->getVictim(), 10000000.0f); @@ -1721,7 +1725,7 @@ struct TRINITY_DLL_DECL mob_parasitic_shadowfiendAI : public ScriptedAI { mob_parasitic_shadowfiendAI(Creature* c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } ScriptedInstance* pInstance; @@ -1739,14 +1743,14 @@ struct TRINITY_DLL_DECL mob_parasitic_shadowfiendAI : public ScriptedAI DoCast(m_creature, SPELL_SHADOWFIEND_PASSIVE, true); } - void Aggro(Unit* who) { DoZoneInCombat(); } + void EnterCombat(Unit* who) { DoZoneInCombat(); } void DoMeleeAttackIfReady() { if( m_creature->isAttackReady() && m_creature->IsWithinMeleeRange(m_creature->getVictim())) { - if(!m_creature->getVictim()->HasAura(SPELL_PARASITIC_SHADOWFIEND, 0) - && !m_creature->getVictim()->HasAura(SPELL_PARASITIC_SHADOWFIEND2, 0)) + if(!m_creature->getVictim()->HasAura(SPELL_PARASITIC_SHADOWFIEND) + && !m_creature->getVictim()->HasAura(SPELL_PARASITIC_SHADOWFIEND2)) { m_creature->CastSpell(m_creature->getVictim(), SPELL_PARASITIC_SHADOWFIEND2, true, 0, 0, IllidanGUID); //do not stack } @@ -1759,7 +1763,7 @@ struct TRINITY_DLL_DECL mob_parasitic_shadowfiendAI : public ScriptedAI { if(!m_creature->getVictim()) { - if(Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0, 999, true)) + if(Unit *target = SelectTarget(SELECT_TARGET_RANDOM, 0, 999, true)) AttackStart(target); else { @@ -1772,7 +1776,7 @@ struct TRINITY_DLL_DECL mob_parasitic_shadowfiendAI : public ScriptedAI if(CheckTimer < diff) { GETUNIT(Illidan, IllidanGUID); - if(!Illidan || ((Creature*)Illidan)->IsInEvadeMode()) + if(!Illidan || CAST_CRE(Illidan)->IsInEvadeMode()) { m_creature->SetVisibility(VISIBILITY_OFF); m_creature->setDeathState(JUST_DIED); @@ -1808,9 +1812,9 @@ void boss_illidan_stormrageAI::Reset() Akama->Respawn(); else { - ((npc_akama_illidanAI*)Akama->AI())->EnterEvadeMode(); + CAST_AI(npc_akama_illidanAI, Akama->AI())->EnterEvadeMode(); Akama->GetMotionMaster()->MoveTargetedHome(); - ((npc_akama_illidanAI*)Akama->AI())->Reset(); + CAST_AI(npc_akama_illidanAI, Akama->AI())->Reset(); } } AkamaGUID = 0; @@ -1836,9 +1840,8 @@ void boss_illidan_stormrageAI::Reset() m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, 0); - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY+1, 0); - m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING + MOVEMENTFLAG_ONTRANSPORT); + SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_UNEQUIP, EQUIP_NO_CHANGE); + m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); m_creature->setActive(false); Summons.DespawnAll(); } @@ -1856,15 +1859,15 @@ void boss_illidan_stormrageAI::JustSummoned(Creature* summon) summon->setDeathState(JUST_DIED); return; } - Unit *target = SelectUnit(SELECT_TARGET_TOPAGGRO, 0, 999, true); - if(!target || target->HasAura(SPELL_PARASITIC_SHADOWFIEND, 0) - || target->HasAura(SPELL_PARASITIC_SHADOWFIEND2, 0)) - target = SelectUnit(SELECT_TARGET_RANDOM, 0, 999, true); + Unit *target = SelectTarget(SELECT_TARGET_TOPAGGRO, 0, 999, true); + if(!target || target->HasAura(SPELL_PARASITIC_SHADOWFIEND) + || target->HasAura(SPELL_PARASITIC_SHADOWFIEND2)) + target = SelectTarget(SELECT_TARGET_RANDOM, 0, 999, true); if(target) summon->AI()->AttackStart(target); }break; case SHADOW_DEMON: - if(Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0, 999, true)) // only on players. + if(Unit *target = SelectTarget(SELECT_TARGET_RANDOM, 0, 999, true)) // only on players. { summon->AddThreat(target, 5000000.0f); summon->AI()->AttackStart(target); @@ -1874,7 +1877,7 @@ void boss_illidan_stormrageAI::JustSummoned(Creature* summon) summon->SetVisibility(VISIBILITY_OFF); // Leave her invisible until she has to talk summon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); MaievGUID = summon->GetGUID(); - ((boss_maievAI*)summon->AI())->GetIllidanGUID(m_creature->GetGUID()); + CAST_AI(boss_maievAI, summon->AI())->GetIllidanGUID(m_creature->GetGUID()); summon->AI()->DoAction(PHASE_TALK_SEQUENCE); }break; case FLAME_OF_AZZINOTH: @@ -1894,8 +1897,8 @@ void boss_illidan_stormrageAI::HandleTalkSequence() m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); break; case 8: - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, 45479); // Equip our warglaives! - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY+1, 45481); + // Equip our warglaives! + SetEquipmentSlots(false, EQUIP_ID_MAIN_HAND, EQUIP_ID_OFF_HAND, EQUIP_NO_CHANGE); m_creature->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE ); m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); break; @@ -1904,7 +1907,7 @@ void boss_illidan_stormrageAI::HandleTalkSequence() { m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE); m_creature->AddThreat(Akama, 100.0f); - ((npc_akama_illidanAI*)Akama->AI())->EnterPhase(PHASE_FIGHT_ILLIDAN); + CAST_AI(npc_akama_illidanAI, Akama->AI())->EnterPhase(PHASE_FIGHT_ILLIDAN); EnterPhase(PHASE_NORMAL); } break; @@ -1955,7 +1958,7 @@ void boss_illidan_stormrageAI::HandleTalkSequence() { Maiev->CastSpell(Maiev, SPELL_TELEPORT_VISUAL, true); Maiev->setDeathState(JUST_DIED); - m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,PLAYER_STATE_DEAD); + m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,UNIT_STAND_STATE_DEAD); } break; case 21: // Kill ourself. @@ -2023,7 +2026,7 @@ void boss_illidan_stormrageAI::SummonFlamesOfAzzinoth() Flame->setFaction(m_creature->getFaction()); // Just in case the database has it as a different faction Flame->SetMeleeDamageSchool(SPELL_SCHOOL_FIRE); FlameGUID[i] = Flame->GetGUID(); // Record GUID in order to check if they're dead later on to move to the next phase - ((flame_of_azzinothAI*)Flame->AI())->SetGlaiveGUID(GlaiveGUID[i]); + CAST_AI(flame_of_azzinothAI, Flame->AI())->SetGlaiveGUID(GlaiveGUID[i]); Glaive->CastSpell(Flame, SPELL_AZZINOTH_CHANNEL, false); // Glaives do some random Beam type channel on it. } } diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_mother_shahraz.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_mother_shahraz.cpp index 4b63b092c53..ba3d5316e76 100644 --- a/src/bindings/scripts/scripts/zone/black_temple/boss_mother_shahraz.cpp +++ b/src/bindings/scripts/scripts/zone/black_temple/boss_mother_shahraz.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -80,7 +80,7 @@ struct TRINITY_DLL_DECL boss_shahrazAI : public ScriptedAI { boss_shahrazAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } ScriptedInstance* pInstance; @@ -123,7 +123,7 @@ struct TRINITY_DLL_DECL boss_shahrazAI : public ScriptedAI Enraged = false; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { if(pInstance) pInstance->SetData(DATA_MOTHERSHAHRAZEVENT, IN_PROGRESS); @@ -276,7 +276,7 @@ struct TRINITY_DLL_DECL boss_shahrazAI : public ScriptedAI }else SaberTimer -= diff; //Enrage - if(!m_creature->HasAura(SPELL_BERSERK, 0)) + if(!m_creature->HasAura(SPELL_BERSERK)) if(EnrageTimer < diff) { DoCast(m_creature, SPELL_BERSERK); diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_reliquary_of_souls.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_reliquary_of_souls.cpp index 35bff456074..0c11e2a4106 100644 --- a/src/bindings/scripts/scripts/zone/black_temple/boss_reliquary_of_souls.cpp +++ b/src/bindings/scripts/scripts/zone/black_temple/boss_reliquary_of_souls.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -107,7 +107,7 @@ struct TRINITY_DLL_DECL npc_enslaved_soulAI : public ScriptedAI void Reset() {ReliquaryGUID = 0;} - void Aggro(Unit* who) + void EnterCombat(Unit* who) { m_creature->CastSpell(m_creature, ENSLAVED_SOUL_PASSIVE, true); DoZoneInCombat(); @@ -120,7 +120,7 @@ struct TRINITY_DLL_DECL boss_reliquary_of_soulsAI : public ScriptedAI { boss_reliquary_of_soulsAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); EssenceGUID = 0; } @@ -157,7 +157,7 @@ struct TRINITY_DLL_DECL boss_reliquary_of_soulsAI : public ScriptedAI m_creature->RemoveAurasDueToSpell(SPELL_SUBMERGE); } - void Aggro(Unit* who) + void EnterCombat(Unit* who) { m_creature->AddThreat(who, 10000.0f); DoZoneInCombat(); @@ -169,15 +169,6 @@ struct TRINITY_DLL_DECL boss_reliquary_of_soulsAI : public ScriptedAI Timer = 0; } - void AttackStart(Unit* who) - { - if (!InCombat) - { - Aggro(who); - InCombat = true; - } - } - bool SummonSoul() { uint32 random = rand()%6; @@ -187,7 +178,7 @@ struct TRINITY_DLL_DECL boss_reliquary_of_soulsAI : public ScriptedAI if(!Soul) return false; if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) { - ((npc_enslaved_soulAI*)Soul->AI())->ReliquaryGUID = m_creature->GetGUID(); + CAST_AI(npc_enslaved_soulAI, Soul->AI())->ReliquaryGUID = m_creature->GetGUID(); Soul->AI()->AttackStart(target); }else EnterEvadeMode(); return true; @@ -197,8 +188,6 @@ struct TRINITY_DLL_DECL boss_reliquary_of_soulsAI : public ScriptedAI { if(pInstance) pInstance->SetData(DATA_RELIQUARYOFSOULSEVENT, DONE); - - InCombat = false; } void UpdateAI(const uint32 diff) @@ -361,7 +350,7 @@ struct TRINITY_DLL_DECL boss_essence_of_sufferingAI : public ScriptedAI } } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { DoScriptText(SUFF_SAY_FREED, m_creature); DoZoneInCombat(); @@ -406,7 +395,7 @@ struct TRINITY_DLL_DECL boss_essence_of_sufferingAI : public ScriptedAI void UpdateAI(const uint32 diff) { - if(InCombat) + if(m_creature->isInCombat()) { //Supposed to be cast on nearest target if(FixateTimer < diff) @@ -485,7 +474,7 @@ struct TRINITY_DLL_DECL boss_essence_of_desireAI : public ScriptedAI m_creature->InterruptSpell(CURRENT_GENERIC_SPELL, false); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { DoScriptText(DESI_SAY_FREED, m_creature); DoZoneInCombat(); @@ -564,7 +553,7 @@ struct TRINITY_DLL_DECL boss_essence_of_angerAI : public ScriptedAI CheckedAggro = false; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { switch(rand()%2) { @@ -640,7 +629,7 @@ void npc_enslaved_soulAI::JustDied(Unit *killer) { Creature* Reliquary = (Unit::GetCreature((*m_creature), ReliquaryGUID)); if(Reliquary) - ((boss_reliquary_of_soulsAI*)Reliquary->AI())->SoulDeathCount++; + CAST_AI(boss_reliquary_of_soulsAI, Reliquary->AI())->SoulDeathCount++; } DoCast(m_creature, SPELL_SOUL_RELEASE, true); } diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_shade_of_akama.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_shade_of_akama.cpp index 5d82affcacf..587d9934a51 100644 --- a/src/bindings/scripts/scripts/zone/black_temple/boss_shade_of_akama.cpp +++ b/src/bindings/scripts/scripts/zone/black_temple/boss_shade_of_akama.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -113,7 +113,7 @@ struct TRINITY_DLL_DECL mob_ashtongue_channelerAI : public ScriptedAI void Reset() { ShadeGUID = 0; } void JustDied(Unit* killer); - void Aggro(Unit* who) {} + void EnterCombat(Unit* who) {} void AttackStart(Unit* who) {} void MoveInLineOfSight(Unit* who) {} void UpdateAI(const uint32 diff) {} @@ -135,7 +135,7 @@ struct TRINITY_DLL_DECL mob_ashtongue_sorcererAI : public ScriptedAI } void JustDied(Unit* killer); - void Aggro(Unit* who) {} + void EnterCombat(Unit* who) {} void AttackStart(Unit* who) {} void MoveInLineOfSight(Unit* who) {} void UpdateAI(const uint32 diff) @@ -167,7 +167,7 @@ struct TRINITY_DLL_DECL boss_shade_of_akamaAI : public ScriptedAI { boss_shade_of_akamaAI(Creature* c) : ScriptedAI(c), summons(m_creature) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); AkamaGUID = pInstance ? pInstance->GetData64(DATA_AKAMA_SHADE) : 0; m_creature->setActive(true);//if view distance is too low m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true); @@ -274,8 +274,6 @@ struct TRINITY_DLL_DECL boss_shade_of_akamaAI : public ScriptedAI } } - void Aggro(Unit* who) { } - void AttackStart(Unit* who) { if(!who || IsBanished) return; @@ -291,7 +289,7 @@ struct TRINITY_DLL_DECL boss_shade_of_akamaAI : public ScriptedAI debug_log("TSCR: Increasing Death Count for Shade of Akama encounter"); ++DeathCount; - m_creature->RemoveSingleAuraFromStack(SPELL_SHADE_SOUL_CHANNEL_2, 0); + m_creature->RemoveAuraFromStack(SPELL_SHADE_SOUL_CHANNEL_2); if(guid) { if(Sorcerers.empty()) @@ -311,7 +309,7 @@ struct TRINITY_DLL_DECL boss_shade_of_akamaAI : public ScriptedAI Creature* Sorcerer = m_creature->SummonCreature(CREATURE_SORCERER, X, Y, Z_SPAWN, 0, TEMPSUMMON_DEAD_DESPAWN, 0); if(Sorcerer) { - ((mob_ashtongue_sorcererAI*)Sorcerer->AI())->ShadeGUID = m_creature->GetGUID(); + CAST_AI(mob_ashtongue_sorcererAI, Sorcerer->AI())->ShadeGUID = m_creature->GetGUID(); Sorcerer->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); Sorcerer->GetMotionMaster()->MovePoint(0, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ()); Sorcerer->SetUInt64Value(UNIT_FIELD_TARGET, m_creature->GetGUID()); @@ -346,7 +344,7 @@ struct TRINITY_DLL_DECL boss_shade_of_akamaAI : public ScriptedAI std::list<Creature*> ChannelerList; Trinity::AllCreaturesOfEntryInRange check(m_creature, CREATURE_CHANNELER, 50); - Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(ChannelerList, check); + Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(m_creature, ChannelerList, check); TypeContainerVisitor<Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange>, GridTypeMapContainer> visitor(searcher); CellLock<GridReadGuard> cell_lock(cell, pair); @@ -356,7 +354,7 @@ struct TRINITY_DLL_DECL boss_shade_of_akamaAI : public ScriptedAI { for(std::list<Creature*>::iterator itr = ChannelerList.begin(); itr != ChannelerList.end(); ++itr) { - ((mob_ashtongue_channelerAI*)(*itr)->AI())->ShadeGUID = m_creature->GetGUID(); + CAST_AI(mob_ashtongue_channelerAI, (*itr)->AI())->ShadeGUID = m_creature->GetGUID(); Channelers.push_back((*itr)->GetGUID()); debug_log("TSCR: Shade of Akama Grid Search found channeler %u. Adding to list", (*itr)->GetGUID()); } @@ -381,7 +379,7 @@ struct TRINITY_DLL_DECL boss_shade_of_akamaAI : public ScriptedAI void UpdateAI(const uint32 diff) { - if(!InCombat) + if(!m_creature->isInCombat()) return; if(IsBanished) @@ -491,7 +489,7 @@ void mob_ashtongue_channelerAI::JustDied(Unit* killer) { Creature* Shade = (Unit::GetCreature((*m_creature), ShadeGUID)); if(Shade && Shade->isAlive()) - ((boss_shade_of_akamaAI*)Shade->AI())->IncrementDeathCount(); + CAST_AI(boss_shade_of_akamaAI, Shade->AI())->IncrementDeathCount(); else error_log("SD2 ERROR: Channeler dead but unable to increment DeathCount for Shade of Akama."); } @@ -499,7 +497,7 @@ void mob_ashtongue_sorcererAI::JustDied(Unit* killer) { Creature* Shade = (Unit::GetCreature((*m_creature), ShadeGUID)); if(Shade && Shade->isAlive()) - ((boss_shade_of_akamaAI*)Shade->AI())->IncrementDeathCount(m_creature->GetGUID()); + CAST_AI(boss_shade_of_akamaAI, Shade->AI())->IncrementDeathCount(m_creature->GetGUID()); else error_log("SD2 ERROR: Sorcerer dead but unable to increment DeathCount for Shade of Akama."); } @@ -509,7 +507,7 @@ struct TRINITY_DLL_DECL npc_akamaAI : public ScriptedAI { ShadeHasDied = false; StartCombat = false; - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); ShadeGUID = pInstance ? pInstance->GetData64(DATA_SHADEOFAKAMA) : NOT_STARTED; m_creature->setActive(true); EventBegun = false; @@ -557,7 +555,7 @@ struct TRINITY_DLL_DECL npc_akamaAI : public ScriptedAI } } - void Aggro(Unit* who) {} + void EnterCombat(Unit* who) {} void BeginEvent(Player* pl) { @@ -574,10 +572,10 @@ struct TRINITY_DLL_DECL npc_akamaAI : public ScriptedAI pInstance->SetData(DATA_SHADEOFAKAMAEVENT, IN_PROGRESS); // Prevent players from trying to restart event m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - ((boss_shade_of_akamaAI*)Shade->AI())->SetAkamaGUID(m_creature->GetGUID()); - ((boss_shade_of_akamaAI*)Shade->AI())->SetSelectableChannelers(); - ((boss_shade_of_akamaAI*)Shade->AI())->InCombat = true; + CAST_AI(boss_shade_of_akamaAI, Shade->AI())->SetAkamaGUID(m_creature->GetGUID()); + CAST_AI(boss_shade_of_akamaAI, Shade->AI())->SetSelectableChannelers(); Shade->AddThreat(m_creature, 1000000.0f); + m_creature->CombatStart(Shade); Shade->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_NONE); Shade->SetUInt64Value(UNIT_FIELD_TARGET, m_creature->GetGUID()); if(pl) Shade->AddThreat(pl, 1.0f); @@ -623,7 +621,7 @@ struct TRINITY_DLL_DECL npc_akamaAI : public ScriptedAI HasYelledOnce = false; Creature* Shade = Unit::GetCreature((*m_creature), ShadeGUID); if(Shade && Shade->isAlive()) - ((boss_shade_of_akamaAI*)Shade->AI())->HasKilledAkama = true; + CAST_AI(boss_shade_of_akamaAI, Shade->AI())->HasKilledAkama = true; } void UpdateAI(const uint32 diff) @@ -642,7 +640,7 @@ struct TRINITY_DLL_DECL npc_akamaAI : public ScriptedAI Creature* Shade = (Unit::GetCreature((*m_creature), ShadeGUID)); if(Shade && Shade->isAlive()) { - if(((boss_shade_of_akamaAI*)Shade->AI())->IsBanished) + if(CAST_AI(boss_shade_of_akamaAI, Shade->AI())->IsBanished) { if(CastSoulRetrieveTimer < diff) { @@ -818,7 +816,7 @@ bool GossipSelect_npc_akama(Player *player, Creature *_Creature, uint32 sender, if (action == GOSSIP_ACTION_INFO_DEF + 1) //Fight time { player->CLOSE_GOSSIP_MENU(); - ((npc_akamaAI*)_Creature->AI())->BeginEvent(player); + CAST_AI(npc_akamaAI, _Creature->AI())->BeginEvent(player); } return true; diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_supremus.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_supremus.cpp index 44fbeaadad1..a5841cf86a6 100644 --- a/src/bindings/scripts/scripts/zone/black_temple/boss_supremus.cpp +++ b/src/bindings/scripts/scripts/zone/black_temple/boss_supremus.cpp @@ -39,9 +39,23 @@ EndScriptData */ #define CREATURE_VOLCANO 23085 #define CREATURE_STALKER 23095 +#define PHASE_STRIKE 1 +#define PHASE_CHASE 2 + +#define EVENT_BERSERK 1 +#define EVENT_SWITCH_PHASE 2 +#define EVENT_FLAME 3 +#define EVENT_VOLCANO 4 +#define EVENT_SWITCH_TARGET 5 +#define EVENT_HATEFUL_STRIKE 6 + +#define GCD_CAST 1 + struct TRINITY_DLL_DECL molten_flameAI : public NullCreatureAI { - molten_flameAI(Creature *c) : NullCreatureAI(c) + molten_flameAI(Creature *c) : NullCreatureAI(c) {} + + void InitializeAI() { float x, y, z; me->GetNearPoint(me, x, y, z, 1, 50, M_PI*2*rand_norm()); @@ -53,21 +67,13 @@ struct TRINITY_DLL_DECL boss_supremusAI : public ScriptedAI { boss_supremusAI(Creature *c) : ScriptedAI(c), summons(m_creature) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } ScriptedInstance* pInstance; - - uint32 SummonFlameTimer; - uint32 SwitchTargetTimer; - uint32 PhaseSwitchTimer; - uint32 SummonVolcanoTimer; - uint32 HatefulStrikeTimer; - uint32 BerserkTimer; - - bool Phase1; - + EventMap events; SummonList summons; + uint32 phase; void Reset() { @@ -81,35 +87,55 @@ struct TRINITY_DLL_DECL boss_supremusAI : public ScriptedAI //else ToggleDoors(false); } - HatefulStrikeTimer = 5000; - SummonFlameTimer = 20000; - SwitchTargetTimer = 90000; - PhaseSwitchTimer = 60000; - SummonVolcanoTimer = 5000; - BerserkTimer = 900000; // 15 minute enrage + phase = 0; - Phase1 = true; + events.Reset(); summons.DespawnAll(); - - m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, false); - m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, false); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { - DoZoneInCombat(); - if(pInstance) pInstance->SetData(DATA_SUPREMUSEVENT, IN_PROGRESS); + + ChangePhase(); + events.ScheduleEvent(EVENT_BERSERK, 900000, GCD_CAST); + events.ScheduleEvent(EVENT_FLAME, 20000, GCD_CAST); } void ToggleDoors(bool close) { if(GameObject* Doors = GameObject::GetGameObject(*m_creature, pInstance->GetData64(DATA_GAMEOBJECT_SUPREMUS_DOORS))) { - if(close) Doors->SetGoState(1); // Closed - else Doors->SetGoState(0); // Open + if(close) Doors->SetGoState(GO_STATE_READY); // Closed + else Doors->SetGoState(GO_STATE_ACTIVE); // Open + } + } + + void ChangePhase() + { + if(!phase || phase == PHASE_CHASE) + { + phase = PHASE_STRIKE; + summons.DoAction(EVENT_VOLCANO, 0); + events.ScheduleEvent(EVENT_HATEFUL_STRIKE, 5000, GCD_CAST, PHASE_STRIKE); + m_creature->SetSpeed(MOVE_RUN, 1.2f); + m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, false); + m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, false); + } + else + { + phase = PHASE_CHASE; + events.ScheduleEvent(EVENT_VOLCANO, 5000, GCD_CAST, PHASE_CHASE); + events.ScheduleEvent(EVENT_SWITCH_TARGET, 10000, 0, PHASE_CHASE); + m_creature->SetSpeed(MOVE_RUN, 0.9f); + m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true); + m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true); } + DoResetThreat(); + DoZoneInCombat(); + events.SetPhase(phase); + events.ScheduleEvent(EVENT_SWITCH_PHASE, 60000, GCD_CAST); } void JustDied(Unit *killer) @@ -153,80 +179,53 @@ struct TRINITY_DLL_DECL boss_supremusAI : public ScriptedAI if (!UpdateVictim()) return; - if(!m_creature->HasAura(SPELL_BERSERK, 0)) - { - if(BerserkTimer < diff) - DoCast(m_creature, SPELL_BERSERK); - else BerserkTimer -= diff; - } - - if(SummonFlameTimer < diff) - { - DoCast(m_creature, SPELL_MOLTEN_PUNCH); - SummonFlameTimer = 20000; - }else SummonFlameTimer -= diff; + events.Update(diff); - if(Phase1) + while(uint32 eventId = events.ExecuteEvent()) { - if(HatefulStrikeTimer < diff) + switch(eventId) { - if(Unit* target = CalculateHatefulStrikeTarget()) + case EVENT_BERSERK: + m_creature->CastSpell(m_creature, SPELL_BERSERK, true); + break; + case EVENT_FLAME: + DoCast(m_creature, SPELL_MOLTEN_PUNCH); + events.DelayEvents(1500, GCD_CAST); + events.ScheduleEvent(EVENT_FLAME, 20000, GCD_CAST); + break; + case EVENT_HATEFUL_STRIKE: + if(Unit* target = CalculateHatefulStrikeTarget()) + DoCast(target, SPELL_HATEFUL_STRIKE); + events.DelayEvents(1000, GCD_CAST); + events.ScheduleEvent(EVENT_HATEFUL_STRIKE, 5000, GCD_CAST, PHASE_STRIKE); + break; + case EVENT_SWITCH_TARGET: + if(Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true)) + { + DoResetThreat(); + m_creature->AddThreat(target, 5000000.0f); + DoScriptText(EMOTE_NEW_TARGET, m_creature); + } + events.ScheduleEvent(EVENT_SWITCH_TARGET, 10000, 0, PHASE_CHASE); + break; + case EVENT_VOLCANO: { - DoCast(target, SPELL_HATEFUL_STRIKE); - HatefulStrikeTimer = 5000; + Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 999, true); + if(!target) target = m_creature->getVictim(); + if(target) + { + DoCast(target, SPELL_VOLCANIC_SUMMON); + DoScriptText(EMOTE_GROUND_CRACK, m_creature); + events.DelayEvents(1500, GCD_CAST); + } + events.ScheduleEvent(EVENT_VOLCANO, 10000, GCD_CAST, PHASE_CHASE); + return; } - }else HatefulStrikeTimer -= diff; - } - - if(!Phase1) - { - if(SwitchTargetTimer < diff) - { - if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1, 100, true)) - { - DoResetThreat(); - m_creature->AddThreat(target, 5000000.0f); - DoScriptText(EMOTE_NEW_TARGET, m_creature); - SwitchTargetTimer = 10000; - } - }else SwitchTargetTimer -= diff; - - if(SummonVolcanoTimer < diff) - { - if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0, 999, true)) - { - DoCast(target, SPELL_VOLCANIC_SUMMON); - DoScriptText(EMOTE_GROUND_CRACK, m_creature); - SummonVolcanoTimer = 10000; - } - }else SummonVolcanoTimer -= diff; - } - - if(PhaseSwitchTimer < diff) - { - if(!Phase1) - { - Phase1 = true; - DoResetThreat(); - PhaseSwitchTimer = 60000; - m_creature->SetSpeed(MOVE_RUN, 1.2f); - DoZoneInCombat(); - m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, false); - m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, false); - } - else - { - Phase1 = false; - DoResetThreat(); - SwitchTargetTimer = 10000; - SummonVolcanoTimer = 2000; - PhaseSwitchTimer = 60000; - m_creature->SetSpeed(MOVE_RUN, 0.9f); - DoZoneInCombat(); - m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true); - m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true); + case EVENT_SWITCH_PHASE: + ChangePhase(); + break; } - }else PhaseSwitchTimer -= diff; + } DoMeleeAttackIfReady(); } @@ -234,51 +233,27 @@ struct TRINITY_DLL_DECL boss_supremusAI : public ScriptedAI struct TRINITY_DLL_DECL npc_volcanoAI : public ScriptedAI { - npc_volcanoAI(Creature *c) : ScriptedAI(c) - { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); - } - - ScriptedInstance *pInstance; - - uint32 CheckTimer; - bool Eruption; + npc_volcanoAI(Creature *c) : ScriptedAI(c) {} void Reset() { - CheckTimer = 1500; - Eruption = false; - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + DoCast(m_creature, SPELL_VOLCANIC_ERUPTION); + me->SetReactState(REACT_PASSIVE); } - void Aggro(Unit *who) {} + void EnterCombat(Unit *who) {} - void MoveInLineOfSight(Unit *who) - { - return; // paralyze the npc - } + void MoveInLineOfSight(Unit *who) {} - void UpdateAI(const uint32 diff) + void DoAction(const uint32 info) { - if(CheckTimer < diff) - { - uint64 SupremusGUID = pInstance->GetData64(DATA_SUPREMUS); - Creature* Supremus = (Unit::GetCreature((*m_creature), SupremusGUID)); - if(!Eruption && Supremus && !((boss_supremusAI*)Supremus->AI())->Phase1) - { - Eruption = true; - DoCast(m_creature, SPELL_VOLCANIC_ERUPTION); - } - else if((Eruption && Supremus && ((boss_supremusAI*)Supremus->AI())->Phase1) || !Supremus) - { - if(m_creature->HasAura(SPELL_VOLCANIC_ERUPTION, 0)) - m_creature->RemoveAura(SPELL_VOLCANIC_ERUPTION, 0); - } - CheckTimer = 1500; - }else CheckTimer -= diff; + m_creature->RemoveAura(SPELL_VOLCANIC_ERUPTION); } + + void UpdateAI(const uint32 diff) {} + }; CreatureAI* GetAI_boss_supremus(Creature *_Creature) diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_teron_gorefiend.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_teron_gorefiend.cpp index 492860fd4f4..b79abe5e393 100644 --- a/src/bindings/scripts/scripts/zone/black_temple/boss_teron_gorefiend.cpp +++ b/src/bindings/scripts/scripts/zone/black_temple/boss_teron_gorefiend.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -64,7 +64,7 @@ struct TRINITY_DLL_DECL mob_doom_blossomAI : public ScriptedAI TeronGUID = 0; } - void Aggro(Unit *who) { } + void EnterCombat(Unit *who) { } void AttackStart(Unit* who) { } void MoveInLineOfSight(Unit* who) { } @@ -92,7 +92,7 @@ struct TRINITY_DLL_DECL mob_doom_blossomAI : public ScriptedAI CheckTeronTimer = 5000; }else CheckTeronTimer -= diff; - if(ShadowBoltTimer < diff && InCombat) + if(ShadowBoltTimer < diff && m_creature->isInCombat()) { DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_SHADOWBOLT); ShadowBoltTimer = 10000; @@ -134,7 +134,7 @@ struct TRINITY_DLL_DECL mob_shadowy_constructAI : public ScriptedAI CheckTeronTimer = 5000; } - void Aggro(Unit* who) { } + void EnterCombat(Unit* who) { } void MoveInLineOfSight(Unit *who) { @@ -197,7 +197,7 @@ struct TRINITY_DLL_DECL boss_teron_gorefiendAI : public ScriptedAI { boss_teron_gorefiendAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } ScriptedInstance* pInstance; @@ -237,7 +237,7 @@ struct TRINITY_DLL_DECL boss_teron_gorefiendAI : public ScriptedAI Intro = false; } - void Aggro(Unit *who) {} + void EnterCombat(Unit *who) {} void MoveInLineOfSight(Unit *who) { @@ -255,7 +255,7 @@ struct TRINITY_DLL_DECL boss_teron_gorefiendAI : public ScriptedAI m_creature->AddThreat(who, 1.0f); } - if(!InCombat && !Intro && m_creature->IsWithinDistInMap(who, 60.0f) && (who->GetTypeId() == TYPEID_PLAYER)) + if(!m_creature->isInCombat() && !Intro && m_creature->IsWithinDistInMap(who, 60.0f) && (who->GetTypeId() == TYPEID_PLAYER)) { if(pInstance) pInstance->SetData(DATA_TERONGOREFIENDEVENT, IN_PROGRESS); @@ -331,14 +331,14 @@ struct TRINITY_DLL_DECL boss_teron_gorefiendAI : public ScriptedAI Unit* Ghost = NULL; if(GhostGUID) Ghost = Unit::GetUnit((*m_creature), GhostGUID); - if(Ghost && Ghost->isAlive() && Ghost->HasAura(SPELL_SHADOW_OF_DEATH, 0)) + if(Ghost && Ghost->isAlive() && Ghost->HasAura(SPELL_SHADOW_OF_DEATH)) { /*float x,y,z; Ghost->GetPosition(x,y,z); Creature* control = m_creature->SummonCreature(CREATURE_GHOST, x, y, z, 0, TEMPSUMMON_TIMED_DESAWN, 30000); if(control) { - ((Player*)Ghost)->Possess(control); + CAST_PLR(Ghost)->Possess(control); Ghost->DealDamage(Ghost, Ghost->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); }*/ @@ -352,7 +352,7 @@ struct TRINITY_DLL_DECL boss_teron_gorefiendAI : public ScriptedAI { Construct->CastSpell(Construct, SPELL_PASSIVE_SHADOWFORM, true); SetThreatList(Construct); // Use same function as Doom Blossom to set Threat List. - ((mob_shadowy_constructAI*)Construct->AI())->GhostGUID = GhostGUID; + CAST_AI(mob_shadowy_constructAI, Construct->AI())->GhostGUID = GhostGUID; Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1); if(!target) // someone's trying to solo. target = m_creature->getVictim(); @@ -430,8 +430,8 @@ struct TRINITY_DLL_DECL boss_teron_gorefiendAI : public ScriptedAI DoomBlossom->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); DoomBlossom->setFaction(m_creature->getFaction()); DoomBlossom->AddThreat(target, 1.0f); - ((mob_doom_blossomAI*)DoomBlossom->AI())->SetTeronGUID(m_creature->GetGUID()); - ((mob_doom_blossomAI*)DoomBlossom->AI())->InCombat = true; + CAST_AI(mob_doom_blossomAI, DoomBlossom->AI())->SetTeronGUID(m_creature->GetGUID()); + target->CombatStart(DoomBlossom); SetThreatList(DoomBlossom); SummonDoomBlossomTimer = 35000; } @@ -491,7 +491,7 @@ struct TRINITY_DLL_DECL boss_teron_gorefiendAI : public ScriptedAI RandomYellTimer = 50000 + rand()%51 * 1000; }else RandomYellTimer -= diff; - if(!m_creature->HasAura(SPELL_BERSERK, 0)) + if(!m_creature->HasAura(SPELL_BERSERK)) { if(EnrageTimer < diff) { diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_warlord_najentus.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_warlord_najentus.cpp index 538c94decf2..3029231abd9 100644 --- a/src/bindings/scripts/scripts/zone/black_temple/boss_warlord_najentus.cpp +++ b/src/bindings/scripts/scripts/zone/black_temple/boss_warlord_najentus.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -24,51 +24,55 @@ EndScriptData */ #include "precompiled.h" #include "def_black_temple.h" -#define SAY_AGGRO -1564000 -#define SAY_NEEDLE1 -1564001 -#define SAY_NEEDLE2 -1564002 -#define SAY_SLAY1 -1564003 -#define SAY_SLAY2 -1564004 -#define SAY_SPECIAL1 -1564005 -#define SAY_SPECIAL2 -1564006 -#define SAY_ENRAGE1 -1564007 //is this text actually in use? -#define SAY_ENRAGE2 -1564008 -#define SAY_DEATH -1564009 - -//Spells -#define SPELL_NEEDLE_SPINE 39992 -#define SPELL_TIDAL_BURST 39878 -#define SPELL_TIDAL_SHIELD 39872 -#define SPELL_IMPALING_SPINE 39837 -#define SPELL_CREATE_NAJENTUS_SPINE 39956 -#define SPELL_HURL_SPINE 39948 -#define SPELL_BERSERK 45078 - -#define GOBJECT_SPINE 185584 +enum +{ + SAY_AGGRO = -1564000, + SAY_NEEDLE1 = -1564001, + SAY_NEEDLE2 = -1564002, + SAY_SLAY1 = -1564003, + SAY_SLAY2 = -1564004, + SAY_SPECIAL1 = -1564005, + SAY_SPECIAL2 = -1564006, + SAY_ENRAGE1 = -1564007, //is this text actually in use? + SAY_ENRAGE2 = -1564008, + SAY_DEATH = -1564009, + + //Spells + SPELL_NEEDLE_SPINE = 39992, + SPELL_TIDAL_BURST = 39878, + SPELL_TIDAL_SHIELD = 39872, + SPELL_IMPALING_SPINE = 39837, + SPELL_CREATE_NAJENTUS_SPINE = 39956, + SPELL_HURL_SPINE = 39948, + SPELL_BERSERK = 45078, + + GOBJECT_SPINE = 185584, + + EVENT_BERSERK = 1, + EVENT_YELL = 2, + EVENT_NEEDLE = 3, + EVENT_SPINE = 4, + EVENT_SHIELD = 5, + + GCD_CAST = 1, + GCD_YELL = 2 +}; struct TRINITY_DLL_DECL boss_najentusAI : public ScriptedAI { boss_najentusAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } ScriptedInstance* pInstance; - - uint32 NeedleSpineTimer; - uint32 EnrageTimer; - uint32 SpecialYellTimer; - uint32 TidalShieldTimer; - uint32 ImpalingSpineTimer; + EventMap events; uint64 SpineTargetGUID; void Reset() { - EnrageTimer = 480000; - SpecialYellTimer = 45000 + (rand()%76)*1000; - - ResetTimer(); + events.Reset(); SpineTargetGUID = 0; @@ -78,11 +82,8 @@ struct TRINITY_DLL_DECL boss_najentusAI : public ScriptedAI void KilledUnit(Unit *victim) { - switch(rand()%2) - { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; - } + DoScriptText(rand()%2 ? SAY_SLAY1 : SAY_SLAY2, m_creature); + events.DelayEvents(5000, GCD_YELL); } void JustDied(Unit *victim) @@ -95,7 +96,7 @@ struct TRINITY_DLL_DECL boss_najentusAI : public ScriptedAI void SpellHit(Unit *caster, const SpellEntry *spell) { - if(spell->Id == SPELL_HURL_SPINE && m_creature->HasAura(SPELL_TIDAL_SHIELD, 0)) + if(spell->Id == SPELL_HURL_SPINE && m_creature->HasAura(SPELL_TIDAL_SHIELD)) { m_creature->RemoveAurasDueToSpell(SPELL_TIDAL_SHIELD); m_creature->CastSpell(m_creature, SPELL_TIDAL_BURST, true); @@ -103,20 +104,23 @@ struct TRINITY_DLL_DECL boss_najentusAI : public ScriptedAI } } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { if(pInstance) pInstance->SetData(DATA_HIGHWARLORDNAJENTUSEVENT, IN_PROGRESS); DoScriptText(SAY_AGGRO, m_creature); DoZoneInCombat(); + events.ScheduleEvent(EVENT_BERSERK, 480000, GCD_CAST); + events.ScheduleEvent(EVENT_YELL, 45000 + (rand()%76)*1000, GCD_YELL); + ResetTimer(); } bool RemoveImpalingSpine() { if(!SpineTargetGUID) return false; Unit* target = Unit::GetUnit(*m_creature, SpineTargetGUID); - if(target && target->HasAura(SPELL_IMPALING_SPINE, 1)) + if(target && target->HasAura(SPELL_IMPALING_SPINE)) target->RemoveAurasDueToSpell(SPELL_IMPALING_SPINE); SpineTargetGUID=0; return true; @@ -124,9 +128,9 @@ struct TRINITY_DLL_DECL boss_najentusAI : public ScriptedAI void ResetTimer(uint32 inc = 0) { - NeedleSpineTimer = 10000 + inc; - TidalShieldTimer = 60000 + inc; - ImpalingSpineTimer = 20000 + inc; + events.RescheduleEvent(EVENT_NEEDLE, 10000 + inc, GCD_CAST); + events.RescheduleEvent(EVENT_SPINE, 20000 + inc, GCD_CAST); + events.RescheduleEvent(EVENT_SHIELD, 60000 + inc); } void UpdateAI(const uint32 diff) @@ -134,58 +138,56 @@ struct TRINITY_DLL_DECL boss_najentusAI : public ScriptedAI if (!UpdateVictim()) return; - if(TidalShieldTimer < diff) - { - m_creature->CastSpell(m_creature, SPELL_TIDAL_SHIELD, true); - ResetTimer(45000); - }else TidalShieldTimer -= diff; - - if(EnrageTimer < diff) - { - DoScriptText(SAY_ENRAGE2, m_creature); - m_creature->CastSpell(m_creature, SPELL_BERSERK, true); - EnrageTimer = 600000; - }else EnrageTimer -= diff; - - if(NeedleSpineTimer < diff) - { - //m_creature->CastSpell(m_creature, SPELL_NEEDLE_SPINE, true); - std::list<Unit*> target; - SelectUnitList(target, 3, SELECT_TARGET_RANDOM, 80, true); - for(std::list<Unit*>::iterator i = target.begin(); i != target.end(); ++i) - m_creature->CastSpell(*i, 39835, true); - NeedleSpineTimer = 20000+rand()%5000; - }else NeedleSpineTimer -= diff; - - if(SpecialYellTimer < diff) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_SPECIAL1, m_creature); break; - case 1: DoScriptText(SAY_SPECIAL2, m_creature); break; - } - SpecialYellTimer = 25000 + (rand()%76)*1000; - }else SpecialYellTimer -= diff; + events.Update(diff); - if(ImpalingSpineTimer < diff) + while(uint32 eventId = events.ExecuteEvent()) { - Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1); - if(!target) target = m_creature->getVictim(); - if(target) + switch(eventId) { - m_creature->CastSpell(target, SPELL_IMPALING_SPINE, true); - SpineTargetGUID = target->GetGUID(); - //must let target summon, otherwise you cannot click the spine - target->SummonGameObject(GOBJECT_SPINE, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), m_creature->GetOrientation(), 0, 0, 0, 0, 30); - - switch(rand()%2) + case EVENT_SHIELD: + m_creature->CastSpell(m_creature, SPELL_TIDAL_SHIELD, true); + ResetTimer(45000); + break; + case EVENT_BERSERK: + DoScriptText(SAY_ENRAGE2, m_creature); + m_creature->CastSpell(m_creature, SPELL_BERSERK, true); + events.DelayEvents(15000, GCD_YELL); + break; + case EVENT_SPINE: { - case 0: DoScriptText(SAY_NEEDLE1, m_creature); break; - case 1: DoScriptText(SAY_NEEDLE2, m_creature); break; + Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1); + if(!target) target = m_creature->getVictim(); + if(target) + { + m_creature->CastSpell(target, SPELL_IMPALING_SPINE, true); + SpineTargetGUID = target->GetGUID(); + //must let target summon, otherwise you cannot click the spine + target->SummonGameObject(GOBJECT_SPINE, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), m_creature->GetOrientation(), 0, 0, 0, 0, 30); + DoScriptText(rand()%2 ? SAY_NEEDLE1 : SAY_NEEDLE2, m_creature); + events.DelayEvents(1500, GCD_CAST); + events.DelayEvents(15000, GCD_YELL); + } + events.ScheduleEvent(EVENT_SPINE, 21000, GCD_CAST); + return; } - ImpalingSpineTimer = 21000; + case EVENT_NEEDLE: + { + //m_creature->CastSpell(m_creature, SPELL_NEEDLE_SPINE, true); + std::list<Unit*> target; + SelectTargetList(target, 3, SELECT_TARGET_RANDOM, 80, true); + for(std::list<Unit*>::iterator i = target.begin(); i != target.end(); ++i) + m_creature->CastSpell(*i, 39835, true); + events.ScheduleEvent(EVENT_NEEDLE, 15000+rand()%10000, GCD_CAST); + events.DelayEvents(1500, GCD_CAST); + return; + } + case EVENT_YELL: + DoScriptText(rand()%2 ? SAY_SPECIAL1 : SAY_SPECIAL2, m_creature); + events.ScheduleEvent(EVENT_YELL, 25000 + (rand()%76)*1000, GCD_YELL); + events.DelayEvents(15000, GCD_YELL); + break; } - }else ImpalingSpineTimer -= diff; + } DoMeleeAttackIfReady(); } @@ -193,13 +195,13 @@ struct TRINITY_DLL_DECL boss_najentusAI : public ScriptedAI bool GOHello_go_najentus_spine(Player *player, GameObject* _GO) { - if(ScriptedInstance* pInstance = (ScriptedInstance*)_GO->GetInstanceData()) + if(ScriptedInstance* pInstance = _GO->GetInstanceData()) if(Creature* Najentus = Unit::GetCreature(*_GO, pInstance->GetData64(DATA_HIGHWARLORDNAJENTUS))) - if(((boss_najentusAI*)Najentus->AI())->RemoveImpalingSpine()) + if(CAST_AI(boss_najentusAI, Najentus->AI())->RemoveImpalingSpine()) { player->CastSpell(player, SPELL_CREATE_NAJENTUS_SPINE, true); _GO->SetLootState(GO_NOT_READY); - _GO->SetRespawnTime(0); + _GO->Delete(); } return true; } diff --git a/src/bindings/scripts/scripts/zone/black_temple/def_black_temple.h b/src/bindings/scripts/scripts/zone/black_temple/def_black_temple.h index 0d5bb184792..c98c0b1c363 100644 --- a/src/bindings/scripts/scripts/zone/black_temple/def_black_temple.h +++ b/src/bindings/scripts/scripts/zone/black_temple/def_black_temple.h @@ -1,35 +1,39 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * This program is free software licensed under GPL version 2 * Please see the included DOCS/LICENSE.TXT for more information */ #ifndef DEF_BLACK_TEMPLE_H #define DEF_BLACK_TEMPLE_H -#define DATA_AKAMA 1 -#define DATA_AKAMA_SHADE 2 -#define DATA_GURTOGGBLOODBOILEVENT 3 -#define DATA_HIGHWARLORDNAJENTUS 4 -#define DATA_HIGHWARLORDNAJENTUSEVENT 5 -#define DATA_ILLIDANSTORMRAGE 6 -#define DATA_ILLIDANSTORMRAGEEVENT 7 -#define DATA_ILLIDARICOUNCILEVENT 8 -#define DATA_ILLIDARICOUNCIL 9 -#define DATA_LADYMALANDE 10 -#define DATA_HIGHNETHERMANCERZEREVOR 11 -#define DATA_GATHIOSTHESHATTERER 12 -#define DATA_VERASDARKSHADOW 13 -#define DATA_MOTHERSHAHRAZEVENT 14 -#define DATA_RELIQUARYOFSOULSEVENT 15 -#define DATA_SHADEOFAKAMA 16 -#define DATA_SHADEOFAKAMAEVENT 17 -#define DATA_SUPREMUS 18 -#define DATA_SUPREMUSEVENT 19 -#define DATA_TERONGOREFIENDEVENT 20 -#define DATA_GAMEOBJECT_NAJENTUS_GATE 21 -#define DATA_GAMEOBJECT_ILLIDAN_GATE 22 -#define DATA_GAMEOBJECT_ILLIDAN_DOOR_R 23 -#define DATA_GAMEOBJECT_ILLIDAN_DOOR_L 24 -#define DATA_GAMEOBJECT_SUPREMUS_DOORS 25 -#define DATA_BLOOD_ELF_COUNCIL_VOICE 26 +enum +{ + DATA_AKAMA = 1, + DATA_AKAMA_SHADE = 2, + DATA_GURTOGGBLOODBOILEVENT = 3, + DATA_HIGHWARLORDNAJENTUS = 4, + DATA_HIGHWARLORDNAJENTUSEVENT = 5, + DATA_ILLIDANSTORMRAGE = 6, + DATA_ILLIDANSTORMRAGEEVENT = 7, + DATA_ILLIDARICOUNCILEVENT = 8, + DATA_ILLIDARICOUNCIL = 9, + DATA_LADYMALANDE = 10, + DATA_HIGHNETHERMANCERZEREVOR = 11, + DATA_GATHIOSTHESHATTERER = 12, + DATA_VERASDARKSHADOW = 13, + DATA_MOTHERSHAHRAZEVENT = 14, + DATA_RELIQUARYOFSOULSEVENT = 15, + DATA_SHADEOFAKAMA = 16, + DATA_SHADEOFAKAMAEVENT = 17, + DATA_SUPREMUS = 18, + DATA_SUPREMUSEVENT = 19, + DATA_TERONGOREFIENDEVENT = 20, + DATA_GAMEOBJECT_NAJENTUS_GATE = 21, + DATA_GAMEOBJECT_ILLIDAN_GATE = 22, + DATA_GAMEOBJECT_ILLIDAN_DOOR_R = 23, + DATA_GAMEOBJECT_ILLIDAN_DOOR_L = 24, + DATA_GAMEOBJECT_SUPREMUS_DOORS = 25, + DATA_BLOOD_ELF_COUNCIL_VOICE = 26 +}; + #endif diff --git a/src/bindings/scripts/scripts/zone/black_temple/illidari_council.cpp b/src/bindings/scripts/scripts/zone/black_temple/illidari_council.cpp index 266c84bd09e..0c43ba57041 100644 --- a/src/bindings/scripts/scripts/zone/black_temple/illidari_council.cpp +++ b/src/bindings/scripts/scripts/zone/black_temple/illidari_council.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -135,7 +135,7 @@ struct TRINITY_DLL_DECL mob_blood_elf_council_voice_triggerAI : public ScriptedA // finds and stores the GUIDs for each Council member using instance data system. void LoadCouncilGUIDs() { - if(ScriptedInstance* pInstance = ((ScriptedInstance*)m_creature->GetInstanceData())) + if(ScriptedInstance* pInstance = (m_creature->GetInstanceData())) { Council[0] = pInstance->GetData64(DATA_GATHIOSTHESHATTERER); Council[1] = pInstance->GetData64(DATA_VERASDARKSHADOW); @@ -144,7 +144,7 @@ struct TRINITY_DLL_DECL mob_blood_elf_council_voice_triggerAI : public ScriptedA }else error_log(ERROR_INST_DATA); } - void Aggro(Unit* who) {} + void EnterCombat(Unit* who) {} void AttackStart(Unit* who) {} void MoveInLineOfSight(Unit* who) {} @@ -192,7 +192,7 @@ struct TRINITY_DLL_DECL mob_illidari_councilAI : public ScriptedAI { mob_illidari_councilAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); for(uint8 i = 0; i < 4; ++i) Council[i] = 0; } @@ -243,7 +243,7 @@ struct TRINITY_DLL_DECL mob_illidari_councilAI : public ScriptedAI m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, 11686); } - void Aggro(Unit *who) {} + void EnterCombat(Unit *who) {} void AttackStart(Unit* who) {} void MoveInLineOfSight(Unit* who) {} @@ -261,8 +261,8 @@ struct TRINITY_DLL_DECL mob_illidari_councilAI : public ScriptedAI // Start the event for the Voice Trigger if(Creature* VoiceTrigger = (Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_BLOOD_ELF_COUNCIL_VOICE)))) { - ((mob_blood_elf_council_voice_triggerAI*)VoiceTrigger->AI())->LoadCouncilGUIDs(); - ((mob_blood_elf_council_voice_triggerAI*)VoiceTrigger->AI())->EventStarted = true; + CAST_AI(mob_blood_elf_council_voice_triggerAI, VoiceTrigger->AI())->LoadCouncilGUIDs(); + CAST_AI(mob_blood_elf_council_voice_triggerAI, VoiceTrigger->AI())->EventStarted = true; } for(uint8 i = 0; i < 4; ++i) @@ -272,7 +272,7 @@ struct TRINITY_DLL_DECL mob_illidari_councilAI : public ScriptedAI { Member = Unit::GetUnit((*m_creature), Council[i]); if(Member && Member->isAlive()) - ((Creature*)Member)->AI()->AttackStart(target); + CAST_CRE(Member)->AI()->AttackStart(target); } } @@ -348,7 +348,7 @@ struct TRINITY_DLL_DECL boss_illidari_councilAI : public ScriptedAI { boss_illidari_councilAI(Creature* c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); for(uint8 i = 0; i < 4; ++i) Council[i] = 0; LoadedGUIDs = false; @@ -360,13 +360,13 @@ struct TRINITY_DLL_DECL boss_illidari_councilAI : public ScriptedAI bool LoadedGUIDs; - void Aggro(Unit* who) + void EnterCombat(Unit* who) { if(pInstance) { Creature* Controller = (Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_ILLIDARICOUNCIL))); if(Controller) - ((mob_illidari_councilAI*)Controller->AI())->StartEvent(who); + CAST_AI(mob_illidari_councilAI, Controller->AI())->StartEvent(who); } else { diff --git a/src/bindings/scripts/scripts/zone/black_temple/instance_black_temple.cpp b/src/bindings/scripts/scripts/zone/black_temple/instance_black_temple.cpp index 80a749faa12..3f71e2070ab 100644 --- a/src/bindings/scripts/scripts/zone/black_temple/instance_black_temple.cpp +++ b/src/bindings/scripts/scripts/zone/black_temple/instance_black_temple.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -24,7 +24,7 @@ EndScriptData */ #include "precompiled.h" #include "def_black_temple.h" -#define ENCOUNTERS 9 +#define ENCOUNTERS 9 /* Black Temple encounters: 0 - High Warlord Naj'entus event @@ -42,6 +42,9 @@ struct TRINITY_DLL_DECL instance_black_temple : public ScriptedInstance { instance_black_temple(Map *map) : ScriptedInstance(map) {Initialize();}; + uint32 Encounters[ENCOUNTERS]; + std::string str_data; + uint64 Najentus; uint64 Akama; // This is the Akama that starts the Illidan encounter. uint64 Akama_Shade; // This is the Akama that starts the Shade of Akama encounter. @@ -68,9 +71,6 @@ struct TRINITY_DLL_DECL instance_black_temple : public ScriptedInstance uint64 IllidanGate; uint64 IllidanDoor[2]; - uint32 Encounters[ENCOUNTERS]; - std::string str_data; - void Initialize() { Najentus = 0; @@ -131,7 +131,7 @@ struct TRINITY_DLL_DECL instance_black_temple : public ScriptedInstance void OnCreatureCreate(Creature *creature, uint32 creature_entry) { - switch(creature_entry) + switch(creature->GetEntry()) { case 22887: Najentus = creature->GetGUID(); break; case 23089: Akama = creature->GetGUID(); break; @@ -303,7 +303,7 @@ struct TRINITY_DLL_DECL instance_black_temple : public ScriptedInstance return 0; } - const char* Save() + std::string GetSaveData() { return str_data.c_str(); } diff --git a/src/bindings/scripts/scripts/zone/blackrock_depths/blackrock_depths.cpp b/src/bindings/scripts/scripts/zone/blackrock_depths/blackrock_depths.cpp index e35f5551571..135f63bc08c 100644 --- a/src/bindings/scripts/scripts/zone/blackrock_depths/blackrock_depths.cpp +++ b/src/bindings/scripts/scripts/zone/blackrock_depths/blackrock_depths.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -65,19 +65,9 @@ uint32 RingBoss[]= 9032, // Hedrum }; -float RingLocations[6][3]= -{ - {604.802673, -191.081985, -54.058590}, // ring - {604.072998, -222.106918, -52.743759}, // first gate - {621.400391, -214.499054, -52.814453}, // hiding in corner - {601.300781, -198.556992, -53.950256}, // ring - {631.818359, -180.548126, -52.654770}, // second gate - {627.390381, -201.075974, -52.692917} // hiding in corner -}; - bool AreaTrigger_at_ring_of_law(Player *player, AreaTriggerEntry *at) { - ScriptedInstance* pInstance = ((ScriptedInstance*)player->GetInstanceData()); + ScriptedInstance* pInstance = (player->GetInstanceData()); if (pInstance) { @@ -101,7 +91,7 @@ struct TRINITY_DLL_DECL npc_grimstoneAI : public npc_escortAI { npc_grimstoneAI(Creature *c) : npc_escortAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); MobSpawnId = rand()%6; } @@ -137,16 +127,6 @@ struct TRINITY_DLL_DECL npc_grimstoneAI : public npc_escortAI CanWalk = false; } - void Aggro(Unit *who) { } - - void DoGate(uint32 id, uint32 state) - { - if (GameObject *go = GameObject::GetGameObject(*m_creature,pInstance->GetData64(id))) - go->SetGoState(state); - - debug_log("TSCR: npc_grimstone, arena gate update state."); - } - //TODO: move them to center void SummonRingMob() { @@ -203,6 +183,11 @@ struct TRINITY_DLL_DECL npc_grimstoneAI : public npc_escortAI } } + void HandleGameObject(uint32 id, bool open) + { + pInstance->HandleGameObject(pInstance->GetData64(id), open); + } + void UpdateAI(const uint32 diff) { if (!pInstance) @@ -254,7 +239,7 @@ struct TRINITY_DLL_DECL npc_grimstoneAI : public npc_escortAI { case 0: DoScriptText(-1000000, m_creature);//1 - DoGate(DATA_ARENA4,1); + HandleGameObject(DATA_ARENA4, false); Start(false, false, false); CanWalk = true; Event_Timer = 0; @@ -267,7 +252,7 @@ struct TRINITY_DLL_DECL npc_grimstoneAI : public npc_escortAI Event_Timer = 2000; break; case 3: - DoGate(DATA_ARENA1,0); + HandleGameObject(DATA_ARENA1, true); Event_Timer = 3000; break; case 4: @@ -287,13 +272,13 @@ struct TRINITY_DLL_DECL npc_grimstoneAI : public npc_escortAI break; case 7: m_creature->SetVisibility(VISIBILITY_ON); - DoGate(DATA_ARENA1,1); + HandleGameObject(DATA_ARENA1, false); DoScriptText(-1000000, m_creature);//4 CanWalk = true; Event_Timer = 0; break; case 8: - DoGate(DATA_ARENA2,0); + HandleGameObject(DATA_ARENA2, true); Event_Timer = 5000; break; case 9: @@ -303,9 +288,9 @@ struct TRINITY_DLL_DECL npc_grimstoneAI : public npc_escortAI break; case 10: //if quest, complete - DoGate(DATA_ARENA2,1); - DoGate(DATA_ARENA3,0); - DoGate(DATA_ARENA4,0); + HandleGameObject(DATA_ARENA2, false); + HandleGameObject(DATA_ARENA3, true); + HandleGameObject(DATA_ARENA4, true); CanWalk = true; Event_Timer = 0; break; @@ -323,11 +308,9 @@ CreatureAI* GetAI_npc_grimstone(Creature *_Creature) { npc_grimstoneAI* Grimstone_AI = new npc_grimstoneAI(_Creature); - for(uint8 i = 0; i < 6; ++i) - Grimstone_AI->AddWaypoint(i, RingLocations[i][0], RingLocations[i][1], RingLocations[i][2]); - - return (CreatureAI*)Grimstone_AI; + Grimstone_AI->FillPointMovementListForCreature(); + return Grimstone_AI; } /*###### @@ -353,10 +336,6 @@ struct TRINITY_DLL_DECL mob_phalanxAI : public ScriptedAI MightyBlow_Timer = 15000; } - void Aggro(Unit *who) - { - } - void UpdateAI(const uint32 diff) { //Return since we have no target @@ -558,7 +537,7 @@ struct TRINITY_DLL_DECL npc_dughal_stormwingAI : public npc_escortAI } } - void Aggro(Unit* who) { } + void EnterCombat(Unit* who) { } void Reset() {} void JustDied(Unit* killer) @@ -598,7 +577,7 @@ CreatureAI* GetAI_npc_dughal_stormwing(Creature *_Creature) dughal_stormwingAI->AddWaypoint(1, 287.64,-87.01, -76.79,0); dughal_stormwingAI->AddWaypoint(2, 354.63,-64.95, -67.53,0); - return (CreatureAI*)dughal_stormwingAI; + return dughal_stormwingAI; } bool GossipHello_npc_dughal_stormwing(Player *player, Creature *_Creature) { @@ -615,7 +594,7 @@ bool GossipSelect_npc_dughal_stormwing(Player *player, Creature *_Creature, uint if (action == GOSSIP_ACTION_INFO_DEF + 1) { player->CLOSE_GOSSIP_MENU(); - ((npc_escortAI*)(_Creature->AI()))->Start(false, false, true, player->GetGUID()); + CAST_AI(npc_escortAI, (_Creature->AI()))->Start(false, false, true, player->GetGUID()); _Creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); pInstance->SetData(DATA_QUEST_JAIL_BREAK,ENCOUNTER_STATE_IN_PROGRESS); } @@ -643,7 +622,7 @@ struct TRINITY_DLL_DECL npc_marshal_windsorAI : public npc_escortAI { npc_marshal_windsorAI(Creature *c) : npc_escortAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } void WaypointReached(uint32 i) @@ -691,7 +670,7 @@ struct TRINITY_DLL_DECL npc_marshal_windsorAI : public npc_escortAI } } - void Aggro(Unit* who) + void EnterCombat(Unit* who) { switch(rand()%3) { @@ -763,7 +742,7 @@ CreatureAI* GetAI_npc_marshal_windsor(Creature *_Creature) marshal_windsorAI->AddWaypoint(18, 403.61,-51.71, -63.92,1000); marshal_windsorAI->AddWaypoint(19, 403.61,-51.71, -63.92,0); - return (CreatureAI*)marshal_windsorAI; + return marshal_windsorAI; } bool QuestAccept_npc_marshal_windsor(Player *player, Creature *creature, Quest const *quest ) @@ -772,7 +751,7 @@ bool QuestAccept_npc_marshal_windsor(Player *player, Creature *creature, Quest c {PlayerStart = player; if( pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_NOT_STARTED ) { - ((npc_escortAI*)(creature->AI()))->Start(true, true, false, player->GetGUID()); + CAST_AI(npc_escortAI, (creature->AI()))->Start(true, true, false, player->GetGUID()); pInstance->SetData(DATA_QUEST_JAIL_BREAK,ENCOUNTER_STATE_IN_PROGRESS); creature->setFaction(11); } @@ -875,19 +854,19 @@ struct TRINITY_DLL_DECL npc_marshal_reginald_windsorAI : public npc_escortAI if( who->GetTypeId() == TYPEID_PLAYER ) { - if( ((Player*)who)->GetQuestStatus(4322) == QUEST_STATUS_INCOMPLETE ) + if( CAST_PLR(who)->GetQuestStatus(4322) == QUEST_STATUS_INCOMPLETE ) { float Radius = 10.0; if( m_creature->IsWithinDistInMap(who, Radius) ) { IsOnHold = false; - ((npc_escortAI*)(m_creature->AI()))->Start(true, true, false, who->GetGUID()); + Start(true, true, false, who->GetGUID()); } } } } - void Aggro(Unit* who) + void EnterCombat(Unit* who) { switch(rand()%3) { @@ -990,7 +969,7 @@ CreatureAI* GetAI_npc_marshal_reginald_windsor(Creature *_Creature) marshal_reginald_windsorAI->AddWaypoint(33, 452.45,29.85, -70.37,10000); marshal_reginald_windsorAI->AddWaypoint(34, 451.27,31.85, -70.07,0); - return (CreatureAI*)marshal_reginald_windsorAI; + return marshal_reginald_windsorAI; } */ /*###### @@ -1003,7 +982,7 @@ struct TRINITY_DLL_DECL npc_tobias_seecherAI : public npc_escortAI { npc_tobias_seecherAI(Creature *c) :npc_escortAI(c) {} - void Aggro(Unit* who) { } + void EnterCombat(Unit* who) { } void Reset() {} void JustDied(Unit* killer) @@ -1062,7 +1041,7 @@ CreatureAI* GetAI_npc_tobias_seecher(Creature *_Creature) tobias_seecherAI->AddWaypoint(3, 519.44, -217.02, -59.34); tobias_seecherAI->AddWaypoint(4, 506.55, -153.49, -62.34); - return (CreatureAI*)tobias_seecherAI; + return tobias_seecherAI; } bool GossipHello_npc_tobias_seecher(Player *player, Creature *_Creature) @@ -1080,7 +1059,7 @@ bool GossipSelect_npc_tobias_seecher(Player *player, Creature *_Creature, uint32 if (action == GOSSIP_ACTION_INFO_DEF + 1) { player->CLOSE_GOSSIP_MENU(); - ((npc_escortAI*)(_Creature->AI()))->Start(false, false, true, player->GetGUID()); + CAST_AI(npc_escortAI, (_Creature->AI()))->Start(false, false, true, player->GetGUID()); _Creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); pInstance->SetData(DATA_TOBIAS,ENCOUNTER_STATE_IN_PROGRESS); } @@ -1096,35 +1075,11 @@ bool GossipSelect_npc_tobias_seecher(Player *player, Creature *_Creature, uint32 #define SPELL_DRUNKEN_RAGE 14872 #define QUEST_ALE 4295 -float BarWpLocations[8][3]= -{ - {883.294861, -188.926300, -43.703655}, - {872.763550, -185.605621, -43.703655}, //b1 - {867.923401, -188.006393, -43.703655}, //b2 - {863.295898, -190.795212, -43.703655}, //b3 - {856.139587, -194.652756, -43.703655}, //b4 - {851.878906, -196.928131, -43.703655}, //b5 - {877.035217, -187.048080, -43.703655}, - {891.198000, -197.924000, -43.620400} //home -}; - -uint32 BarWpWait[8]= -{ - 0, - 5000, - 5000, - 5000, - 5000, - 15000, - 0, - 0 -}; - struct TRINITY_DLL_DECL npc_rocknotAI : public npc_escortAI { npc_rocknotAI(Creature *c) : npc_escortAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } ScriptedInstance* pInstance; @@ -1141,12 +1096,10 @@ struct TRINITY_DLL_DECL npc_rocknotAI : public npc_escortAI BreakDoor_Timer = 0; } - void Aggro(Unit *who) { } - void DoGo(uint32 id, uint32 state) { if (GameObject *go = GameObject::GetGameObject(*m_creature,pInstance->GetData64(id))) - go->SetGoState(state); + go->SetGoState((GOState)state); } void WaypointReached(uint32 i) @@ -1217,15 +1170,14 @@ CreatureAI* GetAI_npc_rocknot(Creature *_Creature) { npc_rocknotAI* Rocknot_AI = new npc_rocknotAI(_Creature); - for(uint8 i = 0; i < 8; ++i) - Rocknot_AI->AddWaypoint(i, BarWpLocations[i][0], BarWpLocations[i][1], BarWpLocations[i][2], BarWpWait[i]); + Rocknot_AI->FillPointMovementListForCreature(); - return (CreatureAI*)Rocknot_AI; + return Rocknot_AI; } bool ChooseReward_npc_rocknot(Player *player, Creature *_Creature, const Quest *_Quest, uint32 item) { - ScriptedInstance* pInstance = ((ScriptedInstance*)_Creature->GetInstanceData()); + ScriptedInstance* pInstance = (_Creature->GetInstanceData()); if (!pInstance) return true; @@ -1245,7 +1197,7 @@ bool ChooseReward_npc_rocknot(Player *player, Creature *_Creature, const Quest * { DoScriptText(SAY_GOT_BEER, _Creature); _Creature->CastSpell(_Creature,SPELL_DRUNKEN_RAGE,false); - ((npc_escortAI*)(_Creature->AI()))->Start(false, false, false); + CAST_AI(npc_escortAI, (_Creature->AI()))->Start(false, false, false); } } diff --git a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_ambassador_flamelash.cpp b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_ambassador_flamelash.cpp index b0c4bafb290..d08cbb06b98 100644 --- a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_ambassador_flamelash.cpp +++ b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_ambassador_flamelash.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -42,7 +42,7 @@ struct TRINITY_DLL_DECL boss_ambassador_flamelashAI : public ScriptedAI Spirit_Timer = 24000; } - void Aggro(Unit *who) {} + void EnterCombat(Unit *who) {} void SummonSpirits(Unit* victim) { @@ -61,7 +61,7 @@ struct TRINITY_DLL_DECL boss_ambassador_flamelashAI : public ScriptedAI } Summoned = DoSpawnCreature(9178, RandX, RandY, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000); if(Summoned) - ((CreatureAI*)Summoned->AI())->AttackStart(victim); + (Summoned->AI())->AttackStart(victim); } void UpdateAI(const uint32 diff) diff --git a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_anubshiah.cpp b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_anubshiah.cpp index ad9330528b9..a65d41e3170 100644 --- a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_anubshiah.cpp +++ b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_anubshiah.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -48,7 +48,7 @@ struct TRINITY_DLL_DECL boss_anubshiahAI : public ScriptedAI EnvelopingWeb_Timer = 16000; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } diff --git a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_emperor_dagran_thaurissan.cpp b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_emperor_dagran_thaurissan.cpp index 978f4d8e9d7..378f8163f9d 100644 --- a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_emperor_dagran_thaurissan.cpp +++ b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_emperor_dagran_thaurissan.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -23,12 +23,12 @@ EndScriptData */ #include "precompiled.h" +#define SAY_AGGRO -1230001 +#define SAY_SLAY -1230002 + #define SPELL_HANDOFTHAURISSAN 17492 #define SPELL_AVATAROFFLAME 15636 -#define SAY_AGGRO "Come to aid the Throne!" -#define SAY_SLAY "Hail to the king, baby!" - struct TRINITY_DLL_DECL boss_draganthaurissanAI : public ScriptedAI { boss_draganthaurissanAI(Creature *c) : ScriptedAI(c) {} @@ -44,14 +44,14 @@ struct TRINITY_DLL_DECL boss_draganthaurissanAI : public ScriptedAI //Counter= 0; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { - DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL); + DoScriptText(SAY_AGGRO, m_creature); } void KilledUnit(Unit* victim) { - DoYell(SAY_SLAY, LANG_UNIVERSAL, NULL); + DoScriptText(SAY_SLAY, m_creature); } void UpdateAI(const uint32 diff) @@ -62,9 +62,8 @@ struct TRINITY_DLL_DECL boss_draganthaurissanAI : public ScriptedAI if (HandOfThaurissan_Timer < diff) { - Unit* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM,0); - if (target) DoCast(target,SPELL_HANDOFTHAURISSAN); + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_HANDOFTHAURISSAN); //3 Hands of Thaurissan will be casted //if (Counter < 3) @@ -89,6 +88,7 @@ struct TRINITY_DLL_DECL boss_draganthaurissanAI : public ScriptedAI DoMeleeAttackIfReady(); } }; + CreatureAI* GetAI_boss_draganthaurissan(Creature *_Creature) { return new boss_draganthaurissanAI (_Creature); diff --git a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_general_angerforge.cpp b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_general_angerforge.cpp index 80df7fec20b..5d47241a5d9 100644 --- a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_general_angerforge.cpp +++ b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_general_angerforge.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -54,7 +54,7 @@ struct TRINITY_DLL_DECL boss_general_angerforgeAI : public ScriptedAI Medics = false; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } @@ -76,7 +76,7 @@ struct TRINITY_DLL_DECL boss_general_angerforgeAI : public ScriptedAI Rand1 = 0; SummonedAdds = DoSpawnCreature(8901, Rand1X, Rand1Y, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 120000); if(SummonedAdds) - ((CreatureAI*)SummonedAdds->AI())->AttackStart(victim); + (SummonedAdds->AI())->AttackStart(victim); } void SummonMedics(Unit* victim) @@ -97,7 +97,7 @@ struct TRINITY_DLL_DECL boss_general_angerforgeAI : public ScriptedAI Rand2 = 0; SummonedMedics = DoSpawnCreature(8894, Rand2X, Rand2Y, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 120000); if(SummonedMedics) - ((CreatureAI*)SummonedMedics->AI())->AttackStart(victim); + (SummonedMedics->AI())->AttackStart(victim); } void UpdateAI(const uint32 diff) diff --git a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_gorosh_the_dervish.cpp b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_gorosh_the_dervish.cpp index 25367c6f4dd..6a89906faf7 100644 --- a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_gorosh_the_dervish.cpp +++ b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_gorosh_the_dervish.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -39,7 +39,7 @@ struct TRINITY_DLL_DECL boss_gorosh_the_dervishAI : public ScriptedAI MortalStrike_Timer = 22000; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } diff --git a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_grizzle.cpp b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_grizzle.cpp index 389b2bc5b4d..5aa3786efce 100644 --- a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_grizzle.cpp +++ b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_grizzle.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>.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 @@ -23,6 +23,8 @@ EndScriptData */ #include "precompiled.h" +#define EMOTE_GENERIC_FRENZY_KILL -1000001 + #define SPELL_GROUNDTREMOR 6524 #define SPELL_FRENZY 28371 @@ -39,7 +41,7 @@ struct TRINITY_DLL_DECL boss_grizzleAI : public ScriptedAI Frenzy_Timer =0; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } @@ -62,7 +64,7 @@ struct TRINITY_DLL_DECL boss_grizzleAI : public ScriptedAI if (Frenzy_Timer < diff) { DoCast(m_creature,SPELL_FRENZY); - DoTextEmote("goes into a killing frenzy!",NULL); + DoScriptText(EMOTE_GENERIC_FRENZY_KILL, m_creature); Frenzy_Timer = 15000; }else Frenzy_Timer -= diff; diff --git a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_high_interrogator_gerstahn.cpp b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_high_interrogator_gerstahn.cpp index 422f0f25532..62ba94347d4 100644 --- a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_high_interrogator_gerstahn.cpp +++ b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_high_interrogator_gerstahn.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -45,7 +45,7 @@ struct TRINITY_DLL_DECL boss_high_interrogator_gerstahnAI : public ScriptedAI ShadowShield_Timer = 8000; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } diff --git a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_magmus.cpp b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_magmus.cpp index 25f7f890e3f..f9016987dfa 100644 --- a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_magmus.cpp +++ b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_magmus.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -39,7 +39,7 @@ struct TRINITY_DLL_DECL boss_magmusAI : public ScriptedAI WarStomp_Timer =0; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } diff --git a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_moira_bronzebeard.cpp b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_moira_bronzebeard.cpp index 26c72404355..b60ad5cdbe5 100644 --- a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_moira_bronzebeard.cpp +++ b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_moira_bronzebeard.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -51,7 +51,7 @@ struct TRINITY_DLL_DECL boss_moira_bronzebeardAI : public ScriptedAI Smite_Timer = 8000; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } diff --git a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_tomb_of_seven.cpp b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_tomb_of_seven.cpp index 3e99a09b266..ff02f60f7a2 100644 --- a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_tomb_of_seven.cpp +++ b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_tomb_of_seven.cpp @@ -46,7 +46,7 @@ struct TRINITY_DLL_DECL boss_angerrelAI : public ScriptedAI Strike_Timer = 12000; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } @@ -104,7 +104,7 @@ struct TRINITY_DLL_DECL boss_doperelAI : public ScriptedAI Gouge_Timer = 6000; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } @@ -164,7 +164,7 @@ struct TRINITY_DLL_DECL boss_haterelAI : public ScriptedAI Strike_Timer = 12000; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } @@ -236,7 +236,7 @@ struct TRINITY_DLL_DECL boss_vilerelAI : public ScriptedAI Shield_Timer = 3000; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } @@ -309,7 +309,7 @@ struct TRINITY_DLL_DECL boss_seethrelAI : public ScriptedAI m_creature->CastSpell(m_creature,SPELL_FROSTARMOR,true); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } @@ -385,7 +385,7 @@ struct TRINITY_DLL_DECL boss_gloomrelAI : public ScriptedAI m_creature->setFaction(FACTION_NEUTRAL); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } @@ -493,7 +493,7 @@ struct TRINITY_DLL_DECL boss_doomrelAI : public ScriptedAI m_creature->setFaction(FACTION_NEUTRAL); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } @@ -515,7 +515,7 @@ struct TRINITY_DLL_DECL boss_doomrelAI : public ScriptedAI Rand = 0; Summoned = DoSpawnCreature(16119, RandX, RandY, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 120000); if(Summoned) - ((CreatureAI*)Summoned->AI())->AttackStart(victim); + (Summoned->AI())->AttackStart(victim); } void UpdateAI(const uint32 diff) diff --git a/src/bindings/scripts/scripts/zone/blackrock_depths/instance_blackrock_depths.cpp b/src/bindings/scripts/scripts/zone/blackrock_depths/instance_blackrock_depths.cpp index ffdc304bc6e..d9f3ecd808a 100644 --- a/src/bindings/scripts/scripts/zone/blackrock_depths/instance_blackrock_depths.cpp +++ b/src/bindings/scripts/scripts/zone/blackrock_depths/instance_blackrock_depths.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -265,7 +265,7 @@ struct TRINITY_DLL_DECL instance_blackrock_depths : public ScriptedInstance return 0; } - const char* Save() + std::string GetSaveData() { return str_data.c_str(); } diff --git a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_drakkisath.cpp b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_drakkisath.cpp index 45e5184e1d3..cf199073b77 100644 --- a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_drakkisath.cpp +++ b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_drakkisath.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -45,7 +45,7 @@ struct TRINITY_DLL_DECL boss_drakkisathAI : public ScriptedAI Thunderclap_Timer = 17000; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } diff --git a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_gyth.cpp b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_gyth.cpp index 09656309e5c..e48c832e3b0 100644 --- a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_gyth.cpp +++ b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_gyth.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -76,7 +76,7 @@ struct TRINITY_DLL_DECL boss_gythAI : public ScriptedAI m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } diff --git a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_halycon.cpp b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_halycon.cpp index 61ce2ea2cc4..f5f7e11f7db 100644 --- a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_halycon.cpp +++ b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_halycon.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -46,7 +46,7 @@ struct TRINITY_DLL_DECL boss_halyconAI : public ScriptedAI Summoned = false; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } diff --git a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_highlord_omokk.cpp b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_highlord_omokk.cpp index 6069bad85ed..e84d538bf79 100644 --- a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_highlord_omokk.cpp +++ b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_highlord_omokk.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -54,7 +54,7 @@ struct TRINITY_DLL_DECL boss_highlordomokkAI : public ScriptedAI Slow_Timer = 24000; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } diff --git a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_mother_smolderweb.cpp b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_mother_smolderweb.cpp index 7188ae17770..749ff71f024 100644 --- a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_mother_smolderweb.cpp +++ b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_mother_smolderweb.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -40,7 +40,7 @@ struct TRINITY_DLL_DECL boss_mothersmolderwebAI : public ScriptedAI MothersMilk_Timer = 10000; } - void Aggro(Unit *who) { } + void EnterCombat(Unit *who) { } void DamageTaken(Unit *done_by, uint32 &damage) { diff --git a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_overlord_wyrmthalak.cpp b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_overlord_wyrmthalak.cpp index 85113c9a1ab..98ed58f0b3a 100644 --- a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_overlord_wyrmthalak.cpp +++ b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_overlord_wyrmthalak.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -58,7 +58,7 @@ struct TRINITY_DLL_DECL boss_overlordwyrmthalakAI : public ScriptedAI Summoned = false; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } @@ -103,9 +103,11 @@ struct TRINITY_DLL_DECL boss_overlordwyrmthalakAI : public ScriptedAI target = SelectUnit(SELECT_TARGET_RANDOM,0); SummonedCreature = m_creature->SummonCreature(9216,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,300000); - ((CreatureAI*)SummonedCreature->AI())->AttackStart(target); + if(SummonedCreature) + (SummonedCreature->AI())->AttackStart(target); SummonedCreature = m_creature->SummonCreature(9268,ADD_2X,ADD_2Y,ADD_2Z,ADD_2O,TEMPSUMMON_TIMED_DESPAWN,300000); - ((CreatureAI*)SummonedCreature->AI())->AttackStart(target); + if(SummonedCreature) + (SummonedCreature->AI())->AttackStart(target); Summoned = true; } diff --git a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_pyroguard_emberseer.cpp b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_pyroguard_emberseer.cpp index ea320b40b4d..474a3ffcfdd 100644 --- a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_pyroguard_emberseer.cpp +++ b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_pyroguard_emberseer.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -42,7 +42,7 @@ struct TRINITY_DLL_DECL boss_pyroguard_emberseerAI : public ScriptedAI PyroBlast_Timer = 14000; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } diff --git a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_quartermaster_zigris.cpp b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_quartermaster_zigris.cpp index b4b14ac5f89..d244567eafa 100644 --- a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_quartermaster_zigris.cpp +++ b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_quartermaster_zigris.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -43,7 +43,7 @@ struct TRINITY_DLL_DECL boss_quatermasterzigrisAI : public ScriptedAI //HelingPotion_Timer = 25000; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } diff --git a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_rend_blackhand.cpp b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_rend_blackhand.cpp index ee41701667b..58f487f846d 100644 --- a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_rend_blackhand.cpp +++ b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_rend_blackhand.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -42,7 +42,7 @@ struct TRINITY_DLL_DECL boss_rend_blackhandAI : public ScriptedAI Thunderclap_Timer = 9000; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } diff --git a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_shadow_hunter_voshgajin.cpp b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_shadow_hunter_voshgajin.cpp index 7a1080226ea..43417a6996c 100644 --- a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_shadow_hunter_voshgajin.cpp +++ b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_shadow_hunter_voshgajin.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -44,7 +44,7 @@ struct TRINITY_DLL_DECL boss_shadowvoshAI : public ScriptedAI //m_creature->CastSpell(m_creature,SPELL_ICEARMOR,true); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } diff --git a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_the_beast.cpp b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_the_beast.cpp index 6eead9d4162..38bdd2f2c55 100644 --- a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_the_beast.cpp +++ b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_the_beast.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -42,7 +42,7 @@ struct TRINITY_DLL_DECL boss_thebeastAI : public ScriptedAI TerrifyingRoar_Timer = 23000; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } diff --git a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_warmaster_voone.cpp b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_warmaster_voone.cpp index 625bbc0d28a..358e33969dd 100644 --- a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_warmaster_voone.cpp +++ b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_warmaster_voone.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -51,7 +51,7 @@ struct TRINITY_DLL_DECL boss_warmastervooneAI : public ScriptedAI ThrowAxe_Timer = 1000; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } diff --git a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_broodlord_lashlayer.cpp b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_broodlord_lashlayer.cpp index 5c0b2a8d2f2..915c3062ea7 100644 --- a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_broodlord_lashlayer.cpp +++ b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_broodlord_lashlayer.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -53,7 +53,7 @@ struct TRINITY_DLL_DECL boss_broodlordAI : public ScriptedAI m_creature->ApplySpellImmune(1, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { DoScriptText(SAY_AGGRO, m_creature); DoZoneInCombat(); diff --git a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_chromaggus.cpp b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_chromaggus.cpp index 686c0be35db..555a0825b50 100644 --- a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_chromaggus.cpp +++ b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_chromaggus.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -183,7 +183,7 @@ struct TRINITY_DLL_DECL boss_chromaggusAI : public ScriptedAI Enraged = false; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } @@ -259,11 +259,11 @@ struct TRINITY_DLL_DECL boss_chromaggusAI : public ScriptedAI DoCast(pUnit, SpellAfflict, true); //Chromatic mutation if target is effected by all afflictions - if (pUnit->HasAura(SPELL_BROODAF_BLUE,0) - && pUnit->HasAura(SPELL_BROODAF_BLACK,0) - && pUnit->HasAura(SPELL_BROODAF_RED,0) - && pUnit->HasAura(SPELL_BROODAF_BRONZE,0) - && pUnit->HasAura(SPELL_BROODAF_GREEN,0)) + if (pUnit->HasAura(SPELL_BROODAF_BLUE) + && pUnit->HasAura(SPELL_BROODAF_BLACK) + && pUnit->HasAura(SPELL_BROODAF_RED) + && pUnit->HasAura(SPELL_BROODAF_BRONZE) + && pUnit->HasAura(SPELL_BROODAF_GREEN)) { //target->RemoveAllAuras(); //DoCast(target,SPELL_CHROMATIC_MUT_1); diff --git a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_ebonroc.cpp b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_ebonroc.cpp index c30485ac327..90ff9b9b967 100644 --- a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_ebonroc.cpp +++ b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_ebonroc.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -45,7 +45,7 @@ struct TRINITY_DLL_DECL boss_ebonrocAI : public ScriptedAI Heal_Timer = 1000; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { DoZoneInCombat(); } @@ -76,7 +76,7 @@ struct TRINITY_DLL_DECL boss_ebonrocAI : public ScriptedAI ShadowOfEbonroc_Timer = 25000 + rand()%10000; }else ShadowOfEbonroc_Timer -= diff; - if (m_creature->getVictim()->HasAura(SPELL_SHADOWOFEBONROC,0)) + if (m_creature->getVictim()->HasAura(SPELL_SHADOWOFEBONROC)) { if (Heal_Timer < diff) { diff --git a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_firemaw.cpp b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_firemaw.cpp index 64a01b228f0..0af2c66b54f 100644 --- a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_firemaw.cpp +++ b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_firemaw.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -42,7 +42,7 @@ struct TRINITY_DLL_DECL boss_firemawAI : public ScriptedAI FlameBuffet_Timer = 5000; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { DoZoneInCombat(); } diff --git a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_flamegor.cpp b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_flamegor.cpp index 49dfdaa896f..87ce0e3fb3b 100644 --- a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_flamegor.cpp +++ b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_flamegor.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -44,7 +44,7 @@ struct TRINITY_DLL_DECL boss_flamegorAI : public ScriptedAI Frenzy_Timer = 10000; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { DoZoneInCombat(); } diff --git a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_nefarian.cpp b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_nefarian.cpp index d91714c0246..808f381d197 100644 --- a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_nefarian.cpp +++ b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_nefarian.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -97,7 +97,7 @@ struct TRINITY_DLL_DECL boss_nefarianAI : public ScriptedAI DoScriptText(SAY_DEATH, m_creature); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { switch (rand()%3) { diff --git a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_razorgore.cpp b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_razorgore.cpp index 1da3fb554df..5267f1ef4b6 100644 --- a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_razorgore.cpp +++ b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_razorgore.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -55,7 +55,7 @@ struct TRINITY_DLL_DECL boss_razorgoreAI : public ScriptedAI m_creature->ApplySpellImmune(1, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { DoZoneInCombat(); } @@ -104,7 +104,7 @@ struct TRINITY_DLL_DECL boss_razorgoreAI : public ScriptedAI }else Conflagration_Timer -= diff; // Aura Check. If the gamer is affected by confliguration we attack a random gamer. - if (m_creature->getVictim()->HasAura(SPELL_CONFLAGRATION,0)) + if (m_creature->getVictim() && m_creature->getVictim()->HasAura(SPELL_CONFLAGRATION)) { Unit* target = NULL; target = SelectUnit(SELECT_TARGET_RANDOM,1); diff --git a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_vaelastrasz.cpp b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_vaelastrasz.cpp index f0048e7a4fa..ffba0ac8ef7 100644 --- a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_vaelastrasz.cpp +++ b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_vaelastrasz.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -98,7 +98,7 @@ struct TRINITY_DLL_DECL boss_vaelAI : public ScriptedAI DoScriptText(SAY_KILLTARGET, m_creature, victim); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { DoCast(m_creature,SPELL_ESSENCEOFTHERED); DoZoneInCombat(); @@ -223,7 +223,7 @@ void SendDefaultMenu_boss_vael(Player *player, Creature *_Creature, uint32 actio if (action == GOSSIP_ACTION_INFO_DEF + 1) //Fight time { player->CLOSE_GOSSIP_MENU(); - ((boss_vaelAI*)_Creature->AI())->BeginSpeach((Unit*)player); + CAST_AI(boss_vaelAI, _Creature->AI())->BeginSpeach(player); } } diff --git a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_victor_nefarius.cpp b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_victor_nefarius.cpp index 093ca7b901d..4b8a8b6ff23 100644 --- a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_victor_nefarius.cpp +++ b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_victor_nefarius.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -203,7 +203,7 @@ struct TRINITY_DLL_DECL boss_victor_nefariusAI : public ScriptedAI AttackStart(target); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } @@ -373,7 +373,7 @@ bool GossipSelect_boss_victor_nefarius(Player *player, Creature *_Creature, uint case GOSSIP_ACTION_INFO_DEF+3: player->CLOSE_GOSSIP_MENU(); DoScriptText(SAY_GAMESBEGIN_1, _Creature); - ((boss_victor_nefariusAI*)_Creature->AI())->BeginEvent(player); + CAST_AI(boss_victor_nefariusAI, _Creature->AI())->BeginEvent(player); break; } return true; diff --git a/src/bindings/scripts/scripts/zone/blackwing_lair/instance_blackwing_lair.cpp b/src/bindings/scripts/scripts/zone/blackwing_lair/instance_blackwing_lair.cpp index ddd9e8b9aa3..97bf717589a 100644 --- a/src/bindings/scripts/scripts/zone/blackwing_lair/instance_blackwing_lair.cpp +++ b/src/bindings/scripts/scripts/zone/blackwing_lair/instance_blackwing_lair.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 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 index 3617ae8cc14..263bdf67143 100644 --- 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 @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>.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 @@ -17,7 +17,7 @@ /* ScriptData SDName: Blades_Edge_Mountains SD%Complete: 90 -SDComment: Quest support: 10503, 10504, 10556, 10609, 10682, 10980. Ogri'la->Skettis Flight. (npc_daranelle needs bit more work before consider complete) +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 */ @@ -27,11 +27,20 @@ mobs_nether_drake npc_daranelle npc_overseer_nuaar npc_saikkal_the_elder -npc_skyguard_handler_irena +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 ######*/ @@ -45,14 +54,14 @@ struct TRINITY_DLL_DECL mobs_bladespire_ogreAI : public ScriptedAI { } - void Aggro(Unit* who) + void EnterCombat(Unit* who) { } void JustDied(Unit* Killer) { if (Killer->GetTypeId() == TYPEID_PLAYER) - ((Player*)Killer)->KilledMonster(19995, m_creature->GetGUID()); + CAST_PLR(Killer)->KilledMonster(19995, m_creature->GetGUID()); } }; CreatureAI* GetAI_mobs_bladespire_ogre(Creature *_Creature) @@ -96,154 +105,126 @@ struct TRINITY_DLL_DECL mobs_nether_drakeAI : public ScriptedAI void Reset() { - NihilSpeech_Timer = 2000; IsNihil = false; - if( m_creature->GetEntry() == ENTRY_NIHIL ) - { - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - IsNihil = true; - } - NihilSpeech_Phase = 1; + NihilSpeech_Timer = 3000; + NihilSpeech_Phase = 0; ArcaneBlast_Timer = 7500; ManaBurn_Timer = 10000; IntangiblePresence_Timer = 15000; } - void Aggro(Unit* who) { } + 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 ) + if (spell->Id == SPELL_T_PHASE_MODULATOR && caster->GetTypeId() == TYPEID_PLAYER) { - uint32 cEntry = 0; + 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; - switch( m_creature->GetEntry() ) + //we are nihil, so say before transform + if (m_creature->GetEntry() == ENTRY_NIHIL) { - case ENTRY_WHELP: - switch(rand()%4) - { - case 0: cEntry = ENTRY_PROTO; break; - case 1: cEntry = ENTRY_ADOLE; break; - case 2: cEntry = ENTRY_MATUR; break; - case 3: cEntry = ENTRY_NIHIL; break; - } - break; - case ENTRY_PROTO: - switch(rand()%3) - { - case 0: cEntry = ENTRY_ADOLE; break; - case 1: cEntry = ENTRY_MATUR; break; - case 2: cEntry = ENTRY_NIHIL; break; - } - break; - case ENTRY_ADOLE: - switch(rand()%3) - { - case 0: cEntry = ENTRY_PROTO; break; - case 1: cEntry = ENTRY_MATUR; break; - case 2: cEntry = ENTRY_NIHIL; break; - } - break; - case ENTRY_MATUR: - switch(rand()%3) - { - case 0: cEntry = ENTRY_PROTO; break; - case 1: cEntry = ENTRY_ADOLE; break; - case 2: cEntry = ENTRY_NIHIL; break; - } - break; - case ENTRY_NIHIL: - if( NihilSpeech_Phase ) - { - DoScriptText(SAY_NIHIL_INTERRUPT, m_creature); - IsNihil = false; - switch(rand()%3) - { - case 0: cEntry = ENTRY_PROTO; break; - case 1: cEntry = ENTRY_ADOLE; break; - case 2: cEntry = ENTRY_MATUR; break; - } - } - break; + DoScriptText(SAY_NIHIL_INTERRUPT, m_creature); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + IsNihil = false; } - if( cEntry ) + if (m_creature->UpdateEntry(entry_list[cid])) { - m_creature->UpdateEntry(cEntry); - - if( cEntry == ENTRY_NIHIL ) + if (entry_list[cid] == ENTRY_NIHIL) { - m_creature->InterruptNonMeleeSpells(true); - m_creature->RemoveAllAuras(); - m_creature->DeleteThreatList(); - m_creature->CombatStop(); - InCombat = false; - Reset(); - } + EnterEvadeMode(); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + IsNihil = true; + }else + AttackStart(caster); } } } void UpdateAI(const uint32 diff) { - if( IsNihil ) + if (IsNihil) { - if( NihilSpeech_Phase ) + if (NihilSpeech_Timer <= diff) { - if(NihilSpeech_Timer <= diff) + switch(NihilSpeech_Phase) { - switch( NihilSpeech_Phase ) - { - case 1: - DoScriptText(SAY_NIHIL_1, m_creature); - ++NihilSpeech_Phase; - break; - case 2: - DoScriptText(SAY_NIHIL_2, m_creature); - ++NihilSpeech_Phase; - break; - case 3: - DoScriptText(SAY_NIHIL_3, m_creature); - ++NihilSpeech_Phase; - break; - case 4: - DoScriptText(SAY_NIHIL_4, m_creature); - ++NihilSpeech_Phase; - break; - case 5: - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - // + MOVEMENTFLAG_LEVITATING - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT); - //then take off to random location. creature is initially summoned, so don't bother do anything else. - m_creature->GetMotionMaster()->MovePoint(0, m_creature->GetPositionX()+100, m_creature->GetPositionY(), m_creature->GetPositionZ()+100); - NihilSpeech_Phase = 0; - break; - } - NihilSpeech_Timer = 5000; - }else NihilSpeech_Timer -=diff; - } - return; //anything below here is not interesting for Nihil, so skip it + 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() ) + if (!UpdateVictim() ) return; - if( IntangiblePresence_Timer <= diff ) + if (IntangiblePresence_Timer <= diff) { DoCast(m_creature->getVictim(),SPELL_INTANGIBLE_PRESENCE); IntangiblePresence_Timer = 15000+rand()%15000; }else IntangiblePresence_Timer -= diff; - if( ManaBurn_Timer <= diff ) + if (ManaBurn_Timer <= diff) { Unit* target = m_creature->getVictim(); - if( target && target->getPowerType() == POWER_MANA ) + if (target && target->getPowerType() == POWER_MANA) DoCast(target,SPELL_MANA_BURN); ManaBurn_Timer = 8000+rand()%8000; }else ManaBurn_Timer -= diff; - if( ArcaneBlast_Timer <= diff ) + if (ArcaneBlast_Timer <= diff) { DoCast(m_creature->getVictim(),SPELL_ARCANE_BLAST); ArcaneBlast_Timer = 2500+rand()%5000; @@ -252,6 +233,7 @@ struct TRINITY_DLL_DECL mobs_nether_drakeAI : public ScriptedAI DoMeleeAttackIfReady(); } }; + CreatureAI* GetAI_mobs_nether_drake(Creature *_Creature) { return new mobs_nether_drakeAI (_Creature); @@ -261,30 +243,26 @@ CreatureAI* GetAI_mobs_nether_drake(Creature *_Creature) ## npc_daranelle ######*/ -#define SAY_DARANELLE -1000401 +#define SAY_SPELL_INFLUENCE -1000174 struct TRINITY_DLL_DECL npc_daranelleAI : public ScriptedAI { npc_daranelleAI(Creature *c) : ScriptedAI(c) {} - void Reset() - { - } + void Reset() { } - void Aggro(Unit* who) - { - } + void EnterCombat(Unit* who) { } void MoveInLineOfSight(Unit *who) { if (who->GetTypeId() == TYPEID_PLAYER) { - if(who->HasAura(36904,0)) + if (who->HasAura(36904) && m_creature->IsWithinDistInMap(who, 10.0f)) { - DoScriptText(SAY_DARANELLE, m_creature, who); + DoScriptText(SAY_SPELL_INFLUENCE, m_creature, who); //TODO: Move the below to updateAI and run if this statement == true - ((Player*)who)->KilledMonster(21511, m_creature->GetGUID()); - ((Player*)who)->RemoveAurasDueToSpell(36904); + CAST_PLR(who)->KilledMonster(21511, m_creature->GetGUID()); + CAST_PLR(who)->RemoveAurasDueToSpell(36904); } } @@ -301,12 +279,10 @@ CreatureAI* GetAI_npc_daranelle(Creature *_Creature) ## npc_overseer_nuaar ######*/ -#define GOSSIP_HON "Overseer, I am here to negotiate on behalf of the Cenarion Expedition." - bool GossipHello_npc_overseer_nuaar(Player *player, Creature *_Creature) { if (player->GetQuestStatus(10682) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM( 0, GOSSIP_HON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + player->ADD_GOSSIP_ITEM( 0, "Overseer, I am here to negotiate on behalf of the Cenarion Expedition.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); player->SEND_GOSSIP_MENU(10532, _Creature->GetGUID()); @@ -327,13 +303,10 @@ bool GossipSelect_npc_overseer_nuaar(Player *player, Creature *_Creature, uint32 ## npc_saikkal_the_elder ######*/ -#define GOSSIP_HSTE "Yes... yes, it's me." -#define GOSSIP_SSTE "Yes elder. Tell me more of the book." - bool GossipHello_npc_saikkal_the_elder(Player *player, Creature *_Creature) { if (player->GetQuestStatus(10980) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM( 0, GOSSIP_HSTE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + player->ADD_GOSSIP_ITEM( 0, "Yes... yes, it's me.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); player->SEND_GOSSIP_MENU(10794, _Creature->GetGUID()); @@ -345,7 +318,7 @@ bool GossipSelect_npc_saikkal_the_elder(Player *player, Creature *_Creature, uin switch (action) { case GOSSIP_ACTION_INFO_DEF+1: - player->ADD_GOSSIP_ITEM( 0, GOSSIP_SSTE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + player->ADD_GOSSIP_ITEM( 0, "Yes elder. Tell me more of the book.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); player->SEND_GOSSIP_MENU(10795, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF+2: @@ -357,38 +330,45 @@ bool GossipSelect_npc_saikkal_the_elder(Player *player, Creature *_Creature, uin } /*###### -## npc_skyguard_handler_irena +## go_legion_obelisk ######*/ -#define GOSSIP_SKYGUARD "Fly me to Skettis please" - -bool GossipHello_npc_skyguard_handler_irena(Player *player, Creature *_Creature ) -{ - if (_Creature->isQuestGiver()) - player->PrepareQuestMenu( _Creature->GetGUID() ); - - if (player->GetReputationRank(1031) >= REP_HONORED) - player->ADD_GOSSIP_ITEM( 2, GOSSIP_SKYGUARD, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - - player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID()); - - return true; -} - -bool GossipSelect_npc_skyguard_handler_irena(Player *player, Creature *_Creature, uint32 sender, uint32 action ) -{ - if (action == GOSSIP_ACTION_INFO_DEF+1) - { - player->CLOSE_GOSSIP_MENU(); - - std::vector<uint32> nodes; - - nodes.resize(2); - nodes[0] = 172; //from ogri'la - nodes[1] = 171; //end at skettis - player->ActivateTaxiPathTo(nodes); //TaxiPath 706 - } - return true; +bool GOHello_go_legion_obelisk(Player *player, GameObject* _GO) +{ + if ( player->GetQuestStatus(10821) == QUEST_STATUS_INCOMPLETE ) + { + switch( _GO->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 ) + { + _GO->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; } /*###### @@ -425,11 +405,10 @@ void AddSC_blades_edge_mountains() newscript->pGossipHello = &GossipHello_npc_saikkal_the_elder; newscript->pGossipSelect = &GossipSelect_npc_saikkal_the_elder; newscript->RegisterSelf(); - + newscript = new Script; - newscript->Name="npc_skyguard_handler_irena"; - newscript->pGossipHello = &GossipHello_npc_skyguard_handler_irena; - newscript->pGossipSelect = &GossipSelect_npc_skyguard_handler_irena; + 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 index 954792a1044..432633e90fe 100644 --- a/src/bindings/scripts/scripts/zone/blasted_lands/blasted_lands.cpp +++ b/src/bindings/scripts/scripts/zone/blasted_lands/blasted_lands.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 diff --git a/src/bindings/scripts/scripts/zone/blasted_lands/boss_kruul.cpp b/src/bindings/scripts/scripts/zone/blasted_lands/boss_kruul.cpp index f186a58252c..525570e37e2 100644 --- a/src/bindings/scripts/scripts/zone/blasted_lands/boss_kruul.cpp +++ b/src/bindings/scripts/scripts/zone/blasted_lands/boss_kruul.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -58,7 +58,7 @@ struct TRINITY_DLL_DECL boss_kruulAI : public ScriptedAI Hound_Timer = 8000; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } @@ -87,7 +87,7 @@ struct TRINITY_DLL_DECL boss_kruulAI : public ScriptedAI Rand = 0; Summoned = DoSpawnCreature(19207, RandX, RandY, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); if(Summoned) - ((CreatureAI*)Summoned->AI())->AttackStart(victim); + (Summoned->AI())->AttackStart(victim); } void UpdateAI(const uint32 diff) diff --git a/src/bindings/scripts/scripts/zone/bloodmyst_isle/bloodmyst_isle.cpp b/src/bindings/scripts/scripts/zone/bloodmyst_isle/bloodmyst_isle.cpp index e7ce3b95c42..b9660576097 100644 --- a/src/bindings/scripts/scripts/zone/bloodmyst_isle/bloodmyst_isle.cpp +++ b/src/bindings/scripts/scripts/zone/bloodmyst_isle/bloodmyst_isle.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -43,7 +43,7 @@ struct TRINITY_DLL_DECL mob_webbed_creatureAI : public ScriptedAI { } - void Aggro(Unit* who) + void EnterCombat(Unit* who) { } @@ -56,7 +56,7 @@ struct TRINITY_DLL_DECL mob_webbed_creatureAI : public ScriptedAI case 0: spawnCreatureID = 17681; if (Killer->GetTypeId() == TYPEID_PLAYER) - ((Player*)Killer)->KilledMonster(spawnCreatureID, m_creature->GetGUID()); + CAST_PLR(Killer)->KilledMonster(spawnCreatureID, m_creature->GetGUID()); break; case 1: case 2: @@ -81,7 +81,7 @@ CreatureAI* GetAI_mob_webbed_creature(Creature *_Creature) bool GossipHello_npc_captured_sunhawk_agent(Player *player, Creature *_Creature) { - if (player->HasAura(31609,1) && player->GetQuestStatus(9756) == QUEST_STATUS_INCOMPLETE) + if (player->HasAura(31609) && player->GetQuestStatus(9756) == QUEST_STATUS_INCOMPLETE) { player->ADD_GOSSIP_ITEM( 0, "[PH] ", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); player->SEND_GOSSIP_MENU(9136, _Creature->GetGUID()); diff --git a/src/bindings/scripts/scripts/zone/borean_tundra/borean_tundra.cpp b/src/bindings/scripts/scripts/zone/borean_tundra/borean_tundra.cpp new file mode 100644 index 00000000000..c776c1f9271 --- /dev/null +++ b/src/bindings/scripts/scripts/zone/borean_tundra/borean_tundra.cpp @@ -0,0 +1,105 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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: Borean_Tundra +SD%Complete: 100 +SDComment: +SDCategory: Borean Tundra +EndScriptData */ + +/* ContentData +npc_tiare +npc_surristrasz +EndContentData */ + +#include "precompiled.h" + +/*###### +## npc_tiare +######*/ + +#define GOSSIP_ITEM_TELEPORT "Teleport me to Amber Ledge, please." + +bool GossipHello_npc_tiare(Player *player, Creature *_Creature) +{ + player->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_TELEPORT, GOSSIP_SENDER_MAIN, GOSSIP_OPTION_GOSSIP); + player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID()); + return true; +} + +bool GossipSelect_npc_tiare(Player *player, Creature *_Creature, uint32 sender, uint32 action) +{ + if (action == GOSSIP_OPTION_GOSSIP) + { + player->CLOSE_GOSSIP_MENU(); + player->CastSpell(player,50135,true); + } + 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?" + +bool GossipHello_npc_surristrasz(Player *player, Creature *_Creature) +{ + if (_Creature->isQuestGiver()) + player->PrepareQuestMenu(_Creature->GetGUID()); + + if (_Creature->isTaxi()) + { + player->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_FREE_FLIGHT, GOSSIP_SENDER_MAIN, GOSSIP_OPTION_GOSSIP); + player->ADD_GOSSIP_ITEM(2, GOSSIP_ITEM_FLIGHT, GOSSIP_SENDER_MAIN, GOSSIP_OPTION_TAXIVENDOR); + } + + player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID()); + return true; +} + +bool GossipSelect_npc_surristrasz(Player *player, Creature *_Creature, uint32 sender, uint32 action) +{ + if (action == GOSSIP_OPTION_GOSSIP) + { + player->CLOSE_GOSSIP_MENU(); + player->CastSpell(player,46064,true); //TaxiPath 795 (amber to coldarra) + } + if (action == GOSSIP_OPTION_TAXIVENDOR) + { + player->GetSession()->SendTaxiMenu(_Creature); + } + return true; +} + +void AddSC_borean_tundra() +{ + Script *newscript; + + 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_surristrasz"; + newscript->pGossipHello = &GossipHello_npc_surristrasz; + newscript->pGossipSelect = &GossipSelect_npc_surristrasz; + 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 index 0458e495959..b66f4217851 100644 --- a/src/bindings/scripts/scripts/zone/burning_steppes/burning_steppes.cpp +++ b/src/bindings/scripts/scripts/zone/burning_steppes/burning_steppes.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -52,19 +52,19 @@ struct TRINITY_DLL_DECL npc_ragged_johnAI : public ScriptedAI void MoveInLineOfSight(Unit *who) { - if( who->HasAura(16468,0) ) + if( who->HasAura(16468) ) { if( who->GetTypeId() == TYPEID_PLAYER && m_creature->IsWithinDistInMap(who, 15) && who->isInAccessiblePlaceFor(m_creature) ) { DoCast(who,16472); - ((Player*)who)->AreaExploredOrEventHappens(4866); + CAST_PLR(who)->AreaExploredOrEventHappens(4866); } } ScriptedAI::MoveInLineOfSight(who); } - void Aggro(Unit *who) {} + void EnterCombat(Unit *who) {} }; CreatureAI* GetAI_npc_ragged_john(Creature *_Creature) diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/boss_epoch.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/boss_epoch.cpp new file mode 100644 index 00000000000..43c855aa366 --- /dev/null +++ b/src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/boss_epoch.cpp @@ -0,0 +1,86 @@ +/* Script Data Start +SDName: Boss epoch +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = '' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_CURSE_OF_EXERTION 52772 +#define SPELL_TIME_WARP 52766 //Time slows down, reducing attack, casting and movement speed by 70% for 6 sec. +#define SPELL_TIME_STOP 58848 //Stops time in a 50 yard sphere for 2 sec. +#define SPELL_WOUNDING_STRIKE_N 52771 //Used only on the tank +#define SPELL_WOUNDING_STRIKE_H 58830 + +//Say +#define SAY_INTRO -1595000 //"Prince Arthas Menethil, on this day, a powerful darkness has taken hold of your soul. The death you are destined to visit upon others will this day be your own." +#define SAY_AGGRO -1595001 //"We'll see about that, young prince." +#define SAY_TIME_WARP_1 -1595002 //"Tick tock, tick tock..." +#define SAY_TIME_WARP_2 -1595003 //"Not quick enough!" +#define SAY_TIME_WARP_3 -1595004 //"Let's get this over with. " +#define SAY_SLAY_1 -1595005 //"There is no future for you." +#define SAY_SLAY_2 -1595006 //"This is the hour of our greatest triumph!" +#define SAY_SLAY_3 -1595007 //"You were destined to fail. " +#define SAY_DEATH -1595008 //"*gurgles*" + +struct TRINITY_DLL_DECL boss_epochAI : public ScriptedAI +{ + boss_epochAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if(!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + + switch(rand()%3) + { + case 0:DoScriptText(SAY_SLAY_1, m_creature);break; + case 1:DoScriptText(SAY_SLAY_2, m_creature);break; + case 2:DoScriptText(SAY_SLAY_3, m_creature);break; + } + } +}; + +CreatureAI* GetAI_boss_epoch(Creature *_Creature) +{ + return new boss_epochAI (_Creature); +} + +void AddSC_boss_epoch() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_epoch"; + newscript->GetAI = &GetAI_boss_epoch; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/boss_mal_ganis.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/boss_mal_ganis.cpp new file mode 100644 index 00000000000..c2780950a57 --- /dev/null +++ b/src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/boss_mal_ganis.cpp @@ -0,0 +1,123 @@ +/* Script Data Start +SDName: Boss mal_ganis +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = 'boss_mal_ganis' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_CARRION_SWARM_N 52720 //A cresting wave of chaotic magic splashes over enemies in front of the caster, dealing 3230 to 3570 Shadow damage and 380 to 420 Shadow damage every 3 sec. for 15 sec. +#define SPELL_CARRION_SWARM_H 58852 +#define SPELL_MIND_BLAST_N 52722 //Inflicts 4163 to 4837 Shadow damage to an enemy. +#define SPELL_MIND_BLAST_H 58850 +#define SPELL_SLEEP 52721 //Puts an enemy to sleep for up to 10 sec. Any damage caused will awaken the target. +#define SPELL_VAMPIRIC_TOUCH 52723 //Heals the caster for half the damage dealt by a melee attack. + +//Yell Mal'ganis +#define SAY_INTRO_1 -1595009 +#define SAY_INTRO_2 -1595010 +#define SAY_OUTRO -1595011 +#define SAY_AGGRO -1595012 +#define SAY_KILL_1 -1595013 +#define SAY_KILL_2 -1595014 +#define SAY_KILL_3 -1595015 +#define SAY_SLAY_1 -1595016 +#define SAY_SLAY_2 -1595017 +#define SAY_SLAY_3 -1595018 +#define SAY_SLAY_4 -1595019 +#define SAY_SLEEP_1 -1595020 +#define SAY_SLEEP_2 -1595021 +#define SAY_30HEALTH -1595022 +#define SAY_15HEALTH -1595023 +#define SAY_ESCAPE_SPEECH_1 -1595024 +#define SAY_ESCAPE_SPEECH_2 -1595025 + +struct TRINITY_DLL_DECL boss_mal_ganisAI : public ScriptedAI +{ + boss_mal_ganisAI(Creature *c) : ScriptedAI(c) {} + + bool yelled, + yelled2, + yelled3; + + void Reset() + { + yelled = false; + yelled2 = false; + yelled3 = false; + } + + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if(!UpdateVictim()) + return; + + if(!yelled) + { + if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 30) + { + DoScriptText(SAY_30HEALTH, m_creature); + yelled = true; + } + } + + if(!yelled2) + { + if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 15) + { + DoScriptText(SAY_15HEALTH, m_creature); + yelled2 = true; + } + } + + if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 1) + { + //Handle Escape Event + } + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) {} + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + + switch(rand()%4) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature);break; + case 1: DoScriptText(SAY_SLAY_2, m_creature);break; + case 2: DoScriptText(SAY_SLAY_3, m_creature);break; + case 3: DoScriptText(SAY_SLAY_4, m_creature);break; + } + } +}; + +CreatureAI* GetAI_boss_mal_ganis(Creature *_Creature) +{ + return new boss_mal_ganisAI (_Creature); +} + +void AddSC_boss_mal_ganis() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_mal_ganis"; + newscript->GetAI = &GetAI_boss_mal_ganis; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/boss_meathook.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/boss_meathook.cpp new file mode 100644 index 00000000000..4f2c2e07610 --- /dev/null +++ b/src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/boss_meathook.cpp @@ -0,0 +1,138 @@ +/* Script Data Start +SDName: Boss meathook +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = 'boss_meathook' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spell +#define SPELL_CONSTRICTING_CHAINS_N 52696 //Encases the targets in chains, dealing 1800 Physical damage every 1 sec. and stunning the target for 5 sec. +#define SPELL_CONSTRICTING_CHAINS_H 58823 +#define SPELL_DISEASE_EXPULSION_N 52666 //Meathook belches out a cloud of disease, dealing 1710 to 1890 Nature damage and interrupting the spell casting of nearby enemy targets for 4 sec. +#define SPELL_DISEASE_EXPULSION_H 58824 +#define SPELL_FRENZY 58841 //Increases the caster's Physical damage by 10% for 30 sec. + +//Yell +#define SAY_AGGRO -1595026 +#define SAY_SLAY_1 -1595027 +#define SAY_SLAY_2 -1595028 +#define SAY_SLAY_3 -1595029 +#define SAY_SPAWN -1595030 +#define SAY_DEATH -1595031 + +struct TRINITY_DLL_DECL boss_meathookAI : public ScriptedAI +{ + boss_meathookAI(Creature *c) : ScriptedAI(c) {} + + uint32 Chain_Timer, + Disease_Timer, + Frenzy_Timer; + + void Reset() + { + Chain_Timer = 12000 + rand()%5000; //seen on video 13, 17, 15, 12, 16 + Disease_Timer = 2000 + rand()%1000; //approx 3s + Frenzy_Timer = 20000 + rand()%10000; //made it up + } + + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + + void AttackStart(Unit* who) {} + + std::list <Unit*>pList; + void MoveInLineOfSight(Unit* who, const uint32 diff) + { + /*if (m_creature->isHostileTo(who)) + { + pList.append(who); + }*/ + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if(!UpdateVictim()) + return; + + if(Disease_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_DISEASE_EXPULSION_N); + Disease_Timer = 1500 + rand()%2500; + }else Disease_Timer -= diff; + + if(Frenzy_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_FRENZY); + Frenzy_Timer = 20000 + rand()%10000; + }else Frenzy_Timer -= diff; + + if(Chain_Timer < diff) + { + + /* + std::list<HostilReference*>& m_threatlist = m_creature->getThreatManager().getThreatList(); + std::list<HostilReference*>::iterator itr; + + int st=0; + for(itr = m_threatlist.begin(); itr != m_threatlist.end(); ++itr) + { + //st++; + m_creature->getThreatManager(). + } + Unit* targets[st]; + int st2=0; + for(int i=1; i<=st; i++){ + if(!IsWithinLOSInMap(targets[i]) + st2++; + } + Unit* targets_out_of_LOS[st2];*/ + + DoCast(SelectUnit(SELECT_TARGET_RANDOM, 1), SPELL_CONSTRICTING_CHAINS_N); //anyone but the tank + Chain_Timer = 2000 + rand()%1000; + }else Chain_Timer -= diff; + + DoMeleeAttackIfReady(); + } + + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature);break; + case 1: DoScriptText(SAY_SLAY_2, m_creature);break; + case 2: DoScriptText(SAY_SLAY_3, m_creature);break; + } + } +}; + +CreatureAI* GetAI_boss_meathook(Creature *_Creature) +{ + return new boss_meathookAI (_Creature); +} + +void AddSC_boss_meathook() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_meathook"; + newscript->GetAI = &GetAI_boss_meathook; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/boss_salramm.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/boss_salramm.cpp new file mode 100644 index 00000000000..8111a0a3aa7 --- /dev/null +++ b/src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/boss_salramm.cpp @@ -0,0 +1,155 @@ +/* Script Data Start +SDName: Boss salramm +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = 'boss_salramm' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_CURSE_OF_TWISTED_FLESH 58845 +#define SPELL_EXPLODE_GHOUL_N 52480 +#define SPELL_EXPLODE_GHOUL_H 58825 +#define SPELL_SHADOW_BOLT_N 57725 +#define SPELL_SHADOW_BOLT_H 58828 +#define SPELL_STEAL_FLESH 52708 +#define SPELL_SUMMON_GHOULS 52451 + +//Yell +#define SAY_AGGRO -1595032 +#define SAY_SPAWN -1595033 +#define SAY_SLAY_1 -1595034 +#define SAY_SLAY_2 -1595035 +#define SAY_SLAY_3 -1595036 +#define SAY_DEATH -1595037 +#define SAY_EXPLODE_GHOUL_1 -1595038 +#define SAY_EXPLODE_GHOUL_2 -1595039 +#define SAY_STEAL_FLESH_1 -1595040 +#define SAY_STEAL_FLESH_2 -1595041 +#define SAY_STEAL_FLESH_3 -1595042 +#define SAY_SUMMON_GHOULS_1 -1595043 +#define SAY_SUMMON_GHOULS_2 -1595044 + +struct TRINITY_DLL_DECL boss_salrammAI : public ScriptedAI +{ + boss_salrammAI(Creature *c) : ScriptedAI(c) {} + + uint32 Curse_flesh_Timer, + Explode_ghoul_Timer, + Shadow_bolt_Timer, + Steal_flesh_Timer, + Summon_ghouls_Timer; + + void Reset() + { + Curse_flesh_Timer = 30000; //30s DBM + Explode_ghoul_Timer = 25000 + rand()%3000; //approx 6 sec after summon ghouls + Shadow_bolt_Timer = 8000 + rand()%4000; // approx 10s + Steal_flesh_Timer = 12345; + Summon_ghouls_Timer = 19000 + rand()%5000; //on a video approx 24s after aggro + } + + void EnterCombat(Unit* who) + {DoScriptText(SAY_AGGRO, m_creature);} + + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if(!UpdateVictim()) + return; + + Unit* random_target = SelectUnit(SELECT_TARGET_RANDOM, 0); + + //Curse of twisted flesh timer + if (Curse_flesh_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_CURSE_OF_TWISTED_FLESH); + Curse_flesh_Timer = 37000; + }else Curse_flesh_Timer -= diff; + + //Shadow bolt timer + if (Shadow_bolt_Timer < diff) + { + if(random_target) + DoCast(random_target,SPELL_SHADOW_BOLT_N); + Shadow_bolt_Timer = 8000 + rand()%4000; + }else Shadow_bolt_Timer -= diff; + + //Steal Flesh timer + if (Steal_flesh_Timer < diff) + { + switch(rand()%3) + { + case 0: + DoScriptText(SAY_STEAL_FLESH_1, m_creature); + break; + case 1: + DoScriptText(SAY_STEAL_FLESH_2, m_creature); + break; + case 2: + DoScriptText(SAY_STEAL_FLESH_3, m_creature); + break; + } + if(random_target) + DoCast(random_target,SPELL_STEAL_FLESH); + Steal_flesh_Timer = 10000; + }else Steal_flesh_Timer -= diff; + + //Summon ghouls timer + if (Summon_ghouls_Timer < diff) + { + switch(rand()%2) + { + case 0: + DoScriptText(SAY_SUMMON_GHOULS_1, m_creature); + break; + case 1: + DoScriptText(SAY_SUMMON_GHOULS_2, m_creature); + break; + } + if(random_target) + DoCast(random_target,SPELL_SUMMON_GHOULS); + Summon_ghouls_Timer = 10000; + }else Summon_ghouls_Timer -= diff; + + DoMeleeAttackIfReady(); + } + + void JustDied(Unit* killer) + {DoScriptText(SAY_DEATH, m_creature);} + + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature);break; + case 1: DoScriptText(SAY_SLAY_2, m_creature);break; + case 2: DoScriptText(SAY_SLAY_3, m_creature);break; + } + } +}; + +CreatureAI* GetAI_boss_salramm(Creature *_Creature) +{ + return new boss_salrammAI (_Creature); +} + +void AddSC_boss_salramm() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_salramm"; + newscript->GetAI = &GetAI_boss_salramm; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/def_culling_of_stratholme.h b/src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/def_culling_of_stratholme.h new file mode 100644 index 00000000000..849549e8f99 --- /dev/null +++ b/src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/def_culling_of_stratholme.h @@ -0,0 +1,4 @@ +#ifndef DEF_CULLING_OF_STRATHOLME_H +#define DEF_CULLING_OF_STRATHOLME_H + +#endif diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/instance_culling_of_stratholme.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/instance_culling_of_stratholme.cpp new file mode 100644 index 00000000000..e6922d072b3 --- /dev/null +++ b/src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/instance_culling_of_stratholme.cpp @@ -0,0 +1,21 @@ +#include "precompiled.h" +#include "def_culling_of_stratholme.h" + +struct TRINITY_DLL_DECL instance_culling_of_stratholme : public ScriptedInstance +{ + instance_culling_of_stratholme(Map *Map) : ScriptedInstance(Map) {Initialize();}; +}; + +InstanceData* GetInstanceData_instance_culling_of_stratholme(Map* map) +{ + return new instance_culling_of_stratholme(map); +} + +void AddSC_instance_culling_of_stratholme() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_culling_of_stratholme"; + newscript->GetInstanceData = &GetInstanceData_instance_culling_of_stratholme; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_aeonus.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_aeonus.cpp index 7a2e8239cac..56a99619504 100644 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_aeonus.cpp +++ b/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_aeonus.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -42,7 +42,7 @@ struct TRINITY_DLL_DECL boss_aeonusAI : public ScriptedAI { boss_aeonusAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); HeroicMode = m_creature->GetMap()->IsHeroic(); } @@ -60,7 +60,7 @@ struct TRINITY_DLL_DECL boss_aeonusAI : public ScriptedAI Frenzy_Timer = 120000; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { DoScriptText(SAY_AGGRO, m_creature); } diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_chrono_lord_deja.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_chrono_lord_deja.cpp index dc8723b7201..7745c0c56c9 100644 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_chrono_lord_deja.cpp +++ b/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_chrono_lord_deja.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -42,7 +42,7 @@ struct TRINITY_DLL_DECL boss_chrono_lord_dejaAI : public ScriptedAI { boss_chrono_lord_dejaAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); HeroicMode = m_creature->GetMap()->IsHeroic(); } @@ -58,7 +58,7 @@ struct TRINITY_DLL_DECL boss_chrono_lord_dejaAI : public ScriptedAI TimeLapse_Timer = 15000; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { DoScriptText(SAY_AGGRO, m_creature); } diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_temporus.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_temporus.cpp index 1efa7c75a2c..74264aef142 100644 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_temporus.cpp +++ b/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_temporus.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -41,7 +41,7 @@ struct TRINITY_DLL_DECL boss_temporusAI : public ScriptedAI { boss_temporusAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); HeroicMode = m_creature->GetMap()->IsHeroic(); } @@ -60,7 +60,7 @@ struct TRINITY_DLL_DECL boss_temporusAI : public ScriptedAI SpellReflection_Timer = 40000; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { DoScriptText(SAY_AGGRO, m_creature); } diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/dark_portal.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/dark_portal.cpp index e64a867a641..740e3d221f6 100644 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/dark_portal.cpp +++ b/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/dark_portal.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -58,7 +58,7 @@ struct TRINITY_DLL_DECL npc_medivh_bmAI : public ScriptedAI { npc_medivh_bmAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } ScriptedInstance *pInstance; @@ -79,8 +79,8 @@ struct TRINITY_DLL_DECL npc_medivh_bmAI : public ScriptedAI if (pInstance->GetData(TYPE_MEDIVH) == IN_PROGRESS) m_creature->CastSpell(m_creature,SPELL_CHANNEL,true); - else if (m_creature->HasAura(SPELL_CHANNEL,0)) - m_creature->RemoveAura(SPELL_CHANNEL,0); + else if (m_creature->HasAura(SPELL_CHANNEL)) + m_creature->RemoveAura(SPELL_CHANNEL); m_creature->CastSpell(m_creature,SPELL_PORTAL_RUNE,true); } @@ -92,7 +92,7 @@ struct TRINITY_DLL_DECL npc_medivh_bmAI : public ScriptedAI if (who->GetTypeId() == TYPEID_PLAYER && m_creature->IsWithinDistInMap(who, 10.0f)) { - if (pInstance->GetData(TYPE_MEDIVH) == IN_PROGRESS) + if (pInstance->GetData(TYPE_MEDIVH) == IN_PROGRESS || pInstance->GetData(TYPE_MEDIVH) == DONE) return; DoScriptText(SAY_INTRO, m_creature); @@ -127,7 +127,7 @@ struct TRINITY_DLL_DECL npc_medivh_bmAI : public ScriptedAI //ScriptedAI::AttackStart(who); } - void Aggro(Unit *who) {} + void EnterCombat(Unit *who) {} void SpellHit(Unit* caster, const SpellEntry* spell) { @@ -156,13 +156,13 @@ struct TRINITY_DLL_DECL npc_medivh_bmAI : public ScriptedAI if (SpellCorrupt_Timer) { - if (SpellCorrupt_Timer < diff) + if (SpellCorrupt_Timer <= diff) { pInstance->SetData(TYPE_MEDIVH,SPECIAL); - if (m_creature->HasAura(SPELL_CORRUPT_AEONUS,0)) + if (m_creature->HasAura(SPELL_CORRUPT_AEONUS)) SpellCorrupt_Timer = 1000; - else if (m_creature->HasAura(SPELL_CORRUPT,0)) + else if (m_creature->HasAura(SPELL_CORRUPT)) SpellCorrupt_Timer = 3000; else SpellCorrupt_Timer = 0; @@ -171,7 +171,7 @@ struct TRINITY_DLL_DECL npc_medivh_bmAI : public ScriptedAI if (Check_Timer) { - if (Check_Timer < diff) + if (Check_Timer <= diff) { uint32 pct = pInstance->GetData(DATA_SHIELD); @@ -181,7 +181,6 @@ struct TRINITY_DLL_DECL npc_medivh_bmAI : public ScriptedAI { DoScriptText(SAY_WEAK25, m_creature); Life25 = false; - Check_Timer = 0; } else if (Life50 && pct <= 50) { @@ -203,11 +202,16 @@ struct TRINITY_DLL_DECL npc_medivh_bmAI : public ScriptedAI return; } - if (pInstance->GetData(TYPE_MEDIVH) == DONE) + if (pInstance->GetData(TYPE_RIFT) == DONE) { DoScriptText(SAY_WIN, m_creature); Check_Timer = 0; + + if (m_creature->HasAura(SPELL_CHANNEL)) + m_creature->RemoveAura(SPELL_CHANNEL); + //TODO: start the post-event here + pInstance->SetData(TYPE_MEDIVH,DONE); } }else Check_Timer -= diff; } @@ -240,7 +244,7 @@ struct TRINITY_DLL_DECL npc_time_riftAI : public ScriptedAI { npc_time_riftAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } ScriptedInstance *pInstance; @@ -268,7 +272,7 @@ struct TRINITY_DLL_DECL npc_time_riftAI : public ScriptedAI else mWaveId = 1; } - void Aggro(Unit *who) {} + void EnterCombat(Unit *who) {} void DoSummonAtRift(uint32 creature_entry) { @@ -334,7 +338,8 @@ struct TRINITY_DLL_DECL npc_time_riftAI : public ScriptedAI debug_log("TSCR: npc_time_rift: not casting anylonger, i need to die."); m_creature->setDeathState(JUST_DIED); - pInstance->SetData(TYPE_RIFT,SPECIAL); + if (pInstance->GetData(TYPE_RIFT) == IN_PROGRESS) + pInstance->SetData(TYPE_RIFT,SPECIAL); } }; diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/def_dark_portal.h b/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/def_dark_portal.h index 61018f58118..7bfd8c917d7 100644 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/def_dark_portal.h +++ b/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/def_dark_portal.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * This program is free software licensed under GPL version 2 * Please see the included DOCS/LICENSE.TXT for more information */ diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/instance_dark_portal.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/instance_dark_portal.cpp index 830917a7ad1..697134cd82d 100644 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/instance_dark_portal.cpp +++ b/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/instance_dark_portal.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -227,6 +227,7 @@ struct TRINITY_DLL_DECL instance_dark_portal : public ScriptedInstance //this may be completed further out in the post-event if (Unit *medivh = Unit::GetUnit(*player,MedivhGUID)) { + debug_log("TSCR: Instance Dark Portal: Event completed."); player->GroupEventHappens(QUEST_OPENING_PORTAL,medivh); player->GroupEventHappens(QUEST_MASTER_TOUCH,medivh); } @@ -302,11 +303,10 @@ struct TRINITY_DLL_DECL instance_dark_portal : public ScriptedInstance if (Unit *medivh = Unit::GetUnit(*player,MedivhGUID)) { - for(uint8 i = 0; i < 4; i++) - { - int tmp = rand()%4; - if (tmp != CurrentRiftId) - { + int tmp = rand()%(4-1); + + if (tmp >= CurrentRiftId) + tmp++; debug_log("TSCR: Instance Dark Portal: Creating Time Rift at locationId %i (old locationId was %u).",tmp,CurrentRiftId); CurrentRiftId = tmp; @@ -334,9 +334,6 @@ struct TRINITY_DLL_DECL instance_dark_portal : public ScriptedInstance } } } - break; - } - } } } @@ -354,7 +351,7 @@ struct TRINITY_DLL_DECL instance_dark_portal : public ScriptedInstance if (NextPortal_Timer) { - if (NextPortal_Timer < diff) + if (NextPortal_Timer <= diff) { ++mRiftPortalCount; UpdateBMWorldState(WORLD_STATE_BM_RIFT,mRiftPortalCount); diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_anetheron.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_anetheron.cpp index 3b51b941d1f..e4016707a99 100644 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_anetheron.cpp +++ b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_anetheron.cpp @@ -40,10 +40,10 @@ struct TRINITY_DLL_DECL boss_anetheronAI : public hyjal_trashAI { boss_anetheronAI(Creature *c) : hyjal_trashAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); go = false; pos = 0; - SpellEntry *TempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_SLEEP); + SpellEntry *TempSpell = GET_SPELL(SPELL_SLEEP); if(TempSpell && TempSpell->EffectImplicitTargetA[0] != 1) { TempSpell->EffectImplicitTargetA[0] = 1; @@ -70,7 +70,7 @@ struct TRINITY_DLL_DECL boss_anetheronAI : public hyjal_trashAI pInstance->SetData(DATA_ANETHERONEVENT, NOT_STARTED); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { if(pInstance && IsEvent) pInstance->SetData(DATA_ANETHERONEVENT, IN_PROGRESS); @@ -128,16 +128,16 @@ struct TRINITY_DLL_DECL boss_anetheronAI : public hyjal_trashAI go = true; if(pInstance) { - ((npc_escortAI*)(m_creature->AI()))->AddWaypoint(0, 4896.08, -1576.35, 1333.65); - ((npc_escortAI*)(m_creature->AI()))->AddWaypoint(1, 4898.68, -1615.02, 1329.48); - ((npc_escortAI*)(m_creature->AI()))->AddWaypoint(2, 4907.12, -1667.08, 1321.00); - ((npc_escortAI*)(m_creature->AI()))->AddWaypoint(3, 4963.18, -1699.35, 1340.51); - ((npc_escortAI*)(m_creature->AI()))->AddWaypoint(4, 4989.16, -1716.67, 1335.74); - ((npc_escortAI*)(m_creature->AI()))->AddWaypoint(5, 5026.27, -1736.89, 1323.02); - ((npc_escortAI*)(m_creature->AI()))->AddWaypoint(6, 5037.77, -1770.56, 1324.36); - ((npc_escortAI*)(m_creature->AI()))->AddWaypoint(7, 5067.23, -1789.95, 1321.17); - ((npc_escortAI*)(m_creature->AI()))->Start(false, true, true); - ((npc_escortAI*)(m_creature->AI()))->SetDespawnAtEnd(false); + AddWaypoint(0, 4896.08, -1576.35, 1333.65); + AddWaypoint(1, 4898.68, -1615.02, 1329.48); + AddWaypoint(2, 4907.12, -1667.08, 1321.00); + AddWaypoint(3, 4963.18, -1699.35, 1340.51); + AddWaypoint(4, 4989.16, -1716.67, 1335.74); + AddWaypoint(5, 5026.27, -1736.89, 1323.02); + AddWaypoint(6, 5037.77, -1770.56, 1324.36); + AddWaypoint(7, 5067.23, -1789.95, 1321.17); + Start(false, true, true); + SetDespawnAtEnd(false); } } } @@ -148,7 +148,7 @@ struct TRINITY_DLL_DECL boss_anetheronAI : public hyjal_trashAI if(SwarmTimer < diff) { - Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0,100,true); + Unit* target = SelectTarget(SELECT_TARGET_RANDOM,0,100,true); if(target) DoCast(target,SPELL_CARRION_SWARM); @@ -170,7 +170,7 @@ struct TRINITY_DLL_DECL boss_anetheronAI : public hyjal_trashAI { for(uint8 i=0;i<3;++i) { - Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0,100,true); + Unit* target = SelectTarget(SELECT_TARGET_RANDOM,0,100,true); if(target) target->CastSpell(target,SPELL_SLEEP,true); } @@ -194,7 +194,7 @@ struct TRINITY_DLL_DECL boss_anetheronAI : public hyjal_trashAI }else AuraTimer -= diff; if(InfernoTimer < diff) { - DoCast(SelectUnit(SELECT_TARGET_RANDOM,0,100,true), SPELL_INFERNO); + DoCast(SelectTarget(SELECT_TARGET_RANDOM,0,100,true), SPELL_INFERNO); InfernoTimer = 45000; switch(rand()%2) { @@ -225,7 +225,7 @@ struct TRINITY_DLL_DECL mob_towering_infernalAI : public ScriptedAI { mob_towering_infernalAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); if(pInstance) AnetheronGUID = pInstance->GetData64(DATA_ANETHERON); } @@ -242,7 +242,7 @@ struct TRINITY_DLL_DECL mob_towering_infernalAI : public ScriptedAI CheckTimer = 5000; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } @@ -259,11 +259,8 @@ struct TRINITY_DLL_DECL mob_towering_infernalAI : public ScriptedAI void MoveInLineOfSight(Unit *who) { - if (m_creature->GetDistance(who) <= 50 && !InCombat && m_creature->IsHostileTo(who)) - { - m_creature->AddThreat(who,0.0); - m_creature->Attack(who,false); - } + if (m_creature->GetDistance(who) <= 50 && !m_creature->isInCombat() && m_creature->IsHostileTo(who)) + AttackStart(who); } void UpdateAI(const uint32 diff) diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_archimonde.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_archimonde.cpp index 4476a47d04c..6b6529b292e 100644 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_archimonde.cpp +++ b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_archimonde.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -6,12 +6,12 @@ * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* ScriptData @@ -40,9 +40,9 @@ EndScriptData */ #define SAY_SOUL_CHARGE1 -1534029 #define SAY_SOUL_CHARGE2 -1534030 -#define SPELL_DENOUEMENT_WISP 32124 -#define SPELL_ANCIENT_SPARK 39349 -#define SPELL_PROTECTION_OF_ELUNE 38528 +#define SPELL_DENOUEMENT_WISP 32124 +#define SPELL_ANCIENT_SPARK 39349 +#define SPELL_PROTECTION_OF_ELUNE 38528 #define SPELL_DRAIN_WORLD_TREE 39140 #define SPELL_DRAIN_WORLD_TREE_2 39141 @@ -53,8 +53,7 @@ EndScriptData */ #define SPELL_GRIP_OF_THE_LEGION 31972 #define SPELL_DOOMFIRE_STRIKE 31903 //summons two creatures #define SPELL_DOOMFIRE_SPAWN 32074 -#define SPELL_DOOMFIRE_VISUAL 42344 // This is actually a Zul'Aman spell, but the proper Doomfire spell sometimes freezes the server if a player stands in it for too long -#define SPELL_DOOMFIRE_DAMAGE 31944 +#define SPELL_DOOMFIRE 31945 #define SPELL_SOUL_CHARGE_YELLOW 32045 #define SPELL_SOUL_CHARGE_GREEN 32051 #define SPELL_SOUL_CHARGE_RED 32052 @@ -65,7 +64,7 @@ EndScriptData */ #define CREATURE_ARCHIMONDE 17968 #define CREATURE_DOOMFIRE 18095 -#define CREATURE_DOOMFIRE_TARGETING 18104 +#define CREATURE_DOOMFIRE_SPIRIT 18104 #define CREATURE_ANCIENT_WISP 17946 #define CREATURE_CHANNEL_TARGET 22418 @@ -77,7 +76,7 @@ struct mob_ancient_wispAI : public ScriptedAI { mob_ancient_wispAI(Creature* c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } ScriptedInstance* pInstance; @@ -92,26 +91,26 @@ struct mob_ancient_wispAI : public ScriptedAI m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); } - void Aggro(Unit* who) {} + void EnterCombat(Unit* who) {} void DamageTaken(Unit* done_by, uint32 &damage) { damage = 0; } void UpdateAI(const uint32 diff) { - if(!ArchimondeGUID) + if (!ArchimondeGUID) { - if(pInstance) + if (pInstance) ArchimondeGUID = pInstance->GetData64(DATA_ARCHIMONDE); } - if(CheckTimer < diff) + if (CheckTimer < diff) { - if(ArchimondeGUID) + if (ArchimondeGUID) { Unit* Archimonde = Unit::GetUnit((*m_creature), ArchimondeGUID); - if(Archimonde) + if (Archimonde) { - if((((Archimonde->GetHealth()*100) / Archimonde->GetMaxHealth()) < 2) || !Archimonde->isAlive()) + if ((((Archimonde->GetHealth()*100) / Archimonde->GetMaxHealth()) < 2) || !Archimonde->isAlive()) DoCast(m_creature, SPELL_DENOUEMENT_WISP); else DoCast(Archimonde, SPELL_ANCIENT_SPARK); @@ -122,186 +121,65 @@ struct mob_ancient_wispAI : public ScriptedAI } }; -/* This script controls the Doomfire mob. Unlike the other Doomfire mob, this one does not stalk players. - Instead, this doomfire will simply stand in one place after spawning and deal damage to any players that - are within 3 yards. Another creature called Doomfire Targetting spawns this creature as well as stalks. */ +/* This script is merely a placeholder for the Doomfire that triggers Doomfire spell. It will + MoveChase the Doomfire Spirit always, until despawn (AttackStart is called upon it's spawn) */ struct TRINITY_DLL_DECL mob_doomfireAI : public ScriptedAI { mob_doomfireAI(Creature* c) : ScriptedAI(c) {} - uint32 CheckTimer; - uint32 RefreshTimer; - - bool TargetSelected; - - uint64 ArchimondeGUID; - uint64 TargetGUID; - - void Reset() - { - CheckTimer = 5000; - RefreshTimer = 0; - - TargetSelected = false; - - ArchimondeGUID = 0; - TargetGUID = 0; - } + void Reset() { } + void MoveInLineOfSight(Unit* who) { } + void EnterCombat(Unit* who) { } void DamageTaken(Unit *done_by, uint32 &damage) { damage = 0; } - - void Aggro(Unit* who) { } - - void MoveInLineOfSight(Unit* who) - { - // Do not do anything if who does not exist, or we are refreshing our timer, or who is Doomfire, Archimonde or Doomfire targetting - if(!who || who == m_creature || RefreshTimer || who->GetEntry() == CREATURE_ANCIENT_WISP || - who->GetEntry() == CREATURE_ARCHIMONDE || who->GetEntry() == CREATURE_DOOMFIRE || - who->GetEntry() == CREATURE_DOOMFIRE_TARGETING || !who->isTargetableForAttack()) - return; - - if(m_creature->IsWithinDistInMap(who, 3)) - { - TargetSelected = true; - TargetGUID = who->GetGUID(); - RefreshTimer = 2000; - } - } - - void KilledUnit(Unit* victim) - { - bool suicide = true; - if(ArchimondeGUID) - { - Creature* Archimonde = (Unit::GetCreature((*m_creature), ArchimondeGUID)); - if(Archimonde && Archimonde->isAlive()) - { - suicide = false; - Archimonde->AI()->KilledUnit(victim); - } - } - - if(suicide) - m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - } - - void UpdateAI(const uint32 diff) - { - if(RefreshTimer < diff) - RefreshTimer = 0; - else RefreshTimer -= diff; - - if(TargetSelected && TargetGUID) - { - Unit* target = Unit::GetUnit((*m_creature), TargetGUID); - if(target && target->isAlive()) - { - target->CastSpell(target, SPELL_DOOMFIRE_DAMAGE, true); - TargetGUID = 0; - TargetSelected = false; - } - } - - if(CheckTimer < diff) - { - if(ArchimondeGUID) - { - Unit* Archimonde = Unit::GetUnit((*m_creature), ArchimondeGUID); - if(!Archimonde || !Archimonde->isAlive()) - m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - CheckTimer = 5000; - } - else m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - }else CheckTimer -= diff; - } }; -/* This is the script for the Doomfire Targetting Mob. This mob simply follows players and/or travels in random directions and spawns the actual Doomfire which does damage to anyone that moves close. */ +/* This is the script for the Doomfire Spirit Mob. This mob simply follow players or + travels in random directions if target cannot be found. */ struct TRINITY_DLL_DECL mob_doomfire_targettingAI : public ScriptedAI { mob_doomfire_targettingAI(Creature* c) : ScriptedAI(c) {} + uint64 TargetGUID; uint32 ChangeTargetTimer; - uint32 SummonTimer; // This timer will serve as both a summon timer for the doomfire that does damage as well as to check on Archionde - - uint64 ArchimondeGUID; void Reset() { + TargetGUID = 0; ChangeTargetTimer = 5000; - SummonTimer = 1000; - - ArchimondeGUID = 0; } - void Aggro(Unit* who) {} - void MoveInLineOfSight(Unit* who) { - // Do not do anything if who does not exist, or who is Doomfire, Archimonde or Doomfire targetting - if(!who || who == m_creature || who->GetEntry() == CREATURE_ARCHIMONDE - || who->GetEntry() == CREATURE_DOOMFIRE || who->GetEntry() == CREATURE_DOOMFIRE_TARGETING || !who->isTargetableForAttack()) - return; - - m_creature->AddThreat(who, 0.0f); + //will update once TargetGUID is 0. In case noone actually moves(not likely) and this is 0 + //when UpdateAI needs it, it will be forced to select randomPoint + if (!TargetGUID && who->GetTypeId() == TYPEID_PLAYER) + TargetGUID = who->GetGUID(); } + void EnterCombat(Unit* who) {} + void DamageTaken(Unit *done_by, uint32 &damage) { damage = 0; } void UpdateAI(const uint32 diff) { - if(!UpdateVictim()) - return; - - if(SummonTimer < diff) + if (ChangeTargetTimer < diff) { - if(ArchimondeGUID) + if (Unit *temp = Unit::GetUnit(*m_creature,TargetGUID)) { - Unit* Archimonde = Unit::GetUnit((*m_creature), ArchimondeGUID); - if(Archimonde && Archimonde->isAlive()) - { - Creature* Doomfire = DoSpawnCreature(CREATURE_DOOMFIRE, 0, 0, 2, 0, TEMPSUMMON_TIMED_DESPAWN, 30000); - if(Doomfire) - { - Doomfire->CastSpell(Doomfire, SPELL_DOOMFIRE_VISUAL, true); - ((mob_doomfireAI*)Doomfire->AI())->ArchimondeGUID = ArchimondeGUID; - Doomfire->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - } - SummonTimer = 500; - } - else - m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + m_creature->GetMotionMaster()->MoveFollow(temp,0.0f,0.0f); + TargetGUID = 0; } else - m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - }else SummonTimer -= diff; - - if(ChangeTargetTimer < diff) - { - Unit* target = NULL; - switch(rand()%2) { - case 0: // stalk player - target = SelectUnit(SELECT_TARGET_RANDOM, 1); - if(target && target->isAlive()) - { - m_creature->AddThreat(target, DoGetThreat(m_creature->getVictim())); - m_creature->GetMotionMaster()->MoveChase(target); - } - break; - - case 1: // random location - float x = 0; - float y = 0; - float z = 0; - m_creature->GetRandomPoint(m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 40, x, y, z); - m_creature->GetMotionMaster()->MovePoint(0, x, y, z); - break; + float x,y,z = 0.0; + m_creature->GetRandomPoint(m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 40, x, y, z); + m_creature->GetMotionMaster()->MovePoint(0, x, y, z); } + ChangeTargetTimer = 5000; }else ChangeTargetTimer -= diff; } - }; /* Finally, Archimonde's script. His script isn't extremely complex, most are simply spells on timers. @@ -309,8 +187,8 @@ struct TRINITY_DLL_DECL mob_doomfire_targettingAI : public ScriptedAI hardest bit to code. Finger of Death is simply a distance check - if no one is in melee range, then select a random target and cast the spell on them. However, if someone IS in melee range, and this is NOT the main tank (creature's victim), then we aggro that player and they become the new victim. - For Doomfire, we summon a mob (Doomfire Targetting) that summons another mob (Doomfire every second) - Doomfire Targetting 'stalks' players whilst Doomfire damages player that are within range. */ + For Doomfire, we summon a mob (Doomfire Spirit) for the Doomfire mob to follow. It's spirit will + randomly select it's target to follow and then we create the random movement making it unpredictable. */ // This is used to sort by distance in order to see who is the closest target, when checking for Finger of Death struct TargetDistanceOrder : public std::binary_function<const Unit, const Unit, bool> @@ -328,11 +206,14 @@ struct TRINITY_DLL_DECL boss_archimondeAI : public hyjal_trashAI { boss_archimondeAI(Creature *c) : hyjal_trashAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } ScriptedInstance* pInstance; + uint64 DoomfireSpiritGUID; + uint64 WorldTreeGUID; + uint32 DrainNordrassilTimer; uint32 FearTimer; uint32 AirBurstTimer; @@ -354,10 +235,13 @@ struct TRINITY_DLL_DECL boss_archimondeAI : public hyjal_trashAI void Reset() { - if(pInstance) + if (pInstance) pInstance->SetData(DATA_ARCHIMONDEEVENT, NOT_STARTED); + DoomfireSpiritGUID = 0; damageTaken = 0; + WorldTreeGUID = 0; + DrainNordrassilTimer = 0; FearTimer = 42000; AirBurstTimer = 30000; @@ -378,13 +262,13 @@ struct TRINITY_DLL_DECL boss_archimondeAI : public hyjal_trashAI IsChanneling = false; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { m_creature->InterruptSpell(CURRENT_CHANNELED_SPELL); DoScriptText(SAY_AGGRO, m_creature); DoZoneInCombat(); - if(pInstance) + if (pInstance) pInstance->SetData(DATA_ARCHIMONDEEVENT, IN_PROGRESS); } @@ -392,13 +276,13 @@ struct TRINITY_DLL_DECL boss_archimondeAI : public hyjal_trashAI { switch(rand()%2) { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; - case 2: DoScriptText(SAY_SLAY3, m_creature); break; + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + case 2: DoScriptText(SAY_SLAY3, m_creature); break; } - if(victim && (victim->GetTypeId() == TYPEID_PLAYER)) - GainSoulCharge(((Player*)victim)); + if (victim && (victim->GetTypeId() == TYPEID_PLAYER)) + GainSoulCharge(CAST_PLR(victim)); } void GainSoulCharge(Player* victim) @@ -431,7 +315,7 @@ struct TRINITY_DLL_DECL boss_archimondeAI : public hyjal_trashAI hyjal_trashAI::JustDied(victim); DoScriptText(SAY_DEATH, m_creature); - if(pInstance) + if (pInstance) pInstance->SetData(DATA_ARCHIMONDEEVENT, DONE); } @@ -439,11 +323,11 @@ struct TRINITY_DLL_DECL boss_archimondeAI : public hyjal_trashAI { // First we check if our current victim is in melee range or not. Unit* victim = m_creature->getVictim(); - if(victim && m_creature->IsWithinDistInMap(victim, m_creature->GetAttackDistance(victim))) + if (victim && m_creature->IsWithinDistInMap(victim, m_creature->GetAttackDistance(victim))) return false; std::list<HostilReference*>& m_threatlist = m_creature->getThreatManager().getThreatList(); - if(m_threatlist.empty()) + if (m_threatlist.empty()) return false; std::list<Unit*> targets; @@ -451,56 +335,70 @@ struct TRINITY_DLL_DECL boss_archimondeAI : public hyjal_trashAI for( ; itr != m_threatlist.end(); ++itr) { Unit* pUnit = Unit::GetUnit((*m_creature), (*itr)->getUnitGuid()); - if(pUnit && pUnit->isAlive()) + if (pUnit && pUnit->isAlive()) targets.push_back(pUnit); } - if(targets.empty()) + if (targets.empty()) return false; targets.sort(TargetDistanceOrder(m_creature)); Unit* target = targets.front(); - if(target) + if (target) { - if(!m_creature->IsWithinDistInMap(target, m_creature->GetAttackDistance(target))) + if (!m_creature->IsWithinDistInMap(target, m_creature->GetAttackDistance(target))) return true; // Cast Finger of Death else // This target is closest, he is our new tank - m_creature->AddThreat(target, DoGetThreat(m_creature->getVictim())); + m_creature->AddThreat(target, m_creature->getThreatManager().getThreat(m_creature->getVictim())); } return false; } - void SummonDoomfire(Unit* target) + void JustSummoned(Creature *summoned) { - Creature* Doomfire = DoSpawnCreature(CREATURE_DOOMFIRE_TARGETING, rand()%30, rand()%30, 0, 0, TEMPSUMMON_TIMED_DESPAWN, 30000); - if(Doomfire) + summoned->setFaction(m_creature->getFaction()); + summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + + if (summoned->GetEntry() == CREATURE_DOOMFIRE_SPIRIT) { - ((mob_doomfire_targettingAI*)Doomfire->AI())->ArchimondeGUID = m_creature->GetGUID(); - Doomfire->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - // Give Doomfire a taste of everyone in the threatlist = more targets to chase. - std::list<HostilReference*>::iterator itr; - for(itr = m_creature->getThreatManager().getThreatList().begin(); itr != m_creature->getThreatManager().getThreatList().end(); ++itr) - Doomfire->AddThreat(Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()), 1.0f); - Doomfire->setFaction(m_creature->getFaction()); - DoCast(Doomfire, SPELL_DOOMFIRE_SPAWN); - Doomfire->CastSpell(Doomfire, SPELL_DOOMFIRE_VISUAL, true); - if(target) - Doomfire->AI()->AttackStart(target); - - if(rand()%2 == 0) - DoScriptText(SAY_DOOMFIRE1, m_creature); - else - DoScriptText(SAY_DOOMFIRE2, m_creature); + DoomfireSpiritGUID = summoned->GetGUID(); + } + + if (summoned->GetEntry() == CREATURE_DOOMFIRE) + { + summoned->CastSpell(summoned,SPELL_DOOMFIRE_SPAWN,false); + summoned->CastSpell(summoned,SPELL_DOOMFIRE,true,0,0,m_creature->GetGUID()); + + if (Unit *DoomfireSpirit = Unit::GetUnit(*m_creature, DoomfireSpiritGUID)) + { + summoned->GetMotionMaster()->MoveFollow(DoomfireSpirit,0.0f,0.0f); + DoomfireSpiritGUID = 0; + } } } + //this is code doing close to what the summoning spell would do (spell 31903) + void SummonDoomfire(Unit* target) + { + m_creature->SummonCreature(CREATURE_DOOMFIRE_SPIRIT, + target->GetPositionX()+15.0,target->GetPositionY()+15.0,target->GetPositionZ(),0, + TEMPSUMMON_TIMED_DESPAWN, 27000); + + m_creature->SummonCreature(CREATURE_DOOMFIRE, + target->GetPositionX()-15.0,target->GetPositionY()-15.0,target->GetPositionZ(),0, + TEMPSUMMON_TIMED_DESPAWN, 27000); + } + void UnleashSoulCharge() { m_creature->InterruptNonMeleeSpells(false); + bool HasCast = false; uint32 chargeSpell = 0; uint32 unleashSpell = 0; + switch(rand()%3) { case 0: @@ -516,42 +414,48 @@ struct TRINITY_DLL_DECL boss_archimondeAI : public hyjal_trashAI unleashSpell = SPELL_UNLEASH_SOUL_GREEN; break; } - if(m_creature->HasAura(chargeSpell, 0)) + + if (m_creature->HasAura(chargeSpell)) { - m_creature->RemoveSingleAuraFromStack(chargeSpell, 0); + m_creature->RemoveAuraFromStack(chargeSpell); DoCast(m_creature->getVictim(), unleashSpell); HasCast = true; SoulChargeCount--; } - if(HasCast) + + if (HasCast) SoulChargeTimer = 2000 + rand()%28000; } void UpdateAI(const uint32 diff) { - if(!InCombat) + if (!m_creature->isInCombat()) { - if(pInstance) + if (pInstance) { // Do not let the raid skip straight to Archimonde. Visible and hostile ONLY if Azagalor is finished. - if((pInstance->GetData(DATA_AZGALOREVENT) < DONE) && ((m_creature->GetVisibility() != VISIBILITY_OFF) || (m_creature->getFaction() != 35))) + if ((pInstance->GetData(DATA_AZGALOREVENT) < DONE) && ((m_creature->GetVisibility() != VISIBILITY_OFF) || (m_creature->getFaction() != 35))) { m_creature->SetVisibility(VISIBILITY_OFF); m_creature->setFaction(35); } - else if((pInstance->GetData(DATA_AZGALOREVENT) >= DONE) && ((m_creature->GetVisibility() != VISIBILITY_ON) || (m_creature->getFaction() == 35))) + else if ((pInstance->GetData(DATA_AZGALOREVENT) >= DONE) && ((m_creature->GetVisibility() != VISIBILITY_ON) || (m_creature->getFaction() == 35))) { m_creature->setFaction(1720); m_creature->SetVisibility(VISIBILITY_ON); } } - if(DrainNordrassilTimer < diff) + if (DrainNordrassilTimer < diff) { - if(!IsChanneling) + if (!IsChanneling) { - Creature* Nordrassil = m_creature->SummonCreature(CREATURE_CHANNEL_TARGET, NORDRASSIL_X, NORDRASSIL_Y, NORDRASSIL_Z, 0, TEMPSUMMON_TIMED_DESPAWN, 1200000); - if(Nordrassil) + Creature *temp = m_creature->SummonCreature(CREATURE_CHANNEL_TARGET, NORDRASSIL_X, NORDRASSIL_Y, NORDRASSIL_Z, 0, TEMPSUMMON_TIMED_DESPAWN, 1200000); + + if (temp) + WorldTreeGUID = temp->GetGUID(); + + if (Unit *Nordrassil = Unit::GetUnit(*m_creature, WorldTreeGUID)) { Nordrassil->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); Nordrassil->SetUInt32Value(UNIT_FIELD_DISPLAYID, 11686); @@ -559,26 +463,24 @@ struct TRINITY_DLL_DECL boss_archimondeAI : public hyjal_trashAI IsChanneling = true; } } - Creature* Nordrassil = m_creature->SummonCreature(CREATURE_CHANNEL_TARGET, NORDRASSIL_X, NORDRASSIL_Y, NORDRASSIL_Z, 0, TEMPSUMMON_TIMED_DESPAWN, 5000); - if(Nordrassil) + + if (Unit *Nordrassil = Unit::GetUnit(*m_creature, WorldTreeGUID)) { - Nordrassil->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - Nordrassil->SetUInt32Value(UNIT_FIELD_DISPLAYID, 11686); Nordrassil->CastSpell(m_creature, SPELL_DRAIN_WORLD_TREE_2, true); DrainNordrassilTimer = 1000; } }else DrainNordrassilTimer -= diff; } - if(!UpdateVictim()) + if (!UpdateVictim() ) return; - if(((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 10) && !BelowTenPercent && !Enraged) + if (((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 10) && !BelowTenPercent && !Enraged) BelowTenPercent = true; - if(!Enraged) + if (!Enraged) { - if(EnrageTimer < diff) + if (EnrageTimer < diff) { if((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) > 10) { @@ -589,14 +491,15 @@ struct TRINITY_DLL_DECL boss_archimondeAI : public hyjal_trashAI } }else EnrageTimer -= diff; - if(CheckDistanceTimer < diff) + if (CheckDistanceTimer < diff) { // To simplify the check, we simply summon a creature in the location and then check how far we are from the creature Creature* Check = m_creature->SummonCreature(CREATURE_CHANNEL_TARGET, NORDRASSIL_X, NORDRASSIL_Y, NORDRASSIL_Z, 0, TEMPSUMMON_TIMED_DESPAWN, 2000); - if(Check) + if (Check) { Check->SetVisibility(VISIBILITY_OFF); - if(m_creature->IsWithinDistInMap(Check, 75)) + + if (m_creature->IsWithinDistInMap(Check, 75)) { m_creature->GetMotionMaster()->Clear(false); m_creature->GetMotionMaster()->MoveIdle(); @@ -608,37 +511,38 @@ struct TRINITY_DLL_DECL boss_archimondeAI : public hyjal_trashAI }else CheckDistanceTimer -= diff; } - if(BelowTenPercent) + if (BelowTenPercent) { - if(!HasProtected) + if (!HasProtected) { m_creature->GetMotionMaster()->Clear(false); m_creature->GetMotionMaster()->MoveIdle(); + //all members of raid must get this buff DoCast(m_creature->getVictim(), SPELL_PROTECTION_OF_ELUNE); HasProtected = true; Enraged = true; } - if(SummonWispTimer < diff) + if (SummonWispTimer < diff) { Creature* Wisp = DoSpawnCreature(CREATURE_ANCIENT_WISP, rand()%40, rand()%40, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if(Wisp) + if (Wisp) { Wisp->AI()->AttackStart(m_creature); - ((mob_ancient_wispAI*)Wisp->AI())->ArchimondeGUID = m_creature->GetGUID(); + CAST_AI(mob_ancient_wispAI, Wisp->AI())->ArchimondeGUID = m_creature->GetGUID(); } SummonWispTimer = 1500; ++WispCount; }else SummonWispTimer -= diff; - if(WispCount >= 30) + if (WispCount >= 30) m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); } - if(Enraged) + if (Enraged) { - if(HandOfDeathTimer < diff) + if (HandOfDeathTimer < diff) { DoCast(m_creature->getVictim(), SPELL_HAND_OF_DEATH); HandOfDeathTimer = 2000; @@ -646,46 +550,57 @@ struct TRINITY_DLL_DECL boss_archimondeAI : public hyjal_trashAI return; // Don't do anything after this point. } - if(SoulChargeCount) + if (SoulChargeCount) { - if(SoulChargeTimer < diff) + if (SoulChargeTimer < diff) UnleashSoulCharge(); else SoulChargeTimer -= diff; } - if(GripOfTheLegionTimer < diff) + if (GripOfTheLegionTimer < diff) { DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_GRIP_OF_THE_LEGION); GripOfTheLegionTimer = 5000 + rand()%20000; }else GripOfTheLegionTimer -= diff; - if(AirBurstTimer < diff) + if (AirBurstTimer < diff) { - if(rand()%2 == 0) + if (rand()%2 == 0) DoScriptText(SAY_AIR_BURST1, m_creature); else DoScriptText(SAY_AIR_BURST2, m_creature); - DoCast(SelectUnit(SELECT_TARGET_RANDOM, 1), SPELL_AIR_BURST);//not on tank AirBurstTimer = 25000 + rand()%15000; }else AirBurstTimer -= diff; - if(FearTimer < diff) + if (FearTimer < diff) { DoCast(m_creature->getVictim(), SPELL_FEAR); FearTimer = 42000; }else FearTimer -= diff; - if(DoomfireTimer < diff) + if (DoomfireTimer < diff) { - SummonDoomfire(SelectUnit(SELECT_TARGET_RANDOM, 1)); - DoomfireTimer = 40000; + if (rand()%2 == 0) + DoScriptText(SAY_DOOMFIRE1, m_creature); + else + DoScriptText(SAY_DOOMFIRE2, m_creature); + + Unit *temp = SelectUnit(SELECT_TARGET_RANDOM, 1); + if (!temp) + temp = m_creature->getVictim(); + + //replace with spell cast 31903 once implicitTarget 73 implemented + SummonDoomfire(temp); + + //supposedly three doomfire can be up at the same time + DoomfireTimer = 20000; }else DoomfireTimer -= diff; - if(MeleeRangeCheckTimer < diff) + if (MeleeRangeCheckTimer < diff) { - if(CanUseFingerOfDeath()) + if (CanUseFingerOfDeath()) { DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_FINGER_OF_DEATH); MeleeRangeCheckTimer = 1000; @@ -723,7 +638,7 @@ void AddSC_boss_archimonde() { Script *newscript; newscript = new Script; - newscript->Name="boss_archimonde"; + newscript->Name = "boss_archimonde"; newscript->GetAI = &GetAI_boss_archimonde; newscript->RegisterSelf(); @@ -742,4 +657,3 @@ void AddSC_boss_archimonde() newscript->GetAI = &GetAI_mob_ancient_wisp; newscript->RegisterSelf(); } - diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_azgalor.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_azgalor.cpp index c8d9c403a29..8ca8ba36575 100644 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_azgalor.cpp +++ b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_azgalor.cpp @@ -31,10 +31,10 @@ struct TRINITY_DLL_DECL boss_azgalorAI : public hyjal_trashAI { boss_azgalorAI(Creature *c) : hyjal_trashAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); go = false; pos = 0; - SpellEntry *TempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_HOWL_OF_AZGALOR); + SpellEntry *TempSpell = GET_SPELL(SPELL_HOWL_OF_AZGALOR); if(TempSpell) TempSpell->EffectRadiusIndex[0] = 12;//100yards instead of 50000?! } @@ -63,7 +63,7 @@ struct TRINITY_DLL_DECL boss_azgalorAI : public hyjal_trashAI pInstance->SetData(DATA_AZGALOREVENT, NOT_STARTED); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { if(pInstance && IsEvent) pInstance->SetData(DATA_AZGALOREVENT, IN_PROGRESS); @@ -120,16 +120,16 @@ struct TRINITY_DLL_DECL boss_azgalorAI : public hyjal_trashAI go = true; if(pInstance) { - ((npc_escortAI*)(m_creature->AI()))->AddWaypoint(0, 5492.91, -2404.61, 1462.63); - ((npc_escortAI*)(m_creature->AI()))->AddWaypoint(1, 5531.76, -2460.87, 1469.55); - ((npc_escortAI*)(m_creature->AI()))->AddWaypoint(2, 5554.58, -2514.66, 1476.12); - ((npc_escortAI*)(m_creature->AI()))->AddWaypoint(3, 5554.16, -2567.23, 1479.90); - ((npc_escortAI*)(m_creature->AI()))->AddWaypoint(4, 5540.67, -2625.99, 1480.89); - ((npc_escortAI*)(m_creature->AI()))->AddWaypoint(5, 5508.16, -2659.2, 1480.15); - ((npc_escortAI*)(m_creature->AI()))->AddWaypoint(6, 5489.62, -2704.05, 1482.18); - ((npc_escortAI*)(m_creature->AI()))->AddWaypoint(7, 5457.04, -2726.26, 1485.10); - ((npc_escortAI*)(m_creature->AI()))->Start(false, true, true); - ((npc_escortAI*)(m_creature->AI()))->SetDespawnAtEnd(false); + AddWaypoint(0, 5492.91, -2404.61, 1462.63); + AddWaypoint(1, 5531.76, -2460.87, 1469.55); + AddWaypoint(2, 5554.58, -2514.66, 1476.12); + AddWaypoint(3, 5554.16, -2567.23, 1479.90); + AddWaypoint(4, 5540.67, -2625.99, 1480.89); + AddWaypoint(5, 5508.16, -2659.2, 1480.15); + AddWaypoint(6, 5489.62, -2704.05, 1482.18); + AddWaypoint(7, 5457.04, -2726.26, 1485.10); + Start(false, true, true); + SetDespawnAtEnd(false); } } } @@ -140,13 +140,13 @@ struct TRINITY_DLL_DECL boss_azgalorAI : public hyjal_trashAI if(RainTimer < diff) { - DoCast(SelectUnit(SELECT_TARGET_RANDOM,0,30,true), SPELL_RAIN_OF_FIRE); + DoCast(SelectTarget(SELECT_TARGET_RANDOM,0,30,true), SPELL_RAIN_OF_FIRE); RainTimer = 20000+rand()%15000; }else RainTimer -= diff; if(DoomTimer < diff) { - DoCast(SelectUnit(SELECT_TARGET_RANDOM,1,100,true), SPELL_DOOM);//never on tank + DoCast(SelectTarget(SELECT_TARGET_RANDOM,1,100,true), SPELL_DOOM);//never on tank DoomTimer = 45000+rand()%5000; }else DoomTimer -= diff; @@ -187,7 +187,7 @@ struct TRINITY_DLL_DECL mob_lesser_doomguardAI : public hyjal_trashAI { mob_lesser_doomguardAI(Creature *c) : hyjal_trashAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); if(pInstance) AzgalorGUID = pInstance->GetData64(DATA_AZGALOR); } @@ -206,7 +206,7 @@ struct TRINITY_DLL_DECL mob_lesser_doomguardAI : public hyjal_trashAI CheckTimer = 5000; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } @@ -222,11 +222,8 @@ struct TRINITY_DLL_DECL mob_lesser_doomguardAI : public hyjal_trashAI void MoveInLineOfSight(Unit *who) { - if (m_creature->GetDistance(who) <= 50 && !InCombat && m_creature->IsHostileTo(who)) - { - m_creature->AddThreat(who,0.0); - m_creature->Attack(who,false); - } + if (m_creature->GetDistance(who) <= 50 && !m_creature->isInCombat() && m_creature->IsHostileTo(who)) + AttackStart(who); } void JustDied(Unit *victim) @@ -263,7 +260,7 @@ struct TRINITY_DLL_DECL mob_lesser_doomguardAI : public hyjal_trashAI if(CrippleTimer < diff) { - DoCast(SelectUnit(SELECT_TARGET_RANDOM,0,100,true), SPELL_CRIPPLE); + DoCast(SelectTarget(SELECT_TARGET_RANDOM,0,100,true), SPELL_CRIPPLE); CrippleTimer = 25000+rand()%5000; }else CrippleTimer -= diff; diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_kazrogal.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_kazrogal.cpp index 2d8eb508ce4..c8e149e6a37 100644 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_kazrogal.cpp +++ b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_kazrogal.cpp @@ -28,10 +28,10 @@ struct TRINITY_DLL_DECL boss_kazrogalAI : public hyjal_trashAI { boss_kazrogalAI(Creature *c) : hyjal_trashAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); go = false; pos = 0; - SpellEntry *TempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_MARK); + SpellEntry *TempSpell = GET_SPELL(SPELL_MARK); if(TempSpell && TempSpell->EffectImplicitTargetA[0] != 1) { TempSpell->EffectImplicitTargetA[0] = 1; @@ -58,7 +58,7 @@ struct TRINITY_DLL_DECL boss_kazrogalAI : public hyjal_trashAI pInstance->SetData(DATA_KAZROGALEVENT, NOT_STARTED); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { if(pInstance && IsEvent) pInstance->SetData(DATA_KAZROGALEVENT, IN_PROGRESS); @@ -115,16 +115,16 @@ struct TRINITY_DLL_DECL boss_kazrogalAI : public hyjal_trashAI go = true; if(pInstance) { - ((npc_escortAI*)(m_creature->AI()))->AddWaypoint(0, 5492.91, -2404.61, 1462.63); - ((npc_escortAI*)(m_creature->AI()))->AddWaypoint(1, 5531.76, -2460.87, 1469.55); - ((npc_escortAI*)(m_creature->AI()))->AddWaypoint(2, 5554.58, -2514.66, 1476.12); - ((npc_escortAI*)(m_creature->AI()))->AddWaypoint(3, 5554.16, -2567.23, 1479.90); - ((npc_escortAI*)(m_creature->AI()))->AddWaypoint(4, 5540.67, -2625.99, 1480.89); - ((npc_escortAI*)(m_creature->AI()))->AddWaypoint(5, 5508.16, -2659.2, 1480.15); - ((npc_escortAI*)(m_creature->AI()))->AddWaypoint(6, 5489.62, -2704.05, 1482.18); - ((npc_escortAI*)(m_creature->AI()))->AddWaypoint(7, 5457.04, -2726.26, 1485.10); - ((npc_escortAI*)(m_creature->AI()))->Start(false, true, true); - ((npc_escortAI*)(m_creature->AI()))->SetDespawnAtEnd(false); + AddWaypoint(0, 5492.91, -2404.61, 1462.63); + AddWaypoint(1, 5531.76, -2460.87, 1469.55); + AddWaypoint(2, 5554.58, -2514.66, 1476.12); + AddWaypoint(3, 5554.16, -2567.23, 1479.90); + AddWaypoint(4, 5540.67, -2625.99, 1480.89); + AddWaypoint(5, 5508.16, -2659.2, 1480.15); + AddWaypoint(6, 5489.62, -2704.05, 1482.18); + AddWaypoint(7, 5457.04, -2726.26, 1485.10); + Start(false, true, true); + SetDespawnAtEnd(false); } } } @@ -145,7 +145,7 @@ struct TRINITY_DLL_DECL boss_kazrogalAI : public hyjal_trashAI WarStompTimer = 60000; }else WarStompTimer -= diff; - if(m_creature->HasAura(SPELL_MARK,0)) + if(m_creature->HasAura(SPELL_MARK)) m_creature->RemoveAurasDueToSpell(SPELL_MARK); if(MarkTimer < diff) { diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_rage_winterchill.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_rage_winterchill.cpp index 809aa9c7690..924652f3d41 100644 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_rage_winterchill.cpp +++ b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_rage_winterchill.cpp @@ -34,7 +34,7 @@ struct TRINITY_DLL_DECL boss_rage_winterchillAI : public hyjal_trashAI { boss_rage_winterchillAI(Creature *c) : hyjal_trashAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); go = false; pos = 0; } @@ -58,7 +58,7 @@ struct TRINITY_DLL_DECL boss_rage_winterchillAI : public hyjal_trashAI pInstance->SetData(DATA_RAGEWINTERCHILLEVENT, NOT_STARTED); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { if(pInstance && IsEvent) pInstance->SetData(DATA_RAGEWINTERCHILLEVENT, IN_PROGRESS); @@ -112,16 +112,16 @@ struct TRINITY_DLL_DECL boss_rage_winterchillAI : public hyjal_trashAI go = true; if(pInstance) { - ((npc_escortAI*)(m_creature->AI()))->AddWaypoint(0, 4896.08, -1576.35, 1333.65); - ((npc_escortAI*)(m_creature->AI()))->AddWaypoint(1, 4898.68, -1615.02, 1329.48); - ((npc_escortAI*)(m_creature->AI()))->AddWaypoint(2, 4907.12, -1667.08, 1321.00); - ((npc_escortAI*)(m_creature->AI()))->AddWaypoint(3, 4963.18, -1699.35, 1340.51); - ((npc_escortAI*)(m_creature->AI()))->AddWaypoint(4, 4989.16, -1716.67, 1335.74); - ((npc_escortAI*)(m_creature->AI()))->AddWaypoint(5, 5026.27, -1736.89, 1323.02); - ((npc_escortAI*)(m_creature->AI()))->AddWaypoint(6, 5037.77, -1770.56, 1324.36); - ((npc_escortAI*)(m_creature->AI()))->AddWaypoint(7, 5067.23, -1789.95, 1321.17); - ((npc_escortAI*)(m_creature->AI()))->Start(false, true, true); - ((npc_escortAI*)(m_creature->AI()))->SetDespawnAtEnd(false); + AddWaypoint(0, 4896.08, -1576.35, 1333.65); + AddWaypoint(1, 4898.68, -1615.02, 1329.48); + AddWaypoint(2, 4907.12, -1667.08, 1321.00); + AddWaypoint(3, 4963.18, -1699.35, 1340.51); + AddWaypoint(4, 4989.16, -1716.67, 1335.74); + AddWaypoint(5, 5026.27, -1736.89, 1323.02); + AddWaypoint(6, 5037.77, -1770.56, 1324.36); + AddWaypoint(7, 5067.23, -1789.95, 1321.17); + Start(false, true, true); + SetDespawnAtEnd(false); } } } @@ -169,7 +169,7 @@ struct TRINITY_DLL_DECL boss_rage_winterchillAI : public hyjal_trashAI }else NovaTimer -= diff; if(IceboltTimer < diff) { - DoCast(SelectUnit(SELECT_TARGET_RANDOM,0,40,true), SPELL_ICEBOLT); + DoCast(SelectTarget(SELECT_TARGET_RANDOM,0,40,true), SPELL_ICEBOLT); IceboltTimer = 11000+rand()%20000; }else IceboltTimer -= diff; diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/def_hyjal.h b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/def_hyjal.h index ed02258cd9f..7d81dbe4993 100644 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/def_hyjal.h +++ b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/def_hyjal.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * This program is free software licensed under GPL version 2 * Please see the included DOCS/LICENSE.TXT for more information */ diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal.cpp index 386a7ec8216..5b51a720f8b 100644 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal.cpp +++ b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal.cpp @@ -1,4 +1,4 @@ - /* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> + /* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -66,7 +66,7 @@ CreatureAI* GetAI_npc_jaina_proudmoore(Creature *_Creature) bool GossipHello_npc_jaina_proudmoore(Player *player, Creature *_Creature) { - hyjalAI* ai = ((hyjalAI*)_Creature->AI()); + hyjalAI* ai = CAST_AI(hyjalAI, _Creature->AI()); if(ai->EventBegun) return false; @@ -88,7 +88,7 @@ bool GossipHello_npc_jaina_proudmoore(Player *player, Creature *_Creature) bool GossipSelect_npc_jaina_proudmoore(Player *player, Creature *_Creature, uint32 sender, uint32 action) { - hyjalAI* ai = ((hyjalAI*)_Creature->AI()); + hyjalAI* ai = CAST_AI(hyjalAI, _Creature->AI()); switch(action) { case GOSSIP_ACTION_INFO_DEF + 1: @@ -130,7 +130,7 @@ CreatureAI* GetAI_npc_thrall(Creature *_Creature) bool GossipHello_npc_thrall(Player *player, Creature *_Creature) { - hyjalAI* ai = ((hyjalAI*)_Creature->AI()); + hyjalAI* ai = CAST_AI(hyjalAI, _Creature->AI()); if (ai->EventBegun) return false; @@ -157,7 +157,7 @@ bool GossipHello_npc_thrall(Player *player, Creature *_Creature) bool GossipSelect_npc_thrall(Player *player, Creature *_Creature, uint32 sender, uint32 action) { - hyjalAI* ai = ((hyjalAI*)_Creature->AI()); + hyjalAI* ai = CAST_AI(hyjalAI, _Creature->AI()); ai->DeSpawnVeins();//despawn the alliance veins switch(action) { @@ -190,7 +190,7 @@ CreatureAI* GetAI_npc_tyrande_whisperwind(Creature *_Creature) bool GossipHello_npc_tyrande_whisperwind(Player* player, Creature* _Creature) { - hyjalAI* ai = ((hyjalAI*)_Creature->AI()); + hyjalAI* ai = CAST_AI(hyjalAI, _Creature->AI()); uint32 AzgalorEvent = ai->GetInstanceData(DATA_AZGALOREVENT); // Only let them get item if Azgalor is dead. @@ -213,7 +213,7 @@ bool GossipSelect_npc_tyrande_whisperwind(Player *player, Creature *_Creature, u player->SendNewItem(item,1,true,false,true); } player->SEND_GOSSIP_MENU(907, _Creature->GetGUID()); - hyjalAI* ai = ((hyjalAI*)_Creature->AI()); + hyjalAI* ai = CAST_AI(hyjalAI, _Creature->AI()); } return true; } diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.cpp index 6003e927d5c..77ba7fd7ce2 100644 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.cpp +++ b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -308,7 +308,7 @@ float HordeFirePos[65][8]=//spawn points for the fire visuals (GO) in the horde hyjalAI::hyjalAI(Creature *c) : npc_escortAI(c), Summons(m_creature) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); VeinsSpawned[0] = false; VeinsSpawned[1] = false; for(uint8 i=0;i<14;i++) @@ -354,6 +354,7 @@ void hyjalAI::Reset() // Misc WaveCount = 0; + EnemyCount = 0; // Set faction properly based on creature entry switch(m_creature->GetEntry()) @@ -419,14 +420,12 @@ void hyjalAI::EnterEvadeMode() m_creature->GetMotionMaster()->MoveTargetedHome(); m_creature->SetLootRecipient(NULL); - - InCombat = false; } -void hyjalAI::Aggro(Unit *who) +void hyjalAI::EnterCombat(Unit *who) { if(IsDummy)return; - for(uint8 i = 0; i < 2; ++i) + for(uint8 i = 0; i < 3; ++i) if(Spell[i].Cooldown) SpellTimer[i] = Spell[i].Cooldown; @@ -463,7 +462,7 @@ void hyjalAI::SummonCreature(uint32 entry, float Base[4][3]) {//summon at tower pCreature = m_creature->SummonCreature(entry, SpawnPointSpecial[SPAWN_NEAR_TOWER][0]+irand(-20,20), SpawnPointSpecial[SPAWN_NEAR_TOWER][1]+irand(-20,20), SpawnPointSpecial[SPAWN_NEAR_TOWER][2]+irand(-10,10), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000); if(pCreature) - ((hyjal_trashAI*)pCreature->AI())->useFlyPath = true; + CAST_AI(hyjal_trashAI, pCreature->AI())->useFlyPath = true; }else{//summon at gate pCreature = m_creature->SummonCreature(entry, SpawnPointSpecial[SPAWN_GARG_GATE][0]+irand(-10,10), SpawnPointSpecial[SPAWN_GARG_GATE][1]+irand(-10,10), SpawnPointSpecial[SPAWN_GARG_GATE][2]+irand(-10,10), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000); } @@ -475,7 +474,7 @@ void hyjalAI::SummonCreature(uint32 entry, float Base[4][3]) }else{ pCreature = m_creature->SummonCreature(entry, SpawnPointSpecial[SPAWN_NEAR_TOWER][0], SpawnPointSpecial[SPAWN_NEAR_TOWER][1],SpawnPointSpecial[SPAWN_NEAR_TOWER][2], 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000); if(pCreature) - ((hyjal_trashAI*)pCreature->AI())->useFlyPath = true; + CAST_AI(hyjal_trashAI, pCreature->AI())->useFlyPath = true; } break; case 17908: //GIANT_INFERNAL @@ -511,7 +510,7 @@ void hyjalAI::SummonCreature(uint32 entry, float Base[4][3]) case ANETHERON: case KAZROGAL: case AZGALOR: - ((hyjal_trashAI*)pCreature->AI())->IsEvent = true; + CAST_AI(hyjal_trashAI, pCreature->AI())->IsEvent = true; break; } if(pInstance) @@ -683,7 +682,7 @@ void hyjalAI::Retreat() if(JainaDummy) { JainaDummy->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - ((hyjalAI*)JainaDummy->AI())->IsDummy = true; + CAST_AI(hyjalAI, JainaDummy->AI())->IsDummy = true; DummyGuid = JainaDummy->GetGUID(); } AddWaypoint(0,JainaDummySpawn[1][0],JainaDummySpawn[1][1],JainaDummySpawn[1][2]); @@ -729,7 +728,7 @@ void hyjalAI::DeSpawnVeins() { Creature* pUnit=Unit::GetCreature((*m_creature),pInstance->GetData64(DATA_JAINAPROUDMOORE)); if (!pUnit)return; - hyjalAI* ai = ((hyjalAI*)pUnit->AI()); + hyjalAI* ai = CAST_AI(hyjalAI, pUnit->AI()); if(!ai)return; for (uint8 i = 0; i<7; i++) { @@ -741,7 +740,7 @@ void hyjalAI::DeSpawnVeins() { Creature* pUnit=Unit::GetCreature((*m_creature),pInstance->GetData64(DATA_THRALL)); if (!pUnit)return; - hyjalAI* ai = ((hyjalAI*)pUnit->AI()); + hyjalAI* ai = CAST_AI(hyjalAI, pUnit->AI()); if(!ai)return; for (uint8 i = 7; i<14; i++) { @@ -956,7 +955,7 @@ void hyjalAI::HideNearPos(float x, float y) // First get all creatures. std::list<Creature*> creatures; Trinity::AllFriendlyCreaturesInGrid creature_check(m_creature); - Trinity::CreatureListSearcher<Trinity::AllFriendlyCreaturesInGrid> creature_searcher(creatures, creature_check); + Trinity::CreatureListSearcher<Trinity::AllFriendlyCreaturesInGrid> creature_searcher(m_creature, creatures, creature_check); TypeContainerVisitor <Trinity::CreatureListSearcher<Trinity::AllFriendlyCreaturesInGrid>, GridTypeMapContainer> creature_visitor(creature_searcher); @@ -982,7 +981,7 @@ void hyjalAI::RespawnNearPos(float x, float y) cell.SetNoCreate(); Trinity::RespawnDo u_do; - Trinity::WorldObjectWorker<Trinity::RespawnDo> worker(u_do); + Trinity::WorldObjectWorker<Trinity::RespawnDo> worker(m_creature, u_do); TypeContainerVisitor<Trinity::WorldObjectWorker<Trinity::RespawnDo>, GridTypeMapContainer > obj_worker(worker); CellLock<GridReadGuard> cell_lock(cell, p); cell_lock->Visit(cell_lock, obj_worker, *m_creature->GetMap()); @@ -991,7 +990,7 @@ void hyjalAI::WaypointReached(uint32 i) { if(i == 1 || (i == 0 && m_creature->GetEntry() == THRALL)) { - m_creature->Yell("Hurry, we don't have much time",0,0); + m_creature->MonsterYell("Hurry, we don't have much time",0,0); WaitForTeleport = true; TeleportTimer = 20000; if(m_creature->GetEntry() == JAINA) @@ -1001,8 +1000,8 @@ void hyjalAI::WaypointReached(uint32 i) Unit* Dummy = Unit::GetUnit((*m_creature),DummyGuid); if(Dummy) { - ((hyjalAI*)((Creature*)Dummy)->AI())->DoMassTeleport = true; - ((hyjalAI*)((Creature*)Dummy)->AI())->MassTeleportTimer = 20000; + CAST_AI(hyjalAI, CAST_CRE(Dummy)->AI())->DoMassTeleport = true; + CAST_AI(hyjalAI, CAST_CRE(Dummy)->AI())->MassTeleportTimer = 20000; Dummy->CastSpell(m_creature,SPELL_MASS_TELEPORT,false); } } @@ -1016,7 +1015,7 @@ void hyjalAI::WaypointReached(uint32 i) // First get all creatures. std::list<Creature*> creatures; Trinity::AllFriendlyCreaturesInGrid creature_check(m_creature); - Trinity::CreatureListSearcher<Trinity::AllFriendlyCreaturesInGrid> creature_searcher(creatures, creature_check); + Trinity::CreatureListSearcher<Trinity::AllFriendlyCreaturesInGrid> creature_searcher(m_creature, creatures, creature_check); TypeContainerVisitor <Trinity::CreatureListSearcher<Trinity::AllFriendlyCreaturesInGrid>, GridTypeMapContainer> creature_visitor(creature_searcher); @@ -1058,7 +1057,7 @@ void hyjalAI::DoOverrun(uint32 faction, const uint32 diff) std::list<Creature*> creatures; Trinity::AllFriendlyCreaturesInGrid creature_check(m_creature); - Trinity::CreatureListSearcher<Trinity::AllFriendlyCreaturesInGrid> creature_searcher(creatures, creature_check); + Trinity::CreatureListSearcher<Trinity::AllFriendlyCreaturesInGrid> creature_searcher(m_creature, creatures, creature_check); TypeContainerVisitor <Trinity::CreatureListSearcher<Trinity::AllFriendlyCreaturesInGrid>, GridTypeMapContainer> creature_visitor(creature_searcher); @@ -1101,9 +1100,9 @@ void hyjalAI::DoOverrun(uint32 faction, const uint32 diff) Creature* pUnit = m_creature->SummonCreature(GHOUL, AllianceBase[r][0]+irand(-15,15), AllianceBase[r][1]+irand(-15,15), AllianceBase[r][2], 0, TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000); if(pUnit) { - ((hyjal_trashAI*)pUnit->AI())->faction = Faction; - ((hyjal_trashAI*)pUnit->AI())->IsOverrun = true; - ((hyjal_trashAI*)pUnit->AI())->OverrunType = i; + CAST_AI(hyjal_trashAI, pUnit->AI())->faction = Faction; + CAST_AI(hyjal_trashAI, pUnit->AI())->IsOverrun = true; + CAST_AI(hyjal_trashAI, pUnit->AI())->OverrunType = i; pUnit->setActive(true); } } @@ -1113,9 +1112,9 @@ void hyjalAI::DoOverrun(uint32 faction, const uint32 diff) Creature* pUnit = m_creature->SummonCreature(ABOMINATION, AllianceBase[r][0]+irand(-15,15), AllianceBase[r][1]+irand(-15,15), AllianceBase[r][2], 0, TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000); if(pUnit) { - ((hyjal_trashAI*)pUnit->AI())->faction = Faction; - ((hyjal_trashAI*)pUnit->AI())->IsOverrun = true; - ((hyjal_trashAI*)pUnit->AI())->OverrunType = i; + CAST_AI(hyjal_trashAI, pUnit->AI())->faction = Faction; + CAST_AI(hyjal_trashAI, pUnit->AI())->IsOverrun = true; + CAST_AI(hyjal_trashAI, pUnit->AI())->OverrunType = i; pUnit->setActive(true); } } @@ -1125,9 +1124,9 @@ void hyjalAI::DoOverrun(uint32 faction, const uint32 diff) if(pUnit) { pUnit->SetHomePosition(AllianceOverrunGargPos[i][0], AllianceOverrunGargPos[i][1], AllianceOverrunGargPos[i][2], AllianceOverrunGargPos[i][3]); - ((hyjal_trashAI*)pUnit->AI())->faction = Faction; - ((hyjal_trashAI*)pUnit->AI())->IsOverrun = true; - ((hyjal_trashAI*)pUnit->AI())->OverrunType = i; + CAST_AI(hyjal_trashAI, pUnit->AI())->faction = Faction; + CAST_AI(hyjal_trashAI, pUnit->AI())->IsOverrun = true; + CAST_AI(hyjal_trashAI, pUnit->AI())->OverrunType = i; pUnit->setActive(true); } } @@ -1142,9 +1141,9 @@ void hyjalAI::DoOverrun(uint32 faction, const uint32 diff) if(pUnit) { pUnit->SetHomePosition(InfernalSPWP[i][0], InfernalSPWP[i][1], InfernalSPWP[i][2], InfernalSPWP[i][3]); - ((hyjal_trashAI*)pUnit->AI())->faction = Faction; - ((hyjal_trashAI*)pUnit->AI())->IsOverrun = true; - ((hyjal_trashAI*)pUnit->AI())->OverrunType = i; + CAST_AI(hyjal_trashAI, pUnit->AI())->faction = Faction; + CAST_AI(hyjal_trashAI, pUnit->AI())->IsOverrun = true; + CAST_AI(hyjal_trashAI, pUnit->AI())->OverrunType = i; pUnit->setActive(true); } } @@ -1154,9 +1153,9 @@ void hyjalAI::DoOverrun(uint32 faction, const uint32 diff) Creature* pUnit = m_creature->SummonCreature(GHOUL, HordeBase[r][0]+irand(-15,15), HordeBase[r][1]+irand(-15,15), HordeBase[r][2], 0, TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000); if(pUnit) { - ((hyjal_trashAI*)pUnit->AI())->faction = Faction; - ((hyjal_trashAI*)pUnit->AI())->IsOverrun = true; - ((hyjal_trashAI*)pUnit->AI())->OverrunType = i; + CAST_AI(hyjal_trashAI, pUnit->AI())->faction = Faction; + CAST_AI(hyjal_trashAI, pUnit->AI())->IsOverrun = true; + CAST_AI(hyjal_trashAI, pUnit->AI())->OverrunType = i; pUnit->setActive(true); } } @@ -1166,9 +1165,9 @@ void hyjalAI::DoOverrun(uint32 faction, const uint32 diff) Creature* pUnit = m_creature->SummonCreature(ABOMINATION, HordeBase[r][0]+irand(-15,15), HordeBase[r][1]+irand(-15,15), HordeBase[r][2], 0, TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000); if(pUnit) { - ((hyjal_trashAI*)pUnit->AI())->faction = Faction; - ((hyjal_trashAI*)pUnit->AI())->IsOverrun = true; - ((hyjal_trashAI*)pUnit->AI())->OverrunType = i; + CAST_AI(hyjal_trashAI, pUnit->AI())->faction = Faction; + CAST_AI(hyjal_trashAI, pUnit->AI())->IsOverrun = true; + CAST_AI(hyjal_trashAI, pUnit->AI())->OverrunType = i; pUnit->setActive(true); } } diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.h b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.h index 6f252d8e2bc..8f7e40cfdfe 100644 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.h +++ b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * This program is free software licensed under GPL version 2 * Please see the included DOCS/LICENSE.TXT for more information */ @@ -161,7 +161,7 @@ struct TRINITY_DLL_DECL hyjalAI : public npc_escortAI void EnterEvadeMode(); // Send creature back to spawn location and evade. - void Aggro(Unit *who); // Used to reset cooldowns for our spells and to inform the raid that we're under attack + void EnterCombat(Unit *who); // Used to reset cooldowns for our spells and to inform the raid that we're under attack void UpdateAI(const uint32 diff); // Called to summon waves, check for boss deaths and to cast our spells. diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal_trash.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal_trash.cpp index 55096b56e42..92cbfdbf3ab 100644 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal_trash.cpp +++ b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal_trash.cpp @@ -139,11 +139,9 @@ float HordeOverrunWP[21][3]=//waypoints in the horde base used in the end in the {5429.91,-2718.44,1493.42}//20 end 2 }; -void hyjal_trashAI::Reset(){} - hyjal_trashAI::hyjal_trashAI(Creature *c) : npc_escortAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); IsEvent = false; Delay = 0; LastOverronPos = 0; @@ -158,7 +156,7 @@ hyjal_trashAI::hyjal_trashAI(Creature *c) : npc_escortAI(c) void hyjal_trashAI::DamageTaken(Unit *done_by, uint32 &damage) { - if(done_by->GetTypeId() == TYPEID_PLAYER || (done_by->GetTypeId() == TYPEID_UNIT && ((Creature*)done_by)->isPet())) + if(done_by->GetTypeId() == TYPEID_PLAYER || (done_by->GetTypeId() == TYPEID_UNIT && CAST_CRE(done_by)->isPet())) { damageTaken += damage; if(pInstance) @@ -166,8 +164,6 @@ void hyjal_trashAI::DamageTaken(Unit *done_by, uint32 &damage) } } -void hyjal_trashAI::Aggro(Unit *who){} - void hyjal_trashAI::UpdateAI(const uint32 diff) { if(IsOverrun && !SetupOverrun) @@ -379,7 +375,7 @@ struct mob_giant_infernalAI : public hyjal_trashAI { mob_giant_infernalAI(Creature* c) : hyjal_trashAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); meteor = false;//call once! CanMove = false; Delay = rand()%30000; @@ -407,7 +403,7 @@ struct mob_giant_infernalAI : public hyjal_trashAI imol = false; } - void Aggro(Unit* who) {} + void EnterCombat(Unit* who) {} void WaypointReached(uint32 i) { @@ -441,7 +437,7 @@ struct mob_giant_infernalAI : public hyjal_trashAI { trigger->SetVisibility(VISIBILITY_OFF); trigger->setFaction(m_creature->getFaction()); - trigger->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT + MOVEMENTFLAG_LEVITATING); + trigger->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); trigger->CastSpell(m_creature,SPELL_METEOR,true); } m_creature->GetMotionMaster()->Clear(); @@ -477,9 +473,9 @@ struct mob_giant_infernalAI : public hyjal_trashAI go = true; if(pInstance) { - ((npc_escortAI*)(m_creature->AI()))->AddWaypoint(0, HordeWPs[7][0]+irand(-3,3), HordeWPs[7][1]+irand(-3,3), HordeWPs[7][2]);//HordeWPs[7] infront of thrall - ((npc_escortAI*)(m_creature->AI()))->Start(true, true, true); - ((npc_escortAI*)(m_creature->AI()))->SetDespawnAtEnd(false); + AddWaypoint(0, HordeWPs[7][0]+irand(-3,3), HordeWPs[7][1]+irand(-3,3), HordeWPs[7][2]);//HordeWPs[7] infront of thrall + Start(true, true, true); + SetDespawnAtEnd(false); } } } @@ -513,7 +509,7 @@ struct mob_abominationAI : public hyjal_trashAI { mob_abominationAI(Creature* c) : hyjal_trashAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); go = false; pos = 0; Reset(); @@ -553,7 +549,7 @@ struct mob_abominationAI : public hyjal_trashAI } } - void Aggro(Unit* who) {} + void EnterCombat(Unit* who) {} void UpdateAI(const uint32 diff) { @@ -570,20 +566,20 @@ struct mob_abominationAI : public hyjal_trashAI if (pInstance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, use horde WPs { for (uint8 i = 0; i < 8; ++i) - ((npc_escortAI*)(m_creature->AI()))->AddWaypoint(i, HordeWPs[i][0]+irand(-3,3), HordeWPs[i][1]+irand(-3,3), HordeWPs[i][2]); - ((npc_escortAI*)(m_creature->AI()))->Start(false, true, true); - ((npc_escortAI*)(m_creature->AI()))->SetDespawnAtEnd(false); + AddWaypoint(i, HordeWPs[i][0]+irand(-3,3), HordeWPs[i][1]+irand(-3,3), HordeWPs[i][2]); + Start(false, true, true); + SetDespawnAtEnd(false); }else//use alliance WPs { for (uint8 i = 0; i < 8; ++i) - ((npc_escortAI*)(m_creature->AI()))->AddWaypoint(i, AllianceWPs[i][0]+irand(-3,3), AllianceWPs[i][1]+irand(-3,3), AllianceWPs[i][2]); - ((npc_escortAI*)(m_creature->AI()))->Start(false, true, true); - ((npc_escortAI*)(m_creature->AI()))->SetDespawnAtEnd(false); + AddWaypoint(i, AllianceWPs[i][0]+irand(-3,3), AllianceWPs[i][1]+irand(-3,3), AllianceWPs[i][2]); + Start(false, true, true); + SetDespawnAtEnd(false); } } } } - if(!m_creature->HasAura(SPELL_DISEASE_CLOUD,0)) + if(!m_creature->HasAura(SPELL_DISEASE_CLOUD)) DoCast(m_creature,SPELL_DISEASE_CLOUD); if (!UpdateVictim()) return; @@ -608,7 +604,7 @@ struct mob_ghoulAI : public hyjal_trashAI { mob_ghoulAI(Creature* c) : hyjal_trashAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); go = false; pos = 0; Reset(); @@ -654,7 +650,7 @@ struct mob_ghoulAI : public hyjal_trashAI } } - void Aggro(Unit* who) {} + void EnterCombat(Unit* who) {} void UpdateAI(const uint32 diff) { @@ -671,15 +667,15 @@ struct mob_ghoulAI : public hyjal_trashAI if (pInstance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, use horde WPs { for (uint8 i = 0; i < 8; ++i) - ((npc_escortAI*)(m_creature->AI()))->AddWaypoint(i, HordeWPs[i][0]+irand(-3,3), HordeWPs[i][1]+irand(-3,3), HordeWPs[i][2]); - ((npc_escortAI*)(m_creature->AI()))->Start(false, true, true); - ((npc_escortAI*)(m_creature->AI()))->SetDespawnAtEnd(false); + AddWaypoint(i, HordeWPs[i][0]+irand(-3,3), HordeWPs[i][1]+irand(-3,3), HordeWPs[i][2]); + Start(false, true, true); + SetDespawnAtEnd(false); }else//use alliance WPs { for (uint8 i = 0; i < 8; ++i) - ((npc_escortAI*)(m_creature->AI()))->AddWaypoint(i, AllianceWPs[i][0]+irand(-3,3), AllianceWPs[i][1]+irand(-3,3), AllianceWPs[i][2]); - ((npc_escortAI*)(m_creature->AI()))->Start(false, true, true); - ((npc_escortAI*)(m_creature->AI()))->SetDespawnAtEnd(false); + AddWaypoint(i, AllianceWPs[i][0]+irand(-3,3), AllianceWPs[i][1]+irand(-3,3), AllianceWPs[i][2]); + Start(false, true, true); + SetDespawnAtEnd(false); } } } @@ -711,7 +707,7 @@ struct mob_necromancerAI : public hyjal_trashAI { mob_necromancerAI(Creature* c) : hyjal_trashAI(c), summons(m_creature) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); go = false; pos = 0; Reset(); @@ -728,7 +724,7 @@ struct mob_necromancerAI : public hyjal_trashAI void JustSummoned(Creature* summon) { - Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0,30,true); + Unit* target = SelectTarget(SELECT_TARGET_RANDOM,0,30,true); if(target && summon) summon->Attack(target,false); summons.Summon(summon); @@ -773,7 +769,7 @@ struct mob_necromancerAI : public hyjal_trashAI } } - void Aggro(Unit* who) {} + void EnterCombat(Unit* who) {} void UpdateAI(const uint32 diff) { @@ -790,15 +786,15 @@ struct mob_necromancerAI : public hyjal_trashAI if (pInstance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, use horde WPs { for (uint8 i = 0; i < 8; ++i) - ((npc_escortAI*)(m_creature->AI()))->AddWaypoint(i, HordeWPs[i][0]+irand(-3,3), HordeWPs[i][1]+irand(-3,3), HordeWPs[i][2]); - ((npc_escortAI*)(m_creature->AI()))->Start(true, true, true); - ((npc_escortAI*)(m_creature->AI()))->SetDespawnAtEnd(false); + AddWaypoint(i, HordeWPs[i][0]+irand(-3,3), HordeWPs[i][1]+irand(-3,3), HordeWPs[i][2]); + Start(true, true, true); + SetDespawnAtEnd(false); }else//use alliance WPs { for (uint8 i = 0; i < 8; ++i) - ((npc_escortAI*)(m_creature->AI()))->AddWaypoint(i, AllianceWPs[i][0]+irand(-3,3), AllianceWPs[i][1]+irand(-3,3), AllianceWPs[i][2]); - ((npc_escortAI*)(m_creature->AI()))->Start(true, true, true); - ((npc_escortAI*)(m_creature->AI()))->SetDespawnAtEnd(false); + AddWaypoint(i, AllianceWPs[i][0]+irand(-3,3), AllianceWPs[i][1]+irand(-3,3), AllianceWPs[i][2]); + Start(true, true, true); + SetDespawnAtEnd(false); } } } @@ -829,7 +825,7 @@ struct mob_bansheeAI : public hyjal_trashAI { mob_bansheeAI(Creature* c) : hyjal_trashAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); go = false; pos = 0; Reset(); @@ -865,7 +861,7 @@ struct mob_bansheeAI : public hyjal_trashAI } } - void Aggro(Unit* who) {} + void EnterCombat(Unit* who) {} void UpdateAI(const uint32 diff) { @@ -882,15 +878,15 @@ struct mob_bansheeAI : public hyjal_trashAI if (pInstance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, use horde WPs { for (uint8 i = 0; i < 8; ++i) - ((npc_escortAI*)(m_creature->AI()))->AddWaypoint(i, HordeWPs[i][0]+irand(-3,3), HordeWPs[i][1]+irand(-3,3), HordeWPs[i][2]); - ((npc_escortAI*)(m_creature->AI()))->Start(false, true, true); - ((npc_escortAI*)(m_creature->AI()))->SetDespawnAtEnd(false); + AddWaypoint(i, HordeWPs[i][0]+irand(-3,3), HordeWPs[i][1]+irand(-3,3), HordeWPs[i][2]); + Start(false, true, true); + SetDespawnAtEnd(false); }else//use alliance WPs { for (uint8 i = 0; i < 8; ++i) - ((npc_escortAI*)(m_creature->AI()))->AddWaypoint(i, AllianceWPs[i][0]+irand(-3,3), AllianceWPs[i][1]+irand(-3,3), AllianceWPs[i][2]); - ((npc_escortAI*)(m_creature->AI()))->Start(false, true, true); - ((npc_escortAI*)(m_creature->AI()))->SetDespawnAtEnd(false); + AddWaypoint(i, AllianceWPs[i][0]+irand(-3,3), AllianceWPs[i][1]+irand(-3,3), AllianceWPs[i][2]); + Start(false, true, true); + SetDespawnAtEnd(false); } } } @@ -928,7 +924,7 @@ struct mob_crypt_fiendAI : public hyjal_trashAI { mob_crypt_fiendAI(Creature* c) : hyjal_trashAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); go = false; pos = 0; Reset(); @@ -960,7 +956,7 @@ struct mob_crypt_fiendAI : public hyjal_trashAI } } - void Aggro(Unit* who) {} + void EnterCombat(Unit* who) {} void UpdateAI(const uint32 diff) { @@ -977,15 +973,15 @@ struct mob_crypt_fiendAI : public hyjal_trashAI if (pInstance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, use horde WPs { for (uint8 i = 0; i < 8; ++i) - ((npc_escortAI*)(m_creature->AI()))->AddWaypoint(i, HordeWPs[i][0]+irand(-3,3), HordeWPs[i][1]+irand(-3,3), HordeWPs[i][2]); - ((npc_escortAI*)(m_creature->AI()))->Start(false, true, true); - ((npc_escortAI*)(m_creature->AI()))->SetDespawnAtEnd(false); + AddWaypoint(i, HordeWPs[i][0]+irand(-3,3), HordeWPs[i][1]+irand(-3,3), HordeWPs[i][2]); + Start(false, true, true); + SetDespawnAtEnd(false); }else//use alliance WPs { for (uint8 i = 0; i < 8; ++i) - ((npc_escortAI*)(m_creature->AI()))->AddWaypoint(i, AllianceWPs[i][0]+irand(-3,3), AllianceWPs[i][1]+irand(-3,3), AllianceWPs[i][2]); - ((npc_escortAI*)(m_creature->AI()))->Start(false, true, true); - ((npc_escortAI*)(m_creature->AI()))->SetDespawnAtEnd(false); + AddWaypoint(i, AllianceWPs[i][0]+irand(-3,3), AllianceWPs[i][1]+irand(-3,3), AllianceWPs[i][2]); + Start(false, true, true); + SetDespawnAtEnd(false); } } @@ -1014,7 +1010,7 @@ struct mob_fel_stalkerAI : public hyjal_trashAI { mob_fel_stalkerAI(Creature* c) : hyjal_trashAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); go = false; pos = 0; Reset(); @@ -1046,7 +1042,7 @@ struct mob_fel_stalkerAI : public hyjal_trashAI } } - void Aggro(Unit* who) {} + void EnterCombat(Unit* who) {} void UpdateAI(const uint32 diff) { @@ -1063,15 +1059,15 @@ struct mob_fel_stalkerAI : public hyjal_trashAI if (pInstance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, use horde WPs { for (uint8 i = 0; i < 8; ++i) - ((npc_escortAI*)(m_creature->AI()))->AddWaypoint(i, HordeWPs[i][0]+irand(-3,3), HordeWPs[i][1]+irand(-3,3), HordeWPs[i][2]); - ((npc_escortAI*)(m_creature->AI()))->Start(false, true, true); - ((npc_escortAI*)(m_creature->AI()))->SetDespawnAtEnd(false); + AddWaypoint(i, HordeWPs[i][0]+irand(-3,3), HordeWPs[i][1]+irand(-3,3), HordeWPs[i][2]); + Start(false, true, true); + SetDespawnAtEnd(false); }else//use alliance WPs { for (uint8 i = 0; i < 8; ++i) - ((npc_escortAI*)(m_creature->AI()))->AddWaypoint(i, AllianceWPs[i][0]+irand(-3,3), AllianceWPs[i][1]+irand(-3,3), AllianceWPs[i][2]); - ((npc_escortAI*)(m_creature->AI()))->Start(false, true, true); - ((npc_escortAI*)(m_creature->AI()))->SetDespawnAtEnd(false); + AddWaypoint(i, AllianceWPs[i][0]+irand(-3,3), AllianceWPs[i][1]+irand(-3,3), AllianceWPs[i][2]); + Start(false, true, true); + SetDespawnAtEnd(false); } } @@ -1100,7 +1096,7 @@ struct mob_frost_wyrmAI : public hyjal_trashAI { mob_frost_wyrmAI(Creature* c) : hyjal_trashAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); go = false; pos = 0; Reset(); @@ -1115,7 +1111,7 @@ struct mob_frost_wyrmAI : public hyjal_trashAI { FrostBreathTimer = 5000; MoveTimer = 0; - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT + MOVEMENTFLAG_LEVITATING); + m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); } void WaypointReached(uint32 i) @@ -1144,14 +1140,14 @@ struct mob_frost_wyrmAI : public hyjal_trashAI m_creature->Relocate(x,y,z,0); } - void Aggro(Unit* who) {} + void EnterCombat(Unit* who) {} void UpdateAI(const uint32 diff) { hyjal_trashAI::UpdateAI(diff); if(IsEvent || IsOverrun) { - ((hyjal_trashAI*)m_creature->AI())->SetCanMelee(false); + CAST_AI(hyjal_trashAI, m_creature->AI())->SetCanMelee(false); npc_escortAI::UpdateAI(diff); } if (IsEvent) @@ -1164,14 +1160,14 @@ struct mob_frost_wyrmAI : public hyjal_trashAI if(!useFlyPath) { for (uint8 i = 0; i < 3; ++i) - ((npc_escortAI*)(m_creature->AI()))->AddWaypoint(i, FrostWyrmWPs[i][0], FrostWyrmWPs[i][1], FrostWyrmWPs[i][2]); - ((npc_escortAI*)(m_creature->AI()))->Start(false, true, true); - ((npc_escortAI*)(m_creature->AI()))->SetDespawnAtEnd(false); + AddWaypoint(i, FrostWyrmWPs[i][0], FrostWyrmWPs[i][1], FrostWyrmWPs[i][2]); + Start(false, true, true); + SetDespawnAtEnd(false); }else{//fly path FlyPathWPs for (uint8 i = 0; i < 3; ++i) - ((npc_escortAI*)(m_creature->AI()))->AddWaypoint(i, FlyPathWPs[i][0]+irand(-10,10), FlyPathWPs[i][1]+irand(-10,10), FlyPathWPs[i][2]); - ((npc_escortAI*)(m_creature->AI()))->Start(false, true, true); - ((npc_escortAI*)(m_creature->AI()))->SetDespawnAtEnd(false); + AddWaypoint(i, FlyPathWPs[i][0]+irand(-10,10), FlyPathWPs[i][1]+irand(-10,10), FlyPathWPs[i][2]); + Start(false, true, true); + SetDespawnAtEnd(false); } } } @@ -1211,7 +1207,7 @@ struct mob_gargoyleAI : public hyjal_trashAI { mob_gargoyleAI(Creature* c) : hyjal_trashAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); go = false; pos = 0; DummyTarget[0] = 0;DummyTarget[1] = 0;DummyTarget[2] = 0; @@ -1231,7 +1227,7 @@ struct mob_gargoyleAI : public hyjal_trashAI Zpos = 10.0; StrikeTimer = 2000+rand()%5000; MoveTimer = 0; - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT + MOVEMENTFLAG_LEVITATING); + m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); } void WaypointReached(uint32 i) @@ -1263,7 +1259,7 @@ struct mob_gargoyleAI : public hyjal_trashAI hyjal_trashAI::UpdateAI(diff); if(IsEvent || IsOverrun) { - ((hyjal_trashAI*)m_creature->AI())->SetCanMelee(false); + CAST_AI(hyjal_trashAI, m_creature->AI())->SetCanMelee(false); npc_escortAI::UpdateAI(diff); } if (IsEvent) @@ -1276,14 +1272,14 @@ struct mob_gargoyleAI : public hyjal_trashAI if(!useFlyPath) { for (uint8 i = 0; i < 3; ++i) - ((npc_escortAI*)(m_creature->AI()))->AddWaypoint(i, GargoyleWPs[i][0]+irand(-10,10), GargoyleWPs[i][1]+irand(-10,10), GargoyleWPs[i][2]); - ((npc_escortAI*)(m_creature->AI()))->Start(false, true, true); - ((npc_escortAI*)(m_creature->AI()))->SetDespawnAtEnd(false); + AddWaypoint(i, GargoyleWPs[i][0]+irand(-10,10), GargoyleWPs[i][1]+irand(-10,10), GargoyleWPs[i][2]); + Start(false, true, true); + SetDespawnAtEnd(false); }else{//fly path FlyPathWPs for (uint8 i = 0; i < 3; ++i) - ((npc_escortAI*)(m_creature->AI()))->AddWaypoint(i, FlyPathWPs[i][0]+irand(-10,10), FlyPathWPs[i][1]+irand(-10,10), FlyPathWPs[i][2]); - ((npc_escortAI*)(m_creature->AI()))->Start(false, true, true); - ((npc_escortAI*)(m_creature->AI()))->SetDespawnAtEnd(false); + AddWaypoint(i, FlyPathWPs[i][0]+irand(-10,10), FlyPathWPs[i][1]+irand(-10,10), FlyPathWPs[i][2]); + Start(false, true, true); + SetDespawnAtEnd(false); } } } @@ -1350,7 +1346,7 @@ struct TRINITY_DLL_DECL alliance_riflemanAI : public Scripted_NoMovementAI uint32 ExplodeTimer; - void JustDied(Unit*) + void JustDied(Unit* who) { } @@ -1374,7 +1370,7 @@ struct TRINITY_DLL_DECL alliance_riflemanAI : public Scripted_NoMovementAI } } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal_trash.h b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal_trash.h index bbc2f6663a8..30b84c2e180 100644 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal_trash.h +++ b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal_trash.h @@ -11,12 +11,6 @@ struct TRINITY_DLL_DECL hyjal_trashAI : public npc_escortAI { hyjal_trashAI(Creature *c); - void Reset(); - - //void EnterEvadeMode(); - - void Aggro(Unit *who); - void UpdateAI(const uint32 diff); void JustDied(Unit* killer); diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/instance_hyjal.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/instance_hyjal.cpp index ccfdcf2eb31..cdcd6cb6b66 100644 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/instance_hyjal.cpp +++ b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/instance_hyjal.cpp @@ -1,4 +1,4 @@ - /* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> + /* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -39,6 +39,9 @@ struct TRINITY_DLL_DECL instance_mount_hyjal : public ScriptedInstance { instance_mount_hyjal(Map *map) : ScriptedInstance(map) {Initialize();}; + uint32 Encounters[ENCOUNTERS]; + std::string str_data; + uint64 RageWinterchill; uint64 Anetheron; uint64 Kazrogal; @@ -51,7 +54,7 @@ struct TRINITY_DLL_DECL instance_mount_hyjal : public ScriptedInstance uint64 ElfGate; uint32 Trash; - uint32 Encounters[ENCOUNTERS]; + uint32 hordeRetreat; uint32 allianceRetreat; @@ -98,29 +101,28 @@ struct TRINITY_DLL_DECL instance_mount_hyjal : public ScriptedInstance case 182060: HordeGate = go->GetGUID(); if(allianceRetreat) - go->SetGoState(0); + go->SetGoState(GO_STATE_ACTIVE); else - go->SetGoState(1); + go->SetGoState(GO_STATE_READY); break; case 182061: ElfGate = go->GetGUID(); if(hordeRetreat) - go->SetGoState(0); + go->SetGoState(GO_STATE_ACTIVE); else - go->SetGoState(1); + go->SetGoState(GO_STATE_READY); break; } } void OpenDoor(uint64 DoorGUID, bool open) { - if(GameObject *Door = instance->GetGameObjectInMap(DoorGUID)) - Door->SetUInt32Value(GAMEOBJECT_STATE, open ? 0 : 1); + HandleGameObject(DoorGUID, open, NULL); } void OnCreatureCreate(Creature *creature, uint32 creature_entry) { - switch(creature_entry) + switch(creature->GetEntry()) { case 17767: RageWinterchill = creature->GetGUID(); break; case 17808: Anetheron = creature->GetGUID(); break; @@ -167,7 +169,7 @@ struct TRINITY_DLL_DECL instance_mount_hyjal : public ScriptedInstance if(ArchiYell)break; ArchiYell = true; - Creature* pCreature = instance->GetCreatureInMap(Azgalor); + Creature* pCreature = instance->GetCreature(Azgalor); if(pCreature) { Creature* pUnit = pCreature->SummonCreature(21987,pCreature->GetPositionX(),pCreature->GetPositionY(),pCreature->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN,10000); @@ -229,7 +231,21 @@ struct TRINITY_DLL_DECL instance_mount_hyjal : public ScriptedInstance debug_log("TSCR: Instance Hyjal: Instance data updated for event %u (Data=%u)",type,data); if(data == DONE) + { + OUT_SAVE_INST_DATA; + + std::ostringstream saveStream; + saveStream << Encounters[0] << " " << Encounters[1] << " " << Encounters[2] << " " + << Encounters[3] << " " << Encounters[4] + << " " << allianceRetreat << " " << hordeRetreat + << " " << RaidDamage; + + str_data = saveStream.str(); + SaveToDB(); + OUT_SAVE_INST_DATA_COMPLETE; + } + } uint32 GetData(uint32 type) @@ -263,21 +279,9 @@ struct TRINITY_DLL_DECL instance_mount_hyjal : public ScriptedInstance }else debug_log("TSCR: Instance Hyjal: UpdateWorldState, but PlayerList is empty!"); } - const char* Save() + std::string GetSaveData() { - OUT_SAVE_INST_DATA; - std::ostringstream stream; - stream << Encounters[0] << " " << Encounters[1] << " " << Encounters[2] << " " - << Encounters[3] << " " << Encounters[4] << " " << allianceRetreat << " " << hordeRetreat << " " << RaidDamage; - char* out = new char[stream.str().length() + 1]; - strcpy(out, stream.str().c_str()); - if(out) - { - OUT_SAVE_INST_DATA_COMPLETE; - return out; - } - - return NULL; + return str_data.c_str(); } void Load(const char* in) @@ -289,8 +293,7 @@ struct TRINITY_DLL_DECL instance_mount_hyjal : public ScriptedInstance } OUT_LOAD_INST_DATA(in); - std::istringstream loadStream; - loadStream.str(in); + std::istringstream loadStream(in); loadStream >> Encounters[0] >> Encounters[1] >> Encounters[2] >> Encounters[3] >> Encounters[4] >> allianceRetreat >> hordeRetreat >> RaidDamage; for(uint8 i = 0; i < ENCOUNTERS; ++i) if(Encounters[i] == IN_PROGRESS) // Do not load an encounter as IN_PROGRESS - reset it instead. diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/boss_captain_skarloc.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/boss_captain_skarloc.cpp index ab3a61ffe0b..feff5debf3e 100644 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/boss_captain_skarloc.cpp +++ b/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/boss_captain_skarloc.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -42,7 +42,7 @@ struct TRINITY_DLL_DECL boss_captain_skarlocAI : public ScriptedAI { boss_captain_skarlocAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } ScriptedInstance *pInstance; @@ -56,15 +56,15 @@ struct TRINITY_DLL_DECL boss_captain_skarlocAI : public ScriptedAI void Reset() { - Holy_Light_Timer = 30000; + Holy_Light_Timer = 20000 + rand()%10000; Cleanse_Timer = 10000; - HammerOfJustice_Timer = 60000; + HammerOfJustice_Timer = 20000 + rand()%15000; HolyShield_Timer = 240000; DevotionAura_Timer = 3000; Consecration_Timer = 8000; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { //This is not correct. Should taunt Thrall before engage in combat DoScriptText(SAY_TAUNT1, m_creature); @@ -126,14 +126,14 @@ struct TRINITY_DLL_DECL boss_captain_skarlocAI : public ScriptedAI if (DevotionAura_Timer < diff) { DoCast(m_creature, SPELL_DEVOTION_AURA); - DevotionAura_Timer = 60000; + DevotionAura_Timer = 45000 + rand()%10000; }else DevotionAura_Timer -= diff; //Consecration if (Consecration_Timer < diff) { //DoCast(m_creature->getVictim(), SPELL_CONSECRATION); - Consecration_Timer = 8000; + Consecration_Timer = 5000 + rand()%5000; }else Consecration_Timer -= diff; DoMeleeAttackIfReady(); diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/boss_epoch_hunter.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/boss_epoch_hunter.cpp index 39d42413c5f..26e1cb57e1a 100644 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/boss_epoch_hunter.cpp +++ b/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/boss_epoch_hunter.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -44,7 +44,7 @@ struct TRINITY_DLL_DECL boss_epoch_hunterAI : public ScriptedAI { boss_epoch_hunterAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } ScriptedInstance *pInstance; @@ -56,13 +56,13 @@ struct TRINITY_DLL_DECL boss_epoch_hunterAI : public ScriptedAI void Reset() { - SandBreath_Timer = 25000; - ImpendingDeath_Timer = 30000; + SandBreath_Timer = 8000 + rand()%8000; + ImpendingDeath_Timer = 25000 + rand()%5000; WingBuffet_Timer = 35000; Mda_Timer = 40000; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { switch(rand()%2) { @@ -108,13 +108,13 @@ struct TRINITY_DLL_DECL boss_epoch_hunterAI : public ScriptedAI case 1: DoScriptText(SAY_BREATH2, m_creature); break; } - SandBreath_Timer = 25000+rand()%5000; + SandBreath_Timer = 10000 + rand()%10000; }else SandBreath_Timer -= diff; if (ImpendingDeath_Timer < diff) { DoCast(m_creature->getVictim(),SPELL_IMPENDING_DEATH); - ImpendingDeath_Timer = 30000+rand()%5000; + ImpendingDeath_Timer = 25000+rand()%5000; }else ImpendingDeath_Timer -= diff; if (WingBuffet_Timer < diff) diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/boss_leutenant_drake.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/boss_leutenant_drake.cpp index 67d0db45872..e219c8f72a6 100644 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/boss_leutenant_drake.cpp +++ b/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/boss_leutenant_drake.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -31,7 +31,7 @@ EndScriptData */ bool GOHello_go_barrel_old_hillsbrad(Player *player, GameObject* _GO) { - ScriptedInstance* pInstance = (ScriptedInstance*)_GO->GetInstanceData(); + ScriptedInstance* pInstance = _GO->GetInstanceData(); if (!pInstance) return false; @@ -115,7 +115,7 @@ struct TRINITY_DLL_DECL boss_lieutenant_drakeAI : public ScriptedAI ExplodingShout_Timer = 25000; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { DoScriptText(SAY_AGGRO, m_creature); } @@ -159,7 +159,7 @@ struct TRINITY_DLL_DECL boss_lieutenant_drakeAI : public ScriptedAI { DoScriptText(SAY_SHOUT, m_creature); DoCast(m_creature->getVictim(), SPELL_FRIGHTENING_SHOUT); - Fear_Timer = 30000+rand()%10000; + Fear_Timer = 25000+rand()%10000; }else Fear_Timer -= diff; //Mortal Strike @@ -167,7 +167,7 @@ struct TRINITY_DLL_DECL boss_lieutenant_drakeAI : public ScriptedAI { DoScriptText(SAY_MORTAL, m_creature); DoCast(m_creature->getVictim(), SPELL_MORTAL_STRIKE); - MortalStrike_Timer = 45000+rand()%5000; + MortalStrike_Timer = 20000+rand()%10000; }else MortalStrike_Timer -= diff; DoMeleeAttackIfReady(); diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/def_old_hillsbrad.h b/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/def_old_hillsbrad.h index b60f8eee565..3253a384217 100644 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/def_old_hillsbrad.h +++ b/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/def_old_hillsbrad.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * This program is free software licensed under GPL version 2 * Please see the included DOCS/LICENSE.TXT for more information */ diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/instance_old_hillsbrad.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/instance_old_hillsbrad.cpp index 330d7d5c62a..3c34e42cee5 100644 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/instance_old_hillsbrad.cpp +++ b/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/instance_old_hillsbrad.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -98,7 +98,7 @@ struct TRINITY_DLL_DECL instance_old_hillsbrad : public ScriptedInstance void OnCreatureCreate(Creature *creature, uint32 creature_entry) { - switch(creature_entry) + switch(creature->GetEntry()) { case THRALL_ENTRY: ThrallGUID = creature->GetGUID(); diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/old_hillsbrad.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/old_hillsbrad.cpp index c350990cde7..ec01c32b5a3 100644 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/old_hillsbrad.cpp +++ b/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/old_hillsbrad.cpp @@ -1,4 +1,4 @@ - /* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> + /* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -22,7 +22,6 @@ SDCategory: Caverns of Time, Old Hillsbrad Foothills EndScriptData */ /* ContentData -npc_brazen npc_erozion npc_thrall_old_hillsbrad npc_taretha @@ -39,38 +38,6 @@ EndContentData */ #define ITEM_ENTRY_BOMBS 25853 /*###### -## npc_brazen -######*/ - -bool GossipHello_npc_brazen(Player *player, Creature *_Creature) -{ - player->ADD_GOSSIP_ITEM(0, "I am ready to go to Durnholde Keep.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID()); - return true; -} - -bool GossipSelect_npc_brazen(Player *player, Creature *_Creature, uint32 sender, uint32 action ) -{ - if (action == GOSSIP_ACTION_INFO_DEF+1) - { - if( !player->HasItemCount(ITEM_ENTRY_BOMBS,1) ) - player->SEND_GOSSIP_MENU(9780, _Creature->GetGUID()); - else - { - player->CLOSE_GOSSIP_MENU(); - - std::vector<uint32> nodes; - - nodes.resize(2); - nodes[0] = 115; //from brazen - nodes[1] = 116; //end outside durnholde - player->ActivateTaxiPathTo(nodes); //TaxiPath 534 - } - } - return true; -} - -/*###### ## npc_erozion ######*/ @@ -79,7 +46,7 @@ bool GossipHello_npc_erozion(Player *player, Creature *_Creature) if( _Creature->isQuestGiver() ) player->PrepareQuestMenu( _Creature->GetGUID() ); - ScriptedInstance* pInstance = ((ScriptedInstance*)_Creature->GetInstanceData()); + ScriptedInstance* pInstance = (_Creature->GetInstanceData()); if( pInstance && pInstance->GetData(TYPE_BARREL_DIVERSION) != DONE && !player->HasItemCount(ITEM_ENTRY_BOMBS,1) ) player->ADD_GOSSIP_ITEM( 0, "I need a pack of Incendiary Bombs.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); @@ -210,7 +177,7 @@ struct TRINITY_DLL_DECL npc_thrall_old_hillsbradAI : public npc_escortAI { npc_thrall_old_hillsbradAI(Creature *c) : npc_escortAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); m_creature->setActive(true); } @@ -229,24 +196,23 @@ struct TRINITY_DLL_DECL npc_thrall_old_hillsbradAI : public npc_escortAI switch( i ) { case 8: - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + SetRun(false); m_creature->SummonCreature(18764,2181.87,112.46,89.45,0.26,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); break; case 9: DoScriptText(SAY_TH_ARMORY, m_creature); - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, THRALL_WEAPON_MODEL); - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO, THRALL_WEAPON_INFO); - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+1, 781); - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY+1, THRALL_SHIELD_MODEL); - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+2, THRALL_SHIELD_INFO); - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+3, 1038); + m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, THRALL_WEAPON_MODEL); + //m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO, THRALL_WEAPON_INFO); + //m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+1, 781); + m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, THRALL_SHIELD_MODEL); + //m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+2, THRALL_SHIELD_INFO); + //m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+3, 1038); break; case 10: m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, THRALL_MODEL_EQUIPPED); break; case 11: - m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + SetRun(); break; case 15: m_creature->SummonCreature(MOB_ENTRY_RIFLE,2200.28,137.37,87.93,5.07,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); @@ -274,12 +240,12 @@ struct TRINITY_DLL_DECL npc_thrall_old_hillsbradAI : public npc_escortAI case 30: IsOnHold = true; m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + SetRun(false); break; case 31: DoScriptText(SAY_TH_MOUNTS_UP, m_creature); - m_creature->HandleEmoteCommand(EMOTE_ONESHOT_TALK); DoMount(); + SetRun(); break; case 37: //possibly regular patrollers? If so, remove this and let database handle them @@ -291,6 +257,7 @@ struct TRINITY_DLL_DECL npc_thrall_old_hillsbradAI : public npc_escortAI m_creature->SummonCreature(SKARLOC_MOUNT,2488.64,625.77,58.26,4.71,TEMPSUMMON_TIMED_DESPAWN,10000); DoUnmount(); HadMount = false; + SetRun(false); break; case 60: m_creature->HandleEmoteCommand(EMOTE_ONESHOT_EXCLAMATION); @@ -298,9 +265,10 @@ struct TRINITY_DLL_DECL npc_thrall_old_hillsbradAI : public npc_escortAI IsOnHold = true; m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); pInstance->SetData(TYPE_THRALL_PART2, DONE); + SetRun(); break; case 64: - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + SetRun(false); break; case 68: m_creature->SummonCreature(MOB_ENTRY_BARN_PROTECTOR,2500.22,692.60,55.50,2.84,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); @@ -309,10 +277,10 @@ struct TRINITY_DLL_DECL npc_thrall_old_hillsbradAI : public npc_escortAI m_creature->SummonCreature(MOB_ENTRY_BARN_GUARDSMAN,2500.94,695.81,55.50,3.14,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); break; case 71: - m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + SetRun(); break; case 81: - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + SetRun(false); break; case 83: m_creature->SummonCreature(MOB_ENTRY_CHURCH_PROTECTOR,2627.33,646.82,56.03,4.28,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,5000); @@ -322,9 +290,11 @@ struct TRINITY_DLL_DECL npc_thrall_old_hillsbradAI : public npc_escortAI break; case 84: DoScriptText(SAY_TH_CHURCH_END, m_creature); + SetRun(); break; case 91: m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + SetRun(false); break; case 93: m_creature->SummonCreature(MOB_ENTRY_INN_PROTECTOR,2652.71,660.31,61.93,1.67,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); @@ -333,7 +303,6 @@ struct TRINITY_DLL_DECL npc_thrall_old_hillsbradAI : public npc_escortAI m_creature->SummonCreature(MOB_ENTRY_INN_GUARDSMAN,2656.39,659.77,61.93,2.61,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); break; case 94: - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); if (uint64 TarethaGUID = pInstance->GetData64(DATA_TARETHA)) { if (Unit* Taretha = Unit::GetUnit((*m_creature), TarethaGUID)) @@ -347,12 +316,10 @@ struct TRINITY_DLL_DECL npc_thrall_old_hillsbradAI : public npc_escortAI break; case 96: DoScriptText(SAY_TH_EPOCH_WONDER, m_creature); - m_creature->HandleEmoteCommand(EMOTE_ONESHOT_TALK); break; case 97: DoScriptText(SAY_TH_EPOCH_KILL_TARETHA, m_creature); - m_creature->HandleEmoteCommand(EMOTE_ONESHOT_EXCLAMATION); - m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + SetRun(); break; case 98: //trigger epoch Yell("Thrall! Come outside and face your fate! ....") @@ -368,7 +335,7 @@ struct TRINITY_DLL_DECL npc_thrall_old_hillsbradAI : public npc_escortAI if (uint64 TarethaGUID = pInstance->GetData64(DATA_TARETHA)) { if (Creature* Taretha = (Unit::GetCreature(*m_creature, TarethaGUID))) - ((npc_escortAI*)(Taretha->AI()))->Start(false, false, true, PlayerGUID); + CAST_AI(npc_escortAI, (Taretha->AI()))->Start(false, false, true, PlayerGUID); } //kill credit creature for quest @@ -406,12 +373,8 @@ struct TRINITY_DLL_DECL npc_thrall_old_hillsbradAI : public npc_escortAI { DoUnmount(); HadMount = false; - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, 0); - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO, 0); - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+1, 0); - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY+1, 0); - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+2, 0); - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+3, 0); + m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, 0); + m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, 0); m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, THRALL_MODEL_UNEQUIPPED); } if( IsBeingEscorted ) @@ -433,14 +396,13 @@ struct TRINITY_DLL_DECL npc_thrall_old_hillsbradAI : public npc_escortAI { m_creature->Mount(SKARLOC_MOUNT_MODEL); m_creature->SetSpeed(MOVE_RUN,SPEED_MOUNT); - m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); } void DoUnmount() { m_creature->Unmount(); m_creature->SetSpeed(MOVE_RUN,SPEED_RUN); } - void Aggro(Unit* who) + void EnterCombat(Unit* who) { switch(rand()%4) { @@ -522,156 +484,9 @@ CreatureAI* GetAI_npc_thrall_old_hillsbrad(Creature *_Creature) { npc_thrall_old_hillsbradAI* thrall_walkAI = new npc_thrall_old_hillsbradAI(_Creature); - thrall_walkAI->AddWaypoint(0, 2230.91, 118.765, 82.2947,5000); - thrall_walkAI->AddWaypoint(1, 2230.33, 114.980, 82.2946); - thrall_walkAI->AddWaypoint(2, 2233.36, 111.057, 82.2996); - thrall_walkAI->AddWaypoint(3, 2231.17, 108.486, 82.6624); - thrall_walkAI->AddWaypoint(4, 2220.22, 114.605, 89.4264); - thrall_walkAI->AddWaypoint(5, 2215.23, 115.990, 89.4549); - thrall_walkAI->AddWaypoint(6, 2210.00, 106.849, 89.4549); - thrall_walkAI->AddWaypoint(7, 2205.66, 105.234, 89.4549); - //spawn armorer - thrall_walkAI->AddWaypoint(8, 2192.26, 112.618, 89.4549); - - //get weapon - thrall_walkAI->AddWaypoint(9, 2181.28, 118.612, 89.4549,8000); - //get armor - thrall_walkAI->AddWaypoint(10, 2181.62, 120.385, 89.4549,5000); - - thrall_walkAI->AddWaypoint(11, 2189.44, 113.922, 89.4549); - thrall_walkAI->AddWaypoint(12, 2195.63, 110.584, 89.4549); - thrall_walkAI->AddWaypoint(13, 2201.09, 115.115, 89.4549); - thrall_walkAI->AddWaypoint(14, 2204.34, 121.036, 89.4355); - //first ambush - thrall_walkAI->AddWaypoint(15, 2208.66, 129.127, 87.9560); - thrall_walkAI->AddWaypoint(16, 2193.09, 137.940, 88.2164); - thrall_walkAI->AddWaypoint(17, 2173.39, 149.064, 87.9227); - thrall_walkAI->AddWaypoint(18, 2164.25, 137.965, 85.0595); - thrall_walkAI->AddWaypoint(19, 2149.31, 125.645, 77.0858); - thrall_walkAI->AddWaypoint(20, 2142.78, 127.173, 75.5954); - //second ambush - thrall_walkAI->AddWaypoint(21, 2139.28, 133.952, 73.6386); - thrall_walkAI->AddWaypoint(22, 2139.54, 155.235, 67.1269); - thrall_walkAI->AddWaypoint(23, 2145.38, 167.551, 64.8974); - thrall_walkAI->AddWaypoint(24, 2134.28, 175.304, 67.9446); - thrall_walkAI->AddWaypoint(25, 2118.08, 187.387, 68.8141); - //third ambush - thrall_walkAI->AddWaypoint(26, 2105.88, 195.461, 65.1854); - thrall_walkAI->AddWaypoint(27, 2096.77, 196.939, 65.2117); - thrall_walkAI->AddWaypoint(28, 2083.90, 209.395, 64.8736); - //in front of keeps gate, meeting scarloc - thrall_walkAI->AddWaypoint(29, 2067.84, 224.376, 64.8022,30000); - - //ref point after skarloc fight - thrall_walkAI->AddWaypoint(30, 2055.40, 242.90, 63.3418); - - //mount up! - thrall_walkAI->AddWaypoint(31, 2039.20, 266.460, 63.0182,10000); - thrall_walkAI->AddWaypoint(32, 2011.77, 278.478, 65.3388); - thrall_walkAI->AddWaypoint(33, 2005.08, 289.676, 66.1179); - thrall_walkAI->AddWaypoint(34, 2033.11, 337.450, 66.0948); - thrall_walkAI->AddWaypoint(35, 2070.30, 416.208, 66.0893); - thrall_walkAI->AddWaypoint(36, 2086.76, 469.768, 65.9182); - //possible road ambush - thrall_walkAI->AddWaypoint(37, 2101.70, 497.955, 61.7881); - - thrall_walkAI->AddWaypoint(38, 2133.39, 530.933, 55.3700,5000); - thrall_walkAI->AddWaypoint(39, 2157.91, 559.635, 48.5157); - thrall_walkAI->AddWaypoint(40, 2167.34, 586.191, 42.4394); - thrall_walkAI->AddWaypoint(41, 2174.17, 637.643, 33.9002); - thrall_walkAI->AddWaypoint(42, 2179.31, 656.053, 34.723); - thrall_walkAI->AddWaypoint(43, 2183.65, 670.941, 34.0318); - thrall_walkAI->AddWaypoint(44, 2201.50, 668.616, 36.1236); - thrall_walkAI->AddWaypoint(45, 2221.56, 652.747, 36.6153); - thrall_walkAI->AddWaypoint(46, 2238.97, 640.125, 37.2214); - thrall_walkAI->AddWaypoint(47, 2251.17, 620.574, 40.1473); - thrall_walkAI->AddWaypoint(48, 2261.98, 595.303, 41.4117); - thrall_walkAI->AddWaypoint(49, 2278.67, 560.172, 38.9090); - thrall_walkAI->AddWaypoint(50, 2336.72, 528.327, 40.9369); - thrall_walkAI->AddWaypoint(51, 2381.04, 519.612, 37.7312); - thrall_walkAI->AddWaypoint(52, 2412.20, 515.425, 39.2068); - thrall_walkAI->AddWaypoint(53, 2452.39, 516.174, 42.9387); - thrall_walkAI->AddWaypoint(54, 2467.38, 539.389, 47.4992); - thrall_walkAI->AddWaypoint(55, 2470.70, 554.333, 46.6668); - thrall_walkAI->AddWaypoint(56, 2478.07, 575.321, 55.4549); - thrall_walkAI->AddWaypoint(57, 2480.00, 585.408, 56.6921); - thrall_walkAI->AddWaypoint(58, 2482.67, 608.817, 55.6643); - //demount - thrall_walkAI->AddWaypoint(59, 2485.62, 626.061, 58.0132,2000); - //scare the shit out of horse, so it'll run off - thrall_walkAI->AddWaypoint(60, 2486.91, 626.356, 58.0761); - - thrall_walkAI->AddWaypoint(61, 2488.58, 660.940, 57.3913); - thrall_walkAI->AddWaypoint(62, 2502.56, 686.059, 55.6252); - thrall_walkAI->AddWaypoint(63, 2502.08, 694.360, 55.5083); - thrall_walkAI->AddWaypoint(64, 2491.46, 694.321, 55.7163); - thrall_walkAI->AddWaypoint(65, 2491.10, 703.300, 55.7630); - thrall_walkAI->AddWaypoint(66, 2485.64, 702.992, 55.7917); - - thrall_walkAI->AddWaypoint(67, 2479.10, 695.291, 55.7901,10000); - //spawn mobs - thrall_walkAI->AddWaypoint(68, 2476.75, 693.689, 55.7960); - thrall_walkAI->AddWaypoint(69, 2475.39, 695.983, 55.8146); - thrall_walkAI->AddWaypoint(70, 2477.75, 694.473, 55.7945); - //meet mobs in doorway - thrall_walkAI->AddWaypoint(71, 2481.27, 697.747, 55.7910); - - thrall_walkAI->AddWaypoint(72, 2486.31, 703.131, 55.7861,5000); - thrall_walkAI->AddWaypoint(73, 2490.76, 703.511, 55.7662); - thrall_walkAI->AddWaypoint(74, 2491.30, 694.792, 55.7195); - thrall_walkAI->AddWaypoint(75, 2518.69, 693.876, 55.1383); - thrall_walkAI->AddWaypoint(76, 2531.33, 681.914, 55.1383); - thrall_walkAI->AddWaypoint(77, 2568.25, 682.654, 55.1778); - thrall_walkAI->AddWaypoint(78, 2589.61, 689.981, 55.1421); - thrall_walkAI->AddWaypoint(79, 2634.74, 679.833, 54.6613); - thrall_walkAI->AddWaypoint(80, 2630.41, 661.464, 54.2761); - thrall_walkAI->AddWaypoint(81, 2629.00, 656.982, 56.0651); - //stop in church - thrall_walkAI->AddWaypoint(82, 2620.84, 633.007, 56.0300,3000); - //summon - thrall_walkAI->AddWaypoint(83, 2622.99, 639.178, 56.0300); - - thrall_walkAI->AddWaypoint(84, 2628.73, 656.693, 56.0610,5000); - thrall_walkAI->AddWaypoint(85, 2630.34, 661.135, 54.2738); - thrall_walkAI->AddWaypoint(86, 2635.38, 672.243, 54.4508); - thrall_walkAI->AddWaypoint(87, 2644.13, 668.158, 55.3797); - thrall_walkAI->AddWaypoint(88, 2646.82, 666.740, 56.9898); - thrall_walkAI->AddWaypoint(89, 2658.22, 665.432, 57.1725); - thrall_walkAI->AddWaypoint(90, 2661.88, 674.849, 57.1725); - thrall_walkAI->AddWaypoint(91, 2656.23, 677.208, 57.1725); - - thrall_walkAI->AddWaypoint(92, 2652.28, 670.270, 61.9353); - //summon inn - thrall_walkAI->AddWaypoint(93, 2650.79, 664.290, 61.9302); - thrall_walkAI->AddWaypoint(94, 2658.19, 660.454, 61.9320,5000); - //speak with Taretha - thrall_walkAI->AddWaypoint(95, 2660.57, 659.173, 61.9370); - - //epoch calls - thrall_walkAI->AddWaypoint(96, 2658.19, 660.454, 61.9320,5000); - //taretha "dies" - thrall_walkAI->AddWaypoint(97, 2659.84, 659.482, 61.9361,5000); - - thrall_walkAI->AddWaypoint(98, 2654.28, 662.722, 61.9313); - thrall_walkAI->AddWaypoint(99, 2652.37, 670.561, 61.9368); - thrall_walkAI->AddWaypoint(100, 2656.05, 676.761, 57.1727); - thrall_walkAI->AddWaypoint(101, 2658.49, 677.166, 57.1727); - thrall_walkAI->AddWaypoint(102, 2659.28, 667.117, 57.1727); - thrall_walkAI->AddWaypoint(103, 2649.71, 665.387, 57.1727); - //he's outside inn here - thrall_walkAI->AddWaypoint(104, 2634.79, 672.964, 54.4577); - - //getting ready here, must start attack before 30secs up - thrall_walkAI->AddWaypoint(105, 2635.06, 673.892, 54.4713,30000); - - //ref point, will move here when all dead and meet Taretha - thrall_walkAI->AddWaypoint(106, 2634.79, 672.964, 54.4577,60000); - - //run off - thrall_walkAI->AddWaypoint(107, 2631.72, 665.629, 54.2923); - thrall_walkAI->AddWaypoint(108, 2647.40, 640.530, 55.7634); - - return (CreatureAI*)thrall_walkAI; + thrall_walkAI->FillPointMovementListForCreature(); + + return thrall_walkAI; } bool GossipHello_npc_thrall_old_hillsbrad(Player *player, Creature *_Creature) @@ -682,7 +497,7 @@ bool GossipHello_npc_thrall_old_hillsbrad(Player *player, Creature *_Creature) player->SendPreparedQuest(_Creature->GetGUID()); } - ScriptedInstance* pInstance = ((ScriptedInstance*)_Creature->GetInstanceData()); + ScriptedInstance* pInstance = (_Creature->GetInstanceData()); if( pInstance ) { if (pInstance->GetData(TYPE_BARREL_DIVERSION) == DONE && !pInstance->GetData(TYPE_THRALL_EVENT)) @@ -708,7 +523,7 @@ bool GossipHello_npc_thrall_old_hillsbrad(Player *player, Creature *_Creature) bool GossipSelect_npc_thrall_old_hillsbrad(Player *player, Creature *_Creature, uint32 sender, uint32 action) { - ScriptedInstance* pInstance = ((ScriptedInstance*)_Creature->GetInstanceData()); + ScriptedInstance* pInstance = (_Creature->GetInstanceData()); switch( action ) { case GOSSIP_ACTION_INFO_DEF+1: @@ -721,10 +536,10 @@ bool GossipSelect_npc_thrall_old_hillsbrad(Player *player, Creature *_Creature, DoScriptText(SAY_TH_START_EVENT_PART1, _Creature); - ((npc_escortAI*)(_Creature->AI()))->Start(true, true, true, player->GetGUID()); - ((npc_escortAI*)(_Creature->AI()))->SetMaxPlayerDistance(100.0f);//not really needed, because it will not despawn if player is too far - ((npc_escortAI*)(_Creature->AI()))->SetDespawnAtEnd(false); - ((npc_escortAI*)(_Creature->AI()))->SetDespawnAtFar(false); + CAST_AI(npc_escortAI, (_Creature->AI()))->Start(true, true, true, player->GetGUID()); + CAST_AI(npc_escortAI, (_Creature->AI()))->SetMaxPlayerDistance(100.0f);//not really needed, because it will not despawn if player is too far + CAST_AI(npc_escortAI, (_Creature->AI()))->SetDespawnAtEnd(false); + CAST_AI(npc_escortAI, (_Creature->AI()))->SetDespawnAtFar(false); break; case GOSSIP_ACTION_INFO_DEF+2: @@ -740,14 +555,14 @@ bool GossipSelect_npc_thrall_old_hillsbrad(Player *player, Creature *_Creature, DoScriptText(SAY_TH_START_EVENT_PART2, _Creature); - ((npc_thrall_old_hillsbradAI*)_Creature->AI())->StartWP(); + CAST_AI(npc_thrall_old_hillsbradAI, _Creature->AI())->StartWP(); break; case GOSSIP_ACTION_INFO_DEF+3: player->CLOSE_GOSSIP_MENU(); if(pInstance) pInstance->SetData(TYPE_THRALL_PART3,IN_PROGRESS); - ((npc_thrall_old_hillsbradAI*)_Creature->AI())->StartWP(); + CAST_AI(npc_thrall_old_hillsbradAI, _Creature->AI())->StartWP(); break; } return true; @@ -766,7 +581,7 @@ struct TRINITY_DLL_DECL npc_tarethaAI : public npc_escortAI { npc_tarethaAI(Creature *c) : npc_escortAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } ScriptedInstance *pInstance; @@ -784,7 +599,7 @@ struct TRINITY_DLL_DECL npc_tarethaAI : public npc_escortAI } } void Reset() {} - void Aggro(Unit* who) {} + void EnterCombat(Unit* who) {} void UpdateAI(const uint32 diff) { @@ -795,21 +610,14 @@ CreatureAI* GetAI_npc_taretha(Creature *_Creature) { npc_tarethaAI* taretha_walkAI = new npc_tarethaAI(_Creature); - taretha_walkAI->AddWaypoint(0, 2650.06, 665.473, 61.9305); - taretha_walkAI->AddWaypoint(1, 2652.44, 670.761, 61.9370); - taretha_walkAI->AddWaypoint(2, 2655.96, 676.913, 57.1725); - taretha_walkAI->AddWaypoint(3, 2659.40, 677.317, 57.1725); - taretha_walkAI->AddWaypoint(4, 2651.75, 664.482, 57.1725); - taretha_walkAI->AddWaypoint(5, 2647.49, 666.595, 57.0824); - taretha_walkAI->AddWaypoint(6, 2644.37, 668.167, 55.4182); - taretha_walkAI->AddWaypoint(7, 2640.96, 669.890, 54.7567,60000); + taretha_walkAI->FillPointMovementListForCreature(); - return (CreatureAI*)taretha_walkAI; + return taretha_walkAI; } bool GossipHello_npc_taretha(Player *player, Creature *_Creature) { - ScriptedInstance* pInstance = ((ScriptedInstance*)_Creature->GetInstanceData()); + ScriptedInstance* pInstance = (_Creature->GetInstanceData()); if( pInstance && pInstance->GetData(TYPE_THRALL_PART3) == DONE && pInstance->GetData(TYPE_THRALL_PART4) == NOT_STARTED) { player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_EPOCH1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); @@ -820,7 +628,7 @@ bool GossipHello_npc_taretha(Player *player, Creature *_Creature) bool GossipSelect_npc_taretha(Player *player, Creature *_Creature, uint32 sender, uint32 action) { - ScriptedInstance* pInstance = ((ScriptedInstance*)_Creature->GetInstanceData()); + ScriptedInstance* pInstance = (_Creature->GetInstanceData()); if( action == GOSSIP_ACTION_INFO_DEF+1 ) { player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_EPOCH2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); @@ -841,7 +649,7 @@ bool GossipSelect_npc_taretha(Player *player, Creature *_Creature, uint32 sender { Creature* Thrall = (Unit::GetCreature((*_Creature), ThrallGUID)); if(Thrall) - ((npc_thrall_old_hillsbradAI*)Thrall->AI())->StartWP(); + CAST_AI(npc_thrall_old_hillsbradAI, Thrall->AI())->StartWP(); } } } @@ -857,12 +665,6 @@ void AddSC_old_hillsbrad() Script *newscript; newscript = new Script; - newscript->Name="npc_brazen"; - newscript->pGossipHello = &GossipHello_npc_brazen; - newscript->pGossipSelect = &GossipSelect_npc_brazen; - newscript->RegisterSelf(); - - newscript = new Script; newscript->Name="npc_erozion"; newscript->pGossipHello = &GossipHello_npc_erozion; newscript->pGossipSelect = &GossipSelect_npc_erozion; diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_fathomlord_karathress.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_fathomlord_karathress.cpp index 7fb9c74be21..5e9afdf5c33 100644 --- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_fathomlord_karathress.cpp +++ b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_fathomlord_karathress.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -95,7 +95,7 @@ struct TRINITY_DLL_DECL boss_fathomlord_karathressAI : public ScriptedAI { boss_fathomlord_karathressAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); Advisors[0] = 0; Advisors[1] = 0; Advisors[2] = 0; @@ -210,7 +210,7 @@ struct TRINITY_DLL_DECL boss_fathomlord_karathressAI : public ScriptedAI m_creature->SummonCreature(SEER_OLUM, OLUM_X, OLUM_Y, OLUM_Z, OLUM_O, TEMPSUMMON_TIMED_DESPAWN, 3600000); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { StartEvent(who); } @@ -218,7 +218,7 @@ struct TRINITY_DLL_DECL boss_fathomlord_karathressAI : public ScriptedAI void UpdateAI(const uint32 diff) { //Only if not incombat check if the event is started - if (!InCombat && pInstance && pInstance->GetData(DATA_KARATHRESSEVENT)) + if (!m_creature->isInCombat() && pInstance && pInstance->GetData(DATA_KARATHRESSEVENT)) { Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_KARATHRESSEVENT_STARTER)); @@ -305,7 +305,7 @@ struct TRINITY_DLL_DECL boss_fathomguard_sharkkisAI : public ScriptedAI { boss_fathomguard_sharkkisAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } ScriptedInstance* pInstance; @@ -329,7 +329,7 @@ struct TRINITY_DLL_DECL boss_fathomguard_sharkkisAI : public ScriptedAI pet = false; - Creature *Pet = (Creature*) Unit::GetUnit(*m_creature, SummonedPet); + Creature *Pet = Unit::GetCreature(*m_creature, SummonedPet); if( Pet && Pet->isAlive() ) { Pet->DealDamage( Pet, Pet->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false ); @@ -346,15 +346,15 @@ struct TRINITY_DLL_DECL boss_fathomguard_sharkkisAI : public ScriptedAI if (pInstance) { Creature *Karathress = NULL; - Karathress = (Creature*)(Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_KARATHRESS))); + Karathress = (Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_KARATHRESS))); if (Karathress) - ((boss_fathomlord_karathressAI*)Karathress->AI())->EventSharkkisDeath(); - ((boss_fathomlord_karathressAI*)Karathress->AI())->EventSharkkisDeath(); + CAST_AI(boss_fathomlord_karathressAI, Karathress->AI())->EventSharkkisDeath(); + CAST_AI(boss_fathomlord_karathressAI, Karathress->AI())->EventSharkkisDeath(); } } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { if (pInstance) { @@ -366,7 +366,7 @@ struct TRINITY_DLL_DECL boss_fathomguard_sharkkisAI : public ScriptedAI void UpdateAI(const uint32 diff) { //Only if not incombat check if the event is started - if (!InCombat && pInstance && pInstance->GetData(DATA_KARATHRESSEVENT)) + if (!m_creature->isInCombat() && pInstance && pInstance->GetData(DATA_KARATHRESSEVENT)) { Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_KARATHRESSEVENT_STARTER)); @@ -405,7 +405,7 @@ struct TRINITY_DLL_DECL boss_fathomguard_sharkkisAI : public ScriptedAI if(TheBeastWithin_Timer < diff) { DoCast(m_creature, SPELL_THE_BEAST_WITHIN); - Creature *Pet = (Creature*) Unit::GetUnit(*m_creature, SummonedPet); + Creature *Pet = Unit::GetCreature(*m_creature, SummonedPet); if( Pet && Pet->isAlive() ) { Pet->CastSpell( Pet, SPELL_PET_ENRAGE, true ); @@ -449,7 +449,7 @@ struct TRINITY_DLL_DECL boss_fathomguard_tidalvessAI : public ScriptedAI { boss_fathomguard_tidalvessAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } ScriptedInstance* pInstance; @@ -475,15 +475,15 @@ struct TRINITY_DLL_DECL boss_fathomguard_tidalvessAI : public ScriptedAI if (pInstance) { Creature *Karathress = NULL; - Karathress = (Creature*)(Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_KARATHRESS))); + Karathress = (Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_KARATHRESS))); if (Karathress) if(!m_creature->isAlive() && Karathress) - ((boss_fathomlord_karathressAI*)Karathress->AI())->EventTidalvessDeath(); + CAST_AI(boss_fathomlord_karathressAI, Karathress->AI())->EventTidalvessDeath(); } } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { if (pInstance) { @@ -496,7 +496,7 @@ struct TRINITY_DLL_DECL boss_fathomguard_tidalvessAI : public ScriptedAI void UpdateAI(const uint32 diff) { //Only if not incombat check if the event is started - if (!InCombat && pInstance && pInstance->GetData(DATA_KARATHRESSEVENT)) + if (!m_creature->isInCombat() && pInstance && pInstance->GetData(DATA_KARATHRESSEVENT)) { Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_KARATHRESSEVENT_STARTER)); @@ -517,7 +517,7 @@ struct TRINITY_DLL_DECL boss_fathomguard_tidalvessAI : public ScriptedAI return; } - if( !m_creature->HasAura(SPELL_WINDFURY_WEAPON, 0) ) + if( !m_creature->HasAura(SPELL_WINDFURY_WEAPON) ) { DoCast(m_creature, SPELL_WINDFURY_WEAPON); } @@ -536,7 +536,7 @@ struct TRINITY_DLL_DECL boss_fathomguard_tidalvessAI : public ScriptedAI Unit *SpitfireTotem = Unit::GetUnit( *m_creature, CREATURE_SPITFIRE_TOTEM ); if( SpitfireTotem ) { - ((Creature*)SpitfireTotem)->AI()->AttackStart( m_creature->getVictim() ); + CAST_CRE(SpitfireTotem)->AI()->AttackStart( m_creature->getVictim() ); } Spitfire_Timer = 60000; }else Spitfire_Timer -= diff; @@ -564,7 +564,7 @@ struct TRINITY_DLL_DECL boss_fathomguard_caribdisAI : public ScriptedAI { boss_fathomguard_caribdisAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } ScriptedInstance* pInstance; @@ -590,15 +590,15 @@ struct TRINITY_DLL_DECL boss_fathomguard_caribdisAI : public ScriptedAI if (pInstance) { Creature *Karathress = NULL; - Karathress = (Creature*)(Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_KARATHRESS))); + Karathress = (Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_KARATHRESS))); if (Karathress) if(!m_creature->isAlive() && Karathress) - ((boss_fathomlord_karathressAI*)Karathress->AI())->EventCaribdisDeath(); + CAST_AI(boss_fathomlord_karathressAI, Karathress->AI())->EventCaribdisDeath(); } } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { if (pInstance) { @@ -610,7 +610,7 @@ struct TRINITY_DLL_DECL boss_fathomguard_caribdisAI : public ScriptedAI void UpdateAI(const uint32 diff) { //Only if not incombat check if the event is started - if (!InCombat && pInstance && pInstance->GetData(DATA_KARATHRESSEVENT)) + if (!m_creature->isInCombat() && pInstance && pInstance->GetData(DATA_KARATHRESSEVENT)) { Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_KARATHRESSEVENT_STARTER)); @@ -655,7 +655,7 @@ struct TRINITY_DLL_DECL boss_fathomguard_caribdisAI : public ScriptedAI Creature *Cyclone = m_creature->SummonCreature(CREATURE_CYCLONE, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), (rand()%5), TEMPSUMMON_TIMED_DESPAWN, 15000); if( Cyclone ) { - ((Creature*)Cyclone)->SetFloatValue(OBJECT_FIELD_SCALE_X, 3.0f); + CAST_CRE(Cyclone)->SetFloatValue(OBJECT_FIELD_SCALE_X, 3.0f); Cyclone->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); Cyclone->setFaction(m_creature->getFaction()); Cyclone->CastSpell(Cyclone, SPELL_CYCLONE_CYCLONE, true); diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_hydross_the_unstable.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_hydross_the_unstable.cpp index e28fc77acd2..bd2365336f0 100644 --- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_hydross_the_unstable.cpp +++ b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_hydross_the_unstable.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -78,7 +78,7 @@ struct TRINITY_DLL_DECL boss_hydross_the_unstableAI : public ScriptedAI { boss_hydross_the_unstableAI(Creature *c) : ScriptedAI(c), Summons(m_creature) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } ScriptedInstance* pInstance; @@ -153,7 +153,7 @@ struct TRINITY_DLL_DECL boss_hydross_the_unstableAI : public ScriptedAI } } } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { DoScriptText(SAY_AGGRO, m_creature); diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_lady_vashj.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_lady_vashj.cpp index 1a82ee38900..8e5ed16688c 100644 --- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_lady_vashj.cpp +++ b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_lady_vashj.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -132,7 +132,7 @@ struct TRINITY_DLL_DECL boss_lady_vashjAI : public ScriptedAI { boss_lady_vashjAI (Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); Intro = false; JustCreated = true; m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); //set it only once on creature create (no need do intro if wiped) @@ -248,7 +248,7 @@ struct TRINITY_DLL_DECL boss_lady_vashjAI : public ScriptedAI pInstance->SetData(DATA_LADYVASHJEVENT, IN_PROGRESS); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { if (pInstance) { @@ -370,7 +370,7 @@ struct TRINITY_DLL_DECL boss_lady_vashjAI : public ScriptedAI Unit *target = NULL; target = SelectUnit(SELECT_TARGET_RANDOM, 0); - if(target && !target->HasAura(SPELL_STATIC_CHARGE_TRIGGER, 0)) + if(target && !target->HasAura(SPELL_STATIC_CHARGE_TRIGGER)) //cast Static Charge every 2 seconds for 20 seconds DoCast(target, SPELL_STATIC_CHARGE_TRIGGER); @@ -576,26 +576,21 @@ struct TRINITY_DLL_DECL boss_lady_vashjAI : public ScriptedAI } } }; -class TRINITY_DLL_DECL VashjSurgeAura : public Aura -{ - public: - VashjSurgeAura(SpellEntry *spell, uint32 eff, int32 *bp, Unit *target, Unit *caster) : Aura(spell, eff, bp, target, caster, NULL) - {} -}; + //Enchanted Elemental //If one of them reaches Vashj he will increase her damage done by 5%. struct TRINITY_DLL_DECL mob_enchanted_elementalAI : public ScriptedAI { mob_enchanted_elementalAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } ScriptedInstance *pInstance; uint32 move; uint32 phase; float x, y, z; - Unit *Vashj; + Creature *Vashj; void Reset() { @@ -624,10 +619,10 @@ struct TRINITY_DLL_DECL mob_enchanted_elementalAI : public ScriptedAI } } if (pInstance) - Vashj = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_LADYVASHJ)); + Vashj = Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_LADYVASHJ)); } - void Aggro(Unit *who) { return; } + void EnterCombat(Unit *who) { return; } void MoveInLineOfSight(Unit *who){return;} @@ -662,21 +657,22 @@ struct TRINITY_DLL_DECL mob_enchanted_elementalAI : public ScriptedAI m_creature->GetMotionMaster()->MovePoint(0, MIDDLE_X, MIDDLE_Y, MIDDLE_Z); if(m_creature->GetDistance(MIDDLE_X, MIDDLE_Y, MIDDLE_Z) < 3) { - SpellEntry *spell = (SpellEntry *)GetSpellStore()->LookupEntry(SPELL_SURGE); + SpellEntry *spell = GET_SPELL(SPELL_SURGE); if( spell ) { - for(uint32 i = 0;i<3;i++) + uint8 eff_mask=0; + for (int i=0; i<3; i++) { if (!spell->Effect[i]) continue; - - Vashj->AddAura(new VashjSurgeAura(spell, i, NULL, Vashj, Vashj)); + eff_mask|=1<<i; } + Vashj->AddAura(new Aura(spell, eff_mask, NULL, Vashj, Vashj)); } m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); } } - if(((boss_lady_vashjAI*)((Creature*)Vashj)->AI())->InCombat == false || ((boss_lady_vashjAI*)((Creature*)Vashj)->AI())->Phase != 2 || Vashj->isDead()) + if(CAST_AI(boss_lady_vashjAI, Vashj->AI())->InCombat == false || CAST_AI(boss_lady_vashjAI, Vashj->AI())->Phase != 2 || Vashj->isDead()) { //call Unsummon() m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); @@ -692,7 +688,7 @@ struct TRINITY_DLL_DECL mob_tainted_elementalAI : public ScriptedAI { mob_tainted_elementalAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } ScriptedInstance *pInstance; @@ -711,14 +707,14 @@ struct TRINITY_DLL_DECL mob_tainted_elementalAI : public ScriptedAI if(pInstance) { Creature *Vashj = NULL; - Vashj = (Creature*)(Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_LADYVASHJ))); + Vashj = (Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_LADYVASHJ))); if(Vashj) - ((boss_lady_vashjAI*)Vashj->AI())->EventTaintedElementalDeath(); + CAST_AI(boss_lady_vashjAI, Vashj->AI())->EventTaintedElementalDeath(); } } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { m_creature->AddThreat(who, 0.1f); } @@ -755,7 +751,7 @@ struct TRINITY_DLL_DECL mob_toxic_sporebatAI : public ScriptedAI { mob_toxic_sporebatAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); EnterEvadeMode(); } @@ -768,7 +764,7 @@ struct TRINITY_DLL_DECL mob_toxic_sporebatAI : public ScriptedAI void Reset() { - m_creature->AddUnitMovementFlag(/*MOVEMENTFLAG_ONTRANSPORT + */MOVEMENTFLAG_LEVITATING); + m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); m_creature->setFaction(14); movement_timer = 0; ToxicSpore_Timer = 5000; @@ -776,7 +772,7 @@ struct TRINITY_DLL_DECL mob_toxic_sporebatAI : public ScriptedAI Check_Timer = 1000; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } @@ -797,10 +793,6 @@ struct TRINITY_DLL_DECL mob_toxic_sporebatAI : public ScriptedAI void UpdateAI (const uint32 diff) { - - /*if(!m_creature->isInCombat()) - m_creature->SetInCombatState(false);*/ - //Random movement if (movement_timer < diff) { @@ -835,7 +827,7 @@ struct TRINITY_DLL_DECL mob_toxic_sporebatAI : public ScriptedAI //check if vashj is death Unit *Vashj = NULL; Vashj = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_LADYVASHJ)); - if(!Vashj || (Vashj && !Vashj->isAlive()) || (Vashj && ((boss_lady_vashjAI*)((Creature*)Vashj)->AI())->Phase != 3)) + if(!Vashj || (Vashj && !Vashj->isAlive()) || (Vashj && CAST_AI(boss_lady_vashjAI, CAST_CRE(Vashj)->AI())->Phase != 3)) { //remove m_creature->setDeathState(DEAD); @@ -891,7 +883,7 @@ struct TRINITY_DLL_DECL mob_shield_generator_channelAI : public ScriptedAI { mob_shield_generator_channelAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } ScriptedInstance *pInstance; @@ -906,7 +898,7 @@ struct TRINITY_DLL_DECL mob_shield_generator_channelAI : public ScriptedAI m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); } - void Aggro(Unit *who) { return; } + void EnterCombat(Unit *who) { return; } void MoveInLineOfSight(Unit *who) { return; } @@ -923,7 +915,7 @@ struct TRINITY_DLL_DECL mob_shield_generator_channelAI : public ScriptedAI if(Vashj && Vashj->isAlive()) { //start visual channel - if (!Casted || !Vashj->HasAura(SPELL_MAGIC_BARRIER,0)) + if (!Casted || !Vashj->HasAura(SPELL_MAGIC_BARRIER)) { m_creature->CastSpell(Vashj,SPELL_MAGIC_BARRIER,true); Casted = true; @@ -936,7 +928,7 @@ struct TRINITY_DLL_DECL mob_shield_generator_channelAI : public ScriptedAI bool ItemUse_item_tainted_core(Player *player, Item* _Item, SpellCastTargets const& targets) { - ScriptedInstance *pInstance = (player->GetInstanceData()) ? ((ScriptedInstance*)player->GetInstanceData()) : NULL; + ScriptedInstance *pInstance = (player->GetInstanceData()) ? (player->GetInstanceData()) : NULL; if(!pInstance) { @@ -945,8 +937,8 @@ bool ItemUse_item_tainted_core(Player *player, Item* _Item, SpellCastTargets con } Creature *Vashj = NULL; - Vashj = (Creature*)(Unit::GetUnit((*player), pInstance->GetData64(DATA_LADYVASHJ))); - if(Vashj && ((boss_lady_vashjAI*)Vashj->AI())->Phase == 2) + Vashj = (Unit::GetCreature((*player), pInstance->GetData64(DATA_LADYVASHJ))); + if(Vashj && CAST_AI(boss_lady_vashjAI, Vashj->AI())->Phase == 2) { if(targets.getGOTarget() && targets.getGOTarget()->GetTypeId()==TYPEID_GAMEOBJECT) { @@ -982,7 +974,7 @@ bool ItemUse_item_tainted_core(Player *player, Item* _Item, SpellCastTargets con //get and remove channel Unit *Channel = NULL; - Channel = Unit::GetUnit((*Vashj), ((boss_lady_vashjAI*)Vashj->AI())->ShieldGeneratorChannel[channel_identifier]); + Channel = Unit::GetCreature(*Vashj, CAST_AI(boss_lady_vashjAI, Vashj->AI())->ShieldGeneratorChannel[channel_identifier]); if(Channel) { //call Unsummon() diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_leotheras_the_blind.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_leotheras_the_blind.cpp index 73d55127c78..1373be2ed6d 100644 --- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_leotheras_the_blind.cpp +++ b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_leotheras_the_blind.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -65,12 +65,6 @@ EndScriptData */ #define SAY_FREE -1548019 #define SAY_DEATH -1548020 -class TRINITY_DLL_DECL InsidiousAura : public Aura { -public: - InsidiousAura(SpellEntry *spell, uint32 eff, int32 *bp, Unit *target, Unit *caster) : Aura(spell, eff, bp, target, caster, NULL) - {} -}; - struct TRINITY_DLL_DECL mob_inner_demonAI : public ScriptedAI { mob_inner_demonAI(Creature *c) : ScriptedAI(c) @@ -91,7 +85,7 @@ struct TRINITY_DLL_DECL mob_inner_demonAI : public ScriptedAI void JustDied(Unit *victim) { Unit* pUnit = Unit::GetUnit((*m_creature),victimGUID); - if (pUnit && pUnit->HasAura(SPELL_INSIDIOUS_WHISPER,0)) + if (pUnit && pUnit->HasAura(SPELL_INSIDIOUS_WHISPER)) pUnit->RemoveAurasDueToSpell(SPELL_INSIDIOUS_WHISPER); } @@ -104,7 +98,7 @@ struct TRINITY_DLL_DECL mob_inner_demonAI : public ScriptedAI } } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { if (!victimGUID) return; } @@ -128,7 +122,7 @@ struct TRINITY_DLL_DECL mob_inner_demonAI : public ScriptedAI }else Link_Timer -= diff; - if(!m_creature->HasAura(AURA_DEMONIC_ALIGNMENT, 0)) + if(!m_creature->HasAura(AURA_DEMONIC_ALIGNMENT)) DoCast(m_creature, AURA_DEMONIC_ALIGNMENT,true); if(ShadowBolt_Timer < diff) @@ -146,7 +140,7 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI boss_leotheras_the_blindAI(Creature *c) : ScriptedAI(c) { m_creature->GetPosition(x,y,z); - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); Demon = 0; for(uint8 i = 0; i < 3; i++)//clear guids @@ -194,8 +188,8 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI InnderDemon_Count = 0; m_creature->SetSpeed( MOVE_RUN, 2.0f, true); m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, MODEL_NIGHTELF); - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY , 0); - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY+1, 0); + m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID , 0); + m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, 0); m_creature->CastSpell(m_creature, SPELL_DUAL_WIELD, true); m_creature->SetCorpseDelay(1000*60*60); if(pInstance) @@ -229,7 +223,7 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI } void MoveInLineOfSight(Unit *who) { - if(m_creature->HasAura(AURA_BANISH, 0)) + if(m_creature->HasAura(AURA_BANISH)) return; if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessiblePlaceFor(m_creature) ) @@ -267,7 +261,7 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI } // channelers == 0 remove banish aura - if(AliveChannelers == 0 && m_creature->HasAura(AURA_BANISH, 0)) + if(AliveChannelers == 0 && m_creature->HasAura(AURA_BANISH)) { // removing banish aura m_creature->RemoveAurasDueToSpell(AURA_BANISH); @@ -290,7 +284,7 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI StartEvent(); } } - else if(AliveChannelers != 0 && !m_creature->HasAura(AURA_BANISH, 0)) + else if(AliveChannelers != 0 && !m_creature->HasAura(AURA_BANISH)) { // channelers != 0 apply banish aura // removing Leotheras banish immune to apply AURA_BANISH @@ -301,8 +295,8 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, MODEL_DEMON); // and removing weapons - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY , 0); - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY+1, 0); + m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID , 0); + m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, 0); } } @@ -332,10 +326,10 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI { if(InnderDemon[i] > 0 ) { - Unit* pUnit = Unit::GetUnit((*m_creature), InnderDemon[i]); + Creature* pUnit = Unit::GetCreature((*m_creature), InnderDemon[i]); if (pUnit && pUnit->isAlive()) { - Unit* pUnit_target = Unit::GetUnit((*pUnit), ((mob_inner_demonAI *)((Creature *)pUnit)->AI())->victimGUID); + Unit* pUnit_target = Unit::GetUnit(*pUnit, CAST_AI(mob_inner_demonAI, pUnit->AI())->victimGUID); if( pUnit_target && pUnit_target->isAlive()) { pUnit->CastSpell(pUnit_target, SPELL_CONSUMING_MADNESS, true); @@ -388,9 +382,9 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI pInstance->SetData(DATA_LEOTHERASTHEBLINDEVENT, DONE); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { - if(m_creature->HasAura(AURA_BANISH, 0)) + if(m_creature->HasAura(AURA_BANISH)) return; m_creature->LoadEquipment(m_creature->GetEquipmentId()); @@ -399,7 +393,7 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI void UpdateAI(const uint32 diff) { //Return since we have no target - if (m_creature->HasAura(AURA_BANISH, 0) || !UpdateVictim()) + if (m_creature->HasAura(AURA_BANISH) || !UpdateVictim()) { if(BanishTimer<diff) { @@ -408,7 +402,7 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI }else BanishTimer -= diff; return; } - if(m_creature->HasAura(SPELL_WHIRLWIND, 0)) + if(m_creature->HasAura(SPELL_WHIRLWIND)) if(Whirlwind_Timer < diff) { Unit *newTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); @@ -422,7 +416,7 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI }else Whirlwind_Timer -= diff; // reseting after changing forms and after ending whirlwind - if(NeedThreatReset && !m_creature->HasAura(SPELL_WHIRLWIND, 0)) + if(NeedThreatReset && !m_creature->HasAura(SPELL_WHIRLWIND)) { // when changing forms seting timers (or when ending whirlwind - to avoid adding new variable i use Whirlwind_Timer to countdown 2s while whirlwinding) if(DemonForm) @@ -446,7 +440,7 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI if(!DemonForm) { //Whirldind Timer - if(!m_creature->HasAura(SPELL_WHIRLWIND, 0)) + if(!m_creature->HasAura(SPELL_WHIRLWIND)) { if(Whirlwind_Timer < diff) { @@ -465,8 +459,8 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI m_creature->RemoveAurasDueToSpell(SPELL_WHIRLWIND,0); m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, MODEL_DEMON); DoScriptText(SAY_SWITCH_TO_DEMON, m_creature); - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY , 0); - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY+1, 0); + m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID , 0); + m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, 0); DemonForm = true; NeedThreatReset = true; SwitchToDemon_Timer = 45000; @@ -502,23 +496,25 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI if(tempTarget && tempTarget->GetTypeId() == TYPEID_PLAYER && tempTarget->GetGUID() != m_creature->getVictim()->GetGUID() && TargetList.size()<5) TargetList.push_back( tempTarget ); } - SpellEntry *spell = (SpellEntry *)GetSpellStore()->LookupEntry(SPELL_INSIDIOUS_WHISPER); + SpellEntry *spell = GET_SPELL(SPELL_INSIDIOUS_WHISPER); for(std::vector<Unit *>::iterator itr = TargetList.begin(); itr != TargetList.end(); ++itr) { if( (*itr) && (*itr)->isAlive() ) { - Creature * demon = (Creature *)m_creature->SummonCreature(INNER_DEMON_ID, (*itr)->GetPositionX()+10, (*itr)->GetPositionY()+10, (*itr)->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + Creature * demon = m_creature->SummonCreature(INNER_DEMON_ID, (*itr)->GetPositionX()+10, (*itr)->GetPositionY()+10, (*itr)->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); if(demon) { - ((ScriptedAI *)demon->AI())->AttackStart( (*itr) ); - ((mob_inner_demonAI *)demon->AI())->victimGUID = (*itr)->GetGUID(); + demon->AI()->AttackStart( (*itr) ); + CAST_AI(mob_inner_demonAI, demon->AI())->victimGUID = (*itr)->GetGUID(); + uint8 eff_mask=0; for (int i=0; i<3; i++) { if (!spell->Effect[i]) continue; - (*itr)->AddAura(new InsidiousAura(spell, i, NULL, (*itr), (*itr))); + eff_mask|=1<<i; } + (*itr)->AddAura(new Aura(spell, eff_mask, NULL, (*itr), (*itr))); if( InnderDemon_Count > 4 ) InnderDemon_Count = 0; //Safe storing of creatures @@ -611,7 +607,7 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blind_demonformAI : public ScriptedAI m_creature->CastSpell(m_creature, 8149, true); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { StartEvent(); } @@ -644,7 +640,7 @@ struct TRINITY_DLL_DECL mob_greyheart_spellbinderAI : public ScriptedAI { mob_greyheart_spellbinderAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance *)c->GetInstanceData());; + pInstance = (c->GetInstanceData());; leotherasGUID = 0; AddedBanish = false; } @@ -666,13 +662,13 @@ struct TRINITY_DLL_DECL mob_greyheart_spellbinderAI : public ScriptedAI if(pInstance) { pInstance->SetData64(DATA_LEOTHERAS_EVENT_STARTER, 0); - Creature *leotheras = (Creature *)Unit::GetUnit(*m_creature, leotherasGUID); + Creature *leotheras = Unit::GetCreature(*m_creature, leotherasGUID); if(leotheras && leotheras->isAlive()) - ((boss_leotheras_the_blindAI*)leotheras->AI())->CheckChannelers(false); + CAST_AI(boss_leotheras_the_blindAI, leotheras->AI())->CheckChannelers(false); } } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { m_creature->InterruptNonMeleeSpells(false); if(pInstance) @@ -681,18 +677,17 @@ struct TRINITY_DLL_DECL mob_greyheart_spellbinderAI : public ScriptedAI void JustRespawned() { - InCombat = false; AddedBanish = false; Reset(); } void CastChanneling() { - if(!InCombat && !m_creature->m_currentSpells[CURRENT_CHANNELED_SPELL]) + if(!m_creature->isInCombat() && !m_creature->m_currentSpells[CURRENT_CHANNELED_SPELL]) { if(leotherasGUID) { - Creature *leotheras = (Creature *)Unit::GetUnit(*m_creature, leotherasGUID); + Creature *leotheras = Unit::GetCreature(*m_creature, leotherasGUID); if(leotheras && leotheras->isAlive()) DoCast(leotheras, BANISH_BEAM); } @@ -706,7 +701,7 @@ struct TRINITY_DLL_DECL mob_greyheart_spellbinderAI : public ScriptedAI if(!leotherasGUID) leotherasGUID = pInstance->GetData64(DATA_LEOTHERAS); - if(!InCombat && pInstance->GetData64(DATA_LEOTHERAS_EVENT_STARTER)) + if(!m_creature->isInCombat() && pInstance->GetData64(DATA_LEOTHERAS_EVENT_STARTER)) { Unit *victim = NULL; victim = Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_LEOTHERAS_EVENT_STARTER)); diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_lurker_below.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_lurker_below.cpp index a3a4230c342..3fa97e6b608 100644 --- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_lurker_below.cpp +++ b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_lurker_below.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -76,8 +76,8 @@ struct TRINITY_DLL_DECL boss_the_lurker_belowAI : public Scripted_NoMovementAI { boss_the_lurker_belowAI(Creature *c) : Scripted_NoMovementAI(c), Summons(m_creature) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); - SpellEntry *TempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_SPOUT_ANIM); + pInstance = (c->GetInstanceData()); + SpellEntry *TempSpell = GET_SPELL(SPELL_SPOUT_ANIM); if(TempSpell) { TempSpell->Effect[0] = 0;//remove all spell effect, only anim is needed @@ -152,7 +152,7 @@ struct TRINITY_DLL_DECL boss_the_lurker_belowAI : public Scripted_NoMovementAI } } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { if(pInstance) pInstance->SetData(DATA_THELURKERBELOWEVENT, IN_PROGRESS); @@ -267,7 +267,7 @@ struct TRINITY_DLL_DECL boss_the_lurker_belowAI : public Scripted_NoMovementAI for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) { - if (i->getSource()->isAlive() && i->getSource()->IsInWater() && !i->getSource()->HasAura(SPELL_SCALDINGWATER, 0)) + if (i->getSource()->isAlive() && i->getSource()->IsInWater() && !i->getSource()->HasAura(SPELL_SCALDINGWATER)) i->getSource()->CastSpell(i->getSource(), SPELL_SCALDINGWATER, true); else if(!i->getSource()->IsInWater()) i->getSource()->RemoveAurasDueToSpell(SPELL_SCALDINGWATER); @@ -322,7 +322,7 @@ struct TRINITY_DLL_DECL boss_the_lurker_belowAI : public Scripted_NoMovementAI if(WaterboltTimer < diff) { - Unit* target = SelectUnit(SELECT_TARGET_NEAREST,0,14,true); + Unit* target = SelectTarget(SELECT_TARGET_NEAREST,0,14,true); if(!target) { target = SelectUnit(SELECT_TARGET_RANDOM,0); @@ -358,7 +358,7 @@ struct TRINITY_DLL_DECL boss_the_lurker_belowAI : public Scripted_NoMovementAI }else PhaseTimer-=diff; if(!m_creature->isInCombat()) - m_creature->SetInCombatState(false); + DoZoneInCombat(); if(!Spawned) { @@ -403,7 +403,7 @@ struct TRINITY_DLL_DECL mob_coilfang_ambusherAI : public Scripted_NoMovementAI { mob_coilfang_ambusherAI(Creature *c) : Scripted_NoMovementAI(c) { - SpellEntry *TempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_SHOOT); + SpellEntry *TempSpell = GET_SPELL(SPELL_SHOOT); if(TempSpell) TempSpell->Effect[0] = 2;//change spell effect from weapon % dmg to simple phisical dmg } @@ -418,7 +418,7 @@ struct TRINITY_DLL_DECL mob_coilfang_ambusherAI : public Scripted_NoMovementAI } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_morogrim_tidewalker.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_morogrim_tidewalker.cpp index b892741c973..5038fe09334 100644 --- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_morogrim_tidewalker.cpp +++ b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_morogrim_tidewalker.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -100,7 +100,7 @@ struct TRINITY_DLL_DECL boss_morogrim_tidewalkerAI : public ScriptedAI { boss_morogrim_tidewalkerAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } ScriptedInstance* pInstance; @@ -161,9 +161,9 @@ struct TRINITY_DLL_DECL boss_morogrim_tidewalkerAI : public ScriptedAI pInstance->SetData(DATA_MOROGRIMTIDEWALKEREVENT, DONE); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { - PlayerList = &((InstanceMap*)m_creature->GetMap())->GetPlayers(); + PlayerList = &m_creature->GetMap()->GetPlayers(); Playercount = PlayerList->getSize(); StartEvent(); } @@ -235,7 +235,7 @@ struct TRINITY_DLL_DECL boss_morogrim_tidewalkerAI : public ScriptedAI for(uint8 i = 0; i < 4; i++) { counter = 0; - do{target = SelectUnit(SELECT_TARGET_RANDOM, 1, 50, true); //target players only + do{target = SelectTarget(SELECT_TARGET_RANDOM, 1, 50, true); //target players only if(counter < Playercount) break; if(target) itr = list.find(target->GetGUID()); @@ -272,7 +272,7 @@ struct TRINITY_DLL_DECL boss_morogrim_tidewalkerAI : public ScriptedAI for (int8 g = 0; g < 4; g++) //one unit cant cast more than one spell per update, so some players have to cast for us XD { counter = 0; - do {globuletarget = SelectUnit(SELECT_TARGET_RANDOM, 0,50,true); + do {globuletarget = SelectTarget(SELECT_TARGET_RANDOM, 0,50,true); if(globuletarget) itr = globulelist.find(globuletarget->GetGUID()); if (counter > Playercount) break; @@ -308,7 +308,7 @@ struct TRINITY_DLL_DECL mob_water_globuleAI : public ScriptedAI m_creature->setFaction(14); } - void Aggro(Unit *who) {} + void EnterCombat(Unit *who) {} void MoveInLineOfSight(Unit *who) { diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/def_serpent_shrine.h b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/def_serpent_shrine.h index aceabea4b5c..13144bc93c0 100644 --- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/def_serpent_shrine.h +++ b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/def_serpent_shrine.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * This program is free software licensed under GPL version 2 * Please see the included DOCS/LICENSE.TXT for more information */ diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/instance_serpent_shrine.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/instance_serpent_shrine.cpp index 0aceef32714..4e104fc2846 100644 --- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/instance_serpent_shrine.cpp +++ b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/instance_serpent_shrine.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -37,7 +37,7 @@ EndScriptData */ bool GOHello_go_bridge_console(Player *player, GameObject* go) { - ScriptedInstance* pInstance = (ScriptedInstance*)go->GetInstanceData(); + ScriptedInstance* pInstance = go->GetInstanceData(); if(!pInstance) return false; @@ -136,13 +136,13 @@ struct TRINITY_DLL_DECL instance_serpentshrine_cavern : public ScriptedInstance void OpenDoor(uint64 DoorGUID, bool open) { - if(GameObject *Door = instance->GetGameObjectInMap(DoorGUID)) - Door->SetUInt32Value(GAMEOBJECT_STATE, open ? 0 : 1); + if(GameObject *Door = instance->GetGameObject(DoorGUID)) + Door->SetGoState(open ? GO_STATE_ACTIVE : GO_STATE_READY); } void OnCreatureCreate(Creature *creature, uint32 creature_entry) { - switch(creature_entry) + switch(creature->GetEntry()) { case 21212: LadyVashj = creature->GetGUID(); break; case 21214: Karathress = creature->GetGUID(); break; @@ -236,7 +236,7 @@ struct TRINITY_DLL_DECL instance_serpentshrine_cavern : public ScriptedInstance } return 0; } - const char* Save() + std::string GetSaveData() { OUT_SAVE_INST_DATA; std::ostringstream stream; diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/boss_hydromancer_thespia.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/boss_hydromancer_thespia.cpp index cafbf8e3f4f..c8bbe986176 100644 --- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/boss_hydromancer_thespia.cpp +++ b/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/boss_hydromancer_thespia.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -45,7 +45,7 @@ struct TRINITY_DLL_DECL boss_thespiaAI : public ScriptedAI { boss_thespiaAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); HeroicMode = m_creature->GetMap()->IsHeroic(); } @@ -83,7 +83,7 @@ struct TRINITY_DLL_DECL boss_thespiaAI : public ScriptedAI } } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { switch(rand()%3) { @@ -153,7 +153,7 @@ struct TRINITY_DLL_DECL mob_coilfang_waterelementalAI : public ScriptedAI WaterBoltVolley_Timer = 3000+rand()%3000; } - void Aggro(Unit *who) { } + void EnterCombat(Unit *who) { } void UpdateAI(const uint32 diff) { diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/boss_mekgineer_steamrigger.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/boss_mekgineer_steamrigger.cpp index 1515b14e3a2..50d919d3e2c 100644 --- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/boss_mekgineer_steamrigger.cpp +++ b/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/boss_mekgineer_steamrigger.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -50,7 +50,7 @@ struct TRINITY_DLL_DECL boss_mekgineer_steamriggerAI : public ScriptedAI { boss_mekgineer_steamriggerAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); HeroicMode = m_creature->GetMap()->IsHeroic(); } @@ -96,7 +96,7 @@ struct TRINITY_DLL_DECL boss_mekgineer_steamriggerAI : public ScriptedAI } } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { switch(rand()%3) { @@ -199,7 +199,7 @@ struct TRINITY_DLL_DECL mob_steamrigger_mechanicAI : public ScriptedAI { mob_steamrigger_mechanicAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); HeroicMode = m_creature->GetMap()->IsHeroic(); } @@ -219,7 +219,7 @@ struct TRINITY_DLL_DECL mob_steamrigger_mechanicAI : public ScriptedAI return; } - void Aggro(Unit *who) { } + void EnterCombat(Unit *who) { } void UpdateAI(const uint32 diff) { diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/boss_warlord_kalithresh.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/boss_warlord_kalithresh.cpp index 7090d678768..f84b6864641 100644 --- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/boss_warlord_kalithresh.cpp +++ b/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/boss_warlord_kalithresh.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -44,7 +44,7 @@ struct TRINITY_DLL_DECL mob_naga_distillerAI : public ScriptedAI { mob_naga_distillerAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } ScriptedInstance *pInstance; @@ -65,7 +65,7 @@ struct TRINITY_DLL_DECL mob_naga_distillerAI : public ScriptedAI } } - void Aggro(Unit *who) { } + void EnterCombat(Unit *who) { } void StartRageGen(Unit *caster) { @@ -90,7 +90,7 @@ struct TRINITY_DLL_DECL boss_warlord_kalithreshAI : public ScriptedAI { boss_warlord_kalithreshAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } ScriptedInstance *pInstance; @@ -111,7 +111,7 @@ struct TRINITY_DLL_DECL boss_warlord_kalithreshAI : public ScriptedAI pInstance->SetData(TYPE_WARLORD_KALITHRESH, NOT_STARTED); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { switch(rand()%3) { @@ -143,7 +143,7 @@ struct TRINITY_DLL_DECL boss_warlord_kalithreshAI : public ScriptedAI cell.SetNoCreate(); Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck creature_check(*m_creature, entry, true, range); - Trinity::CreatureLastSearcher<Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck> searcher(pCreature, creature_check); + Trinity::CreatureLastSearcher<Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck> searcher(m_creature, pCreature, creature_check); TypeContainerVisitor<Trinity::CreatureLastSearcher<Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck>, GridTypeMapContainer> creature_searcher(searcher); @@ -182,7 +182,7 @@ struct TRINITY_DLL_DECL boss_warlord_kalithreshAI : public ScriptedAI { DoScriptText(SAY_REGEN, m_creature); DoCast(m_creature,SPELL_WARLORDS_RAGE); - ((mob_naga_distillerAI*)distiller->AI())->StartRageGen(m_creature); + CAST_AI(mob_naga_distillerAI, distiller->AI())->StartRageGen(m_creature); } Rage_Timer = 3000+rand()%15000; }else Rage_Timer -= diff; diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/def_steam_vault.h b/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/def_steam_vault.h index 09a76d482b7..4b407ac4816 100644 --- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/def_steam_vault.h +++ b/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/def_steam_vault.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * This program is free software licensed under GPL version 2 * Please see the included DOCS/LICENSE.TXT for more information */ diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/instance_steam_vault.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/instance_steam_vault.cpp index e268ca97112..55ef0716638 100644 --- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/instance_steam_vault.cpp +++ b/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/instance_steam_vault.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -38,7 +38,7 @@ EndScriptData */ bool GOHello_go_main_chambers_access_panel(Player *player, GameObject* _GO) { - ScriptedInstance* pInstance = (ScriptedInstance*)_GO->GetInstanceData(); + ScriptedInstance* pInstance = _GO->GetInstanceData(); if (!pInstance) return false; @@ -141,12 +141,12 @@ struct TRINITY_DLL_DECL instance_steam_vault : public ScriptedInstance if (data == SPECIAL) { if (GameObject *_go = GameObject::GetGameObject(*player,AccessPanelHydro)) - _go->SetGoState(0); + _go->SetGoState(GO_STATE_ACTIVE); if (GetData(TYPE_MEKGINEER_STEAMRIGGER) == SPECIAL) { if (GameObject *_go = GameObject::GetGameObject(*player,MainChambersDoor)) - _go->SetGoState(0); + _go->SetGoState(GO_STATE_ACTIVE); } debug_log("TSCR: Instance Steamvault: Access panel used."); } @@ -156,12 +156,12 @@ struct TRINITY_DLL_DECL instance_steam_vault : public ScriptedInstance if (data == SPECIAL) { if (GameObject *_go = GameObject::GetGameObject(*player,AccessPanelMek)) - _go->SetGoState(0); + _go->SetGoState(GO_STATE_ACTIVE); if (GetData(TYPE_HYDROMANCER_THESPIA) == SPECIAL) { if (GameObject *_go = GameObject::GetGameObject(*player,MainChambersDoor)) - _go->SetGoState(0); + _go->SetGoState(GO_STATE_ACTIVE); } debug_log("TSCR: Instance Steamvault: Access panel used."); } @@ -209,7 +209,7 @@ struct TRINITY_DLL_DECL instance_steam_vault : public ScriptedInstance return 0; } - const char* Save() + std::string GetSaveData() { OUT_SAVE_INST_DATA; std::ostringstream stream; diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/underbog/boss_hungarfen.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/underbog/boss_hungarfen.cpp index 328bd8ee1ce..a0a0b2a2cd1 100644 --- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/underbog/boss_hungarfen.cpp +++ b/src/bindings/scripts/scripts/zone/coilfang_resevoir/underbog/boss_hungarfen.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -45,7 +45,7 @@ struct TRINITY_DLL_DECL boss_hungarfenAI : public ScriptedAI AcidGeyser_Timer = 10000; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } @@ -114,7 +114,7 @@ struct TRINITY_DLL_DECL mob_underbog_mushroomAI : public ScriptedAI void AttackStart(Unit* who) { return; } - void Aggro(Unit* who) { } + void EnterCombat(Unit* who) { } void UpdateAI(const uint32 diff) { diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/underbog/boss_the_black_stalker.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/underbog/boss_the_black_stalker.cpp index c3c8d977509..62bcf62a2df 100644 --- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/underbog/boss_the_black_stalker.cpp +++ b/src/bindings/scripts/scripts/zone/coilfang_resevoir/underbog/boss_the_black_stalker.cpp @@ -63,7 +63,7 @@ struct TRINITY_DLL_DECL boss_the_black_stalkerAI : public ScriptedAI Striders.clear(); } - void Aggro(Unit *who) {} + void EnterCombat(Unit *who) {} void JustSummoned(Creature *summon) { @@ -119,9 +119,9 @@ struct TRINITY_DLL_DECL boss_the_black_stalkerAI : public ScriptedAI { if(LevitatedTarget_Timer < diff) { - if(Unit* target = (Unit*)Unit::GetUnit(*m_creature, LevitatedTarget)) + if(Unit* target = Unit::GetUnit(*m_creature, LevitatedTarget)) { - if(!target->HasAura(SPELL_LEVITATE,0)) + if(!target->HasAura(SPELL_LEVITATE)) { LevitatedTarget = 0; return; @@ -165,7 +165,7 @@ struct TRINITY_DLL_DECL boss_the_black_stalkerAI : public ScriptedAI // Static Charge if(StaticCharge_Timer < diff) { - if(Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0,30,true)) + if(Unit *target = SelectTarget(SELECT_TARGET_RANDOM,0,30,true)) DoCast(target, SPELL_STATIC_CHARGE); StaticCharge_Timer = 10000; }else StaticCharge_Timer -= diff; diff --git a/src/bindings/scripts/scripts/zone/darkshore/darkshore.cpp b/src/bindings/scripts/scripts/zone/darkshore/darkshore.cpp index aea0e52e4f7..fcb13e9f479 100644 --- a/src/bindings/scripts/scripts/zone/darkshore/darkshore.cpp +++ b/src/bindings/scripts/scripts/zone/darkshore/darkshore.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 diff --git a/src/bindings/scripts/scripts/zone/deadmines/deadmines.cpp b/src/bindings/scripts/scripts/zone/deadmines/deadmines.cpp index fcafcf6079e..72498f388ec 100644 --- a/src/bindings/scripts/scripts/zone/deadmines/deadmines.cpp +++ b/src/bindings/scripts/scripts/zone/deadmines/deadmines.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -72,7 +72,7 @@ struct TRINITY_DLL_DECL instance_deadmines : public ScriptedInstance CannonBlast_Timer = CANNON_BLAST_TIMER; // it's a hack - Mr. Smite should do that but his too far away IronCladDoor->SetName("Mr. Smite"); - IronCladDoor->Yell(SAY_MR_SMITE_ALARM1, LANG_UNIVERSAL, 0); + IronCladDoor->MonsterYell(SAY_MR_SMITE_ALARM1, LANG_UNIVERSAL, 0); DoPlaySound(IronCladDoor, SOUND_MR_SMITE_ALARM1); State=CANNON_BLAST_INITIATED; break; @@ -84,7 +84,7 @@ struct TRINITY_DLL_DECL instance_deadmines : public ScriptedInstance ShootCannon(); BlastOutDoor(); LeverStucked(); - IronCladDoor->Yell(SAY_MR_SMITE_ALARM2, LANG_UNIVERSAL, 0); + IronCladDoor->MonsterYell(SAY_MR_SMITE_ALARM2, LANG_UNIVERSAL, 0); DoPlaySound(IronCladDoor, SOUND_MR_SMITE_ALARM2); State = PIRATES_ATTACK; }else @@ -126,13 +126,13 @@ struct TRINITY_DLL_DECL instance_deadmines : public ScriptedInstance void ShootCannon() { - DefiasCannon->SetUInt32Value(GAMEOBJECT_STATE, 0); + DefiasCannon->SetGoState(GO_STATE_ACTIVE); DoPlaySound(DefiasCannon, SOUND_CANNONFIRE); } void BlastOutDoor() { - IronCladDoor->SetUInt32Value(GAMEOBJECT_STATE, 2); + IronCladDoor->SetGoState(GO_STATE_ACTIVE_ALTERNATIVE); DoPlaySound(IronCladDoor, SOUND_DESTROYDOOR); } @@ -196,7 +196,7 @@ struct TRINITY_DLL_DECL instance_deadmines : public ScriptedInstance bool ItemUse_item_defias_gunpowder(Player *player, Item* _Item, SpellCastTargets const& targets) { - ScriptedInstance *pInstance = (player->GetInstanceData()) ? ((ScriptedInstance*)player->GetInstanceData()) : NULL; + ScriptedInstance *pInstance = (player->GetInstanceData()) ? (player->GetInstanceData()) : NULL; if(!pInstance) { diff --git a/src/bindings/scripts/scripts/zone/dragonblight/dragonblight.cpp b/src/bindings/scripts/scripts/zone/dragonblight/dragonblight.cpp new file mode 100644 index 00000000000..2430ee659ac --- /dev/null +++ b/src/bindings/scripts/scripts/zone/dragonblight/dragonblight.cpp @@ -0,0 +1,71 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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: 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(0, 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/draktharon_keep/boss_dred.cpp b/src/bindings/scripts/scripts/zone/draktharon_keep/boss_dred.cpp new file mode 100644 index 00000000000..3dcd3e632e8 --- /dev/null +++ b/src/bindings/scripts/scripts/zone/draktharon_keep/boss_dred.cpp @@ -0,0 +1,56 @@ +/* Script Data Start +SDName: Boss dred +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = '' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_BELLOWING_ROAR 44863 // fears the group, can be resisted/dispelled +#define SPELL_GRIEVOUS_BITE 48920 +#define SPELL_MANGLING_SLASH 48873 //casted on the current tank, adds debuf +#define SPELL_FEARSOME_ROAR_N 48849 +#define SPELL_FEARSOME_ROAR_H 48849 //Not stacking, debuff +#define SPELL_PIERCING_SLASH 48878 //debuff -->Armor reduced by 75% +#define SPELL_RAPTOR_CALL 59416 //dummy + + +struct TRINITY_DLL_DECL boss_dredAI : public ScriptedAI +{ + boss_dredAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) {} + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if(!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) {} +}; + +CreatureAI* GetAI_boss_dred(Creature *_Creature) +{ + return new boss_dredAI (_Creature); +} + +void AddSC_boss_dred() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_dred"; + newscript->GetAI = &GetAI_boss_dred; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/zone/draktharon_keep/boss_novos.cpp b/src/bindings/scripts/scripts/zone/draktharon_keep/boss_novos.cpp new file mode 100644 index 00000000000..6a12f2afc4c --- /dev/null +++ b/src/bindings/scripts/scripts/zone/draktharon_keep/boss_novos.cpp @@ -0,0 +1,75 @@ +/* Script Data Start +SDName: Boss novos +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = 'boss_novos' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_ARCANE_BLAST_N 49198 +#define SPELL_ARCANE_BLAST_H 59909 +#define SPELL_ARCANE_FIELD 47346 +#define SPELL_BLIZZARD_N 49034 +#define SPELL_BLIZZARD_H 59854 +#define SPELL_FROSTBOLT_N 49037 +#define SPELL_FROSTBOLT_H 59855 +#define SPELL_WRATH_OF_MISERY_N 50089 +#define SPELL_WRATH_OF_MISERY_H 59856 +#define SPELL_SUMMON_MINIONS 59910 //Summons an army of Fetid Troll Corpses to assist the caster. + +//Yell +#define SAY_AGGRO -1600000 +#define SAY_KILL -1600001 +#define SAY_DEATH -1600002 +#define SAY_NECRO_ADD -1600003 +#define SAY_REUBBLE_1 -1600004 +#define SAY_REUBBLE_2 -1600005 + +struct TRINITY_DLL_DECL boss_novosAI : public ScriptedAI +{ + boss_novosAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if(!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) {} + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + DoScriptText(SAY_KILL, m_creature); + } +}; + +CreatureAI* GetAI_boss_novos(Creature *_Creature) +{ + return new boss_novosAI (_Creature); +} + +void AddSC_boss_novos() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_novos"; + newscript->GetAI = &GetAI_boss_novos; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/zone/draktharon_keep/boss_tharon_ja.cpp b/src/bindings/scripts/scripts/zone/draktharon_keep/boss_tharon_ja.cpp new file mode 100644 index 00000000000..b09e6f14508 --- /dev/null +++ b/src/bindings/scripts/scripts/zone/draktharon_keep/boss_tharon_ja.cpp @@ -0,0 +1,88 @@ +/* Script Data Start +SDName: Boss tharon_ja +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = 'boss_tharon_ja' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_COURSE_OF_LIFE 49527 +#define SPELL_DECAY_FLESH 49356 //casted at end of pahase 1, starts phase 2 +#define SPELL_EYE_BEAM_N 49544 +#define SPELL_LIGHTNING_BREATH_N 49537 +#define SPELL_POISON_CLOUD_N 49548 +#define SPELL_RAIN_OF_FIRE_N 49518 +#define SPELL_RETURN_FLESH 53463 //Channeled spell ending phase two and returning to phase 1. This ability will stun the party for 6 seconds. +#define SPELL_SHADOW_VOLLEY_N 49528 + +//Spells Heroic +#define SPELL_COURSE_OF_LIFE_H 59972 +#define SPELL_EYE_BEAM_H 59965 +#define SPELL_LIGHTNING_BREATH_H 59963 +#define SPELL_POISON_CLOUD_H 59969 +#define SPELL_RAIN_OF_FIRE_H 59971 +#define SPELL_SHADOW_VOLLEY_H 59973 + +//Players skills durring Phase2 +#define PLAYER_PHASE2_SLAYING_STRIKE 50799 +#define PLAYER_PHASE2_TAUNT 49613 +#define PLAYER_PHASE2_BONE_ARMOR 49609 +#define PLAYER_PHASE2_TOUCH_OF_LIFE 49617 +//Phase 1 all abilities except Eye beam +//Phase 2 turns players to skeletons with new abilities, boss grows skin + +//Yell +#define SAY_AGGRO 1600011 +#define SAY_KILL_1 1600012 +#define SAY_KILL_2 1600013 +#define SAY_FLESH_1 1600014 +#define SAY_FLESH_2 1600015 +#define SAY_SKELETON_1 1600016 +#define SAY_SKELETON_2 1600017 +#define SAY_DEATH 1600018 + +struct TRINITY_DLL_DECL boss_tharon_jaAI : public ScriptedAI +{ + boss_tharon_jaAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if(!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH,m_creature); + } +}; + +CreatureAI* GetAI_boss_tharon_ja(Creature *_Creature) +{ + return new boss_tharon_jaAI (_Creature); +} + +void AddSC_boss_tharon_ja() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_tharon_ja"; + newscript->GetAI = &GetAI_boss_tharon_ja; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/zone/draktharon_keep/boss_trollgore.cpp b/src/bindings/scripts/scripts/zone/draktharon_keep/boss_trollgore.cpp new file mode 100644 index 00000000000..74b474b0fd1 --- /dev/null +++ b/src/bindings/scripts/scripts/zone/draktharon_keep/boss_trollgore.cpp @@ -0,0 +1,75 @@ +/* Script Data Start +SDName: Boss trollgore +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = 'boss_trollgore' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spell +#define SPELL_INFECTED_WOUND 49637 +#define SPELL_CRUSH 49639 +#define SPELL_CORPSE_EXPLODE_N 49555 +#define SPELL_CONSUME_N 49380 + +//Spell Heroic +#define SPELL_CORPSE_EXPLODE_H 59807 +#define SPELL_CONSUME_H 59803 + +//Yell +#define SAY_AGGRO -1600006 +#define SAY_KILL -1600007 +#define SAY_CONSUME -1600008 +#define SAY_EXPLODE -1600009 +#define SAY_DEATH -1600010 + +struct TRINITY_DLL_DECL boss_trollgoreAI : public ScriptedAI +{ + boss_trollgoreAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if(!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + DoScriptText(SAY_KILL, m_creature); + } +}; + +CreatureAI* GetAI_boss_trollgore(Creature *_Creature) +{ + return new boss_trollgoreAI (_Creature); +} + +void AddSC_boss_trollgore() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_trollgore"; + newscript->GetAI = &GetAI_boss_trollgore; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/zone/draktharon_keep/def_drak_tharon_keep.h b/src/bindings/scripts/scripts/zone/draktharon_keep/def_drak_tharon_keep.h new file mode 100644 index 00000000000..321d77a9c27 --- /dev/null +++ b/src/bindings/scripts/scripts/zone/draktharon_keep/def_drak_tharon_keep.h @@ -0,0 +1,4 @@ +#ifndef DEF_DRAK_THARON_H +#define DEF_DRAK_THARON_H + +#endif diff --git a/src/bindings/scripts/scripts/zone/draktharon_keep/instance_drak_tharon_keep.cpp b/src/bindings/scripts/scripts/zone/draktharon_keep/instance_drak_tharon_keep.cpp new file mode 100644 index 00000000000..867c576db0d --- /dev/null +++ b/src/bindings/scripts/scripts/zone/draktharon_keep/instance_drak_tharon_keep.cpp @@ -0,0 +1,21 @@ +#include "precompiled.h" +#include "def_drak_tharon_keep.h" + +struct TRINITY_DLL_DECL instance_drak_tharon : public ScriptedInstance +{ + instance_drak_tharon(Map *Map) : ScriptedInstance(Map) {Initialize();}; +}; + +InstanceData* GetInstanceData_instance_drak_tharon(Map* map) +{ + return new instance_drak_tharon(map); +} + +void AddSC_instance_drak_tharon() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_drak_tharon"; + newscript->GetInstanceData = &GetInstanceData_instance_drak_tharon; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/zone/dun_morogh/dun_morogh.cpp b/src/bindings/scripts/scripts/zone/dun_morogh/dun_morogh.cpp index 623cda57518..5e33be96da0 100644 --- a/src/bindings/scripts/scripts/zone/dun_morogh/dun_morogh.cpp +++ b/src/bindings/scripts/scripts/zone/dun_morogh/dun_morogh.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>.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 @@ -44,11 +44,11 @@ struct TRINITY_DLL_DECL npc_narm_faulkAI : public ScriptedAI { lifeTimer = 120000; m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 32); - m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,7); // lay down + m_creature->SetStandState(UNIT_STAND_STATE_DEAD); spellHit = false; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } @@ -59,7 +59,7 @@ struct TRINITY_DLL_DECL npc_narm_faulkAI : public ScriptedAI void UpdateAI(const uint32 diff) { - if (!m_creature->GetUInt32Value(UNIT_FIELD_BYTES_1)) + if (m_creature->IsStandState()) { if(lifeTimer < diff) { @@ -76,7 +76,7 @@ struct TRINITY_DLL_DECL npc_narm_faulkAI : public ScriptedAI if(Spellkind->Id == 8593 && !spellHit) { DoCast(m_creature,32343); - m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,0); + m_creature->SetStandState(UNIT_STAND_STATE_STAND); m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 0); //m_creature->RemoveAllAuras(); DoScriptText(SAY_HEAL, m_creature); diff --git a/src/bindings/scripts/scripts/zone/dustwallow_marsh/dustwallow_marsh.cpp b/src/bindings/scripts/scripts/zone/dustwallow_marsh/dustwallow_marsh.cpp index 6e3e0fbb6d7..9e88ac0becc 100644 --- a/src/bindings/scripts/scripts/zone/dustwallow_marsh/dustwallow_marsh.cpp +++ b/src/bindings/scripts/scripts/zone/dustwallow_marsh/dustwallow_marsh.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -52,12 +52,12 @@ struct TRINITY_DLL_DECL mobs_risen_husk_spiritAI : public ScriptedAI IntangiblePresence_Timer = 5000; } - void Aggro(Unit* who) { } + void EnterCombat(Unit* who) { } void DamageTaken(Unit *done_by, uint32 &damage) { if( done_by->GetTypeId() == TYPEID_PLAYER ) - if( damage >= m_creature->GetHealth() && ((Player*)done_by)->GetQuestStatus(11180) == QUEST_STATUS_INCOMPLETE ) + if( damage >= m_creature->GetHealth() && CAST_PLR(done_by)->GetQuestStatus(11180) == QUEST_STATUS_INCOMPLETE ) m_creature->CastSpell(done_by,SPELL_SUMMON_RESTLESS_APPARITION,false); } @@ -115,7 +115,7 @@ struct TRINITY_DLL_DECL npc_deserter_agitatorAI : public ScriptedAI m_creature->setFaction(894); } - void Aggro(Unit* who) {} + void EnterCombat(Unit* who) {} }; CreatureAI* GetAI_npc_deserter_agitator(Creature *_Creature) diff --git a/src/bindings/scripts/scripts/zone/eastern_plaguelands/eastern_plaguelands.cpp b/src/bindings/scripts/scripts/zone/eastern_plaguelands/eastern_plaguelands.cpp index 6d068ec1543..be1a2258dda 100644 --- a/src/bindings/scripts/scripts/zone/eastern_plaguelands/eastern_plaguelands.cpp +++ b/src/bindings/scripts/scripts/zone/eastern_plaguelands/eastern_plaguelands.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -40,7 +40,7 @@ struct TRINITY_DLL_DECL mobs_ghoul_flayerAI : public ScriptedAI void Reset() { } - void Aggro(Unit* who) { } + void EnterCombat(Unit* who) { } void JustDied(Unit* Killer) { @@ -93,7 +93,7 @@ struct TRINITY_DLL_DECL npc_darrowshire_spiritAI : public ScriptedAI m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); } - void Aggro(Unit *who) { } + void EnterCombat(Unit *who) { } }; CreatureAI* GetAI_npc_darrowshire_spirit(Creature *_Creature) @@ -118,7 +118,7 @@ bool GossipHello_npc_tirion_fordring(Player *player, Creature *_Creature) if (_Creature->isQuestGiver()) player->PrepareQuestMenu( _Creature->GetGUID() ); - if (player->GetQuestStatus(5742) == QUEST_STATUS_INCOMPLETE && player->getStandState() == PLAYER_STATE_SIT ) + if (player->GetQuestStatus(5742) == QUEST_STATUS_INCOMPLETE && player->getStandState() == UNIT_STAND_STATE_SIT ) player->ADD_GOSSIP_ITEM( 0, "I am ready to hear your tale, Tirion.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID()); diff --git a/src/bindings/scripts/scripts/zone/eastern_plaguelands/the_scarlet_enclave.cpp b/src/bindings/scripts/scripts/zone/eastern_plaguelands/the_scarlet_enclave.cpp new file mode 100644 index 00000000000..560d9196d95 --- /dev/null +++ b/src/bindings/scripts/scripts/zone/eastern_plaguelands/the_scarlet_enclave.cpp @@ -0,0 +1,671 @@ +/* + * Copyright (C) 2009 Trinity <http://www.trinitycore.org/> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "precompiled.h" + +#define GCD_CAST 1 + +/*###### +##Quest 12848 +######*/ + +#define SAY_EVENT_START "I will dismantle this festering hellhole!" +#define SAY_EVENT_ATTACK "It ends here!" + +#define SPELL_SOUL_PRISON_CHAIN_SELF 54612 +#define SPELL_SOUL_PRISON_CHAIN 54613 + +#define SPELL_ICY_TOUCH 52372 +#define SPELL_PLAGUE_STRIKE 52373 +#define SPELL_BLOOD_STRIKE 52374 +#define SPELL_DEATH_COIL 52375 + +#define EVENT_ICY_TOUCH 1 +#define EVENT_PLAGUE_STRIKE 2 +#define EVENT_BLOOD_STRIKE 3 +#define EVENT_DEATH_COIL 4 + +uint32 acherus_soul_prison[12] = +{ + 191577, + 191580, + 191581, + 191582, + 191583, + 191584, + 191585, + 191586, + 191587, + 191588, + 191589, + 191590 +}; + +uint32 acherus_unworthy_initiate[5] = +{ + 29519, + 29520, + 29565, + 29566, + 29567 +}; + +enum initiate_phase +{ + Chained, + ToEquipping, + Equipping, + ToAttacking, + Attacking +}; + +float modelid_dk_armor[20] = +{ + 25432, // bloodelf female + 25422, // bloodelf male + 25412, // draenei female + 25420, // draenei male + 25406, // dwarf female + 25414, // dwarf male + 25438, // forsaken female + 25426, // forsaken male + 25408, // gnome female + 25426, // gnome male + 25404, // human female + 25375, // human male + 25410, // nightelf female + 25418, // nightelf male + 25436, // orc female + 25424, // orc male + 25440, // tauren female + 25430, // tauren male + 25434, // troll female + 25428 // troll male +}; + +float modelid_dk_unworthy[20] = +{ + 25369, // bloodelf female + 25373, // bloodelf male + 25363, // draenei female + 25357, // draenei male + 25361, // dwarf female + 25356, // dwarf male + 25372, // forsaken female + 25367, // forsaken male + 25362, // gnome female + 25359, // gnome male + 25355, // human female + 25354, // human male + 25360, // nightelf female + 25358, // nightelf male + 25368, // orc female + 25364, // orc male + 25371, // tauren female + 25366, // tauren male + 25370, // troll female + 25365 // troll male +}; + +struct TRINITY_DLL_DECL npc_unworthy_initiateAI : public ScriptedAI +{ + npc_unworthy_initiateAI(Creature *c) : ScriptedAI(c) + { + m_creature->GetHomePosition(home_x,home_y,home_z,home_ori); + } + + float home_x,home_y,home_z,home_ori; + bool event_startet; + uint64 event_starter; + initiate_phase phase; + uint32 wait_timer; + float targ_x,targ_y,targ_z; + uint64 anchor; + + EventMap events; + + void Reset() + { + anchor = 0; + phase = Chained; + events.Reset(); + m_creature->setFaction(7); + m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 8); + m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID , 0); + m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, m_creature->GetNativeDisplayId()); + event_starter = 0; + event_startet = false; + + m_creature->SetHomePosition(home_x,home_y,home_z,home_ori); + m_creature->GetMotionMaster()->MoveTargetedHome(); + } + + void EnterCombat(Unit *who) + { + events.ScheduleEvent(EVENT_ICY_TOUCH, 1000, GCD_CAST); + events.ScheduleEvent(EVENT_PLAGUE_STRIKE, 3000, GCD_CAST); + events.ScheduleEvent(EVENT_BLOOD_STRIKE, 2000, GCD_CAST); + events.ScheduleEvent(EVENT_DEATH_COIL, 5000, GCD_CAST); + } + + void JustDied(Unit *killer) + { + if(m_creature->GetEntry() != 29519) + if(killer->GetTypeId() == TYPEID_PLAYER) + CAST_PLR(killer)->KilledMonster(29519,m_creature->GetGUID()); + } + + void AddEquipp() + { + int model_counter = 0; + for(int i = 0; i< 20; i++) + { + if(m_creature->GetDisplayId() == modelid_dk_unworthy[i]) + { + model_counter = i; + break; + } + } + + m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, modelid_dk_armor[model_counter]); + m_creature->LoadEquipment(m_creature->GetEquipmentId()); + } + + void MovementInform(uint32 type, uint32 id) + { + if(type != POINT_MOTION_TYPE) + return; + + if(id == 1) + { + wait_timer = 5000; + AddEquipp(); + + DoSay(SAY_EVENT_ATTACK,LANG_UNIVERSAL,NULL,true); + + phase = ToAttacking; + } + } + + void EventStart(Creature* anchor, Player* target) + { + wait_timer = 5000; + phase = ToEquipping; + + m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); + + anchor->GetPosition(targ_x,targ_y,targ_z); + anchor->DealDamage(anchor,anchor->GetHealth()); + m_creature->RemoveAurasDueToSpell(SPELL_SOUL_PRISON_CHAIN_SELF); + m_creature->RemoveAurasDueToSpell(SPELL_SOUL_PRISON_CHAIN); + + DoSay(SAY_EVENT_START,LANG_UNIVERSAL,NULL,true); + event_starter = target->GetGUID(); + } + + void UpdateAI(const uint32 diff); +}; + +CreatureAI* GetAI_npc_unworthy_initiate(Creature *_Creature) +{ + return new npc_unworthy_initiateAI(_Creature); +} + +struct TRINITY_DLL_DECL npc_unworthy_initiate_anchorAI : public ScriptedAI +{ + npc_unworthy_initiate_anchorAI(Creature *c) : ScriptedAI(c) { guid_target = 0; } + + uint64 guid_target; + + void Reset(){} + + void SetTarget(uint64 target); + uint64 GetTarget() + { + return guid_target; + } + + void UpdateAI(const uint32 diff){} +}; + +void npc_unworthy_initiate_anchorAI::SetTarget(uint64 target) +{ + if(guid_target <= 0) + guid_target = target; +} + +void npc_unworthy_initiateAI::UpdateAI(const uint32 diff) +{ + switch(phase) + { + case Chained: + if(anchor == 0) + { + float x, y, z; + float dist = 99.0f; + uint64 nearest_prison; + + for(int i = 0; i < 12; i++) + { + GameObject* temp_prison; + temp_prison = m_creature->FindNearestGameObject(acherus_soul_prison[i],30); + if(temp_prison) + { + if(dist == 99.0f || dist > m_creature->GetDistance2d(temp_prison)) + { + temp_prison->GetPosition(x, y, z); + dist = m_creature->GetDistance2d(temp_prison); + nearest_prison = temp_prison->GetGUID(); + } + } + } + if(dist == 99) + return; + + Creature* trigger = m_creature->SummonCreature(29521,x,y,z,0,TEMPSUMMON_MANUAL_DESPAWN,100); + if(trigger) + { + GameObject* go_prison = GameObject::GetGameObject((*m_creature),nearest_prison); + if(go_prison) + go_prison->ResetDoorOrButton(); + + CAST_AI(npc_unworthy_initiate_anchorAI, trigger->AI())->SetTarget(m_creature->GetGUID()); + trigger->CastSpell(m_creature,SPELL_SOUL_PRISON_CHAIN,true); + anchor = trigger->GetGUID(); + } + } + return; + case ToEquipping: + if(wait_timer) + { + if(wait_timer < diff) + { + m_creature->GetMotionMaster()->MovePoint(1,targ_x,targ_y,m_creature->GetPositionZ()); + phase = Equipping; + wait_timer = 0; + }else wait_timer -= diff; + } + return; + case ToAttacking: + if(wait_timer) + { + if(wait_timer < diff) + { + m_creature->setFaction(14); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); + phase = Attacking; + + if(Unit* target = Unit::GetUnit((*m_creature),event_starter)) + m_creature->AI()->AttackStart(target); + wait_timer = 0; + }else wait_timer -= diff; + } + return; + case Attacking: + if(!UpdateVictim()) + return; + + events.Update(diff); + + while(uint32 eventId = events.ExecuteEvent()) + { + switch(eventId) + { + case EVENT_ICY_TOUCH: + DoCast(m_creature->getVictim(), SPELL_ICY_TOUCH); + events.DelayEvents(1000, GCD_CAST); + events.ScheduleEvent(EVENT_ICY_TOUCH, 5000, GCD_CAST); + break; + case EVENT_PLAGUE_STRIKE: + DoCast(m_creature->getVictim(), SPELL_PLAGUE_STRIKE); + events.DelayEvents(1000, GCD_CAST); + events.ScheduleEvent(SPELL_PLAGUE_STRIKE, 5000, GCD_CAST); + break; + case EVENT_BLOOD_STRIKE: + DoCast(m_creature->getVictim(), SPELL_BLOOD_STRIKE); + events.DelayEvents(1000, GCD_CAST); + events.ScheduleEvent(EVENT_BLOOD_STRIKE, 5000, GCD_CAST); + break; + case EVENT_DEATH_COIL: + DoCast(m_creature->getVictim(), SPELL_DEATH_COIL); + events.DelayEvents(1000, GCD_CAST); + events.ScheduleEvent(EVENT_DEATH_COIL, 5000, GCD_CAST); + break; + } + } + + DoMeleeAttackIfReady(); + return; + } +} + +CreatureAI* GetAI_npc_unworthy_initiate_anchor(Creature *_Creature) +{ + return new npc_unworthy_initiate_anchorAI(_Creature); +} + +bool GOHello_go_acherus_soul_prison(Player *player, GameObject* _GO) +{ + Creature* finder = player->SummonCreature(WORLD_TRIGGER,_GO->GetPositionX(),_GO->GetPositionY(),_GO->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN,2000); + if(!finder) return false; + + Unit* prison_anchor = finder->FindNearestCreature(29521, 15); + if(!prison_anchor) return false; + + uint64 owner = CAST_AI(npc_unworthy_initiate_anchorAI, CAST_CRE(prison_anchor)->AI())->GetTarget(); + + Creature* prisoner = Creature::GetCreature((*player),owner); + if(prisoner) + { + CAST_AI(npc_unworthy_initiateAI, (prisoner->AI()))->EventStart(CAST_CRE(prison_anchor),player); + } + + return false; +} + +/*###### +## npc_death_knight_initiate +######*/ + +#define GOSSIP_DKI "Duel with me!" + +const char * SAY_DKI_DUEL1 = "Remember this day, $N, for it is the day that you will be thoroughly owned."; +const char * SAY_DKI_DUEL2 = "I'm going to tear your heart out, cupcake!"; +const char * SAY_DKI_DUEL3 = "You have challenged death itself!"; +const char * SAY_DKI_DUEL4 = "Don't make me laugh."; +const char * SAY_DKI_DUEL5 = "Here come the tears..."; +const char * SAY_DKI_DUEL6 = "No potions!"; +#define SAY_DKI_DUEL RAND(SAY_DKI_DUEL1,SAY_DKI_DUEL2,SAY_DKI_DUEL3,SAY_DKI_DUEL4,SAY_DKI_DUEL5,SAY_DKI_DUEL6) + +#define SPELL_DUEL_FLAG 52991 + +struct TRINITY_DLL_DECL npc_death_knight_initiateAI : public SpellAI +{ + npc_death_knight_initiateAI(Creature *c) : SpellAI(c) {} + + void Reset() + { + me->RestoreFaction(); + lose = false; + SpellAI::Reset(); + } + + bool lose; + + void EnterCombat(Unit *who) + { + if(who->GetTypeId() == TYPEID_PLAYER) + me->MonsterSay(SAY_DKI_DUEL, LANG_UNIVERSAL, who->GetGUID()); + SpellAI::EnterCombat(who); + } + + void UpdateAI(const uint32 diff) + { + if(me->getVictim() && me->getVictim()->GetTypeId() == TYPEID_PLAYER) + { + if(lose) + { + if(!me->HasAura(7267)) // beg aura has faded + { + CAST_PLR(me->getVictim())->KilledMonster(29025,m_creature->GetGUID()); + EnterEvadeMode(); + } + return; + } + else if(me->getVictim()->GetHealth() * 10 < me->getVictim()->GetMaxHealth()) + { + me->getVictim()->CastSpell(me->getVictim(), 7267, true); // beg + me->getVictim()->RemoveGameObject(SPELL_DUEL_FLAG, true); + EnterEvadeMode(); + return; // must return after enterevademode + } + } + + SpellAI::UpdateAI(diff); + } + + void DamageTaken(Unit *done_by, uint32 & damage) + { + if(done_by->GetTypeId() == TYPEID_PLAYER) + { + if(done_by != me->getVictim()) + damage = 0; // not allow other player to help + else if(damage > me->GetHealth()) + { + damage = 0; + done_by->AttackStop(); + if(!lose) + { + lose = true; + me->CastSpell(me, 7267, true); // beg + me->getVictim()->RemoveGameObject(SPELL_DUEL_FLAG, true); + me->RestoreFaction(); + } + } + } + } +}; + +CreatureAI* GetAI_npc_death_knight_initiate(Creature *_Creature) +{ + return new npc_death_knight_initiateAI(_Creature); +} + +bool GossipHello_npc_death_knight_initiate(Player *player, Creature *_Creature) +{ + if( player->GetQuestStatus(12733) == QUEST_STATUS_INCOMPLETE && _Creature->GetHealth() == _Creature->GetMaxHealth()) + player->ADD_GOSSIP_ITEM(0, GOSSIP_DKI, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + + player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(),_Creature->GetGUID()); + return true; +} + +bool GossipSelect_npc_death_knight_initiate(Player *player, Creature *_Creature, uint32 sender, uint32 action ) +{ + if( action == GOSSIP_ACTION_INFO_DEF ) + { + player->CastSpell(player, SPELL_DUEL_FLAG, true); + if (player->GetTeam() == HORDE ) // Check the player team, then choose faction + _Creature->setFaction(1); + else + _Creature->setFaction(2); + _Creature->AI()->AttackStart(player); + } + return true; +} + +/*###### +## npc_salanar_the_horseman +######*/ + +enum +{ + REALM_OF_SHADOWS = 52693 +}; + +struct TRINITY_DLL_DECL npc_salanar_the_horsemanAI : public ScriptedAI +{ + npc_salanar_the_horsemanAI(Creature *c) : ScriptedAI(c) {} + + void MoveInLineOfSight(Unit *who) + { + ScriptedAI::MoveInLineOfSight(who); + + if(who->GetTypeId() == TYPEID_UNIT && CAST_CRE(who)->isVehicle() && me->IsWithinDistInMap(who, 10.0f)) + { + if( Unit *charmer = who->GetCharmer() ) + { + if( charmer->GetTypeId() == TYPEID_PLAYER ) + { + switch(me->GetEntry()) + { + // for quest Grand Theft Palomino(12680) + case 28653: + if( CAST_PLR(charmer)->GetQuestStatus(12680) == QUEST_STATUS_INCOMPLETE ) + CAST_PLR(charmer)->KilledMonster(28767, me->GetGUID()); + break; + // for quest Into the Realm of Shadows(12687) + case 28788: + if( CAST_PLR(charmer)->GetQuestStatus(12687) == QUEST_STATUS_INCOMPLETE ) + { + if(CAST_PLR(charmer)->HasAura(REALM_OF_SHADOWS)) + charmer->RemoveAurasDueToSpell(REALM_OF_SHADOWS); + CAST_PLR(charmer)->GroupEventHappens(12687, me); + } + break; + default: + return; + } + CAST_PLR(charmer)->ExitVehicle(); + //without this we can see npc kill the horse + who->setDeathState(DEAD); + CAST_CRE(who)->Respawn(); + } + } + } + } +}; + +CreatureAI* GetAI_npc_salanar_the_horseman(Creature *_Creature) +{ + return new npc_salanar_the_horsemanAI(_Creature); +} + +/*###### +## npc_ros_dark_rider +######*/ + +struct TRINITY_DLL_DECL npc_ros_dark_riderAI : public ScriptedAI +{ + npc_ros_dark_riderAI(Creature *c) : ScriptedAI(c) {} + + void MoveInLineOfSight(Unit *who) + { + if(me->getVictim()) + return; + + // this should be before next one otherwise he may enter vehicle again + if(!me->m_Vehicle && who->GetEntry() == 28782 && CAST_CRE(who)->isVehicle() && !who->GetCharmerGUID()) + me->EnterVehicle((Vehicle*)who); + + ScriptedAI::MoveInLineOfSight(who); + } + + void CombatStart(Unit *who) + { + me->ExitVehicle(); + } + + void Reset() + { + Creature* deathcharger = me->FindNearestCreature(28782, 30); + if(!deathcharger) return; + deathcharger->RestoreFaction(); + deathcharger->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK); + deathcharger->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + } + + void JustDied(Unit *killer) + { + Creature* deathcharger = me->FindNearestCreature(28782, 30); + if(!deathcharger) return; + if( killer->GetTypeId() == TYPEID_PLAYER && deathcharger->GetTypeId() == TYPEID_UNIT && deathcharger->isVehicle() ) + { + deathcharger->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK); + deathcharger->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + deathcharger->setFaction(2096); + } + } +}; + +CreatureAI* GetAI_npc_ros_dark_rider(Creature *_Creature) +{ + return new npc_ros_dark_riderAI(_Creature); +} + +struct TRINITY_DLL_DECL npc_dkc1_gothikAI : public ScriptedAI +{ + npc_dkc1_gothikAI(Creature *c) : ScriptedAI(c) {} + + void MoveInLineOfSight(Unit *who) + { + ScriptedAI::MoveInLineOfSight(who); + + if(who->GetEntry() == 28845 && me->IsWithinDistInMap(who, 10.0f)) + { + if(Unit *owner = who->GetOwner()) + { + if(owner->GetTypeId() == TYPEID_PLAYER) + { + if(CAST_PLR(owner)->GetQuestStatus(12698) == QUEST_STATUS_INCOMPLETE) + { + CAST_PLR(owner)->KilledMonster(28845, me->GetGUID()); + who->setDeathState(DEAD); + } + } + } + } + } +}; + +CreatureAI* GetAI_npc_dkc1_gothik(Creature *_Creature) +{ + return new npc_dkc1_gothikAI(_Creature); +} + +void AddSC_the_scarlet_enclave() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="npc_unworthy_initiate"; + newscript->GetAI = &GetAI_npc_unworthy_initiate; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_unworthy_initiate_anchor"; + newscript->GetAI = &GetAI_npc_unworthy_initiate_anchor; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="go_acherus_soul_prison"; + newscript->pGOHello = &GOHello_go_acherus_soul_prison; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_death_knight_initiate"; + newscript->pGossipHello = &GossipHello_npc_death_knight_initiate; + newscript->pGossipSelect = &GossipSelect_npc_death_knight_initiate; + newscript->GetAI = &GetAI_npc_death_knight_initiate; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_salanar_the_horseman"; + newscript->GetAI = &GetAI_npc_salanar_the_horseman; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_ros_dark_rider"; + newscript->GetAI = &GetAI_npc_ros_dark_rider; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_dkc1_gothik"; + newscript->GetAI = &GetAI_npc_dkc1_gothik; + newscript->RegisterSelf(); +}
\ No newline at end of file diff --git a/src/bindings/scripts/scripts/zone/elwynn_forest/elwynn_forest.cpp b/src/bindings/scripts/scripts/zone/elwynn_forest/elwynn_forest.cpp index 354da2892c1..6fe009743e0 100644 --- a/src/bindings/scripts/scripts/zone/elwynn_forest/elwynn_forest.cpp +++ b/src/bindings/scripts/scripts/zone/elwynn_forest/elwynn_forest.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>.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 @@ -44,11 +44,11 @@ struct TRINITY_DLL_DECL npc_henze_faulkAI : public ScriptedAI { lifeTimer = 120000; m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 32); - m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,7); // lay down + m_creature->SetStandState(UNIT_STAND_STATE_DEAD); // lay down spellHit = false; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } @@ -59,7 +59,7 @@ struct TRINITY_DLL_DECL npc_henze_faulkAI : public ScriptedAI void UpdateAI(const uint32 diff) { - if (!m_creature->GetUInt32Value(UNIT_FIELD_BYTES_1)) + if (m_creature->IsStandState()) { if(lifeTimer < diff) { @@ -76,7 +76,7 @@ struct TRINITY_DLL_DECL npc_henze_faulkAI : public ScriptedAI if(Spellkind->Id == 8593 && !spellHit) { DoCast(m_creature,32343); - m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,0); + m_creature->SetStandState(UNIT_STAND_STATE_STAND); m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 0); //m_creature->RemoveAllAuras(); DoScriptText(SAY_HEAL, m_creature); diff --git a/src/bindings/scripts/scripts/zone/eversong_woods/eversong_woods.cpp b/src/bindings/scripts/scripts/zone/eversong_woods/eversong_woods.cpp index 7340ac5c073..aaded603f80 100644 --- a/src/bindings/scripts/scripts/zone/eversong_woods/eversong_woods.cpp +++ b/src/bindings/scripts/scripts/zone/eversong_woods/eversong_woods.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>.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 @@ -17,46 +17,22 @@ /* ScriptData SDName: Eversong_Woods SD%Complete: 100 -SDComment: Quest support: 8346, 8483, 8488, 8490 +SDComment: Quest support: 8483, 8488, 8490, 9686 SDCategory: Eversong Woods EndScriptData */ /* ContentData -mobs_mana_tapped 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" /*###### -## mobs_mana_tapped -######*/ - -struct TRINITY_DLL_DECL mobs_mana_tappedAI : public ScriptedAI -{ - mobs_mana_tappedAI(Creature *c) : ScriptedAI(c) {} - - void Reset() { } - - void Aggro(Unit *who) { } - - void SpellHit(Unit *caster, const SpellEntry *spell) - { - if( caster->GetTypeId() == TYPEID_PLAYER) - if( ((Player*)caster)->GetQuestStatus(8346) == QUEST_STATUS_INCOMPLETE && !((Player*)caster)->GetReqKillOrCastCurrentCount(8346, m_creature->GetEntry()) && spell->Id == 28734) - ((Player*)caster)->CastedCreatureOrGO(15468, m_creature->GetGUID(), spell->Id); - return; - } -}; -CreatureAI* GetAI_mobs_mana_tapped(Creature *_Creature) -{ - return new mobs_mana_tappedAI (_Creature); -} - -/*###### ## npc_prospector_anvilward ######*/ @@ -89,7 +65,7 @@ struct TRINITY_DLL_DECL npc_prospector_anvilwardAI : public npc_escortAI } } - void Aggro(Unit* who) { } + void EnterCombat(Unit* who) { } void Reset() { @@ -107,20 +83,13 @@ struct TRINITY_DLL_DECL npc_prospector_anvilwardAI : public npc_escortAI } }; -CreatureAI* GetAI_npc_prospector_anvilward(Creature *_Creature) +CreatureAI* GetAI_npc_prospector_anvilward(Creature* pCreature) { - npc_prospector_anvilwardAI* thisAI = new npc_prospector_anvilwardAI(_Creature); - - thisAI->AddWaypoint(0, 9294.78, -6682.51, 22.42); - thisAI->AddWaypoint(1, 9298.27, -6667.99, 22.42); - thisAI->AddWaypoint(2, 9309.63, -6658.84, 22.43); - thisAI->AddWaypoint(3, 9304.43, -6649.31, 26.46); - thisAI->AddWaypoint(4, 9298.83, -6648.00, 28.61); - thisAI->AddWaypoint(5, 9291.06, -6653.46, 31.83, 2500); - thisAI->AddWaypoint(6, 9289.08, -6660.17, 31.85, 5000); - thisAI->AddWaypoint(7, 9291.06, -6653.46, 31.83); - - return (CreatureAI*)thisAI; + npc_prospector_anvilwardAI* thisAI = new npc_prospector_anvilwardAI(pCreature); + + thisAI->FillPointMovementListForCreature(); + + return thisAI; } bool GossipHello_npc_prospector_anvilward(Player *player, Creature *_Creature) @@ -142,7 +111,7 @@ bool GossipSelect_npc_prospector_anvilward(Player *player, Creature *_Creature, break; case GOSSIP_ACTION_INFO_DEF+2: player->CLOSE_GOSSIP_MENU(); - ((npc_escortAI*)(_Creature->AI()))->Start(true, true, false, player->GetGUID()); + CAST_AI(npc_escortAI, (_Creature->AI()))->Start(true, true, false, player->GetGUID()); break; } return true; @@ -229,7 +198,7 @@ struct TRINITY_DLL_DECL npc_secondTrialAI : public ScriptedAI questPhase = 0; summonerGuid = 0; - m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, PLAYER_STATE_KNEEL); + m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_KNEEL); m_creature->setFaction(FACTION_FRIENDLY); spellFlashLight = false; @@ -261,14 +230,14 @@ struct TRINITY_DLL_DECL npc_secondTrialAI : public ScriptedAI } } - void Aggro(Unit *who) { } + void EnterCombat(Unit *who) { } void UpdateAI(const uint32 diff) { if ( questPhase == 1 ) { if ( timer < diff ) { - m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, PLAYER_STATE_NONE); + m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_STAND); m_creature->setFaction(FACTION_HOSTILE); questPhase = 0; @@ -357,7 +326,7 @@ struct TRINITY_DLL_DECL master_kelerun_bloodmournAI : public ScriptedAI } - void Aggro(Unit *who) {} + void EnterCombat(Unit *who) {} void UpdateAI(const uint32 diff) { @@ -374,7 +343,7 @@ struct TRINITY_DLL_DECL master_kelerun_bloodmournAI : public ScriptedAI Creature* paladinSpawn; paladinSpawn = (Unit::GetCreature((*m_creature), paladinGuid[paladinPhase])); if ( paladinSpawn ) { - ((npc_secondTrialAI*)paladinSpawn->AI())->Activate(m_creature->GetGUID()); + CAST_AI(npc_secondTrialAI, paladinSpawn->AI())->Activate(m_creature->GetGUID()); switch(paladinPhase) { case 0: @@ -436,7 +405,7 @@ bool GossipHello_master_kelerun_bloodmourn(Player *player, Creature *_Creature) // 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 ( ((master_kelerun_bloodmournAI*)_Creature->AI())->questPhase == 0 ) { + if ( CAST_AI(master_kelerun_bloodmournAI, _Creature->AI())->questPhase == 0 ) { player->PrepareQuestMenu(_Creature->GetGUID()); player->SendPreparedQuest(_Creature->GetGUID()); } @@ -449,7 +418,7 @@ bool QuestAccept_master_kelerun_bloodmourn(Player *player, Creature *creature, Q { // One Player exclusive quest, wait for user go activation if(quest->GetQuestId() == QUEST_SECOND_TRIAL ) - ((master_kelerun_bloodmournAI*)creature->AI())->questPhase = 1; + CAST_AI(master_kelerun_bloodmournAI, creature->AI())->questPhase = 1; return true; } @@ -475,12 +444,12 @@ void npc_secondTrialAI::JustDied(Unit* Killer) { Summoner = (Unit::GetCreature((*m_creature), summonerGuid)); if ( Summoner ) - ((master_kelerun_bloodmournAI*)Summoner->AI())->SecondTrialKill(); + CAST_AI(master_kelerun_bloodmournAI, Summoner->AI())->SecondTrialKill(); // last kill quest complete for group if ( m_creature->GetEntry() == CHAMPION_SUNSTRIKER ) { - if( Group *pGroup = ((Player*)Killer)->GetGroup() ) + if( Group *pGroup = CAST_PLR(Killer)->GetGroup() ) { for(GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next()) { @@ -492,8 +461,8 @@ void npc_secondTrialAI::JustDied(Unit* Killer) { } } else { - if ( ((Player*)Killer)->GetQuestStatus( QUEST_SECOND_TRIAL ) == QUEST_STATUS_INCOMPLETE ) - ((Player*)Killer)->CompleteQuest( QUEST_SECOND_TRIAL ); + if ( CAST_PLR(Killer)->GetQuestStatus( QUEST_SECOND_TRIAL ) == QUEST_STATUS_INCOMPLETE ) + CAST_PLR(Killer)->CompleteQuest( QUEST_SECOND_TRIAL ); } } } @@ -503,8 +472,8 @@ void npc_secondTrialAI::KilledUnit(Unit* Killed) { if ( Killed->GetTypeId() == TYPEID_PLAYER ) { - if ( ((Player*)Killed)->GetQuestStatus(QUEST_SECOND_TRIAL) == QUEST_STATUS_INCOMPLETE ) - ((Player*)Killed)->FailQuest(QUEST_SECOND_TRIAL); + if ( CAST_PLR(Killed)->GetQuestStatus(QUEST_SECOND_TRIAL) == QUEST_STATUS_INCOMPLETE ) + CAST_PLR(Killed)->FailQuest(QUEST_SECOND_TRIAL); } } @@ -539,13 +508,13 @@ bool GOHello_go_second_trial(Player *player, GameObject* _GO) Creature* event_controller = NULL; Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck u_check(*_GO, MASTER_KELERUN_BLOODMOURN, true, 30); - Trinity::CreatureLastSearcher<Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck> searcher(event_controller, u_check); + Trinity::CreatureLastSearcher<Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck> searcher(player, event_controller, u_check); TypeContainerVisitor<Trinity::CreatureLastSearcher<Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck>, GridTypeMapContainer > grid_unit_searcher(searcher); //cell_lock->Visit(cell_lock, grid_unit_searcher, *MapManager::Instance().GetMap(_GO->GetMap(), _GO)); cell_lock->Visit(cell_lock, grid_unit_searcher, *(_GO->GetMap())); if ( event_controller ) - ((master_kelerun_bloodmournAI*)event_controller->AI())->StartEvent(); + CAST_AI(master_kelerun_bloodmournAI, event_controller->AI())->StartEvent(); return true; } @@ -575,7 +544,7 @@ struct TRINITY_DLL_DECL npc_apprentice_mirvedaAI : public ScriptedAI Summon = false; } - void Aggro(Unit* who){} + void EnterCombat(Unit* who){} void JustSummoned(Creature *summoned) { @@ -595,7 +564,7 @@ struct TRINITY_DLL_DECL npc_apprentice_mirvedaAI : public ScriptedAI { Player* player = Unit::GetPlayer(PlayerGUID); if (player) - ((Player*)player)->FailQuest(QUEST_UNEXPECTED_RESULT); + CAST_PLR(player)->FailQuest(QUEST_UNEXPECTED_RESULT); } } @@ -607,7 +576,7 @@ struct TRINITY_DLL_DECL npc_apprentice_mirvedaAI : public ScriptedAI { Player* player = Unit::GetPlayer(PlayerGUID); if(player) - ((Player*)player)->CompleteQuest(QUEST_UNEXPECTED_RESULT); + CAST_PLR(player)->CompleteQuest(QUEST_UNEXPECTED_RESULT); } } @@ -625,8 +594,8 @@ bool QuestAccept_npc_apprentice_mirveda(Player* player, Creature* creature, Ques { if (quest->GetQuestId() == QUEST_UNEXPECTED_RESULT) { - ((npc_apprentice_mirvedaAI*)creature->AI())->Summon = true; - ((npc_apprentice_mirvedaAI*)creature->AI())->PlayerGUID = player->GetGUID(); + CAST_AI(npc_apprentice_mirvedaAI, creature->AI())->Summon = true; + CAST_AI(npc_apprentice_mirvedaAI, creature->AI())->PlayerGUID = player->GetGUID(); } return true; } @@ -680,13 +649,13 @@ struct TRINITY_DLL_DECL npc_infused_crystalAI : public Scripted_NoMovementAI WaveTimer = 0; } - void Aggro(Unit* who){} + void EnterCombat(Unit* who){} void MoveInLineOfSight(Unit* who) { if( who->GetTypeId() == TYPEID_PLAYER && !m_creature->canStartAttack(who) && !Progress) { - if( ((Player*)who)->GetQuestStatus(QUEST_POWERING_OUR_DEFENSES) == QUEST_STATUS_INCOMPLETE ) + if( CAST_PLR(who)->GetQuestStatus(QUEST_POWERING_OUR_DEFENSES) == QUEST_STATUS_INCOMPLETE ) { float Radius = 10.0; if( m_creature->IsWithinDistInMap(who, Radius) ) @@ -711,7 +680,7 @@ struct TRINITY_DLL_DECL npc_infused_crystalAI : public Scripted_NoMovementAI { Player* player = Unit::GetPlayer(PlayerGUID); if (player) - ((Player*)player)->FailQuest(QUEST_POWERING_OUR_DEFENSES); + CAST_PLR(player)->FailQuest(QUEST_POWERING_OUR_DEFENSES); } } @@ -725,7 +694,7 @@ struct TRINITY_DLL_DECL npc_infused_crystalAI : public Scripted_NoMovementAI { Player* player = Unit::GetPlayer(PlayerGUID); if(player) - ((Player*)player)->CompleteQuest(QUEST_POWERING_OUR_DEFENSES); + CAST_PLR(player)->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(); @@ -754,11 +723,6 @@ void AddSC_eversong_woods() Script *newscript; newscript = new Script; - newscript->Name="mobs_mana_tapped"; - newscript->GetAI = &GetAI_mobs_mana_tapped; - newscript->RegisterSelf(); - - newscript = new Script; newscript->Name= "npc_prospector_anvilward"; newscript->GetAI = &GetAI_npc_prospector_anvilward; newscript->pGossipHello = &GossipHello_npc_prospector_anvilward; diff --git a/src/bindings/scripts/scripts/zone/felwood/felwood.cpp b/src/bindings/scripts/scripts/zone/felwood/felwood.cpp index b7a4bc03c59..4103283be43 100644 --- a/src/bindings/scripts/scripts/zone/felwood/felwood.cpp +++ b/src/bindings/scripts/scripts/zone/felwood/felwood.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 diff --git a/src/bindings/scripts/scripts/zone/feralas/feralas.cpp b/src/bindings/scripts/scripts/zone/feralas/feralas.cpp index f3822bcdb7a..be57b8c8d88 100644 --- a/src/bindings/scripts/scripts/zone/feralas/feralas.cpp +++ b/src/bindings/scripts/scripts/zone/feralas/feralas.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -17,11 +17,12 @@ /* ScriptData SDName: Feralas SD%Complete: 100 -SDComment: Quest support: 3520. Special vendor Gregan Brewspewer +SDComment: Quest support: 3520, 2767, Special vendor Gregan Brewspewer SDCategory: Feralas EndScriptData */ #include "precompiled.h" +#include "../../npc/npc_escortAI.h" /*###### ## npc_gregan_brewspewer @@ -54,6 +55,148 @@ bool GossipSelect_npc_gregan_brewspewer(Player *player, Creature *_Creature, uin } /*###### +## 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) + { + normFaction = pCreature->getFaction(); + } + + uint32 normFaction; + + 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->setFaction(normFaction); + 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); + } + + void JustDied(Unit* killer) + { + if (!IsBeingEscorted) + return; + + if(Player* pPlayer = Unit::GetPlayer(PlayerGUID)) + { + // If NPC dies, player fails the quest + if(pPlayer->GetQuestStatus(QUEST_RESCUE_OOX22FE) != QUEST_STATUS_COMPLETE) + pPlayer->FailQuest(QUEST_RESCUE_OOX22FE); + } + } + + void UpdateAI(const uint32 diff) + { + npc_escortAI::UpdateAI(diff); + } +}; + +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); + + CAST_AI(npc_escortAI, (pCreature->AI()))->Start(true, true, false, pPlayer->GetGUID()); + + } + return true; +} + +/*###### ## npc_screecher_spirit ######*/ @@ -81,6 +224,12 @@ void AddSC_feralas() 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 index d6a3bbb51ba..9d4e81ca241 100644 --- a/src/bindings/scripts/scripts/zone/ghostlands/ghostlands.cpp +++ b/src/bindings/scripts/scripts/zone/ghostlands/ghostlands.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -126,7 +126,7 @@ bool GOHello_gilded_brazier(Player *player, GameObject* _GO) { Creature *Stillblade = player->SummonCreature(17716, 8106.11, -7542.06, 151.775, 3.02598, TEMPSUMMON_DEAD_DESPAWN, 60000); if (Stillblade) - ((CreatureAI*)Stillblade->AI())->AttackStart(player); + (Stillblade->AI())->AttackStart(player); } return true; }; @@ -135,17 +135,21 @@ bool GOHello_gilded_brazier(Player *player, GameObject* _GO) ## npc_ranger_lilatha ######*/ -#define SAY_START -1000140 -#define SAY_PROGRESS1 -1000141 -#define SAY_PROGRESS2 -1000142 -#define SAY_PROGRESS3 -1000143 -#define SAY_END1 -1000144 -#define SAY_END2 -1000145 -#define SAY_CAPTAIN_ANSWER -1000146 - -#define QUEST_ESCAPE_FROM_THE_CATACOMBS 9212 -#define GO_CAGE 181152 -#define NPC_CAPTAIN_HELIOS 16220 +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 { @@ -165,9 +169,9 @@ struct TRINITY_DLL_DECL npc_ranger_lilathaAI : public npc_escortAI case 0: { m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); - GameObject* Cage = FindGameObject(GO_CAGE, 20, m_creature); + GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 20); if(Cage) - Cage->SetGoState(0); + Cage->SetGoState(GO_STATE_ACTIVE); DoScriptText(SAY_START, m_creature, player); break; } @@ -194,7 +198,7 @@ struct TRINITY_DLL_DECL npc_ranger_lilathaAI : public npc_escortAI case 25: m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); break; case 30: if (player && player->GetTypeId() == TYPEID_PLAYER) - ((Player*)player)->GroupEventHappens(QUEST_ESCAPE_FROM_THE_CATACOMBS,m_creature); + CAST_PLR(player)->GroupEventHappens(QUEST_ESCAPE_FROM_THE_CATACOMBS,m_creature); break; case 32: m_creature->SetOrientation(2.978281); @@ -203,23 +207,23 @@ struct TRINITY_DLL_DECL npc_ranger_lilathaAI : public npc_escortAI case 33: m_creature->SetOrientation(5.858011); DoScriptText(SAY_END2, m_creature, player); - Unit* CaptainHelios = FindCreature(NPC_CAPTAIN_HELIOS, 50, m_creature); + Unit* CaptainHelios = me->FindNearestCreature(NPC_CAPTAIN_HELIOS, 50); if(CaptainHelios) DoScriptText(SAY_CAPTAIN_ANSWER, CaptainHelios, player); break; } } - void Aggro(Unit* who) {} + void EnterCombat(Unit* who) {} void Reset() { if (!IsBeingEscorted) m_creature->setFaction(1602); - GameObject* Cage = FindGameObject(GO_CAGE, 20, m_creature); + GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 20); if(Cage) - Cage->SetGoState(1); + Cage->SetGoState(GO_STATE_READY); } void JustDied(Unit* killer) @@ -228,7 +232,7 @@ struct TRINITY_DLL_DECL npc_ranger_lilathaAI : public npc_escortAI { Player* player = Unit::GetPlayer(PlayerGUID); if (player) - ((Player*)player)->FailQuest(QUEST_ESCAPE_FROM_THE_CATACOMBS); + CAST_PLR(player)->FailQuest(QUEST_ESCAPE_FROM_THE_CATACOMBS); } } @@ -243,7 +247,7 @@ bool QuestAccept_npc_ranger_lilatha(Player* player, Creature* creature, Quest co if (quest->GetQuestId() == QUEST_ESCAPE_FROM_THE_CATACOMBS) { creature->setFaction(113); - ((npc_escortAI*)(creature->AI()))->Start(true, true, false, player->GetGUID()); + CAST_AI(npc_escortAI, (creature->AI()))->Start(true, true, false, player->GetGUID()); } return true; } @@ -252,43 +256,9 @@ CreatureAI* GetAI_npc_ranger_lilathaAI(Creature *_Creature) { npc_ranger_lilathaAI* ranger_lilathaAI = new npc_ranger_lilathaAI(_Creature); - ranger_lilathaAI->AddWaypoint(0, 7545.07, -7359.87, 162.354, 4000); // Say0 - ranger_lilathaAI->AddWaypoint(1, 7550.048340, -7362.237793, 162.235657); - ranger_lilathaAI->AddWaypoint(2, 7566.976074, -7364.315430, 161.738770); - ranger_lilathaAI->AddWaypoint(3, 7578.830566, -7361.677734, 161.738770); - ranger_lilathaAI->AddWaypoint(4, 7590.969238, -7359.053711, 162.257660); - ranger_lilathaAI->AddWaypoint(5, 7598.354004, -7362.815430, 162.256683, 4000); // Say1 - ranger_lilathaAI->AddWaypoint(6, 7605.861328, -7380.424316, 161.937073); - ranger_lilathaAI->AddWaypoint(7, 7605.295410, -7387.382813, 157.253998); - ranger_lilathaAI->AddWaypoint(8, 7606.131836, -7393.893555, 156.941925); - ranger_lilathaAI->AddWaypoint(9, 7615.207520, -7400.187012, 157.142639); - ranger_lilathaAI->AddWaypoint(10, 7618.956543, -7402.652832, 158.202042); - ranger_lilathaAI->AddWaypoint(11, 7636.850586, -7401.756836, 162.144791); - ranger_lilathaAI->AddWaypoint(12, 7637.058105, -7404.944824, 162.206970, 4000);// Say2 - ranger_lilathaAI->AddWaypoint(13, 7636.910645, -7412.585449, 162.366425); - ranger_lilathaAI->AddWaypoint(14, 7637.607910, -7425.591797, 162.630661); - ranger_lilathaAI->AddWaypoint(15, 7637.816895, -7459.057129, 163.302704); - ranger_lilathaAI->AddWaypoint(16, 7638.859863, -7470.902344, 162.517059); - ranger_lilathaAI->AddWaypoint(17, 7641.395996, -7488.217285, 157.381287); - ranger_lilathaAI->AddWaypoint(18, 7634.455566, -7505.451660, 154.682159); - ranger_lilathaAI->AddWaypoint(19, 7631.906738, -7516.948730, 153.597382); // say3 - ranger_lilathaAI->AddWaypoint(20, 7622.231445, -7537.037598, 151.587112); - ranger_lilathaAI->AddWaypoint(21, 7610.921875, -7550.670410, 149.639374); - ranger_lilathaAI->AddWaypoint(22, 7598.229004, -7562.551758, 145.953888); - ranger_lilathaAI->AddWaypoint(23, 7588.509277, -7577.755371, 148.294479); - ranger_lilathaAI->AddWaypoint(24, 7567.339355, -7608.456055, 146.006485); - ranger_lilathaAI->AddWaypoint(25, 7562.547852, -7617.417969, 148.097504); - ranger_lilathaAI->AddWaypoint(26, 7561.508789, -7645.064453, 151.245163); - ranger_lilathaAI->AddWaypoint(27, 7563.337402, -7654.652344, 151.227158); - ranger_lilathaAI->AddWaypoint(28, 7565.533691, -7658.296387, 151.248886); - ranger_lilathaAI->AddWaypoint(29, 7571.155762, -7659.118652, 151.244568); - ranger_lilathaAI->AddWaypoint(30, 7579.119629, -7662.213867, 151.651505); - ranger_lilathaAI->AddWaypoint(31, 7603.768066, -7667.000488, 153.997726); - ranger_lilathaAI->AddWaypoint(32, 7603.768066, -7667.000488, 153.997726, 4000); // Say4 & Set orientation - ranger_lilathaAI->AddWaypoint(33, 7603.768066, -7667.000488, 153.997726, 8000); // Say5 & Set orientation - ranger_lilathaAI->AddWaypoint(34, 7603.768066, -7667.000488, 153.997726); - - return (CreatureAI*)ranger_lilathaAI; + ranger_lilathaAI->FillPointMovementListForCreature(); + + return ranger_lilathaAI; } void AddSC_ghostlands() diff --git a/src/bindings/scripts/scripts/zone/gruuls_lair/boss_gruul.cpp b/src/bindings/scripts/scripts/zone/gruuls_lair/boss_gruul.cpp index a651c117d7a..0335799b4e9 100644 --- a/src/bindings/scripts/scripts/zone/gruuls_lair/boss_gruul.cpp +++ b/src/bindings/scripts/scripts/zone/gruuls_lair/boss_gruul.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -6,12 +6,12 @@ * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* ScriptData @@ -24,7 +24,6 @@ EndScriptData */ #include "precompiled.h" #include "def_gruuls_lair.h" -/* Yells & Quotes */ #define SAY_AGGRO -1565010 #define SAY_SLAM1 -1565011 #define SAY_SLAM2 -1565012 @@ -36,30 +35,32 @@ EndScriptData */ #define SAY_DEATH -1565018 #define EMOTE_GROW -1565019 -/* Spells */ -#define SPELL_GROWTH 36300 -#define SPELL_CAVE_IN 36240 -#define SPELL_GROUND_SLAM 33525 // AoE Ground Slam applying Ground Slam to everyone with a script effect (most likely the knock back, we can code it to a set knockback) -#define SPELL_REVERBERATION 36297 //AoE Silence -#define SPELL_SHATTER 33654 -#define SPELL_MAGNETIC_PULL 28337 -#define SPELL_KNOCK_BACK 24199 //Knockback spell until correct implementation is made +#define SPELL_GROWTH 36300 +#define SPELL_CAVE_IN 36240 +#define SPELL_GROUND_SLAM 33525 //AoE Ground Slam applying Ground Slam to everyone with a script effect (most likely the knock back, we can code it to a set knockback) +#define SPELL_REVERBERATION 36297 //AoE Silence +#define SPELL_SHATTER 33654 + #define SPELL_SHATTER_EFFECT 33671 #define SPELL_HURTFUL_STRIKE 33813 #define SPELL_STONED 33652 //Spell is self cast +#define SPELL_MAGNETIC_PULL 28337 +#define SPELL_KNOCK_BACK 24199 //Knockback spell until correct implementation is made + #define SPELL_GRONN_LORDS_GRASP 33572 //Triggered by Ground Slam struct TRINITY_DLL_DECL boss_gruulAI : public ScriptedAI { boss_gruulAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } ScriptedInstance *pInstance; uint32 Growth_Timer; uint32 CaveIn_Timer; + uint32 CaveIn_StaticTimer; uint32 GroundSlamTimer; uint32 GroundSlamStage; uint32 PerformingGroundSlam; @@ -69,31 +70,26 @@ struct TRINITY_DLL_DECL boss_gruulAI : public ScriptedAI void Reset() { Growth_Timer= 30000; - CaveIn_Timer= 40000; + CaveIn_Timer= 27000; + CaveIn_StaticTimer = 30000; GroundSlamTimer= 35000; GroundSlamStage= 0; PerformingGroundSlam= false; HurtfulStrike_Timer= 8000; Reverberation_Timer= 60000+45000; - if(pInstance) + if (pInstance) pInstance->SetData(DATA_GRUULEVENT, NOT_STARTED); - } - - void JustDied(Unit* Killer) - { - DoScriptText(SAY_DEATH, m_creature); - if(pInstance) - pInstance->SetData(DATA_GRUULEVENT, DONE); + m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true); + m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { DoScriptText(SAY_AGGRO, m_creature); - DoZoneInCombat(); - if(pInstance) + if (pInstance) pInstance->SetData(DATA_GRUULEVENT, IN_PROGRESS); } @@ -101,9 +97,23 @@ struct TRINITY_DLL_DECL boss_gruulAI : public ScriptedAI { switch(rand()%3) { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; - case 2: DoScriptText(SAY_SLAY3, m_creature); break; + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + case 2: DoScriptText(SAY_SLAY3, m_creature); break; + } + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEATH, m_creature); + + if(pInstance) + { + pInstance->SetData(DATA_GRUULEVENT, DONE); + + GameObject* EncounterDoor = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GRUULDOOR)); + if (EncounterDoor) + EncounterDoor->SetGoState(GO_STATE_ACTIVE); // Open the encounter door } } @@ -117,14 +127,14 @@ struct TRINITY_DLL_DECL boss_gruulAI : public ScriptedAI // Gruul can cast this spell up to 30 times if (Growth_Timer < diff) { - DoCast(m_creature,SPELL_GROWTH); DoScriptText(EMOTE_GROW, m_creature); + DoCast(m_creature,SPELL_GROWTH); Growth_Timer = 30000; }else Growth_Timer -= diff; - if(PerformingGroundSlam) + if (PerformingGroundSlam) { - if(GroundSlamTimer < diff) + if (GroundSlamTimer < diff) { switch(GroundSlamStage) { @@ -140,7 +150,7 @@ struct TRINITY_DLL_DECL boss_gruulAI : public ScriptedAI { Unit *target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()); - if(target && target->GetTypeId() == TYPEID_PLAYER) + if (target && target->GetTypeId() == TYPEID_PLAYER) knockback_targets.push_back(target); } @@ -150,7 +160,7 @@ struct TRINITY_DLL_DECL boss_gruulAI : public ScriptedAI Unit *target = *itr; Unit *target2 = *(knockback_targets.begin() + rand()%knockback_targets.size()); - if(target && target2) + if (target && target2) { switch(rand()%2) { @@ -161,7 +171,7 @@ struct TRINITY_DLL_DECL boss_gruulAI : public ScriptedAI } GroundSlamTimer = 7000; - break; + break; } case 1: @@ -181,18 +191,15 @@ struct TRINITY_DLL_DECL boss_gruulAI : public ScriptedAI } GroundSlamTimer = 5000; - - break; + break; } case 2: { //The dummy shatter spell is cast DoCast(m_creature, SPELL_SHATTER); - GroundSlamTimer = 1000; - - break; + break; } case 3: @@ -217,20 +224,20 @@ struct TRINITY_DLL_DECL boss_gruulAI : public ScriptedAI m_creature->GetMotionMaster()->Clear(); Unit *victim = m_creature->getVictim(); - if(victim) + if (victim) { m_creature->GetMotionMaster()->MoveChase(victim); m_creature->SetUInt64Value(UNIT_FIELD_TARGET, victim->GetGUID()); } PerformingGroundSlam = false; - GroundSlamTimer =120000; HurtfulStrike_Timer= 8000; - if(Reverberation_Timer < 10000) //Give a little time to the players to undo the damage from shatter + + if (Reverberation_Timer < 10000) //Give a little time to the players to undo the damage from shatter Reverberation_Timer += 10000; - break; + break; } } @@ -259,7 +266,7 @@ struct TRINITY_DLL_DECL boss_gruulAI : public ScriptedAI if (Reverberation_Timer < diff) { DoCast(m_creature->getVictim(), SPELL_REVERBERATION, true); - Reverberation_Timer = 30000; + Reverberation_Timer = 15000 + rand()%10000; }else Reverberation_Timer -= diff; // Cave In @@ -268,7 +275,11 @@ struct TRINITY_DLL_DECL boss_gruulAI : public ScriptedAI if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) DoCast(target,SPELL_CAVE_IN); - CaveIn_Timer = 20000; + if(CaveIn_StaticTimer >= 4000) + CaveIn_StaticTimer -= 2000; + + CaveIn_Timer = CaveIn_StaticTimer; + }else CaveIn_Timer -= diff; // Ground Slam, Gronn Lord's Grasp, Stoned, Shatter diff --git a/src/bindings/scripts/scripts/zone/gruuls_lair/boss_high_king_maulgar.cpp b/src/bindings/scripts/scripts/zone/gruuls_lair/boss_high_king_maulgar.cpp index e7a392a5370..7c1741fb77c 100644 --- a/src/bindings/scripts/scripts/zone/gruuls_lair/boss_high_king_maulgar.cpp +++ b/src/bindings/scripts/scripts/zone/gruuls_lair/boss_high_king_maulgar.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -88,11 +88,11 @@ bool CheckAllBossDied(ScriptedInstance* pInstance, Creature* m_creature) OlmGUID = pInstance->GetData64(DATA_OLMTHESUMMONER); KroshGUID = pInstance->GetData64(DATA_KROSHFIREHAND); - Maulgar = ((Creature*)Unit::GetUnit((*m_creature), MaulgarGUID)); - Kiggler = ((Creature*)Unit::GetUnit((*m_creature), KigglerGUID)); - Blindeye = ((Creature*)Unit::GetUnit((*m_creature), BlindeyeGUID)); - Olm = ((Creature*)Unit::GetUnit((*m_creature), OlmGUID)); - Krosh = ((Creature*)Unit::GetUnit((*m_creature), KroshGUID)); + Maulgar = (Unit::GetCreature((*m_creature), MaulgarGUID)); + Kiggler = (Unit::GetCreature((*m_creature), KigglerGUID)); + Blindeye = (Unit::GetCreature((*m_creature), BlindeyeGUID)); + Olm = (Unit::GetCreature((*m_creature), OlmGUID)); + Krosh = (Unit::GetCreature((*m_creature), KroshGUID)); if(!Maulgar || !Kiggler || !Blindeye || !Olm || !Krosh) return false; @@ -108,7 +108,7 @@ struct TRINITY_DLL_DECL boss_high_king_maulgarAI : public ScriptedAI { boss_high_king_maulgarAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); for(uint8 i = 0; i < 4; ++i) Council[i] = 0; } @@ -142,7 +142,7 @@ struct TRINITY_DLL_DECL boss_high_king_maulgarAI : public ScriptedAI { if(Council[i]) { - pCreature = (Creature*)(Unit::GetUnit((*m_creature), Council[i])); + pCreature = (Unit::GetCreature((*m_creature), Council[i])); if(pCreature && !pCreature->isAlive()) { pCreature->Respawn(); @@ -186,7 +186,7 @@ struct TRINITY_DLL_DECL boss_high_king_maulgarAI : public ScriptedAI } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { StartEvent(who); } @@ -218,7 +218,7 @@ struct TRINITY_DLL_DECL boss_high_king_maulgarAI : public ScriptedAI void UpdateAI(const uint32 diff) { //Only if not incombat check if the event is started - if(!InCombat && pInstance && pInstance->GetData(DATA_MAULGAREVENT)) + if(!m_creature->isInCombat() && pInstance && pInstance->GetData(DATA_MAULGAREVENT)) { Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_MAULGAREVENT_TANK)); @@ -268,8 +268,8 @@ struct TRINITY_DLL_DECL boss_high_king_maulgarAI : public ScriptedAI DoScriptText(SAY_ENRAGE, m_creature); m_creature->CastSpell(m_creature, SPELL_DUAL_WIELD, true); - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, 0); - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY+1, 0); + m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, 0); + m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, 0); } if(Phase2) @@ -304,7 +304,7 @@ struct TRINITY_DLL_DECL boss_olm_the_summonerAI : public ScriptedAI { boss_olm_the_summonerAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } uint32 DarkDecay_Timer; @@ -324,7 +324,7 @@ struct TRINITY_DLL_DECL boss_olm_the_summonerAI : public ScriptedAI pInstance->SetData(DATA_MAULGAREVENT, NOT_STARTED); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { if(pInstance) { @@ -338,10 +338,10 @@ struct TRINITY_DLL_DECL boss_olm_the_summonerAI : public ScriptedAI if(pInstance) { Creature *Maulgar = NULL; - Maulgar = (Creature*)(Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_MAULGAR))); + Maulgar = (Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_MAULGAR))); if(Maulgar) - ((boss_high_king_maulgarAI*)Maulgar->AI())->AddDeath(); + CAST_AI(boss_high_king_maulgarAI, Maulgar->AI())->AddDeath(); if(CheckAllBossDied(pInstance, m_creature)) pInstance->SetData(DATA_MAULGAREVENT, DONE); @@ -351,7 +351,7 @@ struct TRINITY_DLL_DECL boss_olm_the_summonerAI : public ScriptedAI void UpdateAI(const uint32 diff) { //Only if not incombat check if the event is started - if(!InCombat && pInstance && pInstance->GetData(DATA_MAULGAREVENT)) + if(!m_creature->isInCombat() && pInstance && pInstance->GetData(DATA_MAULGAREVENT)) { Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_MAULGAREVENT_TANK)); @@ -406,7 +406,7 @@ struct TRINITY_DLL_DECL boss_kiggler_the_crazedAI : public ScriptedAI { boss_kiggler_the_crazedAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } uint32 GreaterPolymorph_Timer; @@ -428,7 +428,7 @@ struct TRINITY_DLL_DECL boss_kiggler_the_crazedAI : public ScriptedAI pInstance->SetData(DATA_MAULGAREVENT, NOT_STARTED); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { if(pInstance) { @@ -442,10 +442,10 @@ struct TRINITY_DLL_DECL boss_kiggler_the_crazedAI : public ScriptedAI if(pInstance) { Creature *Maulgar = NULL; - Maulgar = (Creature*)(Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_MAULGAR))); + Maulgar = (Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_MAULGAR))); if(Maulgar) - ((boss_high_king_maulgarAI*)Maulgar->AI())->AddDeath(); + CAST_AI(boss_high_king_maulgarAI, Maulgar->AI())->AddDeath(); if(CheckAllBossDied(pInstance, m_creature)) pInstance->SetData(DATA_MAULGAREVENT, DONE); @@ -455,7 +455,7 @@ struct TRINITY_DLL_DECL boss_kiggler_the_crazedAI : public ScriptedAI void UpdateAI(const uint32 diff) { //Only if not incombat check if the event is started - if(!InCombat && pInstance && pInstance->GetData(DATA_MAULGAREVENT)) + if(!m_creature->isInCombat() && pInstance && pInstance->GetData(DATA_MAULGAREVENT)) { Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_MAULGAREVENT_TANK)); @@ -483,7 +483,7 @@ struct TRINITY_DLL_DECL boss_kiggler_the_crazedAI : public ScriptedAI if(target) DoCast(target, SPELL_GREATER_POLYMORPH); - GreaterPolymorph_Timer = 20000; + GreaterPolymorph_Timer = 15000 + rand()%5000; }else GreaterPolymorph_Timer -= diff; //LightningBolt_Timer @@ -516,25 +516,27 @@ struct TRINITY_DLL_DECL boss_blindeye_the_seerAI : public ScriptedAI { boss_blindeye_the_seerAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } uint32 GreaterPowerWordShield_Timer; uint32 Heal_Timer; + uint32 PrayerofHealing_Timer; ScriptedInstance* pInstance; void Reset() { GreaterPowerWordShield_Timer = 5000; - Heal_Timer = 30000; + Heal_Timer = 25000 + rand()%15000; + PrayerofHealing_Timer = 45000 + rand()%10000; //reset encounter if (pInstance) pInstance->SetData(DATA_MAULGAREVENT, NOT_STARTED); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { if(pInstance) { @@ -548,10 +550,10 @@ struct TRINITY_DLL_DECL boss_blindeye_the_seerAI : public ScriptedAI if(pInstance) { Creature *Maulgar = NULL; - Maulgar = (Creature*)(Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_MAULGAR))); + Maulgar = (Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_MAULGAR))); if(Maulgar) - ((boss_high_king_maulgarAI*)Maulgar->AI())->AddDeath(); + CAST_AI(boss_high_king_maulgarAI, Maulgar->AI())->AddDeath(); if(CheckAllBossDied(pInstance, m_creature)) pInstance->SetData(DATA_MAULGAREVENT, DONE); @@ -561,7 +563,7 @@ struct TRINITY_DLL_DECL boss_blindeye_the_seerAI : public ScriptedAI void UpdateAI(const uint32 diff) { //Only if not incombat check if the event is started - if(!InCombat && pInstance && pInstance->GetData(DATA_MAULGAREVENT)) + if(!m_creature->isInCombat() && pInstance && pInstance->GetData(DATA_MAULGAREVENT)) { Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_MAULGAREVENT_TANK)); @@ -593,9 +595,16 @@ struct TRINITY_DLL_DECL boss_blindeye_the_seerAI : public ScriptedAI if(Heal_Timer < diff) { DoCast(m_creature, SPELL_HEAL); - Heal_Timer = 60000; + Heal_Timer = 15000 + rand()%25000; }else Heal_Timer -= diff; + //PrayerofHealing_Timer + if (PrayerofHealing_Timer < diff) + { + DoCast(m_creature, SPELL_PRAYER_OH); + PrayerofHealing_Timer = 35000 + rand()%15000; + }else PrayerofHealing_Timer -= diff; + DoMeleeAttackIfReady(); } }; @@ -605,7 +614,7 @@ struct TRINITY_DLL_DECL boss_krosh_firehandAI : public ScriptedAI { boss_krosh_firehandAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } uint32 GreaterFireball_Timer; @@ -625,7 +634,7 @@ struct TRINITY_DLL_DECL boss_krosh_firehandAI : public ScriptedAI pInstance->SetData(DATA_MAULGAREVENT, NOT_STARTED); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { if(pInstance) { @@ -639,10 +648,10 @@ struct TRINITY_DLL_DECL boss_krosh_firehandAI : public ScriptedAI if(pInstance) { Creature *Maulgar = NULL; - Maulgar = (Creature*)(Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_MAULGAR))); + Maulgar = (Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_MAULGAR))); if(Maulgar) - ((boss_high_king_maulgarAI*)Maulgar->AI())->AddDeath(); + CAST_AI(boss_high_king_maulgarAI, Maulgar->AI())->AddDeath(); if(CheckAllBossDied(pInstance, m_creature)) pInstance->SetData(DATA_MAULGAREVENT, DONE); @@ -652,7 +661,7 @@ struct TRINITY_DLL_DECL boss_krosh_firehandAI : public ScriptedAI void UpdateAI(const uint32 diff) { //Only if not incombat check if the event is started - if(!InCombat && pInstance && pInstance->GetData(DATA_MAULGAREVENT)) + if(!m_creature->isInCombat() && pInstance && pInstance->GetData(DATA_MAULGAREVENT)) { Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_MAULGAREVENT_TANK)); diff --git a/src/bindings/scripts/scripts/zone/gruuls_lair/def_gruuls_lair.h b/src/bindings/scripts/scripts/zone/gruuls_lair/def_gruuls_lair.h index 145e573f02a..7003dcb1e26 100644 --- a/src/bindings/scripts/scripts/zone/gruuls_lair/def_gruuls_lair.h +++ b/src/bindings/scripts/scripts/zone/gruuls_lair/def_gruuls_lair.h @@ -1,19 +1,21 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * This program is free software licensed under GPL version 2 * Please see the included DOCS/LICENSE.TXT for more information */ #ifndef DEF_GRUULS_LAIR_H #define DEF_GRUULS_LAIR_H -#define DATA_BLINDEYETHESEER 1 -#define DATA_GRUULEVENT 2 -#define DATA_KIGGLERTHECRAZED 3 -#define DATA_KROSHFIREHAND 4 -#define DATA_MAULGAREVENT 5 -#define DATA_MAULGAREVENT_TANK 6 -#define DATA_OLMTHESUMMONER 7 -#define DATA_MAULGARDOOR 8 -#define DATA_GRUULDOOR 9 -#define DATA_MAULGAR 10 +#define DATA_BLINDEYETHESEER 1 +#define DATA_GRUULEVENT 2 +#define DATA_KIGGLERTHECRAZED 3 +#define DATA_KROSHFIREHAND 4 +#define DATA_MAULGAREVENT 5 +#define DATA_MAULGAREVENT_TANK 6 +#define DATA_OLMTHESUMMONER 7 +#define DATA_MAULGARDOOR 8 +#define DATA_GRUULDOOR 9 +#define DATA_MAULGAR 10 + +#define ERROR_INST_DATA "TSCR Error: Instance Data not set properly for Gruul's Lair instance (map 565). Encounters will be buggy." #endif diff --git a/src/bindings/scripts/scripts/zone/gruuls_lair/instance_gruuls_lair.cpp b/src/bindings/scripts/scripts/zone/gruuls_lair/instance_gruuls_lair.cpp index 5c026ab1860..4c90fdf49a8 100644 --- a/src/bindings/scripts/scripts/zone/gruuls_lair/instance_gruuls_lair.cpp +++ b/src/bindings/scripts/scripts/zone/gruuls_lair/instance_gruuls_lair.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -73,7 +73,7 @@ struct TRINITY_DLL_DECL instance_gruuls_lair : public ScriptedInstance void OnCreatureCreate(Creature *creature, uint32 creature_entry) { - switch(creature_entry) + switch(creature->GetEntry()) { case 18835: KigglerTheCrazed = creature->GetGUID(); break; case 18836: BlindeyeTheSeer = creature->GetGUID(); break; @@ -144,7 +144,7 @@ struct TRINITY_DLL_DECL instance_gruuls_lair : public ScriptedInstance return 0; } - const char* Save() + std::string GetSaveData() { OUT_SAVE_INST_DATA; std::ostringstream stream; diff --git a/src/bindings/scripts/scripts/zone/gundrak/boss_drakkari_colossus.cpp b/src/bindings/scripts/scripts/zone/gundrak/boss_drakkari_colossus.cpp new file mode 100644 index 00000000000..40bf428da91 --- /dev/null +++ b/src/bindings/scripts/scripts/zone/gundrak/boss_drakkari_colossus.cpp @@ -0,0 +1,55 @@ +/* Script Data Start +SDName: Boss Drakkari Colossus +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = '' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_EMERGE 54850 //to phase2, Colossus unatackable, Elemental emerges +#define SPELL_EMERGE_2 54851 +#define SPELL_MIGHTY_BLOW 54719 + +struct TRINITY_DLL_DECL boss_drakkari_colossusAI : public ScriptedAI +{ + boss_drakkari_colossusAI(Creature *c) : ScriptedAI(c) {} + + uint32 phase; + + void Reset() {} + void EnterCombat(Unit* who) {} + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if(!UpdateVictim()) + return; + + phase =1; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) {} +}; + +CreatureAI* GetAI_boss_drakkari_colossus(Creature *_Creature) +{ + return new boss_drakkari_colossusAI (_Creature); +} + +void AddSC_boss_drakkari_colossus() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_drakkari_colossus"; + newscript->GetAI = &GetAI_boss_drakkari_colossus; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/zone/gundrak/boss_eck.cpp b/src/bindings/scripts/scripts/zone/gundrak/boss_eck.cpp new file mode 100644 index 00000000000..7decc3d6b28 --- /dev/null +++ b/src/bindings/scripts/scripts/zone/gundrak/boss_eck.cpp @@ -0,0 +1,65 @@ +/* Script Data Start +SDName: Boss Eck the Ferocious +SDAuthor: LordVanMartin +SD%Complete: +SDComment: Only appears in Heroic mode +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = '' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +#define SPELL_ECK_BERSERK 55816 //Eck goes berserk, increasing his attack speed by 150% and all damage he deals by 500%. +#define SPELL_ECK_BITE 55813 //Eck bites down hard, inflicting 150% of his normal damage to an enemy. +#define SPELL_ECK_SPIT 55814 //Eck spits toxic bile at enemies in a cone in front of him, inflicting 2970 Nature damage and draining 220 mana every 1 sec for 3 sec. +#define SPELL_ECK_SPRING_1 55815 //Eck leaps at a distant target. --> Drops aggro and charges a random player. Tank can simply taunt him back. +#define SPELL_ECK_SPRING_2 55837 //Eck leaps at a distant target. + +struct TRINITY_DLL_DECL boss_eckAI : public ScriptedAI +{ + boss_eckAI(Creature *c) : ScriptedAI(c) {} + + uint32 berserk; + + void Reset() + { + //Source Deadly Boss Mod + berserk = 120000; //2min + } + + void EnterCombat(Unit* who) {} + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if(!UpdateVictim()) + return; + + if(berserk < diff) + { + DoCast(m_creature,SPELL_ECK_BERSERK); + berserk = 120000; + }else berserk -= diff; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) {} +}; + +CreatureAI* GetAI_boss_eck(Creature *_Creature) +{ + return new boss_eckAI (_Creature); +} + +void AddSC_boss_eck() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_eck"; + newscript->GetAI = &GetAI_boss_eck; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/zone/gundrak/boss_gal_darah.cpp b/src/bindings/scripts/scripts/zone/gundrak/boss_gal_darah.cpp new file mode 100644 index 00000000000..0f34d019e6a --- /dev/null +++ b/src/bindings/scripts/scripts/zone/gundrak/boss_gal_darah.cpp @@ -0,0 +1,85 @@ +/* Script Data Start +SDName: Boss gal_darah +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = '' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_ENRAGE 55285 +#define SPELL_IMPALING_CHARGE 54956 +#define SPELL_STOMP 55292 + +#define SPELL_PUNCTURE 55276 +#define SPELL_STAMPEDE 55218 +#define SPELL_WHIRLING_SLASH 55285 + +//Yells +#define SAY_AGGRO -1604000 +#define SAY_SLAY_1 -1604001 +#define SAY_SLAY_2 -1604002 +#define SAY_SLAY_3 -1604003 +#define SAY_DEATH -1604004 +#define SAY_SUMMON_RHINO_1 -1604005 +#define SAY_SUMMON_RHINO_2 -1604006 +#define SAY_SUMMON_RHINO_3 -1604007 +#define SAY_TRANSFORM_1 -1604008 //Phase change +#define SAY_TRANSFORM_2 -1604009 + +struct TRINITY_DLL_DECL boss_gal_darahAI : public ScriptedAI +{ + boss_gal_darahAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if(!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature);break; + case 1: DoScriptText(SAY_SLAY_2, m_creature);break; + case 2: DoScriptText(SAY_SLAY_3, m_creature);break; + } + } +}; + +CreatureAI* GetAI_boss_gal_darah(Creature *_Creature) +{ + return new boss_gal_darahAI (_Creature); +} + +void AddSC_boss_gal_darah() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_gal_darah"; + newscript->GetAI = &GetAI_boss_gal_darah; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/zone/gundrak/boss_moorabi.cpp b/src/bindings/scripts/scripts/zone/gundrak/boss_moorabi.cpp new file mode 100644 index 00000000000..f9e8b41a427 --- /dev/null +++ b/src/bindings/scripts/scripts/zone/gundrak/boss_moorabi.cpp @@ -0,0 +1,88 @@ +/* Script Data Start +SDName: Boss moorabi +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = 'boss_moorabi' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_DETERMINED_GORE 55102 +#define SPELL_DETERMINED_STAB_2 59444 +#define SPELL_DETERMINED_STAB_3 55104 + +#define SPELL_GROUND_TREMOR 55142 +#define SPELL_MOJO_FRENZY 55163 +#define SPELL_NUMBING_ROAR_1 55100 +#define SPELL_NUMBING_ROAR_2 55106 +#define SPELL_TRANSFORMATION 55098 //Periodic, The caster transforms into a powerful mammoth, increasing Physical damage done by 25% and granting immunity to Stun effects. +#define SPELL_QUAKE 55101 + +//Yell +#define SAY_AGGRO -1604010 +#define SAY_SLAY_1 -1604011 +#define SAY_SLAY_2 -1604012 +#define SAY_SLAY_3 -1604013 +#define SAY_DEATH -1604014 +#define SAY_TRANSFORM -1604015 +#define SAY_QUAKE -1604016 + +struct TRINITY_DLL_DECL boss_moorabiAI : public ScriptedAI +{ + boss_moorabiAI(Creature *c) : ScriptedAI(c) {} + + uint32 phase; + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + phase =1; + //Return since we have no target + if(!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature);break; + case 1: DoScriptText(SAY_SLAY_2, m_creature);break; + case 2: DoScriptText(SAY_SLAY_3, m_creature);break; + } + } +}; + +CreatureAI* GetAI_boss_moorabi(Creature *_Creature) +{ + return new boss_moorabiAI (_Creature); +} + +void AddSC_boss_moorabi() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_moorabi"; + newscript->GetAI = &GetAI_boss_moorabi; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/zone/gundrak/boss_slad_ran.cpp b/src/bindings/scripts/scripts/zone/gundrak/boss_slad_ran.cpp new file mode 100644 index 00000000000..f001626568f --- /dev/null +++ b/src/bindings/scripts/scripts/zone/gundrak/boss_slad_ran.cpp @@ -0,0 +1,95 @@ +/* Script Data Start +SDName: Boss slad_ran +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = 'boss_slad_ran' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_POISON_NOVA 55081 +#define SPELL_POISON_NOVA_2 59842 +//-- +#define SPELL_POWERFUL_BITE 48287 +#define SPELL_POWERFUL_BITE_2 59840 +//-- +#define SPELL_VENOM_BOLT 54970 +#define SPELL_VENOM_BOLT_2 59839 +//At 30% HPStart summoning small serpents + +//Yell +#define SAY_AGGRO -1604017 +#define SAY_SLAY_1 -1604018 +#define SAY_SLAY_2 -1604019 +#define SAY_SLAY_3 -1604020 +#define SAY_DEATH -1604021 +#define SAY_SUMMON_SNAKES -1604022 //npc 29680 +#define SAY_SUMMON_CONSTRICTORS -1604023 //npc 29713, can cast Grip of Slad'ran (spell 55093) + +struct TRINITY_DLL_DECL boss_slad_ranAI : public ScriptedAI +{ + boss_slad_ranAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if(!UpdateVictim()) + return; + + if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 30) + { + //Summon 3 snakes --> npc 29680 + DoScriptText(SAY_SUMMON_SNAKES,m_creature); + } + if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 25) + { + //Summon 3 constrictors --> npc 29713 + DoScriptText(SAY_SUMMON_CONSTRICTORS,m_creature); + } + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + + switch(rand()%3) + { + case 0:DoScriptText(SAY_SLAY_1, m_creature);break; + case 1:DoScriptText(SAY_SLAY_2, m_creature);break; + case 2:DoScriptText(SAY_SLAY_3, m_creature);break; + } + } +}; + +CreatureAI* GetAI_boss_slad_ran(Creature *_Creature) +{ + return new boss_slad_ranAI (_Creature); +} + +void AddSC_boss_slad_ran() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_slad_ran"; + newscript->GetAI = &GetAI_boss_slad_ran; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/zone/gundrak/def_gundrak.h b/src/bindings/scripts/scripts/zone/gundrak/def_gundrak.h new file mode 100644 index 00000000000..5f015610312 --- /dev/null +++ b/src/bindings/scripts/scripts/zone/gundrak/def_gundrak.h @@ -0,0 +1,4 @@ +#ifndef DEF_GUNDRAK_H +#define DEF_GUNDRAK_H + +#endif diff --git a/src/bindings/scripts/scripts/zone/gundrak/instance_gundrak.cpp b/src/bindings/scripts/scripts/zone/gundrak/instance_gundrak.cpp new file mode 100644 index 00000000000..3e5b59c0930 --- /dev/null +++ b/src/bindings/scripts/scripts/zone/gundrak/instance_gundrak.cpp @@ -0,0 +1,21 @@ +#include "precompiled.h" +#include "def_gundrak.h" + +struct TRINITY_DLL_DECL instance_gundrak : public ScriptedInstance +{ + instance_gundrak(Map *Map) : ScriptedInstance(Map) {Initialize();}; +}; + +InstanceData* GetInstanceData_instance_gundrak(Map* map) +{ + return new instance_gundrak(map); +} + +void AddSC_instance_gundrak() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_gundrak"; + newscript->GetInstanceData = &GetInstanceData_instance_gundrak; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_broggok.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_broggok.cpp index 92971bf16cf..e05a1f25095 100644 --- a/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_broggok.cpp +++ b/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_broggok.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -6,18 +6,18 @@ * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* ScriptData SDName: Boss_Broggok -SD%Complete: 100 -SDComment: +SD%Complete: 70 +SDComment: pre-event not made SDCategory: Hellfire Citadel, Blood Furnace EndScriptData */ @@ -46,30 +46,37 @@ struct TRINITY_DLL_DECL boss_broggokAI : public ScriptedAI PoisonBolt_Timer = 7000; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { DoScriptText(SAY_AGGRO, m_creature); } - void UpdateAI(const uint32 diff) + void JustSummoned(Creature *summoned) { + summoned->setFaction(16); + summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + summoned->CastSpell(summoned,SPELL_POISON,false,0,0,m_creature->GetGUID()); + } - if (!UpdateVictim()) + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim() ) return; - if(AcidSpray_Timer < diff) + if (AcidSpray_Timer < diff) { DoCast(m_creature->getVictim(),SPELL_SLIME_SPRAY); AcidSpray_Timer = 4000+rand()%8000; }else AcidSpray_Timer -=diff; - if(PoisonBolt_Timer < diff) + if (PoisonBolt_Timer < diff) { DoCast(m_creature->getVictim(),SPELL_POISON_BOLT); PoisonBolt_Timer = 4000+rand()%8000; }else PoisonBolt_Timer -=diff; - if(PoisonSpawn_Timer < diff) + if (PoisonSpawn_Timer < diff) { DoCast(m_creature,SPELL_POISON_CLOUD); PoisonSpawn_Timer = 20000; @@ -79,7 +86,7 @@ struct TRINITY_DLL_DECL boss_broggokAI : public ScriptedAI } }; -CreatureAI* GetAI_boss_broggokAI(Creature *_Creature) +CreatureAI* GetAI_boss_broggok(Creature *_Creature) { return new boss_broggokAI (_Creature); } @@ -88,8 +95,7 @@ void AddSC_boss_broggok() { Script *newscript; newscript = new Script; - newscript->Name="boss_broggok"; - newscript->GetAI = &GetAI_boss_broggokAI; + newscript->Name = "boss_broggok"; + newscript->GetAI = &GetAI_boss_broggok; newscript->RegisterSelf(); } - diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_kelidan_the_breaker.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_kelidan_the_breaker.cpp index 64bd8e04de1..10cdbdba862 100644 --- a/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_kelidan_the_breaker.cpp +++ b/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_kelidan_the_breaker.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -62,17 +62,11 @@ const float ShadowmoonChannelers[5][4]= {316,-109,-24.6,1.257} }; -class TRINITY_DLL_DECL BurningNovaAura : public Aura -{ - public: - BurningNovaAura(SpellEntry *spell, uint32 eff, Unit *target, Unit *caster) : Aura(spell, eff, NULL, target, caster, NULL){} -}; - struct TRINITY_DLL_DECL boss_kelidan_the_breakerAI : public ScriptedAI { boss_kelidan_the_breakerAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); HeroicMode = m_creature->GetMap()->IsHeroic(); for(int i=0; i<5; ++i) Channelers[i] = 0; } @@ -100,7 +94,7 @@ struct TRINITY_DLL_DECL boss_kelidan_the_breakerAI : public ScriptedAI SummonChannelers(); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { DoScriptText(SAY_WAKE, m_creature); if (m_creature->IsNonMeleeSpellCasted(false)) @@ -232,14 +226,16 @@ struct TRINITY_DLL_DECL boss_kelidan_the_breakerAI : public ScriptedAI DoScriptText(SAY_NOVA, m_creature); - if(SpellEntry *nova = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_BURNING_NOVA)) + if(SpellEntry *nova = GET_SPELL(SPELL_BURNING_NOVA)) { - for(uint32 i = 0; i < 3; ++i) - if(nova->Effect[i] == SPELL_EFFECT_APPLY_AURA) - { - Aura *Aur = new BurningNovaAura(nova, i, m_creature, m_creature); - m_creature->AddAura(Aur); - } + uint8 eff_mask=0; + for (int i=0; i<3; i++) + { + if (!nova->Effect[i]) + continue; + eff_mask|=1<<i; + } + m_creature->AddAura(new Aura(nova, eff_mask, NULL, m_creature, m_creature)); } if (HeroicMode) @@ -273,7 +269,7 @@ struct TRINITY_DLL_DECL mob_shadowmoon_channelerAI : public ScriptedAI { mob_shadowmoon_channelerAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); HeroicMode = m_creature->GetMap()->IsHeroic(); } @@ -293,10 +289,10 @@ struct TRINITY_DLL_DECL mob_shadowmoon_channelerAI : public ScriptedAI m_creature->InterruptNonMeleeSpells(true); } - void Aggro(Unit* who) + void EnterCombat(Unit* who) { - if(Creature *Kelidan = (Creature *)FindCreature(ENTRY_KELIDAN, 100, m_creature)) - ((boss_kelidan_the_breakerAI*)Kelidan->AI())->ChannelerEngaged(who); + if(Creature *Kelidan = me->FindNearestCreature(ENTRY_KELIDAN, 100)) + CAST_AI(boss_kelidan_the_breakerAI, Kelidan->AI())->ChannelerEngaged(who); if (m_creature->IsNonMeleeSpellCasted(false)) m_creature->InterruptNonMeleeSpells(true); DoStartMovement(who); @@ -304,8 +300,8 @@ struct TRINITY_DLL_DECL mob_shadowmoon_channelerAI : public ScriptedAI void JustDied(Unit* Killer) { - if(Creature *Kelidan = (Creature *)FindCreature(ENTRY_KELIDAN, 100, m_creature)) - ((boss_kelidan_the_breakerAI*)Kelidan->AI())->ChannelerDied(Killer); + if(Creature *Kelidan = me->FindNearestCreature(ENTRY_KELIDAN, 100)) + CAST_AI(boss_kelidan_the_breakerAI, Kelidan->AI())->ChannelerDied(Killer); } void UpdateAI(const uint32 diff) @@ -315,9 +311,9 @@ struct TRINITY_DLL_DECL mob_shadowmoon_channelerAI : public ScriptedAI if(check_Timer < diff) { if (!m_creature->IsNonMeleeSpellCasted(false)) - if(Creature *Kelidan = (Creature *)FindCreature(ENTRY_KELIDAN, 100, m_creature)) + if(Creature *Kelidan = me->FindNearestCreature(ENTRY_KELIDAN, 100)) { - uint64 channeler = ((boss_kelidan_the_breakerAI*)Kelidan->AI())->GetChanneled(m_creature); + uint64 channeler = CAST_AI(boss_kelidan_the_breakerAI, Kelidan->AI())->GetChanneled(m_creature); if(Unit *channeled = Unit::GetUnit(*m_creature, channeler)) DoCast(channeled,SPELL_CHANNELING); } diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_the_maker.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_the_maker.cpp index 65c98d5ef8d..02bfef63ea1 100644 --- a/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_the_maker.cpp +++ b/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_the_maker.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -52,7 +52,7 @@ struct TRINITY_DLL_DECL boss_the_makerAI : public ScriptedAI Knockdown_Timer = 10000; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { switch(rand()%3) { diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/instance_blood_furnace.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/instance_blood_furnace.cpp index caf29b1f213..035bd8aadfe 100644 --- a/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/instance_blood_furnace.cpp +++ b/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/instance_blood_furnace.cpp @@ -68,20 +68,6 @@ struct TRINITY_DLL_DECL instance_blood_furnace : public ScriptedInstance return NULL; } - void HandleGameObject(uint64 guid, uint32 state) - { - Player *player = GetPlayerInMap(); - - if (!player || !guid) - { - debug_log("TSCR: Blood Furnace: HandleGameObject fail"); - return; - } - - if (GameObject *go = GameObject::GetGameObject(*player,guid)) - go->SetGoState(state); - } - void SetData(uint32 type, uint32 data) { switch(type) @@ -89,8 +75,8 @@ struct TRINITY_DLL_DECL instance_blood_furnace : public ScriptedInstance case DATA_KELIDANEVENT: if( data == DONE ) { - HandleGameObject(Sewer1GUID,0); - HandleGameObject(Sewer2GUID,0); + HandleGameObject(Sewer1GUID, true); + HandleGameObject(Sewer2GUID, true); } break; } diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/boss_omor_the_unscarred.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/boss_omor_the_unscarred.cpp index 0dce1fe51d9..99130528eb8 100644 --- a/src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/boss_omor_the_unscarred.cpp +++ b/src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/boss_omor_the_unscarred.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -75,7 +75,7 @@ struct TRINITY_DLL_DECL boss_omor_the_unscarredAI : public Scripted_NoMovementAI CanPullBack = false; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { switch(rand()%3) { diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/boss_vazruden_the_herald.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/boss_vazruden_the_herald.cpp index 4483a8be037..72e614dbb1b 100644 --- a/src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/boss_vazruden_the_herald.cpp +++ b/src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/boss_vazruden_the_herald.cpp @@ -85,7 +85,7 @@ struct TRINITY_DLL_DECL boss_nazanAI : public ScriptedAI UnsummonCheck = 5000; } - void Aggro(Unit* who) {} + void EnterCombat(Unit* who) {} void JustSummoned(Creature *summoned) { @@ -133,7 +133,7 @@ struct TRINITY_DLL_DECL boss_nazanAI : public ScriptedAI flight = false; BellowingRoar_Timer = 6000; ConeOfFire_Timer = 12000; - m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT + MOVEMENTFLAG_LEVITATING); + m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); m_creature->GetMotionMaster()->Clear(); if(Unit *victim = SelectUnit(SELECT_TARGET_NEAREST,0)) @@ -190,7 +190,7 @@ struct TRINITY_DLL_DECL boss_vazrudenAI : public ScriptedAI WipeSaid = false; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { switch(rand()%3) { @@ -281,7 +281,7 @@ struct TRINITY_DLL_DECL boss_vazruden_the_heraldAI : public ScriptedAI { Creature *Nazan = Unit::GetCreature(*m_creature, NazanGUID); Creature *Vazruden = Unit::GetCreature(*m_creature, VazrudenGUID); - if(Nazan || (Nazan = (Creature *)FindCreature(ENTRY_NAZAN, 5000, m_creature))) + if(Nazan || (Nazan = me->FindNearestCreature(ENTRY_NAZAN, 5000))) { Nazan->SetLootRecipient(NULL); Nazan->SetVisibility(VISIBILITY_OFF); @@ -289,7 +289,7 @@ struct TRINITY_DLL_DECL boss_vazruden_the_heraldAI : public ScriptedAI Nazan->RemoveCorpse(); NazanGUID = 0; } - if(Vazruden || (Vazruden = (Creature *)FindCreature(ENTRY_VAZRUDEN, 5000, m_creature))) + if(Vazruden || (Vazruden = me->FindNearestCreature(ENTRY_VAZRUDEN, 5000))) { Vazruden->SetLootRecipient(NULL); Vazruden->SetVisibility(VISIBILITY_OFF); @@ -319,7 +319,7 @@ struct TRINITY_DLL_DECL boss_vazruden_the_heraldAI : public ScriptedAI } } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { if(phase==0) { @@ -335,11 +335,11 @@ struct TRINITY_DLL_DECL boss_vazruden_the_heraldAI : public ScriptedAI Unit *victim = m_creature->getVictim(); if(summoned->GetEntry() == ENTRY_NAZAN) { - ((boss_nazanAI *)summoned->AI())->VazrudenGUID = VazrudenGUID; - summoned->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT + MOVEMENTFLAG_LEVITATING); + CAST_AI(boss_nazanAI, summoned->AI())->VazrudenGUID = VazrudenGUID; + summoned->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); summoned->SetSpeed(MOVE_FLIGHT, 2.5); if(victim) - ((ScriptedAI*)summoned->AI())->AttackStart(victim,false); + AttackStartNoMove(victim); } else if(victim) summoned->AI()->AttackStart(victim); @@ -349,7 +349,7 @@ struct TRINITY_DLL_DECL boss_vazruden_the_heraldAI : public ScriptedAI { if(sentryDown) { - AttackStart(killer, false); + AttackStartNoMove(killer); sentryDown = false; } else @@ -419,12 +419,12 @@ struct TRINITY_DLL_DECL mob_hellfire_sentryAI : public ScriptedAI KidneyShot_Timer = 3000+rand()%4000; } - void Aggro(Unit* who) {} + void EnterCombat(Unit* who) {} void JustDied(Unit* who) { - if(Creature *herald = (Creature *)FindCreature(ENTRY_VAZRUDEN_HERALD,150, m_creature)) - ((boss_vazruden_the_heraldAI *)herald->AI())->SentryDownBy(who); + if(Creature *herald = me->FindNearestCreature(ENTRY_VAZRUDEN_HERALD,150)) + CAST_AI(boss_vazruden_the_heraldAI, herald->AI())->SentryDownBy(who); } void UpdateAI(const uint32 diff) diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/boss_watchkeeper_gargolmar.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/boss_watchkeeper_gargolmar.cpp index 042291b330a..c36f963555c 100644 --- a/src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/boss_watchkeeper_gargolmar.cpp +++ b/src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/boss_watchkeeper_gargolmar.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -64,7 +64,7 @@ struct TRINITY_DLL_DECL boss_watchkeeper_gargolmarAI : public ScriptedAI YelledForHeal = false; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { switch(rand()%3) { diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/def_hellfire_ramparts.h b/src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/def_hellfire_ramparts.h new file mode 100644 index 00000000000..4ced55bfb09 --- /dev/null +++ b/src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/def_hellfire_ramparts.h @@ -0,0 +1,16 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_RAMPARTS_H +#define DEF_RAMPARTS_H + +#define ENCOUNTERS 2 + +enum +{ + TYPE_VAZRUDEN = 1, + TYPE_NAZAN = 2 +}; + +#endif diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/instance_hellfire_ramparts.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/instance_hellfire_ramparts.cpp new file mode 100644 index 00000000000..9893c3c6849 --- /dev/null +++ b/src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/instance_hellfire_ramparts.cpp @@ -0,0 +1,124 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Hellfire_Ramparts +SD%Complete: 50 +SDComment: +SDCategory: Hellfire Ramparts +EndScriptData */ + +#include "precompiled.h" +#include "def_hellfire_ramparts.h" + +struct TRINITY_DLL_DECL instance_ramparts : public ScriptedInstance +{ + instance_ramparts(Map* pMap) : ScriptedInstance(pMap) {Initialize();} + + uint32 m_uiEncounter[ENCOUNTERS]; + uint64 m_uiChestNGUID; + uint64 m_uiChestHGUID; + + void Initialize() + { + m_uiChestNGUID = 0; + m_uiChestHGUID = 0; + + for(uint8 i = 0; i < ENCOUNTERS; i++) + m_uiEncounter[i] = NOT_STARTED; + + } + + void OnObjectCreate(GameObject* pGo) + { + switch(pGo->GetEntry()) + { + case 185168: m_uiChestNGUID = pGo->GetGUID(); break; + case 185169: m_uiChestHGUID = pGo->GetGUID(); break; + } + } + + Player* GetFirstPlayerInInstance() + { + Map::PlayerList const& pPlayers = instance->GetPlayers(); + + if (!pPlayers.isEmpty()) + { + for(Map::PlayerList::const_iterator itr = pPlayers.begin(); itr != pPlayers.end(); ++itr) + { + if (Player* pPlr = itr->getSource()) + return pPlr; + } + } + + debug_log("TSCR: Instance Ramparts: GetFirstPlayerInInstance, but PlayerList is empty."); + return NULL; + } + + void DoRespawnChest() + { + if (Player* pPlayer = GetFirstPlayerInInstance()) + { + uint64 uiChest; + + if (instance->IsHeroic()) + uiChest = m_uiChestHGUID; + else + uiChest = m_uiChestNGUID; + + if (GameObject* pGo = GameObject::GetGameObject(*pPlayer,uiChest)) + { + if (pGo->isSpawned()) + return; + + pGo->SetRespawnTime(HOUR*IN_MILISECONDS); + } + } + } + + void SetData(uint32 uiType, uint32 uiData) + { + debug_log("TSCR: Instance Ramparts: SetData received for type %u with data %u",uiType,uiData); + + switch(uiType) + { + case TYPE_VAZRUDEN: + if (uiData == DONE && m_uiEncounter[1] == DONE) + DoRespawnChest(); + m_uiEncounter[0] = uiData; + break; + case TYPE_NAZAN: + if (uiData == DONE && m_uiEncounter[0] == DONE) + DoRespawnChest(); + m_uiEncounter[1] = uiData; + break; + } + } +}; + +InstanceData* GetInstanceData_instance_ramparts(Map* pMap) +{ + return new instance_ramparts(pMap); +} + +void AddSC_instance_ramparts() +{ + Script* pNewScript; + pNewScript = new Script; + pNewScript->Name = "instance_ramparts"; + pNewScript->GetInstanceData = &GetInstanceData_instance_ramparts; + pNewScript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/boss_magtheridon.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/boss_magtheridon.cpp index 3e001888752..69084fb2d14 100644 --- a/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/boss_magtheridon.cpp +++ b/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/boss_magtheridon.cpp @@ -128,7 +128,7 @@ struct TRINITY_DLL_DECL mob_abyssalAI : public ScriptedAI } } - void Aggro(Unit*) {DoZoneInCombat();} + void EnterCombat(Unit* who) {DoZoneInCombat();} void AttackStart(Unit *who) {if(!trigger) ScriptedAI::AttackStart(who);} void MoveInLineOfSight(Unit *who) {if(!trigger) ScriptedAI::MoveInLineOfSight(who);} @@ -170,19 +170,19 @@ struct TRINITY_DLL_DECL boss_magtheridonAI : public ScriptedAI { boss_magtheridonAI(Creature *c) : ScriptedAI(c) { - pInstance =(ScriptedInstance*)m_creature->GetInstanceData(); + pInstance =m_creature->GetInstanceData(); m_creature->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 10); m_creature->SetFloatValue(UNIT_FIELD_COMBATREACH, 10); // target 7, random target with certain entry spell, need core fix SpellEntry *TempSpell; - TempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_BLAZE_TARGET); + TempSpell = GET_SPELL(SPELL_BLAZE_TARGET); if(TempSpell && TempSpell->EffectImplicitTargetA[0] != 6) { TempSpell->EffectImplicitTargetA[0] = 6; TempSpell->EffectImplicitTargetB[0] = 0; } - TempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_QUAKE_TRIGGER); + TempSpell = GET_SPELL(SPELL_QUAKE_TRIGGER); if(TempSpell && TempSpell->EffectTriggerSpell[0] != SPELL_QUAKE_KNOCKBACK) { TempSpell->EffectTriggerSpell[0] = SPELL_QUAKE_KNOCKBACK; @@ -257,7 +257,7 @@ struct TRINITY_DLL_DECL boss_magtheridonAI : public ScriptedAI for(CubeMap::iterator i = Cube.begin(); i != Cube.end(); ++i) { Unit *clicker = Unit::GetUnit(*m_creature, (*i).second); - if(!clicker || !clicker->HasAura(SPELL_SHADOW_GRASP, 1)) + if(!clicker || !clicker->HasAura(SPELL_SHADOW_GRASP)) { DebuffClicker(clicker); (*i).second = 0; @@ -265,12 +265,12 @@ struct TRINITY_DLL_DECL boss_magtheridonAI : public ScriptedAI } // if 5 clickers from other cubes apply shadow cage - if(ClickerNum >= CLICKERS_COUNT && !m_creature->HasAura(SPELL_SHADOW_CAGE, 0)) + if(ClickerNum >= CLICKERS_COUNT && !m_creature->HasAura(SPELL_SHADOW_CAGE)) { DoScriptText(SAY_BANISH, m_creature); m_creature->CastSpell(m_creature, SPELL_SHADOW_CAGE, true); } - else if(ClickerNum < CLICKERS_COUNT && m_creature->HasAura(SPELL_SHADOW_CAGE, 0)) + else if(ClickerNum < CLICKERS_COUNT && m_creature->HasAura(SPELL_SHADOW_CAGE)) m_creature->RemoveAurasDueToSpell(SPELL_SHADOW_CAGE); if(!ClickerNum) NeedCheckCube = false; @@ -289,7 +289,7 @@ struct TRINITY_DLL_DECL boss_magtheridonAI : public ScriptedAI DoScriptText(SAY_DEATH, m_creature); } - void MoveInLineOfSight(Unit*) {} + void MoveInLineOfSight(Unit* who) {} void AttackStart(Unit *who) { @@ -297,7 +297,7 @@ struct TRINITY_DLL_DECL boss_magtheridonAI : public ScriptedAI ScriptedAI::AttackStart(who); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { if(pInstance) pInstance->SetData(DATA_MAGTHERIDON_EVENT, IN_PROGRESS); @@ -311,7 +311,7 @@ struct TRINITY_DLL_DECL boss_magtheridonAI : public ScriptedAI void UpdateAI(const uint32 diff) { - if (!InCombat) + if (!m_creature->isInCombat()) { if (RandChat_Timer < diff) { @@ -368,7 +368,7 @@ struct TRINITY_DLL_DECL boss_magtheridonAI : public ScriptedAI Creature *summon = m_creature->SummonCreature(MOB_ABYSSAL, x, y, z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); if(summon) { - ((mob_abyssalAI*)summon->AI())->SetTrigger(2); + CAST_AI(mob_abyssalAI, summon->AI())->SetTrigger(2); m_creature->CastSpell(summon, SPELL_BLAZE_TARGET, true); summon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); } @@ -398,7 +398,7 @@ struct TRINITY_DLL_DECL boss_magtheridonAI : public ScriptedAI float x, y, z; target->GetPosition(x, y, z); Creature *summon = m_creature->SummonCreature(MOB_ABYSSAL, x, y, z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); - if(summon) ((mob_abyssalAI*)summon->AI())->SetTrigger(1); + if(summon) CAST_AI(mob_abyssalAI, summon->AI())->SetTrigger(1); } Debris_Timer = 10000; }else Debris_Timer -= diff; @@ -412,7 +412,7 @@ struct TRINITY_DLL_DECL mob_hellfire_channelerAI : public ScriptedAI { mob_hellfire_channelerAI(Creature *c) : ScriptedAI(c) { - pInstance =(ScriptedInstance*)m_creature->GetInstanceData(); + pInstance =m_creature->GetInstanceData(); } ScriptedInstance* pInstance; @@ -439,7 +439,7 @@ struct TRINITY_DLL_DECL mob_hellfire_channelerAI : public ScriptedAI m_creature->CastSpell(m_creature, SPELL_SHADOW_GRASP_C, false); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { if(pInstance) pInstance->SetData(DATA_CHANNELER_EVENT, IN_PROGRESS); @@ -450,7 +450,7 @@ struct TRINITY_DLL_DECL mob_hellfire_channelerAI : public ScriptedAI void JustSummoned(Creature *summon) {summon->AI()->AttackStart(m_creature->getVictim());} - void MoveInLineOfSight(Unit*) {} + void MoveInLineOfSight(Unit* who) {} void DamageTaken(Unit*, uint32 &damage) { @@ -458,7 +458,7 @@ struct TRINITY_DLL_DECL mob_hellfire_channelerAI : public ScriptedAI m_creature->CastSpell(m_creature, SPELL_SOUL_TRANSFER, true); } - void JustDied(Unit*) + void JustDied(Unit* who) { if(pInstance) pInstance->SetData(DATA_CHANNELER_EVENT, DONE); @@ -503,20 +503,20 @@ struct TRINITY_DLL_DECL mob_hellfire_channelerAI : public ScriptedAI //Manticron Cube bool GOHello_go_Manticron_Cube(Player *player, GameObject* _GO) { - ScriptedInstance* pInstance =(ScriptedInstance*)_GO->GetInstanceData(); + ScriptedInstance* pInstance =_GO->GetInstanceData(); if(!pInstance) return true; if(pInstance->GetData(DATA_MAGTHERIDON_EVENT) != IN_PROGRESS) return true; Creature *Magtheridon =Unit::GetCreature(*_GO, pInstance->GetData64(DATA_MAGTHERIDON)); if(!Magtheridon || !Magtheridon->isAlive()) return true; // if exhausted or already channeling return - if(player->HasAura(SPELL_MIND_EXHAUSTION, 0) || player->HasAura(SPELL_SHADOW_GRASP, 1)) + if(player->HasAura(SPELL_MIND_EXHAUSTION) || player->HasAura(SPELL_SHADOW_GRASP)) return true; player->InterruptNonMeleeSpells(false); player->CastSpell(player, SPELL_SHADOW_GRASP, true); player->CastSpell(player, SPELL_SHADOW_GRASP_VISUAL, false); - ((boss_magtheridonAI*)Magtheridon->AI())->SetClicker(_GO->GetGUID(), player->GetGUID()); + CAST_AI(boss_magtheridonAI, Magtheridon->AI())->SetClicker(_GO->GetGUID(), player->GetGUID()); return true; } diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/def_magtheridons_lair.h b/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/def_magtheridons_lair.h index 3c0012ce447..c5469acaea0 100644 --- a/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/def_magtheridons_lair.h +++ b/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/def_magtheridons_lair.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * This program is free software licensed under GPL version 2 * Please see the included DOCS/LICENSE.TXT for more information */ diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/instance_magtheridons_lair.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/instance_magtheridons_lair.cpp index ea51e575824..8f3a28e02a3 100644 --- a/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/instance_magtheridons_lair.cpp +++ b/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/instance_magtheridons_lair.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -126,8 +126,8 @@ struct TRINITY_DLL_DECL instance_magtheridons_lair : public ScriptedInstance RespawnTimer = 10000; if(data != IN_PROGRESS) { - if(GameObject *Door = instance->GetGameObjectInMap(DoorGUID)) - Door->SetGoState(0); + if(GameObject *Door = instance->GetGameObject(DoorGUID)) + Door->SetGoState(GO_STATE_ACTIVE); } break; case DATA_CHANNELER_EVENT: @@ -139,7 +139,7 @@ struct TRINITY_DLL_DECL instance_magtheridons_lair : public ScriptedInstance Encounters[1] = NOT_STARTED; for(std::set<uint64>::iterator i = ChannelerGUID.begin(); i != ChannelerGUID.end(); ++i) { - if(Creature *Channeler = instance->GetCreatureInMap(*i)) + if(Creature *Channeler = instance->GetCreature(*i)) { if(Channeler->isAlive()) Channeler->AI()->EnterEvadeMode(); @@ -148,8 +148,8 @@ struct TRINITY_DLL_DECL instance_magtheridons_lair : public ScriptedInstance } } CageTimer = 0; - if(GameObject *Door = instance->GetGameObjectInMap(DoorGUID)) - Door->SetGoState(0); + if(GameObject *Door = instance->GetGameObject(DoorGUID)) + Door->SetGoState(GO_STATE_ACTIVE); }break; case IN_PROGRESS: // Event start. if(Encounters[1] != IN_PROGRESS) @@ -158,24 +158,24 @@ struct TRINITY_DLL_DECL instance_magtheridons_lair : public ScriptedInstance // Let all five channelers aggro. for(std::set<uint64>::iterator i = ChannelerGUID.begin(); i != ChannelerGUID.end(); ++i) { - Creature *Channeler = instance->GetCreatureInMap(*i); + Creature *Channeler = instance->GetCreature(*i); if(Channeler && Channeler->isAlive()) Channeler->AI()->AttackStart(Channeler->SelectNearestTarget(999)); } // Release Magtheridon after two minutes. - Creature *Magtheridon = instance->GetCreatureInMap(MagtheridonGUID); + Creature *Magtheridon = instance->GetCreature(MagtheridonGUID); if(Magtheridon && Magtheridon->isAlive()) { - Magtheridon->TextEmote("'s bonds begin to weaken!", 0); + Magtheridon->MonsterTextEmote("'s bonds begin to weaken!", 0); CageTimer = 120000; } - if(GameObject *Door = instance->GetGameObjectInMap(DoorGUID)) - Door->SetGoState(1); + if(GameObject *Door = instance->GetGameObject(DoorGUID)) + Door->SetGoState(GO_STATE_READY); }break; case DONE: // Add buff and check if all channelers are dead. for(std::set<uint64>::iterator i = ChannelerGUID.begin(); i != ChannelerGUID.end(); ++i) { - Creature *Channeler = instance->GetCreatureInMap(*i); + Creature *Channeler = instance->GetCreature(*i); if(Channeler && Channeler->isAlive()) { //Channeler->CastSpell(Channeler, SPELL_SOUL_TRANSFER, true); @@ -189,10 +189,7 @@ struct TRINITY_DLL_DECL instance_magtheridons_lair : public ScriptedInstance case DATA_COLLAPSE: // true - collapse / false - reset for(std::set<uint64>::iterator i = ColumnGUID.begin(); i != ColumnGUID.end(); ++i) - { - if(GameObject *Column = instance->GetGameObjectInMap(*i)) - Column->SetGoState(!data); - } + HandleGameObject(*i, data); break; default: break; @@ -212,7 +209,7 @@ struct TRINITY_DLL_DECL instance_magtheridons_lair : public ScriptedInstance { if(CageTimer <= diff) { - Creature *Magtheridon = instance->GetCreatureInMap(MagtheridonGUID); + Creature *Magtheridon = instance->GetCreature(MagtheridonGUID); if(Magtheridon && Magtheridon->isAlive()) { Magtheridon->clearUnitState(UNIT_STAT_STUNNED); @@ -228,7 +225,7 @@ struct TRINITY_DLL_DECL instance_magtheridons_lair : public ScriptedInstance { for(std::set<uint64>::iterator i = ChannelerGUID.begin(); i != ChannelerGUID.end(); ++i) { - if(Creature *Channeler = instance->GetCreatureInMap(*i)) + if(Creature *Channeler = instance->GetCreature(*i)) { if(Channeler->isAlive()) Channeler->AI()->EnterEvadeMode(); diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/boss_nethekurse.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/boss_nethekurse.cpp index 320c6a0b0a4..6eeb07d1448 100644 --- a/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/boss_nethekurse.cpp +++ b/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/boss_nethekurse.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -77,7 +77,7 @@ struct TRINITY_DLL_DECL boss_grand_warlock_nethekurseAI : public ScriptedAI { boss_grand_warlock_nethekurseAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); HeroicMode = m_creature->GetMap()->IsHeroic(); } @@ -168,14 +168,6 @@ struct TRINITY_DLL_DECL boss_grand_warlock_nethekurseAI : public ScriptedAI if (m_creature->Attack(who, true)) { - m_creature->AddThreat(who, 0.0f); - - if (!InCombat) - { - InCombat = true; - Aggro(who); - } - if (Phase) DoStartNoMovement(who); else DoStartMovement(who); } @@ -183,10 +175,11 @@ struct TRINITY_DLL_DECL boss_grand_warlock_nethekurseAI : public ScriptedAI void MoveInLineOfSight(Unit *who) { - if (!m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessiblePlaceFor(m_creature) ) - { - if (!IntroOnce && m_creature->IsWithinDistInMap(who, 75)) + if (!IntroOnce && m_creature->IsWithinDistInMap(who, 50.0f)) { + if (who->GetTypeId() != TYPEID_PLAYER) + return; + DoScriptText(SAY_INTRO, m_creature); IntroOnce = true; IsIntroEvent = true; @@ -195,22 +188,13 @@ struct TRINITY_DLL_DECL boss_grand_warlock_nethekurseAI : public ScriptedAI pInstance->SetData(TYPE_NETHEKURSE,IN_PROGRESS); } - if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE ) - return; - if (IsIntroEvent || !IsMainEvent) return; - float attackRadius = m_creature->GetAttackDistance(who); - if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who) ) - { - //who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); - AttackStart(who); - } - } + ScriptedAI::MoveInLineOfSight(who); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { switch(rand()%3) { @@ -222,9 +206,13 @@ struct TRINITY_DLL_DECL boss_grand_warlock_nethekurseAI : public ScriptedAI void JustSummoned(Creature *summoned) { - summoned->setFaction(14); + summoned->setFaction(16); summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + + //triggered spell of consumption does not properly show it's SpellVisual, wrong spellid? + summoned->CastSpell(summoned,SPELL_TEMPORARY_VISUAL,true); + summoned->CastSpell(summoned,SPELL_CONSUMPTION,false,0,0,m_creature->GetGUID()); } void KilledUnit(Unit* victim) @@ -248,7 +236,7 @@ struct TRINITY_DLL_DECL boss_grand_warlock_nethekurseAI : public ScriptedAI if (pInstance->GetData64(DATA_NETHEKURSE_DOOR)) { if (GameObject *Door = GameObject::GetGameObject(*m_creature,pInstance->GetData64(DATA_NETHEKURSE_DOOR))) - Door->SetGoState(0); + Door->SetGoState(GO_STATE_ACTIVE); } } @@ -316,7 +304,7 @@ struct TRINITY_DLL_DECL mob_fel_orc_convertAI : public ScriptedAI { mob_fel_orc_convertAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } ScriptedInstance* pInstance; @@ -333,32 +321,36 @@ struct TRINITY_DLL_DECL mob_fel_orc_convertAI : public ScriptedAI return; } - void Aggro(Unit* who) + void EnterCombat(Unit* who) { if (pInstance) { if (pInstance->GetData64(DATA_NETHEKURSE)) { Creature *pKurse = Unit::GetCreature(*m_creature,pInstance->GetData64(DATA_NETHEKURSE)); - if (pKurse) - ((boss_grand_warlock_nethekurseAI*)pKurse->AI())->DoYellForPeonAggro(); - } + if (pKurse && m_creature->GetDistance(pKurse) < 45.0f) + { + CAST_AI(boss_grand_warlock_nethekurseAI, pKurse->AI())->DoYellForPeonAggro(); - if (pInstance->GetData(TYPE_NETHEKURSE) == IN_PROGRESS ) - return; - else pInstance->SetData(TYPE_NETHEKURSE,IN_PROGRESS); - } + if (pInstance->GetData(TYPE_NETHEKURSE) == IN_PROGRESS ) + return; + else pInstance->SetData(TYPE_NETHEKURSE,IN_PROGRESS); + } + } + } } void JustDied(Unit* Killer) { if (pInstance) { + if (pInstance->GetData(TYPE_NETHEKURSE) != IN_PROGRESS) + return; if (pInstance->GetData64(DATA_NETHEKURSE)) { Creature *pKurse = Unit::GetCreature(*m_creature,pInstance->GetData64(DATA_NETHEKURSE)); if (pKurse) - ((boss_grand_warlock_nethekurseAI*)pKurse->AI())->DoYellForPeonDeath(); + CAST_AI(boss_grand_warlock_nethekurseAI, pKurse->AI())->DoYellForPeonDeath(); } } } @@ -383,39 +375,10 @@ struct TRINITY_DLL_DECL mob_lesser_shadow_fissureAI : public ScriptedAI { mob_lesser_shadow_fissureAI(Creature *c) : ScriptedAI(c) {} - bool Start; - uint32 Stop_Timer; - - void Reset() - { - Start = false; - Stop_Timer = 30000; - } - - void Aggro(Unit* who) { } - - void MoveInLineOfSight(Unit *who) { return; } - - void AttackStart(Unit* who) { return; } - - void UpdateAI(const uint32 diff) - { - if (!Start) - { - //triggered spell of consumption does not properly show it's SpellVisual, hack it a bit - m_creature->CastSpell(m_creature,SPELL_TEMPORARY_VISUAL,true); - m_creature->CastSpell(m_creature,SPELL_CONSUMPTION,false); - Start = true; - } - - if (Stop_Timer < diff) - { - m_creature->setDeathState(JUST_DIED); - m_creature->SetHealth(0); - m_creature->CombatStop(); - m_creature->DeleteThreatList(); - }else Stop_Timer -= diff; - } + void Reset() { } + void MoveInLineOfSight(Unit *who) { } + void AttackStart(Unit* who) { } + void EnterCombat(Unit* who) { } }; CreatureAI* GetAI_boss_grand_warlock_nethekurse(Creature *_Creature) diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/boss_warbringer_omrogg.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/boss_warbringer_omrogg.cpp index b5caede6f7d..bdedc6b4fde 100644 --- a/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/boss_warbringer_omrogg.cpp +++ b/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/boss_warbringer_omrogg.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -103,7 +103,7 @@ struct TRINITY_DLL_DECL mob_omrogg_headsAI : public ScriptedAI uint32 Death_Timer; void Reset() {} - void Aggro(Unit* who) { } + void EnterCombat(Unit* who) { } void DoDeathYell() { @@ -128,7 +128,7 @@ struct TRINITY_DLL_DECL boss_warbringer_omroggAI : public ScriptedAI { boss_warbringer_omroggAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); HeroicMode = m_creature->GetMap()->IsHeroic(); } @@ -156,8 +156,6 @@ struct TRINITY_DLL_DECL boss_warbringer_omroggAI : public ScriptedAI void Reset() { - m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true); - m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true); LeftHead = 0; RightHead = 0; @@ -175,6 +173,9 @@ struct TRINITY_DLL_DECL boss_warbringer_omroggAI : public ScriptedAI ThunderClap_Timer = 15000; ResetThreat_Timer = 30000; + m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true); + m_creature->ApplySpellImmune(1, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true); + if (pInstance) pInstance->SetData(TYPE_OMROGG, NOT_STARTED); //End boss can use this later. O'mrogg must be defeated(DONE) or he will come to aid. } @@ -200,10 +201,10 @@ struct TRINITY_DLL_DECL boss_warbringer_omroggAI : public ScriptedAI } } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { - DoSpawnCreature(ENTRY_LEFT_HEAD,0,0,0,0,TEMPSUMMON_TIMED_DESPAWN,1800000); - DoSpawnCreature(ENTRY_RIGHT_HEAD,0,0,0,0,TEMPSUMMON_TIMED_DESPAWN,1800000); + DoSpawnCreature(ENTRY_LEFT_HEAD,0,0,0,0,TEMPSUMMON_TIMED_DESPAWN,90000); + DoSpawnCreature(ENTRY_RIGHT_HEAD,0,0,0,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,90000); if (Unit *Left = Unit::GetUnit(*m_creature,LeftHead)) { @@ -273,7 +274,7 @@ struct TRINITY_DLL_DECL boss_warbringer_omroggAI : public ScriptedAI DoScriptText(YELL_DIE_L, Left); - ((mob_omrogg_headsAI*)((Creature*)Right)->AI())->DoDeathYell(); + CAST_AI(mob_omrogg_headsAI, CAST_CRE(Right)->AI())->DoDeathYell(); } if (pInstance) @@ -357,19 +358,19 @@ struct TRINITY_DLL_DECL boss_warbringer_omroggAI : public ScriptedAI DoResetThreat(); m_creature->AddThreat(target, 0.0f); } - ResetThreat_Timer = 35000+rand()%10000; + ResetThreat_Timer = 25000+rand()%15000; }else ResetThreat_Timer -= diff; if (Fear_Timer < diff) { DoCast(m_creature,SPELL_FEAR); - Fear_Timer = 15000+rand()%25000; + Fear_Timer = 15000+rand()%20000; }else Fear_Timer -= diff; if (ThunderClap_Timer < diff) { DoCast(m_creature,SPELL_THUNDERCLAP); - ThunderClap_Timer = 25000+rand()%15000; + ThunderClap_Timer = 15000+rand()%15000; }else ThunderClap_Timer -= diff; DoMeleeAttackIfReady(); diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/boss_warchief_kargath_bladefist.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/boss_warchief_kargath_bladefist.cpp index 7ae44f2f80a..276089a91ee 100644 --- a/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/boss_warchief_kargath_bladefist.cpp +++ b/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/boss_warchief_kargath_bladefist.cpp @@ -1,6 +1,39 @@ -/* Copyright (C) 2008 - 2009 BroodWyrm */ +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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_Warchief_Kargath_Bladefist +SD%Complete: 90 +SDComment: +SDCategory: Hellfire Citadel, Shattered Halls +EndScriptData */ + +/* ContentData +boss_warchief_kargath_bladefist +EndContentData */ + #include "precompiled.h" +#define SAY_AGGRO1 -1540042 +#define SAY_AGGRO2 -1540043 +#define SAY_AGGRO3 -1540044 +#define SAY_SLAY1 -1540045 +#define SAY_SLAY2 -1540046 +#define SAY_DEATH -1540047 + #define SPELL_BLADE_DANCE 30739 #define H_SPELL_CHARGE 25821 @@ -11,28 +44,15 @@ #define MOB_SHARPSHOOTER_GUARD 17622 #define MOB_REAVER_GUARD 17623 -float AssassEntrance[3] = {275.136,-84.29,2.3}; // y +-8 -float AssassExit[3] = {184.233,-84.29,2.3}; // y +-8 +float AssassEntrance[3] = {275.136,-84.29,2.3}; // y -8 +float AssassExit[3] = {184.233,-84.29,2.3}; // y -8 float AddsEntrance[3] = {306.036,-84.29,1.93}; -#define SOUND_AGGRO1 10323 -#define SAY_AGGRO1 "Ours is the true Horde! The only Horde!" -#define SOUND_AGGRO2 10324 -#define SAY_AGGRO2 "I'll carve the meat from your bones!" -#define SOUND_AGGRO3 10325 -#define SAY_AGGRO3 "I am called Bladefist for a reason, as you will see!" -#define SOUND_SLAY1 10326 -#define SAY_SLAY1 "For the real Horde!" -#define SOUND_SLAY2 10327 -#define SAY_SLAY2 "I am the only Warchief!" -#define SOUND_DEATH 10328 -#define SAY_DEATH "The true Horde... will.. prevail.." - struct TRINITY_DLL_DECL boss_warchief_kargath_bladefistAI : public ScriptedAI { boss_warchief_kargath_bladefistAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); HeroicMode = m_creature->GetMap()->IsHeroic(); } @@ -67,28 +87,19 @@ struct TRINITY_DLL_DECL boss_warchief_kargath_bladefistAI : public ScriptedAI Wait_Timer = 0; Charge_timer = 0; - Blade_Dance_Timer = 30000; - Summon_Assistant_Timer = 15000; + Blade_Dance_Timer = 45000; + Summon_Assistant_Timer = 30000; Assassins_Timer = 5000; resetcheck_timer = 5000; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { switch (rand()%3) { - case 0: - DoPlaySoundToSet(m_creature,SOUND_AGGRO1); - DoYell(SAY_AGGRO1,LANG_UNIVERSAL,NULL); - break; - case 1: - DoPlaySoundToSet(m_creature,SOUND_AGGRO2); - DoYell(SAY_AGGRO2,LANG_UNIVERSAL,NULL); - break; - case 2: - DoPlaySoundToSet(m_creature,SOUND_AGGRO3); - DoYell(SAY_AGGRO3,LANG_UNIVERSAL,NULL); - break; + case 0:DoScriptText(SAY_AGGRO1, m_creature);break; + case 1:DoScriptText(SAY_AGGRO2, m_creature);break; + case 2:DoScriptText(SAY_AGGRO3, m_creature);break; } } @@ -114,22 +125,15 @@ struct TRINITY_DLL_DECL boss_warchief_kargath_bladefistAI : public ScriptedAI { switch(rand()%2) { - case 0: - DoPlaySoundToSet(m_creature, SOUND_SLAY1); - DoYell(SAY_SLAY1,LANG_UNIVERSAL,NULL); - break; - case 1: - DoPlaySoundToSet(m_creature, SOUND_SLAY2); - DoYell(SAY_SLAY2,LANG_UNIVERSAL,NULL); - break; + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; } } } void JustDied(Unit* Killer) { - DoPlaySoundToSet(m_creature, SOUND_DEATH); - DoYell(SAY_DEATH,LANG_UNIVERSAL,NULL); + DoScriptText(SAY_DEATH, m_creature); removeAdds(); } @@ -161,7 +165,7 @@ struct TRINITY_DLL_DECL boss_warchief_kargath_bladefistAI : public ScriptedAI { (*temp).GetMotionMaster()->Clear(true); m_creature->DealDamage(temp,temp->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - ((Creature*)temp)->RemoveCorpse(); + CAST_CRE(temp)->RemoveCorpse(); } } adds.clear(); @@ -173,22 +177,23 @@ struct TRINITY_DLL_DECL boss_warchief_kargath_bladefistAI : public ScriptedAI { (*temp).GetMotionMaster()->Clear(true); m_creature->DealDamage(temp,temp->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - ((Creature*)temp)->RemoveCorpse(); + CAST_CRE(temp)->RemoveCorpse(); } } assassins.clear(); } void SpawnAssassin() { - m_creature->SummonCreature(MOB_SHATTERED_ASSASSIN,AssassEntrance[0],AssassEntrance[1]+8, AssassEntrance[2], 0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,10000); - m_creature->SummonCreature(MOB_SHATTERED_ASSASSIN,AssassEntrance[0],AssassEntrance[1]-8, AssassEntrance[2], 0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,10000); - m_creature->SummonCreature(MOB_SHATTERED_ASSASSIN,AssassExit[0],AssassExit[1]+8, AssassExit[2], 0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,10000); - m_creature->SummonCreature(MOB_SHATTERED_ASSASSIN,AssassExit[0],AssassExit[1]-8, AssassExit[2], 0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,10000); + m_creature->SummonCreature(MOB_SHATTERED_ASSASSIN,AssassEntrance[0],AssassEntrance[1]+8, AssassEntrance[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); + m_creature->SummonCreature(MOB_SHATTERED_ASSASSIN,AssassEntrance[0],AssassEntrance[1]-8, AssassEntrance[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); + m_creature->SummonCreature(MOB_SHATTERED_ASSASSIN,AssassExit[0],AssassExit[1]+8, AssassExit[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); + m_creature->SummonCreature(MOB_SHATTERED_ASSASSIN,AssassExit[0],AssassExit[1]-8, AssassExit[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); } void UpdateAI(const uint32 diff) { - if (!UpdateVictim() ) + //Return since we have no target + if (!UpdateVictim()) return; if(Assassins_Timer) @@ -250,30 +255,29 @@ struct TRINITY_DLL_DECL boss_warchief_kargath_bladefistAI : public ScriptedAI if (Summon_Assistant_Timer < diff) { Unit* target = NULL; - Creature* Summoned; for(int i = 0; i < summoned; i++) { switch(rand()%3) { - case 0: Summoned = m_creature->SummonCreature(MOB_HEARTHEN_GUARD,AddsEntrance[0],AddsEntrance[1], AddsEntrance[2], 0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,10000); break; - case 1: Summoned = m_creature->SummonCreature(MOB_SHARPSHOOTER_GUARD,AddsEntrance[0],AddsEntrance[1], AddsEntrance[2], 0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,10000); break; - case 2: Summoned = m_creature->SummonCreature(MOB_REAVER_GUARD,AddsEntrance[0],AddsEntrance[1], AddsEntrance[2], 0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,10000); break; + case 0: m_creature->SummonCreature(MOB_HEARTHEN_GUARD,AddsEntrance[0],AddsEntrance[1], AddsEntrance[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); break; + case 1: m_creature->SummonCreature(MOB_SHARPSHOOTER_GUARD,AddsEntrance[0],AddsEntrance[1], AddsEntrance[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); break; + case 2: m_creature->SummonCreature(MOB_REAVER_GUARD,AddsEntrance[0],AddsEntrance[1], AddsEntrance[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); break; } } if(rand()%100 < 20) summoned++; - Summon_Assistant_Timer = 15000 + (rand()%5000) ; + Summon_Assistant_Timer = 25000 + (rand()%10000) ; }else Summon_Assistant_Timer -= diff; DoMeleeAttackIfReady(); } - if(resetcheck_timer < diff) + if (resetcheck_timer < diff) { uint32 tempx,tempy; - tempx = m_creature->GetPositionX(); - tempy = m_creature->GetPositionY(); - if ( tempx > 255 || tempx < 205) + tempx = uint32(m_creature->GetPositionX()); + tempy = uint32(m_creature->GetPositionY()); + if (tempx > 255 || tempx < 205) { EnterEvadeMode(); return; @@ -293,7 +297,7 @@ void AddSC_boss_warchief_kargath_bladefist() Script *newscript; newscript = new Script; newscript->Name="boss_warchief_kargath_bladefist"; - newscript->GetAI = &GetAI_boss_warchief_kargath_bladefist; + newscript->GetAI = GetAI_boss_warchief_kargath_bladefist; newscript->RegisterSelf(); } diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/def_shattered_halls.h b/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/def_shattered_halls.h index cb3a06055cb..cbfa23ec4e0 100644 --- a/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/def_shattered_halls.h +++ b/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/def_shattered_halls.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * This program is free software licensed under GPL version 2 * Please see the included DOCS/LICENSE.TXT for more information */ diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/instance_shattered_halls.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/instance_shattered_halls.cpp index aa2817ca994..b606ff0f97e 100644 --- a/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/instance_shattered_halls.cpp +++ b/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/instance_shattered_halls.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 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 index b9e3b9d752f..27e673f7f29 100644 --- a/src/bindings/scripts/scripts/zone/hellfire_peninsula/boss_doomlord_kazzak.cpp +++ b/src/bindings/scripts/scripts/zone/hellfire_peninsula/boss_doomlord_kazzak.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>.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 @@ -73,7 +73,7 @@ struct TRINITY_DLL_DECL boss_doomlordkazzakAI : public ScriptedAI DoScriptText(SAY_INTRO, m_creature); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { switch(rand()%2) { diff --git a/src/bindings/scripts/scripts/zone/hellfire_peninsula/hellfire_peninsula.cpp b/src/bindings/scripts/scripts/zone/hellfire_peninsula/hellfire_peninsula.cpp index cba3a107af6..a32112ed709 100644 --- a/src/bindings/scripts/scripts/zone/hellfire_peninsula/hellfire_peninsula.cpp +++ b/src/bindings/scripts/scripts/zone/hellfire_peninsula/hellfire_peninsula.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -24,9 +24,6 @@ EndScriptData */ /* ContentData npc_aeranas go_haaleshi_altar -npc_wing_commander_dabiree -npc_gryphoneer_windbellow -npc_wing_commander_brack npc_wounded_blood_elf EndContentData */ @@ -37,16 +34,19 @@ EndContentData */ ## npc_aeranas ######*/ -#define SAY_SUMMON -1000138 -#define SAY_FREE -1000139 +enum +{ + SAY_SUMMON = -1000138, + SAY_FREE = -1000139, -#define FACTION_HOSTILE 16 -#define FACTION_FRIENDLY 35 + FACTION_HOSTILE = 16, + FACTION_FRIENDLY = 35, -#define SPELL_ENVELOPING_WINDS 15535 -#define SPELL_SHOCK 12553 + SPELL_ENVELOPING_WINDS = 15535, + SPELL_SHOCK = 12553, -#define C_AERANAS 17085 + C_AERANAS = 17085 +}; struct TRINITY_DLL_DECL npc_aeranasAI : public ScriptedAI { @@ -68,7 +68,7 @@ struct TRINITY_DLL_DECL npc_aeranasAI : public ScriptedAI DoScriptText(SAY_SUMMON, m_creature); } - void Aggro(Unit *who) {} + void EnterCombat(Unit *who) {} void UpdateAI(const uint32 diff) { @@ -127,147 +127,20 @@ bool GOHello_go_haaleshi_altar(Player *player, GameObject* _GO) } /*###### -## npc_wing_commander_dabiree -######*/ - -#define GOSSIP_ITEM1_DAB "Fly me to Murketh and Shaadraz Gateways" -#define GOSSIP_ITEM2_DAB "Fly me to Shatter Point" - -bool GossipHello_npc_wing_commander_dabiree(Player *player, Creature *_Creature) -{ - if (_Creature->isQuestGiver()) - player->PrepareQuestMenu( _Creature->GetGUID() ); - - //Mission: The Murketh and Shaadraz Gateways - if (player->GetQuestStatus(10146) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM(2, GOSSIP_ITEM1_DAB, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - - //Shatter Point - if (!player->GetQuestRewardStatus(10340)) - player->ADD_GOSSIP_ITEM(2, GOSSIP_ITEM2_DAB, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - - player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID()); - - return true; -} - -bool GossipSelect_npc_wing_commander_dabiree(Player *player, Creature *_Creature, uint32 sender, uint32 action ) -{ - if (action == GOSSIP_ACTION_INFO_DEF + 1) - { - player->CLOSE_GOSSIP_MENU(); - player->CastSpell(player,33768,true); //TaxiPath 585 (Gateways Murket and Shaadraz) - } - if (action == GOSSIP_ACTION_INFO_DEF + 2) - { - player->CLOSE_GOSSIP_MENU(); - player->CastSpell(player,35069,true); //TaxiPath 612 (Taxi - Hellfire Peninsula - Expedition Point to Shatter Point) - } - return true; -} - -/*###### -## npc_gryphoneer_windbellow -######*/ - -#define GOSSIP_ITEM1_WIN "Fly me to The Abyssal Shelf" -#define GOSSIP_ITEM2_WIN "Fly me to Honor Point" - -bool GossipHello_npc_gryphoneer_windbellow(Player *player, Creature *_Creature) -{ - if (_Creature->isQuestGiver()) - player->PrepareQuestMenu( _Creature->GetGUID() ); - - //Mission: The Abyssal Shelf || Return to the Abyssal Shelf - if (player->GetQuestStatus(10163) == QUEST_STATUS_INCOMPLETE || player->GetQuestStatus(10346) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM(2, GOSSIP_ITEM1_WIN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - - //Go to the Front - if (player->GetQuestStatus(10382) != QUEST_STATUS_NONE && !player->GetQuestRewardStatus(10382)) - player->ADD_GOSSIP_ITEM(2, GOSSIP_ITEM2_WIN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - - player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID()); - - return true; -} - -bool GossipSelect_npc_gryphoneer_windbellow(Player *player, Creature *_Creature, uint32 sender, uint32 action ) -{ - if (action == GOSSIP_ACTION_INFO_DEF + 1) - { - player->CLOSE_GOSSIP_MENU(); - player->CastSpell(player,33899,true); //TaxiPath 589 (Aerial Assault Flight (Alliance)) - } - if (action == GOSSIP_ACTION_INFO_DEF + 2) - { - player->CLOSE_GOSSIP_MENU(); - player->CastSpell(player,35065,true); //TaxiPath 607 (Taxi - Hellfire Peninsula - Shatter Point to Beach Head) - } - return true; -} - -/*###### -## npc_wing_commander_brack -######*/ - -#define GOSSIP_ITEM1_BRA "Fly me to Murketh and Shaadraz Gateways" -#define GOSSIP_ITEM2_BRA "Fly me to The Abyssal Shelf" -#define GOSSIP_ITEM3_BRA "Fly me to Spinebreaker Post" - -bool GossipHello_npc_wing_commander_brack(Player *player, Creature *_Creature) -{ - if (_Creature->isQuestGiver()) - player->PrepareQuestMenu( _Creature->GetGUID() ); - - //Mission: The Murketh and Shaadraz Gateways - if (player->GetQuestStatus(10129) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM(2, GOSSIP_ITEM1_BRA, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - - //Mission: The Abyssal Shelf || Return to the Abyssal Shelf - if (player->GetQuestStatus(10162) == QUEST_STATUS_INCOMPLETE || player->GetQuestStatus(10347) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM(2, GOSSIP_ITEM2_BRA, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - - //Spinebreaker Post - if (player->GetQuestStatus(10242) == QUEST_STATUS_COMPLETE && !player->GetQuestRewardStatus(10242)) - player->ADD_GOSSIP_ITEM(2, GOSSIP_ITEM3_BRA, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); - - player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID()); - - return true; -} - -bool GossipSelect_npc_wing_commander_brack(Player *player, Creature *_Creature, uint32 sender, uint32 action ) -{ - switch(action) - { - case GOSSIP_ACTION_INFO_DEF + 1: - player->CLOSE_GOSSIP_MENU(); - player->CastSpell(player,33659,true); //TaxiPath 584 (Gateways Murket and Shaadraz) - break; - case GOSSIP_ACTION_INFO_DEF + 2: - player->CLOSE_GOSSIP_MENU(); - player->CastSpell(player,33825,true); //TaxiPath 587 (Aerial Assault Flight (Horde)) - break; - case GOSSIP_ACTION_INFO_DEF + 3: - player->CLOSE_GOSSIP_MENU(); - player->CastSpell(player,34578,true); //TaxiPath 604 (Taxi - Reaver's Fall to Spinebreaker Ridge) - break; - } - return true; -} - -/*###### ## npc_wounded_blood_elf ######*/ -#define SAY_ELF_START -1000117 -#define SAY_ELF_SUMMON1 -1000118 -#define SAY_ELF_RESTING -1000119 -#define SAY_ELF_SUMMON2 -1000120 -#define SAY_ELF_COMPLETE -1000121 -#define SAY_ELF_AGGRO -1000122 - -#define QUEST_ROAD_TO_FALCON_WATCH 9375 +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 { @@ -293,8 +166,6 @@ struct TRINITY_DLL_DECL npc_wounded_blood_elfAI : public npc_escortAI break; case 13: DoScriptText(SAY_ELF_RESTING, m_creature, player); - // make the NPC kneel - m_creature->HandleEmoteCommand(EMOTE_ONESHOT_KNEEL); break; case 14: DoScriptText(SAY_ELF_SUMMON2, m_creature, player); @@ -306,8 +177,8 @@ struct TRINITY_DLL_DECL npc_wounded_blood_elfAI : public npc_escortAI DoScriptText(SAY_ELF_COMPLETE, m_creature, player); // Award quest credit Player* player = Unit::GetPlayer(PlayerGUID); - if (player && player->GetTypeId() == TYPEID_PLAYER) - ((Player*)player)->GroupEventHappens(QUEST_ROAD_TO_FALCON_WATCH,m_creature); + if (player) + player->GroupEventHappens(QUEST_ROAD_TO_FALCON_WATCH,m_creature); break; } } @@ -318,7 +189,7 @@ struct TRINITY_DLL_DECL npc_wounded_blood_elfAI : public npc_escortAI m_creature->setFaction(1604); } - void Aggro(Unit* who) + void EnterCombat(Unit* who) { if (IsBeingEscorted) DoScriptText(SAY_ELF_AGGRO, m_creature); @@ -338,8 +209,8 @@ struct TRINITY_DLL_DECL npc_wounded_blood_elfAI : public npc_escortAI { // If NPC dies, player fails the quest Player* player = Unit::GetPlayer(PlayerGUID); - if (player && player->GetTypeId() == TYPEID_PLAYER) - ((Player*)player)->FailQuest(QUEST_ROAD_TO_FALCON_WATCH); + if (player) + player->FailQuest(QUEST_ROAD_TO_FALCON_WATCH); } } @@ -349,47 +220,20 @@ struct TRINITY_DLL_DECL npc_wounded_blood_elfAI : public npc_escortAI } }; -CreatureAI* GetAI_npc_wounded_blood_elf(Creature *_Creature) +CreatureAI* GetAI_npc_wounded_blood_elf(Creature* pCreature) { - npc_wounded_blood_elfAI* welfAI = new npc_wounded_blood_elfAI(_Creature); - - welfAI->AddWaypoint(0, -1137.72, 4272.10, 14.04, 5000); - welfAI->AddWaypoint(1, -1141.34, 4232.42, 14.63); - welfAI->AddWaypoint(2, -1133.47, 4220.88, 11.78); - welfAI->AddWaypoint(3, -1126.18, 4213.26, 13.51); - welfAI->AddWaypoint(4, -1100.12, 4204.32, 16.41); - welfAI->AddWaypoint(5, -1063.68, 4197.92, 15.51); - welfAI->AddWaypoint(6, -1027.28, 4194.36, 15.52); - welfAI->AddWaypoint(7, -995.68, 4189.59, 19.84); - welfAI->AddWaypoint(8, -970.90, 4188.60, 24.61); - welfAI->AddWaypoint(9, -961.93, 4193.34, 26.11, 15000); // Summon 1 - welfAI->AddWaypoint(10, -935.52, 4210.99, 31.98); - welfAI->AddWaypoint(11, -913.42, 4218.27, 37.29); - welfAI->AddWaypoint(12, -896.53, 4207.73, 43.23); - welfAI->AddWaypoint(13, -868.49, 4194.77, 46.75, 30000);// Kneel and Rest Here - welfAI->AddWaypoint(14, -852.83, 4198.29, 47.28, 15000);// Summon 2 - welfAI->AddWaypoint(15, -819.85, 4200.50, 46.37); - welfAI->AddWaypoint(16, -791.92, 4201.96, 44.19); - welfAI->AddWaypoint(17, -774.42, 4202.46, 47.41); - welfAI->AddWaypoint(18, -762.90, 4202.17, 48.81); - welfAI->AddWaypoint(19, -728.25, 4195.35, 50.68); - welfAI->AddWaypoint(20, -713.58, 4192.07, 53.98); - welfAI->AddWaypoint(21, -703.09, 4189.74, 56.96); - welfAI->AddWaypoint(22, -693.70, 4185.43, 57.06); - welfAI->AddWaypoint(23, -686.38, 4159.81, 60.26); - welfAI->AddWaypoint(24, -679.88, 4147.04, 64.20); - welfAI->AddWaypoint(25, -656.74, 4147.72, 64.11); - welfAI->AddWaypoint(26, -652.22, 4137.50, 64.58); - welfAI->AddWaypoint(27, -649.99, 4136.38, 64.63, 30000);// Award Quest Credit - - return (CreatureAI*)welfAI; + npc_wounded_blood_elfAI* welfAI = new npc_wounded_blood_elfAI(pCreature); + + welfAI->FillPointMovementListForCreature(); + + return welfAI; } bool QuestAccept_npc_wounded_blood_elf(Player* player, Creature* creature, Quest const* quest) { if (quest->GetQuestId() == QUEST_ROAD_TO_FALCON_WATCH) { - ((npc_escortAI*)(creature->AI()))->Start(true, true, false, player->GetGUID()); + CAST_AI(npc_escortAI, (creature->AI()))->Start(true, true, false, player->GetGUID()); // Change faction so mobs attack creature->setFaction(775); } @@ -416,24 +260,6 @@ void AddSC_hellfire_peninsula() newscript->RegisterSelf(); newscript = new Script; - newscript->Name="npc_wing_commander_dabiree"; - newscript->pGossipHello = &GossipHello_npc_wing_commander_dabiree; - newscript->pGossipSelect = &GossipSelect_npc_wing_commander_dabiree; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_gryphoneer_windbellow"; - newscript->pGossipHello = &GossipHello_npc_gryphoneer_windbellow; - newscript->pGossipSelect = &GossipSelect_npc_gryphoneer_windbellow; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_wing_commander_brack"; - newscript->pGossipHello = &GossipHello_npc_wing_commander_brack; - newscript->pGossipSelect = &GossipSelect_npc_wing_commander_brack; - 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; diff --git a/src/bindings/scripts/scripts/zone/ironforge/ironforge.cpp b/src/bindings/scripts/scripts/zone/ironforge/ironforge.cpp index 674bf56bb26..b17a280391a 100644 --- a/src/bindings/scripts/scripts/zone/ironforge/ironforge.cpp +++ b/src/bindings/scripts/scripts/zone/ironforge/ironforge.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 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 index 900a5ae3d5b..51b22fd934a 100644 --- 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 @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>.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 @@ -22,48 +22,13 @@ SDCategory: Isle Of Quel'Danas EndScriptData */ /* ContentData -npc_ayren_cloudbreaker npc_converted_sentry -npc_unrestrained_dragonhawk npc_greengill_slave EndContentData */ #include "precompiled.h" /*###### -## npc_ayren_cloudbreaker -######*/ - -#define GOSSIP_FLY1 "Speaking of action, I've been ordered to undertake an air strike." -#define GOSSIP_FLY2 "I need to intercept the Dawnblade reinforcements." -bool GossipHello_npc_ayren_cloudbreaker(Player *player, Creature *_Creature) -{ - if( player->GetQuestStatus(11532) == QUEST_STATUS_INCOMPLETE || player->GetQuestStatus(11533) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM(0, GOSSIP_FLY1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - - if( player->GetQuestStatus(11542) == QUEST_STATUS_INCOMPLETE || player->GetQuestStatus(11543) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM(0, GOSSIP_FLY2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); - - player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(),_Creature->GetGUID()); - return true; -} - -bool GossipSelect_npc_ayren_cloudbreaker(Player *player, Creature *_Creature, uint32 sender, uint32 action ) -{ - if (action == GOSSIP_ACTION_INFO_DEF+1) - { - player->CLOSE_GOSSIP_MENU(); - player->CastSpell(player,45071,true); //TaxiPath 779 - } - if (action == GOSSIP_ACTION_INFO_DEF+2) - { - player->CLOSE_GOSSIP_MENU(); - player->CastSpell(player,45113,true); //TaxiPath 784 - } - return true; -} - -/*###### ## npc_converted_sentry ######*/ @@ -87,7 +52,7 @@ struct TRINITY_DLL_DECL npc_converted_sentryAI : public ScriptedAI void MoveInLineOfSight(Unit *who) { return; } - void Aggro(Unit* who) + void EnterCombat(Unit* who) { } void UpdateAI(const uint32 diff) @@ -114,31 +79,6 @@ CreatureAI* GetAI_npc_converted_sentry(Creature *_Creature) } /*###### -## npc_unrestrained_dragonhawk -######*/ - -#define GOSSIP_UD "<Ride the dragonhawk to Sun's Reach>" - -bool GossipHello_npc_unrestrained_dragonhawk(Player *player, Creature *_Creature) -{ - if( player->GetQuestStatus(11542) == QUEST_STATUS_COMPLETE || player->GetQuestStatus(11543) == QUEST_STATUS_COMPLETE ) - player->ADD_GOSSIP_ITEM(0, GOSSIP_UD, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - - player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(),_Creature->GetGUID()); - return true; -} - -bool GossipSelect_npc_unrestrained_dragonhawk(Player *player, Creature *_Creature, uint32 sender, uint32 action ) -{ - if (action == GOSSIP_ACTION_INFO_DEF+1) - { - player->CLOSE_GOSSIP_MENU(); - player->CastSpell(player,45353,true); //TaxiPath 788 - } - return true; -} - -/*###### ## npc_greengill_slave ######*/ @@ -153,7 +93,7 @@ struct TRINITY_DLL_DECL npc_greengill_slaveAI : public ScriptedAI uint64 PlayerGUID; - void Aggro(Unit* who){} + void EnterCombat(Unit* who){} void Reset() { @@ -165,17 +105,17 @@ struct TRINITY_DLL_DECL npc_greengill_slaveAI : public ScriptedAI if(!caster) return; - if(caster->GetTypeId() == TYPEID_PLAYER && spell->Id == ORB && !m_creature->HasAura(ENRAGE, 0)) + 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 && ((Player*)plr)->GetQuestStatus(QUESTG) == QUEST_STATUS_INCOMPLETE) - ((Player*)plr)->KilledMonster(25086, m_creature->GetGUID()); + if(plr && CAST_PLR(plr)->GetQuestStatus(QUESTG) == QUEST_STATUS_INCOMPLETE) + CAST_PLR(plr)->KilledMonster(25086, m_creature->GetGUID()); } DoCast(m_creature, ENRAGE); - Unit* Myrmidon = FindCreature(DM, 70, m_creature); + Unit* Myrmidon = me->FindNearestCreature(DM, 70); if(Myrmidon) { m_creature->AddThreat(Myrmidon, 100000.0f); @@ -200,23 +140,11 @@ void AddSC_isle_of_queldanas() Script *newscript; newscript = new Script; - newscript->Name="npc_ayren_cloudbreaker"; - newscript->pGossipHello = &GossipHello_npc_ayren_cloudbreaker; - newscript->pGossipSelect = &GossipSelect_npc_ayren_cloudbreaker; - newscript->RegisterSelf(); - - newscript = new Script; newscript->Name="npc_converted_sentry"; newscript->GetAI = &GetAI_npc_converted_sentry; newscript->RegisterSelf(); newscript = new Script; - newscript->Name="npc_unrestrained_dragonhawk"; - newscript->pGossipHello = &GossipHello_npc_unrestrained_dragonhawk; - newscript->pGossipSelect = &GossipSelect_npc_unrestrained_dragonhawk; - 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/karazhan/boss_curator.cpp b/src/bindings/scripts/scripts/zone/karazhan/boss_curator.cpp index c2bfeaecbb8..f95ff8ead5a 100644 --- a/src/bindings/scripts/scripts/zone/karazhan/boss_curator.cpp +++ b/src/bindings/scripts/scripts/zone/karazhan/boss_curator.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -6,18 +6,18 @@ * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* ScriptData SDName: Boss_Curator SD%Complete: 100 -SDComment: Evocation may cause client crash (Core related) +SDComment: SDCategory: Karazhan EndScriptData */ @@ -34,10 +34,6 @@ EndScriptData */ //Flare spell info #define SPELL_ASTRAL_FLARE_PASSIVE 30234 //Visual effect + Flare damage -#define SPELL_ASTRAL_FLARE_NE 30236 -#define SPELL_ASTRAL_FLARE_NW 30239 -#define SPELL_ASTRAL_FLARE_SE 30240 -#define SPELL_ASTRAL_FLARE_SW 30241 //Curator spell info #define SPELL_HATEFUL_BOLT 30383 @@ -45,7 +41,7 @@ EndScriptData */ #define SPELL_ENRAGE 30403 //Arcane Infusion: Transforms Curator and adds damage. #define SPELL_BERSERK 26662 -struct TRINITY_DLL_DECL boss_curatorAI : public ScriptedAI +struct TRINITY_DLL_DECL boss_curatorAI : public ScriptedAI { boss_curatorAI(Creature *c) : ScriptedAI(c) {} @@ -69,8 +65,8 @@ struct TRINITY_DLL_DECL boss_curatorAI : public ScriptedAI { switch(rand()%2) { - case 0: DoScriptText(SAY_KILL1, m_creature); break; - case 1: DoScriptText(SAY_KILL2, m_creature); break; + case 0: DoScriptText(SAY_KILL1, m_creature); break; + case 1: DoScriptText(SAY_KILL2, m_creature); break; } } @@ -79,7 +75,7 @@ struct TRINITY_DLL_DECL boss_curatorAI : public ScriptedAI DoScriptText(SAY_DEATH, m_creature); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { DoScriptText(SAY_AGGRO, m_creature); } @@ -89,18 +85,38 @@ struct TRINITY_DLL_DECL boss_curatorAI : public ScriptedAI if (!UpdateVictim() ) return; - if (Evocating && !m_creature->HasAura(SPELL_EVOCATION, 0)) - Evocating = false; + //always decrease BerserkTimer + if (BerserkTimer < diff) + { + //if evocate, then break evocate + if (Evocating) + { + if (m_creature->HasAura(SPELL_EVOCATION)) + m_creature->RemoveAurasDueToSpell(SPELL_EVOCATION); + + Evocating = false; + } + + //may not be correct SAY (generic hard enrage) + DoScriptText(SAY_ENRAGE, m_creature); - if (m_creature->GetPower(POWER_MANA) <= 1000 && !Evocating) + m_creature->InterruptNonMeleeSpells(true); + DoCast(m_creature, SPELL_BERSERK); + + //don't know if he's supposed to do summon/evocate after hard enrage (probably not) + Enraged = true; + }else BerserkTimer -= diff; + + if (Evocating) { - DoScriptText(SAY_EVOCATE, m_creature); - m_creature->InterruptNonMeleeSpells(false); - DoCast(m_creature, SPELL_EVOCATION); - Evocating = true; + //not supposed to do anything while evocate + if (m_creature->HasAura(SPELL_EVOCATION)) + return; + else + Evocating = false; } - if (!Enraged && !Evocating) + if (!Enraged) { if (AddTimer < diff) { @@ -113,30 +129,40 @@ struct TRINITY_DLL_DECL boss_curatorAI : public ScriptedAI { AstralFlare->CastSpell(AstralFlare, SPELL_ASTRAL_FLARE_PASSIVE, false); AstralFlare->AI()->AttackStart(target); + AstralFlare->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true); + AstralFlare->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true); } - //Reduce Mana by 10% - int32 mana = (int32)(0.1f*(m_creature->GetMaxPower(POWER_MANA))); - m_creature->ModifyPower(POWER_MANA, -mana); - switch(rand()%4) + //Reduce Mana by 10% of max health + if (int32 mana = m_creature->GetMaxPower(POWER_MANA)) { - case 0: DoScriptText(SAY_SUMMON1, m_creature);break; - case 1: DoScriptText(SAY_SUMMON2, m_creature);break; + mana /= 10; + m_creature->ModifyPower(POWER_MANA, -mana); + + //if this get's us below 10%, then we evocate (the 10th should be summoned now) + if (m_creature->GetPower(POWER_MANA)*100 / m_creature->GetMaxPower(POWER_MANA) < 10) + { + DoScriptText(SAY_EVOCATE, m_creature); + m_creature->InterruptNonMeleeSpells(false); + DoCast(m_creature, SPELL_EVOCATION); + Evocating = true; + //no AddTimer cooldown, this will make first flare appear instantly after evocate end, like expected + return; + } + else + { + switch(rand()%4) + { + case 0: DoScriptText(SAY_SUMMON1, m_creature); break; + case 1: DoScriptText(SAY_SUMMON2, m_creature); break; + } + } } + AddTimer = 10000; }else AddTimer -= diff; - if (HatefulBoltTimer < diff) - { - Unit* target = NULL; - target = SelectUnit(SELECT_TARGET_TOPAGGRO, 1); - if(target) - DoCast(target, SPELL_HATEFUL_BOLT); - - HatefulBoltTimer = 15000; - }else HatefulBoltTimer -= diff; - - if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 15) + if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 15) { Enraged = true; DoCast(m_creature, SPELL_ENRAGE); @@ -144,11 +170,17 @@ struct TRINITY_DLL_DECL boss_curatorAI : public ScriptedAI } } - if (BerserkTimer < diff) + if (HatefulBoltTimer < diff) { - DoCast(m_creature, SPELL_BERSERK); - DoScriptText(SAY_ENRAGE, m_creature); - }else BerserkTimer -= diff; + if (Enraged) + HatefulBoltTimer = 7000; + else + HatefulBoltTimer = 15000; + + if (Unit* target = SelectUnit(SELECT_TARGET_TOPAGGRO, 1)) + DoCast(target, SPELL_HATEFUL_BOLT); + + }else HatefulBoltTimer -= diff; DoMeleeAttackIfReady(); } @@ -163,8 +195,7 @@ void AddSC_boss_curator() { Script *newscript; newscript = new Script; - newscript->Name="boss_curator"; + newscript->Name = "boss_curator"; newscript->GetAI = &GetAI_boss_curator; newscript->RegisterSelf(); } - diff --git a/src/bindings/scripts/scripts/zone/karazhan/boss_maiden_of_virtue.cpp b/src/bindings/scripts/scripts/zone/karazhan/boss_maiden_of_virtue.cpp index 230b31c69bb..69fae7d4f72 100644 --- a/src/bindings/scripts/scripts/zone/karazhan/boss_maiden_of_virtue.cpp +++ b/src/bindings/scripts/scripts/zone/karazhan/boss_maiden_of_virtue.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -51,9 +51,9 @@ struct TRINITY_DLL_DECL boss_maiden_of_virtueAI : public ScriptedAI void Reset() { - Repentance_Timer = 30000+(rand()%15000); + Repentance_Timer = 25000+(rand()%15000); Holyfire_Timer = 8000+(rand()%17000); - Holywrath_Timer = 20000+(rand()%10000); + Holywrath_Timer = 15000+(rand()%10000); Holyground_Timer = 3000; Enrage_Timer = 600000; @@ -78,7 +78,7 @@ struct TRINITY_DLL_DECL boss_maiden_of_virtueAI : public ScriptedAI DoScriptText(SAY_DEATH, m_creature); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { DoScriptText(SAY_AGGRO, m_creature); } @@ -109,7 +109,7 @@ struct TRINITY_DLL_DECL boss_maiden_of_virtueAI : public ScriptedAI case 0: DoScriptText(SAY_REPENTANCE1, m_creature);break; case 1: DoScriptText(SAY_REPENTANCE2, m_creature);break; } - Repentance_Timer = 30000 + rand()%15000; //A little randomness on that spell + Repentance_Timer = 25000 + rand()%10000; //A little randomness on that spell }else Repentance_Timer -= diff; if (Holyfire_Timer < diff) @@ -117,7 +117,7 @@ struct TRINITY_DLL_DECL boss_maiden_of_virtueAI : public ScriptedAI if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) DoCast(target,SPELL_HOLYFIRE); - Holyfire_Timer = 8000 + rand()%17000; //Anywhere from 8 to 25 seconds, good luck having several of those in a row! + Holyfire_Timer = 8000 + rand()%15000; //Anywhere from 8 to 23 seconds, good luck having several of those in a row! }else Holyfire_Timer -= diff; if (Holywrath_Timer < diff) @@ -125,7 +125,7 @@ struct TRINITY_DLL_DECL boss_maiden_of_virtueAI : public ScriptedAI if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) DoCast(target,SPELL_HOLYWRATH); - Holywrath_Timer = 20000+(rand()%10000); //20-30 secs sounds nice + Holywrath_Timer = 20000+(rand()%5000); //20-30 secs sounds nice }else Holywrath_Timer -= diff; diff --git a/src/bindings/scripts/scripts/zone/karazhan/boss_midnight.cpp b/src/bindings/scripts/scripts/zone/karazhan/boss_midnight.cpp index 8bb8a5edbcd..08df637eb04 100644 --- a/src/bindings/scripts/scripts/zone/karazhan/boss_midnight.cpp +++ b/src/bindings/scripts/scripts/zone/karazhan/boss_midnight.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -62,7 +62,7 @@ struct TRINITY_DLL_DECL boss_midnightAI : public ScriptedAI m_creature->SetVisibility(VISIBILITY_ON); } - void Aggro(Unit* who) {} + void EnterCombat(Unit* who) {} void KilledUnit(Unit *victim) { @@ -185,9 +185,12 @@ struct TRINITY_DLL_DECL boss_attumenAI : public ScriptedAI void Reset() { ResetTimer = 2000; + + m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true); + m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true); } - void Aggro(Unit* who) {} + void EnterCombat(Unit* who) {} void KilledUnit(Unit *victim) { @@ -281,8 +284,9 @@ struct TRINITY_DLL_DECL boss_attumenAI : public ScriptedAI Creature *pMidnight = Unit::GetCreature(*m_creature, Midnight); if(pMidnight && pMidnight->GetTypeId() == TYPEID_UNIT) { - ((boss_midnightAI*)(pMidnight->AI()))->Mount(m_creature); + CAST_AI(boss_midnightAI, (pMidnight->AI()))->Mount(m_creature); m_creature->SetHealth(pMidnight->GetHealth()); + DoResetThreat(); } } } @@ -299,7 +303,7 @@ struct TRINITY_DLL_DECL boss_attumenAI : public ScriptedAI void boss_midnightAI::SetMidnight(Creature *pAttumen, uint64 value) { - ((boss_attumenAI*)pAttumen->AI())->Midnight = value; + CAST_AI(boss_attumenAI, pAttumen->AI())->Midnight = value; } CreatureAI* GetAI_boss_attumen(Creature *_Creature) diff --git a/src/bindings/scripts/scripts/zone/karazhan/boss_moroes.cpp b/src/bindings/scripts/scripts/zone/karazhan/boss_moroes.cpp index dbf8a3427df..9a8b0bf27b6 100644 --- a/src/bindings/scripts/scripts/zone/karazhan/boss_moroes.cpp +++ b/src/bindings/scripts/scripts/zone/karazhan/boss_moroes.cpp @@ -66,7 +66,7 @@ struct TRINITY_DLL_DECL boss_moroesAI : public ScriptedAI { AddId[i] = 0; } - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } ScriptedInstance *pInstance; @@ -110,7 +110,7 @@ struct TRINITY_DLL_DECL boss_moroesAI : public ScriptedAI DoZoneInCombat(); } - void Aggro(Unit* who) + void EnterCombat(Unit* who) { StartEvent(); @@ -295,11 +295,15 @@ struct TRINITY_DLL_DECL boss_moroesAI : public ScriptedAI if (Blind_Timer < diff) { - Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0, 5, true); - if (target && m_creature->IsWithinMeleeRange(target)) + Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (target && target->GetTypeId() == TYPEID_PLAYER && m_creature->IsWithinMeleeRange(target)) + { DoCast(target, SPELL_BLIND); - Blind_Timer = 40000; + Blind_Timer = 40000; + } + else + Blind_Timer = 1000; }else Blind_Timer -= diff; } @@ -336,7 +340,7 @@ struct TRINITY_DLL_DECL boss_moroes_guestAI : public ScriptedAI for(uint8 i = 0; i < 4; ++i) GuestGUID[i] = 0; - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } void Reset() @@ -345,8 +349,6 @@ struct TRINITY_DLL_DECL boss_moroes_guestAI : public ScriptedAI pInstance->SetData(DATA_MOROES_EVENT, NOT_STARTED); } - void Aggro(Unit* who) {} - void AcquireGUID() { if(!pInstance) @@ -358,7 +360,7 @@ struct TRINITY_DLL_DECL boss_moroes_guestAI : public ScriptedAI { for(uint8 i = 0; i < 3; ++i) { - uint64 GUID = ((boss_moroesAI*)Moroes->AI())->AddGUID[i]; + uint64 GUID = CAST_AI(boss_moroesAI, Moroes->AI())->AddGUID[i]; if(GUID && GUID != m_creature->GetGUID()) GuestGUID[i+1] = GUID; } diff --git a/src/bindings/scripts/scripts/zone/karazhan/boss_netherspite.cpp b/src/bindings/scripts/scripts/zone/karazhan/boss_netherspite.cpp index b074dc920c1..6db1b193234 100644 --- a/src/bindings/scripts/scripts/zone/karazhan/boss_netherspite.cpp +++ b/src/bindings/scripts/scripts/zone/karazhan/boss_netherspite.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 diff --git a/src/bindings/scripts/scripts/zone/karazhan/boss_nightbane.cpp b/src/bindings/scripts/scripts/zone/karazhan/boss_nightbane.cpp index e738466652b..12c7c3fa2ad 100644 --- a/src/bindings/scripts/scripts/zone/karazhan/boss_nightbane.cpp +++ b/src/bindings/scripts/scripts/zone/karazhan/boss_nightbane.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -60,7 +60,7 @@ struct TRINITY_DLL_DECL boss_nightbaneAI : public ScriptedAI { boss_nightbaneAI(Creature* c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); Intro = true; } @@ -109,7 +109,7 @@ struct TRINITY_DLL_DECL boss_nightbaneAI : public ScriptedAI MovePhase = 0; m_creature->SetSpeed(MOVE_RUN, 2.0f); - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT + MOVEMENTFLAG_LEVITATING); + m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); m_creature->setActive(true); @@ -139,12 +139,12 @@ struct TRINITY_DLL_DECL boss_nightbaneAI : public ScriptedAI void HandleTerraceDoors(bool open) { if(GameObject *Door = GameObject::GetGameObject((*m_creature),pInstance->GetData64(DATA_MASTERS_TERRACE_DOOR_1))) - Door->SetUInt32Value(GAMEOBJECT_STATE, open ? 0 : 1); + Door->SetGoState(open ? GO_STATE_ACTIVE : GO_STATE_READY); if(GameObject *Door = GameObject::GetGameObject((*m_creature),pInstance->GetData64(DATA_MASTERS_TERRACE_DOOR_2))) - Door->SetUInt32Value(GAMEOBJECT_STATE, open ? 0 : 1); + Door->SetGoState(open ? GO_STATE_ACTIVE : GO_STATE_READY); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { if(pInstance) pInstance->SetData(DATA_NIGHTBANE_EVENT, IN_PROGRESS); @@ -233,7 +233,7 @@ struct TRINITY_DLL_DECL boss_nightbaneAI : public ScriptedAI m_creature->InterruptSpell(CURRENT_GENERIC_SPELL); m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF); - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT + MOVEMENTFLAG_LEVITATING); + m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); (*m_creature).GetMotionMaster()->Clear(false); (*m_creature).GetMotionMaster()->MovePoint(0,IntroWay[2][0],IntroWay[2][1],IntroWay[2][2]); @@ -256,7 +256,7 @@ struct TRINITY_DLL_DECL boss_nightbaneAI : public ScriptedAI { if(MovePhase >= 7) { - m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT + MOVEMENTFLAG_LEVITATING); + m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LAND); m_creature->GetMotionMaster()->MovePoint(8,IntroWay[7][0],IntroWay[7][1],IntroWay[7][2]); } @@ -271,7 +271,7 @@ struct TRINITY_DLL_DECL boss_nightbaneAI : public ScriptedAI { if(MovePhase >= 7) { - m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT + MOVEMENTFLAG_LEVITATING); + m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LAND); m_creature->GetMotionMaster()->MovePoint(8,IntroWay[7][0],IntroWay[7][1],IntroWay[7][2]); } diff --git a/src/bindings/scripts/scripts/zone/karazhan/boss_prince_malchezaar.cpp b/src/bindings/scripts/scripts/zone/karazhan/boss_prince_malchezaar.cpp index 3de8e352ded..66005746bbd 100644 --- a/src/bindings/scripts/scripts/zone/karazhan/boss_prince_malchezaar.cpp +++ b/src/bindings/scripts/scripts/zone/karazhan/boss_prince_malchezaar.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -37,7 +37,7 @@ EndScriptData */ #define SAY_SUMMON2 -1532101 #define SAY_DEATH -1532102 -// 19 Coordinates for Infernal spawns +// 18 Coordinates for Infernal spawns struct InfernalPoint { float x,y; @@ -64,35 +64,34 @@ static InfernalPoint InfernalPoints[] = {-10948.8, -2005.1}, {-10984.0, -2019.3}, {-10932.8, -1979.6}, - {-10932.8, -1979.6}, {-10935.7, -1996.0} }; -#define TOTAL_INFERNAL_POINTS 19 +#define TOTAL_INFERNAL_POINTS 18 //Enfeeble is supposed to reduce hp to 1 and then heal player back to full when it ends //Along with reducing healing and regen while enfeebled to 0% //This spell effect will only reduce healing -#define SPELL_ENFEEBLE 30843 //Enfeeble during phase 1 and 2 -#define SPELL_ENFEEBLE_EFFECT 41624 +#define SPELL_ENFEEBLE 30843 //Enfeeble during phase 1 and 2 +#define SPELL_ENFEEBLE_EFFECT 41624 -#define SPELL_SHADOWNOVA 30852 //Shadownova used during all phases -#define SPELL_SW_PAIN 30854 //Shadow word pain during phase 1 and 3 (different targeting rules though) -#define SPELL_THRASH_PASSIVE 12787 //Extra attack chance during phase 2 -#define SPELL_SUNDER_ARMOR 30901 //Sunder armor during phase 2 -#define SPELL_THRASH_AURA 3417 //Passive proc chance for thrash -#define SPELL_EQUIP_AXES 30857 //Visual for axe equiping -#define SPELL_AMPLIFY_DAMAGE 12738 //Amplifiy during phase 3 -#define SPELL_HELLFIRE 30859 //Infenals' hellfire aura -#define NETHERSPITE_INFERNAL 17646 //The netherspite infernal creature -#define MALCHEZARS_AXE 17650 //Malchezar's axes (creatures), summoned during phase 3 +#define SPELL_SHADOWNOVA 30852 //Shadownova used during all phases +#define SPELL_SW_PAIN 30854 //Shadow word pain during phase 1 and 3 (different targeting rules though) +#define SPELL_THRASH_PASSIVE 12787 //Extra attack chance during phase 2 +#define SPELL_SUNDER_ARMOR 30901 //Sunder armor during phase 2 +#define SPELL_THRASH_AURA 12787 //Passive proc chance for thrash +#define SPELL_EQUIP_AXES 30857 //Visual for axe equiping +#define SPELL_AMPLIFY_DAMAGE 39095 //Amplifiy during phase 3 +#define SPELL_CLEAVE 30131 //Same as Nightbane. +#define SPELL_HELLFIRE 30859 //Infenals' hellfire aura +#define NETHERSPITE_INFERNAL 17646 //The netherspite infernal creature +#define MALCHEZARS_AXE 17650 //Malchezar's axes (creatures), summoned during phase 3 -#define INFERNAL_MODEL_INVISIBLE 11686 //Infernal Effects -#define SPELL_INFERNAL_RELAY 30834 +#define INFERNAL_MODEL_INVISIBLE 11686 //Infernal Effects +#define SPELL_INFERNAL_RELAY 30834 -#define AXE_EQUIP_MODEL 40066 //Axes info -#define AXE_EQUIP_INFO 33448898 +#define EQUIP_ID_AXE 33542 //Axes info //---------Infernal code first struct TRINITY_DLL_DECL netherspite_infernalAI : public ScriptedAI @@ -106,7 +105,7 @@ struct TRINITY_DLL_DECL netherspite_infernalAI : public ScriptedAI InfernalPoint *point; void Reset() {} - void Aggro(Unit *who) {} + void EnterCombat(Unit *who) {} void MoveInLineOfSight(Unit *who) {} void UpdateAI(const uint32 diff) @@ -131,7 +130,7 @@ struct TRINITY_DLL_DECL netherspite_infernalAI : public ScriptedAI { Unit *pMalchezaar = Unit::GetUnit(*m_creature, malchezaar); if(pMalchezaar) - ((Creature*)pMalchezaar)->AI()->KilledUnit(who); + CAST_CRE(pMalchezaar)->AI()->KilledUnit(who); } void SpellHit(Unit *who, const SpellEntry *spell) @@ -158,7 +157,7 @@ struct TRINITY_DLL_DECL boss_malchezaarAI : public ScriptedAI { boss_malchezaarAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } ScriptedInstance *pInstance; @@ -168,6 +167,7 @@ struct TRINITY_DLL_DECL boss_malchezaarAI : public ScriptedAI uint32 SWPainTimer; uint32 SunderArmorTimer; uint32 AmplifyDamageTimer; + uint32 Cleave_Timer; uint32 InfernalTimer; uint32 AxesTargetSwitchTimer; uint32 InfernalCleanupTimer; @@ -196,12 +196,14 @@ struct TRINITY_DLL_DECL boss_malchezaarAI : public ScriptedAI EnfeebleTimer = 30000; EnfeebleResetTimer = 38000; - ShadowNovaTimer = 35000; + ShadowNovaTimer = 35500; SWPainTimer = 20000; - AmplifyDamageTimer = 10000; + AmplifyDamageTimer = 5000; + Cleave_Timer = 8000; InfernalTimer = 45000; InfernalCleanupTimer = 47000; AxesTargetSwitchTimer = 7500 + rand()%12500; + SunderArmorTimer = 5000 + rand()%5000; phase = 1; if(pInstance) @@ -209,7 +211,7 @@ struct TRINITY_DLL_DECL boss_malchezaarAI : public ScriptedAI GameObject* Door = GameObject::GetGameObject((*m_creature),pInstance->GetData64(DATA_GAMEOBJECT_NETHER_DOOR)); if(Door) { - Door->SetGoState(0); + Door->SetGoState(GO_STATE_ACTIVE); } } } @@ -241,12 +243,12 @@ struct TRINITY_DLL_DECL boss_malchezaarAI : public ScriptedAI GameObject* Door = GameObject::GetGameObject((*m_creature),pInstance->GetData64(DATA_GAMEOBJECT_NETHER_DOOR)); if(Door) { - Door->SetGoState(0); + Door->SetGoState(GO_STATE_ACTIVE); } } } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { DoScriptText(SAY_AGGRO, m_creature); @@ -255,7 +257,7 @@ struct TRINITY_DLL_DECL boss_malchezaarAI : public ScriptedAI GameObject* Door = GameObject::GetGameObject((*m_creature),pInstance->GetData64(DATA_GAMEOBJECT_NETHER_DOOR)); if(Door) { - Door->SetGoState(1); + Door->SetGoState(GO_STATE_READY); } } } @@ -288,11 +290,7 @@ struct TRINITY_DLL_DECL boss_malchezaarAI : public ScriptedAI void ClearWeapons() { - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, 0); - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO, 0); - - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY+1, 0); - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+2, 0); + SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_UNEQUIP, EQUIP_NO_CHANGE); //damage const CreatureInfo *cinfo = m_creature->GetCreatureInfo(); @@ -382,8 +380,8 @@ struct TRINITY_DLL_DECL boss_malchezaarAI : public ScriptedAI Infernal->SetUInt32Value(UNIT_FIELD_DISPLAYID, INFERNAL_MODEL_INVISIBLE); Infernal->setFaction(m_creature->getFaction()); if(point) - ((netherspite_infernalAI*)Infernal->AI())->point=point; - ((netherspite_infernalAI*)Infernal->AI())->malchezaar=m_creature->GetGUID(); + CAST_AI(netherspite_infernalAI, Infernal->AI())->point=point; + CAST_AI(netherspite_infernalAI, Infernal->AI())->malchezaar=m_creature->GetGUID(); infernals.push_back(Infernal->GetGUID()); DoCast(Infernal, SPELL_INFERNAL_RELAY); @@ -432,11 +430,7 @@ struct TRINITY_DLL_DECL boss_malchezaarAI : public ScriptedAI m_creature->CastSpell(m_creature, SPELL_THRASH_AURA, true); //models - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, AXE_EQUIP_MODEL); - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO, AXE_EQUIP_INFO); - - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY+1, AXE_EQUIP_MODEL); - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+2, AXE_EQUIP_INFO); + SetEquipmentSlots(false, EQUIP_ID_AXE, EQUIP_ID_AXE, EQUIP_NO_CHANGE); //damage const CreatureInfo *cinfo = m_creature->GetCreatureInfo(); @@ -474,9 +468,6 @@ struct TRINITY_DLL_DECL boss_malchezaarAI : public ScriptedAI Creature *axe = m_creature->SummonCreature(MALCHEZARS_AXE, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000); if(axe) { - axe->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, AXE_EQUIP_MODEL); - axe->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO, AXE_EQUIP_INFO); - axe->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); axe->setFaction(m_creature->getFaction()); axes[i] = axe->GetGUID(); @@ -499,9 +490,16 @@ struct TRINITY_DLL_DECL boss_malchezaarAI : public ScriptedAI if(SunderArmorTimer < diff) { DoCast(m_creature->getVictim(), SPELL_SUNDER_ARMOR); - SunderArmorTimer = 15000; + SunderArmorTimer = 10000 + rand()%8000; }else SunderArmorTimer -= diff; + + if (Cleave_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_CLEAVE); + Cleave_Timer = 6000 + rand()%6000; + + }else Cleave_Timer -= diff; } else { @@ -543,13 +541,13 @@ struct TRINITY_DLL_DECL boss_malchezaarAI : public ScriptedAI if(InfernalTimer < diff) { SummonInfernal(diff); - InfernalTimer = phase == 3 ? 15000 : 45000; //15 secs in phase 3, 45 otherwise + InfernalTimer = phase == 3 ? 14500 : 44500; //15 secs in phase 3, 45 otherwise }else InfernalTimer -= diff; if(ShadowNovaTimer < diff) { DoCast(m_creature->getVictim(), SPELL_SHADOWNOVA); - ShadowNovaTimer = phase == 3 ? 35000 : -1; + ShadowNovaTimer = phase == 3 ? 31000 : -1; }else ShadowNovaTimer -= diff; if(phase != 2) @@ -623,7 +621,7 @@ void netherspite_infernalAI::Cleanup() Unit *pMalchezaar = Unit::GetUnit(*m_creature, malchezaar); if(pMalchezaar && pMalchezaar->isAlive()) - ((boss_malchezaarAI*)((Creature*)pMalchezaar)->AI())->Cleanup(m_creature, point); + CAST_AI(boss_malchezaarAI, CAST_CRE(pMalchezaar)->AI())->Cleanup(m_creature, point); } CreatureAI* GetAI_netherspite_infernal(Creature *_Creature) diff --git a/src/bindings/scripts/scripts/zone/karazhan/boss_shade_of_aran.cpp b/src/bindings/scripts/scripts/zone/karazhan/boss_shade_of_aran.cpp index 02480d14d66..015a19087ab 100644 --- a/src/bindings/scripts/scripts/zone/karazhan/boss_shade_of_aran.cpp +++ b/src/bindings/scripts/scripts/zone/karazhan/boss_shade_of_aran.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -83,7 +83,7 @@ struct TRINITY_DLL_DECL boss_aranAI : public ScriptedAI { boss_aranAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } ScriptedInstance* pInstance; @@ -143,7 +143,7 @@ struct TRINITY_DLL_DECL boss_aranAI : public ScriptedAI pInstance->SetData(DATA_SHADEOFARAN_EVENT, NOT_STARTED); if(GameObject* Door = GameObject::GetGameObject(*m_creature, pInstance->GetData64(DATA_GAMEOBJECT_LIBRARY_DOOR))) - Door->SetGoState(0); + Door->SetGoState(GO_STATE_ACTIVE); } } @@ -165,11 +165,11 @@ struct TRINITY_DLL_DECL boss_aranAI : public ScriptedAI pInstance->SetData(DATA_SHADEOFARAN_EVENT, DONE); if(GameObject* Door = GameObject::GetGameObject(*m_creature, pInstance->GetData64(DATA_GAMEOBJECT_LIBRARY_DOOR))) - Door->SetGoState(0); + Door->SetGoState(GO_STATE_ACTIVE); } } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { switch(rand()%3) { @@ -182,7 +182,7 @@ struct TRINITY_DLL_DECL boss_aranAI : public ScriptedAI { pInstance->SetData(DATA_SHADEOFARAN_EVENT, IN_PROGRESS); if(GameObject* Door = GameObject::GetGameObject(*m_creature, pInstance->GetData64(DATA_GAMEOBJECT_LIBRARY_DOOR))) - Door->SetGoState(1); + Door->SetGoState(GO_STATE_READY); } } @@ -233,7 +233,7 @@ struct TRINITY_DLL_DECL boss_aranAI : public ScriptedAI if(pInstance) { if(GameObject* Door = GameObject::GetGameObject(*m_creature, pInstance->GetData64(DATA_GAMEOBJECT_LIBRARY_DOOR))) - Door->SetGoState(1); + Door->SetGoState(GO_STATE_READY); CloseDoorTimer = 0; } }else CloseDoorTimer -= diff; @@ -273,8 +273,7 @@ struct TRINITY_DLL_DECL boss_aranAI : public ScriptedAI m_creature->CastSpell(m_creature, SPELL_MASS_POLY, true); m_creature->CastSpell(m_creature, SPELL_CONJURE, false); m_creature->CastSpell(m_creature, SPELL_DRINK, false); - //Sitting down - m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 1); + m_creature->SetStandState(UNIT_STAND_STATE_SIT); DrinkInturruptTimer = 10000; } } @@ -284,7 +283,7 @@ struct TRINITY_DLL_DECL boss_aranAI : public ScriptedAI { Drinking = false; m_creature->RemoveAurasDueToSpell(SPELL_DRINK); - m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); + m_creature->SetStandState(UNIT_STAND_STATE_STAND); m_creature->SetPower(POWER_MANA, m_creature->GetMaxPower(POWER_MANA)-32000); m_creature->CastSpell(m_creature, SPELL_POTION, false); } @@ -295,7 +294,7 @@ struct TRINITY_DLL_DECL boss_aranAI : public ScriptedAI DrinkInturruptTimer -= diff; else { - m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); + m_creature->SetStandState(UNIT_STAND_STATE_STAND); m_creature->CastSpell(m_creature, SPELL_POTION, true); m_creature->CastSpell(m_creature, SPELL_AOE_PYROBLAST, false); DrinkInturrupted = true; @@ -539,7 +538,7 @@ struct TRINITY_DLL_DECL water_elementalAI : public ScriptedAI CastTimer = 2000 + (rand()%3000); } - void Aggro(Unit* who) {} + void EnterCombat(Unit* who) {} void UpdateAI(const uint32 diff) { diff --git a/src/bindings/scripts/scripts/zone/karazhan/boss_terestian_illhoof.cpp b/src/bindings/scripts/scripts/zone/karazhan/boss_terestian_illhoof.cpp index a7860bb9fb4..24981a903c4 100644 --- a/src/bindings/scripts/scripts/zone/karazhan/boss_terestian_illhoof.cpp +++ b/src/bindings/scripts/scripts/zone/karazhan/boss_terestian_illhoof.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -45,9 +45,9 @@ EndScriptData */ #define SPELL_FIENDISH_PORTAL 30171 // Opens portal and summons Fiendish Portal, 2 sec cast #define SPELL_FIENDISH_PORTAL_1 30179 // Opens portal and summons Fiendish Portal, instant cast +#define SPELL_FIREBOLT 30050 // Blasts a target for 150 Fire damage. #define SPELL_BROKEN_PACT 30065 // All damage taken increased by 25%. #define SPELL_AMPLIFY_FLAMES 30053 // Increases the Fire damage taken by an enemy by 500 for 25 sec. -#define SPELL_FIREBOLT 18086 // Blasts a target for 150 Fire damage. #define CREATURE_DEMONCHAINS 17248 #define CREATURE_FIENDISHIMP 17267 @@ -65,7 +65,7 @@ struct TRINITY_DLL_DECL mob_kilrekAI : public ScriptedAI { mob_kilrekAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } ScriptedInstance* pInstance; @@ -77,11 +77,10 @@ struct TRINITY_DLL_DECL mob_kilrekAI : public ScriptedAI void Reset() { TerestianGUID = 0; - - AmplifyTimer = 0; + AmplifyTimer = 2000; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { if(!pInstance) { @@ -119,13 +118,10 @@ struct TRINITY_DLL_DECL mob_kilrekAI : public ScriptedAI m_creature->InterruptNonMeleeSpells(false); DoCast(m_creature->getVictim(),SPELL_AMPLIFY_FLAMES); - AmplifyTimer = 20000; + AmplifyTimer = 10000 + rand()%10000; }else AmplifyTimer -= diff; - //Chain cast - if (!m_creature->IsNonMeleeSpellCasted(false) && m_creature->IsWithinDistInMap(m_creature->getVictim(), 30)) - DoCast(m_creature->getVictim(),SPELL_FIREBOLT); - else DoMeleeAttackIfReady(); + DoMeleeAttackIfReady(); } }; @@ -140,7 +136,7 @@ struct TRINITY_DLL_DECL mob_demon_chainAI : public ScriptedAI SacrificeGUID = 0; } - void Aggro(Unit* who) {} + void EnterCombat(Unit* who) {} void AttackStart(Unit* who) {} void MoveInLineOfSight(Unit* who) {} @@ -159,7 +155,9 @@ struct TRINITY_DLL_DECL boss_terestianAI : public ScriptedAI { boss_terestianAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + for(uint8 i = 0; i < 2; ++i) + PortalGUID[i] = 0; + pInstance = (c->GetInstanceData()); } ScriptedInstance *pInstance; @@ -173,6 +171,7 @@ struct TRINITY_DLL_DECL boss_terestianAI : public ScriptedAI uint32 SummonTimer; uint32 BerserkTimer; + bool ReSummon; bool SummonKilrek; bool SummonedPortals; bool Berserk; @@ -199,19 +198,26 @@ struct TRINITY_DLL_DECL boss_terestianAI : public ScriptedAI SummonedPortals = false; Berserk = false; + ReSummon = false; if(pInstance) pInstance->SetData(DATA_TERESTIAN_EVENT, NOT_STARTED); } - void Aggro(Unit* who) + void EnterCombat(Unit* who) { DoScriptText(SAY_AGGRO, m_creature); if(pInstance) { - // Put Kil'rek in combat against our target so players don't skip him Creature* Kilrek = (Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_KILREK))); + // Respawn Kil'rek on aggro if Kil'rek is dead. + if (Kilrek && !Kilrek->isAlive()) + { + Kilrek->Respawn(); + } + + // Put Kil'rek in combat against our target so players don't skip him if(Kilrek && !Kilrek->getVictim()) Kilrek->AddThreat(who, 1.0f); @@ -255,18 +261,22 @@ struct TRINITY_DLL_DECL boss_terestianAI : public ScriptedAI if(CheckKilrekTimer < diff) { + CheckKilrekTimer = 5000; if(pInstance) uint64 KilrekGUID = pInstance->GetData64(DATA_KILREK); else ERROR_INST_DATA(m_creature); - Creature* Kilrek = (Unit::GetCreature((*m_creature), KilrekGUID)); + Creature* Kilrek = (Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_KILREK))); if(SummonKilrek && Kilrek) { Kilrek->Respawn(); if(Kilrek->AI()) + { Kilrek->AI()->AttackStart(m_creature->getVictim()); + m_creature->RemoveAurasDueToSpell(SPELL_BROKEN_PACT); + } SummonKilrek = false; } @@ -287,7 +297,7 @@ struct TRINITY_DLL_DECL boss_terestianAI : public ScriptedAI Creature* Chains = m_creature->SummonCreature(CREATURE_DEMONCHAINS, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 21000); if(Chains) { - ((mob_demon_chainAI*)Chains->AI())->SacrificeGUID = target->GetGUID(); + CAST_AI(mob_demon_chainAI, Chains->AI())->SacrificeGUID = target->GetGUID(); Chains->CastSpell(Chains, SPELL_DEMON_CHAINS, true); switch(rand()%2) { @@ -355,10 +365,12 @@ struct TRINITY_DLL_DECL mob_fiendish_impAI : public ScriptedAI void Reset() { - FireboltTimer = 3000; + FireboltTimer = 2000; + + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true); } - void Aggro(Unit *who) {} + void EnterCombat(Unit *who) {} void UpdateAI(const uint32 diff) { @@ -369,7 +381,7 @@ struct TRINITY_DLL_DECL mob_fiendish_impAI : public ScriptedAI if(FireboltTimer < diff) { DoCast(m_creature->getVictim(), SPELL_FIREBOLT); - FireboltTimer = 1500; + FireboltTimer = 2200; }else FireboltTimer -= diff; DoMeleeAttackIfReady(); diff --git a/src/bindings/scripts/scripts/zone/karazhan/bosses_opera.cpp b/src/bindings/scripts/scripts/zone/karazhan/bosses_opera.cpp index cd404e2ff15..5ae57e95614 100644 --- a/src/bindings/scripts/scripts/zone/karazhan/bosses_opera.cpp +++ b/src/bindings/scripts/scripts/zone/karazhan/bosses_opera.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>.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 @@ -91,7 +91,7 @@ void SummonCroneIfReady(ScriptedInstance* pInstance, Creature *_Creature) pInstance->SetData(DATA_OPERA_OZ_DEATHCOUNT, 0); // Increment DeathCount if(pInstance->GetData(DATA_OPERA_OZ_DEATHCOUNT) == 4) { - Creature* Crone = _Creature->SummonCreature(CREATURE_CRONE, -10891.96, -1755.95, _Creature->GetPositionZ(), 4.64, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 30000); + Creature* Crone = _Creature->SummonCreature(CREATURE_CRONE, -10891.96, -1755.95, _Creature->GetPositionZ(), 4.64, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); if(Crone) { if(_Creature->getVictim()) @@ -104,7 +104,7 @@ struct TRINITY_DLL_DECL boss_dorotheeAI : public ScriptedAI { boss_dorotheeAI(Creature* c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } ScriptedInstance* pInstance; @@ -117,7 +117,6 @@ struct TRINITY_DLL_DECL boss_dorotheeAI : public ScriptedAI bool SummonedTito; bool TitoDied; - bool InCombat; void Reset() { @@ -129,10 +128,9 @@ struct TRINITY_DLL_DECL boss_dorotheeAI : public ScriptedAI SummonedTito = false; TitoDied = false; - InCombat = false; } - void Aggro(Unit* who) + void EnterCombat(Unit* who) { DoScriptText(SAY_DOROTHEE_AGGRO, m_creature); } @@ -205,17 +203,15 @@ struct TRINITY_DLL_DECL mob_titoAI : public ScriptedAI mob_titoAI(Creature* c) : ScriptedAI(c) {} uint64 DorotheeGUID; - uint32 YipTimer; void Reset() { DorotheeGUID = 0; - YipTimer = 10000; } - void Aggro(Unit* who) {} + void EnterCombat(Unit* who) {} void JustDied(Unit* killer) { @@ -224,7 +220,7 @@ struct TRINITY_DLL_DECL mob_titoAI : public ScriptedAI Creature* Dorothee = (Unit::GetCreature((*m_creature), DorotheeGUID)); if(Dorothee && Dorothee->isAlive()) { - ((boss_dorotheeAI*)Dorothee->AI())->TitoDied = true; + CAST_AI(boss_dorotheeAI, Dorothee->AI())->TitoDied = true; DoScriptText(SAY_DOROTHEE_TITO_DEATH, Dorothee); } } @@ -247,11 +243,11 @@ struct TRINITY_DLL_DECL mob_titoAI : public ScriptedAI void boss_dorotheeAI::SummonTito() { - Creature* Tito = DoSpawnCreature(CREATURE_TITO, 0, 0, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45000); + Creature* Tito = DoSpawnCreature(CREATURE_TITO, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); if(Tito) { DoScriptText(SAY_DOROTHEE_SUMMON, m_creature); - ((mob_titoAI*)Tito->AI())->DorotheeGUID = m_creature->GetGUID(); + CAST_AI(mob_titoAI, Tito->AI())->DorotheeGUID = m_creature->GetGUID(); Tito->AI()->AttackStart(m_creature->getVictim()); SummonedTito = true; TitoDied = false; @@ -262,7 +258,7 @@ struct TRINITY_DLL_DECL boss_strawmanAI : public ScriptedAI { boss_strawmanAI(Creature* c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } ScriptedInstance* pInstance; @@ -294,15 +290,22 @@ struct TRINITY_DLL_DECL boss_strawmanAI : public ScriptedAI ScriptedAI::MoveInLineOfSight(who); } - void Aggro(Unit* who) + void EnterCombat(Unit* who) { DoScriptText(SAY_STRAWMAN_AGGRO, m_creature); } void SpellHit(Unit* caster, const SpellEntry *Spell) { - if((Spell->SchoolMask == SPELL_SCHOOL_MASK_FIRE) && (!(rand()%10))) + if ((Spell->SchoolMask == SPELL_SCHOOL_MASK_FIRE) && (!(rand()%10))) + { + /* + if (not direct damage(aoe,dot)) + return; + */ + DoCast(m_creature, SPELL_BURNING_STRAW, true); + } } void JustDied(Unit* killer) @@ -352,7 +355,7 @@ struct TRINITY_DLL_DECL boss_tinheadAI : public ScriptedAI { boss_tinheadAI(Creature* c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } ScriptedInstance* pInstance; @@ -372,7 +375,7 @@ struct TRINITY_DLL_DECL boss_tinheadAI : public ScriptedAI RustCount = 0; } - void Aggro(Unit* who) + void EnterCombat(Unit* who) { DoScriptText(SAY_TINHEAD_AGGRO, m_creature); } @@ -445,7 +448,7 @@ struct TRINITY_DLL_DECL boss_roarAI : public ScriptedAI { boss_roarAI(Creature* c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } ScriptedInstance* pInstance; @@ -479,7 +482,7 @@ struct TRINITY_DLL_DECL boss_roarAI : public ScriptedAI ScriptedAI::AttackStart(who); } - void Aggro(Unit* who) + void EnterCombat(Unit* who) { DoScriptText(SAY_ROAR_AGGRO, m_creature); } @@ -537,7 +540,7 @@ struct TRINITY_DLL_DECL boss_croneAI : public ScriptedAI { boss_croneAI(Creature* c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } ScriptedInstance* pInstance; @@ -551,7 +554,7 @@ struct TRINITY_DLL_DECL boss_croneAI : public ScriptedAI ChainLightningTimer = 10000; } - void Aggro(Unit* who) + void EnterCombat(Unit* who) { switch(rand()%2) { @@ -569,9 +572,13 @@ struct TRINITY_DLL_DECL boss_croneAI : public ScriptedAI if(pInstance) { pInstance->SetData(DATA_OPERA_EVENT, DONE); - GameObject* Door = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GAMEOBJECT_STAGEDOORRIGHT)); - if(Door) - Door->UseDoorOrButton(); + + if (GameObject* lDoor = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GAMEOBJECT_STAGEDOORLEFT))) + lDoor->SetGoState(GO_STATE_ACTIVE); + if (GameObject* rDoor = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GAMEOBJECT_STAGEDOORRIGHT))) + rDoor->SetGoState(GO_STATE_ACTIVE); + if (GameObject* pSideEntrance = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GO_SIDE_ENTRANCE_DOOR))) + pSideEntrance->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED); } } @@ -612,7 +619,7 @@ struct TRINITY_DLL_DECL mob_cycloneAI : public ScriptedAI MoveTimer = 1000; } - void Aggro(Unit* who) {} + void EnterCombat(Unit* who) {} void MoveInLineOfSight(Unit* who) { @@ -620,7 +627,7 @@ struct TRINITY_DLL_DECL mob_cycloneAI : public ScriptedAI void UpdateAI(const uint32 diff) { - if(!m_creature->HasAura(SPELL_KNOCKBACK, 0)) + if(!m_creature->HasAura(SPELL_KNOCKBACK)) DoCast(m_creature, SPELL_KNOCKBACK, true); if(MoveTimer < diff) @@ -705,7 +712,7 @@ bool GossipSelect_npc_grandmother(Player* player, Creature* _Creature, uint32 se _Creature->SetVisibility(VISIBILITY_OFF); float x,y,z; _Creature->GetPosition(x,y,z); - Creature* BigBadWolf = _Creature->SummonCreature(CREATURE_BIG_BAD_WOLF, x, y, z, 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 30000); + Creature* BigBadWolf = _Creature->SummonCreature(CREATURE_BIG_BAD_WOLF, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); if(BigBadWolf) { BigBadWolf->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); @@ -722,7 +729,7 @@ struct TRINITY_DLL_DECL boss_bigbadwolfAI : public ScriptedAI { boss_bigbadwolfAI(Creature* c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } ScriptedInstance* pInstance; @@ -748,7 +755,7 @@ struct TRINITY_DLL_DECL boss_bigbadwolfAI : public ScriptedAI IsChasing = false; } - void Aggro(Unit* who) + void EnterCombat(Unit* who) { DoScriptText(SAY_WOLF_AGGRO, m_creature); } @@ -760,9 +767,13 @@ struct TRINITY_DLL_DECL boss_bigbadwolfAI : public ScriptedAI if(pInstance) { pInstance->SetData(DATA_OPERA_EVENT, DONE); - GameObject* Door = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GAMEOBJECT_STAGEDOORRIGHT)); - if(Door) - Door->UseDoorOrButton(); + + if (GameObject* lDoor = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GAMEOBJECT_STAGEDOORLEFT))) + lDoor->SetGoState(GO_STATE_ACTIVE); + if (GameObject* rDoor = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GAMEOBJECT_STAGEDOORRIGHT))) + rDoor->SetGoState(GO_STATE_ACTIVE); + if (GameObject* pSideEntrance = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GO_SIDE_ENTRANCE_DOOR))) + pSideEntrance->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED); } } @@ -795,8 +806,8 @@ struct TRINITY_DLL_DECL boss_bigbadwolfAI : public ScriptedAI else { IsChasing = false; - Unit* target = Unit::GetUnit((*m_creature), HoodGUID); - if(target) + + if (Unit* target = Unit::GetUnit((*m_creature), HoodGUID)) { HoodGUID = 0; if(DoGetThreat(target)) @@ -868,9 +879,9 @@ CreatureAI* GetAI_boss_bigbadwolf(Creature* _Creature) #define SPELL_RES_VISUAL 24171 /*** Misc. Information ****/ -#define CREATURE_ROMULO 17533 -#define ROMULO_X -10900 -#define ROMULO_Y -1758 +#define CREATURE_ROMULO 17533 +#define ROMULO_X -10900 +#define ROMULO_Y -1758 enum RAJPhase { @@ -881,57 +892,56 @@ enum RAJPhase void PretendToDie(Creature* _Creature) { - _Creature->InterruptNonMeleeSpells(false); + _Creature->InterruptNonMeleeSpells(true); + _Creature->RemoveAllAuras(); _Creature->SetHealth(0); - _Creature->ClearComboPointHolders(); - _Creature->RemoveAllAurasOnDeath(); - _Creature->ModifyAuraState(AURA_STATE_HEALTHLESS_20_PERCENT, false); - _Creature->ModifyAuraState(AURA_STATE_HEALTHLESS_35_PERCENT, false); _Creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - _Creature->ClearAllReactives(); - _Creature->SetUInt64Value(UNIT_FIELD_TARGET,0); - _Creature->GetMotionMaster()->Clear(); + _Creature->GetMotionMaster()->MovementExpired(false); _Creature->GetMotionMaster()->MoveIdle(); - _Creature->SetUInt32Value(UNIT_FIELD_BYTES_1,PLAYER_STATE_DEAD); + _Creature->SetStandState(UNIT_STAND_STATE_DEAD); }; void Resurrect(Creature* target) { target->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); target->SetHealth(target->GetMaxHealth()); - target->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); + target->SetStandState(UNIT_STAND_STATE_STAND); target->CastSpell(target, SPELL_RES_VISUAL, true); if(target->getVictim()) { - target->SetUInt64Value(UNIT_FIELD_TARGET, target->getVictim()->GetGUID()); target->GetMotionMaster()->MoveChase(target->getVictim()); target->AI()->AttackStart(target->getVictim()); } + else + target->GetMotionMaster()->Initialize(); }; struct TRINITY_DLL_DECL boss_julianneAI : public ScriptedAI { boss_julianneAI(Creature* c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); EntryYellTimer = 1000; AggroYellTimer = 10000; } ScriptedInstance* pInstance; + uint32 EntryYellTimer; + uint32 AggroYellTimer; + uint64 RomuloGUID; uint32 Phase; - uint32 EntryYellTimer; - uint32 AggroYellTimer; uint32 BlindingPassionTimer; uint32 DevotionTimer; uint32 EternalAffectionTimer; uint32 PowerfulAttractionTimer; uint32 SummonRomuloTimer; uint32 ResurrectTimer; + uint32 DrinkPoisonTimer; + uint32 ResurrectSelfTimer; bool IsFakingDeath; bool SummonedRomulo; @@ -947,15 +957,18 @@ struct TRINITY_DLL_DECL boss_julianneAI : public ScriptedAI Romulo->DealDamage(Romulo, Romulo->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); } - RomuloGUID = 0; } + RomuloGUID = 0; Phase = PHASE_JULIANNE; BlindingPassionTimer = 30000; DevotionTimer = 15000; EternalAffectionTimer = 25000; PowerfulAttractionTimer = 5000; + SummonRomuloTimer = 10000; + DrinkPoisonTimer = 0; + ResurrectSelfTimer = 0; if(IsFakingDeath) Resurrect(m_creature); @@ -965,7 +978,7 @@ struct TRINITY_DLL_DECL boss_julianneAI : public ScriptedAI RomuloDead = false; } - void Aggro(Unit* who) {} + void EnterCombat(Unit* who) {} void AttackStart(Unit* who) { @@ -983,6 +996,15 @@ struct TRINITY_DLL_DECL boss_julianneAI : public ScriptedAI ScriptedAI::MoveInLineOfSight(who); } + void SpellHit(Unit* caster, const SpellEntry *Spell) + { + if (Spell->Id == SPELL_DRINK_POISON) + { + DoScriptText(SAY_JULIANNE_DEATH01, m_creature); + DrinkPoisonTimer = 2500; + } + } + void DamageTaken(Unit* done_by, uint32 &damage); void JustDied(Unit* killer) @@ -992,9 +1014,13 @@ struct TRINITY_DLL_DECL boss_julianneAI : public ScriptedAI if(pInstance) { pInstance->SetData(DATA_OPERA_EVENT, DONE); - GameObject* Door = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GAMEOBJECT_STAGEDOORRIGHT)); - if(Door) - Door->UseDoorOrButton(); + + if (GameObject* lDoor = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GAMEOBJECT_STAGEDOORLEFT))) + lDoor->SetGoState(GO_STATE_ACTIVE); + if (GameObject* rDoor = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GAMEOBJECT_STAGEDOORRIGHT))) + rDoor->SetGoState(GO_STATE_ACTIVE); + if (GameObject* pSideEntrance = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GO_SIDE_ENTRANCE_DOOR))) + pSideEntrance->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED); } } @@ -1010,12 +1036,14 @@ struct TRINITY_DLL_DECL boss_romuloAI : public ScriptedAI { boss_romuloAI(Creature* c) : ScriptedAI(c) { + pInstance = (c->GetInstanceData()); EntryYellTimer = 8000; AggroYellTimer = 15000; } + + ScriptedInstance* pInstance; uint64 JulianneGUID; - uint32 Phase; uint32 EntryYellTimer; @@ -1026,22 +1054,19 @@ struct TRINITY_DLL_DECL boss_romuloAI : public ScriptedAI uint32 PoisonThrustTimer; uint32 ResurrectTimer; - bool JulianneDead; bool IsFakingDeath; + bool JulianneDead; void Reset() { JulianneGUID = 0; - Phase = PHASE_ROMULO; BackwardLungeTimer = 15000; DaringTimer = 20000; DeadlySwatheTimer = 25000; PoisonThrustTimer = 10000; - - if(IsFakingDeath) - Resurrect(m_creature); + ResurrectTimer = 10000; IsFakingDeath = false; JulianneDead = false; @@ -1049,7 +1074,7 @@ struct TRINITY_DLL_DECL boss_romuloAI : public ScriptedAI void DamageTaken(Unit* done_by, uint32 &damage); - void Aggro(Unit* who) + void EnterCombat(Unit* who) { DoScriptText(SAY_ROMULO_AGGRO, m_creature); if(JulianneGUID) @@ -1074,6 +1099,18 @@ struct TRINITY_DLL_DECL boss_romuloAI : public ScriptedAI void JustDied(Unit* killer) { DoScriptText(SAY_ROMULO_DEATH, m_creature); + + if (pInstance) + { + pInstance->SetData(DATA_OPERA_EVENT, DONE); + + if (GameObject* lDoor = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GAMEOBJECT_STAGEDOORLEFT))) + lDoor->SetGoState(GO_STATE_ACTIVE); + if (GameObject* rDoor = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GAMEOBJECT_STAGEDOORRIGHT))) + rDoor->SetGoState(GO_STATE_ACTIVE); + if (GameObject* pSideEntrance = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GO_SIDE_ENTRANCE_DOOR))) + pSideEntrance->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED); + } } void KilledUnit(Unit* victim) @@ -1086,137 +1123,169 @@ struct TRINITY_DLL_DECL boss_romuloAI : public ScriptedAI void boss_julianneAI::DamageTaken(Unit* done_by, uint32 &damage) { - if(damage < m_creature->GetHealth() || done_by == m_creature || done_by->GetGUID() == RomuloGUID) + if (damage < m_creature->GetHealth()) return; + //anything below only used if incoming damage will kill + if(Phase == PHASE_JULIANNE) { - DoScriptText(SAY_JULIANNE_DEATH01, m_creature); + damage = 0; + + //this means already drinking, so return + if (IsFakingDeath) + return; + m_creature->InterruptNonMeleeSpells(true); DoCast(m_creature, SPELL_DRINK_POISON); - PretendToDie(m_creature); - Phase = PHASE_ROMULO; - damage = 0; + IsFakingDeath = true; - SummonRomuloTimer = 10000; + //IS THIS USEFULL? Creature* Julianne = (Unit::GetCreature((*m_creature), JulianneGUID)); return; } - if(!IsFakingDeath) + if (Phase == PHASE_ROMULO) { - Creature* Romulo = (Unit::GetCreature((*m_creature), RomuloGUID)); - if(Romulo && Romulo->isAlive() && !((boss_romuloAI*)Romulo->AI())->IsFakingDeath) - { - ((boss_romuloAI*)Romulo->AI())->ResurrectTimer = 10000; - ((boss_romuloAI*)Romulo->AI())->JulianneDead = true; - } - else + error_log("TSCR: boss_julianneAI: cannot take damage in PHASE_ROMULO, why was i here?"); + damage = 0; + return; + } + + if (Phase == PHASE_BOTH) + { + //if this is true then we have to kill romulo too + if (RomuloDead) { - m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - if(Romulo) + if (Creature* Romulo = (Unit::GetCreature((*m_creature), RomuloGUID))) { - Romulo->DealDamage(Romulo, Romulo->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); Romulo->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + Romulo->GetMotionMaster()->Clear(); + Romulo->setDeathState(JUST_DIED); + Romulo->CombatStop(); + Romulo->DeleteThreatList(); + Romulo->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); } - JustDied(done_by); + return; } - IsFakingDeath = true; - PretendToDie(m_creature); - damage = 0; + //if not already returned, then romulo is alive and we can pretend die + if (Creature* Romulo = (Unit::GetCreature((*m_creature), RomuloGUID))) + { + PretendToDie(m_creature); + IsFakingDeath = true; + CAST_AI(boss_romuloAI, Romulo->AI())->ResurrectTimer = 10000; + CAST_AI(boss_romuloAI, Romulo->AI())->JulianneDead = true; + damage = 0; + return; + } } - else - damage = 0; + error_log("TSCR: boss_julianneAI: DamageTaken reach end of code, that should not happen."); } void boss_romuloAI::DamageTaken(Unit* done_by, uint32 &damage) { - if(damage < m_creature->GetHealth() || done_by == m_creature || done_by->GetGUID() == JulianneGUID) + if (damage < m_creature->GetHealth()) return; - if(!IsFakingDeath) + //anything below only used if incoming damage will kill + + if (Phase == PHASE_ROMULO) { - IsFakingDeath = true; + DoScriptText(SAY_ROMULO_DEATH, m_creature); PretendToDie(m_creature); + IsFakingDeath = true; + Phase = PHASE_BOTH; - if(Phase == PHASE_BOTH) + if (Creature* Julianne = (Unit::GetCreature((*m_creature), JulianneGUID))) { - Creature* Julianne = (Unit::GetCreature((*m_creature), JulianneGUID)); - if(Julianne && Julianne->isAlive() && !((boss_julianneAI*)Julianne->AI())->IsFakingDeath) - { - ((boss_julianneAI*)Julianne->AI())->ResurrectTimer = 10000; - ((boss_julianneAI*)Julianne->AI())->RomuloDead = true; - } - else - { - m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - if(Julianne) - { - Julianne->DealDamage(Julianne, Julianne->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - Julianne->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - } - JustDied(done_by); - } + CAST_AI(boss_julianneAI, Julianne->AI())->RomuloDead = true; + CAST_AI(boss_julianneAI, Julianne->AI())->ResurrectSelfTimer = 10000; } - else + + damage = 0; + return; + } + + if (Phase == PHASE_BOTH) + { + if (JulianneDead) { - Creature* Julianne = (Unit::GetCreature((*m_creature), JulianneGUID)); - if(Julianne) + if (Creature* Julianne = (Unit::GetCreature((*m_creature), JulianneGUID))) { - Resurrect(Julianne); - m_creature->SetHealth(m_creature->GetMaxHealth()); - ((boss_julianneAI*)Julianne->AI())->ResurrectTimer = 4000; - ((boss_julianneAI*)Julianne->AI())->RomuloDead = true; - ((boss_julianneAI*)Julianne->AI())->Phase = PHASE_BOTH; - ((boss_julianneAI*)Julianne->AI())->IsFakingDeath = false; + Julianne->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + Julianne->GetMotionMaster()->Clear(); + Julianne->setDeathState(JUST_DIED); + Julianne->CombatStop(); + Julianne->DeleteThreatList(); + Julianne->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); } - Phase = PHASE_BOTH; + return; } - damage = 0; + if (Creature* Julianne = (Unit::GetCreature((*m_creature), JulianneGUID))) + { + PretendToDie(m_creature); + IsFakingDeath = true; + CAST_AI(boss_julianneAI, Julianne->AI())->ResurrectTimer = 10000; + CAST_AI(boss_julianneAI, Julianne->AI())->RomuloDead = true; + damage = 0; + return; + } } - if(IsFakingDeath) damage = 0; + error_log("TSCR: boss_romuloAI: DamageTaken reach end of code, that should not happen."); } void boss_julianneAI::UpdateAI(const uint32 diff) { if(EntryYellTimer) { - if(EntryYellTimer < diff) + if (EntryYellTimer <= diff) { DoScriptText(SAY_JULIANNE_ENTER, m_creature); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); EntryYellTimer = 0; }else EntryYellTimer -= diff; } if(AggroYellTimer) { - if(AggroYellTimer < diff) + if (AggroYellTimer <= diff) { DoScriptText(SAY_JULIANNE_AGGRO, m_creature); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->setFaction(16); AggroYellTimer = 0; }else AggroYellTimer -= diff; } - if(Phase == PHASE_ROMULO && !SummonedRomulo) + if (DrinkPoisonTimer) + { + //will do this 2secs after spell hit. this is time to display visual as expected + if (DrinkPoisonTimer <= diff) + { + PretendToDie(m_creature); + Phase = PHASE_ROMULO; + SummonRomuloTimer = 10000; + DrinkPoisonTimer = 0; + }else DrinkPoisonTimer -= diff; + } + + if (Phase == PHASE_ROMULO && !SummonedRomulo) { if(SummonRomuloTimer < diff) { - Creature* Romulo = m_creature->SummonCreature(CREATURE_ROMULO, ROMULO_X, ROMULO_Y, m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 45000); + Creature* Romulo = m_creature->SummonCreature(CREATURE_ROMULO, ROMULO_X, ROMULO_Y, m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); if(Romulo) { RomuloGUID = Romulo->GetGUID(); - ((boss_romuloAI*)Romulo->AI())->JulianneGUID = m_creature->GetGUID(); - ((boss_romuloAI*)Romulo->AI())->Phase = PHASE_ROMULO; + CAST_AI(boss_romuloAI, Romulo->AI())->JulianneGUID = m_creature->GetGUID(); + CAST_AI(boss_romuloAI, Romulo->AI())->Phase = PHASE_ROMULO; + Romulo->setFaction(16); + if(m_creature->getVictim()) { - Romulo->AI()->AttackStart(m_creature->getVictim()); - Romulo->AddThreat(m_creature->getVictim(), 50.0f); + Romulo->AddThreat(m_creature->getVictim(), 0.0f); } DoZoneInCombat(Romulo); } @@ -1224,7 +1293,23 @@ void boss_julianneAI::UpdateAI(const uint32 diff) }else SummonRomuloTimer -= diff; } - if(!UpdateVictim() ||IsFakingDeath) + if (ResurrectSelfTimer) + { + if (ResurrectSelfTimer <= diff) + { + Resurrect(m_creature); + Phase = PHASE_BOTH; + IsFakingDeath = false; + + if (m_creature->getVictim()) + AttackStart(m_creature->getVictim()); + + ResurrectSelfTimer = 0; + ResurrectTimer = 1000; + }else ResurrectSelfTimer -= diff; + } + + if(!UpdateVictim() || IsFakingDeath) return; if(RomuloDead) @@ -1232,14 +1317,14 @@ void boss_julianneAI::UpdateAI(const uint32 diff) if(ResurrectTimer < diff) { Creature* Romulo = (Unit::GetCreature((*m_creature), RomuloGUID)); - if(Romulo && ((boss_romuloAI*)Romulo->AI())->IsFakingDeath) + if(Romulo && CAST_AI(boss_romuloAI, Romulo->AI())->IsFakingDeath) { DoScriptText(SAY_JULIANNE_RESURRECT, m_creature); Resurrect(Romulo); - ((boss_romuloAI*)Romulo->AI())->IsFakingDeath = false; + CAST_AI(boss_romuloAI, Romulo->AI())->IsFakingDeath = false; + RomuloDead = false; ResurrectTimer = 10000; } - RomuloDead = false; }else ResurrectTimer -= diff; } @@ -1266,10 +1351,8 @@ void boss_julianneAI::UpdateAI(const uint32 diff) if(rand()%2 == 1 && SummonedRomulo) { Creature* Romulo = (Unit::GetCreature((*m_creature), RomuloGUID)); - if(Romulo && Romulo->isAlive() && !((boss_romuloAI*)Romulo->AI())->IsFakingDeath) + if (Romulo && Romulo->isAlive() && !RomuloDead) DoCast(Romulo, SPELL_ETERNAL_AFFECTION); - else - return; }else DoCast(m_creature, SPELL_ETERNAL_AFFECTION); EternalAffectionTimer = 45000 + rand()%15000; @@ -1288,14 +1371,14 @@ void boss_romuloAI::UpdateAI(const uint32 diff) if(ResurrectTimer < diff) { Creature* Julianne = (Unit::GetCreature((*m_creature), JulianneGUID)); - if(Julianne && ((boss_julianneAI*)Julianne->AI())->IsFakingDeath) + if(Julianne && CAST_AI(boss_julianneAI, Julianne->AI())->IsFakingDeath) { DoScriptText(SAY_ROMULO_RESURRECT, m_creature); Resurrect(Julianne); - ((boss_julianneAI*)Julianne->AI())->IsFakingDeath = false; + CAST_AI(boss_julianneAI, Julianne->AI())->IsFakingDeath = false; + JulianneDead = false; ResurrectTimer = 10000; } - JulianneDead = false; }else ResurrectTimer -= diff; } diff --git a/src/bindings/scripts/scripts/zone/karazhan/def_karazhan.h b/src/bindings/scripts/scripts/zone/karazhan/def_karazhan.h index be007134fe4..47162ec2599 100644 --- a/src/bindings/scripts/scripts/zone/karazhan/def_karazhan.h +++ b/src/bindings/scripts/scripts/zone/karazhan/def_karazhan.h @@ -1,44 +1,51 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * This program is free software licensed under GPL version 2 * Please see the included DOCS/LICENSE.TXT for more information */ + #ifndef DEF_KARAZHAN_H #define DEF_KARAZHAN_H -#define DATA_ATTUMEN_EVENT 1 -#define DATA_MOROES_EVENT 2 -#define DATA_MAIDENOFVIRTUE_EVENT 3 -#define DATA_OPTIONAL_BOSS_EVENT 4 -#define DATA_OPERA_EVENT 5 -#define DATA_CURATOR_EVENT 6 -#define DATA_SHADEOFARAN_EVENT 7 -#define DATA_TERESTIAN_EVENT 8 -#define DATA_NETHERSPITE_EVENT 9 -#define DATA_CHESS_EVENT 10 -#define DATA_MALCHEZZAR_EVENT 11 -#define DATA_NIGHTBANE_EVENT 12 -#define DATA_OPERA_PERFORMANCE 13 -#define DATA_OPERA_OZ_DEATHCOUNT 14 -#define DATA_KILREK 15 -#define DATA_TERESTIAN 16 -#define DATA_MOROES 17 -#define DATA_GAMEOBJECT_CURTAINS 18 -#define DATA_GAMEOBJECT_STAGEDOORLEFT 19 -#define DATA_GAMEOBJECT_STAGEDOORRIGHT 20 -#define DATA_GAMEOBJECT_LIBRARY_DOOR 21 -#define DATA_GAMEOBJECT_MASSIVE_DOOR 22 -#define DATA_GAMEOBJECT_NETHER_DOOR 23 -#define DATA_GAMEOBJECT_GAME_DOOR 24 -#define DATA_GAMEOBJECT_GAME_EXIT_DOOR 25 -#define DATA_IMAGE_OF_MEDIVH 26 -#define DATA_MASTERS_TERRACE_DOOR_1 27 -#define DATA_MASTERS_TERRACE_DOOR_2 28 +enum +{ + DATA_ATTUMEN_EVENT = 1, + DATA_MOROES_EVENT = 2, + DATA_MAIDENOFVIRTUE_EVENT = 3, + DATA_OPTIONAL_BOSS_EVENT = 4, + DATA_OPERA_EVENT = 5, + DATA_CURATOR_EVENT = 6, + DATA_SHADEOFARAN_EVENT = 7, + DATA_TERESTIAN_EVENT = 8, + DATA_NETHERSPITE_EVENT = 9, + DATA_CHESS_EVENT = 10, + DATA_MALCHEZZAR_EVENT = 11, + DATA_NIGHTBANE_EVENT = 12, + DATA_OPERA_PERFORMANCE = 13, + DATA_OPERA_OZ_DEATHCOUNT = 14, + DATA_KILREK = 15, + DATA_TERESTIAN = 16, + DATA_MOROES = 17, + DATA_GAMEOBJECT_CURTAINS = 18, + DATA_GAMEOBJECT_STAGEDOORLEFT = 19, + DATA_GAMEOBJECT_STAGEDOORRIGHT = 20, + DATA_GAMEOBJECT_LIBRARY_DOOR = 21, + DATA_GAMEOBJECT_MASSIVE_DOOR = 22, + DATA_GAMEOBJECT_NETHER_DOOR = 23, + DATA_GAMEOBJECT_GAME_DOOR = 24, + DATA_GAMEOBJECT_GAME_EXIT_DOOR = 25, + DATA_IMAGE_OF_MEDIVH = 26, + DATA_MASTERS_TERRACE_DOOR_1 = 27, + DATA_MASTERS_TERRACE_DOOR_2 = 28, + DATA_GO_SIDE_ENTRANCE_DOOR = 29 +}; -// Opera Performances -#define EVENT_OZ 1 -#define EVENT_HOOD 2 -#define EVENT_RAJ 3 +enum OperaEvents +{ + EVENT_OZ = 1, + EVENT_HOOD = 2, + EVENT_RAJ = 3 +}; -#define ERROR_INST_DATA(a) error_log("TSCR: Instance Data for Karazhan not set properly. Encounter for Creature Entry %u may not work properly.", a->GetEntry()); +#define ERROR_INST_DATA(a) error_log("TSCR: Instance Data for Karazhan not set properly. Encounter for Creature Entry %u may not work properly.", a->GetEntry()); #endif diff --git a/src/bindings/scripts/scripts/zone/karazhan/instance_karazhan.cpp b/src/bindings/scripts/scripts/zone/karazhan/instance_karazhan.cpp index 3952c0da167..62ad6fcf42c 100644 --- a/src/bindings/scripts/scripts/zone/karazhan/instance_karazhan.cpp +++ b/src/bindings/scripts/scripts/zone/karazhan/instance_karazhan.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -46,6 +46,7 @@ struct TRINITY_DLL_DECL instance_karazhan : public ScriptedInstance instance_karazhan(Map* map) : ScriptedInstance(map) {Initialize();} uint32 Encounters[ENCOUNTERS]; + std::string str_data; uint32 OperaEvent; uint32 OzDeathCount; @@ -58,6 +59,7 @@ struct TRINITY_DLL_DECL instance_karazhan : public ScriptedInstance uint64 MoroesGUID; uint64 LibraryDoor; // Door at Shade of Aran uint64 MassiveDoor; // Door at Netherspite + uint64 SideEntranceDoor; // Side Entrance uint64 GamesmansDoor; // Door before Chess uint64 GamesmansExitDoor; // Door after Chess uint64 NetherspaceDoor; // Door at Malchezaar @@ -82,6 +84,7 @@ struct TRINITY_DLL_DECL instance_karazhan : public ScriptedInstance LibraryDoor = 0; MassiveDoor = 0; + SideEntranceDoor = 0; GamesmansDoor = 0; GamesmansExitDoor = 0; NetherspaceDoor = 0; @@ -145,6 +148,7 @@ struct TRINITY_DLL_DECL instance_karazhan : public ScriptedInstance case DATA_GAMEOBJECT_CURTAINS: return CurtainGUID; case DATA_GAMEOBJECT_LIBRARY_DOOR: return LibraryDoor; case DATA_GAMEOBJECT_MASSIVE_DOOR: return MassiveDoor; + case DATA_GO_SIDE_ENTRANCE_DOOR: return SideEntranceDoor; case DATA_GAMEOBJECT_GAME_DOOR: return GamesmansDoor; case DATA_GAMEOBJECT_GAME_EXIT_DOOR: return GamesmansExitDoor; case DATA_GAMEOBJECT_NETHER_DOOR: return NetherspaceDoor; @@ -183,7 +187,19 @@ struct TRINITY_DLL_DECL instance_karazhan : public ScriptedInstance } if(data == DONE) + { + OUT_SAVE_INST_DATA; + + std::ostringstream saveStream; + saveStream << Encounters[0] << " " << Encounters[1] << " " << Encounters[2] << " " + << Encounters[3] << " " << Encounters[4] << " " << Encounters[5] << " " << Encounters[6] << " " + << Encounters[7] << " " << Encounters[8] << " " << Encounters[9] << " " << Encounters[10]; + + str_data = saveStream.str(); + SaveToDB(); + OUT_SAVE_INST_DATA_COMPLETE; + } } void SetData64(uint32 identifier, uint64 data) @@ -208,6 +224,13 @@ struct TRINITY_DLL_DECL instance_karazhan : public ScriptedInstance case 185134: NetherspaceDoor = go->GetGUID(); break; case 184274: MastersTerraceDoor[0] = go->GetGUID(); break; case 184280: MastersTerraceDoor[1] = go->GetGUID(); break; + case 184275: + SideEntranceDoor = go->GetGUID(); + if (GetData(DATA_OPERA_EVENT) != DONE) + go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED); + else + go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED); + break; } switch(OperaEvent) @@ -224,22 +247,9 @@ struct TRINITY_DLL_DECL instance_karazhan : public ScriptedInstance } } - const char* Save() + std::string GetSaveData() { - OUT_SAVE_INST_DATA; - std::ostringstream stream; - stream << Encounters[0] << " " << Encounters[1] << " " << Encounters[2] << " " << Encounters[3] << " " - << Encounters[4] << " " << Encounters[5] << " " << Encounters[6] << " " << Encounters[7] << " " - << Encounters[8] << " " << Encounters[9] << " " << Encounters[10] << " " << Encounters[11]; - char* out = new char[stream.str().length() + 1]; - strcpy(out, stream.str().c_str()); - if(out) - { - OUT_SAVE_INST_DATA_COMPLETE; - return out; - } - - return NULL; + return str_data.c_str(); } void Load(const char* in) @@ -251,8 +261,8 @@ struct TRINITY_DLL_DECL instance_karazhan : public ScriptedInstance } OUT_LOAD_INST_DATA(in); - std::istringstream stream(in); - stream >> Encounters[0] >> Encounters[1] >> Encounters[2] >> Encounters[3] + std::istringstream loadStream(in); + loadStream >> Encounters[0] >> Encounters[1] >> Encounters[2] >> Encounters[3] >> Encounters[4] >> Encounters[5] >> Encounters[6] >> Encounters[7] >> Encounters[8] >> Encounters[9] >> Encounters[10] >> Encounters[11]; for(uint8 i = 0; i < ENCOUNTERS; ++i) diff --git a/src/bindings/scripts/scripts/zone/karazhan/karazhan.cpp b/src/bindings/scripts/scripts/zone/karazhan/karazhan.cpp index 00fe2e23c69..e984bea31c2 100644 --- a/src/bindings/scripts/scripts/zone/karazhan/karazhan.cpp +++ b/src/bindings/scripts/scripts/zone/karazhan/karazhan.cpp @@ -1,4 +1,4 @@ - /* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> + /* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -46,6 +46,10 @@ EndContentData */ #define SAY_RAJ_INTRO1 "The romantic plays are really tough, but you'll do better this time. You have TALENT. Ready?" #define RAJ_GOSSIP1 "I've never been more ready." +#define OZ_GM_GOSSIP1 "[GM] Change event to EVENT_OZ" +#define OZ_GM_GOSSIP2 "[GM] Change event to EVENT_HOOD" +#define OZ_GM_GOSSIP3 "[GM] Change event to EVENT_RAJ" + struct Dialogue { int32 textid; @@ -111,7 +115,7 @@ struct TRINITY_DLL_DECL npc_barnesAI : public npc_escortAI npc_barnesAI(Creature* c) : npc_escortAI(c) { RaidWiped = false; - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } ScriptedInstance* pInstance; @@ -145,14 +149,14 @@ struct TRINITY_DLL_DECL npc_barnesAI : public npc_escortAI Event = pInstance->GetData(DATA_OPERA_PERFORMANCE); if (GameObject* Door = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GAMEOBJECT_STAGEDOORLEFT))) - Door->SetGoState(1); + Door->SetGoState(GO_STATE_READY); if (GameObject* Curtain = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GAMEOBJECT_CURTAINS))) - Curtain->SetGoState(1); + Curtain->SetGoState(GO_STATE_READY); } } - void Aggro(Unit* who) {} + void EnterCombat(Unit* who) {} void WaypointReached(uint32 i) { @@ -177,10 +181,11 @@ struct TRINITY_DLL_DECL npc_barnesAI : public npc_escortAI if(pInstance) { if (GameObject* Door = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GAMEOBJECT_STAGEDOORLEFT))) - Door->SetGoState(1); + Door->SetGoState(GO_STATE_READY); } IsBeingEscorted = false; PerformanceReady = true; + m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); break; } } @@ -257,7 +262,7 @@ struct TRINITY_DLL_DECL npc_barnesAI : public npc_escortAI return; if (GameObject* Curtain = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GAMEOBJECT_CURTAINS))) - Curtain->SetGoState(0); + Curtain->SetGoState(GO_STATE_ACTIVE); CurtainTimer = 0; }else CurtainTimer -= diff; @@ -311,7 +316,7 @@ struct TRINITY_DLL_DECL npc_barnesAI : public npc_escortAI pInstance->SetData(DATA_OPERA_EVENT, IN_PROGRESS); if (GameObject* Door = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GAMEOBJECT_STAGEDOORLEFT))) - Door->SetGoState(0); + Door->SetGoState(GO_STATE_ACTIVE); m_creature->CastSpell(m_creature, SPELL_TUXEDO, true); m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); @@ -367,18 +372,25 @@ CreatureAI* GetAI_npc_barnesAI(Creature* _Creature) for(uint8 i = 0; i < 6; ++i) Barnes_AI->AddWaypoint(i, StageLocations[i][0], StageLocations[i][1], 90.465); - return ((CreatureAI*)Barnes_AI); + return (Barnes_AI); } bool GossipHello_npc_barnes(Player* player, Creature* _Creature) { // Check for death of Moroes. - ScriptedInstance* pInstance = ((ScriptedInstance*)_Creature->GetInstanceData()); + ScriptedInstance* pInstance = (_Creature->GetInstanceData()); if(pInstance && (pInstance->GetData(DATA_MOROES_EVENT) >= DONE)) { player->ADD_GOSSIP_ITEM(0, OZ_GOSSIP1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - if(!((npc_barnesAI*)_Creature->AI())->RaidWiped) + if (player->isGameMaster()) + { + player->ADD_GOSSIP_ITEM(5, OZ_GM_GOSSIP1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + player->ADD_GOSSIP_ITEM(5, OZ_GM_GOSSIP2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4); + player->ADD_GOSSIP_ITEM(5, OZ_GM_GOSSIP3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5); + } + + if(!CAST_AI(npc_barnesAI, _Creature->AI())->RaidWiped) player->SEND_GOSSIP_MENU(8970, _Creature->GetGUID()); else player->SEND_GOSSIP_MENU(8975, _Creature->GetGUID()); @@ -395,10 +407,24 @@ bool GossipSelect_npc_barnes(Player *player, Creature *_Creature, uint32 sender, player->ADD_GOSSIP_ITEM(0, OZ_GOSSIP2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); player->SEND_GOSSIP_MENU(8971, _Creature->GetGUID()); break; - case GOSSIP_ACTION_INFO_DEF+2: player->CLOSE_GOSSIP_MENU(); - ((npc_barnesAI*)_Creature->AI())->StartEvent(); + CAST_AI(npc_barnesAI, _Creature->AI())->StartEvent(); + break; + case GOSSIP_ACTION_INFO_DEF+3: + player->CLOSE_GOSSIP_MENU(); + CAST_AI(npc_barnesAI, _Creature->AI())->Event = EVENT_OZ; + outstring_log("TSCR: player (GUID %i) manually set Opera event to EVENT_OZ",player->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+4: + player->CLOSE_GOSSIP_MENU(); + CAST_AI(npc_barnesAI, _Creature->AI())->Event = EVENT_HOOD; + outstring_log("TSCR: player (GUID %i) manually set Opera event to EVENT_HOOD",player->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+5: + player->CLOSE_GOSSIP_MENU(); + CAST_AI(npc_barnesAI, _Creature->AI())->Event = EVENT_RAJ; + outstring_log("TSCR: player (GUID %i) manually set Opera event to EVENT_RAJ",player->GetGUID()); break; } @@ -415,7 +441,7 @@ bool GossipSelect_npc_barnes(Player *player, Creature *_Creature, uint32 sender, bool GossipHello_npc_berthold(Player* player, Creature* _Creature) { - ScriptedInstance* pInstance = ((ScriptedInstance*)_Creature->GetInstanceData()); + ScriptedInstance* pInstance = (_Creature->GetInstanceData()); // Check if Shade of Aran is dead or not if(pInstance && (pInstance->GetData(DATA_SHADEOFARAN_EVENT) >= DONE)) player->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_TELEPORT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); @@ -460,7 +486,7 @@ struct TRINITY_DLL_DECL npc_image_of_medivhAI : public ScriptedAI { npc_image_of_medivhAI(Creature* c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } ScriptedInstance *pInstance; @@ -489,7 +515,7 @@ struct TRINITY_DLL_DECL npc_image_of_medivhAI : public ScriptedAI m_creature->RemoveCorpse(); } } - void Aggro(Unit* who){} + void EnterCombat(Unit* who){} void MovementInform(uint32 type, uint32 id) { @@ -511,7 +537,7 @@ struct TRINITY_DLL_DECL npc_image_of_medivhAI : public ScriptedAI if(!Arcanagos) return; ArcanagosGUID = Arcanagos->GetGUID(); - Arcanagos->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT + MOVEMENTFLAG_LEVITATING); + Arcanagos->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); (*Arcanagos).GetMotionMaster()->MovePoint(0,ArcanagosPos[0],ArcanagosPos[1],ArcanagosPos[2]); Arcanagos->SetOrientation(ArcanagosPos[3]); m_creature->SetOrientation(MedivPos[3]); @@ -527,25 +553,25 @@ struct TRINITY_DLL_DECL npc_image_of_medivhAI : public ScriptedAI { case 0: return 9999999; case 1: - m_creature->Yell(SAY_DIALOG_MEDIVH_1,LANG_UNIVERSAL,NULL); + m_creature->MonsterYell(SAY_DIALOG_MEDIVH_1,LANG_UNIVERSAL,NULL); return 10000; case 2: if(arca) - ((Creature*)arca)->Yell(SAY_DIALOG_ARCANAGOS_2,LANG_UNIVERSAL,NULL); + CAST_CRE(arca)->MonsterYell(SAY_DIALOG_ARCANAGOS_2,LANG_UNIVERSAL,NULL); return 20000; case 3: - m_creature->Yell(SAY_DIALOG_MEDIVH_3,LANG_UNIVERSAL,NULL); + m_creature->MonsterYell(SAY_DIALOG_MEDIVH_3,LANG_UNIVERSAL,NULL); return 10000; case 4: if(arca) - ((Creature*)arca)->Yell(SAY_DIALOG_ARCANAGOS_4, LANG_UNIVERSAL, NULL); + CAST_CRE(arca)->MonsterYell(SAY_DIALOG_ARCANAGOS_4, LANG_UNIVERSAL, NULL); return 20000; case 5: - m_creature->Yell(SAY_DIALOG_MEDIVH_5, LANG_UNIVERSAL, NULL); + m_creature->MonsterYell(SAY_DIALOG_MEDIVH_5, LANG_UNIVERSAL, NULL); return 20000; case 6: if(arca) - ((Creature*)arca)->Yell(SAY_DIALOG_ARCANAGOS_6, LANG_UNIVERSAL, NULL); + CAST_CRE(arca)->MonsterYell(SAY_DIALOG_ARCANAGOS_6, LANG_UNIVERSAL, NULL); return 10000; case 7: FireArcanagosTimer = 500; @@ -555,7 +581,7 @@ struct TRINITY_DLL_DECL npc_image_of_medivhAI : public ScriptedAI DoCast(m_creature, SPELL_MANA_SHIELD); return 10000; case 9: - m_creature->TextEmote(EMOTE_DIALOG_MEDIVH_7, 0, false); + m_creature->MonsterTextEmote(EMOTE_DIALOG_MEDIVH_7, 0, false); return 10000; case 10: if(arca) @@ -563,7 +589,7 @@ struct TRINITY_DLL_DECL npc_image_of_medivhAI : public ScriptedAI return 1000; case 11: if(arca) - ((Creature*)arca)->Yell(SAY_DIALOG_ARCANAGOS_8, LANG_UNIVERSAL, NULL); + CAST_CRE(arca)->MonsterYell(SAY_DIALOG_ARCANAGOS_8, LANG_UNIVERSAL, NULL); return 5000; case 12: arca->GetMotionMaster()->MovePoint(0, -11010.82,-1761.18, 156.47); @@ -572,7 +598,7 @@ struct TRINITY_DLL_DECL npc_image_of_medivhAI : public ScriptedAI arca->SetSpeed(MOVE_FLIGHT, 2.0f); return 10000; case 13: - m_creature->Yell(SAY_DIALOG_MEDIVH_9, LANG_UNIVERSAL, NULL); + m_creature->MonsterYell(SAY_DIALOG_MEDIVH_9, LANG_UNIVERSAL, NULL); return 10000; case 14: m_creature->SetVisibility(VISIBILITY_OFF); @@ -580,7 +606,7 @@ struct TRINITY_DLL_DECL npc_image_of_medivhAI : public ScriptedAI if(map->IsDungeon()) { - InstanceMap::PlayerList const &PlayerList = ((InstanceMap*)map)->GetPlayers(); + InstanceMap::PlayerList const &PlayerList = map->GetPlayers(); for (InstanceMap::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) { if(i->getSource()->isAlive()) diff --git a/src/bindings/scripts/scripts/zone/loch_modan/loch_modan.cpp b/src/bindings/scripts/scripts/zone/loch_modan/loch_modan.cpp index d79f581d1c8..b838fc97aab 100644 --- a/src/bindings/scripts/scripts/zone/loch_modan/loch_modan.cpp +++ b/src/bindings/scripts/scripts/zone/loch_modan/loch_modan.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 diff --git a/src/bindings/scripts/scripts/zone/magisters_terrace/boss_felblood_kaelthas.cpp b/src/bindings/scripts/scripts/zone/magisters_terrace/boss_felblood_kaelthas.cpp index cbc1013da17..fe62b55f0a4 100644 --- a/src/bindings/scripts/scripts/zone/magisters_terrace/boss_felblood_kaelthas.cpp +++ b/src/bindings/scripts/scripts/zone/magisters_terrace/boss_felblood_kaelthas.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -6,18 +6,18 @@ * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* ScriptData SDName: Boss_Felblood_Kaelthas SD%Complete: 80 -SDComment: Normal and Heroic Support. Issues: Arcane Spheres do not initially follow targets. TODO: Convert Phoenix to ACID. +SDComment: Normal and Heroic Support. Issues: Arcane Spheres do not initially follow targets. SDCategory: Magisters' Terrace EndScriptData */ @@ -25,7 +25,7 @@ EndScriptData */ #include "def_magisters_terrace.h" #include "WorldPacket.h" -#define SAY_AGGRO -1585023 //This yell should be done when the room is cleared. For now, set it as aggro yell. +#define SAY_AGGRO -1585023 //This yell should be done when the room is cleared. For now, set it as a movelineofsight yell. #define SAY_PHOENIX -1585024 #define SAY_FLAMESTRIKE -1585025 #define SAY_GRAVITY_LAPSE -1585026 @@ -36,13 +36,12 @@ EndScriptData */ /*** Spells ***/ // Phase 1 spells - #define SPELL_FIREBALL_NORMAL 44189 // Deals 2700-3300 damage at current target #define SPELL_FIREBALL_HEROIC 46164 // 4950-6050 #define SPELL_PHOENIX 44194 // Summons a phoenix (Doesn't work?) -#define SPELL_PHOENIX_BURN 44198 // A spell Phoenix uses to damage everything around -#define SPELL_PHOENIX_FIREBALL 44202 // Phoenix casts this in phase 2 and stops moving +#define SPELL_PHOENIX_BURN 44197 // A spell Phoenix uses to damage everything around +#define SPELL_REBIRTH_DMG 44196 // DMG if a Phoenix rebirth happen #define SPELL_FLAMESTRIKE1_NORMAL 44190 // Damage part #define SPELL_FLAMESTRIKE1_HEROIC 46163 // Heroic damage part @@ -53,7 +52,6 @@ EndScriptData */ #define SPELL_PYROBLAST 36819 // Heroic only; 45-55k fire damage // Phase 2 spells - #define SPELL_GRAVITY_LAPSE_INITIAL 44224 // Cast at the beginning of every Gravity Lapse #define SPELL_GRAVITY_LAPSE_CHANNEL 44251 // Channeled; blue beam animation to every enemy in range #define SPELL_TELEPORT_CENTER 44218 // Should teleport people to the center. Requires DB entry in spell_target_position. @@ -68,22 +66,20 @@ EndScriptData */ #define CREATURE_ARCANE_SPHERE 24708 /** Locations **/ -float KaelLocations[6][2]= +float KaelLocations[3][2]= { - {148.744659, 181.377426},//center - {140.823883, 195.403046},//phoenixpos1 - {156.574188, 195.650482},//phoenixpos2 - {149.813, 160.917},//spherepos1 - {167.223, 173.594},//spherepos2 - {130.68, 173.007},//spherepos3 + {148.744659, 181.377426}, + {140.823883, 195.403046}, + {156.574188, 195.650482}, }; -#define LOCATION_Z -16.727455 + +#define LOCATION_Z -16.727455 struct TRINITY_DLL_DECL boss_felblood_kaelthasAI : public ScriptedAI { boss_felblood_kaelthasAI(Creature* c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); Heroic = c->GetMap()->IsHeroic(); + pInstance = (c->GetInstanceData()); Heroic = c->GetMap()->IsHeroic(); } ScriptedInstance* pInstance; @@ -106,6 +102,7 @@ struct TRINITY_DLL_DECL boss_felblood_kaelthasAI : public ScriptedAI bool FirstGravityLapse; bool Heroic; + bool HasTaunted; uint8 Phase; // 0 = Not started @@ -116,7 +113,7 @@ struct TRINITY_DLL_DECL boss_felblood_kaelthasAI : public ScriptedAI { // TODO: Timers FireballTimer = 0; - PhoenixTimer = 30000; + PhoenixTimer = 10000; FlameStrikeTimer = 25000; CombatPulseTimer = 0; @@ -126,55 +123,57 @@ struct TRINITY_DLL_DECL boss_felblood_kaelthasAI : public ScriptedAI GravityLapsePhase = 0; FirstGravityLapse = true; + HasTaunted = false; Phase = 0; - if(pInstance) - { - if(m_creature->isDead()) - pInstance->SetData(DATA_KAELTHAS_EVENT, DONE); - else - pInstance->SetData(DATA_KAELTHAS_EVENT, NOT_STARTED); - } - } + if (pInstance) + pInstance->SetData(DATA_KAELTHAS_EVENT, 0); - void KilledUnit(Unit* victim) - { - if(victim && (victim->GetTypeId() == TYPEID_PLAYER)) - { - victim->RemoveAurasDueToSpell(SPELL_GRAVITY_LAPSE_FLY); - victim->RemoveAurasDueToSpell(SPELL_GRAVITY_LAPSE_DOT); - WorldPacket data(12); - data.SetOpcode(SMSG_MOVE_UNSET_CAN_FLY); - data.append(victim->GetPackGUID()); - data << uint32(0); - victim->SendMessageToSet(&data, true); - } + GameObject* Door = GameObject::GetGameObject(*m_creature, pInstance->GetData64(DATA_KAEL_DOOR)); + if (Door) + Door->SetGoState(GO_STATE_ACTIVE); // Open the big encounter door. Close it in Aggro and open it only in JustDied(and here) + // Small door opened after event are expected to be closed by default } + void JustDied(Unit *killer) { - RemoveGravityLapse(); DoScriptText(SAY_DEATH, m_creature); - if(pInstance) - pInstance->SetData(DATA_KAELTHAS_EVENT, DONE); + GameObject* EncounterDoor = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_KAEL_DOOR)); + if (EncounterDoor) + EncounterDoor->SetGoState(GO_STATE_ACTIVE); // Open the encounter door } void DamageTaken(Unit* done_by, uint32 &damage) { - if(damage > m_creature->GetHealth()) + if (damage > m_creature->GetHealth()) RemoveGravityLapse(); // Remove Gravity Lapse so that players fall to ground if they kill him when in air. } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { - DoScriptText(SAY_AGGRO, m_creature); - if(pInstance) - pInstance->SetData(DATA_KAELTHAS_EVENT, IN_PROGRESS); + if (pInstance) + { + GameObject* EncounterDoor = GameObject::GetGameObject(*m_creature, pInstance->GetData64(DATA_KAEL_DOOR)); + if (EncounterDoor) + EncounterDoor->SetGoState(GO_STATE_READY); //Close the encounter door, open it in JustDied/Reset + } + } + + void MoveInLineOfSight(Unit *who) + { + if (!HasTaunted && m_creature->IsWithinDistInMap(who, 40.0)) + { + DoScriptText(SAY_AGGRO, m_creature); + HasTaunted = true; + } + + ScriptedAI::MoveInLineOfSight(who); } void SetThreatList(Creature* SummonedUnit) { - if(!SummonedUnit) + if (!SummonedUnit) return; std::list<HostilReference*>& m_threatlist = m_creature->getThreatManager().getThreatList(); @@ -182,114 +181,86 @@ struct TRINITY_DLL_DECL boss_felblood_kaelthasAI : public ScriptedAI for(i = m_threatlist.begin(); i != m_threatlist.end(); i++) { Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid()); - if(pUnit && pUnit->isAlive()) + if (pUnit && pUnit->isAlive()) { - float threat = DoGetThreat(pUnit); - SummonedUnit->AddThreat(pUnit, 0.1f); + float threat = m_creature->getThreatManager().getThreat(pUnit); + SummonedUnit->AddThreat(pUnit, threat); } } } - void EnterEvadeMode() - { - RemoveGravityLapse(); - m_creature->InterruptNonMeleeSpells(true); - m_creature->RemoveAllAuras(); - m_creature->DeleteThreatList(); - m_creature->CombatStop(); - m_creature->LoadCreaturesAddon(); - - if( m_creature->isAlive() ) - m_creature->GetMotionMaster()->MoveTargetedHome(); - - m_creature->SetLootRecipient(NULL); - - InCombat = false; - Reset(); - } - void TeleportPlayersToSelf() { - float x,y,z; - m_creature->Relocate(KaelLocations[0][0], KaelLocations[0][1], LOCATION_Z, 0); - Map *map = m_creature->GetMap(); - Map::PlayerList const &PlayerList = map->GetPlayers(); - Map::PlayerList::const_iterator i; - for (i = PlayerList.begin(); i != PlayerList.end(); ++i) + float x = KaelLocations[0][0]; + float y = KaelLocations[0][1]; + m_creature->Relocate(x, y, LOCATION_Z, 0); + //m_creature->SendMonsterMove(x, y, LOCATION_Z, 0, 0, 0); // causes some issues... + std::list<HostilReference*>::iterator i = m_creature->getThreatManager().getThreatList().begin(); + for (i = m_creature->getThreatManager().getThreatList().begin(); i!= m_creature->getThreatManager().getThreatList().end();++i) { - if (Player* i_pl = i->getSource()) - if(i_pl->isAlive()) - { - i_pl->CastSpell(i_pl, SPELL_TELEPORT_CENTER, true); - m_creature->GetNearPoint(m_creature,x,y,z,5,5,0); - i_pl->TeleportTo(m_creature->GetMapId(),x,y,LOCATION_Z,i_pl->GetOrientation()); - } + Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid()); + if (pUnit && (pUnit->GetTypeId() == TYPEID_PLAYER)) + pUnit->CastSpell(pUnit, SPELL_TELEPORT_CENTER, true); } DoCast(m_creature, SPELL_TELEPORT_CENTER, true); } void CastGravityLapseKnockUp() { - Map *map = m_creature->GetMap(); - Map::PlayerList const &PlayerList = map->GetPlayers(); - Map::PlayerList::const_iterator i; - for (i = PlayerList.begin(); i != PlayerList.end(); ++i) + std::list<HostilReference*>::iterator i = m_creature->getThreatManager().getThreatList().begin(); + for (i = m_creature->getThreatManager().getThreatList().begin(); i!= m_creature->getThreatManager().getThreatList().end();++i) { - if (Player* i_pl = i->getSource()) - if(i_pl->isAlive()) + Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid()); + if (pUnit && (pUnit->GetTypeId() == TYPEID_PLAYER)) // Knockback into the air - i_pl->CastSpell(i_pl, SPELL_GRAVITY_LAPSE_DOT, true, 0, 0, m_creature->GetGUID()); + pUnit->CastSpell(pUnit, SPELL_GRAVITY_LAPSE_DOT, true, 0, 0, m_creature->GetGUID()); } } void CastGravityLapseFly() // Use Fly Packet hack for now as players can't cast "fly" spells unless in map 530. Has to be done a while after they get knocked into the air... { - Map *map = m_creature->GetMap(); - Map::PlayerList const &PlayerList = map->GetPlayers(); - Map::PlayerList::const_iterator i; - for (i = PlayerList.begin(); i != PlayerList.end(); ++i) + std::list<HostilReference*>::iterator i = m_creature->getThreatManager().getThreatList().begin(); + for (i = m_creature->getThreatManager().getThreatList().begin(); i!= m_creature->getThreatManager().getThreatList().end();++i) { - if (Player* i_pl = i->getSource()) + Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid()); + if (pUnit && (pUnit->GetTypeId() == TYPEID_PLAYER)) { - if(i_pl->isAlive()) - { - // Also needs an exception in spell system. - i_pl->CastSpell(i_pl, SPELL_GRAVITY_LAPSE_FLY, true, 0, 0, m_creature->GetGUID()); - // Use packet hack - WorldPacket data(12); - data.SetOpcode(SMSG_MOVE_SET_CAN_FLY); - data.append(i_pl->GetPackGUID()); - data << uint32(0); - i_pl->SendMessageToSet(&data, true); - i_pl->SetSpeed(MOVE_FLIGHT, 2.0f); - } + // Also needs an exception in spell system. + pUnit->CastSpell(pUnit, SPELL_GRAVITY_LAPSE_FLY, true, 0, 0, m_creature->GetGUID()); + // Use packet hack + WorldPacket data(12); + data.SetOpcode(SMSG_MOVE_SET_CAN_FLY); + data.append(pUnit->GetPackGUID()); + data << uint32(0); + pUnit->SendMessageToSet(&data, true); } } } void RemoveGravityLapse() { - Map *map = m_creature->GetMap(); - Map::PlayerList const &PlayerList = map->GetPlayers(); - Map::PlayerList::const_iterator i; - for (i = PlayerList.begin(); i != PlayerList.end(); ++i) + std::list<HostilReference*>::iterator i = m_creature->getThreatManager().getThreatList().begin(); + for (i = m_creature->getThreatManager().getThreatList().begin(); i!= m_creature->getThreatManager().getThreatList().end();++i) { - if(Player* i_pl = i->getSource()) + Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid()); + if (pUnit && (pUnit->GetTypeId() == TYPEID_PLAYER)) { - i_pl->RemoveAurasDueToSpell(SPELL_GRAVITY_LAPSE_FLY); - i_pl->RemoveAurasDueToSpell(SPELL_GRAVITY_LAPSE_DOT); + pUnit->RemoveAurasDueToSpell(SPELL_GRAVITY_LAPSE_FLY); + pUnit->RemoveAurasDueToSpell(SPELL_GRAVITY_LAPSE_DOT); + WorldPacket data(12); data.SetOpcode(SMSG_MOVE_UNSET_CAN_FLY); - data.append(i_pl->GetPackGUID()); + data.append(pUnit->GetPackGUID()); data << uint32(0); - i_pl->SendMessageToSet(&data, true); + pUnit->SendMessageToSet(&data, true); } } } void UpdateAI(const uint32 diff) { - if(!UpdateVictim()) + //Return since we have no target + if (!UpdateVictim()) return; switch(Phase) @@ -297,9 +268,9 @@ struct TRINITY_DLL_DECL boss_felblood_kaelthasAI : public ScriptedAI case 0: { // *Heroic mode only: - if(Heroic) + if (Heroic) { - if(PyroblastTimer < diff) + if (PyroblastTimer < diff) { DoCast(m_creature, SPELL_SHOCK_BARRIER, true); DoCast(m_creature->getVictim(), SPELL_PYROBLAST); @@ -307,56 +278,47 @@ struct TRINITY_DLL_DECL boss_felblood_kaelthasAI : public ScriptedAI }else PyroblastTimer -= diff; } - if(FireballTimer < diff) + if (FireballTimer < diff) { DoCast(m_creature->getVictim(), Heroic ? SPELL_FIREBALL_HEROIC : SPELL_FIREBALL_NORMAL); FireballTimer = 2000 + rand()%4000; }else FireballTimer -= diff; - if(PhoenixTimer < diff) + if (PhoenixTimer < diff) { + + Unit* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM,1); + uint32 random = rand()%2 + 1; float x = KaelLocations[random][0]; float y = KaelLocations[random][1]; - Creature* Phoenix = m_creature->SummonCreature(CREATURE_PHOENIX, x, y, LOCATION_Z, 0, TEMPSUMMON_CORPSE_DESPAWN, 60000); - if(Phoenix) + + Creature* Phoenix = m_creature->SummonCreature(CREATURE_PHOENIX, x, y, LOCATION_Z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000); + if (Phoenix) { Phoenix->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE + UNIT_FLAG_NON_ATTACKABLE); SetThreatList(Phoenix); - Unit *target = SelectUnit(SELECT_TARGET_RANDOM,1); - if(target) - { - Phoenix->AddThreat(target,1000); - Phoenix->Attack(target,true); - Phoenix->GetMotionMaster()->MoveChase(target); - } - else - { - Phoenix->AddThreat(m_creature->getVictim(),1000); - Phoenix->Attack(m_creature->getVictim(),true); - Phoenix->GetMotionMaster()->MoveChase(m_creature->getVictim()); - } + Phoenix->AI()->AttackStart(target); } DoScriptText(SAY_PHOENIX, m_creature); - PhoenixTimer = 40000; + PhoenixTimer = 60000; }else PhoenixTimer -= diff; - if(FlameStrikeTimer < diff) + if (FlameStrikeTimer < diff) { if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) { - m_creature->InterruptNonMeleeSpells(false); DoCast(target, SPELL_FLAMESTRIKE3, true); DoScriptText(SAY_FLAMESTRIKE, m_creature); - - FlameStrikeTimer = 20000 + rand()%5000; } + FlameStrikeTimer = 15000 + rand()%10000; }else FlameStrikeTimer -= diff; // Below 50% - if(m_creature->GetMaxHealth() * 0.5 > m_creature->GetHealth()) + if (m_creature->GetMaxHealth() * 0.5 > m_creature->GetHealth()) { m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_INTERRUPT_CAST, true); m_creature->StopMoving(); @@ -366,34 +328,35 @@ struct TRINITY_DLL_DECL boss_felblood_kaelthasAI : public ScriptedAI GravityLapsePhase = 0; Phase = 1; } + DoMeleeAttackIfReady(); } break; case 1: { - m_creature->StopMoving(); - if(GravityLapseTimer < diff) + if (GravityLapseTimer < diff) { switch(GravityLapsePhase) { case 0: - if(FirstGravityLapse) // Different yells at 50%, and at every following Gravity Lapse + if (FirstGravityLapse) // Different yells at 50%, and at every following Gravity Lapse { DoScriptText(SAY_GRAVITY_LAPSE, m_creature); FirstGravityLapse = false; - if(pInstance) + + if (pInstance) { GameObject* KaelLeft = GameObject::GetGameObject(*m_creature, pInstance->GetData64(DATA_KAEL_STATUE_LEFT)); - if(KaelLeft) KaelLeft->SetGoState(0); + if (KaelLeft) KaelLeft->SetGoState(GO_STATE_ACTIVE); GameObject* KaelRight = GameObject::GetGameObject(*m_creature, pInstance->GetData64(DATA_KAEL_STATUE_RIGHT)); - if(KaelRight) KaelRight->SetGoState(0); + if (KaelRight) KaelRight->SetGoState(GO_STATE_ACTIVE); } }else { DoScriptText(SAY_RECAST_GRAVITY, m_creature); } - m_creature->StopMoving(); + DoCast(m_creature, SPELL_GRAVITY_LAPSE_INITIAL); GravityLapseTimer = 2000 + diff;// Don't interrupt the visual spell GravityLapsePhase = 1; @@ -415,31 +378,23 @@ struct TRINITY_DLL_DECL boss_felblood_kaelthasAI : public ScriptedAI CastGravityLapseFly(); GravityLapseTimer = 30000; GravityLapsePhase = 4; + + for(uint8 i = 0; i < 3; ++i) { - Creature* Orb = m_creature->SummonCreature(CREATURE_ARCANE_SPHERE,KaelLocations[3+i][0],KaelLocations[3+i][1],LOCATION_Z,0,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,30000); - if(Orb) + Unit* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM,0); + + Creature* Orb = DoSpawnCreature(CREATURE_ARCANE_SPHERE, 5, 5, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000); + if (Orb && target) { - SetThreatList(Orb); - Unit *target = SelectUnit(SELECT_TARGET_BOTTOMAGGRO,i); - if(target) - { - Orb->AddThreat(target,1000); - Orb->Attack(target,true); - Orb->GetMotionMaster()->MoveChase(target); - } - else - { - Unit *ntarget = SelectUnit(SELECT_TARGET_RANDOM,0); - if(ntarget) - { - Orb->AddThreat(ntarget,1000); - Orb->Attack(ntarget,true); - Orb->GetMotionMaster()->MoveChase(ntarget); - } - } + //SetThreatList(Orb); + Orb->AddThreat(target, 1.0f); + Orb->AI()->AttackStart(target); } + } + DoCast(m_creature, SPELL_GRAVITY_LAPSE_CHANNEL); break; @@ -479,11 +434,11 @@ struct TRINITY_DLL_DECL mob_felkael_flamestrikeAI : public ScriptedAI DoCast(m_creature, SPELL_FLAMESTRIKE2, true); } - void Aggro(Unit *who) {} + void EnterCombat(Unit *who) {} void MoveInLineOfSight(Unit *who) {} void UpdateAI(const uint32 diff) { - if(FlameStrikeTimer < diff) + if (FlameStrikeTimer < diff) { DoCast(m_creature, Heroic ? SPELL_FLAMESTRIKE1_HEROIC : SPELL_FLAMESTRIKE1_NORMAL, true); m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); @@ -493,211 +448,187 @@ struct TRINITY_DLL_DECL mob_felkael_flamestrikeAI : public ScriptedAI struct TRINITY_DLL_DECL mob_felkael_phoenixAI : public ScriptedAI { - mob_felkael_phoenixAI(Creature *c) : ScriptedAI(c) + mob_felkael_phoenixAI(Creature* c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } - uint32 BurnTimer; - uint32 CheckTimer; - uint8 phase; + ScriptedInstance* pInstance; - bool end; + uint32 BurnTimer; + uint32 Death_Timer; + bool Rebirth; + bool FakeDeath; void Reset() { - m_creature->SetSpeed(MOVE_RUN, 0.5f); - m_creature->SetSpeed(MOVE_WALK, 0.5f); m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE + UNIT_FLAG_NON_ATTACKABLE); + m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + m_creature->CastSpell(m_creature,SPELL_PHOENIX_BURN,true); BurnTimer = 2000; - CheckTimer = 1000; - phase = 0; - end = false; + Death_Timer = 2700; + Rebirth = false; + FakeDeath = false; } - void Aggro(Unit* who) {} + void EnterCombat(Unit* who) {} - void JustDied(Unit* slayer) + void DamageTaken(Unit* pKiller, uint32 &damage) { - if (end) + if (damage < m_creature->GetHealth()) + return; + + //Prevent glitch if in fake death + if (FakeDeath) + { + damage = 0; return; - DoSpawnCreature(CREATURE_PHOENIX_EGG, 0, 0, 0, 0, TEMPSUMMON_CORPSE_DESPAWN, 45000); + + } + //Don't really die in all phases of Kael'Thas + if (pInstance && pInstance->GetData(DATA_KAELTHAS_EVENT) == 0) + { + //prevent death + damage = 0; + FakeDeath = true; + + m_creature->InterruptNonMeleeSpells(false); + m_creature->SetHealth(0); + m_creature->StopMoving(); + m_creature->ClearComboPointHolders(); + m_creature->RemoveAllAurasOnDeath(); + m_creature->ModifyAuraState(AURA_STATE_HEALTHLESS_20_PERCENT, false); + m_creature->ModifyAuraState(AURA_STATE_HEALTHLESS_35_PERCENT, false); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->ClearAllReactives(); + m_creature->SetUInt64Value(UNIT_FIELD_TARGET,0); + m_creature->GetMotionMaster()->Clear(); + m_creature->GetMotionMaster()->MoveIdle(); + m_creature->SetStandState(UNIT_STAND_STATE_DEAD); + + } + + } + + void JustDied(Unit* slayer) + { + DoSpawnCreature(CREATURE_PHOENIX_EGG, 0, 0, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45000); } void UpdateAI(const uint32 diff) { - if(CheckTimer < diff) + + //If we are fake death, we cast revbirth and after that we kill the phoenix to spawn the egg. + if (FakeDeath) { - if (pInstance) + if (!Rebirth) + { + DoCast(m_creature, SPELL_REBIRTH_DMG); + Rebirth = true; + } + + if (Rebirth) { - Creature *boss = (Unit::GetCreature((*m_creature),pInstance->GetData64(DATA_KAEL))); - if (boss) + + if (Death_Timer < diff) { - phase = ((boss_felblood_kaelthasAI*)boss->AI())->Phase; - if(boss->isDead() || !boss->isInCombat()) - { - end = true; - m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_FIRE, NULL, false);//temphack, hellfire is not damaging self - } - } + DoSpawnCreature(CREATURE_PHOENIX_EGG, 0, 0, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45000); + m_creature->setDeathState(JUST_DIED); + m_creature->RemoveCorpse(); + Rebirth = false; + }else Death_Timer -= diff; } - CheckTimer = 1000; - }else CheckTimer -= diff; + + + } if (!UpdateVictim()) return; if (BurnTimer < diff) { - if(!phase) - { - DoCast(m_creature, SPELL_PHOENIX_BURN); - m_creature->DealDamage(m_creature, 1500, NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_FIRE, NULL, false);//temphack, hellfire is not damaging self - } - else - { - m_creature->StopMoving(); - DoCast(m_creature->getVictim(), SPELL_PHOENIX_FIREBALL); - } - BurnTimer = 2000; - }else BurnTimer -= diff; + //spell Burn should possible do this, but it doesn't, so do this for now. + uint32 dmg = urand(1650,2050); + m_creature->DealDamage(m_creature, dmg, 0, DOT, SPELL_SCHOOL_MASK_FIRE, NULL, false); + BurnTimer += 2000; + } BurnTimer -= diff; + - //DoMeleeAttackIfReady(); + DoMeleeAttackIfReady(); } }; -struct TRINITY_DLL_DECL mob_felkael_phoenix_eggAI : public Scripted_NoMovementAI +struct TRINITY_DLL_DECL mob_felkael_phoenix_eggAI : public ScriptedAI { - mob_felkael_phoenix_eggAI(Creature *c) : Scripted_NoMovementAI(c) - { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); - } + mob_felkael_phoenix_eggAI(Creature *c) : ScriptedAI(c) {} uint32 HatchTimer; - ScriptedInstance* pInstance; - void Reset() { HatchTimer = 15000; } - void Aggro(Unit* who) {} + void Reset() + { + HatchTimer = 10000; + + } + + void EnterCombat(Unit* who) {} void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) { - - if(HatchTimer < diff) + if (HatchTimer < diff) { - Creature *bird = DoSpawnCreature(CREATURE_PHOENIX, 0, 0, 0, 0, TEMPSUMMON_CORPSE_DESPAWN, 60000); - if (bird) - { - Unit *boss = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_KAEL)); - if (boss && boss->getVictim()) - { - bird->AddThreat(boss->getVictim(),100); - bird->Attack(boss->getVictim(),true); - bird->GetMotionMaster()->MoveChase(boss->getVictim()); - } - } + DoSpawnCreature(CREATURE_PHOENIX, 0, 0, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000); m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); }else HatchTimer -= diff; + } }; struct TRINITY_DLL_DECL mob_arcane_sphereAI : public ScriptedAI { - mob_arcane_sphereAI(Creature *c) : ScriptedAI(c) - { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); - } + mob_arcane_sphereAI(Creature *c) : ScriptedAI(c) {Reset();} + uint32 DespawnTimer; uint32 ChangeTargetTimer; - uint32 CheckTimer; - - ScriptedInstance* pInstance; void Reset() { - m_creature->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); DespawnTimer = 30000; - ChangeTargetTimer = 5000; - CheckTimer = 1000; - m_creature->SetSpeed(MOVE_RUN, 0.5f); - m_creature->SetSpeed(MOVE_WALK, 0.5f); + ChangeTargetTimer = 6000 + rand()%6000; + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); m_creature->setFaction(14); DoCast(m_creature, SPELL_ARCANE_SPHERE_PASSIVE, true); } - void Aggro(Unit* who) {} - void StalkTarget(Unit* target) - { - if(!target) - return; - m_creature->AddThreat(target,100000); - m_creature->GetMotionMaster()->MoveChase(target); - m_creature->Attack(target,true); - } + void EnterCombat(Unit* who) {} + void UpdateAI(const uint32 diff) { - if(DespawnTimer < diff) + if (DespawnTimer < diff) m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); else DespawnTimer -= diff; - if(!UpdateVictim()) - ChangeTargetTimer = 0; + //Return since we have no target + if (!UpdateVictim()) + return; - if(ChangeTargetTimer < diff) + if (ChangeTargetTimer < diff) { - DoResetThreat(); - Unit *ntarget = SelectUnit(SELECT_TARGET_RANDOM,0); - if (ntarget) - StalkTarget(ntarget); - ChangeTargetTimer = 10000; - }else ChangeTargetTimer -= diff; - if(CheckTimer < diff) - { - if (pInstance) - { - Creature *boss = Unit::GetCreature((*m_creature),pInstance->GetData64(DATA_KAEL)); - if(boss) - { - if(!((boss_felblood_kaelthasAI*)boss->AI())->Phase || boss->isDead()) - DespawnTimer = 0; - }else DespawnTimer = 0; - } - CheckTimer = 1000; - }else CheckTimer -= diff; - } -}; + Unit* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM,0); + if (target) + m_creature->AddThreat(target, 1.0f); + m_creature->TauntApply(target); + AttackStart(target); -bool GOHello_go_kael_orb(Player *player, GameObject* _GO) -{ - ScriptedInstance* pInst = (ScriptedInstance*)_GO->GetInstanceData(); - if (pInst && player) - { - Unit *kael = Unit::GetUnit((*_GO),pInst->GetData64(DATA_KAEL)); - if (kael && kael->isDead()) - player->TeleportTo(530, 12888, -6876, 9, 0.3); - } - return true; -} - -bool GOHello_go_movie_orb(Player *player, GameObject* _GO) -{ - if (player) - { - WorldPacket data(SMSG_TRIGGER_CINEMATIC, 4); - data << (uint32)164; - player->GetSession()->SendPacket(&data); - - if (player->GetQuestStatus(11490) == QUEST_STATUS_INCOMPLETE) - { - Unit *qUnit = player->SummonCreature(25042,player->GetPositionX(),player->GetPositionY(),player->GetPositionZ()-10,0,TEMPSUMMON_CORPSE_DESPAWN,0); - if(qUnit) - player->DealDamage(qUnit, qUnit->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - } + ChangeTargetTimer = 5000 + rand()%10000; + }else ChangeTargetTimer -= diff; } - return true; -} +}; CreatureAI* GetAI_boss_felblood_kaelthas(Creature* c) { @@ -739,28 +670,18 @@ void AddSC_boss_felblood_kaelthas() newscript->RegisterSelf(); newscript = new Script; - newscript->Name="mob_felkael_phoenix"; + newscript->Name = "mob_felkael_phoenix"; newscript->GetAI = &GetAI_mob_felkael_phoenix; newscript->RegisterSelf(); newscript = new Script; - newscript->Name="mob_felkael_phoenix_egg"; + newscript->Name = "mob_felkael_phoenix_egg"; newscript->GetAI = &GetAI_mob_felkael_phoenix_egg; newscript->RegisterSelf(); newscript = new Script; - newscript->Name="mob_felkael_flamestrike"; + newscript->Name = "mob_felkael_flamestrike"; newscript->GetAI = &GetAI_mob_felkael_flamestrike; newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="go_kael_orb"; - newscript->pGOHello = &GOHello_go_kael_orb; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="go_movie_orb"; - newscript->pGOHello = &GOHello_go_movie_orb; - newscript->RegisterSelf(); } diff --git a/src/bindings/scripts/scripts/zone/magisters_terrace/boss_priestess_delrissa.cpp b/src/bindings/scripts/scripts/zone/magisters_terrace/boss_priestess_delrissa.cpp index 36ec57a4e25..e101d9713c5 100644 --- a/src/bindings/scripts/scripts/zone/magisters_terrace/boss_priestess_delrissa.cpp +++ b/src/bindings/scripts/scripts/zone/magisters_terrace/boss_priestess_delrissa.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -96,9 +96,7 @@ struct TRINITY_DLL_DECL boss_priestess_delrissaAI : public ScriptedAI { boss_priestess_delrissaAI(Creature* c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); - Adds.clear(); - //SummonAdds(); + pInstance = (c->GetInstanceData()); Heroic = c->GetMap()->IsHeroic(); } @@ -122,7 +120,6 @@ struct TRINITY_DLL_DECL boss_priestess_delrissaAI : public ScriptedAI void Reset() { - m_creature->SetCorpseDelay(60*60*1000); LackeysKilled = 0; PlayersKilled = 0; @@ -135,18 +132,17 @@ struct TRINITY_DLL_DECL boss_priestess_delrissaAI : public ScriptedAI CombatPulseTimer = 5000; + SummonAdds(); CheckAdds(); - if(pInstance) + if (pInstance) { + pInstance->SetData(DATA_DELRISSA_EVENT, NOT_STARTED); pInstance->SetData(DATA_DELRISSA_DEATH_COUNT, 0); - if (m_creature->isDead()) - pInstance->SetData(DATA_DELRISSA_EVENT, DONE); - else pInstance->SetData(DATA_DELRISSA_EVENT, NOT_STARTED); - }else error_log(ERROR_INST_DATA); + } else error_log(ERROR_INST_DATA); } - void Aggro(Unit* who) + void EnterCombat(Unit* who) { DoScriptText(SAY_AGGRO, m_creature); @@ -157,8 +153,9 @@ struct TRINITY_DLL_DECL boss_priestess_delrissaAI : public ScriptedAI void SummonAdds() { - /*if (m_creature->isDead()) - return;*/ + if(!Adds.empty()) + return; + std::vector<uint32> AddList; for(uint8 i = 0; i < 8; ++i) AddList.push_back(AddEntry[i]); @@ -169,7 +166,7 @@ struct TRINITY_DLL_DECL boss_priestess_delrissaAI : public ScriptedAI for(uint8 i = 0; i < AddList.size(); ++i) { Creature* pAdd = m_creature->SummonCreature(AddList[i], LackeyLocations[i][0], LackeyLocations[i][1], POS_Z, ORIENT, TEMPSUMMON_DEAD_DESPAWN, 0); - if(pAdd) + if (pAdd) { Add* nAdd = new Add(AddList[i], pAdd->GetGUID()); Adds.push_back(nAdd); @@ -179,51 +176,45 @@ struct TRINITY_DLL_DECL boss_priestess_delrissaAI : public ScriptedAI void CheckAdds() { - //if (m_creature->isDead()) - // return; - if(Adds.empty()) - { - SummonAdds(); + if (Adds.empty()) return; - } - for(uint8 i = 0; i < Adds.size(); ++i) + + uint32 n = 0; + for(std::vector<Add*>::iterator i = Adds.begin(); i != Adds.end(); ++i, ++n) { - Creature* pAdd = (Unit::GetCreature(*m_creature, Adds[i]->guid)); + Creature* pAdd = (Unit::GetCreature(*m_creature, (*i)->guid)); if(pAdd && pAdd->isAlive()) { - pAdd->AI()->EnterEvadeMode(); - pAdd->GetMotionMaster()->MovePoint(0,LackeyLocations[i][0], LackeyLocations[i][1], POS_Z); + pAdd->AI()->EnterEvadeMode(); // Force them out of combat and reset if they are in combat. } - if(!pAdd || (pAdd && pAdd->isDead())) + else { + pAdd = m_creature->SummonCreature((*i)->entry, LackeyLocations[n][0], LackeyLocations[n][1], POS_Z, ORIENT, TEMPSUMMON_DEAD_DESPAWN, 0); if(pAdd) - pAdd->RemoveCorpse();//looks stupid if mob is alive but has a dead corpse in front of him :) - Creature* pAdd = m_creature->SummonCreature(Adds[i]->entry, LackeyLocations[i][0], LackeyLocations[i][1], POS_Z, ORIENT, TEMPSUMMON_DEAD_DESPAWN, 0); - if(pAdd) - Adds[i]->guid = pAdd->GetGUID(); + (*i)->guid = pAdd->GetGUID(); + else + (*i)->guid = 0; } } } void KilledUnit(Unit* victim) { - if(victim->GetTypeId() != TYPEID_PLAYER || m_creature->isDead()) + if (victim->GetTypeId() != TYPEID_PLAYER) return; DoScriptText(PlayerDeath[PlayersKilled].id, m_creature); - if( PlayersKilled < 4 ) + + if (PlayersKilled < 4) ++PlayersKilled; } void KilledLackey() { - if(m_creature->isDead())//no sense to talk if dead.. - return; DoScriptText(LackeyDeath[LackeysKilled].id, m_creature); - if( LackeysKilled < 3 ) - ++LackeysKilled; - CheckLootable(); + if (LackeysKilled < 3) + ++LackeysKilled; } void JustDied(Unit* killer) @@ -232,21 +223,21 @@ struct TRINITY_DLL_DECL boss_priestess_delrissaAI : public ScriptedAI CheckLootable(); - if(!pInstance) + if (!pInstance) { error_log(ERROR_INST_DATA); return; } - pInstance->SetData(DATA_DELRISSA_DEATH_COUNT, 1); pInstance->SetData(DATA_DELRISSA_EVENT, DONE); - if(GameObject* Door = GameObject::GetGameObject(*m_creature, pInstance->GetData64(DATA_DELRISSA_DOOR))) - Door->SetGoState(0); + + if (GameObject* Door = GameObject::GetGameObject(*m_creature, pInstance->GetData64(DATA_DELRISSA_DOOR))) + Door->SetGoState(GO_STATE_ACTIVE); } void CheckLootable() { - if(pInstance && pInstance->GetData(DATA_DELRISSA_DEATH_COUNT) >= 4) + if (LackeysKilled > 3) m_creature->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); else m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); @@ -254,7 +245,7 @@ struct TRINITY_DLL_DECL boss_priestess_delrissaAI : public ScriptedAI void UpdateAI(const uint32 diff) { - if(!UpdateVictim()) + if (!UpdateVictim()) return; if(ResetTimer < diff) @@ -269,27 +260,27 @@ struct TRINITY_DLL_DECL boss_priestess_delrissaAI : public ScriptedAI ResetTimer = 5000; }else ResetTimer -= diff; - if(HealTimer < diff) + if (HealTimer < diff) { uint32 health = m_creature->GetHealth(); Unit* target = m_creature; for(uint8 i = 0; i < Adds.size(); ++i) - if(Unit* pAdd = Unit::GetUnit(*m_creature, Adds[i]->guid)) - if(pAdd->isAlive() && pAdd->GetHealth() < health) + if (Unit* pAdd = Unit::GetUnit(*m_creature, Adds[i]->guid)) + if (pAdd->isAlive() && pAdd->GetHealth() < health) target = pAdd; DoCast(target, SPELL_FLASH_HEAL); HealTimer = 15000; }else HealTimer -= diff; - if(RenewTimer < diff) + if (RenewTimer < diff) { Unit* target = m_creature; - if(rand()%2 == 1) + if (rand()%2 == 1) { std::vector<Add*>::iterator itr = Adds.begin() + rand()%Adds.size(); Unit* pAdd = Unit::GetUnit(*m_creature, (*itr)->guid); - if(pAdd && pAdd->isAlive()) + if (pAdd && pAdd->isAlive()) target = pAdd; } DoCast(target,Heroic ? SPELL_RENEW_HEROIC : SPELL_RENEW_NORMAL); @@ -299,44 +290,44 @@ struct TRINITY_DLL_DECL boss_priestess_delrissaAI : public ScriptedAI if(ShieldTimer < diff) { Unit* target = m_creature; - if(rand()%2 == 1) + if (rand()%2 == 1) { std::vector<Add*>::iterator itr = Adds.begin() + rand()%Adds.size(); - if(Unit* pAdd = Unit::GetUnit(*m_creature, (*itr)->guid)) - if(!pAdd->HasAura(SPELL_SHIELD, 0) && pAdd->isAlive()) + if (Unit* pAdd = Unit::GetUnit(*m_creature, (*itr)->guid)) + if (!pAdd->HasAura(SPELL_SHIELD) && pAdd->isAlive()) target = pAdd; } DoCast(target, SPELL_SHIELD); ShieldTimer = 7500; }else ShieldTimer -= diff; - if(DispelTimer < diff) + if (DispelTimer < diff) { Unit* target = NULL; bool friendly = false; - if(rand()%2 == 1) + if (rand()%2 == 1) target = SelectUnit(SELECT_TARGET_RANDOM, 0); else { friendly = true; - if(rand()%2 == 1) + if (rand()%2 == 1) target = m_creature; else { std::vector<Add*>::iterator itr = Adds.begin() + rand()%Adds.size(); Unit* pAdd = Unit::GetUnit(*m_creature, (*itr)->guid); - if(pAdd && pAdd->isAlive()) + if (pAdd && pAdd->isAlive()) target = pAdd; } } - if(target) + if (target) { DoCast(target, SPELL_DISPEL_MAGIC); DispelTimer = 12000; } }else DispelTimer -= diff; - if(SWPainTimer < diff) + if (SWPainTimer < diff) { DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0),Heroic ? SPELL_SW_PAIN_HEROIC : SPELL_SW_PAIN_NORMAL); SWPainTimer = 10000; @@ -367,7 +358,7 @@ struct TRINITY_DLL_DECL boss_priestess_guestAI : public ScriptedAI boss_priestess_guestAI(Creature* c) : ScriptedAI(c) { Group.clear(); - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); AcquireGUIDs(); } @@ -382,61 +373,57 @@ struct TRINITY_DLL_DECL boss_priestess_guestAI : public ScriptedAI void Reset() { UsedPotion = false; - if(pInstance) - { - Creature *boss = (Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_DELRISSA))); - if (boss && boss->isDead()) - boss->Respawn(); - } + ResetThreatTimer = 5000 + rand()%15000; // These guys like to switch targets often, and are not meant to be tanked. } - void Aggro(Unit* who) {} + void EnterCombat(Unit* who) {} void JustDied(Unit* killer) { - if(!pInstance) + if (!pInstance) { error_log(ERROR_INST_DATA); return; } Creature* Delrissa = (Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_DELRISSA))); - if(Delrissa) + if (Delrissa) { - ((boss_priestess_delrissaAI*)Delrissa->AI())->KilledLackey(); - if(!Delrissa->isAlive() && pInstance->GetData(DATA_DELRISSA_DEATH_COUNT) > 3) - ((boss_priestess_delrissaAI*)Delrissa->AI())->CheckLootable(); - pInstance->SetData(DATA_DELRISSA_DEATH_COUNT, 1); + + CAST_AI(boss_priestess_delrissaAI, Delrissa->AI())->KilledLackey(); + + if (!Delrissa->isAlive() && pInstance->GetData(DATA_DELRISSA_DEATH_COUNT) > 3) + Delrissa->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); } } void KilledUnit(Unit* victim) { - if(!pInstance) + if (!pInstance) { error_log(ERROR_INST_DATA); return; } Creature* Delrissa = (Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_DELRISSA))); - if(Delrissa) + if (Delrissa) Delrissa->AI()->KilledUnit(victim); } void AcquireGUIDs() { - if(!pInstance) + if (!pInstance) { error_log(ERROR_INST_DATA); return; } Creature* Delrissa = (Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_DELRISSA))); - if(Delrissa) + if (Delrissa) { - Group = ((boss_priestess_delrissaAI*)Delrissa->AI())->Adds; + Group = CAST_AI(boss_priestess_delrissaAI, Delrissa->AI())->Adds; Add* dAdd = new Add(Delrissa->GetEntry(), Delrissa->GetGUID()); Group.push_back(dAdd); } @@ -444,13 +431,13 @@ struct TRINITY_DLL_DECL boss_priestess_guestAI : public ScriptedAI void UpdateAI(const uint32 diff) { - if(((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 25) && !UsedPotion) + if (((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 25) && !UsedPotion) { DoCast(m_creature, SPELL_HEALING_POTION, true); UsedPotion = true; } - if(ResetThreatTimer < diff) + if (ResetThreatTimer < diff) { DoResetThreat(); ResetThreatTimer = 5000 + rand()%15000; @@ -492,12 +479,12 @@ struct TRINITY_DLL_DECL boss_kagani_nightstrikeAI : public boss_priestess_guestA void UpdateAI(const uint32 diff) { - if(!UpdateVictim() ) + if (!UpdateVictim()) return; boss_priestess_guestAI::UpdateAI(diff); - if(Vanish_Timer < diff) + if (Vanish_Timer < diff) { m_creature->SetVisibility(VISIBILITY_OFF); // ...? Hacklike DoCast(m_creature, SPELL_VANISH); @@ -508,35 +495,36 @@ struct TRINITY_DLL_DECL boss_kagani_nightstrikeAI : public boss_priestess_guestA m_creature->AddThreat(SelectUnit(SELECT_TARGET_RANDOM, 0), 1000.0f); }else Vanish_Timer -= diff; - if(InVanish) - if(Wait_Timer < diff) + if (InVanish) { - DoCast(m_creature->getVictim(), SPELL_BACKSTAB, true); - DoCast(m_creature->getVictim(), SPELL_KIDNEY_SHOT, true); - m_creature->SetVisibility(VISIBILITY_ON); // ...? Hacklike - InVanish = false; - }else Wait_Timer -= diff; + if (Wait_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_BACKSTAB, true); + DoCast(m_creature->getVictim(), SPELL_KIDNEY_SHOT, true); + m_creature->SetVisibility(VISIBILITY_ON); // ...? Hacklike + InVanish = false; + }else Wait_Timer -= diff; + } - if(Gouge_Timer < diff) + if (Gouge_Timer < diff) { DoCast(m_creature->getVictim(), SPELL_GOUGE); - DoModifyThreatPercent(m_creature->getVictim(),-100); Gouge_Timer = 5500; }else Gouge_Timer -= diff; - if(Kick_Timer < diff) + if (Kick_Timer < diff) { DoCast(m_creature->getVictim(), SPELL_KICK); Kick_Timer = 7000; }else Kick_Timer -= diff; - if(Eviscerate_Timer < diff) + if (Eviscerate_Timer < diff) { DoCast(m_creature->getVictim(), SPELL_EVISCERATE); Eviscerate_Timer = 4000; }else Eviscerate_Timer -= diff; - if(!InVanish) + if (!InVanish) DoMeleeAttackIfReady(); } }; @@ -564,11 +552,12 @@ struct TRINITY_DLL_DECL boss_kagani_nightstrikeAI : public boss_priestess_guestA void KilledUnit(Unit* victim); void JustDied(Unit* killer); - void Aggro(Unit* who){} + void EnterCombat(Unit* who){} void UpdateAI(const uint32 diff) { - if (!UpdateVictim() ) + //Return since we have no target + if (!UpdateVictim()) return; //Chain cast @@ -581,9 +570,7 @@ struct TRINITY_DLL_DECL boss_kagani_nightstrikeAI : public boss_priestess_guestA struct TRINITY_DLL_DECL boss_ellris_duskhallowAI : public boss_priestess_guestAI { //Warlock - boss_ellris_duskhallowAI(Creature *c) : boss_priestess_guestAI(c) - { - } + boss_ellris_duskhallowAI(Creature *c) : boss_priestess_guestAI(c) {} bool HasSummonedImp; @@ -595,7 +582,7 @@ struct TRINITY_DLL_DECL boss_ellris_duskhallowAI : public boss_priestess_guestAI void Reset() { - //HasSummonedImp = false; + HasSummonedImp = false; Immolate_Timer = 6000; Shadow_Bolt_Timer = 3000; @@ -613,64 +600,62 @@ struct TRINITY_DLL_DECL boss_ellris_duskhallowAI : public boss_priestess_guestAI void UpdateAI(const uint32 diff) { - if(!HasSummonedImp) + if (!HasSummonedImp) { //Imp will not despawn unless it's killed, even if owner dies, this is correct way. DoCast(m_creature,SPELL_SUMMON_IMP); HasSummonedImp = true; } - if(!UpdateVictim() ) + if (!UpdateVictim()) return; boss_priestess_guestAI::UpdateAI(diff); - if(Immolate_Timer < diff) + if (Immolate_Timer < diff) { DoCast(m_creature->getVictim(),SPELL_IMMOLATE); Immolate_Timer = 6000; }else Immolate_Timer -= diff; - if(Shadow_Bolt_Timer < diff) + if (Shadow_Bolt_Timer < diff) { DoCast(m_creature->getVictim(),SPELL_SHADOW_BOLT); Shadow_Bolt_Timer = 5000; }else Shadow_Bolt_Timer -= diff; - if(Seed_of_Corruption_Timer < diff) + if (Seed_of_Corruption_Timer < diff) { DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_SEED_OF_CORRUPTION); Seed_of_Corruption_Timer = 10000; }else Seed_of_Corruption_Timer -= diff; - if(Curse_of_Agony_Timer < diff) + if (Curse_of_Agony_Timer < diff) { DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_CURSE_OF_AGONY); Curse_of_Agony_Timer = 13000; }else Curse_of_Agony_Timer -= diff; - if(Fear_Timer < diff) + if (Fear_Timer < diff) { DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_FEAR); Fear_Timer = 10000; }else Fear_Timer -= diff; - if (m_creature->GetDistance(m_creature->getVictim()) <= 10) - m_creature->StopMoving(); - //DoMeleeAttackIfReady();//should not melee, she's a warlock + DoMeleeAttackIfReady(); } }; /*void mob_fizzleAI::JustDied(Unit* killer) { if(Creature* Ellris = (Unit::GetCreature(*m_creature, EllrisGUID))) - ((boss_ellris_duskhallowAI*)Ellris->AI())->ImpGUID = 0; + CAST_AI(boss_ellris_duskhallowAI, Ellris->AI())->ImpGUID = 0; } void mob_fizzleAI::KilledUnit(Unit* victim) { if(Creature* Ellris = (Unit::GetCreature(*m_creature, EllrisGUID))) - ((boss_ellris_duskhallowAI*)Ellris->AI())->KilledUnit(victim); + CAST_AI(boss_ellris_duskhallowAI, Ellris->AI())->KilledUnit(victim); }*/ #define SPELL_KNOCKDOWN 11428 @@ -694,18 +679,18 @@ struct TRINITY_DLL_DECL boss_eramas_brightblazeAI : public boss_priestess_guestA void UpdateAI(const uint32 diff) { - if(!UpdateVictim() ) + if (!UpdateVictim()) return; boss_priestess_guestAI::UpdateAI(diff); - if(Knockdown_Timer < diff) + if (Knockdown_Timer < diff) { DoCast(m_creature->getVictim(),SPELL_KNOCKDOWN); Knockdown_Timer = 6000; }else Knockdown_Timer -= diff; - if(Snap_Kick_Timer < diff) + if (Snap_Kick_Timer < diff) { DoCast(m_creature->getVictim(),SPELL_SNAP_KICK); Snap_Kick_Timer = 4500; @@ -726,7 +711,7 @@ struct TRINITY_DLL_DECL boss_eramas_brightblazeAI : public boss_priestess_guestA struct TRINITY_DLL_DECL boss_yazzaiAI : public boss_priestess_guestAI { //Mage - boss_yazzaiAI(Creature *c) : boss_priestess_guestAI(c) {} + boss_yazzaiAI(Creature *c) : boss_priestess_guestAI(c) {} bool HasIceBlocked; @@ -757,82 +742,75 @@ struct TRINITY_DLL_DECL boss_yazzaiAI : public boss_priestess_guestAI void UpdateAI(const uint32 diff) { - if(!UpdateVictim() ) + if (!UpdateVictim()) return; boss_priestess_guestAI::UpdateAI(diff); - if(Polymorph_Timer < diff) + if (Polymorph_Timer < diff) { if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) { DoCast(target, SPELL_POLYMORPH); - DoModifyThreatPercent(target,-100); Polymorph_Timer = 20000; } }else Polymorph_Timer -= diff; - if(((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 35) && !HasIceBlocked) + if (((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 35) && !HasIceBlocked) { DoCast(m_creature, SPELL_ICE_BLOCK); HasIceBlocked = true; } - if(Blizzard_Timer < diff) + if (Blizzard_Timer < diff) { DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_BLIZZARD); Blizzard_Timer = 8000; }else Blizzard_Timer -= diff; - if(Ice_Lance_Timer < diff) + if (Ice_Lance_Timer < diff) { DoCast(m_creature->getVictim(), SPELL_ICE_LANCE); Ice_Lance_Timer = 12000; }else Ice_Lance_Timer -= diff; - if(Cone_of_Cold_Timer < diff) + if (Cone_of_Cold_Timer < diff) { DoCast(m_creature->getVictim(), SPELL_CONE_OF_COLD); Cone_of_Cold_Timer = 10000; }else Cone_of_Cold_Timer -= diff; - if(Frostbolt_Timer < diff) + if (Frostbolt_Timer < diff) { DoCast(m_creature->getVictim(), SPELL_FROSTBOLT); Frostbolt_Timer = 8000; }else Frostbolt_Timer -= diff; - if(Blink_Timer < diff) + if (Blink_Timer < diff) { bool InMeleeRange = false; std::list<HostilReference*>& t_list = m_creature->getThreatManager().getThreatList(); for(std::list<HostilReference*>::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr) { - if(Unit* target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid())) + if (Unit* target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid())) + { //if in melee range if (target->IsWithinDistInMap(m_creature, 5)) { InMeleeRange = true; break; } + } } + //if anybody is in melee range than escape by blink - if(InMeleeRange) - { - //DoCast(m_creature, SPELL_BLINK); //blink does not work on npcs - float x,y,z; - m_creature->GetPosition(x,y,z); - x = rand()%2 ? x+10+rand()%10 : x-10-rand()%10; - y = rand()%2 ? y+10+rand()%10 : y-10-rand()%10; - DoTeleportTo(x, y, z); - } + if (InMeleeRange) + DoCast(m_creature, SPELL_BLINK); + Blink_Timer = 8000; }else Blink_Timer -= diff; - if (m_creature->getVictim() && m_creature->GetDistance(m_creature->getVictim()) <= 10) - m_creature->StopMoving(); - - //DoMeleeAttackIfReady(); //mage type, no melee needed + DoMeleeAttackIfReady(); } }; @@ -865,66 +843,71 @@ struct TRINITY_DLL_DECL boss_warlord_salarisAI : public boss_priestess_guestAI Hamstring_Timer = 4500; Mortal_Strike_Timer = 8000; DoCast(m_creature, SPELL_BATTLE_SHOUT); + boss_priestess_guestAI::Reset(); } - void Aggro(Unit* who) + void EnterCombat(Unit* who) { DoCast(m_creature, SPELL_BATTLE_SHOUT); } void UpdateAI(const uint32 diff) { - if(!UpdateVictim() ) + if (!UpdateVictim()) return; boss_priestess_guestAI::UpdateAI(diff); - if(Intercept_Stun_Timer < diff) + if (Intercept_Stun_Timer < diff) { bool InMeleeRange = false; std::list<HostilReference*>& t_list = m_creature->getThreatManager().getThreatList(); for(std::list<HostilReference*>::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr) { - if(Unit* target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid())) - //if in melee range - if (target->IsWithinDistInMap(m_creature, 5)) + if (Unit* target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid())) { - InMeleeRange = true; - break; + //if in melee range + if (target->IsWithinDistInMap(m_creature, 5)) + { + InMeleeRange = true; + break; + } } } + //if nobody is in melee range than try to use Intercept - if(!InMeleeRange) + if (!InMeleeRange) DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_INTERCEPT_STUN); + Intercept_Stun_Timer = 10000; }else Intercept_Stun_Timer -= diff; - if(Disarm_Timer < diff) + if (Disarm_Timer < diff) { DoCast(m_creature->getVictim(),SPELL_DISARM); Disarm_Timer = 6000; }else Disarm_Timer -= diff; - if(Hamstring_Timer < diff) + if (Hamstring_Timer < diff) { DoCast(m_creature->getVictim(), SPELL_HAMSTRING); Hamstring_Timer = 4500; }else Hamstring_Timer -= diff; - if(Mortal_Strike_Timer < diff) + if (Mortal_Strike_Timer < diff) { DoCast(m_creature->getVictim(), SPELL_MORTAL_STRIKE); Mortal_Strike_Timer = 4500; }else Mortal_Strike_Timer -= diff; - if(Piercing_Howl_Timer < diff) + if (Piercing_Howl_Timer < diff) { DoCast(m_creature->getVictim(), SPELL_PIERCING_HOWL); Piercing_Howl_Timer = 10000; }else Piercing_Howl_Timer -= diff; - if(Frightening_Shout_Timer < diff) + if (Frightening_Shout_Timer < diff) { DoCast(m_creature->getVictim(), SPELL_FRIGHTENING_SHOUT); Frightening_Shout_Timer = 18000; @@ -955,7 +938,7 @@ struct TRINITY_DLL_DECL boss_warlord_salarisAI : public boss_priestess_guestAI void KilledUnit(Unit* victim); void JustDied(Unit* killer); - void Aggro(Unit* who){} + void EnterCombat(Unit* who){} };*/ @@ -973,13 +956,11 @@ struct TRINITY_DLL_DECL boss_garaxxasAI : public boss_priestess_guestAI uint32 Multi_Shot_Timer; uint32 Wing_Clip_Timer; uint32 Freezing_Trap_Timer; - uint32 StopMoving; - bool Stopped; void Reset() { //SliverGUID = 0; - //HasSummonedSliver = false; + HasSummonedSliver = false; Aimed_Shot_Timer = 6000; Shoot_Timer = 2500; @@ -987,8 +968,6 @@ struct TRINITY_DLL_DECL boss_garaxxasAI : public boss_priestess_guestAI Multi_Shot_Timer = 10000; Wing_Clip_Timer = 4000; Freezing_Trap_Timer = 15000; - StopMoving = 2000; - Stopped = false; boss_priestess_guestAI::Reset(); } @@ -1000,88 +979,77 @@ struct TRINITY_DLL_DECL boss_garaxxasAI : public boss_priestess_guestAI void UpdateAI(const uint32 diff) { - if(!HasSummonedSliver) + if (!HasSummonedSliver) { Creature* Sliver = m_creature->SummonCreature(CREATURE_SLIVER, 0, 0, 0, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); - if(Sliver) + if (Sliver) { - //((mob_sliverAI*)Sliver->AI())->GaraxxasGUID = m_creature->GetGUID(); + //CAST_AI(mob_sliverAI, Sliver->AI())->GaraxxasGUID = m_creature->GetGUID(); //SliverGUID = Sliver->GetGUID(); HasSummonedSliver = true; } } - if(!UpdateVictim() ) + if (!UpdateVictim()) return; boss_priestess_guestAI::UpdateAI(diff); - if(m_creature->IsWithinDistInMap(m_creature->getVictim(), 5)) + if (m_creature->IsWithinDistInMap(m_creature->getVictim(), 5.0f)) { - if(Wing_Clip_Timer < diff) + if (Wing_Clip_Timer < diff) { DoCast(m_creature->getVictim(), SPELL_WING_CLIP); Wing_Clip_Timer = 4000; }else Wing_Clip_Timer -= diff; - if(Freezing_Trap_Timer < diff) + if (Freezing_Trap_Timer < diff) { DoCast(m_creature->getVictim(), SPELL_FREEZING_TRAP); - DoModifyThreatPercent(m_creature->getVictim(),-100); Freezing_Trap_Timer = 30000; }else Freezing_Trap_Timer -= diff; - if(!m_creature->getVictim()->hasUnitState(UNIT_STAT_STUNNED | UNIT_STAT_ROOT | UNIT_STAT_CONFUSED | UNIT_STAT_DISTRACTED)) - DoMeleeAttackIfReady(); - }else + DoMeleeAttackIfReady(); + } + else { - if(Concussive_Shot_Timer < diff) + if (Concussive_Shot_Timer < diff) { DoCast(m_creature->getVictim(), SPELL_CONCUSSIVE_SHOT); Concussive_Shot_Timer = 8000; }else Concussive_Shot_Timer -= diff; - if(Multi_Shot_Timer < diff) + if (Multi_Shot_Timer < diff) { DoCast(m_creature->getVictim(), SPELL_MULTI_SHOT); Multi_Shot_Timer = 10000; }else Multi_Shot_Timer -= diff; - if(Aimed_Shot_Timer < diff) + if (Aimed_Shot_Timer < diff) { DoCast(m_creature->getVictim(), SPELL_AIMED_SHOT); Aimed_Shot_Timer = 6000; }else Aimed_Shot_Timer -= diff; - if(Shoot_Timer < diff) + if (Shoot_Timer < diff) { DoCast(m_creature->getVictim(), SPELL_SHOOT); Shoot_Timer = 2500; }else Shoot_Timer -= diff; } - if(StopMoving < diff) - { - if(Stopped) - Stopped = false; - else - Stopped = true; - StopMoving = 2000+rand()%5000; - }else StopMoving -= diff; - if (Stopped) - m_creature->StopMoving(); } }; /*void mob_sliverAI::JustDied(Unit* killer) { if(Creature* Garaxxas = (Unit::GetCreature(*m_creature, GaraxxasGUID))) - ((boss_garaxxasAI*)Garaxxas->AI())->SliverGUID = 0; + CAST_AI(boss_garaxxasAI, Garaxxas->AI())->SliverGUID = 0; } void mob_sliverAI::KilledUnit(Unit* victim) { if(Creature* Garaxxas = (Unit::GetCreature(*m_creature, GaraxxasGUID))) - ((boss_garaxxasAI*)Garaxxas->AI())->KilledUnit(victim); + CAST_AI(boss_garaxxasAI, Garaxxas->AI())->KilledUnit(victim); }*/ #define SPELL_WINDFURY_TOTEM 27621 @@ -1118,12 +1086,12 @@ struct TRINITY_DLL_DECL boss_apokoAI : public boss_priestess_guestAI void UpdateAI(const uint32 diff) { - if(!UpdateVictim() ) + if (!UpdateVictim()) return; boss_priestess_guestAI::UpdateAI(diff); - if(Totem_Timer < diff) + if (Totem_Timer < diff) { switch(rand()%3) { @@ -1135,25 +1103,25 @@ struct TRINITY_DLL_DECL boss_apokoAI : public boss_priestess_guestAI Totem_Timer = Totem_Amount*2000; }else Totem_Timer -= diff; - if(War_Stomp_Timer < diff) + if (War_Stomp_Timer < diff) { DoCast(m_creature, SPELL_WAR_STOMP); War_Stomp_Timer = 10000; }else War_Stomp_Timer -= diff; - if(Purge_Timer < diff) + if (Purge_Timer < diff) { DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_PURGE); Purge_Timer = 15000; }else Purge_Timer -= diff; - if(Frost_Shock_Timer < diff) + if (Frost_Shock_Timer < diff) { DoCast(m_creature->getVictim(), SPELL_FROST_SHOCK); Frost_Shock_Timer = 7000; }else Frost_Shock_Timer -= diff; - if(Healing_Wave_Timer < diff) + if (Healing_Wave_Timer < diff) { // std::vector<Add*>::iterator itr = Group.begin() + rand()%Group.size(); // uint64 guid = (*itr)->guid; @@ -1205,44 +1173,45 @@ struct TRINITY_DLL_DECL boss_zelfanAI : public boss_priestess_guestAI void UpdateAI(const uint32 diff) { - if(!UpdateVictim() ) + if (!UpdateVictim()) return; boss_priestess_guestAI::UpdateAI(diff); - if(Goblin_Dragon_Gun_Timer < diff) + if (Goblin_Dragon_Gun_Timer < diff) { - if (m_creature->GetDistance(m_creature->getVictim()) <= 5) - { - Goblin_Dragon_Gun_Timer = 10000; - DoCast(m_creature->getVictim(), SPELL_GOBLIN_DRAGON_GUN); - }else Goblin_Dragon_Gun_Timer = 2000; + DoCast(m_creature->getVictim(), SPELL_GOBLIN_DRAGON_GUN); + Goblin_Dragon_Gun_Timer = 10000; }else Goblin_Dragon_Gun_Timer -= diff; - if(Rocket_Launch_Timer < diff) + if (Rocket_Launch_Timer < diff) { DoCast(m_creature->getVictim(), SPELL_ROCKET_LAUNCH); Rocket_Launch_Timer = 9000; }else Rocket_Launch_Timer -= diff; - if(Fel_Iron_Bomb_Timer < diff) + if (Fel_Iron_Bomb_Timer < diff) { DoCast(m_creature->getVictim(), SPELL_FEL_IRON_BOMB); Fel_Iron_Bomb_Timer = 15000; }else Fel_Iron_Bomb_Timer -= diff; - if(Recombobulate_Timer < diff) + if (Recombobulate_Timer < diff) { for(uint8 i = 0; i < Group.size(); ++i) - if(Unit* pAdd = Unit::GetUnit(*m_creature, Group[i]->guid)) - if(pAdd->IsPolymorphed()) + { + if (Unit* pAdd = Unit::GetUnit(*m_creature, Group[i]->guid)) + { + if (pAdd->IsPolymorphed()) { DoCast(pAdd, SPELL_RECOMBOBULATE); break; } + } + } }else Recombobulate_Timer -= diff; - if(High_Explosive_Sheep_Timer < diff) + if (High_Explosive_Sheep_Timer < diff) { DoCast(m_creature, SPELL_HIGH_EXPLOSIVE_SHEEP); High_Explosive_Sheep_Timer = 65000; @@ -1265,7 +1234,7 @@ struct TRINITY_DLL_DECL boss_zelfanAI : public boss_priestess_guestAI // // void JustDied(Unit *Killer){} // -// void Aggro(Unit *who){} +// void EnterCombat(Unit *who){} // // void UpdateAI(const uint32 diff) // { @@ -1342,62 +1311,62 @@ void AddSC_boss_priestess_delrissa() Script *newscript; newscript = new Script; - newscript->Name="boss_priestess_delrissa"; + newscript->Name = "boss_priestess_delrissa"; newscript->GetAI = &GetAI_boss_priestess_delrissa; newscript->RegisterSelf(); newscript = new Script; - newscript->Name="boss_kagani_nightstrike"; + newscript->Name = "boss_kagani_nightstrike"; newscript->GetAI = &GetAI_boss_kagani_nightstrike; newscript->RegisterSelf(); newscript = new Script; - newscript->Name="boss_ellris_duskhallow"; + newscript->Name = "boss_ellris_duskhallow"; newscript->GetAI = &GetAI_ellris_duskhallow; newscript->RegisterSelf(); newscript = new Script; - newscript->Name="boss_eramas_brightblaze"; + newscript->Name = "boss_eramas_brightblaze"; newscript->GetAI = &GetAI_eramas_brightblaze; newscript->RegisterSelf(); newscript = new Script; - newscript->Name="boss_yazzai"; + newscript->Name = "boss_yazzai"; newscript->GetAI = &GetAI_yazzai; newscript->RegisterSelf(); newscript = new Script; - newscript->Name="boss_warlord_salaris"; + newscript->Name = "boss_warlord_salaris"; newscript->GetAI = &GetAI_warlord_salaris; newscript->RegisterSelf(); newscript = new Script; - newscript->Name="boss_garaxxas"; + newscript->Name = "boss_garaxxas"; newscript->GetAI = &GetAI_garaxxas; newscript->RegisterSelf(); newscript = new Script; - newscript->Name="boss_apoko"; + newscript->Name = "boss_apoko"; newscript->GetAI = &GetAI_apoko; newscript->RegisterSelf(); newscript = new Script; - newscript->Name="boss_zelfan"; + newscript->Name = "boss_zelfan"; newscript->GetAI = &GetAI_zelfan; newscript->RegisterSelf(); /*newscript = new Script; - newscript->Name="mob_high_explosive_sheep"; + newscript->Name = "mob_high_explosive_sheep"; newscript->GetAI = &GetAI_mob_high_explosive_sheep; newscript->RegisterSelf();*/ /*newscript = new Script; - newscript->Name="mob_fizzle"; + newscript->Name = "mob_fizzle"; newscript->GetAI = &GetAI_mob_fizzle; newscript->RegisterSelf();*/ /*newscript = new Script; - newscript->Name="mob_sliver"; + newscript->Name = "mob_sliver"; newscript->GetAI = &GetAI_mob_sliver; newscript->RegisterSelf();*/ } diff --git a/src/bindings/scripts/scripts/zone/magisters_terrace/boss_selin_fireheart.cpp b/src/bindings/scripts/scripts/zone/magisters_terrace/boss_selin_fireheart.cpp index a56d6a4dd3d..b23abd1da2a 100644 --- a/src/bindings/scripts/scripts/zone/magisters_terrace/boss_selin_fireheart.cpp +++ b/src/bindings/scripts/scripts/zone/magisters_terrace/boss_selin_fireheart.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -6,12 +6,12 @@ * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* ScriptData @@ -32,7 +32,7 @@ EndScriptData */ #define SAY_DEATH -1585005 #define EMOTE_CRYSTAL -1585006 -//Crystal efect spells +//Crystal effect spells #define SPELL_FEL_CRYSTAL_COSMETIC 44374 #define SPELL_FEL_CRYSTAL_DUMMY 44329 #define SPELL_FEL_CRYSTAL_VISUAL 44355 @@ -53,11 +53,11 @@ struct TRINITY_DLL_DECL boss_selin_fireheartAI : public ScriptedAI { boss_selin_fireheartAI(Creature* c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); Crystals.clear(); - // GUIDs per instance is static, so we only need to load them once. - if(pInstance) + //GUIDs per instance is static, so we only need to load them once. + if (pInstance) { uint32 size = pInstance->GetData(DATA_FEL_CRYSTAL_SIZE); for(uint8 i = 0; i < size; ++i) @@ -71,6 +71,7 @@ struct TRINITY_DLL_DECL boss_selin_fireheartAI : public ScriptedAI } ScriptedInstance* pInstance; + bool Heroic; std::list<uint64> Crystals; @@ -78,39 +79,38 @@ struct TRINITY_DLL_DECL boss_selin_fireheartAI : public ScriptedAI uint32 DrainManaTimer; uint32 FelExplosionTimer; uint32 DrainCrystalTimer; - uint32 CheckTimer; + uint32 EmpowerTimer; bool IsDraining; bool DrainingCrystal; - bool Heroic; + uint64 CrystalGUID; // This will help us create a pointer to the crystal we are draining. We store GUIDs, never units in case unit is deleted/offline (offline if player of course). void Reset() { - if(pInstance) + if (pInstance) { //for(uint8 i = 0; i < CRYSTALS_NUMBER; ++i) for(std::list<uint64>::iterator itr = Crystals.begin(); itr != Crystals.end(); ++itr) { //Unit* pUnit = Unit::GetUnit(*m_creature, FelCrystals[i]); Unit* pUnit = Unit::GetUnit(*m_creature, *itr); - if(pUnit) + if (pUnit) { if(!pUnit->isAlive()) - ((Creature*)pUnit)->Respawn(); // Let MaNGOS handle setting death state, etc. + CAST_CRE(pUnit)->Respawn(); // Let MaNGOS handle setting death state, etc. // Only need to set unselectable flag. You can't attack unselectable units so non_attackable flag is not necessary here. pUnit->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); } } + GameObject* Door = GameObject::GetGameObject(*m_creature, pInstance->GetData64(DATA_SELIN_ENCOUNTER_DOOR)); - if( Door ) - Door->SetGoState(0); // Open the big encounter door. Close it in Aggro and open it only in JustDied(and here) + if (Door) + Door->SetGoState(GO_STATE_ACTIVE); // Open the big encounter door. Close it in Aggro and open it only in JustDied(and here) // Small door opened after event are expected to be closed by default // Set Inst data for encounter - if (m_creature->isDead()) - pInstance->SetData(DATA_SELIN_EVENT, DONE); - else pInstance->SetData(DATA_SELIN_EVENT, NOT_STARTED); + pInstance->SetData(DATA_SELIN_EVENT, NOT_STARTED); }else error_log(ERROR_INST_DATA); DrainLifeTimer = 3000 + rand()%4000; @@ -118,7 +118,7 @@ struct TRINITY_DLL_DECL boss_selin_fireheartAI : public ScriptedAI FelExplosionTimer = 2100; DrainCrystalTimer = 10000 + rand()%5000; DrainCrystalTimer = 20000 + rand()%5000; - CheckTimer = 1000; + EmpowerTimer = 10000; IsDraining = false; DrainingCrystal = false; @@ -127,7 +127,7 @@ struct TRINITY_DLL_DECL boss_selin_fireheartAI : public ScriptedAI void SelectNearestCrystal() { - if(Crystals.empty()) + if (Crystals.empty()) return; float ShortestDistance = 0; @@ -140,9 +140,9 @@ struct TRINITY_DLL_DECL boss_selin_fireheartAI : public ScriptedAI pCrystal = NULL; //pCrystal = Unit::GetUnit(*m_creature, FelCrystals[i]); pCrystal = Unit::GetUnit(*m_creature, *itr); - if(pCrystal && pCrystal->isAlive()) + if (pCrystal && pCrystal->isAlive()) { - if(!ShortestDistance || (ShortestDistance > m_creature->GetDistance2d(pCrystal))) + if (!ShortestDistance || (ShortestDistance > m_creature->GetDistance2d(pCrystal))) { ShortestDistance = m_creature->GetDistance2d(pCrystal); CrystalGUID = pCrystal->GetGUID(); @@ -150,7 +150,7 @@ struct TRINITY_DLL_DECL boss_selin_fireheartAI : public ScriptedAI } } } - if( CrystalChosen ) + if (CrystalChosen) { DoScriptText(SAY_ENERGY, m_creature); DoScriptText(EMOTE_CRYSTAL, m_creature); @@ -168,7 +168,7 @@ struct TRINITY_DLL_DECL boss_selin_fireheartAI : public ScriptedAI void ShatterRemainingCrystals() { - if(Crystals.empty()) + if (Crystals.empty()) return; //for(uint8 i = 0; i < CRYSTALS_NUMBER; ++i) @@ -176,21 +176,20 @@ struct TRINITY_DLL_DECL boss_selin_fireheartAI : public ScriptedAI { //Creature* pCrystal = (Unit::GetCreature(*m_creature, FelCrystals[i])); Creature* pCrystal = (Unit::GetCreature(*m_creature, *itr)); - if( pCrystal && pCrystal->isAlive()) + if (pCrystal && pCrystal->isAlive()) pCrystal->DealDamage(pCrystal, pCrystal->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); } } - void Aggro(Unit* who) + void EnterCombat(Unit* who) { - m_creature->SetPower(POWER_MANA, 0); DoScriptText(SAY_AGGRO, m_creature); - if( pInstance ) + if (pInstance) { GameObject* EncounterDoor = GameObject::GetGameObject(*m_creature, pInstance->GetData64(DATA_SELIN_ENCOUNTER_DOOR)); - if( EncounterDoor ) - EncounterDoor->SetGoState(1); //Close the encounter door, open it in JustDied/Reset + if (EncounterDoor) + EncounterDoor->SetGoState(GO_STATE_READY); //Close the encounter door, open it in JustDied/Reset } } @@ -198,17 +197,17 @@ struct TRINITY_DLL_DECL boss_selin_fireheartAI : public ScriptedAI { switch(rand()%2) { - case 0: DoScriptText(SAY_KILL_1, m_creature); break; - case 1: DoScriptText(SAY_KILL_2, m_creature); break; + case 0: DoScriptText(SAY_KILL_1, m_creature); break; + case 1: DoScriptText(SAY_KILL_2, m_creature); break; } } void MovementInform(uint32 type, uint32 id) { - if(type == POINT_MOTION_TYPE && id == 1) + if (type == POINT_MOTION_TYPE && id == 1) { Unit* CrystalChosen = Unit::GetUnit(*m_creature, CrystalGUID); - if(CrystalChosen && CrystalChosen->isAlive()) + if (CrystalChosen && CrystalChosen->isAlive()) { // Make the crystal attackable // We also remove NON_ATTACKABLE in case the database has it set. @@ -229,7 +228,7 @@ struct TRINITY_DLL_DECL boss_selin_fireheartAI : public ScriptedAI { DoScriptText(SAY_DEATH, m_creature); - if(!pInstance) + if (!pInstance) { error_log(ERROR_INST_DATA); return; @@ -238,35 +237,36 @@ struct TRINITY_DLL_DECL boss_selin_fireheartAI : public ScriptedAI pInstance->SetData(DATA_SELIN_EVENT, DONE); // Encounter complete! GameObject* EncounterDoor = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_SELIN_ENCOUNTER_DOOR)); - if( EncounterDoor ) - EncounterDoor->SetGoState(0); // Open the encounter door + if (EncounterDoor) + EncounterDoor->SetGoState(GO_STATE_ACTIVE); // Open the encounter door GameObject* ContinueDoor = GameObject::GetGameObject(*m_creature, pInstance->GetData64(DATA_SELIN_DOOR)); - if( ContinueDoor ) - ContinueDoor->SetGoState(0); // Open the door leading further in + if (ContinueDoor) + ContinueDoor->SetGoState(GO_STATE_ACTIVE); // Open the door leading further in + ShatterRemainingCrystals(); } void UpdateAI(const uint32 diff) { - if(!UpdateVictim()) + if (!UpdateVictim()) return; - if(!DrainingCrystal) + if (!DrainingCrystal) { uint32 maxPowerMana = m_creature->GetMaxPower(POWER_MANA); - if( maxPowerMana && ((m_creature->GetPower(POWER_MANA)*100 / maxPowerMana) < 10) ) + if (maxPowerMana && ((m_creature->GetPower(POWER_MANA)*100 / maxPowerMana) < 10)) { - if( DrainLifeTimer < diff ) + if (DrainLifeTimer < diff) { DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_DRAIN_LIFE); DrainLifeTimer = 10000; }else DrainLifeTimer -= diff; // Heroic only - if( Heroic ) + if (Heroic) { - if( DrainManaTimer < diff ) + if (DrainManaTimer < diff) { DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_DRAIN_MANA); DrainManaTimer = 10000; @@ -274,9 +274,9 @@ struct TRINITY_DLL_DECL boss_selin_fireheartAI : public ScriptedAI } } - if( FelExplosionTimer < diff ) + if (FelExplosionTimer < diff) { - if(!m_creature->IsNonMeleeSpellCasted(false)) + if (!m_creature->IsNonMeleeSpellCasted(false)) { DoCast(m_creature, SPELL_FEL_EXPLOSION); FelExplosionTimer = 2000; @@ -285,48 +285,40 @@ struct TRINITY_DLL_DECL boss_selin_fireheartAI : public ScriptedAI // If below 10% mana, start recharging maxPowerMana = m_creature->GetMaxPower(POWER_MANA); - if( maxPowerMana && ((m_creature->GetPower(POWER_MANA)*100 / maxPowerMana) < 10) ) + if (maxPowerMana && ((m_creature->GetPower(POWER_MANA)*100 / maxPowerMana) < 10)) { - if(DrainCrystalTimer < diff) + if (DrainCrystalTimer < diff) { SelectNearestCrystal(); - if(Heroic) DrainCrystalTimer = 10000 + rand()%5000; - else DrainCrystalTimer = 20000 + rand()%5000; + if (Heroic) DrainCrystalTimer = 10000 + rand()%5000; + else DrainCrystalTimer = 20000 + rand()%5000; }else DrainCrystalTimer -= diff; } }else { - if( IsDraining ) + if (IsDraining) { - if (CheckTimer < diff) + if (EmpowerTimer < diff) { + IsDraining = false; + DrainingCrystal = false; + + DoScriptText(SAY_EMPOWERED, m_creature); + Unit* CrystalChosen = Unit::GetUnit(*m_creature, CrystalGUID); - if(CrystalChosen) - { - if(CrystalChosen->GetUInt32Value(UNIT_CHANNEL_SPELL) == SPELL_MANA_RAGE) - { - m_creature->StopMoving(); - }else{ - IsDraining = false; - DrainingCrystal = false; - - DoScriptText(SAY_EMPOWERED, m_creature); - - Unit* CrystalChosen = Unit::GetUnit(*m_creature, CrystalGUID); - if( CrystalChosen && CrystalChosen->isAlive() ) - // Use Deal Damage to kill it, not setDeathState. - CrystalChosen->DealDamage(CrystalChosen, CrystalChosen->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - CrystalGUID = 0; - - m_creature->GetMotionMaster()->Clear(); - m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); - } - } - CheckTimer = 1000; - }else CheckTimer -= diff; + if (CrystalChosen && CrystalChosen->isAlive()) + // Use Deal Damage to kill it, not setDeathState. + CrystalChosen->DealDamage(CrystalChosen, CrystalChosen->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + + CrystalGUID = 0; + + m_creature->GetMotionMaster()->Clear(); + m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); + }else EmpowerTimer -= diff; } } + DoMeleeAttackIfReady(); // No need to check if we are draining crystal here, as the spell has a stun. } }; @@ -341,26 +333,25 @@ struct TRINITY_DLL_DECL mob_fel_crystalAI : public ScriptedAI mob_fel_crystalAI(Creature *c) : ScriptedAI(c) {} void Reset() {} - void Aggro(Unit* who) {} + void EnterCombat(Unit* who) {} void AttackStart(Unit* who) {} void MoveInLineOfSight(Unit* who) {} void UpdateAI(const uint32 diff) {} void JustDied(Unit* killer) { - m_creature->RemoveAurasDueToSpell(SPELL_MANA_RAGE); - if(ScriptedInstance* pInstance = ((ScriptedInstance*)m_creature->GetInstanceData())) + if (ScriptedInstance* pInstance = (m_creature->GetInstanceData())) { Creature* Selin = (Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_SELIN))); - if(Selin && Selin->isAlive()) + if (Selin && Selin->isAlive()) { - if(((boss_selin_fireheartAI*)Selin->AI())->CrystalGUID == m_creature->GetGUID()) + if(CAST_AI(boss_selin_fireheartAI, Selin->AI())->CrystalGUID == m_creature->GetGUID()) { // Set this to false if we are the creature that Selin is draining so his AI flows properly - ((boss_selin_fireheartAI*)Selin->AI())->DrainingCrystal = false; - ((boss_selin_fireheartAI*)Selin->AI())->IsDraining = false; - Selin->RemoveAurasDueToSpell(SPELL_MANA_RAGE); - if(Selin->getVictim()) + CAST_AI(boss_selin_fireheartAI, Selin->AI())->DrainingCrystal = false; + CAST_AI(boss_selin_fireheartAI, Selin->AI())->IsDraining = false; + CAST_AI(boss_selin_fireheartAI, Selin->AI())->EmpowerTimer = 10000; + if (Selin->getVictim()) { Selin->AI()->AttackStart(Selin->getVictim()); Selin->GetMotionMaster()->MoveChase(Selin->getVictim()); @@ -381,12 +372,12 @@ void AddSC_boss_selin_fireheart() Script *newscript; newscript = new Script; - newscript->Name="boss_selin_fireheart"; + newscript->Name = "boss_selin_fireheart"; newscript->GetAI = &GetAI_boss_selin_fireheart; newscript->RegisterSelf(); newscript = new Script; - newscript->Name="mob_fel_crystal"; + newscript->Name = "mob_fel_crystal"; newscript->GetAI = &GetAI_mob_fel_crystal; newscript->RegisterSelf(); } diff --git a/src/bindings/scripts/scripts/zone/magisters_terrace/boss_vexallus.cpp b/src/bindings/scripts/scripts/zone/magisters_terrace/boss_vexallus.cpp index 5575e700405..fb31a3783da 100644 --- a/src/bindings/scripts/scripts/zone/magisters_terrace/boss_vexallus.cpp +++ b/src/bindings/scripts/scripts/zone/magisters_terrace/boss_vexallus.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -6,12 +6,12 @@ * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* ScriptData @@ -29,31 +29,36 @@ EndScriptData */ #define SAY_OVERLOAD -1585009 #define SAY_KILL -1585010 #define EMOTE_DISCHARGE_ENERGY -1585011 + //is this text for real? -#define SAY_DEATH "What...happen...ed." +//#define SAY_DEATH "What...happen...ed." //Pure energy spell info -#define SPELL_ENERGY_BOLT 44342 +#define SPELL_ENERGY_BOLT 46156 #define SPELL_ENERGY_FEEDBACK 44335 //Vexallus spell info #define SPELL_CHAIN_LIGHTNING 44318 -#define SPELL_SUMMON_PURE_ENERGY 44322 //not-working, this script summon this creatures without this spell #define SPELL_OVERLOAD 44353 #define SPELL_ARCANE_SHOCK 44319 -#define ASTRAL_FLARE_VISUAL 30237 + +#define SPELL_SUMMON_PURE_ENERGY 44322 //mod scale -10 +#define H_SPELL_SUMMON_PURE_ENERGY1 46154 //mod scale -5 +#define H_SPELL_SUMMON_PURE_ENERGY2 46159 //mod scale -5 //Creatures #define CREATURE_PURE_ENERGY 24745 -struct TRINITY_DLL_DECL boss_vexallusAI : public ScriptedAI +struct TRINITY_DLL_DECL boss_vexallusAI : public ScriptedAI { boss_vexallusAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); Heroic = c->GetMap()->IsHeroic(); + pInstance = (c->GetInstanceData()); Heroic = c->GetMap()->IsHeroic(); + Heroic = c->GetMap()->IsHeroic(); } ScriptedInstance* pInstance; + bool Heroic; uint32 ChainLightningTimer; uint32 ArcaneShockTimer; @@ -61,7 +66,6 @@ struct TRINITY_DLL_DECL boss_vexallusAI : public ScriptedAI uint32 SpawnAddInterval; uint32 AlreadySpawnedAmount; bool Enraged; - bool Heroic; void Reset() { @@ -70,15 +74,10 @@ struct TRINITY_DLL_DECL boss_vexallusAI : public ScriptedAI OverloadTimer = 2200; SpawnAddInterval = 15; AlreadySpawnedAmount = 0; - Enraged = false; - if(pInstance) - { - if (m_creature->isDead()) - pInstance->SetData(DATA_VEXALLUS_EVENT, DONE); - else pInstance->SetData(DATA_VEXALLUS_EVENT, NOT_STARTED); - } + if (pInstance) + pInstance->SetData(DATA_VEXALLUS_EVENT, NOT_STARTED); } void KilledUnit(Unit *victim) @@ -88,84 +87,95 @@ struct TRINITY_DLL_DECL boss_vexallusAI : public ScriptedAI void JustDied(Unit *victim) { - DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL); if (pInstance) { pInstance->SetData(DATA_VEXALLUS_EVENT, DONE); - GameObject* Door = NULL; - Door = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_VEXALLUS_DOOR)); - if(Door) - Door->SetGoState(0); + if (GameObject* Door = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_VEXALLUS_DOOR))) + Door->SetGoState(GO_STATE_ACTIVE); } } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { DoScriptText(SAY_AGGRO, m_creature); + if (pInstance) pInstance->SetData(DATA_VEXALLUS_EVENT, IN_PROGRESS); } + void JustSummoned(Creature *summoned) + { + if (Unit *temp = SelectUnit(SELECT_TARGET_RANDOM, 0)) + summoned->GetMotionMaster()->MoveFollow(temp,0,0); + + //spells are SUMMON_TYPE_GUARDIAN, so using setOwner should be ok + summoned->CastSpell(summoned,SPELL_ENERGY_BOLT,false,0,0,m_creature->GetGUID()); + } + void UpdateAI(const uint32 diff) { if (!UpdateVictim() ) return; - if(m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 11) + if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 10) { Enraged = true; } - if(!Enraged) + if (!Enraged) { //used for check, when Vexallus cast adds 85%, 70%, 55%, 40%, 25% if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < (100-(SpawnAddInterval*(AlreadySpawnedAmount+1)))) { DoScriptText(SAY_ENERGY, m_creature); DoScriptText(EMOTE_DISCHARGE_ENERGY, m_creature); - Creature* PureEnergyCreature = NULL; - PureEnergyCreature = DoSpawnCreature(CREATURE_PURE_ENERGY, 10, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); - Unit* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (PureEnergyCreature && target) - PureEnergyCreature->AI()->AttackStart(target); - - if(Heroic) // *Heroic mode only - he summons two instead of one. + + if (Heroic) { - PureEnergyCreature = DoSpawnCreature(CREATURE_PURE_ENERGY, -10, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); - target = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (PureEnergyCreature && target) - PureEnergyCreature->AI()->AttackStart(target); + m_creature->CastSpell(m_creature,H_SPELL_SUMMON_PURE_ENERGY1,false); + m_creature->CastSpell(m_creature,H_SPELL_SUMMON_PURE_ENERGY2,false); } + else + m_creature->CastSpell(m_creature,SPELL_SUMMON_PURE_ENERGY,false); + + //below are workaround summons, remove when summoning spells w/implicitTarget 73 implemented in Mangos + DoSpawnCreature(CREATURE_PURE_ENERGY, 0, 0, 0, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); + + if (Heroic) + DoSpawnCreature(CREATURE_PURE_ENERGY, 0, 0, 0, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); ++AlreadySpawnedAmount; - }; + } - if(ChainLightningTimer < diff) + if (ChainLightningTimer < diff) { if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) DoCast(target, SPELL_CHAIN_LIGHTNING); + ChainLightningTimer = 10000; }else ChainLightningTimer -= diff; - if(ArcaneShockTimer < diff) + if (ArcaneShockTimer < diff) { - Unit* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) if(target) DoCast(target, SPELL_ARCANE_SHOCK); + ArcaneShockTimer = 8000; }else ArcaneShockTimer -= diff; - }else + } + else { - if(OverloadTimer < diff) + if (OverloadTimer < diff) { if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) DoCast(target, SPELL_OVERLOAD); + OverloadTimer = 2200; }else OverloadTimer -= diff; } + DoMeleeAttackIfReady(); } }; @@ -175,44 +185,24 @@ CreatureAI* GetAI_boss_vexallus(Creature *_Creature) return new boss_vexallusAI (_Creature); }; -struct TRINITY_DLL_DECL mob_pure_energyAI : public ScriptedAI +struct TRINITY_DLL_DECL mob_pure_energyAI : public ScriptedAI { mob_pure_energyAI(Creature *c) : ScriptedAI(c) {} - uint32 EnergyBoltTimer; - uint32 VisualTimer; - - void Reset() - { - EnergyBoltTimer = 1700; - VisualTimer = 1000; - m_creature->SetSpeed(MOVE_RUN, 0.5f); - m_creature->SetSpeed(MOVE_WALK, 0.5f); - } + void Reset() { } void JustDied(Unit* slayer) { - slayer->CastSpell(slayer, SPELL_ENERGY_FEEDBACK, true, 0, 0, m_creature->GetGUID()); - } - - void Aggro(Unit *who){} - - void UpdateAI(const uint32 diff) - { - if(!UpdateVictim()) - return; - - if(EnergyBoltTimer < diff) + if (Unit *temp = m_creature->GetOwner()) { - DoCast(m_creature->getVictim(), SPELL_ENERGY_BOLT); - EnergyBoltTimer = 1700; - }else EnergyBoltTimer -= diff; - if(VisualTimer < diff) - { - DoCast(m_creature->getVictim(), ASTRAL_FLARE_VISUAL, true); - VisualTimer = 1000; - }else VisualTimer -= diff; + if (temp && temp->isAlive()) + slayer->CastSpell(slayer, SPELL_ENERGY_FEEDBACK, true, 0, 0, temp->GetGUID()); + } } + + void EnterCombat(Unit *who) { } + void MoveInLineOfSight(Unit *who) { } + void AttackStart(Unit *who) { } }; CreatureAI* GetAI_mob_pure_energy(Creature *_Creature) @@ -225,13 +215,12 @@ void AddSC_boss_vexallus() Script *newscript; newscript = new Script; - newscript->Name="boss_vexallus"; + newscript->Name = "boss_vexallus"; newscript->GetAI = &GetAI_boss_vexallus; newscript->RegisterSelf(); newscript = new Script; - newscript->Name="mob_pure_energy"; + newscript->Name = "mob_pure_energy"; newscript->GetAI = &GetAI_mob_pure_energy; newscript->RegisterSelf(); } - diff --git a/src/bindings/scripts/scripts/zone/magisters_terrace/def_magisters_terrace.h b/src/bindings/scripts/scripts/zone/magisters_terrace/def_magisters_terrace.h index f509a8bc73c..d6419ea409c 100644 --- a/src/bindings/scripts/scripts/zone/magisters_terrace/def_magisters_terrace.h +++ b/src/bindings/scripts/scripts/zone/magisters_terrace/def_magisters_terrace.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * This program is free software licensed under GPL version 2 * Please see the included DOCS/LICENSE.TXT for more information */ @@ -20,13 +20,12 @@ #define DATA_DELRISSA_DOOR 11 #define DATA_SELIN_ENCOUNTER_DOOR 12 -#define DATA_KAEL_STATUE_LEFT 13 -#define DATA_KAEL_STATUE_RIGHT 14 +#define DATA_KAEL_DOOR 13 +#define DATA_KAEL_STATUE_LEFT 14 +#define DATA_KAEL_STATUE_RIGHT 15 -#define DATA_DELRISSA_DEATH_COUNT 15 +#define DATA_DELRISSA_DEATH_COUNT 16 -#define DATA_KAEL 16 - -#define ERROR_INST_DATA "SD2 Error: Instance Data not set properly for Magister's Terrace instance (map 585). Encounters will be buggy." +#define ERROR_INST_DATA "TSCR Error: Instance Data not set properly for Magister's Terrace instance (map 585). Encounters will be buggy." #endif diff --git a/src/bindings/scripts/scripts/zone/magisters_terrace/instance_magisters_terrace.cpp b/src/bindings/scripts/scripts/zone/magisters_terrace/instance_magisters_terrace.cpp index 4ef61128257..57484cb5ef4 100644 --- a/src/bindings/scripts/scripts/zone/magisters_terrace/instance_magisters_terrace.cpp +++ b/src/bindings/scripts/scripts/zone/magisters_terrace/instance_magisters_terrace.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -6,12 +6,12 @@ * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* ScriptData @@ -37,29 +37,25 @@ struct TRINITY_DLL_DECL instance_magisters_terrace : public ScriptedInstance { instance_magisters_terrace(Map* map) : ScriptedInstance(map) {Initialize();} - uint32 DoorState[3];//0seline, 1vexallus, 2derlissa uint32 Encounters[NUMBER_OF_ENCOUNTERS]; uint32 DelrissaDeathCount; std::list<uint64> FelCrystals; std::list<uint64>::iterator CrystalItr; - uint64 KaelGUID; uint64 SelinGUID; uint64 DelrissaGUID; uint64 VexallusDoorGUID; uint64 SelinDoorGUID; uint64 SelinEncounterDoorGUID; uint64 DelrissaDoorGUID; + uint64 KaelDoorGUID; uint64 KaelStatue[2]; bool InitializedItr; void Initialize() { - for(uint8 i = 0; i < 3; i++) - DoorState[i] = 1;//1 closed, 0 opened - for(uint8 i = 0; i < NUMBER_OF_ENCOUNTERS; i++) Encounters[i] = NOT_STARTED; @@ -67,13 +63,13 @@ struct TRINITY_DLL_DECL instance_magisters_terrace : public ScriptedInstance DelrissaDeathCount = 0; - KaelGUID = 0; SelinGUID = 0; DelrissaGUID = 0; VexallusDoorGUID = 0; SelinDoorGUID = 0; SelinEncounterDoorGUID = 0; DelrissaDoorGUID = 0; + KaelDoorGUID = 0; KaelStatue[0] = 0; KaelStatue[1] = 0; @@ -106,30 +102,9 @@ struct TRINITY_DLL_DECL instance_magisters_terrace : public ScriptedInstance { switch(identifier) { - case DATA_SELIN_EVENT: - Encounters[0] = data; - if(data==DONE) - { - DoorState[0] = 0; - SaveToDB(); - } - break; - case DATA_VEXALLUS_EVENT: - Encounters[1] = data; - if(data==DONE) - { - DoorState[1] = 0; - SaveToDB(); - } - break; - case DATA_DELRISSA_EVENT: - Encounters[2] = data; - if(data==DONE) - { - DoorState[2] = 0; - SaveToDB(); - } - break; + case DATA_SELIN_EVENT: Encounters[0] = data; break; + case DATA_VEXALLUS_EVENT: Encounters[1] = data; break; + case DATA_DELRISSA_EVENT: Encounters[2] = data; break; case DATA_KAELTHAS_EVENT: Encounters[3] = data; break; case DATA_DELRISSA_DEATH_COUNT: @@ -138,38 +113,13 @@ struct TRINITY_DLL_DECL instance_magisters_terrace : public ScriptedInstance } } - const char* Save() - { - std::ostringstream ss; - ss << "S " << DoorState[0] << " " << DoorState[1] << " " << DoorState[2]; - char* data = new char[ss.str().length()+1]; - strcpy(data, ss.str().c_str()); - return data; - } - - void Load(const char* load) - { - if(!load) return; - std::istringstream ss(load); - char dataHead; // S - uint32 data1, data2, data3; - ss >> dataHead >> data1 >> data2 >> data3; - if(dataHead == 'S') - { - DoorState[0] = data1; - DoorState[1] = data2; - DoorState[2] = data3; - }else error_log("TSCR: Magister's Terrace: corrupted save data."); - } - void OnCreatureCreate(Creature *creature, uint32 entry) { - switch(entry) + switch(creature->GetEntry()) { case 24723: SelinGUID = creature->GetGUID(); break; case 24560: DelrissaGUID = creature->GetGUID(); break; case 24722: FelCrystals.push_back(creature->GetGUID()); break; - case 24664: KaelGUID = creature->GetGUID(); break; } } @@ -177,21 +127,13 @@ struct TRINITY_DLL_DECL instance_magisters_terrace : public ScriptedInstance { switch(go->GetEntry()) { - case 187896: - VexallusDoorGUID = go->GetGUID(); - go->SetGoState(DoorState[1]); - break; + case 187896: VexallusDoorGUID = go->GetGUID(); break; //SunwellRaid Gate 02 - case 187979: - SelinDoorGUID = go->GetGUID(); - go->SetGoState(DoorState[0]); - break; + case 187979: SelinDoorGUID = go->GetGUID(); break; //Assembly Chamber Door case 188065: SelinEncounterDoorGUID = go->GetGUID(); break; - case 187770: - DelrissaDoorGUID = go->GetGUID(); - go->SetGoState(DoorState[2]); - break; + case 187770: DelrissaDoorGUID = go->GetGUID(); break; + case 188064: KaelDoorGUID = go->GetGUID(); break; case 188165: KaelStatue[0] = go->GetGUID(); break; case 188166: KaelStatue[1] = go->GetGUID(); break; } @@ -202,12 +144,12 @@ struct TRINITY_DLL_DECL instance_magisters_terrace : public ScriptedInstance switch(identifier) { case DATA_SELIN: return SelinGUID; - case DATA_KAEL: return KaelGUID; case DATA_DELRISSA: return DelrissaGUID; case DATA_VEXALLUS_DOOR: return VexallusDoorGUID; case DATA_SELIN_DOOR: return SelinDoorGUID; case DATA_SELIN_ENCOUNTER_DOOR: return SelinEncounterDoorGUID; case DATA_DELRISSA_DOOR: return DelrissaDoorGUID; + case DATA_KAEL_DOOR: return KaelDoorGUID; case DATA_KAEL_STATUE_LEFT: return KaelStatue[0]; case DATA_KAEL_STATUE_RIGHT: return KaelStatue[1]; diff --git a/src/bindings/scripts/scripts/zone/maraudon/boss_celebras_the_cursed.cpp b/src/bindings/scripts/scripts/zone/maraudon/boss_celebras_the_cursed.cpp index 16a6a301681..914a6b3d578 100644 --- a/src/bindings/scripts/scripts/zone/maraudon/boss_celebras_the_cursed.cpp +++ b/src/bindings/scripts/scripts/zone/maraudon/boss_celebras_the_cursed.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -42,7 +42,7 @@ struct TRINITY_DLL_DECL celebras_the_cursedAI : public ScriptedAI CorruptForces_Timer = 30000; } - void Aggro(Unit *who) { } + void EnterCombat(Unit *who) { } void JustDied(Unit* Killer) { diff --git a/src/bindings/scripts/scripts/zone/maraudon/boss_landslide.cpp b/src/bindings/scripts/scripts/zone/maraudon/boss_landslide.cpp index ca2253c96b1..c67bebeebb0 100644 --- a/src/bindings/scripts/scripts/zone/maraudon/boss_landslide.cpp +++ b/src/bindings/scripts/scripts/zone/maraudon/boss_landslide.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -42,7 +42,7 @@ struct TRINITY_DLL_DECL boss_landslideAI : public ScriptedAI Landslide_Timer = 0; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } diff --git a/src/bindings/scripts/scripts/zone/maraudon/boss_noxxion.cpp b/src/bindings/scripts/scripts/zone/maraudon/boss_noxxion.cpp index e59da4ff650..00b6d28d6b0 100644 --- a/src/bindings/scripts/scripts/zone/maraudon/boss_noxxion.cpp +++ b/src/bindings/scripts/scripts/zone/maraudon/boss_noxxion.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -49,7 +49,7 @@ struct TRINITY_DLL_DECL boss_noxxionAI : public ScriptedAI Invisible = false; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } @@ -71,7 +71,7 @@ struct TRINITY_DLL_DECL boss_noxxionAI : public ScriptedAI Rand = 0; Summoned = DoSpawnCreature(13456, RandX, RandY, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 90000); if(Summoned) - ((CreatureAI*)Summoned->AI())->AttackStart(victim); + (Summoned->AI())->AttackStart(victim); } void UpdateAI(const uint32 diff) diff --git a/src/bindings/scripts/scripts/zone/maraudon/boss_princess_theradras.cpp b/src/bindings/scripts/scripts/zone/maraudon/boss_princess_theradras.cpp index 64b7c2c67f5..0ecac0e86c4 100644 --- a/src/bindings/scripts/scripts/zone/maraudon/boss_princess_theradras.cpp +++ b/src/bindings/scripts/scripts/zone/maraudon/boss_princess_theradras.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -45,7 +45,7 @@ struct TRINITY_DLL_DECL boss_ptheradrasAI : public ScriptedAI RepulsiveGaze_Timer = 23000; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } diff --git a/src/bindings/scripts/scripts/zone/molten_core/boss_baron_geddon.cpp b/src/bindings/scripts/scripts/zone/molten_core/boss_baron_geddon.cpp index 5b34758714c..26361c68e2b 100644 --- a/src/bindings/scripts/scripts/zone/molten_core/boss_baron_geddon.cpp +++ b/src/bindings/scripts/scripts/zone/molten_core/boss_baron_geddon.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -45,7 +45,7 @@ struct TRINITY_DLL_DECL boss_baron_geddonAI : public ScriptedAI LivingBomb_Timer = 35000; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } diff --git a/src/bindings/scripts/scripts/zone/molten_core/boss_garr.cpp b/src/bindings/scripts/scripts/zone/molten_core/boss_garr.cpp index 7f4758b8c79..3dcb017cf73 100644 --- a/src/bindings/scripts/scripts/zone/molten_core/boss_garr.cpp +++ b/src/bindings/scripts/scripts/zone/molten_core/boss_garr.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -49,7 +49,7 @@ struct TRINITY_DLL_DECL boss_garrAI : public ScriptedAI CheckAdds_Timer = 2000; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } @@ -87,7 +87,7 @@ struct TRINITY_DLL_DECL mob_fireswornAI : public ScriptedAI Immolate_Timer = 4000; //These times are probably wrong } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } diff --git a/src/bindings/scripts/scripts/zone/molten_core/boss_gehennas.cpp b/src/bindings/scripts/scripts/zone/molten_core/boss_gehennas.cpp index fbe09203551..450d136e0be 100644 --- a/src/bindings/scripts/scripts/zone/molten_core/boss_gehennas.cpp +++ b/src/bindings/scripts/scripts/zone/molten_core/boss_gehennas.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -42,7 +42,7 @@ struct TRINITY_DLL_DECL boss_gehennasAI : public ScriptedAI GehennasCurse_Timer = 12000; } - void Aggro(Unit *who) { } + void EnterCombat(Unit *who) { } void UpdateAI(const uint32 diff) { diff --git a/src/bindings/scripts/scripts/zone/molten_core/boss_golemagg.cpp b/src/bindings/scripts/scripts/zone/molten_core/boss_golemagg.cpp index e512d42384c..c82dc52b6e6 100644 --- a/src/bindings/scripts/scripts/zone/molten_core/boss_golemagg.cpp +++ b/src/bindings/scripts/scripts/zone/molten_core/boss_golemagg.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -40,7 +40,7 @@ struct TRINITY_DLL_DECL boss_golemaggAI : public ScriptedAI { boss_golemaggAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } ScriptedInstance *pInstance; @@ -59,7 +59,7 @@ struct TRINITY_DLL_DECL boss_golemaggAI : public ScriptedAI m_creature->CastSpell(m_creature,SPELL_MAGMASPLASH,true); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } @@ -118,7 +118,7 @@ struct TRINITY_DLL_DECL mob_core_ragerAI : public ScriptedAI { mob_core_ragerAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } uint32 Mangle_Timer; @@ -131,7 +131,7 @@ struct TRINITY_DLL_DECL mob_core_ragerAI : public ScriptedAI Check_Timer = 1000; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } diff --git a/src/bindings/scripts/scripts/zone/molten_core/boss_lucifron.cpp b/src/bindings/scripts/scripts/zone/molten_core/boss_lucifron.cpp index 7b948fbf747..4514f4640dd 100644 --- a/src/bindings/scripts/scripts/zone/molten_core/boss_lucifron.cpp +++ b/src/bindings/scripts/scripts/zone/molten_core/boss_lucifron.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -42,7 +42,7 @@ struct TRINITY_DLL_DECL boss_lucifronAI : public ScriptedAI ShadowShock_Timer = 6000; //6 seconds } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } diff --git a/src/bindings/scripts/scripts/zone/molten_core/boss_magmadar.cpp b/src/bindings/scripts/scripts/zone/molten_core/boss_magmadar.cpp index 72c3a759dfa..0738457efae 100644 --- a/src/bindings/scripts/scripts/zone/molten_core/boss_magmadar.cpp +++ b/src/bindings/scripts/scripts/zone/molten_core/boss_magmadar.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -48,7 +48,7 @@ struct TRINITY_DLL_DECL boss_magmadarAI : public ScriptedAI m_creature->CastSpell(m_creature,SPELL_MAGMASPIT,true); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } diff --git a/src/bindings/scripts/scripts/zone/molten_core/boss_majordomo_executus.cpp b/src/bindings/scripts/scripts/zone/molten_core/boss_majordomo_executus.cpp index c28867accbd..7fef37d24c9 100644 --- a/src/bindings/scripts/scripts/zone/molten_core/boss_majordomo_executus.cpp +++ b/src/bindings/scripts/scripts/zone/molten_core/boss_majordomo_executus.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -55,7 +55,7 @@ struct TRINITY_DLL_DECL boss_majordomoAI : public ScriptedAI { boss_majordomoAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } ScriptedInstance* pInstance; @@ -79,7 +79,7 @@ struct TRINITY_DLL_DECL boss_majordomoAI : public ScriptedAI DoScriptText(SAY_SLAY, m_creature); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { DoScriptText(SAY_AGGRO, m_creature); } diff --git a/src/bindings/scripts/scripts/zone/molten_core/boss_ragnaros.cpp b/src/bindings/scripts/scripts/zone/molten_core/boss_ragnaros.cpp index 2a698c975fc..77d0da94a1b 100644 --- a/src/bindings/scripts/scripts/zone/molten_core/boss_ragnaros.cpp +++ b/src/bindings/scripts/scripts/zone/molten_core/boss_ragnaros.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -127,7 +127,7 @@ struct TRINITY_DLL_DECL boss_ragnarosAI : public Scripted_NoMovementAI DoScriptText(SAY_KILL, m_creature); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } @@ -228,7 +228,7 @@ struct TRINITY_DLL_DECL boss_ragnarosAI : public Scripted_NoMovementAI { Summoned = m_creature->SummonCreature(12143,target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(),0,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,900000); if(Summoned) - ((CreatureAI*)Summoned->AI())->AttackStart(target); + (Summoned->AI())->AttackStart(target); } } @@ -249,7 +249,7 @@ struct TRINITY_DLL_DECL boss_ragnarosAI : public Scripted_NoMovementAI { Summoned = m_creature->SummonCreature(12143,target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(),0,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,900000); if(Summoned) - ((CreatureAI*)Summoned->AI())->AttackStart(target); + (Summoned->AI())->AttackStart(target); } } diff --git a/src/bindings/scripts/scripts/zone/molten_core/boss_shazzrah.cpp b/src/bindings/scripts/scripts/zone/molten_core/boss_shazzrah.cpp index d11a49e0cf9..89c0163700e 100644 --- a/src/bindings/scripts/scripts/zone/molten_core/boss_shazzrah.cpp +++ b/src/bindings/scripts/scripts/zone/molten_core/boss_shazzrah.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -47,7 +47,7 @@ struct TRINITY_DLL_DECL boss_shazzrahAI : public ScriptedAI Blink_Timer = 30000; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } diff --git a/src/bindings/scripts/scripts/zone/molten_core/boss_sulfuron_harbinger.cpp b/src/bindings/scripts/scripts/zone/molten_core/boss_sulfuron_harbinger.cpp index 244bc6ece50..5c61ef9225d 100644 --- a/src/bindings/scripts/scripts/zone/molten_core/boss_sulfuron_harbinger.cpp +++ b/src/bindings/scripts/scripts/zone/molten_core/boss_sulfuron_harbinger.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -39,7 +39,7 @@ struct TRINITY_DLL_DECL boss_sulfuronAI : public ScriptedAI { boss_sulfuronAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } uint32 Darkstrike_Timer; @@ -58,7 +58,7 @@ struct TRINITY_DLL_DECL boss_sulfuronAI : public ScriptedAI Flamespear_Timer = 2000; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } @@ -126,7 +126,7 @@ struct TRINITY_DLL_DECL mob_flamewaker_priestAI : public ScriptedAI { mob_flamewaker_priestAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } uint32 Heal_Timer; @@ -142,7 +142,7 @@ struct TRINITY_DLL_DECL mob_flamewaker_priestAI : public ScriptedAI Immolate_Timer = 8000; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } diff --git a/src/bindings/scripts/scripts/zone/molten_core/def_molten_core.h b/src/bindings/scripts/scripts/zone/molten_core/def_molten_core.h index e728c863767..5874d8b9408 100644 --- a/src/bindings/scripts/scripts/zone/molten_core/def_molten_core.h +++ b/src/bindings/scripts/scripts/zone/molten_core/def_molten_core.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * This program is free software licensed under GPL version 2 * Please see the included DOCS/LICENSE.TXT for more information */ diff --git a/src/bindings/scripts/scripts/zone/molten_core/instance_molten_core.cpp b/src/bindings/scripts/scripts/zone/molten_core/instance_molten_core.cpp index 5c783edfe10..bfaa583e033 100644 --- a/src/bindings/scripts/scripts/zone/molten_core/instance_molten_core.cpp +++ b/src/bindings/scripts/scripts/zone/molten_core/instance_molten_core.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 diff --git a/src/bindings/scripts/scripts/zone/molten_core/molten_core.cpp b/src/bindings/scripts/scripts/zone/molten_core/molten_core.cpp index 8d9977957d6..d25ddc7631c 100644 --- a/src/bindings/scripts/scripts/zone/molten_core/molten_core.cpp +++ b/src/bindings/scripts/scripts/zone/molten_core/molten_core.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 diff --git a/src/bindings/scripts/scripts/zone/moonglade/moonglade.cpp b/src/bindings/scripts/scripts/zone/moonglade/moonglade.cpp index 027ef125ca7..26af428c2e7 100644 --- a/src/bindings/scripts/scripts/zone/moonglade/moonglade.cpp +++ b/src/bindings/scripts/scripts/zone/moonglade/moonglade.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -71,12 +71,7 @@ bool GossipSelect_npc_bunthen_plainswind(Player *player, Creature *_Creature, ui player->CLOSE_GOSSIP_MENU(); if (player->getClass() == CLASS_DRUID && player->GetTeam() == HORDE) { - std::vector<uint32> nodes; - - nodes.resize(2); - nodes[0] = 63; // Nighthaven, Moonglade - nodes[1] = 22; // Thunder Bluff, Mulgore - player->ActivateTaxiPathTo(nodes); + player->ActivateTaxiPathTo(316); } break; } @@ -177,14 +172,7 @@ bool GossipSelect_npc_silva_filnaveth(Player *player, Creature *_Creature, uint3 { player->CLOSE_GOSSIP_MENU(); if (player->getClass() == CLASS_DRUID && player->GetTeam() == ALLIANCE) - { - std::vector<uint32> nodes; - - nodes.resize(2); - nodes[0] = 62; // Nighthaven, Moonglade - nodes[1] = 27; // Rut'theran Village, Teldrassil - player->ActivateTaxiPathTo(nodes); - } + player->ActivateTaxiPathTo(315); break; } case GOSSIP_ACTION_INFO_DEF + 2: @@ -297,7 +285,7 @@ public: if(!PlayerGUID) return; - Player *player = (Player *)Unit::GetUnit((*m_creature), PlayerGUID); + Player *player = Unit::GetPlayer(PlayerGUID); if(player && player->GetQuestStatus(10965) == QUEST_STATUS_INCOMPLETE) { player->FailQuest(10965); @@ -308,7 +296,7 @@ public: void EnterEvadeMode() { - Player *player = (Player *)Unit::GetUnit((*m_creature), PlayerGUID); + Player *player = Unit::GetPlayer(PlayerGUID); if(player && player->isInCombat() && player->getAttackerForHelper()) { AttackStart(player->getAttackerForHelper()); @@ -317,7 +305,7 @@ public: npc_escortAI::EnterEvadeMode(); } - void Aggro(Unit* who) + void EnterCombat(Unit* who) { uint32 rnd = rand()%2; switch(rnd) @@ -353,18 +341,21 @@ public: return; } - if(!InCombat && !Event_onWait && checkPlayer_Timer < diff) + if(!m_creature->isInCombat() && !Event_onWait) { - Player *player = (Player *)Unit::GetUnit((*m_creature), PlayerGUID); - if(player && player->isInCombat() && player->getAttackerForHelper()) - AttackStart(player->getAttackerForHelper()); - checkPlayer_Timer = 1000; - } else if(!InCombat && !Event_onWait) checkPlayer_Timer -= diff; + if(checkPlayer_Timer < diff) + { + Player *player = Unit::GetPlayer(PlayerGUID); + if(player && player->isInCombat() && player->getAttackerForHelper()) + AttackStart(player->getAttackerForHelper()); + checkPlayer_Timer = 1000; + }else checkPlayer_Timer -= diff; + } if(Event_onWait && Event_Timer < diff) { - Player *player = (Player *)Unit::GetUnit((*m_creature), PlayerGUID); + Player *player = Unit::GetPlayer(PlayerGUID); if(!player || (player && player->GetQuestStatus(10965) == QUEST_STATUS_NONE)) { m_creature->setDeathState(JUST_DIED); @@ -532,7 +523,7 @@ bool QuestAccept_npc_clintar_dreamwalker(Player *player, Creature *creature, Que { Creature *clintar_spirit = creature->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) - ((npc_clintar_spiritAI*)clintar_spirit->AI())->StartEvent(player); + CAST_AI(npc_clintar_spiritAI, clintar_spirit->AI())->StartEvent(player); } return true; } diff --git a/src/bindings/scripts/scripts/zone/mulgore/mulgore.cpp b/src/bindings/scripts/scripts/zone/mulgore/mulgore.cpp index 4af70ebda45..49317b34ce8 100644 --- a/src/bindings/scripts/scripts/zone/mulgore/mulgore.cpp +++ b/src/bindings/scripts/scripts/zone/mulgore/mulgore.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -75,11 +75,11 @@ struct TRINITY_DLL_DECL npc_kyle_frenziedAI : public ScriptedAI m_creature->SetDefaultMovementType(WAYPOINT_MOTION_TYPE); m_creature->GetMotionMaster()->Initialize(); } - void Aggro(Unit* who){} + void EnterCombat(Unit* who){} void SpellHit(Unit *caster, const SpellEntry* spell) { // we can feed him without any quest - if(spell->Id == 42222 && caster->GetTypeId() == TYPEID_PLAYER && ((Player*)caster)->GetTeam() == HORDE) + if(spell->Id == 42222 && caster->GetTypeId() == TYPEID_PLAYER && CAST_PLR(caster)->GetTeam() == HORDE) { STATE = 1; player = caster->GetGUID(); @@ -139,8 +139,8 @@ struct TRINITY_DLL_DECL npc_kyle_frenziedAI : public ScriptedAI case 3: STATE = 4; //go home Unit *plr = Unit::GetUnit((*m_creature),player); - if(plr && ((Player*)plr)->GetQuestStatus(11129) == QUEST_STATUS_INCOMPLETE) - ((Player*)plr)->CompleteQuest(11129); + if(plr && CAST_PLR(plr)->GetQuestStatus(11129) == QUEST_STATUS_INCOMPLETE) + CAST_PLR(plr)->CompleteQuest(11129); float x, y, z, z2, angle; angle = m_creature->GetAngle(-2146, -430); m_creature->GetPosition(x,y,z); @@ -233,7 +233,7 @@ struct TRINITY_DLL_DECL npc_plains_visionAI : public ScriptedAI amountWP = 49; } - void Aggro(Unit* who){} + void EnterCombat(Unit* who){} void MovementInform(uint32 type, uint32 id) { diff --git a/src/bindings/scripts/scripts/zone/nagrand/nagrand.cpp b/src/bindings/scripts/scripts/zone/nagrand/nagrand.cpp index 9259cc31121..1ed6b003504 100644 --- a/src/bindings/scripts/scripts/zone/nagrand/nagrand.cpp +++ b/src/bindings/scripts/scripts/zone/nagrand/nagrand.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>.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 @@ -49,7 +49,7 @@ struct TRINITY_DLL_DECL mob_shattered_rumblerAI : public ScriptedAI Spawn = false; } - void Aggro(Unit* who) {} + void EnterCombat(Unit* who) {} void SpellHit(Unit *Hitter, const SpellEntry *Spellkind) { @@ -113,18 +113,18 @@ struct TRINITY_DLL_DECL mob_lumpAI : public ScriptedAI { if (done_by->GetTypeId() == TYPEID_PLAYER && (m_creature->GetHealth() - damage)*100 / m_creature->GetMaxHealth() < 30) { - if (!bReset && ((Player*)done_by)->GetQuestStatus(9918) == QUEST_STATUS_INCOMPLETE) + if (!bReset && CAST_PLR(done_by)->GetQuestStatus(9918) == QUEST_STATUS_INCOMPLETE) { //Take 0 damage damage = 0; - ((Player*)done_by)->AttackStop(); + CAST_PLR(done_by)->AttackStop(); m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); m_creature->RemoveAllAuras(); m_creature->DeleteThreatList(); m_creature->CombatStop(); m_creature->setFaction(1080); //friendly - m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, PLAYER_STATE_SIT); + m_creature->SetStandState(UNIT_STAND_STATE_SIT); DoScriptText(LUMP_DEFEAT, m_creature); bReset = true; @@ -132,13 +132,13 @@ struct TRINITY_DLL_DECL mob_lumpAI : public ScriptedAI } } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { - if (m_creature->HasAura(SPELL_VISUAL_SLEEP,0)) - m_creature->RemoveAura(SPELL_VISUAL_SLEEP,0); + if (m_creature->HasAura(SPELL_VISUAL_SLEEP)) + m_creature->RemoveAura(SPELL_VISUAL_SLEEP); if (!m_creature->IsStandState()) - m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, PLAYER_STATE_NONE); + m_creature->SetStandState(UNIT_STAND_STATE_STAND); switch(rand()%2) { @@ -227,10 +227,10 @@ struct TRINITY_DLL_DECL mob_sunspring_villagerAI : public ScriptedAI void Reset() { m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 32); - m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,7); // lay down + m_creature->SetStandState(UNIT_STAND_STATE_DEAD); } - void Aggro(Unit *who) {} + void EnterCombat(Unit *who) {} void SpellHit(Unit *caster, const SpellEntry *spell) { @@ -333,13 +333,7 @@ bool QuestAccept_npc_altruis_the_sufferer(Player *player, Creature *creature, Qu if ( !player->GetQuestRewardStatus(9991) ) //Survey the Land, q-id 9991 { player->CLOSE_GOSSIP_MENU(); - - std::vector<uint32> nodes; - - nodes.resize(2); - nodes[0] = 113; //from - nodes[1] = 114; //end at - player->ActivateTaxiPathTo(nodes); //TaxiPath 532 + player->ActivateTaxiPathTo(532); //TaxiPath 532 } return true; } @@ -526,7 +520,7 @@ struct TRINITY_DLL_DECL npc_creditmarker_visit_with_ancestorsAI : public Scripte void Reset() {} - void Aggro(Unit* who) {} + void EnterCombat(Unit* who) {} void MoveInLineOfSight(Unit *who) { @@ -535,14 +529,14 @@ struct TRINITY_DLL_DECL npc_creditmarker_visit_with_ancestorsAI : public Scripte if(who->GetTypeId() == TYPEID_PLAYER) { - if(((Player*)who)->GetQuestStatus(10085) == QUEST_STATUS_INCOMPLETE) + 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(!((Player*)who)->GetReqKillOrCastCurrentCount(10085, creditMarkerId)) - ((Player*)who)->KilledMonster(creditMarkerId, m_creature->GetGUID()); + if(!CAST_PLR(who)->GetReqKillOrCastCurrentCount(10085, creditMarkerId)) + CAST_PLR(who)->KilledMonster(creditMarkerId, m_creature->GetGUID()); } } } @@ -585,14 +579,14 @@ struct TRINITY_DLL_DECL mob_sparrowhawkAI : public ScriptedAI ScriptedAI::AttackStart(who); } - void Aggro(Unit* who) {} + void EnterCombat(Unit* who) {} void MoveInLineOfSight(Unit *who) { if(!who || PlayerGUID) return; - if(!PlayerGUID && who->GetTypeId() == TYPEID_PLAYER && m_creature->IsWithinDistInMap(((Player *)who), 30) && ((Player *)who)->GetQuestStatus(10987) == QUEST_STATUS_INCOMPLETE) + if(!PlayerGUID && who->GetTypeId() == TYPEID_PLAYER && m_creature->IsWithinDistInMap(who, 30) && CAST_PLR(who)->GetQuestStatus(10987) == QUEST_STATUS_INCOMPLETE) { PlayerGUID = who->GetGUID(); return; @@ -610,7 +604,7 @@ struct TRINITY_DLL_DECL mob_sparrowhawkAI : public ScriptedAI if(fleeing && m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() != FLEEING_MOTION_TYPE) fleeing = false; - Player *player = (Player *)Unit::GetUnit((*m_creature), PlayerGUID); + Player *player = Unit::GetPlayer(PlayerGUID); if(player && m_creature->IsWithinDistInMap(player, 30)) { if(!fleeing) @@ -640,7 +634,7 @@ struct TRINITY_DLL_DECL mob_sparrowhawkAI : public ScriptedAI { if (caster->GetTypeId() == TYPEID_PLAYER) { - if(spell->Id == SPELL_SPARROWHAWK_NET && ((Player*)caster)->GetQuestStatus(10987) == QUEST_STATUS_INCOMPLETE) + 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); diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_anubrekhan.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_anubrekhan.cpp index 86d4002718f..46679f0df5d 100644 --- a/src/bindings/scripts/scripts/zone/naxxramas/boss_anubrekhan.cpp +++ b/src/bindings/scripts/scripts/zone/naxxramas/boss_anubrekhan.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2008 - 2009 Trinity <http://www.trinitycore.org/> * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -14,127 +14,99 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* ScriptData -SDName: Boss_Anubrekhan -SD%Complete: 70 -SDComment: -SDCategory: Naxxramas -EndScriptData */ - #include "precompiled.h" +#include "def_naxxramas.h" -#define SAY_GREET -1533000 -#define SAY_AGGRO1 -1533001 -#define SAY_AGGRO2 -1533002 -#define SAY_AGGRO3 -1533003 -#define SAY_TAUNT1 -1533004 -#define SAY_TAUNT2 -1533005 -#define SAY_TAUNT3 -1533006 -#define SAY_TAUNT4 -1533007 +#define SAY_GREET RAND(-1533000,-1533004,-1533005,-1533006,-1533007) +#define SAY_AGGRO RAND(-1533001,-1533002,-1533003) #define SAY_SLAY -1533008 -#define SPELL_IMPALE 28783 //May be wrong spell id. Causes more dmg than I expect -#define H_SPELL_IMPALE 56090 -#define SPELL_LOCUSTSWARM 28785 //This is a self buff that triggers the dmg debuff -#define H_SPELL_LOCUSTSWARM 54021 - -//invalid -#define SPELL_SUMMONGUARD 29508 //Summons 1 crypt guard at targeted location +#define SPELL_IMPALE HEROIC(28783,56090) +#define SPELL_LOCUSTSWARM HEROIC(28785,54021) #define SPELL_SELF_SPAWN_5 29105 //This spawns 5 corpse scarabs ontop of us (most likely the player casts this on death) -#define SPELL_SELF_SPAWN_10 28864 //This is used by the crypt guards when they die -struct TRINITY_DLL_DECL boss_anubrekhanAI : public ScriptedAI +#define EVENT_IMPALE 1 +#define EVENT_LOCUST 2 + +#define MOB_CRYPT_GUARD 16573 + +struct TRINITY_DLL_DECL boss_anubrekhanAI : public BossAI { - boss_anubrekhanAI(Creature *c) : ScriptedAI(c) {} + boss_anubrekhanAI(Creature *c) : BossAI(c, BOSS_ANUBREKHAN) {} - uint32 Impale_Timer; - uint32 LocustSwarm_Timer; - uint32 Summon_Timer; bool HasTaunted; - void Reset() + void Prepare() { - Impale_Timer = 15000; //15 seconds - LocustSwarm_Timer = 80000 + (rand()%40000); //Random time between 80 seconds and 2 minutes for initial cast - Summon_Timer = LocustSwarm_Timer + 45000; //45 seconds after initial locust swarm + HasTaunted = false; + DoSpawnCreature(MOB_CRYPT_GUARD, 0, 10, 0, me->GetOrientation(), TEMPSUMMON_CORPSE_TIMED_DESPAWN, 60000); + if(HeroicMode) + DoSpawnCreature(MOB_CRYPT_GUARD, 0, -10, 0, me->GetOrientation(), TEMPSUMMON_CORPSE_TIMED_DESPAWN, 60000); } - void KilledUnit(Unit* Victim) + void InitializeAI() { Prepare(); } + void JustReachedHome() { Prepare(); _JustReachedHome(); } + + void KilledUnit(Unit* victim) { //Force the player to spawn corpse scarabs via spell - Victim->CastSpell(Victim, SPELL_SELF_SPAWN_5, true); + victim->CastSpell(victim, SPELL_SELF_SPAWN_5, true, NULL, NULL, me->GetGUID()); - if (rand()%5) - return; - - DoScriptText(SAY_SLAY, m_creature); + if(!(rand()%5)) + DoScriptText(SAY_SLAY, me); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { - switch(rand()%3) - { - case 0: DoScriptText(SAY_AGGRO1, m_creature); break; - case 1: DoScriptText(SAY_AGGRO2, m_creature); break; - case 2: DoScriptText(SAY_AGGRO3, m_creature); break; - } + _EnterCombat(); + DoScriptText(SAY_AGGRO, me); + events.ScheduleEvent(EVENT_IMPALE, 15000, 1); + events.ScheduleEvent(EVENT_LOCUST, 80000 + rand()%40000, 1); } void MoveInLineOfSight(Unit *who) { - - if (!HasTaunted && m_creature->IsWithinDistInMap(who, 60.0f)) - { - switch(rand()%5) - { - case 0: DoScriptText(SAY_GREET, m_creature); break; - case 1: DoScriptText(SAY_TAUNT1, m_creature); break; - case 2: DoScriptText(SAY_TAUNT2, m_creature); break; - case 3: DoScriptText(SAY_TAUNT3, m_creature); break; - case 4: DoScriptText(SAY_TAUNT4, m_creature); break; - } - HasTaunted = true; - } + if(!HasTaunted && me->IsWithinDistInMap(who, 60.0f)) + { + DoScriptText(SAY_GREET, me); + HasTaunted = true; + } ScriptedAI::MoveInLineOfSight(who); } void UpdateAI(const uint32 diff) { - if (!UpdateVictim()) + if(!UpdateVictim() || !CheckInRoom()) return; - //Impale_Timer - if (Impale_Timer < diff) + events.Update(diff); + + while(uint32 eventId = events.ExecuteEvent()) { - //Cast Impale on a random target - //Do NOT cast it when we are afflicted by locust swarm - if (!m_creature->HasAura(SPELL_LOCUSTSWARM,1)) + switch(eventId) { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_IMPALE); + case EVENT_IMPALE: + //Cast Impale on a random target + //Do NOT cast it when we are afflicted by locust swarm + if(!me->HasAura(SPELL_LOCUSTSWARM)) + if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + DoCast(target, SPELL_IMPALE); + events.ScheduleEvent(EVENT_IMPALE, 15000, 1); + events.DelayEvents(1500, 1); + return; + case EVENT_LOCUST: + DoCast(m_creature, SPELL_LOCUSTSWARM); + DoSpawnCreature(MOB_CRYPT_GUARD, 5, 5, 0, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 60000); + events.ScheduleEvent(EVENT_LOCUST, 90000, 1); + return; } - - Impale_Timer = 15000; - }else Impale_Timer -= diff; - - //LocustSwarm_Timer - if (LocustSwarm_Timer < diff) - { - DoCast(m_creature, SPELL_LOCUSTSWARM); - LocustSwarm_Timer = 90000; - }else LocustSwarm_Timer -= diff; - - //Summon_Timer - if (Summon_Timer < diff) - { - DoCast(m_creature, SPELL_SUMMONGUARD); - Summon_Timer = 45000; - }else Summon_Timer -= diff; + } DoMeleeAttackIfReady(); } }; + CreatureAI* GetAI_boss_anubrekhan(Creature *_Creature) { return new boss_anubrekhanAI (_Creature); diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_faerlina.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_faerlina.cpp index c04cab35e58..9ee594b02b5 100644 --- a/src/bindings/scripts/scripts/zone/naxxramas/boss_faerlina.cpp +++ b/src/bindings/scripts/scripts/zone/naxxramas/boss_faerlina.cpp @@ -1,4 +1,6 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* + * Copyright (C) 2008 - 2009 Trinity <http://www.trinitycore.org/> + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -14,81 +16,63 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* ScriptData -SDName: Boss_Faerlina -SD%Complete: 50 -SDComment: Without Mindcontrol boss cannot be defeated -SDCategory: Naxxramas -EndScriptData */ - #include "precompiled.h" +#include "def_naxxramas.h" + +#define SAY_GREET -1533009 +#define SAY_AGGRO RAND(-1533010,-1533011,-1533012,-1533013) +#define SAY_SLAY RAND(-1533014,-1533015) +#define SAY_DEATH -1533016 -#define SAY_GREET -1533009 -#define SAY_AGGRO1 -1533010 -#define SAY_AGGRO2 -1533011 -#define SAY_AGGRO3 -1533012 -#define SAY_AGGRO4 -1533013 -#define SAY_SLAY1 -1533014 -#define SAY_SLAY2 -1533015 -#define SAY_DEATH -1533016 - -#define SPELL_POSIONBOLT_VOLLEY 28796 -#define H_SPELL_POSIONBOLT_VOLLEY 54098 -#define SPELL_ENRAGE 28798 -#define H_SPELL_ENRAGE 54100 -#define SPELL_RAINOFFIRE 28794 //Not sure if targeted AoEs work if casted directly upon a player - -struct TRINITY_DLL_DECL boss_faerlinaAI : public ScriptedAI +//#define SOUND_RANDOM_AGGRO 8955 //soundId containing the 4 aggro sounds, we not using this + +#define SPELL_POSION_BOLT_VOLLEY HEROIC(28796,54098) +#define SPELL_RAIN_OF_FIRE HEROIC(28794,54099) +#define SPELL_FRENZY HEROIC(28798,54100) +#define SPELL_WIDOWS_EMBRACE HEROIC(28732,54097) + +enum Events { - boss_faerlinaAI(Creature *c) : ScriptedAI(c) {} + EVENT_POSION = 1, + EVENT_FIRE, + EVENT_FRENZY, +}; - uint32 PoisonBoltVolley_Timer; - uint32 RainOfFire_Timer; - uint32 Enrage_Timer; - bool HasTaunted; +struct TRINITY_DLL_DECL boss_faerlinaAI : public BossAI +{ + boss_faerlinaAI(Creature *c) : BossAI(c, BOSS_FAERLINA), greet(false) {} - void Reset() - { - PoisonBoltVolley_Timer = 8000; - RainOfFire_Timer = 16000; - Enrage_Timer = 60000; - HasTaunted = false; - } + bool greet; - void Aggro(Unit *who) + void EnterCombat(Unit *who) { - switch (rand()%4) - { - case 0: DoScriptText(SAY_AGGRO1, m_creature); break; - case 1: DoScriptText(SAY_AGGRO2, m_creature); break; - case 2: DoScriptText(SAY_AGGRO3, m_creature); break; - case 3: DoScriptText(SAY_AGGRO4, m_creature); break; - } + _EnterCombat(); + DoScriptText(SAY_AGGRO, me); + events.ScheduleEvent(EVENT_POSION, 10000 + rand()%15000); + events.ScheduleEvent(EVENT_FIRE, 5000 + rand()%15000); + events.ScheduleEvent(EVENT_FRENZY, 60000 + rand()%20000); } void MoveInLineOfSight(Unit *who) { - if (!HasTaunted && m_creature->IsWithinDistInMap(who, 60.0f)) - { - DoScriptText(SAY_GREET, m_creature); - HasTaunted = true; - + if(!greet) + { + DoScriptText(SAY_GREET, me); + greet = true; } - ScriptedAI::MoveInLineOfSight(who); + BossAI::MoveInLineOfSight(who); } void KilledUnit(Unit* victim) { - switch (rand()%2) - { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; - } + if(!(rand()%3)) + DoScriptText(SAY_SLAY, me); } void JustDied(Unit* Killer) { - DoScriptText(SAY_DEATH, m_creature); + _JustDied(); + DoScriptText(SAY_DEATH, me); } void UpdateAI(const uint32 diff) @@ -96,31 +80,33 @@ struct TRINITY_DLL_DECL boss_faerlinaAI : public ScriptedAI if (!UpdateVictim()) return; - //PoisonBoltVolley_Timer - if (PoisonBoltVolley_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_POSIONBOLT_VOLLEY); - PoisonBoltVolley_Timer = 11000; - }else PoisonBoltVolley_Timer -= diff; - - //RainOfFire_Timer - if (RainOfFire_Timer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_RAINOFFIRE); - RainOfFire_Timer = 16000; - }else RainOfFire_Timer -= diff; + events.Update(diff); - //Enrage_Timer - if (Enrage_Timer < diff) + while(uint32 eventId = events.ExecuteEvent()) { - DoCast(m_creature,SPELL_ENRAGE); - Enrage_Timer = 61000; - }else Enrage_Timer -= diff; + switch(eventId) + { + case EVENT_POSION: + if(!me->HasAura(SPELL_WIDOWS_EMBRACE)) + DoCastAOE(SPELL_POSION_BOLT_VOLLEY); + events.ScheduleEvent(EVENT_POSION, 10000 + rand()%15000); + return; + case EVENT_FIRE: + if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + DoCast(target, SPELL_RAIN_OF_FIRE); + events.ScheduleEvent(EVENT_FIRE, 5000 + rand()%15000); + return; + case EVENT_FRENZY: + DoCast(me,SPELL_FRENZY); + events.ScheduleEvent(EVENT_FRENZY, 60000 + rand()%20000); + return; + } + } DoMeleeAttackIfReady(); } }; + CreatureAI* GetAI_boss_faerlina(Creature *_Creature) { return new boss_faerlinaAI (_Creature); @@ -134,4 +120,3 @@ void AddSC_boss_faerlina() newscript->GetAI = &GetAI_boss_faerlina; newscript->RegisterSelf(); } - diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_four_horsemen.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_four_horsemen.cpp index 0ae5080d227..d7969431511 100644 --- a/src/bindings/scripts/scripts/zone/naxxramas/boss_four_horsemen.cpp +++ b/src/bindings/scripts/scripts/zone/naxxramas/boss_four_horsemen.cpp @@ -1,402 +1,167 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.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_Four_Horsemen - SD%Complete: 75 - SDComment: Lady Blaumeux, Thane Korthazz, Sir Zeliek, Baron Rivendare - SDCategory: Naxxramas - EndScriptData */ - - #include "precompiled.h" - - //all horsemen - #define SPELL_SHIELDWALL 29061 - #define SPELL_BESERK 26662 - - //lady blaumeux - #define SAY_BLAU_AGGRO -1533044 - #define SAY_BLAU_TAUNT1 -1533045 - #define SAY_BLAU_TAUNT2 -1533046 - #define SAY_BLAU_TAUNT3 -1533047 - #define SAY_BLAU_SPECIAL -1533048 - #define SAY_BLAU_SLAY -1533049 - #define SAY_BLAU_DEATH -1533050 - - #define SPELL_MARK_OF_BLAUMEUX 28833 - #define SPELL_UNYILDING_PAIN 57381 - #define SPELL_VOIDZONE 28863 - #define H_SPELL_VOIDZONE 57463 - #define SPELL_SHADOW_BOLT 57374 - #define H_SPELL_SHADOW_BOLT 57464 +/* Copyright (C) 2008 - 2009 Trinity <http://www.trinitycore.org/> + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "precompiled.h" +#include "def_naxxramas.h" + +enum Horsemen +{ + HORSEMEN_THANE, + HORSEMEN_LADY, + HORSEMEN_BARON, + HORSEMEN_SIR, +}; + +enum Events +{ + EVENT_MARK = 1, + EVENT_CAST, + EVENT_BERSERK, +}; + +const uint32 MOB_HORSEMEN[] = {16064, 16065, 30549, 16063}; +const uint32 SPELL_MARK[] = {28832, 28833, 28834, 28835}; +#define SPELL_PRIMARY(i) HEROIC(SPELL_PRIMARY_N[i],SPELL_PRIMARY_H[i]) +const uint32 SPELL_PRIMARY_N[] = {28884, 28863, 28882, 28883}; +const uint32 SPELL_PRIMARY_H[] = {57467, 57463, 57369, 57466}; +#define SPELL_SECONDARY(i) HEROIC(SPELL_SECONDARY_N[i],SPELL_SECONDARY_H[i]) +const uint32 SPELL_SECONDARY_N[]= {0, 57374, 0, 57376}; +const uint32 SPELL_SECONDARY_H[]= {0, 57464, 0, 57465}; +const uint32 SPELL_PUNISH[] = {0, 57381, 0, 57377}; +#define SPELL_BERSERK 26662 + +const int32 SAY_AGGRO[] = {-1533051, -1533044, -1533065, -1533058}; +const int32 SAY_TAUNT[3][4] ={ {-1533052, -1533045, -1533071, -1533059}, + {-1533053, -1533046, -1533072, -1533060}, + {-1533054, -1533047, -1533073, -1533061},}; +const int32 SAY_SPECIAL[] = {-1533055, -1533048, -1533070, -1533062}; +const int32 SAY_SLAY[] = {-1533056, -1533049, -1533068, -1533063}; +const int32 SAY_DEATH[] = {-1533057, -1533050, -1533074, -1533064}; + +#define SAY_BARON_AGGRO RAND(-1533065,-1533066,-1533067) +#define SAY_BARON_SLAY RAND(-1533068,-1533069) + +struct TRINITY_DLL_DECL boss_four_horsemenAI : public BossAI +{ + boss_four_horsemenAI(Creature *c) : BossAI(c, BOSS_HORSEMEN) + { + id = Horsemen(0); + for(uint32 i = 1; i < 4; ++i) + if(me->GetEntry() == MOB_HORSEMEN[i]) + id = Horsemen(i); + caster = (id == HORSEMEN_LADY || id == HORSEMEN_SIR); + } - #define C_SPIRIT_OF_BLAUMEUX 16776 + Horsemen id; + bool caster; - struct TRINITY_DLL_DECL boss_lady_blaumeuxAI : public ScriptedAI + void MoveInLineOfSight(Unit *who) { - boss_lady_blaumeuxAI(Creature *c) : ScriptedAI(c) {} - - uint32 Mark_Timer; - uint32 VoidZone_Timer; - bool ShieldWall1; - bool ShieldWall2; + BossAI::MoveInLineOfSight(who); + if(caster) + SelectNearestTarget(who); + } - void Reset() - { - Mark_Timer = 20000; // First Horsemen Mark is applied at 20 sec. - VoidZone_Timer = 12000; // right - ShieldWall1 = true; - ShieldWall2 = true; - } + void AttackStart(Unit *who) + { + if(caster) + AttackStartCaster(who, 20); + else + BossAI::AttackStart(who); + } - void Aggro(Unit *who) + void KilledUnit(Unit* victim) + { + if(!(rand()%5)) { - DoScriptText(SAY_BLAU_AGGRO, m_creature); + if(id == HORSEMEN_BARON) + DoScriptText(SAY_BARON_SLAY, me); + else + DoScriptText(SAY_SLAY[id], me); } + } - void KilledUnit(Unit* Victim) - { - DoScriptText(SAY_BLAU_SLAY, m_creature); - } + void JustDied(Unit* killer) + { + _JustDied(); + DoScriptText(SAY_DEATH[id], me); + } - void JustDied(Unit* Killer) - { - DoScriptText(SAY_BLAU_DEATH, m_creature); - } + void EnterCombat(Unit *who) + { + _EnterCombat(); + if(id == HORSEMEN_BARON) + DoScriptText(SAY_BARON_AGGRO, me); + else + DoScriptText(SAY_AGGRO[id], me); + events.ScheduleEvent(EVENT_MARK, 15000); + events.ScheduleEvent(EVENT_CAST, 20000+rand()%5000); + events.ScheduleEvent(EVENT_BERSERK, 15*100*1000); + } + + void UpdateAI(const uint32 diff) + { + if(!UpdateVictim() || !CheckInRoom()) + return; - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; + events.Update(diff); - // Mark of Blaumeux - if (Mark_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_MARK_OF_BLAUMEUX); - Mark_Timer = 12000; - }else Mark_Timer -= diff; + if(me->hasUnitState(UNIT_STAT_CASTING)) + return; - // Shield Wall - All 4 horsemen will shield wall at 50% hp and 20% hp for 20 seconds - if (ShieldWall1 && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 50) + while(uint32 eventId = events.ExecuteEvent()) + { + switch(eventId) { - if(ShieldWall1) - { - DoCast(m_creature,SPELL_SHIELDWALL); - ShieldWall1 = false; - } - } - if (ShieldWall2 && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 20) - { - if (ShieldWall2) - { - DoCast(m_creature,SPELL_SHIELDWALL); - ShieldWall2 = false; - } - } - - // Void Zone - if (VoidZone_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_VOIDZONE); - VoidZone_Timer = 12000; - }else VoidZone_Timer -= diff; - - DoMeleeAttackIfReady(); - } - }; - - CreatureAI* GetAI_boss_lady_blaumeux(Creature *_Creature) - { - return new boss_lady_blaumeuxAI (_Creature); - } - - //baron rivendare - #define SAY_RIVE_AGGRO1 -1533065 - #define SAY_RIVE_AGGRO2 -1533066 - #define SAY_RIVE_AGGRO3 -1533067 - #define SAY_RIVE_SLAY1 -1533068 - #define SAY_RIVE_SLAY2 -1533069 - #define SAY_RIVE_SPECIAL -1533070 - #define SAY_RIVE_TAUNT1 -1533071 - #define SAY_RIVE_TAUNT2 -1533072 - #define SAY_RIVE_TAUNT3 -1533073 - #define SAY_RIVE_DEATH -1533074 - - #define SPELL_MARK_OF_RIVENDARE 28834 - #define SPELL_UNHOLY_SHADOW 28882 - #define H_SPELL_UNHOLY_SHADOW 57369 - - #define C_SPIRIT_OF_RIVENDARE 0 //creature entry not known yet - - struct TRINITY_DLL_DECL boss_rivendare_naxxAI : public ScriptedAI - { - boss_rivendare_naxxAI(Creature *c) : ScriptedAI(c) {} - - void Reset() - { - } - - void Aggro(Unit *who) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_RIVE_AGGRO1, m_creature); break; - case 1: DoScriptText(SAY_RIVE_AGGRO2, m_creature); break; - case 2: DoScriptText(SAY_RIVE_AGGRO3, m_creature); break; - } - } - - void KilledUnit(Unit* Victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_RIVE_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_RIVE_SLAY2, m_creature); break; - } - } - - void JustDied(Unit* Killer) - { - DoScriptText(SAY_RIVE_DEATH, m_creature); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - }; - - CreatureAI* GetAI_boss_rivendare_naxx(Creature *_Creature) - { - return new boss_rivendare_naxxAI (_Creature); - } - - //thane korthazz - #define SAY_KORT_AGGRO -1533051 - #define SAY_KORT_TAUNT1 -1533052 - #define SAY_KORT_TAUNT2 -1533053 - #define SAY_KORT_TAUNT3 -1533054 - #define SAY_KORT_SPECIAL -1533055 - #define SAY_KORT_SLAY -1533056 - #define SAY_KORT_DEATH -1533057 - - #define SPELL_MARK_OF_KORTHAZZ 28832 - #define SPELL_METEOR 26558 // m_creature->getVictim() auto-area spell but with a core problem - - #define C_SPIRIT_OF_KORTHAZZ 16778 - - struct TRINITY_DLL_DECL boss_thane_korthazzAI : public ScriptedAI - { - boss_thane_korthazzAI(Creature *c) : ScriptedAI(c) {} - - uint32 Mark_Timer; - uint32 Meteor_Timer; - bool ShieldWall1; - bool ShieldWall2; - - void Reset() - { - Mark_Timer = 20000; // First Horsemen Mark is applied at 20 sec. - Meteor_Timer = 30000; // wrong - ShieldWall1 = true; - ShieldWall2 = true; - } - - void Aggro(Unit *who) - { - DoScriptText(SAY_KORT_AGGRO, m_creature); - } - - void KilledUnit(Unit* Victim) - { - DoScriptText(SAY_KORT_SLAY, m_creature); - } - - void JustDied(Unit* Killer) - { - DoScriptText(SAY_KORT_DEATH, m_creature); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - // Mark of Korthazz - if (Mark_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_MARK_OF_KORTHAZZ); - Mark_Timer = 12000; - }else Mark_Timer -= diff; - - // Shield Wall - All 4 horsemen will shield wall at 50% hp and 20% hp for 20 seconds - if (ShieldWall1 && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 50) - { - if (ShieldWall1) - { - DoCast(m_creature,SPELL_SHIELDWALL); - ShieldWall1 = false; - } - } - if (ShieldWall2 && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 20) - { - if (ShieldWall2) - { - DoCast(m_creature,SPELL_SHIELDWALL); - ShieldWall2 = false; - } - } - - // Meteor - if (Meteor_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_METEOR); - Meteor_Timer = 20000; // wrong - }else Meteor_Timer -= diff; - - DoMeleeAttackIfReady(); - } - }; - - CreatureAI* GetAI_boss_thane_korthazz(Creature *_Creature) - { - return new boss_thane_korthazzAI (_Creature); - } - - //sir zeliek - #define SAY_ZELI_AGGRO -1533058 - #define SAY_ZELI_TAUNT1 -1533059 - #define SAY_ZELI_TAUNT2 -1533060 - #define SAY_ZELI_TAUNT3 -1533061 - #define SAY_ZELI_SPECIAL -1533062 - #define SAY_ZELI_SLAY -1533063 - #define SAY_ZELI_DEATH -1533064 - - #define SPELL_MARK_OF_ZELIEK 28835 - #define SPELL_HOLY_WRATH 28883 - #define H_SPELL_HOLY_WRATH 57466 - #define SPELL_HOLY_BOLT 57376 - #define H_SPELL_HOLY_BOLT 57465 - - #define C_SPIRIT_OF_ZELIREK 16777 - - struct TRINITY_DLL_DECL boss_sir_zeliekAI : public ScriptedAI - { - boss_sir_zeliekAI(Creature *c) : ScriptedAI(c) {} - - uint32 Mark_Timer; - uint32 HolyWrath_Timer; - bool ShieldWall1; - bool ShieldWall2; - - void Reset() - { - Mark_Timer = 20000; // First Horsemen Mark is applied at 20 sec. - HolyWrath_Timer = 12000; // right - ShieldWall1 = true; - ShieldWall2 = true; - } - - void Aggro(Unit *who) - { - DoScriptText(SAY_ZELI_AGGRO, m_creature); - } - - void KilledUnit(Unit* Victim) - { - DoScriptText(SAY_ZELI_SLAY, m_creature); - } - - void JustDied(Unit* Killer) - { - DoScriptText(SAY_ZELI_DEATH, m_creature); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - // Mark of Zeliek - if (Mark_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_MARK_OF_ZELIEK); - Mark_Timer = 12000; - }else Mark_Timer -= diff; - - // Shield Wall - All 4 horsemen will shield wall at 50% hp and 20% hp for 20 seconds - if (ShieldWall1 && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 50) - { - if (ShieldWall1) - { - DoCast(m_creature,SPELL_SHIELDWALL); - ShieldWall1 = false; - } - } - if (ShieldWall2 && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 20) - { - if (ShieldWall2) - { - DoCast(m_creature,SPELL_SHIELDWALL); - ShieldWall2 = false; - } - } - - // Holy Wrath - if (HolyWrath_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_HOLY_WRATH); - HolyWrath_Timer = 12000; - }else HolyWrath_Timer -= diff; - - DoMeleeAttackIfReady(); - } - }; - - CreatureAI* GetAI_boss_sir_zeliek(Creature *_Creature) - { - return new boss_sir_zeliekAI (_Creature); - } - - void AddSC_boss_four_horsemen() - { - Script *newscript; - - newscript = new Script; - newscript->Name = "boss_lady_blaumeux"; - newscript->GetAI = &GetAI_boss_lady_blaumeux; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "boss_rivendare_naxx"; - newscript->GetAI = &GetAI_boss_rivendare_naxx; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "boss_thane_korthazz"; - newscript->GetAI = &GetAI_boss_thane_korthazz; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "boss_sir_zeliek"; - newscript->GetAI = &GetAI_boss_sir_zeliek; - newscript->RegisterSelf(); - } + case EVENT_MARK: + if(!(rand()%5)) + DoScriptText(SAY_SPECIAL[id], me); + DoCastAOE(SPELL_MARK[id]); + events.ScheduleEvent(EVENT_MARK, 15000); + return; + case EVENT_CAST: + if(!(rand()%5)) + DoScriptText(SAY_TAUNT[rand()%3][id], me); + DoCast(SPELL_PRIMARY(id)); + events.ScheduleEvent(EVENT_CAST, 15000); + return; + case EVENT_BERSERK: + DoScriptText(SAY_SPECIAL[id], me); + DoCast(me, EVENT_BERSERK); + return; + } + } + if(!caster) + DoMeleeAttackIfReady(); + else if(!DoSpellAttackIfReady(SPELL_SECONDARY(id))) + DoCastAOE(SPELL_PUNISH[id]); + } +}; + +CreatureAI* GetAI_four_horsemen(Creature *_Creature) +{ + return new boss_four_horsemenAI (_Creature); +} + +void AddSC_boss_four_horsemen() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_four_horsemen"; + newscript->GetAI = &GetAI_four_horsemen; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_gluth.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_gluth.cpp index 80cbc347fe1..3e44b1c1f6e 100644 --- a/src/bindings/scripts/scripts/zone/naxxramas/boss_gluth.cpp +++ b/src/bindings/scripts/scripts/zone/naxxramas/boss_gluth.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2008 - 2009 Trinity <http://www.trinitycore.org/> * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -14,151 +14,136 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* ScriptData -SDName: Boss_Gluth -SD%Complete: 100 -SDComment: -SDCategory: Naxxramas -EndScriptData */ - #include "precompiled.h" +#include "def_naxxramas.h" -#define SPELL_MORTALWOUND 25646 -#define SPELL_DECIMATE 28374 -#define SPELL_TERRIFYINGROAR 29685 -#define SPELL_FRENZY 19812 -#define SPELL_ENRAGE 28747 - -#define ADD_1X 3269.590 -#define ADD_1Y -3161.287 -#define ADD_1Z 297.423 - -#define ADD_2X 3277.797 -#define ADD_2Y -3170.352 -#define ADD_2Z 297.423 - -#define ADD_3X 3267.049 -#define ADD_3Y -3172.820 -#define ADD_3Z 297.423 +#define SPELL_MORTAL_WOUND 25646 +#define SPELL_ENRAGE HEROIC(28371,54427) +#define SPELL_DECIMATE HEROIC(28374,54426) +#define SPELL_BERSERK 26662 +#define SPELL_INFECTED_WOUND 29306 -#define ADD_4X 3252.157 -#define ADD_4Y -3132.135 -#define ADD_4Z 297.423 +#define MOB_ZOMBIE 16360 -#define ADD_5X 3259.990 -#define ADD_5Y -3126.590 -#define ADD_5Z 297.423 - -#define ADD_6X 3259.815 -#define ADD_6Y -3137.576 -#define ADD_6Z 297.423 - -#define ADD_7X 3308.030 -#define ADD_7Y -3132.135 -#define ADD_7Z 297.423 - -#define ADD_8X 3303.046 -#define ADD_8Y -3180.682 -#define ADD_8Z 297.423 +const float PosSummon[3][4] = +{ + {3267.9, -3172.1, 297.42, 0.94}, + {3253.2, -3132.3, 297.42, 0}, + {3308.3, -3185.8, 297.42, 1.58}, +}; -#define ADD_9X 3313.283 -#define ADD_9Y -3180.766 -#define ADD_9Z 297.423 +enum Events +{ + EVENT_WOUND = 1, + EVENT_ENRAGE, + EVENT_DECIMATE, + EVENT_BERSERK, + EVENT_SUMMON, +}; -struct TRINITY_DLL_DECL boss_gluthAI : public ScriptedAI +struct TRINITY_DLL_DECL boss_gluthAI : public BossAI { - boss_gluthAI(Creature *c) : ScriptedAI(c) {} + boss_gluthAI(Creature *c) : BossAI(c, BOSS_GLUTH) + { + // Do not let Gluth be affected by zombies' debuff + me->ApplySpellImmune(0, IMMUNITY_ID, SPELL_INFECTED_WOUND, true); + } - uint32 MortalWound_Timer; - uint32 Decimate_Timer; - uint32 TerrifyingRoar_Timer; - uint32 Frenzy_Timer; - uint32 Enrage_Timer; - uint32 Summon_Timer; + std::vector<Creature*> triggers; void Reset() { - MortalWound_Timer = 8000; - Decimate_Timer = 100000; - TerrifyingRoar_Timer = 21000; - Frenzy_Timer = 15000; - Enrage_Timer = 304000; - Summon_Timer = 10000; + triggers.clear(); + _Reset(); } - void Aggro(Unit *who) + void MoveInLineOfSight(Unit *who) { + if(who->GetEntry() == MOB_ZOMBIE && me->IsWithinDistInMap(who, 20)) + { + SetGazeOn(who); + me->MonsterTextEmote(" spots a nearby zombie to devour!", 0, true); + } + else + BossAI::MoveInLineOfSight(who); } - void UpdateAI(const uint32 diff) + void EnterCombat(Unit *who) { - if (!UpdateVictim()) - return; - - //MortalWound_Timer - if (MortalWound_Timer < diff) + for(uint32 i = 0; i < 3; ++i) + if(Creature *trigger = DoSummon(WORLD_TRIGGER, PosSummon[i])) + triggers.push_back(trigger); + if(triggers.size() < 3) { - DoCast(m_creature->getVictim(),SPELL_MORTALWOUND); - MortalWound_Timer = 10000; - }else MortalWound_Timer -= diff; + error_log("Script Gluth: cannot summon triggers!"); + EnterEvadeMode(); + return; + } + + _EnterCombat(); + events.ScheduleEvent(EVENT_WOUND, 10000); + events.ScheduleEvent(EVENT_ENRAGE, 30000); + events.ScheduleEvent(EVENT_DECIMATE, 105000); + events.ScheduleEvent(EVENT_BERSERK, 8*60000); + events.ScheduleEvent(EVENT_SUMMON, 10000); + } - //Decimate_Timer - if (Decimate_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_DECIMATE); - Decimate_Timer = 100000; - }else Decimate_Timer -= diff; + void JustSummoned(Creature *summon) + { + if(summon->GetEntry() == WORLD_TRIGGER) + summon->setActive(true); + else if(summon->GetEntry() == MOB_ZOMBIE) + summon->AI()->AttackStart(me); + summons.Summon(summon); + } - //TerrifyingRoar_Timer - if (TerrifyingRoar_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_TERRIFYINGROAR); - TerrifyingRoar_Timer = 20000; - }else TerrifyingRoar_Timer -= diff; + void UpdateAI(const uint32 diff) + { + if(!UpdateVictimWithGaze() || !CheckInRoom()) + return; - //Frenzy_Timer - if (Frenzy_Timer < diff) - { - DoCast(m_creature,SPELL_FRENZY); - Frenzy_Timer = 10500; - }else Frenzy_Timer -= diff; + events.Update(diff); - //Enrage_Timer - if (Enrage_Timer < diff) + while(uint32 eventId = events.ExecuteEvent()) { - DoCast(m_creature,SPELL_ENRAGE); - Enrage_Timer = 61000; - }else Enrage_Timer -= diff; + switch(eventId) + { + case EVENT_WOUND: + DoCast(me->getVictim(), SPELL_MORTAL_WOUND); + events.ScheduleEvent(EVENT_WOUND, 10000); + return; + case EVENT_ENRAGE: + DoCast(me, SPELL_ENRAGE); + events.ScheduleEvent(EVENT_ENRAGE, 30000); + return; + case EVENT_DECIMATE: + DoCastAOE(SPELL_DECIMATE); + events.ScheduleEvent(EVENT_DECIMATE, 105000); + return; + case EVENT_BERSERK: + DoCast(me, SPELL_BERSERK); + return; + case EVENT_SUMMON: + for(uint32 i = 0; i < HEROIC(1,2); ++i) + DoSummon(MOB_ZOMBIE, triggers[rand()%3]); + events.ScheduleEvent(EVENT_SUMMON, 10000); + return; + } + } - //Summon_Timer - if (Summon_Timer < diff) + if(me->getVictim()->GetEntry() == MOB_ZOMBIE) { - Unit* target = NULL; - Unit* SummonedZombies = NULL; - - SummonedZombies = m_creature->SummonCreature(16360,ADD_1X,ADD_1Y,ADD_1Z,0,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,80000); - SummonedZombies = m_creature->SummonCreature(16360,ADD_2X,ADD_2Y,ADD_2Z,0,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,80000); - SummonedZombies = m_creature->SummonCreature(16360,ADD_3X,ADD_3Y,ADD_3Z,0,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,80000); - SummonedZombies = m_creature->SummonCreature(16360,ADD_4X,ADD_4Y,ADD_4Z,0,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,80000); - SummonedZombies = m_creature->SummonCreature(16360,ADD_5X,ADD_5Y,ADD_5Z,0,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,80000); - SummonedZombies = m_creature->SummonCreature(16360,ADD_6X,ADD_6Y,ADD_6Z,0,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,80000); - SummonedZombies = m_creature->SummonCreature(16360,ADD_7X,ADD_7Y,ADD_7Z,0,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,80000); - SummonedZombies = m_creature->SummonCreature(16360,ADD_8X,ADD_8Y,ADD_8Z,0,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,80000); - SummonedZombies = m_creature->SummonCreature(16360,ADD_9X,ADD_9Y,ADD_9Z,0,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,80000); - - if (SummonedZombies) + if(me->IsWithinMeleeRange(me->getVictim())) { - target = SelectUnit(SELECT_TARGET_RANDOM,0); - if (target) - SummonedZombies->AddThreat(target,1.0f); + me->Kill(me->getVictim()); + me->ModifyHealth(me->GetMaxHealth() * 0.05f); } - - Summon_Timer = 28000; - } else Summon_Timer -= diff; - - DoMeleeAttackIfReady(); + } + else + DoMeleeAttackIfReady(); } }; + CreatureAI* GetAI_boss_gluth(Creature *_Creature) { return new boss_gluthAI (_Creature); diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_gothik.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_gothik.cpp index ed2ef9de4e6..ecc9a8d8d03 100644 --- a/src/bindings/scripts/scripts/zone/naxxramas/boss_gothik.cpp +++ b/src/bindings/scripts/scripts/zone/naxxramas/boss_gothik.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2008 - 2009 Trinity <http://www.trinitycore.org/> * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -14,14 +14,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* ScriptData -SDName: Boss_Gothik -SD%Complete: 0 -SDComment: Placeholder -SDCategory: Naxxramas -EndScriptData */ - #include "precompiled.h" +#include "def_naxxramas.h" #define SAY_SPEECH -1533040 #define SAY_KILL -1533041 @@ -29,34 +23,327 @@ EndScriptData */ #define SAY_TELEPORT -1533043 //Gothik -#define SPELL_HARVESTSOUL 28679 -#define SPELL_SHADOWBOLT 29317 -#define H_SPELL_SHADOWBOLT 56405 -//Unrelenting Trainee -#define SPELL_EAGLECLAW 30285 -#define SPELL_KNOCKDOWN_PASSIVE 6961 +#define SPELL_HARVEST_SOUL 28679 +#define SPELL_SHADOW_BOLT HEROIC(29317,56405) + +#define SPELL_INFORM_LIVE_TRAINEE 27892 +#define SPELL_INFORM_LIVE_KNIGHT 27928 +#define SPELL_INFORM_LIVE_RIDER 27935 +#define SPELL_INFORM_DEAD_TRAINEE 27915 +#define SPELL_INFORM_DEAD_KNIGHT 27931 +#define SPELL_INFORM_DEAD_RIDER 27937 + +#define MOB_LIVE_TRAINEE 16124 +#define MOB_LIVE_KNIGHT 16125 +#define MOB_LIVE_RIDER 16126 +#define MOB_DEAD_TRAINEE 16127 +#define MOB_DEAD_KNIGHT 16148 +#define MOB_DEAD_RIDER 16150 +#define MOB_DEAD_HORSE 16149 + +const struct Waves { uint32 entry, number, time; } +waves[] = +{ + {MOB_LIVE_TRAINEE, 2, 20000}, + {MOB_LIVE_TRAINEE, 2, 20000}, + {MOB_LIVE_TRAINEE, 2, 10000}, + {MOB_LIVE_KNIGHT, 1, 10000}, + {MOB_LIVE_TRAINEE, 2, 15000}, + {MOB_LIVE_KNIGHT, 1, 10000}, + {MOB_LIVE_TRAINEE, 2, 15000}, + {MOB_LIVE_TRAINEE, 2, 0}, + {MOB_LIVE_KNIGHT, 1, 10000}, + {MOB_LIVE_RIDER, 1, 10000}, + {MOB_LIVE_TRAINEE, 2, 5000}, + {MOB_LIVE_KNIGHT, 1, 15000}, + {MOB_LIVE_TRAINEE, 2, 0}, + {MOB_LIVE_RIDER, 1, 10000}, + {MOB_LIVE_KNIGHT, 2, 10000}, + {MOB_LIVE_TRAINEE, 2, 10000}, + {MOB_LIVE_RIDER, 1, 5000}, + {MOB_LIVE_KNIGHT, 1, 5000}, + {MOB_LIVE_TRAINEE, 2, 20000}, + {MOB_LIVE_TRAINEE, 2, 0}, + {MOB_LIVE_KNIGHT, 1, 0}, + {MOB_LIVE_RIDER, 1, 15000}, + {MOB_LIVE_TRAINEE, 2, 29000}, + {0, 0, 0}, +}; + +#define POS_Y_GATE -3360.78f + +enum Events +{ + EVENT_SUMMON = 1, + EVENT_HARVEST, + EVENT_BOLT, +}; + +#define POS_LIVE 3 +#define POS_DEAD 5 + +const float PosSummonLive[POS_LIVE][4] = +{ + {2669.7, -3430.9, 268.56, 1.6}, + {2692.0, -3430.9, 268.56, 1.6}, + {2714.1, -3430.9, 268.56, 1.6}, +}; + +const float PosSummonDead[POS_DEAD][4] = +{ + {2725.1, -3310.0, 268.85, 3.4}, + {2699.3, -3322.8, 268.60, 3.3}, + {2733.1, -3348.5, 268.84, 3.1}, + {2682.8, -3304.2, 268.85, 3.9}, + {2664.8, -3340.7, 268.23, 3.7}, +}; + +const float PosGround[4] = {2691.2, -3362.7, 267.68, 1.7}; +const float PosPlatform[4] = {2640.5, -3360.6, 285.26, 0}; + +struct TRINITY_DLL_DECL boss_gothikAI : public BossAI +{ + boss_gothikAI(Creature *c) : BossAI(c, BOSS_GOTHIK) {} + + uint32 waveCount; + std::vector<Creature*> liveTrigger; + std::vector<Creature*> deadTrigger; + + void Reset() + { + liveTrigger.clear(); + deadTrigger.clear(); + me->setActive(false); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); + me->SetReactState(REACT_PASSIVE); + _Reset(); + } + + void EnterCombat(Unit *who) + { + for(uint32 i = 0; i < POS_LIVE; ++i) + if(Creature *trigger = DoSummon(WORLD_TRIGGER, PosSummonLive[i])) + liveTrigger.push_back(trigger); + for(uint32 i = 0; i < POS_DEAD; ++i) + if(Creature *trigger = DoSummon(WORLD_TRIGGER, PosSummonDead[i])) + deadTrigger.push_back(trigger); + + if(liveTrigger.size() < POS_LIVE || deadTrigger.size() < POS_DEAD) + { + error_log("Script Gothik: cannot summon triggers!"); + EnterEvadeMode(); + return; + } + + _EnterCombat(); + me->setActive(true); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); + waveCount = 0; + events.ScheduleEvent(EVENT_SUMMON, 30000); + DoTeleportTo(PosPlatform); + DoScriptText(SAY_SPEECH, me); + if(instance) + instance->SetData(DATA_GOTHIK_GATE, 1); + } + + void JustSummoned(Creature *summon) + { + if(summon->GetEntry() == WORLD_TRIGGER) + summon->setActive(true); + else + { + summon->AI()->DoAction(me->HasReactState(REACT_PASSIVE) ? 1 : 0); + summon->AI()->EnterEvadeMode(); + } + summons.Summon(summon); + } + + void KilledUnit(Unit* victim) + { + if(!(rand()%5)) + DoScriptText(SAY_KILL, me); + } + + void JustDied(Unit* Killer) + { + _JustDied(); + DoScriptText(SAY_DEATH, me); + } + + void SpellHit(Unit *caster, const SpellEntry *spell) + { + uint32 spellId = 0; + switch(spell->Id) + { + case SPELL_INFORM_LIVE_TRAINEE: spellId = SPELL_INFORM_DEAD_TRAINEE; break; + case SPELL_INFORM_LIVE_KNIGHT: spellId = SPELL_INFORM_DEAD_KNIGHT; break; + case SPELL_INFORM_LIVE_RIDER: spellId = SPELL_INFORM_DEAD_RIDER; break; + } + if(spellId && me->isInCombat()) + { + me->HandleEmoteCommand(EMOTE_ONESHOT_SPELLCAST); + me->CastSpell(deadTrigger[rand()%POS_DEAD], spellId, true); + } + } + + void SpellHitTarget(Unit *target, const SpellEntry *spell) + { + if(!me->isInCombat()) + return; + + switch(spell->Id) + { + case SPELL_INFORM_DEAD_TRAINEE: DoSummon(MOB_DEAD_TRAINEE, target, 0); break; + case SPELL_INFORM_DEAD_KNIGHT: DoSummon(MOB_DEAD_KNIGHT, target, 0); break; + case SPELL_INFORM_DEAD_RIDER: DoSummon(MOB_DEAD_RIDER, target, 1.0f); + DoSummon(MOB_DEAD_HORSE, target, 1.0f); break; + } + } + + void UpdateAI(const uint32 diff) + { + if(!UpdateCombatState() || !CheckInRoom()) + return; + + events.Update(diff); + + if(me->hasUnitState(UNIT_STAT_CASTING)) + return; + + while(uint32 eventId = events.ExecuteEvent()) + { + switch(eventId) + { + case EVENT_SUMMON: + if(waves[waveCount].entry) + { + for(uint32 i = 0; i < waves[waveCount].number; ++i) + DoSummon(waves[waveCount].entry, liveTrigger[rand()%POS_LIVE], 1.0f); + events.ScheduleEvent(EVENT_SUMMON, waves[waveCount].time); + ++waveCount; + } + else + { + DoScriptText(SAY_TELEPORT, me); + DoTeleportTo(PosGround); + me->SetReactState(REACT_AGGRESSIVE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); + if(instance) + instance->SetData(DATA_GOTHIK_GATE, 0); + summons.DoAction(0, 0); + summons.DoZoneInCombat(); + events.ScheduleEvent(EVENT_BOLT, 1000); + events.ScheduleEvent(EVENT_HARVEST, 15000); + } + break; + case EVENT_BOLT: + DoCast(me->getVictim(), SPELL_SHADOW_BOLT); + events.ScheduleEvent(EVENT_BOLT, 1000); + return; + case EVENT_HARVEST: + DoCast(me->getVictim(), SPELL_HARVEST_SOUL); + events.ScheduleEvent(EVENT_HARVEST, 15000); + return; + } + } + + DoMeleeAttackIfReady(); + } +}; + +struct TRINITY_DLL_DECL mob_gothik_minionAI : public SpellAI +{ + mob_gothik_minionAI(Creature *c) : SpellAI(c) + { + liveSide = me->GetPositionY() < POS_Y_GATE; + } + + bool liveSide; + bool gateClose; + +#define SIDE_CHECK(who) (liveSide == (who->GetPositionY() < POS_Y_GATE)) + + void DoAction(const int32 param) + { + gateClose = param; + } + + void DamageTaken(Unit *attacker, uint32 &damage) + { + if(gateClose && !SIDE_CHECK(attacker)) + damage = 0; + } + + void JustDied(Unit *killer) + { + if(me->isSummon()) + { + if(Unit *owner = ((TempSummon*)me)->GetSummoner()) + SpellAI::JustDied(owner); + } + } + + void EnterEvadeMode() + { + if(!gateClose) + { + SpellAI::EnterEvadeMode(); + return; + } + + if(!_EnterEvadeMode()) + return; + + Map *map = me->GetMap(); + if(map->IsDungeon()) + { + Map::PlayerList const &PlayerList = map->GetPlayers(); + for(Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) + { + if(i->getSource()->isAlive() && SIDE_CHECK(i->getSource())) + { + AttackStart(i->getSource()); + return; + } + } + } -//Unrelenting Deathknight -#define SPELL_CHARGE 22120 -#define SPELL_SHADOW_MARK 27825 + me->GetMotionMaster()->MoveIdle(); + Reset(); + } -//Unrelenting Rider -#define SPELL_UNHOLY_AURA 28340 -#define SPELL_SHADOWBOLT 19729 //Search thru targets and find those who have the SHADOW_MARK to cast this on + void UpdateAI(const uint32 diff) + { + if(gateClose && (!SIDE_CHECK(me) || me->getVictim() && !SIDE_CHECK(me->getVictim()))) + { + EnterEvadeMode(); + return; + } -//Spectral Trainee -#define SPELL_ARCANE_EXPLOSION 27989 + SpellAI::UpdateAI(diff); + } +}; -//Spectral Deathknight -#define SPELL_WHIRLWIND 28334 -#define SPELL_SUNDER_ARMOR 25051 //cannot find sunder that reduces armor by 2950 -#define SPELL_CLEAVE 20677 -#define SPELL_MANA_BURN 17631 +CreatureAI* GetAI_boss_gothik(Creature *_Creature) +{ + return new boss_gothikAI (_Creature); +} -//Spectral Rider -#define SPELL_LIFEDRAIN 24300 -//USES SAME UNHOLY AURA AS UNRELENTING RIDER +CreatureAI* GetAI_mob_gothik_minion(Creature *_Creature) +{ + return new mob_gothik_minionAI (_Creature); +} -//Spectral Horse -#define SPELL_STOMP 27993 +void AddSC_boss_gothik() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_gothik"; + newscript->GetAI = &GetAI_boss_gothik; + newscript->RegisterSelf(); + newscript = new Script; + newscript->Name="mob_gothik_minion"; + newscript->GetAI = &GetAI_mob_gothik_minion; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_grobbulus.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_grobbulus.cpp index 88ce581e6dd..45f54611ae3 100644 --- a/src/bindings/scripts/scripts/zone/naxxramas/boss_grobbulus.cpp +++ b/src/bindings/scripts/scripts/zone/naxxramas/boss_grobbulus.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2008 - 2009 Trinity <http://www.trinitycore.org/> * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -14,18 +14,90 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* ScriptData -SDName: Boss_Grobbulus -SD%Complete: 0 -SDComment: Place holder -SDCategory: Naxxramas -EndScriptData */ +#include "precompiled.h" +#include "def_naxxramas.h" -/*Poison Cloud 26590 -Slime Spray 28157 -Fallout slime 28218 -Mutating Injection 28169 -Enrages 26527*/ +#define SPELL_BOMBARD_SLIME 28280 -#include "precompiled.h" +#define SPELL_POISON_CLOUD 28240 +#define SPELL_MUTATING_INJECTION 28169 +#define SPELL_SLIME_SPRAY HEROIC(28157,54364) +#define SPELL_BERSERK 26662 + +#define EVENT_BERSERK 1 +#define EVENT_CLOUD 2 +#define EVENT_INJECT 3 +#define EVENT_SPRAY 4 + +#define MOB_FALLOUT_SLIME 16290 + +struct TRINITY_DLL_DECL boss_grobbulusAI : public BossAI +{ + boss_grobbulusAI(Creature *c) : BossAI(c, BOSS_GROBBULUS) {} + + void EnterCombat(Unit *who) + { + _EnterCombat(); + events.ScheduleEvent(EVENT_CLOUD, 15000); + events.ScheduleEvent(EVENT_INJECT, 20000); + events.ScheduleEvent(EVENT_SPRAY, 15000+rand()%15000); //not sure + events.ScheduleEvent(EVENT_BERSERK, 12*60000); + } + + void SpellHitTarget(Unit *target, const SpellEntry *spell) + { + if(spell->Id == SPELL_SLIME_SPRAY) + { + if(TempSummon *slime = me->SummonCreature(MOB_FALLOUT_SLIME, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 0)) + DoZoneInCombat(slime); + } + } + + void UpdateAI(const uint32 diff) + { + if(!UpdateVictim()) + return; + + events.Update(diff); + + while(uint32 eventId = events.ExecuteEvent()) + { + switch(eventId) + { + case EVENT_CLOUD: + DoCastAOE(SPELL_POISON_CLOUD); + events.ScheduleEvent(EVENT_CLOUD, 15000); + return; + case EVENT_BERSERK: + DoCastAOE(SPELL_BERSERK); + return; + case EVENT_SPRAY: + DoCastAOE(SPELL_SLIME_SPRAY); + events.ScheduleEvent(EVENT_SPRAY, 15000+rand()%15000); + return; + case EVENT_INJECT: + if(Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if(!target->HasAura(SPELL_MUTATING_INJECTION)) + DoCast(target, SPELL_MUTATING_INJECTION); + events.ScheduleEvent(EVENT_INJECT, 8000 + 12000 * ((float)me->GetHealth() / me->GetMaxHealth())); + return; + } + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_grobbulus(Creature *_Creature) +{ + return new boss_grobbulusAI (_Creature); +} +void AddSC_boss_grobbulus() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_grobbulus"; + newscript->GetAI = &GetAI_boss_grobbulus; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_heigan.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_heigan.cpp index 78921efff3d..38071251b78 100644 --- a/src/bindings/scripts/scripts/zone/naxxramas/boss_heigan.cpp +++ b/src/bindings/scripts/scripts/zone/naxxramas/boss_heigan.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2008 - 2009 Trinity <http://www.trinitycore.org/> * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -14,34 +14,137 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* ScriptData -SDName: Boss_Heigan -SD%Complete: 0 -SDComment: Place Holder -SDCategory: Naxxramas -EndScriptData */ - -//Lotheb or Heigan? -//8825 aggro1 - You are mine now! -//8826 aggro2 - I see you! -//8827 aggro3 - You...are next! -//8828 death - -//8829 slay - close your eyes... sleep -//8830 taunt1 - The races of the world will perish. It is only a matter of time. -//8831 taunt2 - I see endless suffering, I see torment, I see rage. I see... everything! -//8832 taunt3 - Soon... the world will tremble! -//8833 taunt4 - The end is upon you. -//8834 taunt5 - Hungry worms will feast on your rotten flesh! - #include "precompiled.h" +#include "def_naxxramas.h" + +#define SAY_AGGRO RAND(-1533109,-1533110,-1533111) +#define SAY_SLAY -1533112 +#define SAY_TAUNT RAND(-1533113,-1533114,-1533115,-1533116,-1533117) +#define SAY_DEATH -1533118 + +#define SPELL_SPELL_DISRUPTION 29310 +#define SPELL_DECREPIT_FEVER HEROIC(29998,55011) +#define SPELL_PLAGUE_CLOUD 29350 -//Spell used by floor peices to cause damage to players -#define SPELL_ERUPTION 29371 +enum Events +{ + EVENT_DISRUPT = 1, + EVENT_FEVER, + EVENT_ERUPT, + EVENT_PHASE, +}; -//Spells by boss -#define SPELL_WILT 23772 -#define SPELL_FEAVER 29998 +enum Phases +{ + PHASE_FIGHT = 1, + PHASE_DANCE, +}; //Spell by eye stalks #define SPELL_MIND_FLAY 26143 +struct TRINITY_DLL_DECL boss_heiganAI : public BossAI +{ + boss_heiganAI(Creature *c) : BossAI(c, BOSS_HEIGAN) {} + + uint32 eruptSection; + bool eruptDirection; + Phases phase; + + void KilledUnit(Unit* Victim) + { + if(!(rand()%5)) + DoScriptText(SAY_SLAY, me); + } + + void JustDied(Unit* Killer) + { + _JustDied(); + DoScriptText(SAY_DEATH, me); + } + + void EnterCombat(Unit *who) + { + _EnterCombat(); + DoScriptText(SAY_AGGRO, me); + EnterPhase(PHASE_FIGHT); + } + + void EnterPhase(Phases newPhase) + { + phase = newPhase; + events.Reset(); + eruptSection = 3; + if(phase == PHASE_FIGHT) + { + events.ScheduleEvent(EVENT_DISRUPT, 0); + events.ScheduleEvent(EVENT_FEVER, 20000); + events.ScheduleEvent(EVENT_PHASE, 85000); + events.ScheduleEvent(EVENT_ERUPT, 10000); + } + else + { + float x, y, z, o; + me->GetHomePosition(x, y, z, o); + me->NearTeleportTo(x, y, z, o); + DoCastAOE(SPELL_PLAGUE_CLOUD); + events.ScheduleEvent(EVENT_PHASE, 45000); + events.ScheduleEvent(EVENT_ERUPT, 5000); + } + } + + void UpdateAI(const uint32 diff) + { + if(!UpdateVictim() || !CheckInRoom()) + return; + + events.Update(diff); + + while(uint32 eventId = events.ExecuteEvent()) + { + switch(eventId) + { + case EVENT_DISRUPT: + DoCastAOE(SPELL_SPELL_DISRUPTION); + events.ScheduleEvent(EVENT_DISRUPT, 5000); + return; + case EVENT_FEVER: + DoCastAOE(SPELL_DECREPIT_FEVER); + events.ScheduleEvent(EVENT_FEVER, 20000); + return; + case EVENT_PHASE: + EnterPhase(phase == PHASE_FIGHT ? PHASE_DANCE : PHASE_FIGHT); + return; + case EVENT_ERUPT: + instance->SetData(DATA_HEIGAN_ERUPT, eruptSection); + TeleportCheaters(); + + if(eruptSection == 0) + eruptDirection = true; + else if(eruptSection == 3) + eruptDirection = false; + + eruptDirection ? ++eruptSection : --eruptSection; + + events.ScheduleEvent(EVENT_ERUPT, phase == PHASE_FIGHT ? 10000 : 3000); + break; + } + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_heigan(Creature *_Creature) +{ + return new boss_heiganAI (_Creature); +} + +void AddSC_boss_heigan() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_heigan"; + newscript->GetAI = &GetAI_boss_heigan; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_kelthuzad.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_kelthuzad.cpp index 170ced981f7..218ebf6619e 100644 --- a/src/bindings/scripts/scripts/zone/naxxramas/boss_kelthuzad.cpp +++ b/src/bindings/scripts/scripts/zone/naxxramas/boss_kelthuzad.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -78,76 +78,37 @@ I also don't know the emotes //common needed defines #define NAXXRAMAS_MAP 533 //Positional defines -#define ADDX_LEFT_FAR 3783.272705 -#define ADDY_LEFT_FAR -5062.697266 -#define ADDZ_LEFT_FAR 143.711203 -#define ADDO_LEFT_FAR 3.617599 - -#define ADDX_LEFT_MIDDLE 3730.291260 -#define ADDY_LEFT_MIDDLE -5027.239258 -#define ADDZ_LEFT_MIDDLE 143.956909 -#define ADDO_LEFT_MIDDLE 4.461900 - -#define ADDX_LEFT_NEAR 3683.868652 -#define ADDY_LEFT_NEAR -5057.281250 -#define ADDZ_LEFT_NEAR 143.183884 -#define ADDO_LEFT_NEAR 5.237086 - -#define ADDX_RIGHT_FAR 3759.355225 -#define ADDY_RIGHT_FAR -5174.128418 -#define ADDZ_RIGHT_FAR 143.802383 -#define ADDO_RIGHT_FAR 2.170104 - -#define ADDX_RIGHT_MIDDLE 370.724365 -#define ADDY_RIGHT_MIDDLE -5185.123047 -#define ADDZ_RIGHT_MIDDLE 143.928024 -#define ADDO_RIGHT_MIDDLE 1.309310 - -#define ADDX_RIGHT_NEAR 3665.121094 -#define ADDY_RIGHT_NEAR -5138.679199 -#define ADDZ_RIGHT_NEAR 143.183212 -#define ADDO_RIGHT_NEAR 0.604023 - -#define WALKX_LEFT_FAR 3754.431396 -#define WALKY_LEFT_FAR -5080.727734 -#define WALKZ_LEFT_FAR 142.036316 -#define WALKO_LEFT_FAR 3.736189 - -#define WALKX_LEFT_MIDDLE 3724.396484 -#define WALKY_LEFT_MIDDLE -5061.330566 -#define WALKZ_LEFT_MIDDLE 142.032700 -#define WALKO_LEFT_MIDDLE 4.564785 - -#define WALKX_LEFT_NEAR 3687.158424 -#define WALKY_LEFT_NEAR -5076.834473 -#define WALKZ_LEFT_NEAR 142.017319 -#define WALKO_LEFT_NEAR 5.237086 - -#define WALKX_RIGHT_FAR 3687.571777 -#define WALKY_RIGHT_FAR -5126.831055 -#define WALKZ_RIGHT_FAR 142.017807 -#define WALKO_RIGHT_FAR 0.604023 - -#define WALKX_RIGHT_MIDDLE 3707.990733 -#define WALKY_RIGHT_MIDDLE -5151.450195 -#define WALKZ_RIGHT_MIDDLE 142.032562 -#define WALKO_RIGHT_MIDDLE 1.376855 - -#define WALKX_RIGHT_NEAR 3739.500000 -#define WALKY_RIGHT_NEAR -5141.883989 -#define WALKZ_RIGHT_NEAR 142.0141130 -#define WALKO_RIGHT_NEAR 2.121412 - -//spells to be casted -#define SPELL_FROST_BOLT 28478 -#define H_SPELL_FROST_BOLT 55802 -#define SPELL_FROST_BOLT_NOVA 28479 -#define H_SPELL_FROST_BOLT_NOVA 55807 - -#define SPELL_CHAINS_OF_KELTHUZAD 28410 -#define SPELL_MANA_DETONATION 27819 + +#define SPELL_FROST_BOLT HEROIC(28478,55802) +#define SPELL_FROST_BOLT_AOE HEROIC(28479,55807) #define SPELL_SHADOW_FISURE 27810 +#define SPELL_VOID_BLAST 27812 +#define SPELL_MANA_DETONATION 27819 #define SPELL_FROST_BLAST 27808 +#define SPELL_CHAINS_OF_KELTHUZAD 28410 //28408 script effect +#define SPELL_BERSERK 28498 + +#define MOB_WASTE 16427 // Soldiers of the Frozen Wastes +#define MOB_ABOMINATION 16428 // Unstoppable Abominations +#define MOB_WEAVER 16429 // Soul Weavers +#define MOB_FISSURE 16129 // Shadow Fissure +#define MOB_ICECROWN 16441 // Guardians of Icecrown + +float Pos[12][4] = +{ + {3783.272705, -5062.697266, 143.711203,3.617599},//LEFT_FAR + {3730.291260, -5027.239258,143.956909,4.461900},//LEFT_MIDDLE + {3683.868652,-5057.281250,143.183884,5.237086},//LEFT_NEAR + {3759.355225,-5174.128418,143.802383,2.170104},//RIGHT_FAR + {370.724365,-5185.123047,143.928024,1.309310},//RIGHT_MIDDLE + {3665.121094,-5138.679199,143.183212,0.604023},//RIGHT_NEAR + {3754.431396,-5080.727734,142.036316,3.736189},//LEFT_FAR + {3724.396484, -5061.330566,142.032700, 4.564785},//LEFT_MIDDLE + {3687.158424,-5076.834473,142.017319,5.237086},//LEFT_NEAR + {3687.571777,-5126.831055,142.017807,0.604023},//RIGHT_FAR + {3707.990733,-5151.450195,142.032562,1.376855},//RIGHT_MIDDLE + {3739.500000,-5141.883989,142.0141130, 2.121412}//RIGHT_NEAR +}; struct TRINITY_DLL_DECL boss_kelthuzadAI : public ScriptedAI { @@ -164,20 +125,30 @@ struct TRINITY_DLL_DECL boss_kelthuzadAI : public ScriptedAI uint64 GuardiansOfIcecrown[5]; uint32 GuardiansOfIcecrown_Count; uint32 GuardiansOfIcecrown_Timer; + + //phase==1 summon_timer + uint32 SummonWasters_Timer; + uint32 SummonAbominations_Timer; + uint32 SummonAWeavers_Timer; + + //phase==2,spell_timer uint32 FrostBolt_Timer; uint32 FrostBoltNova_Timer; uint32 ChainsOfKelthuzad_Timer; uint32 ManaDetonation_Timer; uint32 ShadowFisure_Timer; uint32 FrostBlast_Timer; - uint32 ChainsOfKelthuzad_Targets; + uint32 Phase1_Timer; - bool Phase2; - bool Phase3; + uint32 Phase; void Reset() { - FrostBolt_Timer = (rand()%60)*1000; //It won't be more than a minute without cast it + SummonWasters_Timer=3000; // 3s summon waster + SummonAbominations_Timer=25000; //25s summon abomination + SummonAWeavers_Timer=20000; //20s summon Weavers + + FrostBolt_Timer = 2000; //2s CD FrostBoltNova_Timer = 15000; //Cast every 15 seconds ChainsOfKelthuzad_Timer = (rand()%30+30)*1000; //Cast no sooner than once every 30 seconds ManaDetonation_Timer = 20000; //Seems to cast about every 20 seconds @@ -188,18 +159,17 @@ struct TRINITY_DLL_DECL boss_kelthuzadAI : public ScriptedAI for(int i=0; i<5; i++) { if(GuardiansOfIcecrown[i]) - { - //delete creature - Unit* pUnit = Unit::GetUnit((*m_creature), GuardiansOfIcecrown[i]); - if (pUnit && pUnit->isAlive()) - pUnit->DealDamage(pUnit, pUnit->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - GuardiansOfIcecrown[i] = 0; - } + { + //delete creature + Unit* pUnit = Unit::GetUnit((*m_creature), GuardiansOfIcecrown[i]); + if (pUnit && pUnit->isAlive()) + pUnit->DealDamage(pUnit, pUnit->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + GuardiansOfIcecrown[i] = 0; + } } - Phase1_Timer = 310000; //Phase 1 lasts 5 minutes and 10 seconds - Phase2 = false; - Phase3 = false; + Phase1_Timer = 228000; //Phase 1 lasts 3 minutes and 48 seconds + Phase=0; } void KilledUnit() @@ -213,55 +183,15 @@ struct TRINITY_DLL_DECL boss_kelthuzadAI : public ScriptedAI void JustDied(Unit* Killer) { DoScriptText(SAY_DEATH, m_creature); - for(int i=0; i<5; i++) - if(GuardiansOfIcecrown[i]) - { - Unit* pUnit = Unit::GetUnit((*m_creature), GuardiansOfIcecrown[i]); - if (!pUnit || !pUnit->isAlive()) - continue; - - pUnit->CombatStop(); - float Walk_Pos_X; - float Walk_Pos_Y; - float Walk_Pos_Z; - switch(rand()%6) - { - case 0: - Walk_Pos_X = ADDX_LEFT_FAR; - Walk_Pos_Y = ADDY_LEFT_FAR; - Walk_Pos_Z = ADDZ_LEFT_FAR; - break; - case 1: - Walk_Pos_X = ADDX_LEFT_MIDDLE; - Walk_Pos_Y = ADDY_LEFT_MIDDLE; - Walk_Pos_Z = ADDZ_LEFT_MIDDLE; - break; - case 2: - Walk_Pos_X = ADDX_LEFT_NEAR; - Walk_Pos_Y = ADDY_LEFT_NEAR; - Walk_Pos_Z = ADDZ_LEFT_NEAR; - break; - case 3: - Walk_Pos_X = ADDX_RIGHT_FAR; - Walk_Pos_Y = ADDY_RIGHT_FAR; - Walk_Pos_Z = ADDZ_RIGHT_FAR; - break; - case 4: - Walk_Pos_X = ADDX_RIGHT_MIDDLE; - Walk_Pos_Y = ADDY_RIGHT_MIDDLE; - Walk_Pos_Z = ADDZ_RIGHT_MIDDLE; - break; - case 5: - Walk_Pos_X = ADDX_RIGHT_NEAR; - Walk_Pos_Y = ADDY_RIGHT_NEAR; - Walk_Pos_Z = ADDZ_RIGHT_NEAR; - break; - } - pUnit->SendMonsterMoveWithSpeed(Walk_Pos_X, Walk_Pos_Y, Walk_Pos_Z,MOVEMENTFLAG_WALK_MODE); - } } - void Aggro(Unit* who) + void SummonedCreatureDespawn(Creature *summon) + { + if(summon->GetEntry() == MOB_FISSURE) + summon->CastSpell(summon, SPELL_VOID_BLAST, true); + } + + void EnterCombat(Unit* who) { switch(rand()%3) { @@ -269,159 +199,228 @@ struct TRINITY_DLL_DECL boss_kelthuzadAI : public ScriptedAI case 1: DoScriptText(SAY_AGGRO2, m_creature); break; case 2: DoScriptText(SAY_AGGRO3, m_creature); break; } + Phase=1; } void UpdateAI(const uint32 diff) { - if (!UpdateVictim()) + if (!UpdateVictim()) return; + if (Phase1_Timer<diff && Phase==1) + { + Phase=2; + }else Phase1_Timer-=diff; + + if(Phase == 1) + { + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + //EnterEvadeMode(); + //SummonWasters_Timer at far positon + if ( SummonWasters_Timer< diff) + { + + Creature *Waster = NULL; + switch(rand()%4) + { + case 0: Waster = m_creature->SummonCreature(MOB_WASTE,Pos[0][0], Pos[0][1], Pos[0][2], Pos[0][3], TEMPSUMMON_CORPSE_DESPAWN, 0); break; + case 1: Waster = m_creature->SummonCreature(MOB_WASTE,Pos[3][0], Pos[3][1], Pos[3][2], Pos[3][3], TEMPSUMMON_CORPSE_DESPAWN, 0); break; + case 2: Waster = m_creature->SummonCreature(MOB_WASTE,Pos[6][0], Pos[6][1], Pos[6][2], Pos[6][3], TEMPSUMMON_CORPSE_DESPAWN, 0); break; + case 3: Waster = m_creature->SummonCreature(MOB_WASTE,Pos[9][0], Pos[9][1], Pos[9][2], Pos[9][3], TEMPSUMMON_CORPSE_DESPAWN, 0); break; + } + + if(Waster) + { + Unit *target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM, 0); + if(target) + Waster->AI()->AttackStart(target); + } + SummonWasters_Timer=3000; + }else SummonWasters_Timer-=diff; + + //MOB_ABOMINATION at middle positon + if ( SummonAbominations_Timer< diff) + { - if(m_creature->getVictim() && m_creature->isAlive()) + Creature *Abominations = NULL; + switch(rand()%4) + { + case 0: Abominations = m_creature->SummonCreature(MOB_ABOMINATION,Pos[1][0], Pos[1][1], Pos[1][2], Pos[1][3], TEMPSUMMON_CORPSE_DESPAWN, 0); break; + case 1: Abominations = m_creature->SummonCreature(MOB_ABOMINATION,Pos[4][0], Pos[4][1], Pos[4][2], Pos[4][3], TEMPSUMMON_CORPSE_DESPAWN, 0); break; + case 2: Abominations = m_creature->SummonCreature(MOB_ABOMINATION,Pos[7][0], Pos[7][1], Pos[7][2], Pos[7][3], TEMPSUMMON_CORPSE_DESPAWN, 0); break; + case 3: Abominations = m_creature->SummonCreature(MOB_ABOMINATION,Pos[10][0], Pos[10][1], Pos[10][2], Pos[10][3], TEMPSUMMON_CORPSE_DESPAWN, 0); break; + } + + if(Abominations) + { + Unit *target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM, 0); + if(target) + Abominations->AI()->AttackStart(target); + } + SummonAbominations_Timer=25000; + }else SummonAbominations_Timer-=diff; + + //SummonAWeavers_Timer at far positon + if ( SummonAWeavers_Timer< diff) + { + + Creature *Weavers = NULL; + switch(rand()%4) + { + case 0: Weavers = m_creature->SummonCreature(MOB_WEAVER,Pos[0][0], Pos[0][1], Pos[0][2], Pos[0][3], TEMPSUMMON_CORPSE_DESPAWN, 0); break; + case 1: Weavers = m_creature->SummonCreature(MOB_WEAVER,Pos[3][0], Pos[3][1], Pos[3][2], Pos[3][3], TEMPSUMMON_CORPSE_DESPAWN, 0); break; + case 2: Weavers = m_creature->SummonCreature(MOB_WEAVER,Pos[6][0], Pos[6][1], Pos[6][2], Pos[6][3], TEMPSUMMON_CORPSE_DESPAWN, 0); break; + case 3: Weavers = m_creature->SummonCreature(MOB_WEAVER,Pos[9][0], Pos[9][1], Pos[9][2], Pos[9][3], TEMPSUMMON_CORPSE_DESPAWN, 0); break; + } + + if(Weavers) + { + Unit *target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM, 0); + if(target) + Weavers->AI()->AttackStart(target); + } + SummonAWeavers_Timer=30000; + }else SummonAWeavers_Timer-=diff; + + } + + if( Phase!=1 && m_creature->getVictim() && m_creature->isAlive()) { + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + //Check for Frost Bolt if(FrostBolt_Timer < diff) { DoCast(m_creature->getVictim(),SPELL_FROST_BOLT); //Cast again on time - FrostBolt_Timer = (rand()%60)*1000; + FrostBolt_Timer = 2000; }else FrostBolt_Timer -= diff; //Check for Frost Bolt Nova if(FrostBoltNova_Timer < diff) { - DoCast(m_creature->getVictim(),SPELL_FROST_BOLT_NOVA); + DoCast(m_creature->getVictim(),SPELL_FROST_BOLT_AOE); FrostBoltNova_Timer = 15000; }else FrostBoltNova_Timer -= diff; - //Check for Chains Of Kelthuzad + //Cast Chains Of Kelthuzad only on the Heroic instance + /* if(ChainsOfKelthuzad_Timer < diff) { - //DoCast(m_creature->getVictim(),SPELL_CHAINS_OF_KELTHUZAD); + //DoCast(m_creature->getVictim(),SPELL_CHAINS_OF_KELTHUZAD); - //if(rand()%2 == 0) - //DoScriptText(SAY_CHAIN1, m_creature); - //else - //DoScriptText(SAY_CHAIN2, m_creature); - ChainsOfKelthuzad_Timer = (rand()%30+30)*1000; + //if(rand()%2 == 0) + //DoScriptText(SAY_CHAIN1, m_creature); + //else + //DoScriptText(SAY_CHAIN2, m_creature); + ChainsOfKelthuzad_Timer = (rand()%30+30)*1000; }else ChainsOfKelthuzad_Timer -= diff; + */ //Check for Mana Detonation if(ManaDetonation_Timer < diff) { - //time to cast - DoCast(m_creature->getVictim(),SPELL_MANA_DETONATION); + std::list<HostilReference*> *threatList = &me->getThreatManager().getThreatList(); + std::list<HostilReference*>::iterator itr = threatList->begin(); + std::vector<Unit*> unitList; + for(;itr != threatList->end(); ++itr) + { + if((*itr)->getTarget()->GetTypeId() == TYPEID_PLAYER + && (*itr)->getTarget()->getPowerType() == POWER_MANA + && (*itr)->getTarget()->GetPower(POWER_MANA)) + unitList.push_back((*itr)->getTarget()); + } - if (rand()%2) - DoScriptText(SAY_SPECIAL1_MANA_DET, m_creature); + if(!unitList.empty()) + { + std::vector<Unit*>::iterator itr = unitList.begin(); + advance(itr, rand()%unitList.size()); + DoCast(*itr, SPELL_MANA_DETONATION); + } + + if (rand()%2) + DoScriptText(SAY_SPECIAL1_MANA_DET, m_creature); ManaDetonation_Timer = 20000; }else ManaDetonation_Timer -= diff; - //Check for Shadow Fissure + //Summons a Shadow Fissure underneath a random player. + //The fissure will stay inactive for about 3 seconds, after which it will become a beam of purple energy, + //instantly killing the player if they remain in it. + if(ShadowFisure_Timer < diff) { - DoCast(m_creature->getVictim(),SPELL_SHADOW_FISURE); + if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target, SPELL_SHADOW_FISURE); - if (rand()%2) - DoScriptText(SAY_SPECIAL3_MANA_DET, m_creature); + if (rand()%2) + DoScriptText(SAY_SPECIAL3_MANA_DET, m_creature); ShadowFisure_Timer = 25000; }else ShadowFisure_Timer -= diff; - //Check for Frost Blast + //cast Frost Blast to a random player if(FrostBlast_Timer < diff) { - //time to cast - DoCast(m_creature->getVictim(),SPELL_FROST_BLAST); - + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) + { + DoCast(target,SPELL_FROST_BLAST); + //obviously the spell doesn't work like the description + //So, we need script this spell? + } if(rand()%2 == 0) DoScriptText(SAY_FROST_BLAST, m_creature); FrostBlast_Timer = (rand()%30+30)*1000; }else FrostBlast_Timer -= diff; //start phase 3 when we are 40% health - if(!Phase3 && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 40) + if( Phase!=3 && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 40) { - Phase3 = true; - DoScriptText(SAY_REQUEST_AID, m_creature); + Phase = 3 ; + DoScriptText(SAY_REQUEST_AID, m_creature); //here Lich King should respond to KelThuzad but I don't know which creature to make talk //so for now just make Kelthuzad says it. DoScriptText(SAY_ANSWER_REQUEST, m_creature); } - if(Phase3 && (GuardiansOfIcecrown_Count < 5)) + if(Phase==3 && (GuardiansOfIcecrown_Count < 2)) //in normal raid ,only two Icecrown if(GuardiansOfIcecrown_Timer < diff) - { - //Summon a Guardian of Icecrown in a random alcove (Creature # 16441) - //uint32 TimeToWalk; - Unit* pUnit = NULL; - float Walk_Pos_X; - float Walk_Pos_Y; - float Walk_Pos_Z; - switch(rand()%6) { + //Summon a Guardian of Icecrown in a random alcove + TempSummon* pUnit = NULL; + switch(rand()%3) + { case 0: - pUnit = m_creature->SummonCreature(16441,ADDX_LEFT_FAR,ADDY_LEFT_FAR,ADDZ_LEFT_FAR,ADDO_LEFT_FAR,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,1000); - //Setting walk position - Walk_Pos_X = WALKX_LEFT_FAR; - Walk_Pos_Y = WALKY_LEFT_FAR; - Walk_Pos_Z = WALKZ_LEFT_FAR; + pUnit = m_creature->SummonCreature(MOB_ICECROWN,Pos[2][0],Pos[2][1],Pos[2][2],Pos[2][3],TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,1000); break; case 1: - pUnit = m_creature->SummonCreature(16441,ADDX_LEFT_MIDDLE,ADDY_LEFT_MIDDLE,ADDZ_LEFT_MIDDLE,ADDO_LEFT_MIDDLE,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,1000); - //Start moving guardian towards the center of the room - Walk_Pos_X = WALKX_LEFT_MIDDLE; - Walk_Pos_Y = WALKY_LEFT_MIDDLE; - Walk_Pos_Z = WALKZ_LEFT_MIDDLE; + pUnit = m_creature->SummonCreature(MOB_ICECROWN,Pos[5][0],Pos[5][1],Pos[5][2],Pos[5][3],TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,1000); break; case 2: - pUnit = m_creature->SummonCreature(16441,ADDX_LEFT_NEAR,ADDY_LEFT_NEAR,ADDZ_LEFT_NEAR,ADDO_LEFT_NEAR,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,1000); - //Start moving guardian towards the center of the room - Walk_Pos_X = WALKX_LEFT_NEAR; - Walk_Pos_Y = WALKY_LEFT_NEAR; - Walk_Pos_Z = WALKZ_LEFT_NEAR; + pUnit = m_creature->SummonCreature(MOB_ICECROWN,Pos[8][0],Pos[8][1],Pos[8][2],Pos[8][3],TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,1000); break; - case 3: + } - pUnit = m_creature->SummonCreature(16441,ADDX_RIGHT_FAR,ADDY_RIGHT_FAR,ADDZ_RIGHT_FAR,ADDO_RIGHT_FAR,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,1000); - //Start moving guardian towards the center of the room - Walk_Pos_X = WALKX_RIGHT_FAR; - Walk_Pos_Y = WALKY_RIGHT_FAR; - Walk_Pos_Z = WALKZ_RIGHT_FAR; - break; - case 4: - pUnit = m_creature->SummonCreature(16441,ADDX_RIGHT_MIDDLE,ADDY_RIGHT_MIDDLE,ADDZ_RIGHT_MIDDLE,ADDO_RIGHT_MIDDLE,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,1000); - //Start moving guardian towards the center of the room - Walk_Pos_X = WALKX_RIGHT_MIDDLE; - Walk_Pos_Y = WALKY_RIGHT_MIDDLE; - Walk_Pos_Z = WALKZ_RIGHT_MIDDLE; - break; - case 5: - pUnit = m_creature->SummonCreature(16441,ADDX_RIGHT_NEAR,ADDY_RIGHT_NEAR,ADDZ_RIGHT_NEAR,ADDO_RIGHT_NEAR,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,1000); - //Start moving guardian towards the center of the room - Walk_Pos_X = WALKX_RIGHT_NEAR; - Walk_Pos_Y = WALKY_RIGHT_NEAR; - Walk_Pos_Z = WALKZ_RIGHT_NEAR; - break; - } + if (pUnit) + { - if (pUnit) - { - //if we find no one to figth walk to the center - if(!pUnit->isInCombat()) - pUnit->SendMonsterMoveWithSpeed(Walk_Pos_X,Walk_Pos_Y,Walk_Pos_Z,MOVEMENTFLAG_WALK_MODE); + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) + { + pUnit->AI()->AttackStart(target); + } + //Safe storing of creatures + GuardiansOfIcecrown[GuardiansOfIcecrown_Count] = pUnit->GetGUID(); - //Safe storing of creatures - GuardiansOfIcecrown[GuardiansOfIcecrown_Count] = pUnit->GetGUID(); - - //Update guardian count - GuardiansOfIcecrown_Count++; + //Update guardian count + GuardiansOfIcecrown_Count++; + } + //5 seconds until summoning next guardian + GuardiansOfIcecrown_Timer = 5000; } - //5 seconds until summoning next guardian - GuardiansOfIcecrown_Timer = 5000; - } - else GuardiansOfIcecrown_Timer -= diff; + else GuardiansOfIcecrown_Timer -= diff; - DoMeleeAttackIfReady(); + DoMeleeAttackIfReady(); } } }; @@ -433,11 +432,9 @@ CreatureAI* GetAI_boss_kelthuzadAI(Creature *_Creature) void AddSC_boss_kelthuzad() { - Script *newscript; newscript = new Script; newscript->Name="boss_kelthuzad"; newscript->GetAI = &GetAI_boss_kelthuzadAI; newscript->RegisterSelf(); } - diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_loatheb.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_loatheb.cpp index d5e382d80e6..8548862d1b5 100644 --- a/src/bindings/scripts/scripts/zone/naxxramas/boss_loatheb.cpp +++ b/src/bindings/scripts/scripts/zone/naxxramas/boss_loatheb.cpp @@ -1,4 +1,6 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* + * Copyright (C) 2008 - 2009 Trinity <http://www.trinitycore.org/> + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -14,193 +16,64 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* ScriptData -SDName: Boss_Loatheb -SD%Complete: 100 -SDComment: -SDCategory: Naxxramas -EndScriptData */ - #include "precompiled.h" +#include "def_naxxramas.h" -#define SAY_AGGRO1 "You are mine now!" -#define SAY_AGGRO2 "I see you!" -#define SAY_AGGRO3 "You...are next!" -#define SAY_SLAY1 "Close your eyes... sleep!" -#define SAY_SLAY2 "The races of the world will perish. It is only a matter of time." -#define SAY_SLAY3 "I see endless suffering, I see torment, I see rage. I see... everything!" -#define SAY_SLAY4 "Soon... the world will tremble!" -#define SAY_SLAY5 "The end is upon you." -#define SAY_SLAY6 "Hungry worms will feast on your rotten flesh!" -#define SAY_DEATH "" - -#define SOUND_AGGRO1 8825 -#define SOUND_AGGRO2 8826 -#define SOUND_AGGRO3 8827 -#define SOUND_SLAY1 8829 -#define SOUND_SLAY2 8830 -#define SOUND_SLAY3 8831 -#define SOUND_SLAY4 8832 -#define SOUND_SLAY5 8833 -#define SOUND_SLAY6 8834 -#define SOUND_DEATH 8828 - -#define SPELL_CORRUPTED_MIND 29198 -#define SPELL_POISON_AURA 29865 -#define SPELL_INEVITABLE_DOOM 29204 -#define SPELL_REMOVE_CURSE 30281 - -#define ADD_1X 2957.040 -#define ADD_1Y -3997.590 -#define ADD_1Z 274.280 +#define SPELL_NECROTIC_AURA 55593 +#define SPELL_SUMMON_SPORE 29234 +#define SPELL_DEATHBLOOM HEROIC(29865,55053) +#define SPELL_INEVITABLE_DOOM HEROIC(29204,55052) -#define ADD_2X 2909.130 -#define ADD_2Y -4042.970 -#define ADD_2Z 274.280 - -#define ADD_3X 2861.102 -#define ADD_3Y -3997.901 -#define ADD_3Z 274.280 - -struct TRINITY_DLL_DECL boss_loathebAI : public ScriptedAI +enum Events { - boss_loathebAI(Creature *c) : ScriptedAI(c) {} - - uint32 CorruptedMind_Timer; - uint32 PoisonAura_Timer; - uint32 InevitableDoom_Timer; - uint32 InevitableDoom5mins_Timer; - uint32 RemoveCurse_Timer; - uint32 Summon_Timer; - - void Reset() - { - CorruptedMind_Timer = 4000; - PoisonAura_Timer = 2500; - InevitableDoom_Timer = 120000; - InevitableDoom5mins_Timer = 300000; - RemoveCurse_Timer = 30000; - Summon_Timer = 8000; - } - - void Aggro(Unit *who) - { - switch (rand()%3) - { - case 0: - DoYell(SAY_AGGRO1,LANG_UNIVERSAL,NULL); - DoPlaySoundToSet(m_creature,SOUND_AGGRO1); - break; - case 1: - DoYell(SAY_AGGRO2,LANG_UNIVERSAL,NULL); - DoPlaySoundToSet(m_creature,SOUND_AGGRO2); - break; - case 2: - DoYell(SAY_AGGRO3,LANG_UNIVERSAL,NULL); - DoPlaySoundToSet(m_creature,SOUND_AGGRO3); - break; - } - } + EVENT_AURA = 1, + EVENT_BLOOM, + EVENT_DOOM, +}; - void KilledUnit(Unit* victim) - { - switch (rand()%6) - { - case 0: - DoYell(SAY_SLAY1,LANG_UNIVERSAL,NULL); - DoPlaySoundToSet(m_creature,SOUND_SLAY1); - break; - case 1: - DoYell(SAY_SLAY2,LANG_UNIVERSAL,NULL); - DoPlaySoundToSet(m_creature,SOUND_SLAY2); - break; - case 2: - DoYell(SAY_SLAY3,LANG_UNIVERSAL,NULL); - DoPlaySoundToSet(m_creature,SOUND_SLAY3); - break; - case 3: - DoYell(SAY_SLAY4,LANG_UNIVERSAL,NULL); - DoPlaySoundToSet(m_creature,SOUND_SLAY4); - break; - case 4: - DoYell(SAY_SLAY5,LANG_UNIVERSAL,NULL); - DoPlaySoundToSet(m_creature,SOUND_SLAY5); - break; - case 5: - DoYell(SAY_SLAY6,LANG_UNIVERSAL,NULL); - DoPlaySoundToSet(m_creature,SOUND_SLAY6); - break; - } - } +struct TRINITY_DLL_DECL boss_loathebAI : public BossAI +{ + boss_loathebAI(Creature *c) : BossAI(c, BOSS_LOATHEB) {} - void JustDied(Unit* Killer) + void EnterCombat(Unit *who) { - DoYell(SAY_DEATH,LANG_UNIVERSAL,NULL); - DoPlaySoundToSet(m_creature,SOUND_DEATH); + _EnterCombat(); + events.ScheduleEvent(EVENT_AURA, 0); + events.ScheduleEvent(EVENT_BLOOM, 30000); + events.ScheduleEvent(EVENT_DOOM, 120000); } void UpdateAI(const uint32 diff) { - if (!UpdateVictim()) + if(!UpdateVictim()) return; - //CorruptedMind_Timer - if (CorruptedMind_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_CORRUPTED_MIND); - CorruptedMind_Timer = 62000; - }else CorruptedMind_Timer -= diff; - - //PoisonAura_Timer - if (PoisonAura_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_POISON_AURA); - PoisonAura_Timer = 60000; - }else PoisonAura_Timer -= diff; - - //InevitableDoom_Timer - if (InevitableDoom_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_INEVITABLE_DOOM); - InevitableDoom_Timer = 120000; - }else InevitableDoom_Timer -= diff; - - //InevitableDoom5mins_Timer - if (InevitableDoom5mins_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_INEVITABLE_DOOM); - InevitableDoom5mins_Timer = 15000; - }else InevitableDoom5mins_Timer -= diff; + events.Update(diff); - //RemoveCurse_Timer - if (RemoveCurse_Timer < diff) + while(uint32 eventId = events.ExecuteEvent()) { - DoCast(m_creature,SPELL_REMOVE_CURSE); - RemoveCurse_Timer = 30000; - }else RemoveCurse_Timer -= diff; - - //Summon_Timer - if (Summon_Timer < diff) - { - Unit* target = NULL; - Unit* SummonedSpores = NULL; - - SummonedSpores = m_creature->SummonCreature(16286,ADD_1X,ADD_1Y,ADD_1Z,0,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,80000); - SummonedSpores = m_creature->SummonCreature(16286,ADD_2X,ADD_2Y,ADD_2Z,0,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,80000); - SummonedSpores = m_creature->SummonCreature(16286,ADD_3X,ADD_3Y,ADD_3Z,0,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,80000); - if (SummonedSpores) + switch(eventId) { - target = SelectUnit(SELECT_TARGET_RANDOM,0); - if (target) - SummonedSpores->AddThreat(target,1.0f); + case EVENT_AURA: + DoCastAOE(SPELL_NECROTIC_AURA); + events.ScheduleEvent(EVENT_AURA, 20000); + return; + case EVENT_BLOOM: + DoCastAOE(SPELL_SUMMON_SPORE, true); + DoCastAOE(SPELL_DEATHBLOOM); + events.ScheduleEvent(EVENT_BLOOM, 30000); + return; + case EVENT_DOOM: + DoCastAOE(SPELL_INEVITABLE_DOOM); + events.ScheduleEvent(EVENT_DOOM, events.GetTimer() < 5*60000 ? 30000 : 15000); + return; } - - Summon_Timer = 28000; - } else Summon_Timer -= diff; + } DoMeleeAttackIfReady(); } }; + CreatureAI* GetAI_boss_loatheb(Creature *_Creature) { return new boss_loathebAI (_Creature); @@ -213,5 +86,8 @@ void AddSC_boss_loatheb() newscript->Name="boss_loatheb"; newscript->GetAI = &GetAI_boss_loatheb; newscript->RegisterSelf(); + + // Fungal Creep + GetAISpellInfo(29232)->condition = AICOND_DIE; } diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_maexxna.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_maexxna.cpp index b3185d01cdf..ff23e77a673 100644 --- a/src/bindings/scripts/scripts/zone/naxxramas/boss_maexxna.cpp +++ b/src/bindings/scripts/scripts/zone/naxxramas/boss_maexxna.cpp @@ -1,4 +1,6 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* + * Copyright (C) 2008 - 2009 Trinity <http://www.trinitycore.org/> + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -14,223 +16,113 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* ScriptData -SDName: Boss_Maexxna -SD%Complete: 80 -SDComment: -SDCategory: Naxxramas -EndScriptData */ - #include "precompiled.h" +#include "def_naxxramas.h" -#define SPELL_WEBTRAP 28622 //Spell is normally used by the webtrap on the wall NOT by Maexxna -#define SPELL_WEBSPRAY 29484 -#define H_SPELL_WEBSPRAY 54125 -#define SPELL_POISONSHOCK 28741 -#define H_SPELL_POISONSHOCK 54122 -#define SPELL_NECROTICPOISON 28776 -#define H_SPELL_NECROTICPOISON 54121 -#define SPELL_FRENZY 54123 -#define H_SPELL_FRENZY 54124 - -#define SPELL_SUMMON_SPIDERLING 29434 - -#define LOC_X1 3546.796 -#define LOC_Y1 -3869.082 -#define LOC_Z1 296.450 - -#define LOC_X2 3531.271 -#define LOC_Y2 -3847.424 -#define LOC_Z2 299.450 +#define SPELL_WEB_WRAP 28622 +#define SPELL_WEB_SPRAY HEROIC(29484,54125) +#define SPELL_POISON_SHOCK HEROIC(28741,54122) +#define SPELL_NECROTIC_POISON HEROIC(54121,28776) +#define SPELL_FRENZY HEROIC(54123,54124) -#define LOC_X3 3497.067 -#define LOC_Y3 -3843.384 -#define LOC_Z3 302.384 +#define MOB_WEB_WRAP 16486 +#define MOB_SPIDERLING 17055 -struct TRINITY_DLL_DECL mob_webwrapAI : public ScriptedAI +#define MAX_POS_WRAP 3 +const float PosWrap[MAX_POS_WRAP][3] = { - mob_webwrapAI(Creature *c) : ScriptedAI(c) {} - - uint64 victimGUID; - - void Reset() - { - victimGUID = 0; - } - - void SetVictim(Unit* victim) - { - if(victim) - { - victimGUID = victim->GetGUID(); - victim->CastSpell(victim, SPELL_WEBTRAP, true); - } - } - - void DamageTaken(Unit *done_by, uint32 &damage) - { - if(damage > m_creature->GetHealth()) - { - if(victimGUID) - { - Unit* victim = NULL; - victim = Unit::GetUnit((*m_creature), victimGUID); - if(victim) - victim->RemoveAurasDueToSpell(SPELL_WEBTRAP); - } - } - } - - void Aggro(Unit *who) - { - } - - void MoveInLineOfSight(Unit *who) - { - } + {3546.796, -3869.082, 296.450+20}, + {3531.271, -3847.424, 299.450+20}, + {3497.067, -3843.384, 302.384+20}, +}; - void UpdateAI(const uint32 diff) - { - } +enum Events +{ + EVENT_SPRAY = 1, + EVENT_SHOCK, + EVENT_POISON, + EVENT_WRAP, + EVENT_SUMMON, }; -struct TRINITY_DLL_DECL boss_maexxnaAI : public ScriptedAI +struct TRINITY_DLL_DECL boss_maexxnaAI : public BossAI { - boss_maexxnaAI(Creature *c) : ScriptedAI(c) {} + boss_maexxnaAI(Creature *c) : BossAI(c, BOSS_MAEXXNA) {} - uint32 WebTrap_Timer; - uint32 WebSpray_Timer; - uint32 PoisonShock_Timer; - uint32 NecroticPoison_Timer; - uint32 SummonSpiderling_Timer; - bool Enraged; + bool enraged; - void Reset() + void EnterCombat(Unit *who) { - WebTrap_Timer = 20000; //20 sec init, 40 sec normal - WebSpray_Timer = 40000; //40 seconds - PoisonShock_Timer = 20000; //20 seconds - NecroticPoison_Timer = 30000; //30 seconds - SummonSpiderling_Timer = 30000; //30 sec init, 40 sec normal - Enraged = false; + _EnterCombat(); + enraged = false; + events.ScheduleEvent(EVENT_WRAP, 20000); + events.ScheduleEvent(EVENT_SPRAY, 40000); + events.ScheduleEvent(EVENT_SHOCK, 10000); + events.ScheduleEvent(EVENT_POISON, 5000); + events.ScheduleEvent(EVENT_SUMMON, 40000); } - void Aggro(Unit *who) - { - } - - void DoCastWebWrap() + void UpdateAI(const uint32 diff) { - std::list<HostilReference *> t_list = m_creature->getThreatManager().getThreatList(); - std::vector<Unit *> targets; - - //This spell doesn't work if we only have 1 player on threat list - if(t_list.size() < 2) + if(!UpdateVictim() || !CheckInRoom()) return; - //begin + 1 , so we don't target the one with the highest threat - std::list<HostilReference *>::iterator itr = t_list.begin(); - std::advance(itr, 1); - for( ; itr!= t_list.end(); ++itr) //store the threat list in a different container - { - Unit *target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()); - //only on alive players - if(target && target->isAlive() && target->GetTypeId() == TYPEID_PLAYER ) - targets.push_back( target); - } + events.Update(diff); - while(targets.size() > 3) - //cut down to size if we have more than 3 targets - targets.erase(targets.begin()+rand()%targets.size()); - - int i = 0; - for(std::vector<Unit *>::iterator itr = targets.begin(); itr!= targets.end(); ++itr, ++i) + while(uint32 eventId = events.ExecuteEvent()) { - // Teleport the 3 targets to a location on the wall and summon a Web Wrap on them - Unit *target = *itr; - Creature* Wrap = NULL; - if(target) + switch(eventId) { - switch(i) - { - case 0: - DoTeleportPlayer(target, LOC_X1, LOC_Y1, LOC_Z1, target->GetOrientation()); - Wrap = m_creature->SummonCreature(16486, LOC_X1, LOC_Y1, LOC_Z1, 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000); - break; - case 1: - DoTeleportPlayer(target, LOC_X2, LOC_Y2, LOC_Z2, target->GetOrientation()); - Wrap = m_creature->SummonCreature(16486, LOC_X2, LOC_Y2, LOC_Z2, 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000); - break; - case 2: - DoTeleportPlayer(target, LOC_X3, LOC_Y3, LOC_Z3, target->GetOrientation()); - Wrap = m_creature->SummonCreature(16486, LOC_X3, LOC_Y3, LOC_Z3, 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000); - break; - } - if(Wrap) + case EVENT_WRAP: + for(uint32 i = 0; i < HEROIC(1,2); ++i) + { + if(Unit *target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0, true, -SPELL_WEB_WRAP)) + { + target->RemoveAura(SPELL_WEB_SPRAY); + uint32 pos = rand()%MAX_POS_WRAP; + target->GetMotionMaster()->MoveJump(PosWrap[pos][0], PosWrap[pos][1], PosWrap[pos][2], 20, 20); + if(Creature *wrap = DoSummon(MOB_WEB_WRAP, target, 0, 60000)) + { + wrap->AI()->SetGUID(target->GetGUID()); + wrap->GetMotionMaster()->MoveJump(PosWrap[pos][0], PosWrap[pos][1], PosWrap[pos][2], 20, 20); + } + } + } + events.ScheduleEvent(EVENT_WRAP, 40000); + return; + case EVENT_SPRAY: + DoCastAOE(SPELL_WEB_SPRAY); + events.ScheduleEvent(EVENT_SPRAY, 40000); + return; + case EVENT_SHOCK: + DoCastAOE(SPELL_POISON_SHOCK); + events.ScheduleEvent(EVENT_SHOCK, 10000); + return; + case EVENT_POISON: + DoCast(me->getVictim(), SPELL_NECROTIC_POISON); + events.ScheduleEvent(EVENT_POISON, 30000); + return; + case EVENT_SUMMON: { - Wrap->setFaction(m_creature->getFaction()); - ((mob_webwrapAI*)Wrap->AI())->SetVictim(target); + uint32 amount = 8+rand()%2; + for(uint32 i = 0; i < amount; ++i) + DoSummon(MOB_SPIDERLING, me); + events.ScheduleEvent(EVENT_SUMMON, 40000); + break; } } - } - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //WebTrap_Timer - if (WebTrap_Timer < diff) - { - DoCastWebWrap(); - WebTrap_Timer = 40000; - }else WebTrap_Timer -= diff; - - //WebSpray_Timer - if (WebSpray_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_WEBSPRAY); - WebSpray_Timer = 40000; - }else WebSpray_Timer -= diff; - - //PoisonShock_Timer - if (PoisonShock_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_POISONSHOCK); - PoisonShock_Timer = 20000; - }else PoisonShock_Timer -= diff; - - //NecroticPoison_Timer - if (NecroticPoison_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_NECROTICPOISON); - NecroticPoison_Timer = 30000; - }else NecroticPoison_Timer -= diff; - - //SummonSpiderling_Timer - if (SummonSpiderling_Timer < diff) - { - DoCast(m_creature, SPELL_SUMMON_SPIDERLING); - SummonSpiderling_Timer = 40000; - }else SummonSpiderling_Timer -= diff; + } - //Enrage if not already enraged and below 30% - if (!Enraged && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 30) + if(!enraged && HealthBelowPct(30)) { - DoCast(m_creature,SPELL_FRENZY); - Enraged = true; + DoCast(me, SPELL_FRENZY); + enraged = true; } - - DoMeleeAttackIfReady(); + else + DoMeleeAttackIfReady(); } }; -CreatureAI* GetAI_mob_webwrap(Creature* _Creature) -{ - return new mob_webwrapAI (_Creature); -} - CreatureAI* GetAI_boss_maexxna(Creature *_Creature) { return new boss_maexxnaAI (_Creature); @@ -244,10 +136,5 @@ void AddSC_boss_maexxna() newscript->Name="boss_maexxna"; newscript->GetAI = &GetAI_boss_maexxna; newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_webwrap"; - newscript->GetAI = &GetAI_mob_webwrap; - newscript->RegisterSelf(); } diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_noth.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_noth.cpp index 59f9d33e245..8ce017a936e 100644 --- a/src/bindings/scripts/scripts/zone/naxxramas/boss_noth.cpp +++ b/src/bindings/scripts/scripts/zone/naxxramas/boss_noth.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2008 - 2009 Trinity <http://www.trinitycore.org/> * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -14,31 +14,24 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* ScriptData -SDName: Boss_Noth -SD%Complete: 40 -SDComment: Missing Balcony stage -SDCategory: Naxxramas -EndScriptData */ - #include "precompiled.h" +#include "def_naxxramas.h" -#define SAY_AGGRO1 -1533075 -#define SAY_AGGRO2 -1533076 -#define SAY_AGGRO3 -1533077 +#define SAY_AGGRO RAND(-1533075,-1533076,-1533077) #define SAY_SUMMON -1533078 -#define SAY_SLAY1 -1533079 -#define SAY_SLAY2 -1533080 +#define SAY_SLAY RAND(-1533079,-1533080) #define SAY_DEATH -1533081 -#define SPELL_BLINK 29211 //29208, 29209 and 29210 too -#define SPELL_CRIPPLE 29212 -#define H_SPELL_CRIPPLE 54814 -#define SPELL_CURSE_PLAGUEBRINGER 28213 -#define H_SPELL_CURSE_PLAGUEBRINGER 54835 #define SOUND_DEATH 8848 -#define C_PLAGUED_WARRIOR 16984 +#define SPELL_CURSE_PLAGUEBRINGER HEROIC(29213,54835) +#define SPELL_BLINK RAND(29208,29209,29210,29211) +#define SPELL_CRIPPLE HEROIC(29212,54814) +#define SPELL_TELEPORT 29216 + +#define MOB_WARRIOR 16984 +#define MOB_CHAMPION 16983 +#define MOB_GUARDIAN 16981 // Teleport position of Noth on his balcony #define TELE_X 2631.370 @@ -46,89 +39,162 @@ EndScriptData */ #define TELE_Z 274.040 #define TELE_O 6.277 -// IMPORTANT: BALCONY TELEPORT NOT ADDED YET! WILL BE ADDED SOON! -// Dev note 26.12.2008: When is soon? :) +#define MAX_SUMMON_POS 5 + +const float SummonPos[MAX_SUMMON_POS][4] = +{ + {2728.12, -3544.43, 261.91, 6.04}, + {2729.05, -3544.47, 261.91, 5.58}, + {2728.24, -3465.08, 264.20, 3.56}, + {2704.11, -3456.81, 265.53, 4.51}, + {2663.56, -3464.43, 262.66, 5.20}, +}; + +enum Events +{ + EVENT_BERSERK = 1, + EVENT_CURSE, + EVENT_BLINK, + EVENT_WARRIOR, + EVENT_BALCONY, + EVENT_WAVE, + EVENT_GROUND, +}; -struct TRINITY_DLL_DECL boss_nothAI : public ScriptedAI +struct TRINITY_DLL_DECL boss_nothAI : public BossAI { - boss_nothAI(Creature *c) : ScriptedAI(c) {} + boss_nothAI(Creature *c) : BossAI(c, BOSS_NOTH) {} - uint32 Blink_Timer; - uint32 Curse_Timer; - uint32 Summon_Timer; + uint32 waveCount, balconyCount; void Reset() { - Blink_Timer = 25000; - Curse_Timer = 4000; - Summon_Timer = 12000; + _Reset(); + me->setActive(false); + } + + void EnterCombat(Unit *who) + { + _EnterCombat(); + DoScriptText(SAY_AGGRO, me); + me->setActive(true); + balconyCount = 0; + EnterPhaseGround(); } - void Aggro(Unit *who) + void EnterPhaseGround() { - switch (rand()%3) + DoZoneInCombat(); + if(me->getThreatManager().isThreatListEmpty()) + EnterEvadeMode(); + else { - case 0: DoScriptText(SAY_AGGRO1, m_creature); break; - case 1: DoScriptText(SAY_AGGRO2, m_creature); break; - case 2: DoScriptText(SAY_AGGRO3, m_creature); break; + events.ScheduleEvent(EVENT_BALCONY, 110000); + events.ScheduleEvent(EVENT_CURSE, 20000+rand()%10000); + events.ScheduleEvent(EVENT_WARRIOR, 30000); + if(HeroicMode) + events.ScheduleEvent(EVENT_BLINK, 20000+rand()%10000); } } void KilledUnit(Unit* victim) { - switch (rand()%2) - { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; - } + if(!(rand()%5)) + DoScriptText(SAY_SLAY, me); } - void JustSummoned(Creature* summoned) + void JustSummoned(Creature *summon) { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) - summoned->AddThreat(target,0.0f); + summons.Summon(summon); + summon->setActive(true); + summon->AI()->DoZoneInCombat(); } void JustDied(Unit* Killer) { - DoScriptText(SAY_DEATH, m_creature); + _JustDied(); + DoScriptText(SAY_DEATH, me); } - void UpdateAI(const uint32 diff) + void SummonUndead(uint32 entry, uint32 num) { - if (!UpdateVictim()) - return; - - //Blink_Timer - if (Blink_Timer < diff) + for(uint32 i = 0; i < num; ++i) { - DoCast(m_creature->getVictim(),SPELL_CRIPPLE); - DoCast(m_creature,SPELL_BLINK); + uint32 pos = rand()%MAX_SUMMON_POS; + me->SummonCreature(entry, SummonPos[pos][0], SummonPos[pos][1], SummonPos[pos][2], + SummonPos[pos][3], TEMPSUMMON_CORPSE_DESPAWN, 60000); + } + } - Blink_Timer = 25000; - }else Blink_Timer -= diff; + void UpdateAI(const uint32 diff) + { + if(!UpdateCombatState() || !CheckInRoom()) + return; - //Curse_Timer - if (Curse_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_CURSE_PLAGUEBRINGER); - Curse_Timer = 28000; - }else Curse_Timer -= diff; + events.Update(diff); - //Summon_Timer - if (Summon_Timer < diff) + while(uint32 eventId = events.ExecuteEvent()) { - DoScriptText(SAY_SUMMON, m_creature); - - for(uint8 i = 0; i < 6; i++) - m_creature->SummonCreature(C_PLAGUED_WARRIOR,2684.804,-3502.517,261.313,0,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,80000); - - Summon_Timer = 30500; - } else Summon_Timer -= diff; + switch(eventId) + { + case EVENT_CURSE: + DoCastAOE(SPELL_CURSE_PLAGUEBRINGER); + events.ScheduleEvent(EVENT_CURSE, 20000+rand()%10000); + return; + case EVENT_WARRIOR: + DoScriptText(SAY_SUMMON, me); + SummonUndead(MOB_WARRIOR, HEROIC(2,3)); + events.ScheduleEvent(EVENT_WARRIOR, 30000); + return; + case EVENT_BLINK: + DoCastAOE(SPELL_CRIPPLE, true); + DoCastAOE(SPELL_BLINK); + DoResetThreat(); + events.ScheduleEvent(EVENT_BLINK, 20000+rand()%10000); + return; + case EVENT_BALCONY: + me->SetReactState(REACT_PASSIVE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + me->AttackStop(); + me->RemoveAllAuras(); + me->NearTeleportTo(TELE_X, TELE_Y, TELE_Z, TELE_O); + events.Reset(); + events.ScheduleEvent(EVENT_WAVE, 2000); + waveCount = 0; + return; + case EVENT_WAVE: + DoScriptText(SAY_SUMMON, me); + switch(balconyCount) + { + case 0: SummonUndead(MOB_CHAMPION, HEROIC(2,4)); break; + case 1: SummonUndead(MOB_CHAMPION, HEROIC(1,2)); + SummonUndead(MOB_GUARDIAN, HEROIC(1,2)); break; + case 2: SummonUndead(MOB_GUARDIAN, HEROIC(2,4)); break; + default:SummonUndead(MOB_CHAMPION, HEROIC(5,10)); + SummonUndead(MOB_GUARDIAN, HEROIC(5,10));break; + } + ++waveCount; + events.ScheduleEvent(waveCount < 2 ? EVENT_WAVE : EVENT_GROUND, 34000); + return; + case EVENT_GROUND: + { + ++balconyCount; + me->SetReactState(REACT_AGGRESSIVE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + float x, y, z, o; + me->GetHomePosition(x, y, z, o); + me->NearTeleportTo(x, y, z, o); + EnterPhaseGround(); + return; + } + } + } - DoMeleeAttackIfReady(); + if(me->HasReactState(REACT_AGGRESSIVE)) + DoMeleeAttackIfReady(); } }; + CreatureAI* GetAI_boss_noth(Creature *_Creature) { return new boss_nothAI (_Creature); @@ -142,4 +208,3 @@ void AddSC_boss_noth() newscript->GetAI = &GetAI_boss_noth; newscript->RegisterSelf(); } - diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_patchwerk.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_patchwerk.cpp index 50f4559b4eb..7886fad94cc 100644 --- a/src/bindings/scripts/scripts/zone/naxxramas/boss_patchwerk.cpp +++ b/src/bindings/scripts/scripts/zone/naxxramas/boss_patchwerk.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2008 - 2009 Trinity <http://www.trinitycore.org/> * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -14,130 +14,110 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* ScriptData -SDName: Boss_Patchwerk -SD%Complete: 100 -SDComment: Some issues with hateful strike inturrupting the melee swing timer. Probably core issue. -SDCategory: Naxxramas -EndScriptData */ - #include "precompiled.h" +#include "def_naxxramas.h" -#define SAY_AGGRO1 -1533017 -#define SAY_AGGRO2 -1533018 +#define SAY_AGGRO RAND(-1533017,-1533018) #define SAY_SLAY -1533019 #define SAY_DEATH -1533020 #define EMOTE_BERSERK -1533021 #define EMOTE_ENRAGE -1533022 -#define SPELL_HATEFULSTRIKE 28308 -#define H_SPELL_HATEFULSTRIKE 59192 -#define SPELL_ENRAGE 2813 +#define SPELL_HATEFULSTRIKE HEROIC(41926,59192) +#define SPELL_FRENZY 28131 #define SPELL_BERSERK 26662 #define SPELL_SLIMEBOLT 32309 -struct TRINITY_DLL_DECL boss_patchwerkAI : public ScriptedAI +#define EVENT_BERSERK 1 +#define EVENT_HATEFUL 2 +#define EVENT_SLIME 3 + +struct TRINITY_DLL_DECL boss_patchwerkAI : public BossAI { - boss_patchwerkAI(Creature *c) : ScriptedAI(c) {} + boss_patchwerkAI(Creature *c) : BossAI(c, BOSS_PATCHWERK) {} - uint32 HatefullStrike_Timer; - uint32 Enrage_Timer; - uint32 Slimebolt_Timer; bool Enraged; - void Reset() - { - HatefullStrike_Timer = 1200; //1.2 seconds - Enrage_Timer = 420000; //7 minutes 420,000 - Slimebolt_Timer = 450000; //7.5 minutes 450,000 - Enraged = false; - } - void KilledUnit(Unit* Victim) { - if (rand()%5) - return; - - DoScriptText(SAY_SLAY, m_creature); + if(!(rand()%5)) + DoScriptText(SAY_SLAY, me); } void JustDied(Unit* Killer) { - DoScriptText(SAY_DEATH, m_creature); + _JustDied(); + DoScriptText(SAY_DEATH, me); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { - if (rand()%2) - { - DoScriptText(SAY_AGGRO1, m_creature); - } - else - { - DoScriptText(SAY_AGGRO2, m_creature); - } + _EnterCombat(); + Enraged = false; + DoScriptText(SAY_AGGRO, me); + events.ScheduleEvent(EVENT_HATEFUL, 1200); + events.ScheduleEvent(EVENT_BERSERK, 360000); } void UpdateAI(const uint32 diff) { - if (!UpdateVictim()) + if(!UpdateVictim()) return; - //HatefullStrike_Timer - if (HatefullStrike_Timer < diff) + events.Update(diff); + + while(uint32 eventId = events.ExecuteEvent()) { - //Cast Hateful strike on the player with the highest - //amount of HP within melee distance - uint32 MostHP = 0; - Unit* pMostHPTarget = NULL; - Unit* pTemp = NULL; - std::list<HostilReference*>::iterator i = m_creature->getThreatManager().getThreatList().begin(); - - for (i = m_creature->getThreatManager().getThreatList().begin(); i!=m_creature->getThreatManager().getThreatList().end();) + switch(eventId) { - pTemp = Unit::GetUnit((*m_creature),(*i)->getUnitGuid()); - ++i; - if (pTemp && pTemp->isAlive() && pTemp->GetHealth() > MostHP && m_creature->GetDistance2d(pTemp) < 5) + case EVENT_HATEFUL: { - MostHP = pTemp->GetHealth(); - pMostHPTarget = pTemp; + //Cast Hateful strike on the player with the highest + //amount of HP within melee distance + uint32 MostHP = 0; + Unit* pMostHPTarget = NULL; + std::list<HostilReference*>::iterator i = me->getThreatManager().getThreatList().begin(); + for(; i != me->getThreatManager().getThreatList().end(); ++i) + { + Unit* target = (*i)->getTarget(); + if (target->isAlive() && target->GetHealth() > MostHP && me->IsWithinMeleeRange(target)) + { + MostHP = target->GetHealth(); + pMostHPTarget = target; + } + } + + if (pMostHPTarget) + DoCast(pMostHPTarget, SPELL_HATEFULSTRIKE, true); + + events.ScheduleEvent(EVENT_HATEFUL, 1200); + return; } + case EVENT_BERSERK: + DoCast(m_creature, SPELL_BERSERK); + DoScriptText(EMOTE_BERSERK, m_creature); + events.ScheduleEvent(EVENT_SLIME, 2000); + return; + case EVENT_SLIME: + DoCast(m_creature->getVictim(), SPELL_SLIMEBOLT); + events.ScheduleEvent(EVENT_SLIME, 2000); + return; } + } - if (pMostHPTarget) - DoCast(pMostHPTarget, SPELL_HATEFULSTRIKE); - - HatefullStrike_Timer = 1200; - }else HatefullStrike_Timer -= diff; - - //Enrage_Timer - if (Enrage_Timer < diff) - { - DoCast(m_creature, SPELL_BERSERK); - DoScriptText(EMOTE_BERSERK, m_creature); - - Enrage_Timer = 300000; - }else Enrage_Timer -= diff; - - //Slimebolt_Timer - if (Slimebolt_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_SLIMEBOLT); - Slimebolt_Timer = 5000; - }else Slimebolt_Timer -= diff; - - //Enrage if not already enraged and below 5% - if (!Enraged && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 5) + if(!Enraged && HealthBelowPct(5)) { - DoCast(m_creature,SPELL_ENRAGE); - DoScriptText(EMOTE_ENRAGE,NULL); + DoCast(m_creature, SPELL_FRENZY); + DoScriptText(EMOTE_ENRAGE, NULL); Enraged = true; + return; } DoMeleeAttackIfReady(); } }; + CreatureAI* GetAI_boss_patchwerk(Creature *_Creature) { return new boss_patchwerkAI (_Creature); @@ -151,4 +131,3 @@ void AddSC_boss_patchwerk() newscript->GetAI = &GetAI_boss_patchwerk; newscript->RegisterSelf(); } - diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_razuvious.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_razuvious.cpp index 9a8277264e5..67fcaee7de3 100644 --- a/src/bindings/scripts/scripts/zone/naxxramas/boss_razuvious.cpp +++ b/src/bindings/scripts/scripts/zone/naxxramas/boss_razuvious.cpp @@ -1,4 +1,6 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* + * Copyright (C) 2008 - 2009 Trinity <http://www.trinitycore.org/> + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -14,14 +16,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* ScriptData -SDName: Boss_Razuvious -SD%Complete: 50 -SDComment: Missing adds and event is impossible without Mind Control -SDCategory: Naxxramas -EndScriptData */ - #include "precompiled.h" +#include "def_naxxramas.h" //Razuvious - NO TEXT sound only //8852 aggro01 - Hah hah, I'm just getting warmed up! @@ -37,121 +33,86 @@ EndScriptData */ //8860 death - An honorable... death... //8947 - Aggro Mixed? - ? -#define SOUND_AGGRO1 8852 -#define SOUND_AGGRO2 8853 -#define SOUND_AGGRO3 8854 -#define SOUND_SLAY1 8861 -#define SOUND_SLAY2 8863 -#define SOUND_COMMND1 8855 -#define SOUND_COMMND2 8856 -#define SOUND_COMMND3 8858 -#define SOUND_COMMND4 8859 -#define SOUND_COMMND5 8861 +#define SOUND_AGGRO RAND(8852,8853,8854) +#define SOUND_SLAY RAND(8861,8863) +#define SOUND_COMMND RAND(8855,8856,8858,8859,8861) #define SOUND_DEATH 8860 #define SOUND_AGGROMIX 8847 -#define SPELL_UNBALANCINGSTRIKE 26613 -#define SPELL_DISRUPTINGSHOUT 29107 +#define SPELL_UNBALANCING_STRIKE 26613 +#define SPELL_DISRUPTING_SHOUT HEROIC(29107,55543) +#define SPELL_JAGGED_KNIFE 55550 +#define SPELL_HOPELESS 29125 -struct TRINITY_DLL_DECL boss_razuviousAI : public ScriptedAI +enum Events { - boss_razuviousAI(Creature *c) : ScriptedAI(c) {} - - uint32 UnbalancingStrike_Timer; - uint32 DisruptingShout_Timer; - uint32 CommandSound_Timer; + EVENT_STRIKE, + EVENT_SHOUT, + EVENT_KNIFE, + EVENT_COMMAND, +}; - void Reset() - { - UnbalancingStrike_Timer = 30000; //30 seconds - DisruptingShout_Timer = 25000; //25 seconds - CommandSound_Timer = 40000; //40 seconds - } +struct TRINITY_DLL_DECL boss_razuviousAI : public BossAI +{ + boss_razuviousAI(Creature *c) : BossAI(c, BOSS_RAZUVIOUS) {} - void KilledUnit(Unit* Victim) + void KilledUnit(Unit* victim) { - if (rand()%3) - return; - - switch (rand()%2) - { - case 0: - DoPlaySoundToSet(m_creature, SOUND_SLAY1); - break; - case 1: - DoPlaySoundToSet(m_creature, SOUND_SLAY2); - break; - } + if(!(rand()%3)) + DoPlaySoundToSet(me, SOUND_SLAY); } - void JustDied(Unit* Killer) + void JustDied(Unit* killer) { - DoPlaySoundToSet(m_creature, SOUND_DEATH); + _JustDied(); + DoPlaySoundToSet(me, SOUND_DEATH); + me->CastSpell(me, SPELL_HOPELESS, true); // TODO: this may affect other creatures } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { - switch (rand()%3) - { - case 0: - DoPlaySoundToSet(m_creature, SOUND_AGGRO1); - break; - case 1: - DoPlaySoundToSet(m_creature, SOUND_AGGRO2); - break; - case 2: - DoPlaySoundToSet(m_creature, SOUND_AGGRO3); - break; - } + _EnterCombat(); + DoPlaySoundToSet(m_creature, SOUND_AGGRO); + events.ScheduleEvent(EVENT_STRIKE, 30000); + events.ScheduleEvent(EVENT_SHOUT, 25000); + events.ScheduleEvent(EVENT_COMMAND, 40000); } void UpdateAI(const uint32 diff) { - if (!UpdateVictim()) + if(!UpdateVictim()) return; - //UnbalancingStrike_Timer - if (UnbalancingStrike_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_UNBALANCINGSTRIKE); - UnbalancingStrike_Timer = 30000; - }else UnbalancingStrike_Timer -= diff; - - //DisruptingShout_Timer - if (DisruptingShout_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_DISRUPTINGSHOUT); - DisruptingShout_Timer = 25000; - }else DisruptingShout_Timer -= diff; + events.Update(diff); - //CommandSound_Timer - if (CommandSound_Timer < diff) + while(uint32 eventId = events.ExecuteEvent()) { - switch (rand()%5) + switch(eventId) { - case 0: - DoPlaySoundToSet(m_creature, SOUND_COMMND1); - break; - case 1: - DoPlaySoundToSet(m_creature, SOUND_COMMND2); - break; - case 2: - DoPlaySoundToSet(m_creature, SOUND_COMMND3); - break; - case 3: - DoPlaySoundToSet(m_creature, SOUND_COMMND4); - break; - case 4: - DoPlaySoundToSet(m_creature, SOUND_COMMND5); - break; + case EVENT_STRIKE: + DoCast(me->getVictim(), SPELL_UNBALANCING_STRIKE); + events.ScheduleEvent(EVENT_STRIKE, 30000); + return; + case EVENT_SHOUT: + DoCastAOE(SPELL_DISRUPTING_SHOUT); + events.ScheduleEvent(EVENT_SHOUT, 25000); + return; + case EVENT_KNIFE: + if(Unit *target = SelectTarget(SELECT_TARGET_RANDOM, 0, 45)) + DoCast(target, SPELL_JAGGED_KNIFE); + events.ScheduleEvent(EVENT_KNIFE, 25000); + return; + case EVENT_COMMAND: + DoPlaySoundToSet(me, SOUND_COMMND); + events.ScheduleEvent(EVENT_COMMAND, 40000); + return; } - - CommandSound_Timer = 40000; - }else CommandSound_Timer -= diff; + } DoMeleeAttackIfReady(); } }; + CreatureAI* GetAI_boss_razuvious(Creature *_Creature) { return new boss_razuviousAI (_Creature); @@ -165,4 +126,3 @@ void AddSC_boss_razuvious() newscript->GetAI = &GetAI_boss_razuvious; newscript->RegisterSelf(); } - diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_sapphiron.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_sapphiron.cpp index 43396199f5f..05dea45ed25 100644 --- a/src/bindings/scripts/scripts/zone/naxxramas/boss_sapphiron.cpp +++ b/src/bindings/scripts/scripts/zone/naxxramas/boss_sapphiron.cpp @@ -1,4 +1,6 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* + * Copyright (C) 2008 - 2009 Trinity <http://www.trinitycore.org/> + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -14,154 +16,318 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* ScriptData -SDName: Boss_Sapphiron -SD%Complete: 0 -SDComment: Place Holder -SDCategory: Naxxramas -EndScriptData */ - #include "precompiled.h" +#include "def_naxxramas.h" #define EMOTE_BREATH -1533082 #define EMOTE_ENRAGE -1533083 +#define SPELL_FROST_AURA HEROIC(28531,55799) +#define SPELL_CLEAVE 19983 +#define SPELL_TAIL_SWEEP HEROIC(55697,55696) +#define SPELL_SUMMON_BLIZZARD 28560 +#define SPELL_LIFE_DRAIN HEROIC(28542,55665) #define SPELL_ICEBOLT 28522 #define SPELL_FROST_BREATH 29318 -#define SPELL_FROST_AURA 28531 -#define SPELL_LIFE_DRAIN 28542 -#define SPELL_BLIZZARD 28547 -#define SPELL_BESERK 26662 +#define SPELL_FROST_EXPLOSION 28524 +#define SPELL_FROST_MISSILE 30101 +#define SPELL_BERSERK 26662 +#define SPELL_DIES 29357 + +#define SPELL_CHILL HEROIC(28547,55699) + +#define MOB_BLIZZARD 16474 +#define GO_ICEBLOCK 181247 + +enum Phases +{ + PHASE_NULL = 0, + PHASE_BIRTH, + PHASE_GROUND, + PHASE_FLIGHT, +}; + +enum Events +{ + EVENT_BERSERK = 1, + EVENT_CLEAVE, + EVENT_TAIL, + EVENT_DRAIN, + EVENT_BLIZZARD, + EVENT_FLIGHT, + EVENT_LIFTOFF, + EVENT_ICEBOLT, + EVENT_BREATH, + EVENT_EXPLOSION, + EVENT_LAND, + EVENT_GROUND, + EVENT_BIRTH, +}; -struct TRINITY_DLL_DECL boss_sapphironAI : public ScriptedAI +typedef std::map<uint64, uint64> IceBlockMap; + +struct TRINITY_DLL_DECL boss_sapphironAI : public BossAI { - boss_sapphironAI(Creature* c) : ScriptedAI(c) {} - - uint32 Icebolt_Count; - uint32 Icebolt_Timer; - uint32 FrostBreath_Timer; - uint32 FrostAura_Timer; - uint32 LifeDrain_Timer; - uint32 Blizzard_Timer; - uint32 Fly_Timer; - uint32 Fly2_Timer; - uint32 Beserk_Timer; - uint32 phase; - bool IsInFly; - uint32 land_Timer; + boss_sapphironAI(Creature* c) : BossAI(c, BOSS_SAPPHIRON) + , phase(PHASE_NULL) + {} + + Phases phase; + uint32 iceboltCount; + IceBlockMap iceblocks; + + void InitializeAI() + { + float x, y, z; + me->GetPosition(x, y, z); + me->SummonGameObject(GO_BIRTH, x, y, z, 0, 0, 0, 0, 0, 0); + me->SetVisibility(VISIBILITY_OFF); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + me->SetReactState(REACT_PASSIVE); + + Reset(); + } void Reset() { - FrostAura_Timer = 2000; - LifeDrain_Timer = 24000; - Blizzard_Timer = 20000; - Fly_Timer = 45000; - Icebolt_Timer = 4000; - land_Timer = 0; - Beserk_Timer = 0; - phase = 1; - Icebolt_Count = 0; - IsInFly = false; - - m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING + MOVEMENTFLAG_ONTRANSPORT); + _Reset(); + + if(phase = PHASE_FLIGHT) + ClearIceBlock(); + + phase = PHASE_NULL; + } + + void EnterCombat(Unit *who) + { + _EnterCombat(); + + me->CastSpell(me, SPELL_FROST_AURA, true); + + events.ScheduleEvent(EVENT_BERSERK, 15*60000); + EnterPhaseGround(); + } + + void SpellHitTarget(Unit *target, const SpellEntry *spell) + { + if(spell->Id == SPELL_ICEBOLT) + { + IceBlockMap::iterator itr = iceblocks.find(target->GetGUID()); + if(itr != iceblocks.end() && !itr->second) + { + if(GameObject *iceblock = me->SummonGameObject(GO_ICEBLOCK, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, 0, 0, 0, 0, 25000)) + itr->second = iceblock->GetGUID(); + } + } } - void Aggro(Unit *who) + void JustDied(Unit* who) { + _JustDied(); + me->CastSpell(me, SPELL_DIES, true); + } + + void MovementInform(uint32, uint32 id) + { + if(id == 1) + events.ScheduleEvent(EVENT_LIFTOFF, 0); + } + + void DoAction(const int32 param) + { + if(param == DATA_SAPPHIRON_BIRTH) + { + phase = PHASE_BIRTH; + events.ScheduleEvent(EVENT_BIRTH, 23000); + } + } + + void EnterPhaseGround() + { + phase = PHASE_GROUND; + me->SetReactState(REACT_AGGRESSIVE); + events.SetPhase(PHASE_GROUND); + events.ScheduleEvent(EVENT_CLEAVE, 5000+rand()%10000, 0, PHASE_GROUND); + events.ScheduleEvent(EVENT_TAIL, 5000+rand()%10000, 0, PHASE_GROUND); + events.ScheduleEvent(EVENT_DRAIN, 24000, 0, PHASE_GROUND); + events.ScheduleEvent(EVENT_BLIZZARD, 5000+rand()%5000, 0, PHASE_GROUND); + events.ScheduleEvent(EVENT_FLIGHT, 45000); + } + + void ClearIceBlock() + { + for(IceBlockMap::iterator itr = iceblocks.begin(); itr != iceblocks.end(); ++itr) + { + if(Player *player = Unit::GetPlayer(itr->first)) + player->RemoveAura(SPELL_ICEBOLT); + if(GameObject *go = GameObject::GetGameObject(*me, itr->second)) + go->Delete(); + } + iceblocks.clear(); } void UpdateAI(const uint32 diff) { - if (!UpdateVictim()) + if(!phase) return; - if(phase == 1) - { - if(FrostAura_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_FROST_AURA); - FrostAura_Timer = 5000; - }else FrostAura_Timer -= diff; - - if(LifeDrain_Timer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_LIFE_DRAIN); - LifeDrain_Timer = 24000; - }else LifeDrain_Timer -= diff; + events.Update(diff); - if(Blizzard_Timer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_BLIZZARD); - Blizzard_Timer = 20000; - }else Blizzard_Timer -= diff; + if(phase != PHASE_BIRTH && !UpdateCombatState() || !CheckInRoom()) + return; - if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() > 10) + if(phase == PHASE_GROUND) + { + while(uint32 eventId = events.ExecuteEvent()) + { + switch(eventId) { - if(Fly_Timer < diff) + case EVENT_BERSERK: + DoScriptText(EMOTE_ENRAGE, m_creature); + DoCast(me, SPELL_BERSERK); + return; + case EVENT_CLEAVE: + DoCast(me->getVictim(), SPELL_CLEAVE); + events.ScheduleEvent(EVENT_CLEAVE, 5000+rand()%10000, 0, PHASE_GROUND); + return; + case EVENT_TAIL: + DoCastAOE(SPELL_TAIL_SWEEP); + events.ScheduleEvent(EVENT_TAIL, 5000+rand()%10000, 0, PHASE_GROUND); + return; + case EVENT_DRAIN: + DoCastAOE(SPELL_LIFE_DRAIN); + events.ScheduleEvent(EVENT_DRAIN, 24000, 0, PHASE_GROUND); + return; + case EVENT_BLIZZARD: { - phase = 2; - m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF); - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING + MOVEMENTFLAG_ONTRANSPORT); - m_creature->GetMotionMaster()->Clear(false); - m_creature->GetMotionMaster()->MoveIdle(); - m_creature->SetHover(true); - Icebolt_Timer = 4000; - Icebolt_Count = 0; - IsInFly = true; - }else Fly_Timer -= diff; + //DoCastAOE(SPELL_SUMMON_BLIZZARD); + float x, y, z; + me->GetGroundPointAroundUnit(x, y, z, rand_norm()*20, rand_norm()*2*M_PI); + if(Creature *summon = me->SummonCreature(MOB_BLIZZARD, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN, 25000+rand()%5000)) + summon->GetMotionMaster()->MoveRandom(40); + events.ScheduleEvent(EVENT_BLIZZARD, HEROIC(20000,7000), 0, PHASE_GROUND); + break; + } + case EVENT_FLIGHT: + phase = PHASE_FLIGHT; + events.SetPhase(PHASE_FLIGHT); + me->SetReactState(REACT_PASSIVE); + me->AttackStop(); + float x, y, z, o; + me->GetHomePosition(x, y, z, o); + me->GetMotionMaster()->MovePoint(1, x, y, z); + return; } } - if (phase == 2) + DoMeleeAttackIfReady(); + } + else + { + if(uint32 eventId = events.ExecuteEvent()) + { + switch(eventId) { - if(Icebolt_Timer < diff && Icebolt_Count < 5) + case EVENT_LIFTOFF: + me->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF); + me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SendMovementFlagUpdate(); + events.ScheduleEvent(EVENT_ICEBOLT, 1500); + iceboltCount = HEROIC(2,3); + return; + case EVENT_ICEBOLT: { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) + std::vector<Unit*> targets; + std::list<HostilReference*>::iterator i = me->getThreatManager().getThreatList().begin(); + for(; i != me->getThreatManager().getThreatList().end(); ++i) + if((*i)->getTarget()->GetTypeId() == TYPEID_PLAYER && !(*i)->getTarget()->HasAura(SPELL_ICEBOLT)) + targets.push_back((*i)->getTarget()); + + if(targets.empty()) + iceboltCount = 0; + else { - DoCast(target,SPELL_ICEBOLT); - ++Icebolt_Count; - error_log("Count incremented"); + std::vector<Unit*>::iterator itr = targets.begin(); + advance(itr, rand()%targets.size()); + iceblocks.insert(std::make_pair((*itr)->GetGUID(), 0)); + DoCast(*itr, SPELL_ICEBOLT); + --iceboltCount; } - FrostBreath_Timer = 6000; - Icebolt_Timer = 4000; - }else Icebolt_Timer -= diff; - if(Icebolt_Count == 5 && IsInFly && FrostBreath_Timer < diff ) + if(iceboltCount) + events.ScheduleEvent(EVENT_ICEBOLT, 1000); + else + events.ScheduleEvent(EVENT_BREATH, 1000); + return; + } + case EVENT_BREATH: { - DoScriptText(EMOTE_BREATH, m_creature); - DoCast(m_creature->getVictim(),SPELL_FROST_BREATH); - land_Timer = 2000; - IsInFly = false; - FrostBreath_Timer = 6000; - }else FrostBreath_Timer -= diff; - - if(!IsInFly && land_Timer < diff) - { - phase = 1; - m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LAND); - m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING + MOVEMENTFLAG_ONTRANSPORT); - m_creature->GetMotionMaster()->Clear(false); - m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); - m_creature->SetHover(true); - land_Timer = 0; - Fly_Timer = 67000; - }else land_Timer -= diff; + DoScriptText(EMOTE_BREATH, me); + DoCastAOE(SPELL_FROST_MISSILE); + events.ScheduleEvent(EVENT_EXPLOSION, 8000); + return; + } + case EVENT_EXPLOSION: + CastExplosion(); + ClearIceBlock(); + events.ScheduleEvent(EVENT_LAND, 3000); + return; + case EVENT_LAND: + me->HandleEmoteCommand(EMOTE_ONESHOT_LAND); + me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SendMovementFlagUpdate(); + events.ScheduleEvent(EVENT_GROUND, 1500); + return; + case EVENT_GROUND: + EnterPhaseGround(); + return; + case EVENT_BIRTH: + me->SetVisibility(VISIBILITY_ON); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + me->SetReactState(REACT_AGGRESSIVE); + return; } + }//if(uint32 eventId = events.ExecuteEvent()) + }//if(phase == PHASE_GROUND) + } - if ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() <= 10) + void CastExplosion() + { + DoZoneInCombat(); // make sure everyone is in threatlist + std::vector<Unit*> targets; + std::list<HostilReference*>::iterator i = me->getThreatManager().getThreatList().begin(); + for(; i != me->getThreatManager().getThreatList().end(); ++i) + { + Unit *target = (*i)->getTarget(); + if(target->GetTypeId() != TYPEID_PLAYER) + continue; + + if(target->HasAura(SPELL_ICEBOLT)) + { + target->ApplySpellImmune(0, IMMUNITY_ID, SPELL_FROST_EXPLOSION, true); + targets.push_back(target); + continue; + } + + for(IceBlockMap::iterator itr = iceblocks.begin(); itr != iceblocks.end(); ++itr) + { + if(GameObject *go = GameObject::GetGameObject(*me, itr->second)) { - if (Beserk_Timer < diff) + if(go->IsInBetween(me, target, 2.0f) + && me->GetExactDistance2d(target->GetPositionX(), target->GetPositionY()) - me->GetExactDistance2d(go->GetPositionX(), go->GetPositionY()) < 5.0f) { - DoScriptText(EMOTE_ENRAGE, m_creature); - DoCast(m_creature,SPELL_BESERK); - Beserk_Timer = 300000; - }else Beserk_Timer -= diff; + target->ApplySpellImmune(0, IMMUNITY_ID, SPELL_FROST_EXPLOSION, true); + targets.push_back(target); + break; + } } + } + } - if (phase!=2) - DoMeleeAttackIfReady(); + me->CastSpell(me, SPELL_FROST_EXPLOSION, true); + + for(std::vector<Unit*>::iterator itr = targets.begin(); itr != targets.end(); ++itr) + (*itr)->ApplySpellImmune(0, IMMUNITY_ID, SPELL_FROST_EXPLOSION, false); } }; @@ -177,5 +343,8 @@ void AddSC_boss_sapphiron() newscript->Name="boss_sapphiron"; newscript->GetAI = &GetAI_boss_sapphiron; newscript->RegisterSelf(); -} + // Chill + GetAISpellInfo(28547)->cooldown = 1000; + GetAISpellInfo(55699)->cooldown = 1000; +} diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_thaddius.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_thaddius.cpp index a8bc620ec17..941fe420ed3 100644 --- a/src/bindings/scripts/scripts/zone/naxxramas/boss_thaddius.cpp +++ b/src/bindings/scripts/scripts/zone/naxxramas/boss_thaddius.cpp @@ -1,4 +1,6 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* + * Copyright (C) 2008 - 2009 Trinity <http://www.trinitycore.org/> + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -14,14 +16,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* ScriptData -SDName: Boss_Thaddius -SD%Complete: 0 -SDComment: Merge Feugen & Stalagg with this script -SDCategory: Naxxramas -EndScriptData */ - #include "precompiled.h" +#include "def_naxxramas.h" //Stalagg #define SAY_STAL_AGGRO -1533023 @@ -40,11 +36,14 @@ EndScriptData */ //both #define SPELL_WARSTOMP 28125 + + //generic +#define C_TESLA_COIL 16218 //the coils (emotes "Tesla Coil overloads!") + + //Thaddus #define SAY_GREET -1533029 -#define SAY_AGGRO1 -1533030 -#define SAY_AGGRO2 -1533031 -#define SAY_AGGRO3 -1533032 +#define SAY_AGGRO RAND(-1533030,-1533031,-1533032) #define SAY_SLAY -1533033 #define SAY_ELECT -1533034 #define SAY_DEATH -1533035 @@ -53,19 +52,92 @@ EndScriptData */ #define SAY_SCREAM3 -1533038 #define SAY_SCREAM4 -1533039 -#define SPELL_BALL_LIGHTNING 28299 +#define SPELL_POLARITY_SHIFT 28089 +#define SPELL_BALL_LIGHTNING 28299 +#define SPELL_CHAIN_LIGHTNING HEROIC(28167,54531) +#define SPELL_BERSERK 27680 -#define SPELL_CHARGE_POSITIVE_DMGBUFF 29659 -#define SPELL_CHARGE_POSITIVE_NEARDMG 28059 +enum Events +{ + EVENT_SHIFT = 1, + EVENT_CHAIN, + EVENT_BERSERK, +}; -#define SPELL_CHARGE_NEGATIVE_DMGBUFF 29660 -#define SPELL_CHARGE_NEGATIVE_NEARDMG 28084 +struct TRINITY_DLL_DECL boss_thaddiusAI : public BossAI +{ + boss_thaddiusAI(Creature *c) : BossAI(c, BOSS_THADDIUS) + { + // temp + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2 | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_STUNNED); + } -#define SPELL_CHAIN_LIGHTNING 28167 -#define H_SPELL_CHAIN_LIGHTNING 54531 + void KilledUnit(Unit* victim) + { + if(!(rand()%5)) + DoScriptText(SAY_SLAY, me); + } -#define SPELL_BESERK 26662 + void JustDied(Unit* Killer) + { + _JustDied(); + DoScriptText(SAY_DEATH, me); + } - //generic -#define C_TESLA_COIL 16218 //the coils (emotes "Tesla Coil overloads!") + void EnterCombat(Unit *who) + { + _EnterCombat(); + DoScriptText(SAY_AGGRO, me); + events.ScheduleEvent(EVENT_SHIFT, 30000); + events.ScheduleEvent(EVENT_CHAIN, 10000+rand()%10000); + events.ScheduleEvent(EVENT_BERSERK, 6*60000); + } + + void UpdateAI(const uint32 diff) + { + if(!UpdateVictim()) + return; + + events.Update(diff); + + if(me->hasUnitState(UNIT_STAT_CASTING)) + return; + + while(uint32 eventId = events.ExecuteEvent()) + { + switch(eventId) + { + case EVENT_SHIFT: + DoCastAOE(SPELL_POLARITY_SHIFT); + events.ScheduleEvent(EVENT_SHIFT, 30000); + return; + case EVENT_CHAIN: + DoCast(me->getVictim(), SPELL_CHAIN_LIGHTNING); + events.ScheduleEvent(EVENT_CHAIN, 10000+rand()%10000); + return; + case EVENT_BERSERK: + DoCast(me, SPELL_BERSERK); + return; + } + } + + if(events.GetTimer() > 15000 && !me->IsWithinMeleeRange(me->getVictim())) + DoCast(me->getVictim(), SPELL_BALL_LIGHTNING); + else + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_thaddius(Creature *_Creature) +{ + return new boss_thaddiusAI (_Creature); +} +void AddSC_boss_thaddius() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_thaddius"; + newscript->GetAI = &GetAI_boss_thaddius; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/zone/naxxramas/def_naxxramas.h b/src/bindings/scripts/scripts/zone/naxxramas/def_naxxramas.h new file mode 100644 index 00000000000..383200d4600 --- /dev/null +++ b/src/bindings/scripts/scripts/zone/naxxramas/def_naxxramas.h @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2008 - 2009 Trinity <http://www.trinitycore.org/> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef DEF_NAXXRAMAS_H +#define DEF_NAXXRAMAS_H + +enum Encounter +{ + BOSS_ANUBREKHAN, + BOSS_FAERLINA, + BOSS_MAEXXNA, + BOSS_NOTH, + BOSS_HEIGAN, + BOSS_LOATHEB, + BOSS_PATCHWERK, + BOSS_GROBBULUS, + BOSS_GLUTH, + BOSS_THADDIUS, + BOSS_RAZUVIOUS, + BOSS_GOTHIK, + BOSS_HORSEMEN, + BOSS_SAPPHIRON, + BOSS_KELTHUZAD, + MAX_BOSS_NUMBER +}; + +enum Data +{ + DATA_HEIGAN_ERUPT, + DATA_GOTHIK_GATE, + DATA_SAPPHIRON_BIRTH, +}; + +#define GO_BIRTH 181356 + +#endif + diff --git a/src/bindings/scripts/scripts/zone/naxxramas/instance_naxxramas.cpp b/src/bindings/scripts/scripts/zone/naxxramas/instance_naxxramas.cpp index e589630c15f..95783562e65 100644 --- a/src/bindings/scripts/scripts/zone/naxxramas/instance_naxxramas.cpp +++ b/src/bindings/scripts/scripts/zone/naxxramas/instance_naxxramas.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2008 - 2009 Trinity <http://www.trinitycore.org/> * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -14,12 +14,181 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* ScriptData -SDName: Instance_Naxxramas -SD%Complete: 0 -SDComment: Place holder -SDCategory: Naxxramas -EndScriptData */ - #include "precompiled.h" +#include "def_naxxramas.h" + +const DoorData doorData[] = +{ + {181126, BOSS_ANUBREKHAN,DOOR_TYPE_ROOM, BOUNDARY_S}, + {181195, BOSS_ANUBREKHAN,DOOR_TYPE_PASSAGE, 0}, + {194022, BOSS_FAERLINA, DOOR_TYPE_PASSAGE, 0}, + {181209, BOSS_FAERLINA, DOOR_TYPE_PASSAGE, 0}, + {181209, BOSS_MAEXXNA, DOOR_TYPE_ROOM, BOUNDARY_SW}, + {181200, BOSS_NOTH, DOOR_TYPE_ROOM, BOUNDARY_N}, + {181201, BOSS_NOTH, DOOR_TYPE_PASSAGE, BOUNDARY_E}, + {181202, BOSS_NOTH, DOOR_TYPE_PASSAGE, 0}, + {181202, BOSS_HEIGAN, DOOR_TYPE_ROOM, BOUNDARY_N}, + {181203, BOSS_HEIGAN, DOOR_TYPE_PASSAGE, BOUNDARY_E}, + {181241, BOSS_HEIGAN, DOOR_TYPE_PASSAGE, 0}, + {181241, BOSS_LOATHEB, DOOR_TYPE_ROOM, BOUNDARY_W}, + {181123, BOSS_PATCHWERK, DOOR_TYPE_PASSAGE, 0}, + {181123, BOSS_GROBBULUS, DOOR_TYPE_ROOM, 0}, + {181120, BOSS_GLUTH, DOOR_TYPE_PASSAGE, BOUNDARY_NW}, + {181121, BOSS_GLUTH, DOOR_TYPE_PASSAGE, 0}, + {181121, BOSS_THADDIUS, DOOR_TYPE_ROOM, 0}, + {181124, BOSS_RAZUVIOUS, DOOR_TYPE_PASSAGE, 0}, + {181124, BOSS_GOTHIK, DOOR_TYPE_ROOM, BOUNDARY_N}, + {181125, BOSS_GOTHIK, DOOR_TYPE_PASSAGE, BOUNDARY_S}, + {181119, BOSS_GOTHIK, DOOR_TYPE_PASSAGE, 0}, + {181119, BOSS_HORSEMEN, DOOR_TYPE_ROOM, BOUNDARY_NE}, + {181225, BOSS_SAPPHIRON, DOOR_TYPE_PASSAGE, BOUNDARY_W}, + {0, 0, DOOR_TYPE_ROOM, 0}, // EOF +}; + +const MinionData minionData[] = +{ + //{16573, BOSS_ANUBREKHAN}, there is no spawn point in db, so we do not add them here + {16506, BOSS_FAERLINA}, + {16803, BOSS_RAZUVIOUS}, + {16063, BOSS_HORSEMEN}, + {16064, BOSS_HORSEMEN}, + {16065, BOSS_HORSEMEN}, + {30549, BOSS_HORSEMEN}, + {0, 0,} +}; + +#define GO_GOTHIK_GATE 181170 +#define GO_HORSEMEN_CHEST 181366 + +#define SPELL_ERUPTION 29371 + +const float HeiganPos[2] = {2796, -3707}; +const float HeiganEruptionSlope[3] = +{ + (-3685 - HeiganPos[1]) /(2724 - HeiganPos[0]), + (-3647 - HeiganPos[1]) /(2749 - HeiganPos[0]), + (-3637 - HeiganPos[1]) /(2771 - HeiganPos[0]), +}; + +// 0 H x +// 1 ^ +// 2 | +// 3 y<--o +inline uint32 GetEruptionSection(float x, float y) +{ + y -= HeiganPos[1]; + if(y < 1.0f) + return 0; + + x -= HeiganPos[0]; + if(x > -1.0f) + return 3; + + float slope = y/x; + for(uint32 i = 0; i < 3; ++i) + if(slope > HeiganEruptionSlope[i]) + return i; + return 3; +} + +struct TRINITY_DLL_DECL instance_naxxramas : public InstanceData +{ + instance_naxxramas(Map *map) : InstanceData(map) + , Sapphiron(NULL), GothikGate(NULL), HorsemenChest(NULL), HorsemenNum(0) + { + SetBossNumber(MAX_BOSS_NUMBER); + LoadDoorData(doorData); + LoadMinionData(minionData); + } + + std::set<GameObject*> HeiganEruption[4]; + GameObject *GothikGate, *HorsemenChest; + Creature *Sapphiron; + uint32 HorsemenNum; + + void OnCreatureCreate(Creature *creature, bool add) + { + switch(creature->GetEntry()) + { + case 15989: Sapphiron = add ? creature : NULL; return; + } + + AddMinion(creature, add); + } + + void OnGameObjectCreate(GameObject* go, bool add) + { + if(go->GetGOInfo()->displayId == 6785 || go->GetGOInfo()->displayId == 1287) + { + uint32 section = GetEruptionSection(go->GetPositionX(), go->GetPositionY()); + if(add) + HeiganEruption[section].insert(go); + else + HeiganEruption[section].erase(go); + return; + } + + switch(go->GetEntry()) + { + case GO_BIRTH: if(!add && Sapphiron) Sapphiron->AI()->DoAction(DATA_SAPPHIRON_BIRTH); return; + case GO_GOTHIK_GATE: GothikGate = add ? go : NULL; break; + case GO_HORSEMEN_CHEST: HorsemenChest = add ? go : NULL; break; + } + + AddDoor(go, add); + } + + void SetData(uint32 id, uint32 value) + { + switch(id) + { + case DATA_HEIGAN_ERUPT: + HeiganErupt(value); + break; + case DATA_GOTHIK_GATE: + if(GothikGate) + GothikGate->SetGoState(GOState(value)); + break; + } + } + + bool SetBossState(uint32 id, EncounterState state) + { + if(!InstanceData::SetBossState(id, state)) + return false; + + if(id == BOSS_HORSEMEN && state == DONE && HorsemenChest) + HorsemenChest->SetRespawnTime(HorsemenChest->GetRespawnDelay()); + + return true; + } + + void HeiganErupt(uint32 section) + { + for(uint32 i = 0; i < 4; ++i) + { + if(i == section) + continue; + + for(std::set<GameObject*>::iterator itr = HeiganEruption[i].begin(); itr != HeiganEruption[i].end(); ++itr) + { + (*itr)->SendCustomAnim(); + (*itr)->CastSpell(NULL, SPELL_ERUPTION); + } + } + } +}; + +InstanceData* GetInstanceData_instance_naxxramas(Map* map) +{ + return new instance_naxxramas(map); +} +void AddSC_instance_naxxramas() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_naxxramas"; + newscript->GetInstanceData = &GetInstanceData_instance_naxxramas; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/zone/netherstorm/netherstorm.cpp b/src/bindings/scripts/scripts/zone/netherstorm/netherstorm.cpp index 05a6c9b6bf8..c8c7651dbe1 100644 --- a/src/bindings/scripts/scripts/zone/netherstorm/netherstorm.cpp +++ b/src/bindings/scripts/scripts/zone/netherstorm/netherstorm.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -25,8 +25,6 @@ EndScriptData */ npc_manaforge_control_console go_manaforge_control_console npc_commander_dawnforge -npc_protectorate_nether_drake -npc_veronia npc_bessy EndContentData */ @@ -83,7 +81,7 @@ struct TRINITY_DLL_DECL npc_manaforge_control_consoleAI : public ScriptedAI Creature* add = NULL; } - void Aggro(Unit *who) { return; } + void EnterCombat(Unit *who) { return; } /*void SpellHit(Unit *caster, const SpellEntry *spell) { @@ -105,20 +103,20 @@ struct TRINITY_DLL_DECL npc_manaforge_control_consoleAI : public ScriptedAI switch( m_creature->GetEntry() ) { case ENTRY_BNAAR_C_CONSOLE: - ((Player*)p)->FailQuest(10299); - ((Player*)p)->FailQuest(10329); + CAST_PLR(p)->FailQuest(10299); + CAST_PLR(p)->FailQuest(10329); break; case ENTRY_CORUU_C_CONSOLE: - ((Player*)p)->FailQuest(10321); - ((Player*)p)->FailQuest(10330); + CAST_PLR(p)->FailQuest(10321); + CAST_PLR(p)->FailQuest(10330); break; case ENTRY_DURO_C_CONSOLE: - ((Player*)p)->FailQuest(10322); - ((Player*)p)->FailQuest(10338); + CAST_PLR(p)->FailQuest(10322); + CAST_PLR(p)->FailQuest(10338); break; case ENTRY_ARA_C_CONSOLE: - ((Player*)p)->FailQuest(10323); - ((Player*)p)->FailQuest(10365); + CAST_PLR(p)->FailQuest(10323); + CAST_PLR(p)->FailQuest(10365); break; } } @@ -257,7 +255,7 @@ struct TRINITY_DLL_DECL npc_manaforge_control_consoleAI : public ScriptedAI { Unit* u = Unit::GetUnit((*m_creature),someplayer); if( u && u->GetTypeId() == TYPEID_PLAYER ) - ((Player*)u)->KilledMonster(m_creature->GetEntry(),m_creature->GetGUID()); + CAST_PLR(u)->KilledMonster(m_creature->GetEntry(),m_creature->GetGUID()); DoCast(m_creature,SPELL_DISABLE_VISUAL); } if( goConsole ) @@ -326,8 +324,8 @@ bool GOHello_go_manaforge_control_console(Player *player, GameObject* _GO) if( manaforge ) { - ((npc_manaforge_control_consoleAI*)manaforge->AI())->someplayer = player->GetGUID(); - ((npc_manaforge_control_consoleAI*)manaforge->AI())->goConsole = _GO->GetGUID(); + CAST_AI(npc_manaforge_control_consoleAI, manaforge->AI())->someplayer = player->GetGUID(); + CAST_AI(npc_manaforge_control_consoleAI, manaforge->AI())->goConsole = _GO->GetGUID(); _GO->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE); } return true; @@ -354,11 +352,11 @@ bool GOHello_go_manaforge_control_console(Player *player, GameObject* _GO) #define SPELL_SUNFURY_DISGUISE 34603 // Entries of Arcanist Ardonis, Commander Dawnforge, Pathaleon the Curators Image -int CreatureEntry[3][1] = +const uint32 CreatureEntry[3] = { - {19830}, // Ardonis - {19831}, // Dawnforge - {21504} // Pathaleon + 19830, // Ardonis + 19831, // Dawnforge + 21504 // Pathaleon }; struct TRINITY_DLL_DECL npc_commander_dawnforgeAI : public ScriptedAI @@ -391,7 +389,7 @@ struct TRINITY_DLL_DECL npc_commander_dawnforgeAI : public ScriptedAI isEvent = false; } - void Aggro(Unit *who) { } + void EnterCombat(Unit *who) { } //Select any creature in a grid Creature* SelectCreatureInGrid(uint32 entry, float range) @@ -404,7 +402,7 @@ struct TRINITY_DLL_DECL npc_commander_dawnforgeAI : public ScriptedAI cell.SetNoCreate(); Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck creature_check(*m_creature, entry, true, range); - Trinity::CreatureLastSearcher<Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck> searcher(pCreature, creature_check); + Trinity::CreatureLastSearcher<Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck> searcher(m_creature, pCreature, creature_check); TypeContainerVisitor<Trinity::CreatureLastSearcher<Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck>, GridTypeMapContainer> creature_searcher(searcher); @@ -441,8 +439,8 @@ struct TRINITY_DLL_DECL npc_commander_dawnforgeAI : public ScriptedAI ardonis->SendUpdateToPlayer(player); //Set them to kneel - m_creature->SetStandState(PLAYER_STATE_KNEEL); - ardonis->SetStandState(PLAYER_STATE_KNEEL); + m_creature->SetStandState(UNIT_STAND_STATE_KNEEL); + ardonis->SetStandState(UNIT_STAND_STATE_KNEEL); } //Set them back to each other @@ -466,8 +464,8 @@ struct TRINITY_DLL_DECL npc_commander_dawnforgeAI : public ScriptedAI ardonis->SendUpdateToPlayer(player); //Set state - m_creature->SetStandState(PLAYER_STATE_NONE); - ardonis->SetStandState(PLAYER_STATE_NONE); + m_creature->SetStandState(UNIT_STAND_STATE_STAND); + ardonis->SetStandState(UNIT_STAND_STATE_STAND); } } @@ -475,7 +473,7 @@ struct TRINITY_DLL_DECL npc_commander_dawnforgeAI : public ScriptedAI { if (!isEvent) { - Creature *ardonis = SelectCreatureInGrid(CreatureEntry[0][0], 10.0f); + Creature *ardonis = SelectCreatureInGrid(CreatureEntry[0], 10.0f); if (!ardonis) return false; @@ -544,7 +542,7 @@ struct TRINITY_DLL_DECL npc_commander_dawnforgeAI : public ScriptedAI //Phase 4 Pathaleon spawns up to phase 9 case 4: //spawn pathaleon's image - m_creature->SummonCreature(CreatureEntry[2][0], 2325.851563, 2799.534668, 133.084229, 6.038996, TEMPSUMMON_TIMED_DESPAWN, 90000); + m_creature->SummonCreature(CreatureEntry[2], 2325.851563, 2799.534668, 133.084229, 6.038996, TEMPSUMMON_TIMED_DESPAWN, 90000); ++Phase; Phase_Timer = 500; break; @@ -639,7 +637,7 @@ Creature* SearchDawnforge(Player *source, uint32 entry, float range) cell.SetNoCreate(); Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck creature_check(*source, entry, true, range); - Trinity::CreatureLastSearcher<Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck> searcher(pCreature, creature_check); + Trinity::CreatureLastSearcher<Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck> searcher(source, pCreature, creature_check); TypeContainerVisitor<Trinity::CreatureLastSearcher<Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck>, GridTypeMapContainer> creature_searcher(searcher); @@ -652,56 +650,23 @@ Creature* SearchDawnforge(Player *source, uint32 entry, float range) bool AreaTrigger_at_commander_dawnforge(Player *player, AreaTriggerEntry *at) { //if player lost aura or not have at all, we should not try start event. - if (!player->HasAura(SPELL_SUNFURY_DISGUISE,0)) + if (!player->HasAura(SPELL_SUNFURY_DISGUISE)) return false; if (player->isAlive() && player->GetQuestStatus(QUEST_INFO_GATHERING) == QUEST_STATUS_INCOMPLETE) { - Creature* Dawnforge = SearchDawnforge(player, CreatureEntry[1][0], 30.0f); + Creature* Dawnforge = SearchDawnforge(player, CreatureEntry[1], 30.0f); if (!Dawnforge) return false; - if (((npc_commander_dawnforgeAI*)Dawnforge->AI())->CanStartEvent(player)) + if(CAST_AI(npc_commander_dawnforgeAI, Dawnforge->AI())->CanStartEvent(player)) return true; } return false; } /*###### -## npc_protectorate_nether_drake -######*/ - -#define GOSSIP_ITEM "I'm ready to fly! Take me up, dragon!" - -bool GossipHello_npc_protectorate_nether_drake(Player *player, Creature *_Creature) -{ - //On Nethery Wings - if (player->GetQuestStatus(10438) == QUEST_STATUS_INCOMPLETE && player->HasItemCount(29778,1) ) - player->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - - player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID()); - - return true; -} - -bool GossipSelect_npc_protectorate_nether_drake(Player *player, Creature *_Creature, uint32 sender, uint32 action ) -{ - if (action == GOSSIP_ACTION_INFO_DEF+1) - { - player->CLOSE_GOSSIP_MENU(); - - std::vector<uint32> nodes; - - nodes.resize(2); - nodes[0] = 152; //from drake - nodes[1] = 153; //end at drake - player->ActivateTaxiPathTo(nodes); //TaxiPath 627 (possibly 627+628(152->153->154->155) ) - } - return true; -} - -/*###### ## npc_professor_dabiri ######*/ @@ -745,36 +710,6 @@ bool QuestAccept_npc_professor_dabiri(Player *player, Creature *creature, Quest } /*###### -## npc_veronia -######*/ - -#define GOSSIP_HV "Fly me to Manaforge Coruu please" - -bool GossipHello_npc_veronia(Player *player, Creature *_Creature) -{ - if (_Creature->isQuestGiver()) - player->PrepareQuestMenu( _Creature->GetGUID() ); - - //Behind Enemy Lines - if (player->GetQuestStatus(10652) && !player->GetQuestRewardStatus(10652)) - player->ADD_GOSSIP_ITEM(0, GOSSIP_HV, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - - player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID()); - - return true; -} - -bool GossipSelect_npc_veronia(Player *player, Creature *_Creature, uint32 sender, uint32 action ) -{ - if (action == GOSSIP_ACTION_INFO_DEF) - { - player->CLOSE_GOSSIP_MENU(); - player->CastSpell(player,34905,true); //TaxiPath 606 - } - return true; -} - -/*###### ## mob_phase_hunter ######*/ @@ -814,7 +749,7 @@ struct TRINITY_DLL_DECL mob_phase_hunterAI : public ScriptedAI ManaBurnTimer = 5000 + (rand()%3 * 1000); // 5-8 sec cd } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { if(Player *player = who->GetCharmerOrOwnerPlayerOrPlayerItself()) PlayerGUID = player->GetGUID(); @@ -853,12 +788,12 @@ struct TRINITY_DLL_DECL mob_phase_hunterAI : public ScriptedAI Unit* target = Unit::GetUnit((*m_creature), PlayerGUID); if(target && !Weak && m_creature->GetHealth() < (m_creature->GetMaxHealth() / 100 * WeakPercent) - && ((Player*)target)->GetQuestStatus(10190) == QUEST_STATUS_INCOMPLETE) + && CAST_PLR(target)->GetQuestStatus(10190) == QUEST_STATUS_INCOMPLETE) { DoScriptText(EMOTE_WEAK, m_creature); Weak = true; } - if(Weak && !Drained && m_creature->HasAura(34219, 0)) + if(Weak && !Drained && m_creature->HasAura(34219)) { Drained = true; @@ -916,7 +851,7 @@ struct TRINITY_DLL_DECL npc_bessyAI : public npc_escortAI if (PlayerGUID) { if (Player* player = Unit::GetPlayer(PlayerGUID)) - ((Player*)player)->FailQuest(Q_ALMABTRIEB); + CAST_PLR(player)->FailQuest(Q_ALMABTRIEB); } } @@ -943,14 +878,14 @@ struct TRINITY_DLL_DECL npc_bessyAI : public npc_escortAI case 12: if (player) { - ((Player*)player)->GroupEventHappens(Q_ALMABTRIEB, m_creature); + CAST_PLR(player)->GroupEventHappens(Q_ALMABTRIEB, m_creature); Completed = true; } - {Unit* Thadell = FindCreature(N_THADELL, 30, m_creature); + {Unit* Thadell = me->FindNearestCreature(N_THADELL, 30); if(Thadell) DoScriptText(SAY_THADELL_1, m_creature);}break; case 13: - {Unit* Thadell = FindCreature(N_THADELL, 30, m_creature); + {Unit* Thadell = me->FindNearestCreature(N_THADELL, 30); if(Thadell) DoScriptText(SAY_THADELL_2, m_creature, player);}break; } @@ -961,7 +896,7 @@ struct TRINITY_DLL_DECL npc_bessyAI : public npc_escortAI summoned->AI()->AttackStart(m_creature); } - void Aggro(Unit* who){} + void EnterCombat(Unit* who){} void Reset() { @@ -982,7 +917,7 @@ bool QuestAccept_npc_bessy(Player* player, Creature* creature, Quest const* ques { creature->setFaction(113); creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - ((npc_escortAI*)(creature->AI()))->Start(true, true, false, player->GetGUID()); + CAST_AI(npc_escortAI, (creature->AI()))->Start(true, true, false, player->GetGUID()); } return true; } @@ -1006,7 +941,7 @@ CreatureAI* GetAI_npc_bessy(Creature *_Creature) bessyAI->AddWaypoint(12, 2297.68, 2266.79, 95.07,4000); bessyAI->AddWaypoint(13, 2297.67, 2266.76, 95.07,4000); - return (CreatureAI*)bessyAI; + return bessyAI; } /*###### @@ -1038,12 +973,6 @@ void AddSC_netherstorm() newscript->RegisterSelf(); newscript = new Script; - newscript->Name="npc_protectorate_nether_drake"; - newscript->pGossipHello = &GossipHello_npc_protectorate_nether_drake; - newscript->pGossipSelect = &GossipSelect_npc_protectorate_nether_drake; - newscript->RegisterSelf(); - - newscript = new Script; newscript->Name = "npc_professor_dabiri"; newscript->pGossipHello = &GossipHello_npc_professor_dabiri; newscript->pGossipSelect = &GossipSelect_npc_professor_dabiri; @@ -1051,12 +980,6 @@ void AddSC_netherstorm() newscript->RegisterSelf(); newscript = new Script; - newscript->Name="npc_veronia"; - newscript->pGossipHello = &GossipHello_npc_veronia; - newscript->pGossipSelect = &GossipSelect_npc_veronia; - newscript->RegisterSelf(); - - newscript = new Script; newscript->Name = "mob_phase_hunter"; newscript->GetAI = &GetAI_mob_phase_hunter; newscript->RegisterSelf(); diff --git a/src/bindings/scripts/scripts/zone/nexus/eye_of_eternity/boss_malygos.cpp b/src/bindings/scripts/scripts/zone/nexus/eye_of_eternity/boss_malygos.cpp new file mode 100644 index 00000000000..c79ac6be53f --- /dev/null +++ b/src/bindings/scripts/scripts/zone/nexus/eye_of_eternity/boss_malygos.cpp @@ -0,0 +1,170 @@ +/* Script Data Start +SDName: Boss malygos +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = '' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_ARCANE_BREATH_N 56272 +#define SPELL_ARCANE_BREATH_H 60072 +#define SPELL_ARCANE_PULSE 57432 +#define SPELL_ARCANE_STORM_1 57459 +#define SPELL_ARCANE_STORM_2 61693 +#define SPELL_ARCANE_STORM_3 61694 +#define SPELL_STATIC_FIELD 57430 +#define SPELL_SURGE_OF_POWER_1 56505 +#define SPELL_SURGE_OF_POWER_2 57407 +#define SPELL_SURGE_OF_POWER_3 60936 +#define SPELL_VORTEX 56105 + +//Dragon "mounts" spells in Phase3 +//they use Rugelike energy +#define SPELL_DMOUNT_FLAME_SPIKE 56091 //maybe not accurate +#define SPELL_DMOUNT_ENGULF_IN_FLAMES 61621 +#define SPELL_DMOUNT_REVIVIFY 57090 +#define SPELL_DMOUNT_LIFE_BURST 57143 +#define SPELL_DMOUNT_FLAME_SHIELD 57108 +//#define SPELL_DMOUNT_UNKNOWN XYZ //Increases your drake's flight speed by 500%. + + +//Yell +//-->Other +#define SAY_ANTI_MAGIC_SHELL -1616000 +#define SAY_BREATH_ATTACK -1616001 +#define SAY_HIGH_DAMAGE_MODE -1616002 +#define SAY_MAGIC_BLAST -1616003 +//--> Generic Spells +#define SAY_GENERIC_SPELL_1 -1616004 +#define SAY_GENERIC_SPELL_2 -1616005 +#define SAY_GENERIC_SPELL_3 -1616006 +#define SAY_DEATH -1616007 +//--> Prefight +#define SAY_PREFIGHT_1 -1616008 +#define SAY_PREFIGHT_2 -1616009 +#define SAY_PREFIGHT_3 -1616010 +#define SAY_PREFIGHT_4 -1616011 +#define SAY_PREFIGHT_5 -1616012 +//--> Phase1 +#define SAY_PHASE1_AGGRO -1616013 +#define SAY_PHASE1_END -1616014 +#define SAY_PHASE1_SLAY_1 -1616015 +#define SAY_PHASE1_SLAY_2 -1616016 +#define SAY_PHASE1_SLAY_3 -1616017 + +//--> Phase2 at 50% HP, + +/*Malygos himself is not targetable during this phase, it will end when the adds he spawns are all killed. However, he does continue to play a part in the encounter. +During this phase he drops anti-magic zones onto the ground the raid MUST stand inside of, it reduces magical damage taken by 50%. They shrink over time, so it's important that your raid moves to each new one he drops. +Throughout the phase, he will deep breath doing ~4k damage per second, unless you are standing inside of the anti-magic zone. +The way the fight works during this phase is there are NPCs riding around on disks in the room. There are two types of mobs, Lords and Scions. +The Lords will move down onto the group, and need to be tanked (They will one-shot a non-tank). After they die, they drop a disk that a raid member can mount onto, which allows them to fly, to attack the Scions that do not come down to the ground. +It is recommended to let melee take the first disks, then ranged. As those mobs die, they also drop disks, which allows the rest of your dps to get onto them. +The Scions will continually cast Arcane Blast on random targets on the floor, which is mitigated by the anti-magic zones. While mounted on a disk, you will not take damage. +After all of the NPCs riding on the disks die, the players on the disks need to dismount as Phase 3 is about to begin.*/ + +#define SAY_PHASE2_AGGRO -1616018 +#define SAY_PHASE2_END -1616019 +#define SAY_PHASE2_SLAY_1 -1616020 +#define SAY_PHASE2_SLAY_2 -1616021 +#define SAY_PHASE2_SLAY_3 -1616022 +//--> Phase3 Malygos destroys the floor, encounter continues on dragon "mounts" +#define SAY_PHASE3_INTRO -1616023 +#define SAY_PHASE3_AGGRO -1616024 +#define SAY_PHASE3_SLAY_1 -1616025 +#define SAY_PHASE3_SLAY_2 -1616026 +#define SAY_PHASE3_SLAY_3 -1616027 +#define SAY_PHASE3_BIG_ATTACK -1616028 + +struct TRINITY_DLL_DECL boss_malygosAI : public ScriptedAI +{ + boss_malygosAI(Creature *c) : ScriptedAI(c) {} + + uint32 phase, + enrage; + + void Reset() + { + //Source Deadly Boss Mod + enrage = 615000; //10 min + } + void EnterCombat(Unit* who) + { + if(phase == 1) + DoScriptText(SAY_PHASE1_AGGRO, m_creature); + if(phase == 2) + DoScriptText(SAY_PHASE1_AGGRO, m_creature); + if(phase == 3) + DoScriptText(SAY_PHASE1_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + phase =1; + //Return since we have no target + if(!UpdateVictim()) + return; + + if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) <= 50){ + phase = 2; + //spawn adds + //set malygos unatackable untill all adds spawned dead + //start phase3 + } + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + + if(phase ==1) + switch(rand()%3) + { + case 0: DoScriptText(SAY_PHASE1_SLAY_1, m_creature); break; + case 1: DoScriptText(SAY_PHASE1_SLAY_2, m_creature);break; + case 2: DoScriptText(SAY_PHASE1_SLAY_3, m_creature);break; + } + if(phase ==2) + switch(rand()%3) + { + case 0: DoScriptText(SAY_PHASE2_SLAY_1, m_creature);break; + case 1: DoScriptText(SAY_PHASE2_SLAY_2, m_creature);break; + case 2: DoScriptText(SAY_PHASE2_SLAY_3, m_creature);break; + } + if(phase ==3) + switch(rand()%3) + { + case 0: DoScriptText(SAY_PHASE3_SLAY_1, m_creature);break; + case 1: DoScriptText(SAY_PHASE3_SLAY_2, m_creature);break; + case 2: DoScriptText(SAY_PHASE3_SLAY_3, m_creature);break; + } + } +}; + +CreatureAI* GetAI_boss_malygos(Creature *_Creature) +{ + return new boss_malygosAI (_Creature); +} + +void AddSC_boss_malygos() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_malygos"; + newscript->GetAI = &GetAI_boss_malygos; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/zone/nexus/eye_of_eternity/def_eye_of_eternity.h b/src/bindings/scripts/scripts/zone/nexus/eye_of_eternity/def_eye_of_eternity.h new file mode 100644 index 00000000000..caa82a92e95 --- /dev/null +++ b/src/bindings/scripts/scripts/zone/nexus/eye_of_eternity/def_eye_of_eternity.h @@ -0,0 +1,4 @@ +#ifndef DEF_EYE_OF_ETERNITY_H +#define DEF_EYE_OF_ETERNITY_H + +#endif diff --git a/src/bindings/scripts/scripts/zone/nexus/eye_of_eternity/instance_eye_of_eternity.cpp b/src/bindings/scripts/scripts/zone/nexus/eye_of_eternity/instance_eye_of_eternity.cpp new file mode 100644 index 00000000000..600da8a55ba --- /dev/null +++ b/src/bindings/scripts/scripts/zone/nexus/eye_of_eternity/instance_eye_of_eternity.cpp @@ -0,0 +1,21 @@ +#include "precompiled.h" +#include "def_eye_of_eternity.h" + +struct TRINITY_DLL_DECL instance_eye_of_eternity : public ScriptedInstance +{ + instance_eye_of_eternity(Map *Map) : ScriptedInstance(Map) {Initialize();}; +}; + +InstanceData* GetInstanceData_instance_eye_of_eternity(Map* map) +{ + return new instance_eye_of_eternity(map); +} + +void AddSC_instance_eye_of_eternity() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_eye_of_eternity"; + newscript->GetInstanceData = &GetInstanceData_instance_eye_of_eternity; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/zone/nexus/nexus/boss_anomalus.cpp b/src/bindings/scripts/scripts/zone/nexus/nexus/boss_anomalus.cpp new file mode 100644 index 00000000000..92f276e07d8 --- /dev/null +++ b/src/bindings/scripts/scripts/zone/nexus/nexus/boss_anomalus.cpp @@ -0,0 +1,149 @@ +/* Script Data Start +SDName: Boss anomalus +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = '' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_SPARK_1 47751 +#define SPELL_SPARK_2 57062 +#define SPELL_RIFT_SHIELD 47748 +#define SPELL_CHARGE_RIFT 47747 +#define SPELL_ARCANE_ATTRACTION 57063 +#define SPELL_CREATE_RIFT 47743 //Dummy ---> summons (npc 26918) "Chaotic Rift", which spawns "Crazed Mana Wraith"s (npc 26746) + +#define MOB_CRAZED_MANA_WRAITH 26746 +#define NPC_CHAOTIC_RIFT 26918 + +//Yell +#define SAY_AGGRO -1576000 +#define SAY_KILL -1576001 +#define SAY_DEATH -1576002 +#define SAY_RIFT -1576003 +#define SAY_SHIELD -1576004 + +struct TRINITY_DLL_DECL boss_anomalusAI : public ScriptedAI +{ + boss_anomalusAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if(!UpdateVictim()) + return; + + //Source DBM + if((((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 80) && ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) > 77)) + || (((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 55) && ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) > 52)) + || (((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 30) && ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) > 27))) + { + //Summon rift at a random location + } + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + void KilledUnit(Unit *victim) + { + if(victim == m_creature) + return; + DoScriptText(SAY_KILL, m_creature); + } +}; + +/*###### +## Crazed Mana Wraiths +######*/ +#define SPELL_ARCANE_MISSILES 33833 + +struct TRINITY_DLL_DECL mob_crazed_mana_wraithAI : public ScriptedAI +{ + mob_crazed_mana_wraithAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if(!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) {} +}; + +/*###### +## Chaotic Rift +######*/ +#define SPELL_CHAOTIC_ENERGY_BURST 47688 +#define SPELL_CHARGED_CHAOTIC_ENERGY_BURST 47737 + +struct TRINITY_DLL_DECL npc_chaotic_riftAI : public ScriptedAI +{ + npc_chaotic_riftAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if(!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) {} +}; + +CreatureAI* GetAI_npc_chaotic_rift(Creature *_Creature) +{ + return new npc_chaotic_riftAI (_Creature); +} + +CreatureAI* GetAI_boss_anomalus(Creature *_Creature) +{ + return new boss_anomalusAI (_Creature); +} + +CreatureAI* GetAI_mob_crazed_mana_wraith(Creature *_Creature) +{ + return new boss_anomalusAI (_Creature); +} + +void AddSC_boss_anomalus() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_anomalus"; + newscript->GetAI = &GetAI_boss_anomalus; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_crazed_mana_wraith"; + newscript->GetAI = &GetAI_mob_crazed_mana_wraith; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_chaotic_rift"; + newscript->GetAI = &GetAI_npc_chaotic_rift; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/zone/nexus/nexus/boss_keristrasza.cpp b/src/bindings/scripts/scripts/zone/nexus/nexus/boss_keristrasza.cpp new file mode 100644 index 00000000000..c2b6d3d4a8b --- /dev/null +++ b/src/bindings/scripts/scripts/zone/nexus/nexus/boss_keristrasza.cpp @@ -0,0 +1,89 @@ +/* Script Data Start +SDName: Boss keristrasza +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = 'boss_maiden_of_grief' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_TAIL_SWEEP 50155 +#define SPELL_CRYSTAL_CHAINS 50997 +#define SPELL_ENRAGE 8599 +#define SPELL_CRYSTALFIRE_BREATH_1 48096 +#define SPELL_CRYSTALFIRE_BREATH_2 57091 +#define SPELL_CRYSTALIZE 48179 +#define SPELL_INTENSE_COLD 48095 //stackable debuff + +//Yell +#define SAY_AGGRO -1576005 +#define SAY_SLAY -1576006 +#define SAY_ENRAGE -1576007 +#define SAY_DEATH -1576008 +#define SAY_CRYSTAL_NOVA -1576009 + +struct TRINITY_DLL_DECL boss_keristraszaAI : public ScriptedAI +{ + boss_keristraszaAI(Creature *c) : ScriptedAI(c) {} + + bool enraged; + + void Reset() + { + enraged = false; + } + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if(!UpdateVictim()) + return; + + if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) == 10) + { + if(!enraged) + { + DoScriptText(SAY_ENRAGE, m_creature); + DoCast(m_creature, SPELL_ENRAGE); + enraged = true; + } + } + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + void KilledUnit(Unit *victim) + { + if(victim == m_creature) + return; + DoScriptText(SAY_SLAY, m_creature); + } +}; + +CreatureAI* GetAI_boss_keristrasza(Creature *_Creature) +{ + return new boss_keristraszaAI (_Creature); +} + +void AddSC_boss_keristrasza() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_keristrasza"; + newscript->GetAI = &GetAI_boss_keristrasza; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/zone/nexus/nexus/boss_magus_telestra.cpp b/src/bindings/scripts/scripts/zone/nexus/nexus/boss_magus_telestra.cpp new file mode 100644 index 00000000000..f3d9e72267f --- /dev/null +++ b/src/bindings/scripts/scripts/zone/nexus/nexus/boss_magus_telestra.cpp @@ -0,0 +1,118 @@ +/* Script Data Start +SDName: Boss magus_telestra +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = '' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" +#include "def_nexus.h" + + +//Spells + +//phase 1 +#define SPELL_ICE_NOVA 47772 +#define SPELL_ICE_NOVA 56935 +#define SPELL_FIREBOMB 47773 +#define SPELL_FIREBOMB 56934 +#define SPELL_GAVITY_WELL 47756 + +//Phase 2 -->50% HP (3 clones, Frost, Fire, Arcane) +//Frost Magus (npc 26930) +#define FROST_MAGUS_VISUAL 47706 //Dummy +#define SPELL_BLIZZARD_N 47727 +#define SPELL_ICE_BARB_N 47729 +//heroic +#define SPELL_BLIZZARD_H 56936 +#define SPELL_ICE_BARB_H 56937 + +//Fire Magus (npc 26928) +#define FIRE_MAGUS_VISUAL 47705 //Dummy +#define SPELL_FIRE_BLAST 47721 +#define SPELL_SCORCH 47723 +//heroic +#define SPELL_FIRE_BLAST_H 56939 +#define SPELL_SCORCH_H 56938 + +//Arcane Magus (npc 26929) +#define ARCANE_MAGUS_VISUAL 47704 //Dummy +#define SPELL_CRITTER 47731 +#define SPELL_TIME_STOP 47736 + +//Yell +#define SAY_AGGRO -1576010 +#define SAY_KILL -1576011 +#define SAY_DEATH -1576012 +#define SAY_MERGE -1576013 +#define SAY_SPLIT_1 -1576014 +#define SAY_SPLIT_2 -1576015 + + +struct TRINITY_DLL_DECL boss_magus_telestraAI : public ScriptedAI +{ + boss_magus_telestraAI(Creature *c) : ScriptedAI(c) {} + + bool splited; + uint64 Magus_frost, + Magus_fire, + Magus_arcane; + + void Reset() + { + splited = false; + } + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if(!UpdateVictim()) + return; + + if(!splited) + { + if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) <= 50) + { + DoScriptText(SAY_SPLIT_1, m_creature); + //HandleSplit + splited = true; + } + } + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + void KilledUnit(Unit *victim) + { + if(victim == m_creature) + return; + DoScriptText(SAY_KILL, m_creature); + } +}; + +CreatureAI* GetAI_boss_magus_telestra(Creature *_Creature) +{ + return new boss_magus_telestraAI (_Creature); +} + +void AddSC_boss_magus_telestra() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_magus_telestra"; + newscript->GetAI = &GetAI_boss_magus_telestra; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/zone/nexus/nexus/boss_ormorok.cpp b/src/bindings/scripts/scripts/zone/nexus/nexus/boss_ormorok.cpp new file mode 100644 index 00000000000..eacaf771071 --- /dev/null +++ b/src/bindings/scripts/scripts/zone/nexus/nexus/boss_ormorok.cpp @@ -0,0 +1,90 @@ +/* Script Data Start +SDName: Boss ormorok +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = '' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_CRYSTAL_SPIKES_1 47958 +#define SPELL_CRYSTAL_SPIKES_2 57082 +#define SPELL_CRYSTAL_SPIKES_3 57083 +#define SPELL_SPELL_REFLECTION 47981 +#define SPELL_TRAMPLE_N 48016 +#define SPELL_TRAMPLE_H 57066 +#define SPELL_FRENZY_N 48017 +#define SPELL_FRENZY_H 57086 +#define SPELL_SUMMON_CRYSTALLINE_TANGLER 61564 //summons npc 32665 + +//Yell +#define SAY_AGGRO -1576016 +#define SAY_KILL -1576017 +#define SAY_DEATH -1576018 +#define SAY_REFLECT -1576019 +#define SAY_ICE_SPIKES -1576020 + +struct TRINITY_DLL_DECL boss_ormorokAI : public ScriptedAI +{ + boss_ormorokAI(Creature *c) : ScriptedAI(c) {} + + bool frenzy; + + void Reset() + { + frenzy = false; + } + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if(!UpdateVictim()) + return; + + if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) == 25) + { + if(!frenzy) + { + DoCast(m_creature, SPELL_FRENZY_N); + frenzy = true; + } + } + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + void KilledUnit(Unit *victim) + { + if(victim == m_creature) + return; + DoScriptText(SAY_KILL, m_creature); + } +}; + +CreatureAI* GetAI_boss_ormorok(Creature *_Creature) +{ + return new boss_ormorokAI (_Creature); +} + +void AddSC_boss_ormorok() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_ormorok"; + newscript->GetAI = &GetAI_boss_ormorok; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/zone/nexus/nexus/commander_kolurg.cpp b/src/bindings/scripts/scripts/zone/nexus/nexus/commander_kolurg.cpp new file mode 100644 index 00000000000..1ad4253355d --- /dev/null +++ b/src/bindings/scripts/scripts/zone/nexus/nexus/commander_kolurg.cpp @@ -0,0 +1,57 @@ +/* Script Data Start +SDName: Boss Commander Kolurg +SDAuthor: LordVanMartin +SD%Complete: +SDComment: Only Alliance Heroic +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = 'boss_commander_kolurg' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +#define SPELL_BATTLE_SHOUT 31403 +#define SPELL_CHARGE 60067 +#define SPELL_FRIGHTENING_SHOUT 19134 +#define SPELL_WHIRLWIND_1 38619 +#define SPELL_WHIRLWIND_2 38618 + +//Yell +#define SAY_AGGRO 1576024 +#define SAY_KILL 1576025 +#define SAY_DEATH 1576026 + +struct TRINITY_DLL_DECL boss_commander_kolurgAI : public ScriptedAI +{ + boss_commander_kolurgAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) {} + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if(!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) {} +}; + +CreatureAI* GetAI_boss_commander_kolurg(Creature *_Creature) +{ + return new boss_commander_kolurgAI (_Creature); +} + +void AddSC_boss_commander_kolurg() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_commander_kolurg"; + newscript->GetAI = &GetAI_boss_commander_kolurg; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/zone/nexus/nexus/commander_stoutbeard.cpp b/src/bindings/scripts/scripts/zone/nexus/nexus/commander_stoutbeard.cpp new file mode 100644 index 00000000000..49a35f4975f --- /dev/null +++ b/src/bindings/scripts/scripts/zone/nexus/nexus/commander_stoutbeard.cpp @@ -0,0 +1,63 @@ +/* Script Data Start +SDName: Boss Commander Stoutbeard +SDAuthor: LordVanMartin +SD%Complete: +SDComment: Only Horde Heroic +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = 'boss_commander_stoutbeard' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +#define SPELL_BATTLE_SHOUT 31403 +#define SPELL_CHARGE 60067 +#define SPELL_FRIGHTENING_SHOUT 19134 +#define SPELL_WHIRLWIND_1 38619 +#define SPELL_WHIRLWIND_2 38618 + +//Yell +#define SAY_AGGRO 1576021 +#define SAY_KILL 1576022 +#define SAY_DEATH 1576023 + +struct TRINITY_DLL_DECL boss_commander_stoutbeardAI : public ScriptedAI +{ + boss_commander_stoutbeardAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if(!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } +}; + +CreatureAI* GetAI_boss_commander_stoutbeard(Creature *_Creature) +{ + return new boss_commander_stoutbeardAI (_Creature); +} + +void AddSC_boss_commander_stoutbeard() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_commander_stoutbeard"; + newscript->GetAI = &GetAI_boss_commander_stoutbeard; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/zone/nexus/nexus/def_nexus.h b/src/bindings/scripts/scripts/zone/nexus/nexus/def_nexus.h new file mode 100644 index 00000000000..d868c72adf6 --- /dev/null +++ b/src/bindings/scripts/scripts/zone/nexus/nexus/def_nexus.h @@ -0,0 +1,35 @@ +#ifndef DEF_NEXUS_H +#define DEF_NEXUS_H + +#define DATA_ANOMALUSDEAD 1 +#define DATA_ANOMALUS_DEATH 2 +#define DATA_ORMOROKDDEAD 3 +#define DATA_ORMOROK_DEATH 4 + +#define DATA_MAGUSTELESTRADEAD 5 +#define DATA_MAGUSTELESTRA_DEATH 6 +#define DATA_MAGUSTELESTRA_A_DEAD 7 +#define DATA_MAGUSTELESTRA_A_DEATH 8 +#define DATA_MAGUSTELESTRA_F_DEAD 9 +#define DATA_MAGUSTELESTRA_F_DEATH 10 +#define DATA_MAGUSTELESTRA_FI_DEAD 11 +#define DATA_MAGUSTELESTRA_FI_DEATH 12 + +#define DATA_KERISTRASZADEAD 13 +#define DATA_KERISTRASZA_DEATH 14 +#define DATA_COMMANDER_KOLURGDEAD 15 +#define DATA_COMMANDER_KOLURG_DEATH 16 +#define DATA_COMMANDER_STOUTBEARDDEAD 17 +#define DATA_COMMANDER_STOUTBEARD_DEATH 18 +#define DATA_ANOMALUS 19 +#define DATA_ORMOROK 20 + +#define DATA_MAGUSTELESTRA 21 +#define DATA_MAGUSTELESTRA_A 22 +#define DATA_MAGUSTELESTRA_F 23 +#define DATA_MAGUSTELESTRA_FI 24 + +#define DATA_KERISTRASZA 25 +#define DATA_COMMANDER_KOLURG 26 +#define DATA_COMMANDER_STOUTBEARD 27 +#endif diff --git a/src/bindings/scripts/scripts/zone/nexus/nexus/instance_nexus.cpp b/src/bindings/scripts/scripts/zone/nexus/nexus/instance_nexus.cpp new file mode 100644 index 00000000000..01d0ade1e25 --- /dev/null +++ b/src/bindings/scripts/scripts/zone/nexus/nexus/instance_nexus.cpp @@ -0,0 +1,158 @@ +#include "precompiled.h" +#include "def_nexus.h" + +struct TRINITY_DLL_DECL instance_nexus : public ScriptedInstance +{ + instance_nexus(Map *Map) : ScriptedInstance(Map) {Initialize();}; + + uint64 Anomalus, + Ormorok, + Magus_telestra, + Magus_frost, + Magus_fire, + Magus_arcane, + keristrasza, + Commander_kolurg, + Commander_stoutbeard; + bool IsBossDied[9]; + + void Initialize() + { + Anomalus = 0; + Ormorok = 0; + Magus_telestra =0; + Magus_frost =0; + Magus_fire =0; + Magus_arcane =0; + keristrasza =0; + Commander_kolurg = 0; + Commander_stoutbeard = 0; + IsBossDied[0] = false; + IsBossDied[1] = false; + IsBossDied[2] = false; + IsBossDied[3] = false; + IsBossDied[4] = false; + IsBossDied[5] = false; + IsBossDied[6] = false; + IsBossDied[7] = false; + IsBossDied[8] = false; + } + + bool IsEncounterInProgress() const + { + //not active + return false; + } + void OnCreatureCreate(Creature *creature, uint32 creature_entry) + { + switch(creature->GetEntry()) + { + case 26763: Anomalus = creature->GetGUID(); break; + case 26794: Ormorok = creature->GetGUID(); break; + case 26731: Magus_telestra = creature->GetGUID(); break; + case 26930: Magus_frost = creature->GetGUID(); break; + case 26928: Magus_fire = creature->GetGUID(); break; + case 26926: Magus_arcane = creature->GetGUID(); break; + case 26723: keristrasza = creature->GetGUID(); break; + case 26798: Commander_kolurg = creature->GetGUID(); break; + case 26796: Commander_stoutbeard = creature->GetGUID(); break; + } + } + uint32 GetData(uint32 type) + { + switch(type) + { + case DATA_ANOMALUSDEAD: + if(IsBossDied[0]) + return 1; + break; + case DATA_ORMOROKDDEAD: + if(IsBossDied[1]) + return 1; + break; + case DATA_MAGUSTELESTRADEAD: + if(IsBossDied[2]) + return 1; + break; + case DATA_MAGUSTELESTRA_A_DEAD: + if(IsBossDied[3]) + return 1; + break; + case DATA_MAGUSTELESTRA_F_DEAD: + if(IsBossDied[4]) + return 1; + break; + case DATA_MAGUSTELESTRA_FI_DEAD: + if(IsBossDied[5]) + return 1; + break; + case DATA_KERISTRASZADEAD: + if(IsBossDied[6]) + return 1; + break; + case DATA_COMMANDER_KOLURGDEAD: + if(IsBossDied[7]) + return 1; + break; + case DATA_COMMANDER_STOUTBEARDDEAD: + if(IsBossDied[8]) + return 1; + break; + } + + return 0; + } + + uint64 GetData64 (uint32 identifier) + { + return 0; + } + + void SetData(uint32 type, uint32 data) + { + switch(type) + { + case DATA_ANOMALUS_DEATH: + IsBossDied[0] = true; + break; + case DATA_ORMOROK_DEATH: + IsBossDied[1] = true; + break; + case DATA_MAGUSTELESTRA_DEATH: + IsBossDied[2] = true; + break; + case DATA_MAGUSTELESTRA_A_DEATH: + IsBossDied[3] = true; + break; + case DATA_MAGUSTELESTRA_F_DEATH: + IsBossDied[4] = true; + break; + case DATA_MAGUSTELESTRA_FI_DEAD: + IsBossDied[5] = true; + break; + case DATA_KERISTRASZA_DEATH: + IsBossDied[6] = true; + break; + case DATA_COMMANDER_KOLURG_DEATH: + IsBossDied[7] = true; + break; + case DATA_COMMANDER_STOUTBEARD_DEATH: + IsBossDied[8] = true; + break; + } + } +}; + +InstanceData* GetInstanceData_instance_nexus(Map* map) +{ + return new instance_nexus(map); +} + +void AddSC_instance_nexus() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_nexus"; + newscript->GetInstanceData = &GetInstanceData_instance_nexus; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/zone/nexus/oculus/boss_drakos.cpp b/src/bindings/scripts/scripts/zone/nexus/oculus/boss_drakos.cpp new file mode 100644 index 00000000000..c0f7c589403 --- /dev/null +++ b/src/bindings/scripts/scripts/zone/nexus/oculus/boss_drakos.cpp @@ -0,0 +1,82 @@ +/* Script Data Start +SDName: Boss drakos +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = '' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_MAGIC_PULL 51336 +#define SPELL_THUNDERING_STOMP 50774 +#define SPELL_THUNDERING_STOMP_2 59370 + +//Yell +#define SAY_AGGRO -1578000 +#define SAY_KILL_1 -1578001 +#define SAY_KILL_2 -1578002 +#define SAY_KILL_3 -1578003 +#define SAY_DEATH -1578004 +#define SAY_PULL_1 -1578005 +#define SAY_PULL_2 -1578006 +#define SAY_PULL_3 -1578007 +#define SAY_PULL_4 -1578008 +#define SAY_STOMP_1 -1578009 +#define SAY_STOMP_2 -1578010 +#define SAY_STOMP_3 -1578011 + +struct TRINITY_DLL_DECL boss_drakosAI : public ScriptedAI +{ + boss_drakosAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if(!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + void KilledUnit(Unit *victim) + { + if(victim == m_creature) + return; + switch(rand()%3) + { + case 0: DoScriptText(SAY_KILL_1, m_creature);break; + case 1: DoScriptText(SAY_KILL_2, m_creature);break; + case 2: DoScriptText(SAY_KILL_3, m_creature);break; + } + } +}; + +CreatureAI* GetAI_boss_drakos(Creature *_Creature) +{ + return new boss_drakosAI (_Creature); +} + +void AddSC_boss_drakos() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_drakos"; + newscript->GetAI = &GetAI_boss_drakos; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/zone/nexus/oculus/boss_eregos.cpp b/src/bindings/scripts/scripts/zone/nexus/oculus/boss_eregos.cpp new file mode 100644 index 00000000000..998f526ca80 --- /dev/null +++ b/src/bindings/scripts/scripts/zone/nexus/oculus/boss_eregos.cpp @@ -0,0 +1,104 @@ +/* Script Data Start +SDName: Boss eregos +SDAuthor: LordVanMartin +SD%Complete: +SDComment: Encounter is done entirely on drake vehicles +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = '' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Types of drake mounts: Ruby(Tank), Amber(DPS), Emerald(Healer) +//Two Repeating phases + +//Spells +#define SPELL_ARCANE_BARRAGE 50804 +#define SPELL_ARCANE_VOLLEY 51153 +#define SPELL_ENRAGED_ASSAULT 51170 +#define SPELL_PLANAR_ANOMALIES 57959 +#define SPELL_PLANAR_SHIFT 51162 + +//Heroic +#define SPELL_ARCANE_BARRAGE_H 59381 +#define SPELL_ARCANE_VOLLEY_H 59382 + +/*Ruby Drake , +(npc 27756) (item 37860) +(summoned by spell Ruby Essence = 37860 ---> Call Amber Drake == 49462 ---> Summon 27756) +*/ +#define NPC_RUBY_DRAKE_VEHICLE 27756 +#define SPELL_RIDE_RUBY_DRAKE_QUE 49463 //Apply Aura: Periodic Trigger, Interval: 3 seconds ---> 49464 +#define SPELL_RUBY_DRAKE_SADDLE 49464 //Allows you to ride on the back of an Amber Drake. ---> Dummy + +#define SPELL_RUBY_SEARING_WRATH 50232 //(60 yds) - Instant - Breathes a stream of fire at an enemy dragon, dealing 6800 to 9200 Fire damage and then jumping to additional dragons within 30 yards. Each jump increases the damage by 50%. Affects up to 5 total targets +#define SPELL_RUBY_EVASIVE_AURA 50248 //Instant - Allows the Ruby Drake to generate Evasive Charges when hit by hostile attacks and spells. +#define SPELL_RUBY_EVASIVE_MANEUVERS 50240 //Instant - 5 sec. cooldown - Allows your drake to dodge all incoming attacks and spells. Requires Evasive Charges to use. Each attack or spell dodged while this ability is active burns one Evasive Charge. Lasts 30 sec. or until all charges are exhausted. +//you do not have acces to until you kill Mage-Lord Urom +#define SPELL_RUBY_MARTYR 50253 //Instant - 10 sec. cooldown - Redirect all harmful spells cast at friendly drakes to yourself for 10 sec. + +/*Amber Drake, +(npc 27755) (item 37859) +(summoned by spell Amber Essence = 37859 ---> Call Amber Drake == 49461 ---> Summon 27755) +*/ +#define NPC_AMBER_DRAKE_VEHICLE 27755 +#define SPELL_RIDE_AMBER_DRAKE_QUE 49459 //Apply Aura: Periodic Trigger, Interval: 3 seconds ---> 49460 +#define SPELL_AMBER_DRAKE_SADDLE 49460 //Allows you to ride on the back of an Amber Drake. ---> Dummy + +#define SPELL_AMBER_SHOCK_LANCE 49840 //(60 yds) - Instant - Deals 4822 to 5602 Arcane damage and detonates all Shock Charges on an enemy dragon. Damage is increased by 6525 for each detonated. +#define SPELL_AMBER_STOP_TIME //Instant - 1 min cooldown - Halts the passage of time, freezing all enemy dragons in place for 10 sec. This attack applies 5 Shock Charges to each affected target. +//you do not have access to until you kill the Mage-Lord Urom. +#define SPELL_AMBER_TEMPORAL_RIFT 49592 //(60 yds) - Channeled - Channels a temporal rift on an enemy dragon for 10 sec. While trapped in the rift, all damage done to the target is increased by 100%. In addition, for every 15,000 damage done to a target affected by Temporal Rift, 1 Shock Charge is generated. + +/*Emerald Drake, +(npc 27692) (item 37815), + (summoned by spell Emerald Essence = 37815 ---> Call Emerald Drake == 49345 ---> Summon 27692) +*/ +#define NPC_EMERALD_DRAKE_VEHICLE 27692 +#define SPELL_RIDE_EMERALD_DRAKE_QUE 49427 //Apply Aura: Periodic Trigger, Interval: 3 seconds ---> 49346 +#define SPELL_EMERALD_DRAKE_SADDLE 49346 //Allows you to ride on the back of an Amber Drake. ---> Dummy + +#define SPELL_EMERALD_LEECHING_POISON 50328 //(60 yds) - Instant - Poisons the enemy dragon, leeching 1300 to the caster every 2 sec. for 12 sec. Stacks up to 3 times. +#define SPELL_EMERALD_TOUCH_THE_NIGHTMARE 50341 //(60 yds) - Instant - Consumes 30% of the caster's max health to inflict 25,000 nature damage to an enemy dragon and reduce the damage it deals by 25% for 30 sec. +// you do not have access to until you kill the Mage-Lord Urom +#define SPELL_EMERALD_DREAM_FUNNEL 50344 //(60 yds) - Channeled - Transfers 5% of the caster's max health to a friendly drake every second for 10 seconds as long as the caster channels. + +struct TRINITY_DLL_DECL boss_eregosAI : public ScriptedAI +{ + boss_eregosAI(Creature *c) : ScriptedAI(c) {} + + uint32 phase; + + void Reset() {} + void EnterCombat(Unit* who) {} + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if(!UpdateVictim()) + return; + + phase =1; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) {} +}; + +CreatureAI* GetAI_boss_eregos(Creature *_Creature) +{ + return new boss_eregosAI (_Creature); +} + +void AddSC_boss_eregos() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_eregos"; + newscript->GetAI = &GetAI_boss_eregos; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/zone/nexus/oculus/boss_urom.cpp b/src/bindings/scripts/scripts/zone/nexus/oculus/boss_urom.cpp new file mode 100644 index 00000000000..8c09f0c6f4b --- /dev/null +++ b/src/bindings/scripts/scripts/zone/nexus/oculus/boss_urom.cpp @@ -0,0 +1,87 @@ +/* Script Data Start +SDName: Boss urom +SDAuthor: LordVanMartin +SD%Complete: 1% +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = '' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_ARCANE_SHIELD 53813 //Dummy --> Channeled, shields the caster from damage. +#define SPELL_EMPOWERED_ARCANE_EXPLOSION 51110 +#define SPELL_EMPOWERED_ARCANE_EXPLOSION_2 59377 +#define SPELL_FROSTBOMB 51103 //Urom throws a bomb, hitting its target with the highest aggro which inflict directly 650 frost damage and drops a frost zone on the ground. This zone deals 650 frost damage per second and reduce the movement speed by 35%. Lasts 1 minute. +#define SPELL_SUMMON_MENAGERIE 50476 //Summons an assortment of creatures and teleports the caster to safety. +#define SPELL_SUMMON_MENAGERIE_2 50495 +#define SPELL_SUMMON_MENAGERIE_3 50496 +#define SPELL_TELEPORT 51112 //Teleports to the center of Oculus +#define SPELL_TIME_BOMB 51121 //Deals arcane damage to a random player, and after 6 seconds, deals zone damage to nearby equal to the health missing of the target afflicted by the debuff. +#define SPELL_TIME_BOMB_2 59376 + +//Yell +#define SAY_AGGRO -1578012 +#define SAY_KILL_1 -1578013 +#define SAY_KILL_2 -1578014 +#define SAY_KILL_3 -1578015 +#define SAY_DEATH -1578016 +#define SAY_EXPLOSION_1 -1578017 +#define SAY_EXPLOSION_2 -1578018 +#define SAY_SUMMON_1 -1578019 +#define SAY_SUMMON_2 -1578020 +#define SAY_SUMMON_3 -1578021 + +struct TRINITY_DLL_DECL boss_uromAI : public ScriptedAI +{ + boss_uromAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if(!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + void KilledUnit(Unit *victim) + { + if(victim == m_creature) + return; + switch(rand()%3) + { + case 0: DoScriptText(SAY_KILL_1, m_creature);break; + case 1: DoScriptText(SAY_KILL_2, m_creature);break; + case 2: DoScriptText(SAY_KILL_3, m_creature);break; + } + } +}; + +CreatureAI* GetAI_boss_urom(Creature *_Creature) +{ + return new boss_uromAI (_Creature); +} + +void AddSC_boss_urom() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_urom"; + newscript->GetAI = &GetAI_boss_urom; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/zone/nexus/oculus/boss_varos.cpp b/src/bindings/scripts/scripts/zone/nexus/oculus/boss_varos.cpp new file mode 100644 index 00000000000..faaee9c7c42 --- /dev/null +++ b/src/bindings/scripts/scripts/zone/nexus/oculus/boss_varos.cpp @@ -0,0 +1,85 @@ +/* Script Data Start +SDName: Boss varos +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = '' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_ENERGIZE_CORES 50785 //Damage 5938 to 6562, effec2 Triggers 54069, effect3 Triggers 56251 +#define SPELL_ENERGIZE_CORES_TRIGGER_1 54069 +#define SPELL_ENERGIZE_CORES_TRIGGER_2 56251 +#define SPELL_ENERGIZE_CORES_2 59372 //Damage 9025 to 9975, effect2 Triggers 54069, effect 56251 +#define SPELL_CALL_AZURE_RING_CAPTAIN 51002 //Effect Send Event (12229) +#define SPELL_CALL_AZURE_RING_CAPTAIN_2 51006 //Effect Send Event (10665) +#define SPELL_CALL_AZURE_RING_CAPTAIN_3 51007 //Effect Send Event (18454) +#define SPELL_CALL_AZURE_RING_CAPTAIN_4 51008 //Effect Send Event (18455) +#define SPELL_CALL_AMPLIFY_MAGIC 51054 +#define SPELL_CALL_AMPLIFY_MAGIC_2 59371 + +//Yell +#define SAY_AGGRO -1578022 +#define SAY_KILL_1 -1578023 +#define SAY_KILL_2 -1578024 +#define SAY_DEATH -1578025 +#define SAY_STRIKE_1 -1578026 +#define SAY_STRIKE_2 -1578027 +#define SAY_STRIKE_3 -1578028 +#define SAY_SPAWN -1578029 + + +struct TRINITY_DLL_DECL boss_varosAI : public ScriptedAI +{ + boss_varosAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if(!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + void KilledUnit(Unit *victim) + { + if(victim == m_creature) + return; + switch(rand()%2) + { + case 0: DoScriptText(SAY_KILL_1, m_creature);break; + case 1: DoScriptText(SAY_KILL_2, m_creature);break; + } + } +}; + +CreatureAI* GetAI_boss_varos(Creature *_Creature) +{ + return new boss_varosAI (_Creature); +} + +void AddSC_boss_varos() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_varos"; + newscript->GetAI = &GetAI_boss_varos; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/zone/nexus/oculus/def_oculus.h b/src/bindings/scripts/scripts/zone/nexus/oculus/def_oculus.h new file mode 100644 index 00000000000..0b63a52d866 --- /dev/null +++ b/src/bindings/scripts/scripts/zone/nexus/oculus/def_oculus.h @@ -0,0 +1,4 @@ +#ifndef DEF_OCULUS_H +#define DEF_OCULUS_H + +#endif diff --git a/src/bindings/scripts/scripts/zone/nexus/oculus/instance_oculus.cpp b/src/bindings/scripts/scripts/zone/nexus/oculus/instance_oculus.cpp new file mode 100644 index 00000000000..dd223372da0 --- /dev/null +++ b/src/bindings/scripts/scripts/zone/nexus/oculus/instance_oculus.cpp @@ -0,0 +1,21 @@ +#include "precompiled.h" +#include "def_oculus.h" + +struct TRINITY_DLL_DECL instance_oculus : public ScriptedInstance +{ + instance_oculus(Map *Map) : ScriptedInstance(Map) {Initialize();}; +}; + +InstanceData* GetInstanceData_instance_oculus(Map* map) +{ + return new instance_oculus(map); +} + +void AddSC_instance_oculus() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_oculus"; + newscript->GetInstanceData = &GetInstanceData_instance_oculus; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/zone/obsidian_sanctum/boss_sartharion.cpp b/src/bindings/scripts/scripts/zone/obsidian_sanctum/boss_sartharion.cpp new file mode 100644 index 00000000000..c7034655b11 --- /dev/null +++ b/src/bindings/scripts/scripts/zone/obsidian_sanctum/boss_sartharion.cpp @@ -0,0 +1,300 @@ +/* Script Data Start +SDName: Boss sartharion +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = '' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Sartharion Spells +#define SPELL_BERSERK 61632 // Increases the caster's attack speed by 150% and all damage it deals by 500% for 5 min. +#define SPELL_CLEAVE 56909 // Inflicts 35% weapon damage to an enemy and its nearest allies, affecting up to 10 targets. +#define SPELL_FLAME_BREATH_N 56908 // Inflicts 8750 to 11250 Fire damage to enemies in a cone in front of the caster. +#define SPELL_FLAME_BREATH_H 58956 // Inflicts 10938 to 14062 Fire damage to enemies in a cone in front of the caster. +#define SPELL_TAIL_LASH_N 56910 // A sweeping tail strike hits all enemies behind the caster, inflicting 3063 to 3937 damage and stunning them for 2 sec. +#define SPELL_TAIL_LASH_H 58957 // A sweeping tail strike hits all enemies behind the caster, inflicting 4375 to 5625 damage and stunning them for 2 sec. +#define SPELL_WILL_OF_SARTHARION 61254 // Sartharion's presence bolsters the resolve of the Twilight Drakes, increasing their total health by 25%. This effect also increases Sartharion's health by 25%. +#define SPELL_POWER_OF_SARTHARION 61254 //Shadron's presence increases Fire damage taken by all enemies by 100%. + +//Sartharion Yell +#define SAY_SARTHARION_AGGRO -1615016 +#define SAY_SARTHARION_BERSERK -1615017 +#define SAY_SARTHARION_BREATH -1615018 +#define SAY_SARTHARION_CALL_SHADRON -1615019 +#define SAY_SARTHARION_CALL_TENEBRON -1615020 +#define SAY_SARTHARION_CALL_VESPERON -1615021 +#define SAY_SARTHARION_DEATH -1615022 +#define SAY_SARTHARION_SPECIAL_1 -1615023 +#define SAY_SARTHARION_SPECIAL_2 -1615024 +#define SAY_SARTHARION_SPECIAL_3 -1615025 +#define SAY_SARTHARION_SPECIAL_4 -1615026 +#define SAY_SARTHARION_SLAY_1 -1615027 +#define SAY_SARTHARION_SLAY_2 -1615028 +#define SAY_SARTHARION_SLAY_3 -1615029 + +//Miniboses (Vesperon, Shadron, Tenebron) +#define SPELL_SHADOW_BREATH_H 59126 //Inflicts 8788 to 10212 Fire damage to enemies in a cone in front of the caster. +#define SPELL_SHADOW_BREATH_N 57570 //Inflicts 6938 to 8062 Fire damage to enemies in a cone in front of the caster. +//TAIL LASH the same as Sartharion's +#define SPELL_SHADOW_FISSURE_H 59127 //Deals 9488 to 13512 Shadow damage to any enemy within the Shadow fissure after 5 sec. +#define SPELL_SHADOW_FISSURE_N 57579 //Deals 6188 to 8812 Shadow damage to any enemy within the Shadow fissure after 5 sec. + +//Vesperon +#define MINIBOSS_VESPERON 30449 //npc 30449 //In portal is a disciple, when disciple killed remove Power_of_vesperon, portal spawns multiple times +#define BUFF_POWER_OF_VESPERON 61251 //Vesperon's presence decreases the maximum health of all enemies by 25%. + +//Shadron +#define MINIBOSS_SHADRON 30451 //npc 30451 //In portal is a disciple, when disciple killed remove Power_of_vesperon, portal spawns multiple times +#define BUFF_POWER_OF_SHADRON 58105 //Shadron's presence increases Fire damage taken by all enemies by 100%. + +//Tenebron +#define MINIBOSS_TENEBRON 30452 //npc 30452 //in the portal spawns 6 eggs, if not killed in time (approx. 20s) they will hatch, whelps can cast 60708 +#define BUFF_POWER_OF_TENEBRON 61248 //Tenebron's presence increases Shadow damage taken by all enemies by 100%. + +//Minibosses common spells +#define SPELL_SHADOW_BREATH_N 57570 +#define SPELL_SHADOW_BREATH_H 59126 +#define SPELL_SHADOW_FISSURE_N 57579 +#define SPELL_SHADOW_FISSURE_H 59127 +#define SPELL_TWILIGHT_REVENGE 60639 + +//Tenebron, dummy spell +#define SPELL_HATCH_EGGS 58793 + +//Whelps +#define TWILIGHT_WHELP 30890 //npc 30890 +#define SHARTHARION_TWILIGHT_WHELP 31214 //npc 31214 +#define SPELL_FADE_ARMOR 60708 //Reduces the armor of an enemy by 1500 for 15s + +/*Summons a portal, which all DPS and one healer should go through and proceed to kill all eggs. After about 20 seconds these eggs will hatch into whelplings with 60k health. Whelplings that hatched should be picked up by a tank and killed. +Hatch Eggs Tenebron summons a portal in which eggs are spawned. After about 20s the eggs hatches into Whelps (156,396 hp - amount of whelps determined by Normal or Heroic mode) that do Fade Armor. */ + +struct TRINITY_DLL_DECL boss_sartharionAI : public ScriptedAI +{ + boss_sartharionAI(Creature *c) : ScriptedAI(c) {} + + bool berserk; + + void Reset() + { + berserk = false; + } + void EnterCombat(Unit* who) + { + DoScriptText(SAY_SARTHARION_DEATH,m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if(!UpdateVictim()) + return; + + if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) <= 10) + { + if(!berserk){ + DoCast(m_creature,SPELL_BERSERK); + berserk = true; + } + } + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_SARTHARION_DEATH,m_creature); + } +}; + +/*###### +## Mob Vesperon +######*/ + +//Vesperon Yell +#define SAY_VESPERON_AGGRO -1615030 +#define SAY_VESPERON_SLAY_1 -1615031 +#define SAY_VESPERON_SLAY_2 -1615032 +#define SAY_VESPERON_DEATH -1615033 +#define SAY_VESPERON_BREATH -1615034 +#define SAY_VESPERON_RESPOND -1615035 +#define SAY_VESPERON_SPECIAL_1 -1615036 +#define SAY_VESPERON_SPECIAL_2 -1615037 + +struct TRINITY_DLL_DECL mob_vesperonAI : public ScriptedAI +{ + mob_vesperonAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_VESPERON_AGGRO,m_creature); + } + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if(!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_VESPERON_DEATH,m_creature); + } +}; + +/*###### +## Mob Shadron +######*/ + +//Shadron Yell +#define SAY_SHADRON_AGGRO -1615000 +#define SAY_SHADRON_SLAY_1 -1615001 +#define SAY_SHADRON_SLAY_2 -1615002 +#define SAY_SHADRON_DEATH -1615003 +#define SAY_SHADRON_BREATH -1615004 +#define SAY_SHADRON_RESPOND -1615005 +#define SAY_SHADRON_SPECIAL_1 -1615006 +#define SAY_SHADRON_SPECIAL_2 -1615007 + +struct TRINITY_DLL_DECL mob_shadronAI : public ScriptedAI +{ + mob_shadronAI(Creature *c) : ScriptedAI(c) {} + + void Reset(){} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_SHADRON_AGGRO,m_creature); + } + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if(!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_SHADRON_DEATH,m_creature); + } +}; +/*###### +## Mob Tenebron +######*/ + +//Yell +#define SAY_TENEBRON_AGGRO -1615008 +#define SAY_TENEBRON_SLAY_1 -1615009 +#define SAY_TENEBRON_SLAY_2 -1615010 +#define SAY_TENEBRON_DEATH -1615011 +#define SAY_TENEBRON_BREATH -1615012 +#define SAY_TENEBRON_RESPOND -1615013 +#define SAY_TENEBRON_SPECIAL_1 -1615014 +#define SAY_TENEBRON_SPECIAL_2 -1615015 + +struct TRINITY_DLL_DECL mob_tenebronAI : public ScriptedAI +{ + mob_tenebronAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_TENEBRON_AGGRO,m_creature); + } + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if(!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_TENEBRON_DEATH,m_creature); + } +}; + +/*###### +## Mob Whelps +######*/ +struct TRINITY_DLL_DECL mob_whelpAI : public ScriptedAI +{ + mob_whelpAI(Creature *c) : ScriptedAI(c) {} + + uint32 Fade_armor_Timer; + + void Reset() {} + void EnterCombat(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if(!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) {} +}; + +CreatureAI* GetAI_mob_whelp(Creature *_Creature) +{ + return new mob_whelpAI (_Creature); +} + +CreatureAI* GetAI_mob_tenebron(Creature *_Creature) +{ + return new mob_tenebronAI (_Creature); +} + +CreatureAI* GetAI_mob_shadron(Creature *_Creature) +{ + return new mob_shadronAI (_Creature); +} + +CreatureAI* GetAI_mob_vesperon(Creature *_Creature) +{ + return new mob_vesperonAI (_Creature); +} + +CreatureAI* GetAI_boss_sartharion(Creature *_Creature) +{ + return new boss_sartharionAI (_Creature); +} + +void AddSC_boss_sartharion() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_sartharion"; + newscript->GetAI = &GetAI_boss_sartharion; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_vesperon"; + newscript->GetAI = &GetAI_mob_vesperon; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_shadron"; + newscript->GetAI = &GetAI_mob_shadron; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_tenebron"; + newscript->GetAI = &GetAI_mob_tenebron; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_whelp"; + newscript->GetAI = &GetAI_mob_whelp; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/zone/obsidian_sanctum/def_obsidian_sanctum.h b/src/bindings/scripts/scripts/zone/obsidian_sanctum/def_obsidian_sanctum.h new file mode 100644 index 00000000000..59d76502af3 --- /dev/null +++ b/src/bindings/scripts/scripts/zone/obsidian_sanctum/def_obsidian_sanctum.h @@ -0,0 +1,4 @@ +#ifndef DEF_OBSIDIAN_SANCTUM_H +#define DEF_OBSIDIAN_SANCTUM_H + +#endif diff --git a/src/bindings/scripts/scripts/zone/obsidian_sanctum/instance_obsidian_sanctum.cpp b/src/bindings/scripts/scripts/zone/obsidian_sanctum/instance_obsidian_sanctum.cpp new file mode 100644 index 00000000000..898574c99eb --- /dev/null +++ b/src/bindings/scripts/scripts/zone/obsidian_sanctum/instance_obsidian_sanctum.cpp @@ -0,0 +1,21 @@ +#include "precompiled.h" +#include "def_obsidian_sanctum.h" + +struct TRINITY_DLL_DECL instance_obsidian_sanctum : public ScriptedInstance +{ + instance_obsidian_sanctum(Map *Map) : ScriptedInstance(Map) {Initialize();}; +}; + +InstanceData* GetInstanceData_instance_obsidian_sanctum(Map* map) +{ + return new instance_obsidian_sanctum(map); +} + +void AddSC_instance_obsidian_sanctum() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_obsidian_sanctum"; + newscript->GetInstanceData = &GetInstanceData_instance_obsidian_sanctum; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/zone/onyxias_lair/boss_onyxia.cpp b/src/bindings/scripts/scripts/zone/onyxias_lair/boss_onyxia.cpp index eef29518ecd..96885e7e672 100644 --- a/src/bindings/scripts/scripts/zone/onyxias_lair/boss_onyxia.cpp +++ b/src/bindings/scripts/scripts/zone/onyxias_lair/boss_onyxia.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -102,7 +102,7 @@ struct TRINITY_DLL_DECL boss_onyxiaAI : public ScriptedAI m_creature->ApplySpellImmune(1, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true); } - void Aggro(Unit* who) + void EnterCombat(Unit* who) { DoScriptText(SAY_AGGRO, m_creature); DoZoneInCombat(); @@ -125,8 +125,7 @@ struct TRINITY_DLL_DECL boss_onyxiaAI : public ScriptedAI if(((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 60) && (Phase == 1)) { Phase = 2; - m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF); - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING + MOVEMENTFLAG_ONTRANSPORT); + m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); m_creature->SetHover(true); m_creature->GetMotionMaster()->Clear(false); m_creature->GetMotionMaster()->MoveIdle(); @@ -136,13 +135,13 @@ struct TRINITY_DLL_DECL boss_onyxiaAI : public ScriptedAI if(((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 40) && (Phase == 2)) { Phase = 3; - m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING + MOVEMENTFLAG_ONTRANSPORT); - m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LAND); + m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); m_creature->SetHover(false); m_creature->GetMotionMaster()->MovePoint(0, -10.6155, -219.357, -87.7344); DoStartMovement(m_creature->getVictim()); m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); DoScriptText(SAY_PHASE_3_TRANS, m_creature); + m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); } if(Phase == 1 || Phase == 3) diff --git a/src/bindings/scripts/scripts/zone/orgrimmar/orgrimmar.cpp b/src/bindings/scripts/scripts/zone/orgrimmar/orgrimmar.cpp index a53794c2b7a..5a9d17db745 100644 --- a/src/bindings/scripts/scripts/zone/orgrimmar/orgrimmar.cpp +++ b/src/bindings/scripts/scripts/zone/orgrimmar/orgrimmar.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -90,7 +90,7 @@ struct TRINITY_DLL_DECL npc_shenthulAI : public ScriptedAI playerGUID = 0; } - void Aggro(Unit* who) { } + void EnterCombat(Unit* who) { } void UpdateAI(const uint32 diff) { @@ -99,7 +99,7 @@ struct TRINITY_DLL_DECL npc_shenthulAI : public ScriptedAI { if( Unit* temp = Unit::GetUnit((*m_creature),playerGUID) ) if( temp->GetTypeId() == TYPEID_PLAYER ) - ((Player*)temp)->FailQuest(QUEST_2460); + CAST_PLR(temp)->FailQuest(QUEST_2460); Reset(); } else Reset_Timer -= diff; @@ -116,7 +116,18 @@ struct TRINITY_DLL_DECL npc_shenthulAI : public ScriptedAI DoMeleeAttackIfReady(); } + + void ReciveEmote_npc_shenthul(Player *player, uint32 emote) + { + if( emote == TEXTEMOTE_SALUTE && player->GetQuestStatus(QUEST_2460) == QUEST_STATUS_INCOMPLETE ) + if(CanEmote) + { + player->AreaExploredOrEventHappens(QUEST_2460); + Reset(); + } + } }; + CreatureAI* GetAI_npc_shenthul(Creature *_Creature) { return new npc_shenthulAI (_Creature); @@ -126,19 +137,8 @@ bool QuestAccept_npc_shenthul(Player* player, Creature* creature, Quest const* q { if( quest->GetQuestId() == QUEST_2460 ) { - ((npc_shenthulAI*)creature->AI())->CanTalk = true; - ((npc_shenthulAI*)creature->AI())->playerGUID = player->GetGUID(); - } - return true; -} - -bool ReciveEmote_npc_shenthul(Player *player, Creature *_Creature, uint32 emote) -{ - if( emote == TEXTEMOTE_SALUTE && player->GetQuestStatus(QUEST_2460) == QUEST_STATUS_INCOMPLETE ) - if( ((npc_shenthulAI*)_Creature->AI())->CanEmote ) - { - player->AreaExploredOrEventHappens(QUEST_2460); - ((npc_shenthulAI*)_Creature->AI())->Reset(); + CAST_AI(npc_shenthulAI, creature->AI())->CanTalk = true; + CAST_AI(npc_shenthulAI, creature->AI())->playerGUID = player->GetGUID(); } return true; } @@ -174,7 +174,7 @@ struct TRINITY_DLL_DECL npc_thrall_warchiefAI : public ScriptedAI Shock_Timer = 8000; } - void Aggro(Unit *who) {} + void EnterCombat(Unit *who) {} void UpdateAI(const uint32 diff) { @@ -263,7 +263,6 @@ void AddSC_orgrimmar() newscript->Name="npc_shenthul"; newscript->GetAI = &GetAI_npc_shenthul; newscript->pQuestAccept = &QuestAccept_npc_shenthul; - newscript->pReceiveEmote = &ReciveEmote_npc_shenthul; newscript->RegisterSelf(); newscript = new Script; diff --git a/src/bindings/scripts/scripts/zone/razorfen_downs/boss_amnennar_the_coldbringer.cpp b/src/bindings/scripts/scripts/zone/razorfen_downs/boss_amnennar_the_coldbringer.cpp index 5502fe61f1a..89fff0d3fd7 100644 --- a/src/bindings/scripts/scripts/zone/razorfen_downs/boss_amnennar_the_coldbringer.cpp +++ b/src/bindings/scripts/scripts/zone/razorfen_downs/boss_amnennar_the_coldbringer.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -23,15 +23,16 @@ EndScriptData */ #include "precompiled.h" -#define SAY_0 "You'll never leave this place... alive." -#define SAY_1 "Come, spirits, attend your master." -#define SAY_SLAY "Too...easy!" -#define SOUND_AGGRO 5825 -#define SOUND_SLAY 5826 -#define SOUND_SUMMON 5829 +#define SAY_AGGRO -1129000 +#define SAY_SUMMON60 -1129001 +#define SAY_SUMMON30 -1129002 +#define SAY_HP -1129003 +#define SAY_KILL -1129004 -#define SPELL_AMNENNARSWRATH 13009 -#define SPELL_FROSTBOLT 10179 +#define SPELL_AMNENNARSWRATH 13009 +#define SPELL_FROSTBOLT 15530 +#define SPELL_FROST_NOVA 15531 +#define SPELL_FROST_SPECTRES 12642 struct TRINITY_DLL_DECL boss_amnennar_the_coldbringerAI : public ScriptedAI { @@ -39,50 +40,29 @@ struct TRINITY_DLL_DECL boss_amnennar_the_coldbringerAI : public ScriptedAI uint32 AmnenarsWrath_Timer; uint32 FrostBolt_Timer; - bool Spectrals; - int Rand; - int RandX; - int RandY; - Creature* Summoned; + uint32 FrostNova_Timer; + bool Spectrals60; + bool Spectrals30; + bool Hp; void Reset() { AmnenarsWrath_Timer = 8000; FrostBolt_Timer = 1000; - Spectrals = false; + FrostNova_Timer = 10000 + rand()%5000; + Spectrals30 = false; + Spectrals60 = false; + Hp = false; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { - DoYell(SAY_0,LANG_UNIVERSAL,NULL); - DoPlaySoundToSet(m_creature,SOUND_AGGRO); + DoScriptText(SAY_AGGRO, m_creature); } void KilledUnit() { - DoYell(SAY_SLAY, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_SLAY); - } - - void SummonSpectrals(Unit* victim) - { - Rand = rand()%5; - switch (rand()%2) - { - case 0: RandX = 0 - Rand; break; - case 1: RandX = 0 + Rand; break; - } - Rand = 0; - Rand = rand()%5; - switch (rand()%2) - { - case 0: RandY = 0 - Rand; break; - case 1: RandY = 0 + Rand; break; - } - Rand = 0; - Summoned = DoSpawnCreature(8585, RandX, RandY, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000); - if(Summoned) - ((CreatureAI*)Summoned->AI())->AttackStart(victim); + DoScriptText(SAY_KILL, m_creature); } void UpdateAI(const uint32 diff) @@ -100,28 +80,34 @@ struct TRINITY_DLL_DECL boss_amnennar_the_coldbringerAI : public ScriptedAI //FrostBolt_Timer if (FrostBolt_Timer < diff) { - Unit* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM,0); - if (target) DoCast(target,SPELL_FROSTBOLT); - + DoCast(m_creature->getVictim(),SPELL_FROSTBOLT); FrostBolt_Timer = 8000; } else FrostBolt_Timer -= diff; - if ( !Spectrals && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 50 ) + if (FrostNova_Timer < diff) + { + DoCast(m_creature,SPELL_FROST_NOVA); + FrostNova_Timer = 15000; + } else FrostNova_Timer -= diff; + + if (!Spectrals60 && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 60) + { + DoScriptText(SAY_SUMMON60, m_creature); + DoCast(m_creature->getVictim(),SPELL_FROST_SPECTRES); + Spectrals60 = true; + } + + if (!Hp && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 50) + { + DoScriptText(SAY_HP, m_creature); + Hp = true; + } + + if (!Spectrals30 && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 30) { - DoYell(SAY_1, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_SUMMON); - - Unit* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM,0); - - if(target) - { - SummonSpectrals(target); - SummonSpectrals(target); - SummonSpectrals(target); - } - Spectrals = true; + DoScriptText(SAY_SUMMON30, m_creature); + DoCast(m_creature->getVictim(),SPELL_FROST_SPECTRES); + Spectrals30 = true; } DoMeleeAttackIfReady(); diff --git a/src/bindings/scripts/scripts/zone/razorfen_downs/razorfen_downs.cpp b/src/bindings/scripts/scripts/zone/razorfen_downs/razorfen_downs.cpp new file mode 100644 index 00000000000..d5c09e504a8 --- /dev/null +++ b/src/bindings/scripts/scripts/zone/razorfen_downs/razorfen_downs.cpp @@ -0,0 +1,85 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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: Razorfen_Downs +SD%Complete: 100 +SDComment: Support for Henry Stern(2 recipes) +SDCategory: Razorfen Downs +EndScriptData */ + +/* ContentData +npc_henry_stern +EndContentData */ + +#include "precompiled.h" + +/*### +# npc_henry_stern +####*/ + +enum +{ + SPELL_GOLDTHORN_TEA = 13028, + SPELL_TEACHING_GOLDTHORN_TEA = 13029, + SPELL_MIGHT_TROLLS_BLOOD_POTION = 3451, + SPELL_TEACHING_MIGHTY_TROLLS_BLOOD_POTION = 13030, + GOSSIP_TEXT_TEA_ANSWER = 2114, + GOSSIP_TEXT_POTION_ANSWER = 2115, +}; + +#define GOSSIP_ITEM_TEA "Teach me the cooking recipe" +#define GOSSIP_ITEM_POTION "Teach me the alchemy recipe" + +bool GossipHello_npc_henry_stern (Player* pPlayer, Creature* pCreature) +{ + if (pPlayer->GetBaseSkillValue(SKILL_COOKING) >= 175 && !pPlayer->HasSpell(SPELL_GOLDTHORN_TEA)) + pPlayer->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_TEA, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + + if (pPlayer->GetBaseSkillValue(SKILL_ALCHEMY) >= 180 && !pPlayer->HasSpell(SPELL_MIGHT_TROLLS_BLOOD_POTION)) + pPlayer->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_POTION, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + + pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_henry_stern (Player* pPlayer, Creature* pCreature, uint32 sender, uint32 action) +{ + if (action == GOSSIP_ACTION_INFO_DEF + 1) + { + pCreature->CastSpell(pPlayer, SPELL_TEACHING_GOLDTHORN_TEA, true); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXT_TEA_ANSWER, pCreature->GetGUID()); + } + + if (action == GOSSIP_ACTION_INFO_DEF + 2) + { + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXT_POTION_ANSWER, pCreature->GetGUID()); + pCreature->CastSpell(pPlayer, SPELL_TEACHING_MIGHTY_TROLLS_BLOOD_POTION, true); + } + + return true; +} + +void AddSC_razorfen_downs() +{ + Script* newscript; + + newscript = new Script; + newscript->Name = "npc_henry_stern"; + newscript->pGossipHello = &GossipHello_npc_henry_stern; + newscript->pGossipSelect = &GossipSelect_npc_henry_stern; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/zone/razorfen_kraul/razorfen_kraul.cpp b/src/bindings/scripts/scripts/zone/razorfen_kraul/razorfen_kraul.cpp index 39be57325d7..8680218e992 100644 --- a/src/bindings/scripts/scripts/zone/razorfen_kraul/razorfen_kraul.cpp +++ b/src/bindings/scripts/scripts/zone/razorfen_kraul/razorfen_kraul.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -90,7 +90,7 @@ npc_willixAI(Creature *c) : npc_escortAI(c) {} case 45: DoScriptText(SAY_WIN, m_creature, player); if (player && player->GetTypeId() == TYPEID_PLAYER) - ((Player*)player)->GroupEventHappens(QUEST_WILLIX_THE_IMPORTER,m_creature); + CAST_PLR(player)->GroupEventHappens(QUEST_WILLIX_THE_IMPORTER,m_creature); break; case 46: DoScriptText(SAY_END, m_creature, player); @@ -100,7 +100,7 @@ npc_willixAI(Creature *c) : npc_escortAI(c) {} void Reset() {} - void Aggro(Unit* who) + void EnterCombat(Unit* who) { DoScriptText(SAY_AGGRO1, m_creature, NULL); } @@ -115,7 +115,7 @@ npc_willixAI(Creature *c) : npc_escortAI(c) {} if (PlayerGUID) { if (Player* player = Unit::GetPlayer(PlayerGUID)) - ((Player*)player)->FailQuest(QUEST_WILLIX_THE_IMPORTER); + CAST_PLR(player)->FailQuest(QUEST_WILLIX_THE_IMPORTER); } } @@ -129,7 +129,7 @@ bool QuestAccept_npc_willix(Player* player, Creature* creature, Quest const* que { if (quest->GetQuestId() == QUEST_WILLIX_THE_IMPORTER) { - ((npc_escortAI*)(creature->AI()))->Start(true, true, false, player->GetGUID()); + CAST_AI(npc_escortAI, (creature->AI()))->Start(true, true, false, player->GetGUID()); DoScriptText(SAY_READY, creature, player); creature->setFaction(113); } @@ -189,7 +189,7 @@ CreatureAI* GetAI_npc_willix(Creature *_Creature) thisAI->AddWaypoint(45, 1948.35, 1571.35, 80.96, 30000); thisAI->AddWaypoint(46, 1947.02, 1566.42, 81.80, 30000); - return (CreatureAI*)thisAI; + return thisAI; } void AddSC_razorfen_kraul() diff --git a/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_ayamiss.cpp b/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_ayamiss.cpp index 128ab315334..60830068e01 100644 --- a/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_ayamiss.cpp +++ b/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_ayamiss.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -52,7 +52,7 @@ struct TRINITY_DLL_DECL boss_ayamissAI : public ScriptedAI phase=1; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { pTarget = who; } diff --git a/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_buru.cpp b/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_buru.cpp index 4297c32492f..58c48540362 100644 --- a/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_buru.cpp +++ b/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_buru.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 diff --git a/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_kurinnaxx.cpp b/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_kurinnaxx.cpp index 9c888e98605..69d1babf173 100644 --- a/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_kurinnaxx.cpp +++ b/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_kurinnaxx.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -44,7 +44,7 @@ struct TRINITY_DLL_DECL boss_kurinnaxxAI : public ScriptedAI SANDTRAP_Timer = 30000; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { pTarget = who; } diff --git a/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_moam.cpp b/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_moam.cpp index 5830b3a8070..df542a69693 100644 --- a/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_moam.cpp +++ b/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_moam.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -52,7 +52,7 @@ struct TRINITY_DLL_DECL boss_moamAI : public ScriptedAI DRAINMANA_Timer = 30000; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { DoScriptText(EMOTE_AGGRO, m_creature); pTarget = who; diff --git a/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_ossirian.cpp b/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_ossirian.cpp index 1d389830045..5652b706917 100644 --- a/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_ossirian.cpp +++ b/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_ossirian.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 diff --git a/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_rajaxx.cpp b/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_rajaxx.cpp index 0639a02deb6..fb2c92ff59f 100644 --- a/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_rajaxx.cpp +++ b/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_rajaxx.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 diff --git a/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/instance_ruins_of_ahnqiraj.cpp b/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/instance_ruins_of_ahnqiraj.cpp index 27a0621b2be..b94e6f16a80 100644 --- a/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/instance_ruins_of_ahnqiraj.cpp +++ b/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/instance_ruins_of_ahnqiraj.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 diff --git a/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_arcanist_doan.cpp b/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_arcanist_doan.cpp index 222f927e5a0..454abb1602d 100644 --- a/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_arcanist_doan.cpp +++ b/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_arcanist_doan.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>.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 @@ -23,55 +23,40 @@ EndScriptData */ #include "precompiled.h" -#define SPELL_POLYMORPH 12826 -#define SPELL_AOESILENCE 8988 -#define SPELL_ARCANEEXPLOSION3 8438 -#define SPELL_ARCANEEXPLOSION4 8439 -#define SPELL_FIREAOE 9435 -#define SPELL_BLINK 1953 -#define SPELL_FIREBALL 21162 -#define SPELL_MANASHIELD4 10191 -#define SPELL_ARCANEBUBBLE 9438 - -#define SAY_AGGRO "You will not defile these mysteries!" -#define SAY_SPECIALAE "Burn in righteous fire!" - -#define SOUND_AGGRO 5842 -#define SOUND_SPECIALAE 5843 +enum +{ + SAY_AGGRO = -1189019, + SAY_SPECIALAE = -1189020, + + SPELL_POLYMORPH = 13323, + SPELL_AOESILENCE = 8988, + SPELL_ARCANEEXPLOSION = 9433, + SPELL_FIREAOE = 9435, + SPELL_ARCANEBUBBLE = 9438, +}; struct TRINITY_DLL_DECL boss_arcanist_doanAI : public ScriptedAI { boss_arcanist_doanAI(Creature *c) : ScriptedAI(c) {} - uint32 FullAOE_Timer; uint32 Polymorph_Timer; - uint32 Yell_Timer; - uint32 ArcaneBubble_Timer; uint32 AoESilence_Timer; - uint32 ArcaneExplosion3_Timer; - uint32 ArcaneExplosion4_Timer; - uint32 Blink_Timer; - uint32 Fireball_Timer; - uint32 ManaShield4_Timer; + uint32 ArcaneExplosion_Timer; + bool bCanDetonate; + bool bShielded; void Reset() { - FullAOE_Timer = 5000; - Polymorph_Timer = 1; - Yell_Timer = 2000; - ArcaneBubble_Timer = 3000; - AoESilence_Timer = 20000; - ArcaneExplosion3_Timer = 10000; - ArcaneExplosion4_Timer = 10000; - Blink_Timer = 40000; - Fireball_Timer = 6000; - ManaShield4_Timer = 70000; + Polymorph_Timer = 20000; + AoESilence_Timer = 15000; + ArcaneExplosion_Timer = 3000; + bCanDetonate = false; + bShielded = false; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { - DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL); - DoPlaySoundToSet(m_creature,SOUND_AGGRO); + DoScriptText(SAY_AGGRO, m_creature); } void UpdateAI(const uint32 diff) @@ -79,79 +64,50 @@ struct TRINITY_DLL_DECL boss_arcanist_doanAI : public ScriptedAI if (!UpdateVictim()) return; - //If we are <50% hp cast Arcane Bubble and start casting SPECIAL FIRE AOE - if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 50 && !m_creature->IsNonMeleeSpellCasted(false)) + if (bShielded && bCanDetonate) { - if (Polymorph_Timer < diff) - { - Unit* target = NULL; - - target = SelectUnit(SELECT_TARGET_RANDOM,0); - if (target)DoCast(target,SPELL_POLYMORPH); - Polymorph_Timer = 40000; - }else Polymorph_Timer -= diff; - - if (Yell_Timer < diff) - { - DoYell(SAY_SPECIALAE,LANG_UNIVERSAL,NULL); - DoPlaySoundToSet(m_creature,SOUND_SPECIALAE); - Yell_Timer = 40000; - }else Yell_Timer -= diff; - - if (ArcaneBubble_Timer < diff) - { - DoCast(m_creature,SPELL_ARCANEBUBBLE); - ArcaneBubble_Timer = 40000; - }else ArcaneBubble_Timer -= diff; - - if (FullAOE_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_FIREAOE); - FullAOE_Timer = 40000; - }else FullAOE_Timer -= diff; + DoCast(m_creature,SPELL_FIREAOE); + bCanDetonate = false; } - //AoESilence_Timer - if (AoESilence_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_AOESILENCE); - AoESilence_Timer = 30000; - }else AoESilence_Timer -= diff; + if (m_creature->HasAura(SPELL_ARCANEBUBBLE)) + return; - //ArcaneExplosion3_Timer - if (ArcaneExplosion3_Timer < diff) + //If we are <50% hp cast Arcane Bubble + if (!bShielded && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 50) { - DoCast(m_creature->getVictim(),SPELL_ARCANEEXPLOSION3); - ArcaneExplosion3_Timer = 8000; - }else ArcaneExplosion3_Timer -= diff; + //wait if we already casting + if (m_creature->IsNonMeleeSpellCasted(false)) + return; - //ArcaneExplosion4_Timer - if (ArcaneExplosion4_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_ARCANEEXPLOSION4); - ArcaneExplosion4_Timer = 10000; - }else ArcaneExplosion4_Timer -= diff; + DoScriptText(SAY_SPECIALAE, m_creature); + DoCast(m_creature,SPELL_ARCANEBUBBLE); - //Blink_Timer - if (Blink_Timer < diff) + bCanDetonate = true; + bShielded = true; + } + + if (Polymorph_Timer < diff) { - DoCast(m_creature,SPELL_BLINK); - Blink_Timer = 30000; - }else Blink_Timer -= diff; + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,1)) + DoCast(target,SPELL_POLYMORPH); + + Polymorph_Timer = 20000; + }else Polymorph_Timer -= diff; - //Fireball_Timer - if (Fireball_Timer < diff) + //AoESilence_Timer + if (AoESilence_Timer < diff) { - DoCast(m_creature->getVictim(),SPELL_FIREBALL); - Fireball_Timer = 12000; - }else Fireball_Timer -= diff; + DoCast(m_creature->getVictim(),SPELL_AOESILENCE); + AoESilence_Timer = 15000 + rand()%5000; + }else AoESilence_Timer -= diff; - //ManaShiled4_Timer - if (ManaShield4_Timer < diff) + //ArcaneExplosion_Timer + if (ArcaneExplosion_Timer < diff) { - DoCast(m_creature,SPELL_MANASHIELD4); - ManaShield4_Timer = 70000; - }else ManaShield4_Timer -= diff; + DoCast(m_creature->getVictim(),SPELL_ARCANEEXPLOSION); + ArcaneExplosion_Timer = 8000; + }else ArcaneExplosion_Timer -= diff; DoMeleeAttackIfReady(); } diff --git a/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_azshir_the_sleepless.cpp b/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_azshir_the_sleepless.cpp index e22de9b8fb3..2e2bb14a711 100644 --- a/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_azshir_the_sleepless.cpp +++ b/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_azshir_the_sleepless.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -42,7 +42,7 @@ struct TRINITY_DLL_DECL boss_azshir_the_sleeplessAI : public ScriptedAI Terrify_Timer = 20000; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } diff --git a/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_bloodmage_thalnos.cpp b/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_bloodmage_thalnos.cpp index f5c094d6127..c8ca71dff7c 100644 --- a/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_bloodmage_thalnos.cpp +++ b/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_bloodmage_thalnos.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>.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 @@ -23,45 +23,45 @@ EndScriptData */ #include "precompiled.h" -#define SPELL_FROSTNOVA2 865 -#define SPELL_FLAMESHOCK3 8053 -#define SPELL_SHADOWBOLT5 1106 -#define SPELL_FLAMESPIKE 8814 -#define SPELL_FIRENOVA 16079 - -#define SAY_AGGRO "We hunger for vengeance." -#define SAY_HEALTH "No rest... for the angry dead!" -#define SAY_DEATH "More... More souls!" - -#define SOUND_AGGRO 5844 -#define SOUND_HEALTH 5846 -#define SOUND_DEATH 5845 +enum +{ + SAY_AGGRO = -1189016, + SAY_HEALTH = -1189017, + SAY_KILL = -1189018, + + SPELL_FLAMESHOCK = 8053, + SPELL_SHADOWBOLT = 1106, + SPELL_FLAMESPIKE = 8814, + SPELL_FIRENOVA = 16079, +}; struct TRINITY_DLL_DECL boss_bloodmage_thalnosAI : public ScriptedAI { boss_bloodmage_thalnosAI(Creature *c) : ScriptedAI(c) {} - uint32 FrostNova2_Timer; - uint32 FlameShock3_Timer; - uint32 ShadowBolt5_Timer; + bool HpYell; + uint32 FlameShock_Timer; + uint32 ShadowBolt_Timer; uint32 FlameSpike_Timer; uint32 FireNova_Timer; - uint32 Yell_Timer; void Reset() { - Yell_Timer = 1; - FrostNova2_Timer = 10000; - FlameShock3_Timer = 15000; - ShadowBolt5_Timer = 20000; - FlameSpike_Timer = 20000; - FireNova_Timer = 10000; + HpYell = false; + FlameShock_Timer = 10000; + ShadowBolt_Timer = 2000; + FlameSpike_Timer = 8000; + FireNova_Timer = 40000; + } + + void EnterCombat(Unit *who) + { + DoScriptText(SAY_AGGRO, m_creature); } - void Aggro(Unit *who) + void KilledUnit(Unit* Victim) { - DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL); - DoPlaySoundToSet(m_creature,SOUND_AGGRO); + DoScriptText(SAY_KILL, m_creature); } void UpdateAI(const uint32 diff) @@ -70,38 +70,18 @@ struct TRINITY_DLL_DECL boss_bloodmage_thalnosAI : public ScriptedAI return; //If we are <35% hp - if ( m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 35) + if (!HpYell && ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() <= 35)) { - Yell_Timer -= diff; - - if (Yell_Timer < diff) - { - DoYell(SAY_HEALTH,LANG_UNIVERSAL,NULL); - DoPlaySoundToSet(m_creature,SOUND_HEALTH); - Yell_Timer = 900000; - } + DoScriptText(SAY_HEALTH, m_creature); + HpYell = true; } - //FrostNova2_Timer - if (FrostNova2_Timer < diff) + //FlameShock_Timer + if (FlameShock_Timer < diff) { - DoCast(m_creature->getVictim(),SPELL_FROSTNOVA2); - FrostNova2_Timer = 10000; - }else FrostNova2_Timer -= diff; - - //FlameShock3_Timer - if (FlameShock3_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_FLAMESHOCK3); - FlameShock3_Timer = 15000; - }else FlameShock3_Timer -= diff; - - //ShadowBolt5_Timer - if (ShadowBolt5_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_SHADOWBOLT5); - ShadowBolt5_Timer = 20000; - }else ShadowBolt5_Timer -= diff; + DoCast(m_creature->getVictim(),SPELL_FLAMESHOCK); + FlameShock_Timer = 10000 + rand()%5000; + }else FlameShock_Timer -= diff; //FlameSpike_Timer if (FlameSpike_Timer < diff) @@ -114,9 +94,16 @@ struct TRINITY_DLL_DECL boss_bloodmage_thalnosAI : public ScriptedAI if (FireNova_Timer < diff) { DoCast(m_creature->getVictim(),SPELL_FIRENOVA); - FireNova_Timer = 20000; + FireNova_Timer = 40000; }else FireNova_Timer -= diff; + //ShadowBolt_Timer + if (ShadowBolt_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_SHADOWBOLT); + ShadowBolt_Timer = 2000; + }else ShadowBolt_Timer -= diff; + DoMeleeAttackIfReady(); } }; diff --git a/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_headless_horseman.cpp b/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_headless_horseman.cpp index 99d08375fae..68e18201b0f 100644 --- a/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_headless_horseman.cpp +++ b/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_headless_horseman.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -134,10 +134,10 @@ struct TRINITY_DLL_DECL mob_wisp_invisAI : public ScriptedAI { Creaturetype = delay = spell = spell2 = 0; //that's hack but there are no info about range of this spells in dbc - SpellEntry *wisp = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_WISP_BLUE); + SpellEntry *wisp = GET_SPELL(SPELL_WISP_BLUE); if (wisp) wisp->rangeIndex = 6; //100 yards - SpellEntry *port = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_WISP_FLIGHT_PORT); + SpellEntry *port = GET_SPELL(SPELL_WISP_FLIGHT_PORT); if (port) port->rangeIndex = 6; } @@ -147,7 +147,7 @@ struct TRINITY_DLL_DECL mob_wisp_invisAI : public ScriptedAI uint32 spell; uint32 spell2; void Reset(){} - void Aggro(Unit *who){} + void EnterCombat(Unit *who){} void SetType(uint32 _type) { Creaturetype = _type; @@ -176,7 +176,7 @@ struct TRINITY_DLL_DECL mob_wisp_invisAI : public ScriptedAI if (!who || Creaturetype != 1 || !who->isTargetableForAttack()) return; - if (m_creature->GetDistance2d(who) < 0.1 && !who->HasAura(SPELL_SQUASH_SOUL,0)) + if (m_creature->GetDistance2d(who) < 0.1 && !who->HasAura(SPELL_SQUASH_SOUL)) DoCast(who,SPELL_SQUASH_SOUL); } @@ -218,7 +218,7 @@ struct TRINITY_DLL_DECL mob_headAI : public ScriptedAI laugh = 15000 + rand()%16 * 1000; } - void Aggro(Unit *who) {} + void EnterCombat(Unit *who) {} void SaySound(int32 textEntry, Unit *target = 0) { DoScriptText(textEntry, m_creature, target); @@ -321,7 +321,7 @@ struct TRINITY_DLL_DECL boss_headless_horsemanAI : public ScriptedAI { boss_headless_horsemanAI(Creature *c) : ScriptedAI(c) { - SpellEntry *confl = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_CONFLAGRATION); + SpellEntry *confl = GET_SPELL(SPELL_CONFLAGRATION); if(confl) { confl->EffectApplyAuraName[0] = SPELL_AURA_PERIODIC_DAMAGE_PERCENT; @@ -329,17 +329,17 @@ struct TRINITY_DLL_DECL boss_headless_horsemanAI : public ScriptedAI confl->EffectBaseDice[0] = 10; confl->DmgMultiplier[0] = 1; } -/* SpellEntry *confl = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_CONFLAGRATION); +/* SpellEntry *confl = GET_SPELL(SPELL_CONFLAGRATION); if(confl) confl->EffectTriggerSpell[1] = 22587; - SpellEntry *speed = (SpellEntry*)GetSpellStore()->LookupEntry(22587); + SpellEntry *speed = GET_SPELL(22587); if(speed) { speed->Effect[1] = SPELL_EFFECT_APPLY_AURA; speed->EffectApplyAuraName[1] = SPELL_AURA_MOD_CONFUSE; }*/ - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } ScriptedInstance *pInstance; @@ -424,7 +424,7 @@ struct TRINITY_DLL_DECL boss_headless_horsemanAI : public ScriptedAI case 1: { Creature *smoke = m_creature->SummonCreature(HELPER,Spawn[1].x,Spawn[1].y,Spawn[1].z,0,TEMPSUMMON_TIMED_DESPAWN,20000); if(smoke) - ((mob_wisp_invisAI*)smoke->AI())->SetType(3); + CAST_AI(mob_wisp_invisAI, smoke->AI())->SetType(3); DoCast(m_creature,SPELL_RHYME_BIG); break;} case 6: @@ -448,7 +448,7 @@ struct TRINITY_DLL_DECL boss_headless_horsemanAI : public ScriptedAI ++id; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { if(pInstance) pInstance->SetData(DATA_HORSEMAN_EVENT, IN_PROGRESS); @@ -469,7 +469,7 @@ struct TRINITY_DLL_DECL boss_headless_horsemanAI : public ScriptedAI else { //maybe possible when player dies from conflagration Creature *Head = Unit::GetCreature((*m_creature), headGUID); if (Head) - ((mob_headAI*)Head->AI())->SaySound(SAY_PLAYER_DEATH); + CAST_AI(mob_headAI, Head->AI())->SaySound(SAY_PLAYER_DEATH); } } } @@ -508,7 +508,7 @@ struct TRINITY_DLL_DECL boss_headless_horsemanAI : public ScriptedAI void SpellHitTarget(Unit* unit, const SpellEntry* spell) { if (spell->Id == SPELL_CONFLAGRATION) - if (unit->HasAura(SPELL_CONFLAGRATION,0)) + if (unit->HasAura(SPELL_CONFLAGRATION)) SaySound(SAY_CONFLAGRATION,unit); } @@ -522,7 +522,7 @@ struct TRINITY_DLL_DECL boss_headless_horsemanAI : public ScriptedAI flame->CastSpell(flame,SPELL_BODY_FLAME,false); Creature *wisp = DoSpawnCreature(WISP_INVIS,0,0,0,0,TEMPSUMMON_TIMED_DESPAWN,60000); if(wisp) - ((mob_wisp_invisAI*)wisp->AI())->SetType(4); + CAST_AI(mob_wisp_invisAI, wisp->AI())->SetType(4); if(pInstance) pInstance->SetData(DATA_HORSEMAN_EVENT, DONE); } @@ -577,7 +577,7 @@ struct TRINITY_DLL_DECL boss_headless_horsemanAI : public ScriptedAI DoCast(m_creature,SPELL_BODY_REGEN,true); m_creature->CastSpell(Head, SPELL_FLYING_HEAD,true); DoCast(m_creature,SPELL_CONFUSE,false); //test - done_by->ProcDamageAndSpell(m_creature,PROC_FLAG_KILL_AND_GET_XP,PROC_FLAG_KILLED,PROC_EX_NONE,0); + done_by->ProcDamageAndSpell(m_creature,PROC_FLAG_KILL,PROC_FLAG_KILLED,PROC_EX_NONE,0); whirlwind = 4000 + (rand()%5)*1000; regen = 0; } @@ -628,14 +628,14 @@ struct TRINITY_DLL_DECL boss_headless_horsemanAI : public ScriptedAI { Creature *flame = m_creature->SummonCreature(HELPER,Spawn[0].x,Spawn[0].y,Spawn[0].z,0,TEMPSUMMON_TIMED_DESPAWN,17000); if(flame) - ((mob_wisp_invisAI*)flame->AI())->SetType(2); + CAST_AI(mob_wisp_invisAI, flame->AI())->SetType(2); burned = true; }else burn -= diff; break; case 2: if (conflagrate < diff) { - Unit *plr = (Unit*)SelectRandomPlayer(30.0f); + Unit *plr = SelectRandomPlayer(30.0f); if (plr) m_creature->CastSpell(plr,SPELL_CONFLAGRATION,false); conflagrate = 10000 + rand()%7 * 1000; @@ -679,8 +679,8 @@ struct TRINITY_DLL_DECL boss_headless_horsemanAI : public ScriptedAI Creature* Head = Unit::GetCreature((*m_creature), headGUID); if (Head && Head->isAlive()) { - ((mob_headAI*)Head->AI())->Phase = Phase; - ((mob_headAI*)Head->AI())->Disappear(); + CAST_AI(mob_headAI, Head->AI())->Phase = Phase; + CAST_AI(mob_headAI, Head->AI())->Disappear(); } return; } @@ -718,7 +718,7 @@ void mob_headAI::Disappear() m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); m_creature->GetMotionMaster()->MoveIdle(); - ((boss_headless_horsemanAI*)body->AI())->returned = true; + CAST_AI(boss_headless_horsemanAI, body->AI())->returned = true; } } } @@ -741,16 +741,16 @@ struct TRINITY_DLL_DECL mob_pulsing_pumpkinAI : public ScriptedAI { debuff->SetDisplayId(m_creature->GetDisplayId()); debuff->CastSpell(debuff,SPELL_PUMPKIN_AURA_GREEN,false); - ((mob_wisp_invisAI*)debuff->AI())->SetType(1); + CAST_AI(mob_wisp_invisAI, debuff->AI())->SetType(1); debuffGUID = debuff->GetGUID(); } sprouted = false; DoCast(m_creature,SPELL_PUMPKIN_AURA,true); DoCast(m_creature,SPELL_SPROUTING); - m_creature->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_DISABLE_ROTATE); + m_creature->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_STUNNED); } - void Aggro(Unit *who){} + void EnterCombat(Unit *who){} void SpellHit(Unit *caster, const SpellEntry *spell) { @@ -758,7 +758,7 @@ struct TRINITY_DLL_DECL mob_pulsing_pumpkinAI : public ScriptedAI { sprouted = true; m_creature->RemoveAllAuras(); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_DISABLE_ROTATE); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_STUNNED); DoCast(m_creature,SPELL_SPROUT_BODY,true); m_creature->UpdateEntry(PUMPKIN_FIEND); DoStartMovement(m_creature->getVictim()); @@ -807,8 +807,8 @@ bool GOHello_go_loosely_turned_soil(Player *plr, GameObject* soil) Creature *horseman = soil->SummonCreature(HH_MOUNTED,FlightPoint[20].x,FlightPoint[20].y,FlightPoint[20].z,0,TEMPSUMMON_MANUAL_DESPAWN,0); if(horseman) { - ((boss_headless_horsemanAI*)horseman->AI())->playerGUID = plr->GetGUID(); - ((boss_headless_horsemanAI*)horseman->AI())->FlyMode(); + CAST_AI(boss_headless_horsemanAI, horseman->AI())->playerGUID = plr->GetGUID(); + CAST_AI(boss_headless_horsemanAI, horseman->AI())->FlyMode(); } //} return true; diff --git a/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_herod.cpp b/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_herod.cpp index 17f4aee1ae3..2531d3d6db6 100644 --- a/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_herod.cpp +++ b/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_herod.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -55,7 +55,7 @@ struct TRINITY_DLL_DECL boss_herodAI : public ScriptedAI Whirlwind_Timer = 60000; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { DoScriptText(SAY_AGGRO, m_creature); DoCast(m_creature,SPELL_RUSHINGCHARGE); @@ -105,46 +105,23 @@ struct TRINITY_DLL_DECL boss_herodAI : public ScriptedAI } }; -CreatureAI* GetAI_boss_herod(Creature *_Creature) +CreatureAI* GetAI_boss_herod(Creature* pCreature) { - return new boss_herodAI (_Creature); + return new boss_herodAI(pCreature); } -float Location[12][3]= -{ - {1945.81, -431.54, 16.36}, - {1946.21, -436.41, 16.36}, - {1950.01, -444.11, 14.63}, - {1956.08, -449.34, 13.12}, - {1966.59, -450.55, 11.27}, - {1976.09, -447.51, 11.27}, - {1983.42, -435.85, 11.27}, - {1978.17, -428.81, 11.27}, - {1973.97, -422.08, 9.04}, - {1963.84, -418.90, 6.17}, - {1961.22, -422.74, 6.17}, - {1964.80, -431.26, 6.17} -}; - -uint32 Wait[12][1]= -{ - {0},{0},{0},{0},{0},{0},{0},{0},{0},{0},{0},{600000} -}; - struct TRINITY_DLL_DECL mob_scarlet_traineeAI : public npc_escortAI { - mob_scarlet_traineeAI(Creature *c) : npc_escortAI(c) {} - - uint32 Start_Timer; - - void WaypointReached(uint32 i) { } - - void Reset() + mob_scarlet_traineeAI(Creature *c) : npc_escortAI(c) { - Start_Timer = urand(1500,4500); + Start_Timer = urand(1000,6000); } - void Aggro(Unit* who) { } + uint32 Start_Timer; + + void Reset() { } + void WaypointReached(uint32 uiPoint) { } + void EnterCombat(Unit* who) { } void UpdateAI(const uint32 diff) { @@ -161,14 +138,13 @@ struct TRINITY_DLL_DECL mob_scarlet_traineeAI : public npc_escortAI } }; -CreatureAI* GetAI_mob_scarlet_trainee(Creature* _Creature) +CreatureAI* GetAI_mob_scarlet_trainee(Creature* pCreature) { - mob_scarlet_traineeAI* thisAI = new mob_scarlet_traineeAI(_Creature); + mob_scarlet_traineeAI* thisAI = new mob_scarlet_traineeAI(pCreature); - for(uint32 i = 0; i < 12; ++i) - thisAI->AddWaypoint(i, Location[i][0], Location[i][1], Location[i][2], Wait[i][0]); + thisAI->FillPointMovementListForCreature(); - return ((CreatureAI*)thisAI); + return thisAI; } void AddSC_boss_herod() diff --git a/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_high_inquisitor_fairbanks.cpp b/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_high_inquisitor_fairbanks.cpp index b1c8bde0566..d477483b125 100644 --- a/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_high_inquisitor_fairbanks.cpp +++ b/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_high_inquisitor_fairbanks.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -55,7 +55,7 @@ struct TRINITY_DLL_DECL boss_high_inquisitor_fairbanksAI : public ScriptedAI MindBlast5_Timer = 20000; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } diff --git a/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_houndmaster_loksey.cpp b/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_houndmaster_loksey.cpp index 5dde65cb840..370ed9aedc8 100644 --- a/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_houndmaster_loksey.cpp +++ b/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_houndmaster_loksey.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>.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 @@ -23,11 +23,10 @@ EndScriptData */ #include "precompiled.h" -#define SPELL_SUMMONSCARLETHOUND 17164 -#define SPELL_ENRAGE 28747 +#define SAY_AGGRO -1189021 -#define SAY_AGGRO "Release the hounds!" -#define SOUND_AGGRO 5841 +#define SPELL_SUMMONSCARLETHOUND 17164 +#define SPELL_ENRAGE 6742 struct TRINITY_DLL_DECL boss_houndmaster_lokseyAI : public ScriptedAI { @@ -37,15 +36,12 @@ struct TRINITY_DLL_DECL boss_houndmaster_lokseyAI : public ScriptedAI void Reset() { - Enrage_Timer = 6000000; + Enrage_Timer = 0; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { - DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL); - DoPlaySoundToSet(m_creature,SOUND_AGGRO); - - DoCast(m_creature,SPELL_SUMMONSCARLETHOUND); + DoScriptText(SAY_AGGRO, m_creature); } void UpdateAI(const uint32 diff) @@ -53,16 +49,17 @@ struct TRINITY_DLL_DECL boss_houndmaster_lokseyAI : public ScriptedAI if (!UpdateVictim()) return; - //If we are <10% hp cast healing spells at self and Mograine - if ( m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 10 && !m_creature->IsNonMeleeSpellCasted(false) && Enrage_Timer < diff) + //If we are <25% hp, bloodlust + if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 25 && Enrage_Timer < diff) { DoCast(m_creature,SPELL_ENRAGE); - Enrage_Timer = 900000; + Enrage_Timer = 60000; }else Enrage_Timer -= diff; DoMeleeAttackIfReady(); } }; + CreatureAI* GetAI_boss_houndmaster_loksey(Creature *_Creature) { return new boss_houndmaster_lokseyAI (_Creature); diff --git a/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_interrogator_vishas.cpp b/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_interrogator_vishas.cpp index 1366897eb05..3db07afbfdd 100644 --- a/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_interrogator_vishas.cpp +++ b/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_interrogator_vishas.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>.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 @@ -22,36 +22,55 @@ SDCategory: Scarlet Monastery EndScriptData */ #include "precompiled.h" +#include "def_scarlet_monastery.h" -#define SPELL_POWERWORDSHIELD 6065 - -#define SAY_AGGRO "Tell me... tell me everything!" -#define SAY_HEALTH1 "Naughty secrets" -#define SAY_HEALTH2 "I'll rip the secrets from your flesh!" -#define SAY_DEATH "Purged by pain!" +enum +{ + SAY_AGGRO = -1189011, + SAY_HEALTH1 = -1189012, + SAY_HEALTH2 = -1189013, + SAY_KILL = -1189014, + SAY_TRIGGER_VORREL = -1189015, -#define SOUND_AGGRO 5847 -#define SOUND_HEALTH1 5849 -#define SOUND_HEALTH2 5850 -#define SOUND_DEATH 5848 + SPELL_SHADOWWORDPAIN = 2767, +}; struct TRINITY_DLL_DECL boss_interrogator_vishasAI : public ScriptedAI { - boss_interrogator_vishasAI(Creature *c) : ScriptedAI(c) {} + boss_interrogator_vishasAI(Creature *c) : ScriptedAI(c) + { + pInstance = m_creature->GetInstanceData(); + } + + ScriptedInstance* pInstance; - uint32 Yell_Timer; - uint32 PowerWordShield_Timer; + bool Yell30; + bool Yell60; + uint32 ShadowWordPain_Timer; void Reset() { - Yell_Timer = 6000000; - PowerWordShield_Timer = 60000; + ShadowWordPain_Timer = 5000; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { - DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL); - DoPlaySoundToSet(m_creature,SOUND_AGGRO); + DoScriptText(SAY_AGGRO, m_creature); + } + + void KilledUnit(Unit* Victim) + { + DoScriptText(SAY_KILL, m_creature); + } + + void JustDied(Unit* Killer) + { + if (!pInstance) + return; + + //Any other actions to do with vorrel? setStandState? + if (Unit *vorrel = Unit::GetUnit(*m_creature,pInstance->GetData64(DATA_VORREL))) + DoScriptText(SAY_TRIGGER_VORREL, vorrel); } void UpdateAI(const uint32 diff) @@ -60,44 +79,29 @@ struct TRINITY_DLL_DECL boss_interrogator_vishasAI : public ScriptedAI return; //If we are low on hp Do sayings - if ( m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 60 && !m_creature->IsNonMeleeSpellCasted(false)) + if (!Yell60 && ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() <= 60)) { - //Yell_Timer - if (Yell_Timer < diff) - { - DoYell(SAY_HEALTH1,LANG_UNIVERSAL,NULL); - DoPlaySoundToSet(m_creature,SOUND_HEALTH1); - return; - - //60 seconds until we should cast this agian - Yell_Timer = 60000; - }else Yell_Timer -= diff; + DoScriptText(SAY_HEALTH1, m_creature); + Yell60 = true; } - if ( m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 30 && !m_creature->IsNonMeleeSpellCasted(false)) + if (!Yell30 && ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() <= 30)) { - //Yell_Timer - if (Yell_Timer < diff) - { - DoYell(SAY_HEALTH2,LANG_UNIVERSAL,NULL); - DoPlaySoundToSet(m_creature,SOUND_HEALTH2); - return; - - //60 seconds until we should cast this agian - Yell_Timer = 6000000; - }else Yell_Timer -= diff; + DoScriptText(SAY_HEALTH2, m_creature); + Yell30 = true; } - //PowerWordShield_Timer - if (PowerWordShield_Timer < diff) + //ShadowWordPain_Timer + if (ShadowWordPain_Timer < diff) { - DoCast(m_creature,SPELL_POWERWORDSHIELD); - PowerWordShield_Timer = 60000; - }else PowerWordShield_Timer -= diff; + DoCast(m_creature->getVictim(),SPELL_SHADOWWORDPAIN); + ShadowWordPain_Timer = 5000 + rand()%10000;; + }else ShadowWordPain_Timer -= diff; DoMeleeAttackIfReady(); } }; + CreatureAI* GetAI_boss_interrogator_vishas(Creature *_Creature) { return new boss_interrogator_vishasAI (_Creature); diff --git a/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_mograine_and_whitemane.cpp b/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_mograine_and_whitemane.cpp index 6c2bd8a9be8..68bdcf9fa10 100644 --- a/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_mograine_and_whitemane.cpp +++ b/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_mograine_and_whitemane.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -46,7 +46,7 @@ struct TRINITY_DLL_DECL boss_scarlet_commander_mograineAI : public ScriptedAI { boss_scarlet_commander_mograineAI(Creature *c) : ScriptedAI(c) { - pInstance = (ScriptedInstance*)m_creature->GetInstanceData(); + pInstance = m_creature->GetInstanceData(); } ScriptedInstance* pInstance; @@ -70,7 +70,7 @@ struct TRINITY_DLL_DECL boss_scarlet_commander_mograineAI : public ScriptedAI BlessingOfProtection3_Timer = 45000; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { DoScriptText(SAY_MO_AGGRO, m_creature); DoCast(m_creature,SPELL_RETRIBUTIONAURA3); @@ -173,7 +173,7 @@ struct TRINITY_DLL_DECL boss_high_inquisitor_whitemaneAI : public ScriptedAI { boss_high_inquisitor_whitemaneAI(Creature *c) : ScriptedAI(c) { - pInstance = (ScriptedInstance*)m_creature->GetInstanceData(); + pInstance = m_creature->GetInstanceData(); } ScriptedInstance* pInstance; @@ -199,7 +199,7 @@ struct TRINITY_DLL_DECL boss_high_inquisitor_whitemaneAI : public ScriptedAI MindBlast6_Timer = 6000; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { DoScriptText(SAY_WH_INTRO, m_creature); } diff --git a/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_scorn.cpp b/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_scorn.cpp index 88cee632568..d4e2a1f5f69 100644 --- a/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_scorn.cpp +++ b/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_scorn.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -45,7 +45,7 @@ struct TRINITY_DLL_DECL boss_scornAI : public ScriptedAI FrostNova_Timer = 30000; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } diff --git a/src/bindings/scripts/scripts/zone/scarlet_monastery/def_scarlet_monastery.h b/src/bindings/scripts/scripts/zone/scarlet_monastery/def_scarlet_monastery.h index b8ab822129d..2b6399ae3e4 100644 --- a/src/bindings/scripts/scripts/zone/scarlet_monastery/def_scarlet_monastery.h +++ b/src/bindings/scripts/scripts/zone/scarlet_monastery/def_scarlet_monastery.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>.sourceforge.net/> * This program is free software licensed under GPL version 2 * Please see the included DOCS/LICENSE.TXT for more information */ @@ -10,7 +10,9 @@ #define DATA_WHITEMANE 3 #define DATA_DOOR_WHITEMANE 4 -#define DATA_HORSEMAN_EVENT 5 -#define GAMEOBJECT_PUMPKIN_SHRINE 6 +#define DATA_HORSEMAN_EVENT 5 +#define GAMEOBJECT_PUMPKIN_SHRINE 6 + +#define DATA_VORREL 7 #endif diff --git a/src/bindings/scripts/scripts/zone/scarlet_monastery/instance_scarlet_monastery.cpp b/src/bindings/scripts/scripts/zone/scarlet_monastery/instance_scarlet_monastery.cpp index 44152e6b4e0..4c1bd810388 100644 --- a/src/bindings/scripts/scripts/zone/scarlet_monastery/instance_scarlet_monastery.cpp +++ b/src/bindings/scripts/scripts/zone/scarlet_monastery/instance_scarlet_monastery.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>.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 @@ -43,6 +43,7 @@ struct TRINITY_DLL_DECL instance_scarlet_monastery : public ScriptedInstance uint64 MograineGUID; uint64 WhitemaneGUID; + uint64 VorrelGUID; uint64 DoorHighInquisitorGUID; uint32 Encounter[ENCOUNTERS]; @@ -56,6 +57,7 @@ struct TRINITY_DLL_DECL instance_scarlet_monastery : public ScriptedInstance MograineGUID = 0; WhitemaneGUID = 0; + VorrelGUID = 0; DoorHighInquisitorGUID = 0; for(uint8 i = 0; i < ENCOUNTERS; i++) @@ -80,6 +82,7 @@ struct TRINITY_DLL_DECL instance_scarlet_monastery : public ScriptedInstance case ENTRY_PUMPKIN: HorsemanAdds.insert(creature->GetGUID());break; case 3976: MograineGUID = creature->GetGUID(); break; case 3977: WhitemaneGUID = creature->GetGUID(); break; + case 3981: VorrelGUID = creature->GetGUID(); break; } } @@ -90,23 +93,23 @@ struct TRINITY_DLL_DECL instance_scarlet_monastery : public ScriptedInstance case TYPE_MOGRAINE_AND_WHITE_EVENT: Encounter[0] = data; break; case GAMEOBJECT_PUMPKIN_SHRINE: { - GameObject *Shrine = instance->GetGameObjectInMap(PumpkinShrineGUID); + GameObject *Shrine = instance->GetGameObject(PumpkinShrineGUID); if(Shrine) - Shrine->SetUInt32Value(GAMEOBJECT_STATE,1); + Shrine->SetGoState(GO_STATE_READY); }break; case DATA_HORSEMAN_EVENT: if (data == DONE) { for(std::set<uint64>::iterator itr = HorsemanAdds.begin(); itr != HorsemanAdds.end(); ++itr) { - Creature* add = instance->GetCreatureInMap(*itr); + Creature* add = instance->GetCreature(*itr); if(add && add->isAlive()) add->DealDamage(add, add->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); } HorsemanAdds.clear(); - GameObject *Shrine = instance->GetGameObjectInMap(PumpkinShrineGUID); + GameObject *Shrine = instance->GetGameObject(PumpkinShrineGUID); if(Shrine) - Shrine->SetUInt32Value(GAMEOBJECT_STATE,1); + Shrine->SetGoState(GO_STATE_READY); } break; } @@ -121,6 +124,7 @@ struct TRINITY_DLL_DECL instance_scarlet_monastery : public ScriptedInstance //case DATA_HEAD: return HeadGUID; case DATA_MOGRAINE: return MograineGUID; case DATA_WHITEMANE: return WhitemaneGUID; + case DATA_VORREL: return VorrelGUID; case DATA_DOOR_WHITEMANE: return DoorHighInquisitorGUID; } return 0; diff --git a/src/bindings/scripts/scripts/zone/scholomance/boss_darkmaster_gandling.cpp b/src/bindings/scripts/scripts/zone/scholomance/boss_darkmaster_gandling.cpp index 094b61a6c7e..a26a7652e74 100644 --- a/src/bindings/scripts/scripts/zone/scholomance/boss_darkmaster_gandling.cpp +++ b/src/bindings/scripts/scripts/zone/scholomance/boss_darkmaster_gandling.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -16,12 +16,13 @@ /* ScriptData SDName: Boss_Darkmaster_Gandling -SD%Complete: 99 +SD%Complete: 75 SDComment: Doors missing in instance script. SDCategory: Scholomance EndScriptData */ #include "precompiled.h" +#include "def_scholomance.h" #define SPELL_ARCANEMISSILES 22272 #define SPELL_SHADOWSHIELD 22417 //Not right ID. But 12040 is wrong either. @@ -49,12 +50,18 @@ EndScriptData */ struct TRINITY_DLL_DECL boss_darkmaster_gandlingAI : public ScriptedAI { - boss_darkmaster_gandlingAI(Creature *c) : ScriptedAI(c) {} + boss_darkmaster_gandlingAI(Creature *c) : ScriptedAI(c) + { + pInstance = m_creature->GetInstanceData(); + } + + ScriptedInstance* pInstance; uint32 ArcaneMissiles_Timer; uint32 ShadowShield_Timer; uint32 Curse_Timer; uint32 Teleport_Timer; + Creature *Summoned; void Reset() @@ -65,8 +72,14 @@ struct TRINITY_DLL_DECL boss_darkmaster_gandlingAI : public ScriptedAI Teleport_Timer = 16000; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) + { + } + + void JustDied(Unit *killer) { + if (pInstance) + pInstance->SetData(TYPE_GANDLING, DONE); } void UpdateAI(const uint32 diff) @@ -114,79 +127,79 @@ struct TRINITY_DLL_DECL boss_darkmaster_gandlingAI : public ScriptedAI DoTeleportPlayer(target, 250.0696,0.3921,84.8408,3.149); Summoned = m_creature->SummonCreature(16119,254.2325,0.3417,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); if(Summoned) - ((CreatureAI*)Summoned->AI())->AttackStart(target); + (Summoned->AI())->AttackStart(target); Summoned = m_creature->SummonCreature(16119,257.7133,4.0226,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); if(Summoned) - ((CreatureAI*)Summoned->AI())->AttackStart(target); + (Summoned->AI())->AttackStart(target); Summoned = m_creature->SummonCreature(16119,258.6702,-2.60656,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); if(Summoned) - ((CreatureAI*)Summoned->AI())->AttackStart(target); + (Summoned->AI())->AttackStart(target); break; case 1: DoTeleportPlayer(target, 181.4220,-91.9481,84.8410,1.608); Summoned = m_creature->SummonCreature(16119,184.0519,-73.5649,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); if(Summoned) - ((CreatureAI*)Summoned->AI())->AttackStart(target); + (Summoned->AI())->AttackStart(target); Summoned = m_creature->SummonCreature(16119,179.5951,-73.7045,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); if(Summoned) - ((CreatureAI*)Summoned->AI())->AttackStart(target); + (Summoned->AI())->AttackStart(target); Summoned = m_creature->SummonCreature(16119,180.6452,-78.2143,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); if(Summoned) - ((CreatureAI*)Summoned->AI())->AttackStart(target); + (Summoned->AI())->AttackStart(target); Summoned = m_creature->SummonCreature(16119,283.2274,-78.1518,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); if(Summoned) - ((CreatureAI*)Summoned->AI())->AttackStart(target); + (Summoned->AI())->AttackStart(target); break; case 2: DoTeleportPlayer(target, 95.1547,-1.8173,85.2289,0.043); Summoned = m_creature->SummonCreature(16119,100.9404,-1.8016,85.2289,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); if(Summoned) - ((CreatureAI*)Summoned->AI())->AttackStart(target); + (Summoned->AI())->AttackStart(target); Summoned = m_creature->SummonCreature(16119,101.3729,0.4882,85.2289,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); if(Summoned) - ((CreatureAI*)Summoned->AI())->AttackStart(target); + (Summoned->AI())->AttackStart(target); Summoned = m_creature->SummonCreature(16119,101.4596,-4.4740,85.2289,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); if(Summoned) - ((CreatureAI*)Summoned->AI())->AttackStart(target); + (Summoned->AI())->AttackStart(target); break; case 3: DoTeleportPlayer(target, 250.0696,0.3921,72.6722,3.149); Summoned = m_creature->SummonCreature(16119,240.34481,0.7368,72.6722,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); if(Summoned) - ((CreatureAI*)Summoned->AI())->AttackStart(target); + (Summoned->AI())->AttackStart(target); Summoned = m_creature->SummonCreature(16119,240.3633,-2.9520,72.6722,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); if(Summoned) - ((CreatureAI*)Summoned->AI())->AttackStart(target); + (Summoned->AI())->AttackStart(target); Summoned = m_creature->SummonCreature(16119,240.6702,3.34949,72.6722,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); if(Summoned) - ((CreatureAI*)Summoned->AI())->AttackStart(target); + (Summoned->AI())->AttackStart(target); break; case 4: DoTeleportPlayer(target, 181.4220,-91.9481,70.7734,1.608); Summoned = m_creature->SummonCreature(16119,184.0519,-73.5649,70.7734,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); if(Summoned) - ((CreatureAI*)Summoned->AI())->AttackStart(target); + (Summoned->AI())->AttackStart(target); Summoned = m_creature->SummonCreature(16119,179.5951,-73.7045,70.7734,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); if(Summoned) - ((CreatureAI*)Summoned->AI())->AttackStart(target); + (Summoned->AI())->AttackStart(target); Summoned = m_creature->SummonCreature(16119,180.6452,-78.2143,70.7734,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); if(Summoned) - ((CreatureAI*)Summoned->AI())->AttackStart(target); + (Summoned->AI())->AttackStart(target); Summoned = m_creature->SummonCreature(16119,283.2274,-78.1518,70.7734,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); if(Summoned) - ((CreatureAI*)Summoned->AI())->AttackStart(target); + (Summoned->AI())->AttackStart(target); break; case 5: DoTeleportPlayer(target, 106.1541,-1.8994,75.3663,0.043); Summoned = m_creature->SummonCreature(16119,115.3945,-1.5555,75.3663,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); if(Summoned) - ((CreatureAI*)Summoned->AI())->AttackStart(target); + (Summoned->AI())->AttackStart(target); Summoned = m_creature->SummonCreature(16119,257.7133,1.8066,75.3663,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); if(Summoned) - ((CreatureAI*)Summoned->AI())->AttackStart(target); + (Summoned->AI())->AttackStart(target); Summoned = m_creature->SummonCreature(16119,258.6702,-5.1001,75.3663,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); if(Summoned) - ((CreatureAI*)Summoned->AI())->AttackStart(target); + (Summoned->AI())->AttackStart(target); break; } } diff --git a/src/bindings/scripts/scripts/zone/scholomance/boss_death_knight_darkreaver.cpp b/src/bindings/scripts/scripts/zone/scholomance/boss_death_knight_darkreaver.cpp index 2e0eb4e09e2..5840b782575 100644 --- a/src/bindings/scripts/scripts/zone/scholomance/boss_death_knight_darkreaver.cpp +++ b/src/bindings/scripts/scripts/zone/scholomance/boss_death_knight_darkreaver.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -39,7 +39,7 @@ struct TRINITY_DLL_DECL boss_death_knight_darkreaverAI : public ScriptedAI } } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } }; diff --git a/src/bindings/scripts/scripts/zone/scholomance/boss_doctor_theolen_krastinov.cpp b/src/bindings/scripts/scripts/zone/scholomance/boss_doctor_theolen_krastinov.cpp index 001c67c26b8..f8676fc3c8b 100644 --- a/src/bindings/scripts/scripts/zone/scholomance/boss_doctor_theolen_krastinov.cpp +++ b/src/bindings/scripts/scripts/zone/scholomance/boss_doctor_theolen_krastinov.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>.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 @@ -24,6 +24,8 @@ EndScriptData */ #include "precompiled.h" #include "def_scholomance.h" +#define EMOTE_GENERIC_FRENZY_KILL -1000001 + #define SPELL_REND 18106 #define SPELL_CLEAVE 15584 #define SPELL_FRENZY 28371 @@ -45,17 +47,17 @@ struct TRINITY_DLL_DECL boss_theolenkrastinovAI : public ScriptedAI void JustDied(Unit *killer) { - ScriptedInstance *pInstance = (m_creature->GetInstanceData()) ? ((ScriptedInstance*)m_creature->GetInstanceData()) : NULL; + ScriptedInstance *pInstance = (m_creature->GetInstanceData()) ? (m_creature->GetInstanceData()) : NULL; if(pInstance) { pInstance->SetData(DATA_DOCTORTHEOLENKRASTINOV_DEATH, 0); - if(pInstance->GetData(DATA_CANSPAWNGANDLING)) + if (pInstance->GetData(TYPE_GANDLING) == IN_PROGRESS) m_creature->SummonCreature(1853, 180.73, -9.43856, 75.507, 1.61399, TEMPSUMMON_DEAD_DESPAWN, 0); } } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } @@ -84,7 +86,7 @@ struct TRINITY_DLL_DECL boss_theolenkrastinovAI : public ScriptedAI if (Frenzy_Timer < diff) { DoCast(m_creature,SPELL_FRENZY); - DoTextEmote("goes into a killing frenzy!",NULL); + DoScriptText(EMOTE_GENERIC_FRENZY_KILL, m_creature); Frenzy_Timer = 8000; }else Frenzy_Timer -= diff; diff --git a/src/bindings/scripts/scripts/zone/scholomance/boss_illucia_barov.cpp b/src/bindings/scripts/scripts/zone/scholomance/boss_illucia_barov.cpp index 6eb5e1ec249..39b16785e43 100644 --- a/src/bindings/scripts/scripts/zone/scholomance/boss_illucia_barov.cpp +++ b/src/bindings/scripts/scripts/zone/scholomance/boss_illucia_barov.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -48,17 +48,17 @@ struct TRINITY_DLL_DECL boss_illuciabarovAI : public ScriptedAI void JustDied(Unit *killer) { - ScriptedInstance *pInstance = (m_creature->GetInstanceData()) ? ((ScriptedInstance*)m_creature->GetInstanceData()) : NULL; + ScriptedInstance *pInstance = (m_creature->GetInstanceData()) ? (m_creature->GetInstanceData()) : NULL; if(pInstance) { pInstance->SetData(DATA_LADYILLUCIABAROV_DEATH, 0); - if(pInstance->GetData(DATA_CANSPAWNGANDLING)) + if (pInstance->GetData(TYPE_GANDLING) == IN_PROGRESS) m_creature->SummonCreature(1853, 180.73, -9.43856, 75.507, 1.61399, TEMPSUMMON_DEAD_DESPAWN, 0); } } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } diff --git a/src/bindings/scripts/scripts/zone/scholomance/boss_instructor_malicia.cpp b/src/bindings/scripts/scripts/zone/scholomance/boss_instructor_malicia.cpp index 4ba2811dc52..db070857f0d 100644 --- a/src/bindings/scripts/scripts/zone/scholomance/boss_instructor_malicia.cpp +++ b/src/bindings/scripts/scripts/zone/scholomance/boss_instructor_malicia.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -55,17 +55,17 @@ struct TRINITY_DLL_DECL boss_instructormaliciaAI : public ScriptedAI void JustDied(Unit *killer) { - ScriptedInstance *pInstance = (m_creature->GetInstanceData()) ? ((ScriptedInstance*)m_creature->GetInstanceData()) : NULL; + ScriptedInstance *pInstance = (m_creature->GetInstanceData()) ? (m_creature->GetInstanceData()) : NULL; if(pInstance) { pInstance->SetData(DATA_INSTRUCTORMALICIA_DEATH, 0); - if(pInstance->GetData(DATA_CANSPAWNGANDLING)) + if (pInstance->GetData(TYPE_GANDLING) == IN_PROGRESS) m_creature->SummonCreature(1853, 180.73, -9.43856, 75.507, 1.61399, TEMPSUMMON_DEAD_DESPAWN, 0); } } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } diff --git a/src/bindings/scripts/scripts/zone/scholomance/boss_jandice_barov.cpp b/src/bindings/scripts/scripts/zone/scholomance/boss_jandice_barov.cpp index c8f7cfcac0a..faa7efa53a5 100644 --- a/src/bindings/scripts/scripts/zone/scholomance/boss_jandice_barov.cpp +++ b/src/bindings/scripts/scripts/zone/scholomance/boss_jandice_barov.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -51,7 +51,7 @@ struct TRINITY_DLL_DECL boss_jandicebarovAI : public ScriptedAI Invisible = false; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } @@ -73,7 +73,7 @@ struct TRINITY_DLL_DECL boss_jandicebarovAI : public ScriptedAI Rand = 0; Summoned = DoSpawnCreature(11439, RandX, RandY, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000); if(Summoned) - ((CreatureAI*)Summoned->AI())->AttackStart(victim); + (Summoned->AI())->AttackStart(victim); } void UpdateAI(const uint32 diff) @@ -171,7 +171,7 @@ struct TRINITY_DLL_DECL mob_illusionofjandicebarovAI : public ScriptedAI m_creature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_MAGIC, true); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } diff --git a/src/bindings/scripts/scripts/zone/scholomance/boss_kormok.cpp b/src/bindings/scripts/scripts/zone/scholomance/boss_kormok.cpp index b9e0254b8bc..966fd3bf6ec 100644 --- a/src/bindings/scripts/scripts/zone/scholomance/boss_kormok.cpp +++ b/src/bindings/scripts/scripts/zone/scholomance/boss_kormok.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -53,7 +53,7 @@ struct TRINITY_DLL_DECL boss_kormokAI : public ScriptedAI Mages = false; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } @@ -75,7 +75,7 @@ struct TRINITY_DLL_DECL boss_kormokAI : public ScriptedAI Rand1 = 0; SummonedMinions = DoSpawnCreature(16119, Rand1X, Rand1Y, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 120000); if(SummonedMinions) - ((CreatureAI*)SummonedMinions->AI())->AttackStart(victim); + (SummonedMinions->AI())->AttackStart(victim); } void SummonMages(Unit* victim) @@ -96,7 +96,7 @@ struct TRINITY_DLL_DECL boss_kormokAI : public ScriptedAI Rand2 = 0; SummonedMages = DoSpawnCreature(16120, Rand2X, Rand2Y, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 120000); if(SummonedMages) - ((CreatureAI*)SummonedMages->AI())->AttackStart(victim); + (SummonedMages->AI())->AttackStart(victim); } void UpdateAI(const uint32 diff) diff --git a/src/bindings/scripts/scripts/zone/scholomance/boss_lord_alexei_barov.cpp b/src/bindings/scripts/scripts/zone/scholomance/boss_lord_alexei_barov.cpp index 195e5b048b4..ffaf56f1c45 100644 --- a/src/bindings/scripts/scripts/zone/scholomance/boss_lord_alexei_barov.cpp +++ b/src/bindings/scripts/scripts/zone/scholomance/boss_lord_alexei_barov.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -44,17 +44,17 @@ struct TRINITY_DLL_DECL boss_lordalexeibarovAI : public ScriptedAI void JustDied(Unit *killer) { - ScriptedInstance *pInstance = (m_creature->GetInstanceData()) ? ((ScriptedInstance*)m_creature->GetInstanceData()) : NULL; + ScriptedInstance *pInstance = (m_creature->GetInstanceData()) ? (m_creature->GetInstanceData()) : NULL; if(pInstance) { pInstance->SetData(DATA_LORDALEXEIBAROV_DEATH, 0); - if(pInstance->GetData(DATA_CANSPAWNGANDLING)) + if (pInstance->GetData(TYPE_GANDLING) == IN_PROGRESS) m_creature->SummonCreature(1853, 180.73, -9.43856, 75.507, 1.61399, TEMPSUMMON_DEAD_DESPAWN, 0); } } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } diff --git a/src/bindings/scripts/scripts/zone/scholomance/boss_lorekeeper_polkelt.cpp b/src/bindings/scripts/scripts/zone/scholomance/boss_lorekeeper_polkelt.cpp index 728ad07e838..1afa0c91fa6 100644 --- a/src/bindings/scripts/scripts/zone/scholomance/boss_lorekeeper_polkelt.cpp +++ b/src/bindings/scripts/scripts/zone/scholomance/boss_lorekeeper_polkelt.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -48,17 +48,17 @@ struct TRINITY_DLL_DECL boss_lorekeeperpolkeltAI : public ScriptedAI void JustDied(Unit *killer) { - ScriptedInstance *pInstance = (m_creature->GetInstanceData()) ? ((ScriptedInstance*)m_creature->GetInstanceData()) : NULL; + ScriptedInstance *pInstance = (m_creature->GetInstanceData()) ? (m_creature->GetInstanceData()) : NULL; if(pInstance) { pInstance->SetData(DATA_LOREKEEPERPOLKELT_DEATH, 0); - if(pInstance->GetData(DATA_CANSPAWNGANDLING)) + if (pInstance->GetData(TYPE_GANDLING) == IN_PROGRESS) m_creature->SummonCreature(1853, 180.73, -9.43856, 75.507, 1.61399, TEMPSUMMON_DEAD_DESPAWN, 0); } } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } diff --git a/src/bindings/scripts/scripts/zone/scholomance/boss_ras_frostwhisper.cpp b/src/bindings/scripts/scripts/zone/scholomance/boss_ras_frostwhisper.cpp index 154da52596a..9c0c8e29ff4 100644 --- a/src/bindings/scripts/scripts/zone/scholomance/boss_ras_frostwhisper.cpp +++ b/src/bindings/scripts/scripts/zone/scholomance/boss_ras_frostwhisper.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -53,7 +53,7 @@ struct TRINITY_DLL_DECL boss_rasfrostAI : public ScriptedAI m_creature->CastSpell(m_creature,SPELL_ICEARMOR,true); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } diff --git a/src/bindings/scripts/scripts/zone/scholomance/boss_the_ravenian.cpp b/src/bindings/scripts/scripts/zone/scholomance/boss_the_ravenian.cpp index 95ebafb092a..6be34592529 100644 --- a/src/bindings/scripts/scripts/zone/scholomance/boss_the_ravenian.cpp +++ b/src/bindings/scripts/scripts/zone/scholomance/boss_the_ravenian.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -29,8 +29,6 @@ EndScriptData */ #define SPELL_SUNDERINCLEAVE 25174 #define SPELL_KNOCKAWAY 10101 -#define SAY_AGGRO1 "Mine! Mine! Mine! Gizlock is the ruler of this domain! You shall never reveal my presence!" - struct TRINITY_DLL_DECL boss_theravenianAI : public ScriptedAI { boss_theravenianAI(Creature *c) : ScriptedAI(c) {} @@ -52,19 +50,18 @@ struct TRINITY_DLL_DECL boss_theravenianAI : public ScriptedAI void JustDied(Unit *killer) { - ScriptedInstance *pInstance = (m_creature->GetInstanceData()) ? ((ScriptedInstance*)m_creature->GetInstanceData()) : NULL; + ScriptedInstance *pInstance = (m_creature->GetInstanceData()) ? (m_creature->GetInstanceData()) : NULL; if(pInstance) { pInstance->SetData(DATA_THERAVENIAN_DEATH, 0); - if(pInstance->GetData(DATA_CANSPAWNGANDLING)) + if (pInstance->GetData(TYPE_GANDLING) == IN_PROGRESS) m_creature->SummonCreature(1853, 180.73, -9.43856, 75.507, 1.61399, TEMPSUMMON_DEAD_DESPAWN, 0); } } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { - DoYell(SAY_AGGRO1, LANG_UNIVERSAL, NULL); } void UpdateAI(const uint32 diff) @@ -103,6 +100,7 @@ struct TRINITY_DLL_DECL boss_theravenianAI : public ScriptedAI DoMeleeAttackIfReady(); } }; + CreatureAI* GetAI_boss_theravenian(Creature *_Creature) { return new boss_theravenianAI (_Creature); diff --git a/src/bindings/scripts/scripts/zone/scholomance/boss_vectus.cpp b/src/bindings/scripts/scripts/zone/scholomance/boss_vectus.cpp index 280e0d194d7..55a50724294 100644 --- a/src/bindings/scripts/scripts/zone/scholomance/boss_vectus.cpp +++ b/src/bindings/scripts/scripts/zone/scholomance/boss_vectus.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -23,6 +23,8 @@ EndScriptData */ #include "precompiled.h" +#define EMOTE_GENERIC_FRENZY_KILL -1000001 + #define SPELL_FIRESHIELD 19626 #define SPELL_BLASTWAVE 13021 #define SPELL_FRENZY 28371 @@ -42,7 +44,7 @@ struct TRINITY_DLL_DECL boss_vectusAI : public ScriptedAI Frenzy_Timer = 0; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } @@ -71,7 +73,7 @@ struct TRINITY_DLL_DECL boss_vectusAI : public ScriptedAI if (Frenzy_Timer < diff) { DoCast(m_creature,SPELL_FRENZY); - DoTextEmote("goes into a killing frenzy!",NULL); + DoScriptText(EMOTE_GENERIC_FRENZY_KILL, m_creature); Frenzy_Timer = 24000; }else Frenzy_Timer -= diff; diff --git a/src/bindings/scripts/scripts/zone/scholomance/def_scholomance.h b/src/bindings/scripts/scripts/zone/scholomance/def_scholomance.h index 0216a48fc74..83ce26c9687 100644 --- a/src/bindings/scripts/scripts/zone/scholomance/def_scholomance.h +++ b/src/bindings/scripts/scripts/zone/scholomance/def_scholomance.h @@ -1,16 +1,17 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * This program is free software licensed under GPL version 2 * Please see the included DOCS/LICENSE.TXT for more information */ #ifndef DEF_SCHOLOMANCE_H #define DEF_SCHOLOMANCE_H -#define DATA_CANSPAWNGANDLING 1 +#define TYPE_GANDLING 1 #define DATA_DOCTORTHEOLENKRASTINOV_DEATH 2 #define DATA_INSTRUCTORMALICIA_DEATH 3 #define DATA_LADYILLUCIABAROV_DEATH 4 #define DATA_LORDALEXEIBAROV_DEATH 5 #define DATA_LOREKEEPERPOLKELT_DEATH 6 #define DATA_THERAVENIAN_DEATH 7 +#define TYPE_KIRTONOS 8 #endif diff --git a/src/bindings/scripts/scripts/zone/scholomance/instance_scholomance.cpp b/src/bindings/scripts/scripts/zone/scholomance/instance_scholomance.cpp index 74b90dfdf53..d99546fbcea 100644 --- a/src/bindings/scripts/scripts/zone/scholomance/instance_scholomance.cpp +++ b/src/bindings/scripts/scripts/zone/scholomance/instance_scholomance.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -24,36 +24,65 @@ EndScriptData */ #include "precompiled.h" #include "def_scholomance.h" +#define GO_GATE_KIRTONOS 175570 +#define GO_GATE_GANDLING 177374 +#define GO_GATE_MALICIA 177375 +#define GO_GATE_THEOLEN 177377 +#define GO_GATE_POLKELT 177376 +#define GO_GATE_RAVENIAN 177372 +#define GO_GATE_BAROV 177373 +#define GO_GATE_ILLUCIA 177371 + +#define ENCOUNTERS 2 + struct TRINITY_DLL_DECL instance_scholomance : public ScriptedInstance { instance_scholomance(Map *map) : ScriptedInstance(map) {Initialize();}; //Lord Alexei Barov, Doctor Theolen Krastinov, The Ravenian, Lorekeeper Polkelt, Instructor Malicia and the Lady Illucia Barov. bool IsBossDied[6]; + uint32 Encounter[ENCOUNTERS]; - void Initialize() - { - IsBossDied[0] = false; - IsBossDied[1] = false; - IsBossDied[2] = false; - IsBossDied[3] = false; - IsBossDied[4] = false; - IsBossDied[5] = false; - } + uint64 GateKirtonosGUID; + uint64 GateGandlingGUID; + uint64 GateMiliciaGUID; + uint64 GateTheolenGUID; + uint64 GatePolkeltGUID; + uint64 GateRavenianGUID; + uint64 GateBarovGUID; + uint64 GateIlluciaGUID; - bool IsEncounterInProgress() const + void Initialize() { - //not active in scholomance - return false; + GateKirtonosGUID = 0; + GateGandlingGUID = 0; + GateMiliciaGUID = 0; + GateTheolenGUID = 0; + GatePolkeltGUID = 0; + GateRavenianGUID = 0; + GateBarovGUID = 0; + GateIlluciaGUID = 0; + + for(uint8 i = 0; i < 6; i++) + IsBossDied[i] = false; + + for(uint8 i = 0; i < ENCOUNTERS; i++) + Encounter[i] = NOT_STARTED; } - uint32 GetData(uint32 type) + void OnObjectCreate(GameObject *go) { - if(type == DATA_CANSPAWNGANDLING) - if(IsBossDied[0] && IsBossDied[1] && IsBossDied[2] && IsBossDied[3] && IsBossDied[4] && IsBossDied[5]) - return 1; - - return 0; + switch(go->GetEntry()) + { + case GO_GATE_KIRTONOS: GateKirtonosGUID = go->GetGUID(); break; + case GO_GATE_GANDLING: GateGandlingGUID = go->GetGUID(); break; + case GO_GATE_MALICIA: GateMiliciaGUID = go->GetGUID(); break; + case GO_GATE_THEOLEN: GateTheolenGUID = go->GetGUID(); break; + case GO_GATE_POLKELT: GatePolkeltGUID = go->GetGUID(); break; + case GO_GATE_RAVENIAN: GateRavenianGUID = go->GetGUID(); break; + case GO_GATE_BAROV: GateBarovGUID = go->GetGUID(); break; + case GO_GATE_ILLUCIA: GateIlluciaGUID = go->GetGUID(); break; + } } void SetData(uint32 type, uint32 data) @@ -63,28 +92,43 @@ struct TRINITY_DLL_DECL instance_scholomance : public ScriptedInstance case DATA_LORDALEXEIBAROV_DEATH: IsBossDied[0] = true; break; - case DATA_DOCTORTHEOLENKRASTINOV_DEATH: IsBossDied[1] = true; break; - case DATA_THERAVENIAN_DEATH: IsBossDied[2] = true; break; - case DATA_LOREKEEPERPOLKELT_DEATH: IsBossDied[3] = true; break; - case DATA_INSTRUCTORMALICIA_DEATH: IsBossDied[4] = true; break; - case DATA_LADYILLUCIABAROV_DEATH: IsBossDied[5] = true; break; + case TYPE_GANDLING: + Encounter[0] = data; + break; + case TYPE_KIRTONOS: + Encounter[1] = data; + break; } } + + uint32 GetData(uint32 type) + { + if (type == TYPE_GANDLING) + { + if (IsBossDied[0] && IsBossDied[1] && IsBossDied[2] && IsBossDied[3] && IsBossDied[4] && IsBossDied[5]) + { + Encounter[0] = IN_PROGRESS; + return IN_PROGRESS; + } + } + + return 0; + } }; InstanceData* GetInstanceData_instance_scholomance(Map* map) diff --git a/src/bindings/scripts/scripts/zone/searing_gorge/searing_gorge.cpp b/src/bindings/scripts/scripts/zone/searing_gorge/searing_gorge.cpp index fff417bcf21..4d55b5d91fd 100644 --- a/src/bindings/scripts/scripts/zone/searing_gorge/searing_gorge.cpp +++ b/src/bindings/scripts/scripts/zone/searing_gorge/searing_gorge.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 diff --git a/src/bindings/scripts/scripts/zone/shadowfang_keep/def_shadowfang_keep.h b/src/bindings/scripts/scripts/zone/shadowfang_keep/def_shadowfang_keep.h index 1612bfd59f0..8383a5c3950 100644 --- a/src/bindings/scripts/scripts/zone/shadowfang_keep/def_shadowfang_keep.h +++ b/src/bindings/scripts/scripts/zone/shadowfang_keep/def_shadowfang_keep.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * This program is free software licensed under GPL version 2 * Please see the included DOCS/LICENSE.TXT for more information */ diff --git a/src/bindings/scripts/scripts/zone/shadowfang_keep/instance_shadowfang_keep.cpp b/src/bindings/scripts/scripts/zone/shadowfang_keep/instance_shadowfang_keep.cpp index 967cff5c769..fc8970c6f8a 100644 --- a/src/bindings/scripts/scripts/zone/shadowfang_keep/instance_shadowfang_keep.cpp +++ b/src/bindings/scripts/scripts/zone/shadowfang_keep/instance_shadowfang_keep.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -16,8 +16,8 @@ /* ScriptData SDName: Instance_Shadowfang_Keep -SD%Complete: 75 -SDComment: TODO: check what other parts would require additional code (ex: make sure door are in open state if boss dead) +SD%Complete: 90 +SDComment: SDCategory: Shadowfang Keep EndScriptData */ @@ -26,6 +26,19 @@ EndScriptData */ #define ENCOUNTERS 4 +enum +{ + SAY_BOSS_DIE_AD = -1033007, + SAY_BOSS_DIE_AS = -1033008, + + NPC_ASH = 3850, + NPC_ADA = 3849, + + GO_COURTYARD_DOOR = 18895, //door to open when talking to NPC's + GO_SORCERER_DOOR = 18972, //door to open when Fenrus the Devourer + GO_ARUGAL_DOOR = 18971 //door to open when Wolf Master Nandos +}; + struct TRINITY_DLL_DECL instance_shadowfang_keep : public ScriptedInstance { instance_shadowfang_keep(Map *map) : ScriptedInstance(map) {Initialize();}; @@ -33,12 +46,18 @@ struct TRINITY_DLL_DECL instance_shadowfang_keep : public ScriptedInstance uint32 Encounter[ENCOUNTERS]; std::string str_data; + uint64 uiAshGUID; + uint64 uiAdaGUID; + uint64 DoorCourtyardGUID; uint64 DoorSorcererGUID; uint64 DoorArugalGUID; void Initialize() { + uiAshGUID = 0; + uiAdaGUID = 0; + DoorCourtyardGUID = 0; DoorSorcererGUID = 0; DoorArugalGUID = 0; @@ -63,28 +82,52 @@ struct TRINITY_DLL_DECL instance_shadowfang_keep : public ScriptedInstance return NULL; } + void OnCreatureCreate(Creature* pCreature, uint32 uiCreature) + { + switch(pCreature->GetEntry()) + { + case NPC_ASH: uiAshGUID = pCreature->GetGUID(); break; + case NPC_ADA: uiAdaGUID = pCreature->GetGUID(); break; + } + } + void OnObjectCreate(GameObject *go) { switch(go->GetEntry()) { - case 18895: DoorCourtyardGUID = go->GetGUID(); break; - case 18972: DoorSorcererGUID = go->GetGUID(); break; - case 18971: DoorArugalGUID = go->GetGUID(); break; + case GO_COURTYARD_DOOR: + DoorCourtyardGUID = go->GetGUID(); + if (Encounter[0] == DONE) + go->SetGoState(GO_STATE_ACTIVE); + break; + case GO_SORCERER_DOOR: + DoorSorcererGUID = go->GetGUID(); + if (Encounter[2] == DONE) + go->SetGoState(GO_STATE_ACTIVE); + break; + case GO_ARUGAL_DOOR: + DoorArugalGUID = go->GetGUID(); + if (Encounter[3] == DONE) + go->SetGoState(GO_STATE_ACTIVE); + break; } } - void HandleGameObject(uint64 guid, uint32 state) + void DoSpeech() { - Player *player = GetPlayerInMap(); + Player* pPlayer = GetPlayerInMap(); - if (!player || !guid) + if (pPlayer) { - debug_log("TSCR: Instance Shadowfang Keep: HandleGameObject fail"); - return; - } + Unit* pAda = Unit::GetUnit(*pPlayer,uiAdaGUID); + Unit* pAsh = Unit::GetUnit(*pPlayer,uiAshGUID); - if (GameObject *go = GameObject::GetGameObject(*player,guid)) - go->SetGoState(state); + if (pAda && pAda->isAlive() && pAsh && pAsh->isAlive()) + { + DoScriptText(SAY_BOSS_DIE_AD,pAda); + DoScriptText(SAY_BOSS_DIE_AS,pAsh); + } + } } void SetData(uint32 type, uint32 data) @@ -97,6 +140,8 @@ struct TRINITY_DLL_DECL instance_shadowfang_keep : public ScriptedInstance Encounter[0] = data; break; case TYPE_RETHILGORE: + if (data == DONE) + DoSpeech(); Encounter[1] = data; break; case TYPE_FENRUS: @@ -141,7 +186,7 @@ struct TRINITY_DLL_DECL instance_shadowfang_keep : public ScriptedInstance return 0; } - const char* Save() + std::string GetSaveData() { return str_data.c_str(); } @@ -160,8 +205,10 @@ struct TRINITY_DLL_DECL instance_shadowfang_keep : public ScriptedInstance loadStream >> Encounter[0] >> Encounter[1] >> Encounter[2] >> Encounter[3]; for(uint8 i = 0; i < ENCOUNTERS; ++i) + { if (Encounter[i] == IN_PROGRESS) Encounter[i] = NOT_STARTED; + } OUT_LOAD_INST_DATA_COMPLETE; } diff --git a/src/bindings/scripts/scripts/zone/shadowfang_keep/shadowfang_keep.cpp b/src/bindings/scripts/scripts/zone/shadowfang_keep/shadowfang_keep.cpp index a4f04f83ffd..bf7c122d452 100644 --- a/src/bindings/scripts/scripts/zone/shadowfang_keep/shadowfang_keep.cpp +++ b/src/bindings/scripts/scripts/zone/shadowfang_keep/shadowfang_keep.cpp @@ -1,4 +1,4 @@ - /* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> + /* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -33,88 +33,110 @@ EndContentData */ ## npc_shadowfang_prisoner ######*/ -#define SAY_FREE -1033000 +enum +{ + SAY_FREE_AS = -1033000, + SAY_OPEN_DOOR_AS = -1033001, + SAY_POST_DOOR_AS = -1033002, + SAY_FREE_AD = -1033003, + SAY_OPEN_DOOR_AD = -1033004, + SAY_POST1_DOOR_AD = -1033005, + SAY_POST2_DOOR_AD = -1033006, + + SPELL_UNLOCK = 6421, + NPC_ASH = 3850 +}; + #define GOSSIP_ITEM_DOOR "Thanks, I'll follow you to the door." struct TRINITY_DLL_DECL npc_shadowfang_prisonerAI : public npc_escortAI { npc_shadowfang_prisonerAI(Creature *c) : npc_escortAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); + uiNpcEntry = c->GetEntry(); } ScriptedInstance *pInstance; + uint32 uiNpcEntry; - void WaypointReached(uint32 i) + void WaypointReached(uint32 uiPoint) { - if( pInstance && i == 6) + switch(uiPoint) { - m_creature->HandleEmoteCommand(EMOTE_ONESHOT_TALK); - DoScriptText(SAY_FREE, m_creature); - pInstance->SetData(TYPE_FREE_NPC, DONE); + case 0: + if (uiNpcEntry == NPC_ASH) + DoScriptText(SAY_FREE_AS, m_creature); + else + DoScriptText(SAY_FREE_AD, m_creature); + break; + case 10: + if (uiNpcEntry == NPC_ASH) + DoScriptText(SAY_OPEN_DOOR_AS, m_creature); + else + DoScriptText(SAY_OPEN_DOOR_AD, m_creature); + break; + case 11: + if (uiNpcEntry == NPC_ASH) + DoCast(m_creature, SPELL_UNLOCK); + break; + case 12: + if (uiNpcEntry == NPC_ASH) + DoScriptText(SAY_POST_DOOR_AS, m_creature); + else + DoScriptText(SAY_POST1_DOOR_AD, m_creature); + + if (pInstance) + pInstance->SetData(TYPE_FREE_NPC, DONE); + break; + case 13: + if (uiNpcEntry != NPC_ASH) + DoScriptText(SAY_POST2_DOOR_AD, m_creature); + break; } } void Reset() {} - void Aggro(Unit* who) {} + void EnterCombat(Unit* who) {} }; -CreatureAI* GetAI_npc_shadowfang_prisoner(Creature *_Creature) +CreatureAI* GetAI_npc_shadowfang_prisoner(Creature* pCreature) { - npc_shadowfang_prisonerAI* prisonerAI = new npc_shadowfang_prisonerAI(_Creature); - - uint32 eCreature = _Creature->GetEntry(); - - if( eCreature==3849) //adamant - prisonerAI->AddWaypoint(0, -254.47, 2117.48, 81.17); - if( eCreature==3850) //ashcrombe - prisonerAI->AddWaypoint(0, -252.35, 2126.71, 81.17); + npc_shadowfang_prisonerAI* prisonerAI = new npc_shadowfang_prisonerAI(pCreature); - prisonerAI->AddWaypoint(1, -253.63, 2131.27, 81.28); - prisonerAI->AddWaypoint(2, -249.66, 2142.45, 87.01); - prisonerAI->AddWaypoint(3, -248.08, 2143.68, 87.01); - prisonerAI->AddWaypoint(4, -238.87, 2139.93, 87.01); - prisonerAI->AddWaypoint(5, -235.47, 2149.18, 90.59); - prisonerAI->AddWaypoint(6, -239.89, 2156.06, 90.62, 20000); + prisonerAI->FillPointMovementListForCreature(); - return (CreatureAI*)prisonerAI; + return prisonerAI; } -bool GossipHello_npc_shadowfang_prisoner(Player *player, Creature *_Creature) +bool GossipHello_npc_shadowfang_prisoner(Player* pPlayer, Creature* pCreature) { - ScriptedInstance* pInstance = ((ScriptedInstance*)_Creature->GetInstanceData()); + ScriptedInstance* pInstance = (pCreature->GetInstanceData()); - if (!pInstance) - return false; - - if (pInstance->GetData(TYPE_FREE_NPC) != DONE && pInstance->GetData(TYPE_RETHILGORE) == DONE) - player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_DOOR, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - - player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID()); + if (pInstance && pInstance->GetData(TYPE_FREE_NPC) != DONE && pInstance->GetData(TYPE_RETHILGORE) == DONE) + pPlayer->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_DOOR, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); return true; } -bool GossipSelect_npc_shadowfang_prisoner(Player *player, Creature *_Creature, uint32 sender, uint32 action) +bool GossipSelect_npc_shadowfang_prisoner(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) { - if (action == GOSSIP_ACTION_INFO_DEF+1) + if (uiAction == GOSSIP_ACTION_INFO_DEF+1) { - player->CLOSE_GOSSIP_MENU(); - ((npc_escortAI*)(_Creature->AI()))->Start(false, false, false); + pPlayer->CLOSE_GOSSIP_MENU(); + CAST_AI(npc_escortAI, (pCreature->AI()))->Start(false, true, false); } return true; } -/*###### -## AddSC -######*/ - void AddSC_shadowfang_keep() { Script *newscript; newscript = new Script; - newscript->Name="npc_shadowfang_prisoner"; + newscript->Name = "npc_shadowfang_prisoner"; newscript->pGossipHello = &GossipHello_npc_shadowfang_prisoner; newscript->pGossipSelect = &GossipSelect_npc_shadowfang_prisoner; newscript->GetAI = &GetAI_npc_shadowfang_prisoner; diff --git a/src/bindings/scripts/scripts/zone/shadowmoon_valley/boss_doomwalker.cpp b/src/bindings/scripts/scripts/zone/shadowmoon_valley/boss_doomwalker.cpp index 014d7fe1153..f46476df98a 100644 --- a/src/bindings/scripts/scripts/zone/shadowmoon_valley/boss_doomwalker.cpp +++ b/src/bindings/scripts/scripts/zone/shadowmoon_valley/boss_doomwalker.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -83,7 +83,7 @@ struct TRINITY_DLL_DECL boss_doomwalkerAI : public ScriptedAI DoScriptText(SAY_DEATH, m_creature); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { DoScriptText(SAY_AGGRO, m_creature); } @@ -131,7 +131,7 @@ struct TRINITY_DLL_DECL boss_doomwalkerAI : public ScriptedAI //remove enrage before casting earthquake because enrage + earthquake = 16000dmg over 8sec and all dead if (InEnrage) - m_creature->RemoveAura(SPELL_ENRAGE, 0); + m_creature->RemoveAura(SPELL_ENRAGE); DoCast(m_creature,SPELL_EARTHQUAKE); Quake_Timer = 30000 + rand()%25000; diff --git a/src/bindings/scripts/scripts/zone/shadowmoon_valley/shadowmoon_valley.cpp b/src/bindings/scripts/scripts/zone/shadowmoon_valley/shadowmoon_valley.cpp index 365499a7956..d87c25c14a7 100644 --- a/src/bindings/scripts/scripts/zone/shadowmoon_valley/shadowmoon_valley.cpp +++ b/src/bindings/scripts/scripts/zone/shadowmoon_valley/shadowmoon_valley.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>.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 @@ -57,6 +57,7 @@ struct TRINITY_DLL_DECL mob_mature_netherwing_drakeAI : public ScriptedAI mob_mature_netherwing_drakeAI(Creature* c) : ScriptedAI(c) { PlayerGUID = 0; + Reset(); } uint64 PlayerGUID; @@ -78,7 +79,7 @@ struct TRINITY_DLL_DECL mob_mature_netherwing_drakeAI : public ScriptedAI CastTimer = 5000; } - void Aggro(Unit* who) { } + void EnterCombat(Unit* who) { } void MoveInLineOfSight(Unit* who) { @@ -93,11 +94,11 @@ struct TRINITY_DLL_DECL mob_mature_netherwing_drakeAI : public ScriptedAI if(!caster) return; - if(caster->GetTypeId() == TYPEID_PLAYER && spell->Id == SPELL_PLACE_CARCASS && !m_creature->HasAura(SPELL_JUST_EATEN, 0) && !PlayerGUID) + if(caster->GetTypeId() == TYPEID_PLAYER && spell->Id == SPELL_PLACE_CARCASS && !m_creature->HasAura(SPELL_JUST_EATEN) && !PlayerGUID) { float PlayerX, PlayerY, PlayerZ; caster->GetClosePoint(PlayerX, PlayerY, PlayerZ, m_creature->GetObjectSize()); - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT + MOVEMENTFLAG_LEVITATING); + m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); m_creature->GetMotionMaster()->MovePoint(1, PlayerX, PlayerY, PlayerZ); PlayerGUID = caster->GetGUID(); } @@ -113,7 +114,7 @@ struct TRINITY_DLL_DECL mob_mature_netherwing_drakeAI : public ScriptedAI IsEating = true; EatTimer = 5000; m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_ATTACKUNARMED); - m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT + MOVEMENTFLAG_LEVITATING); + m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); } } @@ -182,6 +183,7 @@ struct TRINITY_DLL_DECL mob_enslaved_netherwing_drakeAI : public ScriptedAI { PlayerGUID = 0; Tapped = false; + Reset(); } uint64 PlayerGUID; @@ -194,11 +196,11 @@ struct TRINITY_DLL_DECL mob_enslaved_netherwing_drakeAI : public ScriptedAI m_creature->setFaction(FACTION_DEFAULT); FlyTimer = 10000; - m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT + MOVEMENTFLAG_LEVITATING); + m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); m_creature->SetVisibility(VISIBILITY_ON); } - void Aggro(Unit* who) { } + void EnterCombat(Unit* who) { } void SpellHit(Unit* caster, const SpellEntry* spell) { @@ -213,7 +215,7 @@ struct TRINITY_DLL_DECL mob_enslaved_netherwing_drakeAI : public ScriptedAI m_creature->setFaction(FACTION_FRIENDLY); DoCast(caster, SPELL_FORCE_OF_NELTHARAKU, true); - Unit* Dragonmaw = FindCreature(CREATURE_DRAGONMAW_SUBJUGATOR, 50, m_creature); + Unit* Dragonmaw = me->FindNearestCreature(CREATURE_DRAGONMAW_SUBJUGATOR, 50); if(Dragonmaw) { @@ -243,7 +245,7 @@ struct TRINITY_DLL_DECL mob_enslaved_netherwing_drakeAI : public ScriptedAI PlayerGUID = 0; } m_creature->SetVisibility(VISIBILITY_OFF); - m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT + MOVEMENTFLAG_LEVITATING); + 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(); } @@ -273,7 +275,7 @@ struct TRINITY_DLL_DECL mob_enslaved_netherwing_drakeAI : public ScriptedAI float dx, dy, dz; - Unit* EscapeDummy = FindCreature(CREATURE_ESCAPE_DUMMY, 30, m_creature); + Unit* EscapeDummy = me->FindNearestCreature(CREATURE_ESCAPE_DUMMY, 30); if(EscapeDummy) EscapeDummy->GetPosition(dx, dy, dz); else @@ -282,7 +284,7 @@ struct TRINITY_DLL_DECL mob_enslaved_netherwing_drakeAI : public ScriptedAI dz += 25; } - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT + MOVEMENTFLAG_LEVITATING); + m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); m_creature->GetMotionMaster()->MovePoint(1, dx, dy, dz); } } @@ -318,7 +320,7 @@ struct TRINITY_DLL_DECL mob_dragonmaw_peonAI : public ScriptedAI PoisonTimer = 0; } - void Aggro(Unit* who) { } + void EnterCombat(Unit* who) { } void SpellHit(Unit* caster, const SpellEntry* spell) { @@ -620,15 +622,7 @@ bool GossipSelect_npc_oronok_tornheart(Player *player, Creature *_Creature, uint bool QuestAccept_npc_karynaku(Player* player, Creature* creature, Quest const* quest) { if(quest->GetQuestId() == 10870) // Ally of the Netherwing - { - std::vector<uint32> nodes; - - nodes.resize(2); - nodes[0] = 161; // From Karynaku - nodes[1] = 162; // To Mordenai - error_log("TSCR: Player %s started quest 10870 which has disabled taxi node, need to be fixed in core", player->GetName()); - //player->ActivateTaxiPathTo(nodes, 20811); - } + player->ActivateTaxiPathTo(649); return true; } @@ -690,7 +684,7 @@ struct TRINITY_DLL_DECL npc_overlord_morghorAI : public ScriptedAI Event = false; } - void Aggro(Unit* who){} + void EnterCombat(Unit* who){} void StartEvent() { @@ -756,14 +750,14 @@ struct TRINITY_DLL_DECL npc_overlord_morghorAI : public ScriptedAI plr->RemoveAurasDueToSpell(SPELL_FOUR); return 5000; }else{ - ((Player*)plr)->FailQuest(QUEST_LORD_ILLIDAN_STORMRAGE); Step = 30; return 100; + 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_ONTRANSPORT + MOVEMENTFLAG_LEVITATING); + Illi->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); return 500; break; case 21: DoScriptText(OVERLORD_SAY_5, m_creature); return 500; break; case 22: @@ -775,11 +769,11 @@ struct TRINITY_DLL_DECL npc_overlord_morghorAI : public ScriptedAI case 25: DoScriptText(OVERLORD_SAY_6, m_creature); return 2000; break; case 26: if(plr) - ((Player*)plr)->GroupEventHappens(QUEST_LORD_ILLIDAN_STORMRAGE, m_creature); + CAST_PLR(plr)->GroupEventHappens(QUEST_LORD_ILLIDAN_STORMRAGE, m_creature); return 6000; break; case 27: { - Unit* Yarzill = FindCreature(C_YARZILL, 50, m_creature); + Unit* Yarzill = me->FindNearestCreature(C_YARZILL, 50); if (Yarzill) Yarzill->SetUInt64Value(UNIT_FIELD_TARGET, PlayerGUID); return 500; }break; @@ -791,19 +785,19 @@ struct TRINITY_DLL_DECL npc_overlord_morghorAI : public ScriptedAI return 1000; break; case 29: { - Unit* Yarzill = FindCreature(C_YARZILL, 50, m_creature); + Unit* Yarzill = me->FindNearestCreature(C_YARZILL, 50); if(Yarzill) DoScriptText(YARZILL_THE_MERC_SAY, Yarzill, plr); return 5000; }break; case 30: { - Unit* Yarzill = FindCreature(C_YARZILL, 50, m_creature); + Unit* Yarzill = me->FindNearestCreature(C_YARZILL, 50); if (Yarzill) Yarzill->SetUInt64Value(UNIT_FIELD_TARGET, 0); return 5000; }break; case 31: { - Unit* Yarzill = FindCreature(C_YARZILL, 50, m_creature); + Unit* Yarzill = me->FindNearestCreature(C_YARZILL, 50); if (Yarzill) Yarzill->CastSpell(plr, 41540, true); return 1000;}break; @@ -838,8 +832,8 @@ bool QuestAccept_npc_overlord_morghor(Player *player, Creature *_Creature, const { if(_Quest->GetQuestId() == QUEST_LORD_ILLIDAN_STORMRAGE) { - ((npc_overlord_morghorAI*)_Creature->AI())->PlayerGUID = player->GetGUID(); - ((npc_overlord_morghorAI*)_Creature->AI())->StartEvent(); + CAST_AI(npc_overlord_morghorAI, _Creature->AI())->PlayerGUID = player->GetGUID(); + CAST_AI(npc_overlord_morghorAI, _Creature->AI())->StartEvent(); return true; } return false; @@ -871,7 +865,7 @@ struct TRINITY_DLL_DECL npc_earthmender_wildaAI : public npc_escortAI bool Completed; - void Aggro(Unit *who) + void EnterCombat(Unit *who) { Player* player = Unit::GetPlayer(PlayerGUID); @@ -949,7 +943,7 @@ struct TRINITY_DLL_DECL npc_earthmender_wildaAI : public npc_escortAI case 44: SummonAssassin(); break; case 50: DoScriptText(SAY_END, m_creature, player); - ((Player*)player)->GroupEventHappens(QUEST_ESCAPE_FROM_COILSKAR_CISTERN, m_creature); + CAST_PLR(player)->GroupEventHappens(QUEST_ESCAPE_FROM_COILSKAR_CISTERN, m_creature); Completed = true; break; } @@ -967,7 +961,7 @@ struct TRINITY_DLL_DECL npc_earthmender_wildaAI : public npc_escortAI case 0: DoScriptText(ASSASSIN_SAY_AGGRO1, CoilskarAssassin, player); break; case 1: DoScriptText(ASSASSIN_SAY_AGGRO2, CoilskarAssassin, player); break; } - ((Creature*)CoilskarAssassin)->AI()->AttackStart(m_creature); + CAST_CRE(CoilskarAssassin)->AI()->AttackStart(m_creature); } else error_log("TSCR ERROR: Coilskar Assassin couldn't be summmoned"); } @@ -978,7 +972,7 @@ struct TRINITY_DLL_DECL npc_earthmender_wildaAI : public npc_escortAI { Player* player = Unit::GetPlayer(PlayerGUID); if (player) - ((Player*)player)->FailQuest(QUEST_ESCAPE_FROM_COILSKAR_CISTERN); + CAST_PLR(player)->FailQuest(QUEST_ESCAPE_FROM_COILSKAR_CISTERN); } } @@ -1045,7 +1039,7 @@ CreatureAI* GetAI_npc_earthmender_wildaAI(Creature *_Creature) earthmender_wildaAI->AddWaypoint(49, -2841.754883, 1289.832520, 6.990304); earthmender_wildaAI->AddWaypoint(50, -2871.398438, 1302.348145, 6.807335, 8000); // SAY_END - return (CreatureAI*)earthmender_wildaAI; + return earthmender_wildaAI; } bool QuestAccept_npc_earthmender_wilda(Player* player, Creature* creature, Quest const* quest) @@ -1053,7 +1047,7 @@ bool QuestAccept_npc_earthmender_wilda(Player* player, Creature* creature, Quest if (quest->GetQuestId() == QUEST_ESCAPE_FROM_COILSKAR_CISTERN) { creature->setFaction(113); - ((npc_escortAI*)(creature->AI()))->Start(true, true, false, player->GetGUID()); + CAST_AI(npc_escortAI, (creature->AI()))->Start(true, true, false, player->GetGUID()); } return true; } @@ -1172,7 +1166,7 @@ struct TRINITY_DLL_DECL mob_illidari_spawnAI : public ScriptedAI Timers = false; } - void Aggro(Unit* who) {} + void EnterCombat(Unit* who) {} void JustDied(Unit* slayer); void UpdateAI(const uint32 diff) @@ -1285,7 +1279,7 @@ struct TRINITY_DLL_DECL mob_torloth_the_magnificentAI : public ScriptedAI m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0); } - void Aggro(Unit* who){} + void EnterCombat(Unit* who){} void HandleAnimation() { @@ -1387,12 +1381,13 @@ struct TRINITY_DLL_DECL mob_torloth_the_magnificentAI : public ScriptedAI switch(slayer->GetTypeId()) { case TYPEID_UNIT: - if(((Creature*)slayer)->isPet() && ((Pet*)slayer)->GetOwner()->GetTypeId() == TYPEID_PLAYER) - ((Player*)((Pet*)slayer->GetOwner()))->GroupEventHappens(QUEST_BATTLE_OF_THE_CRIMSON_WATCH, m_creature); + 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: - ((Player*)slayer)->GroupEventHappens(QUEST_BATTLE_OF_THE_CRIMSON_WATCH, m_creature); + CAST_PLR(slayer)->GroupEventHappens(QUEST_BATTLE_OF_THE_CRIMSON_WATCH, m_creature); break; } @@ -1440,7 +1435,7 @@ struct TRINITY_DLL_DECL npc_lord_illidan_stormrageAI : public ScriptedAI m_creature->SetVisibility(VISIBILITY_OFF); } - void Aggro(Unit* who) {} + void EnterCombat(Unit* who) {} void MoveInLineOfSight(Unit* who) {} void AttackStart(Unit* who) {} @@ -1496,14 +1491,14 @@ struct TRINITY_DLL_DECL npc_lord_illidan_stormrageAI : public ScriptedAI Spawn->GetMotionMaster()->MovePoint(0,x, y, z); } } - ((mob_illidari_spawnAI*)Spawn->AI())->LordIllidanGUID = m_creature->GetGUID(); + CAST_AI(mob_illidari_spawnAI, Spawn->AI())->LordIllidanGUID = m_creature->GetGUID(); } if(WavesInfo[WaveCount].CreatureId == 22076) // Torloth { - ((mob_torloth_the_magnificentAI*)Spawn->AI())->LordIllidanGUID = m_creature->GetGUID(); + CAST_AI(mob_torloth_the_magnificentAI, Spawn->AI())->LordIllidanGUID = m_creature->GetGUID(); if(PlayerGUID) - ((mob_torloth_the_magnificentAI*)Spawn->AI())->AggroTargetGUID = PlayerGUID; + CAST_AI(mob_torloth_the_magnificentAI, Spawn->AI())->AggroTargetGUID = PlayerGUID; } } } @@ -1611,7 +1606,7 @@ void mob_illidari_spawnAI::JustDied(Unit *slayer) m_creature->RemoveCorpse(); if(Creature* LordIllidan = (Unit::GetCreature(*m_creature, LordIllidanGUID))) if(LordIllidan) - ((npc_lord_illidan_stormrageAI*)LordIllidan->AI())->LiveCounter(); + CAST_AI(npc_lord_illidan_stormrageAI, LordIllidan->AI())->LiveCounter(); } /*##### @@ -1622,13 +1617,13 @@ bool GOQuestAccept_GO_crystal_prison(Player* plr, GameObject* go, Quest const* q { if(quest->GetQuestId() == QUEST_BATTLE_OF_THE_CRIMSON_WATCH ) { - Unit* Illidan = FindCreature(22083, 50, plr); + Creature* Illidan = plr->FindNearestCreature(22083, 50); - if(Illidan && !(((npc_lord_illidan_stormrageAI*)((Creature*)Illidan)->AI())->EventStarted)) + if(Illidan && !CAST_AI(npc_lord_illidan_stormrageAI, Illidan->AI())->EventStarted) { - ((npc_lord_illidan_stormrageAI*)((Creature*)Illidan)->AI())->PlayerGUID = plr->GetGUID(); - ((npc_lord_illidan_stormrageAI*)((Creature*)Illidan)->AI())->LiveCount = 0; - ((npc_lord_illidan_stormrageAI*)((Creature*)Illidan)->AI())->EventStarted=true; + 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; @@ -1699,7 +1694,7 @@ struct TRINITY_DLL_DECL npc_enraged_spiritAI : public ScriptedAI void Reset() { } - void Aggro(Unit *who){} + void EnterCombat(Unit *who){} void JustDied(Unit* killer) { @@ -1742,16 +1737,16 @@ struct TRINITY_DLL_DECL npc_enraged_spiritAI : public ScriptedAI // FIND TOTEM, PROCESS QUEST if (Summoned) { - totemOspirits = FindCreature(ENTRY_TOTEM_OF_SPIRITS, RADIUS_TOTEM_OF_SPIRITS, m_creature); + 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()); - Player* Owner = (Player*)totemOspirits->GetOwner(); - if (Owner) + Unit* Owner = totemOspirits->GetOwner(); + if (Owner && Owner->GetTypeId() == TYPEID_PLAYER) // DoCast(Owner, credit); -- not working! - Owner->KilledMonster(credit, Summoned->GetGUID()); + CAST_PLR(Owner)->KilledMonster(credit, Summoned->GetGUID()); DoCast(totemOspirits,SPELL_SOUL_CAPTURED); } } diff --git a/src/bindings/scripts/scripts/zone/shattrath/shattrath_city.cpp b/src/bindings/scripts/scripts/zone/shattrath/shattrath_city.cpp index 36ea4354030..236ef85f85c 100644 --- a/src/bindings/scripts/scripts/zone/shattrath/shattrath_city.cpp +++ b/src/bindings/scripts/scripts/zone/shattrath/shattrath_city.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -58,7 +58,7 @@ struct TRINITY_DLL_DECL npc_raliq_the_drunkAI : public ScriptedAI m_creature->setFaction(FACTION_FRIENDLY_RD); } - void Aggro(Unit *who) {} + void EnterCombat(Unit *who) {} void UpdateAI(const uint32 diff) { @@ -94,7 +94,7 @@ bool GossipSelect_npc_raliq_the_drunk(Player *player, Creature *_Creature, uint3 { player->CLOSE_GOSSIP_MENU(); _Creature->setFaction(FACTION_HOSTILE_RD); - ((npc_raliq_the_drunkAI*)_Creature->AI())->AttackStart(player); + _Creature->AI()->AttackStart(player); } return true; } @@ -121,14 +121,14 @@ struct TRINITY_DLL_DECL npc_salsalabimAI : public ScriptedAI m_creature->setFaction(FACTION_FRIENDLY_SA); } - void Aggro(Unit *who) {} + 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 ) { - ((Player*)done_by)->GroupEventHappens(QUEST_10004,m_creature); + CAST_PLR(done_by)->GroupEventHappens(QUEST_10004,m_creature); damage = 0; EnterEvadeMode(); } @@ -158,7 +158,7 @@ bool GossipHello_npc_salsalabim(Player *player, Creature *_Creature) if( player->GetQuestStatus(QUEST_10004) == QUEST_STATUS_INCOMPLETE ) { _Creature->setFaction(FACTION_HOSTILE_SA); - ((npc_salsalabimAI*)_Creature->AI())->AttackStart(player); + _Creature->AI()->AttackStart(player); } else { @@ -309,17 +309,17 @@ public: 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 ) + if( PlayerGUID ) { Player* player = (Unit::GetPlayer(PlayerGUID)); if( player ) - (player)->GroupEventHappens(10211,m_creature); + player->GroupEventHappens(10211,m_creature); } break; } } - void Aggro(Unit* who) {} + void EnterCombat(Unit* who) {} void MoveInLineOfSight(Unit *who) { @@ -328,12 +328,12 @@ public: if( who->GetTypeId() == TYPEID_PLAYER ) { - if( ((Player*)who)->GetQuestStatus(10211) == QUEST_STATUS_INCOMPLETE ) + if( CAST_PLR(who)->GetQuestStatus(10211) == QUEST_STATUS_INCOMPLETE ) { float Radius = 10.0; if( m_creature->IsWithinDistInMap(who, Radius) ) { - ((npc_escortAI*)(m_creature->AI()))->Start(false, false, false, who->GetGUID()); + Start(false, false, false, who->GetGUID()); } } } @@ -350,66 +350,9 @@ CreatureAI* GetAI_npc_kservantAI(Creature *_Creature) { npc_kservantAI* kservantAI = new npc_kservantAI(_Creature); - kservantAI->AddWaypoint(0, -1863.369019, 5419.517090, -10.463668, 4000); - kservantAI->AddWaypoint(1, -1861.749023, 5416.465332, -10.508068); - kservantAI->AddWaypoint(2, -1857.036133, 5410.966309, -12.428039); - kservantAI->AddWaypoint(3, -1831.539185, 5365.472168, -12.428039); - kservantAI->AddWaypoint(4, -1813.416504, 5333.776855, -12.428039); - kservantAI->AddWaypoint(5, -1800.354370, 5313.290039, -12.428039); - kservantAI->AddWaypoint(6, -1775.624878, 5268.786133, -38.809181); - kservantAI->AddWaypoint(7, -1770.147339, 5259.268066, -38.829231); - kservantAI->AddWaypoint(8, -1762.814209, 5261.098145, -38.848995); - kservantAI->AddWaypoint(9, -1740.110474, 5268.858398, -40.208965); - kservantAI->AddWaypoint(10, -1725.837402, 5270.936035, -40.208965); - kservantAI->AddWaypoint(11, -1701.580322, 5290.323242, -40.209187); - kservantAI->AddWaypoint(12, -1682.877808, 5291.406738, -34.429646); - kservantAI->AddWaypoint(13, -1670.101685, 5291.201172, -32.786007); - kservantAI->AddWaypoint(14, -1656.666870, 5294.333496, -37.862648); - kservantAI->AddWaypoint(15, -1652.035767, 5295.413086, -40.245499); - kservantAI->AddWaypoint(16, -1620.860596, 5300.133301, -40.208992); - kservantAI->AddWaypoint(17, -1607.630981, 5293.983398, -38.577045, 5000); - kservantAI->AddWaypoint(18, -1607.630981, 5293.983398, -38.577045, 5000); - kservantAI->AddWaypoint(19, -1607.630981, 5293.983398, -38.577045, 5000); - kservantAI->AddWaypoint(20, -1622.140869, 5301.955566, -40.208897); - kservantAI->AddWaypoint(21, -1621.131836, 5333.112793, -40.208897); - kservantAI->AddWaypoint(22, -1637.598999, 5342.134277, -40.208790); - kservantAI->AddWaypoint(23, -1648.521606, 5352.309570, -47.496170); - kservantAI->AddWaypoint(24, -1654.606934, 5357.419434, -45.870892); - kservantAI->AddWaypoint(25, -1633.670044, 5422.067871, -42.835541); - kservantAI->AddWaypoint(25, -1656.567505, 5426.236328, -40.405815); - kservantAI->AddWaypoint(26, -1664.932373, 5425.686523, -38.846405); - kservantAI->AddWaypoint(27, -1681.406006, 5425.871094, -38.810928); - kservantAI->AddWaypoint(28, -1730.875977, 5427.413574, -12.427910); - kservantAI->AddWaypoint(29, -1743.509521, 5369.599121, -12.427910); - kservantAI->AddWaypoint(30, -1877.217041, 5303.710449, -12.427989); - kservantAI->AddWaypoint(31, -1890.371216, 5289.273438, -12.428268); - kservantAI->AddWaypoint(32, -1905.505737, 5266.534668, 2.630672); - kservantAI->AddWaypoint(33, -1909.381348, 5273.008301, 1.663714, 10000); - kservantAI->AddWaypoint(34, -1909.381348, 5273.008301, 1.663714, 12000); - kservantAI->AddWaypoint(35, -1909.381348, 5273.008301, 1.663714, 8000); - kservantAI->AddWaypoint(36, -1909.381348, 5273.008301, 1.663714, 15000); - kservantAI->AddWaypoint(37, -1927.561401, 5275.324707, 1.984987); - kservantAI->AddWaypoint(38, -1927.385498, 5300.879883, -12.427236); - kservantAI->AddWaypoint(39, -1921.063965, 5314.318359, -12.427236); - kservantAI->AddWaypoint(40, -1965.425415, 5379.298828, -12.427236); - kservantAI->AddWaypoint(41, -1981.233154, 5450.743652, -12.427236); - kservantAI->AddWaypoint(42, -1958.022461, 5455.904297, 0.487659); - kservantAI->AddWaypoint(43, -1951.991455, 5463.580566, 0.874490, 10000); - kservantAI->AddWaypoint(44, -1951.991455, 5463.580566, 0.874490, 12000); - kservantAI->AddWaypoint(45, -1968.730225, 5481.752930, -12.427846); - kservantAI->AddWaypoint(46, -1881.839844, 5554.040039, -12.427846); - kservantAI->AddWaypoint(47, -1841.566650, 5545.965332, -12.427846); - kservantAI->AddWaypoint(48, -1837.658325, 5523.780273, 0.558756); - kservantAI->AddWaypoint(49, -1831.321777, 5534.821777, 1.221819, 6000); - kservantAI->AddWaypoint(50, -1831.321777, 5534.821777, 1.221819, 8000); - kservantAI->AddWaypoint(51, -1831.321777, 5534.821777, 1.221819, 5000); - kservantAI->AddWaypoint(52, -1850.060669, 5472.610840, 0.857320, 6000); - kservantAI->AddWaypoint(53, -1850.060669, 5472.610840, 0.857320, 8000); - kservantAI->AddWaypoint(54, -1850.060669, 5472.610840, 0.857320, 9000); - kservantAI->AddWaypoint(55, -1850.060669, 5472.610840, 0.857320, 9000); - kservantAI->AddWaypoint(56, -1850.060669, 5472.610840, 0.857320, 4000); - - return (CreatureAI*)kservantAI; + kservantAI->FillPointMovementListForCreature(); + + return kservantAI; } /*###### @@ -454,17 +397,17 @@ struct TRINITY_DLL_DECL npc_dirty_larryAI : public ScriptedAI m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); m_creature->setFaction(1194); - Unit* Creepjack = FindCreature(NPC_CREEPJACK, 20, m_creature); + Unit* Creepjack = me->FindNearestCreature(NPC_CREEPJACK, 20); if(Creepjack) { - ((Creature*)Creepjack)->AI()->EnterEvadeMode(); + CAST_CRE(Creepjack)->AI()->EnterEvadeMode(); Creepjack->setFaction(1194); Creepjack->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); } - Unit* Malone = FindCreature(NPC_MALONE, 20, m_creature); + Unit* Malone = me->FindNearestCreature(NPC_MALONE, 20); if(Malone) { - ((Creature*)Malone)->AI()->EnterEvadeMode(); + CAST_CRE(Malone)->AI()->EnterEvadeMode(); Malone->setFaction(1194); Malone->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); } @@ -477,10 +420,10 @@ struct TRINITY_DLL_DECL npc_dirty_larryAI : public ScriptedAI switch(Step) { case 0:{ m_creature->SetInFront(player); - Unit* Creepjack = FindCreature(NPC_CREEPJACK, 20, m_creature); + Unit* Creepjack = me->FindNearestCreature(NPC_CREEPJACK, 20); if(Creepjack) Creepjack->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); - Unit* Malone = FindCreature(NPC_MALONE, 20, m_creature); + 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; @@ -494,7 +437,7 @@ struct TRINITY_DLL_DECL npc_dirty_larryAI : public ScriptedAI } } - void Aggro(Unit* who){} + void EnterCombat(Unit* who){} void UpdateAI(const uint32 diff) { @@ -511,7 +454,7 @@ struct TRINITY_DLL_DECL npc_dirty_larryAI : public ScriptedAI m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); if(player) { - Unit* Creepjack = FindCreature(NPC_CREEPJACK, 20, m_creature); + Unit* Creepjack = me->FindNearestCreature(NPC_CREEPJACK, 20); if(Creepjack) { Creepjack->Attack(player, true); @@ -519,7 +462,7 @@ struct TRINITY_DLL_DECL npc_dirty_larryAI : public ScriptedAI Creepjack->GetMotionMaster()->MoveChase(player); Creepjack->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); } - Unit* Malone = FindCreature(NPC_MALONE, 20, m_creature); + Unit* Malone = me->FindNearestCreature(NPC_MALONE, 20); if(Malone) { Malone->Attack(player, true); @@ -535,18 +478,18 @@ struct TRINITY_DLL_DECL npc_dirty_larryAI : public ScriptedAI if((m_creature->GetHealth()*100)/m_creature->GetMaxHealth() < 1 && !Done) { - Unit* Creepjack = FindCreature(NPC_CREEPJACK, 20, m_creature); + Unit* Creepjack = me->FindNearestCreature(NPC_CREEPJACK, 20); if(Creepjack) { - ((Creature*)Creepjack)->AI()->EnterEvadeMode(); + CAST_CRE(Creepjack)->AI()->EnterEvadeMode(); Creepjack->setFaction(1194); Creepjack->GetMotionMaster()->MoveTargetedHome(); Creepjack->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); } - Unit* Malone = FindCreature(NPC_MALONE, 20, m_creature); + Unit* Malone = me->FindNearestCreature(NPC_MALONE, 20); if(Malone) { - ((Creature*)Malone)->AI()->EnterEvadeMode(); + CAST_CRE(Malone)->AI()->EnterEvadeMode(); Malone->setFaction(1194); Malone->GetMotionMaster()->MoveTargetedHome(); Malone->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); @@ -560,7 +503,7 @@ struct TRINITY_DLL_DECL npc_dirty_larryAI : public ScriptedAI m_creature->GetMotionMaster()->MoveTargetedHome(); Player* player = Unit::GetPlayer(PlayerGUID); if(player) - ((Player*)player)->GroupEventHappens(QUEST_WBI, m_creature); + CAST_PLR(player)->GroupEventHappens(QUEST_WBI, m_creature); } DoMeleeAttackIfReady(); } @@ -582,8 +525,8 @@ bool GossipSelect_npc_dirty_larry(Player *player, Creature *creature, uint32 sen { if (action == GOSSIP_ACTION_INFO_DEF+1) { - ((npc_dirty_larryAI*)creature->AI())->Event = true; - ((npc_dirty_larryAI*)creature->AI())->PlayerGUID = player->GetGUID(); + CAST_AI(npc_dirty_larryAI, creature->AI())->Event = true; + CAST_AI(npc_dirty_larryAI, creature->AI())->PlayerGUID = player->GetGUID(); player->CLOSE_GOSSIP_MENU(); } diff --git a/src/bindings/scripts/scripts/zone/silithus/silithus.cpp b/src/bindings/scripts/scripts/zone/silithus/silithus.cpp index 35dca28ddc8..bd1ecf748a0 100644 --- a/src/bindings/scripts/scripts/zone/silithus/silithus.cpp +++ b/src/bindings/scripts/scripts/zone/silithus/silithus.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 diff --git a/src/bindings/scripts/scripts/zone/silvermoon/silvermoon_city.cpp b/src/bindings/scripts/scripts/zone/silvermoon/silvermoon_city.cpp index 330fcf937c2..718a44acf58 100644 --- a/src/bindings/scripts/scripts/zone/silvermoon/silvermoon_city.cpp +++ b/src/bindings/scripts/scripts/zone/silvermoon/silvermoon_city.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>.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 @@ -47,12 +47,12 @@ struct TRINITY_DLL_DECL npc_blood_knight_stillbladeAI : public ScriptedAI void Reset() { lifeTimer = 120000; - m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 32); + m_creature->SetStandState(UNIT_STAND_STATE_DEAD); m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,7); // lay down spellHit = false; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } @@ -63,7 +63,7 @@ struct TRINITY_DLL_DECL npc_blood_knight_stillbladeAI : public ScriptedAI void UpdateAI(const uint32 diff) { - if (!m_creature->GetUInt32Value(UNIT_FIELD_BYTES_1)) + if (m_creature->IsStandState()) { if(lifeTimer < diff) m_creature->AI()->EnterEvadeMode(); @@ -75,11 +75,11 @@ struct TRINITY_DLL_DECL npc_blood_knight_stillbladeAI : public ScriptedAI void SpellHit(Unit *Hitter, const SpellEntry *Spellkind) { if((Spellkind->Id == SPELL_SHIMMERING_VESSEL) && !spellHit && - (Hitter->GetTypeId() == TYPEID_PLAYER) && (((Player*)Hitter)->IsActiveQuest(QUEST_REDEEMING_THE_DEAD))) + (Hitter->GetTypeId() == TYPEID_PLAYER) && (CAST_PLR(Hitter)->IsActiveQuest(QUEST_REDEEMING_THE_DEAD))) { - ((Player*)Hitter)->AreaExploredOrEventHappens(QUEST_REDEEMING_THE_DEAD); + CAST_PLR(Hitter)->AreaExploredOrEventHappens(QUEST_REDEEMING_THE_DEAD); DoCast(m_creature,SPELL_REVIVE_SELF); - m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,0); + m_creature->SetStandState(UNIT_STAND_STATE_STAND); m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 0); //m_creature->RemoveAllAuras(); DoScriptText(SAY_HEAL, m_creature); diff --git a/src/bindings/scripts/scripts/zone/silverpine_forest/silverpine_forest.cpp b/src/bindings/scripts/scripts/zone/silverpine_forest/silverpine_forest.cpp index a4236c82cef..ed96d3a1768 100644 --- a/src/bindings/scripts/scripts/zone/silverpine_forest/silverpine_forest.cpp +++ b/src/bindings/scripts/scripts/zone/silverpine_forest/silverpine_forest.cpp @@ -1,4 +1,4 @@ - /* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> + /* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -44,7 +44,7 @@ struct TRINITY_DLL_DECL npc_astor_hadrenAI : public ScriptedAI m_creature->setFaction(68); } - void Aggro(Unit* who) + void EnterCombat(Unit* who) { } @@ -81,7 +81,7 @@ bool GossipSelect_npc_astor_hadren(Player *player, Creature *_Creature, uint32 s player->CLOSE_GOSSIP_MENU(); _Creature->setFaction(21); if(player) - ((npc_astor_hadrenAI*)_Creature->AI())->AttackStart(player); + CAST_AI(npc_astor_hadrenAI, _Creature->AI())->AttackStart(player); break; } return true; @@ -91,24 +91,27 @@ bool GossipSelect_npc_astor_hadren(Player *player, Creature *_Creature, uint32 s ## npc_deathstalker_erland ######*/ -#define SAY_QUESTACCEPT -1000335 -#define SAY_START -1000336 -#define SAY_AGGRO_1 -1000337 -#define SAY_AGGRO_2 -1000338 -#define SAY_LAST -1000339 - -#define SAY_THANKS -1000340 -#define SAY_RANE -1000341 -#define SAY_ANSWER -1000342 -#define SAY_MOVE_QUINN -1000343 - -#define SAY_GREETINGS -1000344 -#define SAY_QUINN -1000345 -#define SAY_ON_BYE -1000346 - -#define QUEST_ESCORTING 435 -#define NPC_RANE 1950 -#define NPC_QUINN 1951 +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 { @@ -126,11 +129,10 @@ struct TRINITY_DLL_DECL npc_deathstalker_erlandAI : public npc_escortAI case 1: DoScriptText(SAY_START, m_creature, player);break; case 13: DoScriptText(SAY_LAST, m_creature, player); - if(player) - ((Player*)player)->GroupEventHappens(QUEST_ESCORTING, m_creature);break; + player->GroupEventHappens(QUEST_ESCORTING, m_creature);break; case 14: DoScriptText(SAY_THANKS, m_creature, player);break; case 15: { - Unit* Rane = FindCreature(NPC_RANE, 20, m_creature); + Unit* Rane = me->FindNearestCreature(NPC_RANE, 20); if(Rane) DoScriptText(SAY_RANE, Rane); break;} @@ -138,7 +140,7 @@ struct TRINITY_DLL_DECL npc_deathstalker_erlandAI : public npc_escortAI case 17: DoScriptText(SAY_MOVE_QUINN, m_creature); break; case 24: DoScriptText(SAY_GREETINGS, m_creature);break; case 25: { - Unit* Quinn = FindCreature(NPC_QUINN, 20, m_creature); + Unit* Quinn = me->FindNearestCreature(NPC_QUINN, 20); if(Quinn) DoScriptText(SAY_QUINN, Quinn); break;} @@ -149,7 +151,7 @@ struct TRINITY_DLL_DECL npc_deathstalker_erlandAI : public npc_escortAI void Reset() {} - void Aggro(Unit* who) + void EnterCombat(Unit* who) { switch(rand()%2) { @@ -169,7 +171,7 @@ bool QuestAccept_npc_deathstalker_erland(Player* player, Creature* creature, Que if (quest->GetQuestId() == QUEST_ESCORTING) { DoScriptText(SAY_QUESTACCEPT, creature, player); - ((npc_escortAI*)(creature->AI()))->Start(true, true, false, player->GetGUID()); + CAST_AI(npc_escortAI, (creature->AI()))->Start(true, true, false, player->GetGUID()); } return true; @@ -207,7 +209,7 @@ CreatureAI* GetAI_npc_deathstalker_erlandAI(Creature *_Creature) deathstalker_erlandAI->AddWaypoint(25, 1310.51, 1207.36, 58.51, 5000); deathstalker_erlandAI->AddWaypoint(26, 1310.51, 1207.36, 58.51, 2000); - return (CreatureAI*)deathstalker_erlandAI; + return deathstalker_erlandAI; } /*###### diff --git a/src/bindings/scripts/scripts/zone/stonetalon_mountains/stonetalon_mountains.cpp b/src/bindings/scripts/scripts/zone/stonetalon_mountains/stonetalon_mountains.cpp index cd42b046d94..e8f234c0e0b 100644 --- a/src/bindings/scripts/scripts/zone/stonetalon_mountains/stonetalon_mountains.cpp +++ b/src/bindings/scripts/scripts/zone/stonetalon_mountains/stonetalon_mountains.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -111,7 +111,7 @@ struct TRINITY_DLL_DECL npc_kaya_flathoofAI : public npc_escortAI case 23: m_creature->SetInFront(player); DoScriptText(SAY_END, m_creature, player); if (player && player->GetTypeId() == TYPEID_PLAYER) - ((Player*)player)->GroupEventHappens(QUEST_PK, m_creature); + CAST_PLR(player)->GroupEventHappens(QUEST_PK, m_creature); break; } } @@ -123,7 +123,7 @@ struct TRINITY_DLL_DECL npc_kaya_flathoofAI : public npc_escortAI void Reset(){} - void Aggro(Unit* who){} + void EnterCombat(Unit* who){} void JustDied(Unit* killer) { @@ -131,7 +131,7 @@ struct TRINITY_DLL_DECL npc_kaya_flathoofAI : public npc_escortAI { Player* player = Unit::GetPlayer(PlayerGUID); if (player) - ((Player*)player)->FailQuest(QUEST_PK); + CAST_PLR(player)->FailQuest(QUEST_PK); } } @@ -145,7 +145,7 @@ bool QuestAccept_npc_kaya_flathoof(Player* player, Creature* creature, Quest con { if (quest->GetQuestId() == QUEST_PK) { - ((npc_escortAI*)(creature->AI()))->Start(true, true, false, player->GetGUID()); + CAST_AI(npc_escortAI, (creature->AI()))->Start(true, true, false, player->GetGUID()); DoScriptText(SAY_START, creature); creature->setFaction(113); creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); @@ -182,7 +182,7 @@ CreatureAI* GetAI_npc_kaya_flathoofAI(Creature *_Creature) thisAI->AddWaypoint(22, -43.77, -497.99, -46.13, 3000);// summon thisAI->AddWaypoint(23, -41.77, -518.15, -46.13, 5000);//end - return (CreatureAI*)thisAI; + return thisAI; } /*###### diff --git a/src/bindings/scripts/scripts/zone/stormwind/stormwind_city.cpp b/src/bindings/scripts/scripts/zone/stormwind/stormwind_city.cpp index 81016febdae..36f09218093 100644 --- a/src/bindings/scripts/scripts/zone/stormwind/stormwind_city.cpp +++ b/src/bindings/scripts/scripts/zone/stormwind/stormwind_city.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -74,7 +74,7 @@ struct TRINITY_DLL_DECL npc_bartlebyAI : public ScriptedAI void Reset() { m_creature->setFaction(11); - m_creature->setEmoteState(7); + m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, 7); PlayerGUID = 0; } @@ -93,15 +93,15 @@ struct TRINITY_DLL_DECL npc_bartlebyAI : public ScriptedAI if (done_by->GetTypeId() == TYPEID_PLAYER && done_by->GetGUID() == PlayerGUID) { - ((Player*)done_by)->AttackStop(); - ((Player*)done_by)->AreaExploredOrEventHappens(1640); + CAST_PLR(done_by)->AttackStop(); + CAST_PLR(done_by)->AreaExploredOrEventHappens(1640); } m_creature->CombatStop(); EnterEvadeMode(); } } - void Aggro(Unit *who) {} + void EnterCombat(Unit *who) {} }; bool QuestAccept_npc_bartleby(Player *player, Creature *_Creature, Quest const *_Quest) @@ -109,8 +109,8 @@ bool QuestAccept_npc_bartleby(Player *player, Creature *_Creature, Quest const * if(_Quest->GetQuestId() == 1640) { _Creature->setFaction(168); - ((npc_bartlebyAI*)_Creature->AI())->PlayerGUID = player->GetGUID(); - ((npc_bartlebyAI*)_Creature->AI())->AttackStart(player); + CAST_AI(npc_bartlebyAI, _Creature->AI())->PlayerGUID = player->GetGUID(); + CAST_AI(npc_bartlebyAI, _Creature->AI())->AttackStart(player); } return true; } @@ -131,7 +131,7 @@ struct TRINITY_DLL_DECL npc_dashel_stonefistAI : public ScriptedAI void Reset() { m_creature->setFaction(11); - m_creature->setEmoteState(7); + m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, 7); } void DamageTaken(Unit *done_by, uint32 & damage) @@ -143,15 +143,15 @@ struct TRINITY_DLL_DECL npc_dashel_stonefistAI : public ScriptedAI if (done_by->GetTypeId() == TYPEID_PLAYER) { - ((Player*)done_by)->AttackStop(); - ((Player*)done_by)->AreaExploredOrEventHappens(1447); + CAST_PLR(done_by)->AttackStop(); + CAST_PLR(done_by)->AreaExploredOrEventHappens(1447); } //m_creature->CombatStop(); EnterEvadeMode(); } } - void Aggro(Unit *who) {} + void EnterCombat(Unit *who) {} }; bool QuestAccept_npc_dashel_stonefist(Player *player, Creature *_Creature, Quest const *_Quest) @@ -159,7 +159,7 @@ bool QuestAccept_npc_dashel_stonefist(Player *player, Creature *_Creature, Quest if(_Quest->GetQuestId() == 1447) { _Creature->setFaction(168); - ((npc_dashel_stonefistAI*)_Creature->AI())->AttackStart(player); + CAST_AI(npc_dashel_stonefistAI, _Creature->AI())->AttackStart(player); } return true; } @@ -173,6 +173,8 @@ CreatureAI* GetAI_npc_dashel_stonefist(Creature *_creature) ## npc_general_marcus_jonathan ######*/ +#define SAY_GREETING -1000005 + bool ReceiveEmote_npc_general_marcus_jonathan(Player *player, Creature *_Creature, uint32 emote) { if(player->GetTeam() == ALLIANCE) @@ -184,7 +186,7 @@ bool ReceiveEmote_npc_general_marcus_jonathan(Player *player, Creature *_Creatur } if (emote == TEXTEMOTE_WAVE) { - _Creature->MonsterSay("Greetings citizen",LANG_COMMON,0); + DoScriptText(SAY_GREETING, _Creature, player); } } return true; @@ -260,7 +262,7 @@ void AddSC_stormwind_city() newscript = new Script; newscript->Name = "npc_general_marcus_jonathan"; - newscript->pReceiveEmote = &ReceiveEmote_npc_general_marcus_jonathan; + //newscript->pReceiveEmote = &ReceiveEmote_npc_general_marcus_jonathan; newscript->RegisterSelf(); newscript = new Script; diff --git a/src/bindings/scripts/scripts/zone/stranglethorn_vale/stranglethorn_vale.cpp b/src/bindings/scripts/scripts/zone/stranglethorn_vale/stranglethorn_vale.cpp index 3b28c1526ee..daeeb3e11e5 100644 --- a/src/bindings/scripts/scripts/zone/stranglethorn_vale/stranglethorn_vale.cpp +++ b/src/bindings/scripts/scripts/zone/stranglethorn_vale/stranglethorn_vale.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -52,7 +52,7 @@ struct TRINITY_DLL_DECL mob_yennikuAI : public ScriptedAI if (caster->GetTypeId() == TYPEID_PLAYER) { //Yenniku's Release - if(!bReset && ((Player*)caster)->GetQuestStatus(592) == QUEST_STATUS_INCOMPLETE && spell->Id == 3607) + 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 @@ -66,7 +66,7 @@ struct TRINITY_DLL_DECL mob_yennikuAI : public ScriptedAI return; } - void Aggro(Unit *who) {} + void EnterCombat(Unit *who) {} void UpdateAI(const uint32 diff) { @@ -86,7 +86,7 @@ struct TRINITY_DLL_DECL mob_yennikuAI : public ScriptedAI if(m_creature->getVictim()->GetTypeId() == TYPEID_PLAYER) { Unit *victim = m_creature->getVictim(); - if(((Player*)victim)->GetTeam() == HORDE) + if(CAST_PLR(victim)->GetTeam() == HORDE) { m_creature->CombatStop(); m_creature->DeleteThreatList(); diff --git a/src/bindings/scripts/scripts/zone/stratholme/boss_baron_rivendare.cpp b/src/bindings/scripts/scripts/zone/stratholme/boss_baron_rivendare.cpp index e50ab2196fb..092318fd7af 100644 --- a/src/bindings/scripts/scripts/zone/stratholme/boss_baron_rivendare.cpp +++ b/src/bindings/scripts/scripts/zone/stratholme/boss_baron_rivendare.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -79,7 +79,7 @@ struct TRINITY_DLL_DECL boss_baron_rivendareAI : public ScriptedAI { boss_baron_rivendareAI(Creature *c) : ScriptedAI(c) { - pInstance = (ScriptedInstance*)m_creature->GetInstanceData(); + pInstance = m_creature->GetInstanceData(); } ScriptedInstance* pInstance; @@ -100,7 +100,7 @@ struct TRINITY_DLL_DECL boss_baron_rivendareAI : public ScriptedAI SummonSkeletons_Timer = 34000; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { if (pInstance) pInstance->SetData(TYPE_BARON,IN_PROGRESS); diff --git a/src/bindings/scripts/scripts/zone/stratholme/boss_baroness_anastari.cpp b/src/bindings/scripts/scripts/zone/stratholme/boss_baroness_anastari.cpp index cef99648d2f..1906834e184 100644 --- a/src/bindings/scripts/scripts/zone/stratholme/boss_baroness_anastari.cpp +++ b/src/bindings/scripts/scripts/zone/stratholme/boss_baroness_anastari.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -33,7 +33,7 @@ struct TRINITY_DLL_DECL boss_baroness_anastariAI : public ScriptedAI { boss_baroness_anastariAI(Creature *c) : ScriptedAI(c) { - pInstance = (ScriptedInstance*)m_creature->GetInstanceData(); + pInstance = m_creature->GetInstanceData(); } ScriptedInstance* pInstance; @@ -51,7 +51,7 @@ struct TRINITY_DLL_DECL boss_baroness_anastariAI : public ScriptedAI //Possess_Timer = 35000; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } diff --git a/src/bindings/scripts/scripts/zone/stratholme/boss_cannon_master_willey.cpp b/src/bindings/scripts/scripts/zone/stratholme/boss_cannon_master_willey.cpp index ab2aa112a01..fed823ec63a 100644 --- a/src/bindings/scripts/scripts/zone/stratholme/boss_cannon_master_willey.cpp +++ b/src/bindings/scripts/scripts/zone/stratholme/boss_cannon_master_willey.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -102,7 +102,7 @@ struct TRINITY_DLL_DECL boss_cannon_master_willeyAI : public ScriptedAI m_creature->SummonCreature(11054,ADD_9X,ADD_9Y,ADD_9Z,ADD_9O,TEMPSUMMON_TIMED_DESPAWN,240000); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } diff --git a/src/bindings/scripts/scripts/zone/stratholme/boss_dathrohan_balnazzar.cpp b/src/bindings/scripts/scripts/zone/stratholme/boss_dathrohan_balnazzar.cpp index 0e70b4a3b43..8372393f2f7 100644 --- a/src/bindings/scripts/scripts/zone/stratholme/boss_dathrohan_balnazzar.cpp +++ b/src/bindings/scripts/scripts/zone/stratholme/boss_dathrohan_balnazzar.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -129,7 +129,7 @@ struct TRINITY_DLL_DECL boss_dathrohan_balnazzarAI : public ScriptedAI m_creature->SummonCreature(10698,ADD_8X,ADD_8Y,ADD_8Z,ADD_8O,TEMPSUMMON_TIMED_DESPAWN,240000); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } diff --git a/src/bindings/scripts/scripts/zone/stratholme/boss_magistrate_barthilas.cpp b/src/bindings/scripts/scripts/zone/stratholme/boss_magistrate_barthilas.cpp index cae6dbcbcc6..d65390ab6d7 100644 --- a/src/bindings/scripts/scripts/zone/stratholme/boss_magistrate_barthilas.cpp +++ b/src/bindings/scripts/scripts/zone/stratholme/boss_magistrate_barthilas.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -36,7 +36,7 @@ struct TRINITY_DLL_DECL boss_magistrate_barthilasAI : public ScriptedAI { boss_magistrate_barthilasAI(Creature *c) : ScriptedAI(c) { - pInstance = (ScriptedInstance*)m_creature->GetInstanceData(); + pInstance = m_creature->GetInstanceData(); } ScriptedInstance* pInstance; @@ -73,7 +73,7 @@ struct TRINITY_DLL_DECL boss_magistrate_barthilasAI : public ScriptedAI m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, MODEL_HUMAN); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } diff --git a/src/bindings/scripts/scripts/zone/stratholme/boss_maleki_the_pallid.cpp b/src/bindings/scripts/scripts/zone/stratholme/boss_maleki_the_pallid.cpp index 68890d43c1d..dbbbc5576d4 100644 --- a/src/bindings/scripts/scripts/zone/stratholme/boss_maleki_the_pallid.cpp +++ b/src/bindings/scripts/scripts/zone/stratholme/boss_maleki_the_pallid.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -33,7 +33,7 @@ struct TRINITY_DLL_DECL boss_maleki_the_pallidAI : public ScriptedAI { boss_maleki_the_pallidAI(Creature *c) : ScriptedAI(c) { - pInstance = (ScriptedInstance*)m_creature->GetInstanceData(); + pInstance = m_creature->GetInstanceData(); } ScriptedInstance* pInstance; @@ -49,7 +49,7 @@ struct TRINITY_DLL_DECL boss_maleki_the_pallidAI : public ScriptedAI DrainLife_Timer = 31000; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } diff --git a/src/bindings/scripts/scripts/zone/stratholme/boss_nerubenkan.cpp b/src/bindings/scripts/scripts/zone/stratholme/boss_nerubenkan.cpp index 68336fca890..2d2c7605404 100644 --- a/src/bindings/scripts/scripts/zone/stratholme/boss_nerubenkan.cpp +++ b/src/bindings/scripts/scripts/zone/stratholme/boss_nerubenkan.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -33,7 +33,7 @@ struct TRINITY_DLL_DECL boss_nerubenkanAI : public ScriptedAI { boss_nerubenkanAI(Creature *c) : ScriptedAI(c) { - pInstance = (ScriptedInstance*)m_creature->GetInstanceData(); + pInstance = m_creature->GetInstanceData(); } ScriptedInstance* pInstance; @@ -55,7 +55,7 @@ struct TRINITY_DLL_DECL boss_nerubenkanAI : public ScriptedAI RaiseUndeadScarab_Timer = 3000; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } @@ -83,7 +83,7 @@ struct TRINITY_DLL_DECL boss_nerubenkanAI : public ScriptedAI Rand = 0; Summoned = DoSpawnCreature(10876, RandX, RandY, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 180000); if(Summoned) - ((CreatureAI*)Summoned->AI())->AttackStart(victim); + (Summoned->AI())->AttackStart(victim); } void UpdateAI(const uint32 diff) diff --git a/src/bindings/scripts/scripts/zone/stratholme/boss_order_of_silver_hand.cpp b/src/bindings/scripts/scripts/zone/stratholme/boss_order_of_silver_hand.cpp index 42b9a32ae8b..316cbaef9d3 100644 --- a/src/bindings/scripts/scripts/zone/stratholme/boss_order_of_silver_hand.cpp +++ b/src/bindings/scripts/scripts/zone/stratholme/boss_order_of_silver_hand.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -45,7 +45,7 @@ struct TRINITY_DLL_DECL boss_silver_hand_bossesAI : public ScriptedAI { boss_silver_hand_bossesAI(Creature* c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } ScriptedInstance *pInstance; @@ -81,7 +81,7 @@ struct TRINITY_DLL_DECL boss_silver_hand_bossesAI : public ScriptedAI } } - void Aggro(Unit* who) + void EnterCombat(Unit* who) { } @@ -108,7 +108,7 @@ struct TRINITY_DLL_DECL boss_silver_hand_bossesAI : public ScriptedAI break; } if(pInstance->GetData(TYPE_SH_QUEST) && Killer->GetTypeId() == TYPEID_PLAYER) - ((Player*)Killer)->KilledMonster(SH_QUEST_CREDIT,m_creature->GetGUID()); + CAST_PLR(Killer)->KilledMonster(SH_QUEST_CREDIT,m_creature->GetGUID()); } } diff --git a/src/bindings/scripts/scripts/zone/stratholme/boss_postmaster_malown.cpp b/src/bindings/scripts/scripts/zone/stratholme/boss_postmaster_malown.cpp index 8e088dd4126..fd28ad481eb 100644 --- a/src/bindings/scripts/scripts/zone/stratholme/boss_postmaster_malown.cpp +++ b/src/bindings/scripts/scripts/zone/stratholme/boss_postmaster_malown.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -55,7 +55,7 @@ struct TRINITY_DLL_DECL boss_postmaster_malownAI : public ScriptedAI HasYelled = false; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } diff --git a/src/bindings/scripts/scripts/zone/stratholme/boss_ramstein_the_gorger.cpp b/src/bindings/scripts/scripts/zone/stratholme/boss_ramstein_the_gorger.cpp index 9b7682a522a..1ecb95333c4 100644 --- a/src/bindings/scripts/scripts/zone/stratholme/boss_ramstein_the_gorger.cpp +++ b/src/bindings/scripts/scripts/zone/stratholme/boss_ramstein_the_gorger.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -33,7 +33,7 @@ struct TRINITY_DLL_DECL boss_ramstein_the_gorgerAI : public ScriptedAI { boss_ramstein_the_gorgerAI(Creature *c) : ScriptedAI(c) { - pInstance = (ScriptedInstance*)m_creature->GetInstanceData(); + pInstance = m_creature->GetInstanceData(); } ScriptedInstance* pInstance; @@ -47,7 +47,7 @@ struct TRINITY_DLL_DECL boss_ramstein_the_gorgerAI : public ScriptedAI Knockout_Timer = 12000; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } diff --git a/src/bindings/scripts/scripts/zone/stratholme/boss_timmy_the_cruel.cpp b/src/bindings/scripts/scripts/zone/stratholme/boss_timmy_the_cruel.cpp index 0e013642b3a..ac1eaa4b624 100644 --- a/src/bindings/scripts/scripts/zone/stratholme/boss_timmy_the_cruel.cpp +++ b/src/bindings/scripts/scripts/zone/stratholme/boss_timmy_the_cruel.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -40,7 +40,7 @@ struct TRINITY_DLL_DECL boss_timmy_the_cruelAI : public ScriptedAI HasYelled = false; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { if (!HasYelled) { diff --git a/src/bindings/scripts/scripts/zone/stratholme/def_stratholme.h b/src/bindings/scripts/scripts/zone/stratholme/def_stratholme.h index 79dd277c999..b9246091a7c 100644 --- a/src/bindings/scripts/scripts/zone/stratholme/def_stratholme.h +++ b/src/bindings/scripts/scripts/zone/stratholme/def_stratholme.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * This program is free software licensed under GPL version 2 * Please see the included DOCS/LICENSE.TXT for more information */ diff --git a/src/bindings/scripts/scripts/zone/stratholme/instance_stratholme.cpp b/src/bindings/scripts/scripts/zone/stratholme/instance_stratholme.cpp index 68718bd2dec..988667ebe5c 100644 --- a/src/bindings/scripts/scripts/zone/stratholme/instance_stratholme.cpp +++ b/src/bindings/scripts/scripts/zone/stratholme/instance_stratholme.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -146,7 +146,7 @@ struct TRINITY_DLL_DECL instance_stratholme : public ScriptedInstance if (withRestoreTime) go->UseDoorOrButton(10); else - go->SetGoState(newState); + go->SetGoState((GOState)newState); } } @@ -280,10 +280,10 @@ struct TRINITY_DLL_DECL instance_stratholme : public ScriptedInstance if (!pGroupie) continue; - if (pGroupie->HasAura(SPELL_BARON_ULTIMATUM,0)) + if (pGroupie->HasAura(SPELL_BARON_ULTIMATUM)) pGroupie->RemoveAurasDueToSpell(SPELL_BARON_ULTIMATUM); } - } else if (player->HasAura(SPELL_BARON_ULTIMATUM,0)) + } else if (player->HasAura(SPELL_BARON_ULTIMATUM)) player->RemoveAurasDueToSpell(SPELL_BARON_ULTIMATUM); if (Unit *temp = Unit::GetUnit(*player,GetData64(DATA_BARON))) diff --git a/src/bindings/scripts/scripts/zone/stratholme/stratholme.cpp b/src/bindings/scripts/scripts/zone/stratholme/stratholme.cpp index f22ca652fff..7bbc3b91e98 100644 --- a/src/bindings/scripts/scripts/zone/stratholme/stratholme.cpp +++ b/src/bindings/scripts/scripts/zone/stratholme/stratholme.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -37,7 +37,7 @@ EndContentData */ bool GOHello_go_gauntlet_gate(Player *player, GameObject* _GO) { - ScriptedInstance* pInstance = (ScriptedInstance*)_GO->GetInstanceData(); + ScriptedInstance* pInstance = _GO->GetInstanceData(); if (!pInstance) return false; @@ -54,12 +54,12 @@ bool GOHello_go_gauntlet_gate(Player *player, GameObject* _GO) continue; if (pGroupie->GetQuestStatus(QUEST_DEAD_MAN_PLEA) == QUEST_STATUS_INCOMPLETE && - !pGroupie->HasAura(SPELL_BARON_ULTIMATUM,0) && + !pGroupie->HasAura(SPELL_BARON_ULTIMATUM) && pGroupie->GetMap() == _GO->GetMap()) pGroupie->CastSpell(pGroupie,SPELL_BARON_ULTIMATUM,true); } } else if (player->GetQuestStatus(QUEST_DEAD_MAN_PLEA) == QUEST_STATUS_INCOMPLETE && - !player->HasAura(SPELL_BARON_ULTIMATUM,0) && + !player->HasAura(SPELL_BARON_ULTIMATUM) && player->GetMap() == _GO->GetMap()) player->CastSpell(player,SPELL_BARON_ULTIMATUM,true); @@ -72,10 +72,10 @@ bool GOHello_go_gauntlet_gate(Player *player, GameObject* _GO) ######*/ //Possibly more of these quotes around. -#define SAY_ZAPPED0 "Thanks to Egan" -#define SAY_ZAPPED1 "Rivendare must die" -#define SAY_ZAPPED2 "Who you gonna call?" -#define SAY_ZAPPED3 "Don't cross those beams!" +#define SAY_ZAPPED0 -1329000 +#define SAY_ZAPPED1 -1329001 +#define SAY_ZAPPED2 -1329002 +#define SAY_ZAPPED3 -1329003 struct TRINITY_DLL_DECL mob_freed_soulAI : public ScriptedAI { @@ -85,14 +85,14 @@ struct TRINITY_DLL_DECL mob_freed_soulAI : public ScriptedAI { switch (rand()%4) { - case 0: DoSay(SAY_ZAPPED0,LANG_UNIVERSAL,NULL); break; - case 1: DoSay(SAY_ZAPPED1,LANG_UNIVERSAL,NULL); break; - case 2: DoSay(SAY_ZAPPED2,LANG_UNIVERSAL,NULL); break; - case 3: DoSay(SAY_ZAPPED3,LANG_UNIVERSAL,NULL); break; + case 0: DoScriptText(SAY_ZAPPED0, m_creature); break; + case 1: DoScriptText(SAY_ZAPPED1, m_creature); break; + case 2: DoScriptText(SAY_ZAPPED2, m_creature); break; + case 3: DoScriptText(SAY_ZAPPED3, m_creature); break; } } - void Aggro(Unit* who) { } + void EnterCombat(Unit* who) { } }; CreatureAI* GetAI_mob_freed_soul(Creature *_Creature) @@ -125,13 +125,13 @@ struct TRINITY_DLL_DECL mob_restless_soulAI : public ScriptedAI Tagged = false; } - void Aggro(Unit* who) { } + void EnterCombat(Unit* who) { } void SpellHit(Unit *caster, const SpellEntry *spell) { if (caster->GetTypeId() == TYPEID_PLAYER) { - if (!Tagged && spell->Id == SPELL_EGAN_BLASTER && ((Player*)caster)->GetQuestStatus(QUEST_RESTLESS_SOUL) == QUEST_STATUS_INCOMPLETE) + if (!Tagged && spell->Id == SPELL_EGAN_BLASTER && CAST_PLR(caster)->GetQuestStatus(QUEST_RESTLESS_SOUL) == QUEST_STATUS_INCOMPLETE) { Tagged = true; Tagger = caster->GetGUID(); @@ -187,7 +187,7 @@ struct TRINITY_DLL_DECL mobs_spectral_ghostly_citizenAI : public ScriptedAI Tagged = false; } - void Aggro(Unit* who) { } + void EnterCombat(Unit* who) { } void SpellHit(Unit *caster, const SpellEntry *spell) { @@ -227,6 +227,32 @@ struct TRINITY_DLL_DECL mobs_spectral_ghostly_citizenAI : public ScriptedAI DoMeleeAttackIfReady(); } + + void ReciveEmote(Player *player, uint32 emote) + { + switch(emote) + { + case TEXTEMOTE_DANCE: + EnterEvadeMode(); + break; + case TEXTEMOTE_RUDE: + //Should instead cast spell, kicking player back. Spell not found. + if (m_creature->IsWithinDistInMap(player, 5)) + m_creature->HandleEmoteCommand(EMOTE_ONESHOT_RUDE); + else + m_creature->HandleEmoteCommand(EMOTE_ONESHOT_RUDE); + break; + case TEXTEMOTE_WAVE: + m_creature->HandleEmoteCommand(EMOTE_ONESHOT_WAVE); + break; + case TEXTEMOTE_BOW: + m_creature->HandleEmoteCommand(EMOTE_ONESHOT_BOW); + break; + case TEXTEMOTE_KISS: + m_creature->HandleEmoteCommand(EMOTE_ONESHOT_FLEX); + break; + } + } }; CreatureAI* GetAI_mobs_spectral_ghostly_citizen(Creature *_Creature) @@ -234,34 +260,6 @@ CreatureAI* GetAI_mobs_spectral_ghostly_citizen(Creature *_Creature) return new mobs_spectral_ghostly_citizenAI (_Creature); } -bool ReciveEmote_mobs_spectral_ghostly_citizen(Player *player, Creature *_Creature, uint32 emote) -{ - switch(emote) - { - case TEXTEMOTE_DANCE: - ((mobs_spectral_ghostly_citizenAI*)_Creature->AI())->EnterEvadeMode(); - break; - case TEXTEMOTE_RUDE: - //Should instead cast spell, kicking player back. Spell not found. - if (_Creature->IsWithinDistInMap(player, 5)) - _Creature->HandleEmoteCommand(EMOTE_ONESHOT_RUDE); - else - _Creature->HandleEmoteCommand(EMOTE_ONESHOT_RUDE); - break; - case TEXTEMOTE_WAVE: - _Creature->HandleEmoteCommand(EMOTE_ONESHOT_WAVE); - break; - case TEXTEMOTE_BOW: - _Creature->HandleEmoteCommand(EMOTE_ONESHOT_BOW); - break; - case TEXTEMOTE_KISS: - _Creature->HandleEmoteCommand(EMOTE_ONESHOT_FLEX); - break; - } - - return true; -} - void AddSC_stratholme() { Script *newscript; @@ -284,7 +282,6 @@ void AddSC_stratholme() newscript = new Script; newscript->Name = "mobs_spectral_ghostly_citizen"; newscript->GetAI = &GetAI_mobs_spectral_ghostly_citizen; - newscript->pReceiveEmote = &ReciveEmote_mobs_spectral_ghostly_citizen; newscript->RegisterSelf(); } diff --git a/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_brutallus.cpp b/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_brutallus.cpp index e6f3caf0ae1..7f4e6f7fdcd 100644 --- a/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_brutallus.cpp +++ b/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_brutallus.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -67,7 +67,7 @@ enum Spells struct TRINITY_DLL_DECL boss_brutallusAI : public ScriptedAI { boss_brutallusAI(Creature *c) : ScriptedAI(c){ - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } ScriptedInstance* pInstance; @@ -119,7 +119,7 @@ struct TRINITY_DLL_DECL boss_brutallusAI : public ScriptedAI pInstance->SetData(DATA_BRUTALLUS_EVENT, NOT_STARTED); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { DoScriptText(YELL_AGGRO, m_creature); diff --git a/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_eredar_twins.cpp b/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_eredar_twins.cpp index 5dcb5e2abc5..92099f70ee6 100644 --- a/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_eredar_twins.cpp +++ b/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_eredar_twins.cpp @@ -94,7 +94,7 @@ enum Creatures struct TRINITY_DLL_DECL boss_sacrolashAI : public ScriptedAI { boss_sacrolashAI(Creature *c) : ScriptedAI(c){ - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } ScriptedInstance *pInstance; @@ -121,7 +121,7 @@ struct TRINITY_DLL_DECL boss_sacrolashAI : public ScriptedAI if (Temp) if (Temp->isDead()) { - ((Creature*)Temp)->Respawn(); + CAST_CRE(Temp)->Respawn(); }else { if(Temp->getVictim()) @@ -147,8 +147,8 @@ struct TRINITY_DLL_DECL boss_sacrolashAI : public ScriptedAI if(pInstance) pInstance->SetData(DATA_EREDAR_TWINS_EVENT, NOT_STARTED); } - - void Aggro(Unit *who) + + void EnterCombat(Unit *who) { DoZoneInCombat(); @@ -156,7 +156,7 @@ struct TRINITY_DLL_DECL boss_sacrolashAI : public ScriptedAI { Unit* Temp = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_ALYTHESS)); if (Temp && Temp->isAlive() && !(Temp->getVictim())) - ((Creature*)Temp)->AI()->AttackStart(who); + CAST_CRE(Temp)->AI()->AttackStart(who); } if(pInstance) @@ -210,9 +210,9 @@ struct TRINITY_DLL_DECL boss_sacrolashAI : public ScriptedAI switch(TouchedType) { case SPELL_FLAME_TOUCHED: - if(!target->HasAura(SPELL_DARK_FLAME, 0)) + if(!target->HasAura(SPELL_DARK_FLAME)) { - if(target->HasAura(SPELL_DARK_TOUCHED, 0)) + if(target->HasAura(SPELL_DARK_TOUCHED)) { target->RemoveAurasDueToSpell(SPELL_DARK_TOUCHED); target->CastSpell(target, SPELL_DARK_FLAME, true); @@ -220,9 +220,9 @@ struct TRINITY_DLL_DECL boss_sacrolashAI : public ScriptedAI } break; case SPELL_DARK_TOUCHED: - if(!target->HasAura(SPELL_DARK_FLAME, 0)) + if(!target->HasAura(SPELL_DARK_FLAME)) { - if(target->HasAura(SPELL_FLAME_TOUCHED, 0)) + if(target->HasAura(SPELL_FLAME_TOUCHED)) { target->RemoveAurasDueToSpell(SPELL_FLAME_TOUCHED); target->CastSpell(target, SPELL_DARK_FLAME, true); @@ -354,7 +354,7 @@ CreatureAI* GetAI_boss_sacrolash(Creature *_Creature) struct TRINITY_DLL_DECL boss_alythessAI : public Scripted_NoMovementAI { boss_alythessAI(Creature *c) : Scripted_NoMovementAI(c){ - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); IntroStepCounter = 10; } @@ -385,7 +385,7 @@ struct TRINITY_DLL_DECL boss_alythessAI : public Scripted_NoMovementAI if (Temp) if (Temp->isDead()) { - ((Creature*)Temp)->Respawn(); + CAST_CRE(Temp)->Respawn(); }else { if(Temp->getVictim()) @@ -412,8 +412,8 @@ struct TRINITY_DLL_DECL boss_alythessAI : public Scripted_NoMovementAI if(pInstance) pInstance->SetData(DATA_EREDAR_TWINS_EVENT, NOT_STARTED); } - - void Aggro(Unit *who) + + void EnterCombat(Unit *who) { DoZoneInCombat(); @@ -421,7 +421,7 @@ struct TRINITY_DLL_DECL boss_alythessAI : public Scripted_NoMovementAI { Unit* Temp = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_SACROLASH)); if (Temp && Temp->isAlive() && !(Temp->getVictim())) - ((Creature*)Temp)->AI()->AttackStart(who); + CAST_CRE(Temp)->AI()->AttackStart(who); } if(pInstance) @@ -447,11 +447,9 @@ struct TRINITY_DLL_DECL boss_alythessAI : public Scripted_NoMovementAI float attackRadius = m_creature->GetAttackDistance(who); if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->GetDistanceZ(who) <= CREATURE_Z_ATTACK_RANGE && m_creature->IsWithinLOSInMap(who)) { - if (!InCombat) + if (!m_creature->isInCombat()) { DoStartNoMovement(who); - Aggro(who); - InCombat = true; } } } @@ -508,9 +506,9 @@ struct TRINITY_DLL_DECL boss_alythessAI : public Scripted_NoMovementAI switch(TouchedType) { case SPELL_FLAME_TOUCHED: - if(!target->HasAura(SPELL_DARK_FLAME, 0)) + if(!target->HasAura(SPELL_DARK_FLAME)) { - if(target->HasAura(SPELL_DARK_TOUCHED, 0)) + if(target->HasAura(SPELL_DARK_TOUCHED)) { target->RemoveAurasDueToSpell(SPELL_DARK_TOUCHED); target->CastSpell(target, SPELL_DARK_FLAME, true); @@ -521,9 +519,9 @@ struct TRINITY_DLL_DECL boss_alythessAI : public Scripted_NoMovementAI } break; case SPELL_DARK_TOUCHED: - if(!target->HasAura(SPELL_DARK_FLAME, 0)) + if(!target->HasAura(SPELL_DARK_FLAME)) { - if(target->HasAura(SPELL_FLAME_TOUCHED, 0)) + if(target->HasAura(SPELL_FLAME_TOUCHED)) { target->RemoveAurasDueToSpell(SPELL_FLAME_TOUCHED); target->CastSpell(target, SPELL_DARK_FLAME, true); @@ -535,7 +533,7 @@ struct TRINITY_DLL_DECL boss_alythessAI : public Scripted_NoMovementAI uint32 IntroStep(uint32 step) { - Creature* Sacrolash = (Creature*)Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_SACROLASH)); + Creature* Sacrolash = Unit::GetCreature((*m_creature),pInstance->GetData64(DATA_SACROLASH)); switch (step) { case 0: return 0; @@ -688,7 +686,7 @@ struct TRINITY_DLL_DECL mob_shadow_imageAI : public ScriptedAI KillTimer = 15000; } - void Aggro(Unit *who){} + void EnterCombat(Unit *who){} void SpellHitTarget(Unit* target,const SpellEntry* spell) { @@ -697,9 +695,9 @@ struct TRINITY_DLL_DECL mob_shadow_imageAI : public ScriptedAI case SPELL_SHADOW_FURY: case SPELL_DARK_STRIKE: - if(!target->HasAura(SPELL_DARK_FLAME, 0)) + if(!target->HasAura(SPELL_DARK_FLAME)) { - if(target->HasAura(SPELL_FLAME_TOUCHED, 0)) + if(target->HasAura(SPELL_FLAME_TOUCHED)) { target->RemoveAurasDueToSpell(SPELL_FLAME_TOUCHED); target->CastSpell(target, SPELL_DARK_FLAME, true); @@ -711,7 +709,7 @@ struct TRINITY_DLL_DECL mob_shadow_imageAI : public ScriptedAI void UpdateAI(const uint32 diff) { - if(!m_creature->HasAura(SPELL_IMAGE_VISUAL, 0)) + if(!m_creature->HasAura(SPELL_IMAGE_VISUAL)) DoCast(m_creature, SPELL_IMAGE_VISUAL); if(KillTimer < diff) diff --git a/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_felmyst.cpp b/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_felmyst.cpp index 769518be38e..f15a7742a8c 100644 --- a/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_felmyst.cpp +++ b/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_felmyst.cpp @@ -127,16 +127,16 @@ static EventFelmyst MaxTimer[]= struct TRINITY_DLL_DECL boss_felmystAI : public ScriptedAI { boss_felmystAI(Creature *c) : ScriptedAI(c){ - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); // wait for core patch be accepted - /*SpellEntry *TempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_ENCAPSULATE_EFFECT); + /*SpellEntry *TempSpell = GET_SPELL(SPELL_ENCAPSULATE_EFFECT); if(TempSpell->SpellIconID == 2294) TempSpell->SpellIconID = 2295; - TempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_VAPOR_TRIGGER); + TempSpell = GET_SPELL(SPELL_VAPOR_TRIGGER); if((TempSpell->Attributes & SPELL_ATTR_PASSIVE) == 0) TempSpell->Attributes |= SPELL_ATTR_PASSIVE; - TempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_FOG_CHARM2); + TempSpell = GET_SPELL(SPELL_FOG_CHARM2); if((TempSpell->Attributes & SPELL_ATTR_PASSIVE) == 0) TempSpell->Attributes |= SPELL_ATTR_PASSIVE;*/ } @@ -158,7 +158,7 @@ struct TRINITY_DLL_DECL boss_felmystAI : public ScriptedAI Timer[EVENT_BERSERK] = 600000; FlightCount = 0; - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING + MOVEMENTFLAG_ONTRANSPORT); + m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); m_creature->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 10); m_creature->SetFloatValue(UNIT_FIELD_COMBATREACH, 10); @@ -169,7 +169,7 @@ struct TRINITY_DLL_DECL boss_felmystAI : public ScriptedAI pInstance->SetData(DATA_FELMYST_EVENT, NOT_STARTED); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { m_creature->setActive(true); DoZoneInCombat(); @@ -293,7 +293,7 @@ struct TRINITY_DLL_DECL boss_felmystAI : public ScriptedAI error_log("prevent fly phase"); m_creature->GetMotionMaster()->Clear(false); m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF); - m_creature->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING + MOVEMENTFLAG_ONTRANSPORT); + m_creature->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); m_creature->StopMoving(); DoScriptText(YELL_TAKEOFF, m_creature); Timer[EVENT_FLIGHT_SEQUENCE] = 2000; @@ -306,7 +306,7 @@ struct TRINITY_DLL_DECL boss_felmystAI : public ScriptedAI case 2:{ error_log("Summon Vapor case 2"); Unit* target; - target = SelectUnit(SELECT_TARGET_RANDOM, 0, 150, true); + target = SelectTarget(SELECT_TARGET_RANDOM, 0, 150, true); if(!target) target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_PLAYER_GUID)); if(target) { @@ -331,7 +331,7 @@ struct TRINITY_DLL_DECL boss_felmystAI : public ScriptedAI error_log("Summon Vapor case3"); //m_creature->CastSpell(m_creature, SPELL_VAPOR_SELECT); need core support Unit* target; - target = SelectUnit(SELECT_TARGET_RANDOM, 0, 150, true); + target = SelectTarget(SELECT_TARGET_RANDOM, 0, 150, true); if(!target) target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_PLAYER_GUID)); if(target) { @@ -358,7 +358,7 @@ struct TRINITY_DLL_DECL boss_felmystAI : public ScriptedAI break; case 5:{ Unit* target; - target = SelectUnit(SELECT_TARGET_RANDOM, 0, 150, true); + target = SelectTarget(SELECT_TARGET_RANDOM, 0, 150, true); if(!target) target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_PLAYER_GUID)); if(target) { @@ -414,7 +414,7 @@ struct TRINITY_DLL_DECL boss_felmystAI : public ScriptedAI Timer[EVENT_FLIGHT_SEQUENCE] = 0; break; case 10: - m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING + MOVEMENTFLAG_ONTRANSPORT); + m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); m_creature->StopMoving(); m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LAND); EnterPhase(PHASE_GROUND); @@ -471,7 +471,7 @@ struct TRINITY_DLL_DECL boss_felmystAI : public ScriptedAI Timer[EVENT_GAS_NOVA] = 20000 + rand()%5 * 1000; break; case EVENT_ENCAPSULATE: - if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0, 150, true)) + if(Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 150, true)) { m_creature->CastSpell(target, SPELL_ENCAPSULATE_CHANNEL, false); Timer[EVENT_ENCAPSULATE] = 25000 + rand()%5 * 1000; @@ -529,7 +529,7 @@ struct TRINITY_DLL_DECL boss_felmystAI : public ScriptedAI cell.SetNoCreate(); Trinity::AllCreaturesOfEntryInRange check(m_creature, entry, 100); - Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(templist, check); + Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(m_creature, templist, check); TypeContainerVisitor<Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange>, GridTypeMapContainer> cSearcher(searcher); @@ -561,7 +561,7 @@ struct TRINITY_DLL_DECL mob_felmyst_vaporAI : public ScriptedAI m_creature->SetSpeed(MOVE_RUN, 0.8); } void Reset() {} - void Aggro(Unit* who) + void EnterCombat(Unit* who) { DoZoneInCombat(); //m_creature->CastSpell(m_creature, SPELL_VAPOR_FORCE, true); core bug @@ -583,7 +583,7 @@ struct TRINITY_DLL_DECL mob_felmyst_trailAI : public ScriptedAI m_creature->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 0.01); // core bug } void Reset() {} - void Aggro(Unit* who) {} + void EnterCombat(Unit* who) {} void AttackStart(Unit* who) {} void MoveInLineOfSight(Unit* who) {} void UpdateAI(const uint32 diff) {} diff --git a/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_kalecgos.cpp b/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_kalecgos.cpp index 56d389b30ef..600f4906ca5 100644 --- a/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_kalecgos.cpp +++ b/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_kalecgos.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -102,7 +102,7 @@ struct TRINITY_DLL_DECL boss_kalecgosAI : public ScriptedAI { boss_kalecgosAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); SathGUID = 0; DoorGUID = 0; } @@ -134,16 +134,16 @@ struct TRINITY_DLL_DECL boss_kalecgosAI : public ScriptedAI } Unit *Sath = Unit::GetUnit(*m_creature,SathGUID); - if(Sath) ((Creature*)Sath)->AI()->EnterEvadeMode(); + if(Sath) CAST_CRE(Sath)->AI()->EnterEvadeMode(); GameObject *Door = GameObject::GetGameObject(*m_creature, DoorGUID); if(Door) Door->SetLootState(GO_JUST_DEACTIVATED); m_creature->setFaction(14); m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE); - m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT + MOVEMENTFLAG_LEVITATING); + m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); m_creature->SetVisibility(VISIBILITY_ON); - m_creature->SetStandState(PLAYER_STATE_SLEEP); + m_creature->SetStandState(UNIT_STAND_STATE_SLEEP); ArcaneBuffetTimer = 8000; FrostBreathTimer = 15000; @@ -165,9 +165,9 @@ struct TRINITY_DLL_DECL boss_kalecgosAI : public ScriptedAI damage = 0; } - void Aggro(Unit* who) + void EnterCombat(Unit* who) { - m_creature->SetStandState(PLAYER_STATE_NONE); + m_creature->SetStandState(UNIT_STAND_STATE_STAND); DoScriptText(SAY_EVIL_AGGRO, m_creature); GameObject *Door = GameObject::GetGameObject(*m_creature, DoorGUID); if(Door) Door->SetLootState(GO_ACTIVATED); @@ -211,7 +211,7 @@ struct TRINITY_DLL_DECL boss_kalecgosAI : public ScriptedAI TalkTimer = 10000; break; case 3: - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT + MOVEMENTFLAG_LEVITATING); + m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); m_creature->GetMotionMaster()->Clear(); m_creature->GetMotionMaster()->MovePoint(0,FLY_X,FLY_Y,FLY_Z); TalkTimer = 600000; @@ -230,7 +230,7 @@ struct TRINITY_DLL_DECL boss_kalecgosAI : public ScriptedAI TalkTimer = 3000; break; case 2: - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT + MOVEMENTFLAG_LEVITATING); + m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); m_creature->GetMotionMaster()->Clear(); m_creature->GetMotionMaster()->MovePoint(0,FLY_X,FLY_Y,FLY_Z); TalkTimer = 600000; @@ -250,7 +250,7 @@ struct TRINITY_DLL_DECL boss_sathrovarrAI : public ScriptedAI { boss_sathrovarrAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); KalecGUID = 0; KalecgosGUID = 0; } @@ -293,7 +293,7 @@ struct TRINITY_DLL_DECL boss_sathrovarrAI : public ScriptedAI pInstance->SetData(DATA_KALECGOS_EVENT, NOT_STARTED); } - void Aggro(Unit* who) + void EnterCombat(Unit* who) { Creature *Kalec = m_creature->SummonCreature(MOB_KALEC, m_creature->GetPositionX() + 10, m_creature->GetPositionY() + 5, m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 0); if(Kalec) @@ -318,8 +318,8 @@ struct TRINITY_DLL_DECL boss_sathrovarrAI : public ScriptedAI TeleportAllPlayersBack(); if(Unit *Kalecgos = Unit::GetUnit(*m_creature, KalecgosGUID)) { - ((boss_kalecgosAI*)((Creature*)Kalecgos)->AI())->TalkTimer = 1; - ((boss_kalecgosAI*)((Creature*)Kalecgos)->AI())->isFriendly = false; + CAST_AI(boss_kalecgosAI, CAST_CRE(Kalecgos)->AI())->TalkTimer = 1; + CAST_AI(boss_kalecgosAI, CAST_CRE(Kalecgos)->AI())->isFriendly = false; } EnterEvadeMode(); return; @@ -338,8 +338,8 @@ struct TRINITY_DLL_DECL boss_sathrovarrAI : public ScriptedAI TeleportAllPlayersBack(); if(Unit *Kalecgos = Unit::GetUnit(*m_creature, KalecgosGUID)) { - ((boss_kalecgosAI*)((Creature*)Kalecgos)->AI())->TalkTimer = 1; - ((boss_kalecgosAI*)((Creature*)Kalecgos)->AI())->isFriendly = true; + CAST_AI(boss_kalecgosAI, CAST_CRE(Kalecgos)->AI())->TalkTimer = 1; + CAST_AI(boss_kalecgosAI, CAST_CRE(Kalecgos)->AI())->isFriendly = true; } if(pInstance) @@ -354,7 +354,7 @@ struct TRINITY_DLL_DECL boss_sathrovarrAI : public ScriptedAI Map::PlayerList::const_iterator i; for(i = PlayerList.begin(); i != PlayerList.end(); ++i) if(Player* i_pl = i->getSource()) - if(i_pl->HasAura(AURA_SPECTRAL_REALM,0)) + if(i_pl->HasAura(AURA_SPECTRAL_REALM)) i_pl->RemoveAurasDueToSpell(AURA_SPECTRAL_REALM); } @@ -371,7 +371,7 @@ struct TRINITY_DLL_DECL boss_sathrovarrAI : public ScriptedAI if(Kalecgos) { Kalecgos->CastSpell(Kalecgos, SPELL_ENRAGE, true); - ((boss_kalecgosAI*)((Creature*)Kalecgos)->AI())->isEnraged = true; + CAST_AI(boss_kalecgosAI, CAST_CRE(Kalecgos)->AI())->isEnraged = true; } DoCast(m_creature, SPELL_ENRAGE, true); isEnraged = true; @@ -381,7 +381,7 @@ struct TRINITY_DLL_DECL boss_sathrovarrAI : public ScriptedAI { if(Unit *Kalecgos = Unit::GetUnit(*m_creature, KalecgosGUID)) { - if(((boss_kalecgosAI*)((Creature*)Kalecgos)->AI())->isBanished) + if(CAST_AI(boss_kalecgosAI, CAST_CRE(Kalecgos)->AI())->isBanished) { m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); return; @@ -404,7 +404,7 @@ struct TRINITY_DLL_DECL boss_sathrovarrAI : public ScriptedAI if(ResetThreat < diff) { - if ( ( m_creature->getVictim()->HasAura(AURA_SPECTRAL_EXHAUSTION,0)) && (m_creature->getVictim()->GetTypeId() == TYPEID_PLAYER) ) + if ( ( m_creature->getVictim()->HasAura(AURA_SPECTRAL_EXHAUSTION)) && (m_creature->getVictim()->GetTypeId() == TYPEID_PLAYER) ) { for(std::list<HostilReference*>::iterator itr = m_creature->getThreatManager().getThreatList().begin(); itr != m_creature->getThreatManager().getThreatList().end(); ++itr) { @@ -458,7 +458,7 @@ struct TRINITY_DLL_DECL boss_kalecAI : public ScriptedAI bool isEnraged; // if demon is enraged boss_kalecAI(Creature *c) : ScriptedAI(c){ - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } void Reset() @@ -474,7 +474,7 @@ struct TRINITY_DLL_DECL boss_kalecAI : public ScriptedAI isEnraged = false; } - void Aggro(Unit* who) {} + void EnterCombat(Unit* who) {} void DamageTaken(Unit *done_by, uint32 &damage) { @@ -570,7 +570,7 @@ void boss_kalecgosAI::UpdateAI(const uint32 diff) if(Sath) { Sath->CastSpell(Sath, SPELL_ENRAGE, true); - ((boss_sathrovarrAI*)((Creature*)Sath)->AI())->isEnraged = true; + CAST_AI(boss_sathrovarrAI, CAST_CRE(Sath)->AI())->isEnraged = true; } DoCast(m_creature, SPELL_ENRAGE, true); isEnraged = true; @@ -580,7 +580,7 @@ void boss_kalecgosAI::UpdateAI(const uint32 diff) { if(Unit *Sath = Unit::GetUnit(*m_creature, SathGUID)) { - if(((boss_sathrovarrAI*)((Creature*)Sath)->AI())->isBanished) + if(CAST_AI(boss_sathrovarrAI, CAST_CRE(Sath)->AI())->isBanished) { Sath->DealDamage(Sath, Sath->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); return; @@ -629,7 +629,7 @@ void boss_kalecgosAI::UpdateAI(const uint32 diff) { //this is a hack. we need to find a victim without aura in core Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0); - if( ( target && target != m_creature->getVictim() ) && target->isAlive() && !(target->HasAura(AURA_SPECTRAL_EXHAUSTION, 0)) ) + if( target && target != m_creature->getVictim() && target->isAlive() && !target->HasAura(AURA_SPECTRAL_EXHAUSTION) ) { DoCast(target, SPELL_SPECTRAL_BLAST); SpectralBlastTimer = 20000+(rand()%5000); @@ -646,7 +646,7 @@ void boss_kalecgosAI::UpdateAI(const uint32 diff) bool GOkalecgos_teleporter(Player *player, GameObject* _GO) { - if(player->HasAura(AURA_SPECTRAL_EXHAUSTION, 0)) + if(player->HasAura(AURA_SPECTRAL_EXHAUSTION)) player->GetSession()->SendNotification(GO_FAILED); else player->CastSpell(player, SPELL_TELEPORT_SPECTRAL, true); diff --git a/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_kiljaeden.cpp b/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_kiljaeden.cpp index 746aece5fd5..cb0ee4b7f78 100644 --- a/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_kiljaeden.cpp +++ b/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_kiljaeden.cpp @@ -269,12 +269,12 @@ public: bool GOHello_go_orb_of_the_blue_flight(Player *plr, GameObject* go) { if(go->GetUInt32Value(GAMEOBJECT_FACTION) == 35){ - ScriptedInstance* pInstance = ((ScriptedInstance*)go->GetInstanceData()); + ScriptedInstance* pInstance = (go->GetInstanceData()); float x,y,z, dx,dy,dz; go->SummonCreature(CREATURE_POWER_OF_THE_BLUE_DRAGONFLIGHT, plr->GetPositionX(), plr->GetPositionY(), plr->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN, 121000); plr->CastSpell(plr, SPELL_VENGEANCE_OF_THE_BLUE_FLIGHT, true); go->SetUInt32Value(GAMEOBJECT_FACTION, 0); - Unit* Kalec = ((Creature*)Unit::GetUnit(*plr, pInstance->GetData64(DATA_KALECGOS_KJ))); + Unit* Kalec = CAST_CRE(Unit::GetUnit(*plr, pInstance->GetData64(DATA_KALECGOS_KJ))); //Kalec->RemoveDynObject(SPELL_RING_OF_BLUE_FLAMES); go->GetPosition(x,y,z); for(uint8 i = 0; i < 4; ++i){ @@ -296,7 +296,7 @@ bool GOHello_go_orb_of_the_blue_flight(Player *plr, GameObject* go) struct TRINITY_DLL_DECL boss_kalecgos_kjAI : public ScriptedAI { boss_kalecgos_kjAI(Creature* c) : ScriptedAI(c){ - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } GameObject* Orb[4]; @@ -321,8 +321,6 @@ struct TRINITY_DLL_DECL boss_kalecgos_kjAI : public ScriptedAI void Reset(){} - void Aggro(Unit* who) {} - void FindOrbs() { CellPair pair(Trinity::ComputeCellPair(m_creature->GetPositionX(), m_creature->GetPositionY())); @@ -331,7 +329,7 @@ struct TRINITY_DLL_DECL boss_kalecgos_kjAI : public ScriptedAI cell.SetNoCreate(); std::list<GameObject*> orbList; AllOrbsInGrid check; - Trinity::GameObjectListSearcher<AllOrbsInGrid> searcher(orbList, check); + Trinity::GameObjectListSearcher<AllOrbsInGrid> searcher(me, orbList, check); TypeContainerVisitor<Trinity::GameObjectListSearcher<AllOrbsInGrid>, GridTypeMapContainer> visitor(searcher); CellLock<GridReadGuard> cell_lock(cell, pair); cell_lock->Visit(cell_lock, visitor, *(m_creature->GetMap())); @@ -411,7 +409,7 @@ CreatureAI* GetAI_boss_kalecgos_kj(Creature *_Creature) struct TRINITY_DLL_DECL boss_kiljaedenAI : public Scripted_NoMovementAI { boss_kiljaedenAI(Creature* c) : Scripted_NoMovementAI(c), Summons(m_creature){ - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } ScriptedInstance* pInstance; @@ -462,7 +460,7 @@ struct TRINITY_DLL_DECL boss_kiljaedenAI : public Scripted_NoMovementAI IsWaiting = false; OrbActivated = false; - Kalec = ((Creature*)Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_KALECGOS_KJ))); + Kalec = CAST_CRE(Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_KALECGOS_KJ))); ChangeTimers(false, 0); } @@ -518,13 +516,13 @@ struct TRINITY_DLL_DECL boss_kiljaedenAI : public Scripted_NoMovementAI // Reset the controller if(pInstance){ - Creature* Control = ((Creature*)Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_KILJAEDEN_CONTROLLER))); + Creature* Control = CAST_CRE(Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_KILJAEDEN_CONTROLLER))); if(Control) - ((Scripted_NoMovementAI*)Control->AI())->Reset(); + CAST_AI(Scripted_NoMovementAI, Control->AI())->Reset(); } } - void Aggro(Unit* who){ + void EnterCombat(Unit* who){ DoZoneInCombat(); DoScriptText(SAY_KJ_EMERGE, m_creature); } @@ -540,7 +538,7 @@ struct TRINITY_DLL_DECL boss_kiljaedenAI : public Scripted_NoMovementAI float x,y,z; Unit* target; for(uint8 z = 0; z < 6; ++z){ - target = SelectUnit(SELECT_TARGET_RANDOM, 0, 100, true); + target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true); if (!target->HasAura(SPELL_VENGEANCE_OF_THE_BLUE_FLIGHT,0)) break; } target->GetPosition(x,y,z); @@ -584,7 +582,7 @@ struct TRINITY_DLL_DECL boss_kiljaedenAI : public Scripted_NoMovementAI if(!m_creature->IsNonMeleeSpellCasted(false)){ m_creature->RemoveAurasDueToSpell(SPELL_SOUL_FLAY); for(uint8 z = 0; z < 6; ++z){ - randomPlayer = SelectUnit(SELECT_TARGET_RANDOM, 0, 100, true); + randomPlayer = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true); if (!randomPlayer->HasAura(SPELL_VENGEANCE_OF_THE_BLUE_FLIGHT,0)) break; } if(randomPlayer)DoCast(randomPlayer, SPELL_LEGION_LIGHTNING, false); @@ -649,8 +647,8 @@ struct TRINITY_DLL_DECL boss_kiljaedenAI : public Scripted_NoMovementAI break; case TIMER_ORBS_EMPOWER: //Phase 3 if(Phase == PHASE_SACRIFICE){ - if(Kalec)((boss_kalecgos_kjAI*)Kalec->AI())->EmpowerOrb(true); - }else if(Kalec)((boss_kalecgos_kjAI*)Kalec->AI())->EmpowerOrb(false); + if(Kalec)CAST_AI(boss_kalecgos_kjAI, Kalec->AI())->EmpowerOrb(true); + }else if(Kalec)CAST_AI(boss_kalecgos_kjAI, Kalec->AI())->EmpowerOrb(false); Timer[TIMER_ORBS_EMPOWER]= (Phase == PHASE_SACRIFICE) ? 45000 : 35000; OrbActivated = true; TimerIsDeactiveted[TIMER_ORBS_EMPOWER] = true; @@ -658,7 +656,7 @@ struct TRINITY_DLL_DECL boss_kiljaedenAI : public Scripted_NoMovementAI case TIMER_ARMAGEDDON: //Phase 4 Unit* target; for(uint8 z = 0; z < 6; ++z){ - target = SelectUnit(SELECT_TARGET_RANDOM, 0, 100, true); + target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true); if (!target->HasAura(SPELL_VENGEANCE_OF_THE_BLUE_FLIGHT,0)) break; } if(target){ @@ -706,7 +704,7 @@ struct TRINITY_DLL_DECL boss_kiljaedenAI : public Scripted_NoMovementAI if(Phase <= PHASE_ARMAGEDDON){ if(Phase == PHASE_ARMAGEDDON && ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 25)){ Phase = PHASE_SACRIFICE; - Creature* Anveena = (Creature*)(Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_ANVEENA))); + Creature* Anveena = (Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_ANVEENA))); if (Anveena)Anveena->CastSpell(m_creature, SPELL_SACRIFICE_OF_ANVEENA, false); OrbActivated = false; ChangeTimers(true, 10000);// He shouldn't cast spells for ~10 seconds after Anveena's sacrifice. This will be done within Anveena's script @@ -726,7 +724,7 @@ CreatureAI* GetAI_boss_kiljaeden(Creature *_Creature) struct TRINITY_DLL_DECL mob_kiljaeden_controllerAI : public Scripted_NoMovementAI { mob_kiljaeden_controllerAI(Creature* c) : Scripted_NoMovementAI(c), Summons(m_creature){ - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } ScriptedInstance* pInstance; @@ -749,7 +747,7 @@ struct TRINITY_DLL_DECL mob_kiljaeden_controllerAI : public Scripted_NoMovementA void Reset(){ Phase = PHASE_DECEIVERS; - if(KalecKJ)((boss_kalecgos_kjAI*)KalecKJ->AI())->ResetOrbs(); + if(KalecKJ)CAST_AI(boss_kalecgos_kjAI, KalecKJ->AI())->ResetOrbs(); DeceiverDeathCount = 0; SummonedDeceivers = false; KiljaedenDeath = false; @@ -769,15 +767,13 @@ struct TRINITY_DLL_DECL mob_kiljaeden_controllerAI : public Scripted_NoMovementA break; case CREATURE_KILJAEDEN: summoned->CastSpell(summoned, SPELL_REBIRTH, false); - ((boss_kiljaedenAI*)summoned->AI())->Phase=PHASE_NORMAL; + CAST_AI(boss_kiljaedenAI, summoned->AI())->Phase=PHASE_NORMAL; summoned->AddThreat(m_creature->getVictim(), 1.0f); break; } Summons.Summon(summoned); } - void Aggro(Unit* who) {} - void UpdateAI(const uint32 diff) { if(RandomSayTimer < diff && pInstance->GetData(DATA_MURU_EVENT) != DONE && pInstance->GetData(DATA_KILJAEDEN_EVENT) == NOT_STARTED){ @@ -817,7 +813,7 @@ CreatureAI* GetAI_mob_kiljaeden_controller(Creature *_Creature) struct TRINITY_DLL_DECL mob_hand_of_the_deceiverAI : public ScriptedAI { mob_hand_of_the_deceiverAI(Creature* c) : ScriptedAI(c){ - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } ScriptedInstance* pInstance; @@ -836,10 +832,10 @@ struct TRINITY_DLL_DECL mob_hand_of_the_deceiverAI : public ScriptedAI summoned->SetLevel(m_creature->getLevel()); } - void Aggro(Unit* who){ + void EnterCombat(Unit* who){ if(pInstance){ pInstance->SetData(DATA_KILJAEDEN_EVENT, IN_PROGRESS); - Creature* Control = ((Creature*)Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_KILJAEDEN_CONTROLLER))); + Creature* Control = CAST_CRE(Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_KILJAEDEN_CONTROLLER))); if(Control) Control->AddThreat(who, 1.0f); } @@ -850,13 +846,13 @@ struct TRINITY_DLL_DECL mob_hand_of_the_deceiverAI : public ScriptedAI if(!pInstance) return; - Creature* Control = ((Creature*)Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_KILJAEDEN_CONTROLLER))); + Creature* Control = CAST_CRE(Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_KILJAEDEN_CONTROLLER))); if(Control) - ((mob_kiljaeden_controllerAI*)Control->AI())->DeceiverDeathCount++; + CAST_AI(mob_kiljaeden_controllerAI, Control->AI())->DeceiverDeathCount++; } void UpdateAI(const uint32 diff){ - if(!InCombat) + if(!me->isInCombat()) DoCast(m_creature, SPELL_SHADOW_CHANNELING); if(!UpdateVictim()) @@ -915,8 +911,6 @@ struct TRINITY_DLL_DECL mob_felfire_portalAI : public Scripted_NoMovementAI } - void Aggro(Unit* who) {} - void JustSummoned(Creature* summoned) { summoned->setFaction(m_creature->getFaction()); @@ -958,8 +952,6 @@ struct TRINITY_DLL_DECL mob_volatile_felfire_fiendAI : public ScriptedAI LockedTarget = false; } - void Aggro(Unit* who) {} - void DamageTaken(Unit *done_by, uint32 &damage) { if(damage > m_creature->GetHealth()) @@ -1007,8 +999,6 @@ struct TRINITY_DLL_DECL mob_armageddonAI : public Scripted_NoMovementAI Timer = 0; } - void Aggro(Unit* who){} - void UpdateAI(const uint32 diff) { if(Timer < diff){ @@ -1045,7 +1035,7 @@ CreatureAI* GetAI_mob_armageddon(Creature *_Creature) struct TRINITY_DLL_DECL mob_shield_orbAI : public ScriptedAI { mob_shield_orbAI(Creature* c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } bool PointReached; @@ -1068,10 +1058,7 @@ struct TRINITY_DLL_DECL mob_shield_orbAI : public ScriptedAI else Clockwise = false; } - void Reset(){ - } - - void Aggro(Unit* who){} + void Reset(){} void UpdateAI(const uint32 diff){ if(PointReached){ @@ -1130,8 +1117,6 @@ struct TRINITY_DLL_DECL mob_sinster_reflectionAI : public ScriptedAI Class = 0; } - void Aggro(Unit* who){} - void UpdateAI(const uint32 diff){ if(Class == 0){ @@ -1199,7 +1184,7 @@ struct TRINITY_DLL_DECL mob_sinster_reflectionAI : public ScriptedAI Timer[1] = 4000; } if(Timer[2] < diff){ - DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0, 100, true), SPELL_SR_CURSE_OF_AGONY, true); + DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true), SPELL_SR_CURSE_OF_AGONY, true); Timer[2] = 3000; } DoMeleeAttackIfReady(); diff --git a/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_muru.cpp b/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_muru.cpp index 6000ee474e0..cd53ca034f4 100644 --- a/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_muru.cpp +++ b/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_muru.cpp @@ -116,7 +116,7 @@ uint32 EnrageTimer = 600000; struct TRINITY_DLL_DECL boss_entropiusAI : public ScriptedAI { boss_entropiusAI(Creature *c) : ScriptedAI(c), Summons(m_creature){ - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); Combat = false; } @@ -137,7 +137,7 @@ struct TRINITY_DLL_DECL boss_entropiusAI : public ScriptedAI } } - void Aggro(Unit *who) { + void EnterCombat(Unit *who) { DoCastAOE(SPELL_NEGATIVE_ENERGY_E, true); DoCast(m_creature, SPELL_ENTROPIUS_SPAWN, false); } @@ -155,7 +155,7 @@ struct TRINITY_DLL_DECL boss_entropiusAI : public ScriptedAI m_creature->SummonCreature(CREATURE_DARK_FIENDS, x,y,z,o, TEMPSUMMON_CORPSE_DESPAWN, 0); break; } - summoned->AI()->AttackStart(SelectUnit(SELECT_TARGET_RANDOM,0, 50, true)); + summoned->AI()->AttackStart(SelectTarget(SELECT_TARGET_RANDOM,0, 50, true)); Summons.Summon(summoned); } @@ -180,10 +180,10 @@ struct TRINITY_DLL_DECL boss_entropiusAI : public ScriptedAI }else EnrageTimer -= diff; if(BlackHoleSummonTimer < diff){ - Unit* random = SelectUnit(SELECT_TARGET_RANDOM, 0, 100, true); + Unit* random = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true); if(!random)return; DoCast(random, SPELL_DARKNESS_E, false); - random = SelectUnit(SELECT_TARGET_RANDOM, 0, 100, true); + random = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true); if(!random)return; random->CastSpell(random, SPELL_BLACKHOLE, false); BlackHoleSummonTimer = 15000; @@ -202,7 +202,7 @@ CreatureAI* GetAI_boss_entropius(Creature *_Creature) struct TRINITY_DLL_DECL boss_muruAI : public Scripted_NoMovementAI { boss_muruAI(Creature *c) : Scripted_NoMovementAI(c), Summons(m_creature){ - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } ScriptedInstance* pInstance; @@ -230,7 +230,7 @@ struct TRINITY_DLL_DECL boss_muruAI : public Scripted_NoMovementAI pInstance->SetData(DATA_MURU_EVENT, NOT_STARTED); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { if(pInstance) pInstance->SetData(DATA_MURU_EVENT, IN_PROGRESS); @@ -260,7 +260,7 @@ struct TRINITY_DLL_DECL boss_muruAI : public Scripted_NoMovementAI summoned->CastSpell(summoned,SPELL_DARKFIEND_VISUAL,false); break; } - summoned->AI()->AttackStart(SelectUnit(SELECT_TARGET_RANDOM,0, 50, true)); + summoned->AI()->AttackStart(SelectTarget(SELECT_TARGET_RANDOM,0, 50, true)); Summons.Summon(summoned); } @@ -343,7 +343,7 @@ CreatureAI* GetAI_boss_muru(Creature *_Creature) struct TRINITY_DLL_DECL npc_muru_portalAI : public Scripted_NoMovementAI { npc_muru_portalAI(Creature *c) : Scripted_NoMovementAI(c), Summons(m_creature){ - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } ScriptedInstance* pInstance; @@ -361,11 +361,8 @@ struct TRINITY_DLL_DECL npc_muru_portalAI : public Scripted_NoMovementAI Summons.DespawnAll(); } - void Aggro(Unit *who) {} - void JustSummoned(Creature* summoned){ - Player* Target; - Target = (Player*)(Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_PLAYER_GUID))); + Player* Target = Unit::GetPlayer(pInstance->GetData64(DATA_PLAYER_GUID)); if(Target)summoned->AI()->AttackStart(Target); Summons.Summon(summoned); } @@ -409,7 +406,7 @@ CreatureAI* GetAI_npc_muru_portal(Creature *_Creature) struct TRINITY_DLL_DECL npc_dark_fiendAI : public ScriptedAI { npc_dark_fiendAI(Creature *c) : ScriptedAI(c){ - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } ScriptedInstance* pInstance; @@ -422,8 +419,6 @@ struct TRINITY_DLL_DECL npc_dark_fiendAI : public ScriptedAI m_creature->addUnitState(UNIT_STAT_STUNNED); }; - void Aggro(Unit *who) {} - void SpellHit(Unit* caster, const SpellEntry* Spell){ for(uint8 i = 0; i < 3; ++i) if(Spell->Effect[i] == 38){ @@ -441,7 +436,7 @@ struct TRINITY_DLL_DECL npc_dark_fiendAI : public ScriptedAI if(!InAction){ m_creature->clearUnitState(UNIT_STAT_STUNNED); DoCastAOE(SPELL_DARKFIEND_SKIN, false); - AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 0, 100, true)); + AttackStart(SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)); InAction = true; WaitTimer = 500; }else{ @@ -465,7 +460,7 @@ CreatureAI* GetAI_npc_dark_fiend(Creature *_Creature) struct TRINITY_DLL_DECL npc_void_sentinelAI : public ScriptedAI { npc_void_sentinelAI(Creature *c) : ScriptedAI(c){ - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } ScriptedInstance* pInstance; @@ -482,8 +477,6 @@ struct TRINITY_DLL_DECL npc_void_sentinelAI : public ScriptedAI DoTeleportTo(x,y,71); }; - void Aggro(Unit *who) {} - void JustDied(Unit* killer){ for (uint8 i = 0; i < 8; ++i){ m_creature->SummonCreature(CREATURE_VOID_SPAWN, m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ(), rand()%6, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 180000); @@ -518,7 +511,7 @@ CreatureAI* GetAI_npc_void_sentinel(Creature *_Creature) struct TRINITY_DLL_DECL npc_blackholeAI : public ScriptedAI { npc_blackholeAI(Creature *c) : ScriptedAI(c){ - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } ScriptedInstance* pInstance; @@ -536,8 +529,6 @@ struct TRINITY_DLL_DECL npc_blackholeAI : public ScriptedAI DoCastAOE(SPELL_BLACKHOLE_SPAWN, true); } - void Aggro(Unit *who) {} - void UpdateAI(const uint32 diff) { if(SpellTimer < diff){ diff --git a/src/bindings/scripts/scripts/zone/sunwell_plateau/def_sunwell_plateau.h b/src/bindings/scripts/scripts/zone/sunwell_plateau/def_sunwell_plateau.h index 95fca242175..9fbb5de7300 100644 --- a/src/bindings/scripts/scripts/zone/sunwell_plateau/def_sunwell_plateau.h +++ b/src/bindings/scripts/scripts/zone/sunwell_plateau/def_sunwell_plateau.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * This program is free software licensed under GPL version 2 * Please see the included DOCS/LICENSE.TXT for more information */ diff --git a/src/bindings/scripts/scripts/zone/sunwell_plateau/instance_sunwell_plateau.cpp b/src/bindings/scripts/scripts/zone/sunwell_plateau/instance_sunwell_plateau.cpp index ae58ccfd2c1..72c062c865a 100644 --- a/src/bindings/scripts/scripts/zone/sunwell_plateau/instance_sunwell_plateau.cpp +++ b/src/bindings/scripts/scripts/zone/sunwell_plateau/instance_sunwell_plateau.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * This program is free software licensed under GPL version 2 * Please see the included DOCS/LICENSE.TXT for more information */ @@ -119,20 +119,6 @@ struct TRINITY_DLL_DECL instance_sunwell_plateau : public ScriptedInstance return NULL; } - void HandleGameObject(uint64 guid, uint32 state) - { - Player *player = GetPlayerInMap(); - - if (!player || !guid) - { - debug_log("TSCR: Sunwell Plateau: HandleGameObject fail"); - return; - } - - if (GameObject *go = GameObject::GetGameObject(*player,guid)) - go->SetGoState(state); - } - void OnCreatureCreate(Creature* creature, uint32 entry) { switch(entry) @@ -250,7 +236,7 @@ struct TRINITY_DLL_DECL instance_sunwell_plateau : public ScriptedInstance { } - const char* Save() + std::string GetSaveData() { OUT_SAVE_INST_DATA; std::ostringstream stream; diff --git a/src/bindings/scripts/scripts/zone/tanaris/tanaris.cpp b/src/bindings/scripts/scripts/zone/tanaris/tanaris.cpp index 8e1a9967bb8..cefca8902d3 100644 --- a/src/bindings/scripts/scripts/zone/tanaris/tanaris.cpp +++ b/src/bindings/scripts/scripts/zone/tanaris/tanaris.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>.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 @@ -17,7 +17,7 @@ /* ScriptData SDName: Tanaris SD%Complete: 80 -SDComment: Quest support: 2954, 4005, 10277, 648, 10279(Special flight path). Noggenfogger vendor +SDComment: Quest support: 648, 2954, 4005, 10277, 10279(Special flight path). Noggenfogger vendor SDCategory: Tanaris EndScriptData */ @@ -66,19 +66,19 @@ struct TRINITY_DLL_DECL mob_aquementasAI : public ScriptedAI void SendItem(Unit* receiver) { - if (((Player*)receiver)->HasItemCount(11169,1,false) && - ((Player*)receiver)->HasItemCount(11172,11,false) && - ((Player*)receiver)->HasItemCount(11173,1,false) && - !((Player*)receiver)->HasItemCount(11522,1,true)) + 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 = ((Player*)receiver)->CanStoreNewItem( NULL_BAG, NULL_SLOT, dest, 11522, 1, false); + uint8 msg = CAST_PLR(receiver)->CanStoreNewItem( NULL_BAG, NULL_SLOT, dest, 11522, 1, false); if( msg == EQUIP_ERR_OK ) - ((Player*)receiver)->StoreNewItem( dest, 11522, 1, true); + CAST_PLR(receiver)->StoreNewItem( dest, 11522, 1, true); } } - void Aggro(Unit* who) + void EnterCombat(Unit* who) { DoScriptText(AGGRO_YELL_AQUE, m_creature, who); } @@ -179,7 +179,7 @@ struct TRINITY_DLL_DECL npc_custodian_of_timeAI : public npc_escortAI DoScriptText(WHISPER_CUSTODIAN_14, m_creature, pTemp); DoCast(pTemp,34883); //below here is temporary workaround, to be removed when spell works properly - ((Player*)pTemp)->AreaExploredOrEventHappens(10277); + CAST_PLR(pTemp)->AreaExploredOrEventHappens(10277); break; } } @@ -191,18 +191,18 @@ struct TRINITY_DLL_DECL npc_custodian_of_timeAI : public npc_escortAI if( who->GetTypeId() == TYPEID_PLAYER ) { - if( ((Player*)who)->HasAura(34877,1) && ((Player*)who)->GetQuestStatus(10277) == QUEST_STATUS_INCOMPLETE ) + if( CAST_PLR(who)->HasAura(34877) && CAST_PLR(who)->GetQuestStatus(10277) == QUEST_STATUS_INCOMPLETE ) { float Radius = 10.0; if( m_creature->IsWithinDistInMap(who, Radius) ) { - ((npc_escortAI*)(m_creature->AI()))->Start(false, false, false, who->GetGUID()); + Start(false, false, false, who->GetGUID()); } } } } - void Aggro(Unit* who) { } + void EnterCombat(Unit* who) { } void Reset() { } void UpdateAI(const uint32 diff) @@ -211,40 +211,13 @@ struct TRINITY_DLL_DECL npc_custodian_of_timeAI : public npc_escortAI } }; -CreatureAI* GetAI_npc_custodian_of_time(Creature *_Creature) +CreatureAI* GetAI_npc_custodian_of_time(Creature* pCreature) { - npc_custodian_of_timeAI* custodian_of_timeAI = new npc_custodian_of_timeAI(_Creature); - - custodian_of_timeAI->AddWaypoint(0, -8535.57,-4212.61, -212.04); - custodian_of_timeAI->AddWaypoint(1, -8456.48,-4211.77, -213.30); - custodian_of_timeAI->AddWaypoint(2, -8374.93,-4250.21, -205.05,5000); - custodian_of_timeAI->AddWaypoint(3, -8374.93,-4250.21, -204.38,16000); - custodian_of_timeAI->AddWaypoint(4, -8374.93,-4250.21, -204.38,10000); - custodian_of_timeAI->AddWaypoint(5, -8374.93,-4250.21, -204.38,2000); - custodian_of_timeAI->AddWaypoint(6, -8439.40,-4180.05, -209.25); - custodian_of_timeAI->AddWaypoint(7, -8437.82,-4120.84, -208.59,10000); - custodian_of_timeAI->AddWaypoint(8, -8437.82,-4120.84, -208.59,16000); - custodian_of_timeAI->AddWaypoint(9, -8437.82,-4120.84, -208.59,13000); - custodian_of_timeAI->AddWaypoint(10, -8437.82,-4120.84, -208.59,18000); - custodian_of_timeAI->AddWaypoint(11, -8437.82,-4120.84, -208.59,15000); - custodian_of_timeAI->AddWaypoint(12, -8437.82,-4120.84, -208.59,2000); - custodian_of_timeAI->AddWaypoint(13, -8467.26,-4198.63, -214.21); - custodian_of_timeAI->AddWaypoint(14, -8667.76,-4252.13, -209.56); - custodian_of_timeAI->AddWaypoint(15, -8703.71,-4234.58, -209.5,14000); - custodian_of_timeAI->AddWaypoint(16, -8703.71,-4234.58, -209.5,2000); - custodian_of_timeAI->AddWaypoint(17, -8642.81,-4304.37, -209.57); - custodian_of_timeAI->AddWaypoint(18, -8649.06,-4394.36, -208.46,6000); - custodian_of_timeAI->AddWaypoint(19, -8649.06,-4394.36, -208.46,18000); - custodian_of_timeAI->AddWaypoint(20, -8649.06,-4394.36, -208.46,2000); - custodian_of_timeAI->AddWaypoint(21, -8468.72,-4437.67, -215.45); - custodian_of_timeAI->AddWaypoint(22, -8427.54,-4426, -211.13); - custodian_of_timeAI->AddWaypoint(23, -8364.83,-4393.32, -205.91); - custodian_of_timeAI->AddWaypoint(24, -8304.54,-4357.2, -208.2,18000); - custodian_of_timeAI->AddWaypoint(25, -8304.54,-4357.2, -208.2,2000); - custodian_of_timeAI->AddWaypoint(26, -8375.42,-4250.41, -205.14,5000); - custodian_of_timeAI->AddWaypoint(27, -8375.42,-4250.41, -205.14,5000); - - return (CreatureAI*)custodian_of_timeAI; + npc_custodian_of_timeAI* custodian_of_timeAI = new npc_custodian_of_timeAI(pCreature); + + custodian_of_timeAI->FillPointMovementListForCreature(); + + return custodian_of_timeAI; } /*###### @@ -405,16 +378,15 @@ struct TRINITY_DLL_DECL npc_OOX17AI : public npc_escortAI 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); - {Unit* scoff = FindCreature(SPAWN_SECOND_2, 30, m_creature); - if(scoff) - DoScriptText(SAY_SCOFF, scoff);}break; + if(Unit* scoff = me->FindNearestCreature(SPAWN_SECOND_2, 30)) + DoScriptText(SAY_SCOFF, scoff); break; case 86: if (player) { DoScriptText(SAY_CHICKEN_COMP, m_creature); - ((Player*)player)->GroupEventHappens(Q_OOX17, m_creature); + player->GroupEventHappens(Q_OOX17, m_creature); } break; } @@ -422,7 +394,7 @@ struct TRINITY_DLL_DECL npc_OOX17AI : public npc_escortAI void Reset(){} - void Aggro(Unit* who) + void EnterCombat(Unit* who) { switch (rand()%2) { @@ -441,7 +413,7 @@ struct TRINITY_DLL_DECL npc_OOX17AI : public npc_escortAI if (PlayerGUID) { if (Player* player = Unit::GetPlayer(PlayerGUID)) - ((Player*)player)->FailQuest(Q_OOX17); + CAST_PLR(player)->FailQuest(Q_OOX17); } } @@ -463,7 +435,7 @@ bool QuestAccept_npc_OOX17(Player* player, Creature* creature, Quest const* ques creature->SetUInt32Value(UNIT_FIELD_BYTES_1,0); creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); DoScriptText(SAY_CHICKEN_ACC, creature); - ((npc_escortAI*)(creature->AI()))->Start(true, true, false, player->GetGUID()); + CAST_AI(npc_escortAI, (creature->AI()))->Start(true, true, false, player->GetGUID()); } return true; @@ -561,7 +533,7 @@ CreatureAI* GetAI_npc_OOX17(Creature *_Creature) OOX17AI->AddWaypoint(85, -6944.81, -4816.58, 1.60); OOX17AI->AddWaypoint(86, -6942.06, -4839.40, 0.66,5000); - return (CreatureAI*)OOX17AI; + return OOX17AI; } /*###### diff --git a/src/bindings/scripts/scripts/zone/teldrassil/teldrassil.cpp b/src/bindings/scripts/scripts/zone/teldrassil/teldrassil.cpp new file mode 100644 index 00000000000..fb376795119 --- /dev/null +++ b/src/bindings/scripts/scripts/zone/teldrassil/teldrassil.cpp @@ -0,0 +1,193 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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: 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->InterruptNonMeleeSpells(true); + m_creature->RemoveAllAuras(); + m_creature->DeleteThreatList(); + m_creature->CombatStop(); + m_creature->LoadCreaturesAddon(); + + if (m_creature->isAlive()) + { + if (Player* pPlayer = Unit::GetPlayer(uiPlayerGUID)) + m_creature->GetMotionMaster()->MoveFollow(pPlayer, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE); + 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, PET_FOLLOW_ANGLE); + } + + 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->FailTimedQuest(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/tempest_keep/arcatraz/arcatraz.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/arcatraz.cpp index a61a9c9b163..0392437eeb5 100644 --- a/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/arcatraz.cpp +++ b/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/arcatraz.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -63,7 +63,7 @@ struct TRINITY_DLL_DECL npc_millhouse_manastormAI : public ScriptedAI { npc_millhouse_manastormAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } ScriptedInstance* pInstance; @@ -102,20 +102,12 @@ struct TRINITY_DLL_DECL npc_millhouse_manastormAI : public ScriptedAI { if (m_creature->Attack(who, true)) { - m_creature->AddThreat(who, 0.0f); - - if (!InCombat) - { - InCombat = true; - Aggro(who); - } - //TODO: Make it so he moves when target out of range DoStartNoMovement(who); } } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } @@ -259,7 +251,7 @@ struct TRINITY_DLL_DECL npc_warden_mellicharAI : public ScriptedAI { npc_warden_mellicharAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } ScriptedInstance* pInstance; @@ -301,11 +293,11 @@ struct TRINITY_DLL_DECL npc_warden_mellicharAI : public ScriptedAI float attackRadius = m_creature->GetAttackDistance(who)/10; if( m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who) ) - Aggro(who); + EnterCombat(who); } } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { DoScriptText(YELL_INTRO1, m_creature); DoCast(m_creature,SPELL_BUBBLE_VISUAL); @@ -314,7 +306,7 @@ struct TRINITY_DLL_DECL npc_warden_mellicharAI : public ScriptedAI { pInstance->SetData(TYPE_HARBINGERSKYRISS,IN_PROGRESS); if (GameObject* Sphere = GameObject::GetGameObject(*m_creature,pInstance->GetData64(DATA_SPHERE_SHIELD))) - Sphere->SetGoState(1); + Sphere->SetGoState(GO_STATE_READY); IsRunning = true; } } @@ -347,7 +339,7 @@ struct TRINITY_DLL_DECL npc_warden_mellicharAI : public ScriptedAI if( pInstance ) { m_creature->InterruptNonMeleeSpells(true); - m_creature->RemoveSpellsCausingAura(SPELL_AURA_DUMMY); + m_creature->RemoveAurasByType(SPELL_AURA_DUMMY); switch( Phase ) { @@ -355,7 +347,7 @@ struct TRINITY_DLL_DECL npc_warden_mellicharAI : public ScriptedAI DoCast(m_creature,SPELL_TARGET_ALPHA); pInstance->SetData(TYPE_WARDEN_1,IN_PROGRESS); if (GameObject *Sphere = GameObject::GetGameObject(*m_creature,pInstance->GetData64(DATA_SPHERE_SHIELD))) - Sphere->SetGoState(1); + Sphere->SetGoState(GO_STATE_READY); break; case 3: DoCast(m_creature,SPELL_TARGET_BETA); @@ -499,7 +491,7 @@ struct TRINITY_DLL_DECL mob_zerekethvoidzoneAI : public ScriptedAI DoCast(m_creature,SPELL_VOID_ZONE_DAMAGE); } - void Aggro(Unit* who) {} + void EnterCombat(Unit* who) {} }; CreatureAI* GetAI_mob_zerekethvoidzoneAI(Creature *_Creature) { diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/boss_harbinger_skyriss.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/boss_harbinger_skyriss.cpp index da2b392072a..37e12c60b2e 100644 --- a/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/boss_harbinger_skyriss.cpp +++ b/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/boss_harbinger_skyriss.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -57,7 +57,7 @@ struct TRINITY_DLL_DECL boss_harbinger_skyrissAI : public ScriptedAI { boss_harbinger_skyrissAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); HeroicMode = m_creature->GetMap()->IsHeroic(); Intro = false; } @@ -101,7 +101,7 @@ struct TRINITY_DLL_DECL boss_harbinger_skyrissAI : public ScriptedAI ScriptedAI::MoveInLineOfSight(who); } - void Aggro(Unit *who) {} + void EnterCombat(Unit *who) {} void JustDied(Unit* Killer) { @@ -163,7 +163,7 @@ struct TRINITY_DLL_DECL boss_harbinger_skyrissAI : public ScriptedAI case 1: DoScriptText(SAY_INTRO, m_creature); if (GameObject* Sphere = GameObject::GetGameObject(*m_creature,pInstance->GetData64(DATA_SPHERE_SHIELD))) - Sphere->SetGoState(0); + Sphere->SetGoState(GO_STATE_ACTIVE); ++Intro_Phase; Intro_Timer = 25000; break; @@ -279,7 +279,7 @@ struct TRINITY_DLL_DECL boss_harbinger_skyriss_illusionAI : public ScriptedAI { boss_harbinger_skyriss_illusionAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); HeroicMode = m_creature->GetMap()->IsHeroic(); } @@ -288,7 +288,7 @@ struct TRINITY_DLL_DECL boss_harbinger_skyriss_illusionAI : public ScriptedAI void Reset() { } - void Aggro(Unit *who) { } + void EnterCombat(Unit *who) { } }; CreatureAI* GetAI_boss_harbinger_skyriss_illusion(Creature *_Creature) diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/def_arcatraz.h b/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/def_arcatraz.h index 76f8d575383..3f8dee8bbd0 100644 --- a/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/def_arcatraz.h +++ b/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/def_arcatraz.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * This program is free software licensed under GPL version 2 * Please see the included DOCS/LICENSE.TXT for more information */ diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/instance_arcatraz.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/instance_arcatraz.cpp index 5f1fb087655..a0d21e302b5 100644 --- a/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/instance_arcatraz.cpp +++ b/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/instance_arcatraz.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/botanica/boss_high_botanist_freywinn.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/botanica/boss_high_botanist_freywinn.cpp index c9f88c57b2d..13e65b9e416 100644 --- a/src/bindings/scripts/scripts/zone/tempest_keep/botanica/boss_high_botanist_freywinn.cpp +++ b/src/bindings/scripts/scripts/zone/tempest_keep/botanica/boss_high_botanist_freywinn.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -64,7 +64,7 @@ struct TRINITY_DLL_DECL boss_high_botanist_freywinnAI : public ScriptedAI MoveFree = true; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { DoScriptText(SAY_AGGRO, m_creature); } diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/botanica/boss_laj.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/botanica/boss_laj.cpp index e95d8328907..69abca68dff 100644 --- a/src/bindings/scripts/scripts/zone/tempest_keep/botanica/boss_laj.cpp +++ b/src/bindings/scripts/scripts/zone/tempest_keep/botanica/boss_laj.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -140,7 +140,7 @@ struct TRINITY_DLL_DECL boss_lajAI : public ScriptedAI CanSummon = false; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/botanica/boss_warp_splinter.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/botanica/boss_warp_splinter.cpp index 5306aa690cf..51ebe1f70c9 100644 --- a/src/bindings/scripts/scripts/zone/tempest_keep/botanica/boss_warp_splinter.cpp +++ b/src/bindings/scripts/scripts/zone/tempest_keep/botanica/boss_warp_splinter.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -44,9 +44,9 @@ struct TRINITY_DLL_DECL mob_treantAI : public ScriptedAI check_Timer = 0; } - void Aggro(Unit *who) {} + void EnterCombat(Unit *who) {} - void MoveInLineOfSight(Unit*) {} + void MoveInLineOfSight(Unit* who) {} void UpdateAI(const uint32 diff) { @@ -54,7 +54,7 @@ struct TRINITY_DLL_DECL mob_treantAI : public ScriptedAI { if(WarpGuid && check_Timer < diff) { - if(Unit *Warp = (Unit*)Unit::GetUnit(*m_creature, WarpGuid)) + if(Unit *Warp = Unit::GetUnit(*m_creature, WarpGuid)) { if(m_creature->IsWithinMeleeRange(Warp,2.5f)) { @@ -130,7 +130,7 @@ struct TRINITY_DLL_DECL boss_warp_splinterAI : public ScriptedAI m_creature->SetSpeed( MOVE_RUN, 0.7f, true); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { DoScriptText(SAY_AGGRO, m_creature); } @@ -160,7 +160,7 @@ struct TRINITY_DLL_DECL boss_warp_splinterAI : public ScriptedAI float O = - m_creature->GetAngle(X,Y); if(Creature *pTreant = m_creature->SummonCreature(CREATURE_TREANT,treant_pos[i][0],treant_pos[i][1],treant_pos[i][2],O,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,25000)) - ((mob_treantAI*)pTreant->AI())->WarpGuid = m_creature->GetGUID(); + CAST_AI(mob_treantAI, pTreant->AI())->WarpGuid = m_creature->GetGUID(); } switch(rand()%2) { diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_alar.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_alar.cpp index a66d8b7e9e8..6a927191322 100644 --- a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_alar.cpp +++ b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_alar.cpp @@ -69,7 +69,7 @@ struct TRINITY_DLL_DECL boss_alarAI : public ScriptedAI { boss_alarAI(Creature *c) : ScriptedAI(c) { - pInstance =((ScriptedInstance*)c->GetInstanceData()); + pInstance =(c->GetInstanceData()); DefaultMoveSpeedRate = m_creature->GetSpeedRate(MOVE_RUN); } @@ -122,7 +122,7 @@ struct TRINITY_DLL_DECL boss_alarAI : public ScriptedAI m_creature->setActive(false); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { if(pInstance) pInstance->SetData(DATA_ALAREVENT, IN_PROGRESS); @@ -150,9 +150,9 @@ struct TRINITY_DLL_DECL boss_alarAI : public ScriptedAI void AttackStart(Unit* who) { if(Phase1) - ScriptedAI::AttackStart(who, false); + AttackStartNoMove(who); else - ScriptedAI::AttackStart(who, true); + ScriptedAI::AttackStart(who); } void DamageTaken(Unit* pKiller, uint32 &damage) @@ -241,12 +241,12 @@ struct TRINITY_DLL_DECL boss_alarAI : public ScriptedAI WaitEvent = WE_DUMMY; return; case WE_DIE: - m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, PLAYER_STATE_DEAD); + m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_DEAD); WaitTimer = 5000; WaitEvent = WE_REVIVE; return; case WE_REVIVE: - m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, PLAYER_STATE_NONE); + m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_STAND); m_creature->SetHealth(m_creature->GetMaxHealth()); m_creature->SetSpeed(MOVE_RUN, DefaultMoveSpeedRate); m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); @@ -352,7 +352,7 @@ struct TRINITY_DLL_DECL boss_alarAI : public ScriptedAI if(Charge_Timer < diff) { - Unit *target= SelectUnit(SELECT_TARGET_RANDOM, 1, GetSpellMaxRange(SPELL_CHARGE), true); + Unit *target= SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true); if(target) DoCast(target, SPELL_CHARGE); Charge_Timer = 30000; @@ -432,7 +432,7 @@ struct TRINITY_DLL_DECL mob_ember_of_alarAI : public ScriptedAI { mob_ember_of_alarAI(Creature *c) : ScriptedAI(c) { - pInstance = (ScriptedInstance*)c->GetInstanceData(); + pInstance = c->GetInstanceData(); m_creature->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true); } @@ -441,7 +441,7 @@ struct TRINITY_DLL_DECL mob_ember_of_alarAI : public ScriptedAI bool toDie; void Reset() {toDie = false;} - void Aggro(Unit *who) {DoZoneInCombat();} + void EnterCombat(Unit *who) {DoZoneInCombat();} void EnterEvadeMode() {m_creature->setDeathState(JUST_DIED);} void DamageTaken(Unit* pKiller, uint32 &damage) @@ -492,7 +492,7 @@ struct TRINITY_DLL_DECL mob_flame_patch_alarAI : public ScriptedAI { mob_flame_patch_alarAI(Creature *c) : ScriptedAI(c) {} void Reset() {} - void Aggro(Unit *who) {} + void EnterCombat(Unit *who) {} void AttackStart(Unit* who) {} void MoveInLineOfSight(Unit* who) {} void UpdateAI(const uint32 diff) {} diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_astromancer.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_astromancer.cpp index 4e2320d1d90..f886ecae224 100644 --- a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_astromancer.cpp +++ b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_astromancer.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -72,7 +72,7 @@ struct TRINITY_DLL_DECL boss_high_astromancer_solarianAI : public ScriptedAI { boss_high_astromancer_solarianAI(Creature *c) : ScriptedAI(c), Summons(m_creature) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); defaultarmor = m_creature->GetArmor(); defaultsize = m_creature->GetFloatValue(OBJECT_FIELD_SCALE_X); @@ -120,6 +120,7 @@ struct TRINITY_DLL_DECL boss_high_astromancer_solarianAI : public ScriptedAI Jump_Timer=8000; Wrath_Timer = 20000+rand()%5000;//twice in phase one Phase = 1; + Wrath_Timer = 20000+rand()%5000;//twice in phase one if(pInstance) pInstance->SetData(DATA_HIGHASTROMANCERSOLARIANEVENT, NOT_STARTED); @@ -161,7 +162,7 @@ struct TRINITY_DLL_DECL boss_high_astromancer_solarianAI : public ScriptedAI pInstance->SetData(DATA_HIGHASTROMANCERSOLARIANEVENT, DONE); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { StartEvent(); } @@ -229,7 +230,7 @@ struct TRINITY_DLL_DECL boss_high_astromancer_solarianAI : public ScriptedAI if( Wrath_Timer < diff) { m_creature->InterruptNonMeleeSpells(false); - DoCast(SelectUnit(SELECT_TARGET_RANDOM,1,100,true), SPELL_WRATH_OF_THE_ASTROMANCER, true); + DoCast(SelectTarget(SELECT_TARGET_RANDOM,1,100,true), SPELL_WRATH_OF_THE_ASTROMANCER, true); Wrath_Timer = 20000+rand()%5000; }else Wrath_Timer -= diff; @@ -259,7 +260,7 @@ struct TRINITY_DLL_DECL boss_high_astromancer_solarianAI : public ScriptedAI if (MarkOfTheAstromancer_Timer < diff) //A debuff that lasts for 5 seconds, cast several times each phase on a random raid member, but not the main tank { - Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1, 100, true); + Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true); if(target) DoCast(target, SPELL_MARK_OF_THE_ASTROMANCER); else DoCast(m_creature->getVictim(), SPELL_MARK_OF_THE_ASTROMANCER); @@ -392,7 +393,7 @@ struct TRINITY_DLL_DECL mob_solarium_priestAI : public ScriptedAI { mob_solarium_priestAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } ScriptedInstance *pInstance; @@ -408,7 +409,7 @@ struct TRINITY_DLL_DECL mob_solarium_priestAI : public ScriptedAI aoesilenceTimer = 15000; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_kaelthas.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_kaelthas.cpp index 1a2fcaea1a2..28bd1590f03 100644 --- a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_kaelthas.cpp +++ b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_kaelthas.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -159,7 +159,7 @@ struct TRINITY_DLL_DECL advisorbase_ai : public ScriptedAI advisorbase_ai(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } void MoveInLineOfSight(Unit *who) @@ -193,7 +193,7 @@ struct TRINITY_DLL_DECL advisorbase_ai : public ScriptedAI if(pInstance && (pInstance->GetData(DATA_KAELTHASEVENT) == 1 || pInstance->GetData(DATA_KAELTHASEVENT) == 3)) { Creature *Kaelthas = NULL; - Kaelthas = (Creature*)(Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_KAELTHAS))); + Kaelthas = (Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_KAELTHAS))); if(Kaelthas) Kaelthas->AI()->EnterEvadeMode(); @@ -238,7 +238,7 @@ struct TRINITY_DLL_DECL advisorbase_ai : public ScriptedAI m_creature->SetUInt64Value(UNIT_FIELD_TARGET,0); m_creature->GetMotionMaster()->Clear(); m_creature->GetMotionMaster()->MoveIdle(); - m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,PLAYER_STATE_DEAD); + m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,UNIT_STAND_STATE_DEAD); if (pInstance->GetData(DATA_KAELTHASEVENT) == 3) JustDied(pKiller); @@ -274,7 +274,7 @@ struct TRINITY_DLL_DECL boss_kaelthasAI : public ScriptedAI { boss_kaelthasAI(Creature *c) : ScriptedAI(c), summons(m_creature) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); AdvisorGuid[0] = 0; AdvisorGuid[1] = 0; AdvisorGuid[2] = 0; @@ -311,10 +311,7 @@ struct TRINITY_DLL_DECL boss_kaelthasAI : public ScriptedAI void DeleteLegs() { - InstanceMap::PlayerList const &playerliste = ((InstanceMap*)m_creature->GetMap())->GetPlayers(); - InstanceMap::PlayerList::const_iterator it; - - Map::PlayerList const &PlayerList = ((InstanceMap*)m_creature->GetMap())->GetPlayers(); + Map::PlayerList const &PlayerList = m_creature->GetMap()->GetPlayers(); for(Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) { Player* i_pl = i->getSource(); @@ -350,7 +347,7 @@ struct TRINITY_DLL_DECL boss_kaelthasAI : public ScriptedAI IsCastingFireball = false; ChainPyros = false; - if(InCombat) + if(m_creature->isInCombat()) PrepareAdvisors(); DeleteLegs(); @@ -368,7 +365,7 @@ struct TRINITY_DLL_DECL boss_kaelthasAI : public ScriptedAI Creature *pCreature; for(uint8 i = 0; i < 4; ++i) { - pCreature = (Creature*)(Unit::GetUnit((*m_creature), AdvisorGuid[i])); + pCreature = (Unit::GetCreature((*m_creature), AdvisorGuid[i])); if(pCreature) { pCreature->Respawn(); @@ -470,7 +467,7 @@ struct TRINITY_DLL_DECL boss_kaelthasAI : public ScriptedAI } } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { if (pInstance && !pInstance->GetData(DATA_KAELTHASEVENT) && !Phase) StartEvent(); @@ -538,7 +535,7 @@ struct TRINITY_DLL_DECL boss_kaelthasAI : public ScriptedAI case 1: if(Phase_Timer < diff) { - Advisor = (Creature*)(Unit::GetUnit((*m_creature), AdvisorGuid[0])); + Advisor = (Unit::GetCreature((*m_creature), AdvisorGuid[0])); if(Advisor) { @@ -556,8 +553,8 @@ struct TRINITY_DLL_DECL boss_kaelthasAI : public ScriptedAI //Subphase 2 - Start case 2: - Advisor = (Creature*)(Unit::GetUnit((*m_creature), AdvisorGuid[0])); - if(Advisor && (Advisor->GetUInt32Value(UNIT_FIELD_BYTES_1) == PLAYER_STATE_DEAD)) + Advisor = (Unit::GetCreature((*m_creature), AdvisorGuid[0])); + if(Advisor && (Advisor->GetUInt32Value(UNIT_FIELD_BYTES_1) == UNIT_STAND_STATE_DEAD)) { DoScriptText(SAY_INTRO_SANGUINAR, m_creature); @@ -572,7 +569,7 @@ struct TRINITY_DLL_DECL boss_kaelthasAI : public ScriptedAI case 3: if(Phase_Timer < diff) { - Advisor = (Creature*)(Unit::GetUnit((*m_creature), AdvisorGuid[1])); + Advisor = (Unit::GetCreature((*m_creature), AdvisorGuid[1])); if(Advisor) { @@ -590,8 +587,8 @@ struct TRINITY_DLL_DECL boss_kaelthasAI : public ScriptedAI //Subphase 3 - Start case 4: - Advisor = (Creature*)(Unit::GetUnit((*m_creature), AdvisorGuid[1])); - if(Advisor && (Advisor->GetUInt32Value(UNIT_FIELD_BYTES_1) == PLAYER_STATE_DEAD)) + Advisor = (Unit::GetCreature((*m_creature), AdvisorGuid[1])); + if(Advisor && (Advisor->GetUInt32Value(UNIT_FIELD_BYTES_1) == UNIT_STAND_STATE_DEAD)) { DoScriptText(SAY_INTRO_CAPERNIAN, m_creature); @@ -606,7 +603,7 @@ struct TRINITY_DLL_DECL boss_kaelthasAI : public ScriptedAI case 5: if(Phase_Timer < diff) { - Advisor = (Creature*)(Unit::GetUnit((*m_creature), AdvisorGuid[2])); + Advisor = (Unit::GetCreature((*m_creature), AdvisorGuid[2])); if(Advisor) { @@ -624,8 +621,8 @@ struct TRINITY_DLL_DECL boss_kaelthasAI : public ScriptedAI //Subphase 4 - Start case 6: - Advisor = (Creature*)(Unit::GetUnit((*m_creature), AdvisorGuid[2])); - if(Advisor && (Advisor->GetUInt32Value(UNIT_FIELD_BYTES_1) == PLAYER_STATE_DEAD)) + Advisor = (Unit::GetCreature((*m_creature), AdvisorGuid[2])); + if(Advisor && (Advisor->GetUInt32Value(UNIT_FIELD_BYTES_1) == UNIT_STAND_STATE_DEAD)) { DoScriptText(SAY_INTRO_TELONICUS, m_creature); @@ -640,7 +637,7 @@ struct TRINITY_DLL_DECL boss_kaelthasAI : public ScriptedAI case 7: if(Phase_Timer < diff) { - Advisor = (Creature*)(Unit::GetUnit((*m_creature), AdvisorGuid[3])); + Advisor = (Unit::GetCreature((*m_creature), AdvisorGuid[3])); if(Advisor) { @@ -660,8 +657,8 @@ struct TRINITY_DLL_DECL boss_kaelthasAI : public ScriptedAI //End of phase 1 case 8: - Advisor = (Creature*)(Unit::GetUnit((*m_creature), AdvisorGuid[3])); - if(Advisor && (Advisor->GetUInt32Value(UNIT_FIELD_BYTES_1) == PLAYER_STATE_DEAD)) + Advisor = (Unit::GetCreature((*m_creature), AdvisorGuid[3])); + if(Advisor && (Advisor->GetUInt32Value(UNIT_FIELD_BYTES_1) == UNIT_STAND_STATE_DEAD)) { Phase = 2; pInstance->SetData(DATA_KAELTHASEVENT, 2); @@ -730,11 +727,11 @@ struct TRINITY_DLL_DECL boss_kaelthasAI : public ScriptedAI Creature* Advisor; for (uint32 i = 0; i < 4; ++i) { - Advisor = (Creature*)(Unit::GetUnit((*m_creature), AdvisorGuid[i])); + Advisor = (Unit::GetCreature((*m_creature), AdvisorGuid[i])); if (!Advisor) error_log("TSCR: Kael'Thas Advisor %u does not exist. Possibly despawned? Incorrectly Killed?", i); else if(Target) - ((advisorbase_ai*)Advisor->AI())->Revive(Target); + CAST_AI(advisorbase_ai, Advisor->AI())->Revive(Target); } PhaseSubphase = 1; @@ -804,7 +801,7 @@ struct TRINITY_DLL_DECL boss_kaelthasAI : public ScriptedAI if (FlameStrike_Timer < diff) { - if (Unit* pUnit = SelectUnit(SELECT_TARGET_RANDOM, 0, 70, true)) + if (Unit* pUnit = SelectTarget(SELECT_TARGET_RANDOM, 0, 70, true)) DoCast(pUnit, SPELL_FLAME_STRIKE); FlameStrike_Timer = 30000; @@ -816,7 +813,7 @@ struct TRINITY_DLL_DECL boss_kaelthasAI : public ScriptedAI for (uint32 i = 0; i < 3; i++) { - Unit* target =SelectUnit(SELECT_TARGET_RANDOM, 1, 70, true); + Unit* target =SelectTarget(SELECT_TARGET_RANDOM, 1, 70, true); if(!target) target = m_creature->getVictim(); debug_log("TSCR: Kael'Thas mind control not supported."); if(target) @@ -1053,7 +1050,7 @@ struct TRINITY_DLL_DECL boss_thaladred_the_darkenerAI : public advisorbase_ai DoScriptText(SAY_THALADRED_DEATH, m_creature); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) return; @@ -1080,7 +1077,7 @@ struct TRINITY_DLL_DECL boss_thaladred_the_darkenerAI : public advisorbase_ai //Gaze_Timer if(Gaze_Timer < diff) { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0, 100, true)) + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) { DoResetThreat(); if(target) @@ -1128,7 +1125,7 @@ struct TRINITY_DLL_DECL boss_lord_sanguinarAI : public advisorbase_ai DoScriptText(SAY_SANGUINAR_DEATH, m_creature); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) return; @@ -1196,19 +1193,11 @@ struct TRINITY_DLL_DECL boss_grand_astromancer_capernianAI : public advisorbase_ if (m_creature->Attack(who, true)) { - m_creature->AddThreat(who, 0.0f); - - if (!InCombat) - { - InCombat = true; - Aggro(who); - } - DoStartMovement(who, CAPERNIAN_DISTANCE, M_PI/2); } } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) return; @@ -1310,7 +1299,7 @@ struct TRINITY_DLL_DECL boss_master_engineer_telonicusAI : public advisorbase_ai DoScriptText(SAY_TELONICUS_DEATH, m_creature); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) return; @@ -1372,7 +1361,7 @@ struct TRINITY_DLL_DECL mob_kael_flamestrikeAI : public ScriptedAI m_creature->setFaction(14); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } @@ -1408,7 +1397,7 @@ struct TRINITY_DLL_DECL mob_phoenix_tkAI : public ScriptedAI { mob_phoenix_tkAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } ScriptedInstance* pInstance; @@ -1432,13 +1421,13 @@ struct TRINITY_DLL_DECL mob_phoenix_tkAI : public ScriptedAI void Reset() { - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT + MOVEMENTFLAG_LEVITATING);//birds can fly! :) + m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);//birds can fly! :) egg = true; Cycle_Timer = 2000; m_creature->CastSpell(m_creature,SPELL_BURN,true); } - void Aggro(Unit *who) { } + void EnterCombat(Unit *who) { } void DamageTaken(Unit* pKiller, uint32 &damage) { @@ -1495,16 +1484,11 @@ struct TRINITY_DLL_DECL mob_phoenix_egg_tkAI : public ScriptedAI { if (m_creature->Attack(who, false)) { - if (!InCombat) - { - InCombat = true; - Aggro(who); - } DoStartNoMovement(who); } } - void Aggro(Unit *who) { } + void EnterCombat(Unit *who) { } void JustSummoned(Creature* summoned) { diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_void_reaver.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_void_reaver.cpp index 708e5feffcd..aa96435bbb1 100644 --- a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_void_reaver.cpp +++ b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_void_reaver.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -41,7 +41,7 @@ struct TRINITY_DLL_DECL boss_void_reaverAI : public ScriptedAI { boss_void_reaverAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } ScriptedInstance* pInstance; @@ -84,7 +84,7 @@ struct TRINITY_DLL_DECL boss_void_reaverAI : public ScriptedAI pInstance->SetData(DATA_VOIDREAVEREVENT, DONE); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { DoScriptText(SAY_AGGRO, m_creature); diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/def_the_eye.h b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/def_the_eye.h index 7162fb90199..d0d3ea09061 100644 --- a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/def_the_eye.h +++ b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/def_the_eye.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * This program is free software licensed under GPL version 2 * Please see the included DOCS/LICENSE.TXT for more information */ diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/instance_the_eye.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/instance_the_eye.cpp index c6352a9e67c..55ef8c60bbd 100644 --- a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/instance_the_eye.cpp +++ b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/instance_the_eye.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -77,7 +77,7 @@ struct TRINITY_DLL_DECL instance_the_eye : public ScriptedInstance void OnCreatureCreate(Creature *creature, uint32 creature_entry) { - switch(creature_entry) + switch(creature->GetEntry()) { case 20064: ThaladredTheDarkener = creature->GetGUID(); break; case 20063: MasterEngineerTelonicus = creature->GetGUID(); break; @@ -129,7 +129,7 @@ struct TRINITY_DLL_DECL instance_the_eye : public ScriptedInstance return 0; } - const char* Save() + std::string GetSaveData() { OUT_SAVE_INST_DATA; std::ostringstream stream; diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/the_eye.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/the_eye.cpp index ef3860c0581..89d5e04e0c3 100644 --- a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/the_eye.cpp +++ b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/the_eye.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -44,7 +44,7 @@ struct TRINITY_DLL_DECL mob_crystalcore_devastatorAI : public ScriptedAI Knockaway_Timer = 25000; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_gatewatcher_gyrokill.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_gatewatcher_gyrokill.cpp index c77989e27f3..268cfeb2918 100644 --- a/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_gatewatcher_gyrokill.cpp +++ b/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_gatewatcher_gyrokill.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_gatewatcher_ironhand.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_gatewatcher_ironhand.cpp index bd8fc581e9d..86e36072546 100644 --- a/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_gatewatcher_ironhand.cpp +++ b/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_gatewatcher_ironhand.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -44,7 +44,7 @@ struct TRINITY_DLL_DECL boss_gatewatcher_iron_handAI : public ScriptedAI { boss_gatewatcher_iron_handAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); HeroicMode = m_creature->GetMap()->IsHeroic(); } @@ -63,7 +63,7 @@ struct TRINITY_DLL_DECL boss_gatewatcher_iron_handAI : public ScriptedAI Stream_of_Machine_Fluid_Timer = 55000; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { DoScriptText(SAY_AGGRO_1, m_creature); } diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_nethermancer_sepethrea.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_nethermancer_sepethrea.cpp index 14bf854b6df..e14aba074cf 100644 --- a/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_nethermancer_sepethrea.cpp +++ b/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_nethermancer_sepethrea.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -45,7 +45,7 @@ struct TRINITY_DLL_DECL boss_nethermancer_sepethreaAI : public ScriptedAI { boss_nethermancer_sepethreaAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); HeroicMode = m_creature->GetMap()->IsHeroic(); } @@ -71,7 +71,7 @@ struct TRINITY_DLL_DECL boss_nethermancer_sepethreaAI : public ScriptedAI pInstance->SetData(DATA_NETHERMANCER_EVENT, NOT_STARTED); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { if(pInstance) pInstance->SetData(DATA_NETHERMANCER_EVENT, IN_PROGRESS); @@ -108,7 +108,7 @@ struct TRINITY_DLL_DECL boss_nethermancer_sepethreaAI : public ScriptedAI if(frost_attack_Timer < diff) { DoCast(m_creature->getVictim(),SPELL_FROST_ATTACK); - frost_attack_Timer = 7000 + rand()%30000; + frost_attack_Timer = 7000 + rand()%3000; }else frost_attack_Timer -= diff; //Arcane Blast @@ -166,7 +166,7 @@ struct TRINITY_DLL_DECL mob_ragin_flamesAI : public ScriptedAI { mob_ragin_flamesAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); HeroicMode = m_creature->GetMap()->IsHeroic(); + pInstance = (c->GetInstanceData()); HeroicMode = m_creature->GetMap()->IsHeroic(); } ScriptedInstance *pInstance; @@ -190,7 +190,7 @@ struct TRINITY_DLL_DECL mob_ragin_flamesAI : public ScriptedAI m_creature->SetSpeed(MOVE_RUN, HeroicMode ? 0.7f : 0.5f); } - void Aggro(Unit* who) + void EnterCombat(Unit* who) { } diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_pathaleon_the_calculator.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_pathaleon_the_calculator.cpp index 073054c3b90..f93ce338063 100644 --- a/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_pathaleon_the_calculator.cpp +++ b/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_pathaleon_the_calculator.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -78,7 +78,7 @@ struct TRINITY_DLL_DECL boss_pathaleon_the_calculatorAI : public ScriptedAI Counter = 0; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { DoScriptText(SAY_AGGRO, m_creature); } @@ -190,7 +190,7 @@ struct TRINITY_DLL_DECL mob_nether_wraithAI : public ScriptedAI } - void Aggro(Unit* who) + void EnterCombat(Unit* who) { } diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/instance_mechanar.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/instance_mechanar.cpp index a3b4661389e..e8806b62957 100644 --- a/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/instance_mechanar.cpp +++ b/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/instance_mechanar.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 diff --git a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_bug_trio.cpp b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_bug_trio.cpp index 7c04dc5e0d0..2c5ffe06bfc 100644 --- a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_bug_trio.cpp +++ b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_bug_trio.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -39,7 +39,7 @@ struct TRINITY_DLL_DECL boss_kriAI : public ScriptedAI { boss_kriAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } ScriptedInstance *pInstance; @@ -61,7 +61,7 @@ struct TRINITY_DLL_DECL boss_kriAI : public ScriptedAI Death = false; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } @@ -124,7 +124,7 @@ struct TRINITY_DLL_DECL boss_vemAI : public ScriptedAI { boss_vemAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } ScriptedInstance *pInstance; @@ -156,7 +156,7 @@ struct TRINITY_DLL_DECL boss_vemAI : public ScriptedAI } } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } @@ -205,7 +205,7 @@ struct TRINITY_DLL_DECL boss_yaujAI : public ScriptedAI { boss_yaujAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } ScriptedInstance *pInstance; @@ -240,11 +240,11 @@ struct TRINITY_DLL_DECL boss_yaujAI : public ScriptedAI Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0); Creature* Summoned = m_creature->SummonCreature(15621,m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(),0,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,90000); if(Summoned && target) - ((CreatureAI*)Summoned->AI())->AttackStart(target); + (Summoned->AI())->AttackStart(target); } } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } diff --git a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_cthun.cpp b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_cthun.cpp index 9f28016dd46..584e87a3f97 100644 --- a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_cthun.cpp +++ b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_cthun.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -123,7 +123,7 @@ struct TRINITY_DLL_DECL flesh_tentacleAI : public Scripted_NoMovementAI CheckTimer = 1000; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } @@ -136,7 +136,7 @@ struct TRINITY_DLL_DECL eye_of_cthunAI : public Scripted_NoMovementAI { eye_of_cthunAI(Creature *c) : Scripted_NoMovementAI(c) { - pInst = (ScriptedInstance*)c->GetInstanceData(); + pInst = c->GetInstanceData(); if (!pInst) error_log("TSCR: No Instance eye_of_cthunAI"); } @@ -182,7 +182,7 @@ struct TRINITY_DLL_DECL eye_of_cthunAI : public Scripted_NoMovementAI pInst->SetData(DATA_CTHUN_PHASE, 0); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { DoZoneInCombat(); } @@ -190,7 +190,7 @@ struct TRINITY_DLL_DECL eye_of_cthunAI : public Scripted_NoMovementAI void SpawnEyeTentacle(float x, float y) { Creature* Spawned; - Spawned = (Creature*)m_creature->SummonCreature(MOB_EYE_TENTACLE,m_creature->GetPositionX()+x,m_creature->GetPositionY()+y,m_creature->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,500); + Spawned = me->SummonCreature(MOB_EYE_TENTACLE,m_creature->GetPositionX()+x,m_creature->GetPositionY()+y,m_creature->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,500); if (Spawned) { Unit* target; @@ -244,7 +244,7 @@ struct TRINITY_DLL_DECL eye_of_cthunAI : public Scripted_NoMovementAI Creature* Spawned = NULL; //Spawn claw tentacle on the random target - Spawned = (Creature*)m_creature->SummonCreature(MOB_CLAW_TENTACLE,target->GetPositionX(),target->GetPositionY(),target->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,500); + Spawned = me->SummonCreature(MOB_CLAW_TENTACLE,target->GetPositionX(),target->GetPositionY(),target->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,500); if (Spawned) Spawned->AI()->AttackStart(target); @@ -301,7 +301,7 @@ struct TRINITY_DLL_DECL eye_of_cthunAI : public Scripted_NoMovementAI DoCast(m_creature,SPELL_RED_COLORATION); //Freeze animation - m_creature->setEmoteState(53); + m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, 53); //Darkbeam for 35 seconds PhaseTimer = 35000; @@ -351,7 +351,7 @@ struct TRINITY_DLL_DECL eye_of_cthunAI : public Scripted_NoMovementAI m_creature->RemoveAurasDueToSpell(SPELL_RED_COLORATION); //Freeze animation - m_creature->setEmoteState(0); + m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0); m_creature->SetUInt32Value(UNIT_FIELD_FLAGS, 0); //Eye Beam for 50 seconds @@ -397,7 +397,7 @@ struct TRINITY_DLL_DECL eye_of_cthunAI : public Scripted_NoMovementAI m_creature->RemoveAurasDueToSpell(SPELL_RED_COLORATION); //Reset to normal emote state and prevent select and attack - m_creature->setEmoteState(0); + m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0); m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE); //Remove Target field @@ -435,7 +435,7 @@ struct TRINITY_DLL_DECL cthunAI : public Scripted_NoMovementAI { cthunAI(Creature *c) : Scripted_NoMovementAI(c) { - pInst = (ScriptedInstance*)c->GetInstanceData(); + pInst = c->GetInstanceData(); if (!pInst) error_log("TSCR: No Instance eye_of_cthunAI"); } @@ -498,7 +498,7 @@ struct TRINITY_DLL_DECL cthunAI : public Scripted_NoMovementAI pInst->SetData(DATA_CTHUN_PHASE, 0); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { DoZoneInCombat(); } @@ -506,7 +506,7 @@ struct TRINITY_DLL_DECL cthunAI : public Scripted_NoMovementAI void SpawnEyeTentacle(float x, float y) { Creature* Spawned; - Spawned = (Creature*)m_creature->SummonCreature(MOB_EYE_TENTACLE,m_creature->GetPositionX()+x,m_creature->GetPositionY()+y,m_creature->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,500); + Spawned = me->SummonCreature(MOB_EYE_TENTACLE,m_creature->GetPositionX()+x,m_creature->GetPositionY()+y,m_creature->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,500); if (Spawned) { Unit* target; @@ -566,13 +566,15 @@ struct TRINITY_DLL_DECL cthunAI : public Scripted_NoMovementAI Map *map = m_creature->GetMap(); if(!map->IsDungeon()) return; + //Play random sound to the zone Map::PlayerList const &PlayerList = map->GetPlayers(); - for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) + + if (!PlayerList.isEmpty()) { - if (Player* i_pl = i->getSource()) + for(Map::PlayerList::const_iterator itr = PlayerList.begin(); itr != PlayerList.end(); ++itr) { - //Play random sound to the zone - i_pl->SendPlaySound(RANDOM_SOUND_WHISPER, true); + if (Player* pPlr = itr->getSource()) + pPlr->PlayDirectSound(RANDOM_SOUND_WHISPER,pPlr); } } @@ -627,20 +629,20 @@ struct TRINITY_DLL_DECL cthunAI : public Scripted_NoMovementAI Creature* Spawned; //Spawn flesh tentacle - Spawned = (Creature*)m_creature->SummonCreature(MOB_FLESH_TENTACLE, TENTACLE_POS1_X, TENTACLE_POS1_Y, TENTACLE_POS1_Z, TENTACLE_POS1_O, TEMPSUMMON_CORPSE_DESPAWN, 0); + Spawned = me->SummonCreature(MOB_FLESH_TENTACLE, TENTACLE_POS1_X, TENTACLE_POS1_Y, TENTACLE_POS1_Z, TENTACLE_POS1_O, TEMPSUMMON_CORPSE_DESPAWN, 0); if (!Spawned) FleshTentaclesKilled++; else - ((flesh_tentacleAI*)(Spawned->AI()))->SpawnedByCthun(m_creature->GetGUID()); + CAST_AI(flesh_tentacleAI, (Spawned->AI()))->SpawnedByCthun(m_creature->GetGUID()); //Spawn flesh tentacle - Spawned = (Creature*)m_creature->SummonCreature(MOB_FLESH_TENTACLE, TENTACLE_POS2_X, TENTACLE_POS2_Y, TENTACLE_POS2_Z, TENTACLE_POS2_O, TEMPSUMMON_CORPSE_DESPAWN, 0); + Spawned = me->SummonCreature(MOB_FLESH_TENTACLE, TENTACLE_POS2_X, TENTACLE_POS2_Y, TENTACLE_POS2_Z, TENTACLE_POS2_O, TEMPSUMMON_CORPSE_DESPAWN, 0); if (!Spawned) FleshTentaclesKilled++; else - ((flesh_tentacleAI*)(Spawned->AI()))->SpawnedByCthun(m_creature->GetGUID()); + CAST_AI(flesh_tentacleAI, (Spawned->AI()))->SpawnedByCthun(m_creature->GetGUID()); PhaseTimer = 0; }else PhaseTimer -= diff; @@ -773,7 +775,7 @@ struct TRINITY_DLL_DECL cthunAI : public Scripted_NoMovementAI Creature* Spawned = NULL; //Spawn claw tentacle on the random target - Spawned = (Creature*)m_creature->SummonCreature(MOB_GIANT_CLAW_TENTACLE,target->GetPositionX(),target->GetPositionY(),target->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,500); + Spawned = me->SummonCreature(MOB_GIANT_CLAW_TENTACLE,target->GetPositionX(),target->GetPositionY(),target->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,500); if (Spawned) Spawned->AI()->AttackStart(target); @@ -794,7 +796,7 @@ struct TRINITY_DLL_DECL cthunAI : public Scripted_NoMovementAI Creature* Spawned = NULL; //Spawn claw tentacle on the random target - Spawned = (Creature*)m_creature->SummonCreature(MOB_GIANT_EYE_TENTACLE,target->GetPositionX(),target->GetPositionY(),target->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,500); + Spawned = me->SummonCreature(MOB_GIANT_EYE_TENTACLE,target->GetPositionX(),target->GetPositionY(),target->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,500); if (Spawned) Spawned->AI()->AttackStart(target); @@ -842,20 +844,20 @@ struct TRINITY_DLL_DECL cthunAI : public Scripted_NoMovementAI Creature* Spawned; //Spawn flesh tentacle - Spawned = (Creature*)m_creature->SummonCreature(MOB_FLESH_TENTACLE, TENTACLE_POS1_X, TENTACLE_POS1_Y, TENTACLE_POS1_Z, TENTACLE_POS1_O, TEMPSUMMON_CORPSE_DESPAWN, 0); + Spawned = me->SummonCreature(MOB_FLESH_TENTACLE, TENTACLE_POS1_X, TENTACLE_POS1_Y, TENTACLE_POS1_Z, TENTACLE_POS1_O, TEMPSUMMON_CORPSE_DESPAWN, 0); if (!Spawned) FleshTentaclesKilled++; else - ((flesh_tentacleAI*)(Spawned->AI()))->SpawnedByCthun(m_creature->GetGUID()); + CAST_AI(flesh_tentacleAI, (Spawned->AI()))->SpawnedByCthun(m_creature->GetGUID()); //Spawn flesh tentacle - Spawned = (Creature*)m_creature->SummonCreature(MOB_FLESH_TENTACLE, TENTACLE_POS2_X, TENTACLE_POS2_Y, TENTACLE_POS2_Z, TENTACLE_POS2_O, TEMPSUMMON_CORPSE_DESPAWN, 0); + Spawned = me->SummonCreature(MOB_FLESH_TENTACLE, TENTACLE_POS2_X, TENTACLE_POS2_Y, TENTACLE_POS2_Z, TENTACLE_POS2_O, TEMPSUMMON_CORPSE_DESPAWN, 0); if (!Spawned) FleshTentaclesKilled++; else - ((flesh_tentacleAI*)(Spawned->AI()))->SpawnedByCthun(m_creature->GetGUID()); + CAST_AI(flesh_tentacleAI, (Spawned->AI()))->SpawnedByCthun(m_creature->GetGUID()); PhaseTimer = 0; }else PhaseTimer -= diff; @@ -923,7 +925,7 @@ struct TRINITY_DLL_DECL eye_tentacleAI : public Scripted_NoMovementAI uint32 KillSelfTimer; uint64 Portal; - void JustDied(Unit*) + void JustDied(Unit* who) { Unit* p = Unit::GetUnit(*m_creature, Portal); if (p) @@ -939,7 +941,7 @@ struct TRINITY_DLL_DECL eye_tentacleAI : public Scripted_NoMovementAI KillSelfTimer = 35000; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { DoZoneInCombat(); } @@ -963,7 +965,7 @@ struct TRINITY_DLL_DECL eye_tentacleAI : public Scripted_NoMovementAI { Unit* target = NULL; target = SelectUnit(SELECT_TARGET_RANDOM,0); - if (target && !target->HasAura(SPELL_DIGESTIVE_ACID, 0)) + if (target && !target->HasAura(SPELL_DIGESTIVE_ACID)) DoCast(target,SPELL_MIND_FLAY); //Mindflay every 10 seconds @@ -986,7 +988,7 @@ struct TRINITY_DLL_DECL claw_tentacleAI : public Scripted_NoMovementAI uint32 EvadeTimer; uint64 Portal; - void JustDied(Unit*) + void JustDied(Unit* who) { Unit* p = Unit::GetUnit(*m_creature, Portal); if (p) @@ -1001,7 +1003,7 @@ struct TRINITY_DLL_DECL claw_tentacleAI : public Scripted_NoMovementAI EvadeTimer = 5000; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { DoZoneInCombat(); } @@ -1031,7 +1033,7 @@ struct TRINITY_DLL_DECL claw_tentacleAI : public Scripted_NoMovementAI return; } - if (!target->HasAura(SPELL_DIGESTIVE_ACID, 0)) + if (!target->HasAura(SPELL_DIGESTIVE_ACID)) { m_creature->GetMap()->CreatureRelocation(m_creature, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0); Unit* p = DoSpawnCreature(MOB_SMALL_PORTAL,0,0,0,0,TEMPSUMMON_CORPSE_DESPAWN, 0); @@ -1081,7 +1083,7 @@ struct TRINITY_DLL_DECL giant_claw_tentacleAI : public Scripted_NoMovementAI uint32 EvadeTimer; uint64 Portal; - void JustDied(Unit*) + void JustDied(Unit* who) { Unit* p = Unit::GetUnit(*m_creature, Portal); if (p) @@ -1097,7 +1099,7 @@ struct TRINITY_DLL_DECL giant_claw_tentacleAI : public Scripted_NoMovementAI EvadeTimer = 5000; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { DoZoneInCombat(); } @@ -1127,7 +1129,7 @@ struct TRINITY_DLL_DECL giant_claw_tentacleAI : public Scripted_NoMovementAI return; } - if (!target->HasAura(SPELL_DIGESTIVE_ACID, 0)) + if (!target->HasAura(SPELL_DIGESTIVE_ACID)) { m_creature->GetMap()->CreatureRelocation(m_creature, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0); Unit* p = DoSpawnCreature(MOB_GIANT_PORTAL,0,0,0,0,TEMPSUMMON_CORPSE_DESPAWN, 0); @@ -1182,7 +1184,7 @@ struct TRINITY_DLL_DECL giant_eye_tentacleAI : public Scripted_NoMovementAI uint32 BeamTimer; uint64 Portal; - void JustDied(Unit*) + void JustDied(Unit* who) { Unit* p = Unit::GetUnit(*m_creature, Portal); if (p) @@ -1195,7 +1197,7 @@ struct TRINITY_DLL_DECL giant_eye_tentacleAI : public Scripted_NoMovementAI BeamTimer = 500; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { DoZoneInCombat(); } @@ -1211,7 +1213,7 @@ struct TRINITY_DLL_DECL giant_eye_tentacleAI : public Scripted_NoMovementAI { Unit* target = NULL; target = SelectUnit(SELECT_TARGET_RANDOM,0); - if (target && !target->HasAura(SPELL_DIGESTIVE_ACID, 0)) + if (target && !target->HasAura(SPELL_DIGESTIVE_ACID)) DoCast(target,SPELL_GREEN_BEAM); //Beam every 2 seconds @@ -1249,15 +1251,15 @@ void flesh_tentacleAI::JustDied(Unit* killer) { if (!Parent) { - DoYell("Error: No Parent variable", LANG_UNIVERSAL, NULL); + error_log("TSCR: flesh_tentacle: No Parent variable"); return; } Creature* Cthun = Unit::GetCreature(*m_creature, Parent); if (Cthun) - ((cthunAI*)(Cthun->AI()))->FleshTentcleKilled(); - else DoYell("Error: No Cthun", LANG_UNIVERSAL, NULL); + CAST_AI(cthunAI, (Cthun->AI()))->FleshTentcleKilled(); + else error_log("TSCR: flesh_tentacle: No Cthun"); } //GetAIs diff --git a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_fankriss.cpp b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_fankriss.cpp index b560f174bc4..ac50457c5fc 100644 --- a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_fankriss.cpp +++ b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_fankriss.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -77,10 +77,10 @@ struct TRINITY_DLL_DECL boss_fankrissAI : public ScriptedAI Rand = 0; Spawn = DoSpawnCreature(15630, RandX, RandY, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); if(Spawn) - ((CreatureAI*)Spawn->AI())->AttackStart(victim); + (Spawn->AI())->AttackStart(victim); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } @@ -139,46 +139,46 @@ struct TRINITY_DLL_DECL boss_fankrissAI : public ScriptedAI DoTeleportPlayer(target, -8106.0142,1289.2900,-74.419533,5.112); Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()-3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if(Hatchling) - ((CreatureAI*)Hatchling->AI())->AttackStart(target); + (Hatchling->AI())->AttackStart(target); Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()+3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if(Hatchling) - ((CreatureAI*)Hatchling->AI())->AttackStart(target); + (Hatchling->AI())->AttackStart(target); Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()-5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if(Hatchling) - ((CreatureAI*)Hatchling->AI())->AttackStart(target); + (Hatchling->AI())->AttackStart(target); Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()+5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if(Hatchling) - ((CreatureAI*)Hatchling->AI())->AttackStart(target); + (Hatchling->AI())->AttackStart(target); break; case 1: DoTeleportPlayer(target, -7990.135354,1155.1907,-78.849319,2.608); Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()-3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if(Hatchling) - ((CreatureAI*)Hatchling->AI())->AttackStart(target); + (Hatchling->AI())->AttackStart(target); Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()+3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if(Hatchling) - ((CreatureAI*)Hatchling->AI())->AttackStart(target); + (Hatchling->AI())->AttackStart(target); Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()-5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if(Hatchling) - ((CreatureAI*)Hatchling->AI())->AttackStart(target); + (Hatchling->AI())->AttackStart(target); Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()+5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if(Hatchling) - ((CreatureAI*)Hatchling->AI())->AttackStart(target); + (Hatchling->AI())->AttackStart(target); break; case 2: DoTeleportPlayer(target,-8159.7753,1127.9064,-76.868660,0.675); Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()-3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if(Hatchling) - ((CreatureAI*)Hatchling->AI())->AttackStart(target); + (Hatchling->AI())->AttackStart(target); Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()+3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if(Hatchling) - ((CreatureAI*)Hatchling->AI())->AttackStart(target); + (Hatchling->AI())->AttackStart(target); Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()-5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if(Hatchling) - ((CreatureAI*)Hatchling->AI())->AttackStart(target); + (Hatchling->AI())->AttackStart(target); Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()+5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if(Hatchling) - ((CreatureAI*)Hatchling->AI())->AttackStart(target); + (Hatchling->AI())->AttackStart(target); break; } } diff --git a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_huhuran.cpp b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_huhuran.cpp index 484a6260c86..d846fc18aa0 100644 --- a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_huhuran.cpp +++ b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_huhuran.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -23,6 +23,9 @@ EndScriptData */ #include "precompiled.h" +#define EMOTE_GENERIC_FRENZY_KILL -1000001 +#define EMOTE_GENERIC_BERSERK -1000004 + #define SPELL_FRENZY 26051 #define SPELL_BERSERK 26068 #define SPELL_POISONBOLT 26052 @@ -57,7 +60,7 @@ struct TRINITY_DLL_DECL boss_huhuranAI : public ScriptedAI Berserk = false; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } @@ -71,6 +74,7 @@ struct TRINITY_DLL_DECL boss_huhuranAI : public ScriptedAI if (!Frenzy && Frenzy_Timer < diff) { DoCast(m_creature, SPELL_FRENZY); + DoScriptText(EMOTE_GENERIC_FRENZY_KILL, m_creature); Frenzy = true; PoisonBolt_Timer = 3000; Frenzy_Timer = 25000 + rand()%10000; @@ -119,7 +123,7 @@ struct TRINITY_DLL_DECL boss_huhuranAI : public ScriptedAI if ( !Berserk && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 31 ) { m_creature->InterruptNonMeleeSpells(false); - DoTextEmote("is going berserk", NULL); + DoScriptText(EMOTE_GENERIC_BERSERK, m_creature); DoCast(m_creature, SPELL_BERSERK); Berserk = true; } diff --git a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_ouro.cpp b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_ouro.cpp index 4193c7a666f..700e7230d14 100644 --- a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_ouro.cpp +++ b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_ouro.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -59,7 +59,7 @@ struct TRINITY_DLL_DECL boss_ouroAI : public ScriptedAI Submerged = false; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { DoCast(m_creature->getVictim(), SPELL_BIRTH); } diff --git a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_sartura.cpp b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_sartura.cpp index e1e88101fdd..21e73e8df4e 100644 --- a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_sartura.cpp +++ b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_sartura.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -68,7 +68,7 @@ struct TRINITY_DLL_DECL boss_sarturaAI : public ScriptedAI } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { DoScriptText(SAY_AGGRO, m_creature); } @@ -94,8 +94,12 @@ struct TRINITY_DLL_DECL boss_sarturaAI : public ScriptedAI if (WhirlWindRandom_Timer < diff) { //Attack random Gamers - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,1)) - AttackStart(target); + Unit* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM,1); + if (target) + m_creature->AddThreat(target, 1.0f); + m_creature->TauntApply(target); + AttackStart(target); WhirlWindRandom_Timer = 3000 + rand()%4000; }else WhirlWindRandom_Timer -= diff; @@ -119,8 +123,12 @@ struct TRINITY_DLL_DECL boss_sarturaAI : public ScriptedAI if (AggroReset_Timer < diff) { //Attack random Gamers - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,1)) - m_creature->TauntApply(target); + Unit* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM,1); + if (target) + m_creature->AddThreat(target, 1.0f); + m_creature->TauntApply(target); + AttackStart(target); AggroReset = true; AggroReset_Timer = 2000 + rand()%3000; @@ -188,7 +196,7 @@ struct TRINITY_DLL_DECL mob_sartura_royal_guardAI : public ScriptedAI AggroReset = false; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } @@ -211,8 +219,12 @@ struct TRINITY_DLL_DECL mob_sartura_royal_guardAI : public ScriptedAI if (WhirlWindRandom_Timer < diff) { //Attack random Gamers - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,1)) - m_creature->TauntApply(target); + Unit* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM,1); + if (target) + m_creature->AddThreat(target, 1.0f); + m_creature->TauntApply(target); + AttackStart(target); WhirlWindRandom_Timer = 3000 + rand()%4000; }else WhirlWindRandom_Timer -= diff; @@ -228,8 +240,12 @@ struct TRINITY_DLL_DECL mob_sartura_royal_guardAI : public ScriptedAI if (AggroReset_Timer < diff) { //Attack random Gamers - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,1)) - AttackStart(target); + Unit* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM,1); + if (target) + m_creature->AddThreat(target, 1.0f); + m_creature->TauntApply(target); + AttackStart(target); AggroReset = true; AggroReset_Timer = 2000 + rand()%3000; diff --git a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_skeram.cpp b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_skeram.cpp index 471eb391b39..1fc47f68295 100644 --- a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_skeram.cpp +++ b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_skeram.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -39,10 +39,6 @@ EndScriptData */ #define SPELL_TRUE_FULFILLMENT4 26526 #define SPELL_BLINK 28391 -#define PLACES_CLEANUP delete place1; \ - delete place2; \ - delete place3; \ - class ov_mycoordinates { public: @@ -57,7 +53,7 @@ struct TRINITY_DLL_DECL boss_skeramAI : public ScriptedAI { boss_skeramAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); IsImage = false; } @@ -113,7 +109,7 @@ struct TRINITY_DLL_DECL boss_skeramAI : public ScriptedAI DoScriptText(SAY_DEATH, m_creature); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { if (IsImage || Images75) return; @@ -247,7 +243,7 @@ struct TRINITY_DLL_DECL boss_skeramAI : public ScriptedAI Unit *targetpl = SelectUnit(SELECT_TARGET_RANDOM, 0); if (targetpl->GetTypeId() == TYPEID_PLAYER) { - Group *grp = ((Player *)targetpl)->GetGroup(); + Group *grp = CAST_PLR(targetpl)->GetGroup(); if (grp) { for (int ici = 0; ici < TARGETICONCOUNT; ici++) @@ -265,6 +261,9 @@ struct TRINITY_DLL_DECL boss_skeramAI : public ScriptedAI m_creature->SetVisibility(VISIBILITY_OFF); m_creature->Relocate(bossc->x, bossc->y, bossc->z, bossc->r); Invisible = true; + delete place1; + delete place2; + delete place3; DoResetThreat(); DoStopAttack(); @@ -278,32 +277,25 @@ struct TRINITY_DLL_DECL boss_skeramAI : public ScriptedAI Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0); Image1 = m_creature->SummonCreature(15263, i1->x, i1->y, i1->z, i1->r, TEMPSUMMON_CORPSE_DESPAWN, 30000); - if(!Image1) + if (Image1) { - PLACES_CLEANUP - return; + Image1->SetMaxHealth(m_creature->GetMaxHealth() / 5); + Image1->SetHealth(m_creature->GetHealth() / 5); + if (target) + Image1->AI()->AttackStart(target); + CAST_AI(boss_skeramAI, Image1->AI())->IsImage = true; } - Image1->SetMaxHealth(m_creature->GetMaxHealth() / 5); - Image1->SetHealth(m_creature->GetHealth() / 5); - if (target) - Image1->AI()->AttackStart(target); Image2 = m_creature->SummonCreature(15263,i2->x, i2->y, i2->z, i2->r, TEMPSUMMON_CORPSE_DESPAWN, 30000); - if(!Image2) + if (Image2) { - PLACES_CLEANUP - return; + Image2->SetMaxHealth(m_creature->GetMaxHealth() / 5); + Image2->SetHealth(m_creature->GetHealth() / 5); + if (target) + Image2->AI()->AttackStart(target); + CAST_AI(boss_skeramAI, Image2->AI())->IsImage = true; } - Image2->SetMaxHealth(m_creature->GetMaxHealth() / 5); - Image2->SetHealth(m_creature->GetHealth() / 5); - if (target) - Image2->AI()->AttackStart(target); - - ((boss_skeramAI*)Image1->AI())->IsImage = true; - ((boss_skeramAI*)Image2->AI())->IsImage = true; - Invisible = true; - PLACES_CLEANUP } }; diff --git a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_twinemperors.cpp b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_twinemperors.cpp index 2a658449b97..1c741bdd859 100644 --- a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_twinemperors.cpp +++ b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_twinemperors.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -75,7 +75,7 @@ struct TRINITY_DLL_DECL boss_twinemperorsAI : public ScriptedAI boss_twinemperorsAI(Creature *c): ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } void TwinReset() @@ -96,11 +96,11 @@ struct TRINITY_DLL_DECL boss_twinemperorsAI : public ScriptedAI { if(pInstance) { - return (Creature *)Unit::GetUnit((*m_creature), pInstance->GetData64(IAmVeklor() ? DATA_VEKNILASH : DATA_VEKLOR)); + return Unit::GetCreature(*m_creature, pInstance->GetData64(IAmVeklor() ? DATA_VEKNILASH : DATA_VEKLOR)); } else { - return (Creature *)0; + return NULL; } } @@ -129,7 +129,7 @@ struct TRINITY_DLL_DECL boss_twinemperorsAI : public ScriptedAI pOtherBoss->SetHealth(0); pOtherBoss->setDeathState(JUST_DIED); pOtherBoss->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); - ((boss_twinemperorsAI *)pOtherBoss->AI())->DontYellWhenDead = true; + CAST_AI(boss_twinemperorsAI, pOtherBoss->AI())->DontYellWhenDead = true; } if (!DontYellWhenDead) // I hope AI is not threaded DoPlaySoundToSet(m_creature, IAmVeklor() ? SOUND_VL_DEATH : SOUND_VN_DEATH); @@ -140,17 +140,16 @@ struct TRINITY_DLL_DECL boss_twinemperorsAI : public ScriptedAI DoPlaySoundToSet(m_creature, IAmVeklor() ? SOUND_VL_KILL : SOUND_VN_KILL); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { DoZoneInCombat(); - InCombat = true; Creature *pOtherBoss = GetOtherBoss(); if (pOtherBoss) { // TODO: we should activate the other boss location so he can start attackning even if nobody // is near I dont know how to do that - ScriptedAI *otherAI = (ScriptedAI*)pOtherBoss->AI(); - if (!otherAI->InCombat) + ScriptedAI *otherAI = CAST_AI(ScriptedAI, pOtherBoss->AI()); + if (!pOtherBoss->isInCombat()) { DoPlaySoundToSet(m_creature, IAmVeklor() ? SOUND_VL_AGGRO : SOUND_VN_AGGRO); otherAI->AttackStart(who); @@ -198,7 +197,7 @@ struct TRINITY_DLL_DECL boss_twinemperorsAI : public ScriptedAI if (Heal_Timer < diff) { Unit *pOtherBoss = GetOtherBoss(); - if (pOtherBoss && (pOtherBoss->GetDistance((const Creature *)m_creature) <= 60)) + if (pOtherBoss && (pOtherBoss->GetDistance(m_creature) <= 60)) { DoCast(pOtherBoss, SPELL_HEAL_BROTHER); Heal_Timer = 1000; @@ -231,7 +230,7 @@ struct TRINITY_DLL_DECL boss_twinemperorsAI : public ScriptedAI thismap->CreatureRelocation(m_creature, other_x, other_y, other_z, other_o); SetAfterTeleport(); - ((boss_twinemperorsAI*) pOtherBoss->AI())->SetAfterTeleport(); + CAST_AI(boss_twinemperorsAI, pOtherBoss->AI())->SetAfterTeleport(); } } @@ -317,9 +316,9 @@ struct TRINITY_DLL_DECL boss_twinemperorsAI : public ScriptedAI { public: AnyBugCheck(WorldObject const* obj, float range) : i_obj(obj), i_range(range) {} - bool operator()(Unit* u) + bool operator()(Creature* u) { - Creature *c = (Creature *)u; + Creature *c = u; if (!i_obj->IsWithinDistInMap(c, i_range)) return false; return (c->GetEntry() == 15316 || c->GetEntry() == 15317); @@ -339,7 +338,7 @@ struct TRINITY_DLL_DECL boss_twinemperorsAI : public ScriptedAI std::list<Creature*> unitList; AnyBugCheck u_check(m_creature, 150); - Trinity::CreatureListSearcher<AnyBugCheck> searcher(unitList, u_check); + Trinity::CreatureListSearcher<AnyBugCheck> searcher(m_creature, unitList, u_check); TypeContainerVisitor<Trinity::CreatureListSearcher<AnyBugCheck>, GridTypeMapContainer > grid_creature_searcher(searcher); CellLock<GridReadGuard> cell_lock(cell, p); cell_lock->Visit(cell_lock, grid_creature_searcher, *(m_creature->GetMap())); @@ -348,7 +347,7 @@ struct TRINITY_DLL_DECL boss_twinemperorsAI : public ScriptedAI for(std::list<Creature*>::iterator iter = unitList.begin(); iter != unitList.end(); ++iter) { - Creature *c = (Creature *)(*iter); + Creature *c = *iter; if (c && c->isDead()) { c->Respawn(); @@ -407,13 +406,6 @@ struct TRINITY_DLL_DECL boss_twinemperorsAI : public ScriptedAI } }; -class TRINITY_DLL_DECL BugAura : public Aura -{ - public: - BugAura(SpellEntry *spell, uint32 eff, int32 *bp, Unit *target, Unit *caster) : Aura(spell, eff, bp, target, caster, NULL) - {} -}; - struct TRINITY_DLL_DECL boss_veknilashAI : public boss_twinemperorsAI { bool IAmVeklor() {return false;} @@ -442,14 +434,16 @@ struct TRINITY_DLL_DECL boss_veknilashAI : public boss_twinemperorsAI void CastSpellOnBug(Creature *target) { target->setFaction(14); - ((CreatureAI*)target->AI())->AttackStart(m_creature->getThreatManager().getHostilTarget()); - SpellEntry *spell = (SpellEntry *)GetSpellStore()->LookupEntry(SPELL_MUTATE_BUG); + (target->AI())->AttackStart(m_creature->getThreatManager().getHostilTarget()); + SpellEntry *spell = GET_SPELL(SPELL_MUTATE_BUG); + uint8 eff_mask=0; for (int i=0; i<3; i++) { if (!spell->Effect[i]) continue; - target->AddAura(new BugAura(spell, i, NULL, target, target)); + eff_mask|=1<<i; } + target->AddAura(new Aura(spell, eff_mask, NULL, target, target)); target->SetHealth(target->GetMaxHealth()); } @@ -471,7 +465,7 @@ struct TRINITY_DLL_DECL boss_veknilashAI : public boss_twinemperorsAI if (UpperCut_Timer < diff) { - Unit* randomMelee = SelectUnit(SELECT_TARGET_RANDOM, 0, NOMINAL_MELEE_RANGE, true); + Unit* randomMelee = SelectTarget(SELECT_TARGET_RANDOM, 0, NOMINAL_MELEE_RANGE, true); if (randomMelee) DoCast(randomMelee,SPELL_UPPERCUT); UpperCut_Timer = 15000+rand()%15000; @@ -526,13 +520,15 @@ struct TRINITY_DLL_DECL boss_veklorAI : public boss_twinemperorsAI void CastSpellOnBug(Creature *target) { target->setFaction(14); - SpellEntry *spell = (SpellEntry *)GetSpellStore()->LookupEntry(SPELL_EXPLODEBUG); + SpellEntry *spell = GET_SPELL(SPELL_EXPLODEBUG); + uint8 eff_mask=0; for (int i=0; i<3; i++) { if (!spell->Effect[i]) continue; - target->AddAura(new BugAura(spell, i, NULL, target, target)); + eff_mask|=1<<i; } + target->AddAura(new Aura(spell, eff_mask, NULL, target, target)); target->SetHealth(target->GetMaxHealth()); } @@ -564,7 +560,7 @@ struct TRINITY_DLL_DECL boss_veklorAI : public boss_twinemperorsAI if (Blizzard_Timer < diff) { Unit* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM, 0, 45, true); + target = SelectTarget(SELECT_TARGET_RANDOM, 0, 45, true); if (target) DoCast(target,SPELL_BLIZZARD); Blizzard_Timer = 15000+rand()%15000; @@ -573,7 +569,7 @@ struct TRINITY_DLL_DECL boss_veklorAI : public boss_twinemperorsAI if (ArcaneBurst_Timer < diff) { Unit *mvic; - if ((mvic=SelectUnit(SELECT_TARGET_NEAREST, 0, NOMINAL_MELEE_RANGE, true))!=NULL) + if ((mvic=SelectTarget(SELECT_TARGET_NEAREST, 0, NOMINAL_MELEE_RANGE, true))!=NULL) { DoCast(mvic,SPELL_ARCANEBURST); ArcaneBurst_Timer = 5000; @@ -610,12 +606,6 @@ struct TRINITY_DLL_DECL boss_veklorAI : public boss_twinemperorsAI m_creature->GetMotionMaster()->MoveChase(who, VEKLOR_DIST, 0); m_creature->AddThreat(who, 0.0f); } - - if (!InCombat) - { - InCombat = true; - Aggro(who); - } } } }; diff --git a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_viscidus.cpp b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_viscidus.cpp index 7b310dfe10d..2bb9f1bfb0b 100644 --- a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_viscidus.cpp +++ b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_viscidus.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 diff --git a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/def_temple_of_ahnqiraj.h b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/def_temple_of_ahnqiraj.h index 95db307f778..5d545ed7c74 100644 --- a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/def_temple_of_ahnqiraj.h +++ b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/def_temple_of_ahnqiraj.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * This program is free software licensed under GPL version 2 * Please see the included DOCS/LICENSE.TXT for more information */ diff --git a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/instance_temple_of_ahnqiraj.cpp b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/instance_temple_of_ahnqiraj.cpp index 7ca0f33566f..9048591b774 100644 --- a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/instance_temple_of_ahnqiraj.cpp +++ b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/instance_temple_of_ahnqiraj.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 diff --git a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/mob_anubisath_sentinel.cpp b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/mob_anubisath_sentinel.cpp index fd3e7c56cb1..b45097d7f97 100644 --- a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/mob_anubisath_sentinel.cpp +++ b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/mob_anubisath_sentinel.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -133,7 +133,7 @@ struct TRINITY_DLL_DECL aqsentinelAI : public ScriptedAI void GiveBuddyMyList(Creature *c) { - aqsentinelAI *cai = (aqsentinelAI *)(c->AI()); + aqsentinelAI *cai = CAST_AI(aqsentinelAI, (c)->AI()); for (int i=0; i<3; i++) if (nearby[i] && nearby[i]!=c) cai->AddBuddyToList(nearby[i]); @@ -174,7 +174,7 @@ struct TRINITY_DLL_DECL aqsentinelAI : public ScriptedAI std::list<Creature*> assistList; NearbyAQSentinel u_check(nears); - Trinity::CreatureListSearcher<NearbyAQSentinel> searcher(assistList, u_check); + Trinity::CreatureListSearcher<NearbyAQSentinel> searcher(m_creature, assistList, u_check); TypeContainerVisitor<Trinity::CreatureListSearcher<NearbyAQSentinel>, GridTypeMapContainer > grid_creature_searcher(searcher); CellLock<GridReadGuard> cell_lock(cell, p); cell_lock->Visit(cell_lock, grid_creature_searcher, *(nears->GetMap())); @@ -213,13 +213,15 @@ struct TRINITY_DLL_DECL aqsentinelAI : public ScriptedAI if (!nearby[bli]) break; AddSentinelsNear(nearby[bli]); - ((aqsentinelAI *)nearby[bli]->AI())->gatherOthersWhenAggro = false; - ((aqsentinelAI *)nearby[bli]->AI())->selectAbility(pickAbilityRandom(chosenAbilities)); + CAST_AI(aqsentinelAI, nearby[bli]->AI())->gatherOthersWhenAggro = false; + CAST_AI(aqsentinelAI, nearby[bli]->AI())->selectAbility(pickAbilityRandom(chosenAbilities)); } /*if (bli < 3) DoYell("I dont have enough buddies.", LANG_NEUTRAL, 0);*/ SendMyListToBuddies(); CallBuddiesToAttack(who); + + delete[] chosenAbilities; } bool gatherOthersWhenAggro; @@ -245,13 +247,16 @@ struct TRINITY_DLL_DECL aqsentinelAI : public ScriptedAI void GainSentinelAbility(uint32 id) { const SpellEntry *spell = GetSpellStore()->LookupEntry(id); + uint8 eff_mask=0; for (int i=0; i<3; i++) { if (!spell->Effect[i]) continue; - SentinelAbilityAura *a = new SentinelAbilityAura(this, (SpellEntry *)spell, id, i); - m_creature->AddAura(a); + eff_mask=1<<i; } + SentinelAbilityAura *a = new SentinelAbilityAura(this, (SpellEntry*)spell, id, eff_mask); + m_creature->AddAura(a); + if (id == SPELL_KNOCK_BUFF) { m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true); @@ -259,7 +264,7 @@ struct TRINITY_DLL_DECL aqsentinelAI : public ScriptedAI } } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { if (gatherOthersWhenAggro) GetOtherSentinels(who); @@ -268,7 +273,7 @@ struct TRINITY_DLL_DECL aqsentinelAI : public ScriptedAI DoZoneInCombat(); } - void JustDied(Unit*) + void JustDied(Unit* who) { for (int ni=0; ni<3; ni++) { @@ -281,7 +286,7 @@ struct TRINITY_DLL_DECL aqsentinelAI : public ScriptedAI if (h > sent->GetMaxHealth()) h = sent->GetMaxHealth(); sent->SetHealth(h); - ((aqsentinelAI *)sent->AI())->GainSentinelAbility(ability); + CAST_AI(aqsentinelAI, sent->AI())->GainSentinelAbility(ability); } } @@ -339,6 +344,5 @@ SentinelAbilityAura::SentinelAbilityAura(aqsentinelAI *abilityOwner, SpellEntry { aOwner = abilityOwner; abilityId = ability; - currentBasePoints = 0; } diff --git a/src/bindings/scripts/scripts/zone/terokkar_forest/terokkar_forest.cpp b/src/bindings/scripts/scripts/zone/terokkar_forest/terokkar_forest.cpp index 7146b33de7d..cf55ff0123d 100644 --- a/src/bindings/scripts/scripts/zone/terokkar_forest/terokkar_forest.cpp +++ b/src/bindings/scripts/scripts/zone/terokkar_forest/terokkar_forest.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -27,7 +27,6 @@ mob_infested_root_walker mob_rotting_forest_rager mob_netherweb_victim npc_floon -npc_skyguard_handler_deesak npc_isla_starmane EndContentData */ @@ -60,17 +59,17 @@ struct TRINITY_DLL_DECL mob_unkor_the_ruthlessAI : public ScriptedAI CanDoQuest = false; UnkorUnfriendly_Timer = 0; Pulverize_Timer = 3000; - m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, PLAYER_STATE_NONE); + m_creature->SetStandState(UNIT_STAND_STATE_STAND); m_creature->setFaction(FACTION_HOSTILE); } - void Aggro(Unit *who) {} + void EnterCombat(Unit *who) {} void DoNice() { DoScriptText(SAY_SUBMIT, m_creature); m_creature->setFaction(FACTION_FRIENDLY); - m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, PLAYER_STATE_SIT); + m_creature->SetStandState(UNIT_STAND_STATE_SIT); m_creature->RemoveAllAuras(); m_creature->DeleteThreatList(); m_creature->CombatStop(); @@ -82,7 +81,7 @@ struct TRINITY_DLL_DECL mob_unkor_the_ruthlessAI : public ScriptedAI if( done_by->GetTypeId() == TYPEID_PLAYER ) if( (m_creature->GetHealth()-damage)*100 / m_creature->GetMaxHealth() < 30 ) { - if( Group* pGroup = ((Player*)done_by)->GetGroup() ) + if( Group* pGroup = CAST_PLR(done_by)->GetGroup() ) { for(GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next()) { @@ -97,10 +96,10 @@ struct TRINITY_DLL_DECL mob_unkor_the_ruthlessAI : public ScriptedAI } } } else - if( ((Player*)done_by)->GetQuestStatus(QUEST_DONTKILLTHEFATONE) == QUEST_STATUS_INCOMPLETE && - ((Player*)done_by)->GetReqKillOrCastCurrentCount(QUEST_DONTKILLTHEFATONE, 18260) == 10 ) + if( CAST_PLR(done_by)->GetQuestStatus(QUEST_DONTKILLTHEFATONE) == QUEST_STATUS_INCOMPLETE && + CAST_PLR(done_by)->GetReqKillOrCastCurrentCount(QUEST_DONTKILLTHEFATONE, 18260) == 10 ) { - ((Player*)done_by)->AreaExploredOrEventHappens(QUEST_DONTKILLTHEFATONE); + CAST_PLR(done_by)->AreaExploredOrEventHappens(QUEST_DONTKILLTHEFATONE); CanDoQuest = true; } } @@ -152,7 +151,7 @@ struct TRINITY_DLL_DECL mob_infested_root_walkerAI : public ScriptedAI mob_infested_root_walkerAI(Creature *c) : ScriptedAI(c) {} void Reset() { } - void Aggro(Unit *who) { } + void EnterCombat(Unit *who) { } void DamageTaken(Unit *done_by, uint32 &damage) { @@ -177,7 +176,7 @@ struct TRINITY_DLL_DECL mob_rotting_forest_ragerAI : public ScriptedAI mob_rotting_forest_ragerAI(Creature *c) : ScriptedAI(c) {} void Reset() { } - void Aggro(Unit *who) { } + void EnterCombat(Unit *who) { } void DamageTaken(Unit *done_by, uint32 &damage) { @@ -209,19 +208,19 @@ struct TRINITY_DLL_DECL mob_netherweb_victimAI : public ScriptedAI mob_netherweb_victimAI(Creature *c) : ScriptedAI(c) {} void Reset() { } - void Aggro(Unit *who) { } + void EnterCombat(Unit *who) { } void MoveInLineOfSight(Unit *who) { } void JustDied(Unit* Killer) { if( Killer->GetTypeId() == TYPEID_PLAYER ) { - if( ((Player*)Killer)->GetQuestStatus(10873) == QUEST_STATUS_INCOMPLETE ) + if( CAST_PLR(Killer)->GetQuestStatus(10873) == QUEST_STATUS_INCOMPLETE ) { if( rand()%100 < 25 ) { DoSpawnCreature(QUEST_TARGET,0,0,0,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,60000); - ((Player*)Killer)->KilledMonster(QUEST_TARGET, m_creature->GetGUID()); + CAST_PLR(Killer)->KilledMonster(QUEST_TARGET, m_creature->GetGUID()); }else DoSpawnCreature(netherwebVictims[rand()%6],0,0,0,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,60000); @@ -269,7 +268,7 @@ struct TRINITY_DLL_DECL npc_floonAI : public ScriptedAI m_creature->setFaction(FACTION_FRIENDLY_FL); } - void Aggro(Unit *who) {} + void EnterCombat(Unit *who) {} void UpdateAI(const uint32 diff) { @@ -323,36 +322,7 @@ bool GossipSelect_npc_floon(Player *player, Creature *_Creature, uint32 sender, player->CLOSE_GOSSIP_MENU(); _Creature->setFaction(FACTION_HOSTILE_FL); DoScriptText(SAY_FLOON_ATTACK, _Creature, player); - ((npc_floonAI*)_Creature->AI())->AttackStart(player); - } - return true; -} - -/*###### -## npc_skyguard_handler_deesak -######*/ - -#define GOSSIP_SKYGUARD "Fly me to Ogri'la please" - -bool GossipHello_npc_skyguard_handler_deesak(Player *player, Creature *_Creature ) -{ - if (_Creature->isQuestGiver()) - player->PrepareQuestMenu( _Creature->GetGUID() ); - - if (player->GetReputationRank(1031) >= REP_HONORED) - player->ADD_GOSSIP_ITEM( 2, GOSSIP_SKYGUARD, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - - player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID()); - - return true; -} - -bool GossipSelect_npc_skyguard_handler_deesak(Player *player, Creature *_Creature, uint32 sender, uint32 action ) -{ - if (action == GOSSIP_ACTION_INFO_DEF+1) - { - player->CLOSE_GOSSIP_MENU(); - player->CastSpell(player,41279,true); //TaxiPath 705 (Taxi - Skettis to Skyguard Outpost) + _Creature->AI()->AttackStart(player); } return true; } @@ -388,9 +358,9 @@ struct TRINITY_DLL_DECL npc_isla_starmaneAI : public npc_escortAI { case 0: { - GameObject* Cage = FindGameObject(GO_CAGE, 10, m_creature); + GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 10); if(Cage) - Cage->SetGoState(0); + Cage->SetGoState(GO_STATE_ACTIVE); }break; case 2: DoScriptText(SAY_PROGRESS_1, m_creature, player); break; case 5: DoScriptText(SAY_PROGRESS_2, m_creature, player); break; @@ -398,10 +368,10 @@ struct TRINITY_DLL_DECL npc_isla_starmaneAI : public npc_escortAI case 29:DoScriptText(SAY_PROGRESS_4, m_creature, player); if (player) { - if(((Player*)player)->GetTeam() == ALLIANCE) - ((Player*)player)->GroupEventHappens(QUEST_EFTW_A, m_creature); - else if(((Player*)player)->GetTeam() == HORDE) - ((Player*)player)->GroupEventHappens(QUEST_EFTW_H, m_creature); + if(CAST_PLR(player)->GetTeam() == ALLIANCE) + CAST_PLR(player)->GroupEventHappens(QUEST_EFTW_A, m_creature); + else if(CAST_PLR(player)->GetTeam() == HORDE) + CAST_PLR(player)->GroupEventHappens(QUEST_EFTW_H, m_creature); } Completed = true; m_creature->SetInFront(player); break; case 30: m_creature->HandleEmoteCommand(EMOTE_ONESHOT_WAVE); break; @@ -416,7 +386,7 @@ struct TRINITY_DLL_DECL npc_isla_starmaneAI : public npc_escortAI m_creature->setFaction(1660); } - void Aggro(Unit* who){} + void EnterCombat(Unit* who){} void JustDied(Unit* killer) { @@ -425,10 +395,10 @@ struct TRINITY_DLL_DECL npc_isla_starmaneAI : public npc_escortAI Player* player = Unit::GetPlayer(PlayerGUID); if (player && !Completed) { - if(((Player*)player)->GetTeam() == ALLIANCE) - ((Player*)player)->FailQuest(QUEST_EFTW_A); - else if(((Player*)player)->GetTeam() == HORDE) - ((Player*)player)->FailQuest(QUEST_EFTW_H); + if(CAST_PLR(player)->GetTeam() == ALLIANCE) + CAST_PLR(player)->FailQuest(QUEST_EFTW_A); + else if(CAST_PLR(player)->GetTeam() == HORDE) + CAST_PLR(player)->FailQuest(QUEST_EFTW_H); } } } @@ -443,7 +413,7 @@ bool QuestAccept_npc_isla_starmane(Player* player, Creature* creature, Quest con { if (quest->GetQuestId() == QUEST_EFTW_H || quest->GetQuestId() == QUEST_EFTW_A) { - ((npc_escortAI*)(creature->AI()))->Start(true, true, false, player->GetGUID()); + CAST_AI(npc_escortAI, (creature->AI()))->Start(true, true, false, player->GetGUID()); creature->setFaction(113); } return true; @@ -489,7 +459,7 @@ CreatureAI* GetAI_npc_isla_starmaneAI(Creature *_Creature) thisAI->AddWaypoint(33, -2396.81, 3517.17, -3.55); thisAI->AddWaypoint(34, -2439.23, 3523.00, -1.05); - return (CreatureAI*)thisAI; + return thisAI; } /*###### @@ -570,12 +540,7 @@ void AddSC_terokkar_forest() newscript->Name="npc_floon"; newscript->pGossipHello = &GossipHello_npc_floon; newscript->pGossipSelect = &GossipSelect_npc_floon; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_skyguard_handler_deesak"; - newscript->pGossipHello = &GossipHello_npc_skyguard_handler_deesak; - newscript->pGossipSelect = &GossipSelect_npc_skyguard_handler_deesak; + newscript->GetAI = &GetAI_npc_floon; newscript->RegisterSelf(); newscript = new Script; diff --git a/src/bindings/scripts/scripts/zone/thousand_needles/thousand_needles.cpp b/src/bindings/scripts/scripts/zone/thousand_needles/thousand_needles.cpp index 4e81d44a610..7406d259db1 100644 --- a/src/bindings/scripts/scripts/zone/thousand_needles/thousand_needles.cpp +++ b/src/bindings/scripts/scripts/zone/thousand_needles/thousand_needles.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -64,7 +64,7 @@ npc_swiftmountainAI(Creature *c) : npc_escortAI(c) {} case 70: DoScriptText(SAY_FINISH, m_creature, player); if (player && player->GetTypeId() == TYPEID_PLAYER) - ((Player*)player)->GroupEventHappens(QUEST_HOMEWARD_BOUND,m_creature); + CAST_PLR(player)->GroupEventHappens(QUEST_HOMEWARD_BOUND,m_creature); break; } @@ -75,7 +75,7 @@ npc_swiftmountainAI(Creature *c) : npc_escortAI(c) {} m_creature->setFaction(104); } - void Aggro(Unit* who){} + void EnterCombat(Unit* who){} void JustSummoned(Creature* summoned) { @@ -87,7 +87,7 @@ npc_swiftmountainAI(Creature *c) : npc_escortAI(c) {} if (PlayerGUID) { if (Player* player = Unit::GetPlayer(PlayerGUID)) - ((Player*)player)->FailQuest(QUEST_HOMEWARD_BOUND); + CAST_PLR(player)->FailQuest(QUEST_HOMEWARD_BOUND); } } @@ -101,7 +101,7 @@ bool QuestAccept_npc_swiftmountain(Player* player, Creature* creature, Quest con { if (quest->GetQuestId() == QUEST_HOMEWARD_BOUND) { - ((npc_escortAI*)(creature->AI()))->Start(true, true, false, player->GetGUID()); + CAST_AI(npc_escortAI, (creature->AI()))->Start(true, true, false, player->GetGUID()); DoScriptText(SAY_READY, creature, player); creature->setFaction(113); } @@ -186,7 +186,7 @@ CreatureAI* GetAI_npc_swiftmountain(Creature *_Creature) thisAI->AddWaypoint(70, -4938.3, -1100.41, -50.71, 5000); thisAI->AddWaypoint(71, -4937.34, -1102.87, -49.82); - return (CreatureAI*)thisAI; + return thisAI; } /*##### @@ -217,7 +217,7 @@ struct TRINITY_DLL_DECL npc_pluckyAI : public ScriptedAI ChickenTimer = 0; } - void Aggro(Unit *who){} + void EnterCombat(Unit *who){} void TransformHuman(uint32 emoteid) { @@ -259,19 +259,17 @@ struct TRINITY_DLL_DECL npc_pluckyAI : public ScriptedAI DoMeleeAttackIfReady(); } -}; -bool ReceiveEmote_npc_plucky( Player *player, Creature *_Creature, uint32 emote ) -{ - if( (emote == TEXTEMOTE_BECKON || emote == TEXTEMOTE_CHICKEN && - player->GetQuestStatus(QUEST_GET_THE_SCOOP) == QUEST_STATUS_INCOMPLETE) ) + void ReceiveEmote( Player *player, uint32 emote ) { - _Creature->SetInFront(player); - ((npc_pluckyAI*)((Creature*)_Creature)->AI())->TransformHuman(emote); + if( (emote == TEXTEMOTE_BECKON || emote == TEXTEMOTE_CHICKEN && + player->GetQuestStatus(QUEST_GET_THE_SCOOP) == QUEST_STATUS_INCOMPLETE) ) + { + m_creature->SetInFront(player); + TransformHuman(emote); + } } - - return true; -} +}; bool GossipHello_npc_plucky(Player *player, Creature *_Creature) { @@ -316,7 +314,6 @@ void AddSC_thousand_needles() newscript = new Script; newscript->Name = "npc_plucky"; newscript->GetAI = &GetAI_npc_plucky; - newscript->pReceiveEmote = &ReceiveEmote_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 index 30312313ee8..fbc248cde94 100644 --- a/src/bindings/scripts/scripts/zone/thunder_bluff/thunder_bluff.cpp +++ b/src/bindings/scripts/scripts/zone/thunder_bluff/thunder_bluff.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -54,7 +54,7 @@ struct TRINITY_DLL_DECL npc_cairne_bloodhoofAI : public ScriptedAI Uppercut_Timer = 10000; } - void Aggro(Unit *who) {} + void EnterCombat(Unit *who) {} void UpdateAI(const uint32 diff) { diff --git a/src/bindings/scripts/scripts/zone/tirisfal_glades/tirisfal_glades.cpp b/src/bindings/scripts/scripts/zone/tirisfal_glades/tirisfal_glades.cpp index 7a69eab5153..fb558dc31a3 100644 --- a/src/bindings/scripts/scripts/zone/tirisfal_glades/tirisfal_glades.cpp +++ b/src/bindings/scripts/scripts/zone/tirisfal_glades/tirisfal_glades.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -47,13 +47,13 @@ struct TRINITY_DLL_DECL npc_calvin_montagueAI : public ScriptedAI m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); } - void Aggro(Unit* who) { } + void EnterCombat(Unit* who) { } void JustDied(Unit* Killer) { if( Killer->GetTypeId() == TYPEID_PLAYER ) - if( ((Player*)Killer)->GetQuestStatus(QUEST_590) == QUEST_STATUS_INCOMPLETE ) - ((Player*)Killer)->AreaExploredOrEventHappens(QUEST_590); + if( CAST_PLR(Killer)->GetQuestStatus(QUEST_590) == QUEST_STATUS_INCOMPLETE ) + CAST_PLR(Killer)->AreaExploredOrEventHappens(QUEST_590); } void UpdateAI(const uint32 diff) @@ -75,7 +75,7 @@ bool QuestAccept_npc_calvin_montague(Player* player, Creature* creature, Quest c { creature->setFaction(FACTION_HOSTILE); creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); - ((npc_calvin_montagueAI*)creature->AI())->AttackStart(player); + CAST_AI(npc_calvin_montagueAI, creature->AI())->AttackStart(player); } return true; } @@ -100,7 +100,7 @@ GameObject* SearchMausoleumGo(Unit *source, uint32 entry, float range) cell.SetNoCreate(); Trinity::NearestGameObjectEntryInObjectRangeCheck go_check(*source, entry, range); - Trinity::GameObjectLastSearcher<Trinity::NearestGameObjectEntryInObjectRangeCheck> searcher(pGo, go_check); + Trinity::GameObjectLastSearcher<Trinity::NearestGameObjectEntryInObjectRangeCheck> searcher(source, pGo, go_check); TypeContainerVisitor<Trinity::GameObjectLastSearcher<Trinity::NearestGameObjectEntryInObjectRangeCheck>, GridTypeMapContainer> go_searcher(searcher); @@ -117,7 +117,7 @@ bool GOHello_go_mausoleum_door(Player *player, GameObject* _GO) if (GameObject *trigger = SearchMausoleumGo(player, GO_TRIGGER, 30)) { - trigger->SetGoState(1); + trigger->SetGoState(GO_STATE_READY); player->SummonCreature(C_ULAG, 2390.26, 336.47, 40.01, 2.26, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 300000); return false; } @@ -132,7 +132,7 @@ bool GOHello_go_mausoleum_trigger(Player *player, GameObject* _GO) if (GameObject *door = SearchMausoleumGo(player, GO_DOOR, 30)) { - _GO->SetGoState(0); + _GO->SetGoState(GO_STATE_ACTIVE); door->RemoveFlag(GAMEOBJECT_FLAGS,GO_FLAG_INTERACT_COND); return true; } diff --git a/src/bindings/scripts/scripts/zone/uldaman/boss_archaedas.cpp b/src/bindings/scripts/scripts/zone/uldaman/boss_archaedas.cpp index 1536728365e..3221466bfd3 100644 --- a/src/bindings/scripts/scripts/zone/uldaman/boss_archaedas.cpp +++ b/src/bindings/scripts/scripts/zone/uldaman/boss_archaedas.cpp @@ -51,7 +51,7 @@ struct TRINITY_DLL_DECL boss_archaedasAI : public ScriptedAI { boss_archaedasAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)m_creature->GetInstanceData()); + pInstance = (m_creature->GetInstanceData()); } uint32 Tremor_Timer; @@ -94,7 +94,7 @@ struct TRINITY_DLL_DECL boss_archaedasAI : public ScriptedAI } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { m_creature->setFaction (14); m_creature->RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); @@ -210,7 +210,7 @@ struct TRINITY_DLL_DECL mob_archaedas_minionsAI : public ScriptedAI { mob_archaedas_minionsAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)m_creature->GetInstanceData()); + pInstance = (m_creature->GetInstanceData()); } uint32 Arcing_Timer; @@ -236,7 +236,7 @@ struct TRINITY_DLL_DECL mob_archaedas_minionsAI : public ScriptedAI m_creature->RemoveAllAuras(); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { m_creature->setFaction (14); m_creature->RemoveAllAuras(); @@ -336,7 +336,7 @@ bool GOHello_go_altar_of_archaedas(Player *player, GameObject* go) return false; // not enough people } - ScriptedInstance* pInstance = ((ScriptedInstance*)player->GetInstanceData()); + ScriptedInstance* pInstance = (player->GetInstanceData()); if (!pInstance) return false; pInstance->SetData(NULL,0); pInstance->SetData64(0,player->GetGUID()); // activate archaedas @@ -359,7 +359,7 @@ struct TRINITY_DLL_DECL mob_stonekeepersAI : public ScriptedAI { mob_stonekeepersAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)m_creature->GetInstanceData()); + pInstance = (m_creature->GetInstanceData()); } bool InCombat; @@ -374,7 +374,7 @@ struct TRINITY_DLL_DECL mob_stonekeepersAI : public ScriptedAI m_creature->RemoveAllAuras(); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { m_creature->setFaction (14); m_creature->RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); @@ -423,7 +423,7 @@ static uint32 altarOfTheKeeperCounter=0; bool GOHello_go_altar_of_the_keepers(Player *player, GameObject* go) { - ScriptedInstance* pInstance = ((ScriptedInstance*)player->GetInstanceData()); + ScriptedInstance* pInstance = (player->GetInstanceData()); if (!pInstance) return true; bool alreadyUsed; diff --git a/src/bindings/scripts/scripts/zone/uldaman/boss_ironaya.cpp b/src/bindings/scripts/scripts/zone/uldaman/boss_ironaya.cpp index 14a788d29e2..ccee1e68790 100644 --- a/src/bindings/scripts/scripts/zone/uldaman/boss_ironaya.cpp +++ b/src/bindings/scripts/scripts/zone/uldaman/boss_ironaya.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -23,12 +23,11 @@ EndScriptData */ #include "precompiled.h" -#define SPELL_ARCINGSMASH 39144 -#define SPELL_KNOCKAWAY 22893 -#define SPELL_WSTOMP 16727 +#define SAY_AGGRO -1070000 -#define SAY_AGGRO "None may steal the secrets of the makers!" -#define SOUND_AGGRO 5851 +#define SPELL_ARCINGSMASH 8374 +#define SPELL_KNOCKAWAY 10101 +#define SPELL_WSTOMP 11876 struct TRINITY_DLL_DECL boss_ironayaAI : public ScriptedAI { @@ -45,10 +44,9 @@ struct TRINITY_DLL_DECL boss_ironayaAI : public ScriptedAI hasCastedWstomp = false; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { - DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL); - DoPlaySoundToSet(m_creature,SOUND_AGGRO); + DoScriptText(SAY_AGGRO, m_creature); } void UpdateAI(const uint32 diff) diff --git a/src/bindings/scripts/scripts/zone/uldaman/instance_uldaman.cpp b/src/bindings/scripts/scripts/zone/uldaman/instance_uldaman.cpp index 7a5e50805f1..3da5e679cab 100644 --- a/src/bindings/scripts/scripts/zone/uldaman/instance_uldaman.cpp +++ b/src/bindings/scripts/scripts/zone/uldaman/instance_uldaman.cpp @@ -70,7 +70,7 @@ struct TRINITY_DLL_DECL instance_uldaman : public ScriptedInstance break; case ANCIENT_VAULT_DOOR: - go->SetUInt32Value(GAMEOBJECT_STATE,1); + go->SetGoState(GO_STATE_READY); go->SetUInt32Value(GAMEOBJECT_FLAGS, 33); ancientVaultDoor = go->GetGUID(); break; @@ -88,19 +88,19 @@ struct TRINITY_DLL_DECL instance_uldaman : public ScriptedInstance void OpenDoor(uint64 guid) { - GameObject *go = instance->GetGameObjectInMap(guid); + GameObject *go = instance->GetGameObject(guid); if(!go) return; go->SetUInt32Value(GAMEOBJECT_FLAGS, 33); - go->SetUInt32Value(GAMEOBJECT_STATE, 0); + go->SetGoState(GO_STATE_ACTIVE); } void ActivateStoneKeepers() { for(std::vector<uint64>::iterator i = stoneKeeper.begin(); i != stoneKeeper.end(); ++i) { - Creature *target = instance->GetCreatureInMap(*i); + Creature *target = instance->GetCreature(*i); if (!target || !target->isAlive() || target->getFaction()==14) continue; target->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_DISABLE_MOVE); @@ -114,13 +114,13 @@ struct TRINITY_DLL_DECL instance_uldaman : public ScriptedInstance void ActivateWallMinions() { - Creature *archaedas = instance->GetCreatureInMap(archaedasGUID); + Creature *archaedas = instance->GetCreature(archaedasGUID); if(!archaedas) return; for(std::vector<uint64>::iterator i = archaedasWallMinions.begin(); i != archaedasWallMinions.end(); ++i) { - Creature *target = instance->GetCreatureInMap(*i); + Creature *target = instance->GetCreature(*i); if (!target || !target->isAlive() || target->getFaction()==14) continue; archaedas->CastSpell(target, SPELL_AWAKEN_VAULT_WALKER, true); @@ -135,7 +135,7 @@ struct TRINITY_DLL_DECL instance_uldaman : public ScriptedInstance // first despawn any aggroed wall minions for(std::vector<uint64>::iterator i = archaedasWallMinions.begin(); i != archaedasWallMinions.end(); ++i) { - Creature *target = instance->GetCreatureInMap(*i); + Creature *target = instance->GetCreature(*i); if (!target || target->isDead() || target->getFaction()!=14) continue; target->setDeathState(JUST_DIED); @@ -145,7 +145,7 @@ struct TRINITY_DLL_DECL instance_uldaman : public ScriptedInstance // Vault Walkers for(std::vector<uint64>::iterator i = vaultWalker.begin(); i != vaultWalker.end(); ++i) { - Creature *target = instance->GetCreatureInMap(*i); + Creature *target = instance->GetCreature(*i); if (!target || target->isDead() || target->getFaction()!=14) continue; target->setDeathState(JUST_DIED); @@ -155,7 +155,7 @@ struct TRINITY_DLL_DECL instance_uldaman : public ScriptedInstance // Earthen Guardians for(std::vector<uint64>::iterator i = earthenGuardian.begin(); i != earthenGuardian.end(); ++i) { - Creature *target = instance->GetCreatureInMap(*i); + Creature *target = instance->GetCreature(*i); if (!target || target->isDead() || target->getFaction()!=14) continue; target->setDeathState(JUST_DIED); @@ -165,7 +165,7 @@ struct TRINITY_DLL_DECL instance_uldaman : public ScriptedInstance void ActivateArchaedas(uint64 target) { - Creature *archaedas = instance->GetCreatureInMap(archaedasGUID); + Creature *archaedas = instance->GetCreature(archaedasGUID); if(!archaedas) return; @@ -181,7 +181,7 @@ struct TRINITY_DLL_DECL instance_uldaman : public ScriptedInstance // first respawn any aggroed wall minions for(std::vector<uint64>::iterator i = archaedasWallMinions.begin(); i != archaedasWallMinions.end(); ++i) { - Creature *target = instance->GetCreatureInMap(*i); + Creature *target = instance->GetCreature(*i); if (target && target->isDead()) { target->Respawn(); @@ -193,7 +193,7 @@ struct TRINITY_DLL_DECL instance_uldaman : public ScriptedInstance // Vault Walkers for(std::vector<uint64>::iterator i = vaultWalker.begin(); i != vaultWalker.end(); ++i) { - Creature *target = instance->GetCreatureInMap(*i); + Creature *target = instance->GetCreature(*i); if (target && target->isDead()) { target->Respawn(); @@ -205,7 +205,7 @@ struct TRINITY_DLL_DECL instance_uldaman : public ScriptedInstance // Earthen Guardians for(std::vector<uint64>::iterator i = earthenGuardian.begin(); i != earthenGuardian.end(); ++i) { - Creature *target = instance->GetCreatureInMap(*i); + Creature *target = instance->GetCreature(*i); if (target && target->isDead()) { target->Respawn(); diff --git a/src/bindings/scripts/scripts/zone/uldaman/uldaman.cpp b/src/bindings/scripts/scripts/zone/uldaman/uldaman.cpp index de5f4889fe4..8498b3b5770 100644 --- a/src/bindings/scripts/scripts/zone/uldaman/uldaman.cpp +++ b/src/bindings/scripts/scripts/zone/uldaman/uldaman.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -45,7 +45,7 @@ struct TRINITY_DLL_DECL mob_jadespine_basiliskAI : public ScriptedAI Cslumber_Timer = 2000; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } diff --git a/src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/boss_bjarngrim.cpp b/src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/boss_bjarngrim.cpp new file mode 100644 index 00000000000..b26c3d0853d --- /dev/null +++ b/src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/boss_bjarngrim.cpp @@ -0,0 +1,94 @@ +/* Script Data Start +SDName: Boss bjarngrim +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = '' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//AURAS AND STANCES +#define BUFF_BATTLE_AURA 41106 +#define SPELL_BATTLE_STANCE 53792 +#define BUFF_BERSEKER_AURA 41107 +#define SPELL_BERSEKER_STANCE 53791 +#define BUFF_DEFENSIVE_AURA 41105 +#define SPELL_DEFENSIVE_STANCE 53790 + +//OTHER SPELLS +#define SPELL_CHARGE_UP 52098 +#define SPELL_CLEAVE 15284 +#define SPELL_INTERCEPT 58769 +#define SPELL_IRONFORM 52022 +#define SPELL_KNOCK_AWAY 52029 +#define SPELL_MORTAL_STRIKE 15708 +#define SPELL_SLAM 52026 +#define SPELL_SPELL_REFLECTION 36096 +#define SPELL_WHIRLWIND 52027 + +//Yell +#define SAY_AGGRO -1602000 +#define SAY_SLAY_1 -1602001 +#define SAY_SLAY_2 -1602002 +#define SAY_SLAY_3 -1602003 +#define SAY_DEATH -1602004 +#define SAY_BATTLE_STANCE -1602005 +#define SAY_BERSEKER_STANCE -1602006 +#define SAY_DEFENSIVE_STANCE -1602007 + +struct TRINITY_DLL_DECL boss_bjarngrimAI : public ScriptedAI +{ + boss_bjarngrimAI(Creature *c) : ScriptedAI(c) {} + + uint32 whirlwind; + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if(!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + void KilledUnit(Unit *victim) + { + if(victim == m_creature) + return; + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature);break; + case 1: DoScriptText(SAY_SLAY_2, m_creature);break; + case 2: DoScriptText(SAY_SLAY_3, m_creature);break; + } + } +}; + +CreatureAI* GetAI_boss_bjarngrim(Creature *_Creature) +{ + return new boss_bjarngrimAI (_Creature); +} + +void AddSC_boss_bjarngrim() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_bjarngrim"; + newscript->GetAI = &GetAI_boss_bjarngrim; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/boss_ionar.cpp b/src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/boss_ionar.cpp new file mode 100644 index 00000000000..edbf1e58522 --- /dev/null +++ b/src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/boss_ionar.cpp @@ -0,0 +1,114 @@ +/* Script Data Start +SDName: Boss ionar +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = 'boss_ionar' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_BALL_LIGHTNING 52780 +#define SPELL_BALL_LIGHTNING_2 59800 +#define SPELL_DISPERSE 52770 //Disperse into Sparks of Ionar. +#define SPELL_STATIC_OVERLOAD 52658 //Effect Apply Aura: Periodic Trigger Interval: 2 seconds Spell 52659 +#define SPELL_STATIC_OVERLOAD_2 52658 //Effect Apply Aura: Periodic Trigger Interval: 2 seconds Spell 59796 + +//Spark of Ionar spells +#define NPC_SPARK_OF_IONAR 28962 //invulnerable +#define SPELL_ARCING_BURN 52617 +#define SPELL_ARCING_BURN_2 59834 + +//Yell +#define SAY_AGGRO -1602008 +#define SAY_SLAY_1 -1602009 +#define SAY_SLAY_2 -1602010 +#define SAY_SLAY_3 -1602011 +#define SAY_DEATH -1602012 +#define SAY_SPLIT_1 -1602013 +#define SAY_SPLIT_2 -1602014 + +//he does "morph" every about 25% into 4 sparks of ionar that chase people around, they r slow and easily avoidable. + +struct TRINITY_DLL_DECL boss_ionarAI : public ScriptedAI +{ + boss_ionarAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if(!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + void KilledUnit(Unit *victim) + { + if(victim == m_creature) + return; + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature);break; + case 1: DoScriptText(SAY_SLAY_2, m_creature);break; + case 2: DoScriptText(SAY_SLAY_3, m_creature);break; + } + } +}; + +struct TRINITY_DLL_DECL npc_spark_of_ionarAI : public ScriptedAI +{ + npc_spark_of_ionarAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) {} + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if(!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) {} +}; + +CreatureAI* GetAI_npc_spark_of_ionar(Creature *_Creature) +{ + return new npc_spark_of_ionarAI (_Creature); +} +CreatureAI* GetAI_boss_ionar(Creature *_Creature) +{ + return new boss_ionarAI (_Creature); +} + +void AddSC_boss_ionar() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_ionar"; + newscript->GetAI = &GetAI_boss_ionar; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="spark_of_ionar"; + newscript->GetAI = &GetAI_npc_spark_of_ionar; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/boss_loken.cpp b/src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/boss_loken.cpp new file mode 100644 index 00000000000..9459587e3c1 --- /dev/null +++ b/src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/boss_loken.cpp @@ -0,0 +1,86 @@ +/* Script Data Start +SDName: Boss loken +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = 'boss_loken' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_ARC_NOVA 52921 +//Effect #1 School Damage (Nature), Value: 3238 to 3762 +//Effect #2 Apply Aura: Dummy, Value: 3238 to 3762, Server-side script + +#define SPELL_LIGHTNING_NOVA 52960 +#define SPELL_LIGHTNING_NOVA_2 59835 + +//Yell +#define SAY_AGGRO -1602015 +#define SAY_INTRO_1 -1602016 +#define SAY_INTRO_2 -1602017 +#define SAY_SLAY_1 -1602018 +#define SAY_SLAY_2 -1602019 +#define SAY_SLAY_3 -1602020 +#define SAY_DEATH -1602021 +#define SAY_NOVA_1 -1602022 +#define SAY_NOVA_2 -1602023 +#define SAY_NOVA_3 -1602024 +#define SAY_75HEALTH -1602025 +#define SAY_50HEALTH -1602026 +#define SAY_25HEALTH -1602027 + +struct TRINITY_DLL_DECL boss_lokenAI : public ScriptedAI +{ + boss_lokenAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if(!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + void KilledUnit(Unit *victim) + { + if(victim == m_creature) + return; + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature);break; + case 1: DoScriptText(SAY_SLAY_2, m_creature);break; + case 2: DoScriptText(SAY_SLAY_3, m_creature);break; + } + } +}; + +CreatureAI* GetAI_boss_loken(Creature *_Creature) +{ + return new boss_lokenAI (_Creature); +} + +void AddSC_boss_loken() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_loken"; + newscript->GetAI = &GetAI_boss_loken; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/boss_volkhan.cpp b/src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/boss_volkhan.cpp new file mode 100644 index 00000000000..7c76164a63e --- /dev/null +++ b/src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/boss_volkhan.cpp @@ -0,0 +1,128 @@ +/* Script Data Start +SDName: Boss volkhan +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = 'boss_volkhan' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_HEAT 52387 +#define SPELL_HEAT_2 59528 +#define SPELL_SHATTERING_STOMP 52237 +#define SPELL_SHATTERING_STOMP_2 59529 +#define SPELL_TEMPER 52238 //Dummy ---> Strikes Volkhan's Anvil, creating a number of Molten Golems. + +#define NPC_VOLKHANS_ANVIL 28823 +#define MOB_MOLTEN_GOLEM 28695 + +//Yells +#define SAY_AGGRO -1602028 +#define SAY_SLAY_1 -1602029 +#define SAY_SLAY_2 -1602030 +#define SAY_SLAY_3 -1602031 +#define SAY_DEATH -1602032 +#define SAY_STOMP_1 -1602033 +#define SAY_STOMP_2 -1602034 +#define SAY_FORGE_1 -1602035 +#define SAY_FORGE_2 -1602036 + +struct TRINITY_DLL_DECL boss_volkhanAI : public ScriptedAI +{ + boss_volkhanAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if(!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + void KilledUnit(Unit *victim) + { + if(victim == m_creature) + return; + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature);break; + case 1: DoScriptText(SAY_SLAY_2, m_creature);break; + case 2: DoScriptText(SAY_SLAY_3, m_creature);break; + } + } +}; + +/*###### +## Mob Molten Golem +######*/ +//Molten Golem Spells +#define SPELL_BLAST_WAVE 23113 +#define SPELL_IMMOLATION_STRIKE 52433 +#define SPELL_IMMOLATION_STRIKE_2 59530 +//Effect #1 Apply Aura: Periodic Damage, value: 900 every 3 seconds +//Effect #2 School Damage (Fire), value: 900 +//Effect #3 Script Effect +#define SPELL_SHATTER 52429 +//Effect #1 School Damage (Physical), value: 9250 to 10750, radius: 10 yards +//Effect #2 Dummy, Server-side script +#define SPELL_SHATTER_2 + +struct TRINITY_DLL_DECL mob_molten_golemAI : public ScriptedAI +{ + mob_molten_golemAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) {} + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if(!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) {} +}; + +CreatureAI* GetAI_mob_molten_golem(Creature *_Creature) +{ + return new mob_molten_golemAI (_Creature); +} + +CreatureAI* GetAI_boss_volkhan(Creature *_Creature) +{ + return new boss_volkhanAI (_Creature); +} + +void AddSC_boss_volkhan() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_volkhan"; + newscript->GetAI = &GetAI_boss_volkhan; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_molten_golem"; + newscript->GetAI = &GetAI_mob_molten_golem; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/def_halls_of_lightning.h b/src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/def_halls_of_lightning.h new file mode 100644 index 00000000000..134e32850ae --- /dev/null +++ b/src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/def_halls_of_lightning.h @@ -0,0 +1,4 @@ +#ifndef DEF_HALLS_OF_LIGHTNING_H +#define DEF_HALLS_OF_LIGHTNING_H + +#endif diff --git a/src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/instance_halls_of_lightning.cpp b/src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/instance_halls_of_lightning.cpp new file mode 100644 index 00000000000..1c7983d3b69 --- /dev/null +++ b/src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/instance_halls_of_lightning.cpp @@ -0,0 +1,21 @@ +#include "precompiled.h" +#include "def_halls_of_lightning.h" + +struct TRINITY_DLL_DECL instance_halls_of_lightning : public ScriptedInstance +{ + instance_halls_of_lightning(Map *Map) : ScriptedInstance(Map) {Initialize();}; +}; + +InstanceData* GetInstanceData_instance_halls_of_lightning(Map* map) +{ + return new instance_halls_of_lightning(map); +} + +void AddSC_instance_halls_of_lightning() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_halls_of_lightning"; + newscript->GetInstanceData = &GetInstanceData_instance_halls_of_lightning; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/zone/ulduar/halls_of_stone/boss_krystallus.cpp b/src/bindings/scripts/scripts/zone/ulduar/halls_of_stone/boss_krystallus.cpp new file mode 100644 index 00000000000..911cfcdb6d0 --- /dev/null +++ b/src/bindings/scripts/scripts/zone/ulduar/halls_of_stone/boss_krystallus.cpp @@ -0,0 +1,73 @@ +/* Script Data Start +SDName: Boss krystallus +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = 'boss_krystallus' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_BOULDER_TOSS 50843 +#define SPELL_BOULDER_TOSS_2 59742 +#define SPELL_GROUND_SPIKE 59750 +#define SPELL_SHATTER 50810 +#define SPELL_SHATTER_2 61546 +#define SPELL_STOMP 48131 +#define SPELL_STOMP_2 59744 + +//Yell +#define SAY_AGGRO -1599000 +#define SAY_KILL -1599001 +#define SAY_DEATH -1599002 +#define SAY_SHATTER -1599003 + +struct TRINITY_DLL_DECL boss_krystallusAI : public ScriptedAI +{ + boss_krystallusAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if(!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + void KilledUnit(Unit *victim) + { + if(victim == m_creature) + return; + DoScriptText(SAY_KILL, m_creature); + } +}; + +CreatureAI* GetAI_boss_krystallus(Creature *_Creature) +{ + return new boss_krystallusAI (_Creature); +} + +void AddSC_boss_krystallus() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_krystallus"; + newscript->GetAI = &GetAI_boss_krystallus; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/zone/ulduar/halls_of_stone/boss_maiden_of_grief.cpp b/src/bindings/scripts/scripts/zone/ulduar/halls_of_stone/boss_maiden_of_grief.cpp new file mode 100644 index 00000000000..0a84e8114aa --- /dev/null +++ b/src/bindings/scripts/scripts/zone/ulduar/halls_of_stone/boss_maiden_of_grief.cpp @@ -0,0 +1,81 @@ +/* Script Data Start +SDName: Boss maiden_of_grief +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = 'boss_maiden_of_grief' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spell +#define SPELL_PARTING_SORROW 59723 +#define SPELL_STORM_OF_GRIEF 50752 +#define SPELL_STORM_OF_GRIEF_2 59772 +#define SPELL_SHOCK_OF_SORROW 50760 +#define SPELL_SHOCK_OF_SORROW_2 59726 +#define SPELL_PILLAR_OF_WOE 50761 +#define SPELL_PILLAR_OF_WOE_2 59727 + +//Yell +#define SAY_AGGRO -1599004 +#define SAY_SLAY_1 -1599005 +#define SAY_SLAY_2 -1599006 +#define SAY_SLAY_3 -1599007 +#define SAY_SLAY_4 -1599008 +#define SAY_DEATH -1599009 +#define SAY_STUN -1599010 + +struct TRINITY_DLL_DECL boss_maiden_of_griefAI : public ScriptedAI +{ + boss_maiden_of_griefAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if(!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + void KilledUnit(Unit *victim) + { + if(victim == m_creature) + return; + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature);break; + case 1: DoScriptText(SAY_SLAY_2, m_creature);break; + case 2: DoScriptText(SAY_SLAY_3, m_creature);break; + } + } +}; + +CreatureAI* GetAI_boss_maiden_of_grief(Creature *_Creature) +{ + return new boss_maiden_of_griefAI (_Creature); +} + +void AddSC_boss_maiden_of_grief() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_maiden_of_grief"; + newscript->GetAI = &GetAI_boss_maiden_of_grief; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/zone/ulduar/halls_of_stone/boss_sjonnir.cpp b/src/bindings/scripts/scripts/zone/ulduar/halls_of_stone/boss_sjonnir.cpp new file mode 100644 index 00000000000..99cd73c7a33 --- /dev/null +++ b/src/bindings/scripts/scripts/zone/ulduar/halls_of_stone/boss_sjonnir.cpp @@ -0,0 +1,83 @@ +/* Script Data Start +SDName: Boss sjonnir +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = 'boss_sjonnir' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_LIGHTING_RING_1 50840 //Periodic Trigger (interval 2s) spell = 50841 +#define SPELL_LIGHTING_RING_2 51849 //Periodic Trigger (interval 2s) spell = 50841 +#define SPELL_LIGHTING_RING_2 59848 //Periodic Trigger (interval 2s) spell = 59849 +#define SPELL_LIGHTING_RING_3 59861 //Periodic Trigger (interval 2s) spell = 59849 +#define SPELL_STATIC_CHARGE_1 50834 //Periodic Trigger 2s interval, spell =50835 +#define SPELL_STATIC_CHARGE_2 59846 //Periodic Trigger 2s interval, spell =50847 +#define SPELL_CHAIN_LIGHTING_1 50830 +#define SPELL_CHAIN_LIGHTING_2 59844 +#define SPELL_LIGHTING_SHIELD_1 50831 +#define SPELL_LIGHTING_SHIELD_2 59845 +#define SPELL_FRENZY 28747 + +//Yell +#define SAY_AGGRO -1599011 +#define SAY_SLAY_1 -1599012 +#define SAY_SLAY_2 -1599013 +#define SAY_SLAY_3 -1599014 +#define SAY_DEATH -1599015 + +struct TRINITY_DLL_DECL boss_sjonnirAI : public ScriptedAI +{ + boss_sjonnirAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if(!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + void KilledUnit(Unit *victim) + { + if(victim == m_creature) + return; + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature);break; + case 1: DoScriptText(SAY_SLAY_2, m_creature);break; + case 2: DoScriptText(SAY_SLAY_3, m_creature);break; + } + } +}; + +CreatureAI* GetAI_boss_sjonnir(Creature *_Creature) +{ + return new boss_sjonnirAI (_Creature); +} + +void AddSC_boss_sjonnir() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_sjonnir"; + newscript->GetAI = &GetAI_boss_sjonnir; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/zone/ulduar/halls_of_stone/def_halls_of_stone.h b/src/bindings/scripts/scripts/zone/ulduar/halls_of_stone/def_halls_of_stone.h new file mode 100644 index 00000000000..ade934ad921 --- /dev/null +++ b/src/bindings/scripts/scripts/zone/ulduar/halls_of_stone/def_halls_of_stone.h @@ -0,0 +1,4 @@ +#ifndef DEF_HALLS_OF_STONE_H +#define DEF_HALLS_OF_STONE_H + +#endif diff --git a/src/bindings/scripts/scripts/zone/ulduar/halls_of_stone/instance_halls_of_stone.cpp b/src/bindings/scripts/scripts/zone/ulduar/halls_of_stone/instance_halls_of_stone.cpp new file mode 100644 index 00000000000..8ca1d2b606f --- /dev/null +++ b/src/bindings/scripts/scripts/zone/ulduar/halls_of_stone/instance_halls_of_stone.cpp @@ -0,0 +1,21 @@ +#include "precompiled.h" +#include "def_halls_of_stone.h" + +struct TRINITY_DLL_DECL instance_halls_of_stone : public ScriptedInstance +{ + instance_halls_of_stone(Map *Map) : ScriptedInstance(Map) {Initialize();}; +}; + +InstanceData* GetInstanceData_instance_halls_of_stone(Map* map) +{ + return new instance_halls_of_stone(map); +} + +void AddSC_instance_halls_of_stone() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_halls_of_stone"; + newscript->GetInstanceData = &GetInstanceData_instance_halls_of_stone; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/zone/undercity/undercity.cpp b/src/bindings/scripts/scripts/zone/undercity/undercity.cpp index b46acf1fcc2..482165b0b55 100644 --- a/src/bindings/scripts/scripts/zone/undercity/undercity.cpp +++ b/src/bindings/scripts/scripts/zone/undercity/undercity.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -78,7 +78,7 @@ struct TRINITY_DLL_DECL npc_lady_sylvanas_windrunnerAI : public ScriptedAI targetGUID = 0; } - void Aggro(Unit *who) {} + void EnterCombat(Unit *who) {} void JustSummoned(Creature *summoned) { @@ -91,7 +91,7 @@ struct TRINITY_DLL_DECL npc_lady_sylvanas_windrunnerAI : public ScriptedAI summoned->CastSpell(target, SPELL_RIBBON_OF_SOULS, false); } - summoned->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT); + summoned->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); targetGUID = summoned->GetGUID(); } } @@ -110,7 +110,7 @@ struct TRINITY_DLL_DECL npc_lady_sylvanas_windrunnerAI : public ScriptedAI m_creature->SummonCreature(ENTRY_HIGHBORNE_BUNNY, raX, raY, myZ, 0, TEMPSUMMON_TIMED_DESPAWN, 3000); LamentEvent_Timer = 2000; - if( !m_creature->HasAura(SPELL_SYLVANAS_CAST, 0)) + if( !m_creature->HasAura(SPELL_SYLVANAS_CAST)) { DoScriptText(SAY_LAMENT_END, m_creature); DoScriptText(EMOTE_LAMENT_END, m_creature); @@ -134,8 +134,8 @@ bool ChooseReward_npc_lady_sylvanas_windrunner(Player *player, Creature *_Creatu { if( _Quest->GetQuestId() == 9180 ) { - ((npc_lady_sylvanas_windrunnerAI*)_Creature->AI())->LamentEvent = true; - ((npc_lady_sylvanas_windrunnerAI*)_Creature->AI())->DoPlaySoundToSet(_Creature,SOUND_CREDIT); + CAST_AI(npc_lady_sylvanas_windrunnerAI, _Creature->AI())->LamentEvent = true; + CAST_AI(npc_lady_sylvanas_windrunnerAI, _Creature->AI())->DoPlaySoundToSet(_Creature,SOUND_CREDIT); _Creature->CastSpell(_Creature,SPELL_SYLVANAS_CAST,false); for( uint8 i = 0; i < 4; ++i) @@ -166,7 +166,7 @@ struct TRINITY_DLL_DECL npc_highborne_lamenterAI : public ScriptedAI EventCast = true; } - void Aggro(Unit *who) {} + void EnterCombat(Unit *who) {} void UpdateAI(const uint32 diff) { @@ -174,8 +174,8 @@ struct TRINITY_DLL_DECL npc_highborne_lamenterAI : public ScriptedAI { if( EventMove_Timer < diff ) { - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_LEVITATING); - m_creature->SendMonsterMoveWithSpeed(m_creature->GetPositionX(),m_creature->GetPositionY(),HIGHBORNE_LOC_Y_NEW,MOVEMENTFLAG_ONTRANSPORT,5000); + 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; @@ -210,7 +210,7 @@ bool GossipHello_npc_parqual_fintallas(Player *player, Creature *_Creature) if (_Creature->isQuestGiver()) player->PrepareQuestMenu( _Creature->GetGUID() ); - if (player->GetQuestStatus(6628) == QUEST_STATUS_INCOMPLETE && !player->HasAura(SPELL_MARK_OF_SHAME,0) ) + if (player->GetQuestStatus(6628) == QUEST_STATUS_INCOMPLETE && !player->HasAura(SPELL_MARK_OF_SHAME) ) { player->ADD_GOSSIP_ITEM( 0, GOSSIP_HPF1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); player->ADD_GOSSIP_ITEM( 0, GOSSIP_HPF2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); diff --git a/src/bindings/scripts/scripts/zone/ungoro_crater/ungoro_crater.cpp b/src/bindings/scripts/scripts/zone/ungoro_crater/ungoro_crater.cpp index 9bb13dd7718..f8e7976f541 100644 --- a/src/bindings/scripts/scripts/zone/ungoro_crater/ungoro_crater.cpp +++ b/src/bindings/scripts/scripts/zone/ungoro_crater/ungoro_crater.cpp @@ -77,7 +77,7 @@ struct TRINITY_DLL_DECL npc_ameAI : public npc_escortAI case 55: DoScriptText(SAY_FINISH, m_creature, player); if (player && player->GetTypeId() == TYPEID_PLAYER) - ((Player*)player)->GroupEventHappens(QUEST_CHASING_AME,m_creature); + CAST_PLR(player)->GroupEventHappens(QUEST_CHASING_AME,m_creature); break; } @@ -88,7 +88,7 @@ struct TRINITY_DLL_DECL npc_ameAI : public npc_escortAI DEMORALIZINGSHOUT_Timer = 5000; } - void Aggro(Unit* who) + void EnterCombat(Unit* who) {} void JustSummoned(Creature* summoned) @@ -101,7 +101,7 @@ struct TRINITY_DLL_DECL npc_ameAI : public npc_escortAI if (PlayerGUID) { if (Player* player = Unit::GetPlayer(PlayerGUID)) - ((Player*)player)->FailQuest(QUEST_CHASING_AME); + CAST_PLR(player)->FailQuest(QUEST_CHASING_AME); } } @@ -124,7 +124,7 @@ bool QuestAccept_npc_ame(Player* player, Creature* creature, Quest const* quest) { if (quest->GetQuestId() == QUEST_CHASING_AME) { - ((npc_escortAI*)(creature->AI()))->Start(false, true, false, player->GetGUID()); + CAST_AI(npc_escortAI, (creature->AI()))->Start(false, true, false, player->GetGUID()); DoScriptText(SAY_READY, creature, player); creature->SetUInt32Value(UNIT_FIELD_BYTES_1,0); // Change faction so mobs attack @@ -194,7 +194,7 @@ CreatureAI* GetAI_npc_ame(Creature *_Creature) thisAI->AddWaypoint(55, -6302.43, -1181.32, -269.328, 5000); thisAI->AddWaypoint(56, -6298.87, -1185.79, -269.278); - return (CreatureAI*)thisAI; + return thisAI; } void AddSC_ungoro_crater() diff --git a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/boss_ingvar_the_plunderer.cpp b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/boss_ingvar_the_plunderer.cpp new file mode 100644 index 00000000000..e3c66109dfc --- /dev/null +++ b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/boss_ingvar_the_plunderer.cpp @@ -0,0 +1,449 @@ +/* + * Copyright (C) 2009 Trinity <http://www.trinitycore.org/> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Ingvar_The_Plunderer +SD%Complete: 95 +SDComment: Some Problems with Annhylde Movement, Blizzlike Timers +SDCategory: Udgarde Keep +EndScriptData */ + +#include "precompiled.h" +#include "def_utgarde_keep.h" + +//Yells Ingvar +#define YELL_AGGRO_1 -1574015 +#define YELL_AGGRO_2 -1574022 + +#define YELL_DEAD_1 -1574017 +#define YELL_DEAD_2 -1574024 + +#define YELL_KILL_1 -1574023 +#define YELL_KILL_2 -1574016 + +//Ingvar Spells human form +#define MOB_INGVAR_HUMAN 23954 +#define SPELL_CLEAVE 42724 +#define SPELL_SMASH 42669 +#define H_SPELL_SMASH 59706 +#define SPELL_STAGGERING_ROAR 42708 +#define H_SPELL_STAGGERING_ROAR 59708 +#define SPELL_ENRAGE 42705 +#define H_SPELL_ENRAGE 59707 + +#define MOB_ANNHYLDE_THE_CALLER 24068 +#define SPELL_INGVAR_FEIGN_DEATH 42795 +#define SPELL_SUMMON_BANSHEE 42912 +#define SPELL_SCOURG_RESURRECTION_EFFEKTSPAWN 42863 //Spawn resurrecteffekt around Ingvar + +#define MODEL_INGVAR_UNDEAD 26351 +#define MODEL_INGVAR_HUMAN 21953 + +//Ingvar Spells undead form +#define MOB_INGVAR_UNDEAD 23980 +#define SPELL_DARK_SMASH 42723 +#define SPELL_DREADFUL_ROAR 42729 +#define H_SPELL_DREADFUL_ROAR 59734 +#define SPELL_WOE_STRIKE 42730 +#define H_SPELL_WOE_STRIKE 59735 + +#define ENTRY_THROW_TARGET 23996 +#define SPELL_SHADOW_AXE_SUMMON 42749 + +struct TRINITY_DLL_DECL boss_ingvar_the_plundererAI : public ScriptedAI +{ + boss_ingvar_the_plundererAI(Creature *c) : ScriptedAI(c) + { + pInstance = (c->GetInstanceData()); + HeroicMode = c->GetMap()->IsHeroic(); + } + + ScriptedInstance* pInstance; + + bool HeroicMode; + bool undead; + bool event_inProgress; + + uint32 Cleave_Timer; + uint32 Smash_Timer; + uint32 Enrage_Timer; + uint32 Roar_Timer; + uint32 SpawnResTimer; + uint32 wait_Timer; + + void Reset() + { + if(undead) // Visual Hack + m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, MODEL_INGVAR_HUMAN); + + undead = false; + event_inProgress = false; + + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); + m_creature->SetStandState(UNIT_STAND_STATE_STAND); + + Cleave_Timer = 2000; + Smash_Timer = 5000; + Enrage_Timer = 10000; + Roar_Timer = 15000; + + SpawnResTimer = 3000; + + wait_Timer = 0; + + if(pInstance) + pInstance->SetData(DATA_INGVAR_EVENT, NOT_STARTED); + } + + void DamageTaken(Unit *done_by, uint32 &damage) + { + if( damage >= m_creature->GetHealth() && !undead) + { + //DoCast(m_creature,SPELL_INGVAR_FEIGN_DEATH,true); // Dont work ??? + // visuel hack + m_creature->SetHealth(0); + m_creature->InterruptNonMeleeSpells(true); + m_creature->RemoveAllAuras(); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); + m_creature->GetMotionMaster()->MovementExpired(false); + m_creature->GetMotionMaster()->MoveIdle(); + m_creature->SetStandState(UNIT_STAND_STATE_DEAD); + // visuel hack end + + event_inProgress = true; + undead = true; + + DoScriptText(YELL_DEAD_1,m_creature); + } + + if(event_inProgress) + { + damage = 0; + } + } + + void StartZombiePhase() + { + undead = true; + event_inProgress = false; + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); + m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); + m_creature->AI()->AttackStart(m_creature->getVictim()); + + DoScriptText(YELL_AGGRO_2,m_creature); + } + + void EnterCombat(Unit *who) + { + DoScriptText(YELL_AGGRO_1,m_creature); + + if(pInstance) + pInstance->SetData(DATA_INGVAR_EVENT, IN_PROGRESS); + } + + void JustDied(Unit* killer) + { + DoScriptText(YELL_DEAD_2,m_creature); + + if(pInstance) + pInstance->SetData(DATA_INGVAR_EVENT, DONE); + } + + void KilledUnit(Unit *victim) + { + if(undead) { DoScriptText(YELL_KILL_1,m_creature); } + else { DoScriptText(YELL_KILL_2,m_creature); } + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if(event_inProgress) + { + if(SpawnResTimer) + if(SpawnResTimer< diff) + { + DoCast(m_creature,SPELL_SUMMON_BANSHEE); // Summons direktly on caster position + //DoCast(m_creature,SPELL_SCOURG_RESURRECTION_EFFEKTSPAWN); // Dont needet ? + SpawnResTimer = 0; + }else SpawnResTimer -= diff; + + return; + } + + // This is used for a spell queue ... the spells should not castet if one spell is already casting + if(wait_Timer) + if(wait_Timer < diff) + { + wait_Timer = 0; + }else wait_Timer -= diff; + + if(Cleave_Timer < diff) + { + if(!wait_Timer) + { + if(undead) + DoCast(m_creature->getVictim(),HeroicMode ? H_SPELL_WOE_STRIKE : SPELL_WOE_STRIKE); + else + DoCast(m_creature->getVictim(),SPELL_CLEAVE); + Cleave_Timer = rand()%5000 + 2000; + + wait_Timer = 1000; + } + }else Cleave_Timer -= diff; + + if(Smash_Timer < diff) + { + if(!wait_Timer) + { + if(undead) + DoCast(m_creature->getVictim(), SPELL_DARK_SMASH); + else + DoCast(m_creature->getVictim(),HeroicMode ? H_SPELL_SMASH : SPELL_SMASH); + Smash_Timer = 10000; + + wait_Timer = 5000; + } + }else Smash_Timer -= diff; + + if(!undead) + { + if(Enrage_Timer < diff) + { + DoCast(m_creature,HeroicMode ? H_SPELL_ENRAGE : SPELL_ENRAGE); + Enrage_Timer = 10000; + }else Enrage_Timer -= diff; + }else // In Undead form used to summon weapon + { + if(Enrage_Timer < diff) + { + if(!wait_Timer) + { + // Spawn target for Axe + Unit* target = SelectUnit(SELECT_TARGET_TOPAGGRO, 1); + if(target) + { + Creature* temp = m_creature->SummonCreature(ENTRY_THROW_TARGET,target->GetPositionX(),target->GetPositionY(),target->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN,2000); + + DoCast(m_creature,SPELL_SHADOW_AXE_SUMMON); + } + Enrage_Timer = 30000; + } + }else Enrage_Timer -= diff; + } + + + if(Roar_Timer < diff) + { + if(!wait_Timer) + { + if(undead) + DoCast(m_creature,HeroicMode ? H_SPELL_DREADFUL_ROAR : SPELL_DREADFUL_ROAR); + else + DoCast(m_creature,HeroicMode ? H_SPELL_STAGGERING_ROAR : SPELL_STAGGERING_ROAR); + Roar_Timer = 10000; + + wait_Timer = 5000; + } + }else Roar_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_ingvar_the_plunderer(Creature *_Creature) +{ + return new boss_ingvar_the_plundererAI (_Creature); +} + +#define YELL_RESSURECT -1574025 + +//Spells for Annhylde +#define SPELL_SCOURG_RESURRECTION_HEAL 42704 //Heal Max + DummyAura +#define SPELL_SCOURG_RESURRECTION_BEAM 42857 //Channeling Beam of Annhylde +#define SPELL_SCOURG_RESURRECTION_DUMMY 42862 //Some Emote Dummy? +#define SPELL_INGVAR_TRANSFORM 42796 + +struct TRINITY_DLL_DECL mob_annhylde_the_callerAI : public ScriptedAI +{ + mob_annhylde_the_callerAI(Creature *c) : ScriptedAI(c) + { + pInstance = (c->GetInstanceData()); + } + + float x,y,z; + ScriptedInstance* pInstance; + uint32 Resurect_Timer; + uint32 Resurect_Phase; + + void Reset() + { + m_creature->AddUnitMovementFlag(MOVEMENTFLAG_FLYING + MOVEMENTFLAG_FLYING2); + m_creature->SetSpeed(MOVE_SWIM , 0.1f); + m_creature->SetSpeed(MOVE_RUN , 0.1f); + m_creature->SetSpeed(MOVE_WALK , 0.1f); + m_creature->SetSpeed(MOVE_FLIGHT , 0.1f); + + m_creature->GetPosition(x,y,z); + DoTeleportTo(x+1,y,z+30); + + Unit* ingvar = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_INGVAR)); + if(ingvar) + { + m_creature->GetMotionMaster()->MovePoint(1,x,y,z+15); + + DoScriptText(YELL_RESSURECT,m_creature); + } + } + + void MovementInform(uint32 type, uint32 id) + { + if(type != POINT_MOTION_TYPE) + return; + Unit* ingvar = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_INGVAR)); + if(ingvar) + { + switch (id) + { + case 1: + ingvar->RemoveAura(SPELL_SUMMON_BANSHEE); + ingvar->CastSpell(ingvar,SPELL_SCOURG_RESURRECTION_DUMMY,true); + DoCast(ingvar,SPELL_SCOURG_RESURRECTION_BEAM); + Resurect_Timer = 8000; + Resurect_Phase = 1; + break; + case 2: + m_creature->DealDamage(m_creature,m_creature->GetHealth()); + m_creature->RemoveCorpse(); + break; + } + } + } + + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void EnterCombat(Unit *who) {} + void UpdateAI(const uint32 diff) + { + if(Resurect_Timer) + if(Resurect_Timer < diff) + { + if(Resurect_Phase == 1) + { + Unit* ingvar = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_INGVAR)); + if(ingvar) + { + ingvar->SetStandState(UNIT_STAND_STATE_STAND); + ingvar->CastSpell(ingvar,SPELL_SCOURG_RESURRECTION_HEAL,false); + } + Resurect_Timer = 3000; + Resurect_Phase = 2; + }else if (Resurect_Phase == 2) + { + Creature* ingvar = Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_INGVAR)); + if(ingvar) + { + ingvar->RemoveAurasDueToSpell(SPELL_SCOURG_RESURRECTION_DUMMY); + //ingvar->CastSpell(ingvar,SPELL_INGVAR_TRANSFORM,false); + ingvar->SetUInt32Value(UNIT_FIELD_DISPLAYID, MODEL_INGVAR_UNDEAD); // Visual Hack - when he dies he becomes human model -> wrong + Creature* c_ingvar = ingvar; + + CAST_AI(boss_ingvar_the_plundererAI, (c_ingvar->AI()))->StartZombiePhase(); + + m_creature->GetMotionMaster()->MovePoint(2,x+1,y,z+30); + Resurect_Phase++; + } + } + + }else Resurect_Timer -= diff; + } +}; + +CreatureAI* GetAI_mob_annhylde_the_caller(Creature *_Creature) +{ + return new mob_annhylde_the_callerAI (_Creature); +} + +#define SPELL_SHADOW_AXE_DAMAGE 42750 +#define H_SPELL_SHADOW_AXE_DAMAGE 59719 + +struct TRINITY_DLL_DECL mob_ingvar_throw_dummyAI : public ScriptedAI +{ + mob_ingvar_throw_dummyAI(Creature *c) : ScriptedAI(c) + { + pInstance = (c->GetInstanceData()); + HeroicMode = c->GetMap()->IsHeroic(); + } + + bool HeroicMode; + uint32 Despawn_Timer; + + ScriptedInstance* pInstance; + + void Reset() + { + Unit* target = m_creature->FindNearestCreature(ENTRY_THROW_TARGET,50); + if(target) + { + DoCast(m_creature, HeroicMode ? H_SPELL_SHADOW_AXE_DAMAGE : SPELL_SHADOW_AXE_DAMAGE); + float x,y,z; + target->GetPosition(x,y,z); + m_creature->GetMotionMaster()->MovePoint(0,x,y,z); + } + Despawn_Timer = 7000; + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void EnterCombat(Unit *who) {} + void UpdateAI(const uint32 diff) + { + if(Despawn_Timer < diff) + { + m_creature->DealDamage(m_creature,m_creature->GetHealth()); + m_creature->RemoveCorpse(); + Despawn_Timer = 0; + }else Despawn_Timer -= diff; + } +}; + +CreatureAI* GetAI_mob_ingvar_throw_dummy(Creature *_Creature) +{ + return new mob_ingvar_throw_dummyAI (_Creature); +} + +void AddSC_boss_ingvar_the_plunderer() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_ingvar_the_plunderer"; + newscript->GetAI = &GetAI_boss_ingvar_the_plunderer; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_annhylde_the_caller"; + newscript->GetAI = &GetAI_mob_annhylde_the_caller; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_ingvar_throw_dummy"; + newscript->GetAI = &GetAI_mob_ingvar_throw_dummy; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/boss_keleseth.cpp b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/boss_keleseth.cpp new file mode 100644 index 00000000000..a145ddcc425 --- /dev/null +++ b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/boss_keleseth.cpp @@ -0,0 +1,338 @@ +/* + * Copyright (C) 2009 Trinity <http://www.trinitycore.org/> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Prince_Keleseth +SD%Complete: 90 +SDComment: Needs Prince Movements, Needs adjustments to blizzlike timers, Needs Shadowbolt castbar, Needs right Ressurect Visual, Needs Some Heroic Spells +SDCategory: Utgarde Keep +EndScriptData */ + +#include "precompiled.h" +#include "def_utgarde_keep.h" + +#define SPELL_SHADOWBOLT 43667 +#define SPELL_SHADOWBOLT_HEROIC 59389 +#define SPELL_FROST_TOMB 48400 +#define SPELL_FROST_TOMB_SUMMON 42714 +#define SPELL_DECREPIFY 42702 +#define SPELL_SCOURGE_RESSURRECTION 42704 +#define CREATURE_FROSTTOMB 23965 +#define CREATURE_SKELETON 23970 + +#define SAY_AGGRO -1574000 +#define SAY_KILL -1574001 +#define SAY_DEATH -1574002 +#define SAY_FROST_TOMB -1574003 +#define SAY_SKELETONS -1574004 + +#define SKELETONSPAWN_Z 42.8668 + +float SkeletonSpawnPoint[5][5]= +{ + {156.2559, 259.2093}, + {156.2559, 259.2093}, + {156.2559, 259.2093}, + {156.2559, 259.2093}, + {156.2559, 259.2093}, +}; + +float AttackLoc[3]={197.636, 194.046, 40.8164}; + +struct TRINITY_DLL_DECL mob_frost_tombAI : public ScriptedAI +{ + mob_frost_tombAI(Creature *c) : ScriptedAI(c) + { + FrostTombGUID = 0; + } + + uint64 FrostTombGUID; + + void SetPrisoner(Unit* uPrisoner) + { + FrostTombGUID = uPrisoner->GetGUID(); + } + + void Reset(){ FrostTombGUID = 0; } + void EnterCombat(Unit* who) {} + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + + void JustDied(Unit *killer) + { + if(FrostTombGUID) + { + Unit* FrostTomb = Unit::GetUnit((*m_creature),FrostTombGUID); + if(FrostTomb) + FrostTomb->RemoveAurasDueToSpell(SPELL_FROST_TOMB); + } + } + + void UpdateAI(const uint32 diff) + { + Unit* temp = Unit::GetUnit((*m_creature),FrostTombGUID); + if((temp && temp->isAlive() && !temp->HasAura(SPELL_FROST_TOMB)) || !temp ) + m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + } +}; + +struct TRINITY_DLL_DECL boss_kelesethAI : public ScriptedAI +{ + boss_kelesethAI(Creature *c) : ScriptedAI(c) + { + pInstance = (c->GetInstanceData()); + Heroic = c->GetMap()->IsHeroic(); + } + + ScriptedInstance* pInstance; + + uint32 FrostTombTimer; + uint32 SummonSkeletonsTimer; + uint32 RespawnSkeletonsTimer; + uint32 ShadowboltTimer; + uint64 SkeletonGUID[5]; + bool Skeletons; + bool Heroic; + bool RespawnSkeletons; + + void Reset() + { + ShadowboltTimer = 0; + Skeletons = false; + + ResetTimer(); + + if(pInstance) + pInstance->SetData(DATA_PRINCEKELESETH_EVENT, NOT_STARTED); + } + + void KilledUnit(Unit *victim) + { + if(victim == m_creature) + return; + + DoScriptText(SAY_KILL, m_creature); + } + + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + + if(pInstance) + pInstance->SetData(DATA_PRINCEKELESETH_EVENT, DONE); + } + + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + DoZoneInCombat(); + + if(pInstance) + pInstance->SetData(DATA_PRINCEKELESETH_EVENT, IN_PROGRESS); + } + + void ResetTimer(uint32 inc = 0) + { + SummonSkeletonsTimer = 5000 + inc; + FrostTombTimer = 28000 + inc; + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if(ShadowboltTimer < diff) + { + Unit* target = SelectUnit(SELECT_TARGET_TOPAGGRO, 0); + if(target && target->isAlive() && target->GetTypeId() == TYPEID_PLAYER) + m_creature->CastSpell(target, Heroic ? SPELL_SHADOWBOLT_HEROIC : SPELL_SHADOWBOLT, true); + ShadowboltTimer = 10000; + }else ShadowboltTimer -= diff; + + if(!Skeletons) + if((SummonSkeletonsTimer < diff)) + { + Creature* Skeleton; + DoScriptText(SAY_SKELETONS, m_creature); + for(uint8 i = 0; i < 5; ++i) + { + Skeleton = m_creature->SummonCreature(CREATURE_SKELETON, SkeletonSpawnPoint[i][0], SkeletonSpawnPoint[i][1] , SKELETONSPAWN_Z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN,20000); + if(Skeleton) + { + Skeleton->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + Skeleton->GetMotionMaster()->MovePoint(0, m_creature->GetPositionX(), m_creature->GetPositionY() , m_creature->GetPositionZ()); + Skeleton->AddThreat(m_creature->getVictim(), 0.0f); + DoZoneInCombat(Skeleton); + } + } + Skeletons = true; + }else SummonSkeletonsTimer -= diff; + + if(FrostTombTimer < diff) + { + Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1); + if(target && target->isAlive() && target->GetTypeId() == TYPEID_PLAYER) + { + //DoCast(target, SPELL_FROST_TOMB_SUMMON, true); + Creature* Chains = m_creature->SummonCreature(CREATURE_FROSTTOMB, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 20000); + if(Chains) + { + CAST_AI(mob_frost_tombAI, Chains->AI())->SetPrisoner(target); + Chains->CastSpell(target, SPELL_FROST_TOMB, true); + + DoScriptText(SAY_FROST_TOMB, m_creature); + } + } + FrostTombTimer = 15000; + }else FrostTombTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +struct TRINITY_DLL_DECL mob_vrykul_skeletonAI : public ScriptedAI +{ + mob_vrykul_skeletonAI(Creature *c) : ScriptedAI(c) + { + pInstance = (c->GetInstanceData()); + } + + ScriptedInstance *pInstance; + uint32 Respawn_Time; + uint64 Target_Guid; + uint32 Decrepify_Timer; + + bool isDead; + + void Reset() + { + Respawn_Time = 12000; + Decrepify_Timer = 10000 + rand()%20000; + isDead = false; + } + + void EnterCombat(Unit *who){} + void DamageTaken(Unit *done_by, uint32 &damage) + { + if(done_by->GetGUID() == m_creature->GetGUID()) + return; + + if(damage >= m_creature->GetHealth()) + { + PretendToDie(); + damage = 0; + } + } + + + void PretendToDie() + { + isDead = true; + m_creature->InterruptNonMeleeSpells(true); + m_creature->RemoveAllAuras(); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->GetMotionMaster()->MovementExpired(false); + m_creature->GetMotionMaster()->MoveIdle(); + m_creature->SetStandState(UNIT_STAND_STATE_DEAD); + }; + + void Resurrect() + { + isDead = false; + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->SetStandState(UNIT_STAND_STATE_STAND); + m_creature->CastSpell(m_creature,SPELL_SCOURGE_RESSURRECTION,true); + + if(m_creature->getVictim()) + { + m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); + m_creature->AI()->AttackStart(m_creature->getVictim()); + } + else + m_creature->GetMotionMaster()->Initialize(); + }; + + void UpdateAI(const uint32 diff) + { + if(pInstance->GetData(DATA_PRINCEKELESETH_EVENT) == IN_PROGRESS) + { + if(isDead) + { + if(Respawn_Time < diff) + { + Resurrect(); + Respawn_Time = 12000; + }else Respawn_Time -= diff; + } + else + { + if(!UpdateVictim()) + return; + + if(Decrepify_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_DECREPIFY); + Decrepify_Timer = 30000; + }else Decrepify_Timer -= diff; + + DoMeleeAttackIfReady(); + } + }else + { + if(m_creature->isAlive()) + m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + } + + } +}; + +CreatureAI* GetAI_mob_frost_tomb(Creature *_Creature) +{ + return new mob_frost_tombAI(_Creature); +} + +CreatureAI* GetAI_boss_keleseth(Creature *_Creature) +{ + return new boss_kelesethAI (_Creature); +} + +CreatureAI* GetAI_mob_vrykul_skeleton(Creature *_Creature) +{ + return new mob_vrykul_skeletonAI (_Creature); +} + +void AddSC_boss_keleseth() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_keleseth"; + newscript->GetAI = &GetAI_boss_keleseth; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_frost_tomb"; + newscript->GetAI = &GetAI_mob_frost_tomb; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_vrykul_skeleton"; + newscript->GetAI = &GetAI_mob_vrykul_skeleton; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/boss_skarvald_dalronn.cpp b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/boss_skarvald_dalronn.cpp new file mode 100644 index 00000000000..8078716d2d8 --- /dev/null +++ b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/boss_skarvald_dalronn.cpp @@ -0,0 +1,390 @@ +/* + * Copyright (C) 2009 Trinity <http://www.trinitycore.org/> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Skarvald_Dalronn +SD%Complete: 95 +SDComment: Needs adjustments to blizzlike timers, Yell Text + Sound to DB +SDCategory: Utgarde Keep +EndScriptData */ + +#include "precompiled.h" +#include "def_utgarde_keep.h" + +#define YELL_SKARVALD_AGGRO -1574010 +#define YELL_DALRONN_AGGRO -1574005 + +#define YELL_SKARVALD_KILL -1574011 +#define YELL_DALRONN_KILL -1574006 + +#define YELL_DALRONN_DAL_DIEDFIRST -1574007 +#define YELL_SKARVALD_DAL_DIEDFIRST -1574014 +#define YELL_SKARVALD_DAL_DIED -1574013 + +#define YELL_SKARVALD_SKA_DIEDFIRST -1574012 +#define YELL_DALRONN_SKA_DIEDFIRST -1574009 +#define YELL_DALRONN_SKA_DIED -1574008 + +//Spells of Skarvald and his Ghost +#define MOB_SKARVALD_THE_CONSTRUCTOR 24200 +#define SPELL_CHARGE 43651 +#define SPELL_STONE_STRIKE 48583 +#define SPELL_SUMMON_SKARVALD_GHOST 48613 +#define MOB_SKARVALD_GHOST 27390 +//Spells of Dalronn and his Ghost +#define MOB_DALRONN_THE_CONTROLLER 24201 +#define SPELL_SHADOW_BOLT 43649 +#define H_SPELL_SHADOW_BOLT 59575 +#define H_SPELL_SUMMON_SKELETONS 52611 +#define SPELL_DEBILITATE 43650 +#define SPELL_SUMMON_DALRONN_GHOST 48612 +#define MOB_DALRONN_GHOST 27389 + +struct TRINITY_DLL_DECL boss_skarvald_the_constructorAI : public ScriptedAI +{ + boss_skarvald_the_constructorAI(Creature *c) : ScriptedAI(c) + { + pInstance = (c->GetInstanceData()); + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + ScriptedInstance* pInstance; + + bool ghost; + bool HeroicMode; + uint32 Charge_Timer; + uint32 StoneStrike_Timer; + uint32 Response_Timer; + uint32 Check_Timer; + bool Dalronn_isDead; + + void Reset() + { + Charge_Timer = 5000; + StoneStrike_Timer = 10000; + Dalronn_isDead = false; + Check_Timer = 5000; + + ghost = (m_creature->GetEntry() == MOB_SKARVALD_GHOST); + if(!ghost) + { + Unit* dalronn = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_DALRONN)); + if(dalronn && dalronn->isDead()) + CAST_CRE(dalronn)->Respawn(); + + if(pInstance) + pInstance->SetData(DATA_SKARVALD_DALRONN_EVENT, NOT_STARTED); + } + } + + void EnterCombat(Unit *who) + { + if(!ghost) + { + DoScriptText(YELL_SKARVALD_AGGRO,m_creature); + + Unit* dalronn = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_DALRONN)); + if(dalronn && dalronn->isAlive() && !dalronn->getVictim()) + dalronn->getThreatManager().addThreat(who,0.0f); + + if(pInstance) + pInstance->SetData(DATA_SKARVALD_DALRONN_EVENT, IN_PROGRESS); + } + } + + void JustDied(Unit* Killer) + { + if(!ghost) + { + Unit* dalronn = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_DALRONN)); + if(dalronn) + { + if(dalronn->isDead()) + { + DoScriptText(YELL_SKARVALD_DAL_DIED,m_creature); + + if(pInstance) + pInstance->SetData(DATA_SKARVALD_DALRONN_EVENT, DONE); + } + else + { + DoScriptText(YELL_SKARVALD_SKA_DIEDFIRST,m_creature); + + m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); + //DoCast(m_creature,SPELL_SUMMON_SKARVALD_GHOST,true); + Creature* temp = m_creature->SummonCreature(MOB_SKARVALD_GHOST,m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ(),0,TEMPSUMMON_CORPSE_DESPAWN,5000); + if(temp) + temp->AI()->AttackStart(Killer); + } + } + } + } + + void KilledUnit(Unit *victim) + { + if(!ghost) + { + DoScriptText(YELL_SKARVALD_KILL,m_creature); + } + } + + void UpdateAI(const uint32 diff) + { + if(ghost) + { + if(pInstance->GetData(DATA_SKARVALD_DALRONN_EVENT) != IN_PROGRESS) + { + m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + } + } + + if(!UpdateVictim()) + return; + + if(!ghost) + { + if(Check_Timer) + if(Check_Timer < diff) + { + Check_Timer = 5000; + Unit* dalronn = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_DALRONN)); + if(dalronn && dalronn->isDead()) + { + Dalronn_isDead = true; + Response_Timer = 2000; + Check_Timer = 0; + } + }else Check_Timer -= diff; + + if(Response_Timer) + if(Dalronn_isDead) + if(Response_Timer < diff) + { + DoScriptText(YELL_SKARVALD_DAL_DIEDFIRST,m_creature); + + Response_Timer = 0; + }else Response_Timer -= diff; + } + + if(Charge_Timer < diff) + { + DoCast(SelectUnit(SELECT_TARGET_RANDOM, 1), SPELL_CHARGE); + Charge_Timer = 5000+rand()%5000; + }else Charge_Timer -= diff; + + if(StoneStrike_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_STONE_STRIKE); + StoneStrike_Timer = 5000+rand()%5000; + }else StoneStrike_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_skarvald_the_constructor(Creature *_Creature) +{ + return new boss_skarvald_the_constructorAI (_Creature); +} + +struct TRINITY_DLL_DECL boss_dalronn_the_controllerAI : public ScriptedAI +{ + boss_dalronn_the_controllerAI(Creature *c) : ScriptedAI(c) + { + pInstance = (c->GetInstanceData()); + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + ScriptedInstance* pInstance; + + bool ghost; + bool HeroicMode; + uint32 ShadowBolt_Timer; + uint32 Debilitate_Timer; + uint32 Summon_Timer; + + uint32 Response_Timer; + uint32 Check_Timer; + uint32 AggroYell_Timer; + bool Skarvald_isDead; + + + void Reset() + { + ShadowBolt_Timer = 1000; + Debilitate_Timer = 5000; + Summon_Timer = 10000; + Check_Timer = 5000; + Skarvald_isDead = false; + AggroYell_Timer = 0; + + ghost = m_creature->GetEntry() == MOB_DALRONN_GHOST; + if(!ghost) + { + Unit* skarvald = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_SKARVALD)); + if(skarvald && skarvald->isDead()) + CAST_CRE(skarvald)->Respawn(); + + if(pInstance) + pInstance->SetData(DATA_SKARVALD_DALRONN_EVENT, NOT_STARTED); + } + } + + void EnterCombat(Unit *who) + { + if(!ghost) + { + Unit* skarvald = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_SKARVALD)); + if(skarvald && skarvald->isAlive() && !skarvald->getVictim()) + skarvald->getThreatManager().addThreat(who,0.0f); + + AggroYell_Timer = 5000; + + if(pInstance) + pInstance->SetData(DATA_SKARVALD_DALRONN_EVENT, IN_PROGRESS); + } + } + + void JustDied(Unit* Killer) + { + if(!ghost) + { + Unit* skarvald = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_SKARVALD)); + if(skarvald) + if(skarvald->isDead()) + { + DoScriptText(YELL_DALRONN_SKA_DIED,m_creature); + + if(pInstance) + pInstance->SetData(DATA_SKARVALD_DALRONN_EVENT, DONE); + } + else + { + DoScriptText(YELL_DALRONN_DAL_DIEDFIRST,m_creature); + + m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); + //DoCast(m_creature,SPELL_SUMMON_DALRONN_GHOST,true); + Creature* temp = m_creature->SummonCreature(MOB_DALRONN_GHOST,m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ(),0,TEMPSUMMON_CORPSE_DESPAWN,5000); + if(temp) + temp->AI()->AttackStart(Killer); + } + } + } + + void KilledUnit(Unit *victim) + { + if(!ghost) + { + DoScriptText(YELL_DALRONN_KILL,m_creature); + } + } + + void UpdateAI(const uint32 diff) + { + if(ghost) + { + if(pInstance->GetData(DATA_SKARVALD_DALRONN_EVENT) != IN_PROGRESS) + { + m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + } + } + + if(!UpdateVictim()) + return; + + if(AggroYell_Timer) + if(AggroYell_Timer < diff) + { + DoScriptText(YELL_DALRONN_AGGRO,m_creature); + + AggroYell_Timer = 0; + }else AggroYell_Timer -= diff; + + if(!ghost) + { + if(Check_Timer) + if(Check_Timer < diff) + { + Check_Timer = 5000; + Unit* skarvald = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_SKARVALD)); + if(skarvald && skarvald->isDead()) + { + Skarvald_isDead = true; + Response_Timer = 2000; + Check_Timer = 0; + } + }else Check_Timer -= diff; + + if(Response_Timer) + if(Skarvald_isDead) + if(Response_Timer < diff) + { + DoScriptText(YELL_DALRONN_SKA_DIEDFIRST,m_creature); + + Response_Timer = 0; + }else Response_Timer -= diff; + } + + if(ShadowBolt_Timer < diff) + { + if (!m_creature->IsNonMeleeSpellCasted(false)) + { + DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0),HeroicMode ? H_SPELL_SHADOW_BOLT : SPELL_SHADOW_BOLT); + ShadowBolt_Timer = 1000; + } + }else ShadowBolt_Timer -= diff; + + if(Debilitate_Timer < diff) + { + if (!m_creature->IsNonMeleeSpellCasted(false)) + { + DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0),SPELL_DEBILITATE); + Debilitate_Timer = 5000+rand()%5000; + } + }else Debilitate_Timer -= diff; + + if(HeroicMode) + if(Summon_Timer < diff) + { + DoCast(m_creature,H_SPELL_SUMMON_SKELETONS); + Summon_Timer = (rand()%10000) + 20000; + }else Summon_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_dalronn_the_controller(Creature *_Creature) +{ + return new boss_dalronn_the_controllerAI (_Creature); +} + +void AddSC_boss_skarvald_dalronn() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_skarvald_the_constructor"; + newscript->GetAI = &GetAI_boss_skarvald_the_constructor; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="boss_dalronn_the_controller"; + newscript->GetAI = &GetAI_boss_dalronn_the_controller; + newscript->RegisterSelf(); +}
\ No newline at end of file diff --git a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/def_utgarde_keep.h b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/def_utgarde_keep.h new file mode 100644 index 00000000000..b630e156564 --- /dev/null +++ b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/def_utgarde_keep.h @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2009 Trinity <http://www.trinitycore.org/> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef DEF_UTGARDE_KEEP_H +#define DEF_UTGARDE_KEEP_H + +#define DATA_PRINCEKELESETH 1 +#define DATA_SKARVALD 3 +#define DATA_DALRONN 4 +#define DATA_INGVAR 6 + +#define DATA_PRINCEKELESETH_EVENT 2 +#define DATA_SKARVALD_DALRONN_EVENT 5 +#define DATA_INGVAR_EVENT 7 + +#define EVENT_FORGE_1 8 +#define EVENT_FORGE_2 9 +#define EVENT_FORGE_3 10 + +#endif diff --git a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/instance_utgarde_keep.cpp b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/instance_utgarde_keep.cpp new file mode 100644 index 00000000000..d483006642d --- /dev/null +++ b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/instance_utgarde_keep.cpp @@ -0,0 +1,292 @@ +/* + * Copyright (C) 2009 Trinity <http://www.trinitycore.org/> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Utgarde_Keep +SD%Complete: 90 +SDComment: Instance Data Scripts and functions to acquire mobs and set encounter status for use in various Utgarde Keep Scripts +SDCategory: Utgarde Keep +EndScriptData */ + +#include "precompiled.h" +#include "def_utgarde_keep.h" + +#define ENCOUNTERS 3 + +#define ENTRY_BELLOW_1 186688 +#define ENTRY_BELLOW_2 186689 +#define ENTRY_BELLOW_3 186690 + +#define ENTRY_FORGEFIRE_1 186692 +#define ENTRY_FORGEFIRE_2 186693 +#define ENTRY_FORGEFIRE_3 186691 + +#define ENTRY_GLOWING_ANVIL_1 186609 +#define ENTRY_GLOWING_ANVIL_2 186610 +#define ENTRY_GLOWING_ANVIL_3 186611 + +/* Utgarde Keep encounters: +0 - Prince Keleseth +1 - Skarvald Dalronn +2 - Ingvar the Plunderer +*/ + +struct TRINITY_DLL_DECL instance_utgarde_keep : public ScriptedInstance +{ + instance_utgarde_keep(Map *Map) : ScriptedInstance(Map) {Initialize();}; + + uint64 Keleseth; + uint64 Skarvald; + uint64 Dalronn; + uint64 Ingvar; + + uint64 forge_bellow[3]; + uint64 forge_fire[3]; + uint64 forge_anvil[3]; + + uint32 Encounters[ENCOUNTERS]; + std::string str_data; + + void Initialize() + { + Keleseth = 0; + Skarvald = 0; + Dalronn =0; + Ingvar =0; + + for(uint8 i= 0; i < 3; i++) + { + forge_bellow[i] = 0; + forge_fire[i] = 0; + forge_anvil[i] = 0; + } + + for(uint8 i = 0; i < ENCOUNTERS; ++i) + Encounters[i] = NOT_STARTED; + } + + bool IsEncounterInProgress() const + { + for(uint8 i = 0; i < ENCOUNTERS; ++i) + if(Encounters[i] == IN_PROGRESS) return true; + + return false; + } + + Player* GetPlayerInMap() + { + Map::PlayerList const& players = instance->GetPlayers(); + + if (!players.isEmpty()) + { + for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + { + if (Player* plr = itr->getSource()) + return plr; + } + } + + debug_log("TSCR: Instance Utgarde Keep: GetPlayerInMap, but PlayerList is empty!"); + return NULL; + } + + void OnCreatureCreate(Creature *creature, uint32 creature_entry) + { + switch(creature_entry) + { + case 23953: Keleseth = creature->GetGUID(); break; + case 24201: Dalronn = creature->GetGUID(); break; + case 24200: Skarvald = creature->GetGUID(); break; + case 23954: Ingvar = creature->GetGUID(); break; + } + } + + void OnObjectCreate(GameObject* go) + { + switch(go->GetEntry()) + { + //door and object id + case ENTRY_BELLOW_1: forge_bellow[0] = go->GetGUID(); break; + case ENTRY_BELLOW_2: forge_bellow[1] = go->GetGUID(); break; + case ENTRY_BELLOW_3: forge_bellow[2] = go->GetGUID(); break; + case ENTRY_FORGEFIRE_1: forge_fire[0] = go->GetGUID(); break; + case ENTRY_FORGEFIRE_2: forge_fire[1] = go->GetGUID(); break; + case ENTRY_FORGEFIRE_3: forge_fire[2] = go->GetGUID(); break; + case ENTRY_GLOWING_ANVIL_1: forge_anvil[0] = go->GetGUID(); break; + case ENTRY_GLOWING_ANVIL_2: forge_anvil[1] = go->GetGUID(); break; + case ENTRY_GLOWING_ANVIL_3: forge_anvil[2] = go->GetGUID(); break; + } + } + + uint64 GetData64(uint32 identifier) + { + switch(identifier) + { + case DATA_PRINCEKELESETH: return Keleseth; + case DATA_DALRONN: return Dalronn; + case DATA_SKARVALD: return Skarvald; + case DATA_INGVAR: return Ingvar; + } + + return 0; + } + + void SetData(uint32 type, uint32 data) + { + switch(type) + { + case DATA_PRINCEKELESETH_EVENT: + if(data == DONE) + { + //HandleGameObject(doorname, 0); + } + Encounters[0] = data; + break; + case DATA_SKARVALD_DALRONN_EVENT: + if(data == DONE) + { + //HandleGameObject(doorname, 0); + } + Encounters[1] = data; + break; + case DATA_INGVAR_EVENT: + if(data == DONE) + { + //HandleGameObject(doorname, 0); + } + Encounters[2] = data; + break; + case EVENT_FORGE_1: + if(data == NOT_STARTED) + { + HandleGameObject(forge_bellow[0],false); + HandleGameObject(forge_fire[0],false); + HandleGameObject(forge_anvil[0],false); + }else + { + HandleGameObject(forge_bellow[0],true); + HandleGameObject(forge_fire[0],true); + HandleGameObject(forge_anvil[0],true); + } + break; + case EVENT_FORGE_2: + if(data == NOT_STARTED) + { + HandleGameObject(forge_bellow[1],false); + HandleGameObject(forge_fire[1],false); + HandleGameObject(forge_anvil[1],false); + }else + { + HandleGameObject(forge_bellow[1],true); + HandleGameObject(forge_fire[1],true); + HandleGameObject(forge_anvil[1],true); + } + break; + case EVENT_FORGE_3: + if(data == NOT_STARTED) + { + HandleGameObject(forge_bellow[2],false); + HandleGameObject(forge_fire[2],false); + HandleGameObject(forge_anvil[2],false); + }else + { + HandleGameObject(forge_bellow[2],true); + HandleGameObject(forge_fire[2],true); + HandleGameObject(forge_anvil[2],true); + } + break; + } + + + if (data == DONE) + { + SaveToDB(); + } + } + + uint32 GetData(uint32 type) + { + switch(type) + { + case DATA_PRINCEKELESETH_EVENT: return Encounters[0]; + case DATA_SKARVALD_DALRONN_EVENT: return Encounters[1]; + case DATA_INGVAR_EVENT: return Encounters[2]; + } + + return 0; + } + + std::string GetSaveData() + { + OUT_SAVE_INST_DATA; + + std::ostringstream saveStream; + saveStream << "U K " << Encounters[0] << " " << Encounters[1] << " " + << Encounters[2]; + + str_data = saveStream.str(); + + OUT_SAVE_INST_DATA_COMPLETE; + return str_data.c_str(); + } + + void Load(const char* in) + { + if (!in) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(in); + + char dataHead1, dataHead2; + uint16 data0,data1,data2; + + std::istringstream loadStream(in); + loadStream >> dataHead1 >> dataHead2 >> data0 >> data1 >> data2; + + if( dataHead1 == 'U' && dataHead2 == 'K') + { + Encounters[0] = data0; + Encounters[1] = data1; + Encounters[2] = data2; + + for(uint8 i = 0; i < ENCOUNTERS; ++i) + if (Encounters[i] == IN_PROGRESS) + Encounters[i] = NOT_STARTED; + + }else OUT_LOAD_INST_DATA_FAIL; + + OUT_LOAD_INST_DATA_COMPLETE; + } +}; + +InstanceData* GetInstanceData_instance_utgarde_keep(Map* map) +{ + return new instance_utgarde_keep(map); +} + +void AddSC_instance_utgarde_keep() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_utgarde_keep"; + newscript->GetInstanceData = &GetInstanceData_instance_utgarde_keep; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/utgarde_keep.cpp b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/utgarde_keep.cpp new file mode 100644 index 00000000000..517d1270f73 --- /dev/null +++ b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/utgarde_keep.cpp @@ -0,0 +1,160 @@ +/* + * Copyright (C) 2009 Trinity <http://www.trinitycore.org/> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "precompiled.h" +#include "def_utgarde_keep.h" + +uint32 entry_search[3] = +{ + 186609, + 186610, + 186611 +}; + +struct TRINITY_DLL_DECL npc_dragonflayer_forge_masterAI : public ScriptedAI +{ + npc_dragonflayer_forge_masterAI(Creature *c) : ScriptedAI(c) + { + pInstance = (c->GetInstanceData()); + fm_Type = 0; + } + + ScriptedInstance* pInstance; + uint8 fm_Type; + + void Reset() + { + if(fm_Type == 0) fm_Type = GetForgeMasterType(); + CheckForge(); + } + + void CheckForge() + { + if(pInstance) + { + switch(fm_Type) + { + case 1: + pInstance->SetData(EVENT_FORGE_1,m_creature->isAlive() ? NOT_STARTED : DONE); + break; + case 2: + pInstance->SetData(EVENT_FORGE_2,m_creature->isAlive() ? NOT_STARTED : DONE); + break; + case 3: + pInstance->SetData(EVENT_FORGE_3,m_creature->isAlive() ? NOT_STARTED : DONE); + break; + } + } + } + + void JustDied(Unit *killer) + { + if(fm_Type == 0) fm_Type = GetForgeMasterType(); + if(pInstance) + { + switch(fm_Type) + { + case 1: + pInstance->SetData(EVENT_FORGE_1,DONE); + break; + case 2: + pInstance->SetData(EVENT_FORGE_2,DONE); + break; + case 3: + pInstance->SetData(EVENT_FORGE_3,DONE); + break; + } + } + } + + void EnterCombat(Unit *who) + { + if(fm_Type == 0) fm_Type = GetForgeMasterType(); + if(pInstance) + { + switch(fm_Type) + { + case 1: + pInstance->SetData(EVENT_FORGE_1,IN_PROGRESS); + break; + case 2: + pInstance->SetData(EVENT_FORGE_2,IN_PROGRESS); + break; + case 3: + pInstance->SetData(EVENT_FORGE_3,IN_PROGRESS); + break; + } + } + m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE ,EMOTE_ONESHOT_NONE); + } + + uint8 GetForgeMasterType() + { + float diff = 30.0f; + int near_f = 0; + + for(int i = 0; i < 3 ; i++) + { + GameObject* temp; + temp = m_creature->FindNearestGameObject(entry_search[i],30); + if(temp) + { + if(diff > m_creature->GetDistance2d(temp)) + { + near_f = i + 1; + diff = m_creature->GetDistance2d(temp); + + } + } + } + + switch (near_f) + { + case 1: return 1; + case 2: return 2; + case 3: return 3; + default: return 0; + } + } + + void UpdateAI(const uint32 diff) + { + if(fm_Type == 0) + fm_Type = GetForgeMasterType(); + + if(!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_npc_dragonflayer_forge_master(Creature *_Creature) +{ + return new npc_dragonflayer_forge_masterAI(_Creature); +} + +void AddSC_utgarde_keep() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="npc_dragonflayer_forge_master"; + newscript->GetAI = &GetAI_npc_dragonflayer_forge_master; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/boss_palehoof.cpp b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/boss_palehoof.cpp new file mode 100644 index 00000000000..84ab003a430 --- /dev/null +++ b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/boss_palehoof.cpp @@ -0,0 +1,78 @@ +/* Script Data Start +SDName: Boss palehoof +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = 'boss_palehoof' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_ARCING_SMASH 48260 +#define SPELL_IMPALE 48261 +#define SPELL_WITHERING_ROAR 48256 + +//Yell +#define SAY_AGGRO -1575000 +#define SAY_SLAY_1 -1575001 +#define SAY_SLAY_2 -1575002 +#define SAY_DEATH -1575003 + +struct TRINITY_DLL_DECL boss_palehoofAI : public ScriptedAI +{ + boss_palehoofAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if(!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + + switch(rand()%2) + { + case 0: + DoScriptText(SAY_SLAY_1, m_creature); + break; + case 1: + DoScriptText(SAY_SLAY_2, m_creature); + break; + } + } +}; + +CreatureAI* GetAI_boss_palehoof(Creature *_Creature) +{ + return new boss_palehoofAI (_Creature); +} + +void AddSC_boss_palehoof() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_palehoof"; + newscript->GetAI = &GetAI_boss_palehoof; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/boss_skadi.cpp b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/boss_skadi.cpp new file mode 100644 index 00000000000..8d2af03e9b7 --- /dev/null +++ b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/boss_skadi.cpp @@ -0,0 +1,89 @@ +/* Script Data Start +SDName: Boss skadi +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = 'boss_skadi' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Phase 0 "gauntlet even" Skadi on a flying mount, waves of adds charging to the group periodicaly carrying harpoons +//Phase 1 Kill the Skadi drake mount with harppons launcher +//Phase 2 Kill the Skadi + +//Skadi Spells +#define SPELL_CRUSH 50234 +#define SPELL_POISONED_SPEAR 50225 +#define SPELL_WHIRLWIND 50228 //random target, but not the tank approx. every 20s + +//Yell +#define SAY_AGGRO -1575004 +#define SAY_KILL_1 -1575005 +#define SAY_KILL_2 -1575006 +#define SAY_KILL_3 -1575007 +#define SAY_DEATH -1575008 +#define SAY_DRAKE_DEATH -1575009 +#define SAY_DRAKE_HIT_1 -1575010 +#define SAY_DRAKE_HIT_2 -1575011 +#define SAY_DRAKE_BREATH_1 -1575012 +#define SAY_DRAKE_BREATH_2 -1575013 +#define SAY_DRAKE_BREATH_3 -1575014 + +struct TRINITY_DLL_DECL boss_skadiAI : public ScriptedAI +{ + boss_skadiAI(Creature *c) : ScriptedAI(c) {} + + uint32 phase; + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if(!UpdateVictim()) + return; + + phase = 0; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + void KilledUnit(Unit *victim) + { + if(victim == m_creature) + return; + switch(rand()%3) + { + case 0: DoScriptText(SAY_KILL_1, m_creature);break; + case 1: DoScriptText(SAY_KILL_2, m_creature);break; + case 2: DoScriptText(SAY_KILL_3, m_creature);break; + } + } +}; + +CreatureAI* GetAI_boss_skadi(Creature *_Creature) +{ + return new boss_skadiAI (_Creature); +} + +void AddSC_boss_skadi() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_skadi"; + newscript->GetAI = &GetAI_boss_skadi; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/boss_svala.cpp b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/boss_svala.cpp new file mode 100644 index 00000000000..6dd0d6c5767 --- /dev/null +++ b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/boss_svala.cpp @@ -0,0 +1,83 @@ +/* Script Data Start +SDName: Boss svala +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = 'boss_svala' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_CALL_FLAMES 48258 +#define SPELL_RITUAL_OF_THE_SWORD 48276 //Effect #1 Teleport, Effect #2 Dummy +#define SPELL_SINSTER_STRIKE 15667 + +//Yells +#define SAY_DIALOG_WITH_ARTHAS_1 -1575015 +#define SAY_DIALOG_WITH_ARTHAS_2 -1575016 +#define SAY_DIALOG_WITH_ARTHAS_3 -1575017 +#define SAY_AGGRO -1575018 +#define SAY_SLAY_1 -1575019 +#define SAY_SLAY_2 -1575020 +#define SAY_SLAY_3 -1575021 +#define SAY_DEATH -1575022 +#define SAY_SACRIFICE_PLAYER_1 -1575023 +#define SAY_SACRIFICE_PLAYER_2 -1575024 +#define SAY_SACRIFICE_PLAYER_3 -1575025 +#define SAY_SACRIFICE_PLAYER_4 -1575026 +#define SAY_SACRIFICE_PLAYER_5 -1575027 + +struct TRINITY_DLL_DECL boss_svalaAI : public ScriptedAI +{ + boss_svalaAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if(!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + void KilledUnit(Unit *victim) + { + if(victim == m_creature) + return; + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature);break; + case 1: DoScriptText(SAY_SLAY_2, m_creature);break; + case 2: DoScriptText(SAY_SLAY_3, m_creature);break; + } + } +}; + +CreatureAI* GetAI_boss_svala(Creature *_Creature) +{ + return new boss_svalaAI (_Creature); +} + +void AddSC_boss_svala() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_svala"; + newscript->GetAI = &GetAI_boss_svala; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/boss_ymiron.cpp b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/boss_ymiron.cpp new file mode 100644 index 00000000000..1793c972349 --- /dev/null +++ b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/boss_ymiron.cpp @@ -0,0 +1,85 @@ +/* Script Data Start +SDName: Boss ymiron +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = 'boss_ymiron' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_BANE 48294 +#define SPELL_DARK_SLASH 48292 +#define SPELL_FETID_ROT 48291 +#define SPELL_SCREAMS_OF_THE_DEAD 51750 +#define SPELL_SPIRIT_BURST 48529 +#define SPELL_SPIRIT_STRIKE 48423 +//every 20% stuns the party and runs to a boat + +//Yell +#define SAY_AGGRO -1575028 +#define SAY_SLAY_1 -1575029 +#define SAY_SLAY_2 -1575030 +#define SAY_SLAY_3 -1575031 +#define SAY_SLAY_4 -1575032 +#define SAY_DEATH -1575033 +#define SAY_SUMMON_BJORN -1575034 +#define SAY_SUMMON_HALDOR -1575035 +#define SAY_SUMMON_RANULF -1575036 +#define SAY_SUMMON_TORGYN -1575037 + +struct TRINITY_DLL_DECL boss_ymironAI : public ScriptedAI +{ + boss_ymironAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if(!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + void KilledUnit(Unit *victim) + { + if(victim == m_creature) + return; + switch(rand()%4) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature);break; + case 1: DoScriptText(SAY_SLAY_2, m_creature);break; + case 2: DoScriptText(SAY_SLAY_3, m_creature);break; + case 3: DoScriptText(SAY_SLAY_4, m_creature);break; + } + } +}; + +CreatureAI* GetAI_boss_ymiron(Creature *_Creature) +{ + return new boss_ymironAI (_Creature); +} + +void AddSC_boss_ymiron() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_ymiron"; + newscript->GetAI = &GetAI_boss_ymiron; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/def_pinnacle.h b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/def_pinnacle.h new file mode 100644 index 00000000000..82e2173fab5 --- /dev/null +++ b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/def_pinnacle.h @@ -0,0 +1,4 @@ +#ifndef DEF_PINNACLE_H +#define DEF_PINNACLE_H + +#endif diff --git a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/instance_pinnacle.cpp b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/instance_pinnacle.cpp new file mode 100644 index 00000000000..bbf7ded89a2 --- /dev/null +++ b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/instance_pinnacle.cpp @@ -0,0 +1,21 @@ +#include "precompiled.h" +#include "def_pinnacle.h" + +struct TRINITY_DLL_DECL instance_pinnacle : public ScriptedInstance +{ + instance_pinnacle(Map *Map) : ScriptedInstance(Map) {Initialize();}; +}; + +InstanceData* GetInstanceData_instance_pinnacle(Map* map) +{ + return new instance_pinnacle(map); +} + +void AddSC_instance_pinnacle() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_pinnacle"; + newscript->GetInstanceData = &GetInstanceData_instance_pinnacle; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/zone/vault_of_archavon/boss_archavon.cpp b/src/bindings/scripts/scripts/zone/vault_of_archavon/boss_archavon.cpp new file mode 100644 index 00000000000..c977555747d --- /dev/null +++ b/src/bindings/scripts/scripts/zone/vault_of_archavon/boss_archavon.cpp @@ -0,0 +1,199 @@ +/*** SQL START *** +UPDATE `creature_template` SET `ScriptName`='boss_archavon' WHERE `entry`='31125'; +UPDATE `creature_template` SET `ScriptName`='mob_archavon_warder' WHERE `entry`='32353'; +*** SQL END ***/ +#include "precompiled.h" + +//These are patchwerk's yell +#define SAY_AGGRO1 -1533017 +#define SAY_AGGRO2 -1533018 +#define SAY_SLAY -1533019 +#define SAY_DEATH -1533020 + +#define EMOTE_BERSERK -1533021 +#define EMOTE_ENRAGE -1533022 + +//Spells Archavon +#define SPELL_ROCK_SHARDS 58678 +#define SPELL_CRUSHING_LEAP HEROIC(58960,60894)//Instant (10-80yr range) -- Leaps at an enemy, inflicting 8000 Physical damage, knocking all nearby enemies away, and creating a cloud of choking debris. +#define SPELL_STOMP HEROIC(58663,60880) +#define SPELL_IMPALE HEROIC(58666,60882) //Lifts an enemy off the ground with a spiked fist, inflicting 47125 to 52875 Physical damage and 9425 to 10575 additional damage each second for 8 sec. +#define SPELL_BERSERK 47008 +//Spells Archavon Warders +#define SPELL_ROCK_SHOWER HEROIC(60919,60923) +#define SPELL_SHIELD_CRUSH HEROIC(60897,60899) +#define SPELL_WHIRL HEROIC(60902,60916) + +//4 Warders spawned +#define ARCHAVON_WARDER 32353 //npc 32353 + +//Yell +#define SAY_LEAP "Archavon the Stone Watcher lunges for $N!" //$N should be the target + +#define EVENT_ROCK_SHARDS 1 //15s cd +#define EVENT_CHOKING_CLOUD 2 //30s cd +#define EVENT_STOMP 3 //45s cd +#define EVENT_IMPALE 4 +#define EVENT_BERSERK 5 //300s cd + +//mob +#define EVENT_ROCK_SHOWER 5 //set = 20s cd,unkown cd +#define EVENT_SHIELD_CRUSH 6 //set = 30s cd +#define EVENT_WHIRL 8 //set= 10s cd + +struct TRINITY_DLL_DECL boss_archavonAI : public ScriptedAI +{ + boss_archavonAI(Creature *c) : ScriptedAI(c) {} + + EventMap events; + + void Reset() + { + events.Reset(); + } + + void KilledUnit(Unit* Victim) + { + if(!(rand()%5)) + DoScriptText(SAY_SLAY, me); + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEATH, me); + } + + void EnterCombat(Unit *who) + { + DoScriptText(rand()%2 ? SAY_AGGRO1 : SAY_AGGRO2, me); + DoZoneInCombat(); + events.ScheduleEvent(EVENT_ROCK_SHARDS, 15000); + events.ScheduleEvent(EVENT_CHOKING_CLOUD, 30000); + events.ScheduleEvent(EVENT_STOMP, 45000); + events.ScheduleEvent(EVENT_BERSERK, 300000); + } + + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if(!UpdateVictim()) + return; + + events.Update(diff); + + if(me->hasUnitState(UNIT_STAT_CASTING)) + return; + + while(uint32 eventId = events.ExecuteEvent()) + { + switch(eventId) + { + case EVENT_ROCK_SHARDS: + if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + DoCast(target, SPELL_ROCK_SHARDS); + events.ScheduleEvent(EVENT_ROCK_SHARDS, 15000); + return; + case EVENT_CHOKING_CLOUD: + if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + DoCast(target, SPELL_CRUSHING_LEAP, true); //10y~80y, ignore range + events.ScheduleEvent(EVENT_CHOKING_CLOUD, 30000); + return; + case EVENT_STOMP: + DoCast(me->getVictim(), SPELL_STOMP); + events.ScheduleEvent(EVENT_IMPALE, 3000); + events.ScheduleEvent(EVENT_STOMP, 45000); + return; + case EVENT_IMPALE: + DoCast(me->getVictim(), SPELL_IMPALE); + return; + case EVENT_BERSERK: + DoCast(m_creature, SPELL_BERSERK); + DoScriptText(EMOTE_BERSERK, m_creature); + return; + } + } + + DoMeleeAttackIfReady(); + } +}; + +/*###### +## Mob Archavon Warder +######*/ +struct TRINITY_DLL_DECL mob_warderAI : public ScriptedAI //npc 32353 +{ + mob_warderAI(Creature *c) : ScriptedAI(c) {} + + EventMap events; + + void Reset() + { + events.Reset(); + } + + void EnterCombat(Unit *who) + { + DoZoneInCombat(); + events.ScheduleEvent(EVENT_ROCK_SHOWER, 2000); + events.ScheduleEvent(EVENT_SHIELD_CRUSH, 20000); + events.ScheduleEvent(EVENT_WHIRL, 7500); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if(!UpdateVictim()) + return; + + events.Update(diff); + + while(uint32 eventId = events.ExecuteEvent()) + { + switch(eventId) + { + case EVENT_ROCK_SHOWER: + { + if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + DoCast(target, SPELL_ROCK_SHOWER); + events.ScheduleEvent(EVENT_ROCK_SHARDS, 6000); + return; + } + case EVENT_SHIELD_CRUSH: + DoCast(m_creature->getVictim(), SPELL_SHIELD_CRUSH); + events.ScheduleEvent(EVENT_SHIELD_CRUSH, 20000); + return; + case EVENT_WHIRL: + DoCast(m_creature->getVictim(), SPELL_WHIRL); + events.ScheduleEvent(EVENT_WHIRL, 8000); + return; + } + } + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_warder(Creature *_Creature) +{ + return new mob_warderAI (_Creature); +} + +CreatureAI* GetAI_boss_archavon(Creature *_Creature) +{ + return new boss_archavonAI (_Creature); +} + +void AddSC_boss_archavon() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_archavon"; + newscript->GetAI = &GetAI_boss_archavon; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_archavon_warder"; + newscript->GetAI = &GetAI_mob_warder; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/zone/vault_of_archavon/def_vault_of_archavon.h b/src/bindings/scripts/scripts/zone/vault_of_archavon/def_vault_of_archavon.h new file mode 100644 index 00000000000..f46ba447945 --- /dev/null +++ b/src/bindings/scripts/scripts/zone/vault_of_archavon/def_vault_of_archavon.h @@ -0,0 +1,4 @@ +#ifndef DEF_ARCHAVON_H +#define DEF_ARCHAVON_H + +#endif diff --git a/src/bindings/scripts/scripts/zone/vault_of_archavon/instance_vault_of_archavon.cpp b/src/bindings/scripts/scripts/zone/vault_of_archavon/instance_vault_of_archavon.cpp new file mode 100644 index 00000000000..dc725b2be66 --- /dev/null +++ b/src/bindings/scripts/scripts/zone/vault_of_archavon/instance_vault_of_archavon.cpp @@ -0,0 +1,21 @@ +#include "precompiled.h" +#include "def_vault_of_archavon.h" + +struct TRINITY_DLL_DECL instance_archavon : public ScriptedInstance +{ + instance_archavon(Map *Map) : ScriptedInstance(Map) {Initialize();}; +}; + +InstanceData* GetInstanceData_instance_archavon(Map* map) +{ + return new instance_archavon(map); +} + +void AddSC_instance_archavon() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_archavon"; + newscript->GetInstanceData = &GetInstanceData_instance_archavon; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/zone/violet_hold/boss_cyanigosa.cpp b/src/bindings/scripts/scripts/zone/violet_hold/boss_cyanigosa.cpp new file mode 100644 index 00000000000..d2a0bff840d --- /dev/null +++ b/src/bindings/scripts/scripts/zone/violet_hold/boss_cyanigosa.cpp @@ -0,0 +1,82 @@ +/* Script Data Start +SDName: Boss cyanigosa +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = '' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_ARCANE_VACUM 58694 +#define SPELL_BLIZZARD 58693 +#define SPELL_MANA_DESTRUCTION 59374 +#define SPELL_TAIL_SWEEP 58690 +#define SPELL_UNCONTROLLABLE_ENERGY 58688 + +//Yells +#define SAY_AGGRO -1608000 +#define SAY_SLAY_1 -1608001 +#define SAY_SLAY_2 -1608002 +#define SAY_SLAY_3 -1608003 +#define SAY_DEATH -1608004 +#define SAY_SPAWN -1608005 +#define SAY_DISRUPTION -1608006 +#define SAY_BREATH_ATTACK -1608007 +#define SAY_SPECIAL_ATTACK_1 -1608008 +#define SAY_SPECIAL_ATTACK_2 -1608009 + +struct TRINITY_DLL_DECL boss_cyanigosaAI : public ScriptedAI +{ + boss_cyanigosaAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if(!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + void KilledUnit(Unit *victim) + { + if(victim == m_creature) + return; + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature);break; + case 1: DoScriptText(SAY_SLAY_2, m_creature);break; + case 2: DoScriptText(SAY_SLAY_3, m_creature);break; + } + } +}; + +CreatureAI* GetAI_boss_cyanigosa(Creature *_Creature) +{ + return new boss_cyanigosaAI (_Creature); +} + +void AddSC_boss_cyanigosa() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_cyanigosa"; + newscript->GetAI = &GetAI_boss_cyanigosa; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/zone/violet_hold/boss_erekem.cpp b/src/bindings/scripts/scripts/zone/violet_hold/boss_erekem.cpp new file mode 100644 index 00000000000..cc3129143cb --- /dev/null +++ b/src/bindings/scripts/scripts/zone/violet_hold/boss_erekem.cpp @@ -0,0 +1,82 @@ +/* Script Data Start +SDName: Boss erekem +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = '' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_BLOODLUST 54516 +#define SPELL_BREAK_BONDS 59463 +#define SPELL_CHAIN_HEAL 54481 +#define SPELL_EARTH_SHIELD 54479 +#define SPELL_EARTH_SHOCK 54511 +#define SPELL_LIGHTNING_BOLT 53044 +#define SPELL_STORMSTRIKE 51876 + +//Yells +#define SAY_AGGRO -1608010 +#define SAY_SLAY_1 -1608011 +#define SAY_SLAY_2 -1608012 +#define SAY_SLAY_3 -1608013 +#define SAY_DEATH -1608014 +#define SAY_SPAWN -1608015 +#define SAY_ADD_KILED -1608016 +#define SAY_BOTH_ADDS_KILED -1608017 + +struct TRINITY_DLL_DECL boss_erekemAI : public ScriptedAI +{ + boss_erekemAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if(!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + void KilledUnit(Unit *victim) + { + if(victim == m_creature) + return; + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature);break; + case 1: DoScriptText(SAY_SLAY_2, m_creature);break; + case 2: DoScriptText(SAY_SLAY_3, m_creature);break; + } + } +}; + +CreatureAI* GetAI_boss_erekem(Creature *_Creature) +{ + return new boss_erekemAI (_Creature); +} + +void AddSC_boss_erekem() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_erekem"; + newscript->GetAI = &GetAI_boss_erekem; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/zone/violet_hold/boss_ichoron.cpp b/src/bindings/scripts/scripts/zone/violet_hold/boss_ichoron.cpp new file mode 100644 index 00000000000..745fd7ea8f4 --- /dev/null +++ b/src/bindings/scripts/scripts/zone/violet_hold/boss_ichoron.cpp @@ -0,0 +1,81 @@ +/* Script Data Start +SDName: Boss ichoron +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = '' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_DRAINED 59820 +#define SPELL_FRENZY 54312 +#define SPELL_PROTECTIVE_BUBBLE 54306 +#define SPELL_WATER_BLAST 54237 +#define SPELL_WATER_BOLT_VOLLEY 54241 + +//Yells +#define SAY_AGGRO -1608018 +#define SAY_SLAY_1 -1608019 +#define SAY_SLAY_2 -1608020 +#define SAY_SLAY_3 -1608021 +#define SAY_DEATH -1608022 +#define SAY_SPAWN -1608023 +#define SAY_ENRAGE -1608024 +#define SAY_SHATTER -1608025 +#define SAY_BUBBLE -1608026 + +struct TRINITY_DLL_DECL boss_ichoronAI : public ScriptedAI +{ + boss_ichoronAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if(!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + void KilledUnit(Unit *victim) + { + if(victim == m_creature) + return; + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature);break; + case 1: DoScriptText(SAY_SLAY_2, m_creature);break; + case 2: DoScriptText(SAY_SLAY_3, m_creature);break; + } + } +}; + +CreatureAI* GetAI_boss_ichoron(Creature *_Creature) +{ + return new boss_ichoronAI (_Creature); +} + +void AddSC_boss_ichoron() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_ichoron"; + newscript->GetAI = &GetAI_boss_ichoron; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/zone/violet_hold/boss_lavanthor.cpp b/src/bindings/scripts/scripts/zone/violet_hold/boss_lavanthor.cpp new file mode 100644 index 00000000000..ac33b86916f --- /dev/null +++ b/src/bindings/scripts/scripts/zone/violet_hold/boss_lavanthor.cpp @@ -0,0 +1,52 @@ +/* Script Data Start +SDName: Boss lavanthor +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = '' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_CAUTERIZING_FLAMES 59466 +#define SPELL_FIREBOLT 54235 +#define SPELL_FLAME_BREATH 54282 +#define SPELL_LAVA_BURN 54249 + +struct TRINITY_DLL_DECL boss_lavanthorAI : public ScriptedAI +{ + boss_lavanthorAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) {} + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if(!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) {} +}; + +CreatureAI* GetAI_boss_lavanthor(Creature *_Creature) +{ + return new boss_lavanthorAI (_Creature); +} + +void AddSC_boss_lavanthor() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_lavanthor"; + newscript->GetAI = &GetAI_boss_lavanthor; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/zone/violet_hold/boss_moragg.cpp b/src/bindings/scripts/scripts/zone/violet_hold/boss_moragg.cpp new file mode 100644 index 00000000000..ddf9cce882e --- /dev/null +++ b/src/bindings/scripts/scripts/zone/violet_hold/boss_moragg.cpp @@ -0,0 +1,50 @@ +/* Script Data Start +SDName: Boss moragg +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = '' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_CORROSICE_SALIVA 54527 +#define SPELL_OPTIC_LINK 54396 + +struct TRINITY_DLL_DECL boss_moraggAI : public ScriptedAI +{ + boss_moraggAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) {} + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if(!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) {} +}; + +CreatureAI* GetAI_boss_moragg(Creature *_Creature) +{ + return new boss_moraggAI (_Creature); +} + +void AddSC_boss_moragg() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_moragg"; + newscript->GetAI = &GetAI_boss_moragg; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/zone/violet_hold/boss_xevozz.cpp b/src/bindings/scripts/scripts/zone/violet_hold/boss_xevozz.cpp new file mode 100644 index 00000000000..840ac4bf723 --- /dev/null +++ b/src/bindings/scripts/scripts/zone/violet_hold/boss_xevozz.cpp @@ -0,0 +1,82 @@ +/* Script Data Start +SDName: Boss xevozz +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = '' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_ARCANE_BARRAGE_VOLLEY 54202 +#define SPELL_ARCANE_BUFFET 54226 +#define SPELL_SUMMON_ETHEREAL_SPHERE_1 54102 +#define SPELL_SUMMON_ETHEREAL_SPHERE_2 54137 +#define SPELL_SUMMON_ETHEREAL_SPHERE_3 54138 + +//Yells +#define SAY_AGGRO -1608027 +#define SAY_SLAY_1 -1608028 +#define SAY_SLAY_2 -1608029 +#define SAY_SLAY_3 -1608030 +#define SAY_DEATH -1608031 +#define SAY_SPAWN -1608032 +#define SAY_CHARGED -1608033 +#define SAY_REPEAT_SUMMON_1 -1608034 +#define SAY_REPEAT_SUMMON_2 -1608035 +#define SAY_SUMMON_ENERGY -1608036 + +struct TRINITY_DLL_DECL boss_xevozzAI : public ScriptedAI +{ + boss_xevozzAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if(!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + void KilledUnit(Unit *victim) + { + if(victim == m_creature) + return; + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature);break; + case 1: DoScriptText(SAY_SLAY_2, m_creature);break; + case 2: DoScriptText(SAY_SLAY_3, m_creature);break; + } + } +}; + +CreatureAI* GetAI_boss_xevozz(Creature *_Creature) +{ + return new boss_xevozzAI (_Creature); +} + +void AddSC_boss_xevozz() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_xevozz"; + newscript->GetAI = &GetAI_boss_xevozz; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/zone/violet_hold/boss_zuramat.cpp b/src/bindings/scripts/scripts/zone/violet_hold/boss_zuramat.cpp new file mode 100644 index 00000000000..e02cb9adf7a --- /dev/null +++ b/src/bindings/scripts/scripts/zone/violet_hold/boss_zuramat.cpp @@ -0,0 +1,82 @@ +/* Script Data Start +SDName: Boss zuramat +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = '' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_SHROUD_OF_DARKNESS 54524 +#define SPELL_SUMMON_VOID_SENTRY 54524 +#define SPELL_VOID_SHIFT 54524 + +#define NPC_VOID_SENTRY 29364 + +//Yells +#define SAY_AGGRO -1608037 +#define SAY_SLAY_1 -1608038 +#define SAY_SLAY_2 -1608039 +#define SAY_SLAY_3 -1608040 +#define SAY_DEATH -1608041 +#define SAY_SPAWN -1608042 +#define SAY_SHIELD -1608043 +#define SAY_WHISPER -1608044 + +struct TRINITY_DLL_DECL boss_zuramatAI : public ScriptedAI +{ + boss_zuramatAI(Creature *c) : ScriptedAI(c) {} + + uint32 void_shift; + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if(!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + void KilledUnit(Unit *victim) + { + if(victim == m_creature) + return; + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature);break; + case 1: DoScriptText(SAY_SLAY_2, m_creature);break; + case 2: DoScriptText(SAY_SLAY_3, m_creature);break; + } + } +}; + +CreatureAI* GetAI_boss_zuramat(Creature *_Creature) +{ + return new boss_zuramatAI (_Creature); +} + +void AddSC_boss_zuramat() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_zuramat"; + newscript->GetAI = &GetAI_boss_zuramat; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/zone/violet_hold/def_violet_hold.h b/src/bindings/scripts/scripts/zone/violet_hold/def_violet_hold.h new file mode 100644 index 00000000000..71bc0d18d2f --- /dev/null +++ b/src/bindings/scripts/scripts/zone/violet_hold/def_violet_hold.h @@ -0,0 +1,4 @@ +#ifndef DEF_VIOLET_HOLD_H +#define DEF_VIOLET_HOLD_H + +#endif diff --git a/src/bindings/scripts/scripts/zone/violet_hold/instance_violet_hold.cpp b/src/bindings/scripts/scripts/zone/violet_hold/instance_violet_hold.cpp new file mode 100644 index 00000000000..09a805602b1 --- /dev/null +++ b/src/bindings/scripts/scripts/zone/violet_hold/instance_violet_hold.cpp @@ -0,0 +1,21 @@ +#include "precompiled.h" +#include "def_violet_hold.h" + +struct TRINITY_DLL_DECL instance_violet_hold : public ScriptedInstance +{ + instance_violet_hold(Map *Map) : ScriptedInstance(Map) {Initialize();}; +}; + +InstanceData* GetInstanceData_instance_violet_hold(Map* map) +{ + return new instance_violet_hold(map); +} + +void AddSC_instance_violet_hold() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_violet_hold"; + newscript->GetInstanceData = &GetInstanceData_instance_violet_hold; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/zone/wailing_caverns/instance_wailing_caverns.cpp b/src/bindings/scripts/scripts/zone/wailing_caverns/instance_wailing_caverns.cpp index 9aaa32725c1..5327bf7041d 100644 --- a/src/bindings/scripts/scripts/zone/wailing_caverns/instance_wailing_caverns.cpp +++ b/src/bindings/scripts/scripts/zone/wailing_caverns/instance_wailing_caverns.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 diff --git a/src/bindings/scripts/scripts/zone/western_plaguelands/western_plaguelands.cpp b/src/bindings/scripts/scripts/zone/western_plaguelands/western_plaguelands.cpp index 3019331ea05..ce0d76e643d 100644 --- a/src/bindings/scripts/scripts/zone/western_plaguelands/western_plaguelands.cpp +++ b/src/bindings/scripts/scripts/zone/western_plaguelands/western_plaguelands.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -100,7 +100,7 @@ struct TRINITY_DLL_DECL npc_the_scourge_cauldronAI : public ScriptedAI void Reset() {} - void Aggro(Unit* who) {} + void EnterCombat(Unit* who) {} void DoDie() { @@ -122,32 +122,32 @@ struct TRINITY_DLL_DECL npc_the_scourge_cauldronAI : public ScriptedAI switch(m_creature->GetAreaId()) { case 199: //felstone - if( ((Player*)who)->GetQuestStatus(5216) == QUEST_STATUS_INCOMPLETE || - ((Player*)who)->GetQuestStatus(5229) == QUEST_STATUS_INCOMPLETE ) + if( CAST_PLR(who)->GetQuestStatus(5216) == QUEST_STATUS_INCOMPLETE || + CAST_PLR(who)->GetQuestStatus(5229) == QUEST_STATUS_INCOMPLETE ) { DoSpawnCreature(11075,0,0,0,m_creature->GetOrientation(),TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); DoDie(); } break; case 200: //dalson - if( ((Player*)who)->GetQuestStatus(5219) == QUEST_STATUS_INCOMPLETE || - ((Player*)who)->GetQuestStatus(5231) == QUEST_STATUS_INCOMPLETE ) + if( CAST_PLR(who)->GetQuestStatus(5219) == QUEST_STATUS_INCOMPLETE || + CAST_PLR(who)->GetQuestStatus(5231) == QUEST_STATUS_INCOMPLETE ) { DoSpawnCreature(11077,0,0,0,m_creature->GetOrientation(),TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); DoDie(); } break; case 201: //gahrron - if( ((Player*)who)->GetQuestStatus(5225) == QUEST_STATUS_INCOMPLETE || - ((Player*)who)->GetQuestStatus(5235) == QUEST_STATUS_INCOMPLETE ) + if( CAST_PLR(who)->GetQuestStatus(5225) == QUEST_STATUS_INCOMPLETE || + CAST_PLR(who)->GetQuestStatus(5235) == QUEST_STATUS_INCOMPLETE ) { DoSpawnCreature(11078,0,0,0,m_creature->GetOrientation(),TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); DoDie(); } break; case 202: //writhing - if( ((Player*)who)->GetQuestStatus(5222) == QUEST_STATUS_INCOMPLETE || - ((Player*)who)->GetQuestStatus(5233) == QUEST_STATUS_INCOMPLETE ) + if( CAST_PLR(who)->GetQuestStatus(5222) == QUEST_STATUS_INCOMPLETE || + CAST_PLR(who)->GetQuestStatus(5233) == QUEST_STATUS_INCOMPLETE ) { DoSpawnCreature(11076,0,0,0,m_creature->GetOrientation(),TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); DoDie(); diff --git a/src/bindings/scripts/scripts/zone/westfall/westfall.cpp b/src/bindings/scripts/scripts/zone/westfall/westfall.cpp index 749296167fe..f9e04a5186f 100644 --- a/src/bindings/scripts/scripts/zone/westfall/westfall.cpp +++ b/src/bindings/scripts/scripts/zone/westfall/westfall.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -17,17 +17,173 @@ /* ScriptData SDName: Westfall SD%Complete: 90 -SDComment: Quest support: 155 +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); + SetSheathState(SHEATH_STATE_RANGED); + m_creature->HandleEmoteCommand(EMOTE_STATE_USESTANDING_NOSHEATHE); + break; + case 6: + SetCombatMovement(false); + 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->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->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: + SetSheathState(SHEATH_STATE_UNARMED); + m_creature->HandleEmoteCommand(EMOTE_STATE_USESTANDING_NOSHEATHE); + SetEquipmentSlots(true); + break; + case 17: + pPlayer->GroupEventHappens(QUEST_TOME_VALOR, m_creature); + break; + } + } + + void JustSummoned(Creature* pSummoned) + { + pSummoned->AI()->AttackStart(m_creature); + } + + void JustDied(Unit* killer) + { + if (Player* pPlayer = Unit::GetPlayer(PlayerGUID)) + { + if (pPlayer->GetQuestStatus(QUEST_TOME_VALOR) == QUEST_STATUS_INCOMPLETE) + pPlayer->FailQuest(QUEST_TOME_VALOR); + } + } + + void Update(const uint32 diff) + { + npc_escortAI::UpdateAI(diff); + + if(!UpdateVictim()) + return; + + if (uiShootTimer < diff) + { + if (m_creature->IsWithinDistInMap(m_creature->getVictim(), ATTACK_DISTANCE)) + SetCombatMovement(true); + else + SetCombatMovement(false); + + uiShootTimer = 1500; + + 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); + CAST_AI(npc_escortAI, (pCreature->AI()))->Start(true, 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 @@ -38,9 +194,7 @@ EndContentData */ struct TRINITY_DLL_DECL npc_defias_traitorAI : public npc_escortAI { - npc_defias_traitorAI(Creature *c) : npc_escortAI(c) {} - - bool IsWalking; + npc_defias_traitorAI(Creature *c) : npc_escortAI(c) { Reset(); } void WaypointReached(uint32 i) { @@ -49,13 +203,10 @@ struct TRINITY_DLL_DECL npc_defias_traitorAI : public npc_escortAI if (!player) return; - if (IsWalking && !m_creature->HasUnitMovementFlag(MOVEMENTFLAG_WALK_MODE)) - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - switch (i) { case 35: - IsWalking = true; + SetRun(false); break; case 36: DoScriptText(SAY_PROGRESS, m_creature, player); @@ -63,13 +214,13 @@ struct TRINITY_DLL_DECL npc_defias_traitorAI : public npc_escortAI case 44: DoScriptText(SAY_END, m_creature, player); { - if (player && player->GetTypeId() == TYPEID_PLAYER) - ((Player*)player)->GroupEventHappens(QUEST_DEFIAS_BROTHERHOOD,m_creature); + if (player) + player->GroupEventHappens(QUEST_DEFIAS_BROTHERHOOD,m_creature); } break; } } - void Aggro(Unit* who) + void EnterCombat(Unit* who) { switch(rand()%2) { @@ -79,14 +230,7 @@ struct TRINITY_DLL_DECL npc_defias_traitorAI : public npc_escortAI } void Reset() - { - if (IsWalking && !m_creature->HasUnitMovementFlag(MOVEMENTFLAG_WALK_MODE)) - { - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - return; - } - IsWalking = false; - } + {} void JustDied(Unit* killer) { @@ -107,64 +251,20 @@ bool QuestAccept_npc_defias_traitor(Player* player, Creature* creature, Quest co { if (quest->GetQuestId() == QUEST_DEFIAS_BROTHERHOOD) { - ((npc_escortAI*)(creature->AI()))->Start(true, true, true, player->GetGUID()); + CAST_AI(npc_escortAI, (creature->AI()))->Start(true, true, true, player->GetGUID()); DoScriptText(SAY_START, creature, player); } return true; } -CreatureAI* GetAI_npc_defias_traitor(Creature *_Creature) +CreatureAI* GetAI_npc_defias_traitor(Creature* pCreature) { - npc_defias_traitorAI* thisAI = new npc_defias_traitorAI(_Creature); - - thisAI->AddWaypoint(0, -10508.40, 1068.00, 55.21); - thisAI->AddWaypoint(1, -10518.30, 1074.84, 53.96); - thisAI->AddWaypoint(2, -10534.82, 1081.92, 49.88); - thisAI->AddWaypoint(3, -10546.51, 1084.88, 50.13); - thisAI->AddWaypoint(4, -10555.29, 1084.45, 45.75); - thisAI->AddWaypoint(5, -10566.57, 1083.53, 42.10); - thisAI->AddWaypoint(6, -10575.83, 1082.34, 39.46); - thisAI->AddWaypoint(7, -10585.67, 1081.08, 37.77); - thisAI->AddWaypoint(8, -10600.08, 1078.19, 36.23); - thisAI->AddWaypoint(9, -10608.69, 1076.08, 35.88); - thisAI->AddWaypoint(10, -10621.26, 1073.00, 35.40); - thisAI->AddWaypoint(11, -10638.12, 1060.18, 33.61); - thisAI->AddWaypoint(12, -10655.87, 1038.99, 33.48); - thisAI->AddWaypoint(13, -10664.68, 1030.54, 32.70); - thisAI->AddWaypoint(14, -10708.68, 1033.86, 33.32); - thisAI->AddWaypoint(15, -10754.43, 1017.93, 32.79); - thisAI->AddWaypoint(16, -10802.26, 1018.01, 32.16); - thisAI->AddWaypoint(17, -10832.60, 1009.04, 32.71); - thisAI->AddWaypoint(18, -10866.56, 1006.51, 31.71); // Fix waypoints from roughly this point, test first to get proper one - thisAI->AddWaypoint(19, -10879.98, 1005.10, 32.84); - thisAI->AddWaypoint(20, -10892.45, 1001.32, 34.46); - thisAI->AddWaypoint(21, -10906.14, 997.11, 36.15); - thisAI->AddWaypoint(22, -10922.26, 1002.23, 35.74); - thisAI->AddWaypoint(23, -10936.32, 1023.38, 36.52); - thisAI->AddWaypoint(24, -10933.35, 1052.61, 35.85); - thisAI->AddWaypoint(25, -10940.25, 1077.66, 36.49); - thisAI->AddWaypoint(26, -10957.09, 1099.33, 36.83); - thisAI->AddWaypoint(27, -10956.53, 1119.90, 36.73); - thisAI->AddWaypoint(28, -10939.30, 1150.75, 37.42); - thisAI->AddWaypoint(29, -10915.14, 1202.09, 36.55); - thisAI->AddWaypoint(30, -10892.59, 1257.03, 33.37); - thisAI->AddWaypoint(31, -10891.93, 1306.66, 35.45); - thisAI->AddWaypoint(32, -10896.17, 1327.86, 37.77); - thisAI->AddWaypoint(33, -10906.03, 1368.05, 40.91); - thisAI->AddWaypoint(34, -10910.18, 1389.33, 42.62); - thisAI->AddWaypoint(35, -10915.42, 1417.72, 42.93); - thisAI->AddWaypoint(36, -10926.37, 1421.18, 43.04); // walk here and say - thisAI->AddWaypoint(37, -10952.31, 1421.74, 43.40); - thisAI->AddWaypoint(38, -10980.04, 1411.38, 42.79); - thisAI->AddWaypoint(39, -11006.06, 1420.47, 43.26); - thisAI->AddWaypoint(40, -11021.98, 1450.59, 43.09); - thisAI->AddWaypoint(41, -11025.36, 1491.59, 43.15); - thisAI->AddWaypoint(42, -11036.09, 1508.32, 43.28); - thisAI->AddWaypoint(43, -11060.68, 1526.72, 43.19); - thisAI->AddWaypoint(44, -11072.75, 1527.77, 43.20, 5000);// say and quest credit - - return (CreatureAI*)thisAI; + npc_defias_traitorAI* thisAI = new npc_defias_traitorAI(pCreature); + + thisAI->FillPointMovementListForCreature(); + + return thisAI; } void AddSC_westfall() @@ -172,6 +272,12 @@ 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; diff --git a/src/bindings/scripts/scripts/zone/wintergrasp/wintergrasp.cpp b/src/bindings/scripts/scripts/zone/wintergrasp/wintergrasp.cpp new file mode 100644 index 00000000000..67830d78a10 --- /dev/null +++ b/src/bindings/scripts/scripts/zone/wintergrasp/wintergrasp.cpp @@ -0,0 +1,60 @@ +/* Copyright (C) 2008 - 2009 Trinity <http://www.trinitycore.org/> + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "precompiled.h" +#include "Wintergrasp.h" + +bool GossipHello_npc_demolisher_engineerer(Player *player, Creature *_creature) +{ + if(_creature->isQuestGiver()) + player->PrepareQuestMenu(_creature->GetGUID()); + + if(player->HasAura(SPELL_CORPORAL)) + player->ADD_GOSSIP_ITEM(0, "Build catapult.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + else if(player->HasAura(SPELL_LIEUTENANT)) + { + player->ADD_GOSSIP_ITEM(0, "Build catapult.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + player->ADD_GOSSIP_ITEM(0, "Build demolisher.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + player->ADD_GOSSIP_ITEM(0, "Build siege engine.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + } + + player->SEND_GOSSIP_MENU(_creature->GetNpcTextId(), _creature->GetGUID()); + return true; +} + +bool GossipSelect_npc_demolisher_engineerer(Player* player, Creature* me, uint32 uiSender, uint32 uiAction) +{ + player->CLOSE_GOSSIP_MENU(); + switch(uiAction - GOSSIP_ACTION_INFO_DEF) + { + case 0: player->CastSpell(player, 56663, false, NULL, NULL, me->GetGUID()); break; + case 1: player->CastSpell(player, 56575, false, NULL, NULL, me->GetGUID()); break; + case 2: player->CastSpell(player, player->GetTeamId() ? 61408 : 56661, false, NULL, NULL, me->GetGUID()); break; + } + + return true; +} + +void AddSC_wintergrasp() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "npc_demolisher_engineerer"; + newscript->pGossipHello = &GossipHello_npc_demolisher_engineerer; + newscript->pGossipSelect = &GossipSelect_npc_demolisher_engineerer; + newscript->RegisterSelf(); +}
\ No newline at end of file diff --git a/src/bindings/scripts/scripts/zone/winterspring/winterspring.cpp b/src/bindings/scripts/scripts/zone/winterspring/winterspring.cpp index 1986d2c1b27..db6555d058f 100644 --- a/src/bindings/scripts/scripts/zone/winterspring/winterspring.cpp +++ b/src/bindings/scripts/scripts/zone/winterspring/winterspring.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 diff --git a/src/bindings/scripts/scripts/zone/zangarmarsh/zangarmarsh.cpp b/src/bindings/scripts/scripts/zone/zangarmarsh/zangarmarsh.cpp index b5f194d8035..a4f2f32b250 100644 --- a/src/bindings/scripts/scripts/zone/zangarmarsh/zangarmarsh.cpp +++ b/src/bindings/scripts/scripts/zone/zangarmarsh/zangarmarsh.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -137,7 +137,7 @@ struct TRINITY_DLL_DECL npc_cooshcooshAI : public ScriptedAI m_creature->setFaction(FACTION_FRIENDLY_CO); } - void Aggro(Unit *who) {} + void EnterCombat(Unit *who) {} void UpdateAI(const uint32 diff) { @@ -173,7 +173,7 @@ bool GossipSelect_npc_cooshcoosh(Player *player, Creature *_Creature, uint32 sen { player->CLOSE_GOSSIP_MENU(); _Creature->setFaction(FACTION_HOSTILE_CO); - ((npc_cooshcooshAI*)_Creature->AI())->AttackStart(player); + _Creature->AI()->AttackStart(player); } return true; } @@ -277,7 +277,7 @@ struct TRINITY_DLL_DECL npc_kayra_longmaneAI : public npc_escortAI m_creature->setFaction(1660); } - void Aggro(Unit* who){} + void EnterCombat(Unit* who){} void JustSummoned(Creature *summoned) { @@ -333,7 +333,7 @@ bool QuestAccept_npc_kayra_longmane(Player* player, Creature* creature, Quest co { if (quest->GetQuestId() == QUEST_EFU) { - ((npc_escortAI*)(creature->AI()))->Start(true, true, false, player->GetGUID()); + CAST_AI(npc_escortAI, (creature->AI()))->Start(true, true, false, player->GetGUID()); creature->setFaction(113); } return true; @@ -371,7 +371,7 @@ CreatureAI* GetAI_npc_kayra_longmaneAI(Creature* _Creature) thisAI->AddWaypoint(25, -488.45, 5447.83, 22.38); thisAI->AddWaypoint(26, -449.65, 5463.78, 21.77, 11000);//SAY_PROGRESS_6 - return (CreatureAI*)thisAI; + return thisAI; } /*###### ## AddSC diff --git a/src/bindings/scripts/scripts/zone/zulaman/boss_akilzon.cpp b/src/bindings/scripts/scripts/zone/zulaman/boss_akilzon.cpp index ea832370ea3..7861232026e 100644 --- a/src/bindings/scripts/scripts/zone/zulaman/boss_akilzon.cpp +++ b/src/bindings/scripts/scripts/zone/zulaman/boss_akilzon.cpp @@ -61,10 +61,10 @@ struct TRINITY_DLL_DECL boss_akilzonAI : public ScriptedAI { boss_akilzonAI(Creature *c) : ScriptedAI(c) { - SpellEntry *TempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_ELECTRICAL_DAMAGE); + SpellEntry *TempSpell = GET_SPELL(SPELL_ELECTRICAL_DAMAGE); if(TempSpell) TempSpell->EffectBasePoints[1] = 49;//disable bugged lightning until fixed in core - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } ScriptedInstance *pInstance; @@ -112,7 +112,7 @@ struct TRINITY_DLL_DECL boss_akilzonAI : public ScriptedAI SetWeather(WEATHER_STATE_FINE, 0.0f); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { DoYell(SAY_ONAGGRO, LANG_UNIVERSAL, NULL); DoPlaySoundToSet(m_creature, SOUND_ONAGGRO); @@ -187,7 +187,7 @@ struct TRINITY_DLL_DECL boss_akilzonAI : public ScriptedAI { Trinity::AnyAoETargetUnitInObjectRangeCheck u_check(m_creature, m_creature, 999); - Trinity::UnitListSearcher<Trinity::AnyAoETargetUnitInObjectRangeCheck> searcher(tempUnitMap, u_check); + Trinity::UnitListSearcher<Trinity::AnyAoETargetUnitInObjectRangeCheck> searcher(m_creature, tempUnitMap, u_check); TypeContainerVisitor<Trinity::UnitListSearcher<Trinity::AnyAoETargetUnitInObjectRangeCheck>, WorldTypeMapContainer > world_unit_searcher(searcher); TypeContainerVisitor<Trinity::UnitListSearcher<Trinity::AnyAoETargetUnitInObjectRangeCheck>, GridTypeMapContainer > grid_unit_searcher(searcher); @@ -297,7 +297,7 @@ struct TRINITY_DLL_DECL boss_akilzonAI : public ScriptedAI } if (ElectricalStorm_Timer < diff) { - Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0, 50, true); + Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50, true); if(!target) { EnterEvadeMode(); @@ -381,18 +381,9 @@ struct TRINITY_DLL_DECL mob_soaring_eagleAI : public ScriptedAI m_creature->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); } - void Aggro(Unit *who) {DoZoneInCombat();} + void EnterCombat(Unit *who) {DoZoneInCombat();} - void AttackStart(Unit *who) - { - if (!InCombat) - { - Aggro(who); - InCombat = true; - } - } - - void MoveInLineOfSight(Unit *) {} + void MoveInLineOfSight(Unit* who) {} void MovementInform(uint32, uint32) { @@ -431,9 +422,7 @@ struct TRINITY_DLL_DECL mob_soaring_eagleAI : public ScriptedAI m_creature->SetSpeed(MOVE_RUN, 5.0f); TargetGUID = target->GetGUID(); } - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT); m_creature->GetMotionMaster()->MovePoint(0, x, y, z); - m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT); arrived = false; } } diff --git a/src/bindings/scripts/scripts/zone/zulaman/boss_halazzi.cpp b/src/bindings/scripts/scripts/zone/zulaman/boss_halazzi.cpp index 6e7311d8917..fc1fb3ce592 100644 --- a/src/bindings/scripts/scripts/zone/zulaman/boss_halazzi.cpp +++ b/src/bindings/scripts/scripts/zone/zulaman/boss_halazzi.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -75,9 +75,9 @@ struct TRINITY_DLL_DECL boss_halazziAI : public ScriptedAI { boss_halazziAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); // need to find out what controls totem's spell cooldown - SpellEntry *TempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_LIGHTNING); + SpellEntry *TempSpell = GET_SPELL(SPELL_LIGHTNING); if(TempSpell && TempSpell->CastingTimeIndex != 5) TempSpell->CastingTimeIndex = 5; // 2000 ms casting time } @@ -112,7 +112,7 @@ struct TRINITY_DLL_DECL boss_halazziAI : public ScriptedAI EnterPhase(PHASE_LYNX); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { if(pInstance) pInstance->SetData(DATA_HALAZZIEVENT, IN_PROGRESS); @@ -353,7 +353,7 @@ struct TRINITY_DLL_DECL boss_spiritlynxAI : public ScriptedAI ScriptedAI::AttackStart(who); } - void Aggro(Unit *who) {/*DoZoneInCombat();*/} + void EnterCombat(Unit *who) {/*DoZoneInCombat();*/} void UpdateAI(const uint32 diff) { diff --git a/src/bindings/scripts/scripts/zone/zulaman/boss_hexlord.cpp b/src/bindings/scripts/scripts/zone/zulaman/boss_hexlord.cpp index 375c8758bb0..b57cc4e0753 100644 --- a/src/bindings/scripts/scripts/zone/zulaman/boss_hexlord.cpp +++ b/src/bindings/scripts/scripts/zone/zulaman/boss_hexlord.cpp @@ -179,12 +179,12 @@ struct TRINITY_DLL_DECL boss_hexlord_addAI : public ScriptedAI boss_hexlord_addAI(Creature* c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } void Reset() {} - void Aggro(Unit* who) {DoZoneInCombat();} + void EnterCombat(Unit* who) {DoZoneInCombat();} void UpdateAI(const uint32 diff) { @@ -202,7 +202,7 @@ struct TRINITY_DLL_DECL boss_hex_lord_malacrassAI : public ScriptedAI { boss_hex_lord_malacrassAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); SelectAddEntry(); for(uint8 i = 0; i < 4; ++i) AddGUID[i] = 0; @@ -240,12 +240,11 @@ struct TRINITY_DLL_DECL boss_hex_lord_malacrassAI : public ScriptedAI SpawnAdds(); - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, 46916); - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO, 50268674); + m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, 46916); m_creature->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE ); } - void Aggro(Unit* who) + void EnterCombat(Unit* who) { if(pInstance) pInstance->SetData(DATA_HEXLORDEVENT, IN_PROGRESS); @@ -258,7 +257,7 @@ struct TRINITY_DLL_DECL boss_hex_lord_malacrassAI : public ScriptedAI { Unit* Temp = Unit::GetUnit((*m_creature),AddGUID[i]); if(Temp && Temp->isAlive()) - ((Creature*)Temp)->AI()->AttackStart(m_creature->getVictim()); + CAST_CRE(Temp)->AI()->AttackStart(m_creature->getVictim()); else { EnterEvadeMode(); @@ -354,7 +353,7 @@ struct TRINITY_DLL_DECL boss_hex_lord_malacrassAI : public ScriptedAI { Unit* Temp = Unit::GetUnit((*m_creature),AddGUID[i]); if(Temp && Temp->isAlive() && !Temp->getVictim()) - ((Creature*)Temp)->AI()->AttackStart(m_creature->getVictim()); + CAST_CRE(Temp)->AI()->AttackStart(m_creature->getVictim()); } CheckAddState_Timer = 5000; }else CheckAddState_Timer -= diff; @@ -384,7 +383,7 @@ struct TRINITY_DLL_DECL boss_hex_lord_malacrassAI : public ScriptedAI if(SiphonSoul_Timer < diff) { - Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0, 70, true); + Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 70, true); Unit *trigger = DoSpawnCreature(MOB_TEMP_TRIGGER, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN, 30000); if(!target || !trigger) { @@ -533,12 +532,6 @@ struct TRINITY_DLL_DECL boss_alyson_antilleAI : public boss_hexlord_addAI m_creature->GetMotionMaster()->MoveChase(who, 20); m_creature->AddThreat(who, 0.0f); } - - if (!InCombat) - { - Aggro(who); - InCombat = true; - } } } @@ -618,12 +611,6 @@ struct TRINITY_DLL_DECL boss_gazakrothAI : public boss_hexlord_addAI m_creature->GetMotionMaster()->MoveChase(who, 20); m_creature->AddThreat(who, 0.0f); } - - if (!InCombat) - { - Aggro(who); - InCombat = true; - } } } @@ -738,12 +725,6 @@ struct TRINITY_DLL_DECL boss_slitherAI : public boss_hexlord_addAI m_creature->GetMotionMaster()->MoveChase(who, 20); m_creature->AddThreat(who, 0.0f); } - - if (!InCombat) - { - Aggro(who); - InCombat = true; - } } } diff --git a/src/bindings/scripts/scripts/zone/zulaman/boss_janalai.cpp b/src/bindings/scripts/scripts/zone/zulaman/boss_janalai.cpp index 05b92144a89..e8564c84a10 100644 --- a/src/bindings/scripts/scripts/zone/zulaman/boss_janalai.cpp +++ b/src/bindings/scripts/scripts/zone/zulaman/boss_janalai.cpp @@ -1,4 +1,4 @@ - /* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> + /* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -101,9 +101,9 @@ struct TRINITY_DLL_DECL boss_janalaiAI : public ScriptedAI { boss_janalaiAI(Creature *c) : ScriptedAI(c) { - pInstance =((ScriptedInstance*)c->GetInstanceData()); + pInstance =(c->GetInstanceData()); - SpellEntry *TempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_HATCH_EGG); + SpellEntry *TempSpell = GET_SPELL(SPELL_HATCH_EGG); if(TempSpell && TempSpell->EffectImplicitTargetA[0] != 1) { TempSpell->EffectImplicitTargetA[0] = 1; @@ -171,7 +171,7 @@ struct TRINITY_DLL_DECL boss_janalaiAI : public ScriptedAI } } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { if(pInstance) pInstance->SetData(DATA_JANALAIEVENT, IN_PROGRESS); @@ -238,7 +238,7 @@ struct TRINITY_DLL_DECL boss_janalaiAI : public ScriptedAI cell.SetNoCreate(); Trinity::AllCreaturesOfEntryInRange check(m_creature, MOB_EGG, 100); - Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(templist, check); + Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(m_creature, templist, check); TypeContainerVisitor<Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange>, GridTypeMapContainer> cSearcher(searcher); @@ -273,7 +273,7 @@ struct TRINITY_DLL_DECL boss_janalaiAI : public ScriptedAI cell.SetNoCreate(); Trinity::AllCreaturesOfEntryInRange check(m_creature, MOB_FIRE_BOMB, 100); - Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(templist, check); + Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(m_creature, templist, check); TypeContainerVisitor<Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange>, GridTypeMapContainer> cSearcher(searcher); @@ -463,7 +463,7 @@ struct TRINITY_DLL_DECL mob_janalai_firebombAI : public ScriptedAI m_creature->CastSpell(m_creature, SPELL_FIRE_BOMB_DUMMY, true); } - void Aggro(Unit* who) {} + void EnterCombat(Unit* who) {} void AttackStart(Unit* who) {} @@ -481,7 +481,7 @@ struct TRINITY_DLL_DECL mob_amanishi_hatcherAI : public ScriptedAI { mob_amanishi_hatcherAI(Creature *c) : ScriptedAI(c) { - pInstance =((ScriptedInstance*)c->GetInstanceData()); + pInstance =(c->GetInstanceData()); } ScriptedInstance *pInstance; @@ -517,7 +517,7 @@ struct TRINITY_DLL_DECL mob_amanishi_hatcherAI : public ScriptedAI cell.SetNoCreate(); Trinity::AllCreaturesOfEntryInRange check(m_creature, 23817, 50); - Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(templist, check); + Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(m_creature, templist, check); TypeContainerVisitor<Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange>, GridTypeMapContainer> cSearcher(searcher); @@ -542,9 +542,9 @@ struct TRINITY_DLL_DECL mob_amanishi_hatcherAI : public ScriptedAI return true; } - void Aggro(Unit* who) {} - void AttackStart(Unit*) {} - void MoveInLineOfSight(Unit*) {} + void EnterCombat(Unit* who) {} + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} void MovementInform(uint32, uint32) { if(waypoint == 5) @@ -612,7 +612,7 @@ struct TRINITY_DLL_DECL mob_hatchlingAI : public ScriptedAI { mob_hatchlingAI(Creature *c) : ScriptedAI(c) { - pInstance =((ScriptedInstance*)c->GetInstanceData()); + pInstance =(c->GetInstanceData()); } ScriptedInstance *pInstance; @@ -629,7 +629,7 @@ struct TRINITY_DLL_DECL mob_hatchlingAI : public ScriptedAI m_creature->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); } - void Aggro(Unit *who) {/*DoZoneInCombat();*/} + void EnterCombat(Unit *who) {/*DoZoneInCombat();*/} void UpdateAI(const uint32 diff) { @@ -662,7 +662,7 @@ struct TRINITY_DLL_DECL mob_eggAI : public ScriptedAI { mob_eggAI(Creature *c) : ScriptedAI(c){} void Reset() {} - void Aggro(Unit* who) {} + void EnterCombat(Unit* who) {} void AttackStart(Unit* who) {} void MoveInLineOfSight(Unit* who) {} void UpdateAI(const uint32 diff) {} diff --git a/src/bindings/scripts/scripts/zone/zulaman/boss_nalorakk.cpp b/src/bindings/scripts/scripts/zone/zulaman/boss_nalorakk.cpp index d8a909f605a..96038629cb3 100644 --- a/src/bindings/scripts/scripts/zone/zulaman/boss_nalorakk.cpp +++ b/src/bindings/scripts/scripts/zone/zulaman/boss_nalorakk.cpp @@ -1,4 +1,4 @@ - /* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> + /* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -95,7 +95,7 @@ struct TRINITY_DLL_DECL boss_nalorakkAI : public ScriptedAI { MoveEvent = true; MovePhase = 0; - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } ScriptedInstance *pInstance; @@ -142,7 +142,7 @@ struct TRINITY_DLL_DECL boss_nalorakkAI : public ScriptedAI Berserk_Timer = 600000; inBearForm = false; - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY + 1, 5122); + m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, 5122); } void SendAttacker(Unit* target) @@ -158,7 +158,7 @@ struct TRINITY_DLL_DECL boss_nalorakkAI : public ScriptedAI cell.SetNoCreate(); Trinity::AllFriendlyCreaturesInGrid check(m_creature); - Trinity::CreatureListSearcher<Trinity::AllFriendlyCreaturesInGrid> searcher(templist, check); + Trinity::CreatureListSearcher<Trinity::AllFriendlyCreaturesInGrid> searcher(m_creature, templist, check); TypeContainerVisitor<Trinity::CreatureListSearcher<Trinity::AllFriendlyCreaturesInGrid>, GridTypeMapContainer> cSearcher(searcher); @@ -258,7 +258,7 @@ struct TRINITY_DLL_DECL boss_nalorakkAI : public ScriptedAI } } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { if(pInstance) pInstance->SetData(DATA_NALORAKKEVENT, IN_PROGRESS); @@ -360,7 +360,7 @@ struct TRINITY_DLL_DECL boss_nalorakkAI : public ScriptedAI { if(inBearForm) { - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY + 1, 5122); + m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, 5122); DoYell(YELL_SHIFTEDTOTROLL, LANG_UNIVERSAL, NULL); DoPlaySoundToSet(m_creature, SOUND_YELL_TOTROLL); m_creature->RemoveAurasDueToSpell(SPELL_BEARFORM); @@ -372,7 +372,7 @@ struct TRINITY_DLL_DECL boss_nalorakkAI : public ScriptedAI } else { - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY + 1, 0); + m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, 0); DoYell(YELL_SHIFTEDTOBEAR, LANG_UNIVERSAL, NULL); DoPlaySoundToSet(m_creature, SOUND_YELL_TOBEAR); DoCast(m_creature, SPELL_BEARFORM, true); @@ -394,7 +394,7 @@ struct TRINITY_DLL_DECL boss_nalorakkAI : public ScriptedAI if(Mangle_Timer < diff) { - if(m_creature->getVictim() && !m_creature->getVictim()->HasAura(SPELL_MANGLEEFFECT, 0)) + if(m_creature->getVictim() && !m_creature->getVictim()->HasAura(SPELL_MANGLEEFFECT)) { DoCast(m_creature->getVictim(), SPELL_MANGLE); Mangle_Timer = 1000; @@ -406,7 +406,7 @@ struct TRINITY_DLL_DECL boss_nalorakkAI : public ScriptedAI { DoYell(YELL_SURGE, LANG_UNIVERSAL, NULL); DoPlaySoundToSet(m_creature, SOUND_YELL_SURGE); - Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 1, GetSpellMaxRange(SPELL_SURGE), true); + Unit *target = SelectTarget(SELECT_TARGET_RANDOM, 1, 45, true); if(target) DoCast(target, SPELL_SURGE); Surge_Timer = 15000 + rand()%5000; diff --git a/src/bindings/scripts/scripts/zone/zulaman/boss_zuljin.cpp b/src/bindings/scripts/scripts/zone/zulaman/boss_zuljin.cpp index 6cdd5316fec..ea1eddff107 100644 --- a/src/bindings/scripts/scripts/zone/zulaman/boss_zuljin.cpp +++ b/src/bindings/scripts/scripts/zone/zulaman/boss_zuljin.cpp @@ -143,7 +143,7 @@ struct TRINITY_DLL_DECL boss_zuljinAI : public ScriptedAI { boss_zuljinAI(Creature *c) : ScriptedAI(c), Summons(m_creature) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } ScriptedInstance *pInstance; @@ -206,12 +206,12 @@ struct TRINITY_DLL_DECL boss_zuljinAI : public ScriptedAI Summons.DespawnAll(); - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, 47174); - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO, 218172674); - m_creature->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE); + m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, 47174); + //m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO, 218172674); + //m_creature->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { if(pInstance) pInstance->SetData(DATA_ZULJINEVENT, IN_PROGRESS); @@ -252,15 +252,15 @@ struct TRINITY_DLL_DECL boss_zuljinAI : public ScriptedAI Summons.DespawnEntry(CREATURE_COLUMN_OF_FIRE); if(Unit *Temp = Unit::GetUnit(*m_creature, SpiritGUID[3])) - Temp->SetUInt32Value(UNIT_FIELD_BYTES_1,PLAYER_STATE_DEAD); + Temp->SetUInt32Value(UNIT_FIELD_BYTES_1,UNIT_STAND_STATE_DEAD); } void AttackStart(Unit *who) { if(Phase == 2) - ScriptedAI::AttackStart(who, false); + AttackStartNoMove(who); else - ScriptedAI::AttackStart(who, true); + ScriptedAI::AttackStart(who); } void DoMeleeAttackIfReady() @@ -339,7 +339,7 @@ struct TRINITY_DLL_DECL boss_zuljinAI : public ScriptedAI case 4: DoTeleportTo(CENTER_X, CENTER_Y, CENTER_Z, 100); DoResetThreat(); - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, 0); + m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, 0); m_creature->RemoveAurasDueToSpell(Transform[Phase].unaura); DoCast(m_creature, Transform[Phase].spell); DoYell(Transform[Phase].text, LANG_UNIVERSAL, NULL); @@ -347,7 +347,7 @@ struct TRINITY_DLL_DECL boss_zuljinAI : public ScriptedAI if(Phase > 0) { if(Unit *Temp = Unit::GetUnit(*m_creature, SpiritGUID[Phase - 1])) - Temp->SetUInt32Value(UNIT_FIELD_BYTES_1,PLAYER_STATE_DEAD); + Temp->SetUInt32Value(UNIT_FIELD_BYTES_1,UNIT_STAND_STATE_DEAD); } if(Unit *Temp = Unit::GetUnit(*m_creature, SpiritGUID[NextPhase - 1])) Temp->CastSpell(m_creature, SPELL_SIPHON_SOUL, false); // should m cast on temp @@ -587,7 +587,7 @@ struct TRINITY_DLL_DECL feather_vortexAI : public ScriptedAI void Reset() {} - void Aggro(Unit* target) {} + void EnterCombat(Unit* target) {} void SpellHit(Unit *caster, const SpellEntry *spell) { diff --git a/src/bindings/scripts/scripts/zone/zulaman/def_zulaman.h b/src/bindings/scripts/scripts/zone/zulaman/def_zulaman.h index c249cf6b3ec..6fb0ef173bd 100644 --- a/src/bindings/scripts/scripts/zone/zulaman/def_zulaman.h +++ b/src/bindings/scripts/scripts/zone/zulaman/def_zulaman.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * This program is free software licensed under GPL version 2 * Please see the included DOCS/LICENSE.TXT for more information */ diff --git a/src/bindings/scripts/scripts/zone/zulaman/instance_zulaman.cpp b/src/bindings/scripts/scripts/zone/zulaman/instance_zulaman.cpp index fa33bf578f9..8ff01927908 100644 --- a/src/bindings/scripts/scripts/zone/zulaman/instance_zulaman.cpp +++ b/src/bindings/scripts/scripts/zone/zulaman/instance_zulaman.cpp @@ -1,4 +1,4 @@ - /* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> + /* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -106,7 +106,7 @@ struct TRINITY_DLL_DECL instance_zulaman : public ScriptedInstance void OnCreatureCreate(Creature *creature, uint32 creature_entry) { - switch(creature_entry) + switch(creature->GetEntry()) { case 23578://janalai case 23863://zuljin @@ -139,8 +139,8 @@ struct TRINITY_DLL_DECL instance_zulaman : public ScriptedInstance void OpenDoor(uint64 DoorGUID, bool open) { - if(GameObject *Door = instance->GetGameObjectInMap(DoorGUID)) - Door->SetUInt32Value(GAMEOBJECT_STATE, open ? 0 : 1); + if(GameObject *Door = instance->GetGameObject(DoorGUID)) + Door->SetGoState(open ? GO_STATE_ACTIVE : GO_STATE_READY); } void SummonHostage(uint8 num) @@ -179,7 +179,7 @@ struct TRINITY_DLL_DECL instance_zulaman : public ScriptedInstance instance->SendToPlayers(&data); } - const char* Save() + std::string GetSaveData() { std::ostringstream ss; ss << "S " << BossKilled << " " << ChestLooted << " " << QuestMinute; diff --git a/src/bindings/scripts/scripts/zone/zulaman/zulaman.cpp b/src/bindings/scripts/scripts/zone/zulaman/zulaman.cpp index 9f3588e387a..dd16b652c0d 100644 --- a/src/bindings/scripts/scripts/zone/zulaman/zulaman.cpp +++ b/src/bindings/scripts/scripts/zone/zulaman/zulaman.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -40,14 +40,14 @@ struct TRINITY_DLL_DECL npc_forest_frogAI : public ScriptedAI { npc_forest_frogAI(Creature* c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } ScriptedInstance *pInstance; void Reset() { } - void Aggro(Unit *who) { } + void EnterCombat(Unit *who) { } void DoSpawnRandom() { @@ -111,8 +111,8 @@ struct TRINITY_DLL_DECL npc_zulaman_hostageAI : public ScriptedAI bool IsLoot; uint64 PlayerGUID; void Reset() {} - void Aggro(Unit *who) {} - void JustDied(Unit *) + void EnterCombat(Unit *who) {} + void JustDied(Unit* who) { Player* player = Unit::GetPlayer(PlayerGUID); if(player) player->SendLoot(m_creature->GetGUID(), LOOT_CORPSE); @@ -139,7 +139,7 @@ bool GossipSelect_npc_zulaman_hostage(Player* player, Creature* _Creature, uint3 return true; _Creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - ScriptedInstance* pInstance = ((ScriptedInstance*)_Creature->GetInstanceData()); + ScriptedInstance* pInstance = (_Creature->GetInstanceData()); if(pInstance) { //uint8 progress = pInstance->GetData(DATA_CHESTLOOTED); @@ -158,8 +158,8 @@ bool GossipSelect_npc_zulaman_hostage(Player* player, Creature* _Creature, uint3 /*Creature* summon = _Creature->SummonCreature(HostageInfo[progress], x-2, y, z, 0, TEMPSUMMON_DEAD_DESPAWN, 0); if(summon) { - ((npc_zulaman_hostageAI*)summon->AI())->PlayerGUID = player->GetGUID(); - ((npc_zulaman_hostageAI*)summon->AI())->IsLoot = true; + CAST_AI(npc_zulaman_hostageAI, summon->AI())->PlayerGUID = player->GetGUID(); + CAST_AI(npc_zulaman_hostageAI, summon->AI())->IsLoot = true; summon->SetDisplayId(10056); summon->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); summon->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); diff --git a/src/bindings/scripts/scripts/zone/zulfarrak/zulfarrak.cpp b/src/bindings/scripts/scripts/zone/zulfarrak/zulfarrak.cpp index 3d233037d16..80db24d7871 100644 --- a/src/bindings/scripts/scripts/zone/zulfarrak/zulfarrak.cpp +++ b/src/bindings/scripts/scripts/zone/zulfarrak/zulfarrak.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -44,7 +44,7 @@ struct TRINITY_DLL_DECL npc_sergeant_blyAI : public ScriptedAI { npc_sergeant_blyAI(Creature *c) : ScriptedAI(c) { - //pInstance = ((ScriptedInstance*)c->GetInstanceData()); + //pInstance = (c->GetInstanceData()); } //ScriptedInstance* pInstance; @@ -63,7 +63,7 @@ struct TRINITY_DLL_DECL npc_sergeant_blyAI : public ScriptedAI pInstance->SetData(0, NOT_STARTED);*/ } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { /*if( pInstance ) pInstance->SetData(0, IN_PROGRESS);*/ @@ -121,7 +121,7 @@ bool GossipSelect_npc_sergeant_bly(Player *player, Creature *_Creature, uint32 s { player->CLOSE_GOSSIP_MENU(); _Creature->setFaction(FACTION_HOSTILE); - ((npc_sergeant_blyAI*)_Creature->AI())->AttackStart(player); + CAST_AI(npc_sergeant_blyAI, _Creature->AI())->AttackStart(player); } return true; } @@ -141,7 +141,7 @@ struct TRINITY_DLL_DECL npc_weegli_blastfuseAI : public ScriptedAI { npc_weegli_blastfuseAI(Creature *c) : ScriptedAI(c) { - //pInstance = ((ScriptedInstance*)c->GetInstanceData()); + //pInstance = (c->GetInstanceData()); } //ScriptedInstance* pInstance; @@ -152,7 +152,7 @@ struct TRINITY_DLL_DECL npc_weegli_blastfuseAI : public ScriptedAI pInstance->SetData(0, NOT_STARTED);*/ } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { /*if( pInstance ) pInstance->SetData(0, IN_PROGRESS);*/ diff --git a/src/bindings/scripts/scripts/zone/zulgurub/boss_arlokk.cpp b/src/bindings/scripts/scripts/zone/zulgurub/boss_arlokk.cpp index 3d90fad3b63..588a4db8271 100644 --- a/src/bindings/scripts/scripts/zone/zulgurub/boss_arlokk.cpp +++ b/src/bindings/scripts/scripts/zone/zulgurub/boss_arlokk.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -38,7 +38,7 @@ struct TRINITY_DLL_DECL boss_arlokkAI : public ScriptedAI { boss_arlokkAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } ScriptedInstance *pInstance; @@ -78,7 +78,7 @@ struct TRINITY_DLL_DECL boss_arlokkAI : public ScriptedAI m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { DoScriptText(SAY_AGGRO, m_creature); } diff --git a/src/bindings/scripts/scripts/zone/zulgurub/boss_gahzranka.cpp b/src/bindings/scripts/scripts/zone/zulgurub/boss_gahzranka.cpp index 7cf15d53416..c5f45901245 100644 --- a/src/bindings/scripts/scripts/zone/zulgurub/boss_gahzranka.cpp +++ b/src/bindings/scripts/scripts/zone/zulgurub/boss_gahzranka.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -23,7 +23,7 @@ EndScriptData */ #include "precompiled.h" -#define SPELL_FROSTBREATH 21099 +#define SPELL_FROSTBREATH 16099 #define SPELL_MASSIVEGEYSER 22421 //Not working. Cause its a summon... #define SPELL_SLAM 24326 @@ -41,7 +41,7 @@ struct TRINITY_DLL_DECL boss_gahzrankaAI : public ScriptedAI Slam_Timer = 17000; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } diff --git a/src/bindings/scripts/scripts/zone/zulgurub/boss_grilek.cpp b/src/bindings/scripts/scripts/zone/zulgurub/boss_grilek.cpp index 623015acb73..6a7455e731e 100644 --- a/src/bindings/scripts/scripts/zone/zulgurub/boss_grilek.cpp +++ b/src/bindings/scripts/scripts/zone/zulgurub/boss_grilek.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -40,7 +40,7 @@ struct TRINITY_DLL_DECL boss_grilekAI : public ScriptedAI GroundTremor_Timer = 8000 + rand()%8000; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } diff --git a/src/bindings/scripts/scripts/zone/zulgurub/boss_hakkar.cpp b/src/bindings/scripts/scripts/zone/zulgurub/boss_hakkar.cpp index 0d490781ec7..2202fecc19c 100644 --- a/src/bindings/scripts/scripts/zone/zulgurub/boss_hakkar.cpp +++ b/src/bindings/scripts/scripts/zone/zulgurub/boss_hakkar.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -46,7 +46,7 @@ struct TRINITY_DLL_DECL boss_hakkarAI : public ScriptedAI { boss_hakkarAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } ScriptedInstance *pInstance; @@ -94,7 +94,7 @@ struct TRINITY_DLL_DECL boss_hakkarAI : public ScriptedAI Enraged = false; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { DoScriptText(SAY_AGGRO, m_creature); } diff --git a/src/bindings/scripts/scripts/zone/zulgurub/boss_hazzarah.cpp b/src/bindings/scripts/scripts/zone/zulgurub/boss_hazzarah.cpp index ca47d766676..7208fcf3ec1 100644 --- a/src/bindings/scripts/scripts/zone/zulgurub/boss_hazzarah.cpp +++ b/src/bindings/scripts/scripts/zone/zulgurub/boss_hazzarah.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -43,7 +43,7 @@ struct TRINITY_DLL_DECL boss_hazzarahAI : public ScriptedAI Illusions_Timer = 10000 + rand()%8000; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } @@ -80,7 +80,7 @@ struct TRINITY_DLL_DECL boss_hazzarahAI : public ScriptedAI Illusion = m_creature->SummonCreature(15163,target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(),0,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,30000); if(Illusion) - ((CreatureAI*)Illusion->AI())->AttackStart(target); + (Illusion->AI())->AttackStart(target); } Illusions_Timer = 15000 + rand()%10000; diff --git a/src/bindings/scripts/scripts/zone/zulgurub/boss_jeklik.cpp b/src/bindings/scripts/scripts/zone/zulgurub/boss_jeklik.cpp index 7e29787cc5b..f4d99434402 100644 --- a/src/bindings/scripts/scripts/zone/zulgurub/boss_jeklik.cpp +++ b/src/bindings/scripts/scripts/zone/zulgurub/boss_jeklik.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -45,7 +45,7 @@ struct TRINITY_DLL_DECL boss_jeklikAI : public ScriptedAI { boss_jeklikAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } ScriptedInstance *pInstance; @@ -77,7 +77,7 @@ struct TRINITY_DLL_DECL boss_jeklikAI : public ScriptedAI PhaseTwo = false; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { DoScriptText(SAY_AGGRO, m_creature); DoCast(m_creature,SPELL_BAT_FORM); @@ -212,7 +212,7 @@ struct TRINITY_DLL_DECL mob_batriderAI : public ScriptedAI { mob_batriderAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } ScriptedInstance *pInstance; @@ -228,7 +228,7 @@ struct TRINITY_DLL_DECL mob_batriderAI : public ScriptedAI m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); } - void Aggro(Unit *who) {} + void EnterCombat(Unit *who) {} void UpdateAI (const uint32 diff) { diff --git a/src/bindings/scripts/scripts/zone/zulgurub/boss_jindo.cpp b/src/bindings/scripts/scripts/zone/zulgurub/boss_jindo.cpp index 1f9486ed625..b5271291a4d 100644 --- a/src/bindings/scripts/scripts/zone/zulgurub/boss_jindo.cpp +++ b/src/bindings/scripts/scripts/zone/zulgurub/boss_jindo.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -43,7 +43,7 @@ struct TRINITY_DLL_DECL boss_jindoAI : public ScriptedAI { boss_jindoAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } ScriptedInstance *pInstance; @@ -54,10 +54,6 @@ struct TRINITY_DLL_DECL boss_jindoAI : public ScriptedAI uint32 Delusions_Timer; uint32 Teleport_Timer; - Creature *Shade; - Creature *Skeletons; - Creature *HealingWard; - void Reset() { BrainWashTotem_Timer = 20000; @@ -67,7 +63,7 @@ struct TRINITY_DLL_DECL boss_jindoAI : public ScriptedAI Teleport_Timer = 5000; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { DoScriptText(SAY_AGGRO, m_creature); } @@ -88,7 +84,7 @@ struct TRINITY_DLL_DECL boss_jindoAI : public ScriptedAI if (HealingWard_Timer < diff) { //DoCast(m_creature, SPELL_POWERFULLHEALINGWARD); - HealingWard = m_creature->SummonCreature(14987, m_creature->GetPositionX()+3, m_creature->GetPositionY()-2, m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,30000); + m_creature->SummonCreature(14987, m_creature->GetPositionX()+3, m_creature->GetPositionY()-2, m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,30000); HealingWard_Timer = 14000 + rand()%6000; }else HealingWard_Timer -= diff; @@ -110,7 +106,7 @@ struct TRINITY_DLL_DECL boss_jindoAI : public ScriptedAI { DoCast(target, SPELL_DELUSIONSOFJINDO); - Shade = m_creature->SummonCreature(14986, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + Creature *Shade = m_creature->SummonCreature(14986, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if(Shade) Shade->AI()->AttackStart(target); } @@ -130,6 +126,7 @@ struct TRINITY_DLL_DECL boss_jindoAI : public ScriptedAI if(DoGetThreat(m_creature->getVictim())) DoModifyThreatPercent(target,-100); + Creature *Skeletons; Skeletons = m_creature->SummonCreature(14826, target->GetPositionX()+2, target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if(Skeletons) Skeletons->AI()->AttackStart(target); @@ -171,7 +168,7 @@ struct TRINITY_DLL_DECL mob_healing_wardAI : public ScriptedAI { mob_healing_wardAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } uint32 Heal_Timer; @@ -183,7 +180,7 @@ struct TRINITY_DLL_DECL mob_healing_wardAI : public ScriptedAI Heal_Timer = 2000; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } @@ -210,7 +207,7 @@ struct TRINITY_DLL_DECL mob_shade_of_jindoAI : public ScriptedAI { mob_shade_of_jindoAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } uint32 ShadowShock_Timer; @@ -223,7 +220,7 @@ struct TRINITY_DLL_DECL mob_shade_of_jindoAI : public ScriptedAI m_creature->CastSpell(m_creature, SPELL_INVISIBLE,true); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } diff --git a/src/bindings/scripts/scripts/zone/zulgurub/boss_mandokir.cpp b/src/bindings/scripts/scripts/zone/zulgurub/boss_mandokir.cpp index 87939596324..3c10e16dde7 100644 --- a/src/bindings/scripts/scripts/zone/zulgurub/boss_mandokir.cpp +++ b/src/bindings/scripts/scripts/zone/zulgurub/boss_mandokir.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -46,7 +46,7 @@ struct TRINITY_DLL_DECL boss_mandokirAI : public ScriptedAI { boss_mandokirAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } uint32 KillCount; @@ -123,7 +123,7 @@ struct TRINITY_DLL_DECL boss_mandokirAI : public ScriptedAI } } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { DoScriptText(SAY_AGGRO, m_creature); } @@ -270,7 +270,7 @@ struct TRINITY_DLL_DECL mob_ohganAI : public ScriptedAI { mob_ohganAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } uint32 SunderArmor_Timer; @@ -281,7 +281,7 @@ struct TRINITY_DLL_DECL mob_ohganAI : public ScriptedAI SunderArmor_Timer = 5000; } - void Aggro(Unit *who) {} + void EnterCombat(Unit *who) {} void JustDied(Unit* Killer) { diff --git a/src/bindings/scripts/scripts/zone/zulgurub/boss_marli.cpp b/src/bindings/scripts/scripts/zone/zulgurub/boss_marli.cpp index 83db48e0a54..e77f08bbc39 100644 --- a/src/bindings/scripts/scripts/zone/zulgurub/boss_marli.cpp +++ b/src/bindings/scripts/scripts/zone/zulgurub/boss_marli.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -42,7 +42,7 @@ struct TRINITY_DLL_DECL boss_marliAI : public ScriptedAI { boss_marliAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } ScriptedInstance *pInstance; @@ -76,7 +76,7 @@ struct TRINITY_DLL_DECL boss_marliAI : public ScriptedAI m_creature->ApplySpellImmune(1, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { DoScriptText(SAY_AGGRO, m_creature); } @@ -216,7 +216,7 @@ struct TRINITY_DLL_DECL mob_spawn_of_marliAI : public ScriptedAI LevelUp_Timer = 3000; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } diff --git a/src/bindings/scripts/scripts/zone/zulgurub/boss_renataki.cpp b/src/bindings/scripts/scripts/zone/zulgurub/boss_renataki.cpp index 1b01afd9aa1..54cda57d9f9 100644 --- a/src/bindings/scripts/scripts/zone/zulgurub/boss_renataki.cpp +++ b/src/bindings/scripts/scripts/zone/zulgurub/boss_renataki.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -24,8 +24,10 @@ EndScriptData */ #include "precompiled.h" #include "def_zulgurub.h" -#define SPELL_AMBUSH 24337 -#define SPELL_THOUSANDBLADES 24649 +#define SPELL_AMBUSH 24337 +#define SPELL_THOUSANDBLADES 24649 + +#define EQUIP_ID_MAIN_HAND 0 //was item display id 31818, but this id does not exist struct TRINITY_DLL_DECL boss_renatakiAI : public ScriptedAI { @@ -52,7 +54,7 @@ struct TRINITY_DLL_DECL boss_renatakiAI : public ScriptedAI Ambushed = false; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } @@ -65,11 +67,11 @@ struct TRINITY_DLL_DECL boss_renatakiAI : public ScriptedAI if (Invisible_Timer < diff) { m_creature->InterruptSpell(CURRENT_GENERIC_SPELL); - m_creature->SetUInt32Value( UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, 0); - m_creature->SetUInt32Value( UNIT_VIRTUAL_ITEM_INFO , 218171138); - m_creature->SetUInt32Value( UNIT_VIRTUAL_ITEM_INFO + 1, 3); + + SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_NO_CHANGE, EQUIP_NO_CHANGE); + m_creature->SetDisplayId(11686); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID,11686); Invisible = true; Invisible_Timer = 15000 + rand()%15000; @@ -97,11 +99,10 @@ struct TRINITY_DLL_DECL boss_renatakiAI : public ScriptedAI if (Visible_Timer < diff) { m_creature->InterruptSpell(CURRENT_GENERIC_SPELL); - m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID,15268); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetUInt32Value( UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, 31818); - m_creature->SetUInt32Value( UNIT_VIRTUAL_ITEM_INFO , 218171138); - m_creature->SetUInt32Value( UNIT_VIRTUAL_ITEM_INFO + 1, 3); + + m_creature->SetDisplayId(15268); + SetEquipmentSlots(false, EQUIP_ID_MAIN_HAND, EQUIP_NO_CHANGE, EQUIP_NO_CHANGE); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); Invisible = false; diff --git a/src/bindings/scripts/scripts/zone/zulgurub/boss_thekal.cpp b/src/bindings/scripts/scripts/zone/zulgurub/boss_thekal.cpp index 6fbdebc40d5..23fe5901be9 100644 --- a/src/bindings/scripts/scripts/zone/zulgurub/boss_thekal.cpp +++ b/src/bindings/scripts/scripts/zone/zulgurub/boss_thekal.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -54,7 +54,7 @@ struct TRINITY_DLL_DECL boss_thekalAI : public ScriptedAI { boss_thekalAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } uint32 MortalCleave_Timer; @@ -92,7 +92,7 @@ struct TRINITY_DLL_DECL boss_thekalAI : public ScriptedAI pInstance->SetData(DATA_THEKAL_ALIVE, 0); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { DoScriptText(SAY_AGGRO, m_creature); } @@ -159,7 +159,7 @@ struct TRINITY_DLL_DECL boss_thekalAI : public ScriptedAI if (!PhaseTwo && !WasDead && m_creature->GetHealth() <= m_creature->GetMaxHealth() * 0.05) { m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 3); + m_creature->SetStandState(UNIT_STAND_STATE_SLEEP); m_creature->AttackStop(); if(pInstance) @@ -175,7 +175,7 @@ struct TRINITY_DLL_DECL boss_thekalAI : public ScriptedAI { DoCast(m_creature,SPELL_TIGER_FORM); m_creature->SetFloatValue(OBJECT_FIELD_SCALE_X, 2.00f); - m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); + m_creature->SetStandState(UNIT_STAND_STATE_STAND); m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); m_creature->SetHealth(int(m_creature->GetMaxHealth()*1.0)); const CreatureInfo *cinfo = m_creature->GetCreatureInfo(); @@ -241,7 +241,7 @@ struct TRINITY_DLL_DECL mob_zealot_lorkhanAI : public ScriptedAI { mob_zealot_lorkhanAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } uint32 Shield_Timer; @@ -271,7 +271,7 @@ struct TRINITY_DLL_DECL mob_zealot_lorkhanAI : public ScriptedAI m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } @@ -366,7 +366,7 @@ struct TRINITY_DLL_DECL mob_zealot_lorkhanAI : public ScriptedAI if (m_creature->GetHealth() <= m_creature->GetMaxHealth() * 0.05) { m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 3); + m_creature->SetStandState(UNIT_STAND_STATE_SLEEP); m_creature->setFaction(35); m_creature->AttackStop(); @@ -385,7 +385,7 @@ struct TRINITY_DLL_DECL mob_zealot_zathAI : public ScriptedAI { mob_zealot_zathAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } uint32 SweepingStrikes_Timer; @@ -413,11 +413,11 @@ struct TRINITY_DLL_DECL mob_zealot_zathAI : public ScriptedAI if(pInstance) pInstance->SetData(DATA_ZATH_ALIVE, 0); - m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); + m_creature->SetStandState(UNIT_STAND_STATE_STAND); m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } @@ -503,7 +503,7 @@ struct TRINITY_DLL_DECL mob_zealot_zathAI : public ScriptedAI if (m_creature->GetHealth() <= m_creature->GetMaxHealth() * 0.05) { m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 3); + m_creature->SetStandState(UNIT_STAND_STATE_SLEEP); m_creature->setFaction(35); m_creature->AttackStop(); diff --git a/src/bindings/scripts/scripts/zone/zulgurub/boss_venoxis.cpp b/src/bindings/scripts/scripts/zone/zulgurub/boss_venoxis.cpp index 5bed9f80ddd..7c72b6f79c0 100644 --- a/src/bindings/scripts/scripts/zone/zulgurub/boss_venoxis.cpp +++ b/src/bindings/scripts/scripts/zone/zulgurub/boss_venoxis.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -41,7 +41,7 @@ struct TRINITY_DLL_DECL boss_venoxisAI : public ScriptedAI { boss_venoxisAI(Creature *c) : ScriptedAI(c) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); + pInstance = (c->GetInstanceData()); } ScriptedInstance *pInstance; @@ -73,7 +73,7 @@ struct TRINITY_DLL_DECL boss_venoxisAI : public ScriptedAI InBerserk= false; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } diff --git a/src/bindings/scripts/scripts/zone/zulgurub/boss_wushoolay.cpp b/src/bindings/scripts/scripts/zone/zulgurub/boss_wushoolay.cpp index c69e2c6204e..9c6aab1a0e4 100644 --- a/src/bindings/scripts/scripts/zone/zulgurub/boss_wushoolay.cpp +++ b/src/bindings/scripts/scripts/zone/zulgurub/boss_wushoolay.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 @@ -40,7 +40,7 @@ struct TRINITY_DLL_DECL boss_wushoolayAI : public ScriptedAI LightningWave_Timer = 8000 + rand()%8000; } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { } diff --git a/src/bindings/scripts/scripts/zone/zulgurub/def_zulgurub.h b/src/bindings/scripts/scripts/zone/zulgurub/def_zulgurub.h index fd1c905048e..f14bd8eca98 100644 --- a/src/bindings/scripts/scripts/zone/zulgurub/def_zulgurub.h +++ b/src/bindings/scripts/scripts/zone/zulgurub/def_zulgurub.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * This program is free software licensed under GPL version 2 * Please see the included DOCS/LICENSE.TXT for more information */ diff --git a/src/bindings/scripts/scripts/zone/zulgurub/instance_zulgurub.cpp b/src/bindings/scripts/scripts/zone/zulgurub/instance_zulgurub.cpp index a49ff110b2d..eb3cbd1d495 100644 --- a/src/bindings/scripts/scripts/zone/zulgurub/instance_zulgurub.cpp +++ b/src/bindings/scripts/scripts/zone/zulgurub/instance_zulgurub.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.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 diff --git a/src/bindings/scripts/sql/WotLK/npc_taxi.sql b/src/bindings/scripts/sql/WotLK/npc_taxi.sql new file mode 100644 index 00000000000..b93f5dfdfca --- /dev/null +++ b/src/bindings/scripts/sql/WotLK/npc_taxi.sql @@ -0,0 +1,10 @@ +#Taxi in Archerus +UPDATE `creature_template` SET `ScriptName`='npc_acherus_taxi' WHERE `entry`='28864'; + +#Stormwind Harbor +UPDATE `creature_template` SET `ScriptName`='npc_stormwindharbor_taxi' WHERE `entry`='29154'; + +#Taxis to the 3 parts of the Wyrmresttempel +UPDATE `creature_template` SET `ScriptName`='npc_wyrmresttempelbottom_taxi' WHERE `entry`='26443'; +UPDATE `creature_template` SET `ScriptName`='npc_wyrmresttempelmiddle_taxi' WHERE `entry`='27575'; +UPDATE `creature_template` SET `ScriptName`='npc_wyrmresttempeltop_taxi' WHERE `entry`='26949'; diff --git a/src/bindings/scripts/sql/WotLK/script_texts_wotlk.sql b/src/bindings/scripts/sql/WotLK/script_texts_wotlk.sql new file mode 100644 index 00000000000..de3de7b9464 --- /dev/null +++ b/src/bindings/scripts/sql/WotLK/script_texts_wotlk.sql @@ -0,0 +1,530 @@ +-- -1 574 000 UTGARDE KEEP +INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES +-- Prince Keleseth + (-1574000, 'Your blood is mine!',13221,1,0,'keleseth SAY_AGGRO'), + (-1574001, 'Darkness waits',13223,1,0, 'keleseth SAY_KILL'), + (-1574002, 'I join... the night.',13225,1,0, 'keleseth SAY_DEATH'), + (-1574003, 'Not so fast.',13222,1,0, 'keleseth SAY_FROST_TOMB'), + (-1574004, 'Aranal, lidel! Their fate shall be yours!',13224,1,0, 'keleseth SAY_SKELETONS'), +-- Dalronn the Controller + (-1574005, 'By all means, don\'t assess the situation, you halfwit! Just jump into the fray!',13199, 1,0,'dalronn SAY_AGGRO'), + (-1574006, 'You may serve me yet.',13202, 1,0,'dalronn SAY_KILL'), + (-1574007, 'See... you... soon.',13200, 1,0,'dalronn SAY_DEATH_1'), + (-1574008, 'There\'s no... greater... glory.',13201, 1,0,'dalronn SAY_DEATH_2'), + (-1574009, 'Skarvald, you incompetent slug! Return and make yourself useful!',13203,1,0, 'dalronn SAY_RAISES'), +-- Skarvald the Constructor + (-1574010, 'Dalronn! See if you can muster the nerve to join my attack!',13229, 1,0,'skarvald SAY_AGGRO'), + (-1574011, '...',13232,1,0, 'skarvald SAY_KILL'), + (-1574012, 'Not... over... yet.',13230,1,0, 'skarvald SAY_DEATH_1'), + (-1574013, 'A warrior\'s death.',13231,1,0, 'skarvald SAY_DEATH_2'), + (-1574014, 'Pagh! What sort of necromancer lets death stop him? I knew you were worthless!',13233,1,0, 'skarvald SAY_RAISES'), +-- Ingvar the Plunderer + (-1574015, 'I\'ll paint my face with your blood!',13207,1,0, 'ingvar SAY_AGGRO'), + (-1574016, 'I am a warrior born!',13214,1,0, 'ingvar SAY_KILL'), + (-1574017, 'My life for the... death god!',13213,1,0, 'ingvar SAY_DEATH'), + (-1574018, 'Fight on or face me!',13208,1,0, 'ingvar SAY_ATTACK_1'), + (-1574019, '...',13240, 1,0,'ingvar SAY_ATTACK_2'), + (-1574020, 'Slay them all, no excuses, no mercy, no rest!',13241,1,0, 'ingvar SAY_ATTACK_3'), + (-1574021, '... of destruction silence every ...!',13242,1,0, 'ingvar SAY_ATTACK_4'), + (-1574022, 'I return! A second chance to carve out your skull!',13208,1,0, 'ingvar SAY_PHASE2_AGGRO'), + (-1574023, 'Mjul orm agn gjor!',13212, 1,0,'ingvar SAY_PHASE2_KILL'), + (-1574024, 'No! I can do... better! I can...',13211,1,0, 'ingvar SAY_PHASE2_DEATH'), +-- Said by Annhylde the Caller when resurecting Ingvar + (-1574025, 'Ingvar! Your pathetic failure will serve as a warning to all... you are damned! Arise and carry out the master\'s will!',13754, 1,0,'ingvar SAY_ANNHYLDE_THE_CALLER_RESURECTION'); + +-- -1 575 000 UTGARDE PINNACLE +INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES +-- Gortok Palehoof + (-1575000, 'What this place? I will destroy you!',13464,1,0, 'palehoof SAY_AGGRO'), + (-1575001, 'You die! That what master wants!',13465,1,0, 'palehoof SAY_SLAY_1'), + (-1575002, 'An easy task!',13466,1,0, 'palehoof SAY_SLAY_2'), + (-1575003, '...',13467,1,0, 'palehoof SAY_DEATH'), +-- Skadi the Ruthless + (-1575004, 'What mongrels dare intrude here? Look alive, my brothers! A feast for the one that brings me their heads!',13497,1,0, 'skadi SAY_AGGRO'), + (-1575005, 'Mjor Na Ul Kaval!',13503,1,0, 'skadi SAY_KILL_1'), + (-1575006, 'Not so brash now, are you?',13504,1,0, 'skadi SAY_KILL_2'), + (-1575007, 'I\'ll mount your skull from the highest tower!',13505,1,0, 'skadi SAY_KILL_3'), + (-1575008, 'ARGH! You call that... an attack? I\'ll... show... aghhhh...',13506,1,0, 'skadi SAY_DEATH'), + (-1575009, 'You motherless knaves! Your corpses will make fine morsels for my new drake!',13507,1,0, 'skadi SAY_DRAKE_DEATH'), + (-1575010, 'I ask for ... to kill them, yet all I get is feeble whelps! By Ye.. SLAUGHTER THEM!',13501,1,0, 'skadi SAY_DRAKE_HIT_1'), + (-1575011, 'If one more harpoon touches my drake I\'ll flae my miserable heins.',13502,1,0, 'skadi SAY_DRAKE_HIT_2'), + (-1575012, 'Sear them to the bone!',13498,1,0, 'skadi SAY_DRAKE_BREATH_1'), + (-1575013, 'Go now! Leave nothing but ash in your wake!',13499,1,0, 'skadi SAY_DRAKE_BREATH_2'), + (-1575014, 'Cleanse our sacred halls with flame!',13500,1,0, 'skadi SAY_DRAKE_BREATH_3'), +-- Svala Sorrowgrave + (-1575015, 'I will vanquish your soul!',13842,1,0, 'svala SAY_AGGRO'), + (-1575016, 'You were a fool to challenge the power of the Lich King!',13845, 1,0,'svala SAY_SLAY_1'), + (-1575017, 'Your will is done, my king.',13847,1,0, 'svala SAY_SLAY_2'), + (-1575018, 'Another soul for my master.',13848, 1,0,'svala SAY_SLAY_3'), + (-1575019, 'Nooo! I did not come this far... to...',13855,1,0, 'svala SAY_DEATH'), + (-1575020, 'Your death approaches.',13850,1,0, 'svala SAY_SACRIFICE_PLAYER_1'), + (-1575021, 'Go now to my master.',13851,1,0, 'svala SAY_SACRIFICE_PLAYER_2'), + (-1575022, 'Your end is inevitable.',13852,1,0, 'svala SAY_SACRIFICE_PLAYER_3'), + (-1575023, '...',13853,1,0, 'svala SAY_SACRIFICE_PLAYER_4'), + (-1575024, 'Any last words?',13854,1,0, 'svala SAY_SACRIFICE_PLAYER_5'), + (-1575025, 'My liege! I have done as you asked, and now beseech you for your blessing!',13856,1,0, 'svala SAY_SAY_DIALOG_WITH_ARTHAS_1'), + (-1575026, 'The sensation is... beyond my imagining. I am yours to command, my king.',13857,1,0, 'svala SAY_SAY_DIALOG_WITH_ARTHAS_2'), + (-1575027, 'I will be happy to slaughter them in your name! Come, enemies of the Scourge! I will show you the might of the Lich King!',13858,1,0, 'svala SAY_SAY_DIALOG_WITH_ARTHAS_3'), +-- King Ymiron + (-1575028, 'You invade my home and then dare to challenge me? I will tear the hearts from your chests and offer them as gifts to the death god! Rualg nja gaborr!',13609, 1,0,'ymiron SAY_AGGRO'), + (-1575029, 'Your death is only the beginning!',13614,1,0, 'ymiron SAY_SLAY_1'), + (-1575030, 'You have failed your people!',13615, 1,0,'ymiron SAY_SLAY_2'), + (-1575031, 'There is a reason I am king!',13616, 1,0,'ymiron SAY_SLAY_3'), + (-1575032, 'Bleed no more!',13617, 1,0,'ymiron SAY_SLAY_4'), + (-1575033, 'What... awaits me... now?',13618,1,0, 'ymiron SAY_DEATH'), + (-1575034, 'Bjorn of the Black Storm! Honor me now with your presence!',13610,1,0, 'ymiron SAY_SUMMON_BJORN'), + (-1575035, 'Haldor of the rocky cliffs, grant me your strength!',13611, 1,0,'ymiron SAY_SUMMON_HALDOR'), + (-1575036, 'Ranulf of the screaming abyss, snuff these maggots with darkest night!',13612,1,0, 'ymiron SAY_SUMMON_RANULF'), + (-1575037, 'Tor of the Brutal Siege! Bestow your might upon me!',13613,1,0, 'ymiron SAY_SUMMON_TORGYN'); + +-- -1 576 000 NEXUS +INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES +-- Anomalus + (-1576000, 'Chaos beckons.',13186,1,0,'anomalus SAY_AGGRO'), + (-1576001, 'Expiration... is necessary...',13274,1,0,'anomalus SAY_KILL'), + (-1576002, 'Of course.',13187,1,0,'anomalus SAY_DEATH'), + (-1576003, 'Reality... unwoven.',13188,1,0,'anomalus SAY_RIFT'), + (-1576004, 'Indestructible.',13189,1,0,'anomalus SAY_SHIELD'), +-- Keristrasza + (-1576005, 'Preserve? Why? There\'s no truth in it. No no no... only in the taking! I see that now!',13450,1,0,'keristrasza SAY_AGGRO'), + (-1576006, 'Now we\'ve come to the truth! ',13453,1,0,'keristrasza SAY_SLAY'), + (-1576007, 'Finish it! Finish it! Kill me, or I swear by the Dragonqueen you\'ll never see daylight again!',13452,1,0,'keristrasza SAY_ENRAGE'), + (-1576008, 'Dragonqueen... Life-Binder... preserve... me.',13454,1,0,'keristrasza SAY_DEATH'), + (-1576009, 'Stay. Enjoy your final moments.',13451,1,0,'keristrasza SAY_CRYSTAL_NOVA'), +-- Grand Magus Telestra + (-1576010, 'You know what they say about curiosity.',13319,1,0,'magus_telestra SAY_AGGRO'), + (-1576011, 'Death becomes you!',13324,1,0,'magus_telestra SAY_KILL'), + (-1576012, 'Damn the... luck.',13320,1,0,'magus_telestra SAY_DEATH'), + (-1576013, 'Now to finish the job!',13323,1,0,'magus_telestra SAY_MERGE'), + (-1576014, 'There\'s plenty of me to go around.',13321,1,0,'magus_telestra SAY_SPLIT_1'), + (-1576015, 'I\'ll give you more than you can handle.',13322,1,0,'magus_telestra SAY_SPLIT_2'), +-- Ormorok + (-1576016, 'Noo!',13328,1,0,'ormorok SAY_AGGRO'), + (-1576017, 'Aargh Kill!',13329,1,0,'ormorok SAY_KILL'), + (-1576018, 'Aaggh!',13330,1,0,'ormorok SAY_DEATH'), + (-1576019, 'Back!',13331,1,0,'ormorok SAY_REFLECT'), + (-1576020, 'Bleed!',13332,1,0,'ormorok SAY_ICE_SPIKES'), +-- Commander Stoutbeard + (-1576021, 'What? Where in a..? Don\'t just stand around lads KILL SOMEBODY!',13193,1,0,'commander_stoutbeard SAY_AGGRO'), + (-1576022, 'Now we\re getting someplace!',13195,1,0,'commander_stoutbeard SAY_KILL'), + (-1576023, 'Is that all you\'ve... got?',13194,1,0,'commander_stoutbeard SAY_DEATH'), +-- Commander Kolurg + (-1576024, 'What is this? Mag thorin Kar! Kill them!',13458,1,0,'commander_kolurg SAY_AGGRO'), + (-1576025, 'Our task is not yet done!',13459,1,0,'commander_kolurg SAY_KILL'), + (-1576026, 'GOOO!',13460,1,0,'commander_kolurg SAY_DEATH'); + +-- -1 578 000 OCULUS +INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES +-- Drakos the Interrogator + (-1578000, 'The prisoners shall not go free. The word of Malygos is law!',13594,1,0, 'drakos SAY_AGGRO'), + (-1578001, 'A fitting punishment!',13602, 1,0,'drakos SAY_KILL_1'), + (-1578002, 'Sentence: executed!',13603,1,0, 'drakos SAY_KILL_2'), + (-1578003, 'Another casualty of war!',13604, 1,0,'drakos SAY_KILL_3'), + (-1578004, 'The war... goes on.',13605,1,0, 'drakos SPELL_DEATH'), + (-1578005, 'It is too late to run!',13598, 1,0,'drakos SAY_PULL_1'), + (-1578006, 'Gather \'round! ',13599, 1,0,'drakos SAY_PULL_2'), + (-1578007, 'None shall escape!',13600, 1,0,'drakos SAY_PULL_3'), + (-1578008, 'I condemn you to death!',13601,1,0, 'drakos SAY_PULL_4'), + (-1578009, 'Tremble, worms!',13595,1,0, 'drakos SAY_STOMP_1'), + (-1578010, 'I will crush you!',13596, 1,0,'drakos SAY_STOMP_2'), + (-1578011, 'Can you fly?',13597, 1,0,'drakos SAY_STOMP_3'), +-- Mage-Lord Urom + (-1578012, 'Poor blind fools!',13638,1,0, 'urom SAY_AGGRO'), + (-1578013, 'If only you understood!',13641,1,0, 'urom SAY_KILL_1'), + (-1578014, 'Now, do you see? DO YOU?!',13642,1,0, 'urom SAY_KILL_2'), + (-1578015, 'Unfortunate, but necessary.',13643,1,0, 'urom SAY_KILL_3'), + (-1578016, 'Everything I\'ve done... has been for Azeroth...',13644,1,0, 'urom SAY_DEATH'), + (-1578017, 'A taste... just a small taste... of the Spell-Weaver\'s power!',13639,1,0, 'urom SAY_EXPLOSION_1'), + (-1578018, 'So much unstable energy... but worth the risk to destroy you!',13640,1,0, 'urom SAY_EXPLOSION_2'), + (-1578019, 'What do we have here... those would defy the Spell-Weaver? Those without foresight or understanding. How could I make you see? Malygos is saving the world from itself! Bah! You are hardly worth my time!',13635,1,0, 'urom SAY_SUMMON_1'), + (-1578020, 'Clearly my pets failed. Perhaps another demonstration is in order.',13636,1,0, 'urom SAY_SUMMON_2'), + (-1578021, 'Still you fight. Still you cling to misguided principles. If you survive, you\'ll find me in the center ring.',13637,1,0, 'urom SAY_SUMMON_3'), +-- Varos Cloudstrider + (-1578022, 'There will be no mercy!',13649,1,0, 'varos SAY_AGGRO'), + (-1578023, 'You were warned.',13653,1,0, 'varos SAY_KILL_1'), + (-1578024, 'The Oculus is ours.',13654,1,0, 'varos SAY_KILL_2'), + (-1578025, 'They are... too strong! Underestimated their... fortitude.',13655,1,0, 'varos SAY_DEATH'), + (-1578026, 'Blast them! Destroy them!',13650,1,0, 'varos SAY_STRIKE_1'), + (-1578027, 'Take no prisoners! Attack!',13651,1,0, 'varos SAY_STRIKE_2'), + (-1578028, 'Strike now! Obliterate them!',13652,1,0, 'varos SAY_STRIKE_3'), +-- Varos says when Drakos dies + (-1578029, 'Intruders, your victory will be short-lived. I am Commander Varos Cloudstrider. My drakes control the skies and protest this conduit. I will see to it personally that the Oculus does not fall into your hands!',13648,1,0, 'varos SAY_SPAWN'); + +-- -1 595 000 CULLING OF STRATHOLME +INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES +-- Epoch + (-1595000, 'We\'ll see about that, young prince.',13409,1,0, 'epoch SAY_AGGRO'), + (-1595001, 'Tick tock, tick tock...',13410, 1,0,'epoch SAY_TIME_WARP_1'), + (-1595002, 'Not quick enough!',13411,1,0, 'epoch SAY_TIME_WARP_2'), + (-1595003, 'Let\'s get this over with. ',13412, 1,0,'epoch SAY_TIME_WARP_3'), + (-1595004, 'There is no future for you.',13413,1,0, 'epoch SAY_SLAY_1'), + (-1595005, 'This is the hour of our greatest triumph!',13414,1,0, 'epoch SAY_SLAY_2'), + (-1595006, 'You would destined to fail. ',13415,1,0, 'epoch SAY_SLAY_3'), + (-1595007, 'Prince Arthas Menethil, on this day, a powerful darkness has taken hold of your soul. The death you are destined to visit upon others will this day be your own.',13408,1,0, 'epoch SAY_INTRO'), + (-1595008, '*gurgles*',13416,1,0, 'epoch SAY_DEATH'), +-- Mal'ganis + (-1595009, 'Yes...this is the beginning...I\'ve been waiting for you...young prince...I...am Mal\'Ganis..', 14410,1,0, 'mal_ganis SAY_INTRO_1'), + (-1595010, 'As you can see, your people...are now mine. I will now turn this city, household by household, until the flame of life has been snuffed out...forever...', 14411,1,0, 'mal_ganis SAY_INTRO_2'), + (-1595011, 'This will be a fine test...Prince Arthas...', 14413,1,0, 'mal_ganis SAY_AGGRO'), + (-1595012, 'All too easy...', 14416,1,0, 'mal_ganis SAY_KILL_1'), + (-1595013, 'The dark lord is displeased with your interference...', 14417, 1,0,'mal_ganis SAY_KILL_2'), + (-1595014, 'It is Prince Arthas I want...not you...', 14418,1,0, 'mal_ganis SAY_KILL_3'), + (-1595015, 'Anak\'Keri...', 14422, 1,0,'mal_ganis SAY_SLAY_1'), + (-1595016, 'My onslaught will wash over the Lich King\'s forces...', 14423,1,0, 'mal_ganis SAY_SLAY_2'), + (-1595017, 'Your death is in vain, tiny mortal...', 14424, 1,0,'mal_ganis SAY_SLAY_3'), + (-1595018, 'Your time has come to an end! ', 14425,1,0, 'mal_ganis SAY_SLAY_4'), + (-1595019, 'Time out...', 14414, 1,0,'mal_ganis SAY_SLEEP_1'), + (-1595020, 'You seem...tired... ', 14415,1,0, 'mal_ganis SAY_SLEEP_2'), + (-1595021, '*Struggling sounds* I spent too much time in that weak little shell... ', 14426,1,0, 'mal_ganis SAY_30HEALTH'), + (-1595022, '(Eredun) I AM MAL\'GANIS! I AM ETERNAL! ', 14427,1,0, 'mal_ganis SAY_15HEALTH'), + (-1595023, 'ENOUGH! I waste my time here...I must gather my strength on the home world...', 14428,1,0, 'mal_ganis SAY_ESCAPE_SPEECH_1'), + (-1595024, 'You\'ll never defeat the Lich King without my forces! I\'ll have my revenge...on him, AND you... ', 14429,1,0, 'mal_ganis SAY_ESCAPE_SPEECH_2'), + (-1595025, 'Your journey has just begun, young prince...Gather your forces, and meet me in the arctic land of Northrend...It is there we shall settle the score between us...It is there that your true destiny will unfold...', 14412,1,0, 'mal_ganis SAY_OUTRO'), +-- Meathook + (-1595026, 'New toys!',13429,1,0, 'meathook SAY_AGGRO'), + (-1595027, 'Boring...',13430,1,0, 'meathook SAY_SLAY_1'), + (-1595028, 'Why you stop moving?',13431,1,0, 'meathook SAY_SLAY_2'), + (-1595029, 'Get up! Me not done! ',13432,1,0, 'meathook SAY_SLAY_3'), + (-1595030, 'Play time! ',13428,1,0, 'meathook SAY_SPAWN'), + (-1595031, 'This not fun...',13433,1,0, 'meathook SAY_DEATH'), +-- Salramm the Fleshcrafter + (-1595032, 'Ah, the entertainment has arrived!',13472,1,0, 'salramm SAY_AGGRO'), + (-1595033, 'You are too late, champion of Lordaeron. The dead shall have their day. ',13471,1,0, 'salramm SAY_SPAWN'), + (-1595034, 'The fun is just beginning!',13473,1,0, 'salramm SAY_SLAY_1'), + (-1595035, 'Aah, quality materials!',13474, 1,0,'salramm SAY_SLAY_2'), + (-1595036, 'Don\'t worry, I\'ll make good use of you. ',137475, 1,0,'salramm SAY_SLAY_3'), + (-1595037, 'You only advance... the master\'s plan...',13483,1,0, 'salramm SAY_DEATH'), + (-1595038, 'BOOM! Hahahahah...',13478, 1,0,'salramm SAY_EXPLODE_GHOUL_1'), + (-1595039, 'Blood... destruction... EXHILARATING! ',13479,1,0, 'salramm SAY_EXPLODE_GHOUL_2'), + (-1595040, 'I want a sample...',13480,1,0, 'salramm SAY_STEAL_FLESH_1'), + (-1595041, 'Such strength... it must be mine!',13481,1,0, 'salramm SAY_STEAL_FLESH_2'), + (-1595042, 'Your flesh betrays you.',13482,1,0, 'salramm SAY_STEAL_FLESH_3'), + (-1595043, 'Say hello to some friends of mine.',13476,1,0, 'salramm SAY_SUMMON_GHOULS_1'), + (-1595044, 'Come, citizen of Stratholme! Meet your saviors.',13477,1,0, 'salramm SAY_SUMMON_GHOULS_2'); + +-- -1 599 000 HALLS OF STONE +INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES +-- Krystallus + (-1599000, 'Crush....', 14176, 1,0,'krystallus SAY_AGGRO'), + (-1599001, 'Ha...ha...ha...ha...', 14177,1,0, 'krystallus SAY_KILL'), + (-1599002, 'Uuuuhhhhhhhhhh......', 14179,1,0, 'krystallus SAY_DEATH'), + (-1599003, 'Break.... you....', 14178,1,0, 'krystallus SAY_SHATTER'), +-- Maiden of Grief + (-1599004, 'You shouldn\'t have come...now you will die!',13487,1,0, 'maiden_of_grief SAY_AGGRO'), + (-1599005, 'Why must it be this way?',13488,1,0, 'maiden_of_grief SAY_SLAY_1'), + (-1599006, 'You had it coming!',13489, 1,0,'maiden_of_grief SAY_SLAY_2'), + (-1599007, 'My burden grows heavier.',13490,1,0, 'maiden_of_grief SAY_SLAY_3'), + (-1599008, 'This is your own fault!',13491,1,0, 'maiden_of_grief SAY_SLAY_4'), + (-1599009, 'I hope you all rot! I never...wanted...this.',13493, 1,0,'maiden_of_grief SAY_DEATH'), + (-1599010, 'So much lost time... that you\'ll never get back!',13492,1,0, 'maiden_of_grief SAY_STUN'), +-- Sjonnir + (-1599011, 'Soft, vulnerable shells. Brief, fragile lives. You can not escape the curse of flesh!', 14180,1,0, 'sjonnir SAY_AGGRO'), + (-1599012, '...', 14181,1,0, 'sjonnir SAY_SLAY_1'), + (-1599013, 'Flesh is no match for iron!', 14182, 1,0,'sjonnir SAY_SLAY_2'), + (-1599014, 'Armies of iron will smother the world!', 14183, 1,0,'sjonnir SAY_SLAY_3'), + (-1599015, 'Loken will not rest, until the forge is retaken. You changed nothing!', 14184,1,0, 'sjonnir SAY_DEATH'); + +-- -1 600 000 DRAK'THARON KEEP +INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES +-- Novos the Summoner + (-1600000, 'The chill you feel is the herald of your doom.', 13173, 1,0, 'novos SAY_AGGRO'), + (-1600001, 'Such is the faith of all who oppose the Lich King!', 13175, 1,0, 'novos SAY_KILL'), + (-1600002, 'Your efforts... are in vain.', 13174, 1,0, 'novos SAY_DEATH'), + (-1600003, 'Surely you can see the futility of it all!', 13177, 1,0, 'novos SAY_REBUBLE_1'), + (-1600004, 'Just give up and die already!', 13178, 1,0, 'novos SAY_REBUBLE_2'), + (-1600005, 'Bolster my defenses! Hurry, curse you!', 13176, 1,0, 'novos SAY_NECRO_ADD'), +-- Trollgore + (-1600006, 'Mogas moblath moghuld!', 13181, 1,0, 'trollgore SAY_AGGRO'), + (-1600007, '... I will eat you!', 13185, 1,0, 'trollgore SAY_KILL'), + (-1600008, '... .. so hungry, .. ... must\'t feed.', 13182, 1,0, 'trollgore SAY_CONSUME'), + (-1600009, '*laugh* Corpse go boom!', 13184, 1,0, 'trollgore SAY_EXPLODE'), + (-1600010, '...', 13183, 1,0, 'trollgore SAY_DEATH'), +-- The Prophet Tharon'ja + (-1600011, 'Tharon\'ja sees all! The work of mortals shall not end the eternal dynasty!', 13862, 1, 0, 'tharon_ja SAY_AGGRO'), + (-1600012, 'As Tharon\'ja predicted.', 13863, 1, 0, 'tharon_ja SAY_KILL_1'), + (-1600013, 'As it was written.', 13863, 1, 0, 'tharon_ja SAY_KILL_2'), + (-1600014, 'Your flesh serves Tharon\'ja now!', 13865, 1, 0, 'tharon_ja SAY_FLESH_1'), + (-1600015, 'Tharon\'ja has a use for your mortal shell!', 13866, 1, 0, 'tharon_ja SAY_FLESH_2'), + (-1600016, 'No! A taste... all too brief!', 13868, 1, 0, 'tharon_ja SAY_SKELETON_1'), + (-1600017, 'Tharon\'ja will have more!', 13868, 1, 0, 'tharon_ja SAY_SKELETON_2'), + (-1600018, 'Im... impossible! Tharon\'ja is eternal! Tharon\'ja... is...', 13869, 1, 0, 'tharon_ja SAY_DEATH'); + +-- -1 601 000 AZJOL-NERUB +INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES +-- Anub'arak + (-1601000, 'Eternal agony awaits you!', 14054,1,0, 'anub_arak SAY_AGGRO'), + (-1601001, 'You shall experience my torment, first-hand!', 14055,1,0, 'anub_arak SAY_SLAY_1'), + (-1601002, 'You have made your choice.', 14056,1,0, 'anub_arak SAY_SLAY_2'), + (-1601003, 'Soon, the Master\'s voice will call to you.', 14057,1,0, 'anub_arak SAY_SLAY_3'), + (-1601004, 'Ahhh... RAAAAAGH! Never thought... I would be free of him...', 14069,1,0, 'anub_arak SAY_DEATH'), + (-1601005, 'Your armor is useless against my locusts!', 14060, 1,0,'anub_arak SAY_LOCUST_1'), + (-1601006, '?!!??!!!', 14067,1,0, 'anub_arak SAY_LOCUST_2'), + (-1601007, 'The pestilence upon you!', 14068,1,0, 'anub_arak SAY_LOCUST_3'), + (-1601008, '!!!???!!!', 14058,1,0, 'anub_arak SAY_SUBMERGE_1'), + (-1601009, 'Come forth, my brethren. Feast on their flesh!', 14059,1,0, 'anub_arak SAY_SUBMERGE_2'), + (-1601010, 'I was king of this empire once, long ago. In life I stood as champion. In death I returned as conqueror. Now I protect the kingdom once more. Ironic, yes?', 14053, 1,0,'anub_arak SAY_INTRO'), +-- Krik'thir + (-1601011, 'This kingdom belongs to the Scourge! Only the dead may enter.', 14075,1,0, 'krik_thir SAY_AGGRO'), + (-1601012, 'Hash\'tak hi\'tak.', 14076,1,0, 'krik_thir SAY_SLAY_1'), + (-1601013, 'You were foolish to come.', 14077, 1,0,'krik_thir SAY_SLAY_2'), + (-1601014, 'As Anub\'Arak commands!', 14078,1,0, 'krik_thir SAY_SLAY_3'), + (-1601015, 'I should be grateful. But I long ago lost the capacity.', 14087,1,0, 'krik_thir SAY_DEATH'), + (-1601016, 'They hunger.', 14085,1,0, 'krik_thir SAY_SWARM_1'), + (-1601017, 'Dinner time, my pets.', 14086,1,0, 'krik_thir SAY_SWARM_2'), + (-1601018, 'We are besieged. Strike out and bring back their corpses!', 14079,1,0, 'krik_thir SAY_SEND_GROUP_1'), + (-1601019, 'We must hold the gate. Attack! Tear them limb from limb!', 14080,1,0, 'krik_thir SAY_SEND_GROUP_2'), + (-1601020, 'The gate must be protected at all costs. Rip them to shreds!', 14081,1,0, 'krik_thir SAY_SEND_GROUP_3'), + (-1601021, 'Keep an eye on the tunnel. We must not let anyone through!', 14082,1,0, 'krik_thir SAY_PREFIGHT_1'), + (-1601022, 'I hear footsteps. Be on your guard.', 14083,1,0, 'krik_thir SAY_PREFIGHT_2'), + (-1601023, 'I sense the living. Be ready.', 14084,1,0, 'krik_thir SAY_PREFIGHT_3'); + +-- -1 602 000 HALLS OF LIGHTNING +INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES +-- General Bjarngrim + (-1602000, 'I am the greatest of my father\'s sons! Your end has come!', 14149,1,0,'bjarngrim SAY_AGGRO'), + (-1602001, 'So ends your curse!', 14153,1,0, 'bjarngrim SAY_SLAY_1'), + (-1602002, 'Flesh... is... weak!', 14154,1,0, 'bjarngrim SAY_SLAY_2'), + (-1602003, '...', 14155,1,0, 'bjarngrim SAY_SLAY_3'), + (-1602004, 'How can it be...? Flesh is not... stronger!', 14156,1,0, 'bjarngrim SAY_DEATH'), + (-1602005, 'Defend yourself, for all the good it will do!', 14151,1,0, 'bjarngrim SAY_BATTLE_STANCE'), + (-1602006, 'GRAAAAAH! Behold the fury of iron and steel!', 14152,1,0, 'bjarngrim SAY_BERSEKER_STANCE'), + (-1602007, 'Give me your worst!', 14150,1,0, 'bjarngrim SAY_DEFENSIVE_STANCE'), +-- Ionar + (-1602008, 'You wish to confront the master? You must weather the storm!', 14453,1,0, 'ionar SAY_AGGRO'), + (-1602009, 'Shocking ... I know!', 14456,1,0, 'ionar SAY_SLAY_1'), + (-1602010, 'You atempt the unpossible.', 14457,1,0, 'ionar SAY_SLAY_2'), + (-1602011, 'Your spark of light is ... extinguish.', 14458,1,0, 'ionar SAY_SLAY_3'), + (-1602012, 'Master... you have guests.', 14459,1,0, 'ionar SAY_DEATH'), + (-1602013, 'The slightest spark shall be your undoing.', 14454,1,0, 'ionar SAY_SPLIT_1'), + (-1602014, 'No one is safe!', 14455,1,0, 'ionar SAY_SPLIT_2'), +-- Loken + (-1602015, 'What hope is there for you? None!', 14162,1,0, 'loken SAY_AGGRO0'), + (-1602016, 'I have witnessed the rise and fall of empires. The birth and extinction of entire species. Over countless millennia the foolishness of mortals has remained beyond a constant. Your presence here confirms this.', 14160,1,0, 'loken SAY_INTRO_1'), + (-1602017, 'My master has shown me the future, and you have no place in it. Azeroth will be reborn in darkness. Yogg-Saron shall be released! The Pantheon shall fall!', 14162,1,0, 'loken SAY_INTRO_2'), + (-1602018, 'Only mortal...', 14166,1,0, 'loken SAY_SLAY_1'), + (-1602019, 'I... am... FOREVER!', 14167,1,0, 'loken SAY_SLAY_2'), + (-1602020, 'What little time you had, you wasted!', 14168,1,0, 'loken SAY_SLAY_3'), + (-1602021, 'My death... heralds the end of this world.', 14172,1,0, 'loken SAY_DEATH'), + (-1602022, 'You cannot hide from fate!', 14163,1,0, 'lokenSAY_NOVA_1'), + (-1602023, 'Come closer. I will make it quick.', 14164,1,0, 'loken SAY_NOVA_2'), + (-1602024, 'Your flesh cannot hold out for long.', 14165,1,0, 'loken SAY_NOVA_3'), + (-1602025, 'You stare blindly into the abyss!', 14169,1,0, 'loken SAY_75HEALTH'), + (-1602026, 'Your ignorance is profound. Can you not see where this path leads?', 14170,1,0, 'loken SAY_50HEALTH'), + (-1602027, 'You cross the precipice of oblivion!', 14171,1,0, 'loken SAY_25HEALTH'), +-- Volkhan + (-1602028, 'It is you who have destroyed my children? You... shall... pay!',13960,1,0, 'volkhan SAY_AGGRO'), + (-1602029, 'The armies of iron will conquer all!',13965, 1,0,'volkhan SAY_SLAY_1'), + (-1602030, 'Ha, pathetic!',13966,1,0, 'volkhan SAY_SLAY_2'), + (-1602031, 'You have cost me too much work!',13967,1,0, 'volkhan SAY_SLAY_3'), + (-1602032, 'The master was right... to be concerned.',13968, 1,0,'volkhan SAY_DEATH'), + (-1602033, 'I will crush you beneath my boots!',13963, 1,0,'volkhan SAY_STOMP_1'), + (-1602034, 'All my work... undone!',13964, 1,0,'volkhan SAY_STOMP_2'), + (-1602035, 'Life from the lifelessness... death for you.',13961,1,0, 'volkhan SAY_FORGE_1'), + (-1602036, 'Nothing is wasted in the process. You will see....',13962, 1,0,'volkhan SAY_FORGE_2'); + +-- -1 603 000 ULDUAR (RAID NIU) + +-- -1 604 000 GUNDRAK +INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES +-- Gal'darah + (-1604000, 'I\'m gonna spil your guts, man!', 14430, 1,0,'gal_darah SAY_AGGRO'), + (-1604001, 'What a rush.', 14436,1,0, 'gal_darah SAY_SLAY_1'), + (-1604002, 'Who needs gods, when we ARE gods!', 14437, 1,0,'gal_darah SAY_SLAY_2'), + (-1604003, 'I told ya so ...', 14438,1,0, 'gal_darah SAY_SLAY_3'), + (-1604004, 'Even the mighty ... can .. fall.', 14439,1,0, 'gal_darah SAY_DEATH'), + (-1604005, 'God damn! Impale them!', 14433, 1,0,'gal_darah SAY_SUMMON_RHINO_1'), + (-1604006, 'Kill them ALL!', 14434, 1,0,'gal_darah SAY_SUMMON_RHINO_2'), + (-1604007, 'Say hello to my BIG friend.', 14435,1,0, 'gal_darah SAY_SUMMON_RHINO_3'), + (-1604008, 'Ain\'t gonna bee nothig left after this.', 14431,1,0, 'gal_darah SAY_TRANSFORM_1'), + (-1604009, 'You wanna see POWER? I\'m gonna show you POWER!', 14432,1,0, 'gal_darah SAY_TRANSFORM_2'), +-- Moorabi + (-1604010, 'We fought back the Scourge. What chance you be thinking you got?', 14721,1,0, 'moorabi SAY_AGGRO'), + (-1604011, 'I crush you, cockroaches!', 14725,1,0, 'moorabi SAY_SLAY_1'), + (-1604012, 'Who gonna stop me, you?', 14726,1,0, 'moorabi SAY_SLAY_2'), + (-1604013, 'Not so tough now.', 14727,1,0, 'moorabi SAY_SLAY_3'), + (-1604014, 'If our gods can die, then so can we.', 14728,1,0, 'moorabi SAY_DEATH'), + (-1604015, 'Get ready for something much bigger!', 14722,1,0, 'moorabi SAY_TRANSFORM'), + (-1604016, 'The ground will swallow you up!', 14723,1,0, 'moorabi SAY_QUAKE'), +-- Slad'ran + (-1604017, 'Drak\'thari gonna kill anybody who trespass on this lands.', 14443,1,0, 'slad_ran SAY_AGGRO'), + (-1604018, 'Can not breath then, good ...', 14446,1,0, 'slad_ran SAY_SLAY_1'), + (-1604019, 'You\'re scared now.', 14447,1,0, 'slad_ran SAY_SLAY_2'), + (-1604020, 'I eat you next man!', 14448,1,0, 'slad_ran SAY_SLAY_3'), + (-1604021, 'I ... see now. Scourge was not tha greatest enemy.', 14449,1,0, 'slad_ran SAY_DEATH'), + (-1604022, 'Minions of this ... heed my call.', 14444,1,0, 'slad_ran SAY_SUMMON_SNAKES'), + (-1604023, 'A thousand fangs gonna rim yar flesh.', 14445,1,0, 'slad_ran SAY_SUMMON_CONSTRICTORS'); + +-- -1 608 000 VIOLET HOLD +INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES +-- Cyanigosa + (-1608000, 'We finish this now, champions of Kirin Tor!', 13947, 1, 0, 'cyanigosa SAY_AGGRO'), + (-1608001, 'I will end the Kirin Tor!', 13952, 1, 0, 'cyanigosa SAY_SLAY_1'), + (-1608002, 'Dalaran will fall!', 13953, 1, 0, 'cyanigosa SAY_SLAY_2'), + (-1608003, 'So ends your defiance of the Spell-Weaver!', 13954, 1, 0, 'cyanigosa SAY_SLAY_3'), + (-1608004, 'Perhaps... we have... underestimated... you.', 13955, 1, 0, 'cyanigosa SAY_DEATH'), + (-1608005, 'A valiant defense, but this city must be razed. I will fulfill Malygos\'s wishes myself!', 13946, 1, 0, 'cyanigosa SAY_SPAWN'), + (-1608006, 'Am I interrupting?', 13951, 1, 0, 'cyanigosa SAY_DISRUPTION'), + (-1608007, 'Shiver and die!', 13948, 1, 0, 'cyanigosa SAY_BREATH_ATTACK'), + (-1608008, 'The world has forgotten what true magic is! Let this be a reminder!', 13949, 1, 0, 'cyanigosa SAY_SPECIAL_ATTACK_1'), + (-1608009, 'Who among you can withstand my power?', 13950, 1, 0, 'cyanigosa SAY_SPECIAL_ATTACK_2'), +-- Erekem + (-1608010, 'Notcawwget in way ofrrak-rrakflee!', 14219, 1, 0, 'erekem SAY_AGGRO'), + (-1608011, '...', 14222, 1, 0, 'erekem SAY_SLAY_1'), + (-1608012, 'Precious life ... wasted.', 14223, 1, 0, 'erekem SAY_SLAY_2'), + (-1608013, 'Only strong ... survive.', 14224, 1, 0, 'erekem SAY_SLAY_3'), + (-1608014, 'Nokaw, kawflee...', 14225, 1, 0, 'erekem SAY_DEATH'), + (-1608015, 'Free tommfly onw. Ra-aak... Not find usekh-ekh! Escape!', 14218, 1, 0, 'erekem SAY_SPAWN'), + (-1608016, 'My-raaakfavorite! Awk awk awk! Raa-kaa!', 14220, 1, 0, 'erekem SAY_ADD_KILLED'), + (-1608017, 'Nasty little...A-ak, kaw! Kill! Yes, kill you!', 14221, 1, 0, 'erekem SAY_BOTH_ADDS_KILLED'), +-- Ichoron + (-1608018, 'Stand aside, mortals!', 14230, 1, 0, 'ichoron SAY_AGGRO'), + (-1608019, 'I am a force of nature!', 14234, 1, 0, 'ichoron SAY_SLAY_1'), + (-1608020, 'I shall pass!', 14235, 1, 0, 'ichoron SAY_SLAY_2'), + (-1608021, 'You can not stop the tide!', 14236, 1, 0, 'ichoron SAY_SLAY_3'), + (-1608022, 'I... recede.', 14237, 1, 0, 'ichoron SAY_DEATH'), + (-1608023, 'I... am fury... unrestrained!', 14239, 1, 0, 'ichoron SAY_SPAWN'), + (-1608024, 'I shall consume, decimate, devastate, and destroy! Yield now to the wrath of the pounding sea!', 14231, 1, 0, 'ichoron SAY_ENRAGE'), + (-1608025, 'I will not be contained! Ngyah!!', 14233, 1, 0, 'ichoron SAY_SHATTER'), + (-1608026, 'Water can hold any form, take any shape... overcome any obstacle.', 14232, 1, 0, 'ichoron SAY_BUBBLE'), +-- Xevozz + (-1608027, 'It seems my freedom must be bought with blood...', 14499, 1, 0, 'xevozz SAY_AGGRO'), + (-1608028, 'Nothing personal.', 14504, 1, 0, 'xevozz SAY_SLAY_1'), + (-1608029, 'Business concluded.', 14505, 1, 0, 'xevozz SAY_SLAY_2'), + (-1608030, 'Profit!', 14506, 1, 0, 'xevozz SAY_SLAY_3'), + (-1608031, 'This is an... unrecoverable... loss.', 14507, 1, 0, 'xevozz SAY_DEATH'), + (-1608032, 'Back in business! Now to execute an exit strategy.', 14498, 1, 0, 'xevozz SAY_SPAWNED'), + (-1608033, 'It would seem that a renegotiation is in order.', 14503, 1, 0, 'xevozz SAY_CHARGED'), + (-1608034, 'The air teems with latent energy... quite the harvest!', 14501, 1, 0, 'xevozz SAY_REPEAT_SUMMON_1'), + (-1608035, 'Plentiful, exploitable resources... primed for acquisition!', 14502, 1, 0, 'xevozz SAY_REPEAT_SUMMON_2'), + (-1608036, 'Intriguing... a high quantity of arcane energy is near. Time for some prospecting...', 14500, 1, 0, 'xevozz SAY_SUMMON_ENERGY'), +-- Zuramat + (-1608037, 'Eradicate.', 13996, 1, 0, 'zuramat SAY_AGGRO'), + (-1608038, 'More... energy.', 13999, 1, 0, 'zuramat SAY_SLAY_1'), + (-1608039, 'Relinquish.', 14000, 1, 0, 'zuramat SAY_SLAY_2'), + (-1608040, 'Fall... to shadow.', 14001, 1, 0, 'zuramat SAY_SLAY_3'), + (-1608041, 'Disperse.', 14002, 1, 0, 'zuramat SAY_DEATH'), + (-1608042, 'I am... renewed.', 13995, 1, 0, 'zuramat SAY_SPAWN'), + (-1608043, 'Know... my... pain.', 13997, 1, 0, 'zuramat SAY_SHIELD'), + (-1608044, 'Gaze... into the void.', 13998, 1, 0, 'zuramat SAY_WHISPER'); + +-- -1 615 000 OBSIDIAN SANCTUM +INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES +-- Shadron + (-1615000, 'I fear nothing! Least of all you!', 14111,1,0, 'shadron SAY_SHADRON_AGGRO'), + (-1615001, 'You are insignificant!', 14112,1,0, 'shadron SAY_SHADRON_SLAY_1'), + (-1615002, 'Such mediocre resistance!', 14113,1,0, 'shadron SAY_SHADRON_SLAY_2'), + (-1615003, 'We...are superior! How could this...be...', 14118, 1,0,'shadron SAY_SHADRON_DEATH'), + (-1615004, 'You are easily bested! ', 14114,1,0, 'shadron SAY_SHADRON_BREATH'), + (-1615005, 'I will take pity on you Sartharion, just this once.', 14117, 1,0,'shadron SAY_SHADRON_RESPOND'), + (-1615006, 'Father tought me well!', 14115,1,0, 'shadron SAY_SHADRON_SPECIAL_1'), + (-1615007, 'On your knees!', 14116,1,0, 'shadron SAY_SHADRON_SPECIAL_2'), +-- Tenebron + (-1615008, 'You have no place here. Your place is among the departed.', 14122,1,0, 'tenebron SAY_TENEBRON_AGGRO'), + (-1615009, 'No contest.', 14123,1,0, 'tenebron SAY_TENEBRON_SLAY_1'), + (-1615010, 'Typical... Just as I was having fun.', 14124,1,0, 'tenebron SAY_TENEBRON_SLAY_2'), + (-1615011, 'I should not... have held back...', 14129,1,0, 'tenebron SAY_TENEBRON_DEATH'), + (-1615012, 'To darkness I condemn you...', 14125,1,0, 'tenebron SAY_TENEBRON_BREATH'), + (-1615013, 'It is amusing to watch you struggle. Very well, witness how it is done.', 14128, 1,0,'tenebron SAY_TENEBRON_RESPOND'), + (-1615014, 'Arrogant little creatures! To challenge powers you do not yet understand...', 14126,1,0, 'tenebron SAY_TENEBRON_SPECIAL_1'), + (-1615015, 'I am no mere dragon! You will find I am much, much, more...', 14127, 1,0,'tenebron SAY_TENEBRON_SPECIAL_2'), +-- Sartharion + (-1615016, 'It is my charge to watch over these eggs. I will see you burn before any harm comes to them!', 14093,1,0, 'sartharion SAY_SARTHARION_AGGRO'), + (-1615017, 'This pathetic siege ends NOW!', 14103,1,0, 'sartharion SAY_SARTHARION_BERSERK'), + (-1615018, 'Burn, you miserable wretches!', 14098, 1,0,'sartharion SAY_SARTHARION_BREATH'), + (-1615019, 'Shadron! Come to me, all is at risk!', 14105,1,0, 'sartharion SARTHARION_CALL_SHADRON'), + (-1615020, 'Tenebron! The eggs are yours to protect as well!', 14106,1,0, 'sartharion SAY_SARTHARION_CALL_TENEBRON'), + (-1615021, 'Vesperon! The clutch is in danger! Assist me!', 14104,1,0, 'sartharion SAY_SARTHARION_CALL_VESPERON'), + (-1615022, 'Such is the price... of failure...', 14107,1,0, 'sartharion SAY_SARTHARION_DEATH'), + (-1615023, 'Such flammable little insects....', 14099,1,0, 'sartharion SAY_SARTHARION_SPECIAL_1'), + (-1615024, 'Your charred bones will litter the floor!', 14100,1,0, 'sartharion SAY_SARTHARION_SPECIAL_2'), + (-1615025, 'How much heat can you take?', 14101,1,0, 'sartharion SAY_SARTHARION_SPECIAL_3'), + (-1615026, 'All will be reduced to ash!', 14102,1,0, 'sartharion SAY_SARTHARION_SPECIAL_4'), + (-1615027, 'You will make a fine meal for the hatchlings.', 14094,1,0, 'sartharion SAY_SARTHARION_SLAY_1'), + (-1615028, 'You are the grave disadvantage.', 14096,1,0, 'sartharion SAY_SARTHARION_SLAY_2'), + (-1615029, 'This is why we call you lesser beeings.', 14097,1,0, 'sartharion SAY_SARTHARION_SLAY_3'), +-- Vesperon + (-1615030, 'You pose no threat, lesser beings...give me your worst!', 14133, 1,0,'vesperon SAY_VESPERON_AGGRO'), + (-1615031, 'The least you could do is put up a fight...', 14134,1,0, 'vesperon SAY_VESPERON_SLAY_1'), + (-1615032, 'Was that the best you can do?', 14135,1,0, 'vesperon SAY_VESPERON_SLAY_2'), + (-1615033, 'I still have some...fight..in...me...', 14140, 1,0,'vesperon SAY_VESPERON_DEATH'), + (-1615034, 'I will pick my teeth with your bones!', 14136,1,0, 'vesperon SAY_VESPERON_BREATH'), + (-1615035, 'Father was right about you, Sartharion...You are a weakling!', 14139,1,0, 'vesperon SAY_VESPERON_RESPOND'), + (-1615036, 'Aren\'t you tricky...I have a few tricks of my own...', 14137,1,0, 'vesperon SAY_VESPERON_SPECIAL_1'), + (-1615037, 'Unlike, I have many talents.', 14138,1,0, 'vesperon SAY_VESPERON_SPECIAL_2'); + +-- -1 616 000 EYE OF ETERNITY +INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES +-- Malygos + (-1616000, 'I will teach you IGNORANT children just how little you know of magic...', 14524,1,0, 'malygos SAY_ANTI_MAGIC_SHELL'), + (-1616001, 'YOU WILL NOT SUCCEED WHILE I DRAW BREATH!', 14518,1,0, 'malygos SAY_BREATH_ATTACK'), + (-1616002, 'I AM UNSTOPPABLE!', 14533,1,0, 'malygos SAY_HIGH_DAMAGE_MODE'), + (-1616003, 'Watch helplessly as your hopes are swept away...', 14525, 1,0,'malygos SAY_MAGIC_BLAST'), + (-1616004, 'Still standing? Not for long...', 14537, 1,0,'malygos SAY_GENERIC_SPELL_1'), + (-1616005, 'Your cause is lost!', 14538, 1,0,'malygos SAY_GENERIC_SPELL_2'), + (-1616006, 'Your fragile mind will be shattered! ', 14539,1,0, 'malygos SAY_GENERIC_SPELL_3'), + (-1616007, 'UNTHINKABLE! The mortals will destroy...e-everything...my sister...what have you-', 14540,1,0, 'malygos SAY_DEATH'), + (-1616008, 'Lesser beings, intruding here! A shame that your excess courage does not compensate for your stupidity!', 14512,1,0, 'malygos SAY_PREFIGHT_1'), + (-1616009, 'None but the blue dragonflight are welcome here! Perhaps this is the work of Alexstrasza? Well then, she has sent you to your deaths.', 14513,1,0, 'malygos SAY_PREFIGHT_2'), + (-1616010, 'What could you hope to accomplish, to storm brassily into my domain? To employ MAGIC? Against ME? *Laughs*', 14514,1,0, 'malygos SAY_PREFIGHT_3'), + (-1616011, 'I am without limits here...the rules of your cherished reality do not apply...In this realm, I am in control...', 14515, 1,0,'malygos SAY_PREFIGHT_4'), + (-1616012, 'I give you one chance. Pledge loyalty to me, and perhaps I won\'t slaughter you for your insolence!', 14516,1,0, 'malygos SAY_PREFIGHT_5'), + (-1616013, 'My patience has reached its limit, I WILL BE RID OF YOU!', 14517,1,0, 'malygos SAY_PHASE1_AGGRO'), + (-1616014, 'I had hoped to end your lives quickly, but you have proven more...resilient then I had anticipated. None the less, your efforts are in vain, it is you reckless, careless mortals who are to blame for this war! I do what I must...And if it means your...extinction...THEN SO BE IT!', 14522,1,0, 'malygos SAY_PHASE1_END'), + (-1616015, 'Your stupidity has finally caught up to you!', 14519,1,0, 'malygos SAY_PHASE1_SLAY_1'), + (-1616016, 'More artifacts to confiscate...', 14520, 1,0,'malygos SAY_PHASE1_SLAY_2'), + (-1616017, '*Laughs* How very...naive.. ', 14521,1,0, 'malygos SAY_PHASE1_SLAY_3'), + (-1616018, 'Few have experienced the pain I will now inflict on you!', 14523, 1,0,'malygos SAY_PHASE2_AGGRO'), + (-1616019, 'ENOUGH! If you intend to reclaim Azeroth\'s magic, then you shall have it... ', 14529,1,0, 'malygos SAY_PHASE2_END'), + (-1616020, 'Your energy will be put to good use!', 14526,1,0, 'malygos SAY_PHASE2_SLAY_1'), + (-1616021, 'I AM THE SPELL WEAVER! My power is INFINITE!', 14527, 1,0,'malygos SAY_PHASE2_SLAY_2'), + (-1616022, 'Your spirit will linger here forever!', 14528, 1,0,'malygos SAY_PHASE2_SLAY_3'), + (-1616023, 'Now your benefactors make their appearance...But they are too late. The powers contained here are powerful enough to destroy the world ten times over! What do you think they will do to you?', 14530,1,0, 'malygos SAY_PHASE3_INTRO'), + (-1616024, 'SUBMIT!', 14531,1,0, 'malygos SAY_PHASE3_AGGRO'), + (-1616025, 'Alexstrasza! Another of your brood falls!', 14534,1,0, 'malygos SAY_PHASE3_SLAY_1'), + (-1616026, 'Little more then gnats!', 14535, 1,0,'malygos SAY_PHASE3_SLAY_2'), + (-1616027, 'Your red allies will share your fate...', 14536, 1,0,'slad_ran SAY_PHASE3_SLAY_3'), + (-1616028, 'The powers at work here exceed anything you could possibly imagine!', 14532, 1,0,'malygos SAY_PHASE3_BIG_ATTACK'); + +-- -1 619 000 AHN'KAHET + INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES +-- Jedoga Shadowseeker + (-1619000, 'These are sacred halls, your intrusion will be met with death', 14343, 1, 0, 'jedoga SAY_AGGRO'), + (-1619001, 'Who among you is devoted', 14344, 1, 0, 'jedoga SAY_C_SACRIFICE_1'), + (-1619002, 'You there! Step foward', 14345, 1, 0, 'jedoga SAY_C_SACRIFICE_2'), + (-1619003, 'Yogg-Saron, grant me your power!', 14346, 1, 0, 'jedoga SAY_SACRIFICE_1'), + (-1619004, 'Master, a gift for you!', 14347, 1, 0, 'jedoga SAY_SACRIFICE_2'), + (-1619005, 'Glory to the Yogg-Saron!', 14348, 1, 0, 'jedoga SAY_SLAY_1'), + (-1619006, 'You are unworthy', 14349, 1, 0, 'jedoga SAY_SLAY_2'), + (-1619007, 'Get up! You haven\'t suffered enough', 14350, 1, 0, 'jedoga SAY_SLAY_3'), + (-1619008, 'Do not expect your sacrilege... to go unpunished.', 14351, 1, 0, 'jedoga SAY_DEATH'), + (-1619009, 'The elements themselves will rise up against the civilized world! Only the faithful will be spared!', 14352, 1, 0, 'jedoga SAY_PREACHING_1'), + (-1619010, 'Immortality can be yours. But only if you pledge yourself fully to Yogg-Saron!', 14353, 1, 0, 'jedoga SAY_PREACHING_2'), + (-1619011, 'Here on the very borders of his domain. You will expirience powers you would never have imagined!', 14354, 1, 0, 'jedoga SAY_PREACHING_3'), + (-1619012, 'You have traveled long and risked much to be here. Your devotion shall be rewarded.', 14355, 1, 0, 'jedoga SAY_PREACHING_4'), + (-1619013, 'The faithful shall be exalted! But there is more work to be done. We will press on until all of Azeroth lies beneath his shadow!', 14356, 1, 0, 'jedoga SAY_PREACHING_5'), +-- Elder Nadox + (-1619014, 'The secrets of the deep shall remain hidden.', 14033, 1, 0, 'nadox SAY_AGGRO'), + (-1619015, 'Sleep now, in the cold dark.', 14036, 1, 0, 'nadox SAY_SLAY_1'), + (-1619016, 'For the Lich King!', 14307, 1, 0, 'nadox SAY_SLAY_2'), + (-1619017, 'Perhaps we will be allies soon.', 14038, 1, 0, 'nadox SAY_SLAY_3'), + (-1619018, 'Master, is my service complete?', 14039, 1, 0, 'nadox SAY_DEATH'), + (-1619019, 'The young must not grow hungry.', 14034, 1, 0, 'nadox SAY_EGG_SAC_1'), + (-1619020, 'Shad\'ak kerish\'akak', 14035, 1, 0, 'nadox SAY_EGG_SAC_2'), +-- Prince Taldaram + (-1619021, 'I will feast on your remains.', 14360, 1, 0, 'taldaram SAY_AGGRO'), + (-1619022, '(Elfish)', 14365, 1, 0, 'taldaram SAY_SLAY_1'), + (-1619023, 'I will drink no blood before it is time.', 14366, 1, 0, 'taldaram SAY_SLAY_2'), + (-1619024, 'One final embrace.', 14367, 1, 0, 'taldaram SAY_SLAY_3'), + (-1619025, 'Still ... I hunger, still ... I thirst...', 14368, 1, 0, 'taldaram SAY_DEATH'), + (-1619026, 'Your heartbeat is music to my ears.', 14361, 1, 0, 'taldaram SAY_VANISH_1'), + (-1619027, 'I am nowhere. I am everywhere. I am the watcher, unseen.', 14362, 1, 0, 'taldaram SAY_VANISH_2'), + (-1619028, 'So appetizing.', 14363, 1, 0, 'taldaram SAY_FEED_1'), + (-1619029, 'Fresh, warm blood. It has been too long.', 14364, 1, 0, 'taldaram SAY_FEED_2'), +-- Herald Volazj + (-1619030, '??? ??? ???', 14043, 1, 0, 'volazj SAY_AGGRO'), + (-1619031, 'Ywaq ma phgwa\\\'cul hnakf. - They are the whisper on the shivering wind.', 14045, 1, 0, 'volazj SAY_AGGRO'), + (-1619032, '?!? !?! ?!?', 14046, 1, 0, 'volazj SAY_AGGRO'), + (-1619033, '!?! !?! !?!', 14047, 1, 0, 'volazj SAY_AGGRO'), + (-1619034, 'Iilth vwah, uhn\'agth fhssh za. - Where one falls, many shall take its place.', 14048, 1, 0, 'volazj SAY_AGGRO'), + (-1619035, '... ...! ...?', 14049, 1, 0, 'volazj SAY_AGGRO'), + (-1619036, 'Phasing', 14044, 1, 0, 'volazj SAY_AGGRO'); diff --git a/src/bindings/scripts/sql/WotLK/wotlk_bosses.sql b/src/bindings/scripts/sql/WotLK/wotlk_bosses.sql new file mode 100644 index 00000000000..c58ba8dd606 --- /dev/null +++ b/src/bindings/scripts/sql/WotLK/wotlk_bosses.sql @@ -0,0 +1,128 @@ +/* */ +/* AZJOL-NERUB */ +/* */ + +/* AHN'KAHET */ +UPDATE `instance_template` SET `script`='instance_ahn_kahet' WHERE `map`=4494; +UPDATE `creature_template` SET `ScriptName`='boss_jedoga' WHERE `entry`='29310'; +UPDATE `creature_template` SET `ScriptName`='boss_nadox' WHERE `entry`='29309'; +UPDATE `creature_template` SET `ScriptName`='boss_taldaram' WHERE `entry`='29308'; +UPDATE `creature_template` SET `ScriptName`='boss_volazj' WHERE `entry`='29311'; + +/* AZJOL-NERUB */ +UPDATE `instance_template` SET `script`='instance_azjol_nerub' WHERE `map`=3477; +UPDATE `creature_template` SET `ScriptName`='boss_anub_arak' WHERE `entry`='29120'; +UPDATE `creature_template` SET `ScriptName`='boss_hardronox' WHERE `entry`='28921'; +UPDATE `creature_template` SET `ScriptName`='boss_krik_thir' WHERE `entry`='28684'; + +/* THE CULLING OF STRATHOLME */ +UPDATE `instance_template` SET `script`='instance_culling_of_stratholme' WHERE `map`=4100; +UPDATE `creature_template` SET `ScriptName`='boss_epoch' WHERE `entry`='26532'; +UPDATE `creature_template` SET `ScriptName`='boss_mal_ganis' WHERE `entry`='26533'; +UPDATE `creature_template` SET `ScriptName`='boss_meathook' WHERE `entry`='26529'; +UPDATE `creature_template` SET `ScriptName`='boss_salramm' WHERE `entry`='26530'; + +/* DRAK'THARON KEEP */ +UPDATE `instance_template` SET `script`='instance_drak_tharon' WHERE `map`=4196; +UPDATE `creature_template` SET `ScriptName`='boss_dred' WHERE `entry`='27483'; +UPDATE `creature_template` SET `ScriptName`='boss_novos' WHERE `entry`='26631'; +UPDATE `creature_template` SET `ScriptName`='boss_tharon_ja' WHERE `entry`='26632'; +UPDATE `creature_template` SET `ScriptName`='boss_trollgore' WHERE `entry`='26630'; + +/* GUNDRAK */ +UPDATE `instance_template` SET `script`='instance_gundrak' WHERE `map` =4375; +UPDATE `creature_template` SET `ScriptName`='boss_eck' WHERE `entry`='29932'; +UPDATE `creature_template` SET `ScriptName`='boss_drakkari_colossus' WHERE `entry`='29307'; +UPDATE `creature_template` SET `ScriptName`='boss_gal_darah' WHERE `entry`='29306'; +UPDATE `creature_template` SET `ScriptName`='boss_moorabi' WHERE `entry`='29305'; +UPDATE `creature_template` SET `ScriptName`='boss_slad_ran' WHERE `entry`='29304'; + +/* */ +/* THE NEXUS */ +/* */ + +/* EYE OF ETERNITY */ +UPDATE `instance_template` SET `script`='instance_eye_of_eternity' WHERE `map`=4500; +UPDATE `creature_template` SET `ScriptName`='boss_malygos' WHERE `entry`='28859'; + +/* NEXUS */ +UPDATE `instance_template` SET `script`='instance_nexus' WHERE `map`=4120; +UPDATE `creature_template` SET `ScriptName`='boss_anomalus' WHERE `entry`='26763'; +UPDATE `creature_template` SET `ScriptName`='npc_chaotic_rift' WHERE `entry`='26918'; +UPDATE `creature_template` SET `ScriptName`='mob_crazed_mana_wraith' WHERE `entry`='26746'; +UPDATE `creature_template` SET `ScriptName`='boss_keristrasza' WHERE `entry`='26723'; +UPDATE `creature_template` SET `ScriptName`='boss_magus_telestra' WHERE `entry`='26731'; +UPDATE `creature_template` SET `ScriptName`='boss_ormorok' WHERE `entry`='26794'; +UPDATE `creature_template` SET `ScriptName`='boss_commander_stoutbeard' WHERE `entry`='26796'; +UPDATE `creature_template` SET `ScriptName`='boss_commander_kolurg' WHERE `entry`='26798'; + +/* OCULUS */ +UPDATE `instance_template` SET `script`='instance_oculus' WHERE `map`=4228; +UPDATE `creature_template` SET `ScriptName`='boss_drakos' WHERE `entry`='27654'; +UPDATE `creature_template` SET `ScriptName`='boss_eregos' WHERE `entry`='27656'; +UPDATE `creature_template` SET `ScriptName`='boss_urom' WHERE `entry`='27655'; +UPDATE `creature_template` SET `ScriptName`='boss_varos' WHERE `entry`='27447'; + +/* OBSIDIAN SANCTUM */ +UPDATE `instance_template` SET `script`='instance_obsidian_sanctum' WHERE `map`=4493; +UPDATE `creature_template` SET `ScriptName`='boss_sartharion' WHERE `entry`='28860'; +UPDATE `creature_template` SET `ScriptName`='mob_vesperon' WHERE `entry`='30449'; +UPDATE `creature_template` SET `ScriptName`='mob_shadron' WHERE `entry`='30451'; +UPDATE `creature_template` SET `ScriptName`='mob_tenebron' WHERE `entry`='30452'; +UPDATE `creature_template` SET `ScriptName`='mob_whelp' WHERE `entry`='30890'; +UPDATE `creature_template` SET `ScriptName`='mob_whelp' WHERE `entry`='31214'; + +/* */ +/* ULDUAR */ +/* */ + +/* HALLS OF LIGHTNING */ +UPDATE `instance_template` SET `script`='instance_halls_of_lightning' WHERE `map`=4272; +UPDATE `creature_template` SET `ScriptName`='boss_bjarngrim' WHERE `entry`='28586'; +UPDATE `creature_template` SET `ScriptName`='boss_ionar' WHERE `entry`='28546'; +UPDATE `creature_template` SET `ScriptName`='spark_of_ionar' WHERE `entry`='28962'; +UPDATE `creature_template` SET `ScriptName`='boss_volkhan' WHERE `entry`='28587'; +UPDATE `creature_template` SET `ScriptName`='mob_molten_golem' WHERE `entry`='28695'; +UPDATE `creature_template` SET `ScriptName`='boss_loken' WHERE `entry`='28923'; +/* HALLS OF STONE */ +UPDATE `instance_template` SET `script`='instance_halls_of_stone' WHERE `map`=4264; +UPDATE `creature_template` SET `ScriptName`='boss_krystallus' WHERE `entry`='27977'; +UPDATE `creature_template` SET `ScriptName`='boss_maiden_of_grief' WHERE `entry`='27975'; +UPDATE `creature_template` SET `ScriptName`='boss_sjonnir' WHERE `entry`='27978'; + +/* */ +/* UTGARDE KEEP */ +/* */ + +/* UTGARDE KEEP */ +UPDATE `instance_template` SET `script`='instance_utgarde_keep' WHERE `map`=206; +UPDATE `creature_template` SET `ScriptName`='boss_dalronn_the_controller' WHERE `entry`='24201'; +UPDATE `creature_template` SET `ScriptName`='boss_ingvar_the_plunderer' WHERE `entry`='23954'; +UPDATE `creature_template` SET `ScriptName`='mob_annhylde_the_caller' WHERE `entry`=24068; +UPDATE `creature_template` SET `ScriptName`='mob_ingvar_throw_dummy' WHERE `entry`=23997; +UPDATE `creature_template` SET `ScriptName`='boss_keleseth' WHERE `entry`='23953'; +UPDATE `creature_template` SET `scriptname` = 'mob_frost_tomb' WHERE `entry` = '23965'; +UPDATE `creature_template` SET `ScriptName`='mob_vrykul_skeleton' WHERE `entry`=23970; +UPDATE `creature_template` SET `ScriptName`='boss_skarvald_the_constructor' WHERE `entry`='24200'; + +/* UTGARDE PINNACLE */ +UPDATE `instance_template` SET `script`='instance_pinnacle' WHERE `map`=1196; +UPDATE `creature_template` SET `ScriptName`='boss_palehoof' WHERE `entry`='26687'; +UPDATE `creature_template` SET `ScriptName`='boss_skadi' WHERE `entry`='26693'; +UPDATE `creature_template` SET `ScriptName`='boss_svala' WHERE `entry`='26668'; +UPDATE `creature_template` SET `ScriptName`='boss_ymiron' WHERE `entry`='26861'; + +/* VAULT OF ARCHAVON */ +UPDATE `instance_template` SET `script`='instance_archavon' WHERE `map`=4603; +UPDATE `creature_template` SET `ScriptName`='boss_archavon' WHERE `entry`='31125'; +UPDATE `creature_template` SET `ScriptName`='mob_archavon_warder' WHERE `entry`='32353'; + +/* VIOLET HOLD */ +UPDATE `instance_template` SET `script`='instance_violet_hold' WHERE `map`=4415; +UPDATE `creature_template` SET `ScriptName`='boss_cyanigosa' WHERE `entry`='31134'; +UPDATE `creature_template` SET `ScriptName`='boss_erekem' WHERE `entry`='29315'; +UPDATE `creature_template` SET `ScriptName`='boss_ichoron' WHERE `entry`='29313'; +UPDATE `creature_template` SET `ScriptName`='boss_lavanthor' WHERE `entry`='29312'; +UPDATE `creature_template` SET `ScriptName`='boss_moragg' WHERE `entry`='29316'; +UPDATE `creature_template` SET `ScriptName`='boss_xevozz' WHERE `entry`='29266'; +UPDATE `creature_template` SET `ScriptName`='boss_zuramat' WHERE `entry`='29314'; diff --git a/src/bindings/scripts/system.cpp b/src/bindings/scripts/system.cpp index 893e476e2fd..ab62e530681 100644 --- a/src/bindings/scripts/system.cpp +++ b/src/bindings/scripts/system.cpp @@ -1,7 +1,7 @@ /* - * Copyright (C) 2008 Trinity <http://www.trinitycore.org/> + * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/> * - * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/> + * Thanks to the original authors: MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by |
